diff --git a/apigrpc/apigrpc.pb.go b/apigrpc/apigrpc.pb.go index b0ba321619..b52e5e120a 100644 --- a/apigrpc/apigrpc.pb.go +++ b/apigrpc/apigrpc.pb.go @@ -663,14 +663,14 @@ var file_apigrpc_proto_rawDesc = []byte{ 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5a, 0x28, 0x22, 0x1e, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, - 0x3a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0xa7, 0x03, 0x0a, 0x19, 0x63, 0x6f, 0x6d, + 0x3a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0xba, 0x03, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2e, 0x6e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0d, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x41, 0x70, 0x69, 0x47, 0x72, 0x70, 0x63, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x67, 0x72, 0x70, 0x63, 0xaa, 0x02, 0x0f, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x92, 0x41, 0xbc, 0x02, 0x12, 0x75, 0x0a, 0x0d, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, + 0x75, 0x66, 0x92, 0x41, 0xcf, 0x02, 0x12, 0x75, 0x0a, 0x0d, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x20, 0x41, 0x50, 0x49, 0x20, 0x76, 0x32, 0x22, 0x5f, 0x0a, 0x21, 0x54, 0x68, 0x65, 0x20, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x20, 0x26, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x24, 0x68, 0x74, @@ -681,16 +681,17 @@ var file_apigrpc_proto_rawDesc = []byte{ 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x37, 0x33, 0x35, 0x30, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x3f, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x65, 0x61, 0x72, 0x65, - 0x72, 0x4a, 0x77, 0x74, 0x12, 0x00, 0x0a, 0x1d, 0x0a, 0x0b, 0x48, 0x74, 0x74, 0x70, 0x4b, 0x65, - 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0e, 0x08, 0x02, 0x1a, 0x08, 0x68, 0x74, 0x74, 0x70, 0x5f, - 0x6b, 0x65, 0x79, 0x20, 0x02, 0x62, 0x0f, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x65, 0x61, 0x72, 0x65, - 0x72, 0x4a, 0x77, 0x74, 0x12, 0x00, 0x72, 0x3a, 0x0a, 0x1b, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, - 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x68, - 0x65, 0x72, 0x6f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, - 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x52, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, + 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x0a, 0x20, 0x0a, 0x09, 0x42, 0x65, 0x61, 0x72, 0x65, + 0x72, 0x4a, 0x77, 0x74, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x0a, 0x1d, 0x0a, 0x0b, 0x48, 0x74, 0x74, + 0x70, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0e, 0x08, 0x02, 0x1a, 0x08, 0x68, 0x74, + 0x74, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x20, 0x02, 0x62, 0x0f, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x65, + 0x61, 0x72, 0x65, 0x72, 0x4a, 0x77, 0x74, 0x12, 0x00, 0x72, 0x3a, 0x0a, 0x1b, 0x4e, 0x61, 0x6b, + 0x61, 0x6d, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_apigrpc_proto_goTypes = []interface{}{ diff --git a/apigrpc/apigrpc.proto b/apigrpc/apigrpc.proto index d6632d9160..b8ed586923 100644 --- a/apigrpc/apigrpc.proto +++ b/apigrpc/apigrpc.proto @@ -58,10 +58,11 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } } security: { - // Made up security so we can apply "Bearer " - key: "BearerJwt"; + key: "BearerJwt" value: { - type: TYPE_INVALID; + type: TYPE_API_KEY + in: IN_HEADER + name: "Authorization" } } security: { diff --git a/apigrpc/apigrpc.swagger.json b/apigrpc/apigrpc.swagger.json index 3533d3d3d6..aac4c46586 100644 --- a/apigrpc/apigrpc.swagger.json +++ b/apigrpc/apigrpc.swagger.json @@ -5225,7 +5225,9 @@ "type": "basic" }, "BearerJwt": { - "type": "" + "type": "apiKey", + "name": "Authorization", + "in": "header" }, "HttpKeyAuth": { "type": "apiKey", diff --git a/console/console.pb.go b/console/console.pb.go index 6a772b1900..9c8dd54c1b 100644 --- a/console/console.pb.go +++ b/console/console.pb.go @@ -5324,9 +5324,9 @@ var file_console_proto_rawDesc = []byte{ 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x7b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, - 0x42, 0xda, 0x02, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x42, 0xed, 0x02, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6e, 0x61, 0x6b, 0x61, 0x6d, - 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x92, 0x41, 0xad, 0x02, + 0x61, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x92, 0x41, 0xc0, 0x02, 0x12, 0x7d, 0x0a, 0x15, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x41, 0x50, 0x49, 0x20, 0x76, 0x32, 0x22, 0x5f, 0x0a, 0x21, 0x54, 0x68, 0x65, 0x20, 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x20, @@ -5338,15 +5338,16 @@ var file_console_proto_rawDesc = []byte{ 0x0e, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x3a, 0x37, 0x33, 0x35, 0x31, 0x2a, 0x01, 0x01, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x20, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, - 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x4a, 0x77, 0x74, 0x12, 0x00, 0x62, 0x0f, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x65, - 0x61, 0x72, 0x65, 0x72, 0x4a, 0x77, 0x74, 0x12, 0x00, 0x72, 0x42, 0x0a, 0x23, 0x4e, 0x61, 0x6b, - 0x61, 0x6d, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, - 0x6c, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x5a, 0x33, 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, + 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x0a, 0x20, 0x0a, 0x09, 0x42, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x4a, 0x77, 0x74, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x62, 0x0f, 0x0a, 0x0d, 0x0a, + 0x09, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x4a, 0x77, 0x74, 0x12, 0x00, 0x72, 0x42, 0x0a, 0x23, + 0x4e, 0x61, 0x6b, 0x61, 0x6d, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x68, 0x65, 0x72, + 0x6f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/console/console.proto b/console/console.proto index 6863d5b2cd..c8ddcba63d 100644 --- a/console/console.proto +++ b/console/console.proto @@ -55,9 +55,12 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { } } security: { - // Made up security so we can apply "Bearer " - key: "BearerJwt"; - value: {}; + key: "BearerJwt" + value: { + type: TYPE_API_KEY + in: IN_HEADER + name: "Authorization" + } } } // Default security definition. diff --git a/console/console.swagger.json b/console/console.swagger.json index 31aca7eafc..58bcaa7933 100644 --- a/console/console.swagger.json +++ b/console/console.swagger.json @@ -4063,7 +4063,9 @@ "type": "basic" }, "BearerJwt": { - "type": "" + "type": "apiKey", + "name": "Authorization", + "in": "header" } }, "security": [ diff --git a/console/ui/dist/prod-nt/index.html b/console/ui/dist/prod-nt/index.html index 67efdab132..b9cb5cf508 100644 --- a/console/ui/dist/prod-nt/index.html +++ b/console/ui/dist/prod-nt/index.html @@ -10,5 +10,5 @@ - + diff --git a/console/ui/dist/prod-nt/static/main.8e218c242568953c057c.js b/console/ui/dist/prod-nt/static/main.6c39b14c019905e4d727.js similarity index 97% rename from console/ui/dist/prod-nt/static/main.8e218c242568953c057c.js rename to console/ui/dist/prod-nt/static/main.6c39b14c019905e4d727.js index 0e58ef49f9..98be136d3a 100644 --- a/console/ui/dist/prod-nt/static/main.8e218c242568953c057c.js +++ b/console/ui/dist/prod-nt/static/main.6c39b14c019905e4d727.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+U4B":function(t,e,n){var i;i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=t,n.c=e,n.p="",n(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),s=n(8),o=n(15);function a(t,e,n){var o=null,a=function(t,e){n&&n(t,e),o&&o.visit(t,e)},l="function"==typeof n?a:null,c=!1;if(e){var h="boolean"==typeof e.attachComment&&e.attachComment;((c="boolean"==typeof e.comment&&e.comment)||h)&&((o=new i.CommentHandler).attach=h,e.comment=!0,l=a)}var u,d=!1;e&&"string"==typeof e.sourceType&&(d="module"===e.sourceType),u=e&&"boolean"==typeof e.jsx&&e.jsx?new r.JSXParser(t,e,l):new s.Parser(t,e,l);var p=d?u.parseModule():u.parseScript();return c&&o&&(p.comments=o.comments),u.config.tokens&&(p.tokens=u.tokens),u.config.tolerant&&(p.errors=u.errorHandler.errors),p}e.parse=a,e.parseModule=function(t,e,n){var i=e||{};return i.sourceType="module",a(t,i,n)},e.parseScript=function(t,e,n){var i=e||{};return i.sourceType="script",a(t,i,n)},e.tokenize=function(t,e,n){var i,r=new o.Tokenizer(t,e);i=[];try{for(;;){var s=r.getNextToken();if(!s)break;n&&(s=n(s)),i.push(s)}}catch(a){r.errorHandler.tolerate(a)}return r.errorHandler.tolerant&&(i.errors=r.errors()),i};var l=n(2);e.Syntax=l.Syntax,e.version="4.0.1"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r=function(){function t(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return t.prototype.insertInnerComments=function(t,e){if(t.type===i.Syntax.BlockStatement&&0===t.body.length){for(var n=[],r=this.leading.length-1;r>=0;--r){var s=this.leading[r];e.end.offset>=s.start&&(n.unshift(s.comment),this.leading.splice(r,1),this.trailing.splice(r,1))}n.length&&(t.innerComments=n)}},t.prototype.findTrailingComments=function(t){var e=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var i=this.trailing[n];i.start>=t.end.offset&&e.unshift(i.comment)}return this.trailing.length=0,e}var r=this.stack[this.stack.length-1];if(r&&r.node.trailingComments){var s=r.node.trailingComments[0];s&&s.range[0]>=t.end.offset&&(e=r.node.trailingComments,delete r.node.trailingComments)}return e},t.prototype.findLeadingComments=function(t){for(var e,n=[];this.stack.length>0&&(s=this.stack[this.stack.length-1])&&s.start>=t.start.offset;)e=s.node,this.stack.pop();if(e){for(var i=(e.leadingComments?e.leadingComments.length:0)-1;i>=0;--i){var r=e.leadingComments[i];r.range[1]<=t.start.offset&&(n.unshift(r),e.leadingComments.splice(i,1))}return e.leadingComments&&0===e.leadingComments.length&&delete e.leadingComments,n}for(i=this.leading.length-1;i>=0;--i){var s;(s=this.leading[i]).start<=t.start.offset&&(n.unshift(s.comment),this.leading.splice(i,1))}return n},t.prototype.visitNode=function(t,e){if(!(t.type===i.Syntax.Program&&t.body.length>0)){this.insertInnerComments(t,e);var n=this.findTrailingComments(e),r=this.findLeadingComments(e);r.length>0&&(t.leadingComments=r),n.length>0&&(t.trailingComments=n),this.stack.push({node:t,start:e.start.offset})}},t.prototype.visitComment=function(t,e){var n="L"===t.type[0]?"Line":"Block",i={type:n,value:t.value};if(t.range&&(i.range=t.range),t.loc&&(i.loc=t.loc),this.comments.push(i),this.attach){var r={comment:{type:n,value:t.value,range:[e.start.offset,e.end.offset]},start:e.start.offset};t.loc&&(r.comment.loc=t.loc),t.type=n,this.leading.push(r),this.trailing.push(r)}},t.prototype.visit=function(t,e){"LineComment"===t.type||"BlockComment"===t.type?this.visitComment(t,e):this.attach&&this.visitNode(t,e)},t}();e.CommentHandler=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=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])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=n(4),o=n(5),a=n(6),l=n(7),c=n(8),h=n(13),u=n(14);function d(t){var e;switch(t.type){case a.JSXSyntax.JSXIdentifier:e=t.name;break;case a.JSXSyntax.JSXNamespacedName:var n=t;e=d(n.namespace)+":"+d(n.name);break;case a.JSXSyntax.JSXMemberExpression:var i=t;e=d(i.object)+"."+d(i.property)}return e}h.TokenName[100]="JSXIdentifier",h.TokenName[101]="JSXText";var p=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return r(e,t),e.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},e.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},e.prototype.finishJSX=function(){this.nextToken()},e.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},e.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.scanXHTMLEntity=function(t){for(var e="&",n=!0,i=!1,r=!1,o=!1;!this.scanner.eof()&&n&&!i;){var a=this.scanner.source[this.scanner.index];if(a===t)break;if(i=";"===a,e+=a,++this.scanner.index,!i)switch(e.length){case 2:r="#"===a;break;case 3:r&&(n=(o="x"===a)||s.Character.isDecimalDigit(a.charCodeAt(0)),r=r&&!o);break;default:n=(n=n&&!(r&&!s.Character.isDecimalDigit(a.charCodeAt(0))))&&!(o&&!s.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&i&&e.length>2){var l=e.substr(1,e.length-2);r&&l.length>1?e=String.fromCharCode(parseInt(l.substr(1),10)):o&&l.length>2?e=String.fromCharCode(parseInt("0"+l.substr(1),16)):r||o||!u.XHTMLEntities[l]||(e=u.XHTMLEntities[l])}return e},e.prototype.lexJSX=function(){var t=this.scanner.source.charCodeAt(this.scanner.index);if(60===t||62===t||47===t||58===t||61===t||123===t||125===t)return{type:7,value:r=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===t||39===t){for(var e=this.scanner.index,n=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==n;)i+="&"===l?this.scanXHTMLEntity(n):l;return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(46===t){var r,o=this.scanner.source.charCodeAt(this.scanner.index+1),a=this.scanner.source.charCodeAt(this.scanner.index+2);return e=this.scanner.index,this.scanner.index+=(r=46===o&&46===a?"...":".").length,{type:7,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(96===t)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(t)&&92!==t){for(e=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(e,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}return this.scanner.lex()},e.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var t=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(t)),t},e.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var t=this.scanner.index,e="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,e+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var i={type:101,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index};return e.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(i)),i},e.prototype.peekJSXToken=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.lexJSX();return this.scanner.restoreState(t),e},e.prototype.expectJSX=function(t){var e=this.nextJSXToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},e.prototype.matchJSX=function(t){var e=this.peekJSXToken();return 7===e.type&&e.value===t},e.prototype.parseJSXIdentifier=function(){var t=this.createJSXNode(),e=this.nextJSXToken();return 100!==e.type&&this.throwUnexpectedToken(e),this.finalize(t,new o.JSXIdentifier(e.value))},e.prototype.parseJSXElementName=function(){var t=this.createJSXNode(),e=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=e;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(n,i))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var r=e;this.expectJSX(".");var s=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXMemberExpression(r,s))}return e},e.prototype.parseJSXAttributeName=function(){var t,e=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var i=n;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(i,r))}else t=n;return t},e.prototype.parseJSXStringLiteralAttribute=function(){var t=this.createJSXNode(),e=this.nextJSXToken();8!==e.type&&this.throwUnexpectedToken(e);var n=this.getTokenRaw(e);return this.finalize(t,new l.Literal(e.value,n))},e.prototype.parseJSXExpressionAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXExpressionContainer(e))},e.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},e.prototype.parseJSXNameValueAttribute=function(){var t=this.createJSXNode(),e=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(t,new o.JSXAttribute(e,n))},e.prototype.parseJSXSpreadAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXSpreadAttribute(e))},e.prototype.parseJSXAttributes=function(){for(var t=[];!this.matchJSX("/")&&!this.matchJSX(">");){var e=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();t.push(e)}return t},e.prototype.parseJSXOpeningElement=function(){var t=this.createJSXNode();this.expectJSX("<");var e=this.parseJSXElementName(),n=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(e,i,n))},e.prototype.parseJSXBoundaryElement=function(){var t=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var e=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(t,new o.JSXClosingElement(e))}var n=this.parseJSXElementName(),i=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(n,r,i))},e.prototype.parseJSXEmptyExpression=function(){var t=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(t,new o.JSXEmptyExpression)},e.prototype.parseJSXExpressionContainer=function(){var t,e=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new o.JSXExpressionContainer(t))},e.prototype.parseJSXChildren=function(){for(var t=[];!this.scanner.eof();){var e=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;s=this.finalize(t.node,new o.JSXElement(t.opening,t.children,t.closing)),(t=e[e.length-1]).children.push(s),e.pop()}}return t},e.prototype.parseJSXElement=function(){var t=this.createJSXNode(),e=this.parseJSXOpeningElement(),n=[],i=null;if(!e.selfClosing){var r=this.parseComplexJSXElement({node:t,opening:e,closing:i,children:n});n=r.children,i=r.closing}return this.finalize(t,new o.JSXElement(e,n,i))},e.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var t=this.parseJSXElement();return this.finishJSX(),t},e.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},e}(c.Parser);e.JSXParser=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(t){return t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&n.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(t))},isIdentifierPart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&n.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(t))},isDecimalDigit:function(t){return t>=48&&t<=57},isHexDigit:function(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102},isOctalDigit:function(t){return t>=48&&t<=55}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6);e.JSXClosingElement=function(t){this.type=i.JSXSyntax.JSXClosingElement,this.name=t},e.JSXElement=function(t,e,n){this.type=i.JSXSyntax.JSXElement,this.openingElement=t,this.children=e,this.closingElement=n},e.JSXEmptyExpression=function(){this.type=i.JSXSyntax.JSXEmptyExpression},e.JSXExpressionContainer=function(t){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=t},e.JSXIdentifier=function(t){this.type=i.JSXSyntax.JSXIdentifier,this.name=t},e.JSXMemberExpression=function(t,e){this.type=i.JSXSyntax.JSXMemberExpression,this.object=t,this.property=e},e.JSXAttribute=function(t,e){this.type=i.JSXSyntax.JSXAttribute,this.name=t,this.value=e},e.JSXNamespacedName=function(t,e){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=t,this.name=e},e.JSXOpeningElement=function(t,e,n){this.type=i.JSXSyntax.JSXOpeningElement,this.name=t,this.selfClosing=e,this.attributes=n},e.JSXSpreadAttribute=function(t){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=t},e.JSXText=function(t,e){this.type=i.JSXSyntax.JSXText,this.value=t,this.raw=e}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);e.ArrayExpression=function(t){this.type=i.Syntax.ArrayExpression,this.elements=t},e.ArrayPattern=function(t){this.type=i.Syntax.ArrayPattern,this.elements=t},e.ArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!1},e.AssignmentExpression=function(t,e,n){this.type=i.Syntax.AssignmentExpression,this.operator=t,this.left=e,this.right=n},e.AssignmentPattern=function(t,e){this.type=i.Syntax.AssignmentPattern,this.left=t,this.right=e},e.AsyncArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!0},e.AsyncFunctionDeclaration=function(t,e,n){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AsyncFunctionExpression=function(t,e,n){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AwaitExpression=function(t){this.type=i.Syntax.AwaitExpression,this.argument=t},e.BinaryExpression=function(t,e,n){this.type="||"===t||"&&"===t?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=t,this.left=e,this.right=n},e.BlockStatement=function(t){this.type=i.Syntax.BlockStatement,this.body=t},e.BreakStatement=function(t){this.type=i.Syntax.BreakStatement,this.label=t},e.CallExpression=function(t,e){this.type=i.Syntax.CallExpression,this.callee=t,this.arguments=e},e.CatchClause=function(t,e){this.type=i.Syntax.CatchClause,this.param=t,this.body=e},e.ClassBody=function(t){this.type=i.Syntax.ClassBody,this.body=t},e.ClassDeclaration=function(t,e,n){this.type=i.Syntax.ClassDeclaration,this.id=t,this.superClass=e,this.body=n},e.ClassExpression=function(t,e,n){this.type=i.Syntax.ClassExpression,this.id=t,this.superClass=e,this.body=n},e.ComputedMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=t,this.property=e},e.ConditionalExpression=function(t,e,n){this.type=i.Syntax.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n},e.ContinueStatement=function(t){this.type=i.Syntax.ContinueStatement,this.label=t},e.DebuggerStatement=function(){this.type=i.Syntax.DebuggerStatement},e.Directive=function(t,e){this.type=i.Syntax.ExpressionStatement,this.expression=t,this.directive=e},e.DoWhileStatement=function(t,e){this.type=i.Syntax.DoWhileStatement,this.body=t,this.test=e},e.EmptyStatement=function(){this.type=i.Syntax.EmptyStatement},e.ExportAllDeclaration=function(t){this.type=i.Syntax.ExportAllDeclaration,this.source=t},e.ExportDefaultDeclaration=function(t){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=t},e.ExportNamedDeclaration=function(t,e,n){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=t,this.specifiers=e,this.source=n},e.ExportSpecifier=function(t,e){this.type=i.Syntax.ExportSpecifier,this.exported=e,this.local=t},e.ExpressionStatement=function(t){this.type=i.Syntax.ExpressionStatement,this.expression=t},e.ForInStatement=function(t,e,n){this.type=i.Syntax.ForInStatement,this.left=t,this.right=e,this.body=n,this.each=!1},e.ForOfStatement=function(t,e,n){this.type=i.Syntax.ForOfStatement,this.left=t,this.right=e,this.body=n},e.ForStatement=function(t,e,n,r){this.type=i.Syntax.ForStatement,this.init=t,this.test=e,this.update=n,this.body=r},e.FunctionDeclaration=function(t,e,n,r){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.FunctionExpression=function(t,e,n,r){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.Identifier=function(t){this.type=i.Syntax.Identifier,this.name=t},e.IfStatement=function(t,e,n){this.type=i.Syntax.IfStatement,this.test=t,this.consequent=e,this.alternate=n},e.ImportDeclaration=function(t,e){this.type=i.Syntax.ImportDeclaration,this.specifiers=t,this.source=e},e.ImportDefaultSpecifier=function(t){this.type=i.Syntax.ImportDefaultSpecifier,this.local=t},e.ImportNamespaceSpecifier=function(t){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=t},e.ImportSpecifier=function(t,e){this.type=i.Syntax.ImportSpecifier,this.local=t,this.imported=e},e.LabeledStatement=function(t,e){this.type=i.Syntax.LabeledStatement,this.label=t,this.body=e},e.Literal=function(t,e){this.type=i.Syntax.Literal,this.value=t,this.raw=e},e.MetaProperty=function(t,e){this.type=i.Syntax.MetaProperty,this.meta=t,this.property=e},e.MethodDefinition=function(t,e,n,r,s){this.type=i.Syntax.MethodDefinition,this.key=t,this.computed=e,this.value=n,this.kind=r,this.static=s},e.Module=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="module"},e.NewExpression=function(t,e){this.type=i.Syntax.NewExpression,this.callee=t,this.arguments=e},e.ObjectExpression=function(t){this.type=i.Syntax.ObjectExpression,this.properties=t},e.ObjectPattern=function(t){this.type=i.Syntax.ObjectPattern,this.properties=t},e.Property=function(t,e,n,r,s,o){this.type=i.Syntax.Property,this.key=e,this.computed=n,this.value=r,this.kind=t,this.method=s,this.shorthand=o},e.RegexLiteral=function(t,e,n,r){this.type=i.Syntax.Literal,this.value=t,this.raw=e,this.regex={pattern:n,flags:r}},e.RestElement=function(t){this.type=i.Syntax.RestElement,this.argument=t},e.ReturnStatement=function(t){this.type=i.Syntax.ReturnStatement,this.argument=t},e.Script=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="script"},e.SequenceExpression=function(t){this.type=i.Syntax.SequenceExpression,this.expressions=t},e.SpreadElement=function(t){this.type=i.Syntax.SpreadElement,this.argument=t},e.StaticMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=t,this.property=e},e.Super=function(){this.type=i.Syntax.Super},e.SwitchCase=function(t,e){this.type=i.Syntax.SwitchCase,this.test=t,this.consequent=e},e.SwitchStatement=function(t,e){this.type=i.Syntax.SwitchStatement,this.discriminant=t,this.cases=e},e.TaggedTemplateExpression=function(t,e){this.type=i.Syntax.TaggedTemplateExpression,this.tag=t,this.quasi=e},e.TemplateElement=function(t,e){this.type=i.Syntax.TemplateElement,this.value=t,this.tail=e},e.TemplateLiteral=function(t,e){this.type=i.Syntax.TemplateLiteral,this.quasis=t,this.expressions=e},e.ThisExpression=function(){this.type=i.Syntax.ThisExpression},e.ThrowStatement=function(t){this.type=i.Syntax.ThrowStatement,this.argument=t},e.TryStatement=function(t,e,n){this.type=i.Syntax.TryStatement,this.block=t,this.handler=e,this.finalizer=n},e.UnaryExpression=function(t,e){this.type=i.Syntax.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0},e.UpdateExpression=function(t,e,n){this.type=i.Syntax.UpdateExpression,this.operator=t,this.argument=e,this.prefix=n},e.VariableDeclaration=function(t,e){this.type=i.Syntax.VariableDeclaration,this.declarations=t,this.kind=e},e.VariableDeclarator=function(t,e){this.type=i.Syntax.VariableDeclarator,this.id=t,this.init=e},e.WhileStatement=function(t,e){this.type=i.Syntax.WhileStatement,this.test=t,this.body=e},e.WithStatement=function(t,e){this.type=i.Syntax.WithStatement,this.object=t,this.body=e},e.YieldExpression=function(t,e){this.type=i.Syntax.YieldExpression,this.argument=t,this.delegate=e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(10),s=n(11),o=n(7),a=n(12),l=n(2),c=n(13),h="ArrowParameterPlaceHolder",u=function(){function t(t,e,n){void 0===e&&(e={}),this.config={range:"boolean"==typeof e.range&&e.range,loc:"boolean"==typeof e.loc&&e.loc,source:null,tokens:"boolean"==typeof e.tokens&&e.tokens,comment:"boolean"==typeof e.comment&&e.comment,tolerant:"boolean"==typeof e.tolerant&&e.tolerant},this.config.loc&&e.source&&null!==e.source&&(this.config.source=String(e.source)),this.delegate=n,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return t.prototype.throwError=function(t){for(var e=[],n=1;n0&&this.delegate)for(var e=0;e>="===t||">>>="===t||"&="===t||"^="===t||"|="===t},t.prototype.isolateCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=e,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=i,r},t.prototype.inheritCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&e,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=i||this.context.firstCoverInitializedNameError,r},t.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},t.prototype.parsePrimaryExpression=function(){var t,e,n,i=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(i,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(e.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal("true"===e.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(null,n));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,e=this.nextRegexToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.RegexLiteral(e.regex,n,e.pattern,e.flags));break;default:t=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(i,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(i,new o.ThisExpression)):t=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken())}return t},t.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new o.SpreadElement(e))},t.prototype.parseArrayInitializer=function(){var t=this.createNode(),e=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),e.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),e.push(n)}else e.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new o.ArrayExpression(e))},t.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var e=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var i=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=e,this.context.allowStrictDirective=n,i},t.prototype.parsePropertyMethodFunction=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),e=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var i=this.parseFormalParameters(),r=this.parsePropertyMethod(i);return this.context.allowYield=e,this.context.await=n,this.finalize(t,new o.AsyncFunctionExpression(null,i.params,r))},t.prototype.parseObjectPropertyKey=function(){var t,e=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,s.Messages.StrictOctalLiteral);var i=this.getTokenRaw(n);t=this.finalize(e,new o.Literal(n.value,i));break;case 3:case 1:case 5:case 4:t=this.finalize(e,new o.Identifier(n.value));break;case 7:"["===n.value?(t=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):t=this.throwUnexpectedToken(n);break;default:t=this.throwUnexpectedToken(n)}return t},t.prototype.isPropertyKey=function(t,e){return t.type===l.Syntax.Identifier&&t.name===e||t.type===l.Syntax.Literal&&t.value===e},t.prototype.parseObjectProperty=function(t){var e,n=this.createNode(),i=this.lookahead,r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(3===i.type){var d=i.value;this.nextToken(),l=this.match("["),r=(u=!(this.hasLineTerminator||"async"!==d||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(d))}else this.match("*")?this.nextToken():(l=this.match("["),r=this.parseObjectPropertyKey());var p=this.qualifiedPropertyName(this.lookahead);if(3===i.type&&!u&&"get"===i.value&&p)e="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===i.type&&!u&&"set"===i.value&&p)e="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===i.type&&"*"===i.value&&p)e="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(r||this.throwUnexpectedToken(this.lookahead),e="init",this.match(":")&&!u)!l&&this.isPropertyKey(r,"__proto__")&&(t.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===i.type)if(d=this.finalize(n,new o.Identifier(i.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),h=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new o.AssignmentPattern(d,f))}else h=!0,a=d;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(e,r,l,a,c,h))},t.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var e=[],n={value:!1};!this.match("}");)e.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new o.ObjectExpression(e))},t.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateLiteral=function(){var t=this.createNode(),e=[],n=[],i=this.parseTemplateHead();for(n.push(i);!i.tail;)e.push(this.parseExpression()),i=this.parseTemplateElement(),n.push(i);return this.finalize(t,new o.TemplateLiteral(n,e))},t.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:t.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case l.Syntax.ArrayExpression:t.type=l.Syntax.ArrayPattern;for(var e=0;e")||this.expect("=>"),t={type:h,params:[],async:!1};else{var e=this.lookahead,n=[];if(this.match("..."))t=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:h,params:[t],async:!1};else{var i=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(t);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s")||this.expect("=>"),this.context.isBindingElement=!1,s=0;s")&&(t.type===l.Syntax.Identifier&&"yield"===t.name&&(i=!0,t={type:h,params:[t],async:!1}),!i)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===l.Syntax.SequenceExpression)for(s=0;s")){for(var l=0;l0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var r=[t,this.lookahead],s=e,a=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[s,n.value,a],c=[i];!((i=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&i<=c[c.length-1];){a=l.pop();var h=l.pop();c.pop(),s=l.pop(),r.pop();var u=this.startNode(r[r.length-1]);l.push(this.finalize(u,new o.BinaryExpression(h,s,a)))}l.push(this.nextToken().value),c.push(i),r.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var d=l.length-1;e=l[d];for(var p=r.pop();d>1;){var f=r.pop();u=this.startNode(f,p&&p.lineStart),e=this.finalize(u,new o.BinaryExpression(h=l[d-1],l[d-2],e)),d-=2,p=f}}return e},t.prototype.parseConditionalExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var r=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.ConditionalExpression(e,i,r)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return e},t.prototype.checkPatternParam=function(t,e){switch(e.type){case l.Syntax.Identifier:this.validateParam(t,e,e.name);break;case l.Syntax.RestElement:this.checkPatternParam(t,e.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(t,e.left);break;case l.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=t.async,a=this.reinterpretAsCoverFormalsList(t);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,u=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var d=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=r;var f=this.startNode(e);this.expect("=>");var g=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,g=this.parseFunctionSourceElements(),this.context.allowIn=m}else g=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=g.type!==l.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),t=this.finalize(f,r?new o.AsyncArrowFunctionExpression(a.params,g,v):new o.ArrowFunctionExpression(a.params,g,v)),this.context.strict=c,this.context.allowStrictDirective=u,this.context.allowYield=d,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===l.Syntax.Identifier){var y=t;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var b=(n=this.nextToken()).value,w=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.AssignmentExpression(b,t,w)),this.context.firstCoverInitializedNameError=null}}return t},t.prototype.parseExpression=function(){var t=this.lookahead,e=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(e);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(t),new o.SequenceExpression(n))}return e},t.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement()}else t=this.parseStatement();return t},t.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseStatementListItem());return this.expect("}"),this.finalize(t,new o.BlockStatement(e))},t.prototype.parseLexicalBinding=function(t,e){var n=this.createNode(),i=this.parsePattern([],t);this.context.strict&&i.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return"const"===t?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!e.inFor&&i.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),r=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(i,r))},t.prototype.parseBindingList=function(t,e){for(var n=[this.parseLexicalBinding(t,e)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(t,e));return n},t.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.scanner.lex();return this.scanner.restoreState(t),3===e.type||7===e.type&&"["===e.value||7===e.type&&"{"===e.value||4===e.type&&"let"===e.value||4===e.type&&"yield"===e.value},t.prototype.parseLexicalDeclaration=function(t){var e=this.createNode(),n=this.nextToken().value;i.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var r=this.parseBindingList(n,t);return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(r,n))},t.prototype.parseBindingRestElement=function(t,e){var n=this.createNode();this.expect("...");var i=this.parsePattern(t,e);return this.finalize(n,new o.RestElement(i))},t.prototype.parseArrayPattern=function(t,e){var n=this.createNode();this.expect("[");for(var i=[];!this.match("]");)if(this.match(","))this.nextToken(),i.push(null);else{if(this.match("...")){i.push(this.parseBindingRestElement(t,e));break}i.push(this.parsePatternWithDefault(t,e)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(i))},t.prototype.parsePropertyPattern=function(t,e){var n,i,r=this.createNode(),s=!1,a=!1;if(3===this.lookahead.type){var l=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(r,new o.Identifier(l.value));if(this.match("=")){t.push(l),a=!0,this.nextToken();var h=this.parseAssignmentExpression();i=this.finalize(this.startNode(l),new o.AssignmentPattern(c,h))}else this.match(":")?(this.expect(":"),i=this.parsePatternWithDefault(t,e)):(t.push(l),a=!0,i=c)}else s=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),i=this.parsePatternWithDefault(t,e);return this.finalize(r,new o.Property("init",n,s,i,!1,a))},t.prototype.parseObjectPattern=function(t,e){var n=this.createNode(),i=[];for(this.expect("{");!this.match("}");)i.push(this.parsePropertyPattern(t,e)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(i))},t.prototype.parsePattern=function(t,e){var n;return this.match("[")?n=this.parseArrayPattern(t,e):this.match("{")?n=this.parseObjectPattern(t,e):(!this.matchKeyword("let")||"const"!==e&&"let"!==e||this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),t.push(this.lookahead),n=this.parseVariableIdentifier(e)),n},t.prototype.parsePatternWithDefault=function(t,e){var n=this.lookahead,i=this.parsePattern(t,e);if(this.match("=")){this.nextToken();var r=this.context.allowYield;this.context.allowYield=!0;var s=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=r,i=this.finalize(this.startNode(n),new o.AssignmentPattern(i,s))}return i},t.prototype.parseVariableIdentifier=function(t){var e=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==t)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(e,new o.Identifier(n.value))},t.prototype.parseVariableDeclaration=function(t){var e=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===l.Syntax.Identifier||t.inFor||this.expect("="),this.finalize(e,new o.VariableDeclarator(n,i))},t.prototype.parseVariableDeclarationList=function(t){var e={inFor:t.inFor},n=[];for(n.push(this.parseVariableDeclaration(e));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(e));return n},t.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var e=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(e,"var"))},t.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new o.EmptyStatement)},t.prototype.parseExpressionStatement=function(){var t=this.createNode(),e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ExpressionStatement(e))},t.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},t.prototype.parseIfStatement=function(){var t,e=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(e,new o.IfStatement(i,t,n))},t.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var e=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=e,this.expectKeyword("while"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new o.DoWhileStatement(n,i))},t.prototype.parseWhileStatement=function(){var t,e=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var i=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=i}return this.finalize(e,new o.WhileStatement(n,t))},t.prototype.parseForStatement=function(){var t,e,n,i=null,r=null,a=null,c=!0,h=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){i=this.createNode(),this.nextToken();var u=this.context.allowIn;this.context.allowIn=!1;var d=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=u,1===d.length&&this.matchKeyword("in")){var p=d[0];p.init&&(p.id.type===l.Syntax.ArrayPattern||p.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseExpression(),i=null}else 1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){i=this.createNode();var f=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(u=this.context.allowIn,this.context.allowIn=!1,d=this.parseBindingList(f,{inFor:!0}),this.context.allowIn=u,1===d.length&&null===d[0].init&&this.matchKeyword("in")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseExpression(),i=null):1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(this.consumeSemicolon(),i=this.finalize(i,new o.VariableDeclaration(d,f)))):(i=this.finalize(i,new o.Identifier(f)),this.nextToken(),t=i,e=this.parseExpression(),i=null)}else{var g=this.lookahead;if(u=this.context.allowIn,this.context.allowIn=!1,i=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=u,this.matchKeyword("in"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseExpression(),i=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseAssignmentExpression(),i=null,c=!1;else{if(this.match(",")){for(var m=[i];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));i=this.finalize(this.startNode(g),new o.SequenceExpression(m))}this.expect(";")}}if(void 0===t&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return this.finalize(h,void 0===t?new o.ForStatement(i,r,a,n):c?new o.ForInStatement(t,e,n):new o.ForOfStatement(t,e,n))},t.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();e=n,Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(t,new o.ContinueStatement(e))},t.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name),e=n}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(t,new o.BreakStatement(e))},t.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var e=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ReturnStatement(e))},t.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var t,e=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new o.WithStatement(n,t))},t.prototype.parseSwitchCase=function(){var t,e=this.createNode();this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(e,new o.SwitchCase(t,n))},t.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var e=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var i=[],r=!1;for(this.expect("{");!this.match("}");){var a=this.parseSwitchCase();null===a.test&&(r&&this.throwError(s.Messages.MultipleDefaultsInSwitch),r=!0),i.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(t,new o.SwitchStatement(e,i))},t.prototype.parseLabelledStatement=function(){var t,e=this.createNode(),n=this.parseExpression();if(n.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var i=n,r="$"+i.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)&&this.throwError(s.Messages.Redeclaration,"Label",i.name),this.context.labelSet[r]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,h=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):h.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),a=h}else a=this.parseStatement();delete this.context.labelSet[r],t=new o.LabeledStatement(i,a)}else this.consumeSemicolon(),t=new o.ExpressionStatement(n);return this.finalize(e,t)},t.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ThrowStatement(e))},t.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var e=[],n=this.parsePattern(e),i={},r=0;r0&&this.tolerateError(s.Messages.BadGetterArity);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseSetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(s.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseGeneratorMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!0))},t.prototype.isStartOfExpression=function(){var t=!0,e=this.lookahead.value;switch(this.lookahead.type){case 7:t="["===e||"("===e||"{"===e||"+"===e||"-"===e||"!"===e||"~"===e||"++"===e||"--"===e||"/"===e||"/="===e;break;case 4:t="class"===e||"delete"===e||"function"===e||"let"===e||"new"===e||"super"===e||"this"===e||"typeof"===e||"void"===e||"yield"===e}return t},t.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var e=null,n=!1;if(!this.hasLineTerminator){var i=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),e=this.parseAssignmentExpression()):this.isStartOfExpression()&&(e=this.parseAssignmentExpression()),this.context.allowYield=i}return this.finalize(t,new o.YieldExpression(e,n))},t.prototype.parseClassElement=function(t){var e=this.lookahead,n=this.createNode(),i="",r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(r=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(e=this.lookahead,h=!0,l=this.match("["),this.match("*")?this.nextToken():r=this.parseObjectPropertyKey()),3===e.type&&!this.hasLineTerminator&&"async"===e.value){var d=this.lookahead.value;":"!==d&&"("!==d&&"*"!==d&&(u=!0,e=this.lookahead,r=this.parseObjectPropertyKey(),3===e.type&&"constructor"===e.value&&this.tolerateUnexpectedToken(e,s.Messages.ConstructorIsAsync))}var p=this.qualifiedPropertyName(this.lookahead);return 3===e.type?"get"===e.value&&p?(i="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===e.value&&p&&(i="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===e.type&&"*"===e.value&&p&&(i="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!i&&r&&this.match("(")&&(i="init",a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),i||this.throwUnexpectedToken(this.lookahead),"init"===i&&(i="method"),l||(h&&this.isPropertyKey(r,"prototype")&&this.throwUnexpectedToken(e,s.Messages.StaticPrototype),!h&&this.isPropertyKey(r,"constructor")&&(("method"!==i||!c||a&&a.generator)&&this.throwUnexpectedToken(e,s.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(e,s.Messages.DuplicateConstructor):t.value=!0,i="constructor")),this.finalize(n,new o.MethodDefinition(r,l,a,i,h))},t.prototype.parseClassElementList=function(){var t=[],e={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(e));return this.expect("}"),t},t.prototype.parseClassBody=function(){var t=this.createNode(),e=this.parseClassElementList();return this.finalize(t,new o.ClassBody(e))},t.prototype.parseClassDeclaration=function(t){var e=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var i=t&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var s=this.parseClassBody();return this.context.strict=n,this.finalize(e,new o.ClassDeclaration(i,r,s))},t.prototype.parseClassExpression=function(){var t=this.createNode(),e=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var r=this.parseClassBody();return this.context.strict=e,this.finalize(t,new o.ClassExpression(n,i,r))},t.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Module(e))},t.prototype.parseScript=function(){for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Script(e))},t.prototype.parseModuleSpecifier=function(){var t=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var e=this.nextToken(),n=this.getTokenRaw(e);return this.finalize(t,new o.Literal(e.value,n))},t.prototype.parseImportSpecifier=function(){var t,e,n=this.createNode();return 3===this.lookahead.type?(e=t=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),e=this.parseVariableIdentifier())):(e=t=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),e=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(e,t))},t.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},t.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName();return this.finalize(t,new o.ImportDefaultSpecifier(e))},t.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var e=this.parseIdentifierName();return this.finalize(t,new o.ImportNamespaceSpecifier(e))},t.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var t,e=this.createNode();this.expectKeyword("import");var n=[];return 8===this.lookahead.type||(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken()),t=this.parseModuleSpecifier(),this.consumeSemicolon(),this.finalize(e,new o.ImportDeclaration(n,t))},t.prototype.parseExportSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName(),n=e;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(t,new o.ExportSpecifier(e,n))},t.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var t,e=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),t=this.finalize(e,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){this.nextToken(),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null));else{var r=[],a=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),r.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),a=this.parseModuleSpecifier(),this.consumeSemicolon()):l?this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value):this.consumeSemicolon(),t=this.finalize(e,new o.ExportNamedDeclaration(null,r,a))}return t},t}();e.Parser=u},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assert=function(t,e){if(!t)throw new Error("ASSERT: "+e)}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.errors=[],this.tolerant=!1}return t.prototype.recordError=function(t){this.errors.push(t)},t.prototype.tolerate=function(t){if(!this.tolerant)throw t;this.recordError(t)},t.prototype.constructError=function(t,e){var n=new Error(t);try{throw n}catch(i){Object.create&&Object.defineProperty&&(n=Object.create(i),Object.defineProperty(n,"column",{value:e}))}return n},t.prototype.createError=function(t,e,n,i){var r=this.constructError("Line "+e+": "+i,n);return r.index=t,r.lineNumber=e,r.description=i,r},t.prototype.throwError=function(t,e,n,i){throw this.createError(t,e,n,i)},t.prototype.tolerateError=function(t,e,n,i){var r=this.createError(t,e,n,i);if(!this.tolerant)throw r;this.recordError(r)},t}();e.ErrorHandler=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(4),s=n(11);function o(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function a(t){return"01234567".indexOf(t)}var l=function(){function t(t,e){this.source=t,this.errorHandler=e,this.trackComment=!1,this.isModule=!1,this.length=t.length,this.index=0,this.lineNumber=t.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return t.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},t.prototype.restoreState=function(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart},t.prototype.eof=function(){return this.index>=this.length},t.prototype.throwUnexpectedToken=function(t){return void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.tolerateUnexpectedToken=function(t){void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.skipSingleLineComment=function(t){var e,n,i=[];for(this.trackComment&&(i=[],e=this.index-t,n={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,r.Character.isLineTerminator(s))return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart-1},i.push({multiLine:!1,slice:[e+t,this.index-1],range:[e,this.index-1],loc:n})),13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},i.push({multiLine:!1,slice:[e+t,this.index],range:[e,this.index],loc:n})),i},t.prototype.skipMultiLineComment=function(){var t,e,n=[];for(this.trackComment&&(n=[],t=this.index-2,e={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(r.Character.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1))return this.index+=2,this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:e})),n;++this.index}else++this.index}return this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:e})),this.tolerateUnexpectedToken(),n},t.prototype.scanComments=function(){var t;this.trackComment&&(t=[]);for(var e=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(r.Character.isWhiteSpace(n))++this.index;else if(r.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,e=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var i=this.skipSingleLineComment(2);this.trackComment&&(t=t.concat(i)),e=!0}else{if(42!==n)break;this.index+=2,i=this.skipMultiLineComment(),this.trackComment&&(t=t.concat(i))}else if(e&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,i=this.skipSingleLineComment(3),this.trackComment&&(t=t.concat(i))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,i=this.skipSingleLineComment(4),this.trackComment&&(t=t.concat(i))}}return t},t.prototype.isFutureReservedWord=function(t){switch(t){case"enum":case"export":case"import":case"super":return!0;default:return!1}},t.prototype.isStrictModeReservedWord=function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},t.prototype.isRestrictedWord=function(t){return"eval"===t||"arguments"===t},t.prototype.isKeyword=function(t){switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}},t.prototype.codePointAt=function(t){var e=this.source.charCodeAt(t);if(e>=55296&&e<=56319){var n=this.source.charCodeAt(t+1);n>=56320&&n<=57343&&(e=1024*(e-55296)+n-56320+65536)}return e},t.prototype.scanHexEscape=function(t){for(var e="u"===t?4:2,n=0,i=0;i1114111||"}"!==t)&&this.throwUnexpectedToken(),r.Character.fromCodePoint(e)},t.prototype.getIdentifier=function(){for(var t=this.index++;!this.eof();){var e=this.source.charCodeAt(this.index);if(92===e)return this.index=t,this.getComplexIdentifier();if(e>=55296&&e<57343)return this.index=t,this.getComplexIdentifier();if(!r.Character.isIdentifierPart(e))break;++this.index}return this.source.slice(t,this.index)},t.prototype.getComplexIdentifier=function(){var t,e=this.codePointAt(this.index),n=r.Character.fromCodePoint(e);for(this.index+=n.length,92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierStart(t.charCodeAt(0))||this.throwUnexpectedToken(),n=t);!this.eof()&&(e=this.codePointAt(this.index),r.Character.isIdentifierPart(e));)n+=t=r.Character.fromCodePoint(e),this.index+=t.length,92===e&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierPart(t.charCodeAt(0))||this.throwUnexpectedToken(),n+=t);return n},t.prototype.octalToDecimal=function(t){var e="0"!==t,n=a(t);return!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(e=!0,n=8*n+a(this.source[this.index++]),"0123".indexOf(t)>=0&&!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:e}},t.prototype.scanIdentifier=function(){var t,e=this.index,n=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier();if(3!=(t=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&e+n.length!==this.index){var i=this.index;this.index=e,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=i}return{type:t,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var t=this.index,e=this.source[this.index];switch(e){case"(":case"{":"{"===e&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,e="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(e=this.source.substr(this.index,4))?this.index+=4:"==="===(e=e.substr(0,3))||"!=="===e||">>>"===e||"<<="===e||">>="===e||"**="===e?this.index+=3:"&&"===(e=e.substr(0,2))||"||"===e||"=="===e||"!="===e||"+="===e||"-="===e||"*="===e||"/="===e||"++"===e||"--"===e||"<<"===e||">>"===e||"&="===e||"|="===e||"^="===e||"%="===e||"<="===e||">="===e||"=>"===e||"**"===e?this.index+=2:"<>=!+-*%&|^/".indexOf(e=this.source[this.index])>=0&&++this.index}return this.index===t&&this.throwUnexpectedToken(),{type:7,value:e,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanHexLiteral=function(t){for(var e="";!this.eof()&&r.Character.isHexDigit(this.source.charCodeAt(this.index));)e+=this.source[this.index++];return 0===e.length&&this.throwUnexpectedToken(),r.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+e,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanBinaryLiteral=function(t){for(var e,n="";!this.eof()&&("0"===(e=this.source[this.index])||"1"===e);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(e=this.source.charCodeAt(this.index),(r.Character.isIdentifierStart(e)||r.Character.isDecimalDigit(e))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanOctalLiteral=function(t,e){var n="",i=!1;for(r.Character.isOctalDigit(t.charCodeAt(0))?(i=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return i||0!==n.length||this.throwUnexpectedToken(),(r.Character.isIdentifierStart(this.source.charCodeAt(this.index))||r.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var t=this.index+1;t=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(t,e,n){var r=parseInt(e||n,16);return r>1114111&&i.throwUnexpectedToken(s.Messages.InvalidRegExp),r<=65535?String.fromCharCode(r):"\uffff"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"\uffff"));try{RegExp(n)}catch(r){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,e)}catch(o){return null}},t.prototype.scanRegExpBody=function(){var t=this.source[this.index];i.assert("/"===t,"Regular expression literal must start with a slash");for(var e=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e+=t=this.source[this.index++],"\\"===t)t=this.source[this.index++],r.Character.isLineTerminator(t.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e+=t;else if(r.Character.isLineTerminator(t.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===t&&(n=!1);else{if("/"===t){o=!0;break}"["===t&&(n=!0)}return o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e.substr(1,e.length-2)},t.prototype.scanRegExpFlags=function(){for(var t="";!this.eof();){var e=this.source[this.index];if(!r.Character.isIdentifierPart(e.charCodeAt(0)))break;if(++this.index,"\\"!==e||this.eof())t+=e;else if("u"===(e=this.source[this.index])){++this.index;var n=this.index,i=this.scanHexEscape("u");if(null!==i)for(t+=i;n=55296&&t<57343&&r.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t}();e.Scanner=l},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",times:"\xd7",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",divide:"\xf7",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",frasl:"\u2044",euro:"\u20ac",image:"\u2111",weierp:"\u2118",real:"\u211c",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lArr:"\u21d0",uArr:"\u21d1",rArr:"\u21d2",dArr:"\u21d3",hArr:"\u21d4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27e8",rang:"\u27e9"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),r=n(12),s=n(13),o=function(){function t(){this.values=[],this.curly=this.paren=-1}return t.prototype.beforeFunctionExpression=function(t){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)>=0},t.prototype.isRegexStart=function(){var t=this.values[this.values.length-1],e=null!==t;switch(t){case"this":case"]":e=!1;break;case")":var n=this.values[this.paren-1];e="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(e=!1,"function"===this.values[this.curly-3])e=!!(i=this.values[this.curly-4])&&!this.beforeFunctionExpression(i);else if("function"===this.values[this.curly-4]){var i;e=!(i=this.values[this.curly-5])||!this.beforeFunctionExpression(i)}}return e},t.prototype.push=function(t){7===t.type||4===t.type?("{"===t.value?this.curly=this.values.length:"("===t.value&&(this.paren=this.values.length),this.values.push(t.value)):this.values.push(null)},t}(),a=function(){function t(t,e){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=!!e&&"boolean"==typeof e.tolerant&&e.tolerant,this.scanner=new r.Scanner(t,this.errorHandler),this.scanner.trackComment=!!e&&"boolean"==typeof e.comment&&e.comment,this.trackRange=!!e&&"boolean"==typeof e.range&&e.range,this.trackLoc=!!e&&"boolean"==typeof e.loc&&e.loc,this.buffer=[],this.reader=new o}return t.prototype.errors=function(){return this.errorHandler.errors},t.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var e=0;e>10),56320+(t-65536&1023))}for(var _=new Array(256),C=new Array(256),S=0;S<256;S++)_[S]=w(S)?1:0,C[S]=w(S);function E(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||a,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function k(t,e){return new r(e,new s(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function A(t,e){throw k(t,e)}function D(t,e){t.onWarning&&t.onWarning.call(null,k(t,e))}var T={YAML:function(t,e,n){var i,r,s;null!==t.version&&A(t,"duplication of %YAML directive"),1!==n.length&&A(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&A(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&A(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&D(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&A(t,"TAG directive accepts exactly two arguments"),r=n[1],d.test(i=n[0])||A(t,"ill-formed tag handle (first argument) of the TAG directive"),l.call(t.tagMap,i)&&A(t,'there is a previously declared suffix for "'+i+'" tag handle'),p.test(r)||A(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=r}};function R(t,e,n,i){var r,s,o,a;if(e1&&(t.result+=i.repeat("\n",e-1))}function P(t,e){var n,i,r=t.tag,s=t.anchor,o=[],a=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),i=t.input.charCodeAt(t.position);0!==i&&45===i&&v(t.input.charCodeAt(t.position+1));)if(a=!0,t.position++,I(t,!0,-1)&&t.lineIndent<=e)o.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,U(t,e,3,!1,!0),o.push(t.result),I(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)A(t,"bad indentation of a sequence entry");else if(t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente)&&(U(t,e,4,!0,r)&&(g?p=t.result:f=t.result),g||(L(t,h,u,d,p,f,s,o),d=p=f=null),I(t,!0,-1),a=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==a)A(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===s?A(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):h?A(t,"repeat of an indentation width identifier"):(u=e+s-1,h=!0)}if(m(o)){do{o=t.input.charCodeAt(++t.position)}while(m(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!g(o)&&0!==o)}for(;0!==o;){for(M(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!h||t.lineIndentu&&(u=t.lineIndent),g(o))d++;else{if(t.lineIndent0){for(r=o,s=0;r>0;r--)(o=b(a=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+o:A(t,"expected hexadecimal character");t.result+=x(s),t.position++}else A(t,"unknown escape sequence");n=i=t.position}else g(a)?(R(t,n,i,!0),O(t,I(t,!1,e)),n=i=t.position):t.position===t.lineStart&&$(t)?A(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}A(t,"unexpected end of the stream within a double quoted scalar")}(t,p)?E=!0:function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!v(i)&&!y(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&A(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||A(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],I(t,!0,-1),!0}(t)?(E=!0,null===t.tag&&null===t.anchor||A(t,"alias node should not have any properties")):function(t,e,n){var i,r,s,o,a,l,c,h,u=t.kind,d=t.result;if(v(h=t.input.charCodeAt(t.position))||y(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(v(i=t.input.charCodeAt(t.position+1))||n&&y(i)))return!1;for(t.kind="scalar",t.result="",r=s=t.position,o=!1;0!==h;){if(58===h){if(v(i=t.input.charCodeAt(t.position+1))||n&&y(i))break}else if(35===h){if(v(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&$(t)||n&&y(h))break;if(g(h)){if(a=t.line,l=t.lineStart,c=t.lineIndent,I(t,!1,-1),t.lineIndent>=e){o=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=a,t.lineStart=l,t.lineIndent=c;break}}o&&(R(t,r,s,!1),O(t,t.line-a),r=s=t.position,o=!1),m(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return R(t,r,s,!1),!!t.result||(t.kind=u,t.result=d,!1)}(t,p,1===n)&&(E=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===w&&(E=c&&P(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&A(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),h=0,u=t.implicitTypes.length;h tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result)?(t.result=d.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):A(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):A(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||E}function V(t){var e,n,i,r,s=t.position,o=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(r=t.input.charCodeAt(t.position))&&(I(t,!0,-1),r=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==r));){for(o=!0,r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);for(i=[],(n=t.input.slice(e,t.position)).length<1&&A(t,"directive name must not be less than one character in length");0!==r;){for(;m(r);)r=t.input.charCodeAt(++t.position);if(35===r){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&!g(r));break}if(g(r))break;for(e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==r&&M(t),l.call(T,n)?T[n](t,n,i):D(t,'unknown document directive "'+n+'"')}I(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,I(t,!0,-1)):o&&A(t,"directives end mark is expected"),U(t,t.lineIndent-1,4,!1,!0),I(t,!0,-1),t.checkLineBreaks&&h.test(t.input.slice(s,t.position))&&D(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&$(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,I(t,!0,-1)):t.position0?o-4:o;for(n=0;n>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[h++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function h(t,e,n){for(var r,s=[],o=e;o>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},HUeH:function(t,e,n){"use strict";var i=n("ClZL"),r=n("XP29");function s(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n("hyoZ"),t.exports.Schema=n("3lC6"),t.exports.FAILSAFE_SCHEMA=n("2YgE"),t.exports.JSON_SCHEMA=n("+VNs"),t.exports.CORE_SCHEMA=n("RSjF"),t.exports.DEFAULT_SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_FULL_SCHEMA=n("VtPO"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=r.dump,t.exports.safeDump=r.safeDump,t.exports.YAMLException=n("w+qe"),t.exports.MINIMAL_SCHEMA=n("2YgE"),t.exports.SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_SCHEMA=n("VtPO"),t.exports.scan=s("scan"),t.exports.parse=s("parse"),t.exports.compose=s("compose"),t.exports.addConstructor=s("addConstructor")},Iab2:function(t,e,n){var i,r;void 0===(r="function"==typeof(i=function(){"use strict";function e(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){o(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function n(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,s=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(t,s,o){var a=r.URL||r.webkitURL,l=document.createElement("a");l.download=s=s||t.name||"download",l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?i(l):n(l.href)?e(t,s,o):i(l,l.target="_blank")):(l.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){i(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,r,s){if(r=r||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,s),r);else if(n(t))e(t,r,s);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){i(o)})}}:function(t,n,i,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,i);var a="application/octet-stream"===t.type,l=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var h=new FileReader;h.onloadend=function(){var t=h.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},h.readAsDataURL(t)}else{var u=r.URL||r.webkitURL,d=u.createObjectURL(t);o?o.location=d:location.href=d,o=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});r.saveAs=o.saveAs=o,t.exports=o})?i.apply(e,[]):i)||(t.exports=r)},LFvy:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},Ljib:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},MERt:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},Njqi:function(t,e,n){"use strict";var i;try{i=n("+U4B")}catch(s){"undefined"!=typeof window&&(i=window.esprima)}var r=n("hyoZ");t.exports=new r("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e=i.parse("("+t+")",{range:!0});return"Program"===e.type&&1===e.body.length&&"ExpressionStatement"===e.body[0].type&&("ArrowFunctionExpression"===e.body[0].expression.type||"FunctionExpression"===e.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,n="("+t+")",r=i.parse(n,{range:!0}),s=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"ArrowFunctionExpression"!==r.body[0].expression.type&&"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(t){s.push(t.name)}),e=r.body[0].expression.body.range,new Function(s,"BlockStatement"===r.body[0].expression.body.type?n.slice(e[0]+1,e[1]-1):"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},Pe6h:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ"),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!s.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,i,r;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){r.unshift(parseFloat(t,10))}),e=0,i=1,r.forEach(function(t){e+=t*i,i*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||i.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(t))return"-0.0";return n=t.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},RSjF:function(t,e,n){"use strict";var i=n("3lC6");t.exports=new i({include:[n("+VNs")]})},UQ3f:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},VtPO:function(t,e,n){"use strict";var i=n("3lC6");t.exports=i.DEFAULT=new i({include:[n("Z3Ei")],explicit:[n("MERt"),n("UQ3f"),n("Njqi")]})},XP29:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("w+qe"),s=n("VtPO"),o=n("Z3Ei"),a=Object.prototype.toString,l=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},h=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function u(t){var e,n,s;if(e=t.toString(16).toUpperCase(),t<=255)n="x",s=2;else if(t<=65535)n="u",s=4;else{if(!(t<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+i.repeat("0",s-e.length)+e}function d(t){this.schema=t.schema||s,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=i.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,i,r,s,o,a,c;if(null===e)return{};for(n={},r=0,s=(i=Object.keys(e)).length;r0?e.charCodeAt(o-1):null,f=f&&v(a,l)}else{for(o=0;or&&" "!==e[p+1],p=o);else if(!m(a))return 5;l=o>0?e.charCodeAt(o-1):null,f=f&&v(a,l)}u=u||d&&o-p-1>r&&" "!==e[p+1]}return h||u?i>9&&y(e)?5:u?4:3:f&&!function(e){return function(t,e){var n,i;for(n=0,i=t.implicitTypes.length;n-1&&n>=t.flowLevel,t.indent,o)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+w(e,t.indent)+x(p(e,s));case 4:return">"+w(e,t.indent)+x(p(function(t,e){for(var n,i,r,s=/(\n+)([^\n]*)/g,o=(r=t.indexOf("\n"),s.lastIndex=r=-1!==r?r:t.length,_(t.slice(0,r),e)),a="\n"===t[0]||" "===t[0];i=s.exec(t);){var l=i[2];n=" "===l[0],o+=i[1]+(a||n||""===l?"":"\n")+_(l,e),a=n}return o}(e,o),s));case 5:return'"'+function(t){for(var e,n,i,r="",s=0;s=55296&&e<=56319&&(n=t.charCodeAt(s+1))>=56320&&n<=57343?(r+=u(1024*(e-55296)+n-56320+65536),s++):r+=!(i=c[e])&&m(e)?t[s]:i||u(e);return r}(e)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function w(t,e){var n=y(t)?String(e):"",i="\n"===t[t.length-1];return n+(!i||"\n"!==t[t.length-2]&&"\n"!==t?i?"":"-":"+")+"\n"}function x(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function _(t,e){if(""===t||" "===t[0])return t;for(var n,i,r=/ [^ ]/g,s=0,o=0,a=0,l="";n=r.exec(t);)(a=n.index)-s>e&&(l+="\n"+t.slice(s,i=o>s?o:a),s=i+1),o=a;return l+="\n",(l+=t.length-s>e&&o>s?t.slice(s,o)+"\n"+t.slice(o+1):t.slice(s)).slice(1)}function C(t,e,n){var i,s,o,c,h,u;for(o=0,c=(s=n?t.explicitTypes:t.implicitTypes).length;o tag resolver accepts not "'+u+'" style');i=h.represent[u](e,u)}t.dump=i}return!0}return!1}function S(t,e,n,i,s,o){t.tag=null,t.dump=n,C(t,n,!1)||C(t,n,!0);var l=a.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var c,h,u="[object Object]"===l||"[object Array]"===l;if(u&&(h=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||h||2!==t.indent&&e>0)&&(s=!1),h&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(u&&h&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(function(t,e,n,i){var s,o,a,l,c,h,u="",d=t.tag,p=Object.keys(n);if(!0===t.sortKeys)p.sort();else if("function"==typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new r("sortKeys must be a boolean or a function");for(s=0,o=p.length;s1024)&&(t.dump&&10===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,c&&(h+=f(t,e)),S(t,e+1,l,!0,c)&&(t.dump&&10===t.dump.charCodeAt(0)?h+=":":h+=": ",u+=h+=t.dump));t.tag=d,t.dump=u||"{}"}(t,e,t.dump,s),h&&(t.dump="&ref_"+c+t.dump)):(function(t,e,n){var i,r,s,o,a,l="",c=t.tag,h=Object.keys(n);for(i=0,r=h.length;i1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),S(t,e,o,!1,!1)&&(l+=a+=t.dump));t.tag=c,t.dump="{"+l+"}"}(t,e,t.dump),h&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===l){var d=t.noArrayIndent&&e>0?e-1:e;i&&0!==t.dump.length?(function(t,e,n,i){var r,s,o="",a=t.tag;for(r=0,s=n.length;r "+t.dump)}return!0}function E(t,e){var n,i,r=[],s=[];for(k(t,r,s),n=0,i=s.length;n=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=s.match(/ Gecko\/\d+/),e.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,e.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,e.isAIR=s.indexOf("AdobeAIR")>=0,e.isAndroid=s.indexOf("Android")>=0,e.isChromeOS=s.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./useragent");if(e.buildDom=function t(e,n,i){if("string"==typeof e&&e){var r=document.createTextNode(e);return n&&n.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&n&&n.appendChild(e),e;if("string"!=typeof e[0]||!e[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var r=document.createElement("div");e.HI_DPI&&void 0!==r.style.transform&&(e.HAS_CSS_TRANSFORMS=!0),i.isEdge||void 0===r.style.animationName||(e.HAS_CSS_ANIMATION=!0),r=null}e.translate=e.HAS_CSS_TRANSFORMS?function(t,e,n){t.style.transform="translate("+Math.round(e)+"px, "+Math.round(n)+"px)"}:function(t,e,n){t.style.top=Math.round(n)+"px",t.style.left=Math.round(e)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,e,n){"use strict";e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},e.implement=function(t,n){e.mixin(t,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./oop"),r=function(){var t,e,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(e in n.FUNCTION_KEYS)t=n.FUNCTION_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);for(e in n.PRINTABLE_KEYS)t=n.PRINTABLE_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)n.KEY_MODS[e]=t.filter(function(t){return e&n.KEY_MODS[t]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(e,r),e.keyCodeToString=function(t){var e=r[t];return"string"!=typeof e&&(e=String.fromCharCode(t)),e.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i,r=t("./keys"),s=t("./useragent"),o=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){i={passive:!1}}})}catch(t){}}(),i}function c(t,e,n){this.elem=t,this.type=e,this.callback=n}c.prototype.destroy=function(){u(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=e.addListener=function(t,e,n,i){t.addEventListener(e,n,l()),i&&i.$toDestroy.push(new c(t,e,n))},u=e.removeListener=function(t,e,n){t.removeEventListener(e,n,l())};e.stopEvent=function(t){return e.stopPropagation(t),e.preventDefault(t),!1},e.stopPropagation=function(t){t.stopPropagation&&t.stopPropagation()},e.preventDefault=function(t){t.preventDefault&&t.preventDefault()},e.getButton=function(t){return"dblclick"==t.type?0:"contextmenu"==t.type||s.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.button},e.capture=function(t,e,n){var i=t&&t.ownerDocument||document;function r(t){e&&e(t),n&&n(t),u(i,"mousemove",e),u(i,"mouseup",r),u(i,"dragstart",r)}return h(i,"mousemove",e),h(i,"mouseup",r),h(i,"dragstart",r),r},e.addMouseWheelListener=function(t,e,n){"onmousewheel"in t?h(t,"mousewheel",function(t){void 0!==t.wheelDeltaX?(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8):(t.wheelX=0,t.wheelY=-t.wheelDelta/8),e(t)},n):"onwheel"in t?h(t,"wheel",function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0)}e(t)},n):h(t,"DOMMouseScroll",function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),e(t)},n)},e.addMultiMouseDownListener=function(t,n,i,r,o){var a,l,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(t){if(0!==e.getButton(t)?u=0:t.detail>1?++u>4&&(u=1):u=1,s.isIE){var o=Math.abs(t.clientX-a)>5||Math.abs(t.clientY-l)>5;c&&!o||(u=1),c&&clearTimeout(c),c=setTimeout(function(){c=null},n[u-1]||600),1==u&&(a=t.clientX,l=t.clientY)}if(t._clicks=u,i[r]("mousedown",t),u>4)u=0;else if(u>1)return i[r](d[u],t)}Array.isArray(t)||(t=[t]),t.forEach(function(t){h(t,"mousedown",p,o)})};var d=function(t){return 0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0)};function p(t,e,n){var i=d(e);if(!s.isMac&&o){if(e.getModifierState&&(e.getModifierState("OS")||e.getModifierState("Win"))&&(i|=8),o.altGr){if(3==(3&i))return;o.altGr=0}if(18===n||17===n){var l="location"in e?e.location:e.keyLocation;17===n&&1===l?1==o[n]&&(a=e.timeStamp):18===n&&3===i&&2===l&&e.timeStamp-a<50&&(o.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),i||13!==n||3!==(l="location"in e?e.location:e.keyLocation)||(t(e,i,-n),!e.defaultPrevented)){if(s.isChromeOS&&8&i){if(t(e,i,n),e.defaultPrevented)return;i&=-9}return!!(i||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&t(e,i,n)}}function f(){o=Object.create(null)}if(e.getModifierString=function(t){return r.KEY_MODS[d(t)]},e.addCommandKeyListener=function(t,n,i){if(s.isOldGecko||s.isOpera&&!("KeyboardEvent"in window)){var r=null;h(t,"keydown",function(t){r=t.keyCode},i),h(t,"keypress",function(t){return p(n,t,r)},i)}else{var a=null;h(t,"keydown",function(t){o[t.keyCode]=(o[t.keyCode]||0)+1;var e=p(n,t,t.keyCode);return a=t.defaultPrevented,e},i),h(t,"keypress",function(t){a&&(t.ctrlKey||t.altKey||t.shiftKey||t.metaKey)&&(e.stopEvent(t),a=null)},i),h(t,"keyup",function(t){o[t.keyCode]=null},i),o||(f(),h(window,"focus",f))}},"object"==typeof window&&window.postMessage&&!s.isOldIE){var g=1;e.nextTick=function(t,n){n=n||window;var i="zero-timeout-message-"+g++,r=function(s){s.data==i&&(e.stopPropagation(s),u(n,"message",r),t())};h(n,"message",r),n.postMessage(i,"*")}}e.$idleBlocked=!1,e.onIdle=function(t,n){return setTimeout(function n(){e.$idleBlocked?setTimeout(n,100):t()},n)},e.$idleBlockId=null,e.blockIdle=function(t){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout(function(){e.$idleBlocked=!1},t||100)},e.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame=e.nextFrame?e.nextFrame.bind(window):function(t){setTimeout(t,17)}}),ace.define("ace/range",["require","exports","module"],function(t,e,n){"use strict";var i=function(t,e,n,i){this.start={row:t,column:e},this.end={row:n,column:i}};(function(){this.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(t,e){return 0==this.compare(t,e)},this.compareRange=function(t){var e,n=t.end,i=t.start;return 1==(e=this.compare(n.row,n.column))?1==(e=this.compare(i.row,i.column))?2:0==e?1:0:-1==e?-2:-1==(e=this.compare(i.row,i.column))?-1:1==e?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(t){var e=this.compareRange(t);return-1==e||0==e||1==e},this.isEnd=function(t,e){return this.end.row==t&&this.end.column==e},this.isStart=function(t,e){return this.start.row==t&&this.start.column==e},this.setStart=function(t,e){"object"==typeof t?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=e)},this.setEnd=function(t,e){"object"==typeof t?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=e)},this.inside=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)&&!this.isStart(t,e)},this.insideStart=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)},this.insideEnd=function(t,e){return 0==this.compare(t,e)&&!this.isStart(t,e)},this.compare=function(t,e){return this.isMultiLine()||t!==this.start.row?tthis.end.row?1:this.start.row===t?e>=this.start.column?0:-1:this.end.row===t?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(t,e){return this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.compareEnd=function(t,e){return this.end.row==t&&this.end.column==e?1:this.compare(t,e)},this.compareInside=function(t,e){return this.end.row==t&&this.end.column==e?1:this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.clipRows=function(t,e){if(this.end.row>e)var n={row:e+1,column:0};else this.end.rowe)var r={row:e+1,column:0};else this.start.row0;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n};var i=/^\s\s*/,r=/\s\s*$/;e.stringTrimLeft=function(t){return t.replace(i,"")},e.stringTrimRight=function(t){return t.replace(r,"")},e.copyObject=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.copyArray=function(t){for(var e=[],n=0,i=t.length;nDate.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=t("../lib/dom"),o=t("../lib/lang"),a=t("../clipboard"),l=r.isChrome<18,c=r.isIE,h=r.isChrome>63,u=400,d=t("../lib/keys"),p=d.KEY_MODS,f=r.isIOS,g=f?/\s/:/\n/,m=r.isMobile;e.TextInput=function(t,e){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",t.insertBefore(n,t.firstChild);var v=!1,y=!1,b=!1,w=!1,x="";m||(n.style.fontSize="1px");var _=!1,C=!1,S="",E=0,k=0,A=0;try{var D=document.activeElement===n}catch(G){}i.addListener(n,"blur",function(t){C||(e.onBlur(t),D=!1)},e),i.addListener(n,"focus",function(t){if(!C){if(D=!0,r.isEdge)try{if(!document.hasFocus())return}catch(t){}e.onFocus(t),r.isEdge?setTimeout(T):T()}},e),this.$focusScroll=!1,this.focus=function(){if(x||h||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var t=n.style.top;n.style.position="fixed",n.style.top="0px";try{var e=0!=n.getBoundingClientRect().top}catch(G){return}var i=[];if(e)for(var r=n.parentElement;r&&1==r.nodeType;)i.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;n.focus({preventScroll:!0}),e&&i.forEach(function(t){t.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=t)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return D},e.on("beforeEndOperation",function(){var t=e.curOp,i=t&&t.command&&t.command.name;"insertstring"!=i&&(b&&i&&(t.docChanged||t.selectionChanged)&&(S=n.value="",U()),T())});var T=f?function(t){if(D&&(!v||t)&&!w){t||(t="");var i="\n ab"+t+"cde fg\n";i!=n.value&&(n.value=S=i);var r=4+(t.length||(e.selection.isEmpty()?0:1));4==E&&k==r||n.setSelectionRange(4,r),E=4,k=r}}:function(){if(!b&&!w&&(D||F)){b=!0;var t=0,i=0,r="";if(e.session){var s=e.selection,o=s.getRange(),a=s.cursor.row;if(t=o.start.column,i=o.end.column,r=e.session.getLine(a),o.start.row!=a){var l=e.session.getLine(a-1);t=o.start.rowa+1?c.length:i,i+=r.length+1,r=r+"\n"+c}else m&&a>0&&(r="\n"+r,i+=1,t+=1);r.length>u&&(t0&&S[d]==t[d];)d++,a--;for(c=c.slice(d),d=1;l>0&&S.length-d>E-1&&S[S.length-d]==t[t.length-d];)d++,l--;h-=d-1,u-=d-1;var p=c.length-d+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(i||c||h||a||l||u))return"";w=!0;var f=!1;return r.isAndroid&&". "==c&&(c=" ",f=!0),c&&!a&&!l&&!h&&!u||_?e.onTextInput(c):e.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:u}),w=!1,S=t,E=s,k=o,A=u,f?"\n":c},M=function(t){if(b)return B();if(t&&t.inputType){if("historyUndo"==t.inputType)return e.execCommand("undo");if("historyRedo"==t.inputType)return e.execCommand("redo")}var i=n.value,r=L(i,!0);(i.length>500||g.test(r)||m&&E<1&&E==k)&&T()},I=function(t,e,n){var i=t.clipboardData||window.clipboardData;if(i&&!l){var r=c||n?"Text":"text/plain";try{return e?!1!==i.setData(r,e):i.getData(r)}catch(t){if(!n)return I(t,e,!0)}}},$=function(t,r){var s=e.getCopyText();if(!s)return i.preventDefault(t);I(t,s)?(f&&(T(s),v=s,setTimeout(function(){v=!1},10)),r?e.onCut():e.onCopy(),i.preventDefault(t)):(v=!0,n.value=s,n.select(),setTimeout(function(){v=!1,T(),r?e.onCut():e.onCopy()}))},O=function(t){$(t,!0)},P=function(t){$(t,!1)},N=function(t){var s=I(t);a.pasteCancelled()||("string"==typeof s?(s&&e.onPaste(s,t),r.isIE&&setTimeout(T),i.preventDefault(t)):(n.value="",y=!0))};i.addCommandKeyListener(n,e.onCommandKey.bind(e),e),i.addListener(n,"select",function(t){b||(v?v=!1:function(t){return 0===t.selectionStart&&t.selectionEnd>=S.length&&t.value===S&&S&&t.selectionEnd!==k}(n)?(e.selectAll(),T()):m&&n.selectionStart!=E&&T())},e),i.addListener(n,"input",M,e),i.addListener(n,"cut",O,e),i.addListener(n,"copy",P,e),i.addListener(n,"paste",N,e),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(t,"keydown",function(t){if((!r.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:P(t);break;case 86:N(t);break;case 88:O(t)}},e);var B=function(){if(b&&e.onCompositionUpdate&&!e.$readOnly){if(_)return V();b.useTextareaForIME?e.onCompositionUpdate(n.value):(L(n.value),b.markerRange&&(b.context&&(b.markerRange.start.column=b.selectionStart=b.context.compositionStartOffset),b.markerRange.end.column=b.markerRange.start.column+k-b.selectionStart+A))}},U=function(t){e.onCompositionEnd&&!e.$readOnly&&(b=!1,e.onCompositionEnd(),e.off("mousedown",V),t&&M())};function V(){C=!0,n.blur(),n.focus(),C=!1}var H,j=o.delayedCall(B,50).schedule.bind(null,null);function z(){clearTimeout(H),H=setTimeout(function(){x&&(n.style.cssText=x,x=""),e.renderer.$isMousePressed=!1,e.renderer.$keepTextAreaAtCursor&&e.renderer.$moveTextAreaToCursor()},0)}i.addListener(n,"compositionstart",function(t){if(!b&&e.onCompositionStart&&!e.$readOnly&&(b={},!_)){t.data&&(b.useTextareaForIME=!1),setTimeout(B,0),e._signal("compositionStart"),e.on("mousedown",V);var i=e.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,b.markerRange=i,b.selectionStart=E,e.onCompositionStart(b),b.useTextareaForIME?(S=n.value="",E=0,k=0):(n.msGetInputContext&&(b.context=n.msGetInputContext()),n.getInputContext&&(b.context=n.getInputContext()))}},e),i.addListener(n,"compositionupdate",B,e),i.addListener(n,"keyup",function(t){27==t.keyCode&&n.value.lengthk&&"\n"==S[s]?o=d.end:ik&&S.slice(0,s).split("\n").length>2?o=d.down:s>k&&" "==S[s-1]?(o=d.right,a=p.option):(s>k||s==k&&k!=E&&i==s)&&(o=d.right),i!==s&&(a|=p.shift),o){if(!e.onCommandKey({},a,o)&&e.commands){o=d.keyCodeToString(o);var l=e.commands.findKeyCommand(a,o);l&&e.execCommand(l)}E=i,k=s,T("")}}};document.addEventListener("selectionchange",s),e.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,e,n)},e.$setUserAgentForTests=function(t,e){m=t,f=e}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/useragent");function r(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function s(t,e){if(t.start.row==t.end.row)var n=2*e.column-t.start.column-t.end.column;else n=t.start.row!=t.end.row-1||t.start.column||t.end.column?2*e.row-t.start.row-t.end.row:e.column-4;return n<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}(function(){this.onMouseDown=function(t){var e=t.inSelection(),n=t.getDocumentPosition();this.mousedownEvent=t;var r=this.editor,s=t.getButton();return 0!==s?((r.getSelectionRange().isEmpty()||1==s)&&r.selection.moveToPosition(n),void(2==s&&(r.textInput.onContextMenu(t.domEvent),i.isMozilla||t.preventDefault()))):(this.mousedownEvent.time=Date.now(),!e||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(t),this.startSelect(n,t.domEvent._clicks>1),t.preventDefault()):(this.setState("focusWait"),void this.captureMouse(t)))},this.startSelect=function(t,e){t=t||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(t):e||n.selection.moveToPosition(t),e||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)t=this.$clickSelection.end;else if(1==i)t=this.$clickSelection.start;else{var r=s(this.$clickSelection,n);n=r.cursor,t=r.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(t){var e,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[t](i.row,i.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==o&&a<=0)e=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&o>=0)e=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==o&&1==a)i=r.end,e=r.start;else{var l=s(this.$clickSelection,i);i=l.cursor,e=l.anchor}n.selection.setSelectionAnchor(e.row,e.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var t,e,n=(t=this.mousedownEvent.y,e=this.y,Math.sqrt(Math.pow(this.x-this.mousedownEvent.x,2)+Math.pow(e-t,2))),i=Date.now();(n>0||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(t){var e=t.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(t){var e=t.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(t){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(t){if(!t.getAccelKey()){t.getShiftKey()&&t.wheelY&&!t.wheelX&&(t.wheelX=t.wheelY,t.wheelY=0);var e=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=t.domEvent.timeStamp,r=i-n.t,s=r?t.wheelX/r:n.vx,o=r?t.wheelY/r:n.vy;r<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&e.renderer.isScrollableBy(t.wheelX*t.speed,0)&&(l=!0),a<=1&&e.renderer.isScrollableBy(0,t.wheelY*t.speed)&&(l=!0),l?n.allowed=i:i-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=s,n.vy=o,l?(e.renderer.scrollBy(t.wheelX*t.speed,t.wheelY*t.speed),t.stop()):void 0}}}).call(r.prototype),e.DefaultHandlers=r}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(t,e,n){"use strict";t("./lib/oop");var i=t("./lib/dom");function r(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(t){this.getElement().textContent=t},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(t,e){this.getElement().style.left=t+"px",this.getElement().style.top=e+"px"},this.setClassName=function(t){i.addCssClass(this.getElement(),t)},this.show=function(t,e,n){null!=t&&this.setText(t),null!=e&&null!=n&&this.setPosition(e,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),e.Tooltip=r}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/oop"),s=t("../lib/event"),o=t("../tooltip").Tooltip;function a(t){o.call(this,t)}r.inherits(a,o),(function(){this.setPosition=function(t,e){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),s=this.getHeight();(t+=15)+r>n&&(t-=t+r-n),(e+=15)+s>i&&(e-=20+s),o.prototype.setPosition.call(this,t,e)}}).call(a.prototype),e.GutterHandler=function(t){var e,n,r,o=t.editor,l=o.renderer.$gutterLayer,c=new a(o.container);function h(){e&&(e=clearTimeout(e)),r&&(c.hide(),r=null,o._signal("hideGutterTooltip",c),o.off("mousewheel",h))}function u(t){c.setPosition(t.x,t.y)}t.editor.setDefaultHandler("guttermousedown",function(e){if(o.isFocused()&&0==e.getButton()&&"foldWidgets"!=l.getRegion(e)){var n=e.getDocumentPosition().row,i=o.session.selection;if(e.getShiftKey())i.selectTo(n,0);else{if(2==e.domEvent.detail)return o.selectAll(),e.preventDefault();t.$clickSelection=o.selection.getLineRange(n)}return t.setState("selectByLines"),t.captureMouse(e),e.preventDefault()}}),t.editor.setDefaultHandler("guttermousemove",function(s){if(i.hasCssClass(s.domEvent.target||s.domEvent.srcElement,"ace_fold-widget"))return h();r&&t.$tooltipFollowsMouse&&u(s),n=s,e||(e=setTimeout(function(){e=null,n&&!t.isMousePressed?function(){var e=n.getDocumentPosition().row,i=l.$annotations[e];if(!i)return h();if(e==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return h()}if(r!=i)if(r=i.text.join("
"),c.setHtml(r),c.show(),o._signal("showGutterTooltip",c),o.on("mousewheel",h),t.$tooltipFollowsMouse)u(n);else{var d=n.domEvent.target.getBoundingClientRect(),p=c.getElement().style;p.left=d.right+"px",p.top=d.bottom+"px"}}():h()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(t){n=null,r&&!e&&(e=setTimeout(function(){e=null,h()},50))},o),o.on("changeSession",h)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=e.MouseEvent=function(t,e){this.domEvent=t,this.editor=e,this.x=this.clientX=t.clientX,this.y=this.clientY=t.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var t=this.editor.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=t.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/event"),s=t("../lib/useragent");function o(t){var e=t.editor,n=i.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),e.on("mousedown",this.onMouseDown.bind(t));var o,l,c,h,u,d,p,f,g,m,v,y=e.container,b=0;function w(){var t=d;(function(t,n){var i=Date.now();m&&n&&t.row==n.row&&n&&t.column==n.column?a(v.x,v.y,l,c)>5?m=null:i-m>=200&&(e.renderer.scrollCursorIntoView(),m=null):(e.moveCursorToPosition(t),m=i,v={x:l,y:c})})(d=e.renderer.screenToTextCoordinates(l,c),t),function(t,n){var i=Date.now(),r=e.renderer.layerConfig.lineHeight,s=e.renderer.layerConfig.characterWidth,o=e.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:c-o.top,bottom:o.bottom-c}},h=Math.min(a.x.left,a.x.right),u=Math.min(a.y.top,a.y.bottom),d={row:t.row,column:t.column};h/s<=2&&(d.column+=a.x.left=200&&e.renderer.scrollCursorIntoView(d):g=i:g=null}(d,t)}function x(){u=e.selection.toOrientedRange(),o=e.session.addMarker(u,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),w(),h=setInterval(w,20),b=0,r.addListener(document,"mousemove",S)}function _(){clearInterval(h),e.session.removeMarker(o),o=null,e.selection.fromOrientedRange(u),e.isFocused()&&!f&&e.$resetCursorStyle(),u=null,d=null,b=0,g=null,m=null,r.removeListener(document,"mousemove",S)}this.onDragStart=function(t){if(this.cancelDrag||!y.draggable){var i=this;return setTimeout(function(){i.startSelect(),i.captureMouse(t)},0),t.preventDefault()}u=e.getSelectionRange();var r=t.dataTransfer;r.effectAllowed=e.getReadOnly()?"copy":"copyMove",s.isOpera&&(e.container.appendChild(n),n.scrollTop=0),r.setDragImage&&r.setDragImage(n,0,0),s.isOpera&&e.container.removeChild(n),r.clearData(),r.setData("Text",e.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(t){y.draggable=!1,f=!1,this.setState(null),e.getReadOnly()||(p||"move"!=t.dataTransfer.dropEffect||e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||x(),b++,t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragOver=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||(x(),b++),null!==C&&(C=null),t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragLeave=function(t){if(--b<=0&&o)return _(),p=null,r.preventDefault(t)},this.onDrop=function(t){if(d){var n=t.dataTransfer;if(f)switch(p){case"move":u=u.contains(d.row,d.column)?{start:d,end:d}:e.moveText(u,d);break;case"copy":u=e.moveText(u,d,!0)}else{var i=n.getData("Text");u={start:d,end:e.session.insert(d,i)},e.focus(),p=null}return _(),r.preventDefault(t)}},r.addListener(y,"dragstart",this.onDragStart.bind(t),e),r.addListener(y,"dragend",this.onDragEnd.bind(t),e),r.addListener(y,"dragenter",this.onDragEnter.bind(t),e),r.addListener(y,"dragover",this.onDragOver.bind(t),e),r.addListener(y,"dragleave",this.onDragLeave.bind(t),e),r.addListener(y,"drop",this.onDrop.bind(t),e);var C=null;function S(){null==C&&(C=setTimeout(function(){null!=C&&o&&_()},20))}function E(t){var e=t.types;return!e||Array.prototype.some.call(e,function(t){return"text/plain"==t||"Text"==t})}function k(t){var e=["copy","copymove","all","uninitialized"],n=s.isMac?t.altKey:t.ctrlKey,i="uninitialized";try{i=t.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r="none";return n&&e.indexOf(i)>=0?r="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?r="move":e.indexOf(i)>=0&&(r="copy"),r}}function a(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor;t.container.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging"),t.renderer.setCursorStyle(s.isWin?"default":"move"),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&e.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),i=t.getButton();if(1===(t.domEvent.detail||1)&&0===i&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=t.domEvent.target||t.domEvent.srcElement;"unselectable"in r&&(r.unselectable="on"),e.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,e.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(o.prototype),e.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./mouse_event").MouseEvent,r=t("../lib/event"),s=t("../lib/dom");e.addTouchListeners=function(t,e){var n,o,a,l,c,h,u,d,p,f="scroll",g=0,m=0,v=0,y=0;function b(){var t,n,i;p||(t=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var r,o,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,r=e.getCopyText(),o=e.session.getUndoManager().hasUndo(),void p.replaceChild(s.buildDom(n?["span",!r&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],r&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],r&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],t&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),p.firstChild);"paste"==a?t.readText().then(function(t){e.execCommand(a,t)}):a&&("cut"!=a&&"copy"!=a||(t?t.writeText(e.getCopyText()):document.execCommand("copy")),e.execCommand(a)),p.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&e.focus()},p=s.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(t){f="menu",t.stopPropagation(),t.preventDefault(),e.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),i(t)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],e.container));var r=e.selection.cursor,o=e.renderer.textToScreenCoordinates(r.row,r.column),a=e.renderer.textToScreenCoordinates(0,0).pageX,l=e.renderer.scrollLeft,c=e.container.getBoundingClientRect();p.style.top=o.pageY-c.top-3+"px",o.pageX-c.left1)return clearTimeout(c),c=null,a=-1,void(f="zoom");d=e.$mouseHandler.isMousePressed=!0;var s=e.renderer.layerConfig.lineHeight,h=e.renderer.layerConfig.lineHeight,p=t.timeStamp;l=p;var b=r[0],w=b.clientX,_=b.clientY;Math.abs(n-w)+Math.abs(o-_)>s&&(a=-1),n=t.clientX=w,o=t.clientY=_,v=y=0;var C=new i(t,e);if(u=C.getDocumentPosition(),p-a<500&&1==r.length&&!g)m++,t.preventDefault(),t.button=0,function(){c=null,clearTimeout(c),e.selection.moveToPosition(u);var t=m>=2?e.selection.getLineRange(u.row):e.session.getBracketRange(u);t&&!t.isEmpty()?e.selection.setRange(t):e.selection.selectWord(),f="wait"}();else{m=0;var S=e.selection.cursor,E=e.selection.isEmpty()?S:e.selection.anchor,k=e.renderer.$cursorLayer.getPixelPosition(S,!0),A=e.renderer.$cursorLayer.getPixelPosition(E,!0),D=e.renderer.scroller.getBoundingClientRect(),T=e.renderer.layerConfig.offset,R=e.renderer.scrollLeft,F=function(t,e){return(t/=h)*t+(e=e/s-.75)*e};if(t.clientXM?"cursor":"anchor"),f=M<3.5?"anchor":L<3.5?"cursor":"scroll",c=setTimeout(x,450)}a=p},e),r.addListener(t,"touchend",function(t){d=e.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==f?(f="",g=0):c?(e.selection.moveToPosition(u),g=0,b()):"scroll"==f?(g+=60,h=setInterval(function(){g--<=0&&(clearInterval(h),h=null),Math.abs(v)<.01&&(v=0),Math.abs(y)<.01&&(y=0),g<20&&(v*=.9),g<20&&(y*=.9);var t=e.session.getScrollTop();e.renderer.scrollBy(10*v,10*y),t==e.session.getScrollTop()&&(g=0)},10),w()):b(),clearTimeout(c),c=null},e),r.addListener(t,"touchmove",function(t){c&&(clearTimeout(c),c=null);var r=t.touches;if(!(r.length>1||"zoom"==f)){var s=r[0],a=n-s.clientX,h=o-s.clientY;if("wait"==f){if(!(a*a+h*h>4))return t.preventDefault();f="cursor"}n=s.clientX,o=s.clientY,t.clientX=s.clientX,t.clientY=s.clientY;var u=t.timeStamp,d=u-l;if(l=u,"scroll"==f){var p=new i(t,e);p.speed=1,p.wheelX=a,p.wheelY=h,10*Math.abs(a)1&&(r=n[n.length-2]);var o=l[e+"Path"];return null==o?o=l.basePath:"/"==i&&(e=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+e+i+r+this.get("suffix")},e.setModuleUrl=function(t,e){return l.$moduleUrls[t]=e},e.$loading={},e.loadModule=function(n,i){var r,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{r=t(n)}catch(l){}if(r&&!e.$loading[n])return i&&i(r);if(e.$loading[n]||(e.$loading[n]=[]),e.$loading[n].push(i),!(e.$loading[n].length>1)){var a=function(){t([n],function(t){e._emit("load.module",{name:n,module:t});var i=e.$loading[n];e.$loading[n]=null,i.forEach(function(e){e&&e(t)})})};if(!e.get("packaged"))return a();s.loadScript(e.moduleUrl(n,o),a),c()}};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};function h(r){if(a&&a.document){l.packaged=r||t.packaged||i.packaged||a.define&&n("B9Yq").packaged;for(var s,o={},c="",h=document.currentScript||document._currentScript,u=(h&&h.ownerDocument||document).getElementsByTagName("script"),d=0;d=t){for(s=u+1;s=t;)s++;for(a=u,l=s-1;a=e.length||2!=(l=n[r-1])&&3!=l||2!=(c=e[r+1])&&3!=c?4:(s&&(c=3),c==l?c:4);case 10:return 2==(l=r>0?n[r-1]:5)&&r+10&&2==n[r-1])return 2;if(s)return 4;for(p=r+1,d=e.length;p=1425&&g<=2303||64286==g)&&(1==l||7==l))return 1}return r<1||5==(l=e[r-1])?4:n[r-1];case 5:return s=!1,o=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case u:return 4}}function m(t){var e=t.charCodeAt(0),n=e>>8;return 0==n?e>191?0:d[e]:5==n?/[\u0591-\u05f4]/.test(t)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(t)?12:/[\u0660-\u0669\u066b-\u066c]/.test(t)?3:1642==e?h:/[\u06f0-\u06f9]/.test(t)?2:7:32==n&&e<=8287?p[255&e]:254==n&&e>=65136?7:4}e.L=0,e.R=1,e.EN=2,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="\xb7",e.doBidiReorder=function(t,n,h){if(t.length<2)return{};var d=t.split(""),p=new Array(d.length),v=new Array(d.length),y=[];i=h?1:0,function(t,e,n,h){var u=i?c:l,d=null,p=null,f=null,v=0,y=null,b=-1,w=null,x=null,_=[];if(!h)for(w=0,h=[];w0)if(16==y){for(w=b;w-1){for(w=b;w=0&&8==h[C];C--)e[C]=i}}(d,y,d.length,n);for(var b=0;b7&&n[b]<13||4===n[b]||n[b]===u)?y[b]=e.ON_R:b>0&&"\u0644"===d[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[b])&&(y[b-1]=y[b]=e.R_H,b++);for(d[d.length-1]===e.DOT&&(y[d.length-1]=e.B),"\u202b"===d[0]&&(y[0]=e.RLE),b=0;b=0&&(t=this.session.$docRowCache[n])}return t},this.getSplitIndex=function(){var t=0,e=this.session.$screenRowCache;if(e.length)for(var n,i=this.session.$getRowCacheIndex(e,this.currentRow);this.currentRow-t>0&&(n=this.session.$getRowCacheIndex(e,this.currentRow-t-1))===i;)i=n,t++;else t=this.currentRow;return t},this.updateRowLine=function(t,e){void 0===t&&(t=this.getDocumentRow());var n=t===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(t),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[t];s&&(void 0===e&&(e=this.getSplitIndex()),e>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=ee?this.session.getOverwrite()?t:t-1:e,r=i.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&t<=e&&s[r]%2!=0&&r++;for(var a=0;ae&&s[r]%2==0&&(o+=this.charWidths[s[r]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(t,e){var n,i=this.bidiMap,r=i.bidiLevels,s=[],o=0,a=Math.min(t,e)-this.wrapIndent,l=Math.max(t,e)-this.wrapIndent,c=!1,h=!1,u=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,p=0;p=a&&dn+s/2;){if(n+=s,i===r.length-1){s=0;break}s=this.charWidths[r[++i]]}return i>0&&r[i-1]%2!=0&&r[i]%2==0?(t0&&r[i-1]%2==0&&r[i]%2!=0?e=1+(t>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===s&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?e=1+this.bidiMap.logicalFromVisual[i]:(i>0&&r[i-1]%2!=0&&0!==s&&i--,e=this.bidiMap.logicalFromVisual[i]),0===e&&this.isRtlDir&&e++,e+this.wrapIndent}}).call(o.prototype),e.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/lang"),s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(t){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),e.$isEmpty||e.$silent||e._emit("changeSelection"),e.$keepDesiredColumnOnChange||t.old.column==t.value.column||(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,e.$isEmpty||e.$silent||e._emit("changeSelection")})};(function(){i.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?o.fromPoints(e,e):this.isBackwards()?o.fromPoints(e,t):o.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var n=e?t.end:t.start,i=e?t.start:t.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(t,e,n,i){if(!this.$silent){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(n,i),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(void 0===e){var n=t||this.lead;t=n.row,e=n.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var n,i="number"==typeof t?t:this.lead.row,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,!0===e?new o(i,0,n,this.session.getLine(n).length):new o(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,n){var i=t.column,r=t.column+e;return n<0&&(i=t.column-e,r=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(i,r).split(" ").length-1==e},this.moveCursorLeft=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===e.column)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=i)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,e,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(i)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(e)),e>=n.length)return this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,n)}},this.$shortWordEndIndex=function(t){var e,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(t))n=this.session.tokenRe.lastIndex;else{for(;(e=t[n])&&i.test(e);)n++;if(n<1)for(r.lastIndex=0;(e=t[n])&&!r.test(e);)if(r.lastIndex=0,n++,i.test(e)){if(n>2){n--;break}for(;(e=t[n])&&i.test(e);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e),r=this.session.getFoldAt(t,e,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(e==n.length){var s=this.doc.getLength();do{t++,i=this.doc.getLine(t)}while(t0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var s=r.stringReverse(i),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===e&&(0!==t&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=t&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];t<0?t-=r.rowsAbove||0:t>0&&(t+=r.rowCount-(r.rowsAbove||0))}var s=this.session.screenToDocumentPosition(i.row+t,i.column,n);this.moveCursorTo(s.row,s.column+e,0===e)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,n){var i=this.session.getFoldAt(t,e,1);i&&(t=i.start.row,e=i.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(r.charAt(e))&&r.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,n){var i=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var n=this.getCursor();return o.fromPoints(e,n)}catch(i){return o.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(t){var e=t.clone();return e.isBackwards=t.cursor==t.start,e});else(t=this.getRange()).isBackwards=this.isBackwards();return t},this.fromJSON=function(t){if(null==t.start){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var n=o.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),e.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(t,e,n){"use strict";var i=t("./config"),r=2e3,s=function(t){for(var e in this.states=t,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[e],i=[],r=0,s=this.matchMappings[e]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(t,e){return"\\"+(parseInt(e,10)+r+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),s[r]=l,r+=u,i.push(h),c.onMatch||(c.onMatch=null)}}i.length||(s[0]=0,i.push("$")),a.forEach(function(t){t.splitRegex=this.createSplitterRegexp(t.regex,o)},this),this.regExps[e]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(t){r=0|t},this.$applyToken=function(t){var e=this.splitRegex.exec(t).slice(1),n=this.token.apply(this,e);if("string"==typeof n)return[{type:n,value:t}];for(var i=[],r=0,s=n.length;rh){var v=t.substring(h,m-g.length);d.type==p?d.value+=v:(d.type&&c.push(d),d={type:p,value:v})}for(var y=0;yr){for(u>2*t.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:t});h1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},this.reportError=i.reportError}).call(s.prototype),e.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(t,e){if(e)for(var n in t){for(var i=t[n],r=0;r=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var t=this.$rowTokens,e=this.$tokenIndex,n=t[e].start;if(void 0!==n)return n;for(n=0;e>0;)n+=t[e-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var t=this.$rowTokens[this.$tokenIndex],e=this.getCurrentTokenColumn();return new i(this.$row,e,this.$row,e+t.value.length)}}).call(r.prototype),e.TokenIterator=r}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,e,n){"use strict";var i,r=t("../../lib/oop"),s=t("../behaviour").Behaviour,o=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},u={'"':'"',"'":"'"},d=function(t){var e=-1;if(t.multiSelect&&(e=t.selection.index,h.rangeCount!=t.multiSelect.rangeCount&&(h={rangeCount:t.multiSelect.rangeCount})),h[e])return i=h[e];i=h[e]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(t,e,n,i){var r=t.end.row-t.start.row;return{text:n+e+i,selection:[0,t.start.column+1,r,t.end.column+(r?0:1)]}},f=function(t){this.add("braces","insertion",function(e,n,r,s,o){var l=r.getCursorPosition(),c=s.doc.getLine(l.row);if("{"==o){d(r);var h=r.getSelectionRange(),u=s.doc.getTextRange(h);if(""!==u&&"{"!==u&&r.getWrapBehavioursEnabled())return p(h,u,"{","}");if(f.isSaneInsertion(r,s))return/[\]\}\)]/.test(c[l.column])||r.inMultiSelectMode||t&&t.braces?(f.recordAutoInsert(r,s,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(r,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(r),"}"==c.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,c,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(r);var g="";if(f.isMaybeInsertedClosing(l,c)&&(g=a.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var m=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(s.getLine(m.row))}else{if(!g)return void f.clearMaybeInsertedClosing();v=this.$getIndent(c)}var y=v+s.getTabString();return{text:"\n"+y+"\n"+v+g,selection:[1,y.length,1,y.length]}}f.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(t,e,n,r,s){var o=r.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==r.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(t,e,n,i,r){if("("==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(d(n),")"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("brackets","insertion",function(t,e,n,i,r){if("["==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(d(n),"]"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("string_dquotes","insertion",function(t,e,n,i,r){var s=i.$mode.$quotes||u;if(1==r.length&&s[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;d(n);var o=r,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return p(a,l,o,o);if(!l){var c=n.getCursorPosition(),h=i.doc.getLine(c.row),f=h.substring(c.column-1,c.column),g=h.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==f&&m&&/escape/.test(m.type))return null;var y,b=m&&/string|escape/.test(m.type),w=!v||/string|escape/.test(v.type);if(g==o)(y=b!==w)&&/string\.end/.test(v.type)&&(y=!1);else{if(b&&!w)return null;if(b&&w)return null;var x=i.$mode.tokenRe;x.lastIndex=0;var _=x.test(f);x.lastIndex=0;var C=x.test(f);if(_||C)return null;if(g&&!/[\s;,.})\]\\]/.test(g))return null;var S=h[c.column-2];if(f==o&&(S==o||x.test(S)))return null;y=!0}return{text:y?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(t,e,n,i,r){var s=i.$mode.$quotes||u,o=i.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==o))return r.end.column++,r})};f.isSaneInsertion=function(t,e){var n=t.getCursorPosition(),i=new o(e,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(t.session.getLine(n.row)[n.column]))return!0;var r=new o(e,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},f.$matchTokenType=function(t,e){return e.indexOf(t.type||t)>-1},f.recordAutoInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isAutoInsertedClosing(r,s,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=r.row,i.autoInsertedLineEnd=n+s.substr(r.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isMaybeInsertedClosing(r,s)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=r.row,i.maybeInsertedLineStart=s.substr(0,r.column)+n,i.maybeInsertedLineEnd=s.substr(r.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(t,e,n){return i.autoInsertedBrackets>0&&t.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&e.substr(t.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(t,e){return i.maybeInsertedBrackets>0&&t.row===i.maybeInsertedRow&&e.substr(t.column)===i.maybeInsertedLineEnd&&e.substr(0,t.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},r.inherits(f,s),e.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(t,e,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,s=[],o=0;o2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,f=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+l.escapeRegExp(p)+")"),m=new RegExp("(?:"+l.escapeRegExp(f)+")\\s*$"),v=function(t,e){b(t,e)||s&&!/\S/.test(t)||(r.insertInLine({row:e,column:t.length},f),r.insertInLine({row:e,column:a},p))},y=function(t,e){var n;(n=t.match(m))&&r.removeInLine(e,t.length-n[0].length,t.length),(n=t.match(g))&&r.removeInLine(e,n[1].length,n[0].length)},b=function(t,n){if(g.test(t))return!0;for(var i=e.getTokens(n),r=0;rt.length&&(x=t.length)}),a==1/0&&(a=x,s=!1,o=!1),h&&a%c!=0&&(a=Math.floor(a/c)*c),w(o?y:v)},this.toggleBlockComment=function(t,e,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var s,o,a=(g=new c(e,i.row,i.column)).getCurrentToken(),l=e.selection.toOrientedRange();if(a&&/comment/.test(a.type)){for(var u,d;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(r.start))){var p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m;u=new h(p,f,p,f+r.start.length);break}a=g.stepBackward()}var g;for(a=(g=new c(e,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var m;if(-1!=(m=a.value.indexOf(r.end))){p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m,d=new h(p,f,p,f+r.end.length);break}a=g.stepForward()}d&&e.remove(d),u&&(e.remove(u),s=u.start.row,o=-r.start.length)}else o=r.start.length,s=n.start.row,e.insert(n.end,r.end),e.insert(n.start,r.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),e.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(t,e,n){return this.$getIndent(e)},this.checkOutdent=function(t,e,n){return!1},this.autoOutdent=function(t,e,n){},this.$getIndent=function(t){return t.match(/^\s*/)[0]},this.createWorker=function(t){return null},this.createModeDelegates=function(t){for(var e in this.$embeds=[],this.$modes={},t)if(t[e]){var n=t[e],r=n.prototype.$id,s=i.$modes[r];s||(i.$modes[r]=s=new n),i.$modes[e]||(i.$modes[e]=s),this.$embeds.push(e),this.$modes[e]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(e=0;ethis.row)){var n=function(e,n,i){var r="insert"==e.action,s=(r?1:-1)*(e.end.row-e.start.row),o=(r?1:-1)*(e.end.column-e.start.column),a=e.start,l=r?a:e.end;return t(n,a,i)?{row:n.row,column:n.column}:t(l,n,!i)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(t,e,n){var i;if(i=n?{row:t,column:e}:this.$clipPositionToDocument(t,e),this.row!=i.row||this.column!=i.column){var r={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:r,value:i})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,e))),e<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./apply_delta").applyDelta,s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=t("./anchor").Anchor,l=function(t){this.$lines=[""],0===t.length?this.$lines=[""]:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){i.implement(this,s),this.setValue=function(t){var e=this.getLength()-1;this.remove(new o(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},t)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(t,e){return new a(this,t,e)},this.$split=0==="aaa".split(/a/).length?function(t){return t.replace(/\r\n|\r/g,"\n").split("\n")}:function(t){return t.split(/\r\n|\r|\n/)},this.$detectNewLine=function(t){var e=t.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return"\r\n"==t||"\r"==t||"\n"==t},this.getLine=function(t){return this.$lines[t]||""},this.getLines=function(t,e){return this.$lines.slice(t,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(t){var e;if(t.start.row===t.end.row)e=[this.getLine(t.start.row).substring(t.start.column,t.end.column)];else{(e=this.getLines(t.start.row,t.end.row))[0]=(e[0]||"").substring(t.start.column);var n=e.length-1;t.end.row-t.start.row==n&&(e[n]=e[n].substring(0,t.end.column))}return e},this.insertLines=function(t,e){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(t,e)},this.removeLines=function(t,e){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(t,e)},this.insertNewLine=function(t){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(t,["",""])},this.insert=function(t,e){return this.getLength()<=1&&this.$detectNewLine(e),this.insertMergedLines(t,this.$split(e))},this.insertInLine=function(t,e){var n=this.clippedPos(t.row,t.column),i=this.pos(t.row,t.column+e.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[e]},!0),this.clonePos(i)},this.clippedPos=function(t,e){var n=this.getLength();void 0===t?t=n:t<0?t=0:t>=n&&(t=n-1,e=void 0);var i=this.getLine(t);return null==e&&(e=i.length),{row:t,column:e=Math.min(Math.max(e,0),i.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(t,e){return{row:t,column:e}},this.$clipPosition=function(t){var e=this.getLength();return t.row>=e?(t.row=Math.max(0,e-1),t.column=this.getLine(e-1).length):(t.row=Math.max(0,t.row),t.column=Math.min(Math.max(t.column,0),this.getLine(t.row).length)),t},this.insertFullLines=function(t,e){var n=0;(t=Math.min(Math.max(t,0),this.getLength()))0,i=e=0&&this.applyDelta({start:this.pos(t,this.getLine(t).length),end:this.pos(t+1,0),action:"remove",lines:["",""]})},this.replace=function(t,e){return t instanceof o||(t=o.fromPoints(t.start,t.end)),0===e.length&&t.isEmpty()?t.start:e==this.getTextRange(t)?t.end:(this.remove(t),e?this.insert(t.start,e):t.start)},this.applyDeltas=function(t){for(var e=0;e=0;e--)this.revertDelta(t[e])},this.applyDelta=function(t,e){var n="insert"==t.action;(n?t.lines.length<=1&&!t.lines[0]:!o.comparePoints(t.start,t.end))||(n&&t.lines.length>2e4?this.$splitAndapplyLargeDelta(t,2e4):(r(this.$lines,t,e),this._signal("change",t)))},this.$safeApplyDelta=function(t){var e=this.$lines.length;("remove"==t.action&&t.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=e,-1==i&&(i=e),s<=i&&n.fireUpdateEvent(s,i)}}};(function(){i.implement(this,r),this.setTokenizer=function(t){this.tokenizer=t,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(t){this.doc=t,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(t,e){this._signal("update",{data:{first:t,last:e}})},this.start=function(t){this.currentLine=Math.min(t||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.lines[e]=null;else if("remove"==t.action)this.lines.splice(e,n+1,null),this.states.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(t){return this.lines[t]||this.$tokenizeRow(t)},this.getState=function(t){return this.currentLine==t&&this.$tokenizeRow(t),this.states[t]||"start"},this.$tokenizeRow=function(t){var e=this.doc.getLine(t),n=this.tokenizer.getLineTokens(e,this.states[t-1],t);return this.states[t]+""!=n.state+""?(this.states[t]=n.state,this.lines[t+1]=null,this.currentLine>t+1&&(this.currentLine=t+1)):this.currentLine==t&&(this.currentLine=t+1),this.lines[t]=n.tokens}}).call(s.prototype),e.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=(t("./lib/oop"),t("./range").Range),s=function(t,e,n){this.setRegexp(t),this.clazz=e,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+""!=t+""&&(this.regExp=t,this.cache=[])},this.update=function(t,e,n,s){if(this.regExp)for(var o=s.lastRow,a=s.firstRow;a<=o;a++){var l=this.cache[a];null==l&&((l=i.getMatchOffsets(n.getLine(a),this.regExp)).length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(t){return new r(a,t.offset,a,t.offset+t.length)}),this.cache[a]=l.length?l:"");for(var c=l.length;c--;)e.drawSingleLineMarker(t,l[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),e.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../range").Range;function r(t,e){this.foldData=t,Array.isArray(e)?this.folds=e:e=this.folds=[e];var n=e[e.length-1];this.range=new i(e[0].start.row,e[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(t),this.folds.sort(function(t,e){return-t.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(t.start.row,t.start.column)>0?(this.end.row=t.end.row,this.end.column=t.end.column):this.range.compareStart(t.end.row,t.end.column)<0&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(t,e,n){var i,r,s=0,o=this.folds,a=!0;null==e&&(e=this.end.row,n=this.end.column);for(var l=0;l0)){var l=i(t,o.start);return 0===a?e&&0!==l?-s-2:s:l>0||0===l&&!e?s:-s-1}}return-s-1},this.add=function(t){var e=!t.isEmpty(),n=this.pointIndex(t.start,e);n<0&&(n=-n-1);var i=this.pointIndex(t.end,e,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,t)},this.addList=function(t){for(var e=[],n=t.length;n--;)e.push.apply(e,this.add(t[n]));return e},this.substractPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges.splice(e,1)},this.merge=function(){for(var t,e=[],n=this.ranges,r=(n=n.sort(function(t,e){return i(t.start,e.start)}))[0],s=1;s=0},this.containsPoint=function(t){return this.pointIndex(t)>=0},this.rangeAtPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges[e]},this.clipRows=function(t,e){var n=this.ranges;if(n[0].start.row>e||n[n.length-1].start.row=i);o++);if("insert"==t.action){for(var l=r-i,c=-e.column+n.column;oi);o++)if(h.start.row==i&&h.start.column>=e.column&&(h.start.column==e.column&&this.$bias<=0||(h.start.column+=c,h.start.row+=l)),h.end.row==i&&h.end.column>=e.column){if(h.end.column==e.column&&this.$bias<0)continue;h.end.column==e.column&&c>0&&oh.start.column&&h.end.column==s[o+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l}}else for(l=i-r,c=e.column-n.column;or);o++)h.end.rowe.column)&&(h.end.column=e.column,h.end.row=e.row):(h.end.column+=c,h.end.row+=l):h.end.row>r&&(h.end.row+=l),h.start.rowe.column)&&(h.start.column=e.column,h.start.row=e.row):(h.start.column+=c,h.start.row+=l):h.start.row>r&&(h.start.row+=l);if(0!=l&&o=t)return r;if(r.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var n=this.$foldData,i=0;for(e&&(i=n.indexOf(e)),-1==i&&(i=0);i=t)return r}return null},this.getFoldedRowCount=function(t,e){for(var n=this.$foldData,i=e-t+1,r=0;r=e){a=t?i-=e-a:i=0);break}o>=t&&(i-=a>=t?o-a:o-t+1)}return i},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(t,e){return t.start.row-e.start.row}),t},this.addFold=function(t,e){var n,i=this.$foldData,o=!1;t instanceof s?n=t:(n=new s(e,t)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,h=n.end.column,u=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1);if(u&&d==u)return u.addSubFold(n);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(c,h)&&this.removeFold(d);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach(function(t){n.addSubFold(t)}));for(var f=0;f0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(t){this.expandFold(t)},this)},this.unfold=function(t,e){var n,r;if(null==t?(n=new i(0,0,this.getLength(),0),null==e&&(e=!0)):n="number"==typeof t?new i(t,0,t,this.getLine(t).length):"row"in t?i.fromPoints(t,t):t,r=this.getFoldsInRangeList(n),0!=e?this.removeFolds(r):this.expandFolds(r),r.length)return r},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var n=this.getFoldLine(t,e);return n?n.end.row:t},this.getRowFoldStart=function(t,e){var n=this.getFoldLine(t,e);return n?n.start.row:t},this.getFoldDisplayLine=function(t,e,n,i,r){null==i&&(i=t.start.row),null==r&&(r=0),null==e&&(e=t.end.row),null==n&&(n=this.getLine(e).length);var s=this.doc,o="";return t.walk(function(t,e,n,a){if(!(eh)break}while(s&&l.test(s.type));s=r.stepBackward()}else s=r.getCurrentToken();return c.end.row=r.getCurrentTokenRow(),c.end.column=r.getCurrentTokenColumn()+s.value.length-2,c}},this.foldAll=function(t,e,n,i){null==n&&(n=1e5);var r=this.foldWidgets;if(r){e=e||this.getLength();for(var s=t=t||0;s=t&&(s=o.end.row,o.collapseChildren=n,this.addFold("...",o))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var n=t.getTokens(e),i=0;i=0;){var s=n[r];if(null==s&&(s=n[r]=this.getFoldWidget(r)),"start"==s){var o=this.getFoldWidgetRange(r);if(i||(i=o),o&&o.end.row>=t)break}r--}return{range:-1!==r&&o,firstRange:i}},this.onFoldWidgetClick=function(t,e){if(!this.$toggleFoldWidget(t,{children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey})){var n=e.target||e.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var n=this.getFoldWidget(t),i=this.getLine(t),r="end"===n?-1:1,s=this.getFoldAt(t,-1===r?0:i.length,r);if(s)return e.children||e.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(t,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(e.siblings){var a=this.getParentFoldRangeData(t);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,e.all?1e4:0)}else e.children?(c=o?o.end.row:this.getLength(),this.foldAll(t+1,c,e.all?1e4:0)):o&&(e.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var n=this.$toggleFoldWidget(e,{});if(!n){var i=this.getParentFoldRangeData(e,!0);if(n=i.range||i.firstRange){var r=this.getFoldAt(e=n.start.row,this.getLine(e).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.foldWidgets[e]=null;else if("remove"==t.action)this.foldWidgets.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,e,n){"use strict";var i=t("../token_iterator").TokenIterator,r=t("../range").Range;e.BracketMatch=function(){this.findMatchingBracket=function(t,e){if(0==t.column)return null;var n=e||this.getLine(t.row).charAt(t.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t):null},this.getBracketRange=function(t){var e,n=this.getLine(t.row),i=!0,s=n.charAt(t.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(t.column),t={row:t.row,column:t.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),i=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],t)))return null;e=r.fromPoints(t,a),i||(e.end.column++,e.start.column--),e.cursor=e.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],t)))return null;e=r.fromPoints(a,t),i||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(t){var e=this.getLine(t.row),n=e.charAt(t.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=e.charAt(t.column),t={row:t.row,column:t.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!i)return null;var s=new r(t.row,t.column-1,t.row,t.column),o=i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t);return o?[s,new r(o.row,o.column,o.row,o.column+1)]:[s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==r){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else h==t&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;ln&&(this.$docRowCache.splice(n,e),this.$screenRowCache.splice(n,e))},this.$getRowCacheIndex=function(t,e){for(var n=0,i=t.length-1;n<=i;){var r=n+i>>1,s=t[r];if(e>s)n=r+1;else{if(!(e=e);s++);return(n=i[s])?(n.index=s,n.start=r-n.value.length,n):null},this.setUndoManager=function(t){if(this.$undoManager=t,this.$informUndoManager&&this.$informUndoManager.cancel(),t){var e=this;t.addSession(this),this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(t){this.setOption("useSoftTabs",t)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(t){this.setOption("tabSize",t)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(t){return this.$useSoftTabs&&t.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(t){this.setOption("navigateWithinSoftTabs",t)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(t){this.setOption("overwrite",t)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(t,e){this.$decorations[t]||(this.$decorations[t]=""),this.$decorations[t]+=" "+e,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(t,e){this.$decorations[t]=(this.$decorations[t]||"").replace(" "+e,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(t){this.$breakpoints=[];for(var e=0;e0&&(i=!!n.charAt(e-1).match(this.tokenRe)),i||(i=!!n.charAt(e).match(this.tokenRe)),i)var r=this.tokenRe;else r=/^\s+$/.test(n.slice(e-1,e+1))?/\s/:this.nonTokenRe;var s=e;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(r));s++}for(var o=e;ot&&(t=e.screenWidth)}),this.lineWidgetWidth=t},this.$computeWidth=function(t){if(this.$modified||t){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,s=this.$foldData[r],o=s?s.start.row:1/0,a=e.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[r++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(e[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(t,e){return this.doc.getLines(t,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(t,e){return this.doc.insert(t,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(t,e){return this.doc.removeFullLines(t,e)},this.undoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=t.length-1;-1!=n;n--){var i=t[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!e&&this.$undoSelect&&(t.selectionBefore?this.selection.fromJSON(t.selectionBefore):this.selection.setRange(this.$getUndoSelection(t,!0))),this.$fromUndo=!1}},this.redoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=0;nt.end.column&&(s.start.column+=c),s.end.row==t.end.row&&s.end.column>t.end.column&&(s.end.column+=c)),l&&s.start.row>=t.end.row&&(s.start.row+=l,s.end.row+=l)),s.end=this.insert(s.start,i),r.length){var o=t.start,a=s.start,l=a.row-o.row,c=a.column-o.column;this.addFolds(r.map(function(t){return(t=t.clone()).start.row==o.row&&(t.start.column+=c),t.end.row==o.row&&(t.end.column+=c),t.start.row+=l,t.end.row+=l,t}))}return s},this.indentRows=function(t,e,n){n=n.replace(/\t/g,this.getTabString());for(var i=t;i<=e;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(t){for(var e=t.collapseRows(),n=new h(0,0,0,0),i=this.getTabSize(),r=e.start.row;r<=e.end.row;++r){var s=this.getLine(r);n.start.row=r,n.end.row=r;for(var o=0;o0){var r;if((r=this.getRowFoldEnd(e+n))>this.doc.getLength()-1)return 0;i=r-e}else t=this.$clipRowToDocument(t),i=(e=this.$clipRowToDocument(e))-t+1;var s=new h(t,0,e,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(t){return(t=t.clone()).start.row+=i,t.end.row+=i,t}),a=0==n?this.doc.getLines(t,e):this.doc.removeFullLines(t,e);return this.doc.insertFullLines(t+i,a),o.length&&this.addFolds(o),i},this.moveLinesUp=function(t,e){return this.$moveLines(t,e,-1)},this.moveLinesDown=function(t,e){return this.$moveLines(t,e,1)},this.duplicateLines=function(t,e){return this.$moveLines(t,e,0)},this.$clipRowToDocument=function(t){return Math.max(0,Math.min(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(t,e){return e<0?0:Math.min(this.doc.getLine(t).length,e)},this.$clipPositionToDocument=function(t,e){if(e=Math.max(0,e),t<0)t=0,e=0;else{var n=this.doc.getLength();t>=n?(t=n-1,e=this.doc.getLine(n-1).length):e=Math.min(this.doc.getLine(t).length,e)}return{row:t,column:e}},this.$clipRangeToDocument=function(t){t.start.row<0?(t.start.row=0,t.start.column=0):t.start.column=this.$clipColumnToRow(t.start.row,t.start.column);var e=this.doc.getLength()-1;return t.end.row>e?(t.end.row=e,t.end.column=this.doc.getLine(e).length):t.end.column=this.$clipColumnToRow(t.end.row,t.end.column),t},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(t){if(t!=this.$useWrapMode){if(this.$useWrapMode=t,this.$modified=!0,this.$resetRowCache(0),t){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(t,e){this.$wrapLimitRange.min===t&&this.$wrapLimitRange.max===e||(this.$wrapLimitRange={min:t,max:e},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(t,e){var n=this.$wrapLimitRange;n.max<0&&(n={min:e,max:e});var i=this.$constrainWrapLimit(t,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(t,e,n){return e&&(t=Math.max(e,t)),n&&(t=Math.min(n,t)),t},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(t){this.setWrapLimitRange(t,t)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(t){var e=this.$useWrapMode,n=t.action,i=t.start,r=t.end,s=i.row,o=r.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[e?"$wrapData":"$rowLengthCache"].splice(s,a);var c=this.$foldData;l=this.getFoldsInRange(t),this.removeFolds(l);var h=0;if(g=this.getFoldLine(r.row)){g.addRemoveChars(r.row,r.column,i.column-r.column),g.shiftRow(-a);var u=this.getFoldLine(s);u&&u!==g&&(u.merge(g),g=u),h=c.indexOf(g)+1}for(;h=r.row&&g.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var p=e?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,d),c=this.$foldData,h=0,g=this.getFoldLine(s)){var f=g.range.compareInside(i.row,i.column);0==f?(g=g.split(i.row,i.column))&&(g.shiftRow(a),g.addRemoveChars(o,0,r.column-i.column)):-1==f&&(g.addRemoveChars(s,0,r.column-i.column),g.shiftRow(a)),h=c.indexOf(g)+1}for(;h=s&&g.shiftRow(a)}}else a=Math.abs(t.start.column-t.end.column),"remove"===n&&(l=this.getFoldsInRange(t),this.removeFolds(l),a=-a),(g=this.getFoldLine(s))&&g.addRemoveChars(s,i.column,a);return e&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,e?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(t,e,n){this.$rowLengthCache[t]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(n,i){var r,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,h=n;for(i=Math.min(i,o.length-1);h<=i;)(s=this.getFoldLine(h,s))?(r=[],s.walk((function(n,i,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,r.length))[0]=t;for(var c=1;c=4352&&t<=4447||t>=4515&&t<=4519||t>=4602&&t<=4607||t>=9001&&t<=9002||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12283||t>=12288&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12589||t>=12593&&t<=12686||t>=12688&&t<=12730||t>=12736&&t<=12771||t>=12784&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=13054||t>=13056&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=55216&&t<=55238||t>=55243&&t<=55291||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=65281&&t<=65376||t>=65504&&t<=65510)}this.$computeWrapSplits=function(n,i,r){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,c=this.$wrapAsCode,h=this.$indentedSoftWrap,u=i<=Math.max(2*r,8)||!1===h?0:Math.floor(i/2);function d(t){for(var e=t-a,i=a;ii-p;){var f=a+i-p;if(n[f-1]>=10&&n[f]>=10)d(f);else if(n[f]!=t&&n[f]!=e){for(var g=Math.max(f-(i-(i>>2)),a-1);f>g&&n[f]g&&n[f]g&&9==n[f];)f--}else for(;f>g&&n[f]<10;)f--;f>g?d(++f):(2==n[f=a+i]&&f--,d(f-p))}else{for(;f!=a-1&&n[f]!=t;f--);if(f>a){d(f);continue}for(f=a+i;f39&&o<48||o>57&&o<64?r.push(9):o>=4352&&n(o)?r.push(1,2):r.push(1)}return r},this.$getStringScreenWidth=function(t,e,i){if(0==e)return[0,0];var r,s;for(null==e&&(e=1/0),i=i||0,s=0;s=4352&&n(r)?i+=2:i+=1,!(i>e));s++);return[i,s]},this.lineWidgets=null,this.getRowLength=function(t){var e=1;return this.lineWidgets&&(e+=this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0),this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+e:e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(t){if(this.$useWrapMode){var e=this.screenToDocumentPosition(t,Number.MAX_VALUE),n=this.$wrapData[e.row];return n.length&&n[0]=0){a=c[h],s=this.$docRowCache[h];var d=t>c[u-1]}else d=!u;for(var p=this.getLength()-1,f=this.getNextFoldLine(s),g=f?f.start.row:1/0;a<=t&&!(a+(l=this.getRowLength(s))>t||s>=p);)a+=l,++s>g&&(g=(f=this.getNextFoldLine(s=f.end.row+1,f))?f.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(f&&f.start.row<=s)i=this.getFoldDisplayLine(f),s=f.start.row;else{if(a+l<=t||s>p)return{row:p,column:this.getLine(p).length};i=this.getLine(s),f=null}var m=0,v=Math.floor(t-a);if(this.$useWrapMode){var y=this.$wrapData[s];y&&(r=y[v],v>0&&y.length&&(m=y.indent,i=i.substring(o=y[v-1]||y[y.length-1])))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,s,v)&&(e=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(i,e-m)[1],this.$useWrapMode&&o>=r&&(o=r-1),f?f.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(t,e){if(void 0===e)var n=this.$clipPositionToDocument(t.row,t.column);else n=this.$clipPositionToDocument(t,e);var i,r=0,s=null;(i=this.getFoldAt(t=n.row,e=n.column,1))&&(t=i.start.row,e=i.start.column);var o,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,t),h=l.length;if(h&&c>=0){a=l[c],r=this.$screenRowCache[c];var u=t>l[h-1]}else u=!h;for(var d=this.getNextFoldLine(a),p=d?d.start.row:1/0;a=p){if((o=d.end.row+1)>t)break;p=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;r+=this.getRowLength(a),a=o,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(r))}var f="";d&&a>=p?(f=this.getFoldDisplayLine(d,t,e),s=d.start.row):(f=this.getLine(t).substring(0,e),s=t);var g=0;if(this.$useWrapMode){var m=this.$wrapData[s];if(m){for(var v=0;f.length>=m[v];)r++,v++;f=f.substring(m[v-1]||0,f.length),g=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(r+=this.lineWidgets[a].rowsAbove),{row:r,column:g+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(t,e){return this.documentToScreenPosition(t,e).column},this.documentToScreenRow=function(t,e){return this.documentToScreenPosition(t,e).row},this.getScreenLength=function(){var t=0,e=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=(a=0,(e=this.$foldData[a++])?e.start.row:1/0);ir&&(i=e.end.row+1,r=(e=this.$foldData[a++])?e.start.row:1/0)}else{t=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[i,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=n}).call(f.prototype),t("./edit_session/folding").Folding.call(f.prototype),t("./edit_session/bracket_match").BracketMatch.call(f.prototype),o.defineOptions(f.prototype,"session",{wrap:{set:function(t){if(t&&"off"!=t?"free"==t?t=!0:"printMargin"==t?t=-1:"string"==typeof t&&(t=parseInt(t,10)||!1):t=!1,this.$wrap!=t)if(this.$wrap=t,t){var e="number"==typeof t?t:null;this.setWrapLimitRange(e,e),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(t){(t="auto"==t?"text"!=this.$mode.type:"text"!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){(t=parseInt(t))>0&&this.$tabSize!==t&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(t){this.setFoldStyle(t)},handlesSet:!0},overwrite:{set:function(t){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=t("./lib/oop"),s=t("./range").Range,o=function(){this.$options={}};(function(){this.set=function(t){return r.mixin(this.$options,t),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var i=null;return n.forEach(function(t,n,r,o){return i=new s(t,n,r,o),!(n==o&&e.start&&e.start.start&&0!=e.skipCurrent&&i.isEqual(e.start)&&(i=null,1))}),i},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,r=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),o=[],a=e.re;if(e.$isMultiLine){var l,c=a.length,h=r.length-c;t:for(var u=a.offset||0;u<=h;u++){for(var d=0;dg||(o.push(l=new s(u,g,u+c-1,m)),c>2&&(u=u+c-2))}}else for(var v=0;vx&&o[d].end.row==n.end.row;)d--;for(o=o.slice(v,d+1),v=0,d=o.length;v=a;n--)if(u(n,Number.MAX_VALUE,t))return;if(0!=e.wrap)for(n=l,a=o.row;n>=a;n--)if(u(n,Number.MAX_VALUE,t))return}};else c=function(t){var n=o.row;if(!u(n,o.column,t)){for(n+=1;n<=l;n++)if(u(n,0,t))return;if(0!=e.wrap)for(n=a,l=o.row;n<=l;n++)if(u(n,0,t))return}};if(e.$isMultiLine)var h=n.length,u=function(e,r,s){var o=i?e-h+1:e;if(!(o<0)){var a=t.getLine(o),l=a.search(n[0]);if(!(!i&&lr))return!!s(o,l,o+h-1,u)||void 0}}};else u=i?function(e,i,r){var s,o=t.getLine(e),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){if(l=s.index,!(h=s[0].length)){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+h>i)break;a.push(s.index,h)}for(var c=a.length-1;c>=0;c-=2){var h,u=a[c-1];if(r(e,u,e,u+(h=a[c])))return!0}}:function(e,i,r){var s,o,a=t.getLine(e);for(n.lastIndex=i;o=n.exec(a);){var l=o[0].length;if(r(e,s=o.index,e,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:c}}}).call(o.prototype),e.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/keys"),r=t("../lib/useragent"),s=i.KEY_MODS;function o(t,e){this.platform=e||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function a(t,e){o.call(this,t,e),this.$singleCommand=!1}a.prototype=o.prototype,(function(){function t(t){return"object"==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(t,e){var n=t&&("string"==typeof t?t:t.name);t=this.commands[n],e||delete this.commands[n];var i=this.commandKeyBinding;for(var r in i){var s=i[r];if(s==t)delete i[r];else if(Array.isArray(s)){var o=s.indexOf(t);-1!=o&&(s.splice(o,1),1==s.length&&(i[r]=s[0]))}}},this.bindKey=function(t,e,n){if("object"==typeof t&&t&&(null==n&&(n=t.position),t=t[this.platform]),t)return"function"==typeof e?this.addCommand({exec:e,bindKey:t,name:e.name||t}):void t.split("|").forEach(function(t){var i="";if(-1!=t.indexOf(" ")){var r=t.split(/\s+/);t=r.pop(),r.forEach(function(t){var e=this.parseKeys(t);this._addCommandToBinding(i+=(i?" ":"")+(s[e.hashId]+e.key),"chainKeys")},this),i+=" "}var o=this.parseKeys(t);this._addCommandToBinding(i+(s[o.hashId]+o.key),e,n)},this)},this._addCommandToBinding=function(e,n,i){var r,s=this.commandKeyBinding;if(n)if(!s[e]||this.$singleCommand)s[e]=n;else{Array.isArray(s[e])?-1!=(r=s[e].indexOf(n))&&s[e].splice(r,1):s[e]=[s[e]],"number"!=typeof i&&(i=t(n));var o=s[e];for(r=0;ri);r++);o.splice(r,0,n)}else delete s[e]},this.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var n=t[e];if(n){if("string"==typeof n)return this.bindKey(n,e);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=e),this.addCommand(n))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(t){return t}),n=e.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else{if(!e.length)return{key:n,hashId:-1};if(1==e.length&&"shift"==e[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=e.length;o--;){var a=i.KEY_MODS[e[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+e[o]+" in "+t),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(t,e){return this.commandKeyBinding[s[t]+e]},this.handleKeyboard=function(t,e,n,i){if(!(i<0)){var r=s[e]+n,o=this.commandKeyBinding[r];return t.$keyChain&&(t.$keyChain+=" "+r,o=this.commandKeyBinding[t.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(t.$keyChain&&(e&&4!=e||1!=n.length?(-1==e||i>0)&&(t.$keyChain=""):t.$keyChain=t.$keyChain.slice(0,-r.length-1)),{command:o}):(t.$keyChain=t.$keyChain||r,{command:"null"})}},this.getStatusText=function(t,e){return e.$keyChain||""}}).call(o.prototype),e.HashHandler=o,e.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../keyboard/hash_handler").MultiHashHandler,s=t("../lib/event_emitter").EventEmitter,o=function(t,e){r.call(this,e,t),this.byName=this.commands,this.setDefaultHandler("exec",function(t){return t.command.exec(t.editor,t.args||{})})};i.inherits(o,r),(function(){i.implement(this,s),this.exec=function(t,e,n){if(Array.isArray(t)){for(var i=t.length;i--;)if(this.exec(t[i],e,n))return!0;return!1}if("string"==typeof t&&(t=this.commands[t]),!t)return!1;if(e&&e.$readOnly&&!t.readOnly)return!1;if(0!=this.$checkCommandState&&t.isAvailable&&!t.isAvailable(e))return!1;var r={editor:e,command:t,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.toggleRecording=function(t){if(!this.$inReplay)return t&&t._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(t){return t.map(function(t){return"string"!=typeof t[0]&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}).call(o.prototype),e.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=t("../config"),s=t("../range").Range;function o(t,e){return{win:t,mac:e}}e.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(t,e){"number"!=typeof e||isNaN(e)||t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty()?t.selection.getLineRange():t.selection.getRange();t._emit("cut",e),e.isEmpty()||t.session.remove(e),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(i.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(t){for(var e=t.selection.isBackwards(),n=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),r=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),o=t.session.doc.getLine(n.row).length,a=t.session.doc.getTextRange(t.selection.getRange()).replace(/\n\s*/," ").length,l=t.session.doc.getLine(n.row),c=n.row+1;c<=r.row+1;c++){var h=i.stringTrimLeft(i.stringTrimRight(t.session.doc.getLine(c)));0!==h.length&&(h=" "+h),l+=h}r.row+10?(t.selection.moveCursorTo(n.row,n.column),t.selection.selectTo(n.row,n.column+a)):(o=t.session.doc.getLine(n.row).length>o?o+1:o,t.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(t){var e=t.session.doc.getLength()-1,n=t.session.doc.getLine(e).length,i=t.selection.rangeList.ranges,r=[];i.length<1&&(i=[t.selection.getRange()]);for(var o=0;o=r.lastRow||i.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(t){if(this.$mergeUndoDeltas){var e=this.prevOp,n=this.$mergeableCommands,i=e.command&&t.command.name==e.command.name;if("insertstring"==t.command.name){var r=t.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(e.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(t.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(t.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,e){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var n=this;v.loadModule(["keybinding",t],function(i){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(i&&i.handler),e&&e()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),e&&e()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(t){if(this.session!=t){this.curOp&&this.endOperation(),this.curOp={};var e=this.session;if(e){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=t,t?(this.$onDocumentChange=this.onDocumentChange.bind(this),t.on("change",this.$onDocumentChange),this.renderer.setSession(t),this.$onChangeMode=this.onChangeMode.bind(this),t.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),t.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),t.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),t.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),t.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),t.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=t.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(t)),this._signal("changeSession",{session:t,oldSession:e}),this.curOp=null,e&&e._signal("changeEditor",{oldEditor:this}),t&&t._signal("changeEditor",{editor:this}),t&&t.bgTokenizer&&t.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(t,e){return this.session.doc.setValue(t),e?1==e?this.navigateFileEnd():-1==e&&this.navigateFileStart():this.selectAll(),t},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(t){this.renderer.onResize(t)},this.setTheme=function(t,e){this.renderer.setTheme(t,e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(t){this.renderer.setStyle(t)},this.unsetStyle=function(t){this.renderer.unsetStyle(t)},this.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},this.setFontSize=function(t){this.setOption("fontSize",t)},this.$highlightBrackets=function(){if(!this.$highlightPending){var t=this;this.$highlightPending=!0,setTimeout(function(){t.$highlightPending=!1;var e=t.session;if(e&&e.bgTokenizer){e.$bracketHighlight&&(e.$bracketHighlight.markerIds.forEach(function(t){e.removeMarker(t)}),e.$bracketHighlight=null);var n=e.getMatchingBracketRanges(t.getCursorPosition());if(!n&&e.$mode.getMatching&&(n=e.$mode.getMatching(t.session)),n){var i="ace_bracket";Array.isArray(n)?1==n.length&&(i="ace_error_bracket"):n=[n],2==n.length&&(0==p.comparePoints(n[0].end,n[1].start)?n=[p.fromPoints(n[0].start,n[1].end)]:0==p.comparePoints(n[0].start,n[1].end)&&(n=[p.fromPoints(n[1].start,n[0].end)])),e.$bracketHighlight={ranges:n,markerIds:n.map(function(t){return e.addMarker(t,i,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var t=this;this.$highlightTagPending=!0,setTimeout(function(){t.$highlightTagPending=!1;var e=t.session;if(e&&e.bgTokenizer){var n=t.getCursorPosition(),i=new y(t.session,n.row,n.column),r=i.getCurrentToken();if(!r||!/\b(?:tag-open|tag-name)/.test(r.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1===r.type.indexOf("tag-open")||(r=i.stepForward())){var s=r.value,o=r.value,a=0,l=i.stepBackward();if("<"===l.value)do{l=r,(r=i.stepForward())&&(-1!==r.type.indexOf("tag-name")?s===(o=r.value)&&("<"===l.value?a++:""===r.value&&a--)}while(r&&a>=0);else{do{if(r=l,l=i.stepBackward(),r)if(-1!==r.type.indexOf("tag-name"))s===r.value&&("<"===l.value?a++:""===r.value){for(var c=0,h=l;h;){if(-1!==h.type.indexOf("tag-name")&&h.value===s){a--;break}if("<"===h.value)break;h=i.stepBackward(),c++}for(var u=0;u1||(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(t){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(n,"ace_selection",i)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var t=this.session,e=this.getSelectionRange();if(!e.isEmpty()&&!e.isMultiLine()){var n=e.start.column,i=e.end.column,r=t.getLine(e.start.row),s=r.substring(n,i);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=r.substring(n-1,i+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(t){this.renderer.updateText(),this._emit("changeMode",t)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var t=this.getSelectedText(),e=this.session.doc.getNewLineCharacter(),n=!1;if(!t&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;ra.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,h=n.getState(r.row),u=(a=n.getLine(r.row),i.checkOutdent(h,a,t));if(n.insert(r,t),s&&s.selection&&this.selection.setSelectionRange(2==s.selection.length?new p(r.row,c+s.selection[0],r.row,c+s.selection[1]):new p(r.row+s.selection[0],s.selection[1],r.row+s.selection[2],s.selection[3])),this.$enableAutoIndent){if(n.getDocument().isNewLine(t)){var d=i.getNextLineIndent(h,a.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},d)}u&&i.autoOutdent(h,n,r.row)}},this.autoIndent=function(){var t,e,n=this.session,i=n.getMode();if(this.selection.isEmpty())t=0,e=n.doc.getLength()-1;else{var r=this.getSelectionRange();t=r.start.row,e=r.end.row}for(var s,o,a,l="",c="",h="",u=n.getTabString(),d=t;d<=e;d++)d>0&&(l=n.getState(d-1),c=n.getLine(d-1),h=i.getNextLineIndent(l,c,u)),s=n.getLine(d),h!==(o=i.$getIndent(s))&&(o.length>0&&(a=new p(d,0,d,o.length),n.remove(a)),h.length>0&&n.insert({row:d,column:0},h)),i.autoOutdent(l,n,d)},this.onTextInput=function(t,e){if(!e)return this.keyBinding.onTextInput(t);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,t,e);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(t,e){var n;(e.extendLeft||e.extendRight)&&((n=this.selection.getRange()).start.column-=e.extendLeft,n.end.column+=e.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),t||n.isEmpty()||this.remove()),!t&&this.selection.isEmpty()||this.insert(t,!0),(e.restoreStart||e.restoreEnd)&&((n=this.selection.getRange()).start.column-=e.restoreStart,n.end.column-=e.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(t,e,n){return this.keyBinding.onCommandKey(t,e,n)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption("scrollSpeed",t)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(t){this.setOption("dragDelay",t)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(t){this.setOption("selectionStyle",t)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(t){this.setOption("highlightActiveLine",t)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(t){this.setOption("highlightSelectedWord",t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption("readOnly",t)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(t){this.setOption("behavioursEnabled",t)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(t){this.setOption("wrapBehavioursEnabled",t)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(t){this.setOption("showFoldWidgets",t)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(t){this.selection.isEmpty()&&("left"==t?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(e.start.row),r=n.getMode().transformAction(i,"deletion",this,n,e);if(0===e.end.column){var s=n.getTextRange(e);if("\n"==s[s.length-1]){var o=n.getLine(e.end.row);/^\s+$/.test(o)&&(e.end.column=o.length)}}r&&(e=r)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var t=this.getCursorPosition(),e=t.column;if(0!==e){var n,i,r=this.session.getLine(t.row);ee.toLowerCase()?1:0});var r=new p(0,0,0,0);for(i=t.first;i<=t.last;i++){var s=e.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,e.replace(r,n[i-t.first])}},this.toggleCommentLines=function(){var t=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(t,this.session,e.first,e.last)},this.toggleBlockComment=function(){var t=this.getCursorPosition(),e=this.session.getState(t.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,n,t)},this.getNumberAt=function(t,e){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(t);n.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(t){var e=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new p(e,n-1,e,n),r=this.session.getTextRange(i);if(!isNaN(parseFloat(r))&&isFinite(r)){var s=this.getNumberAt(e,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),l+=t*=o!==s.end&&n=a&&o<=l&&(n=e,c.selection.clearSelection(),c.moveCursorTo(t,a+i),c.selection.selectTo(t,l+i)),a=l});for(var h,u=this.$toggleWordPairs,d=0;dp+1)break;p=f.last}for(h--,a=this.session.$moveLines(d,p,e?0:t),e&&-1==t&&(u=h+1);u<=h;)o[u].moveBy(a,0),u++;e||(a=0),l+=a}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(t){this.renderer.showComposition(t)},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(t,e){var n=this.renderer,i=this.renderer.layerConfig,r=t*Math.floor(i.height/i.lineHeight);!0===e?this.selection.$moveSelection(function(){this.moveCursorBy(r,0)}):!1===e&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,r*i.lineHeight),null!=e&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(t,e,n,i){this.renderer.scrollToLine(t,e,n,i)},this.centerSelection=function(){var t=this.getSelectionRange(),e={row:Math.floor(t.start.row+(t.end.row-t.start.row)/2),column:Math.floor(t.start.column+(t.end.column-t.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(t,e){this.selection.moveCursorTo(t,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(t,e){var n=this.getCursorPosition(),i=new y(this.session,n.row,n.column),r=i.getCurrentToken(),s=r||i.stepForward();if(s){var o,a,l=!1,c={},h=n.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;h=0;--s)this.$tryReplace(n[s],t)&&i++;return this.selection.setSelectionRange(r),i},this.$tryReplace=function(t,e){var n=this.session.getTextRange(t);return null!==(e=this.$search.replace(n,e))?(t.end=this.session.replace(t,e),t):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(t,e,n){e||(e={}),"string"==typeof t||t instanceof RegExp?e.needle=t:"object"==typeof t&&i.mixin(e,t);var r=this.selection.getRange();null==e.needle&&((t=this.session.getTextRange(r)||this.$search.$options.needle)||(r=this.session.getWordRange(r.start.row,r.start.column),t=this.session.getTextRange(r)),this.$search.set({needle:t})),this.$search.set(e),e.start||this.$search.set({start:r});var s=this.$search.find(this.session);return e.preventScroll?s:s?(this.revealRange(s,n),s):(e.backwards?r.start=r.end:r.end=r.start,void this.selection.setRange(r))},this.findNext=function(t,e){this.find({skipCurrent:!0,backwards:!1},t,e)},this.findPrevious=function(t,e){this.find(t,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(t,e){this.session.unfold(t),this.selection.setSelectionRange(t);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(t.start,t.end,.5),!1!==e&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(t){t.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(t){if(t){var e,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var r=this.$scrollAnchor;r.style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild);var s=this.on("changeSelection",function(){i=!0}),o=this.renderer.on("beforeRender",function(){i&&(e=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(i&&e&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var t=n.renderer,s=t.$cursorLayer.$pixelPos,o=t.layerConfig,a=s.top-o.offset;null!=(i=s.top>=0&&a+e.top<0||!(s.topwindow.innerHeight)&&null)&&(r.style.top=a+"px",r.style.left=s.left+"px",r.style.height=o.lineHeight+"px",r.scrollIntoView(i)),i=e=null}});this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var t=this.$cursorStyle||"ace",e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(t)),e.isBlinking=!this.$readOnly&&"wide"!=t,r.setCssClass(e.element,"ace_slim-cursors",/slim/.test(t)))},this.prompt=function(t,e,n){var i=this;v.loadModule("./ext/prompt",function(r){r.prompt(i,t,e,n)})}}).call(w.prototype),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:t})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(t){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(t){this.textInput.setReadOnly(t),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(t){this.textInput.setCopyWithEmptySelection(t)},initialValue:!1},cursorStyle:{set:function(t){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(t){this.session.setValue(t)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(t){this.setSession(t)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(t){this.renderer.$gutterLayer.setShowLineNumbers(t),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),t&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(t){this.$showLineNumbers&&t?x.attach(this):x.detach(this)}},placeholder:{set:function(t){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var t=this.session&&(this.renderer.$composition||this.getValue());if(t&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(t||this.renderer.placeholderNode)!t&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var e=r.createElement("div");e.className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode)}}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var x={getText:function(t,e){return(Math.abs(t.selection.lead.row-e)||e+1+(e<9?"\xb7":""))+""},getWidth:function(t,e,n){return Math.max(e.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(t,e){e.renderer.$loop.schedule(e.renderer.CHANGE_GUTTER)},attach:function(t){t.renderer.$gutterLayer.$renderer=this,t.on("changeSelection",this.update),this.update(null,t)},detach:function(t){t.renderer.$gutterLayer.$renderer==this&&(t.renderer.$gutterLayer.$renderer=null),t.off("changeSelection",this.update),this.update(null,t)}};e.Editor=w}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(t){this.$session=t},this.add=function(t,e,n){this.$fromUndo||t!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==e&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),t.id=this.$rev=++this.$maxRev),"remove"!=t.action&&"insert"!=t.action||(this.$lastDelta=t),this.lastDeltas.push(t))},this.addSelection=function(t,e){this.selections.push({value:t,rev:e||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(t,e){null==e&&(e=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=t)break;r.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(t){null==t&&(t=this.$rev),this.mark=t},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(t){return t?a(t):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var r=t("./range").Range,s=r.comparePoints;function o(t){return{row:t.row,column:t.column}}function a(t){if(t=t||this,Array.isArray(t))return t.map(a).join("\n");var e="";return t.action?(e="insert"==t.action?"+":"-",e+="["+t.lines+"]"):t.value&&(e=Array.isArray(t.value)?t.value.map(l).join("\n"):l(t.value)),t.start&&(e+=l(t)),(t.id||t.rev)&&(e+="\t("+(t.id||t.rev)+")"),e}function l(t){return t.start.row+":"+t.start.column+"=>"+t.end.row+":"+t.end.column}function c(t,e){var n="insert"==t.action,i="insert"==e.action;if(n&&i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}else if(!n&&i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(!n&&!i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}return[e,t]}function h(t,e){for(var n=t.length;n--;)for(var i=0;i=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,r.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&i)s(e.start,t.end)>=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,r.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{var o,a;if(!(s(e.end,t.start)<=0))return s(t.start,e.start)<0&&(o=t,t=f(t,e.start)),s(t.end,e.end)>0&&(a=f(t,e.end)),p(e.end,t.start,t.end,-1),a&&!o&&(t.lines=a.lines,t.start=a.start,t.end=a.end,a=t),[e,o,a].filter(Boolean);d(t,e,-1)}return[e,t]}function d(t,e,n){p(t.start,e.start,e.end,n),p(t.end,e.start,e.end,n)}function p(t,e,n,i){t.row==(1==i?e:n).row&&(t.column+=i*(n.column-e.column)),t.row+=i*(n.row-e.row)}function f(t,e){var n=t.lines,i=t.end;t.end=o(e);var r=t.end.row-t.start.row,s=n.splice(r,n.length),a=r?e.column:e.column-t.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(e),end:i,lines:s,action:t.action}}function g(t,e){e=function(t){return{start:o(t.start),end:o(t.end),action:t.action,lines:t.lines.slice()}}(e);for(var n=t.length;n--;){for(var i=t[n],r=0;rs&&(s=(r=e.getNextFoldLine(l=r.end.row+1,r))?r.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,t,this.session,c),this.$lines.push(o)),this.$renderCell(o,t,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(t)},this.$updateGutterWidth=function(t){var e=this.session,n=e.gutterRenderer||this.$renderer,i=e.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||e.$useWrapMode)&&(r=e.getLength()+i-1);var s=n?n.getWidth(e,r,t):r.toString().length*t.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!this.$cursorCell||this.$cursorCell.row!=t){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var e=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&r&&r.start.row==e[n-1].row))break;i=e[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(t){var e=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(e,t))return this.update(t);this.$lines.moveContainer(t);var n=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!e||i0;r--)this.$lines.shift();if(i>n)for(r=this.session.getFoldedRowCount(n+1,i);r>0;r--)this.$lines.pop();t.firstRowi&&this.$lines.push(this.$renderLines(t,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t)},this.$renderLines=function(t,e,n){for(var i=[],r=e,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;r>o&&(o=(s=this.session.getNextFoldLine(r=s.end.row+1,s))?s.start.row:1/0),!(r>n);){var a=this.$lines.createCell(r,t,this.session,c);this.$renderCell(a,t,s,r),i.push(a),r++}return i},this.$renderCell=function(t,e,n,r){var s=t.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],c=o.$firstLineNumber,h=o.$breakpoints,u=o.$decorations,d=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,f=n?n.start.row:Number.MAX_VALUE,g="ace_gutter-cell ";if(this.$highlightGutterLine&&(r==this.$cursorRow||n&&r=f&&this.$cursorRow<=n.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),h[r]&&(g+=h[r]),u[r]&&(g+=u[r]),this.$annotations[r]&&(g+=this.$annotations[r].className),s.className!=g&&(s.className=g),p){var m=p[r];null==m&&(m=p[r]=o.getFoldWidget(r))}m?(g="ace_fold-widget ace_"+m,l.className!=(g+="start"==m&&r==f&&rn.right-e.right?"foldWidgets":void 0}}).call(l.prototype),e.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../range").Range,r=t("../lib/dom"),s=function(t){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",t.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.elt=function(t,e){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=e,n.className=t},this.update=function(t){if(t){var e;for(var n in this.config=t,this.i=0,this.markers){var i=this.markers[n];if(i.range){var r=i.range.clipRows(t.firstRow,t.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),i.renderer){var s=this.$getTop(r.start.row,t);i.renderer(e,r,this.$padding+r.start.column*t.characterWidth,s,t)}else"fullLine"==i.type?this.drawFullLineMarker(e,r,i.clazz,t):"screenLine"==i.type?this.drawScreenLineMarker(e,r,i.clazz,t):r.isMultiLine()?"text"==i.type?this.drawTextMarker(e,r,i.clazz,t):this.drawMultiLineMarker(e,r,i.clazz,t):this.drawSingleLineMarker(e,r,i.clazz+" ace_start ace_br15",t)}else i.update(e,this,this.session,t)}if(-1!=this.i)for(;this.id?4:0)|(c==l?8:0)),r,c==l?0:1,s)},this.drawMultiLineMarker=function(t,e,n,i,r){var s,o=this.$padding,a=i.lineHeight,l=this.$getTop(e.start.row,i),c=o+e.start.column*i.characterWidth;if(r=r||"",this.session.$bidiHandler.isBidiRow(e.start.row)?((s=e.clone()).end.row=s.start.row,s.end.column=this.session.getLine(s.start.row).length,this.drawBidiSingleLineMarker(t,s,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(e.end.row)?((s=e.clone()).start.row=s.end.row,s.start.column=0,this.drawBidiSingleLineMarker(t,s,n+" ace_br12",i,null,r)):(l=this.$getTop(e.end.row,i),this.elt(n+" ace_br12","height:"+a+"px;width:"+e.end.column*i.characterWidth+"px;top:"+l+"px;left:"+o+"px;"+(r||""))),!((a=(e.end.row-e.start.row-1)*i.lineHeight)<=0)){l=this.$getTop(e.start.row+1,i);var h=(e.start.column?1:0)|(e.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+o+"px;"+(r||""))}},this.drawSingleLineMarker=function(t,e,n,i,r,s){if(this.session.$bidiHandler.isBidiRow(e.start.row))return this.drawBidiSingleLineMarker(t,e,n,i,r,s);var o=i.lineHeight,a=(e.end.column+(r||0)-e.start.column)*i.characterWidth,l=this.$getTop(e.start.row,i);this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+(this.$padding+e.start.column*i.characterWidth)+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(t,e,n,i,r,s){var o=i.lineHeight,a=this.$getTop(e.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(e.start.column,e.end.column).forEach(function(t){this.elt(n,"height:"+o+"px;width:"+t.width+(r||0)+"px;top:"+a+"px;left:"+(l+t.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i),o=i.lineHeight;e.start.row!=e.end.row&&(o+=this.$getTop(e.end.row,i)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i);this.elt(n,"height:"+i.lineHeight+"px;top:"+s+"px;left:0;right:0;"+(r||""))}}).call(s.prototype),e.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("./lines").Lines,a=t("../lib/event_emitter").EventEmitter,l=function(t){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){i.implement(this,a),this.EOF_CHAR="\xb6",this.EOL_CHAR_LF="\xac",this.EOL_CHAR_CRLF="\xa4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\xb7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var t=this.session.doc,e="\n"==t.getNewLineCharacter()&&"windows"!=t.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(t){this.$padding=t,this.element.style.margin="0 "+t+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on("changeCharacterSize",(function(t){this._signal("changeCharacterSize",t)}).bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,"string"==typeof t?(this.showSpaces=/tab/i.test(t),this.showTabs=/space/i.test(t),this.showEOL=/eol/i.test(t)):this.showSpaces=this.showTabs=this.showEOL=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var t=this.session.getTabSize();this.tabSize=t;for(var e=this.$tabStrings=[0],n=1;nh&&(h=(l=this.session.getNextFoldLine(a=l.end.row+1,l))?l.start.row:1/0),!(a>r);){var u=s[o++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==h&&l),c&&(u.style.top=this.$lines.computeLineTop(a,t,this.session)+"px");var d=t.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(c=!0,u.style.height=d)}a++}if(c)for(;o0;i--)this.$lines.shift();if(e.lastRow>t.lastRow)for(i=this.session.getFoldedRowCount(t.lastRow+1,e.lastRow);i>0;i--)this.$lines.pop();t.firstRowe.lastRow&&this.$lines.push(this.$renderLinesFragment(t,e.lastRow+1,t.lastRow))},this.$renderLinesFragment=function(t,e,n){for(var i=[],s=e,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(a=(o=this.session.getNextFoldLine(s=o.end.row+1,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,t,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(s,t,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(s,t,this.session)+"px"),this.$renderLine(c,s,s==a&&o),c.className=this.$useLineGroups()?"ace_line_group":"ace_line",i.push(l),s++}return i},this.update=function(t){this.$lines.moveContainer(t),this.config=t;for(var e=t.firstRow,n=t.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(t,e,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(t,e,n,i){for(var r,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),c=0;r=a.exec(i);){var h=r[1],u=r[2],d=r[3],p=r[4],f=r[5];if(o.showSpaces||!u){var g=c!=r.index?i.slice(c,r.index):"";if(c=r.index+r[0].length,g&&l.appendChild(this.dom.createTextNode(g,this.element)),h){var m=o.session.getScreenTabSize(e+r.index);l.appendChild(o.$tabStrings[m].cloneNode(!0)),e+=m-1}else u?o.showSpaces?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=s.stringRepeat(o.SPACE_CHAR,u.length),l.appendChild(y)):l.appendChild(this.com.createTextNode(u,this.element)):d?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(y)):p?(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className=o.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=o.showSpaces?o.SPACE_CHAR:p,l.appendChild(y)):f&&(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className="ace_cjk",y.textContent=f,l.appendChild(y))}}if(l.appendChild(this.dom.createTextNode(c?i.slice(c):i,this.element)),this.$textToken[n.type])t.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==n.type&&(y.style.width=n.value.length*this.config.characterWidth+"px"),y.className=v,y.appendChild(l),t.appendChild(y)}return e+i.length},this.renderIndentGuide=function(t,e,n){var i=e.search(this.$indentGuideRe);if(i<=0||i>=n)return e;if(" "==e[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,h,u.substring(0,o-i)),u=u.substring(o-i),i=o,l=this.$createLineElement(),t.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat("\xa0",n.indent),this.element)),a=0,o=n[++r]||Number.MAX_VALUE;0!=u.length&&(i+=u.length,a=this.$renderToken(l,a,h,u))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(t,e){var n=0,i=e[0],r=i.value;this.displayIndentGuides&&(r=this.renderIndentGuide(t,r)),r&&(n=this.$renderToken(t,n,i,r));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(t,n,i,r);n=this.$renderToken(t,n,i,r)}},this.$renderOverflowMessage=function(t,e,n,i,r){n&&this.$renderToken(t,e,n,i.slice(0,this.MAX_LINE_LENGTH-e));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=r?"":"",t.appendChild(s)},this.$renderLine=function(t,e,n){if(n||0==n||(n=this.session.getFoldLine(e)),n)var i=this.$getFoldLineTokens(e,n);else i=this.session.getTokens(e);var r=t;if(i.length){var s=this.session.getRowSplitData(e);s&&s.length?(this.$renderWrappedLine(t,i,s),r=t.lastChild):(r=t,this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r)),this.$renderSimpleLine(r,i))}else this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r));if(this.showEOL&&r){n&&(e=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o)}},this.$getFoldLineTokens=function(t,e){var n=this.session,i=[],r=n.getTokens(t);return e.walk(function(t,e,s,o,a){null!=t?i.push({type:"fold",value:t}):(a&&(r=n.getTokens(e)),r.length&&function(t,e,n){for(var r=0,s=0;s+t[r].value.lengthn-e&&(o=o.substring(0,n-e)),i.push({type:t[r].type,value:o}),s=e+o.length,r+=1);sn?{type:t[r].type,value:o.substring(0,n-s)}:t[r]),s+=o.length,r+=1}}(r,o,s))},e.end.row,this.session.getLine(e.end.row).length),i},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),e.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=function(t){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",t.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(t){for(var e=this.cursors,n=e.length;n--;)i.setStyle(e[n].style,"opacity",t?"":"0")},this.$startCssAnimation=function(){for(var t=this.cursors,e=t.length;e--;)t[e].style.animationDuration=this.blinkInterval+"ms";setTimeout((function(){i.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},this.$stopCssAnimation=function(){i.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t!=this.smoothBlinking&&(this.smoothBlinking=t,i.setCssClass(this.element,"ace_smooth-blinking",t),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var t=i.createElement("div");return t.className="ace_cursor",this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(this.cursors.length>1){var t=this.cursors.pop();return t.parentNode.removeChild(t),t}},this.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var t=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&i.removeCssClass(this.element,"ace_smooth-blinking"),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout((function(){i.addCssClass(this.element,"ace_smooth-blinking")}).bind(this)),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var e=(function(){this.timeoutId=setTimeout(function(){t(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){t(!0),e()},this.blinkInterval),e()}else this.$stopCssAnimation()},this.getPixelPosition=function(t,e){if(!this.config||!this.session)return{left:0,top:0};t||(t=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(t);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,t.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(e?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(t,e){return t.top>=0&&t.topt.height+t.offset||o.top<0)&&n>1)){var a=this.cursors[r++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,t,e[n],this.session):this.isCursorInView(o,t)?(i.setStyle(l,"display","block"),i.translate(a,o.left,o.top),i.setStyle(l,"width",Math.round(t.characterWidth)+"px"),i.setStyle(l,"height",t.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),e.Cursor=r}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./lib/event"),o=t("./lib/event_emitter").EventEmitter,a=32768,l=function(t){this.element=r.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=r.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xa0",this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){i.implement(this,o),this.setVisible=function(t){this.element.style.display=t?"":"none",this.isVisible=t,this.coeff=1}}).call(l.prototype);var c=function(t,e){l.call(this,t),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=r.scrollbarWidth(t.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(c,l),(function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+"px"},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,t>a?(this.coeff=a/t,t=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=t+"px"},this.setScrollTop=function(t){this.scrollTop!=t&&(this.skipEvent=!0,this.scrollTop=t,this.element.scrollTop=t*this.coeff)}}).call(c.prototype);var h=function(t,e){l.call(this,t),this.scrollLeft=0,this.height=e.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(h,l),(function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(t){this.element.style.width=t+"px"},this.setInnerWidth=function(t){this.inner.style.width=t+"px"},this.setScrollWidth=function(t){this.inner.style.width=t+"px"},this.setScrollLeft=function(t){this.scrollLeft!=t&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=t)}}).call(h.prototype),e.ScrollBar=c,e.ScrollBarV=c,e.ScrollBarH=h,e.VScrollBar=c,e.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,e,n){"use strict";var i=t("./lib/event"),r=function(t,e){this.onRender=t,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=e||window;var n=this;this._flush=function(t){n.pending=!1;var e=n.changes;if(e&&(i.blockIdle(100),n.changes=0,n.onRender(e)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(t){this.changes=this.changes|t,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(t){var e=this.changes;return this.changes=0,e}}).call(r.prototype),e.RenderLoop=r}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,e,n){var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("../lib/event"),a=t("../lib/useragent"),l=t("../lib/event_emitter").EventEmitter,c=256,h="function"==typeof ResizeObserver,u=200,d=e.FontMetrics=function(t){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),t.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",c),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(t,e){t.width=t.height="auto",t.left=t.top="0px",t.visibility="hidden",t.position="absolute",t.whiteSpace="pre",a.isIE<8?t["font-family"]="inherit":t.font="inherit",t.overflow=e?"hidden":"visible"},this.checkForSizeChanges=function(t){if(void 0===t&&(t=this.$measureSizes()),t&&(this.$characterSize.width!==t.width||this.$characterSize.height!==t.height)){this.$measureNode.style.fontWeight="bold";var e=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=t,this.charSizes=Object.create(null),this.allowBoldFonts=e&&e.width===t.width&&e.height===t.height,this._emit("changeCharacterSize",{data:t})}},this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver(function(e){t.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(t){var e={height:(t||this.$measureNode).clientHeight,width:(t||this.$measureNode).clientWidth/c};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.textContent=s.stringRepeat(t,c),this.$main.getBoundingClientRect().width/c},this.getCharacterWidth=function(t){var e=this.charSizes[t];return void 0===e&&(e=this.charSizes[t]=this.$measureCharWidth(t)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function t(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*t(e.parentElement):1},this.$initTransformMeasureNodes=function(){var t=function(t,e){return["div",{style:"position: absolute;top:"+t+"px;left:"+e+"px;"}]};this.els=r.buildDom([t(0,0),t(u,0),t(0,u),t(u,u)],this.el)},this.transformCoordinates=function(t,e){function n(t,e,n){var i=t[1]*e[0]-t[0]*e[1];return[(-e[1]*n[0]+e[0]*n[1])/i,(+t[1]*n[0]-t[0]*n[1])/i]}function i(t,e){return[t[0]-e[0],t[1]-e[1]]}function r(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t*e[0],t*e[1]]}function o(t){var e=t.getBoundingClientRect();return[e.left,e.top]}t&&(t=s(1/this.$getZoom(this.el),t)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),c=o(this.els[2]),h=o(this.els[3]),d=n(i(h,l),i(h,c),i(r(l,c),r(h,a))),p=s(1+d[0],i(l,a)),f=s(1+d[1],i(c,a));if(e){var g=e,m=d[0]*g[0]/u+d[1]*g[1]/u+1,v=r(s(g[0],p),s(g[1],f));return r(s(1/m/u,v),a)}var y=i(t,a),b=n(i(p,s(d[0],y)),i(f,s(d[1],y)),y);return s(u,b)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./config"),o=t("./layer/gutter").Gutter,a=t("./layer/marker").Marker,l=t("./layer/text").Text,c=t("./layer/cursor").Cursor,h=t("./scrollbar").HScrollBar,u=t("./scrollbar").VScrollBar,d=t("./renderloop").RenderLoop,p=t("./layer/font_metrics").FontMetrics,f=t("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=t("./lib/useragent"),v=m.isIE;r.importCssString(g,"ace_editor.css");var y=function(t,e){var n=this;this.container=t||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(e),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var i=this.$textLayer=new l(this.content);this.canvas=i.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollTop(t.data-n.scrollMargin.top)}),this.scrollBarH.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollLeft(t.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(t){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",t)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&t.getScrollTop()<=0&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(t,e,n){if(void 0===e&&(e=1/0),this.$changedLines?(this.$changedLines.firstRow>t&&(this.$changedLines.firstRow=t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(t,e,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=t?1:0;var r=this.container;i||(i=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var s=this.$updateCachedSize(t,e,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;t&&(this.$gutterLayer.$padding=null),t?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(t,e,n,i){var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if((i-=this.$extraHeight||0)&&(t||o.height!=i)&&(o.height=i,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(t||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==e&&(e=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=e,r.setStyle(this.scrollBarH.element.style,"left",e+"px"),r.setStyle(this.scroller.style,"left",e+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-e-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l),r.setStyle(this.scroller.style,"right",l),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||t)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!i,s&&this._signal("resize",a),s},this.onGutterResize=function(t){var e=this.$showGutter?t:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var t=Math.floor((this.$size.scrollerWidth-2*this.$padding)/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(t){this.setOption("animatedScroll",t)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(t){this.setOption("showInvisibles",t),this.session.$bidiHandler.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(t){this.setOption("displayIndentGuides",t)},this.setShowPrintMargin=function(t){this.setOption("showPrintMargin",t)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(t){this.setOption("printMarginColumn",t)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(t){return this.setOption("showGutter",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var t=r.createElement("div");t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",t.appendChild(this.$printMarginEl),this.content.insertBefore(t,this.content.firstChild)}var e=this.$printMarginEl.style;e.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var t=this.textarea.style,e=this.$composition;if(this.$keepTextAreaAtCursor||e){var n=this.$cursorLayer.$pixelPos;if(n){e&&e.markerRange&&(n=this.$cursorLayer.getPixelPosition(e.markerRange.start,!0));var i=this.layerConfig,s=n.top,o=n.left,a=e&&e.useTextareaForIME?this.lineHeight:v?0:1;if((s-=i.offset)<0||s>i.height-a)r.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;e?e.useTextareaForIME?l=this.characterWidth*this.session.$getStringScreenWidth(this.textarea.value)[0]:s+=this.lineHeight+2:s+=this.lineHeight,(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,r.setStyle(t,"height",a+"px"),r.setStyle(t,"width",l+"px"),r.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,c))}}}else r.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var t=this.layerConfig,e=t.lastRow;return this.session.documentToScreenRow(e,0)*t.lineHeight-this.session.getScrollTop()>t.height-t.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(t,e,n,i){var r=this.scrollMargin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(t,e,n,i){var r=this.margin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption("hScrollBarAlwaysVisible",t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption("vScrollBarAlwaysVisible",t)},this.$updateScrollBarV=function(){var t=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&this.scrollTop>(t-=(e-this.lineHeight)*this.$scrollPastEnd)-e&&(t=this.scrollTop+e,this.scrollBarV.scrollTop=null),this.scrollBarV.setScrollHeight(t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(t,e){if(this.$changes&&(t|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(t||e)){if(this.$size.$dirty)return this.$changes|=t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(t&this.CHANGE_FULL||t&this.CHANGE_SIZE||t&this.CHANGE_TEXT||t&this.CHANGE_LINES||t&this.CHANGE_SCROLL||t&this.CHANGE_H_SCROLL){if(t|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;i>0&&(this.scrollTop=i,t|=this.CHANGE_SCROLL,t|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-n.offset);var s=n.minHeight+"px";r.setStyle(this.content.style,"width",n.width+2*this.$padding+"px"),r.setStyle(this.content.style,"height",s)}if(t&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),t&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);if(t&this.CHANGE_SCROLL)return this.$changedLines=null,t&this.CHANGE_TEXT||t&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(t&this.CHANGE_GUTTER||t&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):t&this.CHANGE_LINES?(this.$updateLines()||t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):t&this.CHANGE_TEXT||t&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):t&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",t)}else this.$changes|=t},this.$autosize=function(){var t=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,n=Math.min(e,Math.max((this.$minLines||1)*this.lineHeight,t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&t>e;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var t=this.session,e=this.$size,n=e.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||e.scrollerWidth-r-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=e.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(e.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var h=this.scrollMargin;this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,i-e.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,r+2*this.$padding-e.scrollerWidth+h.right)));var u=!n&&(this.$vScrollBarAlwaysVisible||e.scrollerHeight-i+c<0||this.scrollTop>h.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var p,f,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),y=v+m,b=this.lineHeight;v=t.screenToDocumentRow(v,0);var w=t.getFoldLine(v);w&&(v=w.start.row),p=t.documentToScreenRow(v,0),f=t.getRowLength(v)*b,y=Math.min(t.screenToDocumentRow(y,0),t.getLength()-1),l=e.scrollerHeight+t.getRowLength(y)*b+f,g=this.scrollTop-p*b;var x=0;return(this.layerConfig.width!=r||o)&&(x=this.CHANGE_H_SCROLL),(o||d)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal("scrollbarVisibilityChanged"),d&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:v,firstRowScreen:p,lastRow:y,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:g,gutterOffset:b?Math.max(0,Math.ceil((g+e.height-e.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),x},this.$updateLines=function(){if(this.$changedLines){var t=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(t>n.lastRow+1||ethis.$textLayer.MAX_LINE_LENGTH&&(t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(t*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(t,e){this.$gutterLayer.addGutterDecoration(t,e)},this.removeGutterDecoration=function(t,e){this.$gutterLayer.removeGutterDecoration(t,e)},this.updateBreakpoints=function(t){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(t){this.$gutterLayer.setAnnotations(t),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(t,e,n){this.scrollCursorIntoView(t,n),this.scrollCursorIntoView(e,n)},this.scrollCursorIntoView=function(t,e,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(t),r=i.left,s=i.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(e&&l+o>s+this.lineHeight&&(s-=e*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ar?(r=1-this.scrollMargin.top||e>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=Math.floor((e+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:r}},this.screenToTextCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((e+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),r)},this.textToScreenCoordinates=function(t,e){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(t,e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,t)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth));return{pageX:n.left+r-this.scrollLeft,pageY:n.top+i.row*this.lineHeight-this.scrollTop}},this.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},this.showComposition=function(t){this.$composition=t,t.cssText||(t.cssText=this.textarea.style.cssText),null==t.useTextareaForIME&&(t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):t.markerId=this.session.addMarker(t.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(t){var e=this.session.selection.cursor;this.addToken(t,"composition_placeholder",e.row,e.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var t=this.session.selection.cursor;this.removeExtraToken(t.row,t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(t,e,n,i){var r=this.session;r.bgTokenizer.lines[n]=null;var s={type:e,value:t},o=r.getTokens(n);if(null==i)o.push(s);else for(var a=0,l=0;l50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(l.prototype),e.UIWorkerClient=function(t,e,n){var i=null,r=!1,a=Object.create(s),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(t){c.push(t),i&&(r?setTimeout(u):u())}});h.setEmitSync=function(t){r=t};var u=function(){var t=c.shift();t.command?i[t.command].apply(i,t.args):t.event&&a._signal(t.event,t.data)};return a.postMessage=function(t){h.onMessage({data:t})},a.callback=function(t,e){this.postMessage({type:"call",id:e,data:t})},a.emit=function(t,e){this.postMessage({type:"event",name:t,data:e})},o.loadModule(["worker",e],function(t){for(i=new t[n](a);c.length;)u()}),h},e.WorkerClient=l,e.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./range").Range,r=t("./lib/event_emitter").EventEmitter,s=t("./lib/oop"),o=function(t,e,n,i,r,s){var o=this;this.length=e,this.session=t,this.doc=t.getDocument(),this.mainClass=r,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=t.getUndoManager().$undoStack||t.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),t.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,r),this.setup=function(){var t=this,e=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new i(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var i=e.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),t.others.push(i)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,e=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),e.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,s=e.start.column-this.pos.column;if(this.updateAnchors(t),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===t.action)for(var o=this.others.length-1;o>=0;o--)this.doc.insertMergedLines(l={row:(a=this.others[o]).row,column:a.column+s},t.lines);else if("remove"===t.action)for(o=this.others.length-1;o>=0;o--){var a,l;this.doc.remove(new i((l={row:(a=this.others[o]).row,column:a.column+s}).row,l.column,l.row,l.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(t){this.pos.onChange(t);for(var e=this.others.length;e--;)this.others[e].onChange(t);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var t=this,e=this.session,n=function(n,r){e.removeMarker(n.markerId),n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},this.onCursorChange=function(t){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",t)):(this.hideOtherMarkers(),this._emit("cursorLeave",t))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var t=this.session.getUndoManager(),e=(t.$undoStack||t.$undostack).length-this.$undoStackDepth,n=0;n1?t.multiSelect.joinSelections():t.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(t){t.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(t){t.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(t){t.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(t){t.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(t){return t&&t.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new i(e.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,e,n){var i=t("./range_list").RangeList,r=t("./range").Range,s=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,a=t("./lib/event"),l=t("./lib/lang"),c=t("./commands/multi_select_commands");e.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(0,t("./search").Search),u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(t,e){if(t){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(t),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),e||this.fromOrientedRange(t);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}t.cursor||(t.cursor=t.end);var i=this.rangeList.add(t);return this.$onAddRange(t),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),e||this.fromOrientedRange(t)}},this.toSingleRange=function(t){t=t||this.ranges[0];var e=this.rangeList.removeAll();e.length&&this.$onRemoveRange(e),t&&this.fromOrientedRange(t)},this.substractPoint=function(t){var e=this.rangeList.substractPoint(t);if(e)return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var t=this.rangeList.merge();t.length&&this.$onRemoveRange(t)},this.$onAddRange=function(t){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(t),this._signal("addRange",{range:t})},this.$onRemoveRange=function(t){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var e=this.rangeList.ranges.pop();t.push(e),this.rangeCount=0}for(var n=t.length;n--;){var i=this.ranges.indexOf(t[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:t}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(e=e||this.ranges[0])&&!e.isEqual(this.getRange())&&this.fromOrientedRange(e)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var t=this.ranges.length?this.ranges:[this.getRange()],e=[],n=0;n1){var t=this.rangeList.ranges,e=t[t.length-1],n=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(n,e.cursor==e.start)}else{var i=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(t,e,n){var i=[],s=t.column0;)y--;if(y>0)for(var b=0;i[b].isEmpty();)b++;for(var w=y;w>=b;w--)i[w].isEmpty()&&i.splice(w,1)}return i}}).call(s.prototype);var d=t("./editor").Editor;function p(t){t.$multiselectOnSessionChange||(t.$onAddRange=t.$onAddRange.bind(t),t.$onRemoveRange=t.$onRemoveRange.bind(t),t.$onMultiSelect=t.$onMultiSelect.bind(t),t.$onSingleSelect=t.$onSingleSelect.bind(t),t.$multiselectOnSessionChange=e.onSessionChange.bind(t),t.$checkMultiselectChange=t.$checkMultiselectChange.bind(t),t.$multiselectOnSessionChange(t),t.on("changeSession",t.$multiselectOnSessionChange),t.on("mousedown",o),t.commands.addCommands(c.defaultCommands),function(t){if(t.textInput){var e=t.textInput.getElement(),n=!1;a.addListener(e,"keydown",function(e){t.$blockSelectEnabled&&18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey)?n||(t.renderer.setMouseCursor("crosshair"),n=!0):n&&i()},t),a.addListener(e,"keyup",i,t),a.addListener(e,"blur",i,t)}function i(e){n&&(t.renderer.setMouseCursor(""),n=!1)}}(t))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(t){t.cursor||(t.cursor=t.end);var e=this.getSelectionStyle();return t.marker=this.session.addMarker(t,"ace_selection",e),this.session.$selectionMarkers.push(t),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,t},this.removeSelectionMarker=function(t){if(t.marker){this.session.removeMarker(t.marker);var e=this.session.$selectionMarkers.indexOf(t);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(t){for(var e=this.session.$selectionMarkers,n=t.length;n--;){var i=t[n];if(i.marker){this.session.removeMarker(i.marker);var r=e.indexOf(i);-1!=r&&e.splice(r,1)}}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(t){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(t){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(t){var e=t.command,n=t.editor;if(n.multiSelect){if(e.multiSelectAction)"forEach"==e.multiSelectAction?i=n.forEachSelection(e,t.args):"forEachLine"==e.multiSelectAction?i=n.forEachSelection(e,t.args,!0):"single"==e.multiSelectAction?(n.exitMultiSelectMode(),i=e.exec(n,t.args||{})):i=e.multiSelectAction(n,t.args||{});else{var i=e.exec(n,t.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(t,e,n){if(!this.inVirtualSelectionMode){var i,r=1==n||n&&n.$byLines,o=this.session,a=this.selection,l=(n&&n.keepOrder?a:a.rangeList).ranges;if(!l.length)return t.exec?t.exec(this,e||{}):t(this,e||{});var c=a._eventRegistry;a._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var u=l.length;u--;){if(r)for(;u>0&&l[u].start.row==l[u-1].end.row;)u--;h.fromOrientedRange(l[u]),h.index=u,this.selection=o.selection=h;var d=t.exec?t.exec(this,e||{}):t(this,e||{});i||void 0===d||(i=d),h.toOrientedRange(l[u])}h.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=c,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var p=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),p&&p.from==p.to&&this.renderer.animateScrolling(p.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var t="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var e=this.multiSelect.rangeList.ranges,n=[],i=0;io&&(o=n.column),ih?t.insert(i,l.stringRepeat(" ",s-h)):t.remove(new r(i.row,i.column,i.row,i.column-s+h)),e.start.column=e.end.column=o,e.start.row=e.end.row=i.row,e.cursor=e.end}),e.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),u=h.start.row,d=h.end.row,p=u==d;if(p){var f,g=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d0);u<0&&(u=0),d>=g&&(d=g-1)}var m=this.session.removeFullLines(u,d);m=this.$reAlignText(m,p),this.session.insert({row:u,column:0},m.join("\n")+"\n"),p||(h.start.column=0,h.end.column=m[m.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(t,e){var n,i,r,s=!0,o=!0;return t.map(function(t){var e=t.match(/(\s*)(.*?)(\s*)([=:].*)/);return e?null==n?(n=e[1].length,i=e[2].length,r=e[3].length,e):(n+i+r!=e[1].length+e[2].length+e[3].length&&(o=!1),n!=e[1].length&&(s=!1),n>e[1].length&&(n=e[1].length),ie[3].length&&(r=e[3].length),e):[t]}).map(e?c:s?o?function(t){return t[2]?a(n+i-t[2].length)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}:c:function(t){return t[2]?a(n)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]});function a(t){return l.stringRepeat(" ",t)}function c(t){return t[2]?a(n)+t[2]+a(i-t[2].length+r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}}}).call(d.prototype),e.onSessionChange=function(t){var e=t.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var n=t.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),e&&(e.multiSelect.on("addRange",this.$onAddRange),e.multiSelect.on("removeRange",this.$onRemoveRange),e.multiSelect.on("multiSelect",this.$onMultiSelect),e.multiSelect.on("singleSelect",this.$onSingleSelect),e.multiSelect.lead.on("change",this.$checkMultiselectChange),e.multiSelect.anchor.on("change",this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},e.MultiSelect=p,t("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(t){p(this),t?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../../range").Range,r=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(t,e,n){var i=t.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==e&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(t,e,n){return null},this.indentationBlock=function(t,e,n){var r=/\S/,s=t.getLine(e),o=s.search(r);if(-1!=o){for(var a=n||s.length,l=t.getLength(),c=e,h=e;++ec){var p=t.getLine(h).length;return new i(c,a,h,p)}}},this.openingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r+1},a=t.$findClosingBracket(e,o,s);if(a){var l=t.foldWidgets[a.row];return null==l&&(l=t.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=t.getLine(a.row).length),i.fromPoints(o,a)}},this.closingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r},a=t.$findOpeningBracket(e,o);if(a)return a.column++,o.column--,i.fromPoints(a,o)}}).call(r.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";e.isDark=!1,e.cssClass="ace-tm",e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',e.$id="ace/theme/textmate",t("../lib/dom").importCssString(e.cssText,e.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./lib/dom");function r(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(t){var e;return e=this.lineWidgets&&this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0,this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1+e:1+e},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on("beforeRender",this.measureWidgets),t.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(t){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(t,e){var n=e.lineWidgets;if(n&&t.action){for(var i=t.data,r=i.start.row,s=i.end.row,o="add"==t.action,a=r+1;ae[n].column&&n++,s.unshift(n,0),e.splice.apply(e,s),this.$updateRows()}}},this.$updateRows=function(){var t=this.session.lineWidgets;if(t){var e=!0;t.forEach(function(t,n){if(t)for(e=!1,t.row=n;t.$oldWidget;)t.$oldWidget.row=n,t=t.$oldWidget}),e&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(t){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var e=this.session.lineWidgets[t.row];return e&&(t.$oldWidget=e,e.el&&e.el.parentNode&&(e.el.parentNode.removeChild(e.el),e._inDocument=!1)),this.session.lineWidgets[t.row]=t,t},this.addLineWidget=function(t){if(this.$registerLineWidget(t),t.session=this.session,!this.editor)return t;var e=this.editor.renderer;t.html&&!t.el&&(t.el=i.createElement("div"),t.el.innerHTML=t.html),t.el&&(i.addCssClass(t.el,"ace_lineWidgetContainer"),t.el.style.position="absolute",t.el.style.zIndex=5,e.container.appendChild(t.el),t._inDocument=!0,t.coverGutter||(t.el.style.zIndex=3),null==t.pixelHeight&&(t.pixelHeight=t.el.offsetHeight)),null==t.rowCount&&(t.rowCount=t.pixelHeight/e.layerConfig.lineHeight);var n=this.session.getFoldAt(t.row,0);if(t.$fold=n,n){var r=this.session.lineWidgets;t.row!=n.end.row||r[n.start.row]?t.hidden=!0:r[n.start.row]=t}return this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows(),this.renderWidgets(null,e),this.onWidgetChanged(t),t},this.removeLineWidget=function(t){if(t._inDocument=!1,t.session=null,t.el&&t.el.parentNode&&t.el.parentNode.removeChild(t.el),t.editor&&t.editor.destroy)try{t.editor.destroy()}catch(n){}if(this.session.lineWidgets){var e=this.session.lineWidgets[t.row];if(e==t)this.session.lineWidgets[t.row]=t.$oldWidget,t.$oldWidget&&this.onWidgetChanged(t.$oldWidget);else for(;e;){if(e.$oldWidget==t){e.$oldWidget=t.$oldWidget;break}e=e.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(t){for(var e=this.session.lineWidgets,n=e&&e[t],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(t){this.session._changedWidgets.push(t),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(t,e){var n=this.session._changedWidgets,i=e.layerConfig;if(n&&n.length){for(var r=1/0,s=0;s0&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,e.$cursorLayer.config=n;for(var o=r;o<=s;o++){var a=i[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,e.container.appendChild(a.el));var l=e.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:e.gutterWidth;a.fixedWidth||(c-=e.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.el.style.right=a.fixedWidth?e.scrollBar.getWidth()+"px":""}}}}}).call(r.prototype),e.LineWidgets=r}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(t,e,n){"use strict";var i=t("../line_widgets").LineWidgets,r=t("../lib/dom"),s=t("../range").Range;e.showErrorMarker=function(t,e){var n=t.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(t));var o=t.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(t){return"errorMarker"==t.type})[0];l?l.destroy():a-=e;var c,h=function(t,e,n){var i=t.getAnnotations().sort(s.comparePoints);if(i.length){var r=function(t,e,n){for(var i=0,r=t.length-1;i<=r;){var s=i+r>>1,o=n(e,t[s]);if(o>0)i=s+1;else{if(!(o<0))return s;r=s-1}}return-(i+1)}(i,{row:e,column:-1},s.comparePoints);r<0&&(r=-r-1),r>=i.length?r=n>0?0:i.length-1:0===r&&n<0&&(r=i.length-1);var o=i[r];if(o&&n){if(o.row===e){do{o=i[r+=n]}while(o&&o.row===e);if(!o)return i.slice()}var a=[];e=o.row;do{a[n<0?"unshift":"push"](o),o=i[r+=n]}while(o&&o.row==e);return a.length&&a}}}(n,a,e);if(h){var u=h[0];o.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,o.row=u.row,c=t.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(o.row),t.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},p=d.el.appendChild(r.createElement("div")),f=d.el.appendChild(r.createElement("div"));f.className="error_widget_arrow "+c.className;var g=t.renderer.$cursorLayer.getPixelPosition(o).left;f.style.left=g+t.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",p.className="error_widget "+c.className,p.innerHTML=c.text.join("
"),p.appendChild(r.createElement("div"));var m=function(t,e,n){if(0===e&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(d),t.off("changeSelection",d.destroy),t.off("changeSession",d.destroy),t.off("mouseup",d.destroy),t.off("change",d.destroy))},t.keyBinding.addKeyboardHandler(m),t.on("changeSelection",d.destroy),t.on("changeSession",d.destroy),t.on("mouseup",d.destroy),t.on("change",d.destroy),t.session.widgetManager.addLineWidget(d),d.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(t,e,i){"use strict";t("./lib/fixoldbrowsers");var r=t("./lib/dom"),s=t("./lib/event"),o=t("./range").Range,a=t("./editor").Editor,l=t("./edit_session").EditSession,c=t("./undomanager").UndoManager,h=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),e.config=t("./config"),e.require=t,e.define=n("B9Yq"),e.edit=function(t,n){if("string"==typeof t){var i=t;if(!(t=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(t&&t.env&&t.env.editor instanceof a)return t.env.editor;var o="";if(t&&/input|textarea/i.test(t.tagName)){var l=t;o=l.value,t=r.createElement("pre"),l.parentNode.replaceChild(t,l)}else t&&(o=t.textContent,t.innerHTML="");var c=e.createEditSession(o),u=new a(new h(t),c,n),d={document:c,editor:u,onResize:u.resize.bind(u,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),u.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},e.createEditSession=function(t,e){var n=new l(t,e);return n.setUndoManager(new c),n},e.Range=o,e.Editor=a,e.EditSession=l,e.UndoManager=c,e.VirtualRenderer=h,e.version=e.config.version}),ace.require(["ace/ace"],function(e){for(var n in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(n)&&(window.ace[n]=e[n]);window.ace.default=window.ace,t&&(t.exports=window.ace)})}).call(this,n("YuTi")(t))},hyoZ:function(t,e,n){"use strict";var i=n("w+qe"),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=function(t,e){var n,o;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===r.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(o={},null!==(n=e.styleAliases||null)&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){o[String(e)]=t})}),o),-1===s.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},jO2K:function(t,e,n){"use strict";var i;try{i=n("tjlA").Buffer}catch(o){}var r=n("hyoZ"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,o=s;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,r=t.replace(/[\r\n=]/g,""),o=r.length,a=s,l=0,c=[];for(e=0;e>16&255),c.push(l>>8&255),c.push(255&l)),l=l<<6|a.indexOf(r.charAt(e));return 0==(n=o%4*6)?(c.push(l>>16&255),c.push(l>>8&255),c.push(255&l)):18===n?(c.push(l>>10&255),c.push(l>>2&255)):12===n&&c.push(l>>4&255),i?i.from?i.from(c):new i(c):c},predicate:function(t){return i&&i.isBuffer(t)},represent:function(t){var e,n,i="",r=0,o=t.length,a=s;for(e=0;e>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},"kVK+":function(t,e){e.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,h=-7,u=n?r-1:0,d=n?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,h=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},peYA:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},pzZA:function(t,e,n){"use strict";var i=n("hyoZ"),r=Object.prototype.hasOwnProperty;t.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(r.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},spQ0:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},tN50:function(t,e,n){"use strict";var i=n("Y2Yi");function r(t,e,n,i,r){this.name=t,this.buffer=e,this.position=n,this.line=i,this.column=r}r.prototype.getSnippet=function(t,e){var n,r,s,o,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",r=this.position;r>0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(this.position-(r-=1)>e/2-1){n=" ... ",r+=5;break}for(s="",o=this.position;oe/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(r,o),i.repeat(" ",t)+n+a+s+"\n"+i.repeat(" ",t+this.position-r+n.length)+"^"},r.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=r},tjlA:function(t,e,n){"use strict";var i=n("H7XF"),r=n("kVK+"),s=n("49sm");function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function v(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,i,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var h=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var u=!0,d=0;dr&&(i=r):i=r;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function E(t,e,n){return i.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+u<=n)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(i.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),i.push(h),r+=u}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);for(var n="",i=0;i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,i,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,r),h=t.slice(e,n),u=0;ur)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function D(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;rr)&&(n=r);for(var s="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,i,r,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,s=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function $(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,s=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function O(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,i,s){return s||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function N(t,e,n,i,s){return s||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[t+--e]*r;return i},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+r]=t/s&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):$(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):$(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}},vQl5:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},"w+qe":function(t,e,n){"use strict";function i(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}(i.prototype=Object.create(Error.prototype)).constructor=i,i.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=i},ydHo:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ");function s(t){return 48<=t&&t<=55}function o(t){return 48<=t&&t<=57}t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=t.length,r=0,a=!1;if(!i)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===i)return!0;if("b"===(e=t[++r])){for(r++;r=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},zUnb:function(t,e,n){"use strict";function i(t){return"function"==typeof t}n.r(e);let r=!1;const s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}};function o(t){setTimeout(()=>{throw t},0)}const a={closed:!0,next(t){},error(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;o(t)},complete(){}},l=(()=>Array.isArray||(t=>t&&"number"==typeof t.length))();function c(t){return null!==t&&"object"==typeof t}const h=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();let u=(()=>{class t{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:s,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(let t=0;tt.concat(e instanceof h?e.errors:e),[])}const p=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class f extends u{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!t){this.destination=a;break}if("object"==typeof t){t instanceof f?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,t,e,n)}}[p](){return this}static create(t,e,n){const i=new f(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class g extends f{constructor(t,e,n,r){let s;super(),this._parentSubscriber=t;let o=this;i(e)?s=e:e&&(s=e.next,n=e.error,r=e.complete,e!==a&&(o=Object.create(e),i(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=n,this._complete=r}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=s;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):o(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;o(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw n;o(n)}}__tryOrSetError(t,e,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(o(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const m=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function v(t){return t}let y=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof f)return t;if(t[p])return t[p]()}return t||e||n?new f(t,e,n):new f(a)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),s.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){s.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof f?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=b(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[m](){return this}pipe(...t){return 0===t.length?this:(0===(e=t).length?v:1===e.length?e[0]:function(t){return e.reduce((t,e)=>e(t),t)})(this);var e}toPromise(t){return new(t=b(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function b(t){if(t||(t=s.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const w=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class x extends u{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class _ extends f{constructor(t){super(t),this.destination=t}}let C=(()=>{class t extends y{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new _(this)}lift(t){const e=new S(this,this);return e.operator=t,e}next(t){if(this.closed)throw new w;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew S(t,e),t})();class S extends C{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):u.EMPTY}}function E(t){return t&&"function"==typeof t.schedule}function k(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new A(t,e))}}class A{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new D(t,this.project,this.thisArg))}}class D extends f{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const T=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function M(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const I=t=>{if(t&&"function"==typeof t[m])return i=t,t=>{const e=i[m]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(L(t))return T(t);if(M(t))return n=t,t=>(n.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,o),t);if(t&&"function"==typeof t[F])return e=t,t=>{const n=e[F]();for(;;){let e;try{e=n.next()}catch(i){return t.error(i),t}if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t};{const e=c(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var e,n,i};function $(t,e){return new y(n=>{const i=new u;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function O(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[m]}(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>{const r=t[m]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(M(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(L(t))return $(t,e);if(function(t){return t&&"function"==typeof t[F]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new y(n=>{const i=new u;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[F](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof y?t:new y(I(t))}class P extends f{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class N extends f{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function B(t,e){if(!e.closed)return t instanceof y?t.subscribe(e):I(t)(e)}function U(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(U((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new V(t,n)))}class V{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new H(t,this.project,this.concurrent))}}class H extends N{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function j(t=Number.POSITIVE_INFINITY){return U(v,t)}function z(t,e){return e?$(t,e):new y(T(t))}function W(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return E(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof y?t[0]:j(e)(z(t,n))}function G(){return function(t){return t.lift(new q(t))}}class q{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new K(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class K extends f{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,!i||n&&i!==n||i.unsubscribe()}}class X extends y{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new u,t.add(this.source.subscribe(new J(this.getSubject(),this))),t.closed&&(this._connection=null,t=u.EMPTY)),t}refCount(){return G()(this)}}const Y=(()=>{const t=X.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class J extends _{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function Q(){return new C}function Z(){return t=>{return G()((e=Q,function(t){let n;n="function"==typeof e?e:function(){return e};const i=Object.create(t,Y);return i.source=t,i.subjectFactory=n,i})(t));var e}}function tt(t){for(let e in t)if(t[e]===tt)return e;throw Error("Could not find renamed property on target object.")}function et(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function nt(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(nt).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function it(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const rt=tt({__forward_ref__:tt});function st(t){return t.__forward_ref__=st,t.toString=function(){return nt(this())},t}function ot(t){return at(t)?t():t}function at(t){return"function"==typeof t&&t.hasOwnProperty(rt)&&t.__forward_ref__===st}function lt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function ct(t){return{factory:t.factory,providers:t.providers||[],imports:t.imports||[]}}function ht(t){return ut(t,pt)||ut(t,gt)}function ut(t,e){return t.hasOwnProperty(e)?t[e]:null}function dt(t){return t&&(t.hasOwnProperty(ft)||t.hasOwnProperty(mt))?t[ft]:null}const pt=tt({"\u0275prov":tt}),ft=tt({"\u0275inj":tt}),gt=tt({ngInjectableDef:tt}),mt=tt({ngInjectorDef:tt});var vt=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});let yt;function bt(t){const e=yt;return yt=t,e}function wt(t,e,n){const i=ht(t);if(i&&"root"==i.providedIn)return void 0===i.value?i.value=i.factory():i.value;if(n&vt.Optional)return null;if(void 0!==e)return e;throw new Error(`Injector: NOT_FOUND [${nt(t)}]`)}function xt(t){return{toString:t}.toString()}var _t=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}({}),Ct=function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({});const St="undefined"!=typeof globalThis&&globalThis,Et="undefined"!=typeof window&&window,kt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,At="undefined"!=typeof global&&global,Dt=St||At||Et||kt,Tt={},Rt=[],Ft=tt({"\u0275cmp":tt}),Lt=tt({"\u0275dir":tt}),Mt=tt({"\u0275pipe":tt}),It=tt({"\u0275mod":tt}),$t=tt({"\u0275loc":tt}),Ot=tt({"\u0275fac":tt}),Pt=tt({__NG_ELEMENT_ID__:tt});let Nt=0;function Bt(t){return xt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===_t.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||Rt,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||Ct.Emulated,id:"c",styles:t.styles||Rt,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Nt++,n.inputs=zt(t.inputs,e),n.outputs=zt(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(Ut):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(Vt):null,n})}function Ut(t){return Gt(t)||function(t){return t[Lt]||null}(t)}function Vt(t){return function(t){return t[Mt]||null}(t)}const Ht={};function jt(t){const e={type:t.type,bootstrap:t.bootstrap||Rt,declarations:t.declarations||Rt,imports:t.imports||Rt,exports:t.exports||Rt,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&xt(()=>{Ht[t.id]=t.type}),e}function zt(t,e){if(null==t)return Tt;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const Wt=Bt;function Gt(t){return t[Ft]||null}function qt(t,e){const n=t[It]||null;if(!n&&!0===e)throw new Error(`Type ${nt(t)} does not have '\u0275mod' property.`);return n}const Kt=20,Xt=10;function Yt(t){return Array.isArray(t)&&"object"==typeof t[1]}function Jt(t){return Array.isArray(t)&&!0===t[1]}function Qt(t){return 0!=(8&t.flags)}function Zt(t){return 2==(2&t.flags)}function te(t){return 1==(1&t.flags)}function ee(t){return null!==t.template}function ne(t,e){return t.hasOwnProperty(Ot)?t[Ot]:null}class ie extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function re(t){return"string"==typeof t?t:null==t?"":String(t)}function se(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():re(t)}function oe(t,e){const n=e?" in "+e:"";throw new ie("201",`No provider for ${se(t)} found${n}`)}class ae{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function le(){return ce}function ce(t){return t.type.prototype.ngOnChanges&&(t.setInput=ue),he}function he(){const t=de(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Tt)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function ue(t,e,n,i){const r=de(t)||function(t,e){return t.__ngSimpleChanges__=e}(t,{previous:Tt,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new ae(l&&l.currentValue,e,o===Tt),t[i]=e}function de(t){return t.__ngSimpleChanges__||null}le.ngInherit=!0;const pe="http://www.w3.org/2000/svg";let fe=void 0;function ge(){return void 0!==fe?fe:"undefined"!=typeof document?document:void 0}function me(t){return!!t.listen}const ve={createRenderer:(t,e)=>ge()};function ye(t){for(;Array.isArray(t);)t=t[0];return t}function be(t,e){return ye(e[t])}function we(t,e){return ye(e[t.index])}function xe(t,e){return t.data[e]}function _e(t,e){return t[e]}function Ce(t,e){const n=e[t];return Yt(n)?n:n[0]}function Se(t){const e=function(t){return t.__ngContext__||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Ee(t){return 4==(4&t[2])}function ke(t){return 128==(128&t[2])}function Ae(t,e){return null==e?null:t[e]}function De(t){t[18]=0}function Te(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Re={lFrame:tn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Fe(){return Re.bindingsEnabled}function Le(){return Re.lFrame.lView}function Me(){return Re.lFrame.tView}function Ie(t){Re.lFrame.contextLView=t}function $e(){let t=Oe();for(;null!==t&&64===t.type;)t=t.parent;return t}function Oe(){return Re.lFrame.currentTNode}function Pe(t,e){const n=Re.lFrame;n.currentTNode=t,n.isParent=e}function Ne(){return Re.lFrame.isParent}function Be(){Re.lFrame.isParent=!1}function Ue(){return Re.isInCheckNoChangesMode}function Ve(t){Re.isInCheckNoChangesMode=t}function He(){const t=Re.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function je(){return Re.lFrame.bindingIndex}function ze(){return Re.lFrame.bindingIndex++}function We(t){const e=Re.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function Ge(t,e){const n=Re.lFrame;n.bindingIndex=n.bindingRootIndex=t,qe(e)}function qe(t){Re.lFrame.currentDirectiveIndex=t}function Ke(){return Re.lFrame.currentQueryIndex}function Xe(t){Re.lFrame.currentQueryIndex=t}function Ye(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function Je(t,e,n){if(n&vt.SkipSelf){let i=e,r=t;for(;i=i.parent,!(null!==i||n&vt.Host||(i=Ye(r),null===i)||(r=r[15],10&i.type)););if(null===i)return!1;e=i,t=r}const i=Re.lFrame=Ze();return i.currentTNode=e,i.lView=t,!0}function Qe(t){const e=Ze(),n=t[1];Re.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function Ze(){const t=Re.lFrame,e=null===t?null:t.child;return null===e?tn(t):e}function tn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function en(){const t=Re.lFrame;return Re.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const nn=en;function rn(){const t=en();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function sn(){return Re.lFrame.selectedIndex}function on(t){Re.lFrame.selectedIndex=t}function an(){const t=Re.lFrame;return xe(t.tView,t.selectedIndex)}function ln(){Re.lFrame.currentNamespace=pe}function cn(){Re.lFrame.currentNamespace=null}function hn(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[o]<0&&(t[18]+=65536),(s>11>16&&(3&t[2])===e&&(t[2]+=2048,s.call(o)):s.call(o)}const mn=-1;class vn{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function yn(t,e,n){const i=me(t);let r=0;for(;re){o=s-1;break}}}for(;s>16,i=e;for(;n>0;)i=i[15],n--;return i}let kn=!0;function An(t){const e=kn;return kn=t,e}let Dn=0;function Tn(t,e){const n=Fn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Rn(i.data,t),Rn(e,null),Rn(i.blueprint,null));const r=Ln(t,e),s=t.injectorIndex;if(Cn(r)){const t=Sn(r),n=En(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Rn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Fn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function Ln(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return mn;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return mn}function Mn(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Pt)&&(i=n[Pt]),null==i&&(i=n[Pt]=Dn++);const r=255&i,s=1<=0?255&e:Nn:e}(n);if("function"==typeof s){if(!Je(e,t,i))return i&vt.Host?In(r,n,i):$n(e,n,i,r);try{const t=s();if(null!=t||i&vt.Optional)return t;oe(n)}finally{nn()}}else if("number"==typeof s){let r=null,o=Fn(t,e),a=mn,l=i&vt.Host?e[16][6]:null;for((-1===o||i&vt.SkipSelf)&&(a=-1===o?Ln(t,e):e[o+8],a!==mn&&jn(i,!1)?(r=e[1],o=Sn(a),e=En(a,e)):o=-1);-1!==o;){const t=e[1];if(Hn(s,o,t.data)){const t=Bn(o,e,n,r,i,l);if(t!==Pn)return t}a=e[o+8],a!==mn&&jn(i,e[1].data[o+8]===l)&&Hn(s,o,e)?(r=t,o=Sn(a),e=En(a,e)):o=-1}}}return $n(e,n,i,r)}const Pn={};function Nn(){return new zn($e(),Le())}function Bn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Un(a,o,n,null==i?Zt(a)&&kn:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==l?Vn(e,o,l,a):Pn}function Un(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,h=r?a+c:t.directiveEnd;for(let u=i?a:a+c;u=l&&t.type===n)return u}if(r){const t=o[l];if(t&&ee(t)&&t.type===n)return l}return null}function Vn(t,e,n,i){let r=t[n];const s=e.data;if(r instanceof vn){const o=r;o.resolving&&function(t,e){throw new ie("200","Circular dependency in DI detected for "+t)}(se(s[n]));const a=An(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?bt(o.injectImpl):null;Je(t,i,vt.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ce(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&bt(l),An(a),o.resolving=!1,nn()}}return r}function Hn(t,e,n){const i=64&t,r=32&t;let s;return s=128&t?i?r?n[e+7]:n[e+6]:r?n[e+5]:n[e+4]:i?r?n[e+3]:n[e+2]:r?n[e+1]:n[e],!!(s&1<{const t=Wn(ot(e));return t?t():null};let n=ne(e);if(null===n){const t=dt(e);n=t&&t.factory}return n||null}function Gn(t){return xt(()=>{const e=t.prototype.constructor,n=e[Ot]||Wn(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Ot]||Wn(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function qn(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(Kn)?t[Kn]:Object.defineProperty(t,Kn,{value:[]})[Kn];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class Yn{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=lt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return"InjectionToken "+this._desc}}const Jn=new Yn("AnalyzeForEntryComponents"),Qn=Function;function Zn(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ti(t,e):e(t))}function ei(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ni(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function ii(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function si(t,e){const n=oi(t,e);if(n>=0)return t[1|n]}function oi(t,e){return function(t,e,n){let i=0,r=t.length>>1;for(;r!==i;){const n=i+(r-i>>1),s=t[n<<1];if(e===s)return n<<1;s>e?r=n:i=n+1}return~(r<<1)}(t,e)}const ai=Xn("Inject",t=>({token:t})),li=Xn("Optional"),ci=Xn("Self"),hi=Xn("SkipSelf"),ui={},di=/\n/gm,pi="__source",fi=tt({provide:String,useValue:tt});let gi,mi=void 0;function vi(t){const e=mi;return mi=t,e}function yi(t,e=vt.Default){if(void 0===mi)throw new Error("inject() must be called from an injection context");return null===mi?wt(t,void 0,e):mi.get(t,e&vt.Optional?null:void 0,e)}function bi(t,e=vt.Default){return(yt||yi)(ot(t),e)}function wi(t){const e=[];for(let n=0;nt,createScript:t=>t,createScriptURL:t=>t})}catch(e){}return gi}())||void 0===e?void 0:e.createHTML(t))||t}class _i{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see https://g.co/ng/security#xss)"}}class Ci extends _i{getTypeName(){return"HTML"}}class Si extends _i{getTypeName(){return"Style"}}class Ei extends _i{getTypeName(){return"Script"}}class ki extends _i{getTypeName(){return"URL"}}class Ai extends _i{getTypeName(){return"ResourceURL"}}function Di(t){return t instanceof _i?t.changingThisBreaksApplicationSecurity:t}function Ti(t,e){const n=Ri(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Ri(t){return t instanceof _i&&t.getTypeName()||null}class Fi{getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(xi(t),"text/html").body;return e.removeChild(e.firstChild),e}catch(e){return null}}}class Li{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=xi(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=xi(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0$i(t.trim())).join(", ")),this.buf.push(" ",e,'="',Yi(o),'"')}var i;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();Hi.hasOwnProperty(e)&&!Ni.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(Yi(t))}checkClobberedElement(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}}const Ki=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xi=/([^\#-~ |!])/g;function Yi(t){return t.replace(/&/g,"&").replace(Ki,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Xi,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Ji;function Qi(t,e){let n=null;try{Ji=Ji||function(t){return function(){try{return!!(new window.DOMParser).parseFromString(xi(""),"text/html")}catch(t){return!1}}()?new Fi:new Li(t)}(t);let i=e?String(e):"";n=Ji.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=Ji.getInertBodyElement(i)}while(i!==s);return(new qi).sanitizeChildren(Zi(n)||n)}finally{if(n){const t=Zi(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function Zi(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var tr=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}({});function er(t){const e=ir();return e?e.sanitize(tr.HTML,t)||"":Ti(t,"HTML")?Di(t):Qi(ge(),re(t))}function nr(t){const e=ir();return e?e.sanitize(tr.URL,t)||"":Ti(t,"URL")?Di(t):$i(re(t))}function ir(){const t=Le();return t&&t[12]}function rr(t){return t.ngDebugContext}function sr(t){return t.ngOriginalError}function or(t,...e){t.error(...e)}class ar{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t.ngErrorLogger||or}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?rr(t)?rr(t):this._findContext(sr(t)):null}_findOriginalError(t){let e=sr(t);for(;e&&sr(e);)e=sr(e);return e}}function lr(t,e){t.__ngContext__=e}const cr=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Dt))();function hr(t){return{name:"window",target:t.ownerDocument.defaultView}}function ur(t){return t instanceof Function?t():t}var dr=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({});function pr(t,e){return(void 0)(t,e)}function fr(t){const e=t[3];return Jt(e)?e[3]:e}function gr(t){return vr(t[13])}function mr(t){return vr(t[4])}function vr(t){for(;null!==t&&!Jt(t);)t=t[4];return t}function yr(t,e,n,i,r){if(null!=i){let s,o=!1;Jt(i)?s=i:Yt(i)&&(o=!0,i=i[0]);const a=ye(i);0===t&&null!==n?null==r?kr(e,n,a):Er(e,n,a,r||null,!0):1===t&&null!==n?Er(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Dr(t,e);i&&function(t,e,n,i){me(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==ye(n)&&yr(e,t,i,s,r);for(let o=Xt;o0&&(t[n-1][4]=i[4]);const o=ni(t,Xt+e);$r(i[1],r=i,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}var r;return i}function _r(t,e){if(!(256&e[2])){const n=e[11];me(n)&&n.destroyNode&&$r(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Cr(t[1],t);for(;e;){let n=null;if(Yt(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)Yt(e)&&Cr(e[1],e),e=e[3];null===e&&(e=t),Yt(e)&&Cr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Cr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),t+=2}else{const e=i[r=n[t+1]];n[t].call(e)}if(null!==i)for(let t=r+1;ts?"":r[h+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==Br(e,c,0)||2&i&&c!==t){if(Wr(i))return!1;o=!0}}}}else{if(!o&&!Wr(i)&&!Wr(l))return!1;if(o&&Wr(l))continue;o=!1,i=l|1&i}}return Wr(i)||o}function Wr(t){return 0==(1&t)}function Gr(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""===r||Wr(o)||(e+=Xr(s,r),r=""),i=o,s=s||!Wr(i);n++}return""!==r&&(e+=Xr(s,r)),e}const Jr={};function Qr(t){Zr(Me(),Le(),sn()+t,Ue())}function Zr(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&un(e,i,n)}else{const i=t.preOrderHooks;null!==i&&dn(e,i,0,n)}on(n)}function ts(t,e){return t<<17|e<<2}function es(t){return t>>17&32767}function ns(t){return 2|t}function is(t){return(131068&t)>>2}function rs(t,e){return-131069&t|e<<2}function ss(t){return 1|t}function os(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;iKt&&Zr(t,e,Kt,Ue()),n(i,r)}finally{on(s)}}function fs(t,e,n){if(Qt(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function Ss(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Es(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function ks(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&Is(n)}}function Is(t){for(let n=gr(t);null!==n;n=mr(n))for(let t=Xt;t0&&Is(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&Is(i)}}function $s(t,e){const n=Ce(e,t),i=n[1];!function(t,e){for(let n=e.length;nPromise.resolve(null))();function Hs(t){return t[7]||(t[7]=[])}function js(t){return t.cleanup||(t.cleanup=[])}function zs(t,e){const n=t[9],i=n?n.get(ar,null):null;i&&i.handleError(e)}function Ws(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ti([t],t=>this.processInjectorType(t,[],r)),this.records.set(Ks,oo(void 0,this));const s=this.records.get(Ys);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:nt(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=ui,n=vt.Default){this.assertNotDestroyed();const i=vi(this);try{if(!(n&vt.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=("function"==typeof(r=t)||"object"==typeof r&&r instanceof Yn)&&ht(t);e=n&&this.injectableDefInScope(n)?oo(ro(t),Js):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&vt.Self?eo():this.parent).get(t,e=n&vt.Optional&&e===ui?null:e)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(nt(t)),i)throw s;return function(t,e,n,i){const r=t.ngTempTokenPath;throw e[pi]&&r.unshift(e[pi]),t.message=function(t,e,n,i=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let r=nt(e);if(Array.isArray(e))r=e.map(nt).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):nt(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(di,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t.ngTempTokenPath=null,t}(s,t,"R3InjectorError",this.source)}throw s}finally{vi(i)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(nt(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ot(t)))return!1;let i=dt(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=dt(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ti(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||Zs))}}this.injectorDefTypes.add(s),this.records.set(s,oo(i.factory,Js));const a=i.providers;if(null!=a&&!o){const e=t;ti(a,t=>this.processProvider(t,e,a))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=lo(t=ot(t))?t:ot(t&&t.provide);const r=function(t,e,n){return ao(t)?oo(void 0,t.useValue):oo(so(t),Js)}(t);if(lo(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=oo(void 0,Js,!0),e.factory=()=>wi(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){var n;return e.value===Js&&(e.value=Qs,e.value=e.factory()),"object"==typeof e.value&&e.value&&null!==(n=e.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){return!!t.providedIn&&("string"==typeof t.providedIn?"any"===t.providedIn||t.providedIn===this.scope:this.injectorDefTypes.has(t.providedIn))}}function ro(t){const e=ht(t),n=null!==e?e.factory:ne(t);if(null!==n)return n;const i=dt(t);if(null!==i)return i.factory;if(t instanceof Yn)throw new Error(`Token ${nt(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=ii(e,"?");throw new Error(`Can't resolve all parameters for ${nt(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[pt]||t[gt]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function so(t,e,n){let i=void 0;if(lo(t)){const e=ot(t);return ne(e)||ro(e)}if(ao(t))i=()=>ot(t.useValue);else if((r=t)&&r.useFactory)i=()=>t.useFactory(...wi(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>bi(ot(t.useExisting));else{const e=ot(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return ne(e)||ro(e);i=()=>new e(...wi(t.deps))}var r;return i}function oo(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function ao(t){return null!==t&&"object"==typeof t&&fi in t}function lo(t){return"function"==typeof t}const co=function(t,e,n){return function(t,e=null,n=null,i){const r=no(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};let ho=(()=>{class t{static create(t,e){return Array.isArray(t)?co(t,e,""):co(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=ui,t.NULL=new Xs,t.\u0275prov=lt({token:t,providedIn:"any",factory:()=>bi(Ks)}),t.__NG_ELEMENT_ID__=-1,t})();function uo(t,e){hn(Se(t)[1],$e())}function po(t){let e=Object.getPrototypeOf(t.type.prototype).constructor,n=!0;const i=[t];for(;e;){let r=void 0;if(ee(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=fo(t.inputs),e.declaredInputs=fo(t.declaredInputs),e.outputs=fo(t.outputs);const n=r.hostBindings;n&&vo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&go(t,s),o&&mo(t,o),et(t.inputs,r.inputs),et(t.declaredInputs,r.declaredInputs),et(t.outputs,r.outputs),ee(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=xn(r.hostAttrs,n=xn(n,r.hostAttrs))}}(i)}function fo(t){return t===Tt?{}:t===Rt?[]:t}function go(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function mo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function vo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}let yo=null;function bo(){if(!yo){const t=Dt.Symbol;if(t&&t.iterator)yo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(ye(t[i.index])).target:i.index;if(me(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,u=!1;else{s=jo(i,e,s,!1);const t=n.listen(p.name||f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=jo(i,e,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=jo(i,e,s,!1);const d=i.outputs;let p;if(u&&null!==d&&(p=d[r])){const t=p.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Re.lFrame.contextLView))[8]}(t)}function Wo(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Zo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ta(t){return t.substring(Zo.key,Zo.keyEnd)}function ea(t,e){const n=Zo.textEnd;return n===e?-1:(e=Zo.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Zo.key=e,n),na(t,e,n))}function na(t,e,n){for(;e=0;n=ea(e,n))ri(t,ta(e),!0)}function aa(t,e,n,i){const r=Le(),s=Me(),o=We(2);s.firstUpdatePass&&ha(s,t,o,i),e!==Jr&&So(r,o,e)&&pa(s,s.data[sn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=nt(Di(t)))),t}(e,n),i,o)}function la(t,e,n,i){const r=Me(),s=We(2);r.firstUpdatePass&&ha(r,null,s,i);const o=Le();if(n!==Jr&&So(o,s,n)){const a=r.data[sn()];if(ma(a,i)&&!ca(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=it(t,n||"")),Lo(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===Jr&&(r=Yo);let l=0,c=0,h=0=t.expandoStartIndex}function ha(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[sn()],o=ca(t,n);ma(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=function(t){const e=Re.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=da(n=ua(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=ua(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==is(i))return t[es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=ua(null,t,e,n[1],i),n=da(n,e.attrs,i),function(t,e,n,i){t[es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i=void 0;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(h=!0)}else c=n;if(r)if(0!==l){const e=es(t[a+1]);t[i+1]=ts(e,a),0!==e&&(t[e+1]=rs(t[e+1],i)),t[a+1]=131071&t[a+1]|i<<17}else t[i+1]=ts(a,0),0!==a&&(t[a+1]=rs(t[a+1],i)),a=i;else t[i+1]=ts(l,0),0===a?a=i:t[l+1]=rs(t[l+1],i),l=i;h&&(t[i+1]=ns(t[i+1])),Jo(t,c,i,!0),Jo(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&oi(s,e)>=0&&(n[i+1]=ss(n[i+1]))}(e,c,t,i,s),o=ts(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function ua(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let h=n[r+1];h===Jr&&(h=c?Yo:void 0);let u=c?si(h,i):l===i?h:void 0;if(s&&!ga(u)&&(u=si(e,i)),ga(u)&&(a=u,o))return a;const d=t[r+1];r=o?es(d):is(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=si(t,i))}return a}function ga(t){return void 0!==t}function ma(t,e){return 0!=(t.flags&(e?16:32))}function va(t,e=""){const n=Le(),i=Me(),r=t+Kt,s=i.firstCreatePass?ls(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return me(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Fr(i,n,o,s),Pe(s,!1)}function ya(t){return ba("",t,""),ya}function ba(t,e,n){const i=Le(),r=Ao(i,t,e,n);return r!==Jr&&Gs(i,sn(),r),ba}function wa(t,e,n,i,r){const s=Le(),o=function(t,e,n,i,r,s){const o=Eo(t,je(),n,r);return We(2),o?e+re(n)+i+re(r)+s:Jr}(s,t,e,n,i,r);return o!==Jr&&Gs(s,sn(),o),wa}function xa(t,e,n){const i=Le();return So(i,ze(),e)&&xs(Me(),an(),i,t,e,i[11],n,!0),xa}const _a=void 0;var Ca=["en",[["a","p"],["AM","PM"],_a],[["AM","PM"],_a,_a],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],_a,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],_a,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",_a,"{1} 'at' {0}",_a],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let Sa={};function Ea(t){return t in Sa||(Sa[t]=Dt.ng&&Dt.ng.common&&Dt.ng.common.locales&&Dt.ng.common.locales[t]),Sa[t]}var ka=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}({});const Aa="en-US";let Da=Aa;function Ta(t){var e,n;n="Expected localeId to be defined",null==(e=t)&&function(t,e,n,i){throw new Error("ASSERTION ERROR: "+t+` [Expected=> null != ${e} <=Actual]`)}(n,e),"string"==typeof t&&(Da=t.toLowerCase().replace(/_/g,"-"))}function Ra(t,e,n,i,r){if(t=ot(t),Array.isArray(t))for(let s=0;s>20;if(lo(t)||!t.multi){const i=new vn(l,r,Ro),p=Ma(a,e,r?h:h+d,u);-1===p?(Mn(Tn(c,o),s,a),Fa(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=Ma(a,e,h+d,u),f=Ma(a,e,h,h+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Mn(Tn(c,o),s,a);const h=function(t,e,n,i,r){const s=new vn(t,n,Ro);return s.multi=[],s.index=e,s.componentProviders=0,La(s,r,i&&!n),s}(r?$a:Ia,n.length,r,i,l);!r&&m&&(n[f].providerFactory=h),Fa(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(h),o.push(h)}else Fa(s,t,p>-1?p:f,La(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function Fa(t,e,n,i){const r=lo(e);if(r||e.useClass){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function La(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function Ma(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=Me();if(i.firstCreatePass){const r=ee(t);Ra(n,i.data,i.blueprint,r,!0),Ra(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class Na{}class Ba{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${nt(t)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=t,e}(t)}}let Ua=(()=>{class t{}return t.NULL=new Ba,t})();function Va(...t){}function Ha(t,e){return new za(we(t,e))}const ja=function(){return Ha($e(),Le())};let za=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=ja,t})();class Wa{}let Ga=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>qa(),t})();const qa=function(){const t=Le(),e=Ce($e().index,t);return function(t){return t[11]}(Yt(e)?e:t)};let Ka=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>null}),t})();class Xa{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Ya=new Xa("11.0.5");class Ja{constructor(){}supports(t){return xo(t)}create(t){return new Za(t)}}const Qa=(t,e)=>e;class Za{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Qa}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):t=this._addAfter(new tl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new nl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new nl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class tl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class el{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class nl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new el,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function il(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new ol(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class ol{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let al=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new Ja])}),t})(),ll=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new rl])}),t})();function cl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(ye(s)),Jt(s))for(let t=Xt;t-1&&this._viewContainerRef.detach(t),this._viewContainerRef=null}_r(this._lView[1],this._lView)}onDestroy(t){bs(this._lView[1],this._lView,null,t)}markForCheck(){Ps(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ns(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Ve(!0);try{Ns(t,e,n)}finally{Ve(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t}detachFromAppRef(){var t;this._appRef=null,$r(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class ul extends hl{constructor(t){super(t),this._view=t}detectChanges(){Bs(this._view)}checkNoChanges(){!function(t){Ve(!0);try{Bs(t)}finally{Ve(!1)}}(this._view)}get context(){return null}}const dl=function(t=!1){return function(t,e,n){if(!n&&Zt(t)){const n=Ce(t.index,e);return new hl(n,n)}return 47&t.type?new hl(e[16],e):null}($e(),Le(),t)};let pl=(()=>{class t{}return t.__NG_ELEMENT_ID__=dl,t.__ChangeDetectorRef__=!0,t})();const fl=[new rl],gl=new al([new Ja]),ml=new ll(fl),vl=function(){return xl($e(),Le())};let yl=(()=>{class t{}return t.__NG_ELEMENT_ID__=vl,t})();const bl=yl,wl=class extends bl{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=as(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),hs(e,n,t),new hl(n)}};function xl(t,e){return 4&t.type?new wl(e,t,Ha(t,e)):null}class _l{}class Cl{}const Sl=function(){return Rl($e(),Le())};let El=(()=>{class t{}return t.__NG_ELEMENT_ID__=Sl,t})();const kl=El,Al=class extends kl{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ha(this._hostTNode,this._hostLView)}get injector(){return new zn(this._hostTNode,this._hostLView)}get parentInjector(){const t=Ln(this._hostTNode,this._hostLView);if(Cn(t)){const e=En(t,this._hostLView),n=Sn(t);return new zn(e[1].data[n+8],e)}return new zn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=Dl(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-Xt}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(_l,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(Jt(n[3])){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new Al(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=Xt+i,s=n.length;i>0&&(n[r-1][4]=e),icr});class $l extends Na{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=t.selectors.map(Yr).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return Ml(this.componentDef.inputs)}get outputs(){return Ml(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,Fl,r);return s!==Fl||i===Fl?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Wa,ve),o=r.get(Ka,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(me(t))return t.selectRootElement(e,n===Ct.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):br(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?pe:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),h=this.componentDef.onPush?576:528,u={components:[],scheduler:cr,clean:Vs,playerHandler:null,flags:0},d=ys(0,null,null,1,0,null,null,null,null,null),p=as(null,d,u,h,null,null,s,a,o,r);let f,g;Qe(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=ls(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(qs(a,l,!0),null!==t&&(yn(r,t,l),null!==a.classes&&Nr(r,t,a.classes),null!==a.styles&&Pr(r,t,a.styles)));const c=i.createRenderer(t,e),h=as(n,vs(e),null,e.onPush?64:16,n[20],a,i,c,null,null);return o.firstCreatePass&&(Mn(Tn(a,n),o,e.type),Es(o,a),As(a,n.length,1)),Os(n,h),n[20]=h}(c,this.componentDef,p,s,a);if(c)if(n)yn(a,c,["ng-version",Ya.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&Nr(a,c,e.join(" "))}if(g=xe(d,Kt),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=$e();e.contentQueries(1,o,t.directiveStart)}const a=$e();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(on(a.index),Cs(n[1],a,0,a.directiveStart,a.directiveEnd,e),Ss(e,o)),o}(t,this.componentDef,p,u,[uo]),hs(d,p,null)}finally{rn()}return new Ol(this.componentType,f,Ha(g,p),p,g)}}class Ol extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new ul(i),this.componentType=t}get injector(){return new zn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Pl=new Map;class Nl extends _l{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Ll(this);const n=qt(t),i=t[$t]||null;i&&Ta(i),this._bootstrapComponents=ur(n.bootstrap),this._r3Injector=no(t,e,[{provide:_l,useValue:this},{provide:Ua,useValue:this.componentFactoryResolver}],nt(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=ho.THROW_IF_NOT_FOUND,n=vt.Default){return t===ho||t===_l||t===Ks?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Bl extends Cl{constructor(t){super(),this.moduleType=t,null!==qt(t)&&function(t){const e=new Set;!function t(n){const i=qt(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${nt(e)} vs ${nt(e.name)}`)}(r,Pl.get(r),n),Pl.set(r,n));const s=ur(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Nl(this.moduleType,t)}}function Ul(t,e,n){const i=He()+t,r=Le();return r[i]===Jr?Co(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Vl(t,e,n,i){return zl(Le(),He(),t,e,n,i)}function Hl(t,e,n,i,r){return function(t,e,n,i,r,s,o){const a=e+n;return Eo(t,a,r,s)?Co(t,a+2,o?i.call(o,r,s):i(r,s)):jl(t,a+2)}(Le(),He(),t,e,n,i,r)}function jl(t,e){const n=t[e];return n===Jr?void 0:n}function zl(t,e,n,i,r,s){const o=e+n;return So(t,o,r)?Co(t,o+1,s?i.call(s,r):i(r)):jl(t,o+1)}const Wl=class extends C{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){let i,r=t=>null,s=()=>null;t&&"object"==typeof t?(i=this.__isAsync?e=>{setTimeout(()=>t.next(e))}:e=>{t.next(e)},t.error&&(r=this.__isAsync?e=>{setTimeout(()=>t.error(e))}:e=>{t.error(e)}),t.complete&&(s=this.__isAsync?()=>{setTimeout(()=>t.complete())}:()=>{t.complete()})):(i=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)},e&&(r=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)}),n&&(s=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const o=super.subscribe(i,r,s);return t instanceof u&&t.add(o),o}};function Gl(){return this._results[bo()]()}class ql{constructor(){this.dirty=!0,this._results=[],this.changes=new Wl,this.length=0;const t=bo(),e=ql.prototype;e[t]||(e[t]=Gl)}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t){this._results=Zn(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Kl{constructor(t){this.queryList=t,this.matches=null}clone(){return new Kl(this.queryList)}setDirty(){this.queryList.setDirty()}}class Xl{constructor(t=[]){this.queries=t}createEmbeddedView(t){const e=t.queries;if(null!==e){const n=null!==t.contentQueries?t.contentQueries[0]:e.length,i=[];for(let t=0;t0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=Xt;t{class t{constructor(t){this.appInits=t,this.resolve=Va,this.reject=Va,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(bi(pc,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const gc=new Yn("AppId"),mc={provide:gc,useFactory:function(){return`${vc()}${vc()}${vc()}`},deps:[]};function vc(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const yc=new Yn("Platform Initializer"),bc=new Yn("Platform ID"),wc=new Yn("appBootstrapListener");let xc=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const _c=new Yn("LocaleId"),Cc=new Yn("DefaultCurrencyCode");class Sc{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const Ec=function(t){return new Bl(t)},kc=Ec,Ac=function(t){return Promise.resolve(Ec(t))},Dc=function(t){const e=Ec(t),n=ur(qt(t).declarations).reduce((t,e)=>{const n=Gt(e);return n&&t.push(new $l(n)),t},[]);return new Sc(e,n)},Tc=Dc,Rc=function(t){return Promise.resolve(Dc(t))};let Fc=(()=>{class t{constructor(){this.compileModuleSync=kc,this.compileModuleAsync=Ac,this.compileModuleAndAllComponentsSync=Tc,this.compileModuleAndAllComponentsAsync=Rc}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Lc=(()=>Promise.resolve(0))();function Mc(t){"undefined"==typeof Zone?Lc.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Ic{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Wl(!1),this.onMicrotaskEmpty=new Wl(!1),this.onStable=new Wl(!1),this.onError=new Wl(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const n=this;n._nesting=0,n._outer=n._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(n._inner=n._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(n._inner=n._inner.fork(Zone.longStackTraceZoneSpec)),n.shouldCoalesceEventChangeDetection=e,n.lastRequestAnimationFrameId=-1,n.nativeRequestAnimationFrame=function(){let t=Dt.requestAnimationFrame,e=Dt.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=!!t.shouldCoalesceEventChangeDetection&&t.nativeRequestAnimationFrame&&(()=>{!function(t){-1===t.lastRequestAnimationFrameId&&(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Dt,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Pc(t),Oc(t)},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Pc(t))}(t)});t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0,maybeDelayChangeDetection:e},onInvokeTask:(n,i,r,s,o,a)=>{try{return Nc(t),n.invokeTask(r,s,o,a)}finally{e&&"eventTask"===s.type&&e(),Bc(t)}},onInvoke:(e,n,i,r,s,o,a)=>{try{return Nc(t),e.invoke(i,r,s,o,a)}finally{Bc(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Pc(t),Oc(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(n)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ic.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Ic.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,$c,Va,Va);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const $c={};function Oc(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Pc(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||t.shouldCoalesceEventChangeDetection&&-1!==t.lastRequestAnimationFrameId)}function Nc(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Bc(t){t._nesting--,Oc(t)}class Uc{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Wl,this.onMicrotaskEmpty=new Wl,this.onStable=new Wl,this.onError=new Wl}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Vc=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Mc(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(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()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Hc=(()=>{class t{constructor(){this._applications=new Map,Wc.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Wc.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class jc{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let zc,Wc=new jc,Gc=!0,qc=!1;function Kc(){return qc=!0,Gc}const Xc=new Yn("AllowMultipleToken");class Yc{constructor(t,e){this.name=t,this.token=e}}function Jc(t,e,n=[]){const i="Platform: "+e,r=new Yn(i);return(e=[])=>{let s=Qc();if(!s||s.injector.get(Xc,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:Ys,useValue:"platform"});!function(t){if(zc&&!zc.destroyed&&!zc.injector.get(Xc,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");zc=t.get(Zc);const e=t.get(yc,null);e&&e.forEach(t=>t())}(ho.create({providers:t,name:i}))}return function(t){const e=Qc();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}(r)}}function Qc(){return zc&&!zc.destroyed?zc:null}let Zc=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new Uc:("zone.js"===t?void 0:t)||new Ic({enableLongStackTrace:Kc(),shouldCoalesceEventChangeDetection:e}),n}(e?e.ngZone:void 0,e&&e.ngZoneEventCoalescing||!1),i=[{provide:Ic,useValue:n}];return n.run(()=>{const e=ho.create({providers:i,parent:this.injector,name:t.moduleType.name}),r=t.create(e),s=r.injector.get(ar,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{s.handleError(t)}});r.onDestroy(()=>{nh(this._modules,r),t.unsubscribe()})}),function(t,e,n){try{const i=n();return Bo(i)?i.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):i}catch(i){throw e.runOutsideAngular(()=>t.handleError(i)),i}}(s,n,()=>{const t=r.injector.get(fc);return t.runInitializers(),t.donePromise.then(()=>(Ta(r.injector.get(_c,Aa)||Aa),this._moduleDoBootstrap(r),r))})})}bootstrapModule(t,e=[]){const n=th({},e);return function(t,e,n){const i=new Bl(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(eh);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${nt(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)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function th(t,e){return Array.isArray(e)?e.reduce(th,t):Object.assign(Object.assign({},t),e)}let eh=(()=>{class t{constructor(t,e,n,i,r,s){this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=s,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new y(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),a=new y(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Ic.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=W(o,a.pipe(Z()))}bootstrap(t,e){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.");let n;n=t instanceof Na?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=n.isBoundToModule?void 0:this._injector.get(_l),r=n.create(ho.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Vc,null),a=o&&r.injector.get(Hc);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),nh(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),Kc()&&this._console.log("Angular is running in development mode. Call enableProdMode() to enable production mode."),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;nh(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(wc,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic),bi(xc),bi(ho),bi(ar),bi(Ua),bi(fc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function nh(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ih{}class rh{}const sh={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let oh=(()=>{class t{constructor(t,e){this._compiler=t,this._config=e||sh}load(t){return this.loadAndCompile(t)}loadAndCompile(t){let[e,i]=t.split("#");return void 0===i&&(i="default"),n("zn8P")(e).then(t=>t[i]).then(t=>ah(t,e,i)).then(t=>this._compiler.compileModuleAsync(t))}loadFactory(t){let[e,i]=t.split("#"),r="NgFactory";return void 0===i&&(i="default",r=""),n("zn8P")(this._config.factoryPathPrefix+e+this._config.factoryPathSuffix).then(t=>t[i+r]).then(t=>ah(t,e,i))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fc),bi(rh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function ah(t,e,n){if(!t)throw new Error(`Cannot find '${n}' in '${e}'`);return t}const lh=Jc(null,"core",[{provide:bc,useValue:"unknown"},{provide:Zc,deps:[ho]},{provide:Hc,deps:[]},{provide:xc,deps:[]}]),ch=[{provide:eh,useClass:eh,deps:[Ic,xc,ho,ar,Ua,fc]},{provide:Il,deps:[Ic],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:fc,useClass:fc,deps:[[new li,pc]]},{provide:Fc,useClass:Fc,deps:[]},mc,{provide:al,useFactory:function(){return gl},deps:[]},{provide:ll,useFactory:function(){return ml},deps:[]},{provide:_c,useFactory:function(t){return Ta(t=t||"undefined"!=typeof $localize&&$localize.locale||Aa),t},deps:[[new ai(_c),new li,new hi]]},{provide:Cc,useValue:"USD"}];let hh=(()=>{class t{constructor(t){}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(eh))},providers:ch}),t})(),uh=null;function dh(){return uh}const ph=new Yn("DocumentToken");let fh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:gh,token:t,providedIn:"platform"}),t})();function gh(){return bi(vh)}const mh=new Yn("Location Initialized");let vh=(()=>{class t extends fh{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=dh().getLocation(),this._history=dh().getHistory()}getBaseHrefFromDOM(){return dh().getBaseHref(this._doc)}onPopState(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)}onHashChange(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){yh()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){yh()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:bh,token:t,providedIn:"platform"}),t})();function yh(){return!!window.history.pushState}function bh(){return new vh(bi(ph))}function wh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function xh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function _h(t){return t&&"?"!==t[0]?"?"+t:t}let Ch=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:Sh,token:t,providedIn:"root"}),t})();function Sh(t){const e=bi(ph).location;return new kh(bi(fh),e&&e.origin||"")}const Eh=new Yn("appBaseHref");let kh=(()=>{class t extends Ch{constructor(t,e){if(super(),this._platformLocation=t,null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)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.");this._baseHref=e}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return wh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+_h(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Ah=(()=>{class t extends Ch{constructor(t,e){super(),this._platformLocation=t,this._baseHref="",null!=e&&(this._baseHref=e)}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e}prepareExternalUrl(t){const e=wh(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Dh=(()=>{class t{constructor(t,e){this._subject=new Wl,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=xh(Rh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+_h(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,Rh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(bi(Ch),bi(fh))},t.normalizeQueryParams=_h,t.joinWithSlash=wh,t.stripTrailingSlash=xh,t.\u0275prov=lt({factory:Th,token:t,providedIn:"root"}),t})();function Th(){return new Dh(bi(Ch),bi(fh))}function Rh(t){return t.replace(/\/index.html$/,"")}var Fh=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}({});class Lh{}let Mh=(()=>{class t extends Lh{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=Ea(e);if(n)return n;const i=e.split("-")[0];if(n=Ea(i),n)return n;if("en"===i)return Ca;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[ka.PluralCase]}(e||this.locale)(t)){case Fh.Zero:return"zero";case Fh.One:return"one";case Fh.Two:return"two";case Fh.Few:return"few";case Fh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(bi(_c))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Ih(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let $h=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(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&&(xo(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+nt(t.item));this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(al),Ro(ll),Ro(za),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Oh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ph=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(e){throw new Error(`Cannot find a differ supporting object '${n}' of type '${t=n,t.name||typeof t}'. NgFor only supports binding to Iterables such as Arrays.`)}}var t;if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new Oh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new Nh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new Nh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(al))},t.\u0275dir=Wt({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Nh{constructor(t,e){this.record=t,this.view=e}}let Bh=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Uh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){Vh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Vh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Uh{constructor(){this.$implicit=null,this.ngIf=null}}function Vh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${nt(e)}'.`)}class Hh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let jh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Hh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(jh,1))},t.\u0275dir=Wt({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Wh=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(ll),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),Gh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(this._shouldRecreateView(t)){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(t){const e=t.ngTemplateOutletContext;return!!t.ngTemplateOutlet||e&&this._hasContextShapeChanged(e)}_hasContextShapeChanged(t){const e=Object.keys(t.previousValue||{}),n=Object.keys(t.currentValue||{});if(e.length===n.length){for(let t of n)if(-1===e.indexOf(t))return!0;return!1}return!0}_updateExistingContext(t){for(let e of Object.keys(t))this._viewRef.context[e]=this.ngTemplateOutletContext[e]}}return t.\u0275fac=function(e){return new(e||t)(Ro(El))},t.\u0275dir=Wt({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[le]}),t})(),qh=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:Lh,useClass:Mh}]}),t})(),Kh=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new Xh(bi(ph),window,bi(ar))}),t})();class Xh{constructor(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(this.supportsScrolling()){const e=this.document.getElementById(t)||this.document.getElementsByName(t)[0];e&&this.scrollToElement(e)}}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,i=e.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],i-r[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=Yh(this.window.history)||Yh(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch(t){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(t){return!1}}}function Yh(t){return Object.getOwnPropertyDescriptor(t,"scrollRestoration")}class Jh extends class extends class{}{constructor(){super()}supportsDOMEvents(){return!0}}{static makeCurrent(){var t;t=new Jh,uh||(uh=t)}getProperty(t,e){return t[e]}log(t){window.console&&window.console.log&&window.console.log(t)}logGroup(t){window.console&&window.console.group&&window.console.group(t)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){return t.parentNode&&t.parentNode.removeChild(t),t}getValue(t){return t.value}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(t){const e=Zh||(Zh=document.querySelector("base"),Zh)?Zh.getAttribute("href"):null;return null==e?null:(n=e,Qh||(Qh=document.createElement("a")),Qh.setAttribute("href",n),"/"===Qh.pathname.charAt(0)?Qh.pathname:"/"+Qh.pathname);var n}resetBaseElement(){Zh=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(t){return Ih(document.cookie,t)}}let Qh,Zh=null;const tu=new Yn("TRANSITION_ID"),eu=[{provide:pc,useFactory:function(t,e,n){return()=>{n.get(fc).donePromise.then(()=>{const n=dh();Array.prototype.slice.apply(e.querySelectorAll("style[ng-transition]")).filter(e=>e.getAttribute("ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[tu,ph,ho],multi:!0}];class nu{static init(){var t;t=new nu,Wc=t}addToWindow(t){Dt.getAngularTestability=(e,n=!0)=>{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Dt.getAllAngularTestabilities=()=>t.getAllTestabilities(),Dt.getAllAngularRootElements=()=>t.getAllRootElements(),Dt.frameworkStabilizers||(Dt.frameworkStabilizers=[]),Dt.frameworkStabilizers.push(t=>{const e=Dt.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?dh().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}const iu=new Yn("EventManagerPlugins");let ru=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),au=(()=>{class t extends ou{constructor(t){super(),this._doc=t,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(t.head)}_addStylesToHost(t,e){t.forEach(t=>{const n=this._doc.createElement("style");n.textContent=t,this._styleNodes.add(e.appendChild(n))})}addHost(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)}removeHost(t){this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach(e=>this._addStylesToHost(t,e))}ngOnDestroy(){this._styleNodes.forEach(t=>dh().remove(t))}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},cu=/%COMP%/g;function hu(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let du=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new pu(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case Ct.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new fu(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case Ct.ShadowDom:return new gu(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=hu(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(bi(ru),bi(au),bi(gc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class pu{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(lu[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=lu[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=lu[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(dr.DashCase|dr.Important)?t.style.setProperty(e,n,i&dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,uu(n)):this.eventManager.addEventListener(t,e,uu(n))}}class fu extends pu{constructor(t,e,n,i){super(t),this.component=n;const r=hu(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(cu,i+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(cu,i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class gu extends pu{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=hu(i.id,i.styles,[]);for(let s=0;s{class t extends su{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const vu=["alt","control","meta","shift"],yu={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},bu={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},wu={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let xu=(()=>{class t extends su{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dh().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(vu.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&bu.hasOwnProperty(e)&&(e=bu[e]))}return yu[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),vu.forEach(i=>{i!=n&&(0,wu[i])(t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),_u=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return bi(Cu)},token:t,providedIn:"root"}),t})(),Cu=(()=>{class t extends _u{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case tr.NONE:return e;case tr.HTML:return Ti(e,"HTML")?Di(e):Qi(this._doc,String(e));case tr.STYLE:return Ti(e,"Style")?Di(e):e;case tr.SCRIPT:if(Ti(e,"Script"))return Di(e);throw new Error("unsafe value used in a script context");case tr.URL:return Ri(e),Ti(e,"URL")?Di(e):$i(String(e));case tr.RESOURCE_URL:if(Ti(e,"ResourceURL"))return Di(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return new Ci(t)}bypassSecurityTrustStyle(t){return new Si(t)}bypassSecurityTrustScript(t){return new Ei(t)}bypassSecurityTrustUrl(t){return new ki(t)}bypassSecurityTrustResourceUrl(t){return new Ai(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return t=bi(Ks),new Cu(t.get(ph));var t},token:t,providedIn:"root"}),t})();const Su=Jc(lh,"browser",[{provide:bc,useValue:"browser"},{provide:yc,useValue:function(){Jh.makeCurrent(),nu.init()},multi:!0},{provide:ph,useFactory:function(){return function(t){fe=t}(document),document},deps:[]}]),Eu=[[],{provide:Ys,useValue:"root"},{provide:ar,useFactory:function(){return new ar},deps:[]},{provide:iu,useClass:mu,multi:!0,deps:[ph,Ic,bc]},{provide:iu,useClass:xu,multi:!0,deps:[ph]},[],{provide:du,useClass:du,deps:[ru,au,gc]},{provide:Wa,useExisting:du},{provide:ou,useExisting:au},{provide:au,useClass:au,deps:[ph]},{provide:Vc,useClass:Vc,deps:[Ic]},{provide:ru,useClass:ru,deps:[iu,Ic]},[]];let ku=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:gc,useValue:e.appId},{provide:tu,useExisting:gc},eu]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:Eu,imports:[qh,hh]}),t})();"undefined"!=typeof window&&window;class Au{}const Du="*";function Tu(t,e){return{type:7,name:t,definitions:e,options:{}}}function Ru(t,e=null){return{type:4,styles:e,timings:t}}function Fu(t,e=null){return{type:2,steps:t,options:e}}function Lu(t){return{type:6,styles:t,offset:null}}function Mu(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function Iu(t){Promise.resolve(null).then(t)}class $u{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Iu(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Ou{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Iu(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Pu(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Nu(t){switch(t.length){case 0:return new $u;case 1:return t[0];default:return new Ou(t)}}function Bu(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,h=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Du:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}h[i]=a}),i||a.push(h),c=h,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function Uu(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&Vu(n,"start",t)));break;case"done":t.onDone(()=>i(n&&Vu(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&Vu(n,"destroy",t)))}}function Vu(t,e,n){const i=n.totalTime,r=Hu(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function Hu(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function ju(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function zu(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let Wu=(t,e)=>!1,Gu=(t,e)=>!1,qu=(t,e,n)=>[];const Ku=Pu();(Ku||"undefined"!=typeof Element)&&(Wu=(t,e)=>t.contains(e),Gu=(()=>{if(Ku||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):Gu}})(),qu=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let nd=(()=>{class t{validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new $u(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),id=(()=>{class t{}return t.NOOP=new nd,t})();const rd="ng-enter",sd="ng-leave",od="ng-trigger",ad=".ng-trigger",ld="ng-animating",cd=".ng-animating";function hd(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:ud(parseFloat(e[1]),e[2])}function ud(t,e){switch(e){case"s":return 1e3*t;default:return t}}function dd(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=ud(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=ud(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function pd(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function fd(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else pd(t,n);return n}function gd(t,e,n){return n?e+":"+n+";":""}function md(t){let e="";for(let n=0;n{const r=Ed(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Pu()&&md(t))}function yd(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=Ed(e);t.style[n]=""}),Pu()&&md(t))}function bd(t){return Array.isArray(t)?1==t.length?t[0]:Fu(t):t}const wd=new RegExp("{{\\s*(.+?)\\s*}}","g");function xd(t){let e=[];if("string"==typeof t){let n;for(;n=wd.exec(t);)e.push(n[1]);wd.lastIndex=0}return e}function _d(t,e,n){const i=t.toString(),r=i.replace(wd,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push("Please provide a value for the animation param "+i),r=""),r.toString()});return r==i?t:r}function Cd(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Sd=/-+([a-z0-9])/g;function Ed(t){return t.replace(Sd,(...t)=>t[1].toUpperCase())}function kd(t,e){return 0===t||0===e}function Ad(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Id(r,o)),"<"!=s[0]||r==Rd&&o==Rd||e.push(Id(o,r))}(t,n,e)):n.push(t),n}const Ld=new Set(["true","1"]),Md=new Set(["false","0"]);function Id(t,e){const n=Ld.has(t)||Md.has(t),i=Ld.has(e)||Md.has(e);return(r,s)=>{let o=t==Rd||t==r,a=e==Rd||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Ld.has(t):Md.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Ld.has(e):Md.has(e)),o&&a}}const $d=new RegExp("s*:selfs*,?","g");function Od(t,e,n){return new Pd(t).build(e,n)}class Pd{constructor(t){this._driver=t}build(t,e){const n=new Nd(e);return this._resetContextStyleTimingState(n),Dd(this,bd(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(Bd(t)){const e=t;Object.keys(e).forEach(t=>{xd(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Cd(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Dd(this,bd(t.animation),e);return{type:1,matchers:Fd(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Ud(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Dd(this,t,e)),options:Ud(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Dd(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:Ud(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return Vd(dd(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=Vd(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||dd(i,e),Vd(n.duration,n.delay,n.easing)}(t.timings,e.errors);let i;e.currentAnimateTimings=n;let r=t.styles?t.styles:Lu({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Lu(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Du?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(Bd(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=xd(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=h>0?i==u?1:h*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Dd(this,bd(t.animation),e),options:Ud(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:Ud(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:Ud(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace($d,"")),[t=t.replace(/@\*/g,ad).replace(/@\w+/g,t=>".ng-trigger-"+t.substr(1)).replace(/:animating/g,cd),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,ju(e.collectedStyles,e.currentQuerySelector,{});const o=Dd(this,bd(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:Ud(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:dd(t.timings,e.errors,!0);return{type:12,animation:Dd(this,bd(t.animation),e),timings:n,options:null}}}class Nd{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function Bd(t){return!Array.isArray(t)&&"object"==typeof t}function Ud(t){var e;return t?(t=pd(t)).params&&(t.params=(e=t.params)?pd(e):null):t={},t}function Vd(t,e,n){return{duration:t,delay:e,easing:n}}function Hd(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class jd{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const zd=new RegExp(":enter","g"),Wd=new RegExp(":leave","g");function Gd(t,e,n,i,r,s={},o={},a,l,c=[]){return(new qd).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class qd{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new jd;const h=new Xd(t,e,l,i,r,c,[]);h.options=a,h.currentTimeline.setStyles([s],null,h.errors,a),Dd(this,n,h);const u=h.timelines.filter(t=>t.containsAnimation());if(u.length&&Object.keys(o).length){const t=u[u.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,h.errors,a)}return u.length?u.map(t=>t.buildKeyframes()):[Hd(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?hd(n.duration):null,s=null!=n.delay?hd(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Dd(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Kd);const t=hd(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Dd(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?hd(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Dd(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return dd(e.params?_d(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?hd(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Kd);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Dd(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Dd(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const Kd={};class Xd{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Kd,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Yd(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=hd(n.duration)),null!=n.delay&&(i.delay=hd(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{e&&t.hasOwnProperty(n)||(t[n]=_d(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new Xd(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=Kd,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new Jd(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(zd,"."+this._enterClassName)).replace(Wd,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return r||0!=o.length||s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class Yd{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new Yd(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Du,this._currentKeyframe[t]=Du}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Du})):fd(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=_d(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Du),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=fd(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Du&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Cd(t.values()):[],s=e.size?Cd(e.values()):[];if(n){const t=i[0],e=pd(t);t.offset=0,e.offset=1,i=[t,e]}return Hd(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Jd extends Yd{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.element=e,this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=fd(t[0],!1);a.offset=0,r.push(a);const l=fd(t[0],!1);l.offset=Qd(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=fd(t[i],!1);o.offset=Qd((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return Hd(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function Qd(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class Zd{}class tp extends Zd{normalizePropertyName(t,e){return Ed(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(ep[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const ep=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function np(t,e,n,i,r,s,o,a,l,c,h,u,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:d}}const ip={};class rp{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const h=[],u=this.ast.options&&this.ast.options.params||ip,d=this.buildStyles(n,o&&o.params||ip,h),p=a&&a.params||ip,f=this.buildStyles(i,p,h),g=new Set,m=new Map,v=new Map,y="void"===i,b={params:Object.assign(Object.assign({},u),p)},w=c?[]:Gd(t,e,this.ast.animation,r,s,d,f,b,l,h);let x=0;if(w.forEach(t=>{x=Math.max(t.duration+t.delay,x)}),h.length)return np(e,this._triggerName,n,i,y,d,f,[],[],m,v,x,h);w.forEach(t=>{const n=t.element,i=ju(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=ju(v,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const _=Cd(g.values());return np(e,this._triggerName,n,i,y,d,f,w,_,m,v,x)}}class sp{constructor(t,e){this.styles=t,this.defaultParams=e}buildStyles(t,e){const n={},i=pd(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=_d(s,i,e)),n[t]=s})}}),n}}class op{constructor(t,e){this.name=t,this.ast=e,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new sp(t.style,t.options&&t.options.params||{})}),ap(this.states,"true","1"),ap(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new rp(t,e,this.states))}),this.fallbackTransition=new rp(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function ap(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const lp=new jd;class cp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Od(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=Bu(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=Gd(this._driver,e,r,rd,sd,{},{},n,lp,i),s.forEach(t=>{const e=ju(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error("Unable to create the animation due to the following errors: "+i.join("\n"));o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Du)})});const a=Nu(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e}listen(t,e,n,i){const r=Hu(e,"","","");return Uu(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const hp="ng-animate-queued",up="ng-animate-disabled",dp=".ng-animate-disabled",pp=[],fp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},gp={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class mp{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=null!=(i=n?t.value:t)?i:null,n){const e=pd(t);delete e.value,this.options=e}else this.options={};var i;this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const vp="void",yp=new mp(vp);class bp{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,kp(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if("start"!=(r=n)&&"done"!=r)throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);var r;const s=ju(this._elementListeners,t,[]),o={name:e,phase:n,callback:i};s.push(o);const a=ju(this._engine.statesByElement,t,{});return a.hasOwnProperty(e)||(kp(t,od),kp(t,"ng-trigger-"+e),a[e]=yp),()=>{this._engine.afterFlush(()=>{const t=s.indexOf(o);t>=0&&s.splice(t,1),this._triggers[e]||delete a[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new xp(this.id,e,t);let o=this._engine.statesByElement.get(t);o||(kp(t,od),kp(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new mp(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=yp),l.value!==vp&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{yd(t,n),vd(t,i)})}return}const c=ju(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let h=r.matchTransition(a.value,l.value,t,l.params),u=!1;if(!h){if(!i)return;h=r.fallbackTransition,u=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:a,toState:l,player:s,isFallbackTransition:u}),u||(kp(t,hp),s.onStart(()=>{Ap(t,hp)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,ad,!0);n.forEach(t=>{if(t.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,vp,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&Nu(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t);if(e){const n=new Set;e.forEach(e=>{const i=e.name;if(n.has(i))return;n.add(i);const r=this._triggers[i].fallbackTransition,s=this._engine.statesByElement.get(t)[i]||yp,o=new mp(vp),a=new xp(this.id,i,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:i,transition:r,fromState:s,toState:o,player:a,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t.__ng_removed;i&&i!==fp||(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){kp(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=Hu(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,Uu(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class wp{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new bp(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),kp(t,up)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Ap(t,up))}removeNode(t,e,n,i){if(_p(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e.__ng_removed={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return _p(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,ad,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,cd,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Nu(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t.__ng_removed;if(e&&e.setForRemoval){if(t.__ng_removed=fp,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,dp)&&this.markElementAsDisabled(t,!1),this.driver.query(t,dp,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?Nu(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))}_flushAnimations(t,e){const n=new jd,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=rd+f++;p.set(e,n),t.forEach(t=>kp(t,n))});const g=[],m=new Set,v=new Set;for(let R=0;Rm.add(t)):v.add(t))}const y=new Map,b=Ep(u,Array.from(m));b.forEach((t,e)=>{const n=sd+f++;y.set(e,n),t.forEach(t=>kp(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Ap(t,n))}),b.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Ap(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const w=[],x=[];for(let R=this._namespaceList.length-1;R>=0;R--)this._namespaceList[R].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(w.push(e),this.collectedEnterElements.length){const t=r.__ng_removed;if(t&&t.setForMove)return void e.destroy()}const c=!h||!this.driver.containsElement(h,r),u=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,u,c);if(f.errors&&f.errors.length)x.push(f);else{if(c)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>ju(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(x.length){const t=[];x.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),w.forEach(t=>t.destroy()),this.reportError(t)}const _=new Map,C=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(C.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,_))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{ju(_,e,[]).push(t),t.destroy()})});const S=g.filter(t=>Rp(t,a,l)),E=new Map;Sp(E,this.driver,v,l,Du).forEach(t=>{Rp(t,a,l)&&S.push(t)});const k=new Map;d.forEach((t,e)=>{Sp(k,this.driver,new Set(t),a,"!")}),S.forEach(t=>{const e=E.get(t),n=k.get(t);E.set(t,Object.assign(Object.assign({},e),n))});const A=[],D=[],T={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>vd(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=T;if(C.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=C.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>C.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,_,r,k,E);if(s.setRealPlayer(n),t===T)A.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=Nu(e)),i.push(s)}}else yd(e,o.fromStyles),s.onDestroy(()=>vd(e,o.toStyles)),D.push(s),c.has(e)&&i.push(s)}),D.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=Nu(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let R=0;R!t.destroyed);i.length?Dp(this,t,i):this.processLeaveNode(t)}return g.length=0,A.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),A}elementContainsData(t,e){let n=!1;const i=e.__ng_removed;return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==vp;e.forEach(e=>{e.queued||(t||e.triggerName==i)&&s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=ju(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}yd(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,h=new Set,u=e.timelines.map(e=>{const u=e.element;c.add(u);const d=u.__ng_removed;if(d&&d.removedBeforeQueried)return new $u(e.duration,e.delay);const p=u!==a,f=function(t){const e=[];return Tp(t,e),e}((n.get(u)||pp).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===u),g=r.get(u),m=s.get(u),v=Bu(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,v,f);if(e.subTimeline&&i&&h.add(u),p){const e=new xp(t,o,u);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{ju(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>kp(t,ld));const d=Nu(u);return d.onDestroy(()=>{c.forEach(t=>Ap(t,ld)),vd(a,e.toStyles)}),h.forEach(t=>{ju(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new $u(t.duration,t.delay)}}class xp{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new $u,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>Uu(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){ju(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function _p(t){return t&&1===t.nodeType}function Cp(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function Sp(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Cp(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);n&&0!=n.length||(i.__ng_removed=gp,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Cp(t,s[a++])),o}function Ep(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}function kp(t,e){if(t.classList)t.classList.add(e);else{let n=t.$$classes;n||(n=t.$$classes={}),n[e]=!0}}function Ap(t,e){if(t.classList)t.classList.remove(e);else{let n=t.$$classes;n&&delete n[e]}}function Dp(t,e,n){Nu(n).onDone(()=>t.processLeaveNode(e))}function Tp(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Fp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new wp(t,e,n),this._timelineEngine=new cp(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Od(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e){return new op(t,e)}(i,e),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=zu(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=zu(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Lp(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Ip(e[0]),e.length>1&&(i=Ip(e[e.length-1]))):e&&(n=Ip(e)),n||i?new Mp(t,n,i):null}let Mp=(()=>{class t{constructor(e,n,i){this._element=e,this._startStyles=n,this._endStyles=i,this._state=0;let r=t.initialStylesByElement.get(e);r||t.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vd(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vd(this._element,this._initialStyles),this._endStyles&&(vd(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(yd(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(yd(this._element,this._endStyles),this._endStyles=null),vd(this._element,this._initialStyles),this._state=3)}}return t.initialStylesByElement=new WeakMap,t})();function Ip(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){!function(t,e){const n=zp(t,"").trim();n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Hp(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=zp(t,"").split(","),i=Vp(n,e);i>=0&&(n.splice(i,1),jp(t,"",n.join(",")))}(this._element,this._name))}}function Bp(t,e,n){jp(t,"PlayState",n,Up(t,e))}function Up(t,e){const n=zp(t,"");return n.indexOf(",")>0?Vp(n.split(","),e):Vp([n],e)}function Vp(t,e){for(let n=0;n=0)return n;return-1}function Hp(t,e,n){n?t.removeEventListener(Pp,e):t.addEventListener(Pp,e)}function jp(t,e,n,i){const r=Op+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function zp(t,e){return t.style[Op+e]||""}class Wp{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Np(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Td(this.element,n))})}this.currentSnapshot=t}}class Gp extends $u{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=ed(e)}init(){!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){this._startingStyles&&(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class qp{constructor(){this._count=0,this._head=document.querySelector("head")}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>ed(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=r+"}\n"}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof Wp),l={};kd(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"!=n&&"easing"!=n&&(e[n]=t[n])})}),e}(e=Ad(t,e,l));if(0==n)return new Gp(t,c);const h="gen_css_kf_"+this._count++,u=this.buildKeyframeElement(t,h,e);document.querySelector("head").appendChild(u);const d=Lp(t,e),p=new Wp(t,e,h,n,i,r,c,d);return p.onDestroy(()=>{var t;(t=u).parentNode.removeChild(t)}),p}}class Kp{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Td(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Xp{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Yp().toString()),this._cssKeyframesDriver=new qp}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof Kp);kd(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const h=Lp(t,e=Ad(t,e=e.map(t=>fd(t,!1)),l));return new Kp(t,e,a,h)}}function Yp(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}let Jp=(()=>{class t extends Au{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:Ct.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Fu(t):t;return tf(this._renderer,null,e,"register",[n]),new Qp(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Qp extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new Zp(this._id,t,e||{},this._renderer)}}class Zp{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return tf(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset")}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function tf(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const ef="@",nf="@.disabled";let rf=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new sf("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new of(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(Fp),bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class sf{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==ef&&e==nf?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class of extends sf{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==ef?"."==e.charAt(1)&&e==nf?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if(e.charAt(0)==ef){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return r.charAt(0)!=ef&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let af=(()=>{class t extends Fp{constructor(t,e,n){super(t.body,e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(id),bi(Zd))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lf=new Yn("AnimationModuleType"),cf=[{provide:Au,useClass:Jp},{provide:Zd,useFactory:function(){return new tp}},{provide:Fp,useClass:af},{provide:Wa,useFactory:function(t,e,n){return new rf(t,e,n)},deps:[du,Fp,Ic]}],hf=[{provide:id,useFactory:function(){return"function"==typeof Yp()?new Xp:new qp}},{provide:lf,useValue:"BrowserAnimations"},...cf],uf=[{provide:id,useClass:nd},{provide:lf,useValue:"NoopAnimations"},...cf];let df=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:hf,imports:[ku]}),t})(),pf=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:uf,imports:[ku]}),t})();function ff(...t){let e=t[t.length-1];return E(e)?(t.pop(),$(t,e)):z(t)}class gf extends C{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new w;return this._value}next(t){super.next(this._value=t)}}class mf extends f{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class vf extends f{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function yf(t,e,n,i,r=new vf(t,n,i)){if(!r.closed)return e instanceof y?e.subscribe(r):I(e)(r)}const bf={};class wf{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new xf(t,this.resultSelector))}}class xf extends mf{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(bf),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t})(),Cf=new y(t=>t.complete());function Sf(t){return t?function(t){return new y(e=>t.schedule(()=>e.complete()))}(t):Cf}function Ef(t){return new y(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?O(n):Sf()).subscribe(e)})}function kf(){return j(1)}function Af(t,e){return function(n){return n.lift(new Df(t,e))}}class Df{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Tf(t,this.predicate,this.thisArg))}}class Tf extends f{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}const Rf=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Ff(t){return function(e){return 0===t?Sf():e.lift(new Lf(t))}}class Lf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Mf(t,this.total))}}class Mf extends f{constructor(t,e){super(t),this.total=e,this.ring=new Array,this.count=0}_next(t){const e=this.ring,n=this.total,i=this.count++;e.length0){const n=this.count>=this.total?this.total:this.count,i=this.ring;for(let r=0;re.lift(new $f(t))}class $f{constructor(t){this.errorFactory=t}call(t,e){return e.subscribe(new Of(t,this.errorFactory))}}class Of extends f{constructor(t,e){super(t),this.errorFactory=e,this.hasValue=!1}_next(t){this.hasValue=!0,this.destination.next(t)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function Pf(){return new _f}function Nf(t=null){return e=>e.lift(new Bf(t))}class Bf{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new Uf(t,this.defaultValue))}}class Uf extends f{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Vf(t,e){return"function"==typeof e?n=>n.pipe(Vf((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))))):e=>e.lift(new Hf(t))}class Hf{constructor(t){this.project=t}call(t,e){return e.subscribe(new jf(t,this.project))}}class jf extends N{constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new P(this),i=this.destination;i.add(n),this.innerSubscription=B(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;t&&!t.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}function zf(t){return e=>0===t?Sf():e.lift(new Wf(t))}class Wf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Gf(t,this.total))}}class Gf extends f{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function qf(...t){return kf()(ff(...t))}class Kf{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new Xf(t,this.accumulator,this.seed,this.hasSeed))}}class Xf extends f{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}function Yf(t){return function(e){const n=new Jf(t),i=e.lift(n);return n.caught=i}}class Jf{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Qf(t,this.selector,this.caught))}}class Qf extends N{constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new P(this);this.add(i);const r=B(n,i);r!==i&&this.add(r)}}}function Zf(t,e){return U(t,e,1)}function tg(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,zf(1),n?Nf(e):If(()=>new _f))}function eg(){}function ng(t,e,n){return function(i){return i.lift(new ig(t,e,n))}}class ig{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new rg(t,this.nextOrObserver,this.error,this.complete))}}class rg extends f{constructor(t,e,n,r){super(t),this._tapNext=eg,this._tapError=eg,this._tapComplete=eg,this._tapError=n||eg,this._tapComplete=r||eg,i(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||eg,this._tapError=e.error||eg,this._tapComplete=e.complete||eg)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}class sg{constructor(t){this.callback=t}call(t,e){return e.subscribe(new og(t,this.callback))}}class og extends f{constructor(t,e){super(t),this.add(new u(e))}}class ag{constructor(t,e){this.id=t,this.url=e}}class lg extends ag{constructor(t,e,n="imperative",i=null){super(t,e),this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class cg extends ag{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class hg extends ag{constructor(t,e,n){super(t,e),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class ug extends ag{constructor(t,e,n){super(t,e),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class dg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fg extends ag{constructor(t,e,n,i,r){super(t,e),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class gg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class mg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class vg{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class yg{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class bg{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class wg{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class xg{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class _g{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Cg{constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Sg="primary";class Eg{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function kg(t){return new Eg(t)}function Ag(t){const e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function Dg(t,e,n){const i=n.path.split("/");if(i.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||i.lengthi[e]===t)}return t===e}function Fg(t){return Array.prototype.concat.apply([],t)}function Lg(t){return t.length>0?t[t.length-1]:null}function Mg(t,e){for(const n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Ig(t){return Uo(t)?t:Bo(t)?O(Promise.resolve(t)):ff(t)}function $g(t,e,n){return n?function(t,e){return Tg(t,e)}(t.queryParams,e.queryParams)&&Og(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>Rg(t[n],e[n]))}(t.queryParams,e.queryParams)&&Pg(t.root,e.root)}function Og(t,e){if(!Hg(t.segments,e.segments))return!1;if(t.numberOfChildren!==e.numberOfChildren)return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Og(t.children[n],e.children[n]))return!1}return!0}function Pg(t,e){return Ng(t,e,e.segments)}function Ng(t,e,n){if(t.segments.length>n.length)return!!Hg(t.segments.slice(0,n.length),n)&&!e.hasChildren();if(t.segments.length===n.length){if(!Hg(t.segments,n))return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Pg(t.children[n],e.children[n]))return!1}return!0}{const i=n.slice(0,t.segments.length),r=n.slice(t.segments.length);return!!Hg(t.segments,i)&&!!t.children.primary&&Ng(t.children.primary,e,r)}}class Bg{constructor(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return Gg.serialize(this)}}class Ug{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Mg(e,(t,e)=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return qg(this)}}class Vg{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=kg(this.parameters)),this._parameterMap}toString(){return tm(this)}}function Hg(t,e){return t.length===e.length&&t.every((t,n)=>t.path===e[n].path)}function jg(t,e){let n=[];return Mg(t.children,(t,i)=>{i===Sg&&(n=n.concat(e(t,i)))}),Mg(t.children,(t,i)=>{i!==Sg&&(n=n.concat(e(t,i)))}),n}class zg{}class Wg{parse(t){const e=new sm(t);return new Bg(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){return`${"/"+Kg(t.root,!0)}${function(t){const e=Object.keys(t).map(e=>{const n=t[e];return Array.isArray(n)?n.map(t=>`${Yg(e)}=${Yg(t)}`).join("&"):`${Yg(e)}=${Yg(n)}`});return e.length?"?"+e.join("&"):""}(t.queryParams)}${"string"==typeof t.fragment?"#"+encodeURI(t.fragment):""}`}}const Gg=new Wg;function qg(t){return t.segments.map(t=>tm(t)).join("/")}function Kg(t,e){if(!t.hasChildren())return qg(t);if(e){const e=t.children.primary?Kg(t.children.primary,!1):"",n=[];return Mg(t.children,(t,e)=>{e!==Sg&&n.push(`${e}:${Kg(t,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}{const e=jg(t,(e,n)=>n===Sg?[Kg(t.children.primary,!1)]:[`${n}:${Kg(e,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children.primary?`${qg(t)}/${e[0]}`:`${qg(t)}/(${e.join("//")})`}}function Xg(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Yg(t){return Xg(t).replace(/%3B/gi,";")}function Jg(t){return Xg(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Qg(t){return decodeURIComponent(t)}function Zg(t){return Qg(t.replace(/\+/g,"%20"))}function tm(t){return`${Jg(t.path)}${e=t.parameters,Object.keys(e).map(t=>`;${Jg(t)}=${Jg(e[t])}`).join("")}`;var e}const em=/^[^\/()?;=#]+/;function nm(t){const e=t.match(em);return e?e[0]:""}const im=/^[^=?&#]+/,rm=/^[^?&#]+/;class sm{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ug([],{}):new Ug([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n.primary=new Ug(t,e)),n}parseSegment(){const t=nm(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new Vg(Qg(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=nm(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=nm(this.remaining);t&&(n=t,this.capture(n))}t[Qg(e)]=Qg(n)}parseQueryParam(t){const e=function(t){const e=t.match(im);return e?e[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=function(t){const e=t.match(rm);return e?e[0]:""}(this.remaining);t&&(n=t,this.capture(n))}const i=Zg(e),r=Zg(n);if(t.hasOwnProperty(i)){let e=t[i];Array.isArray(e)||(e=[e],t[i]=e),e.push(r)}else t[i]=r}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=nm(this.remaining),i=this.remaining[n.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let r=void 0;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):t&&(r=Sg);const s=this.parseChildren();e[r]=1===Object.keys(s).length?s.primary:new Ug([],s),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class om{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=am(t,this._root);return e?e.children.map(t=>t.value):[]}firstChild(t){const e=am(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=lm(t,this._root);return e.length<2?[]:e[e.length-2].children.map(t=>t.value).filter(e=>e!==t)}pathFromRoot(t){return lm(t,this._root).map(t=>t.value)}}function am(t,e){if(t===e.value)return e;for(const n of e.children){const e=am(t,n);if(e)return e}return null}function lm(t,e){if(t===e.value)return[e];for(const n of e.children){const i=lm(t,n);if(i.length)return i.unshift(e),i}return[]}class cm{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function hm(t){const e={};return t&&t.children.forEach(t=>e[t.value.outlet]=t),e}class um extends om{constructor(t,e){super(t),this.snapshot=e,vm(this,t)}toString(){return this.snapshot.toString()}}function dm(t,e){const n=function(t,e){const n=new gm([],{},{},"",{},Sg,e,null,t.root,-1,{});return new mm("",new cm(n,[]))}(t,e),i=new gf([new Vg("",{})]),r=new gf({}),s=new gf({}),o=new gf({}),a=new gf(""),l=new pm(i,r,o,a,s,Sg,e,n.root);return l.snapshot=n.root,new um(new cm(l,[]),n)}class pm{constructor(t,e,n,i,r,s,o,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(k(t=>kg(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(k(t=>kg(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function fm(t,e="emptyOnly"){const n=t.pathFromRoot;let i=0;if("always"!==e)for(i=n.length-1;i>=1;){const t=n[i],e=n[i-1];if(t.routeConfig&&""===t.routeConfig.path)i--;else{if(e.component)break;i--}}return function(t){return t.reduce((t,e)=>({params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(i))}class gm{constructor(t,e,n,i,r,s,o,a,l,c,h){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this.routeConfig=a,this._urlSegment=l,this._lastPathIndex=c,this._resolve=h}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=kg(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(t=>t.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class mm extends om{constructor(t,e){super(e),this.url=t,vm(this,e)}toString(){return ym(this._root)}}function vm(t,e){e.value._routerState=t,e.children.forEach(e=>vm(t,e))}function ym(t){const e=t.children.length>0?` { ${t.children.map(ym).join(", ")} } `:"";return`${t.value}${e}`}function bm(t){if(t.snapshot){const e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Tg(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Tg(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(let n=0;nTg(t.parameters,i[e].parameters))&&!(!t.parent!=!e.parent)&&(!t.parent||wm(t.parent,e.parent))}function xm(t,e,n){if(n&&t.shouldReuseRoute(e.value,n.value.snapshot)){const i=n.value;i._futureSnapshot=e.value;const r=function(t,e,n){return e.children.map(e=>{for(const i of n.children)if(t.shouldReuseRoute(e.value,i.value.snapshot))return xm(t,e,i);return xm(t,e)})}(t,e,n);return new cm(i,r)}{const n=t.retrieve(e.value);if(n){const t=n.route;return _m(e,t),t}{const n=new pm(new gf((i=e.value).url),new gf(i.params),new gf(i.queryParams),new gf(i.fragment),new gf(i.data),i.outlet,i.component,i),r=e.children.map(e=>xm(t,e));return new cm(n,r)}}var i}function _m(t,e){if(t.value.routeConfig!==e.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==e.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");e.value._futureSnapshot=t.value;for(let n=0;n{s[e]=Array.isArray(t)?t.map(t=>""+t):""+t}),new Bg(n.root===t?e:km(n.root,t,e),s,r)}function km(t,e,n){const i={};return Mg(t.children,(t,r)=>{i[r]=t===e?n:km(t,e,n)}),new Ug(t.segments,i)}class Am{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Cm(n[0]))throw new Error("Root segment cannot have matrix parameters");const i=n.find(Sm);if(i&&i!==Lg(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Dm{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}function Tm(t,e,n){if(t||(t=new Ug([],{})),0===t.segments.length&&t.hasChildren())return Rm(t,e,n);const i=function(t,e,n){let i=0,r=e;const s={match:!1,pathIndex:0,commandIndex:0};for(;r=n.length)return s;const e=t.segments[r],o=n[i];if(Sm(o))break;const a=""+o,l=i0&&void 0===a)break;if(a&&l&&"object"==typeof l&&void 0===l.outlets){if(!Im(a,l,e))return s;i+=2}else{if(!Im(a,{},e))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(t,e,n),r=n.slice(i.commandIndex);if(i.match&&i.pathIndex{"string"==typeof n&&(n=[n]),null!==n&&(r[i]=Tm(t.children[i],e,n))}),Mg(t.children,(t,e)=>{void 0===i[e]&&(r[e]=t)}),new Ug(t.segments,r)}}function Fm(t,e,n){const i=t.segments.slice(0,e);let r=0;for(;r{"string"==typeof t&&(t=[t]),null!==t&&(e[n]=Fm(new Ug([],{}),0,t))}),e}function Mm(t){const e={};return Mg(t,(t,n)=>e[n]=""+t),e}function Im(t,e,n){return t==n.path&&Tg(e,n.parameters)}class $m{constructor(t,e,n,i){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=i}activate(t){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),bm(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{const e=t.value.outlet;this.deactivateRoutes(t,i[e],n),delete i[e]}),Mg(i,(t,e)=>{this.deactivateRouteAndItsChildren(t,n)})}deactivateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(i===r)if(i.component){const r=n.getContext(i.outlet);r&&this.deactivateChildRoutes(t,e,r.children)}else this.deactivateChildRoutes(t,e,n);else r&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const n=e.getContext(t.value.outlet);if(n&&n.outlet){const e=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:e,route:t,contexts:i})}}deactivateRouteAndOutlet(t,e){const n=e.getContext(t.value.outlet);if(n){const i=hm(t),r=t.value.component?n.children:e;Mg(i,(t,e)=>this.deactivateRouteAndItsChildren(t,r)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{this.activateRoutes(t,i[t.value.outlet],n),this.forwardEvent(new _g(t.value.snapshot))}),t.children.length&&this.forwardEvent(new wg(t.value.snapshot))}activateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(bm(i),i===r)if(i.component){const r=n.getOrCreateContext(i.outlet);this.activateChildRoutes(t,e,r.children)}else this.activateChildRoutes(t,e,n);else if(i.component){const e=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const t=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),e.children.onOutletReAttached(t.contexts),e.attachRef=t.componentRef,e.route=t.route.value,e.outlet&&e.outlet.attach(t.componentRef,t.route.value),Om(t.route)}else{const n=function(t){for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(i.snapshot),r=n?n.module.componentFactoryResolver:null;e.attachRef=null,e.route=i,e.resolver=r,e.outlet&&e.outlet.activateWith(i,r),this.activateChildRoutes(t,null,e.children)}}else this.activateChildRoutes(t,null,n)}}function Om(t){bm(t.value),t.children.forEach(Om)}class Pm{constructor(t,e){this.routes=t,this.module=e}}function Nm(t){return"function"==typeof t}function Bm(t){return t instanceof Bg}const Um=Symbol("INITIAL_VALUE");function Vm(){return Vf(t=>function(...t){let e=void 0,n=void 0;return E(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&l(t[0])&&(t=t[0]),z(t,n).lift(new wf(e))}(...t.map(t=>t.pipe(zf(1),function(...t){const e=t[t.length-1];return E(e)?(t.pop(),n=>qf(t,n,e)):e=>qf(t,e)}(Um)))).pipe(function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new Kf(t,e,n))}}((t,e)=>{let n=!1;return e.reduce((t,i,r)=>{if(t!==Um)return t;if(i===Um&&(n=!0),!n){if(!1===i)return i;if(r===e.length-1||Bm(i))return i}return t},t)},Um),Af(t=>t!==Um),k(t=>Bm(t)?t:!0===t),zf(1)))}let Hm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:function(){return[Ov]},encapsulation:2}),t})();function jm(t,e=""){for(let n=0;ne.error(new Km(t)))}function Jm(t){return new y(e=>e.error(new Xm(t)))}function Qm(t){return new y(e=>e.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Zm{constructor(t,e,n,i,r){this.configLoader=e,this.urlSerializer=n,this.urlTree=i,this.config=r,this.allowRedirects=!0,this.ngModule=t.get(_l)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Sg).pipe(k(t=>this.createUrlTree(t,this.urlTree.queryParams,this.urlTree.fragment))).pipe(Yf(t=>{if(t instanceof Xm)return this.allowRedirects=!1,this.match(t.urlTree);if(t instanceof Km)throw this.noMatchError(t);throw t}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,Sg).pipe(k(e=>this.createUrlTree(e,t.queryParams,t.fragment))).pipe(Yf(t=>{if(t instanceof Km)throw this.noMatchError(t);throw t}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,n){const i=t.segments.length>0?new Ug([],{[Sg]:t}):t;return new Bg(i,e,n)}expandSegmentGroup(t,e,n,i){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(k(t=>new Ug([],t))):this.expandSegment(t,n,e,n.segments,i,!0)}expandChildren(t,e,n){return function(t,e){if(0===Object.keys(t).length)return ff({});const n=[],i=[],r={};return Mg(t,(t,s)=>{const o=e(s,t).pipe(k(t=>r[s]=t));s===Sg?n.push(o):i.push(o)}),ff.apply(null,n.concat(i)).pipe(kf(),function(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,Ff(1),n?Nf(e):If(()=>new _f))}(),k(()=>r))}(n.children,(n,i)=>this.expandSegmentGroup(t,e,i,n))}expandSegment(t,e,n,i,r,s){const o=function(t){return t.reduce((t,e)=>{const n=qm(e);return t.has(n)?t.get(n).push(e):t.set(n,[e]),t},new Map)}(n);o.has(r)||o.set(r,[]);const a=n=>O(n).pipe(Zf(o=>this.expandSegmentAgainstRoute(t,e,n,o,i,r,s).pipe(Yf(t=>{if(t instanceof Km)return ff(null);throw t}))),tg(t=>null!==t),Yf(t=>{if(t instanceof _f||"EmptyError"===t.name){if(this.noLeftoversInUrl(e,i,r))return ff(new Ug([],{}));throw new Km(e)}throw t}));return O(Array.from(o.entries()).map(([t,e])=>{const n=a(e);return t===r?n:n.pipe(k(()=>null),Yf(()=>ff(null)))})).pipe(t=>t.lift(new wf(void 0)),tg(),k(t=>t.find(t=>null!==t)))}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}expandSegmentAgainstRoute(t,e,n,i,r,s,o){return qm(i)!==s&&""!==i.path?Ym(e):void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,e,i,r):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s):Ym(e)}expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,i,s):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,n,i){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Jm(r):this.lineralizeSegments(n,r).pipe(U(n=>{const r=new Ug(n,{});return this.expandSegment(t,r,e,n,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){const{matched:o,consumedSegments:a,lastChild:l,positionalParamSegments:c}=tv(e,i,r);if(!o)return Ym(e);const h=this.applyRedirectCommands(a,i.redirectTo,c);return i.redirectTo.startsWith("/")?Jm(h):this.lineralizeSegments(i,h).pipe(U(i=>this.expandSegment(t,e,n,i.concat(r.slice(l)),s,!1)))}matchSegmentAgainstRoute(t,e,n,i){if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(k(t=>(n._loadedConfig=t,new Ug(i,{})))):ff(new Ug(i,{}));const{matched:r,consumedSegments:s,lastChild:o}=tv(e,n,i);if(!r)return Ym(e);const a=i.slice(o);return this.getChildConfig(t,n,i).pipe(U(t=>{const n=t.module,i=t.routes,{segmentGroup:r,slicedSegments:o}=function(t,e,n,i){return n.length>0&&function(t,e,n){return n.some(n=>nv(t,e,n)&&qm(n)!==Sg)}(t,n,i)?{segmentGroup:ev(new Ug(e,function(t,e){const n={};n.primary=e;for(const i of t)""===i.path&&qm(i)!==Sg&&(n[qm(i)]=new Ug([],{}));return n}(i,new Ug(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some(n=>nv(t,e,n))}(t,n,i)?{segmentGroup:ev(new Ug(t.segments,function(t,e,n,i){const r={};for(const s of n)nv(t,e,s)&&!i[qm(s)]&&(r[qm(s)]=new Ug([],{}));return Object.assign(Object.assign({},i),r)}(t,n,i,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,s,a,i);return 0===o.length&&r.hasChildren()?this.expandChildren(n,i,r).pipe(k(t=>new Ug(s,t))):0===i.length&&0===o.length?ff(new Ug(s,{})):this.expandSegment(n,r,i,o,Sg,!0).pipe(k(t=>new Ug(s.concat(t.segments),t.children)))}))}getChildConfig(t,e,n){return e.children?ff(new Pm(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?ff(e._loadedConfig):this.runCanLoadGuards(t.injector,e,n).pipe(U(n=>n?this.configLoader.load(t.injector,e).pipe(k(t=>(e._loadedConfig=t,t))):function(t){return new y(e=>e.error(Ag(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):ff(new Pm([],t))}runCanLoadGuards(t,e,n){const i=e.canLoad;return i&&0!==i.length?ff(i.map(i=>{const r=t.get(i);let s;if(function(t){return t&&Nm(t.canLoad)}(r))s=r.canLoad(e,n);else{if(!Nm(r))throw new Error("Invalid CanLoad guard");s=r(e,n)}return Ig(s)})).pipe(Vm(),ng(t=>{if(!Bm(t))return;const e=Ag(`Redirecting to "${this.urlSerializer.serialize(t)}"`);throw e.url=t,e}),k(t=>!0===t)):ff(!0)}lineralizeSegments(t,e){let n=[],i=e.root;for(;;){if(n=n.concat(i.segments),0===i.numberOfChildren)return ff(n);if(i.numberOfChildren>1||!i.children.primary)return Qm(t.redirectTo);i=i.children.primary}}applyRedirectCommands(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)}applyRedirectCreatreUrlTree(t,e,n,i){const r=this.createSegmentGroup(t,e.root,n,i);return new Bg(r,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const n={};return Mg(t,(t,i)=>{if("string"==typeof t&&t.startsWith(":")){const r=t.substring(1);n[i]=e[r]}else n[i]=t}),n}createSegmentGroup(t,e,n,i){const r=this.createSegments(t,e.segments,n,i);let s={};return Mg(e.children,(e,r)=>{s[r]=this.createSegmentGroup(t,e,n,i)}),new Ug(r,s)}createSegments(t,e,n,i){return e.map(e=>e.path.startsWith(":")?this.findPosParam(t,e,i):this.findOrReturn(e,n))}findPosParam(t,e,n){const i=n[e.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return i}findOrReturn(t,e){let n=0;for(const i of e){if(i.path===t.path)return e.splice(n),i;n++}return t}}function tv(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:{}};const i=(e.matcher||Dg)(n,t,e);return i?{matched:!0,consumedSegments:i.consumed,lastChild:i.consumed.length,positionalParamSegments:i.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function ev(t){if(1===t.numberOfChildren&&t.children.primary){const e=t.children.primary;return new Ug(t.segments.concat(e.segments),e.children)}return t}function nv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}class iv{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class rv{constructor(t,e){this.component=t,this.route=e}}function sv(t,e,n){const i=t._root;return av(i,e?e._root:null,n,[i.value])}function ov(t,e,n){const i=function(t){if(!t)return null;for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(i?i.module.injector:n).get(t)}function av(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=hm(e);return t.children.forEach(t=>{!function(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=t.value,o=e?e.value:null,a=n?n.getContext(t.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){const l=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!Hg(t.url,e.url);case"pathParamsOrQueryParamsChange":return!Hg(t.url,e.url)||!Tg(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!wm(t,e)||!Tg(t.queryParams,e.queryParams);case"paramsChange":default:return!wm(t,e)}}(o,s,s.routeConfig.runGuardsAndResolvers);l?r.canActivateChecks.push(new iv(i)):(s.data=o.data,s._resolvedData=o._resolvedData),av(t,e,s.component?a?a.children:null:n,i,r),l&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new rv(a.outlet.component,o))}else o&&lv(e,a,r),r.canActivateChecks.push(new iv(i)),av(t,null,s.component?a?a.children:null:n,i,r)}(t,s[t.value.outlet],n,i.concat([t.value]),r),delete s[t.value.outlet]}),Mg(s,(t,e)=>lv(t,n.getContext(e),r)),r}function lv(t,e,n){const i=hm(t),r=t.value;Mg(i,(t,i)=>{lv(t,r.component?e?e.children.getContext(i):null:e,n)}),n.canDeactivateChecks.push(new rv(r.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,r))}function cv(t,e){return null!==t&&e&&e(new xg(t)),ff(!0)}function hv(t,e){return null!==t&&e&&e(new bg(t)),ff(!0)}function uv(t,e,n){const i=e.routeConfig?e.routeConfig.canActivate:null;return i&&0!==i.length?ff(i.map(i=>Ef(()=>{const r=ov(i,e,n);let s;if(function(t){return t&&Nm(t.canActivate)}(r))s=Ig(r.canActivate(e,t));else{if(!Nm(r))throw new Error("Invalid CanActivate guard");s=Ig(r(e,t))}return s.pipe(tg())}))).pipe(Vm()):ff(!0)}function dv(t,e,n){const i=e[e.length-1],r=e.slice(0,e.length-1).reverse().map(t=>function(t){const e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)).filter(t=>null!==t).map(e=>Ef(()=>ff(e.guards.map(r=>{const s=ov(r,e.node,n);let o;if(function(t){return t&&Nm(t.canActivateChild)}(s))o=Ig(s.canActivateChild(i,t));else{if(!Nm(s))throw new Error("Invalid CanActivateChild guard");o=Ig(s(i,t))}return o.pipe(tg())})).pipe(Vm())));return ff(r).pipe(Vm())}class pv{}class fv{constructor(t,e,n,i,r,s){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=i,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=s}recognize(){try{const t=vv(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,Sg),n=new gm([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Sg,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new cm(n,e),r=new mm(this.url,i);return this.inheritParamsAndData(r._root),ff(r)}catch(t){return new y(e=>e.error(t))}}inheritParamsAndData(t){const e=t.value,n=fm(e,this.paramsInheritanceStrategy);e.params=Object.freeze(n.params),e.data=Object.freeze(n.data),t.children.forEach(t=>this.inheritParamsAndData(t))}processSegmentGroup(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)}processChildren(t,e){const n=jg(e,(e,n)=>this.processSegmentGroup(t,e,n));return function(t){const e={};t.forEach(t=>{const n=e[t.value.outlet];if(n){const e=n.url.map(t=>t.toString()).join("/"),i=t.value.url.map(t=>t.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${e}' and '${i}'.`)}e[t.value.outlet]=t.value})}(n),n.sort((t,e)=>t.value.outlet===Sg?-1:e.value.outlet===Sg?1:t.value.outlet.localeCompare(e.value.outlet)),n}processSegment(t,e,n,i){for(const s of t)try{return this.processSegmentAgainstRoute(s,e,n,i)}catch(r){if(!(r instanceof pv))throw r}if(this.noLeftoversInUrl(e,n,i))return[];throw new pv}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}processSegmentAgainstRoute(t,e,n,i){if(t.redirectTo)throw new pv;if((t.outlet||Sg)!==i)throw new pv;let r,s=[],o=[];if("**"===t.path){const s=n.length>0?Lg(n).parameters:{};r=new gm(n,s,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+n.length,wv(t))}else{const a=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new pv;return{consumedSegments:[],lastChild:0,parameters:{}}}const i=(e.matcher||Dg)(n,t,e);if(!i)throw new pv;const r={};Mg(i.posParams,(t,e)=>{r[e]=t.path});const s=i.consumed.length>0?Object.assign(Object.assign({},r),i.consumed[i.consumed.length-1].parameters):r;return{consumedSegments:i.consumed,lastChild:i.consumed.length,parameters:s}}(e,t,n);s=a.consumedSegments,o=n.slice(a.lastChild),r=new gm(s,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+s.length,wv(t))}const a=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),{segmentGroup:l,slicedSegments:c}=vv(e,s,o,a,this.relativeLinkResolution);if(0===c.length&&l.hasChildren()){const t=this.processChildren(a,l);return[new cm(r,t)]}if(0===a.length&&0===c.length)return[new cm(r,[])];const h=this.processSegment(a,l,c,Sg);return[new cm(r,h)]}}function gv(t){let e=t;for(;e._sourceSegment;)e=e._sourceSegment;return e}function mv(t){let e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,n+=e._segmentIndexShift?e._segmentIndexShift:0;return n-1}function vv(t,e,n,i,r){if(n.length>0&&function(t,e,n){return n.some(n=>yv(t,e,n)&&qm(n)!==Sg)}(t,n,i)){const r=new Ug(e,function(t,e,n,i){const r={};r.primary=i,i._sourceSegment=t,i._segmentIndexShift=e.length;for(const s of n)if(""===s.path&&qm(s)!==Sg){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift=e.length,r[qm(s)]=n}return r}(t,e,i,new Ug(n,t.children)));return r._sourceSegment=t,r._segmentIndexShift=e.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some(n=>yv(t,e,n))}(t,n,i)){const s=new Ug(t.segments,function(t,e,n,i,r,s){const o={};for(const a of i)if(yv(t,n,a)&&!r[qm(a)]){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift="legacy"===s?t.segments.length:e.length,o[qm(a)]=n}return Object.assign(Object.assign({},r),o)}(t,e,n,i,t.children,r));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}const s=new Ug(t.segments,t.children);return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}function yv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function bv(t){return t.data||{}}function wv(t){return t.resolve||{}}function xv(t){return function(e){return e.pipe(Vf(e=>{const n=t(e);return n?O(n).pipe(k(()=>e)):O([e])}))}}class _v extends class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}{}const Cv=new Yn("ROUTES");class Sv{constructor(t,e,n,i){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=i}load(t,e){return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(k(n=>{this.onLoadEndListener&&this.onLoadEndListener(e);const i=n.create(t);return new Pm(Fg(i.injector.get(Cv)).map(Gm),i)}))}loadModuleFactory(t){return"string"==typeof t?O(this.loader.load(t)):Ig(t()).pipe(U(t=>t instanceof Cl?ff(t):O(this.compiler.compileModuleAsync(t))))}}class Ev{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new kv,this.attachRef=null}}class kv{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new Ev,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}class Av{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function Dv(t){throw t}function Tv(t,e,n){return e.parse("/")}function Rv(t,e){return ff(null)}let Fv=(()=>{class t{constructor(t,e,n,i,r,s,o,a){this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=i,this.config=a,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new C,this.errorHandler=Dv,this.malformedUriErrorHandler=Tv,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Rv,afterPreactivation:Rv},this.urlHandlingStrategy=new Av,this.routeReuseStrategy=new _v,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.ngModule=r.get(_l),this.console=r.get(xc);const l=r.get(Ic);this.isNgZoneEnabled=l instanceof Ic,this.resetConfig(a),this.currentUrlTree=new Bg(new Ug([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Sv(s,o,t=>this.triggerEvent(new vg(t)),t=>this.triggerEvent(new yg(t))),this.routerState=dm(this.currentUrlTree,this.rootComponentType),this.transitions=new gf({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()}setupNavigations(t){const e=this.events;return t.pipe(Af(t=>0!==t.id),k(t=>Object.assign(Object.assign({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl)})),Vf(t=>{let n=!1,i=!1;return ff(t).pipe(ng(t=>{this.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Vf(t=>{const n=!this.navigated||t.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return ff(t).pipe(Vf(t=>{const n=this.transitions.getValue();return e.next(new lg(t.id,this.serializeUrl(t.extractedUrl),t.source,t.restoredState)),n!==this.transitions.getValue()?Cf:[t]}),Vf(t=>Promise.resolve(t)),(i=this.ngModule.injector,r=this.configLoader,s=this.urlSerializer,o=this.config,function(t){return t.pipe(Vf(t=>function(t,e,n,i,r){return new Zm(t,e,n,i,r).apply()}(i,r,s,t.extractedUrl,o).pipe(k(e=>Object.assign(Object.assign({},t),{urlAfterRedirects:e})))))}),ng(t=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:t.urlAfterRedirects})}),function(t,e,n,i,r){return function(s){return s.pipe(U(s=>function(t,e,n,i,r="emptyOnly",s="legacy"){return new fv(t,e,n,i,r,s).recognize()}(t,e,s.urlAfterRedirects,n(s.urlAfterRedirects),i,r).pipe(k(t=>Object.assign(Object.assign({},s),{targetSnapshot:t})))))}}(this.rootComponentType,this.config,t=>this.serializeUrl(t),this.paramsInheritanceStrategy,this.relativeLinkResolution),ng(t=>{"eager"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),ng(t=>{const n=new dg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.next(n)}));var i,r,s,o;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:i,source:r,restoredState:s,extras:o}=t,a=new lg(n,this.serializeUrl(i),r,s);e.next(a);const l=dm(i,this.rootComponentType).snapshot;return ff(Object.assign(Object.assign({},t),{targetSnapshot:l,urlAfterRedirects:i,extras:Object.assign(Object.assign({},o),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=t.rawUrl,this.browserUrlTree=t.urlAfterRedirects,t.resolve(null),Cf}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.beforePreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),ng(t=>{const e=new pg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),k(t=>Object.assign(Object.assign({},t),{guards:sv(t.targetSnapshot,t.currentSnapshot,this.rootContexts)})),function(t,e){return function(n){return n.pipe(U(n=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:o}}=n;return 0===o.length&&0===s.length?ff(Object.assign(Object.assign({},n),{guardsResult:!0})):function(t,e,n,i){return O(t).pipe(U(t=>function(t,e,n,i,r){const s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return s&&0!==s.length?ff(s.map(s=>{const o=ov(s,e,r);let a;if(function(t){return t&&Nm(t.canDeactivate)}(o))a=Ig(o.canDeactivate(t,e,n,i));else{if(!Nm(o))throw new Error("Invalid CanDeactivate guard");a=Ig(o(t,e,n,i))}return a.pipe(tg())})).pipe(Vm()):ff(!0)}(t.component,t.route,n,e,i)),tg(t=>!0!==t,!0))}(o,i,r,t).pipe(U(n=>n&&"boolean"==typeof n?function(t,e,n,i){return O(e).pipe(Zf(e=>O([hv(e.route.parent,i),cv(e.route,i),dv(t,e.path,n),uv(t,e.route,n)]).pipe(kf(),tg(t=>!0!==t,!0))),tg(t=>!0!==t,!0))}(i,s,t,e):ff(n)),k(t=>Object.assign(Object.assign({},n),{guardsResult:t})))}))}}(this.ngModule.injector,t=>this.triggerEvent(t)),ng(t=>{if(Bm(t.guardsResult)){const e=Ag(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);throw e.url=t.guardsResult,e}}),ng(t=>{const e=new fg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);this.triggerEvent(e)}),Af(t=>{if(!t.guardsResult){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"");return e.next(n),t.resolve(!1),!1}return!0}),xv(t=>{if(t.guards.canActivateChecks.length)return ff(t).pipe(ng(t=>{const e=new gg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),Vf(t=>{let n=!1;return ff(t).pipe((i=this.paramsInheritanceStrategy,r=this.ngModule.injector,function(t){return t.pipe(U(t=>{const{targetSnapshot:e,guards:{canActivateChecks:n}}=t;if(!n.length)return ff(t);let s=0;return O(n).pipe(Zf(t=>function(t,e,n,i){return function(t,e,n,i){const r=Object.keys(t);if(0===r.length)return ff({});const s={};return O(r).pipe(U(r=>function(t,e,n,i){const r=ov(t,e,i);return Ig(r.resolve?r.resolve(e,n):r(e,n))}(t[r],e,n,i).pipe(ng(t=>{s[r]=t}))),Ff(1),U(()=>Object.keys(s).length===r.length?ff(s):Cf))}(t._resolve,t,e,i).pipe(k(e=>(t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),fm(t,n).resolve),null)))}(t.route,e,i,r)),ng(()=>s++),Ff(1),U(e=>s===n.length?ff(t):Cf))}))}),ng({next:()=>n=!0,complete:()=>{if(!n){const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");e.next(n),t.resolve(!1)}}}));var i,r}),ng(t=>{const e=new mg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}))}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.afterPreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),k(t=>{const e=function(t,e,n){const i=xm(t,e._root,n?n._root:void 0);return new um(i,e)}(this.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:e})}),ng(t=>{this.currentUrlTree=t.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl),this.routerState=t.targetRouterState,"deferred"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),(s=this.rootContexts,o=this.routeReuseStrategy,a=t=>this.triggerEvent(t),k(t=>(new $m(o,t.targetRouterState,t.currentRouterState,a).activate(s),t))),ng({next(){n=!0},complete(){n=!0}}),(r=()=>{if(!n&&!i){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),`Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);e.next(n),t.resolve(!1)}this.currentNavigation=null},t=>t.lift(new sg(r))),Yf(n=>{if(i=!0,(r=n)&&r.ngNavigationCancelingError){const i=Bm(n.url);i||(this.navigated=!0,this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));const r=new hg(t.id,this.serializeUrl(t.extractedUrl),n.message);e.next(r),i?setTimeout(()=>{const e=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);return this.scheduleNavigation(e,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})},0):t.resolve(!1)}else{this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);const i=new ug(t.id,this.serializeUrl(t.extractedUrl),n);e.next(i);try{t.resolve(this.errorHandler(n))}catch(s){t.reject(s)}}var r;return Cf}));var r,s,o,a}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}getTransition(){const t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const e=this.extractLocationChangeInfoFromEvent(t);this.shouldScheduleNavigation(this.lastLocationChangeInfo,e)&&setTimeout(()=>{const{source:t,state:n,urlTree:i}=e,r={replaceUrl:!0};if(n){const t=Object.assign({},n);delete t.navigationId,0!==Object.keys(t).length&&(r.state=t)}this.scheduleNavigation(i,t,n,r)},0),this.lastLocationChangeInfo=e}))}extractLocationChangeInfoFromEvent(t){var e;return{source:"popstate"===t.type?"popstate":"hashchange",urlTree:this.parseUrl(t.url),state:(null===(e=t.state)||void 0===e?void 0:e.navigationId)?t.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(t,e){if(!t)return!0;const n=e.urlTree.toString()===t.urlTree.toString();return!(e.transitionId===t.transitionId&&n&&("hashchange"===e.source&&"popstate"===t.source||"popstate"===e.source&&"hashchange"===t.source))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){jm(t),this.config=t.map(Gm),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)}createUrlTree(t,e={}){const{relativeTo:n,queryParams:i,fragment:r,queryParamsHandling:s,preserveFragment:o}=e,a=n||this.routerState.root,l=o?this.currentUrlTree.fragment:r;let c=null;switch(s){case"merge":c=Object.assign(Object.assign({},this.currentUrlTree.queryParams),i);break;case"preserve":c=this.currentUrlTree.queryParams;break;default:c=i||null}return null!==c&&(c=this.removeEmptyProps(c)),function(t,e,n,i,r){if(0===n.length)return Em(e.root,e.root,e,i,r);const s=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Am(!0,0,t);let e=0,n=!1;const i=t.reduce((t,i,r)=>{if("object"==typeof i&&null!=i){if(i.outlets){const e={};return Mg(i.outlets,(t,n)=>{e[n]="string"==typeof t?t.split("/"):t}),[...t,{outlets:e}]}if(i.segmentPath)return[...t,i.segmentPath]}return"string"!=typeof i?[...t,i]:0===r?(i.split("/").forEach((i,r)=>{0==r&&"."===i||(0==r&&""===i?n=!0:".."===i?e++:""!=i&&t.push(i))}),t):[...t,i]},[]);return new Am(n,e,i)}(n);if(s.toRoot())return Em(e.root,new Ug([],{}),e,i,r);const o=function(t,e,n){if(t.isAbsolute)return new Dm(e.root,!0,0);if(-1===n.snapshot._lastPathIndex){const t=n.snapshot._urlSegment;return new Dm(t,t===e.root,0)}const i=Cm(t.commands[0])?0:1;return function(t,e,n){let i=t,r=e,s=n;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new Dm(i,!1,r-s)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(s,e,t),a=o.processChildren?Rm(o.segmentGroup,o.index,s.commands):Tm(o.segmentGroup,o.index,s.commands);return Em(o.segmentGroup,a,e,i,r)}(a,this.currentUrlTree,t,c,l)}navigateByUrl(t,e={skipLocationChange:!1}){const n=Bm(t)?t:this.parseUrl(t),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,e)}navigate(t,e={skipLocationChange:!1}){return function(t){for(let e=0;e{const i=t[n];return null!=i&&(e[n]=i),e},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.events.next(new cg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,t.resolve(!0)},t=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(t,e,n,i,r){const s=this.getTransition(),o="imperative"!==e&&"imperative"===(null==s?void 0:s.source),a=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===t.toString();if(o&&a)return Promise.resolve(!0);let l,c,h;r?(l=r.resolve,c=r.reject,h=r.promise):h=new Promise((t,e)=>{l=t,c=e});const u=++this.navigationId;return this.setTransition({id:u,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:i,resolve:l,reject:c,promise:h,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),h.catch(t=>Promise.reject(t))}setBrowserUrl(t,e,n,i){const r=this.urlSerializer.serialize(t);i=i||{},this.location.isCurrentPathEqualTo(r)||e?this.location.replaceState(r,"",Object.assign(Object.assign({},i),{navigationId:n})):this.location.go(r,"",Object.assign(Object.assign({},i),{navigationId:n}))}resetStateAndUrl(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qn),bi(zg),bi(kv),bi(Dh),bi(ho),bi(ih),bi(Fc),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Lv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.route=e,this.commands=[],this.onChanges=new C,null==n&&i.setAttribute(r.nativeElement,"tabindex","0")}ngOnChanges(t){this.onChanges.next(this)}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}onClick(){const t={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,t),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),qn("tabindex"),Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})(),Mv=(()=>{class t{constructor(t,e,n){this.router=t,this.route=e,this.locationStrategy=n,this.commands=[],this.onChanges=new C,this.subscription=t.events.subscribe(t=>{t instanceof cg&&this.updateTargetUrlAndHref()})}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}ngOnChanges(t){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(t,e,n,i,r){if(0!==t||e||n||i||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const s={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,s),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),Ro(Ch))},t.\u0275dir=Wt({type:t,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.onClick(t.button,t.ctrlKey,t.shiftKey,t.altKey,t.metaKey)}),2&t&&(xa("href",e.href,nr),ko("target",e.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})();function Iv(t){return""===t||!!t}let $v=(()=>{class t{constructor(t,e,n,i,r,s){this.router=t,this.element=e,this.renderer=n,this.cdr=i,this.link=r,this.linkWithHref=s,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=t.events.subscribe(t=>{t instanceof cg&&this.update()})}ngAfterContentInit(){O([this.links.changes,this.linksWithHrefs.changes,ff(null)]).pipe(j()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var t;null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe();const e=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(t=>!!t).map(t=>t.onChanges);this.linkInputChangesSubscription=O(e).pipe(j()).subscribe(t=>{this.isActive!==this.isLinkActive(this.router)(t)&&this.update()})}set routerLinkActive(t){const e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(t=>!!t)}ngOnChanges(t){this.update()}ngOnDestroy(){var t;this.routerEventsSubscription.unsubscribe(),null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const t=this.hasActiveLinks();this.isActive!==t&&(this.isActive=t,this.cdr.markForCheck(),this.classes.forEach(e=>{t?this.renderer.addClass(this.element.nativeElement,e):this.renderer.removeClass(this.element.nativeElement,e)}))})}isLinkActive(t){return e=>t.isActive(e.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.linkWithHref&&t(this.linkWithHref)||this.links.some(t)||this.linksWithHrefs.some(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(za),Ro(Ga),Ro(pl),Ro(Lv,8),Ro(Mv,8))},t.\u0275dir=Wt({type:t,selectors:[["","routerLinkActive",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Lv,!0),ac(n,Mv,!0)),2&t){let t;ic(t=lc())&&(e.links=t),ic(t=lc())&&(e.linksWithHrefs=t)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[le]}),t})(),Ov=(()=>{class t{constructor(t,e,n,i,r){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=r,this.activated=null,this._activatedRoute=null,this.activateEvents=new Wl,this.deactivateEvents=new Wl,this.name=i||Sg,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),i=this.parentContexts.getOrCreateContext(this.name).children,r=new Pv(t,i,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return t.\u0275fac=function(e){return new(e||t)(Ro(kv),Ro(El),Ro(Ua),qn("name"),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class Pv{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===pm?this.route:t===kv?this.childContexts:this.parent.get(t,e)}}class Nv{}class Bv{preload(t,e){return ff(null)}}let Uv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.injector=i,this.preloadingStrategy=r,this.loader=new Sv(e,n,e=>t.triggerEvent(new vg(e)),e=>t.triggerEvent(new yg(e)))}setUpPreloading(){this.subscription=this.router.events.pipe(Af(t=>t instanceof cg),Zf(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(_l);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,e){const n=[];for(const i of e)if(i.loadChildren&&!i.canLoad&&i._loadedConfig){const t=i._loadedConfig;n.push(this.processRoutes(t.module,t.routes))}else i.loadChildren&&!i.canLoad?n.push(this.preloadConfig(t,i)):i.children&&n.push(this.processRoutes(t,i.children));return O(n).pipe(j(),k(t=>{}))}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>this.loader.load(t.injector,e).pipe(U(t=>(e._loadedConfig=t,this.processRoutes(t.module,t.routes)))))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(ih),bi(Fc),bi(ho),bi(Nv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Vv=(()=>{class t{constructor(t,e,n={}){this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof lg?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof cg&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Cg&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.router.triggerEvent(new Cg(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(Kh),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Hv=new Yn("ROUTER_CONFIGURATION"),jv=new Yn("ROUTER_FORROOT_GUARD"),zv=[Dh,{provide:zg,useClass:Wg},{provide:Fv,useFactory:function(t,e,n,i,r,s,o,a={},l,c){const h=new Fv(null,t,e,n,i,r,s,Fg(o));if(l&&(h.urlHandlingStrategy=l),c&&(h.routeReuseStrategy=c),function(t,e){t.errorHandler&&(e.errorHandler=t.errorHandler),t.malformedUriErrorHandler&&(e.malformedUriErrorHandler=t.malformedUriErrorHandler),t.onSameUrlNavigation&&(e.onSameUrlNavigation=t.onSameUrlNavigation),t.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=t.paramsInheritanceStrategy),t.relativeLinkResolution&&(e.relativeLinkResolution=t.relativeLinkResolution),t.urlUpdateStrategy&&(e.urlUpdateStrategy=t.urlUpdateStrategy)}(a,h),a.enableTracing){const t=dh();h.events.subscribe(e=>{t.logGroup("Router Event: "+e.constructor.name),t.log(e.toString()),t.log(e),t.logGroupEnd()})}return h},deps:[zg,kv,Dh,ho,ih,Fc,Cv,Hv,[class{},new li],[class{},new li]]},kv,{provide:pm,useFactory:function(t){return t.routerState.root},deps:[Fv]},{provide:ih,useClass:oh},Uv,Bv,class{preload(t,e){return e().pipe(Yf(()=>ff(null)))}},{provide:Hv,useValue:{enableTracing:!1}}];function Wv(){return new Yc("Router",Fv)}let Gv=(()=>{class t{constructor(t,e){}static forRoot(e,n){return{ngModule:t,providers:[zv,Yv(e),{provide:jv,useFactory:Xv,deps:[[Fv,new li,new hi]]},{provide:Hv,useValue:n||{}},{provide:Ch,useFactory:Kv,deps:[fh,[new ai(Eh),new li],Hv]},{provide:Vv,useFactory:qv,deps:[Fv,Kh,Hv]},{provide:Nv,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Bv},{provide:Yc,multi:!0,useFactory:Wv},[Jv,{provide:pc,multi:!0,useFactory:Qv,deps:[Jv]},{provide:ty,useFactory:Zv,deps:[Jv]},{provide:wc,multi:!0,useExisting:ty}]]}}static forChild(e){return{ngModule:t,providers:[Yv(e)]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(jv,8),bi(Fv,8))}}),t})();function qv(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Vv(t,e,n)}function Kv(t,e,n={}){return n.useHash?new Ah(t,e):new kh(t,e)}function Xv(t){return"guarded"}function Yv(t){return[{provide:Jn,multi:!0,useValue:t},{provide:Cv,multi:!0,useValue:t}]}let Jv=(()=>{class t{constructor(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new C}appInitializer(){return this.injector.get(mh,Promise.resolve(null)).then(()=>{let t=null;const e=new Promise(e=>t=e),n=this.injector.get(Fv),i=this.injector.get(Hv);return"disabled"===i.initialNavigation?(n.setUpLocationChangeListener(),t(!0)):"enabled"===i.initialNavigation||"enabledBlocking"===i.initialNavigation?(n.hooks.afterPreactivation=()=>this.initNavigation?ff(null):(this.initNavigation=!0,t(!0),this.resultOfPreactivationDone),n.initialNavigation()):t(!0),e})}bootstrapListener(t){const e=this.injector.get(Hv),n=this.injector.get(Uv),i=this.injector.get(Vv),r=this.injector.get(Fv),s=this.injector.get(eh);t===s.components[0]&&("enabledNonBlocking"!==e.initialNavigation&&void 0!==e.initialNavigation||r.initialNavigation(),n.setUpPreloading(),i.init(),r.resetRootComponentType(s.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Qv(t){return t.appInitializer.bind(t)}function Zv(t){return t.bootstrapListener.bind(t)}const ty=new Yn("Router Initializer");function ey(t,e){return new y(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,s!==i&&c||(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}const ny=new Yn("NgValueAccessor"),iy={provide:ny,useExisting:st(()=>ry),multi:!0};let ry=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.checked)})("blur",function(){return e.onTouched()})},features:[Pa([iy])]}),t})();const sy={provide:ny,useExisting:st(()=>ay),multi:!0},oy=new Yn("CompositionEventMode");let ay=(()=>{class t{constructor(t,e,n){this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=t=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=dh()?dh().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(oy,8))},t.\u0275dir=Wt({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[Pa([sy])]}),t})();function ly(t){return null==t||0===t.length}function cy(t){return null!=t&&"number"==typeof t.length}const hy=new Yn("NgValidators"),uy=new Yn("NgAsyncValidators"),dy=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class py{static min(t){return e=>{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}}static required(t){return ly(t.value)?{required:!0}:null}static requiredTrue(t){return!0===t.value?null:{required:!0}}static email(t){return ly(t.value)||dy.test(t.value)?null:{email:!0}}static minLength(t){return e=>ly(e.value)||!cy(e.value)?null:e.value.lengthcy(e.value)&&e.value.length>t?{maxlength:{requiredLength:t,actualLength:e.value.length}}:null}static pattern(t){if(!t)return py.nullValidator;let e,n;return"string"==typeof t?(n="","^"!==t.charAt(0)&&(n+="^"),n+=t,"$"!==t.charAt(t.length-1)&&(n+="$"),e=new RegExp(n)):(n=t.toString(),e=t),t=>{if(ly(t.value))return null;const i=t.value;return e.test(i)?null:{pattern:{requiredPattern:n,actualValue:i}}}}static nullValidator(t){return null}static compose(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return my(vy(t,e))}}static composeAsync(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return function(...t){if(1===t.length){const e=t[0];if(l(e))return ey(e,null);if(c(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ey(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return ey(t=1===t.length&&l(t[0])?t[0]:t,null).pipe(k(t=>e(...t)))}return ey(t,null)}(vy(t,e).map(gy)).pipe(k(my))}}}function fy(t){return null!=t}function gy(t){const e=Bo(t)?O(t):t;return Uo(e),e}function my(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function vy(t,e){return e.map(e=>e(t))}function yy(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function by(t){return null!=t?py.compose(yy(t)):null}function wy(t){return null!=t?py.composeAsync(yy(t)):null}function xy(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function _y(t){return t._rawValidators}function Cy(t){return t._rawAsyncValidators}let Sy=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=by(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=wy(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t}),t})(),Ey=(()=>{class t extends Sy{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(e){return ky(e||t)},t.\u0275dir=Wt({type:t,features:[po]}),t})();const ky=Gn(Ey);class Ay extends Sy{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class Dy{constructor(t){this._cd=t}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}let Ty=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ay,2))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})(),Ry=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,2))},t.\u0275dir=Wt({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})();const Fy={provide:ny,useExisting:st(()=>Ly),multi:!0};let Ly=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Fy])]}),t})();const My={provide:ny,useExisting:st(()=>$y),multi:!0};let Iy=(()=>{class t{constructor(){this._accessors=[]}add(t,e){this._accessors.push([t,e])}remove(t){for(let e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)}select(t){this._accessors.forEach(e=>{this._isSameGroup(e,t)&&e[1]!==t&&e[1].fireUncheck(t.value)})}_isSameGroup(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),$y=(()=>{class t{constructor(t,e,n,i){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=i,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(Ay),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(t){this._fn=t,this.onChange=()=>{t(this.value),this._registry.select(this)}}fireUncheck(t){this.writeValue(t)}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(Iy),Ro(ho))},t.\u0275dir=Wt({type:t,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("blur",function(){return e.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[Pa([My])]}),t})();const Oy={provide:ny,useExisting:st(()=>Py),multi:!0};let Py=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Oy])]}),t})();const Ny={provide:ny,useExisting:st(()=>Uy),multi:!0};function By(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let Uy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=By(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(t){this.onChange=e=>{this.value=this._getOptionValue(e),t(this.value)}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const e of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(e),t))return e;return null}_getOptionValue(t){const e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},inputs:{compareWith:"compareWith"},features:[Pa([Ny])]}),t})(),Vy=(()=>{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(By(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(Uy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();const Hy={provide:ny,useExisting:st(()=>zy),multi:!0};function jy(t,e){return null==t?""+e:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let zy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let e;if(this.value=t,Array.isArray(t)){const n=t.map(t=>this._getOptionId(t));e=(t,e)=>{t._setSelected(n.indexOf(e.toString())>-1)}}else e=(t,e)=>{t._setSelected(!1)};this._optionMap.forEach(e)}registerOnChange(t){this.onChange=e=>{const n=[];if(void 0!==e.selectedOptions){const t=e.selectedOptions;for(let e=0;e{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(zy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();function Gy(t,e){Ky(t,e,!0),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&Yy(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&Yy(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function qy(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function Ky(t,e,n){const i=_y(t);null!==e.validator?t.setValidators(xy(i,e.validator)):"function"==typeof i&&t.setValidators([i]);const r=Cy(t);if(null!==e.asyncValidator?t.setAsyncValidators(xy(r,e.asyncValidator)):"function"==typeof r&&t.setAsyncValidators([r]),n){const n=()=>t.updateValueAndValidity();qy(e._rawValidators,n),qy(e._rawAsyncValidators,n)}}function Xy(t,e,n){if(null!==t){if(null!==e.validator){const n=_y(t);Array.isArray(n)&&n.length>0&&t.setValidators(n.filter(t=>t!==e.validator))}if(null!==e.asyncValidator){const n=Cy(t);Array.isArray(n)&&n.length>0&&t.setAsyncValidators(n.filter(t=>t!==e.asyncValidator))}}if(n){const t=()=>{};qy(e._rawValidators,t),qy(e._rawAsyncValidators,t)}}function Yy(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Jy(t,e){Ky(t,e,!1)}const Qy=[ry,Py,Ly,Uy,zy,$y];function Zy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const tb="VALID",eb="INVALID",nb="PENDING",ib="DISABLED";function rb(t){return(lb(t)?t.validators:t)||null}function sb(t){return Array.isArray(t)?by(t):t||null}function ob(t,e){return(lb(e)?e.asyncValidators:t)||null}function ab(t){return Array.isArray(t)?wy(t):t||null}function lb(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class cb{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=sb(this._rawValidators),this._composedAsyncValidatorFn=ab(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===tb}get invalid(){return this.status===eb}get pending(){return this.status==nb}get disabled(){return this.status===ib}get enabled(){return this.status!==ib}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=sb(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=ab(t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=nb,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=ib,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=tb,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==tb&&this.status!==nb||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ib:tb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=nb,this._hasOwnPendingAsyncValidator=!0;const e=gy(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e)return null;if(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length)return null;let i=t;return e.forEach(t=>{i=i instanceof ub?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof db&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Wl,this.statusChanges=new Wl}_calculateStatus(){return this._allControlsDisabled()?ib:this.errors?eb:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(nb)?nb:this._anyControlsHaveStatus(eb)?eb:tb}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){lb(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class hb extends cb{constructor(t=null,e,n){super(rb(e),ob(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Zy(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Zy(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class ub extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof hb?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>t(this.controls[e],e))}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class db extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}at(t){return this.controls[t]}push(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()}insert(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()}removeAt(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof hb?t.value:t.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}let pb=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})();const fb=new Yn("NgModelWithFormControlWarning"),gb={provide:Ey,useExisting:st(()=>mb)};let mb=(()=>{class t extends Ey{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new Wl,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return Gy(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){Zy(this.directives,t)}addFormGroup(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormGroup(t){}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormArray(t){}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,e=this.directives,this.form._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=this.form.get(t.path);t.control!==e&&(function(t,e){const n=()=>{};e.valueAccessor.registerOnChange(n),e.valueAccessor.registerOnTouched(n),Xy(t,e,!0),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}(t.control||null,t),e&&Gy(e,t),t.control=e)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Ky(this.form,this,!1),this._oldForm&&Xy(this._oldForm,this,!1)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(hy,10),Ro(uy,10))},t.\u0275dir=Wt({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&Vo("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Pa([gb]),po,le]}),t})();const vb={provide:Ay,useExisting:st(()=>yb)};let yb=(()=>{class t extends Ay{constructor(t,e,n,i,r){super(),this._ngModelWarningConfig=r,this._added=!1,this.update=new Wl,this._ngModelWarningSent=!1,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=function(t,e){if(!e)return null;Array.isArray(e);let n=void 0,i=void 0,r=void 0;return e.forEach(t=>{var e;t.constructor===ay?n=t:(e=t,Qy.some(t=>e.constructor===t)?i=t:r=t)}),r||i||n||null}(0,i)}set isDisabled(t){}ngOnChanges(t){this._added||this._setUpControl(),function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return t=null==this.name?this.name:this.name.toString(),[...this._parent.path,t];var t}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,13),Ro(hy,10),Ro(uy,10),Ro(ny,10),Ro(fb,8))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[Pa([vb]),po,le]}),t._ngModelWarningSentOnce=!1,t})();const bb={provide:hy,useExisting:st(()=>wb),multi:!0};let wb=(()=>{class t{constructor(){this._required=!1}get required(){return this._required}set required(t){this._required=null!=t&&!1!==t&&""+t!="false",this._onChange&&this._onChange()}validate(t){return this.required?py.required(t):null}registerOnValidatorChange(t){this._onChange=t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(t,e){2&t&&ko("required",e.required?"":null)},inputs:{required:"required"},features:[Pa([bb])]}),t})(),xb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),_b=(()=>{class t{group(t,e=null){const n=this._reduceControls(t);let i=null,r=null,s=void 0;return null!=e&&(function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(e)?(i=null!=e.validators?e.validators:null,r=null!=e.asyncValidators?e.asyncValidators:null,s=null!=e.updateOn?e.updateOn:void 0):(i=null!=e.validator?e.validator:null,r=null!=e.asyncValidator?e.asyncValidator:null)),new ub(n,{asyncValidators:r,updateOn:s,validators:i})}control(t,e,n){return new hb(t,e,n)}array(t,e,n){const i=t.map(t=>this._createControl(t));return new db(i,e,n)}_reduceControls(t){const e={};return Object.keys(t).forEach(n=>{e[n]=this._createControl(t[n])}),e}_createControl(t){return t instanceof hb||t instanceof ub||t instanceof db?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Cb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[Iy],imports:[xb]}),t})(),Sb=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:fb,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[_b,Iy],imports:[xb]}),t})();const Eb=new Yn("ngx-segment-analytics.config"),kb={debug:!1,loadOnInitialization:!0,segmentHost:"cdn.segment.com",segmentUri:"/analytics.js/v1/$API_KEY$/analytics.min.js"};let Ab=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Db=(()=>{class t{constructor(t,e,n){if(this._w=t,this._doc=e,this._config=Object.assign(Object.assign({},kb),n),!this._config.loadOnInitialization||void 0!==this._config.apiKey&&""!==this._config.apiKey){if(void 0===this._w.analytics||void 0===this._w.analytics.initialize||!1===this._w.analytics.initialize){if(void 0!==this._w.analytics&&!0===this._w.analytics.invoked)return void console.error("Segment snippet included twice.");this._config.debug&&console.log("Segment initialization..."),this._w.analytics=[],this._w.analytics.invoked=!0,this._w.analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware"],this._w.analytics.factory=t=>(...e)=>(e.unshift(t),this._w.analytics.push(e),this._w.analytics),this._w.analytics.methods.forEach(t=>{this._w.analytics[t]=this._w.analytics.factory(t)}),this._w.analytics.load=(t,e)=>{const n=this._doc.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://"+this._config.segmentHost+this._config.segmentUri.replace("$API_KEY$",t);const i=this._doc.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),this._w.analytics._loadOptions=e},this._w.analytics.SNIPPET_VERSION="4.1.0",this._config.loadOnInitialization&&this.load(this._config.apiKey)}}else console.error("The API Key cannot be an empty string if Segment must be loaded on initialization.")}load(t,e){this._w.analytics.load(t,e),this._config.debug&&console.log("Segment initialized"),this.debug(this._config.debug)}identify(t,e,n){return new Promise(i=>{this._w.analytics.identify(t,e,n,t=>i(this))})}track(t,e,n){return new Promise(i=>{this._w.analytics.track(t,e,n,t=>i(this))})}page(t,e,n,i){return new Promise(r=>{this._w.analytics.page(t,e,n,i,t=>r(this))})}group(t,e){return new Promise(n=>{this._w.analytics.group(t,e,t=>n(this))})}alias(t,e,n){return new Promise(i=>{this._w.analytics.alias(t,e,n,t=>i(this))})}ready(){return new Promise(t=>{this._w.analytics.ready(e=>t(this))})}user(){return this._w.analytics.user()}id(){return this._w.analytics.id()}traits(){return this._w.analytics.traits()}reset(){this._w.analytics.reset()}debug(t){this._w.analytics.debug(t)}on(t,e){this._w.analytics.on(t,e)}trackLink(t,e,n){this._w.analytics.trackLink(t,e,n)}trackForm(t,e,n){this._w.analytics.trackForm(t,e,n)}timeout(t){this._w.analytics.timeout(t)}addSourceMiddleware(t){this._w.analytics.addSourceMiddleware(t)}get plugins(){return this._w.analytics.plugins}}return t.\u0275fac=function(e){return new(e||t)(bi(Ab),bi(ph),bi(Eb))},t.\u0275prov=lt({factory:function(){return new t(bi(Ab),bi(ph),bi(Eb))},token:t,providedIn:"root"}),t})();function Tb(t){return function(t){return"browser"===t}(t)?window:{}}let Rb=(()=>{class t{constructor(t){if(t)throw new Error("SegmentModule is already loaded. Import it in the AppModule only")}static forRoot(e){return{ngModule:t,providers:[{provide:Eb,useValue:e},Db]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:[{provide:Ab,useFactory:Tb,deps:[bc]}],imports:[[qh]]}),t})();class Fb{}class Lb{}class Mb{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof Mb?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new Mb;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Mb?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class Ib{encodeKey(t){return $b(t)}encodeValue(t){return $b(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}function $b(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class Ob{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new Ib,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Ob({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat([t]),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(t.value),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(t.value);-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}function Pb(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Nb(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Bb(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Ub{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new Mb),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),a)),t.setParams&&(l=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),l)),new Ub(e,n,r,{params:l,headers:a,reportProgress:o,responseType:i,withCredentials:s})}}var Vb=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({});class Hb{constructor(t,e=200,n="OK"){this.headers=t.headers||new Mb,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class jb extends Hb{constructor(t={}){super(t),this.type=Vb.ResponseHeader}clone(t={}){return new jb({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class zb extends Hb{constructor(t={}){super(t),this.type=Vb.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new zb({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Wb extends Hb{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(t.url||"(unknown url)"):`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Gb(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let qb=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Ub)i=t;else{let r=void 0;r=n.headers instanceof Mb?n.headers:new Mb(n.headers);let s=void 0;n.params&&(s=n.params instanceof Ob?n.params:new Ob({fromObject:n.params})),i=new Ub(t,e,void 0!==n.body?n.body:null,{headers:r,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=ff(i).pipe(Zf(t=>this.handler.handle(t)));if(t instanceof Ub||"events"===n.observe)return r;const s=r.pipe(Af(t=>t instanceof zb));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(k(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(k(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Ob).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Gb(n,e))}post(t,e,n={}){return this.request("POST",t,Gb(n,e))}put(t,e,n={}){return this.request("PUT",t,Gb(n,e))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Kb{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const Xb=new Yn("HTTP_INTERCEPTORS");let Yb=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Jb=/^\)\]\}',?\n/;class Qb{}let Zb=(()=>{class t{constructor(){}build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),tw=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new y(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new Mb(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new jb({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Jb,"");try{l=""!==l?JSON.parse(l):null}catch(h){l=t,c&&(c=!1,l={error:h,text:l})}}c?(e.next(new zb({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new Wb({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new Wb({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Vb.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&n.responseText&&(r.partialText=n.responseText),e.next(r)},h=t=>{let n={type:Vb.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",h)),n.send(i),e.next({type:Vb.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("load",o),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",h)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const ew=new Yn("XSRF_COOKIE_NAME"),nw=new Yn("XSRF_HEADER_NAME");class iw{}let rw=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Ih(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(bc),bi(ew))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),sw=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null===i||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(iw),bi(nw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),ow=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(Xb,[]);this.chain=t.reduceRight((t,e)=>new Kb(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(Lb),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),aw=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:sw,useClass:Yb}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:ew,useValue:e.cookieName}:[],e.headerName?{provide:nw,useValue:e.headerName}:[]]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[sw,{provide:Xb,useExisting:sw,multi:!0},{provide:iw,useClass:rw},{provide:ew,useValue:"XSRF-TOKEN"},{provide:nw,useValue:"X-XSRF-TOKEN"}]}),t})(),lw=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[qb,{provide:Fb,useClass:ow},tw,{provide:Lb,useExisting:tw},Zb,{provide:Qb,useExisting:Zb}],imports:[[aw.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();var cw=function(t){return t[t.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",t[t.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",t[t.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",t[t.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",t[t.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",t}({}),hw=function(t){return t[t.APPLE_APP_STORE=0]="APPLE_APP_STORE",t[t.GOOGLE_PLAY_STORE=1]="GOOGLE_PLAY_STORE",t[t.HUAWEI_APP_GALLERY=2]="HUAWEI_APP_GALLERY",t}({});class uw{}let dw=(()=>{class t{constructor(t,e){this.httpClient=t,this.config=e||{host:"http://127.0.0.1:7120",timeoutMs:5e3}}deleteAccounts(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/account",{params:e,headers:this.getTokenAuthHeaders(t)})}listAccounts(t,e,n,i){let r=new Ob;return e&&(r=r.set("filter",e)),(n||!1===n)&&(r=r.set("tombstones",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/account",{params:r,headers:this.getTokenAuthHeaders(t)})}getWalletLedger(t,e,n,i){const r=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet`;let s=new Ob;return n&&(s=s.set("limit",String(n))),i&&(s=s.set("cursor",i)),this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}deleteAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return(n||!1===n)&&(r=r.set("record_deletion",String(n))),this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getAccount(t,e){const n="/v2/console/account/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}banAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/ban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}exportAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getFriends(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteFriend(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getGroups(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/group`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteGroupUser(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/group/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}unbanAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkApple(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/apple`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkCustom(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/custom`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkDevice(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/device`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}unlinkEmail(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/email`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebook(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebook`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebookInstantGame(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebookinstantgame`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGameCenter(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/gamecenter`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGoogle(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/google`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkSteam(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/steam`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteWalletLedger(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteAllData(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/all",{params:e,headers:this.getTokenAuthHeaders(t)})}listApiEndpoints(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/api/endpoints",{params:e,headers:this.getTokenAuthHeaders(t)})}callRpcEndpoint(t,e,n){const i="/v2/console/api/endpoints/rpc/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}callApiEndpoint(t,e,n){const i="/v2/console/api/endpoints/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}authenticate(t){let e=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate",t,{params:e})}authenticateLogout(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate/logout",e,{params:n,headers:this.getTokenAuthHeaders(t)})}listChannelMessages(t,e,n,i,r,s,o){let a=new Ob;return e&&(a=a.set("type",e)),n&&(a=a.set("label",n)),i&&(a=a.set("group_id",i)),r&&(a=a.set("user_id_one",r)),s&&(a=a.set("user_id_two",s)),o&&(a=a.set("cursor",o)),this.httpClient.get(this.config.host+"/v2/console/channel",{params:a,headers:this.getTokenAuthHeaders(t)})}getConfig(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/config",{params:e,headers:this.getTokenAuthHeaders(t)})}listGroups(t,e,n){let i=new Ob;return e&&(i=i.set("filter",e)),n&&(i=i.set("cursor",n)),this.httpClient.get(this.config.host+"/v2/console/group",{params:i,headers:this.getTokenAuthHeaders(t)})}demoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/demote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}promoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/promote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}addGroupUsers(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/add`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateGroup(t,e,n){const i="/v2/console/group/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}exportGroup(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getMembers(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/member`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}listLeaderboards(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/leaderboard",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboardRecord(t,e,n){const i=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/owner/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}listLeaderboardRecords(t,e,n,i,r,s){const o=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/records`;let a=new Ob;return n&&n.forEach(t=>a=a.append("owner_ids",String(t))),i&&(a=a.set("limit",String(i))),r&&(a=a.set("cursor",r)),s&&(a=a.set("expiry",s)),this.httpClient.get(this.config.host+o,{params:a,headers:this.getTokenAuthHeaders(t)})}listMatches(t,e,n,i,r,s,o,a,l){let c=new Ob;return e&&(c=c.set("limit",String(e))),(n||!1===n)&&(c=c.set("authoritative",String(n))),i&&(c=c.set("label",i)),r&&(c=c.set("min_size",String(r))),s&&(c=c.set("max_size",String(s))),o&&(c=c.set("match_id",o)),a&&(c=c.set("query",a)),l&&(c=c.set("node",l)),this.httpClient.get(this.config.host+"/v2/console/match",{params:c,headers:this.getTokenAuthHeaders(t)})}getMatchState(t,e){const n=`/v2/console/match/${e=encodeURIComponent(String(e))}/state`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteChannelMessages(t,e,n){let i=new Ob;return e&&(i=i.set("before",e)),n&&n.forEach(t=>i=i.append("ids",String(t))),this.httpClient.delete(this.config.host+"/v2/console/message",{params:i,headers:this.getTokenAuthHeaders(t)})}listPurchases(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/purchase",{params:r,headers:this.getTokenAuthHeaders(t)})}getRuntime(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/runtime",{params:e,headers:this.getTokenAuthHeaders(t)})}getStatus(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/status",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorage(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/storage",{params:e,headers:this.getTokenAuthHeaders(t)})}listStorage(t,e,n,i,r){let s=new Ob;return e&&(s=s.set("user_id",e)),n&&(s=s.set("key",n)),i&&(s=s.set("collection",i)),r&&(s=s.set("cursor",r)),this.httpClient.get(this.config.host+"/v2/console/storage",{params:s,headers:this.getTokenAuthHeaders(t)})}listStorageCollections(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/storage/collections",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return r&&(o=o.set("version",r)),this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}getStorage(t,e,n,i){const r=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let s=new Ob;return this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}writeStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return this.httpClient.put(this.config.host+s,r,{params:o,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject2(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}/${r=encodeURIComponent(String(r))}`;let o=new Ob;return this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}listSubscriptions(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/subscription",{params:r,headers:this.getTokenAuthHeaders(t)})}deleteUser(t,e){let n=new Ob;return e&&(n=n.set("username",e)),this.httpClient.delete(this.config.host+"/v2/console/user",{params:n,headers:this.getTokenAuthHeaders(t)})}listUsers(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/user",{params:e,headers:this.getTokenAuthHeaders(t)})}addUser(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/user",e,{params:n,headers:this.getTokenAuthHeaders(t)})}getTokenAuthHeaders(t){return(new Mb).set("Authorization","Bearer "+t)}getBasicAuthHeaders(t,e){return(new Mb).set("Authorization","Basic "+btoa(t+":"+e))}}return t.\u0275fac=function(e){return new(e||t)(bi(qb),bi(uw,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const pw=new Yn("window"),fw=[{provide:pw,useFactory:()=>window}],gw="currentSession";let mw=(()=>{class t{constructor(t,e,n,i){this.window=t,this.segment=e,this.http=n,this.consoleService=i;const r=JSON.parse(localStorage.getItem(gw));this.currentSessionSubject=new gf(r),this.currentSession=this.currentSessionSubject.asObservable()}get currentSessionValue(){return this.currentSessionSubject.getValue()}get username(){const t=this.currentSessionSubject.getValue().token;return JSON.parse(atob(t.split(".")[1])).usn}get sessionRole(){const t=this.currentSessionSubject.getValue().token;switch(JSON.parse(atob(t.split(".")[1])).rol){case 1:return cw.USER_ROLE_ADMIN;case 2:return cw.USER_ROLE_DEVELOPER;case 3:return cw.USER_ROLE_MAINTAINER;case 4:return cw.USER_ROLE_READONLY;default:return cw.USER_ROLE_UNKNOWN}}login(t,e){return this.consoleService.authenticate({username:t,password:e}).pipe(ng(t=>{localStorage.setItem(gw,JSON.stringify(t)),this.currentSessionSubject.next(t)}))}logout(){var t;return this.currentSessionSubject.getValue()?this.consoleService.authenticateLogout("",{token:null===(t=this.currentSessionSubject.getValue())||void 0===t?void 0:t.token}).pipe(ng(()=>{localStorage.removeItem(gw),this.currentSessionSubject.next(null)})):Cf}segmentIdentify(t){const e=JSON.parse(atob(t.token.split(".")[1]));this.segment.identify(null,{username:e.usn,email:e.ema,cookie:e.cki})}}return t.\u0275fac=function(e){return new(e||t)(bi(pw),bi(Db),bi(qb),bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function vw(t,e){if(1&t&&(Mo(0,"div",17),va(1),Io()),2&t){const t=zo();Qr(1),ba(" ",t.error," ")}}const yw=function(t){return{"was-validated":t}},bw=function(t){return{"is-invalid":t}};let ww=(()=>{class t{constructor(t,e,n,i,r){this.segment=t,this.formBuilder=e,this.route=n,this.router=i,this.authenticationService=r,this.error=""}ngOnInit(){this.loginForm=this.formBuilder.group({username:["",py.compose([py.required])],password:["",py.compose([py.required,py.minLength(8)])]}),this.returnUrl=this.route.snapshot.queryParams.next||"/"}onSubmit(){this.submitted=!0,this.error="",this.loginForm.invalid||this.authenticationService.login(this.f.username.value,this.f.password.value).subscribe(t=>{this.loginForm.reset(),this.submitted=!1,this.router.navigate([this.returnUrl])},t=>{this.error=t,this.submitted=!1})}get f(){return this.loginForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(Db),Ro(_b),Ro(pm),Ro(Fv),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:26,vars:14,consts:[[1,"bg-grad","d-flex","h-100"],[1,"align-self-center","mx-auto"],[1,"text-center","mb-4"],["src","/static/svg/logo.svg","alt","Nakama Logo","width","175"],["class","alert alert-warning","role","alert",4,"ngIf"],[1,"card"],[1,"card-body"],[1,"text-center"],[3,"formGroup","ngClass","ngSubmit"],[1,"form-group","form-row"],[1,"col-sm-12"],["for","username"],["type","text","id","username","formControlName","username","required","","autofocus","",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","password"],["type","password","id","password","formControlName","password","required","",1,"form-control",3,"ngClass"],[1,"btn","btn-primary","btn-lg","btn-block",3,"disabled"],["role","alert",1,"alert","alert-warning"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"h1",2),$o(3,"img",3),Io(),Do(4,vw,2,1,"div",4),Mo(5,"div",5),Mo(6,"div",6),Mo(7,"h3",7),va(8,"Login"),Io(),Mo(9,"form",8),Vo("ngSubmit",function(){return e.onSubmit()}),Mo(10,"div",9),Mo(11,"div",10),Mo(12,"label",11),va(13,"Username"),Io(),$o(14,"input",12),Mo(15,"div",13),va(16,"Please enter a username."),Io(),Io(),Io(),Mo(17,"div",9),Mo(18,"div",10),Mo(19,"label",14),va(20,"Password"),Io(),$o(21,"input",15),Mo(22,"div",13),va(23,"Password must be at least 8 characters."),Io(),Io(),Io(),Mo(24,"button",16),va(25,"Login"),Io(),Io(),Io(),Io(),Io(),Io()),2&t&&(Qr(4),Fo("ngIf",e.error),Qr(5),Fo("formGroup",e.loginForm)("ngClass",Vl(8,yw,e.submitted)),Qr(5),Fo("ngClass",Vl(10,bw,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(6),Fo("ngClass",Vl(12,bw,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(2),Fo("disabled",!e.loginForm.valid||e.submitted))},directives:[Bh,pb,Ry,mb,$h,ay,Ty,yb,wb],styles:["div[_ngcontent-%COMP%] .mx-auto[_ngcontent-%COMP%]{width:420px}"]}),t})(),xw=(()=>{class t{constructor(t,e){this.authService=t,this.router=e}canActivate(t,e){return!this.authService.currentSessionValue||(this.router.navigate(["/"]),!1)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),_w=(()=>{class t{constructor(t,e){this.router=t,this.authenticationService=e}canActivate(t,e){return!!this.authenticationService.currentSessionValue||(this.router.navigate(["/login"],{queryParams:{next:e.url}}),!1)}canActivateChild(t,e){return this.canActivate(t,e)}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Cw extends u{constructor(t,e){super()}schedule(t,e=0){return this}}class Sw extends Cw{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n=!1,i=void 0;try{this.work(t)}catch(r){n=!0,i=!!r&&r||new Error(r)}if(n)return this.unsubscribe(),i}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}let Ew=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class kw extends Ew{constructor(t,e=Ew.now){super(t,()=>kw.delegate&&kw.delegate!==this?kw.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return kw.delegate&&kw.delegate!==this?kw.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const Aw=new kw(Sw);class Dw{constructor(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}call(t,e){return e.subscribe(new Rw(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))}}class Tw{constructor(){this.buffer=[]}}class Rw extends f{constructor(t,e,n,i,r){super(t),this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=i,this.scheduler=r,this.contexts=[];const s=this.openContext();if(this.timespanOnly=null==n||n<0,this.timespanOnly)this.add(s.closeAction=r.schedule(Fw,e,{subscriber:this,context:s,bufferTimeSpan:e}));else{const t={bufferTimeSpan:e,bufferCreationInterval:n,subscriber:this,scheduler:r};this.add(s.closeAction=r.schedule(Mw,e,{subscriber:this,context:s})),this.add(r.schedule(Lw,n,t))}}_next(t){const e=this.contexts,n=e.length;let i;for(let r=0;r0;){const n=t.shift();e.next(n.buffer)}super._complete()}_unsubscribe(){this.contexts=null}onBufferFull(t){this.closeContext(t);const e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();const e=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(Fw,e,{subscriber:this,context:t,bufferTimeSpan:e}))}}openContext(){const t=new Tw;return this.contexts.push(t),t}closeContext(t){this.destination.next(t.buffer);const e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)}}function Fw(t){const e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Lw(t){const{bufferCreationInterval:e,bufferTimeSpan:n,subscriber:i,scheduler:r}=t,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(Mw,n,{subscriber:i,context:s})),this.schedule(t,e))}function Mw(t){const{subscriber:e,context:n}=t;e.closeContext(n)}class Iw{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new $w(t,this.compare,this.keySelector))}}class $w extends f{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}function Ow(t,e,n,r){return i(n)&&(r=n,n=void 0),r?Ow(t,e,n).pipe(k(t=>l(t)?r(...t):r(t))):new y(i=>{Pw(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Pw(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s=0}function Bw(t=0,e,n){let i=-1;return Nw(e)?i=Number(e)<1?1:Number(e):E(e)&&(n=e),E(n)||(n=Aw),new y(e=>{const r=Nw(t)?t:+t-n.now();return n.schedule(Uw,r,{index:0,period:i,subscriber:e})})}function Uw(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Vw(...t){if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return z(t,void 0).lift(new Hw)}class Hw{call(t,e){return e.subscribe(new jw(t))}}class jw extends mf{constructor(t){super(t),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(t){this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(let n=0;nthis.index}hasCompleted(){return this.array.length===this.index}}class Xw extends N{constructor(t,e,n){super(t),this.parent=e,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[F](){return this}next(){const t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(t){this.buffer.push(t),this.parent.checkIterators()}subscribe(){return B(this.observable,new P(this))}}function Yw(t){return e=>e.lift(new Jw(t))}class Jw{constructor(t){this.notifier=t}call(t,e){const n=new Qw(t),i=B(this.notifier,new P(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Qw extends N{constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Zw(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new tx(t,n))}}class tx{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new ex(t,this.observables,this.project))}}class ex extends mf{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function nx(t,e){return new y(e?n=>e.schedule(ix,0,{error:t,subscriber:n}):e=>e.error(t))}function ix({error:t,subscriber:e}){e.error(t)}let rx=(()=>{class t{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return ff(this.value);case"E":return nx(this.error);case"C":return Sf()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new t("N",e):t.undefinedValueNotification}static createError(e){return new t("E",void 0,e)}static createComplete(){return t.completeNotification}}return t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t})();function sx(t,e=Aw){var n;const i=(n=t)instanceof Date&&!isNaN(+n)?+t-e.now():Math.abs(t);return t=>t.lift(new ox(i,e))}class ox{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new ax(t,this.delay,this.scheduler))}}class ax extends f{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(ax.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new lx(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(rx.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(rx.createComplete()),this.unsubscribe()}}class lx{constructor(t,e){this.time=t,this.notification=e}}function cx(t,e){if(1&t){const t=No();Mo(0,"button",1),Vo("click",function(){return Ie(t),zo().close()}),Mo(1,"span",2),va(2,"\xd7"),Io(),Io()}}const hx=["*"],ux=["dialog"];function dx(t){return null!=t}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const px={animation:!0,transitionTimerDelayMs:5};let fx=(()=>{class t{constructor(){this.animation=px.animation}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})();const gx=()=>{},{transitionTimerDelayMs:mx}=px,vx=new Map,yx=(t,e,n)=>{let i=n.context||{};const r=vx.get(t);if(r)switch(n.runningTransition){case"continue":return Cf;case"stop":r.transition$.complete(),i=Object.assign(r.context,i),vx.delete(t)}!function(t){t||document}(t);const s=e(t,i)||gx;if(!n.animation||"none"===window.getComputedStyle(t).transitionProperty)return s(),ff(void 0);const o=new C,a=o.pipe(function(...t){return e=>qf(e,ff(...t))}(!0));vx.set(t,{transition$:o,context:i});const l=function(t){const{transitionDelay:e,transitionDuration:n}=window.getComputedStyle(t);return 1e3*(parseFloat(e)+parseFloat(n))}(t),c=Ow(t,"transitionend").pipe(Yw(a),Af(({target:e})=>e===t));return Vw(Bw(l+mx).pipe(Yw(a)),c).pipe(Yw(a)).subscribe(()=>{vx.delete(t),s(),o.next(),o.complete()}),o.asObservable()};let bx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),wx=(()=>{class t{constructor(t){this.dismissible=!0,this.type="warning",this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const xx=({classList:t})=>{t.remove("show")};let _x=(()=>{class t{constructor(t,e,n){this._renderer=e,this._element=n,this.closed=new Wl,this.dismissible=t.dismissible,this.type=t.type,this.animation=t.animation}close(){const t=yx(this._element.nativeElement,xx,{animation:this.animation,runningTransition:"continue"});return t.subscribe(()=>this.closed.emit()),t}ngOnChanges(t){const e=t.type;e&&!e.firstChange&&(this._renderer.removeClass(this._element.nativeElement,"alert-"+e.previousValue),this._renderer.addClass(this._element.nativeElement,"alert-"+e.currentValue))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,"alert-"+this.type)}}return t.\u0275fac=function(e){return new(e||t)(Ro(wx),Ro(Ga),Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert","show"],hostVars:4,hostBindings:function(t,e){2&t&&ra("fade",e.animation)("alert-dismissible",e.dismissible)},inputs:{dismissible:"dismissible",type:"type",animation:"animation"},outputs:{closed:"closed"},exportAs:["ngbAlert"],features:[le],ngContentSelectors:hx,decls:2,vars:1,consts:function(){let t,e;return t=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,e=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,[["type","button","class","close","aria-label",t,3,"click",4,"ngIf"],["type","button","aria-label",e,1,"close",3,"click"],["aria-hidden","true"]]},template:function(t,e){1&t&&(Go(),qo(0),Do(1,cx,3,0,"button",0)),2&t&&(Qr(1),Fo("ngIf",e.dismissible))},directives:[Bh],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),t})(),Cx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Sx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbButtonLabel",""]],hostVars:8,hostBindings:function(t,e){2&t&&ra("btn",!0)("active",e.active)("disabled",e.disabled)("focus",e.focused)}}),t})(),Ex=0,kx=(()=>{class t{constructor(){this._radios=new Set,this._value=null,this.name="ngb-radio-"+Ex++,this.onChange=t=>{},this.onTouched=()=>{}}get disabled(){return this._disabled}set disabled(t){this.setDisabledState(t)}onRadioChange(t){this.writeValue(t.value),this.onChange(t.value)}onRadioValueUpdate(){this._updateRadiosValue()}register(t){this._radios.add(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._disabled=t,this._updateRadiosDisabled()}unregister(t){this._radios.delete(t)}writeValue(t){this._value=t,this._updateRadiosValue()}_updateRadiosValue(){this._radios.forEach(t=>t.updateValue(this._value))}_updateRadiosDisabled(){this._radios.forEach(t=>t.updateDisabled())}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbRadioGroup",""]],hostAttrs:["role","radiogroup"],inputs:{name:"name"},features:[Pa([{provide:ny,useExisting:st(()=>t),multi:!0}])]}),t})(),Ax=(()=>{class t{constructor(t,e,n,i,r){this._group=t,this._label=e,this._renderer=n,this._element=i,this._cd=r,this._value=null,this._group.register(this),this.updateDisabled()}set value(t){this._value=t;const e=t?t.toString():"";this._renderer.setProperty(this._element.nativeElement,"value",e),this._group.onRadioValueUpdate()}set disabled(t){this._disabled=!1!==t,this.updateDisabled()}set focused(t){this._label&&(this._label.focused=t),t||this._group.onTouched()}get checked(){return this._checked}get disabled(){return this._group.disabled||this._disabled}get value(){return this._value}get nameAttr(){return this.name||this._group.name}ngOnDestroy(){this._group.unregister(this)}onChange(){this._group.onRadioChange(this)}updateValue(t){this.value!==t&&this._cd.markForCheck(),this._checked=this.value===t,this._label.active=this._checked}updateDisabled(){this._label.disabled=this.disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(kx),Ro(Sx),Ro(Ga),Ro(za),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["","ngbButton","","type","radio"]],hostVars:3,hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("focus",function(){return e.focused=!0})("blur",function(){return e.focused=!1}),2&t&&xa("checked",e.checked)("disabled",e.disabled)("name",e.nameAttr)},inputs:{value:"value",disabled:"disabled",name:"name"}}),t})(),Dx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Tx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Rx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();var Fx=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown",t}({});const Lx=(t,e)=>!!e&&e.some(e=>e.contains(t)),Mx=(t,e)=>!e||null!=function(t,e){return e?void 0===t.closest?null:t.closest(e):null}(t,e),Ix="undefined"!=typeof navigator&&!!navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));function $x(t,e,n,i,r,s,o,a){var l;n&&t.runOutsideAngular((l=()=>{const l=Ow(e,"keydown").pipe(Yw(r),Af(t=>t.which===Fx.Escape),ng(t=>t.preventDefault())),c=Ow(e,"mousedown").pipe(k(t=>{const e=t.target;return 2!==t.button&&!Lx(e,o)&&("inside"===n?Lx(e,s)&&Mx(e,a):"outside"===n?!Lx(e,s):Mx(e,a)||!Lx(e,s))}),Yw(r)),h=Ow(e,"mouseup").pipe(Zw(c),Af(([t,e])=>e),sx(0),Yw(r));Vw([l.pipe(k(t=>0)),h.pipe(k(t=>1))]).subscribe(e=>t.run(()=>i(e)))},Ix?()=>setTimeout(()=>l(),100):l))}const Ox=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function Px(t){const e=Array.from(t.querySelectorAll(Ox)).filter(t=>-1!==t.tabIndex);return[e[0],e[e.length-1]]}const Nx=/\s+/,Bx=new class{getAllStyles(t){return window.getComputedStyle(t)}getStyle(t,e){return this.getAllStyles(t)[e]}isStaticPositioned(t){return"static"===(this.getStyle(t,"position")||"static")}offsetParent(t){let e=t.offsetParent||document.documentElement;for(;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement}position(t,e=!0){let n,i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const e=this.offsetParent(t);n=this.offset(t,!1),e!==document.documentElement&&(i=this.offset(e,!1)),i.top+=e.clientTop,i.left+=e.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(t,e=!0){const n=t.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,r=window.pageXOffset-document.documentElement.clientLeft;let s={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+r,right:n.right+r};return e&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s}positionElements(t,e,n,i){const[r="top",s="center"]=n.split("-"),o=i?this.offset(t,!1):this.position(t,!1),a=this.getAllStyles(e),l=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),h=parseFloat(a.marginLeft),u=parseFloat(a.marginRight);let d=0,p=0;switch(r){case"top":d=o.top-(e.offsetHeight+l+c);break;case"bottom":d=o.top+o.height;break;case"left":p=o.left-(e.offsetWidth+h+u);break;case"right":p=o.left+o.width}switch(s){case"top":d=o.top;break;case"bottom":d=o.top+o.height-e.offsetHeight;break;case"left":p=o.left;break;case"right":p=o.left+o.width-e.offsetWidth;break;case"center":"top"===r||"bottom"===r?p=o.left+o.width/2-e.offsetWidth/2:d=o.top+o.height/2-e.offsetHeight/2}e.style.transform=`translate(${Math.round(p)}px, ${Math.round(d)}px)`;const f=e.getBoundingClientRect(),g=document.documentElement,m=window.innerHeight||g.clientHeight,v=window.innerWidth||g.clientWidth;return f.left>=0&&f.top>=0&&f.right<=v&&f.bottom<=m}};function Ux(t,e,n,i,r){let s=Array.isArray(n)?n:n.split(Nx);const o=["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"],a=e.classList,l=t=>{const[e,n]=t.split("-"),i=[];return r&&(i.push(`${r}-${e}`),n&&i.push(`${r}-${e}-${n}`),i.forEach(t=>{a.add(t)})),i};r&&o.forEach(t=>{a.remove(`${r}-${t}`)});let c=s.findIndex(t=>"auto"===t);c>=0&&o.forEach(function(t){null==s.find(e=>-1!==e.search("^"+t))&&s.splice(c++,1,t)});const h=e.style;h.position="absolute",h.top="0",h.left="0",h["will-change"]="transform";let u=null,d=!1;for(u of s){let n=l(u);if(Bx.positionElements(t,e,u,i)){d=!0;break}r&&n.forEach(t=>{a.remove(t)})}return d||(u=s[0],l(u),Bx.positionElements(t,e,u,i)),u}new Date(1882,10,12),new Date(2174,10,25);let Vx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,Cb]]}),t})(),Hx=(()=>{class t{constructor(){this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),jx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["",8,"navbar"]]}),t})(),zx=(()=>{class t{constructor(t){this.elementRef=t,this._disabled=!1}set disabled(t){this._disabled=""===t||!0===t}get disabled(){return this._disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownItem",""]],hostAttrs:[1,"dropdown-item"],hostVars:2,hostBindings:function(t,e){2&t&&ra("disabled",e.disabled)},inputs:{disabled:"disabled"}}),t})(),Wx=(()=>{class t{constructor(t,e){this.dropdown=t,this.placement="bottom",this.isOpen=!1,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownMenu",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,zx,!1),2&t){let t;ic(t=lc())&&(e.menuItems=t)}},hostVars:5,hostBindings:function(t,e){1&t&&Vo("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Enter",function(t){return e.dropdown.onKeyDown(t)})("keydown.Space",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&(ko("x-placement",e.placement),ra("dropdown-menu",!0)("show",e.dropdown.isOpen()))}}),t})(),Gx=(()=>{class t{constructor(t,e){this.dropdown=t,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownAnchor",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){2&t&&ko("aria-expanded",e.dropdown.isOpen())}}),t})(),qx=(()=>{class t extends Gx{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownToggle",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){1&t&&Vo("click",function(){return e.dropdown.toggle()})("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&ko("aria-expanded",e.dropdown.isOpen())},features:[Pa([{provide:Gx,useExisting:st(()=>t)}]),po]}),t})(),Kx=(()=>{class t{constructor(t,e,n,i,r,s,o){this._changeDetector=t,this._document=n,this._ngZone=i,this._elementRef=r,this._renderer=s,this._closed$=new C,this._bodyContainer=null,this._open=!1,this.openChange=new Wl,this.placement=e.placement,this.container=e.container,this.autoClose=e.autoClose,this.display=o?"static":"dynamic",this._zoneSubscription=i.onStable.subscribe(()=>{this._positionMenu()})}ngAfterContentInit(){this._ngZone.onStable.pipe(zf(1)).subscribe(()=>{this._applyPlacementClasses(),this._open&&this._setCloseHandlers()})}ngOnChanges(t){t.container&&this._open&&this._applyContainer(this.container),t.placement&&!t.placement.isFirstChange&&this._applyPlacementClasses()}isOpen(){return this._open}open(){this._open||(this._open=!0,this._applyContainer(this.container),this.openChange.emit(!0),this._setCloseHandlers(),this._anchor&&this._anchor.nativeElement.focus())}_setCloseHandlers(){$x(this._ngZone,this._document,this.autoClose,t=>{this.close(),0===t&&this._anchor.nativeElement.focus()},this._closed$,this._menu?[this._menu.nativeElement]:[],this._anchor?[this._anchor.nativeElement]:[],".dropdown-item,.dropdown-divider")}close(){this._open&&(this._open=!1,this._resetContainer(),this._closed$.next(),this.openChange.emit(!1),this._changeDetector.markForCheck())}toggle(){this.isOpen()?this.close():this.open()}ngOnDestroy(){this._resetContainer(),this._closed$.next(),this._zoneSubscription.unsubscribe()}onKeyDown(t){const e=t.which,n=this._getMenuElements();let i=-1,r=null;const s=this._isEventFromToggle(t);if(!s&&n.length&&n.forEach((e,n)=>{e.contains(t.target)&&(r=e),e===this._document.activeElement&&(i=n)}),e!==Fx.Space&&e!==Fx.Enter){if(e!==Fx.Tab){if(s||r){if(this.open(),n.length){switch(e){case Fx.ArrowDown:i=Math.min(i+1,n.length-1);break;case Fx.ArrowUp:if(this._isDropup()&&-1===i){i=n.length-1;break}i=Math.max(i-1,0);break;case Fx.Home:i=0;break;case Fx.End:i=n.length-1}n[i].focus()}t.preventDefault()}}else if(t.target&&this.isOpen()&&this.autoClose){if(this._anchor.nativeElement===t.target)return void("body"!==this.container||t.shiftKey?t.shiftKey&&this.close():(this._renderer.setAttribute(this._menu.nativeElement,"tabindex","0"),this._menu.nativeElement.focus(),this._renderer.removeAttribute(this._menu.nativeElement,"tabindex")));if("body"===this.container){const e=this._menu.nativeElement.querySelectorAll(Ox);t.shiftKey&&t.target===e[0]?(this._anchor.nativeElement.focus(),t.preventDefault()):t.shiftKey||t.target!==e[e.length-1]||(this._anchor.nativeElement.focus(),this.close())}else Ow(t.target,"focusout").pipe(zf(1)).subscribe(({relatedTarget:t})=>{this._elementRef.nativeElement.contains(t)||this.close()})}}else!r||!0!==this.autoClose&&"inside"!==this.autoClose||Ow(r,"click").pipe(zf(1)).subscribe(()=>this.close())}_isDropup(){return this._elementRef.nativeElement.classList.contains("dropup")}_isEventFromToggle(t){return this._anchor.nativeElement.contains(t.target)}_getMenuElements(){const t=this._menu;return null==t?[]:t.menuItems.filter(t=>!t.disabled).map(t=>t.elementRef.nativeElement)}_positionMenu(){const t=this._menu;this.isOpen()&&t&&this._applyPlacementClasses("dynamic"===this.display?Ux(this._anchor.nativeElement,this._bodyContainer||this._menu.nativeElement,this.placement,"body"===this.container):this._getFirstPlacement(this.placement))}_getFirstPlacement(t){return Array.isArray(t)?t[0]:t.split(" ")[0]}_resetContainer(){const t=this._renderer;if(this._menu){const e=this._menu.nativeElement;t.appendChild(this._elementRef.nativeElement,e),t.removeStyle(e,"position"),t.removeStyle(e,"transform")}this._bodyContainer&&(t.removeChild(this._document.body,this._bodyContainer),this._bodyContainer=null)}_applyContainer(t=null){if(this._resetContainer(),"body"===t){const t=this._renderer,e=this._menu.nativeElement,n=this._bodyContainer=this._bodyContainer||t.createElement("div");t.setStyle(n,"position","absolute"),t.setStyle(e,"position","static"),t.setStyle(n,"z-index","1050"),t.appendChild(n,e),t.appendChild(this._document.body,n)}}_applyPlacementClasses(t){const e=this._menu;if(e){t||(t=this._getFirstPlacement(this.placement));const n=this._renderer,i=this._elementRef.nativeElement;n.removeClass(i,"dropup"),n.removeClass(i,"dropdown"),e.placement="static"===this.display?null:t;const r=-1!==t.search("^top")?"dropup":"dropdown";n.addClass(i,r);const s=this._bodyContainer;s&&(n.removeClass(s,"dropup"),n.removeClass(s,"dropdown"),n.addClass(s,r))}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl),Ro(Hx),Ro(ph),Ro(Ic),Ro(za),Ro(Ga),Ro(jx,8))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdown",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Wx,!0),ac(n,Gx,!0)),2&t){let t;ic(t=lc())&&(e._menu=t.first),ic(t=lc())&&(e._anchor=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("show",e.isOpen())},inputs:{_open:["open","_open"],placement:"placement",container:"container",autoClose:"autoClose",display:"display"},outputs:{openChange:"openChange"},exportAs:["ngbDropdown"],features:[le]}),t})(),Xx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Yx=(()=>{class t{constructor(t){this.backdrop=!0,this.keyboard=!0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();class Jx{constructor(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}}class Qx{constructor(t,e,n,i,r,s,o){this._type=t,this._injector=e,this._viewContainerRef=n,this._renderer=i,this._ngZone=r,this._componentFactoryResolver=s,this._applicationRef=o,this._windowRef=null,this._contentRef=null}open(t,e,n=!1){this._windowRef||(this._contentRef=this._getContentRef(t,e),this._windowRef=this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type),this._viewContainerRef.length,this._injector,this._contentRef.nodes));const{nativeElement:i}=this._windowRef.location,r=this._ngZone.onStable.asObservable().pipe(zf(1)).pipe(U(()=>this._ngZone.run(()=>yx(i,({classList:t})=>t.add("show"),{animation:n,runningTransition:"continue"}))));return{windowRef:this._windowRef,transition$:r}}close(t=!1){return this._windowRef?yx(this._windowRef.location.nativeElement,({classList:t})=>t.remove("show"),{animation:t,runningTransition:"stop"}).pipe(ng(()=>{var t;this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null),(null===(t=this._contentRef)||void 0===t?void 0:t.viewRef)&&(this._applicationRef.detachView(this._contentRef.viewRef),this._contentRef.viewRef.destroy(),this._contentRef=null)})):ff(void 0)}_getContentRef(t,e){if(t){if(t instanceof yl){const n=t.createEmbeddedView(e);return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}return new Jx([[this._renderer.createText(""+t)]])}return new Jx([])}}const Zx=()=>{};let t_=(()=>{class t{constructor(t){this._document=t}compensate(){const t=this._getWidth();return this._isPresent(t)?this._adjustBody(t):Zx}_adjustBody(t){const e=this._document.body,n=e.style.paddingRight,i=parseFloat(window.getComputedStyle(e)["padding-right"]);return e.style["padding-right"]=i+t+"px",()=>e.style["padding-right"]=n}_isPresent(t){const e=this._document.body.getBoundingClientRect();return window.innerWidth-(e.left+e.right)>=t-.1*t}_getWidth(){const t=this._document.createElement("div");t.className="modal-scrollbar-measure";const e=this._document.body;e.appendChild(t);const n=t.getBoundingClientRect().width-t.clientWidth;return e.removeChild(t),n}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return new t(bi(ph))},token:t,providedIn:"root"}),t})(),e_=(()=>{class t{constructor(t,e){this._el=t,this._zone=e}ngOnInit(){this._zone.onStable.asObservable().pipe(zf(1)).subscribe(()=>{yx(this._el.nativeElement,({classList:t})=>t.add("show"),{animation:this.animation,runningTransition:"continue"})})}hide(){return yx(this._el.nativeElement,({classList:t})=>t.remove("show"),{animation:this.animation,runningTransition:"stop"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:6,hostBindings:function(t,e){2&t&&(sa("modal-backdrop"+(e.backdropClass?" "+e.backdropClass:"")),ra("show",!e.animation)("fade",e.animation))},inputs:{animation:"animation",backdropClass:"backdropClass"},decls:0,vars:0,template:function(t,e){},encapsulation:2}),t})();class n_{close(t){}dismiss(t){}}class i_{constructor(t,e,n,i){this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,this._beforeDismiss=i,this._closed=new C,this._dismissed=new C,this._hidden=new C,t.instance.dismissEvent.subscribe(t=>{this.dismiss(t)}),this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}get closed(){return this._closed.asObservable().pipe(Yw(this._hidden))}get dismissed(){return this._dismissed.asObservable().pipe(Yw(this._hidden))}get hidden(){return this._hidden.asObservable()}get shown(){return this._windowCmptRef.instance.shown.asObservable()}close(t){this._windowCmptRef&&(this._closed.next(t),this._resolve(t),this._removeModalElements())}_dismiss(t){this._dismissed.next(t),this._reject(t),this._removeModalElements()}dismiss(t){if(this._windowCmptRef)if(this._beforeDismiss){const e=this._beforeDismiss();e&&e.then?e.then(e=>{!1!==e&&this._dismiss(t)},()=>{}):!1!==e&&this._dismiss(t)}else this._dismiss(t)}_removeModalElements(){const t=this._windowCmptRef.instance.hide(),e=this._backdropCmptRef?this._backdropCmptRef.instance.hide():ff(void 0);t.subscribe(()=>{const{nativeElement:t}=this._windowCmptRef.location;t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._contentRef=null}),e.subscribe(()=>{if(this._backdropCmptRef){const{nativeElement:t}=this._backdropCmptRef.location;t.parentNode.removeChild(t),this._backdropCmptRef.destroy(),this._backdropCmptRef=null}}),zw(t,e).subscribe(()=>{this._hidden.next(),this._hidden.complete()})}}var r_=function(t){return t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC",t}({});let s_=(()=>{class t{constructor(t,e,n){this._document=t,this._elRef=e,this._zone=n,this._closed$=new C,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new Wl,this.shown=new C,this.hidden=new C}dismiss(t){this.dismissEvent.emit(t)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){this._show()}ngOnDestroy(){this._disableEventHandling()}hide(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"stop"},n=zw(yx(t,()=>t.classList.remove("show"),e),yx(this._dialogEl.nativeElement,()=>{},e));return n.subscribe(()=>{this.hidden.next(),this.hidden.complete()}),this._disableEventHandling(),this._restoreFocus(),n}_show(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"continue"};zw(yx(t,()=>t.classList.add("show"),e),yx(this._dialogEl.nativeElement,()=>{},e)).subscribe(()=>{this.shown.next(),this.shown.complete()}),this._enableEventHandling(),this._setFocus()}_enableEventHandling(){const{nativeElement:t}=this._elRef;this._zone.runOutsideAngular(()=>{Ow(t,"keydown").pipe(Yw(this._closed$),Af(t=>t.which===Fx.Escape)).subscribe(t=>{this.keyboard?requestAnimationFrame(()=>{t.defaultPrevented||this._zone.run(()=>this.dismiss(r_.ESC))}):"static"===this.backdrop&&this._bumpBackdrop()});let e=!1;Ow(this._dialogEl.nativeElement,"mousedown").pipe(Yw(this._closed$),ng(()=>e=!1),Vf(()=>Ow(t,"mouseup").pipe(Yw(this._closed$),zf(1))),Af(({target:e})=>t===e)).subscribe(()=>{e=!0}),Ow(t,"click").pipe(Yw(this._closed$)).subscribe(({target:n})=>{t===n&&("static"===this.backdrop?this._bumpBackdrop():!0!==this.backdrop||e||this._zone.run(()=>this.dismiss(r_.BACKDROP_CLICK))),e=!1})})}_disableEventHandling(){this._closed$.next()}_setFocus(){const{nativeElement:t}=this._elRef;if(!t.contains(document.activeElement)){const e=t.querySelector("[ngbAutofocus]"),n=Px(t)[0];(e||n||t).focus()}}_restoreFocus(){const t=this._document.body,e=this._elWithFocus;let n;n=e&&e.focus&&t.contains(e)?e:t,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null})}_bumpBackdrop(){"static"===this.backdrop&&yx(this._elRef.nativeElement,({classList:t})=>(t.add("modal-static"),()=>t.remove("modal-static")),{animation:this.animation,runningTransition:"continue"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(ph),Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-window"]],viewQuery:function(t,e){if(1&t&&rc(ux,!0),2&t){let t;ic(t=lc())&&(e._dialogEl=t.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:7,hostBindings:function(t,e){2&t&&(ko("aria-modal",!0)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),sa("modal d-block"+(e.windowClass?" "+e.windowClass:"")),ra("fade",e.animation))},inputs:{backdrop:"backdrop",keyboard:"keyboard",animation:"animation",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:hx,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0,1),Mo(2,"div",2),qo(3),Io(),Io()),2&t&&sa("modal-dialog"+(e.size?" modal-"+e.size:"")+(e.centered?" modal-dialog-centered":"")+(e.scrollable?" modal-dialog-scrollable":""))},styles:["ngb-modal-window .component-host-scrollable{-ms-flex-direction:column;display:-ms-flexbox;display:flex;flex-direction:column;overflow:hidden}"],encapsulation:2}),t})(),o_=(()=>{class t{constructor(t,e,n,i,r,s){this._applicationRef=t,this._injector=e,this._document=n,this._scrollBar=i,this._rendererFactory=r,this._ngZone=s,this._activeWindowCmptHasChanged=new C,this._ariaHiddenValues=new Map,this._backdropAttributes=["animation","backdropClass"],this._modalRefs=[],this._windowAttributes=["animation","ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new Wl,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const t=this._windowCmpts[this._windowCmpts.length-1];((t,e,n,i=!1)=>{this._ngZone.runOutsideAngular(()=>{const t=Ow(e,"focusin").pipe(Yw(n),k(t=>t.target));Ow(e,"keydown").pipe(Yw(n),Af(t=>t.which===Fx.Tab),Zw(t)).subscribe(([t,n])=>{const[i,r]=Px(e);n!==i&&n!==e||!t.shiftKey||(r.focus(),t.preventDefault()),n!==r||t.shiftKey||(i.focus(),t.preventDefault())}),i&&Ow(e,"click").pipe(Yw(n),Zw(t),k(t=>t[1])).subscribe(t=>t.focus())})})(0,t.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(t.location.nativeElement)}})}open(t,e,n,i){const r=i.container instanceof HTMLElement?i.container:dx(i.container)?this._document.querySelector(i.container):this._document.body,s=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(s.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!r)throw new Error(`The specified modal container "${i.container||"body"}" was not found in the DOM.`);const l=new n_,c=this._getContentRef(t,i.injector||e,n,l,i);let h=!1!==i.backdrop?this._attachBackdrop(t,r):void 0,u=this._attachWindowComponent(t,r,c),d=new i_(u,c,h,i.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(u),d.result.then(o,o),d.result.then(a,a),l.close=t=>{d.close(t)},l.dismiss=t=>{d.dismiss(t)},this._applyWindowOptions(u.instance,i),1===this._modalRefs.length&&s.addClass(this._document.body,"modal-open"),h&&h.instance&&this._applyBackdropOptions(h.instance,i),d}get activeInstances(){return this._activeInstances}dismissAll(t){this._modalRefs.forEach(e=>e.dismiss(t))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(t,e){let n=t.resolveComponentFactory(e_).create(this._injector);return this._applicationRef.attachView(n.hostView),e.appendChild(n.location.nativeElement),n}_attachWindowComponent(t,e,n){let i=t.resolveComponentFactory(s_).create(this._injector,n.nodes);return this._applicationRef.attachView(i.hostView),e.appendChild(i.location.nativeElement),i}_applyWindowOptions(t,e){this._windowAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_applyBackdropOptions(t,e){this._backdropAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_getContentRef(t,e,n,i,r){return n?n instanceof yl?this._createFromTemplateRef(n,i):"string"==typeof n?this._createFromString(n):this._createFromComponent(t,e,n,i,r):new Jx([])}_createFromTemplateRef(t,e){const n=t.createEmbeddedView({$implicit:e,close(t){e.close(t)},dismiss(t){e.dismiss(t)}});return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}_createFromString(t){const e=this._document.createTextNode(""+t);return new Jx([[e]])}_createFromComponent(t,e,n,i,r){const s=t.resolveComponentFactory(n),o=ho.create({providers:[{provide:n_,useValue:i}],parent:e}),a=s.create(o),l=a.location.nativeElement;return r.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(a.hostView),new Jx([[l]],a.hostView,a)}_setAriaHidden(t){const e=t.parentElement;e&&t!==this._document.body&&(Array.from(e.children).forEach(e=>{e!==t&&"SCRIPT"!==e.nodeName&&(this._ariaHiddenValues.set(e,e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),this._setAriaHidden(e))}_revertAriaHidden(){this._ariaHiddenValues.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(t){const e=()=>{const e=this._modalRefs.indexOf(t);e>-1&&(this._modalRefs.splice(e,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(t),this._activeInstances.emit(this._modalRefs),t.result.then(e,e)}_registerWindowCmpt(t){this._windowCmpts.push(t),this._activeWindowCmptHasChanged.next(),t.onDestroy(()=>{const e=this._windowCmpts.indexOf(t);e>-1&&(this._windowCmpts.splice(e,1),this._activeWindowCmptHasChanged.next())})}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(ho),bi(ph),bi(t_),bi(Wa),bi(Ic))},t.\u0275prov=lt({factory:function(){return new t(bi(eh),bi(Ks),bi(ph),bi(t_),bi(Wa),bi(Ic))},token:t,providedIn:"root"}),t})(),a_=(()=>{class t{constructor(t,e,n,i){this._moduleCFR=t,this._injector=e,this._modalStack=n,this._config=i}open(t,e={}){const n=Object.assign({},this._config,e);return this._modalStack.open(this._moduleCFR,this._injector,t,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(t){this._modalStack.dismissAll(t)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return t.\u0275fac=function(e){return new(e||t)(bi(Ua),bi(ho),bi(o_),bi(Yx))},t.\u0275prov=lt({factory:function(){return new t(bi(Ua),bi(Ks),bi(o_),bi(Yx))},token:t,providedIn:"root"}),t})(),l_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[a_]}),t})(),c_=(()=>{class t{constructor(t){this.destroyOnHide=!0,this.orientation="horizontal",this.roles="tablist",this.keyboard=!1,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const h_=t=>dx(t)&&""!==t;let u_=0,d_=(()=>{class t{constructor(t){this.templateRef=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["ng-template","ngbNavContent",""]]}),t})(),p_=(()=>{class t{constructor(t,e){this.elementRef=e,this.disabled=!1,this.shown=new Wl,this.hidden=new Wl,this._nav=t}ngAfterContentChecked(){this.contentTpl=this.contentTpls.first}ngOnInit(){dx(this.domId)||(this.domId="ngb-nav-"+u_++)}get active(){return this._nav.activeId===this.id}get id(){return h_(this._id)?this._id:this.domId}get panelDomId(){return this.domId+"-panel"}isPanelInDom(){return(dx(this.destroyOnHide)?!this.destroyOnHide:!this._nav.destroyOnHide)||this.active}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>f_)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNavItem",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,d_,!1),2&t){let t;ic(t=lc())&&(e.contentTpls=t)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("nav-item",!0)},inputs:{disabled:"disabled",domId:"domId",destroyOnHide:"destroyOnHide",_id:["ngbNavItem","_id"]},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbNavItem"]}),t})(),f_=(()=>{class t{constructor(t,e,n,i){this.role=t,this._cd=n,this._document=i,this.activeIdChange=new Wl,this.shown=new Wl,this.hidden=new Wl,this.destroy$=new C,this.navItemChange$=new C,this.navChange=new Wl,this.animation=e.animation,this.destroyOnHide=e.destroyOnHide,this.orientation=e.orientation,this.roles=e.roles,this.keyboard=e.keyboard}click(t){t.disabled||this._updateActiveId(t.id)}onKeyDown(t){if("tablist"!==this.roles||!this.keyboard)return;const e=t.which,n=this.links.filter(t=>!t.navItem.disabled),{length:i}=n;let r=-1;if(n.forEach((t,e)=>{t.elRef.nativeElement===this._document.activeElement&&(r=e)}),i){switch(e){case Fx.ArrowLeft:if("vertical"===this.orientation)return;r=(r-1+i)%i;break;case Fx.ArrowRight:if("vertical"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowDown:if("horizontal"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowUp:if("horizontal"===this.orientation)return;r=(r-1+i)%i;break;case Fx.Home:r=0;break;case Fx.End:r=i-1}"changeWithArrows"===this.keyboard&&this.select(n[r].navItem.id),n[r].elRef.nativeElement.focus(),t.preventDefault()}}select(t){this._updateActiveId(t,!1)}ngAfterContentInit(){if(!dx(this.activeId)){const t=this.items.first?this.items.first.id:null;h_(t)&&(this._updateActiveId(t,!1),this._cd.detectChanges())}this.items.changes.pipe(Yw(this.destroy$)).subscribe(()=>this._notifyItemChanged(this.activeId))}ngOnChanges({activeId:t}){t&&!t.firstChange&&this._notifyItemChanged(t.currentValue)}ngOnDestroy(){this.destroy$.next()}_updateActiveId(t,e=!0){if(this.activeId!==t){let n=!1;e&&this.navChange.emit({activeId:this.activeId,nextId:t,preventDefault:()=>{n=!0}}),n||(this.activeId=t,this.activeIdChange.emit(t),this._notifyItemChanged(t))}}_notifyItemChanged(t){this.navItemChange$.next(this._getItemById(t))}_getItemById(t){return this.items&&this.items.find(e=>e.id===t)||null}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(c_),Ro(pl),Ro(ph))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNav",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,p_,!1),ac(n,g_,!0)),2&t){let t;ic(t=lc())&&(e.items=t),ic(t=lc())&&(e.links=t)}},hostVars:6,hostBindings:function(t,e){1&t&&Vo("keydown.arrowLeft",function(t){return e.onKeyDown(t)})("keydown.arrowRight",function(t){return e.onKeyDown(t)})("keydown.arrowDown",function(t){return e.onKeyDown(t)})("keydown.arrowUp",function(t){return e.onKeyDown(t)})("keydown.Home",function(t){return e.onKeyDown(t)})("keydown.End",function(t){return e.onKeyDown(t)}),2&t&&(ko("aria-orientation","vertical"===e.orientation&&"tablist"===e.roles?"vertical":void 0)("role",e.role?e.role:e.roles?"tablist":void 0),ra("nav",!0)("flex-column","vertical"===e.orientation))},inputs:{animation:"animation",destroyOnHide:"destroyOnHide",orientation:"orientation",roles:"roles",keyboard:"keyboard",activeId:"activeId"},outputs:{activeIdChange:"activeIdChange",shown:"shown",hidden:"hidden",navChange:"navChange"},exportAs:["ngbNav"],features:[le]}),t})(),g_=(()=>{class t{constructor(t,e,n,i){this.role=t,this.navItem=e,this.nav=n,this.elRef=i}hasNavItemClass(){return this.navItem.elementRef.nativeElement.nodeType===Node.COMMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(p_),Ro(f_),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["a","ngbNavLink",""]],hostAttrs:["href",""],hostVars:14,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.nav.click(e.navItem),t.preventDefault()}),2&t&&(xa("id",e.navItem.domId),ko("role",e.role?e.role:e.nav.roles?"tab":void 0)("tabindex",e.navItem.disabled?-1:void 0)("aria-controls",e.navItem.isPanelInDom()?e.navItem.panelDomId:null)("aria-selected",e.navItem.active)("aria-disabled",e.navItem.disabled),ra("nav-link",!0)("nav-item",e.hasNavItemClass())("active",e.navItem.active)("disabled",e.navItem.disabled))}}),t})(),m_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),v_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();class y_{constructor(t,e){this.open=t,this.close=e,e||(this.close=t)}isManual(){return"manual"===this.open||"manual"===this.close}}const b_={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]},w_=t=>t>0?sx(t):t=>t;let x_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),__=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),C_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),S_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),E_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),k_=(()=>{class t{constructor(t){this.autoClose=!0,this.placement="auto",this.triggers="hover focus",this.disableTooltip=!1,this.openDelay=0,this.closeDelay=0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})(),A_=0,D_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngb-tooltip-window"]],hostAttrs:["role","tooltip"],hostVars:5,hostBindings:function(t,e){2&t&&(xa("id",e.id),sa("tooltip"+(e.tooltipClass?" "+e.tooltipClass:"")),ra("fade",e.animation))},inputs:{animation:"animation",id:"id",tooltipClass:"tooltipClass"},ngContentSelectors:hx,decls:3,vars:0,consts:[[1,"arrow"],[1,"tooltip-inner"]],template:function(t,e){1&t&&(Go(),$o(0,"div",0),Mo(1,"div",1),qo(2),Io())},styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{bottom:.4rem;top:auto}"],encapsulation:2,changeDetection:0}),t})(),T_=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this._elementRef=t,this._renderer=e,this._ngZone=o,this._document=a,this._changeDetector=l,this.shown=new Wl,this.hidden=new Wl,this._ngbTooltipWindowId="ngb-tooltip-"+A_++,this._windowRef=null,this.animation=s.animation,this.autoClose=s.autoClose,this.placement=s.placement,this.triggers=s.triggers,this.container=s.container,this.disableTooltip=s.disableTooltip,this.tooltipClass=s.tooltipClass,this.openDelay=s.openDelay,this.closeDelay=s.closeDelay,this._popupService=new Qx(D_,n,r,e,this._ngZone,i,c),this._zoneSubscription=o.onStable.subscribe(()=>{this._windowRef&&Ux(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-tooltip")})}set ngbTooltip(t){this._ngbTooltip=t,!t&&this._windowRef&&this.close()}get ngbTooltip(){return this._ngbTooltip}open(t){if(!this._windowRef&&this._ngbTooltip&&!this.disableTooltip){const{windowRef:e,transition$:n}=this._popupService.open(this._ngbTooltip,t,this.animation);this._windowRef=e,this._windowRef.instance.animation=this.animation,this._windowRef.instance.tooltipClass=this.tooltipClass,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),$x(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),n.subscribe(()=>this.shown.emit())}}close(){null!=this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(this.animation).subscribe(()=>{this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck()}))}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=function(t,e,n,i,r,s,o=0,a=0){const l=function(t,e=b_){const n=(t||"").trim();if(0===n.length)return[];const i=n.split(/\s+/).map(t=>t.split(":")).map(t=>{let n=e[t[0]]||t;return new y_(n[0],n[1])}),r=i.filter(t=>t.isManual());if(r.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===r.length&&i.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return i}(n);if(1===l.length&&l[0].isManual())return()=>{};const c=function(t,e,n,i){return new y(r=>{const s=[],o=()=>r.next(!0),a=()=>r.next(!1),l=()=>r.next(!i());return n.forEach(n=>{n.open===n.close?s.push(t.listen(e,n.open,l)):s.push(t.listen(e,n.open,o),t.listen(e,n.close,a))}),()=>{s.forEach(t=>t())}})}(t,e,l,i).pipe(function(t,e,n){return i=>{let r=null;const s=i.pipe(k(t=>({open:t})),Af(t=>{const e=n();return e===t.open||r&&r.open!==e?(r&&r.open!==t.open&&(r=null),!1):(r=t,!0)}),Z());return W(s.pipe(Af(t=>t.open),w_(t)),s.pipe(Af(t=>!t.open),w_(e))).pipe(Af(t=>t===r&&(r=null,t.open!==n())),k(t=>t.open))}}(o,a,i)).subscribe(t=>t?r():s());return()=>c.unsubscribe()}(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({tooltipClass:t}){t&&this.isOpen()&&(this._windowRef.instance.tooltipClass=t.currentValue)}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(ho),Ro(Ua),Ro(El),Ro(k_),Ro(Ic),Ro(ph),Ro(pl),Ro(eh))},t.\u0275dir=Wt({type:t,selectors:[["","ngbTooltip",""]],inputs:{animation:"animation",autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disableTooltip:"disableTooltip",tooltipClass:"tooltipClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbTooltip:"ngbTooltip"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbTooltip"],features:[le]}),t})(),R_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();new Yn("live announcer delay",{providedIn:"root",factory:function(){return 100}});let F_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();const L_=[bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_];let M_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[L_,bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_]}),t})(),I_=(()=>{class t{constructor(){this.restrictedPages=new Map([["users",cw.USER_ROLE_ADMIN],["config",cw.USER_ROLE_DEVELOPER],["modules",cw.USER_ROLE_DEVELOPER],["apiexplorer",cw.USER_ROLE_DEVELOPER]])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function $_(t,e){if(1&t&&(Oo(0,5),Mo(1,"a",27),$o(2,"img",28),Mo(3,"span",12),va(4),Io(),Io(),Po()),2&t){const t=zo().$implicit;Fo("ngbNavItem",t.navItem),Qr(1),Fo("routerLink",t.routerLink),Qr(1),Xo("src","/static/svg/",t.icon,".svg",nr),Qr(2),ya(t.label)}}function O_(t,e){1&t&&$o(0,"hr")}function P_(t,e){if(1&t&&(Do(0,$_,5,4,"ng-container",26),Do(1,O_,1,0,"hr",25)),2&t){const t=e.$implicit;Fo("ngIf",zo().getSessionRole()<=t.minRole),Qr(1),Fo("ngIf",t.separator)}}function N_(t,e){if(1&t&&(Mo(0,"div",29),Mo(1,"h2",30),$o(2,"img",31),va(3,"An error has occurred!"),Io(),Mo(4,"h6",32),va(5),Io(),Mo(6,"p"),va(7,"Please refresh the page to try again."),Io(),Io()),2&t){const t=zo();Qr(5),ya(t.error)}}function B_(t,e){1&t&&(Mo(0,"div",33),$o(1,"img",34),Io())}function U_(t,e){1&t&&$o(0,"router-outlet")}const V_=function(){return["/"]},H_=function(){return["/login"]};let j_=(()=>{class t{constructor(t,e,n,i,r){var s;this.route=t,this.router=e,this.segment=n,this.consoleService=i,this.authService=r,this.loading=!0,this.error="",this.routes=[{navItem:"status",routerLink:["/status"],label:"Status",minRole:cw.USER_ROLE_READONLY,icon:"status"},{navItem:"users",routerLink:["/users"],label:"User Management",minRole:cw.USER_ROLE_ADMIN,icon:"user-management"},{navItem:"config",routerLink:["/config"],label:"Configuration",minRole:cw.USER_ROLE_DEVELOPER,icon:"configuration"},{navItem:"modules",routerLink:["/modules"],label:"Runtime Modules",minRole:cw.USER_ROLE_DEVELOPER,separator:!0,icon:"runtime-modules"},{navItem:"accounts",routerLink:["/accounts"],label:"Accounts",minRole:cw.USER_ROLE_READONLY,icon:"accounts"},{navItem:"groups",routerLink:["/groups"],label:"Groups",minRole:cw.USER_ROLE_READONLY,icon:"groups"},{navItem:"storage",routerLink:["/storage"],label:"Storage",minRole:cw.USER_ROLE_READONLY,icon:"storage"},{navItem:"leaderboards",routerLink:["/leaderboards"],label:"Leaderboards",minRole:cw.USER_ROLE_READONLY,icon:"leaderboard"},{navItem:"chat",routerLink:["/chat"],label:"Chat Messages",minRole:cw.USER_ROLE_READONLY,icon:"chat"},{navItem:"matches",routerLink:["/matches"],label:"Matches",minRole:cw.USER_ROLE_READONLY,icon:"running-matches"},{navItem:"apiexplorer",routerLink:["/apiexplorer"],label:"API Explorer",minRole:cw.USER_ROLE_DEVELOPER,icon:"api-explorer"}],this.loading=!1,this.routerSub=this.router.events.pipe(function(t){let e=arguments.length,n=Aw;E(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);let i=null;e>=2&&(i=arguments[1]);let r=Number.POSITIVE_INFINITY;return e>=3&&(r=arguments[2]),function(e){return e.lift(new Dw(t,i,r,n))}}(2e3)).subscribe(t=>{if(0===t.length)return;const e=t[t.length-1];e instanceof lg&&(this.loading=!0),e instanceof cg&&(this.loading=!1),e instanceof hg&&(this.loading=!1),e instanceof ug&&(this.loading=!1,this.error=e.error)}),this.segmentRouterSub=e.events.pipe((s=(t,e)=>!(e instanceof cg)||t.url===e.url,t=>t.lift(new Iw(s,undefined)))).subscribe(t=>{})}ngOnInit(){this.route.data.subscribe(t=>{this.error=t.error?t.error:""})}getSessionRole(){return this.authService.sessionRole}getUsername(){return this.authService.username}logout(){this.authService.logout().subscribe(()=>{this.router.navigate(["/login"])})}ngOnDestroy(){this.segmentRouterSub.unsubscribe(),this.routerSub.unsubscribe()}onSidebarNavChange(t){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(Db),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:40,vars:11,consts:[[1,"container-fluid"],[1,"row"],["ngbNav","",1,"col-md-2","d-none","d-md-block","sidebar","position-fixed","px-0",3,"navChange"],["sidenav","ngbNav"],[1,"flex-column","text-uppercase"],[3,"ngbNavItem"],[3,"routerLink"],["src","/static/svg/logo.svg","alt","","width","175","height","",1,"logo-full","mx-3","mt-3","mb-1"],["src","/static/svg/logo-icon.svg","alt","","width","32","height","",1,"logo-icon","mx-3","mt-3","mb-1"],["ngFor","",3,"ngForOf"],["href","https://cloud.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/heroiccloud.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"link-text"],["href","https://heroiclabs.com/docs","target","_blank",1,"nav-link"],["src","/static/svg/docs.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://forum.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/forum.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://heroiclabs.com/blog","target","_blank",1,"nav-link"],["src","/static/svg/blog.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"logged-in-as","nav-link","disabled"],["ngbNavLink","","routerLinkActive","active",3,"routerLink","click"],["src","/static/svg/log-out.svg","alt","","width","24","height","",1,"mr-1"],["role","main",1,"ml-sm-auto","col-md-10","col-lg-10","main-extended","px-4","py-4"],["class","mx-auto",4,"ngIf"],["class","loading mx-auto",4,"ngIf"],[4,"ngIf"],[3,"ngbNavItem",4,"ngIf"],["ngbNavLink","","routerLinkActive","active",3,"routerLink"],["alt","","width","24","height","",1,"link-icon","mr-1",3,"src"],[1,"mx-auto"],[1,"pb-2"],["src","/static/svg/red-triangle.svg",1,"mr-2",2,"width","1em","height","1em"],[1,"mr-2","d-inline","font-weight-bold"],[1,"loading","mx-auto"],["src","/static/spinner.svg",1,"p-1","loading"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"nav",2,3),Vo("navChange",function(t){return e.onSidebarNavChange(t)}),Mo(4,"div",4),Oo(5,5),Mo(6,"a",6),$o(7,"img",7),$o(8,"img",8),Io(),Po(),$o(9,"hr"),Do(10,P_,2,2,"ng-template",9),$o(11,"hr"),Mo(12,"a",10),$o(13,"img",11),Mo(14,"span",12),va(15,"Heroic Cloud"),Io(),Io(),Mo(16,"a",13),$o(17,"img",14),Mo(18,"span",12),va(19,"Documentation"),Io(),Io(),Mo(20,"a",15),$o(21,"img",16),Mo(22,"span",12),va(23,"Forum"),Io(),Io(),Mo(24,"a",17),$o(25,"img",18),Mo(26,"span",12),va(27,"Heroic Labs Blog"),Io(),Io(),$o(28,"hr"),Mo(29,"div",19),va(30),Io(),Oo(31,5),Mo(32,"a",20),Vo("click",function(){return e.logout()}),$o(33,"img",21),Mo(34,"span",12),va(35,"Logout"),Io(),Io(),Po(),Io(),Io(),Mo(36,"main",22),Do(37,N_,8,1,"div",23),Do(38,B_,2,0,"div",24),Do(39,U_,1,0,"router-outlet",25),Io(),Io(),Io()),2&t&&(Qr(5),Fo("ngbNavItem","logo"),Qr(1),Fo("routerLink",Ul(9,V_)),Qr(4),Fo("ngForOf",e.routes),Qr(20),ba("Logged in as: ",e.getUsername(),""),Qr(1),Fo("ngbNavItem","logout"),Qr(1),Fo("routerLink",Ul(10,H_)),Qr(5),Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.error&&e.loading),Qr(1),Fo("ngIf",!e.error&&!e.loading))},directives:[f_,p_,Mv,Ph,g_,$v,Bh,Ov],styles:[".nav-link.no-active[_ngcontent-%COMP%]{background-color:initial!important}.nav-item[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-top-color:#708090}.sidebar[_ngcontent-%COMP%]{background-color:#333564;position:fixed;top:0;bottom:0;left:0;z-index:100;font-family:Montserrat,sans-serif;overflow-y:auto}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{color:#fff;font-size:12px;letter-spacing:.1em;opacity:.6;font-weight:500!important}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover{opacity:1;background-color:hsla(0,0%,88.2%,.1)}.sidebar[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-color:#fff;opacity:.2}.active[_ngcontent-%COMP%]{opacity:1}.nav-link.active[_ngcontent-%COMP%]{opacity:1;color:#a69bff}.navbar-collapse[_ngcontent-%COMP%]{letter-spacing:0;text-transform:capitalize}.logo-icon[_ngcontent-%COMP%]{display:none}.link-text[_ngcontent-%COMP%]{padding-left:4px}@media screen and (max-width:1200px){.main-extended[_ngcontent-%COMP%]{width:94.333333%!important;max-width:94.333333%!important;flex:0 0 94.333333%!important}.sidebar[_ngcontent-%COMP%]{min-width:65px!important;width:5.66%!important;max-width:5.66%!important}.sidebar[_ngcontent-%COMP%] .logo-full[_ngcontent-%COMP%]{display:none}.sidebar[_ngcontent-%COMP%] .logo-icon[_ngcontent-%COMP%]{display:block}.sidebar[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{width:30px}.sidebar[_ngcontent-%COMP%] .link-text[_ngcontent-%COMP%], .sidebar[_ngcontent-%COMP%] .logged-in-as[_ngcontent-%COMP%]{display:none}}"]}),t})(),z_=(()=>{class t{constructor(t,e,n){this.authService=t,this.router=e,this.globals=n}canActivate(t,e){return!0}canActivateChild(t,e){const n=this.globals.restrictedPages.get(t.url[0].path);return!(null!==n&&n{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}{}class Y_{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new J_(t,this.dueTime,this.scheduler))}}class J_ extends f{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Q_,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Q_(t){t.debouncedNext()}function Z_(){}var tC=function(t){return null==t?Z_:function(){return this.querySelector(t)}};function eC(){return[]}var nC=function(t){return null==t?eC:function(){return this.querySelectorAll(t)}},iC=function(t){return function(){return this.matches(t)}},rC=function(t){return new Array(t.length)};function sC(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function oC(t,e,n,i,r,s){for(var o,a=0,l=e.length,c=s.length;ae?1:t>=e?0:NaN}sC.prototype={constructor:sC,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var cC="http://www.w3.org/1999/xhtml",hC={svg:"http://www.w3.org/2000/svg",xhtml:cC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},uC=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),hC.hasOwnProperty(e)?{space:hC[e],local:t}:t};function dC(t){return function(){this.removeAttribute(t)}}function pC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fC(t,e){return function(){this.setAttribute(t,e)}}function gC(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function mC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function vC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var yC=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function bC(t){return function(){this.style.removeProperty(t)}}function wC(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xC(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function _C(t,e){return t.style.getPropertyValue(e)||yC(t).getComputedStyle(t,null).getPropertyValue(e)}function CC(t){return function(){delete this[t]}}function SC(t,e){return function(){this[t]=e}}function EC(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function kC(t){return t.trim().split(/^|\s+/)}function AC(t){return t.classList||new DC(t)}function DC(t){this._node=t,this._names=kC(t.getAttribute("class")||"")}function TC(t,e){for(var n=AC(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var zC=function(t){var e=uC(t);return(e.local?jC:HC)(e)};function WC(){return null}function GC(){var t=this.parentNode;t&&t.removeChild(this)}function qC(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function KC(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var XC={},YC=null;function JC(t,e,n){return t=QC(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function QC(t,e,n){return function(i){var r=YC;YC=i;try{t.call(this,this.__data__,e,n)}finally{YC=r}}}function ZC(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function tS(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i=x&&(x=w+1);!(b=v[x])&&++x=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=lC);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s1?this.each((null==e?bC:"function"==typeof e?xC:wC)(t,e,null==n?"":n)):_C(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?CC:"function"==typeof e?EC:SC)(t,e)):this.node()[t]},classed:function(t,e){var n=kC(t+"");if(arguments.length<2){for(var i=AC(this.node()),r=-1,s=n.length;++r=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function fS(t,e){for(var n,i=0,r=t.length;i0)for(var n,i,r=new Array(n),s=0;s>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?US(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?US(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=TS.exec(t))?new jS(e[1],e[2],e[3],1):(e=RS.exec(t))?new jS(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=FS.exec(t))?US(e[1],e[2],e[3],e[4]):(e=LS.exec(t))?US(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=MS.exec(t))?qS(e[1],e[2]/100,e[3]/100,1):(e=IS.exec(t))?qS(e[1],e[2]/100,e[3]/100,e[4]):$S.hasOwnProperty(t)?BS($S[t]):"transparent"===t?new jS(NaN,NaN,NaN,0):null}function BS(t){return new jS(t>>16&255,t>>8&255,255&t,1)}function US(t,e,n,i){return i<=0&&(t=e=n=NaN),new jS(t,e,n,i)}function VS(t){return t instanceof _S||(t=NS(t)),t?new jS((t=t.rgb()).r,t.g,t.b,t.opacity):new jS}function HS(t,e,n,i){return 1===arguments.length?VS(t):new jS(t,e,n,null==i?1:i)}function jS(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function zS(){return"#"+GS(this.r)+GS(this.g)+GS(this.b)}function WS(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function GS(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function qS(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new XS(t,e,n,i)}function KS(t){if(t instanceof XS)return new XS(t.h,t.s,t.l,t.opacity);if(t instanceof _S||(t=NS(t)),!t)return new XS;if(t instanceof XS)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n0&&l<1?0:o,new XS(o,a,l,t.opacity)}function XS(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function YS(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function JS(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}wS(_S,NS,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:OS,formatHex:OS,formatHsl:function(){return KS(this).formatHsl()},formatRgb:PS,toString:PS}),wS(jS,HS,xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zS,formatHex:zS,formatRgb:WS,toString:WS})),wS(XS,function(t,e,n,i){return 1===arguments.length?KS(t):new XS(t,e,n,null==i?1:i)},xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new XS(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new XS(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new jS(YS(t>=240?t-240:t+120,r,i),YS(t,r,i),YS(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var QS=function(t){return function(){return t}};function ZS(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):QS(isNaN(t)?e:t)}var tE=function t(e){var n=function(t){return 1==(t=+t)?ZS:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):QS(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=HS(t)).r,(e=HS(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),o=ZS(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function eE(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1];return JS((n-i/e)*e,i>0?t[i-1]:2*r-s,r,s,is&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:aE(n,i)})),s=hE.lastIndex;return s=0&&e._call.call(null,t),e=e._next;--mE}()}finally{mE=0,function(){for(var t,e,n=rE,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:rE=e);sE=t,RE(i)}(),wE=0}}function TE(){var t=_E.now(),e=t-bE;e>1e3&&(xE-=e,bE=t)}function RE(t){mE||(vE&&(vE=clearTimeout(vE)),t-wE>24?(t<1/0&&(vE=setTimeout(DE,t-_E.now()-xE)),yE&&(yE=clearInterval(yE))):(yE||(bE=_E.now(),yE=setInterval(TE,1e3)),mE=1,CE(DE)))}kE.prototype=AE.prototype={constructor:kE,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?SE():+n)+(null==e?0:+e),this._next||sE===this||(sE?sE._next=this:rE=this,sE=this),this._call=t,this._time=n,RE()},stop:function(){this._call&&(this._call=null,this._time=1/0,RE())}};var FE=function(t,e,n){var i=new kE;return i.restart(function(n){i.stop(),t(n+e)},e=null==e?0:+e,n),i},LE=mS("start","end","cancel","interrupt"),ME=[],IE=function(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(l){var c,h,u,d;if(1!==n.state)return a();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return FE(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c0)throw new Error("too late; already scheduled");return n}function OE(t,e){var n=PE(t,e);if(n.state>3)throw new Error("too late; already running");return n}function PE(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var NE,BE,UE,VE,HE=function(t,e){var n,i,r,s=t.__transition,o=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}},jE=180/Math.PI,zE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},WE=function(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:aE(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:aE(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:aE(t,n)},{i:a-2,x:aE(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?$E:OE;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var gk=lS.prototype.constructor;function mk(t){return function(){this.style.removeProperty(t)}}function vk(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function yk(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&vk(t,s,n)),i}return s._value=e,s}function bk(t){return function(e){this.textContent=t.call(this,e)}}function wk(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&bk(i)),e}return i._value=t,i}var xk=0;function _k(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ck(){return++xk}var Sk=lS.prototype;_k.prototype=(function(t){return lS().transition(t)}).prototype={constructor:_k,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=tC(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;oe?1:t>=e?0:NaN},Qk=function(t){let e=t,n=t;function i(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)<0?i=s+1:r=s}return i}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Jk(t(e),n)}(t)),{left:i,center:function(t,n,r,s){null==r&&(r=0),null==s&&(s=t.length);const o=i(t,n,r,s-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)>0?r=s:i=s+1}return i}}},Zk=Math.sqrt(50),tA=Math.sqrt(10),eA=Math.sqrt(2);function nA(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=Zk?10:s>=tA?5:s>=eA?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=Zk?10:s>=tA?5:s>=eA?2:1)}function iA(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=Zk?r*=10:s>=tA?r*=5:s>=eA&&(r*=2),e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return rA.setTime(+e),sA.setTime(+i),t(rA),t(sA),Math.floor(n(rA,sA))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var aA=oA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});aA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var lA=aA,cA=oA(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),hA=1e3,uA=6e4,dA=36e5;function pA(t){return oA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/6048e5})}var fA=pA(0),gA=(pA(1),pA(2),pA(3),pA(4),pA(5),pA(6),oA(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/864e5,t=>t.getDate()-1)),mA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA-t.getMinutes()*uA)},function(t,e){t.setTime(+t+e*dA)},function(t,e){return(e-t)/dA},function(t){return t.getHours()}),vA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA)},function(t,e){t.setTime(+t+e*uA)},function(t,e){return(e-t)/uA},function(t){return t.getMinutes()}),yA=oA(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*hA)},function(t,e){return(e-t)/hA},function(t){return t.getUTCSeconds()}),bA=oA(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});bA.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?oA(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):bA:null};var wA=bA,xA=new Date,_A=new Date;function CA(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return xA.setTime(+e),_A.setTime(+i),t(xA),t(_A),Math.floor(n(xA,_A))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var SA=864e5,EA=6048e5;function kA(t){return CA(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/EA})}var AA=kA(0),DA=kA(1),TA=(kA(2),kA(3),kA(4)),RA=(kA(5),kA(6),CA(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/SA},function(t){return t.getUTCDate()-1}));function FA(t){return CA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/EA})}var LA=FA(0),MA=FA(1),IA=(FA(2),FA(3),FA(4)),$A=(FA(5),FA(6),CA(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/SA},function(t){return t.getDate()-1})),OA=CA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});OA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var PA=OA,NA=CA(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});NA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var BA=NA;function UA(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function VA(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function HA(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var jA,zA,WA={"-":"",_:" ",0:"0"},GA=/^\s*\d+/,qA=/^%/,KA=/[\\^$*+?|[\]().{}]/g;function XA(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s68?1900:2e3),n+i[0].length):-1}function oD(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function aD(t,e,n){var i=GA.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function lD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function cD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function hD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function uD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function dD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function pD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function fD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function gD(t,e,n){var i=GA.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function mD(t,e,n){var i=qA.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function vD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function yD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function bD(t,e){return XA(t.getDate(),e,2)}function wD(t,e){return XA(t.getHours(),e,2)}function xD(t,e){return XA(t.getHours()%12||12,e,2)}function _D(t,e){return XA(1+$A.count(PA(t),t),e,3)}function CD(t,e){return XA(t.getMilliseconds(),e,3)}function SD(t,e){return CD(t,e)+"000"}function ED(t,e){return XA(t.getMonth()+1,e,2)}function kD(t,e){return XA(t.getMinutes(),e,2)}function AD(t,e){return XA(t.getSeconds(),e,2)}function DD(t){var e=t.getDay();return 0===e?7:e}function TD(t,e){return XA(LA.count(PA(t)-1,t),e,2)}function RD(t){var e=t.getDay();return e>=4||0===e?IA(t):IA.ceil(t)}function FD(t,e){return t=RD(t),XA(IA.count(PA(t),t)+(4===PA(t).getDay()),e,2)}function LD(t){return t.getDay()}function MD(t,e){return XA(MA.count(PA(t)-1,t),e,2)}function ID(t,e){return XA(t.getFullYear()%100,e,2)}function $D(t,e){return XA((t=RD(t)).getFullYear()%100,e,2)}function OD(t,e){return XA(t.getFullYear()%1e4,e,4)}function PD(t,e){var n=t.getDay();return XA((t=n>=4||0===n?IA(t):IA.ceil(t)).getFullYear()%1e4,e,4)}function ND(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+XA(e/60|0,"0",2)+XA(e%60,"0",2)}function BD(t,e){return XA(t.getUTCDate(),e,2)}function UD(t,e){return XA(t.getUTCHours(),e,2)}function VD(t,e){return XA(t.getUTCHours()%12||12,e,2)}function HD(t,e){return XA(1+RA.count(BA(t),t),e,3)}function jD(t,e){return XA(t.getUTCMilliseconds(),e,3)}function zD(t,e){return jD(t,e)+"000"}function WD(t,e){return XA(t.getUTCMonth()+1,e,2)}function GD(t,e){return XA(t.getUTCMinutes(),e,2)}function qD(t,e){return XA(t.getUTCSeconds(),e,2)}function KD(t){var e=t.getUTCDay();return 0===e?7:e}function XD(t,e){return XA(AA.count(BA(t)-1,t),e,2)}function YD(t){var e=t.getUTCDay();return e>=4||0===e?TA(t):TA.ceil(t)}function JD(t,e){return t=YD(t),XA(TA.count(BA(t),t)+(4===BA(t).getUTCDay()),e,2)}function QD(t){return t.getUTCDay()}function ZD(t,e){return XA(DA.count(BA(t)-1,t),e,2)}function tT(t,e){return XA(t.getUTCFullYear()%100,e,2)}function eT(t,e){return XA((t=YD(t)).getUTCFullYear()%100,e,2)}function nT(t,e){return XA(t.getUTCFullYear()%1e4,e,4)}function iT(t,e){var n=t.getUTCDay();return XA((t=n>=4||0===n?TA(t):TA.ceil(t)).getUTCFullYear()%1e4,e,4)}function rT(){return"+0000"}function sT(){return"%"}function oT(t){return+t}function aT(t){return Math.floor(+t/1e3)}jA=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,c=JA(r),h=QA(r),u=JA(s),d=QA(s),p=JA(o),f=QA(o),g=JA(a),m=QA(a),v=JA(l),y=QA(l),b={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:bD,e:bD,f:SD,g:$D,G:PD,H:wD,I:xD,j:_D,L:CD,m:ED,M:kD,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:oT,s:aT,S:AD,u:DD,U:TD,V:FD,w:LD,W:MD,x:null,X:null,y:ID,Y:OD,Z:ND,"%":sT},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:BD,e:BD,f:zD,g:eT,G:iT,H:UD,I:VD,j:HD,L:jD,m:WD,M:GD,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:oT,s:aT,S:qD,u:KD,U:XD,V:JD,w:QD,W:ZD,x:null,X:null,y:tT,Y:nT,Z:rT,"%":sT},x={a:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y[i[0].toLowerCase()],n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m[i[0].toLowerCase()],n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:cD,e:cD,f:gD,g:sD,G:rD,H:uD,I:uD,j:hD,L:fD,m:lD,M:dD,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=h[i[0].toLowerCase()],n+i[0].length):-1},q:aD,Q:vD,s:yD,S:pD,u:tD,U:eD,V:nD,w:ZA,W:iD,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:sD,Y:rD,Z:oD,"%":mD};function _(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=VA(HA(s.y,0,1))).getUTCDay(),i=r>4||0===r?DA.ceil(i):DA(i),i=RA.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=UA(HA(s.y,0,1))).getDay(),i=r>4||0===r?MA.ceil(i):MA(i),i=$A.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?VA(HA(s.y,0,1)).getUTCDay():UA(HA(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,VA(s)):UA(s)}}function S(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=x[r in WA?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=_(n,b),b.X=_(i,b),b.c=_(e,b),w.x=_(n,w),w.X=_(i,w),w.c=_(e,w),{format:function(t){var e=_(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=C(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=C(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),zA=jA.format;var lT=function(t){return null===t?NaN:+t};const cT=Qk(Jk).right;Qk(lT);var hT=cT,uT=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function dT(t){return+t}var pT=[0,1];function fT(t){return t}function gT(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function mT(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r(e=o[l-1])&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?vT:mT,r=s=null,u}function u(e){return isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(c(e)))}return u.invert=function(n){return c(e((s||(s=i(a,o.map(t),aE)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,dT),h()):o.slice()},u.range=function(t){return arguments.length?(a=Array.from(t),h()):a.slice()},u.rangeRound=function(t){return a=Array.from(t),l=uT,h()},u.clamp=function(t){return arguments.length?(c=!!t||fT,h()):c!==fT},u.interpolate=function(t){return arguments.length?(l=t,h()):l},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,i){return t=n,e=i,h()}}()(fT,fT)}function wT(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var xT=31536e6;function _T(t){return new Date(t)}function CT(t){return t instanceof Date?+t:+new Date(+t)}function ST(t,e,n,i,r,s,o,a,l){var c=bT(),h=c.invert,u=c.domain,d=l(".%L"),p=l(":%S"),f=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),v=l("%b %d"),y=l("%B"),b=l("%Y"),w=[[o,1,1e3],[o,5,5e3],[o,15,15e3],[o,30,3e4],[s,1,6e4],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,xT]];function x(a){return(o(a)=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AT(t){if(!(e=kT.exec(t)))throw new Error("invalid format: "+t);var e;return new DT({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function DT(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function TT(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}AT.prototype=DT.prototype,DT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var RT,FT,LT,MT,IT=function(t){return(t=TT(Math.abs(t)))?t[1]:NaN},$T=function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},OT={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return $T(100*t,e)},r:$T,s:function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(RT=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+TT(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},PT=function(t){return t},NT=Array.prototype.map,BT=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function UT(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),s=new Array(r=Math.ceil(e-t+1));++a0;){if((r=nA(l,c,n))===i)return s[o]=l,s[a]=c,e(s);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function VT(){var t=bT();return t.copy=function(){return yT(t,VT())},wT.apply(t,arguments),UT(t)}FT=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?PT:(e=NT.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?PT:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(NT.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=AT(t)).fill,n=t.align,u=t.sign,d=t.symbol,p=t.zero,f=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):OT[y]||(void 0===m&&(m=12),v=!0,y="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?s:/[%p]/.test(y)?l:"",x=OT[y],_=/[defgprs%]/.test(y);function C(t){var r,s,l,d=b,C=w;if("c"===y)C=x(t)+C,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==u&&(S=!1),d=(S?"("===u?u:c:"-"===u||"("===u?"":u)+d,C=("s"===y?BT[8+RT/3]:"")+C+(S&&"("===u?")":""),_)for(r=-1,s=t.length;++r(l=t.charCodeAt(r))||l>57){C=(46===l?o+t.slice(r+1):t.slice(r))+C,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var E=d.length+t.length+C.length,k=E>1)+d+t+C+k.slice(E);break;default:t=k+d+t+C}return a(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return t+""},C}return{format:u,formatPrefix:function(t,e){var n=u(((t=AT(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(IT(e)/3))),r=Math.pow(10,-i),s=BT[8+i/3];return function(t){return n(r*t)+s}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),LT=FT.format,MT=FT.formatPrefix;var HT=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,s=Math.floor(r),o=+n(t[s],s,t);return o+(+n(t[s+1],s+1,t)-o)*(r-s)}}function XT(){var t,e=[],n=[],i=[];function r(){var t=0,r=Math.max(1,n.length);for(i=new Array(r-1);++t0?i[r-1]:e[0],rtR)if(Math.abs(h*a-l*c)>tR&&r){var d=n-s,p=i-o,f=a*a+l*l,g=d*d+p*p,m=Math.sqrt(f),v=Math.sqrt(u),y=r*Math.tan((QT-Math.acos((f+u-g)/(2*m*v)))/2),b=y/v,w=y/m;Math.abs(b-1)>tR&&(this._+="L"+(t+b*c)+","+(e+b*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,c=e+a,h=1^s,u=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>tR||Math.abs(this._y1-c)>tR)&&(this._+="L"+l+","+c),n&&(u<0&&(u=u%ZT+ZT),u>eR?this._+="A"+n+","+n+",0,1,"+h+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>tR&&(this._+="A"+n+","+n+",0,"+ +(u>=QT)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var rR=iR,sR=function(t){return function(){return t}};function oR(t){return t[0]}function aR(t){return t[1]}var lR=function(){var t=oR,e=aR,n=sR(!0),i=null,r=JT,s=null;function o(o){var a,l,c,h=o.length,u=!1;for(null==i&&(s=r(c=rR())),a=0;a<=h;++a)!(a=h;--u)a.point(m[u],v[u]);a.lineEnd(),a.areaEnd()}g&&(m[c]=+t(d,c,l),v[c]=+n(d,c,l),a.point(e?+e(d,c,l):m[c],i?+i(d,c,l):v[c]))}if(p)return a=null,p+""||null}function c(){return lR().defined(r).curve(o).context(s)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:sR(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:sR(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:sR(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:sR(+t),l):i},l.lineX0=l.lineY0=function(){return c().x(t).y(n)},l.lineY1=function(){return c().x(t).y(i)},l.lineX1=function(){return c().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:sR(!!t),l):r},l.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),l):o},l.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),l):s},l},hR=function(){};function uR(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function dR(t,e){this._context=t,this._k=(1-e)/6}function pR(t,e){this._context=t,this._k=(1-e)/6}function fR(t){this._curve=t}dR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:uR(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new dR(t,e)}return n.tension=function(e){return t(+e)},n}(0),pR.prototype={areaStart:hR,areaEnd:hR,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new pR(t,e)}return n.tension=function(e){return t(+e)},n}(0),fR.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Math,Math,Math,Math,Math,Math,Math,Math;var gR=function(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(i-e)/t.value;++a=0;)e+=n[i].value;else e=1;t.value=e}function yR(t,e){var n,i,r,s,o,a=new _R(t),l=+t.value&&(a.value=t.value),c=[a];for(null==e&&(e=bR);n=c.pop();)if(l&&(n.value=+n.data.value),(r=e(n.data))&&(o=r.length))for(n.children=new Array(o),s=o-1;s>=0;--s)c.push(i=n.children[s]=new _R(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(xR)}function bR(t){return t.children}function wR(t){t.data=t.data.data}function xR(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _R(t){this.data=t,this.depth=this.height=0,this.parent=null}!function t(e){function n(t,n,i,r,s){!function(t,e,n,i,r,s){for(var o,a,l,c,h,u,d,p,f,g,m,v=[],y=e.children,b=0,w=0,x=y.length,_=e.value;bd&&(d=a),m=h*h*g,(p=Math.max(d/m,m/u))>f){h-=a;break}f=p}v.push(o={value:h,dice:l1?e:1)},n}((1+Math.sqrt(5))/2),_R.prototype=yR.prototype={constructor:_R,count:function(){return this.eachAfter(vR)},each:function(t){var e,n,i,r,s=this,o=[s];do{for(e=o.reverse(),o=[];s=e.pop();)if(t(s),n=s.children)for(i=0,r=n.length;i=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)i.push(e=e.parent);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return yR(this).eachBefore(wR)}};const CR=["caretElm"];function SR(t,e){}const ER=function(t){return{model:t}};function kR(t,e){if(1&t&&(Mo(0,"span"),Do(1,SR,0,0,"ng-template",5),Io()),2&t){const t=zo();Qr(1),Fo("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Vl(2,ER,t.context))}}function AR(t,e){1&t&&$o(0,"span",6),2&t&&Fo("innerHTML",zo().title,er)}function DR(t,e){if(1&t&&(ln(),cn(),$o(0,"ngx-charts-scale-legend",4)),2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("valueRange",t.legendOptions.domain)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)}}function TR(t,e){if(1&t){const t=No();ln(),cn(),Mo(0,"ngx-charts-legend",5),Vo("labelClick",function(e){return Ie(t),zo().legendLabelClick.emit(e)})("labelActivate",function(e){return Ie(t),zo().legendLabelActivate.emit(e)})("labelDeactivate",function(e){return Ie(t),zo().legendLabelDeactivate.emit(e)}),Io()}if(2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("data",t.legendOptions.domain)("title",t.legendOptions.title)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)("activeEntries",t.activeEntries)}}const RR=["*"],FR=["ngx-charts-axis-label",""],LR=["ticksel"],MR=["ngx-charts-x-axis-ticks",""];function IR(t,e){if(1&t&&(ln(),Mo(0,"g",3),Mo(1,"title"),va(2),Io(),Mo(3,"text",4),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("text-anchor",n.textAnchor)("transform",n.textTransform),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function $R(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",6),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),ko("y1",-t.gridLineHeight)}}function OR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,$R,2,2,"g",5),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}const PR=["ngx-charts-x-axis",""];function NR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksHeight(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("rotateTicks",t.rotateTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickStroke",t.tickStroke)("scale",t.xScale)("orient",t.xOrient)("showGridLines",t.showGridLines)("gridLineHeight",t.dims.height)("width",t.dims.width)("tickValues",t.ticks)}}function BR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient","bottom")("height",t.dims.height)("width",t.dims.width)}}const UR=["ngx-charts-y-axis-ticks",""];function VR(t,e){if(1&t&&(ln(),Mo(0,"g",4),Mo(1,"title"),va(2),Io(),Mo(3,"text",5),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("dy",n.dy)("x",n.x1)("y",n.y1)("text-anchor",n.textAnchor),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function HR(t,e){if(1&t&&(ln(),$o(0,"path",6)),2&t){const t=zo();ko("d",t.referenceAreaPath)("transform",t.gridLineTransform())}}function jR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",zo(3).gridLineWidth)}function zR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",-zo(3).gridLineWidth)}function WR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,jR,1,1,"line",8),Do(2,zR,1,1,"line",8),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),Fo("ngIf","left"===t.orient),Qr(1),Fo("ngIf","right"===t.orient)}}function GR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,WR,3,3,"g",7),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}function qR(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"title"),va(2),Io(),Mo(3,"text",11),va(4),Io(),Io()),2&t){const t=zo(2).$implicit,e=zo();Qr(2),ya(e.tickTrim(e.tickFormat(t.value))),Qr(1),ko("dy",e.dy)("y",-6)("x",e.gridLineWidth)("text-anchor",e.textAnchor),Qr(1),ba(" ",t.name," ")}}function KR(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",10),Do(2,qR,5,6,"g",7),Io()),2&t){const t=zo().$implicit,e=zo();ko("transform",e.transform(t.value)),Qr(1),ko("x2",e.gridLineWidth)("transform",e.gridLineTransform()),Qr(1),Fo("ngIf",e.showRefLabels)}}function XR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,KR,3,4,"g",7),Io()),2&t){const t=zo();Qr(1),Fo("ngIf",t.showRefLines)}}const YR=["ngx-charts-y-axis",""];function JR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksWidth(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickValues",t.ticks)("tickStroke",t.tickStroke)("scale",t.yScale)("orient",t.yOrient)("showGridLines",t.showGridLines)("gridLineWidth",t.dims.width)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)("height",t.dims.height)}}function QR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient",t.yOrient)("height",t.dims.height)("width",t.dims.width)}}const ZR=["ngx-charts-circle-series",""];function tF(t,e){if(1&t&&(ln(),$o(0,"rect",4)),2&t){const t=zo(2);Fo("@animationState","active"),ko("x",t.circle.cx-t.circle.radius)("y",t.circle.cy)("width",2*t.circle.radius)("height",t.circle.height)("fill",t.gradientFill)}}const eF=function(t){return{name:t}};function nF(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"defs"),$o(2,"g",1),Io(),Do(3,tF,1,6,"rect",2),Mo(4,"g",3),Vo("select",function(){Ie(t);const e=zo();return e.onClick(e.circle.data)})("activate",function(){return Ie(t),zo().activateCircle()})("deactivate",function(){return Ie(t),zo().deactivateCircle()}),Io(),Io()}if(2&t){const t=zo();Qr(2),Fo("name",t.gradientId)("stops",t.circle.gradientStops),Qr(1),Fo("ngIf",t.barVisible&&"standard"===t.type),Qr(1),ra("active",t.isActive(Vl(18,eF,t.circle.seriesName))),Fo("cx",t.circle.cx)("cy",t.circle.cy)("r",t.circle.radius)("fill",t.circle.color)("pointerEvents",0===t.circle.value?"none":"all")("data",t.circle.value)("classNames",t.circle.classNames)("tooltipDisabled",t.tooltipDisabled)("tooltipPlacement","top")("tooltipType","tooltip")("tooltipTitle",t.tooltipTemplate?void 0:t.getTooltipText(t.circle))("tooltipTemplate",t.tooltipTemplate)("tooltipContext",t.circle.data)}}const iF=["ngx-charts-circle",""],rF=["ngx-charts-svg-linear-gradient",""];function sF(t,e){if(1&t&&(ln(),$o(0,"stop")),2&t){const t=e.$implicit;ia("stop-color",t.color)("stop-opacity",t.opacity),ko("offset",t.offset+"%")}}const oF=["ngx-charts-area",""];function aF(t,e){if(1&t&&(ln(),Mo(0,"defs"),$o(1,"g",2),Io()),2&t){const t=zo();Qr(1),Fo("name",t.gradientId)("stops",t.gradientStops)}}const lF=["tooltipAnchor"],cF=["ngx-charts-tooltip-area",""];function hF(t,e){if(1&t&&(Mo(0,"div",6),$o(1,"span",7),va(2),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),ia("background-color",t.color),Qr(1),ba(" ",n.getToolTipText(t)," ")}}function uF(t,e){if(1&t&&(ln(),cn(),Mo(0,"div",4),Do(1,hF,3,3,"div",5),Io()),2&t){const t=e.model;Qr(1),Fo("ngForOf",t)}}const dF=["ngx-charts-timeline",""];function pF(t,e){if(1&t&&(Mo(0,"header",4),Mo(1,"span",5),va(2),Io(),Io()),2&t){const t=zo();Qr(2),ya(t.title)}}function fF(t,e){if(1&t){const t=No();Mo(0,"li",6),Mo(1,"ngx-charts-legend-entry",7),Vo("select",function(e){return Ie(t),zo().labelClick.emit(e)})("activate",function(e){return Ie(t),zo().activate(e)})("deactivate",function(e){return Ie(t),zo().deactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(1),Fo("label",t.label)("formattedLabel",t.formattedLabel)("color",t.color)("isActive",n.isActive(t))}}const gF=["tooltipTemplate"],mF=["seriesTooltipTemplate"],vF=function(t,e){return[t,e]},yF=["ngx-charts-line",""];function bF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",7),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateXAxisHeight(e)}),Io()}if(2&t){const t=zo();Fo("xScale",t.xScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showXAxisLabel)("labelText",t.xAxisLabel)("trimTicks",t.trimXAxisTicks)("rotateTicks",t.rotateXAxisTicks)("maxTickLength",t.maxXAxisTickLength)("tickFormatting",t.xAxisTickFormatting)("ticks",t.xAxisTicks)}}function wF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",8),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateYAxisWidth(e)}),Io()}if(2&t){const t=zo();Fo("yScale",t.yScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showYAxisLabel)("labelText",t.yAxisLabel)("trimTicks",t.trimYAxisTicks)("maxTickLength",t.maxYAxisTickLength)("tickFormatting",t.yAxisTickFormatting)("ticks",t.yAxisTicks)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)}}function xF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",9),Io()),2&t){const t=e.$implicit,n=zo();Fo("@animationState","active"),Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("activeEntries",n.activeEntries)("scaleType",n.scaleType)("curve",n.curve)("rangeFillOpacity",n.rangeFillOpacity)("hasRange",n.hasRange)("animations",n.animations)}}function _F(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"g",13),Vo("select",function(e){return Ie(t),zo(2).onClick(e)})("activate",function(e){return Ie(t),zo(2).onActivate(e)})("deactivate",function(e){return Ie(t),zo(2).onDeactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("visibleValue",n.hoveredVertical)("activeEntries",n.activeEntries)("tooltipDisabled",n.tooltipDisabled)("tooltipTemplate",n.tooltipTemplate)}}function CF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",10),Vo("mouseleave",function(){return Ie(t),zo().hideCircles()}),Mo(1,"g",11),Vo("hover",function(e){return Ie(t),zo().updateHoveredVertical(e)}),Io(),Do(2,_F,2,9,"g",12),Io()}if(2&t){const t=zo();Qr(1),Fo("dims",t.dims)("xSet",t.xSet)("xScale",t.xScale)("yScale",t.yScale)("results",t.results)("colors",t.colors)("tooltipDisabled",t.tooltipDisabled)("tooltipTemplate",t.seriesTooltipTemplate),Qr(1),Fo("ngForOf",t.results)}}function SF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",15),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.timelineXScale)("yScale",n.timelineYScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("curve",n.curve)("hasRange",n.hasRange)("animations",n.animations)}}function EF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",14),Vo("onDomainChange",function(e){return Ie(t),zo().updateDomain(e)}),Do(1,SF,2,8,"g",4),Io()}if(2&t){const t=zo();Fo("results",t.results)("view",Hl(10,vF,t.timelineWidth,t.height))("height",t.timelineHeight)("scheme",t.scheme)("customColors",t.customColors)("scaleType",t.scaleType)("legend",t.legend),ko("transform",t.timelineTransform),Qr(1),Fo("ngForOf",t.results)("ngForTrackBy",t.trackBy)}}const kF=["ngx-charts-line-series",""];function AF(t,e){if(1&t&&(ln(),$o(0,"g",4)),2&t){const t=zo();Fo("name",t.gradientId)("stops",t.gradientStops)}}function DF(t,e){if(1&t&&(ln(),$o(0,"g",5)),2&t){const t=zo();ra("active",t.isActive(t.data))("inactive",t.isInactive(t.data)),Fo("data",t.data)("path",t.outerPath)("fill",t.hasGradient?t.gradientUrl:t.colors.getColor(t.data.name))("opacity",t.rangeFillOpacity)("animations",t.animations)}}let TF=(()=>{class t{constructor(t,e,n){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n}static setGlobalRootViewContainer(e){t.globalRootViewContainer=e}getRootViewContainer(){if(this._container)return this._container;if(t.globalRootViewContainer)return t.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(t){this._container=t}getComponentRootNode(t){return t.element?t.element.nativeElement:t.hostView&&t.hostView.rootNodes.length>0?t.hostView.rootNodes[0]:t.location.nativeElement}getRootViewContainerNode(t){return this.getComponentRootNode(t)}projectComponentBindings(t,e){if(e){if(void 0!==e.inputs){const n=Object.getOwnPropertyNames(e.inputs);for(const i of n)t.instance[i]=e.inputs[i]}if(void 0!==e.outputs){const n=Object.getOwnPropertyNames(e.outputs);for(const i of n)t.instance[i]=e.outputs[i]}}return t}appendComponent(t,e={},n){n||(n=this.getRootViewContainer());const i=this.getComponentRootNode(n),r=new X_(i,this.componentFactoryResolver,this.applicationRef,this.injector),s=new G_(t),o=r.attach(s);return this.projectComponentBindings(o,e),o}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(Ua),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t.globalRootViewContainer=null,t})();function RF(t,e,n){let i,r,s;n=n||{};let o=null,a=0;function l(){a=!1===n.leading?0:+new Date,o=null,s=t.apply(i,r)}return function(){const c=+new Date;a||!1!==n.leading||(a=c);const h=e-(c-a);return i=this,r=arguments,h<=0?(clearTimeout(o),o=null,a=c,s=t.apply(i,r)):o||!1===n.trailing||(o=setTimeout(l,h)),s}}var FF=function(t){return t[t.top="top"]="top",t[t.bottom="bottom"]="bottom",t[t.left="left"]="left",t[t.right="right"]="right",t}({});function LF(t,e,n){return"top"===n?t.top-7:"bottom"===n?t.top+t.height-e.height+7:"center"===n?t.top+t.height/2-e.height/2:void 0}function MF(t,e,n){return"left"===n?t.left-7:"right"===n?t.left+t.width-e.width+7:"center"===n?t.left+t.width/2-e.width/2:void 0}class IF{static calculateVerticalAlignment(t,e,n){let i=LF(t,e,n);return i+e.height>window.innerHeight&&(i=window.innerHeight-e.height),i}static calculateVerticalCaret(t,e,n,i){let r;"top"===i&&(r=t.height/2-n.height/2+7),"bottom"===i&&(r=e.height-t.height/2-n.height/2-7),"center"===i&&(r=e.height/2-n.height/2);const s=LF(t,e,i);return s+e.height>window.innerHeight&&(r+=s+e.height-window.innerHeight),r}static calculateHorizontalAlignment(t,e,n){let i=MF(t,e,n);return i+e.width>window.innerWidth&&(i=window.innerWidth-e.width),i}static calculateHorizontalCaret(t,e,n,i){let r;"left"===i&&(r=t.width/2-n.width/2+7),"right"===i&&(r=e.width-t.width/2-n.width/2-7),"center"===i&&(r=e.width/2-n.width/2);const s=MF(t,e,i);return s+e.width>window.innerWidth&&(r+=s+e.width-window.innerWidth),r}static shouldFlip(t,e,n,i){let r=!1;return"right"===n&&t.left+t.width+e.width+i>window.innerWidth&&(r=!0),"left"===n&&t.left-e.width-i<0&&(r=!0),"top"===n&&t.top-e.height-i<0&&(r=!0),"bottom"===n&&t.top+t.height+e.height+i>window.innerHeight&&(r=!0),r}static positionCaret(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=-7,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.left?(o=e.width,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.top?(s=e.height,o=IF.calculateHorizontalCaret(n,e,i,r)):t===FF.bottom&&(s=-7,o=IF.calculateHorizontalCaret(n,e,i,r)),{top:s,left:o}}static positionContent(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=n.left+n.width+i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.left?(o=n.left-e.width-i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.top?(s=n.top-e.height-i,o=IF.calculateHorizontalAlignment(n,e,r)):t===FF.bottom&&(s=n.top+n.height+i,o=IF.calculateHorizontalAlignment(n,e,r)),{top:s,left:o}}static determinePlacement(t,e,n,i){if(IF.shouldFlip(n,e,t,i)){if(t===FF.right)return FF.left;if(t===FF.left)return FF.right;if(t===FF.top)return FF.bottom;if(t===FF.bottom)return FF.top}return t}}let $F=(()=>{class t{constructor(t,e){this.element=t,this.renderer=e}get cssClasses(){let t="ngx-charts-tooltip-content";return t+=" position-"+this.placement,t+=" type-"+this.type,t+=" "+this.cssClass,t}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){const t=this.element.nativeElement,e=this.host.nativeElement.getBoundingClientRect();if(!e.height&&!e.width)return;const n=t.getBoundingClientRect();this.checkFlip(e,n),this.positionContent(t,e,n),this.showCaret&&this.positionCaret(e,n),setTimeout(()=>this.renderer.addClass(t,"animate"),1)}positionContent(t,e,n){const{top:i,left:r}=IF.positionContent(this.placement,n,e,this.spacing,this.alignment);this.renderer.setStyle(t,"top",i+"px"),this.renderer.setStyle(t,"left",r+"px")}positionCaret(t,e){const n=this.caretElm.nativeElement,i=n.getBoundingClientRect(),{top:r,left:s}=IF.positionCaret(this.placement,e,t,i,this.alignment);this.renderer.setStyle(n,"top",r+"px"),this.renderer.setStyle(n,"left",s+"px")}checkFlip(t,e){this.placement=IF.determinePlacement(this.placement,e,t,this.spacing)}onWindowResize(){this.position()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-tooltip-content"]],viewQuery:function(t,e){if(1&t&&sc(CR,!0),2&t){let t;ic(t=lc())&&(e.caretElm=t.first)}},hostVars:2,hostBindings:function(t,e){1&t&&Vo("resize",function(){return e.onWindowResize()},!1,hr),2&t&&sa(e.cssClasses)},inputs:{placement:"placement",host:"host",showCaret:"showCaret",type:"type",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},decls:6,vars:6,consts:[[3,"hidden"],["caretElm",""],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(t,e){var n;1&t&&(Mo(0,"div"),$o(1,"span",0,1),Mo(3,"div",2),Do(4,kR,2,4,"span",3),Do(5,AR,1,1,"span",4),Io(),Io()),2&t&&(Qr(1),"tooltip-caret position-",n=e.placement,"",la(ri,oa,Ao(Le(),"tooltip-caret position-",n,""),!0),Fo("hidden",!e.showCaret),Qr(3),Fo("ngIf",!e.title),Qr(1),Fo("ngIf",e.title))},directives:[Bh,Gh],styles:[".ngx-charts-tooltip-content{border-radius:3px;display:block;font-weight:400;opacity:0;pointer-events:none!important;position:fixed;z-index:5000}.ngx-charts-tooltip-content.type-popover{background:#fff;border:1px solid #72809b;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);color:#060709;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-bottom:7px solid #fff;border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip{background:rgba(0,0,0,.75);color:#fff;font-size:12px;padding:0 10px;pointer-events:auto;text-align:center}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-bottom:7px solid rgba(0,0,0,.75);border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content .tooltip-label{display:block;font-size:1em;line-height:1em;padding:8px 5px 5px}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.position-right{transform:translate3d(10px,0,0)}.ngx-charts-tooltip-content.position-left{transform:translate3d(-10px,0,0)}.ngx-charts-tooltip-content.position-top{transform:translate3d(0,-10px,0)}.ngx-charts-tooltip-content.position-bottom{transform:translate3d(0,10px,0)}.ngx-charts-tooltip-content.animate{opacity:1;pointer-events:auto;transform:translateZ(0);transition:opacity .3s,transform .3s}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{line-height:1.2em;padding:5px 0;text-align:left}.tooltip-item .tooltip-item-color{border-radius:3px;color:#5b646b;display:inline-block;height:12px;margin-right:5px;width:12px}"],encapsulation:2}),function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);s>3&&o&&Object.defineProperty(e,n,o)}([function(t,e,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,e,{configurable:!0,enumerable:n.enumerable,value:RF(n.value,100,void 0)}),this[e]}}}],t.prototype,"onWindowResize",null),t})(),OF=(()=>{class t extends class{constructor(t){this.injectionService=t,this.defaults={},this.components=new Map}getByType(t=this.type){return this.components.get(t)}create(t){return this.createByType(this.type,t)}createByType(t,e){e=this.assignDefaults(e);const n=this.injectComponent(t,e);return this.register(t,n),n}destroy(t){const e=this.components.get(t.componentType);if(e&&e.length){const n=e.indexOf(t);n>-1&&(e[n].destroy(),e.splice(n,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(t){const e=this.components.get(t);if(e&&e.length){let t=e.length-1;for(;t>=0;)this.destroy(e[t--])}}injectComponent(t,e){return this.injectionService.appendComponent(t,e)}assignDefaults(t){const e=Object.assign({},this.defaults.inputs),n=Object.assign({},this.defaults.outputs);return t.inputs||t.outputs||(t={inputs:t}),e&&(t.inputs=Object.assign(Object.assign({},e),t.inputs)),n&&(t.outputs=Object.assign(Object.assign({},n),t.outputs)),t}register(t,e){this.components.has(t)||this.components.set(t,[]),this.components.get(t).push(e)}}{constructor(t){super(t),this.type=$F}}return t.\u0275fac=function(e){return new(e||t)(bi(TF))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),PF=(()=>{class t{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new Wl,this.legendLabelActivate=new Wl,this.legendLabelDeactivate=new Wl}ngOnChanges(t){this.update()}update(){let t=0;this.showLegend&&(this.legendType=this.getLegendType(),this.legendOptions&&"right"!==this.legendOptions.position||(t="scaleLegend"===this.legendType?1:2)),this.chartWidth=Math.floor(this.view[0]*(12-t)/12),this.legendWidth=this.legendOptions&&"right"!==this.legendOptions.position?this.chartWidth:Math.floor(this.view[0]*t/12)}getLegendType(){return"linear"===this.legendOptions.scaleType?"scaleLegend":"legend"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-chart"]],inputs:{showLegend:"showLegend",animations:"animations",legendType:"legendType",view:"view",legendOptions:"legendOptions",data:"data",legendData:"legendData",colors:"colors",activeEntries:"activeEntries"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},features:[Pa([OF]),le],ngContentSelectors:RR,decls:5,vars:8,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"horizontal","valueRange","colors","height","width",4,"ngIf"],["class","chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0),ln(),Mo(1,"svg",1),qo(2),Io(),Do(3,DR,1,5,"ngx-charts-scale-legend",2),Do(4,TR,1,7,"ngx-charts-legend",3),Io()),2&t&&(ia("width",e.view[0],"px"),Fo("@animationState","active")("@.disabled",!e.animations),Qr(1),ko("width",e.chartWidth)("height",e.view[1]),Qr(2),Fo("ngIf",e.showLegend&&"scaleLegend"===e.legendType),Qr(1),Fo("ngIf",e.showLegend&&"legend"===e.legendType))},directives:function(){return[Bh,fL,dL]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru("500ms 100ms",Lu({opacity:1}))])])]},changeDetection:0}),t})(),NF=(()=>{class t{constructor(t,e){this.element=t,this.zone=e,this.visible=new Wl,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const t=()=>{if(!this.element)return;const{offsetHeight:e,offsetWidth:n}=this.element.nativeElement;e&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t())})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275dir=Wt({type:t,selectors:[["visibility-observer"]],outputs:{visible:"visible"}}),t})(),BF=(()=>{class t{constructor(t,e,n){this.chartElement=t,this.zone=e,this.cd=n,this.scheme="cool",this.schemeType="ordinal",this.animations=!0,this.select=new Wl}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new NF(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(t){this.update()}update(){if(this.results=this.results?this.cloneData(this.results):[],this.view)this.width=this.view[0],this.height=this.view[1];else{const t=this.getContainerDims();t&&(this.width=t.width,this.height=t.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let t,e;const n=this.chartElement.nativeElement;if(null!==n.parentNode){const i=n.parentNode.getBoundingClientRect();t=i.width,e=i.height}return t&&e?{width:t,height:e}:null}formatDates(){for(let t=0;tn.lift(new Y_(t,e))}(200)).subscribe(t=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=t}cloneData(t){const e=[];for(const n of t){const t={name:n.name};if(void 0!==n.value&&(t.value=n.value),void 0!==n.series){t.series=[];for(const e of n.series){const n=Object.assign({},e);t.series.push(n)}}void 0!==n.extra&&(t.extra=JSON.parse(JSON.stringify(n.extra))),e.push(t)}return e}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["base-chart"]],inputs:{scheme:"scheme",schemeType:"schemeType",animations:"animations",results:"results",view:"view",customColors:"customColors"},outputs:{select:"select"},features:[le],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"div")},encapsulation:2}),t})(),UF=(()=>{class t{constructor(t){this.textHeight=25,this.margin=5,this.element=t.nativeElement}ngOnChanges(t){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case"top":case"bottom":this.y=this.offset,this.x=this.width/2;break;case"left":this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case"right":this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)"}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},features:[le],attrs:FR,decls:2,vars:6,template:function(t,e){1&t&&(ln(),Mo(0,"text"),va(1),Io()),2&t&&(ko("stroke-width",e.strokeWidth)("x",e.x)("y",e.y)("text-anchor",e.textAnchor)("transform",e.transform),Qr(1),ba(" ",e.label," "))},encapsulation:2,changeDetection:0}),t})();function VF(t,e=16){return"string"!=typeof t?"number"==typeof t?t+"":"":(t=t.trim()).length<=e?t:t.slice(0,e)+"..."}function HF(t,e){if(t.length>e){const n=[],i=Math.floor(t.length/e);for(let e=0;e{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.dimensionsChanged=new Wl,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor="middle",this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);t!==this.height&&(this.height=t,this.dimensionsChanged.emit({height:t}),setTimeout(()=>this.updateDims()))}update(){const t=this.scale;this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()};const e=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.adjustedScale=this.scale.bandwidth?function(t){return this.scale(t)+.5*this.scale.bandwidth()}:this.scale,this.textTransform="",e&&0!==e?(this.textTransform=`rotate(${e})`,this.textAnchor="end",this.verticalSpacing=10):this.textAnchor="middle",setTimeout(()=>this.updateDims())}getRotationAngle(t){let e=0;this.maxTicksLength=0;for(let s=0;sthis.maxTicksLength&&(this.maxTicksLength=n)}const n=8*Math.min(this.maxTicksLength,this.maxAllowedLength);let i=n;const r=Math.floor(this.width/t.length);for(;i>r&&e>-90;)e-=30,i=Math.cos(e*(Math.PI/180))*n;return e}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(100);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.width/t)}tickTransform(t){return"translate("+this.adjustedScale(t)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",rotateTicks:"rotateTicks",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineHeight:"gridLineHeight",width:"width"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:MR,decls:4,vars:2,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[4,"ngIf"],["y2","0",1,"gridline-path","gridline-path-vertical"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,IR,5,7,"g",1),Io(),Do(3,OR,2,2,"g",2)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.ticks))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),zF=(()=>{class t{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient="bottom",this.xAxisOffset=0,this.dimensionsChanged=new Wl,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5}ngOnChanges(t){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,void 0!==this.xAxisTickCount&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:t}){const e=t+25+5;e!==this.labelOffset&&(this.labelOffset=e,setTimeout(()=>{this.dimensionsChanged.emit({height:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(t,e){if(1&t&&sc(jF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{rotateTicks:"rotateTicks",showGridLines:"showGridLines",xOrient:"xOrient",xAxisOffset:"xAxisOffset",xScale:"xScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickInterval:"xAxisTickInterval",xAxisTickCount:"xAxisTickCount"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:PR,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,NR,1,12,"g",0),Do(2,BR,1,5,"g",1),Io()),2&t&&(ko("class",e.xAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.xScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,jF,UF],encapsulation:2,changeDetection:0}),t})(),WF=(()=>{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.dimensionsChanged=new Wl,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor="middle",this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);t!==this.width&&(this.width=t,this.dimensionsChanged.emit({width:t}),setTimeout(()=>this.updateDims()))}update(){let t;const e="top"===this.orient||"right"===this.orient?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,t=this.scale,this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()},this.adjustedScale=t.bandwidth?function(e){return t(e)+.5*t.bandwidth()}:t,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case"top":case"bottom":this.transform=function(t){return"translate("+this.adjustedScale(t)+",0)"},this.textAnchor="middle",this.y2=this.innerTickSize*e,this.y1=this.tickSpacing*e,this.dy=e<0?"0em":".71em";break;case"left":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="end",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em";break;case"right":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="start",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em"}setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(t=>t.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(t=>t.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=function(t,e,n,i,r,[s,o,a,l]){let c="";return c="M"+[t+r,e],c+="h"+((n=0===(n=Math.floor(n))?1:n)-2*r),c+=o?`a${[r,r]} 0 0 1 ${[r,r]}`:`h${r}v${r}`,c+="v"+((i=0===(i=Math.floor(i))?1:i)-2*r),c+=l?`a${[r,r]} 0 0 1 ${[-r,r]}`:`v${r}h${-r}`,c+="h"+(2*r-n),c+=a?`a${[r,r]} 0 0 1 ${[-r,-r]}`:`h${-r}v${-r}`,c+="v"+(2*r-i),c+=s?`a${[r,r]} 0 0 1 ${[r,-r]}`:`v${-r}h${r}`,c+="z",c}(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(50);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.height/t)}tickTransform(t){return`translate(${this.adjustedScale(t)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:UR,decls:6,vars:4,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[1,"reference-area"],[4,"ngIf"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,VR,5,9,"g",1),Io(),Do(3,HR,1,2,"path",2),Do(4,GR,2,2,"g",3),Do(5,XR,2,1,"g",3)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngIf",e.referenceLineLength>1&&e.refMax&&e.refMin&&e.showRefLines),Qr(1),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.referenceLines))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),GF=(()=>{class t{constructor(){this.showGridLines=!1,this.yOrient="left",this.yAxisOffset=0,this.dimensionsChanged=new Wl,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5}ngOnChanges(t){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),"right"===this.yOrient?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):(this.offset=this.offset,this.transform=`translate(${this.offset} , 0)`),void 0!==this.yAxisTickCount&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:t}){t!==this.labelOffset&&"right"===this.yOrient?(this.labelOffset=t+this.labelOffset,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0)):t!==this.labelOffset&&(this.labelOffset=t,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(t,e){if(1&t&&sc(WF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{showGridLines:"showGridLines",yOrient:"yOrient",yAxisOffset:"yAxisOffset",yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showLabel:"showLabel",labelText:"labelText",yAxisTickInterval:"yAxisTickInterval",yAxisTickCount:"yAxisTickCount",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:YR,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,JR,1,14,"g",0),Do(2,QR,1,5,"g",1),Io()),2&t&&(ko("class",e.yAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.yScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,WF,UF],encapsulation:2,changeDetection:0}),t})(),qF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();var KF=function(t){return t[t.popover="popover"]="popover",t[t.tooltip="tooltip"]="tooltip",t}({}),XF=function(t){return t[t.left="left"]="left",t[t.center="center"]="center",t[t.right="right"]="right",t}({}),YF=function(t){return t[t.all="all"]="all",t[t.focus="focus"]="focus",t[t.mouseover="mouseover"]="mouseover",t}({});let JF=(()=>{class t{constructor(t,e,n){this.tooltipService=t,this.viewContainerRef=e,this.renderer=n,this.tooltipCssClass="",this.tooltipTitle="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=FF.top,this.tooltipAlignment=XF.center,this.tooltipType=KF.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=YF.all,this.tooltipImmediateExit=!1,this.show=new Wl,this.hide=new Wl}get listensForFocus(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.focus}get listensForHover(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.mouseover}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(t){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(t))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(t){if(this.component||this.tooltipDisabled)return;const e=t?0:this.tooltipShowTimeout;clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();const t=this.createBoundOptions();this.component=this.tooltipService.create(t),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},e)}addHideListeners(t){this.mouseEnterContentEvent=this.renderer.listen(t,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(t,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen(document,"click",e=>{t.contains(e.target)||this.hideTooltip()}))}hideTooltip(t=!1){if(!this.component)return;const e=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),t?e():this.timeout=setTimeout(e,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}}return t.\u0275fac=function(e){return new(e||t)(Ro(OF),Ro(El),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-tooltip",""]],hostBindings:function(t,e){1&t&&Vo("focusin",function(){return e.onFocus()})("blur",function(){return e.onBlur()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(t){return e.onMouseLeave(t.target)})("click",function(){return e.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipTitle:"tooltipTitle",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipShowEvent:"tooltipShowEvent",tooltipImmediateExit:"tooltipImmediateExit",tooltipTemplate:"tooltipTemplate",tooltipContext:"tooltipContext"},outputs:{show:"show",hide:"hide"}}),t})(),QF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[TF,OF],imports:[[qh]]}),t})();function ZF(t){return t instanceof Date?t.toLocaleDateString():t.toLocaleString()}function tL(t){return t.toLocaleString().replace(/[&'`"<>]/g,t=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"}[t]))}const eL={};function nL(){let t=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return t="a"+t,eL[t]?nL():(eL[t]=!0,t)}let iL,rL=(()=>{class t{constructor(){this.type="standard",this.tooltipDisabled=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.barVisible=!1}ngOnInit(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`}ngOnChanges(t){this.update()}update(){this.circle=this.getActiveCircle()}getActiveCircle(){const t=this.data.series.findIndex(t=>{const e=t.name;return e&&this.visibleValue&&e.toString()===this.visibleValue.toString()&&void 0!==t.value});if(-1!==t)return this.mapDataPointToCircle(this.data.series[t],t)}mapDataPointToCircle(t,e){const n=this.data.name,i=t.value,r=t.name,s=ZF(r);let o;o=this.xScale("time"===this.scaleType?r:"linear"===this.scaleType?Number(r):r);const a=this.yScale("standard"===this.type?i:t.d1),l=this.yScale.range()[0]-a;let c;return c=this.colors.getColor("linear"===this.colors.scaleType?"standard"===this.type?i:t.d1:n),{classNames:["circle-data-"+e],value:i,label:r,data:Object.assign({},t,{series:n,value:i,name:r}),cx:o,cy:a,radius:5,height:l,tooltipLabel:s,color:c,opacity:1,seriesName:n,gradientStops:this.getGradientStops(c),min:t.min,max:t.max}}getTooltipText({tooltipLabel:t,value:e,seriesName:n,min:i,max:r}){return`\n ${tL(n)} \u2022 ${tL(t)}\n ${e.toLocaleString()}${this.getTooltipMinMaxText(i,r)}\n `}getTooltipMinMaxText(t,e){if(void 0!==t||void 0!==e){let n=" (";return void 0!==t?(void 0===e&&(n+="\u2265"),n+=t.toLocaleString(),void 0!==e&&(n+=" - ")):void 0!==e&&(n+="\u2264"),void 0!==e&&(n+=e.toLocaleString()),n+=")",n}return""}getGradientStops(t){return[{offset:0,color:t,opacity:.2},{offset:100,color:t,opacity:1}]}onClick(t){this.select.emit(t)}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}activateCircle(){this.barVisible=!0,this.activate.emit({name:this.data.name})}deactivateCircle(){this.barVisible=!1,this.circle.opacity=0,this.deactivate.emit({name:this.data.name})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle-series",""]],inputs:{type:"type",tooltipDisabled:"tooltipDisabled",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",visibleValue:"visibleValue",activeEntries:"activeEntries",tooltipTemplate:"tooltipTemplate"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:ZR,decls:1,vars:1,consts:[[4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["class","tooltip-bar",4,"ngIf"],["ngx-charts-circle","","ngx-tooltip","",1,"circle",3,"cx","cy","r","fill","pointerEvents","data","classNames","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","select","activate","deactivate"],[1,"tooltip-bar"]],template:function(t,e){1&t&&Do(0,nF,5,20,"g",0),2&t&&Fo("ngIf",e.circle)},directives:function(){return[Bh,oL,sL,JF]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru(250,Lu({opacity:1}))])])]},changeDetection:0}),t})(),sL=(()=>{class t{constructor(){this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl}onClick(){this.select.emit(this.data)}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}ngOnChanges(t){this.classNames=Array.isArray(this.classNames)?this.classNames.join(" "):"",this.classNames+="circle"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle",""]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{classNames:"classNames",cx:"cx",cy:"cy",r:"r",fill:"fill",stroke:"stroke",data:"data",circleOpacity:"circleOpacity",pointerEvents:"pointerEvents"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:iF,decls:1,vars:8,template:function(t,e){1&t&&(ln(),$o(0,"circle")),2&t&&ko("cx",e.cx)("cy",e.cy)("r",e.r)("fill",e.fill)("stroke",e.stroke)("opacity",e.circleOpacity)("class",e.classNames)("pointer-events",e.pointerEvents)},encapsulation:2,changeDetection:0}),t})(),oL=(()=>{class t{constructor(){this.orientation="vertical"}ngOnChanges(t){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%","horizontal"===this.orientation?this.x2="100%":"vertical"===this.orientation&&(this.y1="100%")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},features:[le],attrs:rF,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(t,e){1&t&&(ln(),Mo(0,"linearGradient",0),Do(1,sF,1,5,"stop",1),Io()),2&t&&(Fo("id",e.name),ko("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2),Qr(1),Fo("ngForOf",e.stops))},directives:[Ph],encapsulation:2,changeDetection:0}),t})(),aL=(()=>{class t{constructor(t){this.opacity=1,this.startOpacity=.5,this.endOpacity=1,this.gradient=!1,this.animations=!0,this.select=new Wl,this.initialized=!1,this.hasGradient=!1,this.element=t.nativeElement}ngOnChanges(t){this.initialized?this.update():(this.loadAnimation(),this.initialized=!0)}update(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl()}loadAnimation(){this.areaPath=this.startingPath,setTimeout(this.update.bind(this),100)}updatePathEl(){const t=cS(this.element).select(".area");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.startOpacity},{offset:100,color:this.fill,opacity:this.endOpacity}]}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-area",""]],inputs:{opacity:"opacity",startOpacity:"startOpacity",endOpacity:"endOpacity",gradient:"gradient",animations:"animations",data:"data",path:"path",startingPath:"startingPath",fill:"fill",activeLabel:"activeLabel",stops:"stops"},outputs:{select:"select"},features:[le],attrs:oF,decls:2,vars:5,consts:[[4,"ngIf"],[1,"area"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"]],template:function(t,e){1&t&&(Do(0,aF,2,2,"defs",0),ln(),$o(1,"path",1)),2&t&&(Fo("ngIf",e.gradient),Qr(1),ia("opacity",e.opacity),ko("d",e.areaPath)("fill",e.gradient?e.gradientFill:e.fill))},directives:[Bh,oL],encapsulation:2,changeDetection:0}),t})();"undefined"!=typeof window?iL=window:"undefined"!=typeof global&&(iL=global);const lL=iL.MouseEvent;function cL(t,e=!1,n=!0){if("function"==typeof lL)return new lL(t,{bubbles:e,cancelable:n});{const i=document.createEvent("MouseEvent");return i.initEvent(t,e,n),i}}let hL=(()=>{class t{constructor(){this.anchorOpacity=0,this.anchorPos=-1,this.anchorValues=[],this.showPercentage=!1,this.tooltipDisabled=!1,this.hover=new Wl}getValues(t){const e=[];for(const n of this.results){const i=n.series.find(e=>e.name.toString()===t.toString());let r=n.name;if(r instanceof Date&&(r=r.toLocaleDateString()),i){const t=i.name;let s,o=i.value;if(this.showPercentage&&(o=(i.d1-i.d0).toFixed(2)+"%"),"linear"===this.colors.scaleType){let t=o;i.d1&&(t=i.d1),s=this.colors.getColor(t)}else s=this.colors.getColor(n.name);const a=Object.assign({},i,{value:o,name:t,series:r,min:i.min,max:i.max,color:s});e.push(a)}}return e}mouseMove(t){const e=t.pageX-t.target.getBoundingClientRect().left,n=this.findClosestPointIndex(e),i=this.xSet[n];if(this.anchorPos=this.xScale(i),this.anchorPos=Math.max(0,this.anchorPos),this.anchorPos=Math.min(this.dims.width,this.anchorPos),this.anchorValues=this.getValues(i),this.anchorPos!==this.lastAnchorPos){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=.7,this.hover.emit({value:i}),this.showTooltip(),this.lastAnchorPos=this.anchorPos}}findClosestPointIndex(t){let e=0,n=this.xSet.length-1,i=Number.MAX_VALUE,r=0;for(;e<=n;){const s=(e+n)/2|0,o=this.xScale(this.xSet[s]),a=Math.abs(o-t);if(at)){i=0,r=s;break}n=s-1}}return r}showTooltip(){const t=cL("mouseenter");this.tooltipAnchor.nativeElement.dispatchEvent(t)}hideTooltip(){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=0,this.lastAnchorPos=-1}getToolTipText(t){let e="";return e+=void 0!==t.series?t.series:"???",e+=": ",void 0!==t.value&&(e+=t.value.toLocaleString()),void 0===t.min&&void 0===t.max||(e+=" (",void 0!==t.min?(void 0===t.max&&(e+="\u2265"),e+=t.min.toLocaleString(),void 0!==t.max&&(e+=" - ")):void 0!==t.max&&(e+="\u2264"),void 0!==t.max&&(e+=t.max.toLocaleString()),e+=")"),e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-tooltip-area",""]],viewQuery:function(t,e){if(1&t&&sc(lF,!0),2&t){let t;ic(t=lc())&&(e.tooltipAnchor=t.first)}},inputs:{showPercentage:"showPercentage",tooltipDisabled:"tooltipDisabled",dims:"dims",xSet:"xSet",xScale:"xScale",yScale:"yScale",results:"results",colors:"colors",tooltipTemplate:"tooltipTemplate"},outputs:{hover:"hover"},attrs:cF,decls:6,vars:18,consts:[["y","0",1,"tooltip-area",2,"opacity","0","cursor","auto",3,"mousemove","mouseleave"],["defaultTooltipTemplate",""],["y","0","ngx-tooltip","",1,"tooltip-anchor",3,"tooltipDisabled","tooltipPlacement","tooltipType","tooltipSpacing","tooltipTemplate","tooltipContext","tooltipImmediateExit"],["tooltipAnchor",""],[1,"area-tooltip-container"],["class","tooltip-item",4,"ngFor","ngForOf"],[1,"tooltip-item"],[1,"tooltip-item-color"]],template:function(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"rect",0),Vo("mousemove",function(t){return e.mouseMove(t)})("mouseleave",function(){return e.hideTooltip()}),Io(),Do(2,uF,2,1,"ng-template",null,1,dc),$o(4,"rect",2,3),Io()),2&t){const t=To(3);Qr(1),ko("x",0)("width",e.dims.width)("height",e.dims.height),Qr(3),ia("opacity",e.anchorOpacity)("pointer-events","none"),Fo("@animationState",0!==e.anchorOpacity?"active":"inactive")("tooltipDisabled",e.tooltipDisabled)("tooltipPlacement","right")("tooltipType","tooltip")("tooltipSpacing",15)("tooltipTemplate",e.tooltipTemplate?e.tooltipTemplate:t)("tooltipContext",e.anchorValues)("tooltipImmediateExit",!0),ko("x",e.anchorPos)("width",1)("height",e.dims.height)}},directives:[JF,Ph],encapsulation:2,data:{animation:[Tu("animationState",[Mu("inactive => active",[Lu({opacity:0}),Ru(250,Lu({opacity:.7}))]),Mu("active => inactive",[Lu({opacity:.7}),Ru(250,Lu({opacity:0}))])])]},changeDetection:0}),t})(),uL=(()=>{class t{constructor(t,e){this.cd=e,this.height=50,this.select=new Wl,this.onDomainChange=new Wl,this.initialized=!1,this.element=t.nativeElement}ngOnChanges(t){this.update(),this.initialized||(this.addBrush(),this.initialized=!0)}update(){this.dims=this.getDims(),this.height=this.dims.height;const t=this.view[1]-this.height;this.xDomain=this.getXDomain(),this.xScale=this.getXScale(),this.brush&&this.updateBrush(),this.transform=`translate(0 , ${t})`,this.filterId="filter"+nL().toString(),this.filter=`url(#${this.filterId})`,this.cd.markForCheck()}getXDomain(){let t=[];for(const n of this.results)for(const e of n.series)t.includes(e.name)||t.push(e.name);let e=[];return"time"===this.scaleType?e=[Math.min(...t),Math.max(...t)]:"linear"===this.scaleType?(t=t.map(t=>Number(t)),e=[Math.min(...t),Math.max(...t)]):e=t,e}getXScale(){let t;return"time"===this.scaleType?t=ET().range([0,this.dims.width]).domain(this.xDomain):"linear"===this.scaleType?t=VT().range([0,this.dims.width]).domain(this.xDomain):"ordinal"===this.scaleType&&(t=qT().range([0,this.dims.width]).padding(.1).domain(this.xDomain)),t}addBrush(){if(this.brush)return;const t=this.height,e=this.view[0];this.brush=function(t){var e,n=qk,i=Gk,r=Kk,s=!0,o=mS("start","brush","end"),a=6;function l(e){var n=e.property("__brush",g).selectAll(".overlay").data([Wk("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Uk.overlay).merge(n).each(function(){var t=Xk(this).extent;cS(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Wk("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Uk.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Uk[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=cS(this),e=Xk(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function h(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new u(t,e,n):i}function u(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(){if((!e||YC.touches)&&i.apply(this,arguments)){var n,r,o,a,l,u,d,p,f,g,m,v=this,y=YC.target.__data__.type,b="selection"===(s&&YC.metaKey?y="overlay":y)?Fk:s&&YC.altKey?Ik:Mk,w=t===Bk?null:jk[y],x=t===Nk?null:zk[y],_=Xk(v),C=_.extent,S=_.selection,E=C[0][0],k=C[0][1],A=C[1][0],D=C[1][1],T=0,R=0,F=w&&x&&s&&YC.shiftKey,L=YC.touches?Pk(YC.changedTouches[0].identifier):gE,M=L(v),I=M,$=h(v,arguments,!0).beforestart();"overlay"===y?(S&&(f=!0),_.selection=S=[[n=t===Bk?E:M[0],o=t===Nk?k:M[1]],[l=t===Bk?A:n,d=t===Nk?D:o]]):(n=S[0][0],o=S[0][1],l=S[1][0],d=S[1][1]),r=n,a=o,u=l,p=d;var O=cS(v).attr("pointer-events","none"),P=O.selectAll(".overlay").attr("cursor",Uk[y]);if(YC.touches)$.moved=B,$.ended=V;else{var N=cS(YC.view).on("mousemove.brush",B,!0).on("mouseup.brush",V,!0);s&&N.on("keydown.brush",H,!0).on("keyup.brush",j,!0),yS(YC.view)}Tk(),HE(v),c.call(v),$.start()}function B(){var t=L(v);!F||g||m||(Math.abs(t[0]-I[0])>Math.abs(t[1]-I[1])?m=!0:g=!0),I=t,f=!0,Rk(),U()}function U(){var t;switch(T=I[0]-M[0],R=I[1]-M[1],b){case Lk:case Fk:w&&(T=Math.max(E-n,Math.min(A-l,T)),r=n+T,u=l+T),x&&(R=Math.max(k-o,Math.min(D-d,R)),a=o+R,p=d+R);break;case Mk:w<0?(T=Math.max(E-n,Math.min(A-n,T)),r=n+T,u=l):w>0&&(T=Math.max(E-l,Math.min(A-l,T)),r=n,u=l+T),x<0?(R=Math.max(k-o,Math.min(D-o,R)),a=o+R,p=d):x>0&&(R=Math.max(k-d,Math.min(D-d,R)),a=o,p=d+R);break;case Ik:w&&(r=Math.max(E,Math.min(A,n-T*w)),u=Math.max(E,Math.min(A,l+T*w))),x&&(a=Math.max(k,Math.min(D,o-R*x)),p=Math.max(k,Math.min(D,d+R*x)))}u0&&(n=r-T),x<0?d=p-R:x>0&&(o=a-R),b=Lk,P.attr("cursor",Uk.selection),U());break;default:return}Rk()}function j(){switch(YC.keyCode){case 16:F&&(g=m=F=!1,U());break;case 18:b===Ik&&(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk,U());break;case 32:b===Lk&&(YC.altKey?(w&&(l=u-T*w,n=r+T*w),x&&(d=p-R*x,o=a+R*x),b=Ik):(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk),P.attr("cursor",Uk[y]),U());break;default:return}Rk()}}function p(){h(this,arguments).moved()}function f(){h(this,arguments).ended()}function g(){var e=this.__brush||{selection:null};return e.extent=Ok(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n){e.selection?e.on("start.brush",function(){h(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){h(this,arguments).end()}).tween("brush",function(){var e=this,i=e.__brush,r=h(e,arguments),s=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=dE(s,o);function l(t){i.selection=1===t&&null===o?null:a(t),c.call(e),r.brush()}return null!==s&&null!==o?l:l(1)}):e.each(function(){var e=this,i=arguments,r=e.__brush,s=t.input("function"==typeof n?n.apply(e,i):n,r.extent),o=h(e,i).beforestart();HE(e),r.selection=null===s?null:s,c.call(e),o.start().brush().end()})},l.clear=function(t){l.move(t,null)},u.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){!function(t,e,n,i){var r=YC;t.sourceEvent=YC,YC=t;try{e.apply(n,i)}finally{YC=r}}(new Dk(l,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Ak(Ok(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ak(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Ak(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(s=!!t,l):s},l.on=function(){var t=o.on.apply(o,arguments);return t===o?l:t},l}(Nk).extent([[0,0],[e,t]]).on("brush end",()=>{const t=(YC.selection||this.xScale.range()).map(this.xScale.invert);this.onDomainChange.emit(t),this.cd.markForCheck()}),cS(this.element).select(".brush").call(this.brush)}updateBrush(){this.brush&&(this.brush.extent([[0,0],[this.view[0],this.height]]),cS(this.element).select(".brush").call(this.brush),cS(this.element).select(".selection").attr("fill",void 0).attr("stroke",void 0).attr("fill-opacity",void 0),this.cd.markForCheck())}getDims(){return{width:this.view[0],height:this.height}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-timeline",""]],inputs:{height:"height",view:"view",state:"state",results:"results",scheme:"scheme",customColors:"customColors",legend:"legend",miniChart:"miniChart",autoScale:"autoScale",scaleType:"scaleType"},outputs:{select:"select",onDomainChange:"onDomainChange"},features:[le],attrs:dF,ngContentSelectors:RR,decls:7,vars:4,consts:[[1,"timeline"],["in","SourceGraphic","type","matrix","values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"],[1,"embedded-chart"],["x","0","y","0",1,"brush-background"],[1,"brush"]],template:function(t,e){1&t&&(Go(),ln(),Mo(0,"g",0),Mo(1,"filter"),$o(2,"feColorMatrix",1),Io(),Mo(3,"g",2),qo(4),Io(),$o(5,"rect",3),$o(6,"g",4),Io()),2&t&&(ko("transform",e.transform),Qr(1),ko("id",e.filterId),Qr(4),ko("width",e.view[0])("height",e.height))},styles:[".timeline .brush-background{fill:rgba(0,0,0,.05)}.timeline .brush .selection{fill:rgba(0,0,0,.1);stroke:#888;stroke-width:1px}.timeline .brush .handle{fill-opacity:0}.timeline .embedded-chart{opacity:.6}"],encapsulation:2,changeDetection:0}),t})(),dL=(()=>{class t{constructor(t){this.cd=t,this.horizontal=!1,this.labelClick=new Wl,this.labelActivate=new Wl,this.labelDeactivate=new Wl,this.legendEntries=[]}ngOnChanges(t){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){const t=[];for(const e of this.data){const n=ZF(e);-1===t.findIndex(t=>t.label===n)&&t.push({label:e,formattedLabel:n,color:this.colors.getColor(e)})}return t}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.label===e.name)}activate(t){this.labelActivate.emit(t)}deactivate(t){this.labelDeactivate.emit(t)}trackBy(t,e){return e.label}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend"]],inputs:{horizontal:"horizontal",data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},features:[le],decls:5,vars:9,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"label","formattedLabel","color","isActive","select","activate","deactivate"]],template:function(t,e){1&t&&(Mo(0,"div"),Do(1,pF,3,1,"header",0),Mo(2,"div",1),Mo(3,"ul",2),Do(4,fF,2,4,"li",3),Io(),Io(),Io()),2&t&&(ia("width",e.width,"px"),Qr(1),Fo("ngIf",(null==e.title?null:e.title.length)>0),Qr(2),ia("max-height",e.height-45,"px"),ra("horizontal-legend",e.horizontal),Qr(1),Fo("ngForOf",e.legendEntries)("ngForTrackBy",e.trackBy))},directives:function(){return[Bh,Ph,pL]},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{font-size:14px;font-weight:700;margin-bottom:5px;margin-left:10px;overflow:hidden;white-space:nowrap}.chart-legend li,.chart-legend ul{list-style:none;margin:0;padding:0}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{background:rgba(0,0,0,.05);border-radius:3px;float:left;line-height:85%;list-style:none;overflow-x:hidden;overflow-y:auto;text-align:left;white-space:nowrap;width:100%}.chart-legend .legend-label{color:#afb7c8;cursor:pointer;font-size:90%;margin:8px}.chart-legend .legend-label:hover{color:#000;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{border-radius:3px;color:#5b646b;display:inline-block;height:15px;margin-right:5px;width:15px}.chart-legend .legend-label-text{font-size:12px;line-height:15px;vertical-align:top;width:calc(100% - 20px)}.chart-legend .legend-label-text,.chart-legend .legend-title-text{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-legend .legend-title-text{line-height:16px;vertical-align:bottom}"],encapsulation:2,changeDetection:0}),t})(),pL=(()=>{class t{constructor(){this.isActive=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.toggle=new Wl}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(t,e){1&t&&Vo("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{isActive:"isActive",color:"color",label:"label",formattedLabel:"formattedLabel"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},decls:4,vars:6,consts:[["tabindex","-1",3,"title","click"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(t,e){1&t&&(Mo(0,"span",0),Vo("click",function(){return e.select.emit(e.formattedLabel)}),Mo(1,"span",1),Vo("click",function(){return e.toggle.emit(e.formattedLabel)}),Io(),Mo(2,"span",2),va(3),Io(),Io()),2&t&&(ra("active",e.isActive),Fo("title",e.formattedLabel),Qr(1),ia("background-color",e.color),Qr(2),ba(" ",e.trimmedLabel," "))},encapsulation:2,changeDetection:0}),t})(),fL=(()=>{class t{constructor(t){this.sanitizer=t,this.horizontal=!1}ngOnChanges(t){const e=this.gradientString(this.colors.range(),this.colors.domain());this.gradient=this.sanitizer.bypassSecurityTrustStyle(`linear-gradient(to ${this.horizontal?"right":"bottom"}, ${e})`)}gradientString(t,e){e.push(1);const n=[];return t.reverse().forEach((t,i)=>{n.push(`${t} ${Math.round(100*e[i])}%`)}),n.join(", ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(_u))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-scale-legend"]],inputs:{horizontal:"horizontal",valueRange:"valueRange",colors:"colors",height:"height",width:"width"},features:[le],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"span"),va(3),Io(),Io(),$o(4,"div",2),Mo(5,"div",1),Mo(6,"span"),va(7),Io(),Io(),Io()),2&t&&(ia("height",e.horizontal?void 0:e.height,"px")("width",e.width,"px"),ra("horizontal-legend",e.horizontal),Qr(3),ya(e.valueRange[1].toLocaleString()),Qr(1),ia("background",e.gradient),Qr(3),ya(e.valueRange[0].toLocaleString()))},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{display:flex;flex-direction:column;text-align:center}.chart-legend .scale-legend-wrap{border-radius:5px;display:inline-block;flex:1;margin:0 auto;width:30px}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{height:30px;margin:0 16px;width:auto}"],encapsulation:2,changeDetection:0}),t})(),gL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,qF,QF],qh,qF,QF]}),t})(),mL=[{name:"vivid",selectable:!0,group:"Ordinal",domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:"Ordinal",domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:"Ordinal",domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:"Ordinal",domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:"Continuous",domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:"Continuous",domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:"Continuous",domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:"Ordinal",domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:"Ordinal",domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:"Ordinal",domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:"Ordinal",domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:"Ordinal",domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:"Ordinal",domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:"Ordinal",domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:"Ordinal",domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}];class vL{constructor(t,e,n,i){"string"==typeof t&&(t=mL.find(e=>e.name===t)),this.colorDomain=t.domain,this.scaleType=e,this.domain=n,this.customColors=i,this.scale=this.generateColorScheme(t,e,this.domain)}generateColorScheme(t,e,n){let i;if("string"==typeof t&&(t=mL.find(e=>e.name===t)),"quantile"===e)i=XT().range(t.domain).domain(n);else if("ordinal"===e)i=zT().range(t.domain).domain(n);else if("linear"===e){const e=[...t.domain];1===e.length&&(e.push(e[0]),this.colorDomain=e);const n=HT(0,1,1/e.length);i=VT().domain(n).range(e)}return i}getColor(t){if(null==t)throw new Error("Value can not be null");if("linear"===this.scaleType){const e=VT().domain(this.domain).range([0,1]);return this.scale(e(t))}{if("function"==typeof this.customColors)return this.customColors(t);const e=t.toString();let n;return this.customColors&&this.customColors.length>0&&(n=this.customColors.find(t=>t.name.toLowerCase()===e.toLowerCase())),n?n.value:this.scale(t)}}getLinearGradientStops(t,e){void 0===e&&(e=this.domain[0]);const n=VT().domain(this.domain).range([0,1]),i=WT().domain(this.colorDomain).range([0,1]),r=this.getColor(t),s=n(e),o=this.getColor(e),a=n(t);let l=1,c=s;const h=[];for(h.push({color:o,offset:s,originalOffset:s,opacity:1});c=(a-i.bandwidth()).toFixed(4))break;h.push({color:t,offset:e,opacity:1}),c=e,l++}}if(h[h.length-1].offset<100&&h.push({color:r,offset:a,opacity:1}),a===s)h[0].offset=0,h[1].offset=100;else if(100!==h[h.length-1].offset)for(const u of h)u.offset=(u.offset-s)/(a-s)*100;return h}}let yL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),bL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),wL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),xL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),_L=(()=>{class t{constructor(t){this.element=t,this.fill="none",this.animations=!0,this.select=new Wl,this.initialized=!1}ngOnChanges(t){this.initialized?this.updatePathEl():(this.initialized=!0,this.initialPath=this.path)}updatePathEl(){const t=cS(this.element.nativeElement).select(".line");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line",""]],inputs:{fill:"fill",animations:"animations",path:"path",stroke:"stroke",data:"data"},outputs:{select:"select"},features:[le],attrs:yF,decls:1,vars:4,consts:[["stroke-width","1.5px",1,"line"]],template:function(t,e){1&t&&(ln(),$o(0,"path",0)),2&t&&(Fo("@animationState","active"),ko("d",e.initialPath)("fill",e.fill)("stroke",e.stroke))},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({strokeDasharray:2e3,strokeDashoffset:2e3}),Ru(1e3,Lu({strokeDashoffset:0}))])])]},changeDetection:0}),t})(),CL=(()=>{class t extends BF{constructor(){super(...arguments),this.legendTitle="Legend",this.legendPosition="right",this.showGridLines=!0,this.curve=JT,this.activeEntries=[],this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.roundDomains=!1,this.tooltipDisabled=!1,this.showRefLines=!1,this.showRefLabels=!0,this.activate=new Wl,this.deactivate=new Wl,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.timelineHeight=50,this.timelinePadding=10}update(){super.update(),this.dims=function({width:t,height:e,margins:n,showXAxis:i=!1,showYAxis:r=!1,xAxisHeight:s=0,yAxisWidth:o=0,showXLabel:a=!1,showYLabel:l=!1,showLegend:c=!1,legendType:h="ordinal",legendPosition:u="right",columns:d=12}){let p=n[3],f=t,g=e-n[0]-n[2];if(c&&"right"===u&&(d-="ordinal"===h?2:1),f=f*d/12,f=f-n[1]-n[3],i&&(g-=5,g-=s,a)&&(g-=30),r&&(f-=5,f-=o,p+=o,p+=10,l)){const t=30;f-=t,p+=t}return f=Math.max(0,f),g=Math.max(0,g),{width:Math.floor(f),height:Math.floor(g),xOffset:Math.floor(p)}}({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.timeline&&(this.dims.height-=this.timelineHeight+this.margin[2]+this.timelinePadding),this.xDomain=this.getXDomain(),this.filteredDomain&&(this.xDomain=this.filteredDomain),this.yDomain=this.getYDomain(),this.seriesDomain=this.getSeriesDomain(),this.xScale=this.getXScale(this.xDomain,this.dims.width),this.yScale=this.getYScale(this.yDomain,this.dims.height),this.updateTimeline(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]})`,this.clipPathId="clip"+nL().toString(),this.clipPath=`url(#${this.clipPathId})`}updateTimeline(){this.timeline&&(this.timelineWidth=this.dims.width,this.timelineXDomain=this.getXDomain(),this.timelineXScale=this.getXScale(this.timelineXDomain,this.timelineWidth),this.timelineYScale=this.getYScale(this.yDomain,this.timelineHeight),this.timelineTransform=`translate(${this.dims.xOffset}, ${-this.margin[2]})`)}getXDomain(){let t=function(t){const e=new Set;for(const n of t)for(const t of n.series)e.add(t.name);return Array.from(e)}(this.results);this.scaleType=function(t,e=!0){return e&&t.every(t=>t instanceof Date)?"time":t.every(t=>"number"==typeof t)?"linear":"ordinal"}(t);let e,n,i=[];return"linear"===this.scaleType&&(t=t.map(t=>Number(t))),"time"!==this.scaleType&&"linear"!==this.scaleType||(e=this.xScaleMin?this.xScaleMin:Math.min(...t),n=this.xScaleMax?this.xScaleMax:Math.max(...t)),"time"===this.scaleType?(i=[new Date(e),new Date(n)],this.xSet=[...t].sort((t,e)=>{const n=t.getTime(),i=e.getTime();return n>i?1:i>n?-1:0})):"linear"===this.scaleType?(i=[e,n],this.xSet=[...t].sort((t,e)=>t-e)):(i=t,this.xSet=t),i}getYDomain(){const t=[];for(const n of this.results)for(const e of n.series)t.indexOf(e.value)<0&&t.push(e.value),void 0!==e.min&&(this.hasRange=!0,t.indexOf(e.min)<0&&t.push(e.min)),void 0!==e.max&&(this.hasRange=!0,t.indexOf(e.max)<0&&t.push(e.max));const e=[...t];return this.autoScale||e.push(0),[this.yScaleMin?this.yScaleMin:Math.min(...e),this.yScaleMax?this.yScaleMax:Math.max(...e)]}getSeriesDomain(){return this.results.map(t=>t.name)}getXScale(t,e){let n;return"time"===this.scaleType?n=ET().range([0,e]).domain(t):"linear"===this.scaleType?(n=VT().range([0,e]).domain(t),this.roundDomains&&(n=n.nice())):"ordinal"===this.scaleType&&(n=qT().range([0,e]).padding(.1).domain(t)),n}getYScale(t,e){const n=VT().range([e,0]).domain(t);return this.roundDomains?n.nice():n}updateDomain(t){this.filteredDomain=t,this.xDomain=this.filteredDomain,this.xScale=this.getXScale(this.xDomain,this.dims.width)}updateHoveredVertical(t){this.hoveredVertical=t.value,this.deactivateAll()}hideCircles(){this.hoveredVertical=null,this.deactivateAll()}onClick(t){this.select.emit(t)}trackBy(t,e){return e.name}setColors(){let t;t="ordinal"===this.schemeType?this.seriesDomain:this.yDomain,this.colors=new vL(this.scheme,this.schemeType,t,this.customColors)}getLegendOptions(){const t={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return"ordinal"===t.scaleType?(t.domain=this.seriesDomain,t.colors=this.colors,t.title=this.legendTitle):(t.domain=this.yDomain,t.colors=this.colors.scale),t}updateYAxisWidth({width:t}){this.yAxisWidth=t,this.update()}updateXAxisHeight({height:t}){this.xAxisHeight=t,this.update()}onActivate(t){this.deactivateAll(),this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value)>-1||(this.activeEntries=[t],this.activate.emit({value:t,entries:this.activeEntries}))}onDeactivate(t){const e=this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value);this.activeEntries.splice(e,1),this.activeEntries=[...this.activeEntries],this.deactivate.emit({value:t,entries:this.activeEntries})}deactivateAll(){this.activeEntries=[...this.activeEntries];for(const t of this.activeEntries)this.deactivate.emit({value:t,entries:[]});this.activeEntries=[]}}return t.\u0275fac=function(e){return SL(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-line-chart"]],contentQueries:function(t,e,n){if(1&t&&(ac(n,gF,!0),ac(n,mF,!0)),2&t){let t;ic(t=lc())&&(e.tooltipTemplate=t.first),ic(t=lc())&&(e.seriesTooltipTemplate=t.first)}},hostBindings:function(t,e){1&t&&Vo("mouseleave",function(){return e.hideCircles()})},inputs:{legendTitle:"legendTitle",legendPosition:"legendPosition",showGridLines:"showGridLines",curve:"curve",activeEntries:"activeEntries",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",roundDomains:"roundDomains",tooltipDisabled:"tooltipDisabled",showRefLines:"showRefLines",showRefLabels:"showRefLabels",legend:"legend",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",autoScale:"autoScale",timeline:"timeline",gradient:"gradient",schemeType:"schemeType",rangeFillOpacity:"rangeFillOpacity",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",referenceLines:"referenceLines",xScaleMin:"xScaleMin",xScaleMax:"xScaleMax",yScaleMin:"yScaleMin",yScaleMax:"yScaleMax"},outputs:{activate:"activate",deactivate:"deactivate"},features:[po],decls:11,vars:20,consts:[[3,"view","showLegend","legendOptions","activeEntries","animations","legendLabelClick","legendLabelActivate","legendLabelDeactivate"],[1,"line-chart","chart"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"mouseleave",4,"ngIf"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange",4,"ngIf"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","activeEntries","scaleType","curve","rangeFillOpacity","hasRange","animations"],[3,"mouseleave"],["ngx-charts-tooltip-area","",3,"dims","xSet","xScale","yScale","results","colors","tooltipDisabled","tooltipTemplate","hover"],[4,"ngFor","ngForOf"],["ngx-charts-circle-series","",3,"xScale","yScale","colors","data","scaleType","visibleValue","activeEntries","tooltipDisabled","tooltipTemplate","select","activate","deactivate"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","scaleType","curve","hasRange","animations"]],template:function(t,e){1&t&&(Mo(0,"ngx-charts-chart",0),Vo("legendLabelClick",function(t){return e.onClick(t)})("legendLabelActivate",function(t){return e.onActivate(t)})("legendLabelDeactivate",function(t){return e.onDeactivate(t)}),ln(),Mo(1,"defs"),Mo(2,"clipPath"),$o(3,"rect"),Io(),Io(),Mo(4,"g",1),Do(5,bF,1,10,"g",2),Do(6,wF,1,12,"g",3),Mo(7,"g"),Do(8,xF,2,11,"g",4),Do(9,CF,3,9,"g",5),Io(),Io(),Do(10,EF,2,13,"g",6),Io()),2&t&&(Fo("view",Hl(17,vF,e.width,e.height))("showLegend",e.legend)("legendOptions",e.legendOptions)("activeEntries",e.activeEntries)("animations",e.animations),Qr(2),ko("id",e.clipPathId),Qr(1),ko("width",e.dims.width+10)("height",e.dims.height+10)("transform","translate(-5, -5)"),Qr(1),ko("transform",e.transform),Qr(1),Fo("ngIf",e.xAxis),Qr(1),Fo("ngIf",e.yAxis),Qr(1),ko("clip-path",e.clipPath),Qr(1),Fo("ngForOf",e.results)("ngForTrackBy",e.trackBy),Qr(1),Fo("ngIf",!e.tooltipDisabled),Qr(1),Fo("ngIf",e.timeline&&"ordinal"!=e.scaleType))},directives:function(){return[PF,Bh,Ph,zF,GF,EL,hL,rL,uL]},styles:[".ngx-charts{float:left;overflow:visible}.ngx-charts .arc,.ngx-charts .bar,.ngx-charts .circle{cursor:pointer}.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .card.active,.ngx-charts .card:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .arc:focus,.ngx-charts .bar:focus,.ngx-charts .card:focus,.ngx-charts .cell:focus{outline:none}.ngx-charts .arc.hidden,.ngx-charts .bar.hidden,.ngx-charts .card.hidden,.ngx-charts .cell.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .area-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .line-series.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .polar-series-path.inactive{opacity:.2;transition:opacity .1s ease-in-out}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:400}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{fill:none;stroke:#ddd;stroke-width:1}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-dasharray:5;stroke-dashoffset:5;stroke-width:1}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill:#000;fill-opacity:.05}.ngx-charts .gridline-path-dotted{fill:none;stroke:#ddd;stroke-dasharray:1,20;stroke-dashoffset:3;stroke-width:1}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:rgba(0,0,0,.05)}"],encapsulation:2,data:{animation:[Tu("animationState",[Mu(":leave",[Lu({opacity:1}),Ru(500,Lu({opacity:0}))])])]},changeDetection:0}),t})();const SL=Gn(CL);let EL=(()=>{class t{constructor(){this.animations=!0}ngOnChanges(t){this.update()}update(){this.updateGradients();const t=this.sortData(this.data.series),e=this.getLineGenerator();this.path=e(t)||"";const n=this.getAreaGenerator();if(this.areaPath=n(t)||"",this.hasRange){const e=this.getRangeGenerator();this.outerPath=e(t)||""}if(this.hasGradient){this.stroke=this.gradientUrl;const t=this.data.series.map(t=>t.value),e=Math.max(...t);e===Math.min(...t)&&(this.stroke=this.colors.getColor(e))}else this.stroke=this.colors.getColor(this.data.name)}getLineGenerator(){return lR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y(t=>this.yScale(t.value)).curve(this.curve)}getRangeGenerator(){return cR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y0(t=>this.yScale("number"==typeof t.min?t.min:t.value)).y1(t=>this.yScale("number"==typeof t.max?t.max:t.value)).curve(this.curve)}getAreaGenerator(){return cR().x(t=>this.xScale(t.name)).y0(()=>this.yScale.range()[0]).y1(t=>this.yScale(t.value)).curve(this.curve)}sortData(t){return"linear"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>"asc"===n?t[e]-i[e]:i[e]-t[e])}(t,"name"):"time"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>{const r=t[e].getTime(),s=i[e].getTime();return"asc"===n?r>s?1:s>r?-1:0:r>s?-1:s>r?1:0})}(t,"name"):function(t,e,n="asc",i){return t.sort((t,r)=>{const s=r[e],o=i.indexOf(t[e]),a=i.indexOf(s);return"asc"===n?o-a:a-o})}(t,"name","asc",this.xScale.domain())}updateGradients(){if("linear"===this.colors.scaleType){this.hasGradient=!0,this.gradientId="grad"+nL().toString(),this.gradientUrl=`url(#${this.gradientId})`;const t=this.data.series.map(t=>t.value),e=Math.max(...t),n=Math.min(...t);this.gradientStops=this.colors.getLinearGradientStops(e,n),this.areaGradientStops=this.colors.getLinearGradientStops(e)}else this.hasGradient=!1,this.gradientStops=void 0,this.areaGradientStops=void 0}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}isInactive(t){return!(!this.activeEntries||0===this.activeEntries.length)&&void 0===this.activeEntries.find(e=>t.name===e.name)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line-series",""]],inputs:{animations:"animations",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",curve:"curve",activeEntries:"activeEntries",rangeFillOpacity:"rangeFillOpacity",hasRange:"hasRange"},features:[le],attrs:kF,decls:6,vars:22,consts:[["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops",4,"ngIf"],["ngx-charts-area","",1,"line-highlight",3,"data","path","fill","opacity","startOpacity","gradient","stops","animations"],["ngx-charts-line","",1,"line-series",3,"data","path","stroke","animations"],["ngx-charts-area","","class","line-series-range",3,"data","path","fill","active","inactive","opacity","animations",4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["ngx-charts-area","",1,"line-series-range",3,"data","path","fill","opacity","animations"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Mo(1,"defs"),Do(2,AF,1,2,"g",0),Io(),$o(3,"g",1),$o(4,"g",2),Do(5,DF,1,9,"g",3),Io()),2&t&&(Qr(2),Fo("ngIf",e.hasGradient),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.areaPath)("fill",e.hasGradient?e.gradientUrl:e.colors.getColor(e.data.name))("opacity",.25)("startOpacity",0)("gradient",!0)("stops",e.areaGradientStops)("animations",e.animations),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.path)("stroke",e.stroke)("animations",e.animations),Qr(1),Fo("ngIf",e.hasRange))},directives:[Bh,aL,_L,oL],encapsulation:2,changeDetection:0}),t})(),kL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})();Math;let AL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),DL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,kL]]}),t})(),TL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),RL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),FL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,bL]]}),t})(),LL=(()=>{class t{constructor(){"undefined"!=typeof SVGElement&&void 0===SVGElement.prototype.contains&&(SVGElement.prototype.contains=HTMLDivElement.prototype.contains)}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[gL,yL,bL,wL,xL,kL,DL,TL,AL,RL,FL]}),t})();function ML(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function IL(t,e){1&t&&$o(0,"img",31)}function $L(t,e){1&t&&$o(0,"img",32)}function OL(t,e){1&t&&$o(0,"img",33)}function PL(t,e){1&t&&$o(0,"img",34)}function NL(t,e){if(1&t&&(Mo(0,"tr",24),Mo(1,"td"),Oo(2,25),Do(3,IL,1,0,"img",26),Do(4,$L,1,0,"img",27),Do(5,OL,1,0,"img",28),Do(6,PL,1,0,"img",29),Po(),Mo(7,"span"),va(8),Io(),Io(),Mo(9,"td"),va(10),Mo(11,"span",30),va(12),Io(),Io(),Mo(13,"td"),va(14),Mo(15,"span",30),va(16),Io(),Io(),Mo(17,"td"),va(18),Mo(19,"span",30),va(20),Io(),Io(),Mo(21,"td"),va(22),Mo(23,"span",30),va(24),Io(),Io(),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(2),Fo("ngSwitch",t.health),Qr(1),Fo("ngSwitchCase",0),Qr(1),Fo("ngSwitchCase",1),Qr(1),Fo("ngSwitchCase",2),Qr(1),Fo("ngSwitchCase",3),Qr(2),ya(t.name),Qr(2),ba("",t.session_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxSessionCount()-t.session_count," delta)"),Qr(2),ba("",t.presence_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxPresenceCount()-t.presence_count," delta)"),Qr(2),ba("",t.match_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxMatchCount()-t.match_count," delta)"),Qr(2),ba("",t.goroutine_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxGoroutineCount()-t.goroutine_count," delta)")}}function BL(t,e){if(1&t&&(Mo(0,"tbody"),Do(1,NL,25,18,"tr",22),Mo(2,"tr",3),$o(3,"td",23),Mo(4,"th",3),va(5),Io(),Mo(6,"th",3),va(7),Io(),Mo(8,"th",3),va(9),Io(),Mo(10,"th",3),va(11),Io(),Io(),Io()),2&t){const t=zo();Qr(1),Fo("ngForOf",t.statusData.nodes),Qr(4),ya(t.getTotalSessionCount()),Qr(2),ya(t.getMaxPresenceCount()),Qr(2),ya(t.getTotalMatchCount()),Qr(2),ya(t.getTotalGorountineCount())}}function UL(t,e){if(1&t&&(Mo(0,"option",35),va(1),Io()),2&t){const t=e.$implicit,n=zo();Ko("value",t),Qr(1),ya(n.ranges[t])}}const VL=function(t){return{"background-color":t}};function HL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function jL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,HL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function zL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",37),Do(2,jL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.latencyGraphData)}}function WL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function GL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,WL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function qL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",43),Do(2,GL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.rateGraphData)}}function KL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function XL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,KL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function YL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",44),Do(2,XL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.inputGraphData)}}function JL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function QL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,JL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function ZL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",45),Do(2,QL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.outputGraphData)}}let tM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.showDelta=!1,this.rateGraphData=[],this.latencyGraphData=[],this.inputGraphData=[],this.outputGraphData=[],this.ranges={1:"last 1 minute",10:"last 10 minutes",30:"last 30 minutes",60:"last 1 hour",1440:"last 24 hours"},this.rangesKeys=Object.keys(this.ranges).map(t=>+t),this.colorScheme={domain:["#5AA454","#E44D25","#1e59cf","#7aa3e5","#a8385d","#d0bd00"]},this.samples=60}ngOnInit(){this.rangeForm=this.formBuilder.group({rangeMinutes:[10]}),this.route.data.subscribe(t=>{this.initData(t[0]),this.refresh(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}refresh(){this.consoleService.getStatus("").subscribe(t=>{this.statusData=t,this.rateGraphData=this.updateData(this.rateGraphData,"avg_rate_sec",t),this.latencyGraphData=this.updateData(this.latencyGraphData,"avg_latency_ms",t),this.inputGraphData=this.updateData(this.inputGraphData,"avg_input_kbs",t),this.outputGraphData=this.updateData(this.outputGraphData,"avg_output_kbs",t)})}generateSeries(){let t=new Date;t.setMilliseconds(0);const e=[];for(let n=0;n({name:t,value:0}))}initData(t){const e=this.generateSeries();this.latencyGraphData=t.map(t=>({name:t,series:e})),this.rateGraphData=t.map(t=>({name:t,series:e})),this.inputGraphData=t.map(t=>({name:t,series:e})),this.outputGraphData=t.map(t=>({name:t,series:e}))}updateData(t,e,n){var i;const r=n.nodes,s=[],o=n.timestamp,a=t.map(t=>t.name),l=r.map(t=>t.name),c=this.diff(a,l);for(const h of t)c.includes(h.name)&&s.push({name:h.name,series:this.shiftData(h.series,0,o)});for(const h of r){let n=[],r={};const a=null===(i=t.find(t=>t.name===h.name))||void 0===i?void 0:i.series;n=this.shiftData(a||this.generateSeries(),h[e],o),r={name:h.name,series:n},s.push(r)}return s}shiftData(t,e,n){const i=t.slice(1);return i.push({name:new Date(n),value:e}),i}getPeriod(){return Math.floor(60*this.f.rangeMinutes.value/this.samples)}setRange(t){this.rangeForm.reset({rangeMinutes:+t.target.value}),this.reset()}reset(){this.consoleService.getStatus("").subscribe(t=>{var e;this.initData(t.nodes.map(t=>t.name)),null===(e=this.$refreshTimer)||void 0===e||e.unsubscribe(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}diff(t,e){const n=new Set(t);for(const i of e)n.delete(i);return Array.from(n)}get f(){return this.rangeForm.controls}ngOnDestroy(){this.$refreshTimer.unsubscribe()}getTotalSessionCount(){return this.statusData.nodes.reduce((t,e)=>t+e.session_count,0)}getMaxSessionCount(){return Math.max(...this.statusData.nodes.map(t=>t.session_count))}getMaxPresenceCount(){return Math.max(...this.statusData.nodes.map(t=>t.presence_count))}getMaxMatchCount(){return Math.max(...this.statusData.nodes.map(t=>t.match_count))}getTotalMatchCount(){return this.statusData.nodes.reduce((t,e)=>t+e.match_count,0)}getMaxGoroutineCount(){return Math.max(...this.statusData.nodes.map(t=>t.goroutine_count))}getTotalGorountineCount(){return this.statusData.nodes.reduce((t,e)=>t+e.goroutine_count,0)}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-status"]],decls:62,vars:10,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"status-table","table","table-sm","table-striped","mb-4",3,"mouseover","mouseout"],[1,"thead-light"],["scope","col"],[4,"ngIf"],[3,"formGroup"],[1,"row","no-gutters","justify-content-end"],[1,"col-12","text-right"],["ngbDropdown","","role","group",1,"btn-group"],["formControlName","rangeMinutes",1,"custom-select","custom-select-sm","ml-3",3,"change"],[3,"value",4,"ngFor","ngForOf"],[1,"row"],[1,"col-6","d-inline-flex","justify-content-between","align-items-center"],[1,"graph-title"],[1,"d-inline"],[1,"col-6"],["class","graph",4,"ngIf"],[1,"row","mt-4"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","clickable",4,"ngFor","ngForOf"],[1,"border-0"],[1,"clickable"],[3,"ngSwitch"],["class","mr-2","src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",4,"ngSwitchCase"],["class","mr-2","src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",4,"ngSwitchCase"],["class","mr-2","src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",4,"ngSwitchCase"],["class","mr-2","src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",4,"ngSwitchCase"],[1,"text-muted","small",3,"hidden"],["src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",1,"mr-2"],["src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",1,"mr-2"],["src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",1,"mr-2"],["src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",1,"mr-2"],[3,"value"],[1,"graph"],["xAxisLabel","Time","yAxisLabel","Latency (ms)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["seriesTooltipTemplate",""],[1,"chart-legend"],[4,"ngFor","ngForOf"],[1,"legend-label-color",3,"ngStyle"],[1,"legend-label-text"],["xAxisLabel","Time","yAxisLabel","Request Count",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Input (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Output (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Status"),Io(),Do(2,ML,4,2,"ngb-alert",1),Mo(3,"table",2),Vo("mouseover",function(){return e.showDelta=!0})("mouseout",function(){return e.showDelta=!1}),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Node name"),Io(),Mo(8,"th",4),va(9,"Sessions"),Io(),Mo(10,"th",4),va(11,"Presences"),Io(),Mo(12,"th",4),va(13,"Authoritative Matches"),Io(),Mo(14,"th",4),va(15,"Goroutines"),Io(),Io(),Io(),Do(16,BL,12,5,"tbody",5),Io(),Mo(17,"form",6),Mo(18,"div",7),Mo(19,"div",8),Mo(20,"span"),va(21,"View:"),Io(),Mo(22,"div",9),Mo(23,"select",10),Vo("change",function(t){return e.setRange(t)}),Do(24,UL,2,2,"option",11),function(t,e){const n=Me();let i;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new ie("302",`The pipe '${t}' could not be found!`)}("sortNumbers",n.pipeRegistry),n.data[45]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(45,i.onDestroy)):i=n.data[45];const r=i.factory||(i.factory=ne(i.type)),s=bt(Ro);try{const t=An(!1),e=r();An(t),function(t,e,n,i){45>=t.data.length&&(t.data[45]=null,t.blueprint[45]=null),e[45]=i}(n,Le(),0,e)}finally{bt(s)}}(),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",12),Mo(27,"div",13),Mo(28,"div",14),Mo(29,"h5",15),va(30,"Processing Latency"),Io(),Mo(31,"small"),va(32," (ms)"),Io(),Io(),Io(),Mo(33,"div",13),Mo(34,"div",14),Mo(35,"h5",15),va(36,"Rate"),Io(),Mo(37,"small"),va(38," (rpc/s)"),Io(),Io(),Io(),Io(),Mo(39,"div",12),Mo(40,"div",16),Do(41,zL,4,12,"div",17),Io(),Mo(42,"div",16),Do(43,qL,4,12,"div",17),Io(),Io(),Mo(44,"div",18),Mo(45,"div",13),Mo(46,"div",14),Mo(47,"h5",15),va(48,"Input"),Io(),Mo(49,"small"),va(50," (kb/s)"),Io(),Io(),Io(),Mo(51,"div",13),Mo(52,"div",14),Mo(53,"h5",15),va(54,"Output"),Io(),Mo(55,"small"),va(56," (kb/s)"),Io(),Io(),Io(),Io(),Mo(57,"div",12),Mo(58,"div",16),Do(59,YL,4,12,"div",17),Io(),Mo(60,"div",16),Do(61,ZL,4,12,"div",17),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(14),Fo("ngIf",e.statusData),Qr(1),Fo("formGroup",e.rangeForm),Qr(7),Fo("ngForOf",function(t,e,n){const i=t+Kt,r=Le(),s=_e(r,i);return function(t,e){return wo.isWrapped(e)&&(e=wo.unwrap(e),t[je()]=Jr),e}(r,function(t,e){return t[1].data[e].pure}(r,i)?zl(r,He(),e,s.transform,n,s):s.transform(n))}(25,8,e.rangesKeys)),Qr(17),Fo("ngIf",e.latencyGraphData.length>0),Qr(2),Fo("ngIf",e.rateGraphData.length>0),Qr(16),Fo("ngIf",e.inputGraphData.length>0),Qr(2),Fo("ngIf",e.outputGraphData.length>0))},directives:function(){return[Bh,pb,Ry,mb,Kx,Uy,Ty,yb,Ph,_x,jh,zh,T_,Vy,Wy,CL,Wh]},pipes:function(){return[nM]},styles:[".graph[_ngcontent-%COMP%]{height:450px;border-radius:5px;border:1px solid #dadae9}.graph-title[_ngcontent-%COMP%]{padding:.5rem .5rem .5rem 0}.table[_ngcontent-%COMP%]{table-layout:fixed}h4[_ngcontent-%COMP%]{margin-bottom:0}.status-table[_ngcontent-%COMP%]{empty-cells:hide}.status-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:500}.status-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border:1px solid #dadae9;padding:.6em 1em}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%]{border:2px solid #dadae9;background-color:#f5f5f5}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:2px solid #dadae9}"]}),t})(),eM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),nM=(()=>{class t{transform(t){return t.sort((t,e)=>t-e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe={type:(e={name:"sortNumbers",type:t,pure:!1}).type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null},t;var e})();var iM=n("ZR4k"),rM=n("Iab2");const sM=["fileSelector"];function oM(t,e){if(1&t&&(Mo(0,"div",8),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.dropZoneLabel)}}function aM(t,e){if(1&t){const t=No();Mo(0,"div"),Mo(1,"input",9),Vo("click",function(e){return Ie(t),zo(2).openFileSelector(e)}),Io(),Io()}if(2&t){const t=zo(2);Qr(1),Ko("value",t.browseBtnLabel),Fo("className",t.browseBtnClassName)}}function lM(t,e){if(1&t&&(Do(0,oM,2,1,"div",6),Do(1,aM,2,2,"div",7)),2&t){const t=zo();Fo("ngIf",t.dropZoneLabel),Qr(1),Fo("ngIf",t.showBrowseBtn)}}function cM(t,e){}const hM=function(t){return{openFileSelector:t}};class uM{constructor(t,e){this.relativePath=t,this.fileEntry=e}}let dM=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-file-drop-content-tmp",""]]}),t})(),pM=(()=>{class t{constructor(t,e){this.zone=t,this.renderer=e,this.accept="*",this.directory=!1,this.multiple=!0,this.dropZoneLabel="",this.dropZoneClassName="ngx-file-drop__drop-zone",this.useDragEnter=!1,this.contentClassName="ngx-file-drop__content",this.showBrowseBtn=!1,this.browseBtnClassName="btn btn-primary btn-xs ngx-file-drop__browse-btn",this.browseBtnLabel="Browse files",this.onFileDrop=new Wl,this.onFileOver=new Wl,this.onFileLeave=new Wl,this.isDraggingOverDropZone=!1,this.globalDraggingInProgress=!1,this.files=[],this.numOfActiveReadEntries=0,this.helperFormEl=null,this.fileInputPlaceholderEl=null,this.dropEventTimerSubscription=null,this._disabled=!1,this.openFileSelector=t=>{this.fileSelector&&this.fileSelector.nativeElement&&this.fileSelector.nativeElement.click()},this.globalDragStartListener=this.renderer.listen("document","dragstart",t=>{this.globalDraggingInProgress=!0}),this.globalDragEndListener=this.renderer.listen("document","dragend",t=>{this.globalDraggingInProgress=!1})}get disabled(){return this._disabled}set disabled(t){this._disabled=null!=t&&""+t!="false"}ngOnDestroy(){this.dropEventTimerSubscription&&(this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=null),this.globalDragStartListener(),this.globalDragEndListener(),this.files=[],this.helperFormEl=null,this.fileInputPlaceholderEl=null}onDragOver(t){this.useDragEnter?this.preventAndStop(t):this.isDropzoneDisabled()||this.useDragEnter||(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragEnter(t){!this.isDropzoneDisabled()&&this.useDragEnter&&(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragLeave(t){this.isDropzoneDisabled()||(this.isDraggingOverDropZone&&(this.isDraggingOverDropZone=!1,this.onFileLeave.emit(t)),this.preventAndStop(t))}dropFiles(t){if(!this.isDropzoneDisabled()&&(this.isDraggingOverDropZone=!1,t.dataTransfer)){let e;t.dataTransfer.dropEffect="copy",e=t.dataTransfer.items?t.dataTransfer.items:t.dataTransfer.files,this.preventAndStop(t),this.checkFiles(e)}}uploadFiles(t){!this.isDropzoneDisabled()&&t.target&&(this.checkFiles(t.target.files||[]),this.resetFileInput())}checkFiles(t){for(let e=0;e{t(n)}},e=new uM(t.name,t);this.addToQueue(e)}}this.dropEventTimerSubscription&&this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=Bw(200,200).subscribe(()=>{if(this.files.length>0&&0===this.numOfActiveReadEntries){const t=this.files;this.files=[],this.onFileDrop.emit(t)}})}traverseFileTree(t,e){if(t.isFile){const n=new uM(e,t);this.files.push(n)}else{e+="/";const n=t.createReader();let i=[];const r=()=>{this.numOfActiveReadEntries++,n.readEntries(n=>{if(n.length)i=i.concat(n),r();else if(0===i.length){const n=new uM(e,t);this.zone.run(()=>{this.addToQueue(n)})}else for(let t=0;t{this.traverseFileTree(i[t],e+i[t].name)});this.numOfActiveReadEntries--})};r()}}resetFileInput(){if(this.fileSelector&&this.fileSelector.nativeElement){const t=this.fileSelector.nativeElement,e=t.parentElement,n=this.getHelperFormElement(),i=this.getFileInputPlaceholderElement();e!==n&&(this.renderer.insertBefore(e,i,t),this.renderer.appendChild(n,t),n.reset(),this.renderer.insertBefore(e,t,i),this.renderer.removeChild(e,i))}}getHelperFormElement(){return this.helperFormEl||(this.helperFormEl=this.renderer.createElement("form")),this.helperFormEl}getFileInputPlaceholderElement(){return this.fileInputPlaceholderEl||(this.fileInputPlaceholderEl=this.renderer.createElement("div")),this.fileInputPlaceholderEl}canGetAsEntry(t){return!!t.webkitGetAsEntry}isDropzoneDisabled(){return this.globalDraggingInProgress||this.disabled}addToQueue(t){this.files.push(t)}preventAndStop(t){t.stopPropagation(),t.preventDefault()}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ic),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-file-drop"]],contentQueries:function(t,e,n){if(1&t&&ac(n,dM,!0,yl),2&t){let t;ic(t=lc())&&(e.contentTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&rc(sM,!0),2&t){let t;ic(t=lc())&&(e.fileSelector=t.first)}},inputs:{accept:"accept",directory:"directory",multiple:"multiple",dropZoneLabel:"dropZoneLabel",dropZoneClassName:"dropZoneClassName",useDragEnter:"useDragEnter",contentClassName:"contentClassName",showBrowseBtn:"showBrowseBtn",browseBtnClassName:"browseBtnClassName",browseBtnLabel:"browseBtnLabel",disabled:"disabled"},outputs:{onFileDrop:"onFileDrop",onFileOver:"onFileOver",onFileLeave:"onFileLeave"},decls:7,vars:15,consts:[[3,"className","drop","dragover","dragenter","dragleave"],[3,"className"],["type","file",1,"ngx-file-drop__file-input",3,"accept","multiple","change"],["fileSelector",""],["defaultContentTemplate",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","ngx-file-drop__drop-zone-label",4,"ngIf"],[4,"ngIf"],[1,"ngx-file-drop__drop-zone-label"],["type","button",3,"className","value","click"]],template:function(t,e){if(1&t&&(Mo(0,"div",0),Vo("drop",function(t){return e.dropFiles(t)})("dragover",function(t){return e.onDragOver(t)})("dragenter",function(t){return e.onDragEnter(t)})("dragleave",function(t){return e.onDragLeave(t)}),Mo(1,"div",1),Mo(2,"input",2,3),Vo("change",function(t){return e.uploadFiles(t)}),Io(),Do(4,lM,2,2,"ng-template",null,4,dc),Do(6,cM,0,0,"ng-template",5),Io(),Io()),2&t){const t=To(5);ra("ngx-file-drop__drop-zone--over",e.isDraggingOverDropZone),Fo("className",e.dropZoneClassName),Qr(1),Fo("className",e.contentClassName),Qr(1),Fo("accept",e.accept)("multiple",e.multiple),ko("directory",e.directory||void 0)("webkitdirectory",e.directory||void 0)("mozdirectory",e.directory||void 0)("msdirectory",e.directory||void 0)("odirectory",e.directory||void 0),Qr(4),Fo("ngTemplateOutlet",e.contentTemplate||t)("ngTemplateOutletContext",Vl(13,hM,e.openFileSelector))}},directives:[Gh,Bh],styles:[".ngx-file-drop__drop-zone[_ngcontent-%COMP%]{border:2px dotted #0782d0;border-radius:30px;height:100px;margin:auto}.ngx-file-drop__drop-zone--over[_ngcontent-%COMP%]{background-color:hsla(0,0%,57.6%,.5)}.ngx-file-drop__content[_ngcontent-%COMP%]{align-items:center;color:#0782d0;display:flex;height:100px;justify-content:center}.ngx-file-drop__drop-zone-label[_ngcontent-%COMP%]{text-align:center}.ngx-file-drop__file-input[_ngcontent-%COMP%]{display:none}"]}),t})(),fM=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:function(){return[pM]}}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[],imports:[[qh]]}),t})();function gM(t,e){1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3,"Failed to retrieve configuration."),Io(),Io()),2&t&&Fo("dismissible",!1)}function mM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(2).$implicit;Fo("id",t.name),Qr(1),ya(t.value)}}function vM(t,e){1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t&&Fo("id",zo(2).$implicit.name)}function yM(t,e){if(1&t&&(Mo(0,"div",35),Mo(1,"b"),va(2),Io(),Mo(3,"label",27),Mo(4,"a",28),$o(5,"img",10),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.flatConfig[t+1].name),Qr(1),Fo("for",e.flatConfig[t+1].name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",e.flatConfig[t+1].name,"",nr)}}function bM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(3).index,e=zo();Fo("id",e.flatConfig[t+1].name),Qr(1),ya(e.flatConfig[t+1].value)}}function wM(t,e){if(1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t){const t=zo(3).index;Fo("id",zo().flatConfig[t+1].name)}}function xM(t,e){if(1&t&&(Mo(0,"div",36),Do(1,bM,2,2,"span",29),Do(2,wM,2,1,"span",30),Io()),2&t){const t=zo(2).index,e=zo();Qr(1),Fo("ngIf",!e.isEmpty(e.flatConfig[t+1].value)),Qr(1),Fo("ngIf",e.isEmpty(e.flatConfig[t+1].value))}}function _M(t,e){if(1&t&&(Mo(0,"div",26),Mo(1,"div",7),Mo(2,"b"),va(3),Io(),Mo(4,"label",27),Mo(5,"a",28),$o(6,"img",10),Io(),Io(),Io(),Mo(7,"div",7),Do(8,mM,2,2,"span",29),Do(9,vM,2,1,"span",30),Io(),Do(10,yM,6,3,"div",31),Do(11,xM,3,2,"div",32),Io()),2&t){const t=zo(),e=t.index,n=t.$implicit,i=zo();ra("border-top-0",e>0),Qr(3),ya(n.name),Qr(1),Fo("for",n.name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",n.value.name,"",nr),Qr(3),Fo("ngIf",!i.isEmpty(n.value)),Qr(1),Fo("ngIf",i.isEmpty(n.value)),Qr(1),Fo("ngIf",e{class t{constructor(t,e,n,i,r,s){this.config=t,this.route=e,this.httpClient=n,this.modalService=i,this.consoleService=r,this.formBuilder=s,this.configError="",this.uploadError="",this.deleteError="",this.uploading=!1,this.uploadSuccess=!1,this.deleteSuccess=!1,this.deleting=!1,this.apiConfig=t}ngOnInit(){this.route.data.subscribe(t=>{this.nakamaVersion=t[0].server_version;const e=JSON.parse(t[0].config);this.jsonConfig=e,this.flatConfig=this.flattenConfig(e)},t=>{this.configError=t}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])]})}flattenConfig(t){const e=[];return this.traverseConfig("",t,e),e.sort((t,e)=>t.name.localeCompare(e.name))}traverseConfig(t,e,n){for(const i in e)"env"!==i&&(Array.isArray(e[i])?n.push({name:t+i,value:e[i].join(", ")}):"object"==typeof e[i]?this.traverseConfig(i+".",e[i],n):n.push({name:t+i,value:e[i]}))}isEmpty(t){return""===t||0===t}exportYaml(){const t=new Blob([Object(iM.safeDump)(this.jsonConfig)],{type:"text/yaml;charset=utf-8"});rM.saveAs(t,"config.yaml")}dropped(t){this.uploadError="",this.uploadSuccess=!1;for(const e of t)if(e.fileEntry.isFile){const t=e.fileEntry.name.split("."),n=["json","csv"];t.length>1&&n.includes(t[t.length-1].toLowerCase())?e.fileEntry.file(t=>{this.uploadFile(t)}):this.uploadError="Invalid file: must have extension .json or .csv"}}uploadFile(t){const e=new FormData;e.append(t.name,t),this.uploading=!0,this.httpClient.post(this.apiConfig.host+"/v2/console/storage/import",e,{headers:{Authorization:"Bearer "}}).subscribe(()=>{this.uploading=!1,this.uploadSuccess=!0},t=>{this.uploading=!1,this.uploadError=t})}deleteData(){this.deleteError="",this.deleting=!0,this.consoleService.deleteAllData("").pipe(sx(2e3)).subscribe(()=>{this.deleting=!1,this.deleteError="",this.deleteSuccess=!0},t=>{this.deleting=!1,this.deleteError=t})}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}get f(){return this.confirmDeleteForm.controls}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(uw),Ro(pm),Ro(qb),Ro(a_),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:43,vars:11,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"pb-4"],[1,"d-flex","justify-content-between","mb-4","align-items-baseline"],[1,"btn","btn-primary","btn-sm",3,"click"],[1,"config-table"],[4,"ngFor","ngForOf"],[1,"row","py-2","border","border-top-0","add-border-larger","mb-5"],[1,"col-lg-3"],[1,"pl-1"],["target","_blank","href","https://heroiclabs.com/docs/install-configuration/#runtime.env",1,"d-inline"],["src","/static/svg/hint.svg","alt","","width","16","height",""],[1,"col-lg-9"],[4,"ngIf"],[1,"section-divider","d-flex","mb-4"],["type","success",3,"dismissible","close",4,"ngIf"],["accept",".json,.csv","dropZoneClassName","drop-zone","contentClassName","drop-zone-content","dropZoneLabel","Drop CSV or JSON file here",3,"disabled","onFileDrop"],["ngx-file-drop-content-tmp",""],["role","alert",1,"alert","alert-danger","d-flex","justify-content-between","align-items-center"],["src","/static/svg/red-triangle.svg","alt","","width","16","height",""],[1,"pl-2"],["confirmDelete",""],["type","button",1,"btn","btn-danger",3,"disabled","click"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","row py-2 border",3,"border-top-0",4,"ngIf"],[1,"row","py-2","border"],[1,"pl-1",3,"for"],["target","_blank",1,"d-inline",3,"href"],["class","text-break-all",3,"id",4,"ngIf"],["class","text-muted",3,"id",4,"ngIf"],["class","col-md-3 left-line",4,"ngIf"],["class","col-md-3",4,"ngIf"],[1,"text-break-all",3,"id"],[1,"text-muted",3,"id"],[1,"col-md-3","left-line"],[1,"col-md-3"],["class","mb-0 text-break-all",4,"ngFor","ngForOf"],[1,"mb-0","text-break-all"],[1,"mb-0","text-muted"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"click"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],[1,"mt-2"],["autocomplete","off",3,"formGroup"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,e){if(1&t){const t=No();Do(0,gM,4,1,"ngb-alert",0),Mo(1,"h2",1),va(2,"Server Configuration"),Io(),Mo(3,"div",2),Mo(4,"h5"),Mo(5,"b"),va(6,"Server version:"),Io(),va(7),Io(),Mo(8,"button",3),Vo("click",function(){return e.exportYaml()}),va(9,"Export Configuration"),Io(),Io(),Mo(10,"div",4),Do(11,CM,2,1,"ng-container",5),Mo(12,"div",6),Mo(13,"div",7),Mo(14,"b"),va(15,"runtime.env"),Io(),Mo(16,"label",8),Mo(17,"a",9),$o(18,"img",10),Io(),Io(),Io(),Mo(19,"div",11),Do(20,EM,2,1,"div",12),Do(21,kM,3,0,"div",12),Io(),Io(),Io(),Mo(22,"h5",13),va(23,"Import storage data"),Io(),Mo(24,"p"),va(25,"Import storage objects from a CSV or JSON file by dragging and dropping it below."),Io(),Do(26,AM,6,2,"ngb-alert",0),Do(27,DM,4,1,"ngb-alert",14),Mo(28,"ngx-file-drop",15),Vo("onFileDrop",function(t){return e.dropped(t)}),Do(29,TM,2,0,"ng-template",16),Io(),Mo(30,"h5",13),va(31,"Delete all data"),Io(),Do(32,RM,6,2,"ngb-alert",0),Do(33,FM,4,1,"ngb-alert",14),Mo(34,"div",17),Mo(35,"div"),$o(36,"img",18),Mo(37,"small",19),va(38,"Warning - this operation is not reversible!"),Io(),Io(),Do(39,MM,19,5,"ng-template",null,20,dc),Mo(41,"button",21),Vo("click",function(){Ie(t);const n=To(40);return e.openDeleteDataModal(n)}),va(42,"Delete all"),Io(),Io()}2&t&&(Fo("ngIf",e.configError),Qr(7),ba(" ",e.nakamaVersion,""),Qr(4),Fo("ngForOf",e.flatConfig),Qr(9),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&e.jsonConfig.runtime.env.length>0),Qr(1),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&0===e.jsonConfig.runtime.env.length),Qr(5),Fo("ngIf",e.uploadError),Qr(1),Fo("ngIf",e.uploadSuccess),Qr(1),Fo("disabled",e.uploading),Qr(4),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(8),Fo("disabled",e.deleting))},directives:[Bh,Ph,pM,dM,_x,pb,Ry,mb,ay,Ty,yb,$h],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.text-break-all[_ngcontent-%COMP%]{word-break:break-all;word-wrap:anywhere}.config-table[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]:nth-child(2n){background-color:#fafafc}.config-table[_ngcontent-%COMP%] .left-line[_ngcontent-%COMP%]{border-left:1px solid #dadae9}"]}),t})(),$M=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getConfig("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function OM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function PM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",51),va(2,"No additional users are setup. Create a new user below."),Io(),Io()),2&t&&(Qr(1),Fo("colSpan",4))}function NM(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Mo(6,"span",36),va(7,"Administrator"),Io(),Mo(8,"span",36),va(9,"Developer"),Io(),Mo(10,"span",36),va(11,"Maintainer"),Io(),Mo(12,"span",36),va(13,"View Only"),Io(),Io(),Mo(14,"td"),Mo(15,"button",52),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().deleteUser(n.username)}),va(16,"Delete"),Io(),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.username),Qr(2),ya(t.email),Qr(2),Fo("hidden",t.role!==n.adminRole),Qr(2),Fo("hidden",t.role!==n.developerRole),Qr(2),Fo("hidden",t.role!==n.maintainerRole),Qr(2),Fo("hidden",t.role!==n.readonlyRole)}}function BM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3,"An error occurred:"),Io(),Mo(4,"p",53),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.userCreateError)}}const UM=function(t){return{"is-invalid":t}};let VM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.userCreateError="",this.users=[],this.adminRole=cw.USER_ROLE_ADMIN,this.developerRole=cw.USER_ROLE_DEVELOPER,this.maintainerRole=cw.USER_ROLE_MAINTAINER,this.readonlyRole=cw.USER_ROLE_READONLY}ngOnInit(){this.createUserForm=this.formBuilder.group({username:["",py.required],email:["",[py.required,py.email]],password:["",py.compose([py.required,py.minLength(8)])],role:[+this.readonlyRole,py.required],newsletter:[!1]}),this.route.data.subscribe(t=>{const e=t[0];this.users.length=0,this.users.push(...e.users)},t=>{this.error=t})}deleteUser(t){this.error="",this.consoleService.deleteUser("",t).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(t=>{this.error="",this.users.length=0,this.users.push(...t.users)},t=>{this.error=t})}addUser(){this.userCreateError="",this.createUserForm.disable();let t=cw.USER_ROLE_READONLY;switch(this.f.role.value){case 1:t=cw.USER_ROLE_ADMIN;break;case 2:t=cw.USER_ROLE_DEVELOPER;break;case 3:t=cw.USER_ROLE_MAINTAINER;break;case 4:t=cw.USER_ROLE_READONLY}this.consoleService.addUser("",{username:this.f.username.value,email:this.f.email.value,password:this.f.password.value,role:t,newsletter_subscription:this.f.newsletter.value}).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(e=>{this.userCreateError="",this.createUserForm.reset({role:+t}),this.createUserForm.enable(),this.users.length=0,this.users.push(...e.users)},t=>{this.userCreateError=t,this.createUserForm.enable()})}get f(){return this.createUserForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-users"]],decls:121,vars:24,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"user-details","mb-5","table","table-bordered","table-sm","table-striped"],[1,"thead-light"],[2,"width","400px"],[2,"width","300px"],[2,"width","90px"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"section-divider","d-flex","mb-4"],[1,"mb-4","alert-permissions",3,"type"],[1,"alert-title","font-weight-bold"],[1,"d-flex","flex-wrap","flex-row"],[1,"col","col-md-3","p-4","flex-fill","flex-grow-1"],[1,"d-flex","align-items-center","mb-3"],["src","/static/svg/role-admin.svg","alt","","width","30","height","",1,"mr-2"],[1,"m-0","font-weight-bold"],["src","/static/svg/role-developer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-maintainer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-viewonly.svg","alt","","width","30","height","",1,"mr-2"],[1,"add-border","rounded"],[3,"formGroup","ngSubmit"],[1,"row","no-gutters"],[1,"col","d-flex","justify-content-between","align-items-center"],[1,"col-md-3"],["for","email",1,"d-inline"],[1,"col-md-9","ml-0","p-0"],["type","email","id","email","placeholder","email@example.com","required","","formControlName","email",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control",3,"ngClass"],["for","password",1,"d-inline"],["type","password","id","password","placeholder","Password","required","","formControlName","password",1,"form-control",3,"ngClass"],[1,"d-inline"],[1,"btn-group"],["disabled","",1,"btn","btn-outline-dark","disabled"],[3,"hidden"],["ngbDropdown","","role","group",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","add-border-single-row-bottom","mb-4"],[1,"col","d-flex","align-items-center"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","newsletter","formControlName","newsletter",1,"custom-control-input","mr-2","my-2"],["for","newsletter",1,"form-check-label","custom-control-label"],[1,""],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"text-muted",3,"colSpan"],["type","button",1,"btn","btn-danger","btn-outline-dark",3,"click"],[1,"mb-0","pl-4"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Management"),Io(),Do(2,OM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Username"),Io(),Mo(8,"th"),va(9,"Email"),Io(),Mo(10,"th",5),va(11,"Role"),Io(),Mo(12,"th",6),va(13,"Action"),Io(),Io(),Io(),Mo(14,"tbody"),Do(15,PM,3,1,"tr",7),Do(16,NM,17,6,"tr",8),Io(),Io(),Mo(17,"h5",9),va(18,"Add new user"),Io(),Mo(19,"ngb-alert",10),Mo(20,"h6",11),va(21,"User roles"),Io(),Mo(22,"div",12),Mo(23,"div",13),Mo(24,"div",14),$o(25,"img",15),Mo(26,"h6",16),va(27,"Administrator"),Io(),Io(),Mo(28,"small"),va(29," Owners have complete control over the server, its users and resources. "),Io(),Io(),Mo(30,"div",13),Mo(31,"div",14),$o(32,"img",17),Mo(33,"h6",16),va(34,"Developer"),Io(),Io(),Mo(35,"small"),va(36," Like Administrators, Developers have complete control over the server, resources and data. However they cannot add, change or delete console users. "),Io(),Io(),Mo(37,"div",13),Mo(38,"div",14),$o(39,"img",18),Mo(40,"h6",16),va(41,"Maintainer"),Io(),Io(),Mo(42,"small"),va(43," Maintainers have access to adding, changing and delete client resources such as accounts, storage and leaderboard records. They don't have access to the API Explorer or the console users. "),Io(),Io(),Mo(44,"div",13),Mo(45,"div",14),$o(46,"img",19),Mo(47,"h6",16),va(48,"View Only"),Io(),Io(),Mo(49,"small"),va(50," View Only users can only view client resources but cannot make any changes to the data whatsoever. "),Io(),Io(),Io(),Io(),Do(51,BM,6,2,"ngb-alert",1),Mo(52,"div",20),Mo(53,"form",21),Vo("ngSubmit",function(){return e.addUser()}),Mo(54,"div",22),Mo(55,"div",23),Mo(56,"div",24),Mo(57,"label",25),va(58,"Email"),Io(),Io(),Mo(59,"div",26),$o(60,"input",27),Mo(61,"div",28),va(62,"Email is required"),Io(),Io(),Io(),Io(),Mo(63,"div",22),Mo(64,"div",23),Mo(65,"div",24),Mo(66,"label",29),va(67,"Username"),Io(),Io(),Mo(68,"div",26),$o(69,"input",30),Mo(70,"div",28),va(71,"Username is required"),Io(),Io(),Io(),Io(),Mo(72,"div",22),Mo(73,"div",23),Mo(74,"div",24),Mo(75,"label",31),va(76,"Password"),Io(),Io(),Mo(77,"div",26),$o(78,"input",32),Mo(79,"div",28),va(80,"Password is required, must be 8 chars or longer and consist of at least a capital letter, a small letter and a number."),Io(),Io(),Io(),Io(),Mo(81,"div",22),Mo(82,"div",23),Mo(83,"div",24),Mo(84,"label",33),va(85,"Role"),Io(),Io(),Mo(86,"div",26),Mo(87,"div",34),Mo(88,"button",35),Mo(89,"span",36),va(90,"Administrator"),Io(),Mo(91,"span",36),va(92,"Developer"),Io(),Mo(93,"span",36),va(94,"Maintainer"),Io(),Mo(95,"span",36),va(96,"View Only"),Io(),Io(),Mo(97,"div",37),$o(98,"button",38),Mo(99,"div",39),Mo(100,"button",40),Vo("click",function(){return e.f.role.setValue(+e.adminRole)}),va(101,"Administrator"),Io(),Mo(102,"button",40),Vo("click",function(){return e.f.role.setValue(+e.developerRole)}),va(103,"Developer"),Io(),Mo(104,"button",40),Vo("click",function(){return e.f.role.setValue(+e.maintainerRole)}),va(105,"Maintainer"),Io(),Mo(106,"button",40),Vo("click",function(){return e.f.role.setValue(+e.readonlyRole)}),va(107,"View Only"),Io(),Io(),Io(),Io(),Mo(108,"div",28),va(109,"Role is required"),Io(),Io(),Io(),Io(),Mo(110,"div",41),Mo(111,"div",42),$o(112,"div",24),Mo(113,"div",26),Mo(114,"div",43),$o(115,"input",44),Mo(116,"label",45),va(117,"Subscribe to Heroic Labs' newsletters to receive latest updates to Nakama and other news."),Io(),Io(),Io(),Io(),Io(),Mo(118,"div",46),Mo(119,"button",47),va(120,"Save"),Io(),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",0===e.users.length),Qr(1),Fo("ngForOf",e.users),Qr(3),Fo("type","secondary"),Qr(32),Fo("ngIf",e.userCreateError),Qr(2),Fo("formGroup",e.createUserForm),Qr(7),Fo("ngClass",Vl(18,UM,e.f.email.dirty&&e.f.email.errors)),Qr(1),Fo("hidden",e.f.email.disabled||e.f.email.valid||e.f.email.pristine),Qr(8),Fo("ngClass",Vl(20,UM,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(8),Fo("ngClass",Vl(22,UM,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(10),Fo("hidden",e.f.role.value!==+e.adminRole),Qr(2),Fo("hidden",e.f.role.value!==+e.developerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.maintainerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.readonlyRole),Qr(13),Fo("hidden",e.f.role.disabled||e.f.role.valid||e.f.role.pristine),Qr(11),Fo("disabled",e.createUserForm.invalid))},directives:[Bh,Ph,_x,pb,Ry,mb,ay,wb,Ty,yb,$h,Kx,qx,Wx,zx,ry],styles:[".user-details[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.user-details[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.user-details[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.6em 1em}.alert-permissions[_ngcontent-%COMP%]{padding:0}.alert-permissions[_ngcontent-%COMP%] .alert-title[_ngcontent-%COMP%]{padding:1rem}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%]{border-top:1px solid #dadae9;margin:0}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]{border-right:1px solid #dadae9}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]:last-child{border-right:none}"]}),t})(),HM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listUsers("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jM(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Failed to retrieve runtime information: ",t.error,"")}}function zM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function WM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Go modules were found."),Io(),$o(3,"td"),Io())}function GM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function qM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Lua modules were found."),Io(),$o(3,"td"),Io())}function KM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function XM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No JavaScript modules were found."),Io(),$o(3,"td"),Io())}const YM=function(){return["/apiexplorer"]},JM=function(t){return{endpoint:t}};function QM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function ZM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Go RPC functions were found."),Io(),Io())}function tI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function eI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Lua RPC functions were found."),Io(),Io())}function nI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function iI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No JavaScript RPC functions were found."),Io(),Io())}let rI=(()=>{class t{constructor(t,e){this.route=t,this.consoleService=e,this.error=""}ngOnInit(){this.route.data.subscribe(t=>{this.runtimeInfo=t[0]},t=>{this.error=t})}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:51,vars:13,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"runtime-table","mb-4","table","table-sm","table-bordered","mb-5"],[1,"thead-light"],[2,"width","180px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["colspan","2"],[1,"mb-4","section-divider","d-flex"],[1,"runtime-table","table","table-sm","table-bordered"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","200px"],[1,"text-muted"],[2,"width","180px","text-align","center"],[1,"btn","btn-sm","btn-secondary",3,"routerLink","queryParams"],["colspan","2",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Runtime Modules"),Io(),Do(2,jM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th"),va(7,"Go Modules"),Io(),Mo(8,"th",4),va(9,"Last Modified"),Io(),Io(),Io(),Mo(10,"tbody"),Do(11,zM,5,2,"tr",5),Do(12,WM,4,0,"tr",6),Io(),Mo(13,"thead",3),Mo(14,"tr"),Mo(15,"th",7),va(16,"Lua Modules"),Io(),Io(),Io(),Mo(17,"tbody"),Do(18,GM,5,2,"tr",5),Do(19,qM,4,0,"tr",6),Io(),Mo(20,"thead",3),Mo(21,"tr"),Mo(22,"th",7),va(23,"JavaScript Modules"),Io(),Io(),Io(),Mo(24,"tbody"),Do(25,KM,5,2,"tr",5),Do(26,XM,4,0,"tr",6),Io(),Io(),Mo(27,"h4",8),va(28,"Registered RPC Functions"),Io(),Mo(29,"table",9),Mo(30,"thead",3),Mo(31,"tr"),Mo(32,"th",7),va(33,"Go RPC Functions"),Io(),Io(),Io(),Mo(34,"tbody"),Do(35,QM,7,6,"tr",5),Do(36,ZM,3,0,"tr",6),Io(),Mo(37,"thead",3),Mo(38,"tr"),Mo(39,"th",7),va(40,"Lua RPC Functions"),Io(),Io(),Io(),Mo(41,"tbody"),Do(42,tI,7,6,"tr",5),Do(43,eI,3,0,"tr",6),Io(),Mo(44,"thead",3),Mo(45,"tr"),Mo(46,"th",7),va(47,"JavaScript RPC Functions"),Io(),Io(),Io(),Mo(48,"tbody"),Do(49,nI,7,6,"tr",5),Do(50,iI,3,0,"tr",6),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(9),Fo("ngForOf",e.runtimeInfo.go_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_modules.length),Qr(9),Fo("ngForOf",e.runtimeInfo.go_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_rpc_functions.length))},directives:[Bh,Ph,_x,Mv],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.opaque[_ngcontent-%COMP%]{opacity:1%}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.runtime-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.runtime-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.runtime-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-left:1em;padding-right:1em;vertical-align:middle}"]}),t})(),sI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getRuntime("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function oI(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by collection"),Io())}function aI(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.f.collection.value)}}function lI(t,e){if(1&t){const t=No();Mo(0,"button",34),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().f.collection.setValue(n)}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function cI(t,e){if(1&t&&(Mo(0,"ngb-alert",35),$o(1,"img",36),Mo(2,"h6",37),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying storage objects: ",t.error,"")}}function hI(t,e){1&t&&(Mo(0,"th",38),va(1,"Remove"),Io())}function uI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",39),va(2,"No storage objects found - change the filter criteria or add new objects."),Io(),Io())}function dI(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteObject(e,i,r)}),va(2,"Delete"),Io(),Io()}}function pI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(2),Io(),Mo(3,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(4),Io(),Mo(5,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(6),Io(),Mo(7,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(8),Io(),Do(9,dI,3,0,"td",41),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.collection),Qr(2),ya(t.key),Qr(2),ya(t.user_id),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let fI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.collections=[],this.objects=[],this.objectCount=0,this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({collection:[""],key:[""],user_id:[""]});const t=this.route.snapshot.queryParamMap;this.f.collection.setValue(t.get("collection")),this.f.key.setValue(t.get("key")),this.f.user_id.setValue(t.get("user_id")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.collection.value||this.f.user_id.value)&&this.search(0),this.route.data.subscribe(t=>{this.collections.length=0,this.collections.push(...t[0].collections),this.objectCount=t[1].total_count,this.nextCursor=t[1].next_cursor,this.prevCursor=t[1].prev_cursor,this.objects.length=0,this.objects.push(...t[1].objects)},t=>{this.error=t})}disableSearch(){return!(!this.f.key.value||""===this.f.key.value||this.f.collection.value&&""!==this.f.collection.value)}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listStorage("",this.f.user_id.value,this.f.key.value,this.f.collection.value,e).subscribe(t=>{this.error="",this.objectCount=t.total_count,this.nextCursor=t.next_cursor,this.objects.length=0,this.objects.push(...t.objects),this.router.navigate([],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteObject(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteStorageObject("",n.collection,n.key,n.user_id,n.version).subscribe(()=>{this.error="",this.objectCount--,this.objects.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}viewObject(t){this.router.navigate(["/storage",t.collection,t.key,t.user_id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:50,vars:15,consts:[[1,"pb-1"],[1,"pb-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius",3,"disabled"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",1,"btn","btn-secondary","text-secondary",3,"hidden","click"],[1,"dropdown-divider",3,"hidden"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","text","formControlName","key","placeholder","Filter by key",1,"form-control"],["type","text","formControlName","user_id","placeholder","Filter by user ID",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","submit",1,"btn","btn-primary",3,"disabled","click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Storage Objects"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"button",9),Do(12,oI,2,0,"span",10),Do(13,aI,2,1,"span",10),Io(),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.collection.reset()}),va(16,"\u2718 Deselect collection"),Io(),$o(17,"div",13),Do(18,lI,2,1,"button",14),Io(),Io(),Io(),$o(19,"input",15),$o(20,"input",16),Mo(21,"div",17),Mo(22,"span",18),Vo("click",function(){return e.f.user_id.setValue(e.systemUserId)}),$o(23,"img",19),Io(),Io(),Mo(24,"div",17),Mo(25,"button",20),Vo("click",function(){return e.search(0)}),va(26,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(27,"div",21),Mo(28,"div",22),Mo(29,"button",23),Vo("click",function(){return e.search(0)}),$o(30,"img",24),Io(),Mo(31,"button",23),Vo("click",function(){return e.search(1)}),$o(32,"img",25),Io(),Io(),Io(),Io(),Io(),Do(33,cI,4,2,"ngb-alert",26),Mo(34,"div",27),Mo(35,"table",28),Mo(36,"thead",29),Mo(37,"tr"),Mo(38,"th"),va(39,"Collection Name"),Io(),Mo(40,"th"),va(41,"Key Name"),Io(),Mo(42,"th",30),va(43,"User ID"),Io(),Mo(44,"th",31),va(45,"Last Update"),Io(),Do(46,hI,2,0,"th",32),Io(),Io(),Mo(47,"tbody"),Do(48,uI,3,0,"tr",10),Do(49,pI,10,5,"tr",33),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.objectCount," objects found."),Qr(4),Fo("formGroup",e.searchForm),Qr(4),Fo("disabled",0===e.collections.length),Qr(1),Fo("ngIf",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngIf",e.f.collection.value&&""!==e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngForOf",e.collections),Qr(7),Fo("disabled",e.disableSearch()),Qr(4),Fo("disabled",0===e.objects.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.objects.length),Qr(1),Fo("ngForOf",e.objects))},directives:[pb,Ry,mb,Kx,qx,Bh,Wx,zx,Ph,ay,Ty,yb,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),gI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listStorageCollections("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("collection"),i=t.queryParamMap.get("key"),r=t.queryParamMap.get("user_id");return this.consoleService.listStorage("",r,i,n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var vI=n("bU/s");const yI=["editor"];function bI(t,e){if(1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",39),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while modifying storage object: ",t.error,"")}}function wI(t,e){1&t&&(Mo(0,"ngb-alert",40),$o(1,"img",41),Mo(2,"h6",39),va(3,"Storage object was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function xI(t,e){1&t&&(Mo(0,"span"),va(1,"Save as a copy"),Io())}function _I(t,e){1&t&&va(0,"Save")}function CI(t,e){if(1&t&&(Mo(0,"button",42),Do(1,xI,2,0,"span",43),Do(2,_I,1,0,"ng-template",null,44,dc),Io()),2&t){const t=To(3),e=zo();Fo("disabled",e.updating),Qr(1),Fo("ngIf",e.object.collection!==e.f.collection.value||e.object.key!==e.f.keyname.value||e.object.user_id!==e.f.user_id.value)("ngIfElse",t)}}const SI=function(){return["/storage"]},EI=function(t){return{collection:t}},kI=function(t,e){return{collection:t,key:e}},AI=function(t,e,n){return{collection:t,key:e,user_id:n}},DI=function(t){return{"is-invalid":t}};let TI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.objectForm=this.formBuilder.group({collection:["",py.required],keyname:["",py.required],user_id:["",py.required],permission_read:[0,py.required],permission_write:[0,py.required]}),this.route.data.subscribe(t=>{this.object=t[0],this.f.collection.setValue(this.object.collection),this.f.keyname.setValue(this.object.key),this.f.user_id.setValue(this.object.user_id),this.f.permission_read.setValue(this.object.permission_read),this.f.permission_write.setValue(this.object.permission_write),this.updateAllowed()||this.objectForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.object.value),null,2);this.aceEditor.session.setValue(t)}updateObject(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(n){return this.error=n,void(this.updating=!1)}let e=this.object.version;this.object.collection===this.f.collection.value&&this.object.key===this.f.keyname.value&&this.object.user_id===this.f.user_id.value||(e=""),this.consoleService.writeStorageObject("",this.f.collection.value,this.f.keyname.value,this.f.user_id.value,{version:e,value:t,permission_read:this.f.permission_read.value,permission_write:this.f.permission_write.value}).subscribe(t=>{this.updated=!0,this.updating=!1,this.object.version=t.version,""===e&&(this.object.collection=this.f.collection.value,this.object.key=this.f.keyname.value,this.object.user_id=this.f.user_id.value,this.object.permission_read=this.f.permission_read.value,this.object.permission_write=this.f.permission_write.value)},t=>{this.error=t,this.updating=!1})}deleteObject(){this.error="",this.updated=!1,this.updating=!1;const t=this.object;this.consoleService.deleteStorageObject("",t.collection,t.key,t.user_id,t.version).subscribe(()=>{this.router.navigate(["/storage"],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value}})},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.objectForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(yI,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:88,vars:50,consts:[[1,"pb-1"],[1,"storage-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink","queryParams"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","collection",1,"d-inline"],["type","text","id","collection","placeholder","Collection","required","","formControlName","collection",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","key",1,"d-inline"],["type","text","id","key","placeholder","Key","required","","formControlName","keyname",1,"form-control","form-control-sm","my-2",3,"ngClass"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","required","","formControlName","user_id",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","permission_read",1,"d-inline"],["ngbRadioGroup","","id","permission_read","name","permission_read","formControlName","permission_read",1,"btn-group","btn-group-toggle"],["ngbButtonLabel","",1,"btn-outline-secondary"],["ngbButton","","type","radio",3,"disabled","value"],["for","version",1,"d-inline"],["type","text","id","version","placeholder","Version","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","permission_write",1,"d-inline"],["ngbRadioGroup","","id","permission_write","name","permission_write","formControlName","permission_write",1,"btn-group","btn-group-toggle"],[1,"row","add-border-single-row-bottom","mb-3"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mt-3","mb-3",2,"height","500px"],[2,"height","500px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"],[4,"ngIf","ngIfElse"],["elseBlock",""]],template:function(t,e){var n,i,r,s,o,a;1&t&&(Mo(0,"h2",0),va(1,"Storage Object"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),va(6,"Storage"),Io(),Mo(7,"li",4),Mo(8,"a",5),va(9),Io(),Io(),Mo(10,"li",4),Mo(11,"a",5),va(12),Io(),Io(),Mo(13,"li",4),Mo(14,"a",5),va(15),Io(),Io(),Io(),Io(),Io(),Do(16,bI,4,2,"ngb-alert",6),Do(17,wI,4,1,"ngb-alert",7),Mo(18,"form",8),Vo("ngSubmit",function(){return e.updateObject()}),Mo(19,"div",9),Mo(20,"div",10),Mo(21,"div",11),Mo(22,"label",12),va(23,"Collection"),Io(),Io(),$o(24,"input",13),Mo(25,"div",14),va(26,"Collection is required"),Io(),Io(),Mo(27,"div",10),Mo(28,"div",11),Mo(29,"label",15),va(30,"Key"),Io(),Io(),$o(31,"input",16),Mo(32,"div",14),va(33,"Key is required"),Io(),Io(),Io(),Mo(34,"div",9),Mo(35,"div",10),Mo(36,"div",11),Mo(37,"label",17),va(38,"User ID"),Io(),Io(),$o(39,"input",18),Mo(40,"div",14),va(41,"User ID is required"),Io(),Io(),Mo(42,"div",19),Mo(43,"div",11),Mo(44,"label",20),va(45,"Read Permission"),Io(),Io(),Mo(46,"div",21),Mo(47,"label",22),$o(48,"input",23),va(49," No Read "),Io(),Mo(50,"label",22),$o(51,"input",23),va(52," Owner Read "),Io(),Mo(53,"label",22),$o(54,"input",23),va(55," Public Read "),Io(),Io(),Io(),Io(),Mo(56,"div",9),Mo(57,"div",10),Mo(58,"div",11),Mo(59,"label",24),va(60,"Version"),Io(),Io(),$o(61,"input",25),Io(),Mo(62,"div",19),Mo(63,"div",11),Mo(64,"label",26),va(65,"Write Permission"),Io(),Io(),Mo(66,"div",27),Mo(67,"label",22),$o(68,"input",23),va(69," No Write "),Io(),Mo(70,"label",22),$o(71,"input",23),va(72," Owner Write "),Io(),Io(),Io(),Io(),Mo(73,"div",28),Mo(74,"div",10),Mo(75,"div",11),Mo(76,"label",29),va(77,"Create Time"),Io(),Io(),$o(78,"input",30),Io(),Mo(79,"div",10),Mo(80,"div",11),Mo(81,"label",31),va(82,"Update Time"),Io(),Io(),$o(83,"input",32),Io(),Io(),Mo(84,"div",33),$o(85,"div",34,35),Io(),Do(87,CI,4,3,"button",36),Io()),2&t&&(Qr(8),Fo("routerLink",Ul(32,SI))("queryParams",Vl(33,EI,e.object.collection)),Qr(1),ya(e.object.collection),Qr(2),Fo("routerLink",Ul(35,SI))("queryParams",Hl(36,kI,e.object.collection,e.object.key)),Qr(1),ya(e.object.key),Qr(2),Fo("routerLink",Ul(39,SI))("queryParams",(n=40,i=AI,r=e.object.collection,s=e.object.key,o=e.object.user_id,function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Eo(t,e,n,i);return So(t,e+2,r)||s}(t,l,r,s,o)?Co(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):jl(t,l+3)}(Le(),He(),n,i,r,s,o,a))),Qr(1),ya(e.object.user_id),Qr(1),Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.objectForm),Qr(6),Fo("ngClass",Vl(44,DI,e.f.collection.dirty&&e.f.collection.errors)),Qr(1),Fo("hidden",e.f.collection.disabled||e.f.collection.valid||e.f.collection.pristine),Qr(6),Fo("ngClass",Vl(46,DI,e.f.keyname.dirty&&e.f.keyname.errors)),Qr(1),Fo("hidden",e.f.keyname.disabled||e.f.keyname.valid||e.f.keyname.pristine),Qr(7),Fo("ngClass",Vl(48,DI,e.f.user_id.dirty&&e.f.user_id.errors)),Qr(1),Fo("hidden",e.f.user_id.disabled||e.f.user_id.valid||e.f.user_id.pristine),Qr(8),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(3),Fo("disabled",!e.updateAllowed())("value",2),Qr(7),Fo("value",e.object.version),Qr(7),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(7),Fo("value",e.object.create_time),Qr(5),Fo("value",e.object.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Mv,Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,kx,Sx,Ax,_x],styles:[".storage-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})(),RI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("collection"),i=t.paramMap.get("key"),r=t.paramMap.get("user_id");return this.consoleService.getStorage("",n,i,r)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FI(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function LI(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function MI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function II(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function $I(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function OI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function PI(t,e){if(1&t){const t=No();Mo(0,"td",18),Mo(1,"button",19),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLeaderboard(e,i,r)}),va(2,"Delete"),Io(),Io()}}function NI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(2),Io(),Mo(3,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(4),Io(),Mo(5,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(6),Io(),Mo(7,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(8),Io(),Do(9,MI,2,0,"td",15),Do(10,II,2,0,"td",15),Do(11,$I,2,0,"td",15),Do(12,OI,2,0,"td",15),Do(13,PI,3,0,"td",16),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(n.orderString[t.sort_order]),Qr(2),ya(n.operatorString[t.operator]),Qr(2),ya(""===t.reset_schedule?"-":t.reset_schedule),Qr(1),Fo("ngIf",t.authoritative),Qr(1),Fo("ngIf",!t.authoritative),Qr(1),Fo("ngIf",t.tournament),Qr(1),Fo("ngIf",!t.tournament),Qr(1),Fo("ngIf",n.deleteAllowed())}}function BI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",20),va(2,"No leaderboards were found."),Io(),Io())}let UI=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.authService=n,this.consoleService=i,this.error="",this.leaderboards=[],this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"}}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboards.length=0,this.leaderboards.push(...t[0].leaderboards)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}deleteLeaderboard(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboard("",n.id).subscribe(()=>{this.error="",this.leaderboards.splice(e,1)},t=>{this.error=t})}viewLeaderboardEntries(t){this.router.navigate(["/leaderboards",t.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(mw),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:5,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","130px"],[2,"width","100px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[3,"click"],["class","text-center",3,"click",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"text-center",3,"click"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboards"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FI,4,2,"ngb-alert",2),Mo(5,"table",3),Mo(6,"thead",4),Mo(7,"tr"),Mo(8,"th"),va(9,"Leaderboard ID"),Io(),Mo(10,"th",5),va(11,"Sort Order"),Io(),Mo(12,"th",5),va(13,"Operator"),Io(),Mo(14,"th",5),va(15,"Reset Schedule"),Io(),Mo(16,"th",6),va(17,"Authoritative"),Io(),Mo(18,"th",6),va(19,"Tournament"),Io(),Do(20,LI,2,0,"th",7),Io(),Io(),Mo(21,"tbody"),Do(22,NI,14,9,"tr",8),Do(23,BI,3,0,"tr",9),Io(),Io()),2&t&&(Qr(3),ba("",e.leaderboards.length," leaderboards found."),Qr(1),Fo("ngIf",e.error),Qr(16),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngForOf",e.leaderboards),Qr(1),Fo("ngIf",0===e.leaderboards.length))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),VI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listLeaderboards("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function HI(t,e){if(1&t&&(Mo(0,"ngb-alert",31),$o(1,"img",32),Mo(2,"h6",33),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying accounts: ",t.error,"")}}function jI(t,e){1&t&&(Mo(0,"th",34),va(1,"Remove"),Io())}function zI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",35),va(2,"No users found - change the filter criteria or add new user accounts."),Io(),Io())}function WI(t,e){1&t&&$o(0,"td")}function GI(t,e){if(1&t){const t=No();Mo(0,"td",38),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteAccount(e,i,r)}),va(2,"Delete"),Io(),Io()}}function qI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(8),Io(),Do(9,WI,1,0,"td",29),Do(10,GI,3,0,"td",37),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.username),Qr(2),ya(t.display_name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let KI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.accountsCount=0,this.accounts=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""],filter_type:[0]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.f.filter_type.setValue(+t.get("filter_type")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.filter.value||this.f.filter_type.value)&&this.search(0),this.route.data.subscribe(t=>{this.accounts.length=0,t&&(this.accounts.push(...t[0].users),this.accountsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listAccounts("",this.f.filter.value,this.f.filter_type.value&&1===this.f.filter_type.value,e).subscribe(t=>{this.error="",this.accounts.length=0,this.accounts.push(...t.users),this.accountsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,filter_type:this.f.filter_type.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteAccount(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteAccount("",n.id,!1).subscribe(()=>{this.error="",this.accounts.splice(e,1),this.accountsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewAccount(t){this.router.navigate(["/accounts",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:45,vars:9,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by user ID, social provider ID, device ID, or username (use '%' for prefix or suffix wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],["ngbDropdown","","role","group","aria-label","Button group with nested dropdown",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split",3,"disabled"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Accounts"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"span",9),Vo("click",function(){return e.f.filter.setValue(e.systemUserId)}),$o(12,"img",10),Io(),Io(),Mo(13,"div",8),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.filter_type.setValue(0),e.search(0)}),va(16,"Search"),Io(),Mo(17,"div",13),$o(18,"button",14),Mo(19,"div",15),Mo(20,"button",16),Vo("click",function(){return e.f.filter_type.setValue(1),e.search(0)}),va(21,"Tombstones"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(22,"div",17),Mo(23,"div",18),Mo(24,"button",19),Vo("click",function(){return e.search(0)}),$o(25,"img",20),Io(),Mo(26,"button",19),Vo("click",function(){return e.search(1)}),$o(27,"img",21),Io(),Io(),Io(),Io(),Io(),Do(28,HI,4,2,"ngb-alert",22),Mo(29,"div",23),Mo(30,"table",24),Mo(31,"thead",25),Mo(32,"tr"),Mo(33,"th",26),va(34,"User ID"),Io(),Mo(35,"th"),va(36,"Username"),Io(),Mo(37,"th"),va(38,"Display Name"),Io(),Mo(39,"th",27),va(40,"Last Update"),Io(),Do(41,jI,2,0,"th",28),Io(),Io(),Mo(42,"tbody"),Do(43,zI,3,0,"tr",29),Do(44,qI,11,6,"tr",30),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.accountsCount," accounts found."),Qr(4),Fo("formGroup",e.searchForm),Qr(11),Fo("disabled",!e.f.filter.value||""===e.f.filter.value),Qr(6),Fo("disabled",0===e.accounts.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.accounts.length),Qr(1),Fo("ngForOf",e.accounts))},directives:[pb,Ry,mb,ay,Ty,yb,Kx,qx,Wx,zx,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),XI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter"),i=t.queryParamMap.get("tombstones");return this.consoleService.listAccounts("",n,"true"===i,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function YI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().exportAccount(e)}),$o(1,"img",16),va(2,"Export"),Io()}}function JI(t,e){1&t&&(Mo(0,"span"),va(1,"Unban"),Io())}function QI(t,e){1&t&&(Mo(0,"span"),va(1,"Ban"),Io())}function ZI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().banUnbanAccount(e)}),$o(1,"img",17),Do(2,JI,2,0,"span",18),Do(3,QI,2,0,"span",18),Io()}if(2&t){const t=zo();Qr(2),Fo("ngIf",t.account.disable_time),Qr(1),Fo("ngIf",!t.account.disable_time)}}function t$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!1)}),$o(1,"img",20),va(2,"Delete"),Io()}}function e$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!0)}),$o(1,"img",21),va(2,"Recorded delete"),Io()}}function n$(t,e){if(1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const i$=function(t,e){return["/accounts",t,e]};function r$(t,e){if(1&t&&(Mo(0,"div"),Oo(1,25),Mo(2,"a",26),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,i$,n.account.user.id,t.path)),Qr(1),ya(t.label)}}const s$=function(){return["/accounts"]},o$=function(){return["/storage"]},a$=function(t){return{user_id:t}};let l$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Profile",path:"profile"},{label:"Authentication",path:"authentication"},{label:"Friends",path:"friends"},{label:"Groups",path:"groups"},{label:"Wallet",path:"wallet"},{label:"Purchases",path:"purchases"},{label:"Subscriptions",path:"subscriptions"}]}ngOnInit(){this.route.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAccount(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteAccount("",this.account.user.id,e).subscribe(()=>{this.error="",this.router.navigate(["/accounts"])},t=>{this.error=t})}banUnbanAccount(t){t.target.disabled=!0,this.error="",this.account.disable_time?this.consoleService.unbanAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=null,t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1}):this.consoleService.banAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=Date.now().toString(),t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1})}exportAccount(t){t.target.disabled=!0,this.error="",this.consoleService.exportAccount("",this.account.user.id).subscribe(e=>{this.error="";const n=this.account.user.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:14,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["ngbNavItem","storage"],["ngbNavLink","",3,"routerLink","queryParams"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["src","/static/svg/ban.svg","alt","","width","13","height","13",1,"mr-2"],[4,"ngIf"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["src","/static/svg/bin-recorded.svg","alt","","width","15","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Account"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Account"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,YI,3,0,"button",7),Do(12,ZI,4,2,"button",7),Do(13,t$,3,0,"button",8),Do(14,e$,3,0,"button",8),Io(),Io(),Do(15,n$,4,2,"ngb-alert",9),Mo(16,"nav",10,11),Do(18,r$,4,6,"div",12),Mo(19,"div"),Oo(20,13),Mo(21,"a",14),va(22," Storage "),Io(),Po(),Io(),Io(),$o(23,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(10,s$)),Qr(3),ya(e.account.user.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.banAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views),Qr(3),Fo("routerLink",Ul(11,o$))("queryParams",Vl(12,a$,e.account.user.id)))},directives:[Mv,Bh,f_,Ph,p_,g_,Ov,_x,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),c$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getAccount("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const h$=["editor"];function u$(t,e){if(1&t&&(Mo(0,"ngb-alert",29),$o(1,"img",30),Mo(2,"h6",31),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function d$(t,e){1&t&&(Mo(0,"ngb-alert",32),$o(1,"img",33),Mo(2,"h6",31),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function p$(t,e){1&t&&(Mo(0,"button",34),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const f$=function(t){return{"is-invalid":t}};let g$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({username:["",py.required],display_name:[""],avatar_url:[""],location:[""],timezone:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.username.setValue(this.account.user.username),this.f.display_name.setValue(this.account.user.display_name),this.f.avatar_url.setValue(this.account.user.avatar_url),this.f.location.setValue(this.account.user.location),this.f.timezone.setValue(this.account.user.timezone),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.user.metadata),null,2);this.aceEditor.session.setValue(t)}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{username:this.f.username.value,display_name:this.f.display_name.value,avatar_url:this.f.avatar_url.value,location:this.f.location.value,timezone:this.f.timezone.value,metadata:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(h$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:53,vars:11,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","display_name",1,"d-inline"],["type","text","id","display_name","placeholder","Display Name","formControlName","display_name",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","location",1,"d-inline"],["type","text","id","location","placeholder","Location","formControlName","location",1,"form-control","form-control-sm","my-2"],["for","timezone",1,"d-inline"],["type","text","id","timezone","placeholder","Timezone","formControlName","timezone",1,"form-control","form-control-sm","my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,u$,4,2,"ngb-alert",0),Do(1,d$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"User ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Username"),Io(),Io(),$o(13,"input",9),Mo(14,"div",10),va(15,"Username is required"),Io(),Io(),Io(),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",11),va(20,"Display Name"),Io(),Io(),$o(21,"input",12),Io(),Mo(22,"div",13),Mo(23,"div",5),Mo(24,"label",14),va(25,"Avatar URL"),Io(),Io(),$o(26,"input",15),Io(),Io(),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"div",5),Mo(30,"label",16),va(31,"Location"),Io(),Io(),$o(32,"input",17),Io(),Mo(33,"div",13),Mo(34,"div",5),Mo(35,"label",18),va(36,"Timezone"),Io(),Io(),$o(37,"input",19),Io(),Io(),Mo(38,"div",20),Mo(39,"div",4),Mo(40,"div",5),Mo(41,"label",21),va(42,"Create Time"),Io(),Io(),$o(43,"input",22),Io(),Mo(44,"div",4),Mo(45,"div",5),Mo(46,"label",23),va(47,"Update Time"),Io(),Io(),$o(48,"input",24),Io(),Io(),Mo(49,"div",25),$o(50,"div",26,27),Io(),Do(52,p$,2,1,"button",28),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(6),Fo("value",e.account.user.id),Qr(5),Fo("ngClass",Vl(9,f$,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(29),Fo("value",e.account.user.create_time),Qr(5),Fo("value",e.account.user.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,_x],styles:[""]}),t})();function m$(t,e){if(1&t&&(Mo(0,"ngb-alert",36),$o(1,"img",37),Mo(2,"h6",38),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function v$(t,e){1&t&&(Mo(0,"ngb-alert",39),$o(1,"img",40),Mo(2,"h6",38),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function y$(t,e){if(1&t&&(Mo(0,"option",41),va(1),Io()),2&t){const t=e.$implicit,n=e.index;Ko("value",n),Fo("selected",0===n),Qr(1),ya(t.id)}}function b$(t,e){1&t&&(Mo(0,"button",42),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}let w$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({email:[""],password:[""],selected_device_id_index:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.email.setValue(this.account.email),this.f.password.setValue(""),this.f.selected_device_id_index.setValue(0),0===this.account.devices.length&&this.f.selected_device_id_index.disable(),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t={email:this.f.email.value};this.f.password.dirty&&(t.password=this.f.password.value),this.consoleService.updateAccount("",this.account.user.id,t).subscribe(t=>{this.updated=!0,this.updating=!1,this.f.password.reset()},t=>{this.error=t,this.updating=!1})}unlinkDeviceId(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkDevice("",this.account.user.id,{device_id:this.account.devices[this.f.selected_device_id_index.value].id}).subscribe(()=>{this.error="",this.account.devices.splice(this.f.selected_device_id_index.value,1),this.f.selected_device_id_index.setValue(0)},t=>{this.error=t})}unlinkCustomID(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkCustom("",this.account.user.id).subscribe(()=>{this.error="",this.account.custom_id=null},t=>{this.error=t})}unlinkFacebook(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebook("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_id=null},t=>{this.error=t})}unlinkFacebookInstantGames(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebookInstantGame("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_instant_game_id=null},t=>{this.error=t})}unlinkApple(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkApple("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.apple_id=null},t=>{this.error=t})}unlinkGameCenter(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGameCenter("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.gamecenter_id=null},t=>{this.error=t})}unlinkGoogle(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGoogle("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.google_id=null},t=>{this.error=t})}unlinkSteam(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkSteam("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.steam_id=null},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}copyDeviceIdToClipboard(t){const e=document.createElement("textarea");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.opacity="0",e.value=this.account.devices[t].id,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:102,vars:21,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","selected_device_id_index",1,"d-inline"],[1,"input-group"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["src","/static/svg/copy.svg","alt","","width","16","height","",1,""],["id","selected_device_id_index","formControlName","selected_device_id_index",1,"form-control","custom-select","custom-select-sm"],[3,"value","selected",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","button",1,"btn","btn-sm","btn-outline-danger",3,"disabled","click"],["for","custom_id",1,"d-inline"],["type","text","id","custom_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","facebook_id",1,"d-inline"],["type","text","id","facebook_id","disabled","",1,"form-control","form-control-sm",3,"value"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","facebook_instant_game_id",1,"d-inline"],["type","text","id","facebook_instant_game_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","apple_id",1,"d-inline"],["type","text","id","apple_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","gamecenter_id",1,"d-inline"],["type","text","id","gamecenter_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","google_id",1,"d-inline"],["type","text","id","google_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","steam_id",1,"d-inline"],["type","text","id","steam_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","email",1,"d-inline"],["type","text","id","email","placeholder","Email","formControlName","email",1,"form-control","form-control-sm"],["for","password",1,"d-inline"],["type","text","id","password","placeholder","Password","formControlName","password",1,"form-control","form-control-sm"],[1,"row","remove-sides"],[1,"small"],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[3,"value","selected"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,m$,4,2,"ngb-alert",0),Do(1,v$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Device IDs"),Io(),Io(),Mo(8,"div",7),Mo(9,"button",8),Vo("click",function(){return e.copyDeviceIdToClipboard(e.f.selected_device_id_index.value)}),$o(10,"img",9),va(11," Copy "),Io(),Mo(12,"select",10),Do(13,y$,2,3,"option",11),Io(),Mo(14,"div",12),Mo(15,"button",13),Vo("click",function(t){return e.unlinkDeviceId(t)}),va(16,"Unlink"),Io(),Io(),Io(),Io(),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",14),va(20,"Custom ID"),Io(),Io(),Mo(21,"div",7),$o(22,"input",15),Mo(23,"div",12),Mo(24,"button",13),Vo("click",function(t){return e.unlinkCustomID(t)}),va(25,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",3),Mo(27,"div",4),Mo(28,"div",5),Mo(29,"label",16),va(30,"Facebook ID"),Io(),Io(),Mo(31,"div",7),$o(32,"input",17),Mo(33,"div",12),Mo(34,"button",13),Vo("click",function(t){return e.unlinkFacebook(t)}),va(35,"Unlink"),Io(),Io(),Io(),Io(),Mo(36,"div",18),Mo(37,"div",5),Mo(38,"label",19),va(39,"FB Instant Game ID"),Io(),Io(),Mo(40,"div",7),$o(41,"input",20),Mo(42,"div",12),Mo(43,"button",13),Vo("click",function(t){return e.unlinkFacebookInstantGames(t)}),va(44,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(45,"div",3),Mo(46,"div",4),Mo(47,"div",5),Mo(48,"label",21),va(49,"Apple ID"),Io(),Io(),Mo(50,"div",7),$o(51,"input",22),Mo(52,"div",12),Mo(53,"button",13),Vo("click",function(t){return e.unlinkApple(t)}),va(54,"Unlink"),Io(),Io(),Io(),Io(),Mo(55,"div",18),Mo(56,"div",5),Mo(57,"label",23),va(58,"GameCenter ID"),Io(),Io(),Mo(59,"div",7),$o(60,"input",24),Mo(61,"div",12),Mo(62,"button",13),Vo("click",function(t){return e.unlinkGameCenter(t)}),va(63,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(64,"div",3),Mo(65,"div",4),Mo(66,"div",5),Mo(67,"label",25),va(68,"Google ID"),Io(),Io(),Mo(69,"div",7),$o(70,"input",26),Mo(71,"div",12),Mo(72,"button",13),Vo("click",function(t){return e.unlinkGoogle(t)}),va(73,"Unlink"),Io(),Io(),Io(),Io(),Mo(74,"div",4),Mo(75,"div",5),Mo(76,"label",27),va(77,"Steam ID"),Io(),Io(),Mo(78,"div",7),$o(79,"input",28),Mo(80,"div",12),Mo(81,"button",13),Vo("click",function(t){return e.unlinkSteam(t)}),va(82,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(83,"div",3),Mo(84,"div",4),Mo(85,"div",5),Mo(86,"label",29),va(87,"Email"),Io(),$o(88,"br"),Io(),$o(89,"input",30),Io(),Mo(90,"div",4),Mo(91,"div",5),Mo(92,"label",31),va(93,"Password"),Io(),Io(),$o(94,"input",32),Io(),Io(),Mo(95,"div",33),Mo(96,"div",4),$o(97,"div",5),Mo(98,"span",34),va(99),Io(),Io(),$o(100,"div",4),Io(),Do(101,b$,2,1,"button",35),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(11),Fo("ngForOf",e.account.devices),Qr(2),Fo("disabled",!e.updateAllowed()||0===e.account.devices.length),Qr(7),Fo("value",e.account.custom_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.custom_id||""===e.account.custom_id),Qr(8),Fo("value",e.account.user.facebook_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_id||""===e.account.user.facebook_id),Qr(7),Fo("value",e.account.user.facebook_instant_game_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_instant_game_id||""===e.account.user.facebook_instant_game_id),Qr(8),Fo("value",e.account.user.apple_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.apple_id||""===e.account.user.apple_id),Qr(7),Fo("value",e.account.user.gamecenter_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.gamecenter_id||""===e.account.user.gamecenter_id),Qr(8),Fo("value",e.account.user.google_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.google_id||""===e.account.user.google_id),Qr(7),Fo("value",e.account.user.steam_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.steam_id||""===e.account.user.steam_id),Qr(18),ba("Verification Status: ",null===e.account.verify_time?"Not Verified":"Verified",""),Qr(2),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Ph,ay,_x,Vy,Wy],styles:[".custom-select[_ngcontent-%COMP%]{height:auto}"]}),t})();const x$=["editor"];function _$(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function C$(t,e){1&t&&(Mo(0,"ngb-alert",27),$o(1,"img",28),Mo(2,"h6",26),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function S$(t,e){if(1&t){const t=No();Mo(0,"button",29),Vo("click",function(){return Ie(t),zo().updateWallet()}),va(1,"Save"),Io()}2&t&&Fo("disabled",zo().updating)}function E$(t,e){1&t&&(Mo(0,"th",30),va(1,"Remove"),Io())}function k$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",31),va(2,"No wallet ledger items found."),Io(),Io())}function A$(t,e){1&t&&$o(0,"div",37)}function D$(t,e){1&t&&$o(0,"div",38)}function T$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLedgerItem(e,i,r)}),va(2,"Delete"),Io(),Io()}}function R$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",40),Mo(2,"pre",41),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function F$(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",32),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.walletLedgerMetadataOpen[n]=!i.walletLedgerMetadataOpen[n]}),Do(3,A$,1,0,"div",33),Do(4,D$,1,0,"div",34),Io(),va(5),Io(),Mo(6,"td",35),Mo(7,"pre",36),va(8),Io(),Io(),Mo(9,"td"),va(10),Io(),Do(11,T$,3,0,"td",22),Io(),Do(12,R$,5,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.walletLedgerMetadataOpen[t]),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t]),Qr(1),ba(" ",n.id," "),Qr(3),ya(n.changeset),Qr(2),ya(n.update_time),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t])}}let L$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.walletLedger=[],this.walletLedgerMetadataOpen=[],this.updating=!1,this.updated=!1,this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.walletLedger.length=0,this.walletLedger.push(...t[0].items),this.walletLedgerMetadataOpen.length=this.walletLedger.length,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}loadData(t){this.consoleService.getWalletLedger("",this.userID,this.limit,t).subscribe(t=>{this.walletLedger=t.items,this.walletLedgerMetadataOpen=[],this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.wallet),null,2);this.aceEditor.session.setValue(t)}updateWallet(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{wallet:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteLedgerItem(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteWalletLedger("",this.account.user.id,n.id).subscribe(()=>{this.error="",this.walletLedger.splice(e,1),this.walletLedgerMetadataOpen.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(x$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:32,vars:9,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","button","class","btn btn-primary",3,"disabled","click",4,"ngIf"],[1,"my-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","315px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"disabled","click"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"align-middle"],[1,"m-0","p-0"],[1,"arrow-right"],[1,"arrow-down"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","5",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,_$,4,2,"ngb-alert",0),Do(1,C$,4,1,"ngb-alert",1),Mo(2,"div",2),$o(3,"div",3,4),Io(),Do(5,S$,2,1,"button",5),$o(6,"hr",6),Mo(7,"div",7),Mo(8,"div",8),$o(9,"div",9),Mo(10,"div",10),Mo(11,"div",11),Mo(12,"button",12),Vo("click",function(){return e.loadData("")}),$o(13,"img",13),Io(),Mo(14,"button",12),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(15,"img",14),Io(),Mo(16,"button",12),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(17,"img",15),Io(),Io(),Io(),Io(),Io(),Mo(18,"div",16),Mo(19,"table",17),Mo(20,"thead",18),Mo(21,"tr"),Mo(22,"th",19),va(23,"ID"),Io(),Mo(24,"th"),va(25,"Changeset"),Io(),Mo(26,"th",20),va(27,"Update Time"),Io(),Do(28,E$,2,0,"th",21),Io(),Io(),Mo(29,"tbody"),Do(30,k$,3,0,"tr",22),Do(31,F$,13,7,"ng-template",23),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(4),Fo("ngIf",e.updateAllowed()),Qr(7),Fo("disabled",0===e.walletLedger.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(12),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.walletLedger.length),Qr(1),Fo("ngForOf",e.walletLedger))},directives:[Bh,Ph,_x],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}"]}),t})(),M$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getWalletLedger("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function I$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function $$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function O$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No friends found."),Io(),Io())}function P$(t,e){1&t&&(Mo(0,"span"),va(1,"Friend (0)"),Io())}function N$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Sent (1)"),Io())}function B$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Received (2)"),Io())}function U$(t,e){1&t&&(Mo(0,"span"),va(1,"Blocked (3)"),Io())}function V$(t,e){if(1&t){const t=No();Mo(0,"td",16),Mo(1,"button",17),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteFriend(e,i,r)}),va(2,"Delete"),Io(),Io()}}function H$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Do(6,P$,2,0,"span",8),Do(7,N$,2,0,"span",8),Do(8,B$,2,0,"span",8),Do(9,U$,2,0,"span",8),Io(),Mo(10,"td"),va(11),Io(),Do(12,V$,3,0,"td",15),Io()),2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let j$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.friends=[]}ngOnInit(){this.route.data.subscribe(t=>{this.friends.length=0,this.friends.push(...t[0].friends)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteFriend(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteFriend("",this.account.user.id,n.user.id).subscribe(()=>{this.error="",this.friends.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,I$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"User ID"),Io(),Mo(7,"th"),va(8,"Username"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,$$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,O$,3,0,"tr",8),Do(16,H$,13,8,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.friends.length),Qr(1),Fo("ngForOf",e.friends))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),z$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getFriends("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function W$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function G$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function q$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No group membership found."),Io(),Io())}function K$(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function X$(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function Y$(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function J$(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function Q$(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function Z$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",16),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function tO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,K$,2,0,"span",8),Do(7,X$,2,0,"span",8),Do(8,Y$,2,0,"span",8),Do(9,J$,2,0,"span",8),Do(10,Q$,2,0,"span",8),Io(),Mo(11,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,Z$,3,0,"td",8),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.group.id),Qr(2),ya(t.group.name),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.group.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let eO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.groups=[]}ngOnInit(){this.route.data.subscribe(t=>{this.groups.length=0,this.groups.push(...t[0].user_groups)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",this.account.user.id,n.group.id).subscribe(()=>{this.error="",this.groups.splice(e,1)},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/groups",t.group.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,W$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"Group ID"),Io(),Mo(7,"th"),va(8,"Name"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,G$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,q$,3,0,"tr",8),Do(16,tO,14,9,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),nO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getGroups("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const iO=["editor"];function rO(t,e){if(1&t&&(Mo(0,"ngb-alert",34),$o(1,"img",35),Mo(2,"h6",36),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function sO(t,e){1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",36),va(3,"Group was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function oO(t,e){1&t&&(Mo(0,"button",39),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const aO=function(t){return["/accounts",t]},lO=function(t){return{"is-invalid":t}};let cO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.groupForm=this.formBuilder.group({name:["",py.required],description:[""],avatar_url:[""],lang_tag:[""],open:[""],max_count:[""]}),this.route.parent.data.subscribe(t=>{this.group=t[0],this.f.name.setValue(this.group.name),this.f.description.setValue(this.group.description),this.f.avatar_url.setValue(this.group.avatar_url),this.f.lang_tag.setValue(this.group.lang_tag),this.f.open.setValue(this.group.open),this.f.max_count.setValue(this.group.max_count),this.updateAllowed()||this.groupForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.group.metadata),null,2);this.aceEditor.session.setValue(t)}updateGroup(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}if(this.f.max_count.value{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.groupForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(iO,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:71,vars:16,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","group_id",1,"d-inline"],["type","text","id","group_id","placeholder","Group ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","creator_id",1,"d-inline"],[2,"width","100%",3,"routerLink"],["type","text","id","creator_id","placeholder","Creator ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","name",1,"d-inline"],["type","text","id","name","placeholder","Name","required","","formControlName","name",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","formControlName","description",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","lang_tag",1,"d-inline"],["type","text","id","lang_tag","placeholder","Language","formControlName","lang_tag",1,"form-control","form-control-sm","my-2"],["type","text","id","edge_count","placeholder","Members","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_count",1,"d-inline"],["type","text","id","max_count","placeholder","Max Count","formControlName","max_count",1,"form-control","form-control-sm","my-2"],["type","checkbox","id","open","formControlName","open",1,"my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,rO,4,2,"ngb-alert",0),Do(1,sO,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateGroup()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Group ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Creator ID"),Io(),Io(),Mo(13,"a",9),$o(14,"input",10),Io(),Io(),Io(),Mo(15,"div",3),Mo(16,"div",4),Mo(17,"div",5),Mo(18,"label",11),va(19,"Name"),Io(),Io(),$o(20,"input",12),Mo(21,"div",13),va(22,"Name is required"),Io(),Io(),Mo(23,"div",4),Mo(24,"div",5),Mo(25,"label",14),va(26,"Description"),Io(),Io(),$o(27,"input",15),Io(),Io(),Mo(28,"div",3),Mo(29,"div",16),Mo(30,"div",5),Mo(31,"label",17),va(32,"Avatar URL"),Io(),Io(),$o(33,"input",18),Io(),Mo(34,"div",4),Mo(35,"div",5),Mo(36,"label",19),va(37,"Language"),Io(),Io(),$o(38,"input",20),Io(),Io(),Mo(39,"div",3),Mo(40,"div",4),Mo(41,"div",5),Mo(42,"label",8),va(43,"Members"),Io(),Io(),$o(44,"input",21),Io(),Mo(45,"div",16),Mo(46,"div",5),Mo(47,"label",22),va(48,"Max Count"),Io(),Io(),$o(49,"input",23),Io(),Io(),Mo(50,"div",3),Mo(51,"div",16),Mo(52,"div",5),Mo(53,"label",22),va(54,"Open"),Io(),Io(),$o(55,"input",24),Io(),Io(),Mo(56,"div",25),Mo(57,"div",4),Mo(58,"div",5),Mo(59,"label",26),va(60,"Create Time"),Io(),Io(),$o(61,"input",27),Io(),Mo(62,"div",4),Mo(63,"div",5),Mo(64,"label",28),va(65,"Update Time"),Io(),Io(),$o(66,"input",29),Io(),Io(),Mo(67,"div",30),$o(68,"div",31,32),Io(),Do(70,oO,2,1,"button",33),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.groupForm),Qr(6),Fo("value",e.group.id),Qr(5),Fo("routerLink",Vl(12,aO,e.group.creator_id)),Qr(1),Fo("value",e.group.creator_id),Qr(6),Fo("ngClass",Vl(14,lO,e.f.name.dirty&&e.f.name.errors)),Qr(1),Fo("hidden",e.f.name.disabled||e.f.name.valid||e.f.name.pristine),Qr(23),Fo("value",e.group.edge_count),Qr(17),Fo("value",e.group.create_time),Qr(5),Fo("value",e.group.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Mv,ay,wb,Ty,yb,$h,ry,_x],styles:[""]}),t})();function hO(t,e){if(1&t&&(Mo(0,"ngb-alert",13),$o(1,"img",14),Mo(2,"h6",15),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function uO(t,e){1&t&&(Mo(0,"span"),va(1,"Add by membership state"),Io())}function dO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.activeState)}}function pO(t,e){if(1&t){const t=No();Mo(0,"button",20),Vo("click",function(){Ie(t);const n=e.$implicit;return zo(2).activeState=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function fO(t,e){if(1&t&&(Mo(0,"div",16),Mo(1,"button",17),Do(2,uO,2,0,"span",11),Do(3,dO,2,1,"span",11),Io(),Mo(4,"div",18),Do(5,pO,2,1,"button",19),Io(),Io()),2&t){const t=zo();Qr(2),Fo("ngIf",!t.activeState||""===t.activeState),Qr(1),Fo("ngIf",t.activeState&&""!==t.activeState),Qr(2),Fo("ngForOf",t.states)}}function gO(t,e){if(1&t){const t=No();Mo(0,"div",21),Mo(1,"div",22),Mo(2,"div",23),Mo(3,"form",24),Mo(4,"div",25),$o(5,"input",26),Mo(6,"div",27),Mo(7,"div",28),Mo(8,"button",29),Vo("click",function(){return Ie(t),zo().add()}),va(9,"Add"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io()}if(2&t){const t=zo();Qr(3),Fo("formGroup",t.addForm)}}function mO(t,e){1&t&&(Mo(0,"th",30),va(1,"Demote"),Io())}function vO(t,e){1&t&&(Mo(0,"th",30),va(1,"Promote"),Io())}function yO(t,e){1&t&&(Mo(0,"th",31),va(1,"Remove"),Io())}function bO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No group membership found."),Io(),Io())}function wO(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function xO(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function _O(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function CO(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function SO(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function EO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().demoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",38),$o(3,"path",39),Io(),Io(),Io()}}function kO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().promoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",40),$o(3,"path",41),Io(),Io(),Io()}}function AO(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function DO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,wO,2,0,"span",11),Do(7,xO,2,0,"span",11),Do(8,_O,2,0,"span",11),Do(9,CO,2,0,"span",11),Do(10,SO,2,0,"span",11),Io(),Mo(11,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,EO,4,0,"td",34),Do(14,kO,4,0,"td",34),Do(15,AO,3,0,"td",35),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.user.update_time),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed())}}let TO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.authService=r,this.error="",this.members=[],this.activeState="Add Member",this.states=["Add Member","Join"],this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.onSameUrlNavigation="reload",this.addForm=this.formBuilder.group({ids:[""]})}ngOnInit(){this.route.data.subscribe(t=>{this.members.length=0,this.members.push(...t[0].group_users)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}editionAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",n.user.id,this.group.id).subscribe(()=>{this.members.splice(e,1)},t=>{this.error=t})}demoteGroupUser(t,e,n){this.error="",this.consoleService.demoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state++},t=>{this.error=t})}promoteGroupUser(t,e,n){this.error="",this.consoleService.promoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state--},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/accounts",t.user.id],{relativeTo:this.route})}add(){this.consoleService.addGroupUsers("",this.group.id,{ids:this.f.ids.value,join_request:"Join"===this.activeState}).subscribe(()=>{this.error="",this.router.navigate([this.router.url])},t=>{this.error=t})}get f(){return this.addForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:21,vars:8,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["class","btn-group mb-1","ngbDropdown","",4,"ngIf"],["class","row no-gutters mb-4",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 70px",4,"ngIf"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup"],[1,"input-group"],["id","ids","type","text","formControlName","ids","placeholder","Add user IDs as members, comma-separated",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],[2,"width","70px"],[2,"width","90px"],["colSpan","7",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],["class","text-center align-middle",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-outline-secondary",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-down"],["fill-rule","evenodd","d","M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-up"],["fill-rule","evenodd","d","M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"],[1,"text-center","align-middle"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,hO,4,2,"ngb-alert",0),Do(1,fO,6,3,"div",1),Do(2,gO,10,1,"div",2),Mo(3,"div",3),Mo(4,"table",4),Mo(5,"thead",5),Mo(6,"tr"),Mo(7,"th",6),va(8,"User ID"),Io(),Mo(9,"th"),va(10,"Name"),Io(),Mo(11,"th",7),va(12,"State"),Io(),Mo(13,"th",8),va(14,"Update Time"),Io(),Do(15,mO,2,0,"th",9),Do(16,vO,2,0,"th",9),Do(17,yO,2,0,"th",10),Io(),Io(),Mo(18,"tbody"),Do(19,bO,3,0,"tr",11),Do(20,DO,16,11,"tr",12),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.group.open&&e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(13),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(2),Fo("ngIf",0===e.members.length),Qr(1),Fo("ngForOf",e.members))},directives:[Bh,Ph,_x,Kx,qx,Wx,zx,pb,Ry,mb,ay,Ty,yb],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),RO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getMembers("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FO(t,e){if(1&t&&(Mo(0,"ngb-alert",28),$o(1,"img",29),Mo(2,"h6",30),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function LO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeType)}}function MO(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeType=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function IO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeNode)}}function $O(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeNode=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function OO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No realtime matches were found."),Io(),Io())}function PO(t,e){1&t&&$o(0,"div",40)}function NO(t,e){1&t&&$o(0,"div",41)}function BO(t,e){if(1&t){const t=No();Mo(0,"div",37),Vo("click",function(){Ie(t);const e=zo(),n=e.index,i=e.$implicit,r=zo();return r.getMatchState(n,i),r.matchStatesOpen[n]=!r.matchStatesOpen[n]}),Do(1,PO,1,0,"div",38),Do(2,NO,1,0,"div",39),Io()}if(2&t){const t=zo().index,e=zo();Qr(1),Fo("ngIf",!e.matchStatesOpen[t]),Qr(1),Fo("ngIf",e.matchStatesOpen[t])}}function UO(t,e){1&t&&$o(0,"div",42)}function VO(t,e){1&t&&(Mo(0,"span"),va(1,"Yes"),Io())}function HO(t,e){1&t&&(Mo(0,"span"),va(1,"No"),Io())}function jO(t,e){1&t&&$o(0,"img",51)}function zO(t,e){if(1&t&&(Mo(0,"div"),Mo(1,"small"),Mo(2,"b"),va(3,"Current Tick"),Io(),Io(),Mo(4,"pre",47),Mo(5,"small"),va(6),Io(),Io(),Mo(7,"small"),Mo(8,"b"),va(9,"Match State"),Io(),Io(),Mo(10,"pre",47),Mo(11,"small"),va(12),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(6),ya(e.matchStates[t].tick),Qr(6),ya(e.matchStates[t].state)}}function WO(t,e){1&t&&$o(0,"img",51)}function GO(t,e){if(1&t&&(Mo(0,"pre",47),Mo(1,"small"),va(2),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.getMatchPresencesString(e.matchStates[t].presences))}}function qO(t,e){if(1&t&&(Mo(0,"tr",43),Mo(1,"td",44),Mo(2,"div",45),Mo(3,"div",46),Mo(4,"small"),Mo(5,"b"),va(6,"Match Label"),Io(),Io(),Mo(7,"pre",47),Mo(8,"small"),va(9),Io(),Io(),Io(),Mo(10,"div",48),Do(11,jO,1,0,"img",49),Do(12,zO,13,2,"div",7),Io(),Mo(13,"div",48),Mo(14,"small"),Mo(15,"b"),va(16,"Match Presences"),Io(),Io(),Do(17,WO,1,0,"img",49),Do(18,GO,3,1,"pre",50),Io(),Io(),Io(),Io()),2&t){const t=zo(),e=t.$implicit,n=t.index,i=zo();Qr(9),ya(e.api_match.label),Qr(2),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n]),Qr(5),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n])}}function KO(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Do(2,BO,3,2,"div",33),Do(3,UO,1,0,"div",34),va(4),Io(),Mo(5,"td"),va(6),Io(),Mo(7,"td",35),Do(8,VO,2,0,"span",7),Do(9,HO,2,0,"span",7),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Io(),Do(16,qO,19,5,"tr",36)),2&t){const t=e.index,n=e.$implicit,i=zo();Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(1),ba(" ",n.api_match.match_id," "),Qr(2),ya(n.api_match.size),Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(2),ya(n.node),Qr(2),ya(n.api_match.handler_name),Qr(2),ya(n.api_match.authoritative?n.api_match.tick_rate:"-"),Qr(1),Fo("ngIf",i.matchStatesOpen[t])}}let XO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.formBuilder=n,this.consoleService=i,this.error="",this.matches=[],this.matchStates=[],this.matchStatesOpen=[],this.updated=!1,this.activeType="All",this.types=["All","Authoritative","Relayed"],this.activeNode="All Nodes",this.nodes=["All Nodes"],this.searchForm1=this.formBuilder.group({match_id:""}),this.searchForm2=this.formBuilder.group({match_id:""}),this.searchForm3=this.formBuilder.group({query:""})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.match_id.setValue(t.get("match_id")),this.f2.match_id.setValue(t.get("match_id")),this.f3.query.setValue(t.get("query"));let e=t.get("type");this.type=Number(e);let n=t.get("node");if(this.route.data.subscribe(t=>{console.log(t),t&&(t[0]&&(this.error="",this.matches.length=0,this.matches.push(...t[0].matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length),t[1]&&this.nodes.push(...t[1]),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=0,this.activeType=this.types[0]):0==this.type||1==this.type||2==this.type?this.activeType=this.types[this.type]:this.error="Invalid type",null!==n){let t=!1;this.nodes.forEach(e=>{n===e&&(this.activeNode=n,t=!0)}),t||(this.error="Invalid node.")}}search(){const t=this.getType();this.type=t,JO(this.consoleService,t,0==t?this.f1.match_id.value:this.f2.match_id.value,this.f3.query.value,this.activeNode===this.nodes[0]?"":this.activeNode).subscribe(t=>this.postData(t),t=>{this.error=t})}postData(t){let e;switch(this.error="",this.matches.length=0,this.matches.push(...t.matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length,this.type){case 0:e={type:this.type,match_id:this.f1.match_id.value};break;case 1:e={type:this.type,query:this.f3.query.value},this.activeNode!==this.nodes[0]&&(e.node=this.activeNode);break;case 2:e={type:this.type,match_id:this.f2.match_id.value}}this.router.navigate([],{relativeTo:this.route,queryParams:e})}getType(){let t=0;return this.types.forEach((e,n)=>{this.activeType===e&&(t=n)}),t}getMatchState(t,e){this.matchStatesOpen[t]||(this.matchStates[t]=null,this.error="",this.consoleService.getMatchState("",e.api_match.match_id).subscribe(e=>{this.matchStatesOpen[t]=!0,this.matchStates[t]=e},e=>{this.matchStatesOpen[t]=!1,this.matchStates[t]=null,this.error=e}))}getMatchPresencesString(t){return JSON.stringify(t)}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(_b),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:53,vars:16,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"input-group","mb-1"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-right"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","match_id","placeholder","Filter by match ID",1,"form-control"],["type","text","formControlName","query","placeholder","Filter by query or match ID",1,"form-control","border-right-0"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-left"],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","140px"],[2,"width","100px"],[2,"width","130px"],[2,"width","90px"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","button","ngbDropdownItem","",3,"click"],["colSpan","8",1,"text-muted"],["class","arrow",3,"click",4,"ngIf"],["class","d-inline-block mr-3",4,"ngIf"],[1,"text-center"],["class","open-row",4,"ngIf"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"d-inline-block","mr-3"],[1,"open-row"],["colspan","6",1,"align-middle"],[1,"d-flex","p-0"],[1,"p-3","w-33","border"],[1,"pre-wrap","m-0","p-0"],[1,"p-3","w-33","border","border-left-0"],["src","/static/spinner.svg","class","d-block","width","16",4,"ngIf"],["class","pre-wrap m-0 p-0",4,"ngIf"],["src","/static/spinner.svg","width","16",1,"d-block"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Active Matches"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FO,4,2,"ngb-alert",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"div",5),Mo(8,"button",6),Do(9,LO,2,1,"span",7),Io(),Mo(10,"div",8),Do(11,MO,2,1,"button",9),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"button",11),Vo("click",function(){return e.search()}),va(14,"Search"),Io(),Io(),Io(),Mo(15,"div",12),Mo(16,"div",13),Mo(17,"div",14),Mo(18,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(19,"div",16),$o(20,"input",17),Io(),Io(),Mo(21,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(22,"div",16),$o(23,"input",17),Io(),Io(),Mo(24,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(25,"div",16),$o(26,"input",18),Mo(27,"div",10),Mo(28,"div",5),Mo(29,"button",19),Do(30,IO,2,1,"span",7),Io(),Mo(31,"div",8),Do(32,$O,2,1,"button",9),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(33,"div",20),Mo(34,"table",21),Mo(35,"thead",22),Mo(36,"tr"),Mo(37,"th"),Mo(38,"span"),va(39,"Match ID"),Io(),Io(),Mo(40,"th",23),va(41,"Presence Count"),Io(),Mo(42,"th",24),va(43,"Authoritative"),Io(),Mo(44,"th",24),va(45,"Node"),Io(),Mo(46,"th",25),va(47,"Handler Name"),Io(),Mo(48,"th",26),va(49,"Tick Rate"),Io(),Io(),Io(),Mo(50,"tbody"),Do(51,OO,3,0,"tr",7),Do(52,KO,17,10,"ng-template",27),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.matches.length," running matches found."),Qr(1),Fo("ngIf",e.error),Qr(5),Fo("ngIf",e.activeType&&""!==e.activeType),Qr(2),Fo("ngForOf",e.types),Qr(7),Fo("hidden","All"!==e.activeType)("formGroup",e.searchForm1),Qr(3),Fo("hidden","Relayed"!==e.activeType)("formGroup",e.searchForm2),Qr(3),Fo("hidden","Authoritative"!==e.activeType)("formGroup",e.searchForm3),Qr(6),Fo("ngIf",e.activeNode&&""!==e.activeNode),Qr(2),Fo("ngForOf",e.nodes),Qr(6),ra("pl-3",e.matches.length>0),Qr(13),Fo("ngIf",0===e.matches.length),Qr(1),Fo("ngForOf",e.matches))},directives:[Bh,Kx,qx,Wx,Ph,pb,Ry,mb,ay,Ty,yb,_x,zx],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}.open-row[_ngcontent-%COMP%]{background:#fafafc}.w-33[_ngcontent-%COMP%]{width:33.3333%!important}.dropdown-radius-right[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),YO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));return JO(this.consoleService,n,t.queryParamMap.get("match_id"),t.queryParamMap.get("query"),t.queryParamMap.get("node")).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JO(t,e,n,i,r){switch(e){case 0:return t.listMatches("",null,null,null,null,null,n);case 1:return t.listMatches("",null,!0,null,null,null,null,i,r);case 2:return t.listMatches("",null,!1,null,null,null,n)}return ff(null)}let QO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function ZO(t,e){if(1&t&&(Mo(0,"ngb-alert",25),$o(1,"img",26),Mo(2,"h6",27),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying groups: ",t.error,"")}}function tP(t,e){1&t&&(Mo(0,"th",28),va(1,"Remove"),Io())}function eP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No groups found - change the filter criteria or add new user groups."),Io(),Io())}function nP(t,e){1&t&&$o(0,"td")}function iP(t,e){if(1&t){const t=No();Mo(0,"td",32),Mo(1,"button",33),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroup(e,i,r)}),va(2,"Delete"),Io(),Io()}}function rP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(2),Io(),Mo(3,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(4),Io(),Mo(5,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(6),Io(),Do(7,nP,1,0,"td",23),Do(8,iP,3,0,"td",31),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let sP=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.groupsCount=0,this.groups=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):this.f.filter.value&&this.search(0),this.route.data.subscribe(t=>{this.groups.length=0,t&&(this.groups.push(...t[0].groups),this.groupsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listGroups("",this.f.filter.value,e).subscribe(t=>{this.error="",this.groups.length=0,this.groups.push(...t.groups),this.groupsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteGroup(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroup("",n.id).subscribe(()=>{this.error="",this.groups.splice(e,1),this.groupsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewGroup(t){this.router.navigate(["/groups",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:35,vars:8,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by group ID or name (use '%' for wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Groups"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"div",9),Mo(12,"button",10),Vo("click",function(){return e.search(0)}),va(13,"Search"),Io(),Io(),Io(),Io(),Io(),Io(),Mo(14,"div",11),Mo(15,"div",12),Mo(16,"button",13),Vo("click",function(){return e.search(0)}),$o(17,"img",14),Io(),Mo(18,"button",13),Vo("click",function(){return e.search(1)}),$o(19,"img",15),Io(),Io(),Io(),Io(),Io(),Do(20,ZO,4,2,"ngb-alert",16),Mo(21,"div",17),Mo(22,"table",18),Mo(23,"thead",19),Mo(24,"tr"),Mo(25,"th",20),va(26,"Group ID"),Io(),Mo(27,"th"),va(28,"Name"),Io(),Mo(29,"th",21),va(30,"Last Update"),Io(),Do(31,tP,2,0,"th",22),Io(),Io(),Mo(32,"tbody"),Do(33,eP,3,0,"tr",23),Do(34,rP,9,5,"tr",24),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.groupsCount," groups found."),Qr(4),Fo("formGroup",e.searchForm),Qr(9),Fo("disabled",0===e.groups.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(11),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[pb,Ry,mb,ay,Ty,yb,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),oP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter");return this.consoleService.listGroups("",n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function aP(t,e){if(1&t){const t=No();Mo(0,"button",13),Vo("click",function(e){return Ie(t),zo().exportGroup(e)}),$o(1,"img",14),va(2,"Export"),Io()}}function lP(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().deleteGroup(e,!1)}),$o(1,"img",16),va(2,"Delete"),Io()}}function cP(t,e){if(1&t&&(Mo(0,"ngb-alert",17),$o(1,"img",18),Mo(2,"h6",19),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const hP=function(t,e){return["/groups",t,e]};function uP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,20),Mo(2,"a",21),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,hP,n.group.id,t.path)),Qr(1),ya(t.label)}}const dP=function(){return["/groups"]};let pP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Members",path:"members"}]}ngOnInit(){this.route.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}deleteGroup(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteGroup("",this.group.id).subscribe(()=>{this.error="",this.router.navigate(["/groups"])},t=>{this.error=t})}exportGroup(t){t.target.disabled=!0,this.error="",this.consoleService.exportGroup("",this.group.id).subscribe(e=>{this.error="";const n=this.group.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:18,vars:7,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Group"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Group"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,aP,3,0,"button",7),Do(12,lP,3,0,"button",8),Io(),Io(),Do(13,cP,4,2,"ngb-alert",9),Mo(14,"nav",10,11),Do(16,uP,4,6,"div",12),Io(),$o(17,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(6,dP)),Qr(3),ya(e.group.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),fP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getGroup("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function gP(t,e){if(1&t){const t=No();Mo(0,"button",12),Vo("click",function(e){return Ie(t),zo().deleteLeaderboard(e)}),$o(1,"img",13),va(2,"Delete Leaderboard"),Io()}}function mP(t,e){if(1&t&&(Mo(0,"ngb-alert",14),$o(1,"img",15),Mo(2,"h6",16),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const vP=function(t,e){return["/leaderboards",t,e]};function yP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,17),Mo(2,"a",18),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,vP,n.leaderboard.id,t.path)),Qr(1),ya(t.label)}}const bP=function(){return["/leaderboards"]};let wP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Records",path:"records"}]}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}deleteLeaderboard(t){t.target.disabled=!0,this.error="",this.consoleService.deleteLeaderboard("",this.leaderboard.id).subscribe(()=>{this.error="",this.router.navigate(["/leaderboards"])},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:6,consts:[[1,"pb-1"],[1,"leaderboard-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-danger btn-danger-icon",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["leaderboardNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-danger","btn-danger-icon",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","13","height","13",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboard"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Leaderboards"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,gP,3,0,"button",7),Io(),Io(),Do(12,mP,4,2,"ngb-alert",8),Mo(13,"nav",9,10),Do(15,yP,4,6,"div",11),Io(),$o(16,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(5,bP)),Qr(3),ya(e.leaderboard.id),Qr(2),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.leaderboard-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.leaderboard-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),xP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getLeaderboard("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const _P=["editor"];function CP(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function SP(t,e){if(1&t&&(Mo(0,"div",27),Mo(1,"h6"),va(2,"Tournament"),Io(),$o(3,"hr",28),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"label",29),va(8,"Title"),Io(),Io(),$o(9,"input",30),Io(),Mo(10,"div",3),Mo(11,"div",4),Mo(12,"label",31),va(13,"Description"),Io(),Io(),$o(14,"input",32),Io(),Io(),Mo(15,"div",2),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"label",33),va(19,"Category"),Io(),Io(),$o(20,"input",34),Io(),Mo(21,"div",3),Mo(22,"div",4),Mo(23,"label",35),va(24,"Max Num Score"),Io(),Io(),$o(25,"input",36),Io(),Io(),Mo(26,"div",2),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"label",37),va(30,"Size"),Io(),Io(),$o(31,"input",38),Io(),Mo(32,"div",3),Mo(33,"div",4),Mo(34,"label",39),va(35,"Max Size"),Io(),Io(),$o(36,"input",40),Io(),Io(),Mo(37,"div",2),Mo(38,"div",3),Mo(39,"div",4),Mo(40,"label",41),va(41,"Duration"),Io(),Io(),$o(42,"input",42),Io(),Mo(43,"div",3),Mo(44,"div",4),Mo(45,"label",43),va(46,"Join Required"),Io(),Io(),$o(47,"input",44),Io(),Io(),Mo(48,"div",2),Mo(49,"div",3),Mo(50,"div",4),Mo(51,"label",45),va(52,"Start Time"),Io(),Io(),$o(53,"input",46),Io(),Mo(54,"div",3),Mo(55,"div",4),Mo(56,"label",47),va(57,"End Time"),Io(),Io(),$o(58,"input",48),Io(),Io(),Mo(59,"div",2),Mo(60,"div",3),Mo(61,"div",4),Mo(62,"label",49),va(63,"Start Active"),Io(),Io(),$o(64,"input",50),Io(),Mo(65,"div",3),Mo(66,"div",4),Mo(67,"label",51),va(68,"End Active"),Io(),Io(),$o(69,"input",52),Io(),Io(),Io()),2&t){const t=zo();Qr(9),Fo("value",t.leaderboard.title),Qr(5),Fo("value",t.leaderboard.description),Qr(6),Fo("value",t.leaderboard.category),Qr(5),Fo("value",t.leaderboard.max_num_score),Qr(6),Fo("value",t.leaderboard.size),Qr(5),Fo("value",t.leaderboard.max_size),Qr(6),Fo("value",t.leaderboard.duration),Qr(5),Fo("value",t.leaderboard.join_required),Qr(6),Fo("value",t.leaderboard.start_time),Qr(5),Fo("value",t.leaderboard.end_time),Qr(6),Fo("value",t.leaderboard.start_active),Qr(5),Fo("value",t.leaderboard.end_active)}}let EP=(()=>{class t{constructor(t){this.route=t,this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"},this.error=""}ngOnInit(){this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}ngAfterViewInit(){if(vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.leaderboard.metadata){const t=JSON.stringify(JSON.parse(this.leaderboard.metadata),null,2);this.aceEditor.session.setValue(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(_P,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:50,vars:10,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border","mb-3"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","id",1,"d-inline"],["type","text","id","id","placeholder","ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","authoritative",1,"d-inline"],["type","text","id","authoritative","placeholder","Authoritative","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","sortorder",1,"d-inline"],["type","text","id","sortorder","placeholder","Sort Order","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","operator",1,"d-inline"],["type","text","id","operator","placeholder","Operator","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","reset",1,"d-inline"],["type","text","id","reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"row","add-border-single-row-bottom"],["type","text","id","prev_reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["type","text","id","next_reset","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["class","mt-4",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"mt-4"],[1,"mb-4"],["for","title",1,"d-inline"],["type","text","id","title","placeholder","Title","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","category",1,"d-inline"],["type","text","id","category","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_num_score",1,"d-inline"],["type","text","id","max_num_score","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","size",1,"d-inline"],["type","text","id","size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_size",1,"d-inline"],["type","text","id","max_size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","duration",1,"d-inline"],["type","text","id","duration","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","join_required",1,"d-inline"],["type","text","id","join_required","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_time",1,"d-inline"],["type","text","id","start_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_time",1,"d-inline"],["type","text","id","end_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_active",1,"d-inline"],["type","text","id","start_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_active",1,"d-inline"],["type","text","id","end_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"]],template:function(t,e){1&t&&(Do(0,CP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"label",5),va(6,"ID"),Io(),Io(),$o(7,"input",6),Io(),Mo(8,"div",3),Mo(9,"div",4),Mo(10,"label",7),va(11,"Authoritative"),Io(),Io(),$o(12,"input",8),Io(),Io(),Mo(13,"div",2),Mo(14,"div",3),Mo(15,"div",4),Mo(16,"label",9),va(17,"Sort Order"),Io(),Io(),$o(18,"input",10),Io(),Mo(19,"div",3),Mo(20,"div",4),Mo(21,"label",11),va(22,"Operator"),Io(),Io(),$o(23,"input",12),Io(),Io(),Mo(24,"div",2),Mo(25,"div",3),Mo(26,"div",4),Mo(27,"label",13),va(28,"Reset Schedule"),Io(),Io(),$o(29,"input",14),Io(),Mo(30,"div",3),Mo(31,"div",4),Mo(32,"label",15),va(33,"Create Time"),Io(),Io(),$o(34,"input",16),Io(),Io(),Mo(35,"div",17),Mo(36,"div",3),Mo(37,"div",4),Mo(38,"label",13),va(39,"Prev Reset"),Io(),Io(),$o(40,"input",18),Io(),Mo(41,"div",3),Mo(42,"div",4),Mo(43,"label",15),va(44,"Next Reset"),Io(),Io(),$o(45,"input",19),Io(),Io(),Io(),Do(46,SP,70,12,"div",20),Mo(47,"div",21),$o(48,"div",22,23),Io()),2&t&&(Fo("ngIf",e.error),Qr(7),Fo("value",e.leaderboard.id),Qr(5),Fo("value",e.leaderboard.authoritative),Qr(6),Fo("value",e.orderString[e.leaderboard.sort_order]),Qr(5),Fo("value",e.operatorString[e.leaderboard.operator]),Qr(6),Fo("value",e.leaderboard.reset_schedule),Qr(5),Fo("value",e.leaderboard.create_time),Qr(6),Fo("value",e.leaderboard.prev_reset),Qr(5),Fo("value",e.leaderboard.next_reset),Qr(1),Fo("ngIf",e.leaderboard.tournament))},directives:[Bh,_x],styles:[".leaderboard-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})();function kP(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function AP(t,e){1&t&&(Mo(0,"th",22),va(1,"Remove"),Io())}function DP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",23),va(2,"No records found."),Io(),Io())}function TP(t,e){1&t&&$o(0,"div",28)}function RP(t,e){1&t&&$o(0,"div",29)}function FP(t,e){if(1&t){const t=No();Mo(0,"td",30),Mo(1,"button",31),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteRecord(e,i,r)}),va(2,"Delete"),Io(),Io()}}function LP(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",32),Mo(2,"pre",33),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function MP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",24),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.recordsMetadataOpen[n]=!i.recordsMetadataOpen[n]}),Do(3,TP,1,0,"div",25),Do(4,RP,1,0,"div",26),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Mo(16,"td"),va(17),Io(),Do(18,FP,3,0,"td",27),Io(),Do(19,LP,5,1,"tr",17)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.recordsMetadataOpen[t]),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t]),Qr(1),ba(" ",n.owner_id," "),Qr(2),ya(n.username),Qr(2),ya(n.score),Qr(2),ya(n.subscore),Qr(2),ya(n.rank),Qr(2),ya(n.num_score),Qr(2),ya(n.expiry_time?n.expiry_time:"-"),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t])}}let IP=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.authService=n,this.error="",this.records=[],this.recordsMetadataOpen=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.route.data.subscribe(t=>{this.records.length=0,this.records.push(...t[0].records),this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}loadRecords(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listLeaderboardRecords("",this.leaderboard.id,null,100,e,null).subscribe(t=>{this.error="",this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor,this.records.length=0,this.records.push(...t.records),this.recordsMetadataOpen.length=0,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t})}deleteRecord(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboardRecord("",n.leaderboard_id,n.owner_id).subscribe(()=>{this.error="",this.records.splice(e,1),this.recordsMetadataOpen.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:34,vars:7,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","380px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","8",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,kP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadRecords(0)}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadRecords(-1)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadRecords(1)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th",13),va(17,"Owner ID"),Io(),Mo(18,"th"),va(19,"Username"),Io(),Mo(20,"th",14),va(21,"Score"),Io(),Mo(22,"th",14),va(23,"Subscore"),Io(),Mo(24,"th",14),va(25,"Rank"),Io(),Mo(26,"th",14),va(27,"No. of scores"),Io(),Mo(28,"th",15),va(29,"Expiry Time"),Io(),Do(30,AP,2,0,"th",16),Io(),Io(),Mo(31,"tbody"),Do(32,DP,3,0,"tr",17),Do(33,MP,20,11,"ng-template",18),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.records.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(20),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.records.length),Qr(1),Fo("ngForOf",e.records))},directives:[Bh,Ph,_x],styles:[""]}),t})(),$P=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listLeaderboardRecords("",n,null,100,null,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const OP=["editor"],PP=["editorResponse"];function NP(t,e){if(1&t&&(Mo(0,"ngb-alert",23),$o(1,"img",24),Mo(2,"h6",25),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error whilst making RPC call: ",t.error,"")}}function BP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}function UP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}let VP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.error="",this.rpcEndpoints=[],this.endpoints=[]}ngOnInit(){this.endpointCallForm=this.formBuilder.group({method:["",py.required],user_id:[""]}),this.f.method.valueChanges.subscribe(t=>{const e=this.endpoints.concat(this.rpcEndpoints).find(e=>e.method===t?e:null);this.updateQueryParam(e.method),this.setupRequestBody(e.body_template)}),this.route.data.subscribe(t=>{const e=t[0];this.endpoints.length=0,this.endpoints.push(...e.endpoints),this.rpcEndpoints.length=0,this.rpcEndpoints.push(...e.rpc_endpoints)},t=>{this.error=t});const t=this.endpoints.concat(this.rpcEndpoints).find(t=>t.method===this.route.snapshot.queryParamMap.get("endpoint")?t:null);null!=t&&this.f.method.setValue(t.method)}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.aceEditorResponse=vI.edit(this.editorResponse.nativeElement),this.aceEditorResponse.setReadOnly(!0)}sendRequest(){this.error="";let t=this.aceEditor.session.getValue();if(""!==t)try{t=JSON.stringify(JSON.parse(t))}catch(i){return void(this.error=i)}const e={user_id:this.f.user_id.value,body:t};let n=null;n=this.isRpcEndpoint(this.f.method.value)?this.consoleService.callRpcEndpoint("",this.f.method.value,e):this.consoleService.callApiEndpoint("",this.f.method.value,e),n.subscribe(e=>{if(e.error_message&&""!==e.error_message)this.aceEditorResponse.session.setValue(e.error_message);else{t="";try{t=JSON.stringify(JSON.parse(e.body),null,2)}catch(i){return void(this.error=i)}this.aceEditorResponse.session.setValue(t)}},t=>{this.aceEditorResponse.session.setValue(""),this.error=t})}isRpcEndpoint(t){return null!=this.rpcEndpoints.find(e=>e.method===t?e:null)}setupRequestBody(t){if(null!=this.aceEditor){if(!t||""===t)return this.aceEditor.session.setValue(""),void this.aceEditor.setReadOnly(!this.isRpcEndpoint(this.f.method.value));try{const e=JSON.stringify(JSON.parse(t),null,2);this.aceEditor.session.setValue(e),this.aceEditor.setReadOnly(!1)}catch(e){return void(this.error=e)}}else console.log("problem?")}updateQueryParam(t){this.router.navigate([],{relativeTo:this.route,queryParams:{endpoint:t},queryParamsHandling:"merge"})}get f(){return this.endpointCallForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&(sc(OP,!0),sc(PP,!0)),2&t){let t;ic(t=lc())&&(e.editor=t.first),ic(t=lc())&&(e.editorResponse=t.first)}},decls:35,vars:6,consts:[[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["id","method","formControlName","method",1,"form-control","custom-select","dropdown-radius"],["disabled","",3,"value"],[3,"value",4,"ngFor","ngForOf"],["disabled","",1,"text-muted"],["type","text","formControlName","user_id","placeholder","set user ID as request context",1,"form-control","border-right-0"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"d-flex"],[1,"w-50","py-3"],[1,"mb-4"],[1,"card","p-2","mb-3"],[2,"height","500px"],["editor",""],[1,"w-50","pl-3","py-3"],["editorResponse",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"value"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"API Explorer"),Io(),Do(2,NP,4,2,"ngb-alert",1),Mo(3,"div",2),Mo(4,"div",3),Mo(5,"div",4),Mo(6,"form",5),Vo("ngSubmit",function(){return e.sendRequest()}),Mo(7,"div",6),Mo(8,"div",7),Mo(9,"select",8),Mo(10,"option",9),va(11,"Select Endpoint"),Io(),Do(12,BP,2,2,"option",10),Mo(13,"option",11),va(14,"----"),Io(),Do(15,UP,2,2,"option",10),Io(),Io(),$o(16,"input",12),Mo(17,"div",13),Mo(18,"button",14),va(19,"Send Request"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(20,"div",15),Mo(21,"div",16),Mo(22,"h5"),va(23,"Request Body"),Io(),$o(24,"hr",17),Mo(25,"div",18),$o(26,"div",19,20),Io(),Io(),Mo(28,"div",21),Mo(29,"h5"),va(30,"Response"),Io(),$o(31,"hr",17),Mo(32,"div",18),$o(33,"div",19,22),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(4),Fo("formGroup",e.endpointCallForm),Qr(4),Fo("value",""),Qr(2),Fo("ngForOf",e.rpcEndpoints),Qr(3),Fo("ngForOf",e.endpoints),Qr(3),Fo("disabled",e.f.method.invalid))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Vy,Wy,Ph,ay,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}"]}),t})(),HP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listApiEndpoints("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jP(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function zP(t,e){1&t&&$o(0,"div",23)}function WP(t,e){1&t&&$o(0,"div",24)}function GP(t,e){if(1&t&&(Mo(0,"tr",25),Mo(1,"td",26),Mo(2,"div",27),Mo(3,"div"),Mo(4,"small"),Mo(5,"b"),va(6,"Provider Response"),Io(),Io(),Io(),Mo(7,"div"),Mo(8,"pre",28),Mo(9,"small"),va(10),Io(),Io(),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(10),ya(t.provider_response)}}function qP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",19),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.purchasesRowsOpen[n]=!i.purchasesRowsOpen[n]}),Do(3,zP,1,0,"div",20),Do(4,WP,1,0,"div",21),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Io(),Do(14,GP,11,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.purchasesRowsOpen[t]),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t]),Qr(1),ba(" ",n.product_id," "),Qr(2),ya(n.transaction_id),Qr(2),ya(i.getStoreText(n.store)),Qr(2),ya(n.purchase_time),Qr(2),ya(n.create_time),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t])}}function KP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No purchases were found."),Io(),Io())}let XP=(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.purchases=[],this.purchasesRowsOpen=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.purchases=t[0].validated_purchases,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listPurchases("",this.userID,this.limit,t).subscribe(t=>{this.purchases=t.validated_purchases,this.purchasesRowsOpen=[],this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-purchases"]],decls:29,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"open-row"],["colspan","7"],[1,"p-2"],[1,"pre-wrap","m-0","p-0"],["colspan","5",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,jP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Create Time"),Io(),Io(),Io(),Mo(26,"tbody"),Do(27,qP,15,8,"ng-template",14),Do(28,KP,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.purchases.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(17),Fo("ngForOf",e.purchases),Qr(1),Fo("ngIf",0===e.purchases.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),YP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listPurchases("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JP(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by type"),Io())}function QP(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeFilter)}}function ZP(t,e){if(1&t){const t=No();Mo(0,"button",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeFilter=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function tN(t,e){if(1&t&&(Mo(0,"h6"),va(1),Io()),2&t){const t=zo();Qr(1),ba("Showing results for chat room label: ",t.f1.label.value,"")}}const eN=function(t){return["/groups",t]};function nN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for group ID: "),Mo(2,"a",41),va(3),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(2,eN,t.route.snapshot.queryParamMap.get("group_id"))),Qr(1),ya(t.f2.group_id.value)}}const iN=function(t){return["/accounts",t]};function rN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for user IDs: "),Mo(2,"a",41),va(3),Io(),va(4,", "),Mo(5,"a",41),va(6),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(4,iN,t.route.snapshot.queryParamMap.get("user_id_one"))),Qr(1),ya(t.f3.user_id_one.value),Qr(2),Fo("routerLink",Vl(6,iN,t.route.snapshot.queryParamMap.get("user_id_two"))),Qr(1),ya(t.f3.user_id_two.value)}}function sN(t,e){if(1&t&&(Mo(0,"ngb-alert",42),$o(1,"img",43),Mo(2,"h6",44),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying messages: ",t.error,"")}}function oN(t,e){1&t&&(Mo(0,"th",45),va(1,"Remove"),Io())}function aN(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",46),va(2,"No messages found."),Io(),Io()),2&t){const t=zo();Qr(1),ko("colspan",t.deleteAllowed()?6:5)}}function lN(t,e){1&t&&$o(0,"div",55)}function cN(t,e){1&t&&$o(0,"div",56)}function hN(t,e){1&t&&$o(0,"td")}function uN(t,e){if(1&t){const t=No();Mo(0,"td",57),Mo(1,"button",58),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteMessage(e,i,r)}),va(2,"Delete"),Io(),Io()}}function dN(t,e){if(1&t&&(Mo(0,"tr",59),Mo(1,"td"),va(2),Io(),Io()),2&t){const t=zo().$implicit,e=zo();Qr(1),ko("colspan",e.deleteAllowed()?6:5),Qr(1),ba(" ",t.content," ")}}function pN(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",47),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",48),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",49),Mo(8,"div",50),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.messageStatesOpen[n]=!i.messageStatesOpen[n]}),Do(9,lN,1,0,"div",51),Do(10,cN,1,0,"div",52),Io(),va(11),Io(),Mo(12,"td"),va(13),Io(),Do(14,hN,1,0,"td",3),Do(15,uN,3,0,"td",53),Io(),Do(16,dN,3,2,"tr",54)}if(2&t){const t=e.$implicit,n=e.index,i=zo();Qr(2),ya(t.code),Qr(2),ya(t.sender_id),Qr(2),ya(t.username),Qr(3),Fo("ngIf",!i.messageStatesOpen[n]),Qr(1),Fo("ngIf",i.messageStatesOpen[n]),Qr(1),ba(" ",t.content," "),Qr(2),ya(t.create_time),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id===i.systemUserId),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id!==i.systemUserId),Qr(1),Fo("ngIf",i.messageStatesOpen[n])}}function fN(t,e){if(1&t&&(Mo(0,"ngb-alert",60),$o(1,"img",43),Mo(2,"h6",44),va(3,"Failed to delete data."),Io(),Mo(4,"p",61),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.deleteError)}}function gN(t,e){if(1&t){const t=No();Mo(0,"ngb-alert",62),Vo("close",function(){return Ie(t),zo().deleteSuccess=!1}),$o(1,"img",63),Mo(2,"h6",44),va(3),Io(),Io()}if(2&t){const t=zo();Fo("dismissible",!0),Qr(3),wa("",t.total_deleted," messages ",t.total_deleted>0?"successfully":""," deleted.")}}const mN=function(t){return{"is-invalid":t}};function vN(t,e){if(1&t&&(Mo(0,"div",64),Mo(1,"h5",65),va(2,"Delete messages"),Io(),Mo(3,"button",66),Vo("click",function(){return e.$implicit.dismiss()}),Mo(4,"span",67),va(5,"\xd7"),Io(),Io(),Io(),Mo(6,"div",68),Mo(7,"div",69),Mo(8,"form",70),Mo(9,"div",71),Mo(10,"p"),Mo(11,"b"),va(12,"Choose how many days to retain: "),Io(),$o(13,"input",72),Io(),Io(),$o(14,"input",73),Io(),Io(),Io(),Mo(15,"div",74),Mo(16,"button",75),Vo("click",function(){return e.$implicit.dismiss()}),va(17,"Cancel"),Io(),Mo(18,"button",76),Vo("click",function(){return e.$implicit.close()}),va(19,"DELETE"),Io(),Io()),2&t){const t=zo();Qr(8),Fo("formGroup",t.confirmDeleteForm),Qr(6),Fo("ngClass",Vl(3,mN,t.f.delete.touched&&t.f.delete.invalid)),Qr(4),Fo("disabled",t.f.delete.invalid)}}function yN(t,e){if(1&t){const t=No();Mo(0,"button",76),Vo("click",function(){Ie(t);const e=zo(),n=To(68);return e.openDeleteDataModal(n)}),va(1,"Delete messages"),Io()}2&t&&Fo("disabled",zo().deleting)}let bN=(()=>{class t{constructor(t,e,n,i,r,s){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.modalService=s,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.messages=[],this.nextCursor="",this.deleteError="",this.deleteSuccess=!1,this.deleting=!1,this.total_deleted=0,this.activeFilter="",this.filters=["Chat Room","Group Chat","Direct Chat"],this.messageStatesOpen=[],this.searchForm1=this.formBuilder.group({label:""}),this.searchForm2=this.formBuilder.group({group_id:""}),this.searchForm3=this.formBuilder.group({user_id_one:"",user_id_two:""}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])],days:30})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.label.setValue(t.get("label")),this.f2.group_id.setValue(t.get("group_id")),this.f3.user_id_one.setValue(t.get("user_id_one")),this.f3.user_id_two.setValue(t.get("user_id_two")),this.nextCursor=t.get("cursor");let e=t.get("type");this.type=Number(e),this.route.data.subscribe(t=>{t&&(t[0]&&(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t[0].messages),this.nextCursor=t[0].next_cursor),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=2,this.activeFilter=this.filters[0]):2==this.type||3==this.type||4==this.type?this.activeFilter=this.filters[this.type-2]:this.error="Invalid type."}search(t){let e="";switch(t){case 0:e="";break;case 1:e=this.nextCursor}this.updateMessages(this.type,this.f1.label.value,this.f2.group_id.value,this.f3.user_id_one.value,this.f3.user_id_two.value,e)}updateMessages(t,e,n,i,r,s){switch(t){case 2:this.consoleService.listChannelMessages("",t.toString(),e,null,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 3:this.consoleService.listChannelMessages("",t.toString(),null,n,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 4:this.consoleService.listChannelMessages("",t.toString(),null,null,i,r,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t})}}postData(t,e){let n;switch(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t.messages),this.nextCursor=t.next_cursor,this.type){case 2:n={type:this.type,label:this.f1.label.value,cursor:e};break;case 3:n={type:this.type,group_id:this.f2.group_id.value,cursor:e};break;case 4:n={type:this.type,user_id_one:this.f3.user_id_one.value,user_id_two:this.f3.user_id_two.value,cursor:e}}this.router.navigate([],{relativeTo:this.route,queryParams:n})}deleteMessage(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteChannelMessages("",null,[n.message_id]).subscribe(()=>{this.error="",this.messageStatesOpen.splice(e,1),this.messages.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteMessagesAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}get f(){return this.confirmDeleteForm.controls}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}deleteData(){this.deleteError="",this.deleting=!0;let t=new Date;t.setDate(t.getDate()-this.f.days.value),this.consoleService.deleteChannelMessages("",t.toISOString(),null).subscribe(t=>{this.total_deleted=Number(t.total),this.deleting=!1,this.deleteError="",this.deleteSuccess=!0;const e=this.route.snapshot.queryParamMap;let n=e.get("type"),i=e.get("label");i||(i="0");let r=e.get("group_id"),s=e.get("user_id_one"),o=e.get("user_id_two"),a=e.get("cursor");a||(a=""),n&&this.updateMessages(Number(n),i,r,s,o,a)},t=>{this.deleting=!1,this.deleteError=t})}viewAccount(t){this.router.navigate(["/accounts",t.sender_id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b),Ro(a_))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:70,vars:21,consts:[[1,"pb-1"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup"],[1,"input-group"],["type","text","formControlName","label","placeholder","Search by chat room label",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],["type","text","formControlName","group_id","placeholder","Search by group ID",1,"form-control","border-right-0"],["type","text","formControlName","user_id_one","placeholder","Search by user ID 1",1,"form-control","border-right-0"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","text","formControlName","user_id_two","placeholder","Search by user ID 2",1,"form-control","border-right-0"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered",2,"table-layout","fixed"],[1,"thead-light"],[2,"width","60px"],[2,"width","320px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",3,"dismissible",4,"ngIf"],["type","success",3,"dismissible","close",4,"ngIf"],["role","alert",1,"d-flex","justify-content-between","align-items-center"],["confirmDelete",""],["type","button","class","btn btn-danger",3,"disabled","click",4,"ngIf"],["type","button","ngbDropdownItem","",3,"click"],[2,"width","100%",3,"routerLink"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[1,"text-muted"],[3,"click"],[2,"text-overflow","ellipsis","overflow","hidden",3,"click"],[2,"white-space","nowrap","text-overflow","ellipsis","overflow","hidden"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],[1,"open-row"],["type","danger",3,"dismissible"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],["autocomplete","off",3,"formGroup"],[1,"mt-2"],["type","number","value","30","min","0","formControlName","days",2,"width","80px"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-danger",3,"disabled","click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Chat Messages"),Io(),Mo(2,"div",1),Mo(3,"button",2),Do(4,JP,2,0,"span",3),Do(5,QP,2,1,"span",3),Io(),Mo(6,"div",4),Do(7,ZP,2,1,"button",5),Io(),Io(),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"form",9),Mo(12,"div",10),$o(13,"input",11),Mo(14,"div",12),Mo(15,"div",13),Mo(16,"button",14),Vo("click",function(){return e.type=2,e.search(0)}),va(17,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(18,"form",9),Mo(19,"div",10),$o(20,"input",15),Mo(21,"div",12),Mo(22,"div",13),Mo(23,"button",14),Vo("click",function(){return e.type=3,e.search(0)}),va(24,"Search "),Io(),Io(),Io(),Io(),Io(),Mo(25,"form",9),Mo(26,"div",10),$o(27,"input",16),Mo(28,"div",12),Mo(29,"span",17),Vo("click",function(){return e.f3.user_id_one.setValue(e.systemUserId)}),$o(30,"img",18),Io(),Io(),$o(31,"input",19),Mo(32,"div",12),Mo(33,"div",13),Mo(34,"button",14),Vo("click",function(){return e.type=4,e.search(0)}),va(35,"Search "),Io(),Io(),Io(),Io(),Io(),Io(),Mo(36,"div",20),Mo(37,"div",21),Mo(38,"button",22),Vo("click",function(){return e.search(0)}),$o(39,"img",23),Io(),Mo(40,"button",22),Vo("click",function(){return e.search(1)}),$o(41,"img",24),Io(),Io(),Io(),Io(),Io(),Do(42,tN,2,1,"h6",3),Do(43,nN,4,4,"h6",3),Do(44,rN,7,8,"h6",3),Do(45,sN,4,2,"ngb-alert",25),Mo(46,"div",26),Mo(47,"table",27),Mo(48,"thead",28),Mo(49,"tr"),Mo(50,"th",29),va(51,"Code"),Io(),Mo(52,"th",30),va(53,"Sender ID"),Io(),Mo(54,"th",31),va(55,"Username"),Io(),Mo(56,"th"),va(57,"Content"),Io(),Mo(58,"th",32),va(59,"Create Time"),Io(),Do(60,oN,2,0,"th",33),Io(),Io(),Mo(61,"tbody"),Do(62,aN,3,1,"tr",3),Do(63,pN,17,10,"ng-template",34),Io(),Io(),Io(),Do(64,fN,6,2,"ngb-alert",35),Do(65,gN,4,3,"ngb-alert",36),Mo(66,"div",37),Do(67,vN,20,5,"ng-template",null,38,dc),Do(69,yN,2,1,"button",39),Io()),2&t&&(Qr(4),Fo("ngIf",!e.activeFilter||""===e.activeFilter),Qr(1),Fo("ngIf",e.activeFilter&&""!==e.activeFilter),Qr(2),Fo("ngForOf",e.filters),Qr(4),Fo("hidden","Chat Room"!==e.activeFilter)("formGroup",e.searchForm1),Qr(7),Fo("hidden","Group Chat"!==e.activeFilter)("formGroup",e.searchForm2),Qr(7),Fo("hidden","Direct Chat"!==e.activeFilter)("formGroup",e.searchForm3),Qr(13),Fo("disabled",0===e.messages.length),Qr(2),Fo("disabled",""===e.nextCursor||null===e.nextCursor),Qr(2),Fo("ngIf",0!=e.messages.length&&""===e.error&&2==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&3==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&4==e.type),Qr(1),Fo("ngIf",e.error),Qr(15),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.messages.length),Qr(1),Fo("ngForOf",e.messages),Qr(1),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(4),Fo("ngIf",e.deleteMessagesAllowed()))},directives:[Kx,qx,Bh,Wx,Ph,pb,Ry,mb,ay,Ty,yb,zx,Mv,_x,Ly,$h],styles:[".input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.open-row[_ngcontent-%COMP%]{background:#fafafc}"]}),t})(),wN=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));switch(n){case 2:return this.consoleService.listChannelMessages("",n.toString(),t.queryParamMap.get("label"),null,null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 3:return this.consoleService.listChannelMessages("",n.toString(),null,t.queryParamMap.get("group_id"),null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 4:return this.consoleService.listChannelMessages("",n.toString(),null,null,t.queryParamMap.get("user_id_one"),t.queryParamMap.get("user_id_two"),encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));default:return ff(null)}}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function xN(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function _N(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),va(6),Io(),Mo(7,"td"),va(8),Io(),Mo(9,"td"),va(10),Io(),Mo(11,"td"),va(12),Io(),Io()),2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.product_id),Qr(2),ya(t.original_transaction_id),Qr(2),ya(n.getStoreText(t.store)),Qr(2),ya(t.purchase_time),Qr(2),ya(t.expiry_time),Qr(2),ya(t.create_time)}}function CN(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",19),va(2,"No purchases were found."),Io(),Io())}const SN=[{path:"",component:j_,canActivate:[_w],canActivateChild:[z_],children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",component:tM,resolve:[eM]},{path:"config",component:IM,resolve:[$M]},{path:"users",component:VM,resolve:[HM]},{path:"modules",component:rI,resolve:[sI]},{path:"storage",component:fI,resolve:[gI,mI],pathMatch:"full"},{path:"storage/:collection/:key/:user_id",component:TI,resolve:[RI],pathMatch:"full"},{path:"leaderboards",component:UI,resolve:[VI]},{path:"leaderboards/:id",component:wP,resolve:[xP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:EP,resolve:[]},{path:"records",component:IP,resolve:[$P]}]},{path:"matches",component:XO,resolve:[YO,QO]},{path:"groups",component:sP,resolve:[oP]},{path:"groups/:id",component:pP,resolve:[fP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:cO,resolve:[]},{path:"members",component:TO,resolve:[RO],runGuardsAndResolvers:"always"}]},{path:"accounts",component:KI,resolve:[XI]},{path:"accounts/:id",component:l$,resolve:[c$],children:[{path:"",redirectTo:"profile",pathMatch:"full"},{path:"profile",component:g$,resolve:[]},{path:"authentication",component:w$,resolve:[]},{path:"wallet",component:L$,resolve:[M$]},{path:"friends",component:j$,resolve:[z$]},{path:"groups",component:eO,resolve:[nO]},{path:"purchases",component:XP,resolve:[YP]},{path:"subscriptions",component:(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.subscriptions=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.subscriptions=t[0].validated_subscriptions,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listSubscriptions("",this.userID,this.limit,t).subscribe(t=>{this.subscriptions=t.validated_subscriptions,this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-subscriptions"]],decls:31,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["colspan","6",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,xN,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Original Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Expiry Time"),Io(),Mo(26,"th",13),va(27,"Create Time"),Io(),Io(),Io(),Mo(28,"tbody"),Do(29,_N,13,6,"ng-template",14),Do(30,CN,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.subscriptions.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(19),Fo("ngForOf",e.subscriptions),Qr(1),Fo("ngIf",0===e.subscriptions.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),resolve:[(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listSubscriptions("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()]}]},{path:"apiexplorer",component:VP,resolve:[HP]},{path:"chat",component:bN,resolve:[wN]}]},{path:"login",component:ww,canActivate:[xw]},{path:"**",redirectTo:""}];let EN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[Gv.forRoot(SN,{useHash:!0})],Gv]}),t})(),kN=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:[Ov],styles:[""]}),t})();RegExp(/[&<>"']/g.source);const AN={Tab:9,Enter:13,Esc:27,Space:32,ArrowUp:38,ArrowDown:40,Backspace:8};AN[AN.Tab]="Tab",AN[AN.Enter]="Enter",AN[AN.Esc]="Esc",AN[AN.Space]="Space",AN[AN.ArrowUp]="ArrowUp",AN[AN.ArrowDown]="ArrowDown",AN[AN.Backspace]="Backspace";const DN=new Yn("ng-select-selection-model");class TN{constructor(){this._selected=[]}get value(){return this._selected}select(t,e,n){if(t.selected=!0,(!t.children||!e&&n)&&this._selected.push(t),e)if(t.parent){const e=t.parent.children.length,n=t.parent.children.filter(t=>t.selected).length;t.parent.selected=e===n}else t.children&&(this._setChildrenSelectedState(t.children,!0),this._removeChildren(t),this._selected=n&&this._activeChildren(t)?[...this._selected.filter(e=>e.parent!==t),t]:[...this._selected,...t.children.filter(t=>!t.disabled)])}unselect(t,e){if(this._selected=this._selected.filter(e=>e!==t),t.selected=!1,e)if(t.parent&&t.parent.selected){const e=t.parent.children;this._removeParent(t.parent),this._removeChildren(t.parent),this._selected.push(...e.filter(e=>e!==t&&!e.disabled)),t.parent.selected=!1}else t.children&&(this._setChildrenSelectedState(t.children,!1),this._removeChildren(t))}clear(t){this._selected=t?this._selected.filter(t=>t.disabled):[]}_setChildrenSelectedState(t,e){for(const n of t)n.disabled||(n.selected=e)}_removeChildren(t){this._selected=[...this._selected.filter(e=>e.parent!==t),...t.children.filter(e=>e.parent===t&&e.disabled&&e.selected)]}_removeParent(t){this._selected=this._selected.filter(e=>e!==t)}_activeChildren(t){return t.children.every(t=>!t.disabled||t.selected)}}const RN=function(){return new TN};let FN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:DN,useValue:RN}],imports:[[qh]]}),t})(),LN=(()=>{class t{constructor(t){this.authenticationService=t}intercept(t,e){const n=this.authenticationService.currentSessionValue;return n&&n.token&&(t=t.clone({setHeaders:{Authorization:"Bearer "+n.token}})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),MN=(()=>{class t{constructor(t,e){this.authenticationService=t,this.router=e}intercept(t,e){return e.handle(t).pipe(Yf(e=>(401===e.status?this.authenticationService.logout().subscribe({next:()=>{t.url.includes("/v3/auth")||this.router.navigate(["/login"],{queryParams:{next:this.router.routerState.snapshot.url}})}}):e.status>=500&&console.log(`${e.status}: + ${e.error.message||e.statusText}`),nx(e.error.message||e.statusText))))}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),IN=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:[kN]}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[fw,I_,{provide:uw,useValue:{host:document.location.origin,timeout:15e3}},{provide:Xb,useClass:LN,multi:!0},{provide:Xb,useClass:MN,multi:!0}],imports:[[fM,EN,ku,df,lw,M_,LL,Rb.forRoot({apiKey:"",debug:!1,loadOnInitialization:!1}),pf,Sb,Cb,FN]]}),t})();(function(){if(qc)throw new Error("Cannot enable prod mode after platform setup.");Gc=!1})(),Su().bootstrapModule(IN).then(t=>{window.ngRef&&window.ngRef.destroy(),window.ngRef=t}).catch(t=>console.error(t))},zn8P:function(t,e){function n(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+U4B":function(t,e,n){var i;i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=t,n.c=e,n.p="",n(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),s=n(8),o=n(15);function a(t,e,n){var o=null,a=function(t,e){n&&n(t,e),o&&o.visit(t,e)},l="function"==typeof n?a:null,c=!1;if(e){var h="boolean"==typeof e.attachComment&&e.attachComment;((c="boolean"==typeof e.comment&&e.comment)||h)&&((o=new i.CommentHandler).attach=h,e.comment=!0,l=a)}var u,d=!1;e&&"string"==typeof e.sourceType&&(d="module"===e.sourceType),u=e&&"boolean"==typeof e.jsx&&e.jsx?new r.JSXParser(t,e,l):new s.Parser(t,e,l);var p=d?u.parseModule():u.parseScript();return c&&o&&(p.comments=o.comments),u.config.tokens&&(p.tokens=u.tokens),u.config.tolerant&&(p.errors=u.errorHandler.errors),p}e.parse=a,e.parseModule=function(t,e,n){var i=e||{};return i.sourceType="module",a(t,i,n)},e.parseScript=function(t,e,n){var i=e||{};return i.sourceType="script",a(t,i,n)},e.tokenize=function(t,e,n){var i,r=new o.Tokenizer(t,e);i=[];try{for(;;){var s=r.getNextToken();if(!s)break;n&&(s=n(s)),i.push(s)}}catch(a){r.errorHandler.tolerate(a)}return r.errorHandler.tolerant&&(i.errors=r.errors()),i};var l=n(2);e.Syntax=l.Syntax,e.version="4.0.1"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r=function(){function t(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return t.prototype.insertInnerComments=function(t,e){if(t.type===i.Syntax.BlockStatement&&0===t.body.length){for(var n=[],r=this.leading.length-1;r>=0;--r){var s=this.leading[r];e.end.offset>=s.start&&(n.unshift(s.comment),this.leading.splice(r,1),this.trailing.splice(r,1))}n.length&&(t.innerComments=n)}},t.prototype.findTrailingComments=function(t){var e=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var i=this.trailing[n];i.start>=t.end.offset&&e.unshift(i.comment)}return this.trailing.length=0,e}var r=this.stack[this.stack.length-1];if(r&&r.node.trailingComments){var s=r.node.trailingComments[0];s&&s.range[0]>=t.end.offset&&(e=r.node.trailingComments,delete r.node.trailingComments)}return e},t.prototype.findLeadingComments=function(t){for(var e,n=[];this.stack.length>0&&(s=this.stack[this.stack.length-1])&&s.start>=t.start.offset;)e=s.node,this.stack.pop();if(e){for(var i=(e.leadingComments?e.leadingComments.length:0)-1;i>=0;--i){var r=e.leadingComments[i];r.range[1]<=t.start.offset&&(n.unshift(r),e.leadingComments.splice(i,1))}return e.leadingComments&&0===e.leadingComments.length&&delete e.leadingComments,n}for(i=this.leading.length-1;i>=0;--i){var s;(s=this.leading[i]).start<=t.start.offset&&(n.unshift(s.comment),this.leading.splice(i,1))}return n},t.prototype.visitNode=function(t,e){if(!(t.type===i.Syntax.Program&&t.body.length>0)){this.insertInnerComments(t,e);var n=this.findTrailingComments(e),r=this.findLeadingComments(e);r.length>0&&(t.leadingComments=r),n.length>0&&(t.trailingComments=n),this.stack.push({node:t,start:e.start.offset})}},t.prototype.visitComment=function(t,e){var n="L"===t.type[0]?"Line":"Block",i={type:n,value:t.value};if(t.range&&(i.range=t.range),t.loc&&(i.loc=t.loc),this.comments.push(i),this.attach){var r={comment:{type:n,value:t.value,range:[e.start.offset,e.end.offset]},start:e.start.offset};t.loc&&(r.comment.loc=t.loc),t.type=n,this.leading.push(r),this.trailing.push(r)}},t.prototype.visit=function(t,e){"LineComment"===t.type||"BlockComment"===t.type?this.visitComment(t,e):this.attach&&this.visitNode(t,e)},t}();e.CommentHandler=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=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])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=n(4),o=n(5),a=n(6),l=n(7),c=n(8),h=n(13),u=n(14);function d(t){var e;switch(t.type){case a.JSXSyntax.JSXIdentifier:e=t.name;break;case a.JSXSyntax.JSXNamespacedName:var n=t;e=d(n.namespace)+":"+d(n.name);break;case a.JSXSyntax.JSXMemberExpression:var i=t;e=d(i.object)+"."+d(i.property)}return e}h.TokenName[100]="JSXIdentifier",h.TokenName[101]="JSXText";var p=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return r(e,t),e.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},e.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},e.prototype.finishJSX=function(){this.nextToken()},e.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},e.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.scanXHTMLEntity=function(t){for(var e="&",n=!0,i=!1,r=!1,o=!1;!this.scanner.eof()&&n&&!i;){var a=this.scanner.source[this.scanner.index];if(a===t)break;if(i=";"===a,e+=a,++this.scanner.index,!i)switch(e.length){case 2:r="#"===a;break;case 3:r&&(n=(o="x"===a)||s.Character.isDecimalDigit(a.charCodeAt(0)),r=r&&!o);break;default:n=(n=n&&!(r&&!s.Character.isDecimalDigit(a.charCodeAt(0))))&&!(o&&!s.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&i&&e.length>2){var l=e.substr(1,e.length-2);r&&l.length>1?e=String.fromCharCode(parseInt(l.substr(1),10)):o&&l.length>2?e=String.fromCharCode(parseInt("0"+l.substr(1),16)):r||o||!u.XHTMLEntities[l]||(e=u.XHTMLEntities[l])}return e},e.prototype.lexJSX=function(){var t=this.scanner.source.charCodeAt(this.scanner.index);if(60===t||62===t||47===t||58===t||61===t||123===t||125===t)return{type:7,value:r=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===t||39===t){for(var e=this.scanner.index,n=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==n;)i+="&"===l?this.scanXHTMLEntity(n):l;return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(46===t){var r,o=this.scanner.source.charCodeAt(this.scanner.index+1),a=this.scanner.source.charCodeAt(this.scanner.index+2);return e=this.scanner.index,this.scanner.index+=(r=46===o&&46===a?"...":".").length,{type:7,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(96===t)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(t)&&92!==t){for(e=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(e,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}return this.scanner.lex()},e.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var t=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(t)),t},e.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var t=this.scanner.index,e="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,e+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var i={type:101,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index};return e.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(i)),i},e.prototype.peekJSXToken=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.lexJSX();return this.scanner.restoreState(t),e},e.prototype.expectJSX=function(t){var e=this.nextJSXToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},e.prototype.matchJSX=function(t){var e=this.peekJSXToken();return 7===e.type&&e.value===t},e.prototype.parseJSXIdentifier=function(){var t=this.createJSXNode(),e=this.nextJSXToken();return 100!==e.type&&this.throwUnexpectedToken(e),this.finalize(t,new o.JSXIdentifier(e.value))},e.prototype.parseJSXElementName=function(){var t=this.createJSXNode(),e=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=e;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(n,i))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var r=e;this.expectJSX(".");var s=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXMemberExpression(r,s))}return e},e.prototype.parseJSXAttributeName=function(){var t,e=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var i=n;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(i,r))}else t=n;return t},e.prototype.parseJSXStringLiteralAttribute=function(){var t=this.createJSXNode(),e=this.nextJSXToken();8!==e.type&&this.throwUnexpectedToken(e);var n=this.getTokenRaw(e);return this.finalize(t,new l.Literal(e.value,n))},e.prototype.parseJSXExpressionAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXExpressionContainer(e))},e.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},e.prototype.parseJSXNameValueAttribute=function(){var t=this.createJSXNode(),e=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(t,new o.JSXAttribute(e,n))},e.prototype.parseJSXSpreadAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXSpreadAttribute(e))},e.prototype.parseJSXAttributes=function(){for(var t=[];!this.matchJSX("/")&&!this.matchJSX(">");){var e=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();t.push(e)}return t},e.prototype.parseJSXOpeningElement=function(){var t=this.createJSXNode();this.expectJSX("<");var e=this.parseJSXElementName(),n=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(e,i,n))},e.prototype.parseJSXBoundaryElement=function(){var t=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var e=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(t,new o.JSXClosingElement(e))}var n=this.parseJSXElementName(),i=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(n,r,i))},e.prototype.parseJSXEmptyExpression=function(){var t=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(t,new o.JSXEmptyExpression)},e.prototype.parseJSXExpressionContainer=function(){var t,e=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new o.JSXExpressionContainer(t))},e.prototype.parseJSXChildren=function(){for(var t=[];!this.scanner.eof();){var e=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;s=this.finalize(t.node,new o.JSXElement(t.opening,t.children,t.closing)),(t=e[e.length-1]).children.push(s),e.pop()}}return t},e.prototype.parseJSXElement=function(){var t=this.createJSXNode(),e=this.parseJSXOpeningElement(),n=[],i=null;if(!e.selfClosing){var r=this.parseComplexJSXElement({node:t,opening:e,closing:i,children:n});n=r.children,i=r.closing}return this.finalize(t,new o.JSXElement(e,n,i))},e.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var t=this.parseJSXElement();return this.finishJSX(),t},e.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},e}(c.Parser);e.JSXParser=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(t){return t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&n.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(t))},isIdentifierPart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&n.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(t))},isDecimalDigit:function(t){return t>=48&&t<=57},isHexDigit:function(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102},isOctalDigit:function(t){return t>=48&&t<=55}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6);e.JSXClosingElement=function(t){this.type=i.JSXSyntax.JSXClosingElement,this.name=t},e.JSXElement=function(t,e,n){this.type=i.JSXSyntax.JSXElement,this.openingElement=t,this.children=e,this.closingElement=n},e.JSXEmptyExpression=function(){this.type=i.JSXSyntax.JSXEmptyExpression},e.JSXExpressionContainer=function(t){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=t},e.JSXIdentifier=function(t){this.type=i.JSXSyntax.JSXIdentifier,this.name=t},e.JSXMemberExpression=function(t,e){this.type=i.JSXSyntax.JSXMemberExpression,this.object=t,this.property=e},e.JSXAttribute=function(t,e){this.type=i.JSXSyntax.JSXAttribute,this.name=t,this.value=e},e.JSXNamespacedName=function(t,e){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=t,this.name=e},e.JSXOpeningElement=function(t,e,n){this.type=i.JSXSyntax.JSXOpeningElement,this.name=t,this.selfClosing=e,this.attributes=n},e.JSXSpreadAttribute=function(t){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=t},e.JSXText=function(t,e){this.type=i.JSXSyntax.JSXText,this.value=t,this.raw=e}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);e.ArrayExpression=function(t){this.type=i.Syntax.ArrayExpression,this.elements=t},e.ArrayPattern=function(t){this.type=i.Syntax.ArrayPattern,this.elements=t},e.ArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!1},e.AssignmentExpression=function(t,e,n){this.type=i.Syntax.AssignmentExpression,this.operator=t,this.left=e,this.right=n},e.AssignmentPattern=function(t,e){this.type=i.Syntax.AssignmentPattern,this.left=t,this.right=e},e.AsyncArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!0},e.AsyncFunctionDeclaration=function(t,e,n){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AsyncFunctionExpression=function(t,e,n){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AwaitExpression=function(t){this.type=i.Syntax.AwaitExpression,this.argument=t},e.BinaryExpression=function(t,e,n){this.type="||"===t||"&&"===t?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=t,this.left=e,this.right=n},e.BlockStatement=function(t){this.type=i.Syntax.BlockStatement,this.body=t},e.BreakStatement=function(t){this.type=i.Syntax.BreakStatement,this.label=t},e.CallExpression=function(t,e){this.type=i.Syntax.CallExpression,this.callee=t,this.arguments=e},e.CatchClause=function(t,e){this.type=i.Syntax.CatchClause,this.param=t,this.body=e},e.ClassBody=function(t){this.type=i.Syntax.ClassBody,this.body=t},e.ClassDeclaration=function(t,e,n){this.type=i.Syntax.ClassDeclaration,this.id=t,this.superClass=e,this.body=n},e.ClassExpression=function(t,e,n){this.type=i.Syntax.ClassExpression,this.id=t,this.superClass=e,this.body=n},e.ComputedMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=t,this.property=e},e.ConditionalExpression=function(t,e,n){this.type=i.Syntax.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n},e.ContinueStatement=function(t){this.type=i.Syntax.ContinueStatement,this.label=t},e.DebuggerStatement=function(){this.type=i.Syntax.DebuggerStatement},e.Directive=function(t,e){this.type=i.Syntax.ExpressionStatement,this.expression=t,this.directive=e},e.DoWhileStatement=function(t,e){this.type=i.Syntax.DoWhileStatement,this.body=t,this.test=e},e.EmptyStatement=function(){this.type=i.Syntax.EmptyStatement},e.ExportAllDeclaration=function(t){this.type=i.Syntax.ExportAllDeclaration,this.source=t},e.ExportDefaultDeclaration=function(t){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=t},e.ExportNamedDeclaration=function(t,e,n){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=t,this.specifiers=e,this.source=n},e.ExportSpecifier=function(t,e){this.type=i.Syntax.ExportSpecifier,this.exported=e,this.local=t},e.ExpressionStatement=function(t){this.type=i.Syntax.ExpressionStatement,this.expression=t},e.ForInStatement=function(t,e,n){this.type=i.Syntax.ForInStatement,this.left=t,this.right=e,this.body=n,this.each=!1},e.ForOfStatement=function(t,e,n){this.type=i.Syntax.ForOfStatement,this.left=t,this.right=e,this.body=n},e.ForStatement=function(t,e,n,r){this.type=i.Syntax.ForStatement,this.init=t,this.test=e,this.update=n,this.body=r},e.FunctionDeclaration=function(t,e,n,r){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.FunctionExpression=function(t,e,n,r){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.Identifier=function(t){this.type=i.Syntax.Identifier,this.name=t},e.IfStatement=function(t,e,n){this.type=i.Syntax.IfStatement,this.test=t,this.consequent=e,this.alternate=n},e.ImportDeclaration=function(t,e){this.type=i.Syntax.ImportDeclaration,this.specifiers=t,this.source=e},e.ImportDefaultSpecifier=function(t){this.type=i.Syntax.ImportDefaultSpecifier,this.local=t},e.ImportNamespaceSpecifier=function(t){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=t},e.ImportSpecifier=function(t,e){this.type=i.Syntax.ImportSpecifier,this.local=t,this.imported=e},e.LabeledStatement=function(t,e){this.type=i.Syntax.LabeledStatement,this.label=t,this.body=e},e.Literal=function(t,e){this.type=i.Syntax.Literal,this.value=t,this.raw=e},e.MetaProperty=function(t,e){this.type=i.Syntax.MetaProperty,this.meta=t,this.property=e},e.MethodDefinition=function(t,e,n,r,s){this.type=i.Syntax.MethodDefinition,this.key=t,this.computed=e,this.value=n,this.kind=r,this.static=s},e.Module=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="module"},e.NewExpression=function(t,e){this.type=i.Syntax.NewExpression,this.callee=t,this.arguments=e},e.ObjectExpression=function(t){this.type=i.Syntax.ObjectExpression,this.properties=t},e.ObjectPattern=function(t){this.type=i.Syntax.ObjectPattern,this.properties=t},e.Property=function(t,e,n,r,s,o){this.type=i.Syntax.Property,this.key=e,this.computed=n,this.value=r,this.kind=t,this.method=s,this.shorthand=o},e.RegexLiteral=function(t,e,n,r){this.type=i.Syntax.Literal,this.value=t,this.raw=e,this.regex={pattern:n,flags:r}},e.RestElement=function(t){this.type=i.Syntax.RestElement,this.argument=t},e.ReturnStatement=function(t){this.type=i.Syntax.ReturnStatement,this.argument=t},e.Script=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="script"},e.SequenceExpression=function(t){this.type=i.Syntax.SequenceExpression,this.expressions=t},e.SpreadElement=function(t){this.type=i.Syntax.SpreadElement,this.argument=t},e.StaticMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=t,this.property=e},e.Super=function(){this.type=i.Syntax.Super},e.SwitchCase=function(t,e){this.type=i.Syntax.SwitchCase,this.test=t,this.consequent=e},e.SwitchStatement=function(t,e){this.type=i.Syntax.SwitchStatement,this.discriminant=t,this.cases=e},e.TaggedTemplateExpression=function(t,e){this.type=i.Syntax.TaggedTemplateExpression,this.tag=t,this.quasi=e},e.TemplateElement=function(t,e){this.type=i.Syntax.TemplateElement,this.value=t,this.tail=e},e.TemplateLiteral=function(t,e){this.type=i.Syntax.TemplateLiteral,this.quasis=t,this.expressions=e},e.ThisExpression=function(){this.type=i.Syntax.ThisExpression},e.ThrowStatement=function(t){this.type=i.Syntax.ThrowStatement,this.argument=t},e.TryStatement=function(t,e,n){this.type=i.Syntax.TryStatement,this.block=t,this.handler=e,this.finalizer=n},e.UnaryExpression=function(t,e){this.type=i.Syntax.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0},e.UpdateExpression=function(t,e,n){this.type=i.Syntax.UpdateExpression,this.operator=t,this.argument=e,this.prefix=n},e.VariableDeclaration=function(t,e){this.type=i.Syntax.VariableDeclaration,this.declarations=t,this.kind=e},e.VariableDeclarator=function(t,e){this.type=i.Syntax.VariableDeclarator,this.id=t,this.init=e},e.WhileStatement=function(t,e){this.type=i.Syntax.WhileStatement,this.test=t,this.body=e},e.WithStatement=function(t,e){this.type=i.Syntax.WithStatement,this.object=t,this.body=e},e.YieldExpression=function(t,e){this.type=i.Syntax.YieldExpression,this.argument=t,this.delegate=e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(10),s=n(11),o=n(7),a=n(12),l=n(2),c=n(13),h="ArrowParameterPlaceHolder",u=function(){function t(t,e,n){void 0===e&&(e={}),this.config={range:"boolean"==typeof e.range&&e.range,loc:"boolean"==typeof e.loc&&e.loc,source:null,tokens:"boolean"==typeof e.tokens&&e.tokens,comment:"boolean"==typeof e.comment&&e.comment,tolerant:"boolean"==typeof e.tolerant&&e.tolerant},this.config.loc&&e.source&&null!==e.source&&(this.config.source=String(e.source)),this.delegate=n,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return t.prototype.throwError=function(t){for(var e=[],n=1;n0&&this.delegate)for(var e=0;e>="===t||">>>="===t||"&="===t||"^="===t||"|="===t},t.prototype.isolateCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=e,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=i,r},t.prototype.inheritCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&e,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=i||this.context.firstCoverInitializedNameError,r},t.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},t.prototype.parsePrimaryExpression=function(){var t,e,n,i=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(i,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(e.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal("true"===e.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(null,n));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,e=this.nextRegexToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.RegexLiteral(e.regex,n,e.pattern,e.flags));break;default:t=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(i,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(i,new o.ThisExpression)):t=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken())}return t},t.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new o.SpreadElement(e))},t.prototype.parseArrayInitializer=function(){var t=this.createNode(),e=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),e.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),e.push(n)}else e.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new o.ArrayExpression(e))},t.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var e=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var i=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=e,this.context.allowStrictDirective=n,i},t.prototype.parsePropertyMethodFunction=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),e=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var i=this.parseFormalParameters(),r=this.parsePropertyMethod(i);return this.context.allowYield=e,this.context.await=n,this.finalize(t,new o.AsyncFunctionExpression(null,i.params,r))},t.prototype.parseObjectPropertyKey=function(){var t,e=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,s.Messages.StrictOctalLiteral);var i=this.getTokenRaw(n);t=this.finalize(e,new o.Literal(n.value,i));break;case 3:case 1:case 5:case 4:t=this.finalize(e,new o.Identifier(n.value));break;case 7:"["===n.value?(t=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):t=this.throwUnexpectedToken(n);break;default:t=this.throwUnexpectedToken(n)}return t},t.prototype.isPropertyKey=function(t,e){return t.type===l.Syntax.Identifier&&t.name===e||t.type===l.Syntax.Literal&&t.value===e},t.prototype.parseObjectProperty=function(t){var e,n=this.createNode(),i=this.lookahead,r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(3===i.type){var d=i.value;this.nextToken(),l=this.match("["),r=(u=!(this.hasLineTerminator||"async"!==d||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(d))}else this.match("*")?this.nextToken():(l=this.match("["),r=this.parseObjectPropertyKey());var p=this.qualifiedPropertyName(this.lookahead);if(3===i.type&&!u&&"get"===i.value&&p)e="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===i.type&&!u&&"set"===i.value&&p)e="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===i.type&&"*"===i.value&&p)e="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(r||this.throwUnexpectedToken(this.lookahead),e="init",this.match(":")&&!u)!l&&this.isPropertyKey(r,"__proto__")&&(t.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===i.type)if(d=this.finalize(n,new o.Identifier(i.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),h=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new o.AssignmentPattern(d,f))}else h=!0,a=d;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(e,r,l,a,c,h))},t.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var e=[],n={value:!1};!this.match("}");)e.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new o.ObjectExpression(e))},t.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateLiteral=function(){var t=this.createNode(),e=[],n=[],i=this.parseTemplateHead();for(n.push(i);!i.tail;)e.push(this.parseExpression()),i=this.parseTemplateElement(),n.push(i);return this.finalize(t,new o.TemplateLiteral(n,e))},t.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:t.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case l.Syntax.ArrayExpression:t.type=l.Syntax.ArrayPattern;for(var e=0;e")||this.expect("=>"),t={type:h,params:[],async:!1};else{var e=this.lookahead,n=[];if(this.match("..."))t=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:h,params:[t],async:!1};else{var i=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(t);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s")||this.expect("=>"),this.context.isBindingElement=!1,s=0;s")&&(t.type===l.Syntax.Identifier&&"yield"===t.name&&(i=!0,t={type:h,params:[t],async:!1}),!i)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===l.Syntax.SequenceExpression)for(s=0;s")){for(var l=0;l0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var r=[t,this.lookahead],s=e,a=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[s,n.value,a],c=[i];!((i=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&i<=c[c.length-1];){a=l.pop();var h=l.pop();c.pop(),s=l.pop(),r.pop();var u=this.startNode(r[r.length-1]);l.push(this.finalize(u,new o.BinaryExpression(h,s,a)))}l.push(this.nextToken().value),c.push(i),r.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var d=l.length-1;e=l[d];for(var p=r.pop();d>1;){var f=r.pop();u=this.startNode(f,p&&p.lineStart),e=this.finalize(u,new o.BinaryExpression(h=l[d-1],l[d-2],e)),d-=2,p=f}}return e},t.prototype.parseConditionalExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var r=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.ConditionalExpression(e,i,r)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return e},t.prototype.checkPatternParam=function(t,e){switch(e.type){case l.Syntax.Identifier:this.validateParam(t,e,e.name);break;case l.Syntax.RestElement:this.checkPatternParam(t,e.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(t,e.left);break;case l.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=t.async,a=this.reinterpretAsCoverFormalsList(t);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,u=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var d=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=r;var f=this.startNode(e);this.expect("=>");var g=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,g=this.parseFunctionSourceElements(),this.context.allowIn=m}else g=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=g.type!==l.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),t=this.finalize(f,r?new o.AsyncArrowFunctionExpression(a.params,g,v):new o.ArrowFunctionExpression(a.params,g,v)),this.context.strict=c,this.context.allowStrictDirective=u,this.context.allowYield=d,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===l.Syntax.Identifier){var y=t;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var b=(n=this.nextToken()).value,w=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.AssignmentExpression(b,t,w)),this.context.firstCoverInitializedNameError=null}}return t},t.prototype.parseExpression=function(){var t=this.lookahead,e=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(e);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(t),new o.SequenceExpression(n))}return e},t.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement()}else t=this.parseStatement();return t},t.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseStatementListItem());return this.expect("}"),this.finalize(t,new o.BlockStatement(e))},t.prototype.parseLexicalBinding=function(t,e){var n=this.createNode(),i=this.parsePattern([],t);this.context.strict&&i.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return"const"===t?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!e.inFor&&i.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),r=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(i,r))},t.prototype.parseBindingList=function(t,e){for(var n=[this.parseLexicalBinding(t,e)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(t,e));return n},t.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.scanner.lex();return this.scanner.restoreState(t),3===e.type||7===e.type&&"["===e.value||7===e.type&&"{"===e.value||4===e.type&&"let"===e.value||4===e.type&&"yield"===e.value},t.prototype.parseLexicalDeclaration=function(t){var e=this.createNode(),n=this.nextToken().value;i.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var r=this.parseBindingList(n,t);return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(r,n))},t.prototype.parseBindingRestElement=function(t,e){var n=this.createNode();this.expect("...");var i=this.parsePattern(t,e);return this.finalize(n,new o.RestElement(i))},t.prototype.parseArrayPattern=function(t,e){var n=this.createNode();this.expect("[");for(var i=[];!this.match("]");)if(this.match(","))this.nextToken(),i.push(null);else{if(this.match("...")){i.push(this.parseBindingRestElement(t,e));break}i.push(this.parsePatternWithDefault(t,e)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(i))},t.prototype.parsePropertyPattern=function(t,e){var n,i,r=this.createNode(),s=!1,a=!1;if(3===this.lookahead.type){var l=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(r,new o.Identifier(l.value));if(this.match("=")){t.push(l),a=!0,this.nextToken();var h=this.parseAssignmentExpression();i=this.finalize(this.startNode(l),new o.AssignmentPattern(c,h))}else this.match(":")?(this.expect(":"),i=this.parsePatternWithDefault(t,e)):(t.push(l),a=!0,i=c)}else s=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),i=this.parsePatternWithDefault(t,e);return this.finalize(r,new o.Property("init",n,s,i,!1,a))},t.prototype.parseObjectPattern=function(t,e){var n=this.createNode(),i=[];for(this.expect("{");!this.match("}");)i.push(this.parsePropertyPattern(t,e)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(i))},t.prototype.parsePattern=function(t,e){var n;return this.match("[")?n=this.parseArrayPattern(t,e):this.match("{")?n=this.parseObjectPattern(t,e):(!this.matchKeyword("let")||"const"!==e&&"let"!==e||this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),t.push(this.lookahead),n=this.parseVariableIdentifier(e)),n},t.prototype.parsePatternWithDefault=function(t,e){var n=this.lookahead,i=this.parsePattern(t,e);if(this.match("=")){this.nextToken();var r=this.context.allowYield;this.context.allowYield=!0;var s=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=r,i=this.finalize(this.startNode(n),new o.AssignmentPattern(i,s))}return i},t.prototype.parseVariableIdentifier=function(t){var e=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==t)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(e,new o.Identifier(n.value))},t.prototype.parseVariableDeclaration=function(t){var e=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===l.Syntax.Identifier||t.inFor||this.expect("="),this.finalize(e,new o.VariableDeclarator(n,i))},t.prototype.parseVariableDeclarationList=function(t){var e={inFor:t.inFor},n=[];for(n.push(this.parseVariableDeclaration(e));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(e));return n},t.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var e=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(e,"var"))},t.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new o.EmptyStatement)},t.prototype.parseExpressionStatement=function(){var t=this.createNode(),e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ExpressionStatement(e))},t.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},t.prototype.parseIfStatement=function(){var t,e=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(e,new o.IfStatement(i,t,n))},t.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var e=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=e,this.expectKeyword("while"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new o.DoWhileStatement(n,i))},t.prototype.parseWhileStatement=function(){var t,e=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var i=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=i}return this.finalize(e,new o.WhileStatement(n,t))},t.prototype.parseForStatement=function(){var t,e,n,i=null,r=null,a=null,c=!0,h=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){i=this.createNode(),this.nextToken();var u=this.context.allowIn;this.context.allowIn=!1;var d=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=u,1===d.length&&this.matchKeyword("in")){var p=d[0];p.init&&(p.id.type===l.Syntax.ArrayPattern||p.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseExpression(),i=null}else 1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){i=this.createNode();var f=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(u=this.context.allowIn,this.context.allowIn=!1,d=this.parseBindingList(f,{inFor:!0}),this.context.allowIn=u,1===d.length&&null===d[0].init&&this.matchKeyword("in")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseExpression(),i=null):1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(this.consumeSemicolon(),i=this.finalize(i,new o.VariableDeclaration(d,f)))):(i=this.finalize(i,new o.Identifier(f)),this.nextToken(),t=i,e=this.parseExpression(),i=null)}else{var g=this.lookahead;if(u=this.context.allowIn,this.context.allowIn=!1,i=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=u,this.matchKeyword("in"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseExpression(),i=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseAssignmentExpression(),i=null,c=!1;else{if(this.match(",")){for(var m=[i];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));i=this.finalize(this.startNode(g),new o.SequenceExpression(m))}this.expect(";")}}if(void 0===t&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return this.finalize(h,void 0===t?new o.ForStatement(i,r,a,n):c?new o.ForInStatement(t,e,n):new o.ForOfStatement(t,e,n))},t.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();e=n,Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(t,new o.ContinueStatement(e))},t.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name),e=n}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(t,new o.BreakStatement(e))},t.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var e=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ReturnStatement(e))},t.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var t,e=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new o.WithStatement(n,t))},t.prototype.parseSwitchCase=function(){var t,e=this.createNode();this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(e,new o.SwitchCase(t,n))},t.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var e=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var i=[],r=!1;for(this.expect("{");!this.match("}");){var a=this.parseSwitchCase();null===a.test&&(r&&this.throwError(s.Messages.MultipleDefaultsInSwitch),r=!0),i.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(t,new o.SwitchStatement(e,i))},t.prototype.parseLabelledStatement=function(){var t,e=this.createNode(),n=this.parseExpression();if(n.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var i=n,r="$"+i.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)&&this.throwError(s.Messages.Redeclaration,"Label",i.name),this.context.labelSet[r]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,h=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):h.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),a=h}else a=this.parseStatement();delete this.context.labelSet[r],t=new o.LabeledStatement(i,a)}else this.consumeSemicolon(),t=new o.ExpressionStatement(n);return this.finalize(e,t)},t.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ThrowStatement(e))},t.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var e=[],n=this.parsePattern(e),i={},r=0;r0&&this.tolerateError(s.Messages.BadGetterArity);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseSetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(s.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseGeneratorMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!0))},t.prototype.isStartOfExpression=function(){var t=!0,e=this.lookahead.value;switch(this.lookahead.type){case 7:t="["===e||"("===e||"{"===e||"+"===e||"-"===e||"!"===e||"~"===e||"++"===e||"--"===e||"/"===e||"/="===e;break;case 4:t="class"===e||"delete"===e||"function"===e||"let"===e||"new"===e||"super"===e||"this"===e||"typeof"===e||"void"===e||"yield"===e}return t},t.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var e=null,n=!1;if(!this.hasLineTerminator){var i=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),e=this.parseAssignmentExpression()):this.isStartOfExpression()&&(e=this.parseAssignmentExpression()),this.context.allowYield=i}return this.finalize(t,new o.YieldExpression(e,n))},t.prototype.parseClassElement=function(t){var e=this.lookahead,n=this.createNode(),i="",r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(r=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(e=this.lookahead,h=!0,l=this.match("["),this.match("*")?this.nextToken():r=this.parseObjectPropertyKey()),3===e.type&&!this.hasLineTerminator&&"async"===e.value){var d=this.lookahead.value;":"!==d&&"("!==d&&"*"!==d&&(u=!0,e=this.lookahead,r=this.parseObjectPropertyKey(),3===e.type&&"constructor"===e.value&&this.tolerateUnexpectedToken(e,s.Messages.ConstructorIsAsync))}var p=this.qualifiedPropertyName(this.lookahead);return 3===e.type?"get"===e.value&&p?(i="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===e.value&&p&&(i="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===e.type&&"*"===e.value&&p&&(i="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!i&&r&&this.match("(")&&(i="init",a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),i||this.throwUnexpectedToken(this.lookahead),"init"===i&&(i="method"),l||(h&&this.isPropertyKey(r,"prototype")&&this.throwUnexpectedToken(e,s.Messages.StaticPrototype),!h&&this.isPropertyKey(r,"constructor")&&(("method"!==i||!c||a&&a.generator)&&this.throwUnexpectedToken(e,s.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(e,s.Messages.DuplicateConstructor):t.value=!0,i="constructor")),this.finalize(n,new o.MethodDefinition(r,l,a,i,h))},t.prototype.parseClassElementList=function(){var t=[],e={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(e));return this.expect("}"),t},t.prototype.parseClassBody=function(){var t=this.createNode(),e=this.parseClassElementList();return this.finalize(t,new o.ClassBody(e))},t.prototype.parseClassDeclaration=function(t){var e=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var i=t&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var s=this.parseClassBody();return this.context.strict=n,this.finalize(e,new o.ClassDeclaration(i,r,s))},t.prototype.parseClassExpression=function(){var t=this.createNode(),e=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var r=this.parseClassBody();return this.context.strict=e,this.finalize(t,new o.ClassExpression(n,i,r))},t.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Module(e))},t.prototype.parseScript=function(){for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Script(e))},t.prototype.parseModuleSpecifier=function(){var t=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var e=this.nextToken(),n=this.getTokenRaw(e);return this.finalize(t,new o.Literal(e.value,n))},t.prototype.parseImportSpecifier=function(){var t,e,n=this.createNode();return 3===this.lookahead.type?(e=t=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),e=this.parseVariableIdentifier())):(e=t=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),e=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(e,t))},t.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},t.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName();return this.finalize(t,new o.ImportDefaultSpecifier(e))},t.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var e=this.parseIdentifierName();return this.finalize(t,new o.ImportNamespaceSpecifier(e))},t.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var t,e=this.createNode();this.expectKeyword("import");var n=[];return 8===this.lookahead.type||(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken()),t=this.parseModuleSpecifier(),this.consumeSemicolon(),this.finalize(e,new o.ImportDeclaration(n,t))},t.prototype.parseExportSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName(),n=e;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(t,new o.ExportSpecifier(e,n))},t.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var t,e=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),t=this.finalize(e,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){this.nextToken(),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null));else{var r=[],a=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),r.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),a=this.parseModuleSpecifier(),this.consumeSemicolon()):l?this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value):this.consumeSemicolon(),t=this.finalize(e,new o.ExportNamedDeclaration(null,r,a))}return t},t}();e.Parser=u},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assert=function(t,e){if(!t)throw new Error("ASSERT: "+e)}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.errors=[],this.tolerant=!1}return t.prototype.recordError=function(t){this.errors.push(t)},t.prototype.tolerate=function(t){if(!this.tolerant)throw t;this.recordError(t)},t.prototype.constructError=function(t,e){var n=new Error(t);try{throw n}catch(i){Object.create&&Object.defineProperty&&(n=Object.create(i),Object.defineProperty(n,"column",{value:e}))}return n},t.prototype.createError=function(t,e,n,i){var r=this.constructError("Line "+e+": "+i,n);return r.index=t,r.lineNumber=e,r.description=i,r},t.prototype.throwError=function(t,e,n,i){throw this.createError(t,e,n,i)},t.prototype.tolerateError=function(t,e,n,i){var r=this.createError(t,e,n,i);if(!this.tolerant)throw r;this.recordError(r)},t}();e.ErrorHandler=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(4),s=n(11);function o(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function a(t){return"01234567".indexOf(t)}var l=function(){function t(t,e){this.source=t,this.errorHandler=e,this.trackComment=!1,this.isModule=!1,this.length=t.length,this.index=0,this.lineNumber=t.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return t.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},t.prototype.restoreState=function(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart},t.prototype.eof=function(){return this.index>=this.length},t.prototype.throwUnexpectedToken=function(t){return void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.tolerateUnexpectedToken=function(t){void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.skipSingleLineComment=function(t){var e,n,i=[];for(this.trackComment&&(i=[],e=this.index-t,n={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,r.Character.isLineTerminator(s))return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart-1},i.push({multiLine:!1,slice:[e+t,this.index-1],range:[e,this.index-1],loc:n})),13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},i.push({multiLine:!1,slice:[e+t,this.index],range:[e,this.index],loc:n})),i},t.prototype.skipMultiLineComment=function(){var t,e,n=[];for(this.trackComment&&(n=[],t=this.index-2,e={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(r.Character.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1))return this.index+=2,this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:e})),n;++this.index}else++this.index}return this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:e})),this.tolerateUnexpectedToken(),n},t.prototype.scanComments=function(){var t;this.trackComment&&(t=[]);for(var e=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(r.Character.isWhiteSpace(n))++this.index;else if(r.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,e=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var i=this.skipSingleLineComment(2);this.trackComment&&(t=t.concat(i)),e=!0}else{if(42!==n)break;this.index+=2,i=this.skipMultiLineComment(),this.trackComment&&(t=t.concat(i))}else if(e&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,i=this.skipSingleLineComment(3),this.trackComment&&(t=t.concat(i))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,i=this.skipSingleLineComment(4),this.trackComment&&(t=t.concat(i))}}return t},t.prototype.isFutureReservedWord=function(t){switch(t){case"enum":case"export":case"import":case"super":return!0;default:return!1}},t.prototype.isStrictModeReservedWord=function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},t.prototype.isRestrictedWord=function(t){return"eval"===t||"arguments"===t},t.prototype.isKeyword=function(t){switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}},t.prototype.codePointAt=function(t){var e=this.source.charCodeAt(t);if(e>=55296&&e<=56319){var n=this.source.charCodeAt(t+1);n>=56320&&n<=57343&&(e=1024*(e-55296)+n-56320+65536)}return e},t.prototype.scanHexEscape=function(t){for(var e="u"===t?4:2,n=0,i=0;i1114111||"}"!==t)&&this.throwUnexpectedToken(),r.Character.fromCodePoint(e)},t.prototype.getIdentifier=function(){for(var t=this.index++;!this.eof();){var e=this.source.charCodeAt(this.index);if(92===e)return this.index=t,this.getComplexIdentifier();if(e>=55296&&e<57343)return this.index=t,this.getComplexIdentifier();if(!r.Character.isIdentifierPart(e))break;++this.index}return this.source.slice(t,this.index)},t.prototype.getComplexIdentifier=function(){var t,e=this.codePointAt(this.index),n=r.Character.fromCodePoint(e);for(this.index+=n.length,92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierStart(t.charCodeAt(0))||this.throwUnexpectedToken(),n=t);!this.eof()&&(e=this.codePointAt(this.index),r.Character.isIdentifierPart(e));)n+=t=r.Character.fromCodePoint(e),this.index+=t.length,92===e&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierPart(t.charCodeAt(0))||this.throwUnexpectedToken(),n+=t);return n},t.prototype.octalToDecimal=function(t){var e="0"!==t,n=a(t);return!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(e=!0,n=8*n+a(this.source[this.index++]),"0123".indexOf(t)>=0&&!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:e}},t.prototype.scanIdentifier=function(){var t,e=this.index,n=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier();if(3!=(t=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&e+n.length!==this.index){var i=this.index;this.index=e,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=i}return{type:t,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var t=this.index,e=this.source[this.index];switch(e){case"(":case"{":"{"===e&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,e="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(e=this.source.substr(this.index,4))?this.index+=4:"==="===(e=e.substr(0,3))||"!=="===e||">>>"===e||"<<="===e||">>="===e||"**="===e?this.index+=3:"&&"===(e=e.substr(0,2))||"||"===e||"=="===e||"!="===e||"+="===e||"-="===e||"*="===e||"/="===e||"++"===e||"--"===e||"<<"===e||">>"===e||"&="===e||"|="===e||"^="===e||"%="===e||"<="===e||">="===e||"=>"===e||"**"===e?this.index+=2:"<>=!+-*%&|^/".indexOf(e=this.source[this.index])>=0&&++this.index}return this.index===t&&this.throwUnexpectedToken(),{type:7,value:e,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanHexLiteral=function(t){for(var e="";!this.eof()&&r.Character.isHexDigit(this.source.charCodeAt(this.index));)e+=this.source[this.index++];return 0===e.length&&this.throwUnexpectedToken(),r.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+e,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanBinaryLiteral=function(t){for(var e,n="";!this.eof()&&("0"===(e=this.source[this.index])||"1"===e);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(e=this.source.charCodeAt(this.index),(r.Character.isIdentifierStart(e)||r.Character.isDecimalDigit(e))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanOctalLiteral=function(t,e){var n="",i=!1;for(r.Character.isOctalDigit(t.charCodeAt(0))?(i=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return i||0!==n.length||this.throwUnexpectedToken(),(r.Character.isIdentifierStart(this.source.charCodeAt(this.index))||r.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var t=this.index+1;t=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(t,e,n){var r=parseInt(e||n,16);return r>1114111&&i.throwUnexpectedToken(s.Messages.InvalidRegExp),r<=65535?String.fromCharCode(r):"\uffff"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"\uffff"));try{RegExp(n)}catch(r){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,e)}catch(o){return null}},t.prototype.scanRegExpBody=function(){var t=this.source[this.index];i.assert("/"===t,"Regular expression literal must start with a slash");for(var e=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e+=t=this.source[this.index++],"\\"===t)t=this.source[this.index++],r.Character.isLineTerminator(t.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e+=t;else if(r.Character.isLineTerminator(t.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===t&&(n=!1);else{if("/"===t){o=!0;break}"["===t&&(n=!0)}return o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e.substr(1,e.length-2)},t.prototype.scanRegExpFlags=function(){for(var t="";!this.eof();){var e=this.source[this.index];if(!r.Character.isIdentifierPart(e.charCodeAt(0)))break;if(++this.index,"\\"!==e||this.eof())t+=e;else if("u"===(e=this.source[this.index])){++this.index;var n=this.index,i=this.scanHexEscape("u");if(null!==i)for(t+=i;n=55296&&t<57343&&r.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t}();e.Scanner=l},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",times:"\xd7",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",divide:"\xf7",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",frasl:"\u2044",euro:"\u20ac",image:"\u2111",weierp:"\u2118",real:"\u211c",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lArr:"\u21d0",uArr:"\u21d1",rArr:"\u21d2",dArr:"\u21d3",hArr:"\u21d4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27e8",rang:"\u27e9"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),r=n(12),s=n(13),o=function(){function t(){this.values=[],this.curly=this.paren=-1}return t.prototype.beforeFunctionExpression=function(t){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)>=0},t.prototype.isRegexStart=function(){var t=this.values[this.values.length-1],e=null!==t;switch(t){case"this":case"]":e=!1;break;case")":var n=this.values[this.paren-1];e="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(e=!1,"function"===this.values[this.curly-3])e=!!(i=this.values[this.curly-4])&&!this.beforeFunctionExpression(i);else if("function"===this.values[this.curly-4]){var i;e=!(i=this.values[this.curly-5])||!this.beforeFunctionExpression(i)}}return e},t.prototype.push=function(t){7===t.type||4===t.type?("{"===t.value?this.curly=this.values.length:"("===t.value&&(this.paren=this.values.length),this.values.push(t.value)):this.values.push(null)},t}(),a=function(){function t(t,e){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=!!e&&"boolean"==typeof e.tolerant&&e.tolerant,this.scanner=new r.Scanner(t,this.errorHandler),this.scanner.trackComment=!!e&&"boolean"==typeof e.comment&&e.comment,this.trackRange=!!e&&"boolean"==typeof e.range&&e.range,this.trackLoc=!!e&&"boolean"==typeof e.loc&&e.loc,this.buffer=[],this.reader=new o}return t.prototype.errors=function(){return this.errorHandler.errors},t.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var e=0;e>10),56320+(t-65536&1023))}for(var _=new Array(256),C=new Array(256),S=0;S<256;S++)_[S]=w(S)?1:0,C[S]=w(S);function E(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||a,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function k(t,e){return new r(e,new s(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function A(t,e){throw k(t,e)}function D(t,e){t.onWarning&&t.onWarning.call(null,k(t,e))}var T={YAML:function(t,e,n){var i,r,s;null!==t.version&&A(t,"duplication of %YAML directive"),1!==n.length&&A(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&A(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&A(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&D(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&A(t,"TAG directive accepts exactly two arguments"),r=n[1],d.test(i=n[0])||A(t,"ill-formed tag handle (first argument) of the TAG directive"),l.call(t.tagMap,i)&&A(t,'there is a previously declared suffix for "'+i+'" tag handle'),p.test(r)||A(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=r}};function R(t,e,n,i){var r,s,o,a;if(e1&&(t.result+=i.repeat("\n",e-1))}function P(t,e){var n,i,r=t.tag,s=t.anchor,o=[],a=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),i=t.input.charCodeAt(t.position);0!==i&&45===i&&v(t.input.charCodeAt(t.position+1));)if(a=!0,t.position++,I(t,!0,-1)&&t.lineIndent<=e)o.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,U(t,e,3,!1,!0),o.push(t.result),I(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)A(t,"bad indentation of a sequence entry");else if(t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente)&&(U(t,e,4,!0,r)&&(g?p=t.result:f=t.result),g||(L(t,h,u,d,p,f,s,o),d=p=f=null),I(t,!0,-1),a=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==a)A(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===s?A(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):h?A(t,"repeat of an indentation width identifier"):(u=e+s-1,h=!0)}if(m(o)){do{o=t.input.charCodeAt(++t.position)}while(m(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!g(o)&&0!==o)}for(;0!==o;){for(M(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!h||t.lineIndentu&&(u=t.lineIndent),g(o))d++;else{if(t.lineIndent0){for(r=o,s=0;r>0;r--)(o=b(a=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+o:A(t,"expected hexadecimal character");t.result+=x(s),t.position++}else A(t,"unknown escape sequence");n=i=t.position}else g(a)?(R(t,n,i,!0),O(t,I(t,!1,e)),n=i=t.position):t.position===t.lineStart&&$(t)?A(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}A(t,"unexpected end of the stream within a double quoted scalar")}(t,p)?E=!0:function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!v(i)&&!y(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&A(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||A(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],I(t,!0,-1),!0}(t)?(E=!0,null===t.tag&&null===t.anchor||A(t,"alias node should not have any properties")):function(t,e,n){var i,r,s,o,a,l,c,h,u=t.kind,d=t.result;if(v(h=t.input.charCodeAt(t.position))||y(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(v(i=t.input.charCodeAt(t.position+1))||n&&y(i)))return!1;for(t.kind="scalar",t.result="",r=s=t.position,o=!1;0!==h;){if(58===h){if(v(i=t.input.charCodeAt(t.position+1))||n&&y(i))break}else if(35===h){if(v(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&$(t)||n&&y(h))break;if(g(h)){if(a=t.line,l=t.lineStart,c=t.lineIndent,I(t,!1,-1),t.lineIndent>=e){o=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=a,t.lineStart=l,t.lineIndent=c;break}}o&&(R(t,r,s,!1),O(t,t.line-a),r=s=t.position,o=!1),m(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return R(t,r,s,!1),!!t.result||(t.kind=u,t.result=d,!1)}(t,p,1===n)&&(E=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===w&&(E=c&&P(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&A(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),h=0,u=t.implicitTypes.length;h tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result)?(t.result=d.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):A(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):A(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||E}function V(t){var e,n,i,r,s=t.position,o=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(r=t.input.charCodeAt(t.position))&&(I(t,!0,-1),r=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==r));){for(o=!0,r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);for(i=[],(n=t.input.slice(e,t.position)).length<1&&A(t,"directive name must not be less than one character in length");0!==r;){for(;m(r);)r=t.input.charCodeAt(++t.position);if(35===r){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&!g(r));break}if(g(r))break;for(e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==r&&M(t),l.call(T,n)?T[n](t,n,i):D(t,'unknown document directive "'+n+'"')}I(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,I(t,!0,-1)):o&&A(t,"directives end mark is expected"),U(t,t.lineIndent-1,4,!1,!0),I(t,!0,-1),t.checkLineBreaks&&h.test(t.input.slice(s,t.position))&&D(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&$(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,I(t,!0,-1)):t.position0?o-4:o;for(n=0;n>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[h++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function h(t,e,n){for(var r,s=[],o=e;o>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},HUeH:function(t,e,n){"use strict";var i=n("ClZL"),r=n("XP29");function s(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n("hyoZ"),t.exports.Schema=n("3lC6"),t.exports.FAILSAFE_SCHEMA=n("2YgE"),t.exports.JSON_SCHEMA=n("+VNs"),t.exports.CORE_SCHEMA=n("RSjF"),t.exports.DEFAULT_SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_FULL_SCHEMA=n("VtPO"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=r.dump,t.exports.safeDump=r.safeDump,t.exports.YAMLException=n("w+qe"),t.exports.MINIMAL_SCHEMA=n("2YgE"),t.exports.SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_SCHEMA=n("VtPO"),t.exports.scan=s("scan"),t.exports.parse=s("parse"),t.exports.compose=s("compose"),t.exports.addConstructor=s("addConstructor")},Iab2:function(t,e,n){var i,r;void 0===(r="function"==typeof(i=function(){"use strict";function e(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){o(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function n(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,s=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(t,s,o){var a=r.URL||r.webkitURL,l=document.createElement("a");l.download=s=s||t.name||"download",l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?i(l):n(l.href)?e(t,s,o):i(l,l.target="_blank")):(l.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){i(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,r,s){if(r=r||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,s),r);else if(n(t))e(t,r,s);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){i(o)})}}:function(t,n,i,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,i);var a="application/octet-stream"===t.type,l=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var h=new FileReader;h.onloadend=function(){var t=h.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},h.readAsDataURL(t)}else{var u=r.URL||r.webkitURL,d=u.createObjectURL(t);o?o.location=d:location.href=d,o=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});r.saveAs=o.saveAs=o,t.exports=o})?i.apply(e,[]):i)||(t.exports=r)},LFvy:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},Ljib:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},MERt:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},Njqi:function(t,e,n){"use strict";var i;try{i=n("+U4B")}catch(s){"undefined"!=typeof window&&(i=window.esprima)}var r=n("hyoZ");t.exports=new r("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e=i.parse("("+t+")",{range:!0});return"Program"===e.type&&1===e.body.length&&"ExpressionStatement"===e.body[0].type&&("ArrowFunctionExpression"===e.body[0].expression.type||"FunctionExpression"===e.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,n="("+t+")",r=i.parse(n,{range:!0}),s=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"ArrowFunctionExpression"!==r.body[0].expression.type&&"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(t){s.push(t.name)}),e=r.body[0].expression.body.range,new Function(s,"BlockStatement"===r.body[0].expression.body.type?n.slice(e[0]+1,e[1]-1):"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},Pe6h:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ"),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!s.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,i,r;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){r.unshift(parseFloat(t,10))}),e=0,i=1,r.forEach(function(t){e+=t*i,i*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||i.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(t))return"-0.0";return n=t.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},RSjF:function(t,e,n){"use strict";var i=n("3lC6");t.exports=new i({include:[n("+VNs")]})},UQ3f:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},VtPO:function(t,e,n){"use strict";var i=n("3lC6");t.exports=i.DEFAULT=new i({include:[n("Z3Ei")],explicit:[n("MERt"),n("UQ3f"),n("Njqi")]})},XP29:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("w+qe"),s=n("VtPO"),o=n("Z3Ei"),a=Object.prototype.toString,l=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},h=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function u(t){var e,n,s;if(e=t.toString(16).toUpperCase(),t<=255)n="x",s=2;else if(t<=65535)n="u",s=4;else{if(!(t<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+i.repeat("0",s-e.length)+e}function d(t){this.schema=t.schema||s,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=i.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,i,r,s,o,a,c;if(null===e)return{};for(n={},r=0,s=(i=Object.keys(e)).length;r0?e.charCodeAt(o-1):null,f=f&&v(a,l)}else{for(o=0;or&&" "!==e[p+1],p=o);else if(!m(a))return 5;l=o>0?e.charCodeAt(o-1):null,f=f&&v(a,l)}u=u||d&&o-p-1>r&&" "!==e[p+1]}return h||u?i>9&&y(e)?5:u?4:3:f&&!function(e){return function(t,e){var n,i;for(n=0,i=t.implicitTypes.length;n-1&&n>=t.flowLevel,t.indent,o)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+w(e,t.indent)+x(p(e,s));case 4:return">"+w(e,t.indent)+x(p(function(t,e){for(var n,i,r,s=/(\n+)([^\n]*)/g,o=(r=t.indexOf("\n"),s.lastIndex=r=-1!==r?r:t.length,_(t.slice(0,r),e)),a="\n"===t[0]||" "===t[0];i=s.exec(t);){var l=i[2];n=" "===l[0],o+=i[1]+(a||n||""===l?"":"\n")+_(l,e),a=n}return o}(e,o),s));case 5:return'"'+function(t){for(var e,n,i,r="",s=0;s=55296&&e<=56319&&(n=t.charCodeAt(s+1))>=56320&&n<=57343?(r+=u(1024*(e-55296)+n-56320+65536),s++):r+=!(i=c[e])&&m(e)?t[s]:i||u(e);return r}(e)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function w(t,e){var n=y(t)?String(e):"",i="\n"===t[t.length-1];return n+(!i||"\n"!==t[t.length-2]&&"\n"!==t?i?"":"-":"+")+"\n"}function x(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function _(t,e){if(""===t||" "===t[0])return t;for(var n,i,r=/ [^ ]/g,s=0,o=0,a=0,l="";n=r.exec(t);)(a=n.index)-s>e&&(l+="\n"+t.slice(s,i=o>s?o:a),s=i+1),o=a;return l+="\n",(l+=t.length-s>e&&o>s?t.slice(s,o)+"\n"+t.slice(o+1):t.slice(s)).slice(1)}function C(t,e,n){var i,s,o,c,h,u;for(o=0,c=(s=n?t.explicitTypes:t.implicitTypes).length;o tag resolver accepts not "'+u+'" style');i=h.represent[u](e,u)}t.dump=i}return!0}return!1}function S(t,e,n,i,s,o){t.tag=null,t.dump=n,C(t,n,!1)||C(t,n,!0);var l=a.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var c,h,u="[object Object]"===l||"[object Array]"===l;if(u&&(h=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||h||2!==t.indent&&e>0)&&(s=!1),h&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(u&&h&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(function(t,e,n,i){var s,o,a,l,c,h,u="",d=t.tag,p=Object.keys(n);if(!0===t.sortKeys)p.sort();else if("function"==typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new r("sortKeys must be a boolean or a function");for(s=0,o=p.length;s1024)&&(t.dump&&10===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,c&&(h+=f(t,e)),S(t,e+1,l,!0,c)&&(t.dump&&10===t.dump.charCodeAt(0)?h+=":":h+=": ",u+=h+=t.dump));t.tag=d,t.dump=u||"{}"}(t,e,t.dump,s),h&&(t.dump="&ref_"+c+t.dump)):(function(t,e,n){var i,r,s,o,a,l="",c=t.tag,h=Object.keys(n);for(i=0,r=h.length;i1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),S(t,e,o,!1,!1)&&(l+=a+=t.dump));t.tag=c,t.dump="{"+l+"}"}(t,e,t.dump),h&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===l){var d=t.noArrayIndent&&e>0?e-1:e;i&&0!==t.dump.length?(function(t,e,n,i){var r,s,o="",a=t.tag;for(r=0,s=n.length;r "+t.dump)}return!0}function E(t,e){var n,i,r=[],s=[];for(k(t,r,s),n=0,i=s.length;n=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=s.match(/ Gecko\/\d+/),e.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,e.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,e.isAIR=s.indexOf("AdobeAIR")>=0,e.isAndroid=s.indexOf("Android")>=0,e.isChromeOS=s.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./useragent");if(e.buildDom=function t(e,n,i){if("string"==typeof e&&e){var r=document.createTextNode(e);return n&&n.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&n&&n.appendChild(e),e;if("string"!=typeof e[0]||!e[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var r=document.createElement("div");e.HI_DPI&&void 0!==r.style.transform&&(e.HAS_CSS_TRANSFORMS=!0),i.isEdge||void 0===r.style.animationName||(e.HAS_CSS_ANIMATION=!0),r=null}e.translate=e.HAS_CSS_TRANSFORMS?function(t,e,n){t.style.transform="translate("+Math.round(e)+"px, "+Math.round(n)+"px)"}:function(t,e,n){t.style.top=Math.round(n)+"px",t.style.left=Math.round(e)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,e,n){"use strict";e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},e.implement=function(t,n){e.mixin(t,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./oop"),r=function(){var t,e,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(e in n.FUNCTION_KEYS)t=n.FUNCTION_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);for(e in n.PRINTABLE_KEYS)t=n.PRINTABLE_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)n.KEY_MODS[e]=t.filter(function(t){return e&n.KEY_MODS[t]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(e,r),e.keyCodeToString=function(t){var e=r[t];return"string"!=typeof e&&(e=String.fromCharCode(t)),e.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i,r=t("./keys"),s=t("./useragent"),o=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){i={passive:!1}}})}catch(t){}}(),i}function c(t,e,n){this.elem=t,this.type=e,this.callback=n}c.prototype.destroy=function(){u(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=e.addListener=function(t,e,n,i){t.addEventListener(e,n,l()),i&&i.$toDestroy.push(new c(t,e,n))},u=e.removeListener=function(t,e,n){t.removeEventListener(e,n,l())};e.stopEvent=function(t){return e.stopPropagation(t),e.preventDefault(t),!1},e.stopPropagation=function(t){t.stopPropagation&&t.stopPropagation()},e.preventDefault=function(t){t.preventDefault&&t.preventDefault()},e.getButton=function(t){return"dblclick"==t.type?0:"contextmenu"==t.type||s.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.button},e.capture=function(t,e,n){var i=t&&t.ownerDocument||document;function r(t){e&&e(t),n&&n(t),u(i,"mousemove",e),u(i,"mouseup",r),u(i,"dragstart",r)}return h(i,"mousemove",e),h(i,"mouseup",r),h(i,"dragstart",r),r},e.addMouseWheelListener=function(t,e,n){"onmousewheel"in t?h(t,"mousewheel",function(t){void 0!==t.wheelDeltaX?(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8):(t.wheelX=0,t.wheelY=-t.wheelDelta/8),e(t)},n):"onwheel"in t?h(t,"wheel",function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0)}e(t)},n):h(t,"DOMMouseScroll",function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),e(t)},n)},e.addMultiMouseDownListener=function(t,n,i,r,o){var a,l,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(t){if(0!==e.getButton(t)?u=0:t.detail>1?++u>4&&(u=1):u=1,s.isIE){var o=Math.abs(t.clientX-a)>5||Math.abs(t.clientY-l)>5;c&&!o||(u=1),c&&clearTimeout(c),c=setTimeout(function(){c=null},n[u-1]||600),1==u&&(a=t.clientX,l=t.clientY)}if(t._clicks=u,i[r]("mousedown",t),u>4)u=0;else if(u>1)return i[r](d[u],t)}Array.isArray(t)||(t=[t]),t.forEach(function(t){h(t,"mousedown",p,o)})};var d=function(t){return 0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0)};function p(t,e,n){var i=d(e);if(!s.isMac&&o){if(e.getModifierState&&(e.getModifierState("OS")||e.getModifierState("Win"))&&(i|=8),o.altGr){if(3==(3&i))return;o.altGr=0}if(18===n||17===n){var l="location"in e?e.location:e.keyLocation;17===n&&1===l?1==o[n]&&(a=e.timeStamp):18===n&&3===i&&2===l&&e.timeStamp-a<50&&(o.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),i||13!==n||3!==(l="location"in e?e.location:e.keyLocation)||(t(e,i,-n),!e.defaultPrevented)){if(s.isChromeOS&&8&i){if(t(e,i,n),e.defaultPrevented)return;i&=-9}return!!(i||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&t(e,i,n)}}function f(){o=Object.create(null)}if(e.getModifierString=function(t){return r.KEY_MODS[d(t)]},e.addCommandKeyListener=function(t,n,i){if(s.isOldGecko||s.isOpera&&!("KeyboardEvent"in window)){var r=null;h(t,"keydown",function(t){r=t.keyCode},i),h(t,"keypress",function(t){return p(n,t,r)},i)}else{var a=null;h(t,"keydown",function(t){o[t.keyCode]=(o[t.keyCode]||0)+1;var e=p(n,t,t.keyCode);return a=t.defaultPrevented,e},i),h(t,"keypress",function(t){a&&(t.ctrlKey||t.altKey||t.shiftKey||t.metaKey)&&(e.stopEvent(t),a=null)},i),h(t,"keyup",function(t){o[t.keyCode]=null},i),o||(f(),h(window,"focus",f))}},"object"==typeof window&&window.postMessage&&!s.isOldIE){var g=1;e.nextTick=function(t,n){n=n||window;var i="zero-timeout-message-"+g++,r=function(s){s.data==i&&(e.stopPropagation(s),u(n,"message",r),t())};h(n,"message",r),n.postMessage(i,"*")}}e.$idleBlocked=!1,e.onIdle=function(t,n){return setTimeout(function n(){e.$idleBlocked?setTimeout(n,100):t()},n)},e.$idleBlockId=null,e.blockIdle=function(t){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout(function(){e.$idleBlocked=!1},t||100)},e.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame=e.nextFrame?e.nextFrame.bind(window):function(t){setTimeout(t,17)}}),ace.define("ace/range",["require","exports","module"],function(t,e,n){"use strict";var i=function(t,e,n,i){this.start={row:t,column:e},this.end={row:n,column:i}};(function(){this.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(t,e){return 0==this.compare(t,e)},this.compareRange=function(t){var e,n=t.end,i=t.start;return 1==(e=this.compare(n.row,n.column))?1==(e=this.compare(i.row,i.column))?2:0==e?1:0:-1==e?-2:-1==(e=this.compare(i.row,i.column))?-1:1==e?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(t){var e=this.compareRange(t);return-1==e||0==e||1==e},this.isEnd=function(t,e){return this.end.row==t&&this.end.column==e},this.isStart=function(t,e){return this.start.row==t&&this.start.column==e},this.setStart=function(t,e){"object"==typeof t?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=e)},this.setEnd=function(t,e){"object"==typeof t?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=e)},this.inside=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)&&!this.isStart(t,e)},this.insideStart=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)},this.insideEnd=function(t,e){return 0==this.compare(t,e)&&!this.isStart(t,e)},this.compare=function(t,e){return this.isMultiLine()||t!==this.start.row?tthis.end.row?1:this.start.row===t?e>=this.start.column?0:-1:this.end.row===t?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(t,e){return this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.compareEnd=function(t,e){return this.end.row==t&&this.end.column==e?1:this.compare(t,e)},this.compareInside=function(t,e){return this.end.row==t&&this.end.column==e?1:this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.clipRows=function(t,e){if(this.end.row>e)var n={row:e+1,column:0};else this.end.rowe)var r={row:e+1,column:0};else this.start.row0;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n};var i=/^\s\s*/,r=/\s\s*$/;e.stringTrimLeft=function(t){return t.replace(i,"")},e.stringTrimRight=function(t){return t.replace(r,"")},e.copyObject=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.copyArray=function(t){for(var e=[],n=0,i=t.length;nDate.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=t("../lib/dom"),o=t("../lib/lang"),a=t("../clipboard"),l=r.isChrome<18,c=r.isIE,h=r.isChrome>63,u=400,d=t("../lib/keys"),p=d.KEY_MODS,f=r.isIOS,g=f?/\s/:/\n/,m=r.isMobile;e.TextInput=function(t,e){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",t.insertBefore(n,t.firstChild);var v=!1,y=!1,b=!1,w=!1,x="";m||(n.style.fontSize="1px");var _=!1,C=!1,S="",E=0,k=0,A=0;try{var D=document.activeElement===n}catch(G){}i.addListener(n,"blur",function(t){C||(e.onBlur(t),D=!1)},e),i.addListener(n,"focus",function(t){if(!C){if(D=!0,r.isEdge)try{if(!document.hasFocus())return}catch(t){}e.onFocus(t),r.isEdge?setTimeout(T):T()}},e),this.$focusScroll=!1,this.focus=function(){if(x||h||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var t=n.style.top;n.style.position="fixed",n.style.top="0px";try{var e=0!=n.getBoundingClientRect().top}catch(G){return}var i=[];if(e)for(var r=n.parentElement;r&&1==r.nodeType;)i.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;n.focus({preventScroll:!0}),e&&i.forEach(function(t){t.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=t)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return D},e.on("beforeEndOperation",function(){var t=e.curOp,i=t&&t.command&&t.command.name;"insertstring"!=i&&(b&&i&&(t.docChanged||t.selectionChanged)&&(S=n.value="",U()),T())});var T=f?function(t){if(D&&(!v||t)&&!w){t||(t="");var i="\n ab"+t+"cde fg\n";i!=n.value&&(n.value=S=i);var r=4+(t.length||(e.selection.isEmpty()?0:1));4==E&&k==r||n.setSelectionRange(4,r),E=4,k=r}}:function(){if(!b&&!w&&(D||F)){b=!0;var t=0,i=0,r="";if(e.session){var s=e.selection,o=s.getRange(),a=s.cursor.row;if(t=o.start.column,i=o.end.column,r=e.session.getLine(a),o.start.row!=a){var l=e.session.getLine(a-1);t=o.start.rowa+1?c.length:i,i+=r.length+1,r=r+"\n"+c}else m&&a>0&&(r="\n"+r,i+=1,t+=1);r.length>u&&(t0&&S[d]==t[d];)d++,a--;for(c=c.slice(d),d=1;l>0&&S.length-d>E-1&&S[S.length-d]==t[t.length-d];)d++,l--;h-=d-1,u-=d-1;var p=c.length-d+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(i||c||h||a||l||u))return"";w=!0;var f=!1;return r.isAndroid&&". "==c&&(c=" ",f=!0),c&&!a&&!l&&!h&&!u||_?e.onTextInput(c):e.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:u}),w=!1,S=t,E=s,k=o,A=u,f?"\n":c},M=function(t){if(b)return B();if(t&&t.inputType){if("historyUndo"==t.inputType)return e.execCommand("undo");if("historyRedo"==t.inputType)return e.execCommand("redo")}var i=n.value,r=L(i,!0);(i.length>500||g.test(r)||m&&E<1&&E==k)&&T()},I=function(t,e,n){var i=t.clipboardData||window.clipboardData;if(i&&!l){var r=c||n?"Text":"text/plain";try{return e?!1!==i.setData(r,e):i.getData(r)}catch(t){if(!n)return I(t,e,!0)}}},$=function(t,r){var s=e.getCopyText();if(!s)return i.preventDefault(t);I(t,s)?(f&&(T(s),v=s,setTimeout(function(){v=!1},10)),r?e.onCut():e.onCopy(),i.preventDefault(t)):(v=!0,n.value=s,n.select(),setTimeout(function(){v=!1,T(),r?e.onCut():e.onCopy()}))},O=function(t){$(t,!0)},P=function(t){$(t,!1)},N=function(t){var s=I(t);a.pasteCancelled()||("string"==typeof s?(s&&e.onPaste(s,t),r.isIE&&setTimeout(T),i.preventDefault(t)):(n.value="",y=!0))};i.addCommandKeyListener(n,e.onCommandKey.bind(e),e),i.addListener(n,"select",function(t){b||(v?v=!1:function(t){return 0===t.selectionStart&&t.selectionEnd>=S.length&&t.value===S&&S&&t.selectionEnd!==k}(n)?(e.selectAll(),T()):m&&n.selectionStart!=E&&T())},e),i.addListener(n,"input",M,e),i.addListener(n,"cut",O,e),i.addListener(n,"copy",P,e),i.addListener(n,"paste",N,e),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(t,"keydown",function(t){if((!r.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:P(t);break;case 86:N(t);break;case 88:O(t)}},e);var B=function(){if(b&&e.onCompositionUpdate&&!e.$readOnly){if(_)return V();b.useTextareaForIME?e.onCompositionUpdate(n.value):(L(n.value),b.markerRange&&(b.context&&(b.markerRange.start.column=b.selectionStart=b.context.compositionStartOffset),b.markerRange.end.column=b.markerRange.start.column+k-b.selectionStart+A))}},U=function(t){e.onCompositionEnd&&!e.$readOnly&&(b=!1,e.onCompositionEnd(),e.off("mousedown",V),t&&M())};function V(){C=!0,n.blur(),n.focus(),C=!1}var H,j=o.delayedCall(B,50).schedule.bind(null,null);function z(){clearTimeout(H),H=setTimeout(function(){x&&(n.style.cssText=x,x=""),e.renderer.$isMousePressed=!1,e.renderer.$keepTextAreaAtCursor&&e.renderer.$moveTextAreaToCursor()},0)}i.addListener(n,"compositionstart",function(t){if(!b&&e.onCompositionStart&&!e.$readOnly&&(b={},!_)){t.data&&(b.useTextareaForIME=!1),setTimeout(B,0),e._signal("compositionStart"),e.on("mousedown",V);var i=e.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,b.markerRange=i,b.selectionStart=E,e.onCompositionStart(b),b.useTextareaForIME?(S=n.value="",E=0,k=0):(n.msGetInputContext&&(b.context=n.msGetInputContext()),n.getInputContext&&(b.context=n.getInputContext()))}},e),i.addListener(n,"compositionupdate",B,e),i.addListener(n,"keyup",function(t){27==t.keyCode&&n.value.lengthk&&"\n"==S[s]?o=d.end:ik&&S.slice(0,s).split("\n").length>2?o=d.down:s>k&&" "==S[s-1]?(o=d.right,a=p.option):(s>k||s==k&&k!=E&&i==s)&&(o=d.right),i!==s&&(a|=p.shift),o){if(!e.onCommandKey({},a,o)&&e.commands){o=d.keyCodeToString(o);var l=e.commands.findKeyCommand(a,o);l&&e.execCommand(l)}E=i,k=s,T("")}}};document.addEventListener("selectionchange",s),e.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,e,n)},e.$setUserAgentForTests=function(t,e){m=t,f=e}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/useragent");function r(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function s(t,e){if(t.start.row==t.end.row)var n=2*e.column-t.start.column-t.end.column;else n=t.start.row!=t.end.row-1||t.start.column||t.end.column?2*e.row-t.start.row-t.end.row:e.column-4;return n<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}(function(){this.onMouseDown=function(t){var e=t.inSelection(),n=t.getDocumentPosition();this.mousedownEvent=t;var r=this.editor,s=t.getButton();return 0!==s?((r.getSelectionRange().isEmpty()||1==s)&&r.selection.moveToPosition(n),void(2==s&&(r.textInput.onContextMenu(t.domEvent),i.isMozilla||t.preventDefault()))):(this.mousedownEvent.time=Date.now(),!e||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(t),this.startSelect(n,t.domEvent._clicks>1),t.preventDefault()):(this.setState("focusWait"),void this.captureMouse(t)))},this.startSelect=function(t,e){t=t||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(t):e||n.selection.moveToPosition(t),e||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)t=this.$clickSelection.end;else if(1==i)t=this.$clickSelection.start;else{var r=s(this.$clickSelection,n);n=r.cursor,t=r.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(t){var e,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[t](i.row,i.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==o&&a<=0)e=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&o>=0)e=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==o&&1==a)i=r.end,e=r.start;else{var l=s(this.$clickSelection,i);i=l.cursor,e=l.anchor}n.selection.setSelectionAnchor(e.row,e.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var t,e,n=(t=this.mousedownEvent.y,e=this.y,Math.sqrt(Math.pow(this.x-this.mousedownEvent.x,2)+Math.pow(e-t,2))),i=Date.now();(n>0||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(t){var e=t.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(t){var e=t.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(t){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(t){if(!t.getAccelKey()){t.getShiftKey()&&t.wheelY&&!t.wheelX&&(t.wheelX=t.wheelY,t.wheelY=0);var e=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=t.domEvent.timeStamp,r=i-n.t,s=r?t.wheelX/r:n.vx,o=r?t.wheelY/r:n.vy;r<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&e.renderer.isScrollableBy(t.wheelX*t.speed,0)&&(l=!0),a<=1&&e.renderer.isScrollableBy(0,t.wheelY*t.speed)&&(l=!0),l?n.allowed=i:i-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=s,n.vy=o,l?(e.renderer.scrollBy(t.wheelX*t.speed,t.wheelY*t.speed),t.stop()):void 0}}}).call(r.prototype),e.DefaultHandlers=r}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(t,e,n){"use strict";t("./lib/oop");var i=t("./lib/dom");function r(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(t){this.getElement().textContent=t},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(t,e){this.getElement().style.left=t+"px",this.getElement().style.top=e+"px"},this.setClassName=function(t){i.addCssClass(this.getElement(),t)},this.show=function(t,e,n){null!=t&&this.setText(t),null!=e&&null!=n&&this.setPosition(e,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),e.Tooltip=r}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/oop"),s=t("../lib/event"),o=t("../tooltip").Tooltip;function a(t){o.call(this,t)}r.inherits(a,o),(function(){this.setPosition=function(t,e){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),s=this.getHeight();(t+=15)+r>n&&(t-=t+r-n),(e+=15)+s>i&&(e-=20+s),o.prototype.setPosition.call(this,t,e)}}).call(a.prototype),e.GutterHandler=function(t){var e,n,r,o=t.editor,l=o.renderer.$gutterLayer,c=new a(o.container);function h(){e&&(e=clearTimeout(e)),r&&(c.hide(),r=null,o._signal("hideGutterTooltip",c),o.off("mousewheel",h))}function u(t){c.setPosition(t.x,t.y)}t.editor.setDefaultHandler("guttermousedown",function(e){if(o.isFocused()&&0==e.getButton()&&"foldWidgets"!=l.getRegion(e)){var n=e.getDocumentPosition().row,i=o.session.selection;if(e.getShiftKey())i.selectTo(n,0);else{if(2==e.domEvent.detail)return o.selectAll(),e.preventDefault();t.$clickSelection=o.selection.getLineRange(n)}return t.setState("selectByLines"),t.captureMouse(e),e.preventDefault()}}),t.editor.setDefaultHandler("guttermousemove",function(s){if(i.hasCssClass(s.domEvent.target||s.domEvent.srcElement,"ace_fold-widget"))return h();r&&t.$tooltipFollowsMouse&&u(s),n=s,e||(e=setTimeout(function(){e=null,n&&!t.isMousePressed?function(){var e=n.getDocumentPosition().row,i=l.$annotations[e];if(!i)return h();if(e==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return h()}if(r!=i)if(r=i.text.join("
"),c.setHtml(r),c.show(),o._signal("showGutterTooltip",c),o.on("mousewheel",h),t.$tooltipFollowsMouse)u(n);else{var d=n.domEvent.target.getBoundingClientRect(),p=c.getElement().style;p.left=d.right+"px",p.top=d.bottom+"px"}}():h()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(t){n=null,r&&!e&&(e=setTimeout(function(){e=null,h()},50))},o),o.on("changeSession",h)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=e.MouseEvent=function(t,e){this.domEvent=t,this.editor=e,this.x=this.clientX=t.clientX,this.y=this.clientY=t.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var t=this.editor.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=t.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/event"),s=t("../lib/useragent");function o(t){var e=t.editor,n=i.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),e.on("mousedown",this.onMouseDown.bind(t));var o,l,c,h,u,d,p,f,g,m,v,y=e.container,b=0;function w(){var t=d;(function(t,n){var i=Date.now();m&&n&&t.row==n.row&&n&&t.column==n.column?a(v.x,v.y,l,c)>5?m=null:i-m>=200&&(e.renderer.scrollCursorIntoView(),m=null):(e.moveCursorToPosition(t),m=i,v={x:l,y:c})})(d=e.renderer.screenToTextCoordinates(l,c),t),function(t,n){var i=Date.now(),r=e.renderer.layerConfig.lineHeight,s=e.renderer.layerConfig.characterWidth,o=e.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:c-o.top,bottom:o.bottom-c}},h=Math.min(a.x.left,a.x.right),u=Math.min(a.y.top,a.y.bottom),d={row:t.row,column:t.column};h/s<=2&&(d.column+=a.x.left=200&&e.renderer.scrollCursorIntoView(d):g=i:g=null}(d,t)}function x(){u=e.selection.toOrientedRange(),o=e.session.addMarker(u,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),w(),h=setInterval(w,20),b=0,r.addListener(document,"mousemove",S)}function _(){clearInterval(h),e.session.removeMarker(o),o=null,e.selection.fromOrientedRange(u),e.isFocused()&&!f&&e.$resetCursorStyle(),u=null,d=null,b=0,g=null,m=null,r.removeListener(document,"mousemove",S)}this.onDragStart=function(t){if(this.cancelDrag||!y.draggable){var i=this;return setTimeout(function(){i.startSelect(),i.captureMouse(t)},0),t.preventDefault()}u=e.getSelectionRange();var r=t.dataTransfer;r.effectAllowed=e.getReadOnly()?"copy":"copyMove",s.isOpera&&(e.container.appendChild(n),n.scrollTop=0),r.setDragImage&&r.setDragImage(n,0,0),s.isOpera&&e.container.removeChild(n),r.clearData(),r.setData("Text",e.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(t){y.draggable=!1,f=!1,this.setState(null),e.getReadOnly()||(p||"move"!=t.dataTransfer.dropEffect||e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||x(),b++,t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragOver=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||(x(),b++),null!==C&&(C=null),t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragLeave=function(t){if(--b<=0&&o)return _(),p=null,r.preventDefault(t)},this.onDrop=function(t){if(d){var n=t.dataTransfer;if(f)switch(p){case"move":u=u.contains(d.row,d.column)?{start:d,end:d}:e.moveText(u,d);break;case"copy":u=e.moveText(u,d,!0)}else{var i=n.getData("Text");u={start:d,end:e.session.insert(d,i)},e.focus(),p=null}return _(),r.preventDefault(t)}},r.addListener(y,"dragstart",this.onDragStart.bind(t),e),r.addListener(y,"dragend",this.onDragEnd.bind(t),e),r.addListener(y,"dragenter",this.onDragEnter.bind(t),e),r.addListener(y,"dragover",this.onDragOver.bind(t),e),r.addListener(y,"dragleave",this.onDragLeave.bind(t),e),r.addListener(y,"drop",this.onDrop.bind(t),e);var C=null;function S(){null==C&&(C=setTimeout(function(){null!=C&&o&&_()},20))}function E(t){var e=t.types;return!e||Array.prototype.some.call(e,function(t){return"text/plain"==t||"Text"==t})}function k(t){var e=["copy","copymove","all","uninitialized"],n=s.isMac?t.altKey:t.ctrlKey,i="uninitialized";try{i=t.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r="none";return n&&e.indexOf(i)>=0?r="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?r="move":e.indexOf(i)>=0&&(r="copy"),r}}function a(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor;t.container.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging"),t.renderer.setCursorStyle(s.isWin?"default":"move"),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&e.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),i=t.getButton();if(1===(t.domEvent.detail||1)&&0===i&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=t.domEvent.target||t.domEvent.srcElement;"unselectable"in r&&(r.unselectable="on"),e.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,e.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(o.prototype),e.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./mouse_event").MouseEvent,r=t("../lib/event"),s=t("../lib/dom");e.addTouchListeners=function(t,e){var n,o,a,l,c,h,u,d,p,f="scroll",g=0,m=0,v=0,y=0;function b(){var t,n,i;p||(t=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var r,o,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,r=e.getCopyText(),o=e.session.getUndoManager().hasUndo(),void p.replaceChild(s.buildDom(n?["span",!r&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],r&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],r&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],t&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),p.firstChild);"paste"==a?t.readText().then(function(t){e.execCommand(a,t)}):a&&("cut"!=a&&"copy"!=a||(t?t.writeText(e.getCopyText()):document.execCommand("copy")),e.execCommand(a)),p.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&e.focus()},p=s.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(t){f="menu",t.stopPropagation(),t.preventDefault(),e.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),i(t)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],e.container));var r=e.selection.cursor,o=e.renderer.textToScreenCoordinates(r.row,r.column),a=e.renderer.textToScreenCoordinates(0,0).pageX,l=e.renderer.scrollLeft,c=e.container.getBoundingClientRect();p.style.top=o.pageY-c.top-3+"px",o.pageX-c.left1)return clearTimeout(c),c=null,a=-1,void(f="zoom");d=e.$mouseHandler.isMousePressed=!0;var s=e.renderer.layerConfig.lineHeight,h=e.renderer.layerConfig.lineHeight,p=t.timeStamp;l=p;var b=r[0],w=b.clientX,_=b.clientY;Math.abs(n-w)+Math.abs(o-_)>s&&(a=-1),n=t.clientX=w,o=t.clientY=_,v=y=0;var C=new i(t,e);if(u=C.getDocumentPosition(),p-a<500&&1==r.length&&!g)m++,t.preventDefault(),t.button=0,function(){c=null,clearTimeout(c),e.selection.moveToPosition(u);var t=m>=2?e.selection.getLineRange(u.row):e.session.getBracketRange(u);t&&!t.isEmpty()?e.selection.setRange(t):e.selection.selectWord(),f="wait"}();else{m=0;var S=e.selection.cursor,E=e.selection.isEmpty()?S:e.selection.anchor,k=e.renderer.$cursorLayer.getPixelPosition(S,!0),A=e.renderer.$cursorLayer.getPixelPosition(E,!0),D=e.renderer.scroller.getBoundingClientRect(),T=e.renderer.layerConfig.offset,R=e.renderer.scrollLeft,F=function(t,e){return(t/=h)*t+(e=e/s-.75)*e};if(t.clientXM?"cursor":"anchor"),f=M<3.5?"anchor":L<3.5?"cursor":"scroll",c=setTimeout(x,450)}a=p},e),r.addListener(t,"touchend",function(t){d=e.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==f?(f="",g=0):c?(e.selection.moveToPosition(u),g=0,b()):"scroll"==f?(g+=60,h=setInterval(function(){g--<=0&&(clearInterval(h),h=null),Math.abs(v)<.01&&(v=0),Math.abs(y)<.01&&(y=0),g<20&&(v*=.9),g<20&&(y*=.9);var t=e.session.getScrollTop();e.renderer.scrollBy(10*v,10*y),t==e.session.getScrollTop()&&(g=0)},10),w()):b(),clearTimeout(c),c=null},e),r.addListener(t,"touchmove",function(t){c&&(clearTimeout(c),c=null);var r=t.touches;if(!(r.length>1||"zoom"==f)){var s=r[0],a=n-s.clientX,h=o-s.clientY;if("wait"==f){if(!(a*a+h*h>4))return t.preventDefault();f="cursor"}n=s.clientX,o=s.clientY,t.clientX=s.clientX,t.clientY=s.clientY;var u=t.timeStamp,d=u-l;if(l=u,"scroll"==f){var p=new i(t,e);p.speed=1,p.wheelX=a,p.wheelY=h,10*Math.abs(a)1&&(r=n[n.length-2]);var o=l[e+"Path"];return null==o?o=l.basePath:"/"==i&&(e=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+e+i+r+this.get("suffix")},e.setModuleUrl=function(t,e){return l.$moduleUrls[t]=e},e.$loading={},e.loadModule=function(n,i){var r,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{r=t(n)}catch(l){}if(r&&!e.$loading[n])return i&&i(r);if(e.$loading[n]||(e.$loading[n]=[]),e.$loading[n].push(i),!(e.$loading[n].length>1)){var a=function(){t([n],function(t){e._emit("load.module",{name:n,module:t});var i=e.$loading[n];e.$loading[n]=null,i.forEach(function(e){e&&e(t)})})};if(!e.get("packaged"))return a();s.loadScript(e.moduleUrl(n,o),a),c()}};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};function h(r){if(a&&a.document){l.packaged=r||t.packaged||i.packaged||a.define&&n("B9Yq").packaged;for(var s,o={},c="",h=document.currentScript||document._currentScript,u=(h&&h.ownerDocument||document).getElementsByTagName("script"),d=0;d=t){for(s=u+1;s=t;)s++;for(a=u,l=s-1;a=e.length||2!=(l=n[r-1])&&3!=l||2!=(c=e[r+1])&&3!=c?4:(s&&(c=3),c==l?c:4);case 10:return 2==(l=r>0?n[r-1]:5)&&r+10&&2==n[r-1])return 2;if(s)return 4;for(p=r+1,d=e.length;p=1425&&g<=2303||64286==g)&&(1==l||7==l))return 1}return r<1||5==(l=e[r-1])?4:n[r-1];case 5:return s=!1,o=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case u:return 4}}function m(t){var e=t.charCodeAt(0),n=e>>8;return 0==n?e>191?0:d[e]:5==n?/[\u0591-\u05f4]/.test(t)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(t)?12:/[\u0660-\u0669\u066b-\u066c]/.test(t)?3:1642==e?h:/[\u06f0-\u06f9]/.test(t)?2:7:32==n&&e<=8287?p[255&e]:254==n&&e>=65136?7:4}e.L=0,e.R=1,e.EN=2,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="\xb7",e.doBidiReorder=function(t,n,h){if(t.length<2)return{};var d=t.split(""),p=new Array(d.length),v=new Array(d.length),y=[];i=h?1:0,function(t,e,n,h){var u=i?c:l,d=null,p=null,f=null,v=0,y=null,b=-1,w=null,x=null,_=[];if(!h)for(w=0,h=[];w0)if(16==y){for(w=b;w-1){for(w=b;w=0&&8==h[C];C--)e[C]=i}}(d,y,d.length,n);for(var b=0;b7&&n[b]<13||4===n[b]||n[b]===u)?y[b]=e.ON_R:b>0&&"\u0644"===d[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[b])&&(y[b-1]=y[b]=e.R_H,b++);for(d[d.length-1]===e.DOT&&(y[d.length-1]=e.B),"\u202b"===d[0]&&(y[0]=e.RLE),b=0;b=0&&(t=this.session.$docRowCache[n])}return t},this.getSplitIndex=function(){var t=0,e=this.session.$screenRowCache;if(e.length)for(var n,i=this.session.$getRowCacheIndex(e,this.currentRow);this.currentRow-t>0&&(n=this.session.$getRowCacheIndex(e,this.currentRow-t-1))===i;)i=n,t++;else t=this.currentRow;return t},this.updateRowLine=function(t,e){void 0===t&&(t=this.getDocumentRow());var n=t===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(t),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[t];s&&(void 0===e&&(e=this.getSplitIndex()),e>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=ee?this.session.getOverwrite()?t:t-1:e,r=i.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&t<=e&&s[r]%2!=0&&r++;for(var a=0;ae&&s[r]%2==0&&(o+=this.charWidths[s[r]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(t,e){var n,i=this.bidiMap,r=i.bidiLevels,s=[],o=0,a=Math.min(t,e)-this.wrapIndent,l=Math.max(t,e)-this.wrapIndent,c=!1,h=!1,u=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,p=0;p=a&&dn+s/2;){if(n+=s,i===r.length-1){s=0;break}s=this.charWidths[r[++i]]}return i>0&&r[i-1]%2!=0&&r[i]%2==0?(t0&&r[i-1]%2==0&&r[i]%2!=0?e=1+(t>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===s&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?e=1+this.bidiMap.logicalFromVisual[i]:(i>0&&r[i-1]%2!=0&&0!==s&&i--,e=this.bidiMap.logicalFromVisual[i]),0===e&&this.isRtlDir&&e++,e+this.wrapIndent}}).call(o.prototype),e.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/lang"),s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(t){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),e.$isEmpty||e.$silent||e._emit("changeSelection"),e.$keepDesiredColumnOnChange||t.old.column==t.value.column||(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,e.$isEmpty||e.$silent||e._emit("changeSelection")})};(function(){i.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?o.fromPoints(e,e):this.isBackwards()?o.fromPoints(e,t):o.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var n=e?t.end:t.start,i=e?t.start:t.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(t,e,n,i){if(!this.$silent){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(n,i),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(void 0===e){var n=t||this.lead;t=n.row,e=n.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var n,i="number"==typeof t?t:this.lead.row,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,!0===e?new o(i,0,n,this.session.getLine(n).length):new o(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,n){var i=t.column,r=t.column+e;return n<0&&(i=t.column-e,r=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(i,r).split(" ").length-1==e},this.moveCursorLeft=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===e.column)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=i)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,e,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(i)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(e)),e>=n.length)return this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,n)}},this.$shortWordEndIndex=function(t){var e,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(t))n=this.session.tokenRe.lastIndex;else{for(;(e=t[n])&&i.test(e);)n++;if(n<1)for(r.lastIndex=0;(e=t[n])&&!r.test(e);)if(r.lastIndex=0,n++,i.test(e)){if(n>2){n--;break}for(;(e=t[n])&&i.test(e);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e),r=this.session.getFoldAt(t,e,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(e==n.length){var s=this.doc.getLength();do{t++,i=this.doc.getLine(t)}while(t0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var s=r.stringReverse(i),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===e&&(0!==t&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=t&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];t<0?t-=r.rowsAbove||0:t>0&&(t+=r.rowCount-(r.rowsAbove||0))}var s=this.session.screenToDocumentPosition(i.row+t,i.column,n);this.moveCursorTo(s.row,s.column+e,0===e)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,n){var i=this.session.getFoldAt(t,e,1);i&&(t=i.start.row,e=i.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(r.charAt(e))&&r.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,n){var i=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var n=this.getCursor();return o.fromPoints(e,n)}catch(i){return o.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(t){var e=t.clone();return e.isBackwards=t.cursor==t.start,e});else(t=this.getRange()).isBackwards=this.isBackwards();return t},this.fromJSON=function(t){if(null==t.start){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var n=o.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),e.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(t,e,n){"use strict";var i=t("./config"),r=2e3,s=function(t){for(var e in this.states=t,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[e],i=[],r=0,s=this.matchMappings[e]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(t,e){return"\\"+(parseInt(e,10)+r+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),s[r]=l,r+=u,i.push(h),c.onMatch||(c.onMatch=null)}}i.length||(s[0]=0,i.push("$")),a.forEach(function(t){t.splitRegex=this.createSplitterRegexp(t.regex,o)},this),this.regExps[e]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(t){r=0|t},this.$applyToken=function(t){var e=this.splitRegex.exec(t).slice(1),n=this.token.apply(this,e);if("string"==typeof n)return[{type:n,value:t}];for(var i=[],r=0,s=n.length;rh){var v=t.substring(h,m-g.length);d.type==p?d.value+=v:(d.type&&c.push(d),d={type:p,value:v})}for(var y=0;yr){for(u>2*t.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:t});h1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},this.reportError=i.reportError}).call(s.prototype),e.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(t,e){if(e)for(var n in t){for(var i=t[n],r=0;r=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var t=this.$rowTokens,e=this.$tokenIndex,n=t[e].start;if(void 0!==n)return n;for(n=0;e>0;)n+=t[e-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var t=this.$rowTokens[this.$tokenIndex],e=this.getCurrentTokenColumn();return new i(this.$row,e,this.$row,e+t.value.length)}}).call(r.prototype),e.TokenIterator=r}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,e,n){"use strict";var i,r=t("../../lib/oop"),s=t("../behaviour").Behaviour,o=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},u={'"':'"',"'":"'"},d=function(t){var e=-1;if(t.multiSelect&&(e=t.selection.index,h.rangeCount!=t.multiSelect.rangeCount&&(h={rangeCount:t.multiSelect.rangeCount})),h[e])return i=h[e];i=h[e]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(t,e,n,i){var r=t.end.row-t.start.row;return{text:n+e+i,selection:[0,t.start.column+1,r,t.end.column+(r?0:1)]}},f=function(t){this.add("braces","insertion",function(e,n,r,s,o){var l=r.getCursorPosition(),c=s.doc.getLine(l.row);if("{"==o){d(r);var h=r.getSelectionRange(),u=s.doc.getTextRange(h);if(""!==u&&"{"!==u&&r.getWrapBehavioursEnabled())return p(h,u,"{","}");if(f.isSaneInsertion(r,s))return/[\]\}\)]/.test(c[l.column])||r.inMultiSelectMode||t&&t.braces?(f.recordAutoInsert(r,s,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(r,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(r),"}"==c.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,c,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(r);var g="";if(f.isMaybeInsertedClosing(l,c)&&(g=a.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var m=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(s.getLine(m.row))}else{if(!g)return void f.clearMaybeInsertedClosing();v=this.$getIndent(c)}var y=v+s.getTabString();return{text:"\n"+y+"\n"+v+g,selection:[1,y.length,1,y.length]}}f.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(t,e,n,r,s){var o=r.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==r.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(t,e,n,i,r){if("("==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(d(n),")"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("brackets","insertion",function(t,e,n,i,r){if("["==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(d(n),"]"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("string_dquotes","insertion",function(t,e,n,i,r){var s=i.$mode.$quotes||u;if(1==r.length&&s[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;d(n);var o=r,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return p(a,l,o,o);if(!l){var c=n.getCursorPosition(),h=i.doc.getLine(c.row),f=h.substring(c.column-1,c.column),g=h.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==f&&m&&/escape/.test(m.type))return null;var y,b=m&&/string|escape/.test(m.type),w=!v||/string|escape/.test(v.type);if(g==o)(y=b!==w)&&/string\.end/.test(v.type)&&(y=!1);else{if(b&&!w)return null;if(b&&w)return null;var x=i.$mode.tokenRe;x.lastIndex=0;var _=x.test(f);x.lastIndex=0;var C=x.test(f);if(_||C)return null;if(g&&!/[\s;,.})\]\\]/.test(g))return null;var S=h[c.column-2];if(f==o&&(S==o||x.test(S)))return null;y=!0}return{text:y?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(t,e,n,i,r){var s=i.$mode.$quotes||u,o=i.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==o))return r.end.column++,r})};f.isSaneInsertion=function(t,e){var n=t.getCursorPosition(),i=new o(e,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(t.session.getLine(n.row)[n.column]))return!0;var r=new o(e,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},f.$matchTokenType=function(t,e){return e.indexOf(t.type||t)>-1},f.recordAutoInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isAutoInsertedClosing(r,s,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=r.row,i.autoInsertedLineEnd=n+s.substr(r.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isMaybeInsertedClosing(r,s)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=r.row,i.maybeInsertedLineStart=s.substr(0,r.column)+n,i.maybeInsertedLineEnd=s.substr(r.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(t,e,n){return i.autoInsertedBrackets>0&&t.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&e.substr(t.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(t,e){return i.maybeInsertedBrackets>0&&t.row===i.maybeInsertedRow&&e.substr(t.column)===i.maybeInsertedLineEnd&&e.substr(0,t.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},r.inherits(f,s),e.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(t,e,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,s=[],o=0;o2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,f=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+l.escapeRegExp(p)+")"),m=new RegExp("(?:"+l.escapeRegExp(f)+")\\s*$"),v=function(t,e){b(t,e)||s&&!/\S/.test(t)||(r.insertInLine({row:e,column:t.length},f),r.insertInLine({row:e,column:a},p))},y=function(t,e){var n;(n=t.match(m))&&r.removeInLine(e,t.length-n[0].length,t.length),(n=t.match(g))&&r.removeInLine(e,n[1].length,n[0].length)},b=function(t,n){if(g.test(t))return!0;for(var i=e.getTokens(n),r=0;rt.length&&(x=t.length)}),a==1/0&&(a=x,s=!1,o=!1),h&&a%c!=0&&(a=Math.floor(a/c)*c),w(o?y:v)},this.toggleBlockComment=function(t,e,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var s,o,a=(g=new c(e,i.row,i.column)).getCurrentToken(),l=e.selection.toOrientedRange();if(a&&/comment/.test(a.type)){for(var u,d;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(r.start))){var p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m;u=new h(p,f,p,f+r.start.length);break}a=g.stepBackward()}var g;for(a=(g=new c(e,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var m;if(-1!=(m=a.value.indexOf(r.end))){p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m,d=new h(p,f,p,f+r.end.length);break}a=g.stepForward()}d&&e.remove(d),u&&(e.remove(u),s=u.start.row,o=-r.start.length)}else o=r.start.length,s=n.start.row,e.insert(n.end,r.end),e.insert(n.start,r.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),e.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(t,e,n){return this.$getIndent(e)},this.checkOutdent=function(t,e,n){return!1},this.autoOutdent=function(t,e,n){},this.$getIndent=function(t){return t.match(/^\s*/)[0]},this.createWorker=function(t){return null},this.createModeDelegates=function(t){for(var e in this.$embeds=[],this.$modes={},t)if(t[e]){var n=t[e],r=n.prototype.$id,s=i.$modes[r];s||(i.$modes[r]=s=new n),i.$modes[e]||(i.$modes[e]=s),this.$embeds.push(e),this.$modes[e]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(e=0;ethis.row)){var n=function(e,n,i){var r="insert"==e.action,s=(r?1:-1)*(e.end.row-e.start.row),o=(r?1:-1)*(e.end.column-e.start.column),a=e.start,l=r?a:e.end;return t(n,a,i)?{row:n.row,column:n.column}:t(l,n,!i)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(t,e,n){var i;if(i=n?{row:t,column:e}:this.$clipPositionToDocument(t,e),this.row!=i.row||this.column!=i.column){var r={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:r,value:i})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,e))),e<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./apply_delta").applyDelta,s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=t("./anchor").Anchor,l=function(t){this.$lines=[""],0===t.length?this.$lines=[""]:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){i.implement(this,s),this.setValue=function(t){var e=this.getLength()-1;this.remove(new o(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},t)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(t,e){return new a(this,t,e)},this.$split=0==="aaa".split(/a/).length?function(t){return t.replace(/\r\n|\r/g,"\n").split("\n")}:function(t){return t.split(/\r\n|\r|\n/)},this.$detectNewLine=function(t){var e=t.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return"\r\n"==t||"\r"==t||"\n"==t},this.getLine=function(t){return this.$lines[t]||""},this.getLines=function(t,e){return this.$lines.slice(t,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(t){var e;if(t.start.row===t.end.row)e=[this.getLine(t.start.row).substring(t.start.column,t.end.column)];else{(e=this.getLines(t.start.row,t.end.row))[0]=(e[0]||"").substring(t.start.column);var n=e.length-1;t.end.row-t.start.row==n&&(e[n]=e[n].substring(0,t.end.column))}return e},this.insertLines=function(t,e){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(t,e)},this.removeLines=function(t,e){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(t,e)},this.insertNewLine=function(t){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(t,["",""])},this.insert=function(t,e){return this.getLength()<=1&&this.$detectNewLine(e),this.insertMergedLines(t,this.$split(e))},this.insertInLine=function(t,e){var n=this.clippedPos(t.row,t.column),i=this.pos(t.row,t.column+e.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[e]},!0),this.clonePos(i)},this.clippedPos=function(t,e){var n=this.getLength();void 0===t?t=n:t<0?t=0:t>=n&&(t=n-1,e=void 0);var i=this.getLine(t);return null==e&&(e=i.length),{row:t,column:e=Math.min(Math.max(e,0),i.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(t,e){return{row:t,column:e}},this.$clipPosition=function(t){var e=this.getLength();return t.row>=e?(t.row=Math.max(0,e-1),t.column=this.getLine(e-1).length):(t.row=Math.max(0,t.row),t.column=Math.min(Math.max(t.column,0),this.getLine(t.row).length)),t},this.insertFullLines=function(t,e){var n=0;(t=Math.min(Math.max(t,0),this.getLength()))0,i=e=0&&this.applyDelta({start:this.pos(t,this.getLine(t).length),end:this.pos(t+1,0),action:"remove",lines:["",""]})},this.replace=function(t,e){return t instanceof o||(t=o.fromPoints(t.start,t.end)),0===e.length&&t.isEmpty()?t.start:e==this.getTextRange(t)?t.end:(this.remove(t),e?this.insert(t.start,e):t.start)},this.applyDeltas=function(t){for(var e=0;e=0;e--)this.revertDelta(t[e])},this.applyDelta=function(t,e){var n="insert"==t.action;(n?t.lines.length<=1&&!t.lines[0]:!o.comparePoints(t.start,t.end))||(n&&t.lines.length>2e4?this.$splitAndapplyLargeDelta(t,2e4):(r(this.$lines,t,e),this._signal("change",t)))},this.$safeApplyDelta=function(t){var e=this.$lines.length;("remove"==t.action&&t.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=e,-1==i&&(i=e),s<=i&&n.fireUpdateEvent(s,i)}}};(function(){i.implement(this,r),this.setTokenizer=function(t){this.tokenizer=t,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(t){this.doc=t,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(t,e){this._signal("update",{data:{first:t,last:e}})},this.start=function(t){this.currentLine=Math.min(t||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.lines[e]=null;else if("remove"==t.action)this.lines.splice(e,n+1,null),this.states.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(t){return this.lines[t]||this.$tokenizeRow(t)},this.getState=function(t){return this.currentLine==t&&this.$tokenizeRow(t),this.states[t]||"start"},this.$tokenizeRow=function(t){var e=this.doc.getLine(t),n=this.tokenizer.getLineTokens(e,this.states[t-1],t);return this.states[t]+""!=n.state+""?(this.states[t]=n.state,this.lines[t+1]=null,this.currentLine>t+1&&(this.currentLine=t+1)):this.currentLine==t&&(this.currentLine=t+1),this.lines[t]=n.tokens}}).call(s.prototype),e.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=(t("./lib/oop"),t("./range").Range),s=function(t,e,n){this.setRegexp(t),this.clazz=e,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+""!=t+""&&(this.regExp=t,this.cache=[])},this.update=function(t,e,n,s){if(this.regExp)for(var o=s.lastRow,a=s.firstRow;a<=o;a++){var l=this.cache[a];null==l&&((l=i.getMatchOffsets(n.getLine(a),this.regExp)).length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(t){return new r(a,t.offset,a,t.offset+t.length)}),this.cache[a]=l.length?l:"");for(var c=l.length;c--;)e.drawSingleLineMarker(t,l[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),e.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../range").Range;function r(t,e){this.foldData=t,Array.isArray(e)?this.folds=e:e=this.folds=[e];var n=e[e.length-1];this.range=new i(e[0].start.row,e[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(t),this.folds.sort(function(t,e){return-t.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(t.start.row,t.start.column)>0?(this.end.row=t.end.row,this.end.column=t.end.column):this.range.compareStart(t.end.row,t.end.column)<0&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(t,e,n){var i,r,s=0,o=this.folds,a=!0;null==e&&(e=this.end.row,n=this.end.column);for(var l=0;l0)){var l=i(t,o.start);return 0===a?e&&0!==l?-s-2:s:l>0||0===l&&!e?s:-s-1}}return-s-1},this.add=function(t){var e=!t.isEmpty(),n=this.pointIndex(t.start,e);n<0&&(n=-n-1);var i=this.pointIndex(t.end,e,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,t)},this.addList=function(t){for(var e=[],n=t.length;n--;)e.push.apply(e,this.add(t[n]));return e},this.substractPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges.splice(e,1)},this.merge=function(){for(var t,e=[],n=this.ranges,r=(n=n.sort(function(t,e){return i(t.start,e.start)}))[0],s=1;s=0},this.containsPoint=function(t){return this.pointIndex(t)>=0},this.rangeAtPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges[e]},this.clipRows=function(t,e){var n=this.ranges;if(n[0].start.row>e||n[n.length-1].start.row=i);o++);if("insert"==t.action){for(var l=r-i,c=-e.column+n.column;oi);o++)if(h.start.row==i&&h.start.column>=e.column&&(h.start.column==e.column&&this.$bias<=0||(h.start.column+=c,h.start.row+=l)),h.end.row==i&&h.end.column>=e.column){if(h.end.column==e.column&&this.$bias<0)continue;h.end.column==e.column&&c>0&&oh.start.column&&h.end.column==s[o+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l}}else for(l=i-r,c=e.column-n.column;or);o++)h.end.rowe.column)&&(h.end.column=e.column,h.end.row=e.row):(h.end.column+=c,h.end.row+=l):h.end.row>r&&(h.end.row+=l),h.start.rowe.column)&&(h.start.column=e.column,h.start.row=e.row):(h.start.column+=c,h.start.row+=l):h.start.row>r&&(h.start.row+=l);if(0!=l&&o=t)return r;if(r.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var n=this.$foldData,i=0;for(e&&(i=n.indexOf(e)),-1==i&&(i=0);i=t)return r}return null},this.getFoldedRowCount=function(t,e){for(var n=this.$foldData,i=e-t+1,r=0;r=e){a=t?i-=e-a:i=0);break}o>=t&&(i-=a>=t?o-a:o-t+1)}return i},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(t,e){return t.start.row-e.start.row}),t},this.addFold=function(t,e){var n,i=this.$foldData,o=!1;t instanceof s?n=t:(n=new s(e,t)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,h=n.end.column,u=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1);if(u&&d==u)return u.addSubFold(n);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(c,h)&&this.removeFold(d);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach(function(t){n.addSubFold(t)}));for(var f=0;f0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(t){this.expandFold(t)},this)},this.unfold=function(t,e){var n,r;if(null==t?(n=new i(0,0,this.getLength(),0),null==e&&(e=!0)):n="number"==typeof t?new i(t,0,t,this.getLine(t).length):"row"in t?i.fromPoints(t,t):t,r=this.getFoldsInRangeList(n),0!=e?this.removeFolds(r):this.expandFolds(r),r.length)return r},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var n=this.getFoldLine(t,e);return n?n.end.row:t},this.getRowFoldStart=function(t,e){var n=this.getFoldLine(t,e);return n?n.start.row:t},this.getFoldDisplayLine=function(t,e,n,i,r){null==i&&(i=t.start.row),null==r&&(r=0),null==e&&(e=t.end.row),null==n&&(n=this.getLine(e).length);var s=this.doc,o="";return t.walk(function(t,e,n,a){if(!(eh)break}while(s&&l.test(s.type));s=r.stepBackward()}else s=r.getCurrentToken();return c.end.row=r.getCurrentTokenRow(),c.end.column=r.getCurrentTokenColumn()+s.value.length-2,c}},this.foldAll=function(t,e,n,i){null==n&&(n=1e5);var r=this.foldWidgets;if(r){e=e||this.getLength();for(var s=t=t||0;s=t&&(s=o.end.row,o.collapseChildren=n,this.addFold("...",o))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var n=t.getTokens(e),i=0;i=0;){var s=n[r];if(null==s&&(s=n[r]=this.getFoldWidget(r)),"start"==s){var o=this.getFoldWidgetRange(r);if(i||(i=o),o&&o.end.row>=t)break}r--}return{range:-1!==r&&o,firstRange:i}},this.onFoldWidgetClick=function(t,e){if(!this.$toggleFoldWidget(t,{children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey})){var n=e.target||e.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var n=this.getFoldWidget(t),i=this.getLine(t),r="end"===n?-1:1,s=this.getFoldAt(t,-1===r?0:i.length,r);if(s)return e.children||e.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(t,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(e.siblings){var a=this.getParentFoldRangeData(t);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,e.all?1e4:0)}else e.children?(c=o?o.end.row:this.getLength(),this.foldAll(t+1,c,e.all?1e4:0)):o&&(e.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var n=this.$toggleFoldWidget(e,{});if(!n){var i=this.getParentFoldRangeData(e,!0);if(n=i.range||i.firstRange){var r=this.getFoldAt(e=n.start.row,this.getLine(e).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.foldWidgets[e]=null;else if("remove"==t.action)this.foldWidgets.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,e,n){"use strict";var i=t("../token_iterator").TokenIterator,r=t("../range").Range;e.BracketMatch=function(){this.findMatchingBracket=function(t,e){if(0==t.column)return null;var n=e||this.getLine(t.row).charAt(t.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t):null},this.getBracketRange=function(t){var e,n=this.getLine(t.row),i=!0,s=n.charAt(t.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(t.column),t={row:t.row,column:t.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),i=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],t)))return null;e=r.fromPoints(t,a),i||(e.end.column++,e.start.column--),e.cursor=e.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],t)))return null;e=r.fromPoints(a,t),i||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(t){var e=this.getLine(t.row),n=e.charAt(t.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=e.charAt(t.column),t={row:t.row,column:t.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!i)return null;var s=new r(t.row,t.column-1,t.row,t.column),o=i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t);return o?[s,new r(o.row,o.column,o.row,o.column+1)]:[s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==r){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else h==t&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;ln&&(this.$docRowCache.splice(n,e),this.$screenRowCache.splice(n,e))},this.$getRowCacheIndex=function(t,e){for(var n=0,i=t.length-1;n<=i;){var r=n+i>>1,s=t[r];if(e>s)n=r+1;else{if(!(e=e);s++);return(n=i[s])?(n.index=s,n.start=r-n.value.length,n):null},this.setUndoManager=function(t){if(this.$undoManager=t,this.$informUndoManager&&this.$informUndoManager.cancel(),t){var e=this;t.addSession(this),this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(t){this.setOption("useSoftTabs",t)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(t){this.setOption("tabSize",t)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(t){return this.$useSoftTabs&&t.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(t){this.setOption("navigateWithinSoftTabs",t)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(t){this.setOption("overwrite",t)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(t,e){this.$decorations[t]||(this.$decorations[t]=""),this.$decorations[t]+=" "+e,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(t,e){this.$decorations[t]=(this.$decorations[t]||"").replace(" "+e,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(t){this.$breakpoints=[];for(var e=0;e0&&(i=!!n.charAt(e-1).match(this.tokenRe)),i||(i=!!n.charAt(e).match(this.tokenRe)),i)var r=this.tokenRe;else r=/^\s+$/.test(n.slice(e-1,e+1))?/\s/:this.nonTokenRe;var s=e;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(r));s++}for(var o=e;ot&&(t=e.screenWidth)}),this.lineWidgetWidth=t},this.$computeWidth=function(t){if(this.$modified||t){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,s=this.$foldData[r],o=s?s.start.row:1/0,a=e.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[r++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(e[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(t,e){return this.doc.getLines(t,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(t,e){return this.doc.insert(t,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(t,e){return this.doc.removeFullLines(t,e)},this.undoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=t.length-1;-1!=n;n--){var i=t[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!e&&this.$undoSelect&&(t.selectionBefore?this.selection.fromJSON(t.selectionBefore):this.selection.setRange(this.$getUndoSelection(t,!0))),this.$fromUndo=!1}},this.redoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=0;nt.end.column&&(s.start.column+=c),s.end.row==t.end.row&&s.end.column>t.end.column&&(s.end.column+=c)),l&&s.start.row>=t.end.row&&(s.start.row+=l,s.end.row+=l)),s.end=this.insert(s.start,i),r.length){var o=t.start,a=s.start,l=a.row-o.row,c=a.column-o.column;this.addFolds(r.map(function(t){return(t=t.clone()).start.row==o.row&&(t.start.column+=c),t.end.row==o.row&&(t.end.column+=c),t.start.row+=l,t.end.row+=l,t}))}return s},this.indentRows=function(t,e,n){n=n.replace(/\t/g,this.getTabString());for(var i=t;i<=e;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(t){for(var e=t.collapseRows(),n=new h(0,0,0,0),i=this.getTabSize(),r=e.start.row;r<=e.end.row;++r){var s=this.getLine(r);n.start.row=r,n.end.row=r;for(var o=0;o0){var r;if((r=this.getRowFoldEnd(e+n))>this.doc.getLength()-1)return 0;i=r-e}else t=this.$clipRowToDocument(t),i=(e=this.$clipRowToDocument(e))-t+1;var s=new h(t,0,e,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(t){return(t=t.clone()).start.row+=i,t.end.row+=i,t}),a=0==n?this.doc.getLines(t,e):this.doc.removeFullLines(t,e);return this.doc.insertFullLines(t+i,a),o.length&&this.addFolds(o),i},this.moveLinesUp=function(t,e){return this.$moveLines(t,e,-1)},this.moveLinesDown=function(t,e){return this.$moveLines(t,e,1)},this.duplicateLines=function(t,e){return this.$moveLines(t,e,0)},this.$clipRowToDocument=function(t){return Math.max(0,Math.min(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(t,e){return e<0?0:Math.min(this.doc.getLine(t).length,e)},this.$clipPositionToDocument=function(t,e){if(e=Math.max(0,e),t<0)t=0,e=0;else{var n=this.doc.getLength();t>=n?(t=n-1,e=this.doc.getLine(n-1).length):e=Math.min(this.doc.getLine(t).length,e)}return{row:t,column:e}},this.$clipRangeToDocument=function(t){t.start.row<0?(t.start.row=0,t.start.column=0):t.start.column=this.$clipColumnToRow(t.start.row,t.start.column);var e=this.doc.getLength()-1;return t.end.row>e?(t.end.row=e,t.end.column=this.doc.getLine(e).length):t.end.column=this.$clipColumnToRow(t.end.row,t.end.column),t},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(t){if(t!=this.$useWrapMode){if(this.$useWrapMode=t,this.$modified=!0,this.$resetRowCache(0),t){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(t,e){this.$wrapLimitRange.min===t&&this.$wrapLimitRange.max===e||(this.$wrapLimitRange={min:t,max:e},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(t,e){var n=this.$wrapLimitRange;n.max<0&&(n={min:e,max:e});var i=this.$constrainWrapLimit(t,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(t,e,n){return e&&(t=Math.max(e,t)),n&&(t=Math.min(n,t)),t},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(t){this.setWrapLimitRange(t,t)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(t){var e=this.$useWrapMode,n=t.action,i=t.start,r=t.end,s=i.row,o=r.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[e?"$wrapData":"$rowLengthCache"].splice(s,a);var c=this.$foldData;l=this.getFoldsInRange(t),this.removeFolds(l);var h=0;if(g=this.getFoldLine(r.row)){g.addRemoveChars(r.row,r.column,i.column-r.column),g.shiftRow(-a);var u=this.getFoldLine(s);u&&u!==g&&(u.merge(g),g=u),h=c.indexOf(g)+1}for(;h=r.row&&g.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var p=e?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,d),c=this.$foldData,h=0,g=this.getFoldLine(s)){var f=g.range.compareInside(i.row,i.column);0==f?(g=g.split(i.row,i.column))&&(g.shiftRow(a),g.addRemoveChars(o,0,r.column-i.column)):-1==f&&(g.addRemoveChars(s,0,r.column-i.column),g.shiftRow(a)),h=c.indexOf(g)+1}for(;h=s&&g.shiftRow(a)}}else a=Math.abs(t.start.column-t.end.column),"remove"===n&&(l=this.getFoldsInRange(t),this.removeFolds(l),a=-a),(g=this.getFoldLine(s))&&g.addRemoveChars(s,i.column,a);return e&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,e?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(t,e,n){this.$rowLengthCache[t]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(n,i){var r,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,h=n;for(i=Math.min(i,o.length-1);h<=i;)(s=this.getFoldLine(h,s))?(r=[],s.walk((function(n,i,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,r.length))[0]=t;for(var c=1;c=4352&&t<=4447||t>=4515&&t<=4519||t>=4602&&t<=4607||t>=9001&&t<=9002||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12283||t>=12288&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12589||t>=12593&&t<=12686||t>=12688&&t<=12730||t>=12736&&t<=12771||t>=12784&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=13054||t>=13056&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=55216&&t<=55238||t>=55243&&t<=55291||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=65281&&t<=65376||t>=65504&&t<=65510)}this.$computeWrapSplits=function(n,i,r){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,c=this.$wrapAsCode,h=this.$indentedSoftWrap,u=i<=Math.max(2*r,8)||!1===h?0:Math.floor(i/2);function d(t){for(var e=t-a,i=a;ii-p;){var f=a+i-p;if(n[f-1]>=10&&n[f]>=10)d(f);else if(n[f]!=t&&n[f]!=e){for(var g=Math.max(f-(i-(i>>2)),a-1);f>g&&n[f]g&&n[f]g&&9==n[f];)f--}else for(;f>g&&n[f]<10;)f--;f>g?d(++f):(2==n[f=a+i]&&f--,d(f-p))}else{for(;f!=a-1&&n[f]!=t;f--);if(f>a){d(f);continue}for(f=a+i;f39&&o<48||o>57&&o<64?r.push(9):o>=4352&&n(o)?r.push(1,2):r.push(1)}return r},this.$getStringScreenWidth=function(t,e,i){if(0==e)return[0,0];var r,s;for(null==e&&(e=1/0),i=i||0,s=0;s=4352&&n(r)?i+=2:i+=1,!(i>e));s++);return[i,s]},this.lineWidgets=null,this.getRowLength=function(t){var e=1;return this.lineWidgets&&(e+=this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0),this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+e:e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(t){if(this.$useWrapMode){var e=this.screenToDocumentPosition(t,Number.MAX_VALUE),n=this.$wrapData[e.row];return n.length&&n[0]=0){a=c[h],s=this.$docRowCache[h];var d=t>c[u-1]}else d=!u;for(var p=this.getLength()-1,f=this.getNextFoldLine(s),g=f?f.start.row:1/0;a<=t&&!(a+(l=this.getRowLength(s))>t||s>=p);)a+=l,++s>g&&(g=(f=this.getNextFoldLine(s=f.end.row+1,f))?f.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(f&&f.start.row<=s)i=this.getFoldDisplayLine(f),s=f.start.row;else{if(a+l<=t||s>p)return{row:p,column:this.getLine(p).length};i=this.getLine(s),f=null}var m=0,v=Math.floor(t-a);if(this.$useWrapMode){var y=this.$wrapData[s];y&&(r=y[v],v>0&&y.length&&(m=y.indent,i=i.substring(o=y[v-1]||y[y.length-1])))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,s,v)&&(e=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(i,e-m)[1],this.$useWrapMode&&o>=r&&(o=r-1),f?f.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(t,e){if(void 0===e)var n=this.$clipPositionToDocument(t.row,t.column);else n=this.$clipPositionToDocument(t,e);var i,r=0,s=null;(i=this.getFoldAt(t=n.row,e=n.column,1))&&(t=i.start.row,e=i.start.column);var o,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,t),h=l.length;if(h&&c>=0){a=l[c],r=this.$screenRowCache[c];var u=t>l[h-1]}else u=!h;for(var d=this.getNextFoldLine(a),p=d?d.start.row:1/0;a=p){if((o=d.end.row+1)>t)break;p=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;r+=this.getRowLength(a),a=o,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(r))}var f="";d&&a>=p?(f=this.getFoldDisplayLine(d,t,e),s=d.start.row):(f=this.getLine(t).substring(0,e),s=t);var g=0;if(this.$useWrapMode){var m=this.$wrapData[s];if(m){for(var v=0;f.length>=m[v];)r++,v++;f=f.substring(m[v-1]||0,f.length),g=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(r+=this.lineWidgets[a].rowsAbove),{row:r,column:g+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(t,e){return this.documentToScreenPosition(t,e).column},this.documentToScreenRow=function(t,e){return this.documentToScreenPosition(t,e).row},this.getScreenLength=function(){var t=0,e=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=(a=0,(e=this.$foldData[a++])?e.start.row:1/0);ir&&(i=e.end.row+1,r=(e=this.$foldData[a++])?e.start.row:1/0)}else{t=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[i,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=n}).call(f.prototype),t("./edit_session/folding").Folding.call(f.prototype),t("./edit_session/bracket_match").BracketMatch.call(f.prototype),o.defineOptions(f.prototype,"session",{wrap:{set:function(t){if(t&&"off"!=t?"free"==t?t=!0:"printMargin"==t?t=-1:"string"==typeof t&&(t=parseInt(t,10)||!1):t=!1,this.$wrap!=t)if(this.$wrap=t,t){var e="number"==typeof t?t:null;this.setWrapLimitRange(e,e),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(t){(t="auto"==t?"text"!=this.$mode.type:"text"!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){(t=parseInt(t))>0&&this.$tabSize!==t&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(t){this.setFoldStyle(t)},handlesSet:!0},overwrite:{set:function(t){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=t("./lib/oop"),s=t("./range").Range,o=function(){this.$options={}};(function(){this.set=function(t){return r.mixin(this.$options,t),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var i=null;return n.forEach(function(t,n,r,o){return i=new s(t,n,r,o),!(n==o&&e.start&&e.start.start&&0!=e.skipCurrent&&i.isEqual(e.start)&&(i=null,1))}),i},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,r=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),o=[],a=e.re;if(e.$isMultiLine){var l,c=a.length,h=r.length-c;t:for(var u=a.offset||0;u<=h;u++){for(var d=0;dg||(o.push(l=new s(u,g,u+c-1,m)),c>2&&(u=u+c-2))}}else for(var v=0;vx&&o[d].end.row==n.end.row;)d--;for(o=o.slice(v,d+1),v=0,d=o.length;v=a;n--)if(u(n,Number.MAX_VALUE,t))return;if(0!=e.wrap)for(n=l,a=o.row;n>=a;n--)if(u(n,Number.MAX_VALUE,t))return}};else c=function(t){var n=o.row;if(!u(n,o.column,t)){for(n+=1;n<=l;n++)if(u(n,0,t))return;if(0!=e.wrap)for(n=a,l=o.row;n<=l;n++)if(u(n,0,t))return}};if(e.$isMultiLine)var h=n.length,u=function(e,r,s){var o=i?e-h+1:e;if(!(o<0)){var a=t.getLine(o),l=a.search(n[0]);if(!(!i&&lr))return!!s(o,l,o+h-1,u)||void 0}}};else u=i?function(e,i,r){var s,o=t.getLine(e),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){if(l=s.index,!(h=s[0].length)){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+h>i)break;a.push(s.index,h)}for(var c=a.length-1;c>=0;c-=2){var h,u=a[c-1];if(r(e,u,e,u+(h=a[c])))return!0}}:function(e,i,r){var s,o,a=t.getLine(e);for(n.lastIndex=i;o=n.exec(a);){var l=o[0].length;if(r(e,s=o.index,e,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:c}}}).call(o.prototype),e.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/keys"),r=t("../lib/useragent"),s=i.KEY_MODS;function o(t,e){this.platform=e||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function a(t,e){o.call(this,t,e),this.$singleCommand=!1}a.prototype=o.prototype,(function(){function t(t){return"object"==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(t,e){var n=t&&("string"==typeof t?t:t.name);t=this.commands[n],e||delete this.commands[n];var i=this.commandKeyBinding;for(var r in i){var s=i[r];if(s==t)delete i[r];else if(Array.isArray(s)){var o=s.indexOf(t);-1!=o&&(s.splice(o,1),1==s.length&&(i[r]=s[0]))}}},this.bindKey=function(t,e,n){if("object"==typeof t&&t&&(null==n&&(n=t.position),t=t[this.platform]),t)return"function"==typeof e?this.addCommand({exec:e,bindKey:t,name:e.name||t}):void t.split("|").forEach(function(t){var i="";if(-1!=t.indexOf(" ")){var r=t.split(/\s+/);t=r.pop(),r.forEach(function(t){var e=this.parseKeys(t);this._addCommandToBinding(i+=(i?" ":"")+(s[e.hashId]+e.key),"chainKeys")},this),i+=" "}var o=this.parseKeys(t);this._addCommandToBinding(i+(s[o.hashId]+o.key),e,n)},this)},this._addCommandToBinding=function(e,n,i){var r,s=this.commandKeyBinding;if(n)if(!s[e]||this.$singleCommand)s[e]=n;else{Array.isArray(s[e])?-1!=(r=s[e].indexOf(n))&&s[e].splice(r,1):s[e]=[s[e]],"number"!=typeof i&&(i=t(n));var o=s[e];for(r=0;ri);r++);o.splice(r,0,n)}else delete s[e]},this.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var n=t[e];if(n){if("string"==typeof n)return this.bindKey(n,e);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=e),this.addCommand(n))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(t){return t}),n=e.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else{if(!e.length)return{key:n,hashId:-1};if(1==e.length&&"shift"==e[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=e.length;o--;){var a=i.KEY_MODS[e[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+e[o]+" in "+t),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(t,e){return this.commandKeyBinding[s[t]+e]},this.handleKeyboard=function(t,e,n,i){if(!(i<0)){var r=s[e]+n,o=this.commandKeyBinding[r];return t.$keyChain&&(t.$keyChain+=" "+r,o=this.commandKeyBinding[t.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(t.$keyChain&&(e&&4!=e||1!=n.length?(-1==e||i>0)&&(t.$keyChain=""):t.$keyChain=t.$keyChain.slice(0,-r.length-1)),{command:o}):(t.$keyChain=t.$keyChain||r,{command:"null"})}},this.getStatusText=function(t,e){return e.$keyChain||""}}).call(o.prototype),e.HashHandler=o,e.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../keyboard/hash_handler").MultiHashHandler,s=t("../lib/event_emitter").EventEmitter,o=function(t,e){r.call(this,e,t),this.byName=this.commands,this.setDefaultHandler("exec",function(t){return t.command.exec(t.editor,t.args||{})})};i.inherits(o,r),(function(){i.implement(this,s),this.exec=function(t,e,n){if(Array.isArray(t)){for(var i=t.length;i--;)if(this.exec(t[i],e,n))return!0;return!1}if("string"==typeof t&&(t=this.commands[t]),!t)return!1;if(e&&e.$readOnly&&!t.readOnly)return!1;if(0!=this.$checkCommandState&&t.isAvailable&&!t.isAvailable(e))return!1;var r={editor:e,command:t,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.toggleRecording=function(t){if(!this.$inReplay)return t&&t._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(t){return t.map(function(t){return"string"!=typeof t[0]&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}).call(o.prototype),e.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=t("../config"),s=t("../range").Range;function o(t,e){return{win:t,mac:e}}e.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(t,e){"number"!=typeof e||isNaN(e)||t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty()?t.selection.getLineRange():t.selection.getRange();t._emit("cut",e),e.isEmpty()||t.session.remove(e),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(i.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(t){for(var e=t.selection.isBackwards(),n=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),r=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),o=t.session.doc.getLine(n.row).length,a=t.session.doc.getTextRange(t.selection.getRange()).replace(/\n\s*/," ").length,l=t.session.doc.getLine(n.row),c=n.row+1;c<=r.row+1;c++){var h=i.stringTrimLeft(i.stringTrimRight(t.session.doc.getLine(c)));0!==h.length&&(h=" "+h),l+=h}r.row+10?(t.selection.moveCursorTo(n.row,n.column),t.selection.selectTo(n.row,n.column+a)):(o=t.session.doc.getLine(n.row).length>o?o+1:o,t.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(t){var e=t.session.doc.getLength()-1,n=t.session.doc.getLine(e).length,i=t.selection.rangeList.ranges,r=[];i.length<1&&(i=[t.selection.getRange()]);for(var o=0;o=r.lastRow||i.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(t){if(this.$mergeUndoDeltas){var e=this.prevOp,n=this.$mergeableCommands,i=e.command&&t.command.name==e.command.name;if("insertstring"==t.command.name){var r=t.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(e.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(t.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(t.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,e){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var n=this;v.loadModule(["keybinding",t],function(i){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(i&&i.handler),e&&e()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),e&&e()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(t){if(this.session!=t){this.curOp&&this.endOperation(),this.curOp={};var e=this.session;if(e){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=t,t?(this.$onDocumentChange=this.onDocumentChange.bind(this),t.on("change",this.$onDocumentChange),this.renderer.setSession(t),this.$onChangeMode=this.onChangeMode.bind(this),t.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),t.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),t.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),t.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),t.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),t.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=t.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(t)),this._signal("changeSession",{session:t,oldSession:e}),this.curOp=null,e&&e._signal("changeEditor",{oldEditor:this}),t&&t._signal("changeEditor",{editor:this}),t&&t.bgTokenizer&&t.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(t,e){return this.session.doc.setValue(t),e?1==e?this.navigateFileEnd():-1==e&&this.navigateFileStart():this.selectAll(),t},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(t){this.renderer.onResize(t)},this.setTheme=function(t,e){this.renderer.setTheme(t,e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(t){this.renderer.setStyle(t)},this.unsetStyle=function(t){this.renderer.unsetStyle(t)},this.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},this.setFontSize=function(t){this.setOption("fontSize",t)},this.$highlightBrackets=function(){if(!this.$highlightPending){var t=this;this.$highlightPending=!0,setTimeout(function(){t.$highlightPending=!1;var e=t.session;if(e&&e.bgTokenizer){e.$bracketHighlight&&(e.$bracketHighlight.markerIds.forEach(function(t){e.removeMarker(t)}),e.$bracketHighlight=null);var n=e.getMatchingBracketRanges(t.getCursorPosition());if(!n&&e.$mode.getMatching&&(n=e.$mode.getMatching(t.session)),n){var i="ace_bracket";Array.isArray(n)?1==n.length&&(i="ace_error_bracket"):n=[n],2==n.length&&(0==p.comparePoints(n[0].end,n[1].start)?n=[p.fromPoints(n[0].start,n[1].end)]:0==p.comparePoints(n[0].start,n[1].end)&&(n=[p.fromPoints(n[1].start,n[0].end)])),e.$bracketHighlight={ranges:n,markerIds:n.map(function(t){return e.addMarker(t,i,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var t=this;this.$highlightTagPending=!0,setTimeout(function(){t.$highlightTagPending=!1;var e=t.session;if(e&&e.bgTokenizer){var n=t.getCursorPosition(),i=new y(t.session,n.row,n.column),r=i.getCurrentToken();if(!r||!/\b(?:tag-open|tag-name)/.test(r.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1===r.type.indexOf("tag-open")||(r=i.stepForward())){var s=r.value,o=r.value,a=0,l=i.stepBackward();if("<"===l.value)do{l=r,(r=i.stepForward())&&(-1!==r.type.indexOf("tag-name")?s===(o=r.value)&&("<"===l.value?a++:""===r.value&&a--)}while(r&&a>=0);else{do{if(r=l,l=i.stepBackward(),r)if(-1!==r.type.indexOf("tag-name"))s===r.value&&("<"===l.value?a++:""===r.value){for(var c=0,h=l;h;){if(-1!==h.type.indexOf("tag-name")&&h.value===s){a--;break}if("<"===h.value)break;h=i.stepBackward(),c++}for(var u=0;u1||(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(t){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(n,"ace_selection",i)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var t=this.session,e=this.getSelectionRange();if(!e.isEmpty()&&!e.isMultiLine()){var n=e.start.column,i=e.end.column,r=t.getLine(e.start.row),s=r.substring(n,i);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=r.substring(n-1,i+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(t){this.renderer.updateText(),this._emit("changeMode",t)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var t=this.getSelectedText(),e=this.session.doc.getNewLineCharacter(),n=!1;if(!t&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;ra.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,h=n.getState(r.row),u=(a=n.getLine(r.row),i.checkOutdent(h,a,t));if(n.insert(r,t),s&&s.selection&&this.selection.setSelectionRange(2==s.selection.length?new p(r.row,c+s.selection[0],r.row,c+s.selection[1]):new p(r.row+s.selection[0],s.selection[1],r.row+s.selection[2],s.selection[3])),this.$enableAutoIndent){if(n.getDocument().isNewLine(t)){var d=i.getNextLineIndent(h,a.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},d)}u&&i.autoOutdent(h,n,r.row)}},this.autoIndent=function(){var t,e,n=this.session,i=n.getMode();if(this.selection.isEmpty())t=0,e=n.doc.getLength()-1;else{var r=this.getSelectionRange();t=r.start.row,e=r.end.row}for(var s,o,a,l="",c="",h="",u=n.getTabString(),d=t;d<=e;d++)d>0&&(l=n.getState(d-1),c=n.getLine(d-1),h=i.getNextLineIndent(l,c,u)),s=n.getLine(d),h!==(o=i.$getIndent(s))&&(o.length>0&&(a=new p(d,0,d,o.length),n.remove(a)),h.length>0&&n.insert({row:d,column:0},h)),i.autoOutdent(l,n,d)},this.onTextInput=function(t,e){if(!e)return this.keyBinding.onTextInput(t);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,t,e);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(t,e){var n;(e.extendLeft||e.extendRight)&&((n=this.selection.getRange()).start.column-=e.extendLeft,n.end.column+=e.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),t||n.isEmpty()||this.remove()),!t&&this.selection.isEmpty()||this.insert(t,!0),(e.restoreStart||e.restoreEnd)&&((n=this.selection.getRange()).start.column-=e.restoreStart,n.end.column-=e.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(t,e,n){return this.keyBinding.onCommandKey(t,e,n)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption("scrollSpeed",t)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(t){this.setOption("dragDelay",t)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(t){this.setOption("selectionStyle",t)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(t){this.setOption("highlightActiveLine",t)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(t){this.setOption("highlightSelectedWord",t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption("readOnly",t)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(t){this.setOption("behavioursEnabled",t)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(t){this.setOption("wrapBehavioursEnabled",t)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(t){this.setOption("showFoldWidgets",t)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(t){this.selection.isEmpty()&&("left"==t?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(e.start.row),r=n.getMode().transformAction(i,"deletion",this,n,e);if(0===e.end.column){var s=n.getTextRange(e);if("\n"==s[s.length-1]){var o=n.getLine(e.end.row);/^\s+$/.test(o)&&(e.end.column=o.length)}}r&&(e=r)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var t=this.getCursorPosition(),e=t.column;if(0!==e){var n,i,r=this.session.getLine(t.row);ee.toLowerCase()?1:0});var r=new p(0,0,0,0);for(i=t.first;i<=t.last;i++){var s=e.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,e.replace(r,n[i-t.first])}},this.toggleCommentLines=function(){var t=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(t,this.session,e.first,e.last)},this.toggleBlockComment=function(){var t=this.getCursorPosition(),e=this.session.getState(t.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,n,t)},this.getNumberAt=function(t,e){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(t);n.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(t){var e=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new p(e,n-1,e,n),r=this.session.getTextRange(i);if(!isNaN(parseFloat(r))&&isFinite(r)){var s=this.getNumberAt(e,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),l+=t*=o!==s.end&&n=a&&o<=l&&(n=e,c.selection.clearSelection(),c.moveCursorTo(t,a+i),c.selection.selectTo(t,l+i)),a=l});for(var h,u=this.$toggleWordPairs,d=0;dp+1)break;p=f.last}for(h--,a=this.session.$moveLines(d,p,e?0:t),e&&-1==t&&(u=h+1);u<=h;)o[u].moveBy(a,0),u++;e||(a=0),l+=a}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(t){this.renderer.showComposition(t)},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(t,e){var n=this.renderer,i=this.renderer.layerConfig,r=t*Math.floor(i.height/i.lineHeight);!0===e?this.selection.$moveSelection(function(){this.moveCursorBy(r,0)}):!1===e&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,r*i.lineHeight),null!=e&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(t,e,n,i){this.renderer.scrollToLine(t,e,n,i)},this.centerSelection=function(){var t=this.getSelectionRange(),e={row:Math.floor(t.start.row+(t.end.row-t.start.row)/2),column:Math.floor(t.start.column+(t.end.column-t.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(t,e){this.selection.moveCursorTo(t,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(t,e){var n=this.getCursorPosition(),i=new y(this.session,n.row,n.column),r=i.getCurrentToken(),s=r||i.stepForward();if(s){var o,a,l=!1,c={},h=n.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;h=0;--s)this.$tryReplace(n[s],t)&&i++;return this.selection.setSelectionRange(r),i},this.$tryReplace=function(t,e){var n=this.session.getTextRange(t);return null!==(e=this.$search.replace(n,e))?(t.end=this.session.replace(t,e),t):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(t,e,n){e||(e={}),"string"==typeof t||t instanceof RegExp?e.needle=t:"object"==typeof t&&i.mixin(e,t);var r=this.selection.getRange();null==e.needle&&((t=this.session.getTextRange(r)||this.$search.$options.needle)||(r=this.session.getWordRange(r.start.row,r.start.column),t=this.session.getTextRange(r)),this.$search.set({needle:t})),this.$search.set(e),e.start||this.$search.set({start:r});var s=this.$search.find(this.session);return e.preventScroll?s:s?(this.revealRange(s,n),s):(e.backwards?r.start=r.end:r.end=r.start,void this.selection.setRange(r))},this.findNext=function(t,e){this.find({skipCurrent:!0,backwards:!1},t,e)},this.findPrevious=function(t,e){this.find(t,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(t,e){this.session.unfold(t),this.selection.setSelectionRange(t);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(t.start,t.end,.5),!1!==e&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(t){t.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(t){if(t){var e,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var r=this.$scrollAnchor;r.style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild);var s=this.on("changeSelection",function(){i=!0}),o=this.renderer.on("beforeRender",function(){i&&(e=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(i&&e&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var t=n.renderer,s=t.$cursorLayer.$pixelPos,o=t.layerConfig,a=s.top-o.offset;null!=(i=s.top>=0&&a+e.top<0||!(s.topwindow.innerHeight)&&null)&&(r.style.top=a+"px",r.style.left=s.left+"px",r.style.height=o.lineHeight+"px",r.scrollIntoView(i)),i=e=null}});this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var t=this.$cursorStyle||"ace",e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(t)),e.isBlinking=!this.$readOnly&&"wide"!=t,r.setCssClass(e.element,"ace_slim-cursors",/slim/.test(t)))},this.prompt=function(t,e,n){var i=this;v.loadModule("./ext/prompt",function(r){r.prompt(i,t,e,n)})}}).call(w.prototype),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:t})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(t){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(t){this.textInput.setReadOnly(t),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(t){this.textInput.setCopyWithEmptySelection(t)},initialValue:!1},cursorStyle:{set:function(t){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(t){this.session.setValue(t)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(t){this.setSession(t)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(t){this.renderer.$gutterLayer.setShowLineNumbers(t),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),t&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(t){this.$showLineNumbers&&t?x.attach(this):x.detach(this)}},placeholder:{set:function(t){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var t=this.session&&(this.renderer.$composition||this.getValue());if(t&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(t||this.renderer.placeholderNode)!t&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var e=r.createElement("div");e.className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode)}}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var x={getText:function(t,e){return(Math.abs(t.selection.lead.row-e)||e+1+(e<9?"\xb7":""))+""},getWidth:function(t,e,n){return Math.max(e.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(t,e){e.renderer.$loop.schedule(e.renderer.CHANGE_GUTTER)},attach:function(t){t.renderer.$gutterLayer.$renderer=this,t.on("changeSelection",this.update),this.update(null,t)},detach:function(t){t.renderer.$gutterLayer.$renderer==this&&(t.renderer.$gutterLayer.$renderer=null),t.off("changeSelection",this.update),this.update(null,t)}};e.Editor=w}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(t){this.$session=t},this.add=function(t,e,n){this.$fromUndo||t!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==e&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),t.id=this.$rev=++this.$maxRev),"remove"!=t.action&&"insert"!=t.action||(this.$lastDelta=t),this.lastDeltas.push(t))},this.addSelection=function(t,e){this.selections.push({value:t,rev:e||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(t,e){null==e&&(e=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=t)break;r.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(t){null==t&&(t=this.$rev),this.mark=t},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(t){return t?a(t):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var r=t("./range").Range,s=r.comparePoints;function o(t){return{row:t.row,column:t.column}}function a(t){if(t=t||this,Array.isArray(t))return t.map(a).join("\n");var e="";return t.action?(e="insert"==t.action?"+":"-",e+="["+t.lines+"]"):t.value&&(e=Array.isArray(t.value)?t.value.map(l).join("\n"):l(t.value)),t.start&&(e+=l(t)),(t.id||t.rev)&&(e+="\t("+(t.id||t.rev)+")"),e}function l(t){return t.start.row+":"+t.start.column+"=>"+t.end.row+":"+t.end.column}function c(t,e){var n="insert"==t.action,i="insert"==e.action;if(n&&i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}else if(!n&&i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(!n&&!i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}return[e,t]}function h(t,e){for(var n=t.length;n--;)for(var i=0;i=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,r.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&i)s(e.start,t.end)>=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,r.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{var o,a;if(!(s(e.end,t.start)<=0))return s(t.start,e.start)<0&&(o=t,t=f(t,e.start)),s(t.end,e.end)>0&&(a=f(t,e.end)),p(e.end,t.start,t.end,-1),a&&!o&&(t.lines=a.lines,t.start=a.start,t.end=a.end,a=t),[e,o,a].filter(Boolean);d(t,e,-1)}return[e,t]}function d(t,e,n){p(t.start,e.start,e.end,n),p(t.end,e.start,e.end,n)}function p(t,e,n,i){t.row==(1==i?e:n).row&&(t.column+=i*(n.column-e.column)),t.row+=i*(n.row-e.row)}function f(t,e){var n=t.lines,i=t.end;t.end=o(e);var r=t.end.row-t.start.row,s=n.splice(r,n.length),a=r?e.column:e.column-t.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(e),end:i,lines:s,action:t.action}}function g(t,e){e=function(t){return{start:o(t.start),end:o(t.end),action:t.action,lines:t.lines.slice()}}(e);for(var n=t.length;n--;){for(var i=t[n],r=0;rs&&(s=(r=e.getNextFoldLine(l=r.end.row+1,r))?r.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,t,this.session,c),this.$lines.push(o)),this.$renderCell(o,t,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(t)},this.$updateGutterWidth=function(t){var e=this.session,n=e.gutterRenderer||this.$renderer,i=e.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||e.$useWrapMode)&&(r=e.getLength()+i-1);var s=n?n.getWidth(e,r,t):r.toString().length*t.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!this.$cursorCell||this.$cursorCell.row!=t){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var e=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&r&&r.start.row==e[n-1].row))break;i=e[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(t){var e=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(e,t))return this.update(t);this.$lines.moveContainer(t);var n=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!e||i0;r--)this.$lines.shift();if(i>n)for(r=this.session.getFoldedRowCount(n+1,i);r>0;r--)this.$lines.pop();t.firstRowi&&this.$lines.push(this.$renderLines(t,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t)},this.$renderLines=function(t,e,n){for(var i=[],r=e,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;r>o&&(o=(s=this.session.getNextFoldLine(r=s.end.row+1,s))?s.start.row:1/0),!(r>n);){var a=this.$lines.createCell(r,t,this.session,c);this.$renderCell(a,t,s,r),i.push(a),r++}return i},this.$renderCell=function(t,e,n,r){var s=t.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],c=o.$firstLineNumber,h=o.$breakpoints,u=o.$decorations,d=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,f=n?n.start.row:Number.MAX_VALUE,g="ace_gutter-cell ";if(this.$highlightGutterLine&&(r==this.$cursorRow||n&&r=f&&this.$cursorRow<=n.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),h[r]&&(g+=h[r]),u[r]&&(g+=u[r]),this.$annotations[r]&&(g+=this.$annotations[r].className),s.className!=g&&(s.className=g),p){var m=p[r];null==m&&(m=p[r]=o.getFoldWidget(r))}m?(g="ace_fold-widget ace_"+m,l.className!=(g+="start"==m&&r==f&&rn.right-e.right?"foldWidgets":void 0}}).call(l.prototype),e.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../range").Range,r=t("../lib/dom"),s=function(t){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",t.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.elt=function(t,e){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=e,n.className=t},this.update=function(t){if(t){var e;for(var n in this.config=t,this.i=0,this.markers){var i=this.markers[n];if(i.range){var r=i.range.clipRows(t.firstRow,t.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),i.renderer){var s=this.$getTop(r.start.row,t);i.renderer(e,r,this.$padding+r.start.column*t.characterWidth,s,t)}else"fullLine"==i.type?this.drawFullLineMarker(e,r,i.clazz,t):"screenLine"==i.type?this.drawScreenLineMarker(e,r,i.clazz,t):r.isMultiLine()?"text"==i.type?this.drawTextMarker(e,r,i.clazz,t):this.drawMultiLineMarker(e,r,i.clazz,t):this.drawSingleLineMarker(e,r,i.clazz+" ace_start ace_br15",t)}else i.update(e,this,this.session,t)}if(-1!=this.i)for(;this.id?4:0)|(c==l?8:0)),r,c==l?0:1,s)},this.drawMultiLineMarker=function(t,e,n,i,r){var s,o=this.$padding,a=i.lineHeight,l=this.$getTop(e.start.row,i),c=o+e.start.column*i.characterWidth;if(r=r||"",this.session.$bidiHandler.isBidiRow(e.start.row)?((s=e.clone()).end.row=s.start.row,s.end.column=this.session.getLine(s.start.row).length,this.drawBidiSingleLineMarker(t,s,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(e.end.row)?((s=e.clone()).start.row=s.end.row,s.start.column=0,this.drawBidiSingleLineMarker(t,s,n+" ace_br12",i,null,r)):(l=this.$getTop(e.end.row,i),this.elt(n+" ace_br12","height:"+a+"px;width:"+e.end.column*i.characterWidth+"px;top:"+l+"px;left:"+o+"px;"+(r||""))),!((a=(e.end.row-e.start.row-1)*i.lineHeight)<=0)){l=this.$getTop(e.start.row+1,i);var h=(e.start.column?1:0)|(e.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+o+"px;"+(r||""))}},this.drawSingleLineMarker=function(t,e,n,i,r,s){if(this.session.$bidiHandler.isBidiRow(e.start.row))return this.drawBidiSingleLineMarker(t,e,n,i,r,s);var o=i.lineHeight,a=(e.end.column+(r||0)-e.start.column)*i.characterWidth,l=this.$getTop(e.start.row,i);this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+(this.$padding+e.start.column*i.characterWidth)+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(t,e,n,i,r,s){var o=i.lineHeight,a=this.$getTop(e.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(e.start.column,e.end.column).forEach(function(t){this.elt(n,"height:"+o+"px;width:"+t.width+(r||0)+"px;top:"+a+"px;left:"+(l+t.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i),o=i.lineHeight;e.start.row!=e.end.row&&(o+=this.$getTop(e.end.row,i)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i);this.elt(n,"height:"+i.lineHeight+"px;top:"+s+"px;left:0;right:0;"+(r||""))}}).call(s.prototype),e.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("./lines").Lines,a=t("../lib/event_emitter").EventEmitter,l=function(t){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){i.implement(this,a),this.EOF_CHAR="\xb6",this.EOL_CHAR_LF="\xac",this.EOL_CHAR_CRLF="\xa4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\xb7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var t=this.session.doc,e="\n"==t.getNewLineCharacter()&&"windows"!=t.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(t){this.$padding=t,this.element.style.margin="0 "+t+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on("changeCharacterSize",(function(t){this._signal("changeCharacterSize",t)}).bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,"string"==typeof t?(this.showSpaces=/tab/i.test(t),this.showTabs=/space/i.test(t),this.showEOL=/eol/i.test(t)):this.showSpaces=this.showTabs=this.showEOL=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var t=this.session.getTabSize();this.tabSize=t;for(var e=this.$tabStrings=[0],n=1;nh&&(h=(l=this.session.getNextFoldLine(a=l.end.row+1,l))?l.start.row:1/0),!(a>r);){var u=s[o++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==h&&l),c&&(u.style.top=this.$lines.computeLineTop(a,t,this.session)+"px");var d=t.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(c=!0,u.style.height=d)}a++}if(c)for(;o0;i--)this.$lines.shift();if(e.lastRow>t.lastRow)for(i=this.session.getFoldedRowCount(t.lastRow+1,e.lastRow);i>0;i--)this.$lines.pop();t.firstRowe.lastRow&&this.$lines.push(this.$renderLinesFragment(t,e.lastRow+1,t.lastRow))},this.$renderLinesFragment=function(t,e,n){for(var i=[],s=e,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(a=(o=this.session.getNextFoldLine(s=o.end.row+1,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,t,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(s,t,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(s,t,this.session)+"px"),this.$renderLine(c,s,s==a&&o),c.className=this.$useLineGroups()?"ace_line_group":"ace_line",i.push(l),s++}return i},this.update=function(t){this.$lines.moveContainer(t),this.config=t;for(var e=t.firstRow,n=t.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(t,e,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(t,e,n,i){for(var r,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),c=0;r=a.exec(i);){var h=r[1],u=r[2],d=r[3],p=r[4],f=r[5];if(o.showSpaces||!u){var g=c!=r.index?i.slice(c,r.index):"";if(c=r.index+r[0].length,g&&l.appendChild(this.dom.createTextNode(g,this.element)),h){var m=o.session.getScreenTabSize(e+r.index);l.appendChild(o.$tabStrings[m].cloneNode(!0)),e+=m-1}else u?o.showSpaces?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=s.stringRepeat(o.SPACE_CHAR,u.length),l.appendChild(y)):l.appendChild(this.com.createTextNode(u,this.element)):d?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(y)):p?(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className=o.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=o.showSpaces?o.SPACE_CHAR:p,l.appendChild(y)):f&&(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className="ace_cjk",y.textContent=f,l.appendChild(y))}}if(l.appendChild(this.dom.createTextNode(c?i.slice(c):i,this.element)),this.$textToken[n.type])t.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==n.type&&(y.style.width=n.value.length*this.config.characterWidth+"px"),y.className=v,y.appendChild(l),t.appendChild(y)}return e+i.length},this.renderIndentGuide=function(t,e,n){var i=e.search(this.$indentGuideRe);if(i<=0||i>=n)return e;if(" "==e[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,h,u.substring(0,o-i)),u=u.substring(o-i),i=o,l=this.$createLineElement(),t.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat("\xa0",n.indent),this.element)),a=0,o=n[++r]||Number.MAX_VALUE;0!=u.length&&(i+=u.length,a=this.$renderToken(l,a,h,u))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(t,e){var n=0,i=e[0],r=i.value;this.displayIndentGuides&&(r=this.renderIndentGuide(t,r)),r&&(n=this.$renderToken(t,n,i,r));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(t,n,i,r);n=this.$renderToken(t,n,i,r)}},this.$renderOverflowMessage=function(t,e,n,i,r){n&&this.$renderToken(t,e,n,i.slice(0,this.MAX_LINE_LENGTH-e));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=r?"":"",t.appendChild(s)},this.$renderLine=function(t,e,n){if(n||0==n||(n=this.session.getFoldLine(e)),n)var i=this.$getFoldLineTokens(e,n);else i=this.session.getTokens(e);var r=t;if(i.length){var s=this.session.getRowSplitData(e);s&&s.length?(this.$renderWrappedLine(t,i,s),r=t.lastChild):(r=t,this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r)),this.$renderSimpleLine(r,i))}else this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r));if(this.showEOL&&r){n&&(e=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o)}},this.$getFoldLineTokens=function(t,e){var n=this.session,i=[],r=n.getTokens(t);return e.walk(function(t,e,s,o,a){null!=t?i.push({type:"fold",value:t}):(a&&(r=n.getTokens(e)),r.length&&function(t,e,n){for(var r=0,s=0;s+t[r].value.lengthn-e&&(o=o.substring(0,n-e)),i.push({type:t[r].type,value:o}),s=e+o.length,r+=1);sn?{type:t[r].type,value:o.substring(0,n-s)}:t[r]),s+=o.length,r+=1}}(r,o,s))},e.end.row,this.session.getLine(e.end.row).length),i},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),e.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=function(t){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",t.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(t){for(var e=this.cursors,n=e.length;n--;)i.setStyle(e[n].style,"opacity",t?"":"0")},this.$startCssAnimation=function(){for(var t=this.cursors,e=t.length;e--;)t[e].style.animationDuration=this.blinkInterval+"ms";setTimeout((function(){i.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},this.$stopCssAnimation=function(){i.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t!=this.smoothBlinking&&(this.smoothBlinking=t,i.setCssClass(this.element,"ace_smooth-blinking",t),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var t=i.createElement("div");return t.className="ace_cursor",this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(this.cursors.length>1){var t=this.cursors.pop();return t.parentNode.removeChild(t),t}},this.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var t=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&i.removeCssClass(this.element,"ace_smooth-blinking"),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout((function(){i.addCssClass(this.element,"ace_smooth-blinking")}).bind(this)),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var e=(function(){this.timeoutId=setTimeout(function(){t(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){t(!0),e()},this.blinkInterval),e()}else this.$stopCssAnimation()},this.getPixelPosition=function(t,e){if(!this.config||!this.session)return{left:0,top:0};t||(t=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(t);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,t.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(e?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(t,e){return t.top>=0&&t.topt.height+t.offset||o.top<0)&&n>1)){var a=this.cursors[r++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,t,e[n],this.session):this.isCursorInView(o,t)?(i.setStyle(l,"display","block"),i.translate(a,o.left,o.top),i.setStyle(l,"width",Math.round(t.characterWidth)+"px"),i.setStyle(l,"height",t.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),e.Cursor=r}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./lib/event"),o=t("./lib/event_emitter").EventEmitter,a=32768,l=function(t){this.element=r.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=r.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xa0",this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){i.implement(this,o),this.setVisible=function(t){this.element.style.display=t?"":"none",this.isVisible=t,this.coeff=1}}).call(l.prototype);var c=function(t,e){l.call(this,t),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=r.scrollbarWidth(t.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(c,l),(function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+"px"},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,t>a?(this.coeff=a/t,t=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=t+"px"},this.setScrollTop=function(t){this.scrollTop!=t&&(this.skipEvent=!0,this.scrollTop=t,this.element.scrollTop=t*this.coeff)}}).call(c.prototype);var h=function(t,e){l.call(this,t),this.scrollLeft=0,this.height=e.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(h,l),(function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(t){this.element.style.width=t+"px"},this.setInnerWidth=function(t){this.inner.style.width=t+"px"},this.setScrollWidth=function(t){this.inner.style.width=t+"px"},this.setScrollLeft=function(t){this.scrollLeft!=t&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=t)}}).call(h.prototype),e.ScrollBar=c,e.ScrollBarV=c,e.ScrollBarH=h,e.VScrollBar=c,e.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,e,n){"use strict";var i=t("./lib/event"),r=function(t,e){this.onRender=t,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=e||window;var n=this;this._flush=function(t){n.pending=!1;var e=n.changes;if(e&&(i.blockIdle(100),n.changes=0,n.onRender(e)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(t){this.changes=this.changes|t,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(t){var e=this.changes;return this.changes=0,e}}).call(r.prototype),e.RenderLoop=r}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,e,n){var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("../lib/event"),a=t("../lib/useragent"),l=t("../lib/event_emitter").EventEmitter,c=256,h="function"==typeof ResizeObserver,u=200,d=e.FontMetrics=function(t){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),t.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",c),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(t,e){t.width=t.height="auto",t.left=t.top="0px",t.visibility="hidden",t.position="absolute",t.whiteSpace="pre",a.isIE<8?t["font-family"]="inherit":t.font="inherit",t.overflow=e?"hidden":"visible"},this.checkForSizeChanges=function(t){if(void 0===t&&(t=this.$measureSizes()),t&&(this.$characterSize.width!==t.width||this.$characterSize.height!==t.height)){this.$measureNode.style.fontWeight="bold";var e=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=t,this.charSizes=Object.create(null),this.allowBoldFonts=e&&e.width===t.width&&e.height===t.height,this._emit("changeCharacterSize",{data:t})}},this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver(function(e){t.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(t){var e={height:(t||this.$measureNode).clientHeight,width:(t||this.$measureNode).clientWidth/c};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.textContent=s.stringRepeat(t,c),this.$main.getBoundingClientRect().width/c},this.getCharacterWidth=function(t){var e=this.charSizes[t];return void 0===e&&(e=this.charSizes[t]=this.$measureCharWidth(t)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function t(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*t(e.parentElement):1},this.$initTransformMeasureNodes=function(){var t=function(t,e){return["div",{style:"position: absolute;top:"+t+"px;left:"+e+"px;"}]};this.els=r.buildDom([t(0,0),t(u,0),t(0,u),t(u,u)],this.el)},this.transformCoordinates=function(t,e){function n(t,e,n){var i=t[1]*e[0]-t[0]*e[1];return[(-e[1]*n[0]+e[0]*n[1])/i,(+t[1]*n[0]-t[0]*n[1])/i]}function i(t,e){return[t[0]-e[0],t[1]-e[1]]}function r(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t*e[0],t*e[1]]}function o(t){var e=t.getBoundingClientRect();return[e.left,e.top]}t&&(t=s(1/this.$getZoom(this.el),t)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),c=o(this.els[2]),h=o(this.els[3]),d=n(i(h,l),i(h,c),i(r(l,c),r(h,a))),p=s(1+d[0],i(l,a)),f=s(1+d[1],i(c,a));if(e){var g=e,m=d[0]*g[0]/u+d[1]*g[1]/u+1,v=r(s(g[0],p),s(g[1],f));return r(s(1/m/u,v),a)}var y=i(t,a),b=n(i(p,s(d[0],y)),i(f,s(d[1],y)),y);return s(u,b)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./config"),o=t("./layer/gutter").Gutter,a=t("./layer/marker").Marker,l=t("./layer/text").Text,c=t("./layer/cursor").Cursor,h=t("./scrollbar").HScrollBar,u=t("./scrollbar").VScrollBar,d=t("./renderloop").RenderLoop,p=t("./layer/font_metrics").FontMetrics,f=t("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=t("./lib/useragent"),v=m.isIE;r.importCssString(g,"ace_editor.css");var y=function(t,e){var n=this;this.container=t||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(e),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var i=this.$textLayer=new l(this.content);this.canvas=i.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollTop(t.data-n.scrollMargin.top)}),this.scrollBarH.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollLeft(t.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(t){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",t)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&t.getScrollTop()<=0&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(t,e,n){if(void 0===e&&(e=1/0),this.$changedLines?(this.$changedLines.firstRow>t&&(this.$changedLines.firstRow=t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(t,e,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=t?1:0;var r=this.container;i||(i=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var s=this.$updateCachedSize(t,e,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;t&&(this.$gutterLayer.$padding=null),t?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(t,e,n,i){var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if((i-=this.$extraHeight||0)&&(t||o.height!=i)&&(o.height=i,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(t||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==e&&(e=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=e,r.setStyle(this.scrollBarH.element.style,"left",e+"px"),r.setStyle(this.scroller.style,"left",e+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-e-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l),r.setStyle(this.scroller.style,"right",l),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||t)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!i,s&&this._signal("resize",a),s},this.onGutterResize=function(t){var e=this.$showGutter?t:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var t=Math.floor((this.$size.scrollerWidth-2*this.$padding)/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(t){this.setOption("animatedScroll",t)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(t){this.setOption("showInvisibles",t),this.session.$bidiHandler.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(t){this.setOption("displayIndentGuides",t)},this.setShowPrintMargin=function(t){this.setOption("showPrintMargin",t)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(t){this.setOption("printMarginColumn",t)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(t){return this.setOption("showGutter",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var t=r.createElement("div");t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",t.appendChild(this.$printMarginEl),this.content.insertBefore(t,this.content.firstChild)}var e=this.$printMarginEl.style;e.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var t=this.textarea.style,e=this.$composition;if(this.$keepTextAreaAtCursor||e){var n=this.$cursorLayer.$pixelPos;if(n){e&&e.markerRange&&(n=this.$cursorLayer.getPixelPosition(e.markerRange.start,!0));var i=this.layerConfig,s=n.top,o=n.left,a=e&&e.useTextareaForIME?this.lineHeight:v?0:1;if((s-=i.offset)<0||s>i.height-a)r.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;e?e.useTextareaForIME?l=this.characterWidth*this.session.$getStringScreenWidth(this.textarea.value)[0]:s+=this.lineHeight+2:s+=this.lineHeight,(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,r.setStyle(t,"height",a+"px"),r.setStyle(t,"width",l+"px"),r.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,c))}}}else r.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var t=this.layerConfig,e=t.lastRow;return this.session.documentToScreenRow(e,0)*t.lineHeight-this.session.getScrollTop()>t.height-t.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(t,e,n,i){var r=this.scrollMargin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(t,e,n,i){var r=this.margin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption("hScrollBarAlwaysVisible",t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption("vScrollBarAlwaysVisible",t)},this.$updateScrollBarV=function(){var t=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&this.scrollTop>(t-=(e-this.lineHeight)*this.$scrollPastEnd)-e&&(t=this.scrollTop+e,this.scrollBarV.scrollTop=null),this.scrollBarV.setScrollHeight(t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(t,e){if(this.$changes&&(t|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(t||e)){if(this.$size.$dirty)return this.$changes|=t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(t&this.CHANGE_FULL||t&this.CHANGE_SIZE||t&this.CHANGE_TEXT||t&this.CHANGE_LINES||t&this.CHANGE_SCROLL||t&this.CHANGE_H_SCROLL){if(t|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;i>0&&(this.scrollTop=i,t|=this.CHANGE_SCROLL,t|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-n.offset);var s=n.minHeight+"px";r.setStyle(this.content.style,"width",n.width+2*this.$padding+"px"),r.setStyle(this.content.style,"height",s)}if(t&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),t&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);if(t&this.CHANGE_SCROLL)return this.$changedLines=null,t&this.CHANGE_TEXT||t&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(t&this.CHANGE_GUTTER||t&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):t&this.CHANGE_LINES?(this.$updateLines()||t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):t&this.CHANGE_TEXT||t&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):t&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",t)}else this.$changes|=t},this.$autosize=function(){var t=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,n=Math.min(e,Math.max((this.$minLines||1)*this.lineHeight,t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&t>e;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var t=this.session,e=this.$size,n=e.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||e.scrollerWidth-r-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=e.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(e.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var h=this.scrollMargin;this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,i-e.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,r+2*this.$padding-e.scrollerWidth+h.right)));var u=!n&&(this.$vScrollBarAlwaysVisible||e.scrollerHeight-i+c<0||this.scrollTop>h.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var p,f,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),y=v+m,b=this.lineHeight;v=t.screenToDocumentRow(v,0);var w=t.getFoldLine(v);w&&(v=w.start.row),p=t.documentToScreenRow(v,0),f=t.getRowLength(v)*b,y=Math.min(t.screenToDocumentRow(y,0),t.getLength()-1),l=e.scrollerHeight+t.getRowLength(y)*b+f,g=this.scrollTop-p*b;var x=0;return(this.layerConfig.width!=r||o)&&(x=this.CHANGE_H_SCROLL),(o||d)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal("scrollbarVisibilityChanged"),d&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:v,firstRowScreen:p,lastRow:y,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:g,gutterOffset:b?Math.max(0,Math.ceil((g+e.height-e.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),x},this.$updateLines=function(){if(this.$changedLines){var t=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(t>n.lastRow+1||ethis.$textLayer.MAX_LINE_LENGTH&&(t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(t*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(t,e){this.$gutterLayer.addGutterDecoration(t,e)},this.removeGutterDecoration=function(t,e){this.$gutterLayer.removeGutterDecoration(t,e)},this.updateBreakpoints=function(t){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(t){this.$gutterLayer.setAnnotations(t),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(t,e,n){this.scrollCursorIntoView(t,n),this.scrollCursorIntoView(e,n)},this.scrollCursorIntoView=function(t,e,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(t),r=i.left,s=i.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(e&&l+o>s+this.lineHeight&&(s-=e*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ar?(r=1-this.scrollMargin.top||e>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=Math.floor((e+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:r}},this.screenToTextCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((e+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),r)},this.textToScreenCoordinates=function(t,e){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(t,e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,t)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth));return{pageX:n.left+r-this.scrollLeft,pageY:n.top+i.row*this.lineHeight-this.scrollTop}},this.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},this.showComposition=function(t){this.$composition=t,t.cssText||(t.cssText=this.textarea.style.cssText),null==t.useTextareaForIME&&(t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):t.markerId=this.session.addMarker(t.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(t){var e=this.session.selection.cursor;this.addToken(t,"composition_placeholder",e.row,e.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var t=this.session.selection.cursor;this.removeExtraToken(t.row,t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(t,e,n,i){var r=this.session;r.bgTokenizer.lines[n]=null;var s={type:e,value:t},o=r.getTokens(n);if(null==i)o.push(s);else for(var a=0,l=0;l50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(l.prototype),e.UIWorkerClient=function(t,e,n){var i=null,r=!1,a=Object.create(s),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(t){c.push(t),i&&(r?setTimeout(u):u())}});h.setEmitSync=function(t){r=t};var u=function(){var t=c.shift();t.command?i[t.command].apply(i,t.args):t.event&&a._signal(t.event,t.data)};return a.postMessage=function(t){h.onMessage({data:t})},a.callback=function(t,e){this.postMessage({type:"call",id:e,data:t})},a.emit=function(t,e){this.postMessage({type:"event",name:t,data:e})},o.loadModule(["worker",e],function(t){for(i=new t[n](a);c.length;)u()}),h},e.WorkerClient=l,e.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./range").Range,r=t("./lib/event_emitter").EventEmitter,s=t("./lib/oop"),o=function(t,e,n,i,r,s){var o=this;this.length=e,this.session=t,this.doc=t.getDocument(),this.mainClass=r,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=t.getUndoManager().$undoStack||t.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),t.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,r),this.setup=function(){var t=this,e=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new i(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var i=e.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),t.others.push(i)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,e=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),e.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,s=e.start.column-this.pos.column;if(this.updateAnchors(t),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===t.action)for(var o=this.others.length-1;o>=0;o--)this.doc.insertMergedLines(l={row:(a=this.others[o]).row,column:a.column+s},t.lines);else if("remove"===t.action)for(o=this.others.length-1;o>=0;o--){var a,l;this.doc.remove(new i((l={row:(a=this.others[o]).row,column:a.column+s}).row,l.column,l.row,l.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(t){this.pos.onChange(t);for(var e=this.others.length;e--;)this.others[e].onChange(t);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var t=this,e=this.session,n=function(n,r){e.removeMarker(n.markerId),n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},this.onCursorChange=function(t){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",t)):(this.hideOtherMarkers(),this._emit("cursorLeave",t))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var t=this.session.getUndoManager(),e=(t.$undoStack||t.$undostack).length-this.$undoStackDepth,n=0;n1?t.multiSelect.joinSelections():t.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(t){t.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(t){t.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(t){t.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(t){t.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(t){return t&&t.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new i(e.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,e,n){var i=t("./range_list").RangeList,r=t("./range").Range,s=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,a=t("./lib/event"),l=t("./lib/lang"),c=t("./commands/multi_select_commands");e.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(0,t("./search").Search),u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(t,e){if(t){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(t),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),e||this.fromOrientedRange(t);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}t.cursor||(t.cursor=t.end);var i=this.rangeList.add(t);return this.$onAddRange(t),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),e||this.fromOrientedRange(t)}},this.toSingleRange=function(t){t=t||this.ranges[0];var e=this.rangeList.removeAll();e.length&&this.$onRemoveRange(e),t&&this.fromOrientedRange(t)},this.substractPoint=function(t){var e=this.rangeList.substractPoint(t);if(e)return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var t=this.rangeList.merge();t.length&&this.$onRemoveRange(t)},this.$onAddRange=function(t){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(t),this._signal("addRange",{range:t})},this.$onRemoveRange=function(t){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var e=this.rangeList.ranges.pop();t.push(e),this.rangeCount=0}for(var n=t.length;n--;){var i=this.ranges.indexOf(t[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:t}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(e=e||this.ranges[0])&&!e.isEqual(this.getRange())&&this.fromOrientedRange(e)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var t=this.ranges.length?this.ranges:[this.getRange()],e=[],n=0;n1){var t=this.rangeList.ranges,e=t[t.length-1],n=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(n,e.cursor==e.start)}else{var i=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(t,e,n){var i=[],s=t.column0;)y--;if(y>0)for(var b=0;i[b].isEmpty();)b++;for(var w=y;w>=b;w--)i[w].isEmpty()&&i.splice(w,1)}return i}}).call(s.prototype);var d=t("./editor").Editor;function p(t){t.$multiselectOnSessionChange||(t.$onAddRange=t.$onAddRange.bind(t),t.$onRemoveRange=t.$onRemoveRange.bind(t),t.$onMultiSelect=t.$onMultiSelect.bind(t),t.$onSingleSelect=t.$onSingleSelect.bind(t),t.$multiselectOnSessionChange=e.onSessionChange.bind(t),t.$checkMultiselectChange=t.$checkMultiselectChange.bind(t),t.$multiselectOnSessionChange(t),t.on("changeSession",t.$multiselectOnSessionChange),t.on("mousedown",o),t.commands.addCommands(c.defaultCommands),function(t){if(t.textInput){var e=t.textInput.getElement(),n=!1;a.addListener(e,"keydown",function(e){t.$blockSelectEnabled&&18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey)?n||(t.renderer.setMouseCursor("crosshair"),n=!0):n&&i()},t),a.addListener(e,"keyup",i,t),a.addListener(e,"blur",i,t)}function i(e){n&&(t.renderer.setMouseCursor(""),n=!1)}}(t))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(t){t.cursor||(t.cursor=t.end);var e=this.getSelectionStyle();return t.marker=this.session.addMarker(t,"ace_selection",e),this.session.$selectionMarkers.push(t),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,t},this.removeSelectionMarker=function(t){if(t.marker){this.session.removeMarker(t.marker);var e=this.session.$selectionMarkers.indexOf(t);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(t){for(var e=this.session.$selectionMarkers,n=t.length;n--;){var i=t[n];if(i.marker){this.session.removeMarker(i.marker);var r=e.indexOf(i);-1!=r&&e.splice(r,1)}}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(t){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(t){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(t){var e=t.command,n=t.editor;if(n.multiSelect){if(e.multiSelectAction)"forEach"==e.multiSelectAction?i=n.forEachSelection(e,t.args):"forEachLine"==e.multiSelectAction?i=n.forEachSelection(e,t.args,!0):"single"==e.multiSelectAction?(n.exitMultiSelectMode(),i=e.exec(n,t.args||{})):i=e.multiSelectAction(n,t.args||{});else{var i=e.exec(n,t.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(t,e,n){if(!this.inVirtualSelectionMode){var i,r=1==n||n&&n.$byLines,o=this.session,a=this.selection,l=(n&&n.keepOrder?a:a.rangeList).ranges;if(!l.length)return t.exec?t.exec(this,e||{}):t(this,e||{});var c=a._eventRegistry;a._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var u=l.length;u--;){if(r)for(;u>0&&l[u].start.row==l[u-1].end.row;)u--;h.fromOrientedRange(l[u]),h.index=u,this.selection=o.selection=h;var d=t.exec?t.exec(this,e||{}):t(this,e||{});i||void 0===d||(i=d),h.toOrientedRange(l[u])}h.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=c,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var p=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),p&&p.from==p.to&&this.renderer.animateScrolling(p.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var t="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var e=this.multiSelect.rangeList.ranges,n=[],i=0;io&&(o=n.column),ih?t.insert(i,l.stringRepeat(" ",s-h)):t.remove(new r(i.row,i.column,i.row,i.column-s+h)),e.start.column=e.end.column=o,e.start.row=e.end.row=i.row,e.cursor=e.end}),e.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),u=h.start.row,d=h.end.row,p=u==d;if(p){var f,g=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d0);u<0&&(u=0),d>=g&&(d=g-1)}var m=this.session.removeFullLines(u,d);m=this.$reAlignText(m,p),this.session.insert({row:u,column:0},m.join("\n")+"\n"),p||(h.start.column=0,h.end.column=m[m.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(t,e){var n,i,r,s=!0,o=!0;return t.map(function(t){var e=t.match(/(\s*)(.*?)(\s*)([=:].*)/);return e?null==n?(n=e[1].length,i=e[2].length,r=e[3].length,e):(n+i+r!=e[1].length+e[2].length+e[3].length&&(o=!1),n!=e[1].length&&(s=!1),n>e[1].length&&(n=e[1].length),ie[3].length&&(r=e[3].length),e):[t]}).map(e?c:s?o?function(t){return t[2]?a(n+i-t[2].length)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}:c:function(t){return t[2]?a(n)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]});function a(t){return l.stringRepeat(" ",t)}function c(t){return t[2]?a(n)+t[2]+a(i-t[2].length+r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}}}).call(d.prototype),e.onSessionChange=function(t){var e=t.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var n=t.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),e&&(e.multiSelect.on("addRange",this.$onAddRange),e.multiSelect.on("removeRange",this.$onRemoveRange),e.multiSelect.on("multiSelect",this.$onMultiSelect),e.multiSelect.on("singleSelect",this.$onSingleSelect),e.multiSelect.lead.on("change",this.$checkMultiselectChange),e.multiSelect.anchor.on("change",this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},e.MultiSelect=p,t("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(t){p(this),t?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../../range").Range,r=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(t,e,n){var i=t.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==e&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(t,e,n){return null},this.indentationBlock=function(t,e,n){var r=/\S/,s=t.getLine(e),o=s.search(r);if(-1!=o){for(var a=n||s.length,l=t.getLength(),c=e,h=e;++ec){var p=t.getLine(h).length;return new i(c,a,h,p)}}},this.openingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r+1},a=t.$findClosingBracket(e,o,s);if(a){var l=t.foldWidgets[a.row];return null==l&&(l=t.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=t.getLine(a.row).length),i.fromPoints(o,a)}},this.closingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r},a=t.$findOpeningBracket(e,o);if(a)return a.column++,o.column--,i.fromPoints(a,o)}}).call(r.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";e.isDark=!1,e.cssClass="ace-tm",e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',e.$id="ace/theme/textmate",t("../lib/dom").importCssString(e.cssText,e.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./lib/dom");function r(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(t){var e;return e=this.lineWidgets&&this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0,this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1+e:1+e},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on("beforeRender",this.measureWidgets),t.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(t){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(t,e){var n=e.lineWidgets;if(n&&t.action){for(var i=t.data,r=i.start.row,s=i.end.row,o="add"==t.action,a=r+1;ae[n].column&&n++,s.unshift(n,0),e.splice.apply(e,s),this.$updateRows()}}},this.$updateRows=function(){var t=this.session.lineWidgets;if(t){var e=!0;t.forEach(function(t,n){if(t)for(e=!1,t.row=n;t.$oldWidget;)t.$oldWidget.row=n,t=t.$oldWidget}),e&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(t){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var e=this.session.lineWidgets[t.row];return e&&(t.$oldWidget=e,e.el&&e.el.parentNode&&(e.el.parentNode.removeChild(e.el),e._inDocument=!1)),this.session.lineWidgets[t.row]=t,t},this.addLineWidget=function(t){if(this.$registerLineWidget(t),t.session=this.session,!this.editor)return t;var e=this.editor.renderer;t.html&&!t.el&&(t.el=i.createElement("div"),t.el.innerHTML=t.html),t.el&&(i.addCssClass(t.el,"ace_lineWidgetContainer"),t.el.style.position="absolute",t.el.style.zIndex=5,e.container.appendChild(t.el),t._inDocument=!0,t.coverGutter||(t.el.style.zIndex=3),null==t.pixelHeight&&(t.pixelHeight=t.el.offsetHeight)),null==t.rowCount&&(t.rowCount=t.pixelHeight/e.layerConfig.lineHeight);var n=this.session.getFoldAt(t.row,0);if(t.$fold=n,n){var r=this.session.lineWidgets;t.row!=n.end.row||r[n.start.row]?t.hidden=!0:r[n.start.row]=t}return this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows(),this.renderWidgets(null,e),this.onWidgetChanged(t),t},this.removeLineWidget=function(t){if(t._inDocument=!1,t.session=null,t.el&&t.el.parentNode&&t.el.parentNode.removeChild(t.el),t.editor&&t.editor.destroy)try{t.editor.destroy()}catch(n){}if(this.session.lineWidgets){var e=this.session.lineWidgets[t.row];if(e==t)this.session.lineWidgets[t.row]=t.$oldWidget,t.$oldWidget&&this.onWidgetChanged(t.$oldWidget);else for(;e;){if(e.$oldWidget==t){e.$oldWidget=t.$oldWidget;break}e=e.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(t){for(var e=this.session.lineWidgets,n=e&&e[t],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(t){this.session._changedWidgets.push(t),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(t,e){var n=this.session._changedWidgets,i=e.layerConfig;if(n&&n.length){for(var r=1/0,s=0;s0&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,e.$cursorLayer.config=n;for(var o=r;o<=s;o++){var a=i[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,e.container.appendChild(a.el));var l=e.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:e.gutterWidth;a.fixedWidth||(c-=e.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.el.style.right=a.fixedWidth?e.scrollBar.getWidth()+"px":""}}}}}).call(r.prototype),e.LineWidgets=r}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(t,e,n){"use strict";var i=t("../line_widgets").LineWidgets,r=t("../lib/dom"),s=t("../range").Range;e.showErrorMarker=function(t,e){var n=t.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(t));var o=t.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(t){return"errorMarker"==t.type})[0];l?l.destroy():a-=e;var c,h=function(t,e,n){var i=t.getAnnotations().sort(s.comparePoints);if(i.length){var r=function(t,e,n){for(var i=0,r=t.length-1;i<=r;){var s=i+r>>1,o=n(e,t[s]);if(o>0)i=s+1;else{if(!(o<0))return s;r=s-1}}return-(i+1)}(i,{row:e,column:-1},s.comparePoints);r<0&&(r=-r-1),r>=i.length?r=n>0?0:i.length-1:0===r&&n<0&&(r=i.length-1);var o=i[r];if(o&&n){if(o.row===e){do{o=i[r+=n]}while(o&&o.row===e);if(!o)return i.slice()}var a=[];e=o.row;do{a[n<0?"unshift":"push"](o),o=i[r+=n]}while(o&&o.row==e);return a.length&&a}}}(n,a,e);if(h){var u=h[0];o.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,o.row=u.row,c=t.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(o.row),t.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},p=d.el.appendChild(r.createElement("div")),f=d.el.appendChild(r.createElement("div"));f.className="error_widget_arrow "+c.className;var g=t.renderer.$cursorLayer.getPixelPosition(o).left;f.style.left=g+t.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",p.className="error_widget "+c.className,p.innerHTML=c.text.join("
"),p.appendChild(r.createElement("div"));var m=function(t,e,n){if(0===e&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(d),t.off("changeSelection",d.destroy),t.off("changeSession",d.destroy),t.off("mouseup",d.destroy),t.off("change",d.destroy))},t.keyBinding.addKeyboardHandler(m),t.on("changeSelection",d.destroy),t.on("changeSession",d.destroy),t.on("mouseup",d.destroy),t.on("change",d.destroy),t.session.widgetManager.addLineWidget(d),d.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(t,e,i){"use strict";t("./lib/fixoldbrowsers");var r=t("./lib/dom"),s=t("./lib/event"),o=t("./range").Range,a=t("./editor").Editor,l=t("./edit_session").EditSession,c=t("./undomanager").UndoManager,h=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),e.config=t("./config"),e.require=t,e.define=n("B9Yq"),e.edit=function(t,n){if("string"==typeof t){var i=t;if(!(t=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(t&&t.env&&t.env.editor instanceof a)return t.env.editor;var o="";if(t&&/input|textarea/i.test(t.tagName)){var l=t;o=l.value,t=r.createElement("pre"),l.parentNode.replaceChild(t,l)}else t&&(o=t.textContent,t.innerHTML="");var c=e.createEditSession(o),u=new a(new h(t),c,n),d={document:c,editor:u,onResize:u.resize.bind(u,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),u.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},e.createEditSession=function(t,e){var n=new l(t,e);return n.setUndoManager(new c),n},e.Range=o,e.Editor=a,e.EditSession=l,e.UndoManager=c,e.VirtualRenderer=h,e.version=e.config.version}),ace.require(["ace/ace"],function(e){for(var n in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(n)&&(window.ace[n]=e[n]);window.ace.default=window.ace,t&&(t.exports=window.ace)})}).call(this,n("YuTi")(t))},hyoZ:function(t,e,n){"use strict";var i=n("w+qe"),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=function(t,e){var n,o;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===r.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(o={},null!==(n=e.styleAliases||null)&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){o[String(e)]=t})}),o),-1===s.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},jO2K:function(t,e,n){"use strict";var i;try{i=n("tjlA").Buffer}catch(o){}var r=n("hyoZ"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,o=s;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,r=t.replace(/[\r\n=]/g,""),o=r.length,a=s,l=0,c=[];for(e=0;e>16&255),c.push(l>>8&255),c.push(255&l)),l=l<<6|a.indexOf(r.charAt(e));return 0==(n=o%4*6)?(c.push(l>>16&255),c.push(l>>8&255),c.push(255&l)):18===n?(c.push(l>>10&255),c.push(l>>2&255)):12===n&&c.push(l>>4&255),i?i.from?i.from(c):new i(c):c},predicate:function(t){return i&&i.isBuffer(t)},represent:function(t){var e,n,i="",r=0,o=t.length,a=s;for(e=0;e>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},"kVK+":function(t,e){e.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,h=-7,u=n?r-1:0,d=n?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,h=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},peYA:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},pzZA:function(t,e,n){"use strict";var i=n("hyoZ"),r=Object.prototype.hasOwnProperty;t.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(r.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},spQ0:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},tN50:function(t,e,n){"use strict";var i=n("Y2Yi");function r(t,e,n,i,r){this.name=t,this.buffer=e,this.position=n,this.line=i,this.column=r}r.prototype.getSnippet=function(t,e){var n,r,s,o,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",r=this.position;r>0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(this.position-(r-=1)>e/2-1){n=" ... ",r+=5;break}for(s="",o=this.position;oe/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(r,o),i.repeat(" ",t)+n+a+s+"\n"+i.repeat(" ",t+this.position-r+n.length)+"^"},r.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=r},tjlA:function(t,e,n){"use strict";var i=n("H7XF"),r=n("kVK+"),s=n("49sm");function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function v(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,i,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var h=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var u=!0,d=0;dr&&(i=r):i=r;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function E(t,e,n){return i.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+u<=n)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(i.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),i.push(h),r+=u}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);for(var n="",i=0;i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,i,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,r),h=t.slice(e,n),u=0;ur)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function D(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;rr)&&(n=r);for(var s="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,i,r,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,s=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function $(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,s=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function O(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,i,s){return s||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function N(t,e,n,i,s){return s||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[t+--e]*r;return i},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+r]=t/s&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):$(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):$(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}},vQl5:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},"w+qe":function(t,e,n){"use strict";function i(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}(i.prototype=Object.create(Error.prototype)).constructor=i,i.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=i},ydHo:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ");function s(t){return 48<=t&&t<=55}function o(t){return 48<=t&&t<=57}t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=t.length,r=0,a=!1;if(!i)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===i)return!0;if("b"===(e=t[++r])){for(r++;r=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},zUnb:function(t,e,n){"use strict";function i(t){return"function"==typeof t}n.r(e);let r=!1;const s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}};function o(t){setTimeout(()=>{throw t},0)}const a={closed:!0,next(t){},error(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;o(t)},complete(){}},l=(()=>Array.isArray||(t=>t&&"number"==typeof t.length))();function c(t){return null!==t&&"object"==typeof t}const h=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();let u=(()=>{class t{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:s,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(let t=0;tt.concat(e instanceof h?e.errors:e),[])}const p=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class f extends u{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!t){this.destination=a;break}if("object"==typeof t){t instanceof f?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,t,e,n)}}[p](){return this}static create(t,e,n){const i=new f(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class g extends f{constructor(t,e,n,r){let s;super(),this._parentSubscriber=t;let o=this;i(e)?s=e:e&&(s=e.next,n=e.error,r=e.complete,e!==a&&(o=Object.create(e),i(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=n,this._complete=r}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=s;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):o(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;o(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw n;o(n)}}__tryOrSetError(t,e,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(o(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const m=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function v(t){return t}let y=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof f)return t;if(t[p])return t[p]()}return t||e||n?new f(t,e,n):new f(a)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),s.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){s.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof f?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=b(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[m](){return this}pipe(...t){return 0===t.length?this:(0===(e=t).length?v:1===e.length?e[0]:function(t){return e.reduce((t,e)=>e(t),t)})(this);var e}toPromise(t){return new(t=b(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function b(t){if(t||(t=s.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const w=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class x extends u{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class _ extends f{constructor(t){super(t),this.destination=t}}let C=(()=>{class t extends y{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new _(this)}lift(t){const e=new S(this,this);return e.operator=t,e}next(t){if(this.closed)throw new w;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew S(t,e),t})();class S extends C{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):u.EMPTY}}function E(t){return t&&"function"==typeof t.schedule}function k(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new A(t,e))}}class A{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new D(t,this.project,this.thisArg))}}class D extends f{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const T=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function M(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const I=t=>{if(t&&"function"==typeof t[m])return i=t,t=>{const e=i[m]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(L(t))return T(t);if(M(t))return n=t,t=>(n.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,o),t);if(t&&"function"==typeof t[F])return e=t,t=>{const n=e[F]();for(;;){let e;try{e=n.next()}catch(i){return t.error(i),t}if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t};{const e=c(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var e,n,i};function $(t,e){return new y(n=>{const i=new u;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function O(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[m]}(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>{const r=t[m]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(M(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(L(t))return $(t,e);if(function(t){return t&&"function"==typeof t[F]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new y(n=>{const i=new u;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[F](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof y?t:new y(I(t))}class P extends f{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class N extends f{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function B(t,e){if(!e.closed)return t instanceof y?t.subscribe(e):I(t)(e)}function U(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(U((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new V(t,n)))}class V{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new H(t,this.project,this.concurrent))}}class H extends N{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function j(t=Number.POSITIVE_INFINITY){return U(v,t)}function z(t,e){return e?$(t,e):new y(T(t))}function W(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return E(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof y?t[0]:j(e)(z(t,n))}function G(){return function(t){return t.lift(new q(t))}}class q{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new K(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class K extends f{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,!i||n&&i!==n||i.unsubscribe()}}class X extends y{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new u,t.add(this.source.subscribe(new J(this.getSubject(),this))),t.closed&&(this._connection=null,t=u.EMPTY)),t}refCount(){return G()(this)}}const Y=(()=>{const t=X.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class J extends _{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function Q(){return new C}function Z(){return t=>{return G()((e=Q,function(t){let n;n="function"==typeof e?e:function(){return e};const i=Object.create(t,Y);return i.source=t,i.subjectFactory=n,i})(t));var e}}function tt(t){for(let e in t)if(t[e]===tt)return e;throw Error("Could not find renamed property on target object.")}function et(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function nt(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(nt).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function it(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const rt=tt({__forward_ref__:tt});function st(t){return t.__forward_ref__=st,t.toString=function(){return nt(this())},t}function ot(t){return at(t)?t():t}function at(t){return"function"==typeof t&&t.hasOwnProperty(rt)&&t.__forward_ref__===st}function lt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function ct(t){return{factory:t.factory,providers:t.providers||[],imports:t.imports||[]}}function ht(t){return ut(t,pt)||ut(t,gt)}function ut(t,e){return t.hasOwnProperty(e)?t[e]:null}function dt(t){return t&&(t.hasOwnProperty(ft)||t.hasOwnProperty(mt))?t[ft]:null}const pt=tt({"\u0275prov":tt}),ft=tt({"\u0275inj":tt}),gt=tt({ngInjectableDef:tt}),mt=tt({ngInjectorDef:tt});var vt=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});let yt;function bt(t){const e=yt;return yt=t,e}function wt(t,e,n){const i=ht(t);if(i&&"root"==i.providedIn)return void 0===i.value?i.value=i.factory():i.value;if(n&vt.Optional)return null;if(void 0!==e)return e;throw new Error(`Injector: NOT_FOUND [${nt(t)}]`)}function xt(t){return{toString:t}.toString()}var _t=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}({}),Ct=function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({});const St="undefined"!=typeof globalThis&&globalThis,Et="undefined"!=typeof window&&window,kt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,At="undefined"!=typeof global&&global,Dt=St||At||Et||kt,Tt={},Rt=[],Ft=tt({"\u0275cmp":tt}),Lt=tt({"\u0275dir":tt}),Mt=tt({"\u0275pipe":tt}),It=tt({"\u0275mod":tt}),$t=tt({"\u0275loc":tt}),Ot=tt({"\u0275fac":tt}),Pt=tt({__NG_ELEMENT_ID__:tt});let Nt=0;function Bt(t){return xt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===_t.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||Rt,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||Ct.Emulated,id:"c",styles:t.styles||Rt,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Nt++,n.inputs=zt(t.inputs,e),n.outputs=zt(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(Ut):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(Vt):null,n})}function Ut(t){return Gt(t)||function(t){return t[Lt]||null}(t)}function Vt(t){return function(t){return t[Mt]||null}(t)}const Ht={};function jt(t){const e={type:t.type,bootstrap:t.bootstrap||Rt,declarations:t.declarations||Rt,imports:t.imports||Rt,exports:t.exports||Rt,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&xt(()=>{Ht[t.id]=t.type}),e}function zt(t,e){if(null==t)return Tt;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const Wt=Bt;function Gt(t){return t[Ft]||null}function qt(t,e){const n=t[It]||null;if(!n&&!0===e)throw new Error(`Type ${nt(t)} does not have '\u0275mod' property.`);return n}const Kt=20,Xt=10;function Yt(t){return Array.isArray(t)&&"object"==typeof t[1]}function Jt(t){return Array.isArray(t)&&!0===t[1]}function Qt(t){return 0!=(8&t.flags)}function Zt(t){return 2==(2&t.flags)}function te(t){return 1==(1&t.flags)}function ee(t){return null!==t.template}function ne(t,e){return t.hasOwnProperty(Ot)?t[Ot]:null}class ie extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function re(t){return"string"==typeof t?t:null==t?"":String(t)}function se(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():re(t)}function oe(t,e){const n=e?" in "+e:"";throw new ie("201",`No provider for ${se(t)} found${n}`)}class ae{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function le(){return ce}function ce(t){return t.type.prototype.ngOnChanges&&(t.setInput=ue),he}function he(){const t=de(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Tt)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function ue(t,e,n,i){const r=de(t)||function(t,e){return t.__ngSimpleChanges__=e}(t,{previous:Tt,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new ae(l&&l.currentValue,e,o===Tt),t[i]=e}function de(t){return t.__ngSimpleChanges__||null}le.ngInherit=!0;const pe="http://www.w3.org/2000/svg";let fe=void 0;function ge(){return void 0!==fe?fe:"undefined"!=typeof document?document:void 0}function me(t){return!!t.listen}const ve={createRenderer:(t,e)=>ge()};function ye(t){for(;Array.isArray(t);)t=t[0];return t}function be(t,e){return ye(e[t])}function we(t,e){return ye(e[t.index])}function xe(t,e){return t.data[e]}function _e(t,e){return t[e]}function Ce(t,e){const n=e[t];return Yt(n)?n:n[0]}function Se(t){const e=function(t){return t.__ngContext__||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Ee(t){return 4==(4&t[2])}function ke(t){return 128==(128&t[2])}function Ae(t,e){return null==e?null:t[e]}function De(t){t[18]=0}function Te(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Re={lFrame:tn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Fe(){return Re.bindingsEnabled}function Le(){return Re.lFrame.lView}function Me(){return Re.lFrame.tView}function Ie(t){Re.lFrame.contextLView=t}function $e(){let t=Oe();for(;null!==t&&64===t.type;)t=t.parent;return t}function Oe(){return Re.lFrame.currentTNode}function Pe(t,e){const n=Re.lFrame;n.currentTNode=t,n.isParent=e}function Ne(){return Re.lFrame.isParent}function Be(){Re.lFrame.isParent=!1}function Ue(){return Re.isInCheckNoChangesMode}function Ve(t){Re.isInCheckNoChangesMode=t}function He(){const t=Re.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function je(){return Re.lFrame.bindingIndex}function ze(){return Re.lFrame.bindingIndex++}function We(t){const e=Re.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function Ge(t,e){const n=Re.lFrame;n.bindingIndex=n.bindingRootIndex=t,qe(e)}function qe(t){Re.lFrame.currentDirectiveIndex=t}function Ke(){return Re.lFrame.currentQueryIndex}function Xe(t){Re.lFrame.currentQueryIndex=t}function Ye(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function Je(t,e,n){if(n&vt.SkipSelf){let i=e,r=t;for(;i=i.parent,!(null!==i||n&vt.Host||(i=Ye(r),null===i)||(r=r[15],10&i.type)););if(null===i)return!1;e=i,t=r}const i=Re.lFrame=Ze();return i.currentTNode=e,i.lView=t,!0}function Qe(t){const e=Ze(),n=t[1];Re.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function Ze(){const t=Re.lFrame,e=null===t?null:t.child;return null===e?tn(t):e}function tn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function en(){const t=Re.lFrame;return Re.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const nn=en;function rn(){const t=en();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function sn(){return Re.lFrame.selectedIndex}function on(t){Re.lFrame.selectedIndex=t}function an(){const t=Re.lFrame;return xe(t.tView,t.selectedIndex)}function ln(){Re.lFrame.currentNamespace=pe}function cn(){Re.lFrame.currentNamespace=null}function hn(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[o]<0&&(t[18]+=65536),(s>11>16&&(3&t[2])===e&&(t[2]+=2048,s.call(o)):s.call(o)}const mn=-1;class vn{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function yn(t,e,n){const i=me(t);let r=0;for(;re){o=s-1;break}}}for(;s>16,i=e;for(;n>0;)i=i[15],n--;return i}let kn=!0;function An(t){const e=kn;return kn=t,e}let Dn=0;function Tn(t,e){const n=Fn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Rn(i.data,t),Rn(e,null),Rn(i.blueprint,null));const r=Ln(t,e),s=t.injectorIndex;if(Cn(r)){const t=Sn(r),n=En(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Rn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Fn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function Ln(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return mn;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return mn}function Mn(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Pt)&&(i=n[Pt]),null==i&&(i=n[Pt]=Dn++);const r=255&i,s=1<=0?255&e:Nn:e}(n);if("function"==typeof s){if(!Je(e,t,i))return i&vt.Host?In(r,n,i):$n(e,n,i,r);try{const t=s();if(null!=t||i&vt.Optional)return t;oe(n)}finally{nn()}}else if("number"==typeof s){let r=null,o=Fn(t,e),a=mn,l=i&vt.Host?e[16][6]:null;for((-1===o||i&vt.SkipSelf)&&(a=-1===o?Ln(t,e):e[o+8],a!==mn&&jn(i,!1)?(r=e[1],o=Sn(a),e=En(a,e)):o=-1);-1!==o;){const t=e[1];if(Hn(s,o,t.data)){const t=Bn(o,e,n,r,i,l);if(t!==Pn)return t}a=e[o+8],a!==mn&&jn(i,e[1].data[o+8]===l)&&Hn(s,o,e)?(r=t,o=Sn(a),e=En(a,e)):o=-1}}}return $n(e,n,i,r)}const Pn={};function Nn(){return new zn($e(),Le())}function Bn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Un(a,o,n,null==i?Zt(a)&&kn:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==l?Vn(e,o,l,a):Pn}function Un(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,h=r?a+c:t.directiveEnd;for(let u=i?a:a+c;u=l&&t.type===n)return u}if(r){const t=o[l];if(t&&ee(t)&&t.type===n)return l}return null}function Vn(t,e,n,i){let r=t[n];const s=e.data;if(r instanceof vn){const o=r;o.resolving&&function(t,e){throw new ie("200","Circular dependency in DI detected for "+t)}(se(s[n]));const a=An(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?bt(o.injectImpl):null;Je(t,i,vt.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ce(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&bt(l),An(a),o.resolving=!1,nn()}}return r}function Hn(t,e,n){const i=64&t,r=32&t;let s;return s=128&t?i?r?n[e+7]:n[e+6]:r?n[e+5]:n[e+4]:i?r?n[e+3]:n[e+2]:r?n[e+1]:n[e],!!(s&1<{const t=Wn(ot(e));return t?t():null};let n=ne(e);if(null===n){const t=dt(e);n=t&&t.factory}return n||null}function Gn(t){return xt(()=>{const e=t.prototype.constructor,n=e[Ot]||Wn(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Ot]||Wn(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function qn(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(Kn)?t[Kn]:Object.defineProperty(t,Kn,{value:[]})[Kn];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class Yn{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=lt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return"InjectionToken "+this._desc}}const Jn=new Yn("AnalyzeForEntryComponents"),Qn=Function;function Zn(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ti(t,e):e(t))}function ei(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ni(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function ii(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function si(t,e){const n=oi(t,e);if(n>=0)return t[1|n]}function oi(t,e){return function(t,e,n){let i=0,r=t.length>>1;for(;r!==i;){const n=i+(r-i>>1),s=t[n<<1];if(e===s)return n<<1;s>e?r=n:i=n+1}return~(r<<1)}(t,e)}const ai=Xn("Inject",t=>({token:t})),li=Xn("Optional"),ci=Xn("Self"),hi=Xn("SkipSelf"),ui={},di=/\n/gm,pi="__source",fi=tt({provide:String,useValue:tt});let gi,mi=void 0;function vi(t){const e=mi;return mi=t,e}function yi(t,e=vt.Default){if(void 0===mi)throw new Error("inject() must be called from an injection context");return null===mi?wt(t,void 0,e):mi.get(t,e&vt.Optional?null:void 0,e)}function bi(t,e=vt.Default){return(yt||yi)(ot(t),e)}function wi(t){const e=[];for(let n=0;nt,createScript:t=>t,createScriptURL:t=>t})}catch(e){}return gi}())||void 0===e?void 0:e.createHTML(t))||t}class _i{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see https://g.co/ng/security#xss)"}}class Ci extends _i{getTypeName(){return"HTML"}}class Si extends _i{getTypeName(){return"Style"}}class Ei extends _i{getTypeName(){return"Script"}}class ki extends _i{getTypeName(){return"URL"}}class Ai extends _i{getTypeName(){return"ResourceURL"}}function Di(t){return t instanceof _i?t.changingThisBreaksApplicationSecurity:t}function Ti(t,e){const n=Ri(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Ri(t){return t instanceof _i&&t.getTypeName()||null}class Fi{getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(xi(t),"text/html").body;return e.removeChild(e.firstChild),e}catch(e){return null}}}class Li{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=xi(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=xi(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0$i(t.trim())).join(", ")),this.buf.push(" ",e,'="',Yi(o),'"')}var i;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();Hi.hasOwnProperty(e)&&!Ni.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(Yi(t))}checkClobberedElement(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}}const Ki=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xi=/([^\#-~ |!])/g;function Yi(t){return t.replace(/&/g,"&").replace(Ki,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Xi,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Ji;function Qi(t,e){let n=null;try{Ji=Ji||function(t){return function(){try{return!!(new window.DOMParser).parseFromString(xi(""),"text/html")}catch(t){return!1}}()?new Fi:new Li(t)}(t);let i=e?String(e):"";n=Ji.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=Ji.getInertBodyElement(i)}while(i!==s);return(new qi).sanitizeChildren(Zi(n)||n)}finally{if(n){const t=Zi(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function Zi(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var tr=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}({});function er(t){const e=ir();return e?e.sanitize(tr.HTML,t)||"":Ti(t,"HTML")?Di(t):Qi(ge(),re(t))}function nr(t){const e=ir();return e?e.sanitize(tr.URL,t)||"":Ti(t,"URL")?Di(t):$i(re(t))}function ir(){const t=Le();return t&&t[12]}function rr(t){return t.ngDebugContext}function sr(t){return t.ngOriginalError}function or(t,...e){t.error(...e)}class ar{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t.ngErrorLogger||or}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?rr(t)?rr(t):this._findContext(sr(t)):null}_findOriginalError(t){let e=sr(t);for(;e&&sr(e);)e=sr(e);return e}}function lr(t,e){t.__ngContext__=e}const cr=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Dt))();function hr(t){return{name:"window",target:t.ownerDocument.defaultView}}function ur(t){return t instanceof Function?t():t}var dr=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({});function pr(t,e){return(void 0)(t,e)}function fr(t){const e=t[3];return Jt(e)?e[3]:e}function gr(t){return vr(t[13])}function mr(t){return vr(t[4])}function vr(t){for(;null!==t&&!Jt(t);)t=t[4];return t}function yr(t,e,n,i,r){if(null!=i){let s,o=!1;Jt(i)?s=i:Yt(i)&&(o=!0,i=i[0]);const a=ye(i);0===t&&null!==n?null==r?kr(e,n,a):Er(e,n,a,r||null,!0):1===t&&null!==n?Er(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Dr(t,e);i&&function(t,e,n,i){me(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==ye(n)&&yr(e,t,i,s,r);for(let o=Xt;o0&&(t[n-1][4]=i[4]);const o=ni(t,Xt+e);$r(i[1],r=i,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}var r;return i}function _r(t,e){if(!(256&e[2])){const n=e[11];me(n)&&n.destroyNode&&$r(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Cr(t[1],t);for(;e;){let n=null;if(Yt(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)Yt(e)&&Cr(e[1],e),e=e[3];null===e&&(e=t),Yt(e)&&Cr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Cr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),t+=2}else{const e=i[r=n[t+1]];n[t].call(e)}if(null!==i)for(let t=r+1;ts?"":r[h+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==Br(e,c,0)||2&i&&c!==t){if(Wr(i))return!1;o=!0}}}}else{if(!o&&!Wr(i)&&!Wr(l))return!1;if(o&&Wr(l))continue;o=!1,i=l|1&i}}return Wr(i)||o}function Wr(t){return 0==(1&t)}function Gr(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""===r||Wr(o)||(e+=Xr(s,r),r=""),i=o,s=s||!Wr(i);n++}return""!==r&&(e+=Xr(s,r)),e}const Jr={};function Qr(t){Zr(Me(),Le(),sn()+t,Ue())}function Zr(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&un(e,i,n)}else{const i=t.preOrderHooks;null!==i&&dn(e,i,0,n)}on(n)}function ts(t,e){return t<<17|e<<2}function es(t){return t>>17&32767}function ns(t){return 2|t}function is(t){return(131068&t)>>2}function rs(t,e){return-131069&t|e<<2}function ss(t){return 1|t}function os(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;iKt&&Zr(t,e,Kt,Ue()),n(i,r)}finally{on(s)}}function fs(t,e,n){if(Qt(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function Ss(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Es(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function ks(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&Is(n)}}function Is(t){for(let n=gr(t);null!==n;n=mr(n))for(let t=Xt;t0&&Is(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&Is(i)}}function $s(t,e){const n=Ce(e,t),i=n[1];!function(t,e){for(let n=e.length;nPromise.resolve(null))();function Hs(t){return t[7]||(t[7]=[])}function js(t){return t.cleanup||(t.cleanup=[])}function zs(t,e){const n=t[9],i=n?n.get(ar,null):null;i&&i.handleError(e)}function Ws(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ti([t],t=>this.processInjectorType(t,[],r)),this.records.set(Ks,oo(void 0,this));const s=this.records.get(Ys);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:nt(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=ui,n=vt.Default){this.assertNotDestroyed();const i=vi(this);try{if(!(n&vt.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=("function"==typeof(r=t)||"object"==typeof r&&r instanceof Yn)&&ht(t);e=n&&this.injectableDefInScope(n)?oo(ro(t),Js):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&vt.Self?eo():this.parent).get(t,e=n&vt.Optional&&e===ui?null:e)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(nt(t)),i)throw s;return function(t,e,n,i){const r=t.ngTempTokenPath;throw e[pi]&&r.unshift(e[pi]),t.message=function(t,e,n,i=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let r=nt(e);if(Array.isArray(e))r=e.map(nt).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):nt(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(di,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t.ngTempTokenPath=null,t}(s,t,"R3InjectorError",this.source)}throw s}finally{vi(i)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(nt(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ot(t)))return!1;let i=dt(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=dt(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ti(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||Zs))}}this.injectorDefTypes.add(s),this.records.set(s,oo(i.factory,Js));const a=i.providers;if(null!=a&&!o){const e=t;ti(a,t=>this.processProvider(t,e,a))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=lo(t=ot(t))?t:ot(t&&t.provide);const r=function(t,e,n){return ao(t)?oo(void 0,t.useValue):oo(so(t),Js)}(t);if(lo(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=oo(void 0,Js,!0),e.factory=()=>wi(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){var n;return e.value===Js&&(e.value=Qs,e.value=e.factory()),"object"==typeof e.value&&e.value&&null!==(n=e.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){return!!t.providedIn&&("string"==typeof t.providedIn?"any"===t.providedIn||t.providedIn===this.scope:this.injectorDefTypes.has(t.providedIn))}}function ro(t){const e=ht(t),n=null!==e?e.factory:ne(t);if(null!==n)return n;const i=dt(t);if(null!==i)return i.factory;if(t instanceof Yn)throw new Error(`Token ${nt(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=ii(e,"?");throw new Error(`Can't resolve all parameters for ${nt(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[pt]||t[gt]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function so(t,e,n){let i=void 0;if(lo(t)){const e=ot(t);return ne(e)||ro(e)}if(ao(t))i=()=>ot(t.useValue);else if((r=t)&&r.useFactory)i=()=>t.useFactory(...wi(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>bi(ot(t.useExisting));else{const e=ot(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return ne(e)||ro(e);i=()=>new e(...wi(t.deps))}var r;return i}function oo(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function ao(t){return null!==t&&"object"==typeof t&&fi in t}function lo(t){return"function"==typeof t}const co=function(t,e,n){return function(t,e=null,n=null,i){const r=no(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};let ho=(()=>{class t{static create(t,e){return Array.isArray(t)?co(t,e,""):co(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=ui,t.NULL=new Xs,t.\u0275prov=lt({token:t,providedIn:"any",factory:()=>bi(Ks)}),t.__NG_ELEMENT_ID__=-1,t})();function uo(t,e){hn(Se(t)[1],$e())}function po(t){let e=Object.getPrototypeOf(t.type.prototype).constructor,n=!0;const i=[t];for(;e;){let r=void 0;if(ee(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=fo(t.inputs),e.declaredInputs=fo(t.declaredInputs),e.outputs=fo(t.outputs);const n=r.hostBindings;n&&vo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&go(t,s),o&&mo(t,o),et(t.inputs,r.inputs),et(t.declaredInputs,r.declaredInputs),et(t.outputs,r.outputs),ee(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=xn(r.hostAttrs,n=xn(n,r.hostAttrs))}}(i)}function fo(t){return t===Tt?{}:t===Rt?[]:t}function go(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function mo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function vo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}let yo=null;function bo(){if(!yo){const t=Dt.Symbol;if(t&&t.iterator)yo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(ye(t[i.index])).target:i.index;if(me(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,u=!1;else{s=jo(i,e,s,!1);const t=n.listen(p.name||f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=jo(i,e,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=jo(i,e,s,!1);const d=i.outputs;let p;if(u&&null!==d&&(p=d[r])){const t=p.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Re.lFrame.contextLView))[8]}(t)}function Wo(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Zo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ta(t){return t.substring(Zo.key,Zo.keyEnd)}function ea(t,e){const n=Zo.textEnd;return n===e?-1:(e=Zo.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Zo.key=e,n),na(t,e,n))}function na(t,e,n){for(;e=0;n=ea(e,n))ri(t,ta(e),!0)}function aa(t,e,n,i){const r=Le(),s=Me(),o=We(2);s.firstUpdatePass&&ha(s,t,o,i),e!==Jr&&So(r,o,e)&&pa(s,s.data[sn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=nt(Di(t)))),t}(e,n),i,o)}function la(t,e,n,i){const r=Me(),s=We(2);r.firstUpdatePass&&ha(r,null,s,i);const o=Le();if(n!==Jr&&So(o,s,n)){const a=r.data[sn()];if(ma(a,i)&&!ca(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=it(t,n||"")),Lo(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===Jr&&(r=Yo);let l=0,c=0,h=0=t.expandoStartIndex}function ha(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[sn()],o=ca(t,n);ma(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=function(t){const e=Re.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=da(n=ua(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=ua(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==is(i))return t[es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=ua(null,t,e,n[1],i),n=da(n,e.attrs,i),function(t,e,n,i){t[es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i=void 0;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(h=!0)}else c=n;if(r)if(0!==l){const e=es(t[a+1]);t[i+1]=ts(e,a),0!==e&&(t[e+1]=rs(t[e+1],i)),t[a+1]=131071&t[a+1]|i<<17}else t[i+1]=ts(a,0),0!==a&&(t[a+1]=rs(t[a+1],i)),a=i;else t[i+1]=ts(l,0),0===a?a=i:t[l+1]=rs(t[l+1],i),l=i;h&&(t[i+1]=ns(t[i+1])),Jo(t,c,i,!0),Jo(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&oi(s,e)>=0&&(n[i+1]=ss(n[i+1]))}(e,c,t,i,s),o=ts(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function ua(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let h=n[r+1];h===Jr&&(h=c?Yo:void 0);let u=c?si(h,i):l===i?h:void 0;if(s&&!ga(u)&&(u=si(e,i)),ga(u)&&(a=u,o))return a;const d=t[r+1];r=o?es(d):is(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=si(t,i))}return a}function ga(t){return void 0!==t}function ma(t,e){return 0!=(t.flags&(e?16:32))}function va(t,e=""){const n=Le(),i=Me(),r=t+Kt,s=i.firstCreatePass?ls(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return me(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Fr(i,n,o,s),Pe(s,!1)}function ya(t){return ba("",t,""),ya}function ba(t,e,n){const i=Le(),r=Ao(i,t,e,n);return r!==Jr&&Gs(i,sn(),r),ba}function wa(t,e,n,i,r){const s=Le(),o=function(t,e,n,i,r,s){const o=Eo(t,je(),n,r);return We(2),o?e+re(n)+i+re(r)+s:Jr}(s,t,e,n,i,r);return o!==Jr&&Gs(s,sn(),o),wa}function xa(t,e,n){const i=Le();return So(i,ze(),e)&&xs(Me(),an(),i,t,e,i[11],n,!0),xa}const _a=void 0;var Ca=["en",[["a","p"],["AM","PM"],_a],[["AM","PM"],_a,_a],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],_a,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],_a,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",_a,"{1} 'at' {0}",_a],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let Sa={};function Ea(t){return t in Sa||(Sa[t]=Dt.ng&&Dt.ng.common&&Dt.ng.common.locales&&Dt.ng.common.locales[t]),Sa[t]}var ka=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}({});const Aa="en-US";let Da=Aa;function Ta(t){var e,n;n="Expected localeId to be defined",null==(e=t)&&function(t,e,n,i){throw new Error("ASSERTION ERROR: "+t+` [Expected=> null != ${e} <=Actual]`)}(n,e),"string"==typeof t&&(Da=t.toLowerCase().replace(/_/g,"-"))}function Ra(t,e,n,i,r){if(t=ot(t),Array.isArray(t))for(let s=0;s>20;if(lo(t)||!t.multi){const i=new vn(l,r,Ro),p=Ma(a,e,r?h:h+d,u);-1===p?(Mn(Tn(c,o),s,a),Fa(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=Ma(a,e,h+d,u),f=Ma(a,e,h,h+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Mn(Tn(c,o),s,a);const h=function(t,e,n,i,r){const s=new vn(t,n,Ro);return s.multi=[],s.index=e,s.componentProviders=0,La(s,r,i&&!n),s}(r?$a:Ia,n.length,r,i,l);!r&&m&&(n[f].providerFactory=h),Fa(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(h),o.push(h)}else Fa(s,t,p>-1?p:f,La(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function Fa(t,e,n,i){const r=lo(e);if(r||e.useClass){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function La(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function Ma(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=Me();if(i.firstCreatePass){const r=ee(t);Ra(n,i.data,i.blueprint,r,!0),Ra(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class Na{}class Ba{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${nt(t)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=t,e}(t)}}let Ua=(()=>{class t{}return t.NULL=new Ba,t})();function Va(...t){}function Ha(t,e){return new za(we(t,e))}const ja=function(){return Ha($e(),Le())};let za=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=ja,t})();class Wa{}let Ga=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>qa(),t})();const qa=function(){const t=Le(),e=Ce($e().index,t);return function(t){return t[11]}(Yt(e)?e:t)};let Ka=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>null}),t})();class Xa{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Ya=new Xa("11.0.5");class Ja{constructor(){}supports(t){return xo(t)}create(t){return new Za(t)}}const Qa=(t,e)=>e;class Za{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Qa}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):t=this._addAfter(new tl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new nl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new nl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class tl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class el{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class nl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new el,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function il(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new ol(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class ol{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let al=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new Ja])}),t})(),ll=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new rl])}),t})();function cl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(ye(s)),Jt(s))for(let t=Xt;t-1&&this._viewContainerRef.detach(t),this._viewContainerRef=null}_r(this._lView[1],this._lView)}onDestroy(t){bs(this._lView[1],this._lView,null,t)}markForCheck(){Ps(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ns(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Ve(!0);try{Ns(t,e,n)}finally{Ve(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t}detachFromAppRef(){var t;this._appRef=null,$r(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class ul extends hl{constructor(t){super(t),this._view=t}detectChanges(){Bs(this._view)}checkNoChanges(){!function(t){Ve(!0);try{Bs(t)}finally{Ve(!1)}}(this._view)}get context(){return null}}const dl=function(t=!1){return function(t,e,n){if(!n&&Zt(t)){const n=Ce(t.index,e);return new hl(n,n)}return 47&t.type?new hl(e[16],e):null}($e(),Le(),t)};let pl=(()=>{class t{}return t.__NG_ELEMENT_ID__=dl,t.__ChangeDetectorRef__=!0,t})();const fl=[new rl],gl=new al([new Ja]),ml=new ll(fl),vl=function(){return xl($e(),Le())};let yl=(()=>{class t{}return t.__NG_ELEMENT_ID__=vl,t})();const bl=yl,wl=class extends bl{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=as(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),hs(e,n,t),new hl(n)}};function xl(t,e){return 4&t.type?new wl(e,t,Ha(t,e)):null}class _l{}class Cl{}const Sl=function(){return Rl($e(),Le())};let El=(()=>{class t{}return t.__NG_ELEMENT_ID__=Sl,t})();const kl=El,Al=class extends kl{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ha(this._hostTNode,this._hostLView)}get injector(){return new zn(this._hostTNode,this._hostLView)}get parentInjector(){const t=Ln(this._hostTNode,this._hostLView);if(Cn(t)){const e=En(t,this._hostLView),n=Sn(t);return new zn(e[1].data[n+8],e)}return new zn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=Dl(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-Xt}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(_l,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(Jt(n[3])){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new Al(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=Xt+i,s=n.length;i>0&&(n[r-1][4]=e),icr});class $l extends Na{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=t.selectors.map(Yr).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return Ml(this.componentDef.inputs)}get outputs(){return Ml(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,Fl,r);return s!==Fl||i===Fl?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Wa,ve),o=r.get(Ka,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(me(t))return t.selectRootElement(e,n===Ct.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):br(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?pe:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),h=this.componentDef.onPush?576:528,u={components:[],scheduler:cr,clean:Vs,playerHandler:null,flags:0},d=ys(0,null,null,1,0,null,null,null,null,null),p=as(null,d,u,h,null,null,s,a,o,r);let f,g;Qe(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=ls(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(qs(a,l,!0),null!==t&&(yn(r,t,l),null!==a.classes&&Nr(r,t,a.classes),null!==a.styles&&Pr(r,t,a.styles)));const c=i.createRenderer(t,e),h=as(n,vs(e),null,e.onPush?64:16,n[20],a,i,c,null,null);return o.firstCreatePass&&(Mn(Tn(a,n),o,e.type),Es(o,a),As(a,n.length,1)),Os(n,h),n[20]=h}(c,this.componentDef,p,s,a);if(c)if(n)yn(a,c,["ng-version",Ya.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&Nr(a,c,e.join(" "))}if(g=xe(d,Kt),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=$e();e.contentQueries(1,o,t.directiveStart)}const a=$e();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(on(a.index),Cs(n[1],a,0,a.directiveStart,a.directiveEnd,e),Ss(e,o)),o}(t,this.componentDef,p,u,[uo]),hs(d,p,null)}finally{rn()}return new Ol(this.componentType,f,Ha(g,p),p,g)}}class Ol extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new ul(i),this.componentType=t}get injector(){return new zn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Pl=new Map;class Nl extends _l{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Ll(this);const n=qt(t),i=t[$t]||null;i&&Ta(i),this._bootstrapComponents=ur(n.bootstrap),this._r3Injector=no(t,e,[{provide:_l,useValue:this},{provide:Ua,useValue:this.componentFactoryResolver}],nt(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=ho.THROW_IF_NOT_FOUND,n=vt.Default){return t===ho||t===_l||t===Ks?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Bl extends Cl{constructor(t){super(),this.moduleType=t,null!==qt(t)&&function(t){const e=new Set;!function t(n){const i=qt(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${nt(e)} vs ${nt(e.name)}`)}(r,Pl.get(r),n),Pl.set(r,n));const s=ur(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Nl(this.moduleType,t)}}function Ul(t,e,n){const i=He()+t,r=Le();return r[i]===Jr?Co(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Vl(t,e,n,i){return zl(Le(),He(),t,e,n,i)}function Hl(t,e,n,i,r){return function(t,e,n,i,r,s,o){const a=e+n;return Eo(t,a,r,s)?Co(t,a+2,o?i.call(o,r,s):i(r,s)):jl(t,a+2)}(Le(),He(),t,e,n,i,r)}function jl(t,e){const n=t[e];return n===Jr?void 0:n}function zl(t,e,n,i,r,s){const o=e+n;return So(t,o,r)?Co(t,o+1,s?i.call(s,r):i(r)):jl(t,o+1)}const Wl=class extends C{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){let i,r=t=>null,s=()=>null;t&&"object"==typeof t?(i=this.__isAsync?e=>{setTimeout(()=>t.next(e))}:e=>{t.next(e)},t.error&&(r=this.__isAsync?e=>{setTimeout(()=>t.error(e))}:e=>{t.error(e)}),t.complete&&(s=this.__isAsync?()=>{setTimeout(()=>t.complete())}:()=>{t.complete()})):(i=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)},e&&(r=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)}),n&&(s=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const o=super.subscribe(i,r,s);return t instanceof u&&t.add(o),o}};function Gl(){return this._results[bo()]()}class ql{constructor(){this.dirty=!0,this._results=[],this.changes=new Wl,this.length=0;const t=bo(),e=ql.prototype;e[t]||(e[t]=Gl)}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t){this._results=Zn(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Kl{constructor(t){this.queryList=t,this.matches=null}clone(){return new Kl(this.queryList)}setDirty(){this.queryList.setDirty()}}class Xl{constructor(t=[]){this.queries=t}createEmbeddedView(t){const e=t.queries;if(null!==e){const n=null!==t.contentQueries?t.contentQueries[0]:e.length,i=[];for(let t=0;t0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=Xt;t{class t{constructor(t){this.appInits=t,this.resolve=Va,this.reject=Va,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(bi(pc,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const gc=new Yn("AppId"),mc={provide:gc,useFactory:function(){return`${vc()}${vc()}${vc()}`},deps:[]};function vc(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const yc=new Yn("Platform Initializer"),bc=new Yn("Platform ID"),wc=new Yn("appBootstrapListener");let xc=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const _c=new Yn("LocaleId"),Cc=new Yn("DefaultCurrencyCode");class Sc{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const Ec=function(t){return new Bl(t)},kc=Ec,Ac=function(t){return Promise.resolve(Ec(t))},Dc=function(t){const e=Ec(t),n=ur(qt(t).declarations).reduce((t,e)=>{const n=Gt(e);return n&&t.push(new $l(n)),t},[]);return new Sc(e,n)},Tc=Dc,Rc=function(t){return Promise.resolve(Dc(t))};let Fc=(()=>{class t{constructor(){this.compileModuleSync=kc,this.compileModuleAsync=Ac,this.compileModuleAndAllComponentsSync=Tc,this.compileModuleAndAllComponentsAsync=Rc}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Lc=(()=>Promise.resolve(0))();function Mc(t){"undefined"==typeof Zone?Lc.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Ic{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Wl(!1),this.onMicrotaskEmpty=new Wl(!1),this.onStable=new Wl(!1),this.onError=new Wl(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const n=this;n._nesting=0,n._outer=n._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(n._inner=n._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(n._inner=n._inner.fork(Zone.longStackTraceZoneSpec)),n.shouldCoalesceEventChangeDetection=e,n.lastRequestAnimationFrameId=-1,n.nativeRequestAnimationFrame=function(){let t=Dt.requestAnimationFrame,e=Dt.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=!!t.shouldCoalesceEventChangeDetection&&t.nativeRequestAnimationFrame&&(()=>{!function(t){-1===t.lastRequestAnimationFrameId&&(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Dt,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Pc(t),Oc(t)},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Pc(t))}(t)});t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0,maybeDelayChangeDetection:e},onInvokeTask:(n,i,r,s,o,a)=>{try{return Nc(t),n.invokeTask(r,s,o,a)}finally{e&&"eventTask"===s.type&&e(),Bc(t)}},onInvoke:(e,n,i,r,s,o,a)=>{try{return Nc(t),e.invoke(i,r,s,o,a)}finally{Bc(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Pc(t),Oc(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(n)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ic.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Ic.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,$c,Va,Va);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const $c={};function Oc(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Pc(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||t.shouldCoalesceEventChangeDetection&&-1!==t.lastRequestAnimationFrameId)}function Nc(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Bc(t){t._nesting--,Oc(t)}class Uc{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Wl,this.onMicrotaskEmpty=new Wl,this.onStable=new Wl,this.onError=new Wl}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Vc=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Mc(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(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()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Hc=(()=>{class t{constructor(){this._applications=new Map,Wc.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Wc.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class jc{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let zc,Wc=new jc,Gc=!0,qc=!1;function Kc(){return qc=!0,Gc}const Xc=new Yn("AllowMultipleToken");class Yc{constructor(t,e){this.name=t,this.token=e}}function Jc(t,e,n=[]){const i="Platform: "+e,r=new Yn(i);return(e=[])=>{let s=Qc();if(!s||s.injector.get(Xc,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:Ys,useValue:"platform"});!function(t){if(zc&&!zc.destroyed&&!zc.injector.get(Xc,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");zc=t.get(Zc);const e=t.get(yc,null);e&&e.forEach(t=>t())}(ho.create({providers:t,name:i}))}return function(t){const e=Qc();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}(r)}}function Qc(){return zc&&!zc.destroyed?zc:null}let Zc=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new Uc:("zone.js"===t?void 0:t)||new Ic({enableLongStackTrace:Kc(),shouldCoalesceEventChangeDetection:e}),n}(e?e.ngZone:void 0,e&&e.ngZoneEventCoalescing||!1),i=[{provide:Ic,useValue:n}];return n.run(()=>{const e=ho.create({providers:i,parent:this.injector,name:t.moduleType.name}),r=t.create(e),s=r.injector.get(ar,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{s.handleError(t)}});r.onDestroy(()=>{nh(this._modules,r),t.unsubscribe()})}),function(t,e,n){try{const i=n();return Bo(i)?i.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):i}catch(i){throw e.runOutsideAngular(()=>t.handleError(i)),i}}(s,n,()=>{const t=r.injector.get(fc);return t.runInitializers(),t.donePromise.then(()=>(Ta(r.injector.get(_c,Aa)||Aa),this._moduleDoBootstrap(r),r))})})}bootstrapModule(t,e=[]){const n=th({},e);return function(t,e,n){const i=new Bl(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(eh);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${nt(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)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function th(t,e){return Array.isArray(e)?e.reduce(th,t):Object.assign(Object.assign({},t),e)}let eh=(()=>{class t{constructor(t,e,n,i,r,s){this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=s,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new y(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),a=new y(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Ic.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=W(o,a.pipe(Z()))}bootstrap(t,e){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.");let n;n=t instanceof Na?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=n.isBoundToModule?void 0:this._injector.get(_l),r=n.create(ho.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Vc,null),a=o&&r.injector.get(Hc);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),nh(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),Kc()&&this._console.log("Angular is running in development mode. Call enableProdMode() to enable production mode."),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;nh(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(wc,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic),bi(xc),bi(ho),bi(ar),bi(Ua),bi(fc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function nh(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ih{}class rh{}const sh={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let oh=(()=>{class t{constructor(t,e){this._compiler=t,this._config=e||sh}load(t){return this.loadAndCompile(t)}loadAndCompile(t){let[e,i]=t.split("#");return void 0===i&&(i="default"),n("zn8P")(e).then(t=>t[i]).then(t=>ah(t,e,i)).then(t=>this._compiler.compileModuleAsync(t))}loadFactory(t){let[e,i]=t.split("#"),r="NgFactory";return void 0===i&&(i="default",r=""),n("zn8P")(this._config.factoryPathPrefix+e+this._config.factoryPathSuffix).then(t=>t[i+r]).then(t=>ah(t,e,i))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fc),bi(rh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function ah(t,e,n){if(!t)throw new Error(`Cannot find '${n}' in '${e}'`);return t}const lh=Jc(null,"core",[{provide:bc,useValue:"unknown"},{provide:Zc,deps:[ho]},{provide:Hc,deps:[]},{provide:xc,deps:[]}]),ch=[{provide:eh,useClass:eh,deps:[Ic,xc,ho,ar,Ua,fc]},{provide:Il,deps:[Ic],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:fc,useClass:fc,deps:[[new li,pc]]},{provide:Fc,useClass:Fc,deps:[]},mc,{provide:al,useFactory:function(){return gl},deps:[]},{provide:ll,useFactory:function(){return ml},deps:[]},{provide:_c,useFactory:function(t){return Ta(t=t||"undefined"!=typeof $localize&&$localize.locale||Aa),t},deps:[[new ai(_c),new li,new hi]]},{provide:Cc,useValue:"USD"}];let hh=(()=>{class t{constructor(t){}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(eh))},providers:ch}),t})(),uh=null;function dh(){return uh}const ph=new Yn("DocumentToken");let fh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:gh,token:t,providedIn:"platform"}),t})();function gh(){return bi(vh)}const mh=new Yn("Location Initialized");let vh=(()=>{class t extends fh{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=dh().getLocation(),this._history=dh().getHistory()}getBaseHrefFromDOM(){return dh().getBaseHref(this._doc)}onPopState(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)}onHashChange(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){yh()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){yh()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:bh,token:t,providedIn:"platform"}),t})();function yh(){return!!window.history.pushState}function bh(){return new vh(bi(ph))}function wh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function xh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function _h(t){return t&&"?"!==t[0]?"?"+t:t}let Ch=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:Sh,token:t,providedIn:"root"}),t})();function Sh(t){const e=bi(ph).location;return new kh(bi(fh),e&&e.origin||"")}const Eh=new Yn("appBaseHref");let kh=(()=>{class t extends Ch{constructor(t,e){if(super(),this._platformLocation=t,null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)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.");this._baseHref=e}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return wh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+_h(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Ah=(()=>{class t extends Ch{constructor(t,e){super(),this._platformLocation=t,this._baseHref="",null!=e&&(this._baseHref=e)}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e}prepareExternalUrl(t){const e=wh(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Dh=(()=>{class t{constructor(t,e){this._subject=new Wl,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=xh(Rh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+_h(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,Rh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(bi(Ch),bi(fh))},t.normalizeQueryParams=_h,t.joinWithSlash=wh,t.stripTrailingSlash=xh,t.\u0275prov=lt({factory:Th,token:t,providedIn:"root"}),t})();function Th(){return new Dh(bi(Ch),bi(fh))}function Rh(t){return t.replace(/\/index.html$/,"")}var Fh=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}({});class Lh{}let Mh=(()=>{class t extends Lh{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=Ea(e);if(n)return n;const i=e.split("-")[0];if(n=Ea(i),n)return n;if("en"===i)return Ca;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[ka.PluralCase]}(e||this.locale)(t)){case Fh.Zero:return"zero";case Fh.One:return"one";case Fh.Two:return"two";case Fh.Few:return"few";case Fh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(bi(_c))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Ih(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let $h=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(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&&(xo(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+nt(t.item));this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(al),Ro(ll),Ro(za),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Oh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ph=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(e){throw new Error(`Cannot find a differ supporting object '${n}' of type '${t=n,t.name||typeof t}'. NgFor only supports binding to Iterables such as Arrays.`)}}var t;if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new Oh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new Nh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new Nh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(al))},t.\u0275dir=Wt({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Nh{constructor(t,e){this.record=t,this.view=e}}let Bh=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Uh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){Vh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Vh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Uh{constructor(){this.$implicit=null,this.ngIf=null}}function Vh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${nt(e)}'.`)}class Hh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let jh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Hh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(jh,1))},t.\u0275dir=Wt({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Wh=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(ll),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),Gh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(this._shouldRecreateView(t)){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(t){const e=t.ngTemplateOutletContext;return!!t.ngTemplateOutlet||e&&this._hasContextShapeChanged(e)}_hasContextShapeChanged(t){const e=Object.keys(t.previousValue||{}),n=Object.keys(t.currentValue||{});if(e.length===n.length){for(let t of n)if(-1===e.indexOf(t))return!0;return!1}return!0}_updateExistingContext(t){for(let e of Object.keys(t))this._viewRef.context[e]=this.ngTemplateOutletContext[e]}}return t.\u0275fac=function(e){return new(e||t)(Ro(El))},t.\u0275dir=Wt({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[le]}),t})(),qh=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:Lh,useClass:Mh}]}),t})(),Kh=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new Xh(bi(ph),window,bi(ar))}),t})();class Xh{constructor(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(this.supportsScrolling()){const e=this.document.getElementById(t)||this.document.getElementsByName(t)[0];e&&this.scrollToElement(e)}}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,i=e.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],i-r[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=Yh(this.window.history)||Yh(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch(t){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(t){return!1}}}function Yh(t){return Object.getOwnPropertyDescriptor(t,"scrollRestoration")}class Jh extends class extends class{}{constructor(){super()}supportsDOMEvents(){return!0}}{static makeCurrent(){var t;t=new Jh,uh||(uh=t)}getProperty(t,e){return t[e]}log(t){window.console&&window.console.log&&window.console.log(t)}logGroup(t){window.console&&window.console.group&&window.console.group(t)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){return t.parentNode&&t.parentNode.removeChild(t),t}getValue(t){return t.value}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(t){const e=Zh||(Zh=document.querySelector("base"),Zh)?Zh.getAttribute("href"):null;return null==e?null:(n=e,Qh||(Qh=document.createElement("a")),Qh.setAttribute("href",n),"/"===Qh.pathname.charAt(0)?Qh.pathname:"/"+Qh.pathname);var n}resetBaseElement(){Zh=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(t){return Ih(document.cookie,t)}}let Qh,Zh=null;const tu=new Yn("TRANSITION_ID"),eu=[{provide:pc,useFactory:function(t,e,n){return()=>{n.get(fc).donePromise.then(()=>{const n=dh();Array.prototype.slice.apply(e.querySelectorAll("style[ng-transition]")).filter(e=>e.getAttribute("ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[tu,ph,ho],multi:!0}];class nu{static init(){var t;t=new nu,Wc=t}addToWindow(t){Dt.getAngularTestability=(e,n=!0)=>{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Dt.getAllAngularTestabilities=()=>t.getAllTestabilities(),Dt.getAllAngularRootElements=()=>t.getAllRootElements(),Dt.frameworkStabilizers||(Dt.frameworkStabilizers=[]),Dt.frameworkStabilizers.push(t=>{const e=Dt.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?dh().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}const iu=new Yn("EventManagerPlugins");let ru=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),au=(()=>{class t extends ou{constructor(t){super(),this._doc=t,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(t.head)}_addStylesToHost(t,e){t.forEach(t=>{const n=this._doc.createElement("style");n.textContent=t,this._styleNodes.add(e.appendChild(n))})}addHost(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)}removeHost(t){this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach(e=>this._addStylesToHost(t,e))}ngOnDestroy(){this._styleNodes.forEach(t=>dh().remove(t))}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},cu=/%COMP%/g;function hu(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let du=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new pu(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case Ct.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new fu(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case Ct.ShadowDom:return new gu(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=hu(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(bi(ru),bi(au),bi(gc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class pu{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(lu[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=lu[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=lu[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(dr.DashCase|dr.Important)?t.style.setProperty(e,n,i&dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,uu(n)):this.eventManager.addEventListener(t,e,uu(n))}}class fu extends pu{constructor(t,e,n,i){super(t),this.component=n;const r=hu(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(cu,i+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(cu,i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class gu extends pu{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=hu(i.id,i.styles,[]);for(let s=0;s{class t extends su{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const vu=["alt","control","meta","shift"],yu={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},bu={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},wu={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let xu=(()=>{class t extends su{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dh().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(vu.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&bu.hasOwnProperty(e)&&(e=bu[e]))}return yu[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),vu.forEach(i=>{i!=n&&(0,wu[i])(t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),_u=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return bi(Cu)},token:t,providedIn:"root"}),t})(),Cu=(()=>{class t extends _u{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case tr.NONE:return e;case tr.HTML:return Ti(e,"HTML")?Di(e):Qi(this._doc,String(e));case tr.STYLE:return Ti(e,"Style")?Di(e):e;case tr.SCRIPT:if(Ti(e,"Script"))return Di(e);throw new Error("unsafe value used in a script context");case tr.URL:return Ri(e),Ti(e,"URL")?Di(e):$i(String(e));case tr.RESOURCE_URL:if(Ti(e,"ResourceURL"))return Di(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return new Ci(t)}bypassSecurityTrustStyle(t){return new Si(t)}bypassSecurityTrustScript(t){return new Ei(t)}bypassSecurityTrustUrl(t){return new ki(t)}bypassSecurityTrustResourceUrl(t){return new Ai(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return t=bi(Ks),new Cu(t.get(ph));var t},token:t,providedIn:"root"}),t})();const Su=Jc(lh,"browser",[{provide:bc,useValue:"browser"},{provide:yc,useValue:function(){Jh.makeCurrent(),nu.init()},multi:!0},{provide:ph,useFactory:function(){return function(t){fe=t}(document),document},deps:[]}]),Eu=[[],{provide:Ys,useValue:"root"},{provide:ar,useFactory:function(){return new ar},deps:[]},{provide:iu,useClass:mu,multi:!0,deps:[ph,Ic,bc]},{provide:iu,useClass:xu,multi:!0,deps:[ph]},[],{provide:du,useClass:du,deps:[ru,au,gc]},{provide:Wa,useExisting:du},{provide:ou,useExisting:au},{provide:au,useClass:au,deps:[ph]},{provide:Vc,useClass:Vc,deps:[Ic]},{provide:ru,useClass:ru,deps:[iu,Ic]},[]];let ku=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:gc,useValue:e.appId},{provide:tu,useExisting:gc},eu]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:Eu,imports:[qh,hh]}),t})();"undefined"!=typeof window&&window;class Au{}const Du="*";function Tu(t,e){return{type:7,name:t,definitions:e,options:{}}}function Ru(t,e=null){return{type:4,styles:e,timings:t}}function Fu(t,e=null){return{type:2,steps:t,options:e}}function Lu(t){return{type:6,styles:t,offset:null}}function Mu(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function Iu(t){Promise.resolve(null).then(t)}class $u{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Iu(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Ou{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Iu(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Pu(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Nu(t){switch(t.length){case 0:return new $u;case 1:return t[0];default:return new Ou(t)}}function Bu(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,h=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Du:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}h[i]=a}),i||a.push(h),c=h,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function Uu(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&Vu(n,"start",t)));break;case"done":t.onDone(()=>i(n&&Vu(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&Vu(n,"destroy",t)))}}function Vu(t,e,n){const i=n.totalTime,r=Hu(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function Hu(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function ju(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function zu(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let Wu=(t,e)=>!1,Gu=(t,e)=>!1,qu=(t,e,n)=>[];const Ku=Pu();(Ku||"undefined"!=typeof Element)&&(Wu=(t,e)=>t.contains(e),Gu=(()=>{if(Ku||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):Gu}})(),qu=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let nd=(()=>{class t{validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new $u(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),id=(()=>{class t{}return t.NOOP=new nd,t})();const rd="ng-enter",sd="ng-leave",od="ng-trigger",ad=".ng-trigger",ld="ng-animating",cd=".ng-animating";function hd(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:ud(parseFloat(e[1]),e[2])}function ud(t,e){switch(e){case"s":return 1e3*t;default:return t}}function dd(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=ud(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=ud(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function pd(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function fd(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else pd(t,n);return n}function gd(t,e,n){return n?e+":"+n+";":""}function md(t){let e="";for(let n=0;n{const r=Ed(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Pu()&&md(t))}function yd(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=Ed(e);t.style[n]=""}),Pu()&&md(t))}function bd(t){return Array.isArray(t)?1==t.length?t[0]:Fu(t):t}const wd=new RegExp("{{\\s*(.+?)\\s*}}","g");function xd(t){let e=[];if("string"==typeof t){let n;for(;n=wd.exec(t);)e.push(n[1]);wd.lastIndex=0}return e}function _d(t,e,n){const i=t.toString(),r=i.replace(wd,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push("Please provide a value for the animation param "+i),r=""),r.toString()});return r==i?t:r}function Cd(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Sd=/-+([a-z0-9])/g;function Ed(t){return t.replace(Sd,(...t)=>t[1].toUpperCase())}function kd(t,e){return 0===t||0===e}function Ad(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Id(r,o)),"<"!=s[0]||r==Rd&&o==Rd||e.push(Id(o,r))}(t,n,e)):n.push(t),n}const Ld=new Set(["true","1"]),Md=new Set(["false","0"]);function Id(t,e){const n=Ld.has(t)||Md.has(t),i=Ld.has(e)||Md.has(e);return(r,s)=>{let o=t==Rd||t==r,a=e==Rd||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Ld.has(t):Md.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Ld.has(e):Md.has(e)),o&&a}}const $d=new RegExp("s*:selfs*,?","g");function Od(t,e,n){return new Pd(t).build(e,n)}class Pd{constructor(t){this._driver=t}build(t,e){const n=new Nd(e);return this._resetContextStyleTimingState(n),Dd(this,bd(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(Bd(t)){const e=t;Object.keys(e).forEach(t=>{xd(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Cd(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Dd(this,bd(t.animation),e);return{type:1,matchers:Fd(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Ud(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Dd(this,t,e)),options:Ud(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Dd(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:Ud(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return Vd(dd(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=Vd(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||dd(i,e),Vd(n.duration,n.delay,n.easing)}(t.timings,e.errors);let i;e.currentAnimateTimings=n;let r=t.styles?t.styles:Lu({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Lu(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Du?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(Bd(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=xd(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=h>0?i==u?1:h*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Dd(this,bd(t.animation),e),options:Ud(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:Ud(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:Ud(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace($d,"")),[t=t.replace(/@\*/g,ad).replace(/@\w+/g,t=>".ng-trigger-"+t.substr(1)).replace(/:animating/g,cd),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,ju(e.collectedStyles,e.currentQuerySelector,{});const o=Dd(this,bd(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:Ud(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:dd(t.timings,e.errors,!0);return{type:12,animation:Dd(this,bd(t.animation),e),timings:n,options:null}}}class Nd{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function Bd(t){return!Array.isArray(t)&&"object"==typeof t}function Ud(t){var e;return t?(t=pd(t)).params&&(t.params=(e=t.params)?pd(e):null):t={},t}function Vd(t,e,n){return{duration:t,delay:e,easing:n}}function Hd(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class jd{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const zd=new RegExp(":enter","g"),Wd=new RegExp(":leave","g");function Gd(t,e,n,i,r,s={},o={},a,l,c=[]){return(new qd).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class qd{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new jd;const h=new Xd(t,e,l,i,r,c,[]);h.options=a,h.currentTimeline.setStyles([s],null,h.errors,a),Dd(this,n,h);const u=h.timelines.filter(t=>t.containsAnimation());if(u.length&&Object.keys(o).length){const t=u[u.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,h.errors,a)}return u.length?u.map(t=>t.buildKeyframes()):[Hd(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?hd(n.duration):null,s=null!=n.delay?hd(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Dd(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Kd);const t=hd(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Dd(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?hd(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Dd(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return dd(e.params?_d(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?hd(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Kd);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Dd(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Dd(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const Kd={};class Xd{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Kd,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Yd(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=hd(n.duration)),null!=n.delay&&(i.delay=hd(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{e&&t.hasOwnProperty(n)||(t[n]=_d(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new Xd(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=Kd,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new Jd(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(zd,"."+this._enterClassName)).replace(Wd,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return r||0!=o.length||s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class Yd{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new Yd(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Du,this._currentKeyframe[t]=Du}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Du})):fd(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=_d(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Du),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=fd(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Du&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Cd(t.values()):[],s=e.size?Cd(e.values()):[];if(n){const t=i[0],e=pd(t);t.offset=0,e.offset=1,i=[t,e]}return Hd(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Jd extends Yd{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.element=e,this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=fd(t[0],!1);a.offset=0,r.push(a);const l=fd(t[0],!1);l.offset=Qd(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=fd(t[i],!1);o.offset=Qd((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return Hd(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function Qd(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class Zd{}class tp extends Zd{normalizePropertyName(t,e){return Ed(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(ep[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const ep=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function np(t,e,n,i,r,s,o,a,l,c,h,u,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:d}}const ip={};class rp{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const h=[],u=this.ast.options&&this.ast.options.params||ip,d=this.buildStyles(n,o&&o.params||ip,h),p=a&&a.params||ip,f=this.buildStyles(i,p,h),g=new Set,m=new Map,v=new Map,y="void"===i,b={params:Object.assign(Object.assign({},u),p)},w=c?[]:Gd(t,e,this.ast.animation,r,s,d,f,b,l,h);let x=0;if(w.forEach(t=>{x=Math.max(t.duration+t.delay,x)}),h.length)return np(e,this._triggerName,n,i,y,d,f,[],[],m,v,x,h);w.forEach(t=>{const n=t.element,i=ju(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=ju(v,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const _=Cd(g.values());return np(e,this._triggerName,n,i,y,d,f,w,_,m,v,x)}}class sp{constructor(t,e){this.styles=t,this.defaultParams=e}buildStyles(t,e){const n={},i=pd(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=_d(s,i,e)),n[t]=s})}}),n}}class op{constructor(t,e){this.name=t,this.ast=e,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new sp(t.style,t.options&&t.options.params||{})}),ap(this.states,"true","1"),ap(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new rp(t,e,this.states))}),this.fallbackTransition=new rp(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function ap(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const lp=new jd;class cp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Od(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=Bu(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=Gd(this._driver,e,r,rd,sd,{},{},n,lp,i),s.forEach(t=>{const e=ju(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error("Unable to create the animation due to the following errors: "+i.join("\n"));o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Du)})});const a=Nu(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e}listen(t,e,n,i){const r=Hu(e,"","","");return Uu(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const hp="ng-animate-queued",up="ng-animate-disabled",dp=".ng-animate-disabled",pp=[],fp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},gp={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class mp{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=null!=(i=n?t.value:t)?i:null,n){const e=pd(t);delete e.value,this.options=e}else this.options={};var i;this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const vp="void",yp=new mp(vp);class bp{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,kp(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if("start"!=(r=n)&&"done"!=r)throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);var r;const s=ju(this._elementListeners,t,[]),o={name:e,phase:n,callback:i};s.push(o);const a=ju(this._engine.statesByElement,t,{});return a.hasOwnProperty(e)||(kp(t,od),kp(t,"ng-trigger-"+e),a[e]=yp),()=>{this._engine.afterFlush(()=>{const t=s.indexOf(o);t>=0&&s.splice(t,1),this._triggers[e]||delete a[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new xp(this.id,e,t);let o=this._engine.statesByElement.get(t);o||(kp(t,od),kp(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new mp(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=yp),l.value!==vp&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{yd(t,n),vd(t,i)})}return}const c=ju(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let h=r.matchTransition(a.value,l.value,t,l.params),u=!1;if(!h){if(!i)return;h=r.fallbackTransition,u=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:a,toState:l,player:s,isFallbackTransition:u}),u||(kp(t,hp),s.onStart(()=>{Ap(t,hp)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,ad,!0);n.forEach(t=>{if(t.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,vp,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&Nu(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t);if(e){const n=new Set;e.forEach(e=>{const i=e.name;if(n.has(i))return;n.add(i);const r=this._triggers[i].fallbackTransition,s=this._engine.statesByElement.get(t)[i]||yp,o=new mp(vp),a=new xp(this.id,i,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:i,transition:r,fromState:s,toState:o,player:a,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t.__ng_removed;i&&i!==fp||(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){kp(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=Hu(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,Uu(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class wp{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new bp(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),kp(t,up)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Ap(t,up))}removeNode(t,e,n,i){if(_p(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e.__ng_removed={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return _p(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,ad,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,cd,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Nu(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t.__ng_removed;if(e&&e.setForRemoval){if(t.__ng_removed=fp,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,dp)&&this.markElementAsDisabled(t,!1),this.driver.query(t,dp,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?Nu(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))}_flushAnimations(t,e){const n=new jd,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=rd+f++;p.set(e,n),t.forEach(t=>kp(t,n))});const g=[],m=new Set,v=new Set;for(let R=0;Rm.add(t)):v.add(t))}const y=new Map,b=Ep(u,Array.from(m));b.forEach((t,e)=>{const n=sd+f++;y.set(e,n),t.forEach(t=>kp(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Ap(t,n))}),b.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Ap(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const w=[],x=[];for(let R=this._namespaceList.length-1;R>=0;R--)this._namespaceList[R].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(w.push(e),this.collectedEnterElements.length){const t=r.__ng_removed;if(t&&t.setForMove)return void e.destroy()}const c=!h||!this.driver.containsElement(h,r),u=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,u,c);if(f.errors&&f.errors.length)x.push(f);else{if(c)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>ju(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(x.length){const t=[];x.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),w.forEach(t=>t.destroy()),this.reportError(t)}const _=new Map,C=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(C.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,_))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{ju(_,e,[]).push(t),t.destroy()})});const S=g.filter(t=>Rp(t,a,l)),E=new Map;Sp(E,this.driver,v,l,Du).forEach(t=>{Rp(t,a,l)&&S.push(t)});const k=new Map;d.forEach((t,e)=>{Sp(k,this.driver,new Set(t),a,"!")}),S.forEach(t=>{const e=E.get(t),n=k.get(t);E.set(t,Object.assign(Object.assign({},e),n))});const A=[],D=[],T={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>vd(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=T;if(C.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=C.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>C.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,_,r,k,E);if(s.setRealPlayer(n),t===T)A.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=Nu(e)),i.push(s)}}else yd(e,o.fromStyles),s.onDestroy(()=>vd(e,o.toStyles)),D.push(s),c.has(e)&&i.push(s)}),D.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=Nu(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let R=0;R!t.destroyed);i.length?Dp(this,t,i):this.processLeaveNode(t)}return g.length=0,A.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),A}elementContainsData(t,e){let n=!1;const i=e.__ng_removed;return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==vp;e.forEach(e=>{e.queued||(t||e.triggerName==i)&&s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=ju(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}yd(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,h=new Set,u=e.timelines.map(e=>{const u=e.element;c.add(u);const d=u.__ng_removed;if(d&&d.removedBeforeQueried)return new $u(e.duration,e.delay);const p=u!==a,f=function(t){const e=[];return Tp(t,e),e}((n.get(u)||pp).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===u),g=r.get(u),m=s.get(u),v=Bu(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,v,f);if(e.subTimeline&&i&&h.add(u),p){const e=new xp(t,o,u);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{ju(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>kp(t,ld));const d=Nu(u);return d.onDestroy(()=>{c.forEach(t=>Ap(t,ld)),vd(a,e.toStyles)}),h.forEach(t=>{ju(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new $u(t.duration,t.delay)}}class xp{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new $u,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>Uu(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){ju(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function _p(t){return t&&1===t.nodeType}function Cp(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function Sp(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Cp(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);n&&0!=n.length||(i.__ng_removed=gp,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Cp(t,s[a++])),o}function Ep(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}function kp(t,e){if(t.classList)t.classList.add(e);else{let n=t.$$classes;n||(n=t.$$classes={}),n[e]=!0}}function Ap(t,e){if(t.classList)t.classList.remove(e);else{let n=t.$$classes;n&&delete n[e]}}function Dp(t,e,n){Nu(n).onDone(()=>t.processLeaveNode(e))}function Tp(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Fp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new wp(t,e,n),this._timelineEngine=new cp(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Od(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e){return new op(t,e)}(i,e),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=zu(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=zu(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Lp(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Ip(e[0]),e.length>1&&(i=Ip(e[e.length-1]))):e&&(n=Ip(e)),n||i?new Mp(t,n,i):null}let Mp=(()=>{class t{constructor(e,n,i){this._element=e,this._startStyles=n,this._endStyles=i,this._state=0;let r=t.initialStylesByElement.get(e);r||t.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vd(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vd(this._element,this._initialStyles),this._endStyles&&(vd(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(yd(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(yd(this._element,this._endStyles),this._endStyles=null),vd(this._element,this._initialStyles),this._state=3)}}return t.initialStylesByElement=new WeakMap,t})();function Ip(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){!function(t,e){const n=zp(t,"").trim();n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Hp(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=zp(t,"").split(","),i=Vp(n,e);i>=0&&(n.splice(i,1),jp(t,"",n.join(",")))}(this._element,this._name))}}function Bp(t,e,n){jp(t,"PlayState",n,Up(t,e))}function Up(t,e){const n=zp(t,"");return n.indexOf(",")>0?Vp(n.split(","),e):Vp([n],e)}function Vp(t,e){for(let n=0;n=0)return n;return-1}function Hp(t,e,n){n?t.removeEventListener(Pp,e):t.addEventListener(Pp,e)}function jp(t,e,n,i){const r=Op+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function zp(t,e){return t.style[Op+e]||""}class Wp{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Np(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Td(this.element,n))})}this.currentSnapshot=t}}class Gp extends $u{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=ed(e)}init(){!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){this._startingStyles&&(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class qp{constructor(){this._count=0,this._head=document.querySelector("head")}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>ed(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=r+"}\n"}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof Wp),l={};kd(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"!=n&&"easing"!=n&&(e[n]=t[n])})}),e}(e=Ad(t,e,l));if(0==n)return new Gp(t,c);const h="gen_css_kf_"+this._count++,u=this.buildKeyframeElement(t,h,e);document.querySelector("head").appendChild(u);const d=Lp(t,e),p=new Wp(t,e,h,n,i,r,c,d);return p.onDestroy(()=>{var t;(t=u).parentNode.removeChild(t)}),p}}class Kp{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Td(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Xp{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Yp().toString()),this._cssKeyframesDriver=new qp}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof Kp);kd(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const h=Lp(t,e=Ad(t,e=e.map(t=>fd(t,!1)),l));return new Kp(t,e,a,h)}}function Yp(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}let Jp=(()=>{class t extends Au{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:Ct.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Fu(t):t;return tf(this._renderer,null,e,"register",[n]),new Qp(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Qp extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new Zp(this._id,t,e||{},this._renderer)}}class Zp{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return tf(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset")}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function tf(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const ef="@",nf="@.disabled";let rf=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new sf("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new of(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(Fp),bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class sf{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==ef&&e==nf?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class of extends sf{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==ef?"."==e.charAt(1)&&e==nf?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if(e.charAt(0)==ef){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return r.charAt(0)!=ef&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let af=(()=>{class t extends Fp{constructor(t,e,n){super(t.body,e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(id),bi(Zd))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lf=new Yn("AnimationModuleType"),cf=[{provide:Au,useClass:Jp},{provide:Zd,useFactory:function(){return new tp}},{provide:Fp,useClass:af},{provide:Wa,useFactory:function(t,e,n){return new rf(t,e,n)},deps:[du,Fp,Ic]}],hf=[{provide:id,useFactory:function(){return"function"==typeof Yp()?new Xp:new qp}},{provide:lf,useValue:"BrowserAnimations"},...cf],uf=[{provide:id,useClass:nd},{provide:lf,useValue:"NoopAnimations"},...cf];let df=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:hf,imports:[ku]}),t})(),pf=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:uf,imports:[ku]}),t})();function ff(...t){let e=t[t.length-1];return E(e)?(t.pop(),$(t,e)):z(t)}class gf extends C{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new w;return this._value}next(t){super.next(this._value=t)}}class mf extends f{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class vf extends f{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function yf(t,e,n,i,r=new vf(t,n,i)){if(!r.closed)return e instanceof y?e.subscribe(r):I(e)(r)}const bf={};class wf{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new xf(t,this.resultSelector))}}class xf extends mf{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(bf),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t})(),Cf=new y(t=>t.complete());function Sf(t){return t?function(t){return new y(e=>t.schedule(()=>e.complete()))}(t):Cf}function Ef(t){return new y(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?O(n):Sf()).subscribe(e)})}function kf(){return j(1)}function Af(t,e){return function(n){return n.lift(new Df(t,e))}}class Df{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Tf(t,this.predicate,this.thisArg))}}class Tf extends f{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}const Rf=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Ff(t){return function(e){return 0===t?Sf():e.lift(new Lf(t))}}class Lf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Mf(t,this.total))}}class Mf extends f{constructor(t,e){super(t),this.total=e,this.ring=new Array,this.count=0}_next(t){const e=this.ring,n=this.total,i=this.count++;e.length0){const n=this.count>=this.total?this.total:this.count,i=this.ring;for(let r=0;re.lift(new $f(t))}class $f{constructor(t){this.errorFactory=t}call(t,e){return e.subscribe(new Of(t,this.errorFactory))}}class Of extends f{constructor(t,e){super(t),this.errorFactory=e,this.hasValue=!1}_next(t){this.hasValue=!0,this.destination.next(t)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function Pf(){return new _f}function Nf(t=null){return e=>e.lift(new Bf(t))}class Bf{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new Uf(t,this.defaultValue))}}class Uf extends f{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Vf(t,e){return"function"==typeof e?n=>n.pipe(Vf((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))))):e=>e.lift(new Hf(t))}class Hf{constructor(t){this.project=t}call(t,e){return e.subscribe(new jf(t,this.project))}}class jf extends N{constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new P(this),i=this.destination;i.add(n),this.innerSubscription=B(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;t&&!t.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}function zf(t){return e=>0===t?Sf():e.lift(new Wf(t))}class Wf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Gf(t,this.total))}}class Gf extends f{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function qf(...t){return kf()(ff(...t))}class Kf{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new Xf(t,this.accumulator,this.seed,this.hasSeed))}}class Xf extends f{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}function Yf(t){return function(e){const n=new Jf(t),i=e.lift(n);return n.caught=i}}class Jf{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Qf(t,this.selector,this.caught))}}class Qf extends N{constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new P(this);this.add(i);const r=B(n,i);r!==i&&this.add(r)}}}function Zf(t,e){return U(t,e,1)}function tg(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,zf(1),n?Nf(e):If(()=>new _f))}function eg(){}function ng(t,e,n){return function(i){return i.lift(new ig(t,e,n))}}class ig{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new rg(t,this.nextOrObserver,this.error,this.complete))}}class rg extends f{constructor(t,e,n,r){super(t),this._tapNext=eg,this._tapError=eg,this._tapComplete=eg,this._tapError=n||eg,this._tapComplete=r||eg,i(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||eg,this._tapError=e.error||eg,this._tapComplete=e.complete||eg)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}class sg{constructor(t){this.callback=t}call(t,e){return e.subscribe(new og(t,this.callback))}}class og extends f{constructor(t,e){super(t),this.add(new u(e))}}class ag{constructor(t,e){this.id=t,this.url=e}}class lg extends ag{constructor(t,e,n="imperative",i=null){super(t,e),this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class cg extends ag{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class hg extends ag{constructor(t,e,n){super(t,e),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class ug extends ag{constructor(t,e,n){super(t,e),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class dg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fg extends ag{constructor(t,e,n,i,r){super(t,e),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class gg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class mg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class vg{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class yg{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class bg{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class wg{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class xg{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class _g{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Cg{constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Sg="primary";class Eg{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function kg(t){return new Eg(t)}function Ag(t){const e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function Dg(t,e,n){const i=n.path.split("/");if(i.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||i.lengthi[e]===t)}return t===e}function Fg(t){return Array.prototype.concat.apply([],t)}function Lg(t){return t.length>0?t[t.length-1]:null}function Mg(t,e){for(const n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Ig(t){return Uo(t)?t:Bo(t)?O(Promise.resolve(t)):ff(t)}function $g(t,e,n){return n?function(t,e){return Tg(t,e)}(t.queryParams,e.queryParams)&&Og(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>Rg(t[n],e[n]))}(t.queryParams,e.queryParams)&&Pg(t.root,e.root)}function Og(t,e){if(!Hg(t.segments,e.segments))return!1;if(t.numberOfChildren!==e.numberOfChildren)return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Og(t.children[n],e.children[n]))return!1}return!0}function Pg(t,e){return Ng(t,e,e.segments)}function Ng(t,e,n){if(t.segments.length>n.length)return!!Hg(t.segments.slice(0,n.length),n)&&!e.hasChildren();if(t.segments.length===n.length){if(!Hg(t.segments,n))return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Pg(t.children[n],e.children[n]))return!1}return!0}{const i=n.slice(0,t.segments.length),r=n.slice(t.segments.length);return!!Hg(t.segments,i)&&!!t.children.primary&&Ng(t.children.primary,e,r)}}class Bg{constructor(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return Gg.serialize(this)}}class Ug{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Mg(e,(t,e)=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return qg(this)}}class Vg{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=kg(this.parameters)),this._parameterMap}toString(){return tm(this)}}function Hg(t,e){return t.length===e.length&&t.every((t,n)=>t.path===e[n].path)}function jg(t,e){let n=[];return Mg(t.children,(t,i)=>{i===Sg&&(n=n.concat(e(t,i)))}),Mg(t.children,(t,i)=>{i!==Sg&&(n=n.concat(e(t,i)))}),n}class zg{}class Wg{parse(t){const e=new sm(t);return new Bg(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){return`${"/"+Kg(t.root,!0)}${function(t){const e=Object.keys(t).map(e=>{const n=t[e];return Array.isArray(n)?n.map(t=>`${Yg(e)}=${Yg(t)}`).join("&"):`${Yg(e)}=${Yg(n)}`});return e.length?"?"+e.join("&"):""}(t.queryParams)}${"string"==typeof t.fragment?"#"+encodeURI(t.fragment):""}`}}const Gg=new Wg;function qg(t){return t.segments.map(t=>tm(t)).join("/")}function Kg(t,e){if(!t.hasChildren())return qg(t);if(e){const e=t.children.primary?Kg(t.children.primary,!1):"",n=[];return Mg(t.children,(t,e)=>{e!==Sg&&n.push(`${e}:${Kg(t,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}{const e=jg(t,(e,n)=>n===Sg?[Kg(t.children.primary,!1)]:[`${n}:${Kg(e,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children.primary?`${qg(t)}/${e[0]}`:`${qg(t)}/(${e.join("//")})`}}function Xg(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Yg(t){return Xg(t).replace(/%3B/gi,";")}function Jg(t){return Xg(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Qg(t){return decodeURIComponent(t)}function Zg(t){return Qg(t.replace(/\+/g,"%20"))}function tm(t){return`${Jg(t.path)}${e=t.parameters,Object.keys(e).map(t=>`;${Jg(t)}=${Jg(e[t])}`).join("")}`;var e}const em=/^[^\/()?;=#]+/;function nm(t){const e=t.match(em);return e?e[0]:""}const im=/^[^=?&#]+/,rm=/^[^?&#]+/;class sm{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ug([],{}):new Ug([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n.primary=new Ug(t,e)),n}parseSegment(){const t=nm(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new Vg(Qg(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=nm(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=nm(this.remaining);t&&(n=t,this.capture(n))}t[Qg(e)]=Qg(n)}parseQueryParam(t){const e=function(t){const e=t.match(im);return e?e[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=function(t){const e=t.match(rm);return e?e[0]:""}(this.remaining);t&&(n=t,this.capture(n))}const i=Zg(e),r=Zg(n);if(t.hasOwnProperty(i)){let e=t[i];Array.isArray(e)||(e=[e],t[i]=e),e.push(r)}else t[i]=r}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=nm(this.remaining),i=this.remaining[n.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let r=void 0;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):t&&(r=Sg);const s=this.parseChildren();e[r]=1===Object.keys(s).length?s.primary:new Ug([],s),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class om{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=am(t,this._root);return e?e.children.map(t=>t.value):[]}firstChild(t){const e=am(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=lm(t,this._root);return e.length<2?[]:e[e.length-2].children.map(t=>t.value).filter(e=>e!==t)}pathFromRoot(t){return lm(t,this._root).map(t=>t.value)}}function am(t,e){if(t===e.value)return e;for(const n of e.children){const e=am(t,n);if(e)return e}return null}function lm(t,e){if(t===e.value)return[e];for(const n of e.children){const i=lm(t,n);if(i.length)return i.unshift(e),i}return[]}class cm{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function hm(t){const e={};return t&&t.children.forEach(t=>e[t.value.outlet]=t),e}class um extends om{constructor(t,e){super(t),this.snapshot=e,vm(this,t)}toString(){return this.snapshot.toString()}}function dm(t,e){const n=function(t,e){const n=new gm([],{},{},"",{},Sg,e,null,t.root,-1,{});return new mm("",new cm(n,[]))}(t,e),i=new gf([new Vg("",{})]),r=new gf({}),s=new gf({}),o=new gf({}),a=new gf(""),l=new pm(i,r,o,a,s,Sg,e,n.root);return l.snapshot=n.root,new um(new cm(l,[]),n)}class pm{constructor(t,e,n,i,r,s,o,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(k(t=>kg(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(k(t=>kg(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function fm(t,e="emptyOnly"){const n=t.pathFromRoot;let i=0;if("always"!==e)for(i=n.length-1;i>=1;){const t=n[i],e=n[i-1];if(t.routeConfig&&""===t.routeConfig.path)i--;else{if(e.component)break;i--}}return function(t){return t.reduce((t,e)=>({params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(i))}class gm{constructor(t,e,n,i,r,s,o,a,l,c,h){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this.routeConfig=a,this._urlSegment=l,this._lastPathIndex=c,this._resolve=h}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=kg(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(t=>t.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class mm extends om{constructor(t,e){super(e),this.url=t,vm(this,e)}toString(){return ym(this._root)}}function vm(t,e){e.value._routerState=t,e.children.forEach(e=>vm(t,e))}function ym(t){const e=t.children.length>0?` { ${t.children.map(ym).join(", ")} } `:"";return`${t.value}${e}`}function bm(t){if(t.snapshot){const e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Tg(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Tg(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(let n=0;nTg(t.parameters,i[e].parameters))&&!(!t.parent!=!e.parent)&&(!t.parent||wm(t.parent,e.parent))}function xm(t,e,n){if(n&&t.shouldReuseRoute(e.value,n.value.snapshot)){const i=n.value;i._futureSnapshot=e.value;const r=function(t,e,n){return e.children.map(e=>{for(const i of n.children)if(t.shouldReuseRoute(e.value,i.value.snapshot))return xm(t,e,i);return xm(t,e)})}(t,e,n);return new cm(i,r)}{const n=t.retrieve(e.value);if(n){const t=n.route;return _m(e,t),t}{const n=new pm(new gf((i=e.value).url),new gf(i.params),new gf(i.queryParams),new gf(i.fragment),new gf(i.data),i.outlet,i.component,i),r=e.children.map(e=>xm(t,e));return new cm(n,r)}}var i}function _m(t,e){if(t.value.routeConfig!==e.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==e.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");e.value._futureSnapshot=t.value;for(let n=0;n{s[e]=Array.isArray(t)?t.map(t=>""+t):""+t}),new Bg(n.root===t?e:km(n.root,t,e),s,r)}function km(t,e,n){const i={};return Mg(t.children,(t,r)=>{i[r]=t===e?n:km(t,e,n)}),new Ug(t.segments,i)}class Am{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Cm(n[0]))throw new Error("Root segment cannot have matrix parameters");const i=n.find(Sm);if(i&&i!==Lg(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Dm{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}function Tm(t,e,n){if(t||(t=new Ug([],{})),0===t.segments.length&&t.hasChildren())return Rm(t,e,n);const i=function(t,e,n){let i=0,r=e;const s={match:!1,pathIndex:0,commandIndex:0};for(;r=n.length)return s;const e=t.segments[r],o=n[i];if(Sm(o))break;const a=""+o,l=i0&&void 0===a)break;if(a&&l&&"object"==typeof l&&void 0===l.outlets){if(!Im(a,l,e))return s;i+=2}else{if(!Im(a,{},e))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(t,e,n),r=n.slice(i.commandIndex);if(i.match&&i.pathIndex{"string"==typeof n&&(n=[n]),null!==n&&(r[i]=Tm(t.children[i],e,n))}),Mg(t.children,(t,e)=>{void 0===i[e]&&(r[e]=t)}),new Ug(t.segments,r)}}function Fm(t,e,n){const i=t.segments.slice(0,e);let r=0;for(;r{"string"==typeof t&&(t=[t]),null!==t&&(e[n]=Fm(new Ug([],{}),0,t))}),e}function Mm(t){const e={};return Mg(t,(t,n)=>e[n]=""+t),e}function Im(t,e,n){return t==n.path&&Tg(e,n.parameters)}class $m{constructor(t,e,n,i){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=i}activate(t){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),bm(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{const e=t.value.outlet;this.deactivateRoutes(t,i[e],n),delete i[e]}),Mg(i,(t,e)=>{this.deactivateRouteAndItsChildren(t,n)})}deactivateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(i===r)if(i.component){const r=n.getContext(i.outlet);r&&this.deactivateChildRoutes(t,e,r.children)}else this.deactivateChildRoutes(t,e,n);else r&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const n=e.getContext(t.value.outlet);if(n&&n.outlet){const e=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:e,route:t,contexts:i})}}deactivateRouteAndOutlet(t,e){const n=e.getContext(t.value.outlet);if(n){const i=hm(t),r=t.value.component?n.children:e;Mg(i,(t,e)=>this.deactivateRouteAndItsChildren(t,r)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{this.activateRoutes(t,i[t.value.outlet],n),this.forwardEvent(new _g(t.value.snapshot))}),t.children.length&&this.forwardEvent(new wg(t.value.snapshot))}activateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(bm(i),i===r)if(i.component){const r=n.getOrCreateContext(i.outlet);this.activateChildRoutes(t,e,r.children)}else this.activateChildRoutes(t,e,n);else if(i.component){const e=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const t=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),e.children.onOutletReAttached(t.contexts),e.attachRef=t.componentRef,e.route=t.route.value,e.outlet&&e.outlet.attach(t.componentRef,t.route.value),Om(t.route)}else{const n=function(t){for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(i.snapshot),r=n?n.module.componentFactoryResolver:null;e.attachRef=null,e.route=i,e.resolver=r,e.outlet&&e.outlet.activateWith(i,r),this.activateChildRoutes(t,null,e.children)}}else this.activateChildRoutes(t,null,n)}}function Om(t){bm(t.value),t.children.forEach(Om)}class Pm{constructor(t,e){this.routes=t,this.module=e}}function Nm(t){return"function"==typeof t}function Bm(t){return t instanceof Bg}const Um=Symbol("INITIAL_VALUE");function Vm(){return Vf(t=>function(...t){let e=void 0,n=void 0;return E(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&l(t[0])&&(t=t[0]),z(t,n).lift(new wf(e))}(...t.map(t=>t.pipe(zf(1),function(...t){const e=t[t.length-1];return E(e)?(t.pop(),n=>qf(t,n,e)):e=>qf(t,e)}(Um)))).pipe(function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new Kf(t,e,n))}}((t,e)=>{let n=!1;return e.reduce((t,i,r)=>{if(t!==Um)return t;if(i===Um&&(n=!0),!n){if(!1===i)return i;if(r===e.length-1||Bm(i))return i}return t},t)},Um),Af(t=>t!==Um),k(t=>Bm(t)?t:!0===t),zf(1)))}let Hm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:function(){return[Ov]},encapsulation:2}),t})();function jm(t,e=""){for(let n=0;ne.error(new Km(t)))}function Jm(t){return new y(e=>e.error(new Xm(t)))}function Qm(t){return new y(e=>e.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Zm{constructor(t,e,n,i,r){this.configLoader=e,this.urlSerializer=n,this.urlTree=i,this.config=r,this.allowRedirects=!0,this.ngModule=t.get(_l)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Sg).pipe(k(t=>this.createUrlTree(t,this.urlTree.queryParams,this.urlTree.fragment))).pipe(Yf(t=>{if(t instanceof Xm)return this.allowRedirects=!1,this.match(t.urlTree);if(t instanceof Km)throw this.noMatchError(t);throw t}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,Sg).pipe(k(e=>this.createUrlTree(e,t.queryParams,t.fragment))).pipe(Yf(t=>{if(t instanceof Km)throw this.noMatchError(t);throw t}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,n){const i=t.segments.length>0?new Ug([],{[Sg]:t}):t;return new Bg(i,e,n)}expandSegmentGroup(t,e,n,i){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(k(t=>new Ug([],t))):this.expandSegment(t,n,e,n.segments,i,!0)}expandChildren(t,e,n){return function(t,e){if(0===Object.keys(t).length)return ff({});const n=[],i=[],r={};return Mg(t,(t,s)=>{const o=e(s,t).pipe(k(t=>r[s]=t));s===Sg?n.push(o):i.push(o)}),ff.apply(null,n.concat(i)).pipe(kf(),function(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,Ff(1),n?Nf(e):If(()=>new _f))}(),k(()=>r))}(n.children,(n,i)=>this.expandSegmentGroup(t,e,i,n))}expandSegment(t,e,n,i,r,s){const o=function(t){return t.reduce((t,e)=>{const n=qm(e);return t.has(n)?t.get(n).push(e):t.set(n,[e]),t},new Map)}(n);o.has(r)||o.set(r,[]);const a=n=>O(n).pipe(Zf(o=>this.expandSegmentAgainstRoute(t,e,n,o,i,r,s).pipe(Yf(t=>{if(t instanceof Km)return ff(null);throw t}))),tg(t=>null!==t),Yf(t=>{if(t instanceof _f||"EmptyError"===t.name){if(this.noLeftoversInUrl(e,i,r))return ff(new Ug([],{}));throw new Km(e)}throw t}));return O(Array.from(o.entries()).map(([t,e])=>{const n=a(e);return t===r?n:n.pipe(k(()=>null),Yf(()=>ff(null)))})).pipe(t=>t.lift(new wf(void 0)),tg(),k(t=>t.find(t=>null!==t)))}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}expandSegmentAgainstRoute(t,e,n,i,r,s,o){return qm(i)!==s&&""!==i.path?Ym(e):void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,e,i,r):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s):Ym(e)}expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,i,s):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,n,i){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Jm(r):this.lineralizeSegments(n,r).pipe(U(n=>{const r=new Ug(n,{});return this.expandSegment(t,r,e,n,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){const{matched:o,consumedSegments:a,lastChild:l,positionalParamSegments:c}=tv(e,i,r);if(!o)return Ym(e);const h=this.applyRedirectCommands(a,i.redirectTo,c);return i.redirectTo.startsWith("/")?Jm(h):this.lineralizeSegments(i,h).pipe(U(i=>this.expandSegment(t,e,n,i.concat(r.slice(l)),s,!1)))}matchSegmentAgainstRoute(t,e,n,i){if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(k(t=>(n._loadedConfig=t,new Ug(i,{})))):ff(new Ug(i,{}));const{matched:r,consumedSegments:s,lastChild:o}=tv(e,n,i);if(!r)return Ym(e);const a=i.slice(o);return this.getChildConfig(t,n,i).pipe(U(t=>{const n=t.module,i=t.routes,{segmentGroup:r,slicedSegments:o}=function(t,e,n,i){return n.length>0&&function(t,e,n){return n.some(n=>nv(t,e,n)&&qm(n)!==Sg)}(t,n,i)?{segmentGroup:ev(new Ug(e,function(t,e){const n={};n.primary=e;for(const i of t)""===i.path&&qm(i)!==Sg&&(n[qm(i)]=new Ug([],{}));return n}(i,new Ug(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some(n=>nv(t,e,n))}(t,n,i)?{segmentGroup:ev(new Ug(t.segments,function(t,e,n,i){const r={};for(const s of n)nv(t,e,s)&&!i[qm(s)]&&(r[qm(s)]=new Ug([],{}));return Object.assign(Object.assign({},i),r)}(t,n,i,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,s,a,i);return 0===o.length&&r.hasChildren()?this.expandChildren(n,i,r).pipe(k(t=>new Ug(s,t))):0===i.length&&0===o.length?ff(new Ug(s,{})):this.expandSegment(n,r,i,o,Sg,!0).pipe(k(t=>new Ug(s.concat(t.segments),t.children)))}))}getChildConfig(t,e,n){return e.children?ff(new Pm(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?ff(e._loadedConfig):this.runCanLoadGuards(t.injector,e,n).pipe(U(n=>n?this.configLoader.load(t.injector,e).pipe(k(t=>(e._loadedConfig=t,t))):function(t){return new y(e=>e.error(Ag(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):ff(new Pm([],t))}runCanLoadGuards(t,e,n){const i=e.canLoad;return i&&0!==i.length?ff(i.map(i=>{const r=t.get(i);let s;if(function(t){return t&&Nm(t.canLoad)}(r))s=r.canLoad(e,n);else{if(!Nm(r))throw new Error("Invalid CanLoad guard");s=r(e,n)}return Ig(s)})).pipe(Vm(),ng(t=>{if(!Bm(t))return;const e=Ag(`Redirecting to "${this.urlSerializer.serialize(t)}"`);throw e.url=t,e}),k(t=>!0===t)):ff(!0)}lineralizeSegments(t,e){let n=[],i=e.root;for(;;){if(n=n.concat(i.segments),0===i.numberOfChildren)return ff(n);if(i.numberOfChildren>1||!i.children.primary)return Qm(t.redirectTo);i=i.children.primary}}applyRedirectCommands(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)}applyRedirectCreatreUrlTree(t,e,n,i){const r=this.createSegmentGroup(t,e.root,n,i);return new Bg(r,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const n={};return Mg(t,(t,i)=>{if("string"==typeof t&&t.startsWith(":")){const r=t.substring(1);n[i]=e[r]}else n[i]=t}),n}createSegmentGroup(t,e,n,i){const r=this.createSegments(t,e.segments,n,i);let s={};return Mg(e.children,(e,r)=>{s[r]=this.createSegmentGroup(t,e,n,i)}),new Ug(r,s)}createSegments(t,e,n,i){return e.map(e=>e.path.startsWith(":")?this.findPosParam(t,e,i):this.findOrReturn(e,n))}findPosParam(t,e,n){const i=n[e.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return i}findOrReturn(t,e){let n=0;for(const i of e){if(i.path===t.path)return e.splice(n),i;n++}return t}}function tv(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:{}};const i=(e.matcher||Dg)(n,t,e);return i?{matched:!0,consumedSegments:i.consumed,lastChild:i.consumed.length,positionalParamSegments:i.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function ev(t){if(1===t.numberOfChildren&&t.children.primary){const e=t.children.primary;return new Ug(t.segments.concat(e.segments),e.children)}return t}function nv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}class iv{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class rv{constructor(t,e){this.component=t,this.route=e}}function sv(t,e,n){const i=t._root;return av(i,e?e._root:null,n,[i.value])}function ov(t,e,n){const i=function(t){if(!t)return null;for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(i?i.module.injector:n).get(t)}function av(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=hm(e);return t.children.forEach(t=>{!function(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=t.value,o=e?e.value:null,a=n?n.getContext(t.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){const l=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!Hg(t.url,e.url);case"pathParamsOrQueryParamsChange":return!Hg(t.url,e.url)||!Tg(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!wm(t,e)||!Tg(t.queryParams,e.queryParams);case"paramsChange":default:return!wm(t,e)}}(o,s,s.routeConfig.runGuardsAndResolvers);l?r.canActivateChecks.push(new iv(i)):(s.data=o.data,s._resolvedData=o._resolvedData),av(t,e,s.component?a?a.children:null:n,i,r),l&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new rv(a.outlet.component,o))}else o&&lv(e,a,r),r.canActivateChecks.push(new iv(i)),av(t,null,s.component?a?a.children:null:n,i,r)}(t,s[t.value.outlet],n,i.concat([t.value]),r),delete s[t.value.outlet]}),Mg(s,(t,e)=>lv(t,n.getContext(e),r)),r}function lv(t,e,n){const i=hm(t),r=t.value;Mg(i,(t,i)=>{lv(t,r.component?e?e.children.getContext(i):null:e,n)}),n.canDeactivateChecks.push(new rv(r.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,r))}function cv(t,e){return null!==t&&e&&e(new xg(t)),ff(!0)}function hv(t,e){return null!==t&&e&&e(new bg(t)),ff(!0)}function uv(t,e,n){const i=e.routeConfig?e.routeConfig.canActivate:null;return i&&0!==i.length?ff(i.map(i=>Ef(()=>{const r=ov(i,e,n);let s;if(function(t){return t&&Nm(t.canActivate)}(r))s=Ig(r.canActivate(e,t));else{if(!Nm(r))throw new Error("Invalid CanActivate guard");s=Ig(r(e,t))}return s.pipe(tg())}))).pipe(Vm()):ff(!0)}function dv(t,e,n){const i=e[e.length-1],r=e.slice(0,e.length-1).reverse().map(t=>function(t){const e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)).filter(t=>null!==t).map(e=>Ef(()=>ff(e.guards.map(r=>{const s=ov(r,e.node,n);let o;if(function(t){return t&&Nm(t.canActivateChild)}(s))o=Ig(s.canActivateChild(i,t));else{if(!Nm(s))throw new Error("Invalid CanActivateChild guard");o=Ig(s(i,t))}return o.pipe(tg())})).pipe(Vm())));return ff(r).pipe(Vm())}class pv{}class fv{constructor(t,e,n,i,r,s){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=i,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=s}recognize(){try{const t=vv(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,Sg),n=new gm([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Sg,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new cm(n,e),r=new mm(this.url,i);return this.inheritParamsAndData(r._root),ff(r)}catch(t){return new y(e=>e.error(t))}}inheritParamsAndData(t){const e=t.value,n=fm(e,this.paramsInheritanceStrategy);e.params=Object.freeze(n.params),e.data=Object.freeze(n.data),t.children.forEach(t=>this.inheritParamsAndData(t))}processSegmentGroup(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)}processChildren(t,e){const n=jg(e,(e,n)=>this.processSegmentGroup(t,e,n));return function(t){const e={};t.forEach(t=>{const n=e[t.value.outlet];if(n){const e=n.url.map(t=>t.toString()).join("/"),i=t.value.url.map(t=>t.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${e}' and '${i}'.`)}e[t.value.outlet]=t.value})}(n),n.sort((t,e)=>t.value.outlet===Sg?-1:e.value.outlet===Sg?1:t.value.outlet.localeCompare(e.value.outlet)),n}processSegment(t,e,n,i){for(const s of t)try{return this.processSegmentAgainstRoute(s,e,n,i)}catch(r){if(!(r instanceof pv))throw r}if(this.noLeftoversInUrl(e,n,i))return[];throw new pv}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}processSegmentAgainstRoute(t,e,n,i){if(t.redirectTo)throw new pv;if((t.outlet||Sg)!==i)throw new pv;let r,s=[],o=[];if("**"===t.path){const s=n.length>0?Lg(n).parameters:{};r=new gm(n,s,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+n.length,wv(t))}else{const a=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new pv;return{consumedSegments:[],lastChild:0,parameters:{}}}const i=(e.matcher||Dg)(n,t,e);if(!i)throw new pv;const r={};Mg(i.posParams,(t,e)=>{r[e]=t.path});const s=i.consumed.length>0?Object.assign(Object.assign({},r),i.consumed[i.consumed.length-1].parameters):r;return{consumedSegments:i.consumed,lastChild:i.consumed.length,parameters:s}}(e,t,n);s=a.consumedSegments,o=n.slice(a.lastChild),r=new gm(s,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+s.length,wv(t))}const a=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),{segmentGroup:l,slicedSegments:c}=vv(e,s,o,a,this.relativeLinkResolution);if(0===c.length&&l.hasChildren()){const t=this.processChildren(a,l);return[new cm(r,t)]}if(0===a.length&&0===c.length)return[new cm(r,[])];const h=this.processSegment(a,l,c,Sg);return[new cm(r,h)]}}function gv(t){let e=t;for(;e._sourceSegment;)e=e._sourceSegment;return e}function mv(t){let e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,n+=e._segmentIndexShift?e._segmentIndexShift:0;return n-1}function vv(t,e,n,i,r){if(n.length>0&&function(t,e,n){return n.some(n=>yv(t,e,n)&&qm(n)!==Sg)}(t,n,i)){const r=new Ug(e,function(t,e,n,i){const r={};r.primary=i,i._sourceSegment=t,i._segmentIndexShift=e.length;for(const s of n)if(""===s.path&&qm(s)!==Sg){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift=e.length,r[qm(s)]=n}return r}(t,e,i,new Ug(n,t.children)));return r._sourceSegment=t,r._segmentIndexShift=e.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some(n=>yv(t,e,n))}(t,n,i)){const s=new Ug(t.segments,function(t,e,n,i,r,s){const o={};for(const a of i)if(yv(t,n,a)&&!r[qm(a)]){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift="legacy"===s?t.segments.length:e.length,o[qm(a)]=n}return Object.assign(Object.assign({},r),o)}(t,e,n,i,t.children,r));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}const s=new Ug(t.segments,t.children);return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}function yv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function bv(t){return t.data||{}}function wv(t){return t.resolve||{}}function xv(t){return function(e){return e.pipe(Vf(e=>{const n=t(e);return n?O(n).pipe(k(()=>e)):O([e])}))}}class _v extends class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}{}const Cv=new Yn("ROUTES");class Sv{constructor(t,e,n,i){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=i}load(t,e){return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(k(n=>{this.onLoadEndListener&&this.onLoadEndListener(e);const i=n.create(t);return new Pm(Fg(i.injector.get(Cv)).map(Gm),i)}))}loadModuleFactory(t){return"string"==typeof t?O(this.loader.load(t)):Ig(t()).pipe(U(t=>t instanceof Cl?ff(t):O(this.compiler.compileModuleAsync(t))))}}class Ev{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new kv,this.attachRef=null}}class kv{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new Ev,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}class Av{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function Dv(t){throw t}function Tv(t,e,n){return e.parse("/")}function Rv(t,e){return ff(null)}let Fv=(()=>{class t{constructor(t,e,n,i,r,s,o,a){this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=i,this.config=a,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new C,this.errorHandler=Dv,this.malformedUriErrorHandler=Tv,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Rv,afterPreactivation:Rv},this.urlHandlingStrategy=new Av,this.routeReuseStrategy=new _v,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.ngModule=r.get(_l),this.console=r.get(xc);const l=r.get(Ic);this.isNgZoneEnabled=l instanceof Ic,this.resetConfig(a),this.currentUrlTree=new Bg(new Ug([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Sv(s,o,t=>this.triggerEvent(new vg(t)),t=>this.triggerEvent(new yg(t))),this.routerState=dm(this.currentUrlTree,this.rootComponentType),this.transitions=new gf({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()}setupNavigations(t){const e=this.events;return t.pipe(Af(t=>0!==t.id),k(t=>Object.assign(Object.assign({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl)})),Vf(t=>{let n=!1,i=!1;return ff(t).pipe(ng(t=>{this.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Vf(t=>{const n=!this.navigated||t.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return ff(t).pipe(Vf(t=>{const n=this.transitions.getValue();return e.next(new lg(t.id,this.serializeUrl(t.extractedUrl),t.source,t.restoredState)),n!==this.transitions.getValue()?Cf:[t]}),Vf(t=>Promise.resolve(t)),(i=this.ngModule.injector,r=this.configLoader,s=this.urlSerializer,o=this.config,function(t){return t.pipe(Vf(t=>function(t,e,n,i,r){return new Zm(t,e,n,i,r).apply()}(i,r,s,t.extractedUrl,o).pipe(k(e=>Object.assign(Object.assign({},t),{urlAfterRedirects:e})))))}),ng(t=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:t.urlAfterRedirects})}),function(t,e,n,i,r){return function(s){return s.pipe(U(s=>function(t,e,n,i,r="emptyOnly",s="legacy"){return new fv(t,e,n,i,r,s).recognize()}(t,e,s.urlAfterRedirects,n(s.urlAfterRedirects),i,r).pipe(k(t=>Object.assign(Object.assign({},s),{targetSnapshot:t})))))}}(this.rootComponentType,this.config,t=>this.serializeUrl(t),this.paramsInheritanceStrategy,this.relativeLinkResolution),ng(t=>{"eager"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),ng(t=>{const n=new dg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.next(n)}));var i,r,s,o;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:i,source:r,restoredState:s,extras:o}=t,a=new lg(n,this.serializeUrl(i),r,s);e.next(a);const l=dm(i,this.rootComponentType).snapshot;return ff(Object.assign(Object.assign({},t),{targetSnapshot:l,urlAfterRedirects:i,extras:Object.assign(Object.assign({},o),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=t.rawUrl,this.browserUrlTree=t.urlAfterRedirects,t.resolve(null),Cf}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.beforePreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),ng(t=>{const e=new pg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),k(t=>Object.assign(Object.assign({},t),{guards:sv(t.targetSnapshot,t.currentSnapshot,this.rootContexts)})),function(t,e){return function(n){return n.pipe(U(n=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:o}}=n;return 0===o.length&&0===s.length?ff(Object.assign(Object.assign({},n),{guardsResult:!0})):function(t,e,n,i){return O(t).pipe(U(t=>function(t,e,n,i,r){const s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return s&&0!==s.length?ff(s.map(s=>{const o=ov(s,e,r);let a;if(function(t){return t&&Nm(t.canDeactivate)}(o))a=Ig(o.canDeactivate(t,e,n,i));else{if(!Nm(o))throw new Error("Invalid CanDeactivate guard");a=Ig(o(t,e,n,i))}return a.pipe(tg())})).pipe(Vm()):ff(!0)}(t.component,t.route,n,e,i)),tg(t=>!0!==t,!0))}(o,i,r,t).pipe(U(n=>n&&"boolean"==typeof n?function(t,e,n,i){return O(e).pipe(Zf(e=>O([hv(e.route.parent,i),cv(e.route,i),dv(t,e.path,n),uv(t,e.route,n)]).pipe(kf(),tg(t=>!0!==t,!0))),tg(t=>!0!==t,!0))}(i,s,t,e):ff(n)),k(t=>Object.assign(Object.assign({},n),{guardsResult:t})))}))}}(this.ngModule.injector,t=>this.triggerEvent(t)),ng(t=>{if(Bm(t.guardsResult)){const e=Ag(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);throw e.url=t.guardsResult,e}}),ng(t=>{const e=new fg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);this.triggerEvent(e)}),Af(t=>{if(!t.guardsResult){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"");return e.next(n),t.resolve(!1),!1}return!0}),xv(t=>{if(t.guards.canActivateChecks.length)return ff(t).pipe(ng(t=>{const e=new gg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),Vf(t=>{let n=!1;return ff(t).pipe((i=this.paramsInheritanceStrategy,r=this.ngModule.injector,function(t){return t.pipe(U(t=>{const{targetSnapshot:e,guards:{canActivateChecks:n}}=t;if(!n.length)return ff(t);let s=0;return O(n).pipe(Zf(t=>function(t,e,n,i){return function(t,e,n,i){const r=Object.keys(t);if(0===r.length)return ff({});const s={};return O(r).pipe(U(r=>function(t,e,n,i){const r=ov(t,e,i);return Ig(r.resolve?r.resolve(e,n):r(e,n))}(t[r],e,n,i).pipe(ng(t=>{s[r]=t}))),Ff(1),U(()=>Object.keys(s).length===r.length?ff(s):Cf))}(t._resolve,t,e,i).pipe(k(e=>(t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),fm(t,n).resolve),null)))}(t.route,e,i,r)),ng(()=>s++),Ff(1),U(e=>s===n.length?ff(t):Cf))}))}),ng({next:()=>n=!0,complete:()=>{if(!n){const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");e.next(n),t.resolve(!1)}}}));var i,r}),ng(t=>{const e=new mg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}))}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.afterPreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),k(t=>{const e=function(t,e,n){const i=xm(t,e._root,n?n._root:void 0);return new um(i,e)}(this.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:e})}),ng(t=>{this.currentUrlTree=t.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl),this.routerState=t.targetRouterState,"deferred"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),(s=this.rootContexts,o=this.routeReuseStrategy,a=t=>this.triggerEvent(t),k(t=>(new $m(o,t.targetRouterState,t.currentRouterState,a).activate(s),t))),ng({next(){n=!0},complete(){n=!0}}),(r=()=>{if(!n&&!i){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),`Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);e.next(n),t.resolve(!1)}this.currentNavigation=null},t=>t.lift(new sg(r))),Yf(n=>{if(i=!0,(r=n)&&r.ngNavigationCancelingError){const i=Bm(n.url);i||(this.navigated=!0,this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));const r=new hg(t.id,this.serializeUrl(t.extractedUrl),n.message);e.next(r),i?setTimeout(()=>{const e=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);return this.scheduleNavigation(e,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})},0):t.resolve(!1)}else{this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);const i=new ug(t.id,this.serializeUrl(t.extractedUrl),n);e.next(i);try{t.resolve(this.errorHandler(n))}catch(s){t.reject(s)}}var r;return Cf}));var r,s,o,a}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}getTransition(){const t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const e=this.extractLocationChangeInfoFromEvent(t);this.shouldScheduleNavigation(this.lastLocationChangeInfo,e)&&setTimeout(()=>{const{source:t,state:n,urlTree:i}=e,r={replaceUrl:!0};if(n){const t=Object.assign({},n);delete t.navigationId,0!==Object.keys(t).length&&(r.state=t)}this.scheduleNavigation(i,t,n,r)},0),this.lastLocationChangeInfo=e}))}extractLocationChangeInfoFromEvent(t){var e;return{source:"popstate"===t.type?"popstate":"hashchange",urlTree:this.parseUrl(t.url),state:(null===(e=t.state)||void 0===e?void 0:e.navigationId)?t.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(t,e){if(!t)return!0;const n=e.urlTree.toString()===t.urlTree.toString();return!(e.transitionId===t.transitionId&&n&&("hashchange"===e.source&&"popstate"===t.source||"popstate"===e.source&&"hashchange"===t.source))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){jm(t),this.config=t.map(Gm),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)}createUrlTree(t,e={}){const{relativeTo:n,queryParams:i,fragment:r,queryParamsHandling:s,preserveFragment:o}=e,a=n||this.routerState.root,l=o?this.currentUrlTree.fragment:r;let c=null;switch(s){case"merge":c=Object.assign(Object.assign({},this.currentUrlTree.queryParams),i);break;case"preserve":c=this.currentUrlTree.queryParams;break;default:c=i||null}return null!==c&&(c=this.removeEmptyProps(c)),function(t,e,n,i,r){if(0===n.length)return Em(e.root,e.root,e,i,r);const s=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Am(!0,0,t);let e=0,n=!1;const i=t.reduce((t,i,r)=>{if("object"==typeof i&&null!=i){if(i.outlets){const e={};return Mg(i.outlets,(t,n)=>{e[n]="string"==typeof t?t.split("/"):t}),[...t,{outlets:e}]}if(i.segmentPath)return[...t,i.segmentPath]}return"string"!=typeof i?[...t,i]:0===r?(i.split("/").forEach((i,r)=>{0==r&&"."===i||(0==r&&""===i?n=!0:".."===i?e++:""!=i&&t.push(i))}),t):[...t,i]},[]);return new Am(n,e,i)}(n);if(s.toRoot())return Em(e.root,new Ug([],{}),e,i,r);const o=function(t,e,n){if(t.isAbsolute)return new Dm(e.root,!0,0);if(-1===n.snapshot._lastPathIndex){const t=n.snapshot._urlSegment;return new Dm(t,t===e.root,0)}const i=Cm(t.commands[0])?0:1;return function(t,e,n){let i=t,r=e,s=n;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new Dm(i,!1,r-s)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(s,e,t),a=o.processChildren?Rm(o.segmentGroup,o.index,s.commands):Tm(o.segmentGroup,o.index,s.commands);return Em(o.segmentGroup,a,e,i,r)}(a,this.currentUrlTree,t,c,l)}navigateByUrl(t,e={skipLocationChange:!1}){const n=Bm(t)?t:this.parseUrl(t),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,e)}navigate(t,e={skipLocationChange:!1}){return function(t){for(let e=0;e{const i=t[n];return null!=i&&(e[n]=i),e},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.events.next(new cg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,t.resolve(!0)},t=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(t,e,n,i,r){const s=this.getTransition(),o="imperative"!==e&&"imperative"===(null==s?void 0:s.source),a=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===t.toString();if(o&&a)return Promise.resolve(!0);let l,c,h;r?(l=r.resolve,c=r.reject,h=r.promise):h=new Promise((t,e)=>{l=t,c=e});const u=++this.navigationId;return this.setTransition({id:u,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:i,resolve:l,reject:c,promise:h,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),h.catch(t=>Promise.reject(t))}setBrowserUrl(t,e,n,i){const r=this.urlSerializer.serialize(t);i=i||{},this.location.isCurrentPathEqualTo(r)||e?this.location.replaceState(r,"",Object.assign(Object.assign({},i),{navigationId:n})):this.location.go(r,"",Object.assign(Object.assign({},i),{navigationId:n}))}resetStateAndUrl(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qn),bi(zg),bi(kv),bi(Dh),bi(ho),bi(ih),bi(Fc),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Lv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.route=e,this.commands=[],this.onChanges=new C,null==n&&i.setAttribute(r.nativeElement,"tabindex","0")}ngOnChanges(t){this.onChanges.next(this)}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}onClick(){const t={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,t),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),qn("tabindex"),Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})(),Mv=(()=>{class t{constructor(t,e,n){this.router=t,this.route=e,this.locationStrategy=n,this.commands=[],this.onChanges=new C,this.subscription=t.events.subscribe(t=>{t instanceof cg&&this.updateTargetUrlAndHref()})}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}ngOnChanges(t){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(t,e,n,i,r){if(0!==t||e||n||i||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const s={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,s),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),Ro(Ch))},t.\u0275dir=Wt({type:t,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.onClick(t.button,t.ctrlKey,t.shiftKey,t.altKey,t.metaKey)}),2&t&&(xa("href",e.href,nr),ko("target",e.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})();function Iv(t){return""===t||!!t}let $v=(()=>{class t{constructor(t,e,n,i,r,s){this.router=t,this.element=e,this.renderer=n,this.cdr=i,this.link=r,this.linkWithHref=s,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=t.events.subscribe(t=>{t instanceof cg&&this.update()})}ngAfterContentInit(){O([this.links.changes,this.linksWithHrefs.changes,ff(null)]).pipe(j()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var t;null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe();const e=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(t=>!!t).map(t=>t.onChanges);this.linkInputChangesSubscription=O(e).pipe(j()).subscribe(t=>{this.isActive!==this.isLinkActive(this.router)(t)&&this.update()})}set routerLinkActive(t){const e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(t=>!!t)}ngOnChanges(t){this.update()}ngOnDestroy(){var t;this.routerEventsSubscription.unsubscribe(),null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const t=this.hasActiveLinks();this.isActive!==t&&(this.isActive=t,this.cdr.markForCheck(),this.classes.forEach(e=>{t?this.renderer.addClass(this.element.nativeElement,e):this.renderer.removeClass(this.element.nativeElement,e)}))})}isLinkActive(t){return e=>t.isActive(e.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.linkWithHref&&t(this.linkWithHref)||this.links.some(t)||this.linksWithHrefs.some(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(za),Ro(Ga),Ro(pl),Ro(Lv,8),Ro(Mv,8))},t.\u0275dir=Wt({type:t,selectors:[["","routerLinkActive",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Lv,!0),ac(n,Mv,!0)),2&t){let t;ic(t=lc())&&(e.links=t),ic(t=lc())&&(e.linksWithHrefs=t)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[le]}),t})(),Ov=(()=>{class t{constructor(t,e,n,i,r){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=r,this.activated=null,this._activatedRoute=null,this.activateEvents=new Wl,this.deactivateEvents=new Wl,this.name=i||Sg,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),i=this.parentContexts.getOrCreateContext(this.name).children,r=new Pv(t,i,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return t.\u0275fac=function(e){return new(e||t)(Ro(kv),Ro(El),Ro(Ua),qn("name"),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class Pv{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===pm?this.route:t===kv?this.childContexts:this.parent.get(t,e)}}class Nv{}class Bv{preload(t,e){return ff(null)}}let Uv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.injector=i,this.preloadingStrategy=r,this.loader=new Sv(e,n,e=>t.triggerEvent(new vg(e)),e=>t.triggerEvent(new yg(e)))}setUpPreloading(){this.subscription=this.router.events.pipe(Af(t=>t instanceof cg),Zf(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(_l);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,e){const n=[];for(const i of e)if(i.loadChildren&&!i.canLoad&&i._loadedConfig){const t=i._loadedConfig;n.push(this.processRoutes(t.module,t.routes))}else i.loadChildren&&!i.canLoad?n.push(this.preloadConfig(t,i)):i.children&&n.push(this.processRoutes(t,i.children));return O(n).pipe(j(),k(t=>{}))}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>this.loader.load(t.injector,e).pipe(U(t=>(e._loadedConfig=t,this.processRoutes(t.module,t.routes)))))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(ih),bi(Fc),bi(ho),bi(Nv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Vv=(()=>{class t{constructor(t,e,n={}){this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof lg?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof cg&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Cg&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.router.triggerEvent(new Cg(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(Kh),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Hv=new Yn("ROUTER_CONFIGURATION"),jv=new Yn("ROUTER_FORROOT_GUARD"),zv=[Dh,{provide:zg,useClass:Wg},{provide:Fv,useFactory:function(t,e,n,i,r,s,o,a={},l,c){const h=new Fv(null,t,e,n,i,r,s,Fg(o));if(l&&(h.urlHandlingStrategy=l),c&&(h.routeReuseStrategy=c),function(t,e){t.errorHandler&&(e.errorHandler=t.errorHandler),t.malformedUriErrorHandler&&(e.malformedUriErrorHandler=t.malformedUriErrorHandler),t.onSameUrlNavigation&&(e.onSameUrlNavigation=t.onSameUrlNavigation),t.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=t.paramsInheritanceStrategy),t.relativeLinkResolution&&(e.relativeLinkResolution=t.relativeLinkResolution),t.urlUpdateStrategy&&(e.urlUpdateStrategy=t.urlUpdateStrategy)}(a,h),a.enableTracing){const t=dh();h.events.subscribe(e=>{t.logGroup("Router Event: "+e.constructor.name),t.log(e.toString()),t.log(e),t.logGroupEnd()})}return h},deps:[zg,kv,Dh,ho,ih,Fc,Cv,Hv,[class{},new li],[class{},new li]]},kv,{provide:pm,useFactory:function(t){return t.routerState.root},deps:[Fv]},{provide:ih,useClass:oh},Uv,Bv,class{preload(t,e){return e().pipe(Yf(()=>ff(null)))}},{provide:Hv,useValue:{enableTracing:!1}}];function Wv(){return new Yc("Router",Fv)}let Gv=(()=>{class t{constructor(t,e){}static forRoot(e,n){return{ngModule:t,providers:[zv,Yv(e),{provide:jv,useFactory:Xv,deps:[[Fv,new li,new hi]]},{provide:Hv,useValue:n||{}},{provide:Ch,useFactory:Kv,deps:[fh,[new ai(Eh),new li],Hv]},{provide:Vv,useFactory:qv,deps:[Fv,Kh,Hv]},{provide:Nv,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Bv},{provide:Yc,multi:!0,useFactory:Wv},[Jv,{provide:pc,multi:!0,useFactory:Qv,deps:[Jv]},{provide:ty,useFactory:Zv,deps:[Jv]},{provide:wc,multi:!0,useExisting:ty}]]}}static forChild(e){return{ngModule:t,providers:[Yv(e)]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(jv,8),bi(Fv,8))}}),t})();function qv(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Vv(t,e,n)}function Kv(t,e,n={}){return n.useHash?new Ah(t,e):new kh(t,e)}function Xv(t){return"guarded"}function Yv(t){return[{provide:Jn,multi:!0,useValue:t},{provide:Cv,multi:!0,useValue:t}]}let Jv=(()=>{class t{constructor(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new C}appInitializer(){return this.injector.get(mh,Promise.resolve(null)).then(()=>{let t=null;const e=new Promise(e=>t=e),n=this.injector.get(Fv),i=this.injector.get(Hv);return"disabled"===i.initialNavigation?(n.setUpLocationChangeListener(),t(!0)):"enabled"===i.initialNavigation||"enabledBlocking"===i.initialNavigation?(n.hooks.afterPreactivation=()=>this.initNavigation?ff(null):(this.initNavigation=!0,t(!0),this.resultOfPreactivationDone),n.initialNavigation()):t(!0),e})}bootstrapListener(t){const e=this.injector.get(Hv),n=this.injector.get(Uv),i=this.injector.get(Vv),r=this.injector.get(Fv),s=this.injector.get(eh);t===s.components[0]&&("enabledNonBlocking"!==e.initialNavigation&&void 0!==e.initialNavigation||r.initialNavigation(),n.setUpPreloading(),i.init(),r.resetRootComponentType(s.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Qv(t){return t.appInitializer.bind(t)}function Zv(t){return t.bootstrapListener.bind(t)}const ty=new Yn("Router Initializer");function ey(t,e){return new y(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,s!==i&&c||(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}const ny=new Yn("NgValueAccessor"),iy={provide:ny,useExisting:st(()=>ry),multi:!0};let ry=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.checked)})("blur",function(){return e.onTouched()})},features:[Pa([iy])]}),t})();const sy={provide:ny,useExisting:st(()=>ay),multi:!0},oy=new Yn("CompositionEventMode");let ay=(()=>{class t{constructor(t,e,n){this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=t=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=dh()?dh().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(oy,8))},t.\u0275dir=Wt({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[Pa([sy])]}),t})();function ly(t){return null==t||0===t.length}function cy(t){return null!=t&&"number"==typeof t.length}const hy=new Yn("NgValidators"),uy=new Yn("NgAsyncValidators"),dy=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class py{static min(t){return e=>{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}}static required(t){return ly(t.value)?{required:!0}:null}static requiredTrue(t){return!0===t.value?null:{required:!0}}static email(t){return ly(t.value)||dy.test(t.value)?null:{email:!0}}static minLength(t){return e=>ly(e.value)||!cy(e.value)?null:e.value.lengthcy(e.value)&&e.value.length>t?{maxlength:{requiredLength:t,actualLength:e.value.length}}:null}static pattern(t){if(!t)return py.nullValidator;let e,n;return"string"==typeof t?(n="","^"!==t.charAt(0)&&(n+="^"),n+=t,"$"!==t.charAt(t.length-1)&&(n+="$"),e=new RegExp(n)):(n=t.toString(),e=t),t=>{if(ly(t.value))return null;const i=t.value;return e.test(i)?null:{pattern:{requiredPattern:n,actualValue:i}}}}static nullValidator(t){return null}static compose(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return my(vy(t,e))}}static composeAsync(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return function(...t){if(1===t.length){const e=t[0];if(l(e))return ey(e,null);if(c(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ey(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return ey(t=1===t.length&&l(t[0])?t[0]:t,null).pipe(k(t=>e(...t)))}return ey(t,null)}(vy(t,e).map(gy)).pipe(k(my))}}}function fy(t){return null!=t}function gy(t){const e=Bo(t)?O(t):t;return Uo(e),e}function my(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function vy(t,e){return e.map(e=>e(t))}function yy(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function by(t){return null!=t?py.compose(yy(t)):null}function wy(t){return null!=t?py.composeAsync(yy(t)):null}function xy(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function _y(t){return t._rawValidators}function Cy(t){return t._rawAsyncValidators}let Sy=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=by(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=wy(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t}),t})(),Ey=(()=>{class t extends Sy{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(e){return ky(e||t)},t.\u0275dir=Wt({type:t,features:[po]}),t})();const ky=Gn(Ey);class Ay extends Sy{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class Dy{constructor(t){this._cd=t}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}let Ty=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ay,2))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})(),Ry=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,2))},t.\u0275dir=Wt({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})();const Fy={provide:ny,useExisting:st(()=>Ly),multi:!0};let Ly=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Fy])]}),t})();const My={provide:ny,useExisting:st(()=>$y),multi:!0};let Iy=(()=>{class t{constructor(){this._accessors=[]}add(t,e){this._accessors.push([t,e])}remove(t){for(let e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)}select(t){this._accessors.forEach(e=>{this._isSameGroup(e,t)&&e[1]!==t&&e[1].fireUncheck(t.value)})}_isSameGroup(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),$y=(()=>{class t{constructor(t,e,n,i){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=i,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(Ay),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(t){this._fn=t,this.onChange=()=>{t(this.value),this._registry.select(this)}}fireUncheck(t){this.writeValue(t)}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(Iy),Ro(ho))},t.\u0275dir=Wt({type:t,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("blur",function(){return e.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[Pa([My])]}),t})();const Oy={provide:ny,useExisting:st(()=>Py),multi:!0};let Py=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Oy])]}),t})();const Ny={provide:ny,useExisting:st(()=>Uy),multi:!0};function By(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let Uy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=By(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(t){this.onChange=e=>{this.value=this._getOptionValue(e),t(this.value)}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const e of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(e),t))return e;return null}_getOptionValue(t){const e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},inputs:{compareWith:"compareWith"},features:[Pa([Ny])]}),t})(),Vy=(()=>{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(By(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(Uy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();const Hy={provide:ny,useExisting:st(()=>zy),multi:!0};function jy(t,e){return null==t?""+e:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let zy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let e;if(this.value=t,Array.isArray(t)){const n=t.map(t=>this._getOptionId(t));e=(t,e)=>{t._setSelected(n.indexOf(e.toString())>-1)}}else e=(t,e)=>{t._setSelected(!1)};this._optionMap.forEach(e)}registerOnChange(t){this.onChange=e=>{const n=[];if(void 0!==e.selectedOptions){const t=e.selectedOptions;for(let e=0;e{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(zy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();function Gy(t,e){Ky(t,e,!0),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&Yy(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&Yy(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function qy(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function Ky(t,e,n){const i=_y(t);null!==e.validator?t.setValidators(xy(i,e.validator)):"function"==typeof i&&t.setValidators([i]);const r=Cy(t);if(null!==e.asyncValidator?t.setAsyncValidators(xy(r,e.asyncValidator)):"function"==typeof r&&t.setAsyncValidators([r]),n){const n=()=>t.updateValueAndValidity();qy(e._rawValidators,n),qy(e._rawAsyncValidators,n)}}function Xy(t,e,n){if(null!==t){if(null!==e.validator){const n=_y(t);Array.isArray(n)&&n.length>0&&t.setValidators(n.filter(t=>t!==e.validator))}if(null!==e.asyncValidator){const n=Cy(t);Array.isArray(n)&&n.length>0&&t.setAsyncValidators(n.filter(t=>t!==e.asyncValidator))}}if(n){const t=()=>{};qy(e._rawValidators,t),qy(e._rawAsyncValidators,t)}}function Yy(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Jy(t,e){Ky(t,e,!1)}const Qy=[ry,Py,Ly,Uy,zy,$y];function Zy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const tb="VALID",eb="INVALID",nb="PENDING",ib="DISABLED";function rb(t){return(lb(t)?t.validators:t)||null}function sb(t){return Array.isArray(t)?by(t):t||null}function ob(t,e){return(lb(e)?e.asyncValidators:t)||null}function ab(t){return Array.isArray(t)?wy(t):t||null}function lb(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class cb{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=sb(this._rawValidators),this._composedAsyncValidatorFn=ab(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===tb}get invalid(){return this.status===eb}get pending(){return this.status==nb}get disabled(){return this.status===ib}get enabled(){return this.status!==ib}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=sb(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=ab(t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=nb,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=ib,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=tb,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==tb&&this.status!==nb||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ib:tb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=nb,this._hasOwnPendingAsyncValidator=!0;const e=gy(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e)return null;if(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length)return null;let i=t;return e.forEach(t=>{i=i instanceof ub?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof db&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Wl,this.statusChanges=new Wl}_calculateStatus(){return this._allControlsDisabled()?ib:this.errors?eb:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(nb)?nb:this._anyControlsHaveStatus(eb)?eb:tb}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){lb(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class hb extends cb{constructor(t=null,e,n){super(rb(e),ob(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Zy(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Zy(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class ub extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof hb?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>t(this.controls[e],e))}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class db extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}at(t){return this.controls[t]}push(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()}insert(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()}removeAt(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof hb?t.value:t.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}let pb=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})();const fb=new Yn("NgModelWithFormControlWarning"),gb={provide:Ey,useExisting:st(()=>mb)};let mb=(()=>{class t extends Ey{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new Wl,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return Gy(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){Zy(this.directives,t)}addFormGroup(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormGroup(t){}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormArray(t){}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,e=this.directives,this.form._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=this.form.get(t.path);t.control!==e&&(function(t,e){const n=()=>{};e.valueAccessor.registerOnChange(n),e.valueAccessor.registerOnTouched(n),Xy(t,e,!0),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}(t.control||null,t),e&&Gy(e,t),t.control=e)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Ky(this.form,this,!1),this._oldForm&&Xy(this._oldForm,this,!1)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(hy,10),Ro(uy,10))},t.\u0275dir=Wt({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&Vo("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Pa([gb]),po,le]}),t})();const vb={provide:Ay,useExisting:st(()=>yb)};let yb=(()=>{class t extends Ay{constructor(t,e,n,i,r){super(),this._ngModelWarningConfig=r,this._added=!1,this.update=new Wl,this._ngModelWarningSent=!1,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=function(t,e){if(!e)return null;Array.isArray(e);let n=void 0,i=void 0,r=void 0;return e.forEach(t=>{var e;t.constructor===ay?n=t:(e=t,Qy.some(t=>e.constructor===t)?i=t:r=t)}),r||i||n||null}(0,i)}set isDisabled(t){}ngOnChanges(t){this._added||this._setUpControl(),function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return t=null==this.name?this.name:this.name.toString(),[...this._parent.path,t];var t}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,13),Ro(hy,10),Ro(uy,10),Ro(ny,10),Ro(fb,8))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[Pa([vb]),po,le]}),t._ngModelWarningSentOnce=!1,t})();const bb={provide:hy,useExisting:st(()=>wb),multi:!0};let wb=(()=>{class t{constructor(){this._required=!1}get required(){return this._required}set required(t){this._required=null!=t&&!1!==t&&""+t!="false",this._onChange&&this._onChange()}validate(t){return this.required?py.required(t):null}registerOnValidatorChange(t){this._onChange=t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(t,e){2&t&&ko("required",e.required?"":null)},inputs:{required:"required"},features:[Pa([bb])]}),t})(),xb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),_b=(()=>{class t{group(t,e=null){const n=this._reduceControls(t);let i=null,r=null,s=void 0;return null!=e&&(function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(e)?(i=null!=e.validators?e.validators:null,r=null!=e.asyncValidators?e.asyncValidators:null,s=null!=e.updateOn?e.updateOn:void 0):(i=null!=e.validator?e.validator:null,r=null!=e.asyncValidator?e.asyncValidator:null)),new ub(n,{asyncValidators:r,updateOn:s,validators:i})}control(t,e,n){return new hb(t,e,n)}array(t,e,n){const i=t.map(t=>this._createControl(t));return new db(i,e,n)}_reduceControls(t){const e={};return Object.keys(t).forEach(n=>{e[n]=this._createControl(t[n])}),e}_createControl(t){return t instanceof hb||t instanceof ub||t instanceof db?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Cb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[Iy],imports:[xb]}),t})(),Sb=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:fb,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[_b,Iy],imports:[xb]}),t})();const Eb=new Yn("ngx-segment-analytics.config"),kb={debug:!1,loadOnInitialization:!0,segmentHost:"cdn.segment.com",segmentUri:"/analytics.js/v1/$API_KEY$/analytics.min.js"};let Ab=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Db=(()=>{class t{constructor(t,e,n){if(this._w=t,this._doc=e,this._config=Object.assign(Object.assign({},kb),n),!this._config.loadOnInitialization||void 0!==this._config.apiKey&&""!==this._config.apiKey){if(void 0===this._w.analytics||void 0===this._w.analytics.initialize||!1===this._w.analytics.initialize){if(void 0!==this._w.analytics&&!0===this._w.analytics.invoked)return void console.error("Segment snippet included twice.");this._config.debug&&console.log("Segment initialization..."),this._w.analytics=[],this._w.analytics.invoked=!0,this._w.analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware"],this._w.analytics.factory=t=>(...e)=>(e.unshift(t),this._w.analytics.push(e),this._w.analytics),this._w.analytics.methods.forEach(t=>{this._w.analytics[t]=this._w.analytics.factory(t)}),this._w.analytics.load=(t,e)=>{const n=this._doc.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://"+this._config.segmentHost+this._config.segmentUri.replace("$API_KEY$",t);const i=this._doc.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),this._w.analytics._loadOptions=e},this._w.analytics.SNIPPET_VERSION="4.1.0",this._config.loadOnInitialization&&this.load(this._config.apiKey)}}else console.error("The API Key cannot be an empty string if Segment must be loaded on initialization.")}load(t,e){this._w.analytics.load(t,e),this._config.debug&&console.log("Segment initialized"),this.debug(this._config.debug)}identify(t,e,n){return new Promise(i=>{this._w.analytics.identify(t,e,n,t=>i(this))})}track(t,e,n){return new Promise(i=>{this._w.analytics.track(t,e,n,t=>i(this))})}page(t,e,n,i){return new Promise(r=>{this._w.analytics.page(t,e,n,i,t=>r(this))})}group(t,e){return new Promise(n=>{this._w.analytics.group(t,e,t=>n(this))})}alias(t,e,n){return new Promise(i=>{this._w.analytics.alias(t,e,n,t=>i(this))})}ready(){return new Promise(t=>{this._w.analytics.ready(e=>t(this))})}user(){return this._w.analytics.user()}id(){return this._w.analytics.id()}traits(){return this._w.analytics.traits()}reset(){this._w.analytics.reset()}debug(t){this._w.analytics.debug(t)}on(t,e){this._w.analytics.on(t,e)}trackLink(t,e,n){this._w.analytics.trackLink(t,e,n)}trackForm(t,e,n){this._w.analytics.trackForm(t,e,n)}timeout(t){this._w.analytics.timeout(t)}addSourceMiddleware(t){this._w.analytics.addSourceMiddleware(t)}get plugins(){return this._w.analytics.plugins}}return t.\u0275fac=function(e){return new(e||t)(bi(Ab),bi(ph),bi(Eb))},t.\u0275prov=lt({factory:function(){return new t(bi(Ab),bi(ph),bi(Eb))},token:t,providedIn:"root"}),t})();function Tb(t){return function(t){return"browser"===t}(t)?window:{}}let Rb=(()=>{class t{constructor(t){if(t)throw new Error("SegmentModule is already loaded. Import it in the AppModule only")}static forRoot(e){return{ngModule:t,providers:[{provide:Eb,useValue:e},Db]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:[{provide:Ab,useFactory:Tb,deps:[bc]}],imports:[[qh]]}),t})();class Fb{}class Lb{}class Mb{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof Mb?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new Mb;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Mb?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class Ib{encodeKey(t){return $b(t)}encodeValue(t){return $b(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}function $b(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class Ob{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new Ib,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Ob({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat([t]),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(t.value),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(t.value);-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}function Pb(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Nb(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Bb(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Ub{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new Mb),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),a)),t.setParams&&(l=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),l)),new Ub(e,n,r,{params:l,headers:a,reportProgress:o,responseType:i,withCredentials:s})}}var Vb=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({});class Hb{constructor(t,e=200,n="OK"){this.headers=t.headers||new Mb,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class jb extends Hb{constructor(t={}){super(t),this.type=Vb.ResponseHeader}clone(t={}){return new jb({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class zb extends Hb{constructor(t={}){super(t),this.type=Vb.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new zb({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Wb extends Hb{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(t.url||"(unknown url)"):`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Gb(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let qb=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Ub)i=t;else{let r=void 0;r=n.headers instanceof Mb?n.headers:new Mb(n.headers);let s=void 0;n.params&&(s=n.params instanceof Ob?n.params:new Ob({fromObject:n.params})),i=new Ub(t,e,void 0!==n.body?n.body:null,{headers:r,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=ff(i).pipe(Zf(t=>this.handler.handle(t)));if(t instanceof Ub||"events"===n.observe)return r;const s=r.pipe(Af(t=>t instanceof zb));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(k(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(k(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Ob).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Gb(n,e))}post(t,e,n={}){return this.request("POST",t,Gb(n,e))}put(t,e,n={}){return this.request("PUT",t,Gb(n,e))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Kb{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const Xb=new Yn("HTTP_INTERCEPTORS");let Yb=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Jb=/^\)\]\}',?\n/;class Qb{}let Zb=(()=>{class t{constructor(){}build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),tw=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new y(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new Mb(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new jb({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Jb,"");try{l=""!==l?JSON.parse(l):null}catch(h){l=t,c&&(c=!1,l={error:h,text:l})}}c?(e.next(new zb({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new Wb({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new Wb({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Vb.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&n.responseText&&(r.partialText=n.responseText),e.next(r)},h=t=>{let n={type:Vb.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",h)),n.send(i),e.next({type:Vb.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("load",o),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",h)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const ew=new Yn("XSRF_COOKIE_NAME"),nw=new Yn("XSRF_HEADER_NAME");class iw{}let rw=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Ih(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(bc),bi(ew))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),sw=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null===i||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(iw),bi(nw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),ow=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(Xb,[]);this.chain=t.reduceRight((t,e)=>new Kb(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(Lb),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),aw=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:sw,useClass:Yb}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:ew,useValue:e.cookieName}:[],e.headerName?{provide:nw,useValue:e.headerName}:[]]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[sw,{provide:Xb,useExisting:sw,multi:!0},{provide:iw,useClass:rw},{provide:ew,useValue:"XSRF-TOKEN"},{provide:nw,useValue:"X-XSRF-TOKEN"}]}),t})(),lw=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[qb,{provide:Fb,useClass:ow},tw,{provide:Lb,useExisting:tw},Zb,{provide:Qb,useExisting:Zb}],imports:[[aw.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();var cw=function(t){return t[t.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",t[t.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",t[t.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",t[t.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",t[t.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",t}({}),hw=function(t){return t[t.APPLE_APP_STORE=0]="APPLE_APP_STORE",t[t.GOOGLE_PLAY_STORE=1]="GOOGLE_PLAY_STORE",t[t.HUAWEI_APP_GALLERY=2]="HUAWEI_APP_GALLERY",t}({});class uw{}let dw=(()=>{class t{constructor(t,e){this.httpClient=t,this.config=e||{host:"http://127.0.0.1:7120",timeoutMs:5e3}}deleteAccounts(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/account",{params:e,headers:this.getTokenAuthHeaders(t)})}listAccounts(t,e,n,i){let r=new Ob;return e&&(r=r.set("filter",e)),(n||!1===n)&&(r=r.set("tombstones",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/account",{params:r,headers:this.getTokenAuthHeaders(t)})}getWalletLedger(t,e,n,i){const r=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet`;let s=new Ob;return n&&(s=s.set("limit",String(n))),i&&(s=s.set("cursor",i)),this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}deleteAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return(n||!1===n)&&(r=r.set("record_deletion",String(n))),this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getAccount(t,e){const n="/v2/console/account/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}banAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/ban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}exportAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getFriends(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteFriend(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getGroups(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/group`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteGroupUser(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/group/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}unbanAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkApple(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/apple`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkCustom(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/custom`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkDevice(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/device`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}unlinkEmail(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/email`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebook(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebook`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebookInstantGame(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebookinstantgame`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGameCenter(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/gamecenter`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGoogle(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/google`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkSteam(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/steam`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteWalletLedger(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteAllData(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/all",{params:e,headers:this.getTokenAuthHeaders(t)})}listApiEndpoints(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/api/endpoints",{params:e,headers:this.getTokenAuthHeaders(t)})}callRpcEndpoint(t,e,n){const i="/v2/console/api/endpoints/rpc/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}callApiEndpoint(t,e,n){const i="/v2/console/api/endpoints/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}authenticate(t){let e=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate",t,{params:e})}authenticateLogout(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate/logout",e,{params:n,headers:this.getTokenAuthHeaders(t)})}listChannelMessages(t,e,n,i,r,s,o){let a=new Ob;return e&&(a=a.set("type",e)),n&&(a=a.set("label",n)),i&&(a=a.set("group_id",i)),r&&(a=a.set("user_id_one",r)),s&&(a=a.set("user_id_two",s)),o&&(a=a.set("cursor",o)),this.httpClient.get(this.config.host+"/v2/console/channel",{params:a,headers:this.getTokenAuthHeaders(t)})}getConfig(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/config",{params:e,headers:this.getTokenAuthHeaders(t)})}listGroups(t,e,n){let i=new Ob;return e&&(i=i.set("filter",e)),n&&(i=i.set("cursor",n)),this.httpClient.get(this.config.host+"/v2/console/group",{params:i,headers:this.getTokenAuthHeaders(t)})}demoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/demote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}promoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/promote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}addGroupUsers(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/add`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateGroup(t,e,n){const i="/v2/console/group/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}exportGroup(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getMembers(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/member`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}listLeaderboards(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/leaderboard",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboardRecord(t,e,n){const i=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/owner/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}listLeaderboardRecords(t,e,n,i,r,s){const o=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/records`;let a=new Ob;return n&&n.forEach(t=>a=a.append("owner_ids",String(t))),i&&(a=a.set("limit",String(i))),r&&(a=a.set("cursor",r)),s&&(a=a.set("expiry",s)),this.httpClient.get(this.config.host+o,{params:a,headers:this.getTokenAuthHeaders(t)})}listMatches(t,e,n,i,r,s,o,a,l){let c=new Ob;return e&&(c=c.set("limit",String(e))),(n||!1===n)&&(c=c.set("authoritative",String(n))),i&&(c=c.set("label",i)),r&&(c=c.set("min_size",String(r))),s&&(c=c.set("max_size",String(s))),o&&(c=c.set("match_id",o)),a&&(c=c.set("query",a)),l&&(c=c.set("node",l)),this.httpClient.get(this.config.host+"/v2/console/match",{params:c,headers:this.getTokenAuthHeaders(t)})}getMatchState(t,e){const n=`/v2/console/match/${e=encodeURIComponent(String(e))}/state`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteChannelMessages(t,e,n){let i=new Ob;return e&&(i=i.set("before",e)),n&&n.forEach(t=>i=i.append("ids",String(t))),this.httpClient.delete(this.config.host+"/v2/console/message",{params:i,headers:this.getTokenAuthHeaders(t)})}listPurchases(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/purchase",{params:r,headers:this.getTokenAuthHeaders(t)})}getRuntime(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/runtime",{params:e,headers:this.getTokenAuthHeaders(t)})}getStatus(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/status",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorage(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/storage",{params:e,headers:this.getTokenAuthHeaders(t)})}listStorage(t,e,n,i,r){let s=new Ob;return e&&(s=s.set("user_id",e)),n&&(s=s.set("key",n)),i&&(s=s.set("collection",i)),r&&(s=s.set("cursor",r)),this.httpClient.get(this.config.host+"/v2/console/storage",{params:s,headers:this.getTokenAuthHeaders(t)})}listStorageCollections(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/storage/collections",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return r&&(o=o.set("version",r)),this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}getStorage(t,e,n,i){const r=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let s=new Ob;return this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}writeStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return this.httpClient.put(this.config.host+s,r,{params:o,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject2(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}/${r=encodeURIComponent(String(r))}`;let o=new Ob;return this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}listSubscriptions(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/subscription",{params:r,headers:this.getTokenAuthHeaders(t)})}deleteUser(t,e){let n=new Ob;return e&&(n=n.set("username",e)),this.httpClient.delete(this.config.host+"/v2/console/user",{params:n,headers:this.getTokenAuthHeaders(t)})}listUsers(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/user",{params:e,headers:this.getTokenAuthHeaders(t)})}addUser(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/user",e,{params:n,headers:this.getTokenAuthHeaders(t)})}getTokenAuthHeaders(t){return(new Mb).set("Authorization","Bearer "+t)}getBasicAuthHeaders(t,e){return(new Mb).set("Authorization","Basic "+btoa(t+":"+e))}}return t.\u0275fac=function(e){return new(e||t)(bi(qb),bi(uw,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const pw=new Yn("window"),fw=[{provide:pw,useFactory:()=>window}],gw="currentSession";let mw=(()=>{class t{constructor(t,e,n,i){this.window=t,this.segment=e,this.http=n,this.consoleService=i;const r=JSON.parse(localStorage.getItem(gw));this.currentSessionSubject=new gf(r),this.currentSession=this.currentSessionSubject.asObservable()}get currentSessionValue(){return this.currentSessionSubject.getValue()}get username(){const t=this.currentSessionSubject.getValue().token;return JSON.parse(atob(t.split(".")[1])).usn}get sessionRole(){const t=this.currentSessionSubject.getValue().token;switch(JSON.parse(atob(t.split(".")[1])).rol){case 1:return cw.USER_ROLE_ADMIN;case 2:return cw.USER_ROLE_DEVELOPER;case 3:return cw.USER_ROLE_MAINTAINER;case 4:return cw.USER_ROLE_READONLY;default:return cw.USER_ROLE_UNKNOWN}}login(t,e){return this.consoleService.authenticate({username:t,password:e}).pipe(ng(t=>{localStorage.setItem(gw,JSON.stringify(t)),this.currentSessionSubject.next(t)}))}logout(){var t;return this.currentSessionSubject.getValue()?this.consoleService.authenticateLogout("",{token:null===(t=this.currentSessionSubject.getValue())||void 0===t?void 0:t.token}).pipe(ng(()=>{localStorage.removeItem(gw),this.currentSessionSubject.next(null)})):Cf}segmentIdentify(t){const e=JSON.parse(atob(t.token.split(".")[1]));this.segment.identify(null,{username:e.usn,email:e.ema,cookie:e.cki})}}return t.\u0275fac=function(e){return new(e||t)(bi(pw),bi(Db),bi(qb),bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function vw(t,e){if(1&t&&(Mo(0,"div",17),va(1),Io()),2&t){const t=zo();Qr(1),ba(" ",t.error," ")}}const yw=function(t){return{"was-validated":t}},bw=function(t){return{"is-invalid":t}};let ww=(()=>{class t{constructor(t,e,n,i,r){this.segment=t,this.formBuilder=e,this.route=n,this.router=i,this.authenticationService=r,this.error=""}ngOnInit(){this.loginForm=this.formBuilder.group({username:["",py.compose([py.required])],password:["",py.compose([py.required,py.minLength(8)])]}),this.returnUrl=this.route.snapshot.queryParams.next||"/"}onSubmit(){this.submitted=!0,this.error="",this.loginForm.invalid||this.authenticationService.login(this.f.username.value,this.f.password.value).subscribe(t=>{this.loginForm.reset(),this.submitted=!1,this.router.navigate([this.returnUrl])},t=>{this.error=t,this.submitted=!1})}get f(){return this.loginForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(Db),Ro(_b),Ro(pm),Ro(Fv),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:26,vars:14,consts:[[1,"bg-grad","d-flex","h-100"],[1,"align-self-center","mx-auto"],[1,"text-center","mb-4"],["src","/static/svg/logo.svg","alt","Nakama Logo","width","175"],["class","alert alert-warning","role","alert",4,"ngIf"],[1,"card"],[1,"card-body"],[1,"text-center"],[3,"formGroup","ngClass","ngSubmit"],[1,"form-group","form-row"],[1,"col-sm-12"],["for","username"],["type","text","id","username","formControlName","username","required","","autofocus","",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","password"],["type","password","id","password","formControlName","password","required","",1,"form-control",3,"ngClass"],[1,"btn","btn-primary","btn-lg","btn-block",3,"disabled"],["role","alert",1,"alert","alert-warning"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"h1",2),$o(3,"img",3),Io(),Do(4,vw,2,1,"div",4),Mo(5,"div",5),Mo(6,"div",6),Mo(7,"h3",7),va(8,"Login"),Io(),Mo(9,"form",8),Vo("ngSubmit",function(){return e.onSubmit()}),Mo(10,"div",9),Mo(11,"div",10),Mo(12,"label",11),va(13,"Username"),Io(),$o(14,"input",12),Mo(15,"div",13),va(16,"Please enter a username."),Io(),Io(),Io(),Mo(17,"div",9),Mo(18,"div",10),Mo(19,"label",14),va(20,"Password"),Io(),$o(21,"input",15),Mo(22,"div",13),va(23,"Password must be at least 8 characters."),Io(),Io(),Io(),Mo(24,"button",16),va(25,"Login"),Io(),Io(),Io(),Io(),Io(),Io()),2&t&&(Qr(4),Fo("ngIf",e.error),Qr(5),Fo("formGroup",e.loginForm)("ngClass",Vl(8,yw,e.submitted)),Qr(5),Fo("ngClass",Vl(10,bw,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(6),Fo("ngClass",Vl(12,bw,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(2),Fo("disabled",!e.loginForm.valid||e.submitted))},directives:[Bh,pb,Ry,mb,$h,ay,Ty,yb,wb],styles:["div[_ngcontent-%COMP%] .mx-auto[_ngcontent-%COMP%]{width:420px}"]}),t})(),xw=(()=>{class t{constructor(t,e){this.authService=t,this.router=e}canActivate(t,e){return!this.authService.currentSessionValue||(this.router.navigate(["/"]),!1)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),_w=(()=>{class t{constructor(t,e){this.router=t,this.authenticationService=e}canActivate(t,e){return!!this.authenticationService.currentSessionValue||(this.router.navigate(["/login"],{queryParams:{next:e.url}}),!1)}canActivateChild(t,e){return this.canActivate(t,e)}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Cw extends u{constructor(t,e){super()}schedule(t,e=0){return this}}class Sw extends Cw{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n=!1,i=void 0;try{this.work(t)}catch(r){n=!0,i=!!r&&r||new Error(r)}if(n)return this.unsubscribe(),i}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}let Ew=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class kw extends Ew{constructor(t,e=Ew.now){super(t,()=>kw.delegate&&kw.delegate!==this?kw.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return kw.delegate&&kw.delegate!==this?kw.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const Aw=new kw(Sw);class Dw{constructor(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}call(t,e){return e.subscribe(new Rw(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))}}class Tw{constructor(){this.buffer=[]}}class Rw extends f{constructor(t,e,n,i,r){super(t),this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=i,this.scheduler=r,this.contexts=[];const s=this.openContext();if(this.timespanOnly=null==n||n<0,this.timespanOnly)this.add(s.closeAction=r.schedule(Fw,e,{subscriber:this,context:s,bufferTimeSpan:e}));else{const t={bufferTimeSpan:e,bufferCreationInterval:n,subscriber:this,scheduler:r};this.add(s.closeAction=r.schedule(Mw,e,{subscriber:this,context:s})),this.add(r.schedule(Lw,n,t))}}_next(t){const e=this.contexts,n=e.length;let i;for(let r=0;r0;){const n=t.shift();e.next(n.buffer)}super._complete()}_unsubscribe(){this.contexts=null}onBufferFull(t){this.closeContext(t);const e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();const e=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(Fw,e,{subscriber:this,context:t,bufferTimeSpan:e}))}}openContext(){const t=new Tw;return this.contexts.push(t),t}closeContext(t){this.destination.next(t.buffer);const e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)}}function Fw(t){const e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Lw(t){const{bufferCreationInterval:e,bufferTimeSpan:n,subscriber:i,scheduler:r}=t,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(Mw,n,{subscriber:i,context:s})),this.schedule(t,e))}function Mw(t){const{subscriber:e,context:n}=t;e.closeContext(n)}class Iw{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new $w(t,this.compare,this.keySelector))}}class $w extends f{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}function Ow(t,e,n,r){return i(n)&&(r=n,n=void 0),r?Ow(t,e,n).pipe(k(t=>l(t)?r(...t):r(t))):new y(i=>{Pw(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Pw(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s=0}function Bw(t=0,e,n){let i=-1;return Nw(e)?i=Number(e)<1?1:Number(e):E(e)&&(n=e),E(n)||(n=Aw),new y(e=>{const r=Nw(t)?t:+t-n.now();return n.schedule(Uw,r,{index:0,period:i,subscriber:e})})}function Uw(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Vw(...t){if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return z(t,void 0).lift(new Hw)}class Hw{call(t,e){return e.subscribe(new jw(t))}}class jw extends mf{constructor(t){super(t),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(t){this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(let n=0;nthis.index}hasCompleted(){return this.array.length===this.index}}class Xw extends N{constructor(t,e,n){super(t),this.parent=e,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[F](){return this}next(){const t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(t){this.buffer.push(t),this.parent.checkIterators()}subscribe(){return B(this.observable,new P(this))}}function Yw(t){return e=>e.lift(new Jw(t))}class Jw{constructor(t){this.notifier=t}call(t,e){const n=new Qw(t),i=B(this.notifier,new P(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Qw extends N{constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Zw(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new tx(t,n))}}class tx{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new ex(t,this.observables,this.project))}}class ex extends mf{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function nx(t,e){return new y(e?n=>e.schedule(ix,0,{error:t,subscriber:n}):e=>e.error(t))}function ix({error:t,subscriber:e}){e.error(t)}let rx=(()=>{class t{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return ff(this.value);case"E":return nx(this.error);case"C":return Sf()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new t("N",e):t.undefinedValueNotification}static createError(e){return new t("E",void 0,e)}static createComplete(){return t.completeNotification}}return t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t})();function sx(t,e=Aw){var n;const i=(n=t)instanceof Date&&!isNaN(+n)?+t-e.now():Math.abs(t);return t=>t.lift(new ox(i,e))}class ox{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new ax(t,this.delay,this.scheduler))}}class ax extends f{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(ax.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new lx(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(rx.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(rx.createComplete()),this.unsubscribe()}}class lx{constructor(t,e){this.time=t,this.notification=e}}function cx(t,e){if(1&t){const t=No();Mo(0,"button",1),Vo("click",function(){return Ie(t),zo().close()}),Mo(1,"span",2),va(2,"\xd7"),Io(),Io()}}const hx=["*"],ux=["dialog"];function dx(t){return null!=t}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const px={animation:!0,transitionTimerDelayMs:5};let fx=(()=>{class t{constructor(){this.animation=px.animation}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})();const gx=()=>{},{transitionTimerDelayMs:mx}=px,vx=new Map,yx=(t,e,n)=>{let i=n.context||{};const r=vx.get(t);if(r)switch(n.runningTransition){case"continue":return Cf;case"stop":r.transition$.complete(),i=Object.assign(r.context,i),vx.delete(t)}!function(t){t||document}(t);const s=e(t,i)||gx;if(!n.animation||"none"===window.getComputedStyle(t).transitionProperty)return s(),ff(void 0);const o=new C,a=o.pipe(function(...t){return e=>qf(e,ff(...t))}(!0));vx.set(t,{transition$:o,context:i});const l=function(t){const{transitionDelay:e,transitionDuration:n}=window.getComputedStyle(t);return 1e3*(parseFloat(e)+parseFloat(n))}(t),c=Ow(t,"transitionend").pipe(Yw(a),Af(({target:e})=>e===t));return Vw(Bw(l+mx).pipe(Yw(a)),c).pipe(Yw(a)).subscribe(()=>{vx.delete(t),s(),o.next(),o.complete()}),o.asObservable()};let bx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),wx=(()=>{class t{constructor(t){this.dismissible=!0,this.type="warning",this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const xx=({classList:t})=>{t.remove("show")};let _x=(()=>{class t{constructor(t,e,n){this._renderer=e,this._element=n,this.closed=new Wl,this.dismissible=t.dismissible,this.type=t.type,this.animation=t.animation}close(){const t=yx(this._element.nativeElement,xx,{animation:this.animation,runningTransition:"continue"});return t.subscribe(()=>this.closed.emit()),t}ngOnChanges(t){const e=t.type;e&&!e.firstChange&&(this._renderer.removeClass(this._element.nativeElement,"alert-"+e.previousValue),this._renderer.addClass(this._element.nativeElement,"alert-"+e.currentValue))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,"alert-"+this.type)}}return t.\u0275fac=function(e){return new(e||t)(Ro(wx),Ro(Ga),Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert","show"],hostVars:4,hostBindings:function(t,e){2&t&&ra("fade",e.animation)("alert-dismissible",e.dismissible)},inputs:{dismissible:"dismissible",type:"type",animation:"animation"},outputs:{closed:"closed"},exportAs:["ngbAlert"],features:[le],ngContentSelectors:hx,decls:2,vars:1,consts:function(){let t,e;return t=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,e=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,[["type","button","class","close","aria-label",t,3,"click",4,"ngIf"],["type","button","aria-label",e,1,"close",3,"click"],["aria-hidden","true"]]},template:function(t,e){1&t&&(Go(),qo(0),Do(1,cx,3,0,"button",0)),2&t&&(Qr(1),Fo("ngIf",e.dismissible))},directives:[Bh],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),t})(),Cx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Sx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbButtonLabel",""]],hostVars:8,hostBindings:function(t,e){2&t&&ra("btn",!0)("active",e.active)("disabled",e.disabled)("focus",e.focused)}}),t})(),Ex=0,kx=(()=>{class t{constructor(){this._radios=new Set,this._value=null,this.name="ngb-radio-"+Ex++,this.onChange=t=>{},this.onTouched=()=>{}}get disabled(){return this._disabled}set disabled(t){this.setDisabledState(t)}onRadioChange(t){this.writeValue(t.value),this.onChange(t.value)}onRadioValueUpdate(){this._updateRadiosValue()}register(t){this._radios.add(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._disabled=t,this._updateRadiosDisabled()}unregister(t){this._radios.delete(t)}writeValue(t){this._value=t,this._updateRadiosValue()}_updateRadiosValue(){this._radios.forEach(t=>t.updateValue(this._value))}_updateRadiosDisabled(){this._radios.forEach(t=>t.updateDisabled())}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbRadioGroup",""]],hostAttrs:["role","radiogroup"],inputs:{name:"name"},features:[Pa([{provide:ny,useExisting:st(()=>t),multi:!0}])]}),t})(),Ax=(()=>{class t{constructor(t,e,n,i,r){this._group=t,this._label=e,this._renderer=n,this._element=i,this._cd=r,this._value=null,this._group.register(this),this.updateDisabled()}set value(t){this._value=t;const e=t?t.toString():"";this._renderer.setProperty(this._element.nativeElement,"value",e),this._group.onRadioValueUpdate()}set disabled(t){this._disabled=!1!==t,this.updateDisabled()}set focused(t){this._label&&(this._label.focused=t),t||this._group.onTouched()}get checked(){return this._checked}get disabled(){return this._group.disabled||this._disabled}get value(){return this._value}get nameAttr(){return this.name||this._group.name}ngOnDestroy(){this._group.unregister(this)}onChange(){this._group.onRadioChange(this)}updateValue(t){this.value!==t&&this._cd.markForCheck(),this._checked=this.value===t,this._label.active=this._checked}updateDisabled(){this._label.disabled=this.disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(kx),Ro(Sx),Ro(Ga),Ro(za),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["","ngbButton","","type","radio"]],hostVars:3,hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("focus",function(){return e.focused=!0})("blur",function(){return e.focused=!1}),2&t&&xa("checked",e.checked)("disabled",e.disabled)("name",e.nameAttr)},inputs:{value:"value",disabled:"disabled",name:"name"}}),t})(),Dx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Tx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Rx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();var Fx=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown",t}({});const Lx=(t,e)=>!!e&&e.some(e=>e.contains(t)),Mx=(t,e)=>!e||null!=function(t,e){return e?void 0===t.closest?null:t.closest(e):null}(t,e),Ix="undefined"!=typeof navigator&&!!navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));function $x(t,e,n,i,r,s,o,a){var l;n&&t.runOutsideAngular((l=()=>{const l=Ow(e,"keydown").pipe(Yw(r),Af(t=>t.which===Fx.Escape),ng(t=>t.preventDefault())),c=Ow(e,"mousedown").pipe(k(t=>{const e=t.target;return 2!==t.button&&!Lx(e,o)&&("inside"===n?Lx(e,s)&&Mx(e,a):"outside"===n?!Lx(e,s):Mx(e,a)||!Lx(e,s))}),Yw(r)),h=Ow(e,"mouseup").pipe(Zw(c),Af(([t,e])=>e),sx(0),Yw(r));Vw([l.pipe(k(t=>0)),h.pipe(k(t=>1))]).subscribe(e=>t.run(()=>i(e)))},Ix?()=>setTimeout(()=>l(),100):l))}const Ox=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function Px(t){const e=Array.from(t.querySelectorAll(Ox)).filter(t=>-1!==t.tabIndex);return[e[0],e[e.length-1]]}const Nx=/\s+/,Bx=new class{getAllStyles(t){return window.getComputedStyle(t)}getStyle(t,e){return this.getAllStyles(t)[e]}isStaticPositioned(t){return"static"===(this.getStyle(t,"position")||"static")}offsetParent(t){let e=t.offsetParent||document.documentElement;for(;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement}position(t,e=!0){let n,i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const e=this.offsetParent(t);n=this.offset(t,!1),e!==document.documentElement&&(i=this.offset(e,!1)),i.top+=e.clientTop,i.left+=e.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(t,e=!0){const n=t.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,r=window.pageXOffset-document.documentElement.clientLeft;let s={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+r,right:n.right+r};return e&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s}positionElements(t,e,n,i){const[r="top",s="center"]=n.split("-"),o=i?this.offset(t,!1):this.position(t,!1),a=this.getAllStyles(e),l=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),h=parseFloat(a.marginLeft),u=parseFloat(a.marginRight);let d=0,p=0;switch(r){case"top":d=o.top-(e.offsetHeight+l+c);break;case"bottom":d=o.top+o.height;break;case"left":p=o.left-(e.offsetWidth+h+u);break;case"right":p=o.left+o.width}switch(s){case"top":d=o.top;break;case"bottom":d=o.top+o.height-e.offsetHeight;break;case"left":p=o.left;break;case"right":p=o.left+o.width-e.offsetWidth;break;case"center":"top"===r||"bottom"===r?p=o.left+o.width/2-e.offsetWidth/2:d=o.top+o.height/2-e.offsetHeight/2}e.style.transform=`translate(${Math.round(p)}px, ${Math.round(d)}px)`;const f=e.getBoundingClientRect(),g=document.documentElement,m=window.innerHeight||g.clientHeight,v=window.innerWidth||g.clientWidth;return f.left>=0&&f.top>=0&&f.right<=v&&f.bottom<=m}};function Ux(t,e,n,i,r){let s=Array.isArray(n)?n:n.split(Nx);const o=["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"],a=e.classList,l=t=>{const[e,n]=t.split("-"),i=[];return r&&(i.push(`${r}-${e}`),n&&i.push(`${r}-${e}-${n}`),i.forEach(t=>{a.add(t)})),i};r&&o.forEach(t=>{a.remove(`${r}-${t}`)});let c=s.findIndex(t=>"auto"===t);c>=0&&o.forEach(function(t){null==s.find(e=>-1!==e.search("^"+t))&&s.splice(c++,1,t)});const h=e.style;h.position="absolute",h.top="0",h.left="0",h["will-change"]="transform";let u=null,d=!1;for(u of s){let n=l(u);if(Bx.positionElements(t,e,u,i)){d=!0;break}r&&n.forEach(t=>{a.remove(t)})}return d||(u=s[0],l(u),Bx.positionElements(t,e,u,i)),u}new Date(1882,10,12),new Date(2174,10,25);let Vx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,Cb]]}),t})(),Hx=(()=>{class t{constructor(){this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),jx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["",8,"navbar"]]}),t})(),zx=(()=>{class t{constructor(t){this.elementRef=t,this._disabled=!1}set disabled(t){this._disabled=""===t||!0===t}get disabled(){return this._disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownItem",""]],hostAttrs:[1,"dropdown-item"],hostVars:2,hostBindings:function(t,e){2&t&&ra("disabled",e.disabled)},inputs:{disabled:"disabled"}}),t})(),Wx=(()=>{class t{constructor(t,e){this.dropdown=t,this.placement="bottom",this.isOpen=!1,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownMenu",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,zx,!1),2&t){let t;ic(t=lc())&&(e.menuItems=t)}},hostVars:5,hostBindings:function(t,e){1&t&&Vo("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Enter",function(t){return e.dropdown.onKeyDown(t)})("keydown.Space",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&(ko("x-placement",e.placement),ra("dropdown-menu",!0)("show",e.dropdown.isOpen()))}}),t})(),Gx=(()=>{class t{constructor(t,e){this.dropdown=t,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownAnchor",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){2&t&&ko("aria-expanded",e.dropdown.isOpen())}}),t})(),qx=(()=>{class t extends Gx{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownToggle",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){1&t&&Vo("click",function(){return e.dropdown.toggle()})("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&ko("aria-expanded",e.dropdown.isOpen())},features:[Pa([{provide:Gx,useExisting:st(()=>t)}]),po]}),t})(),Kx=(()=>{class t{constructor(t,e,n,i,r,s,o){this._changeDetector=t,this._document=n,this._ngZone=i,this._elementRef=r,this._renderer=s,this._closed$=new C,this._bodyContainer=null,this._open=!1,this.openChange=new Wl,this.placement=e.placement,this.container=e.container,this.autoClose=e.autoClose,this.display=o?"static":"dynamic",this._zoneSubscription=i.onStable.subscribe(()=>{this._positionMenu()})}ngAfterContentInit(){this._ngZone.onStable.pipe(zf(1)).subscribe(()=>{this._applyPlacementClasses(),this._open&&this._setCloseHandlers()})}ngOnChanges(t){t.container&&this._open&&this._applyContainer(this.container),t.placement&&!t.placement.isFirstChange&&this._applyPlacementClasses()}isOpen(){return this._open}open(){this._open||(this._open=!0,this._applyContainer(this.container),this.openChange.emit(!0),this._setCloseHandlers(),this._anchor&&this._anchor.nativeElement.focus())}_setCloseHandlers(){$x(this._ngZone,this._document,this.autoClose,t=>{this.close(),0===t&&this._anchor.nativeElement.focus()},this._closed$,this._menu?[this._menu.nativeElement]:[],this._anchor?[this._anchor.nativeElement]:[],".dropdown-item,.dropdown-divider")}close(){this._open&&(this._open=!1,this._resetContainer(),this._closed$.next(),this.openChange.emit(!1),this._changeDetector.markForCheck())}toggle(){this.isOpen()?this.close():this.open()}ngOnDestroy(){this._resetContainer(),this._closed$.next(),this._zoneSubscription.unsubscribe()}onKeyDown(t){const e=t.which,n=this._getMenuElements();let i=-1,r=null;const s=this._isEventFromToggle(t);if(!s&&n.length&&n.forEach((e,n)=>{e.contains(t.target)&&(r=e),e===this._document.activeElement&&(i=n)}),e!==Fx.Space&&e!==Fx.Enter){if(e!==Fx.Tab){if(s||r){if(this.open(),n.length){switch(e){case Fx.ArrowDown:i=Math.min(i+1,n.length-1);break;case Fx.ArrowUp:if(this._isDropup()&&-1===i){i=n.length-1;break}i=Math.max(i-1,0);break;case Fx.Home:i=0;break;case Fx.End:i=n.length-1}n[i].focus()}t.preventDefault()}}else if(t.target&&this.isOpen()&&this.autoClose){if(this._anchor.nativeElement===t.target)return void("body"!==this.container||t.shiftKey?t.shiftKey&&this.close():(this._renderer.setAttribute(this._menu.nativeElement,"tabindex","0"),this._menu.nativeElement.focus(),this._renderer.removeAttribute(this._menu.nativeElement,"tabindex")));if("body"===this.container){const e=this._menu.nativeElement.querySelectorAll(Ox);t.shiftKey&&t.target===e[0]?(this._anchor.nativeElement.focus(),t.preventDefault()):t.shiftKey||t.target!==e[e.length-1]||(this._anchor.nativeElement.focus(),this.close())}else Ow(t.target,"focusout").pipe(zf(1)).subscribe(({relatedTarget:t})=>{this._elementRef.nativeElement.contains(t)||this.close()})}}else!r||!0!==this.autoClose&&"inside"!==this.autoClose||Ow(r,"click").pipe(zf(1)).subscribe(()=>this.close())}_isDropup(){return this._elementRef.nativeElement.classList.contains("dropup")}_isEventFromToggle(t){return this._anchor.nativeElement.contains(t.target)}_getMenuElements(){const t=this._menu;return null==t?[]:t.menuItems.filter(t=>!t.disabled).map(t=>t.elementRef.nativeElement)}_positionMenu(){const t=this._menu;this.isOpen()&&t&&this._applyPlacementClasses("dynamic"===this.display?Ux(this._anchor.nativeElement,this._bodyContainer||this._menu.nativeElement,this.placement,"body"===this.container):this._getFirstPlacement(this.placement))}_getFirstPlacement(t){return Array.isArray(t)?t[0]:t.split(" ")[0]}_resetContainer(){const t=this._renderer;if(this._menu){const e=this._menu.nativeElement;t.appendChild(this._elementRef.nativeElement,e),t.removeStyle(e,"position"),t.removeStyle(e,"transform")}this._bodyContainer&&(t.removeChild(this._document.body,this._bodyContainer),this._bodyContainer=null)}_applyContainer(t=null){if(this._resetContainer(),"body"===t){const t=this._renderer,e=this._menu.nativeElement,n=this._bodyContainer=this._bodyContainer||t.createElement("div");t.setStyle(n,"position","absolute"),t.setStyle(e,"position","static"),t.setStyle(n,"z-index","1050"),t.appendChild(n,e),t.appendChild(this._document.body,n)}}_applyPlacementClasses(t){const e=this._menu;if(e){t||(t=this._getFirstPlacement(this.placement));const n=this._renderer,i=this._elementRef.nativeElement;n.removeClass(i,"dropup"),n.removeClass(i,"dropdown"),e.placement="static"===this.display?null:t;const r=-1!==t.search("^top")?"dropup":"dropdown";n.addClass(i,r);const s=this._bodyContainer;s&&(n.removeClass(s,"dropup"),n.removeClass(s,"dropdown"),n.addClass(s,r))}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl),Ro(Hx),Ro(ph),Ro(Ic),Ro(za),Ro(Ga),Ro(jx,8))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdown",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Wx,!0),ac(n,Gx,!0)),2&t){let t;ic(t=lc())&&(e._menu=t.first),ic(t=lc())&&(e._anchor=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("show",e.isOpen())},inputs:{_open:["open","_open"],placement:"placement",container:"container",autoClose:"autoClose",display:"display"},outputs:{openChange:"openChange"},exportAs:["ngbDropdown"],features:[le]}),t})(),Xx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Yx=(()=>{class t{constructor(t){this.backdrop=!0,this.keyboard=!0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();class Jx{constructor(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}}class Qx{constructor(t,e,n,i,r,s,o){this._type=t,this._injector=e,this._viewContainerRef=n,this._renderer=i,this._ngZone=r,this._componentFactoryResolver=s,this._applicationRef=o,this._windowRef=null,this._contentRef=null}open(t,e,n=!1){this._windowRef||(this._contentRef=this._getContentRef(t,e),this._windowRef=this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type),this._viewContainerRef.length,this._injector,this._contentRef.nodes));const{nativeElement:i}=this._windowRef.location,r=this._ngZone.onStable.asObservable().pipe(zf(1)).pipe(U(()=>this._ngZone.run(()=>yx(i,({classList:t})=>t.add("show"),{animation:n,runningTransition:"continue"}))));return{windowRef:this._windowRef,transition$:r}}close(t=!1){return this._windowRef?yx(this._windowRef.location.nativeElement,({classList:t})=>t.remove("show"),{animation:t,runningTransition:"stop"}).pipe(ng(()=>{var t;this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null),(null===(t=this._contentRef)||void 0===t?void 0:t.viewRef)&&(this._applicationRef.detachView(this._contentRef.viewRef),this._contentRef.viewRef.destroy(),this._contentRef=null)})):ff(void 0)}_getContentRef(t,e){if(t){if(t instanceof yl){const n=t.createEmbeddedView(e);return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}return new Jx([[this._renderer.createText(""+t)]])}return new Jx([])}}const Zx=()=>{};let t_=(()=>{class t{constructor(t){this._document=t}compensate(){const t=this._getWidth();return this._isPresent(t)?this._adjustBody(t):Zx}_adjustBody(t){const e=this._document.body,n=e.style.paddingRight,i=parseFloat(window.getComputedStyle(e)["padding-right"]);return e.style["padding-right"]=i+t+"px",()=>e.style["padding-right"]=n}_isPresent(t){const e=this._document.body.getBoundingClientRect();return window.innerWidth-(e.left+e.right)>=t-.1*t}_getWidth(){const t=this._document.createElement("div");t.className="modal-scrollbar-measure";const e=this._document.body;e.appendChild(t);const n=t.getBoundingClientRect().width-t.clientWidth;return e.removeChild(t),n}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return new t(bi(ph))},token:t,providedIn:"root"}),t})(),e_=(()=>{class t{constructor(t,e){this._el=t,this._zone=e}ngOnInit(){this._zone.onStable.asObservable().pipe(zf(1)).subscribe(()=>{yx(this._el.nativeElement,({classList:t})=>t.add("show"),{animation:this.animation,runningTransition:"continue"})})}hide(){return yx(this._el.nativeElement,({classList:t})=>t.remove("show"),{animation:this.animation,runningTransition:"stop"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:6,hostBindings:function(t,e){2&t&&(sa("modal-backdrop"+(e.backdropClass?" "+e.backdropClass:"")),ra("show",!e.animation)("fade",e.animation))},inputs:{animation:"animation",backdropClass:"backdropClass"},decls:0,vars:0,template:function(t,e){},encapsulation:2}),t})();class n_{close(t){}dismiss(t){}}class i_{constructor(t,e,n,i){this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,this._beforeDismiss=i,this._closed=new C,this._dismissed=new C,this._hidden=new C,t.instance.dismissEvent.subscribe(t=>{this.dismiss(t)}),this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}get closed(){return this._closed.asObservable().pipe(Yw(this._hidden))}get dismissed(){return this._dismissed.asObservable().pipe(Yw(this._hidden))}get hidden(){return this._hidden.asObservable()}get shown(){return this._windowCmptRef.instance.shown.asObservable()}close(t){this._windowCmptRef&&(this._closed.next(t),this._resolve(t),this._removeModalElements())}_dismiss(t){this._dismissed.next(t),this._reject(t),this._removeModalElements()}dismiss(t){if(this._windowCmptRef)if(this._beforeDismiss){const e=this._beforeDismiss();e&&e.then?e.then(e=>{!1!==e&&this._dismiss(t)},()=>{}):!1!==e&&this._dismiss(t)}else this._dismiss(t)}_removeModalElements(){const t=this._windowCmptRef.instance.hide(),e=this._backdropCmptRef?this._backdropCmptRef.instance.hide():ff(void 0);t.subscribe(()=>{const{nativeElement:t}=this._windowCmptRef.location;t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._contentRef=null}),e.subscribe(()=>{if(this._backdropCmptRef){const{nativeElement:t}=this._backdropCmptRef.location;t.parentNode.removeChild(t),this._backdropCmptRef.destroy(),this._backdropCmptRef=null}}),zw(t,e).subscribe(()=>{this._hidden.next(),this._hidden.complete()})}}var r_=function(t){return t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC",t}({});let s_=(()=>{class t{constructor(t,e,n){this._document=t,this._elRef=e,this._zone=n,this._closed$=new C,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new Wl,this.shown=new C,this.hidden=new C}dismiss(t){this.dismissEvent.emit(t)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){this._show()}ngOnDestroy(){this._disableEventHandling()}hide(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"stop"},n=zw(yx(t,()=>t.classList.remove("show"),e),yx(this._dialogEl.nativeElement,()=>{},e));return n.subscribe(()=>{this.hidden.next(),this.hidden.complete()}),this._disableEventHandling(),this._restoreFocus(),n}_show(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"continue"};zw(yx(t,()=>t.classList.add("show"),e),yx(this._dialogEl.nativeElement,()=>{},e)).subscribe(()=>{this.shown.next(),this.shown.complete()}),this._enableEventHandling(),this._setFocus()}_enableEventHandling(){const{nativeElement:t}=this._elRef;this._zone.runOutsideAngular(()=>{Ow(t,"keydown").pipe(Yw(this._closed$),Af(t=>t.which===Fx.Escape)).subscribe(t=>{this.keyboard?requestAnimationFrame(()=>{t.defaultPrevented||this._zone.run(()=>this.dismiss(r_.ESC))}):"static"===this.backdrop&&this._bumpBackdrop()});let e=!1;Ow(this._dialogEl.nativeElement,"mousedown").pipe(Yw(this._closed$),ng(()=>e=!1),Vf(()=>Ow(t,"mouseup").pipe(Yw(this._closed$),zf(1))),Af(({target:e})=>t===e)).subscribe(()=>{e=!0}),Ow(t,"click").pipe(Yw(this._closed$)).subscribe(({target:n})=>{t===n&&("static"===this.backdrop?this._bumpBackdrop():!0!==this.backdrop||e||this._zone.run(()=>this.dismiss(r_.BACKDROP_CLICK))),e=!1})})}_disableEventHandling(){this._closed$.next()}_setFocus(){const{nativeElement:t}=this._elRef;if(!t.contains(document.activeElement)){const e=t.querySelector("[ngbAutofocus]"),n=Px(t)[0];(e||n||t).focus()}}_restoreFocus(){const t=this._document.body,e=this._elWithFocus;let n;n=e&&e.focus&&t.contains(e)?e:t,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null})}_bumpBackdrop(){"static"===this.backdrop&&yx(this._elRef.nativeElement,({classList:t})=>(t.add("modal-static"),()=>t.remove("modal-static")),{animation:this.animation,runningTransition:"continue"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(ph),Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-window"]],viewQuery:function(t,e){if(1&t&&rc(ux,!0),2&t){let t;ic(t=lc())&&(e._dialogEl=t.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:7,hostBindings:function(t,e){2&t&&(ko("aria-modal",!0)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),sa("modal d-block"+(e.windowClass?" "+e.windowClass:"")),ra("fade",e.animation))},inputs:{backdrop:"backdrop",keyboard:"keyboard",animation:"animation",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:hx,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0,1),Mo(2,"div",2),qo(3),Io(),Io()),2&t&&sa("modal-dialog"+(e.size?" modal-"+e.size:"")+(e.centered?" modal-dialog-centered":"")+(e.scrollable?" modal-dialog-scrollable":""))},styles:["ngb-modal-window .component-host-scrollable{-ms-flex-direction:column;display:-ms-flexbox;display:flex;flex-direction:column;overflow:hidden}"],encapsulation:2}),t})(),o_=(()=>{class t{constructor(t,e,n,i,r,s){this._applicationRef=t,this._injector=e,this._document=n,this._scrollBar=i,this._rendererFactory=r,this._ngZone=s,this._activeWindowCmptHasChanged=new C,this._ariaHiddenValues=new Map,this._backdropAttributes=["animation","backdropClass"],this._modalRefs=[],this._windowAttributes=["animation","ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new Wl,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const t=this._windowCmpts[this._windowCmpts.length-1];((t,e,n,i=!1)=>{this._ngZone.runOutsideAngular(()=>{const t=Ow(e,"focusin").pipe(Yw(n),k(t=>t.target));Ow(e,"keydown").pipe(Yw(n),Af(t=>t.which===Fx.Tab),Zw(t)).subscribe(([t,n])=>{const[i,r]=Px(e);n!==i&&n!==e||!t.shiftKey||(r.focus(),t.preventDefault()),n!==r||t.shiftKey||(i.focus(),t.preventDefault())}),i&&Ow(e,"click").pipe(Yw(n),Zw(t),k(t=>t[1])).subscribe(t=>t.focus())})})(0,t.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(t.location.nativeElement)}})}open(t,e,n,i){const r=i.container instanceof HTMLElement?i.container:dx(i.container)?this._document.querySelector(i.container):this._document.body,s=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(s.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!r)throw new Error(`The specified modal container "${i.container||"body"}" was not found in the DOM.`);const l=new n_,c=this._getContentRef(t,i.injector||e,n,l,i);let h=!1!==i.backdrop?this._attachBackdrop(t,r):void 0,u=this._attachWindowComponent(t,r,c),d=new i_(u,c,h,i.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(u),d.result.then(o,o),d.result.then(a,a),l.close=t=>{d.close(t)},l.dismiss=t=>{d.dismiss(t)},this._applyWindowOptions(u.instance,i),1===this._modalRefs.length&&s.addClass(this._document.body,"modal-open"),h&&h.instance&&this._applyBackdropOptions(h.instance,i),d}get activeInstances(){return this._activeInstances}dismissAll(t){this._modalRefs.forEach(e=>e.dismiss(t))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(t,e){let n=t.resolveComponentFactory(e_).create(this._injector);return this._applicationRef.attachView(n.hostView),e.appendChild(n.location.nativeElement),n}_attachWindowComponent(t,e,n){let i=t.resolveComponentFactory(s_).create(this._injector,n.nodes);return this._applicationRef.attachView(i.hostView),e.appendChild(i.location.nativeElement),i}_applyWindowOptions(t,e){this._windowAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_applyBackdropOptions(t,e){this._backdropAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_getContentRef(t,e,n,i,r){return n?n instanceof yl?this._createFromTemplateRef(n,i):"string"==typeof n?this._createFromString(n):this._createFromComponent(t,e,n,i,r):new Jx([])}_createFromTemplateRef(t,e){const n=t.createEmbeddedView({$implicit:e,close(t){e.close(t)},dismiss(t){e.dismiss(t)}});return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}_createFromString(t){const e=this._document.createTextNode(""+t);return new Jx([[e]])}_createFromComponent(t,e,n,i,r){const s=t.resolveComponentFactory(n),o=ho.create({providers:[{provide:n_,useValue:i}],parent:e}),a=s.create(o),l=a.location.nativeElement;return r.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(a.hostView),new Jx([[l]],a.hostView,a)}_setAriaHidden(t){const e=t.parentElement;e&&t!==this._document.body&&(Array.from(e.children).forEach(e=>{e!==t&&"SCRIPT"!==e.nodeName&&(this._ariaHiddenValues.set(e,e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),this._setAriaHidden(e))}_revertAriaHidden(){this._ariaHiddenValues.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(t){const e=()=>{const e=this._modalRefs.indexOf(t);e>-1&&(this._modalRefs.splice(e,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(t),this._activeInstances.emit(this._modalRefs),t.result.then(e,e)}_registerWindowCmpt(t){this._windowCmpts.push(t),this._activeWindowCmptHasChanged.next(),t.onDestroy(()=>{const e=this._windowCmpts.indexOf(t);e>-1&&(this._windowCmpts.splice(e,1),this._activeWindowCmptHasChanged.next())})}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(ho),bi(ph),bi(t_),bi(Wa),bi(Ic))},t.\u0275prov=lt({factory:function(){return new t(bi(eh),bi(Ks),bi(ph),bi(t_),bi(Wa),bi(Ic))},token:t,providedIn:"root"}),t})(),a_=(()=>{class t{constructor(t,e,n,i){this._moduleCFR=t,this._injector=e,this._modalStack=n,this._config=i}open(t,e={}){const n=Object.assign({},this._config,e);return this._modalStack.open(this._moduleCFR,this._injector,t,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(t){this._modalStack.dismissAll(t)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return t.\u0275fac=function(e){return new(e||t)(bi(Ua),bi(ho),bi(o_),bi(Yx))},t.\u0275prov=lt({factory:function(){return new t(bi(Ua),bi(Ks),bi(o_),bi(Yx))},token:t,providedIn:"root"}),t})(),l_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[a_]}),t})(),c_=(()=>{class t{constructor(t){this.destroyOnHide=!0,this.orientation="horizontal",this.roles="tablist",this.keyboard=!1,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const h_=t=>dx(t)&&""!==t;let u_=0,d_=(()=>{class t{constructor(t){this.templateRef=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["ng-template","ngbNavContent",""]]}),t})(),p_=(()=>{class t{constructor(t,e){this.elementRef=e,this.disabled=!1,this.shown=new Wl,this.hidden=new Wl,this._nav=t}ngAfterContentChecked(){this.contentTpl=this.contentTpls.first}ngOnInit(){dx(this.domId)||(this.domId="ngb-nav-"+u_++)}get active(){return this._nav.activeId===this.id}get id(){return h_(this._id)?this._id:this.domId}get panelDomId(){return this.domId+"-panel"}isPanelInDom(){return(dx(this.destroyOnHide)?!this.destroyOnHide:!this._nav.destroyOnHide)||this.active}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>f_)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNavItem",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,d_,!1),2&t){let t;ic(t=lc())&&(e.contentTpls=t)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("nav-item",!0)},inputs:{disabled:"disabled",domId:"domId",destroyOnHide:"destroyOnHide",_id:["ngbNavItem","_id"]},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbNavItem"]}),t})(),f_=(()=>{class t{constructor(t,e,n,i){this.role=t,this._cd=n,this._document=i,this.activeIdChange=new Wl,this.shown=new Wl,this.hidden=new Wl,this.destroy$=new C,this.navItemChange$=new C,this.navChange=new Wl,this.animation=e.animation,this.destroyOnHide=e.destroyOnHide,this.orientation=e.orientation,this.roles=e.roles,this.keyboard=e.keyboard}click(t){t.disabled||this._updateActiveId(t.id)}onKeyDown(t){if("tablist"!==this.roles||!this.keyboard)return;const e=t.which,n=this.links.filter(t=>!t.navItem.disabled),{length:i}=n;let r=-1;if(n.forEach((t,e)=>{t.elRef.nativeElement===this._document.activeElement&&(r=e)}),i){switch(e){case Fx.ArrowLeft:if("vertical"===this.orientation)return;r=(r-1+i)%i;break;case Fx.ArrowRight:if("vertical"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowDown:if("horizontal"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowUp:if("horizontal"===this.orientation)return;r=(r-1+i)%i;break;case Fx.Home:r=0;break;case Fx.End:r=i-1}"changeWithArrows"===this.keyboard&&this.select(n[r].navItem.id),n[r].elRef.nativeElement.focus(),t.preventDefault()}}select(t){this._updateActiveId(t,!1)}ngAfterContentInit(){if(!dx(this.activeId)){const t=this.items.first?this.items.first.id:null;h_(t)&&(this._updateActiveId(t,!1),this._cd.detectChanges())}this.items.changes.pipe(Yw(this.destroy$)).subscribe(()=>this._notifyItemChanged(this.activeId))}ngOnChanges({activeId:t}){t&&!t.firstChange&&this._notifyItemChanged(t.currentValue)}ngOnDestroy(){this.destroy$.next()}_updateActiveId(t,e=!0){if(this.activeId!==t){let n=!1;e&&this.navChange.emit({activeId:this.activeId,nextId:t,preventDefault:()=>{n=!0}}),n||(this.activeId=t,this.activeIdChange.emit(t),this._notifyItemChanged(t))}}_notifyItemChanged(t){this.navItemChange$.next(this._getItemById(t))}_getItemById(t){return this.items&&this.items.find(e=>e.id===t)||null}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(c_),Ro(pl),Ro(ph))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNav",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,p_,!1),ac(n,g_,!0)),2&t){let t;ic(t=lc())&&(e.items=t),ic(t=lc())&&(e.links=t)}},hostVars:6,hostBindings:function(t,e){1&t&&Vo("keydown.arrowLeft",function(t){return e.onKeyDown(t)})("keydown.arrowRight",function(t){return e.onKeyDown(t)})("keydown.arrowDown",function(t){return e.onKeyDown(t)})("keydown.arrowUp",function(t){return e.onKeyDown(t)})("keydown.Home",function(t){return e.onKeyDown(t)})("keydown.End",function(t){return e.onKeyDown(t)}),2&t&&(ko("aria-orientation","vertical"===e.orientation&&"tablist"===e.roles?"vertical":void 0)("role",e.role?e.role:e.roles?"tablist":void 0),ra("nav",!0)("flex-column","vertical"===e.orientation))},inputs:{animation:"animation",destroyOnHide:"destroyOnHide",orientation:"orientation",roles:"roles",keyboard:"keyboard",activeId:"activeId"},outputs:{activeIdChange:"activeIdChange",shown:"shown",hidden:"hidden",navChange:"navChange"},exportAs:["ngbNav"],features:[le]}),t})(),g_=(()=>{class t{constructor(t,e,n,i){this.role=t,this.navItem=e,this.nav=n,this.elRef=i}hasNavItemClass(){return this.navItem.elementRef.nativeElement.nodeType===Node.COMMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(p_),Ro(f_),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["a","ngbNavLink",""]],hostAttrs:["href",""],hostVars:14,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.nav.click(e.navItem),t.preventDefault()}),2&t&&(xa("id",e.navItem.domId),ko("role",e.role?e.role:e.nav.roles?"tab":void 0)("tabindex",e.navItem.disabled?-1:void 0)("aria-controls",e.navItem.isPanelInDom()?e.navItem.panelDomId:null)("aria-selected",e.navItem.active)("aria-disabled",e.navItem.disabled),ra("nav-link",!0)("nav-item",e.hasNavItemClass())("active",e.navItem.active)("disabled",e.navItem.disabled))}}),t})(),m_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),v_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();class y_{constructor(t,e){this.open=t,this.close=e,e||(this.close=t)}isManual(){return"manual"===this.open||"manual"===this.close}}const b_={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]},w_=t=>t>0?sx(t):t=>t;let x_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),__=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),C_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),S_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),E_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),k_=(()=>{class t{constructor(t){this.autoClose=!0,this.placement="auto",this.triggers="hover focus",this.disableTooltip=!1,this.openDelay=0,this.closeDelay=0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})(),A_=0,D_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngb-tooltip-window"]],hostAttrs:["role","tooltip"],hostVars:5,hostBindings:function(t,e){2&t&&(xa("id",e.id),sa("tooltip"+(e.tooltipClass?" "+e.tooltipClass:"")),ra("fade",e.animation))},inputs:{animation:"animation",id:"id",tooltipClass:"tooltipClass"},ngContentSelectors:hx,decls:3,vars:0,consts:[[1,"arrow"],[1,"tooltip-inner"]],template:function(t,e){1&t&&(Go(),$o(0,"div",0),Mo(1,"div",1),qo(2),Io())},styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{bottom:.4rem;top:auto}"],encapsulation:2,changeDetection:0}),t})(),T_=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this._elementRef=t,this._renderer=e,this._ngZone=o,this._document=a,this._changeDetector=l,this.shown=new Wl,this.hidden=new Wl,this._ngbTooltipWindowId="ngb-tooltip-"+A_++,this._windowRef=null,this.animation=s.animation,this.autoClose=s.autoClose,this.placement=s.placement,this.triggers=s.triggers,this.container=s.container,this.disableTooltip=s.disableTooltip,this.tooltipClass=s.tooltipClass,this.openDelay=s.openDelay,this.closeDelay=s.closeDelay,this._popupService=new Qx(D_,n,r,e,this._ngZone,i,c),this._zoneSubscription=o.onStable.subscribe(()=>{this._windowRef&&Ux(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-tooltip")})}set ngbTooltip(t){this._ngbTooltip=t,!t&&this._windowRef&&this.close()}get ngbTooltip(){return this._ngbTooltip}open(t){if(!this._windowRef&&this._ngbTooltip&&!this.disableTooltip){const{windowRef:e,transition$:n}=this._popupService.open(this._ngbTooltip,t,this.animation);this._windowRef=e,this._windowRef.instance.animation=this.animation,this._windowRef.instance.tooltipClass=this.tooltipClass,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),$x(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),n.subscribe(()=>this.shown.emit())}}close(){null!=this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(this.animation).subscribe(()=>{this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck()}))}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=function(t,e,n,i,r,s,o=0,a=0){const l=function(t,e=b_){const n=(t||"").trim();if(0===n.length)return[];const i=n.split(/\s+/).map(t=>t.split(":")).map(t=>{let n=e[t[0]]||t;return new y_(n[0],n[1])}),r=i.filter(t=>t.isManual());if(r.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===r.length&&i.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return i}(n);if(1===l.length&&l[0].isManual())return()=>{};const c=function(t,e,n,i){return new y(r=>{const s=[],o=()=>r.next(!0),a=()=>r.next(!1),l=()=>r.next(!i());return n.forEach(n=>{n.open===n.close?s.push(t.listen(e,n.open,l)):s.push(t.listen(e,n.open,o),t.listen(e,n.close,a))}),()=>{s.forEach(t=>t())}})}(t,e,l,i).pipe(function(t,e,n){return i=>{let r=null;const s=i.pipe(k(t=>({open:t})),Af(t=>{const e=n();return e===t.open||r&&r.open!==e?(r&&r.open!==t.open&&(r=null),!1):(r=t,!0)}),Z());return W(s.pipe(Af(t=>t.open),w_(t)),s.pipe(Af(t=>!t.open),w_(e))).pipe(Af(t=>t===r&&(r=null,t.open!==n())),k(t=>t.open))}}(o,a,i)).subscribe(t=>t?r():s());return()=>c.unsubscribe()}(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({tooltipClass:t}){t&&this.isOpen()&&(this._windowRef.instance.tooltipClass=t.currentValue)}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(ho),Ro(Ua),Ro(El),Ro(k_),Ro(Ic),Ro(ph),Ro(pl),Ro(eh))},t.\u0275dir=Wt({type:t,selectors:[["","ngbTooltip",""]],inputs:{animation:"animation",autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disableTooltip:"disableTooltip",tooltipClass:"tooltipClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbTooltip:"ngbTooltip"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbTooltip"],features:[le]}),t})(),R_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();new Yn("live announcer delay",{providedIn:"root",factory:function(){return 100}});let F_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();const L_=[bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_];let M_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[L_,bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_]}),t})(),I_=(()=>{class t{constructor(){this.restrictedPages=new Map([["users",cw.USER_ROLE_ADMIN],["config",cw.USER_ROLE_DEVELOPER],["modules",cw.USER_ROLE_DEVELOPER],["apiexplorer",cw.USER_ROLE_DEVELOPER]])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function $_(t,e){if(1&t&&(Oo(0,5),Mo(1,"a",27),$o(2,"img",28),Mo(3,"span",12),va(4),Io(),Io(),Po()),2&t){const t=zo().$implicit;Fo("ngbNavItem",t.navItem),Qr(1),Fo("routerLink",t.routerLink),Qr(1),Xo("src","/static/svg/",t.icon,".svg",nr),Qr(2),ya(t.label)}}function O_(t,e){1&t&&$o(0,"hr")}function P_(t,e){if(1&t&&(Do(0,$_,5,4,"ng-container",26),Do(1,O_,1,0,"hr",25)),2&t){const t=e.$implicit;Fo("ngIf",zo().getSessionRole()<=t.minRole),Qr(1),Fo("ngIf",t.separator)}}function N_(t,e){if(1&t&&(Mo(0,"div",29),Mo(1,"h2",30),$o(2,"img",31),va(3,"An error has occurred!"),Io(),Mo(4,"h6",32),va(5),Io(),Mo(6,"p"),va(7,"Please refresh the page to try again."),Io(),Io()),2&t){const t=zo();Qr(5),ya(t.error)}}function B_(t,e){1&t&&(Mo(0,"div",33),$o(1,"img",34),Io())}function U_(t,e){1&t&&$o(0,"router-outlet")}const V_=function(){return["/"]},H_=function(){return["/login"]};let j_=(()=>{class t{constructor(t,e,n,i,r){var s;this.route=t,this.router=e,this.segment=n,this.consoleService=i,this.authService=r,this.loading=!0,this.error="",this.routes=[{navItem:"status",routerLink:["/status"],label:"Status",minRole:cw.USER_ROLE_READONLY,icon:"status"},{navItem:"users",routerLink:["/users"],label:"User Management",minRole:cw.USER_ROLE_ADMIN,icon:"user-management"},{navItem:"config",routerLink:["/config"],label:"Configuration",minRole:cw.USER_ROLE_DEVELOPER,icon:"configuration"},{navItem:"modules",routerLink:["/modules"],label:"Runtime Modules",minRole:cw.USER_ROLE_DEVELOPER,separator:!0,icon:"runtime-modules"},{navItem:"accounts",routerLink:["/accounts"],label:"Accounts",minRole:cw.USER_ROLE_READONLY,icon:"accounts"},{navItem:"groups",routerLink:["/groups"],label:"Groups",minRole:cw.USER_ROLE_READONLY,icon:"groups"},{navItem:"storage",routerLink:["/storage"],label:"Storage",minRole:cw.USER_ROLE_READONLY,icon:"storage"},{navItem:"leaderboards",routerLink:["/leaderboards"],label:"Leaderboards",minRole:cw.USER_ROLE_READONLY,icon:"leaderboard"},{navItem:"chat",routerLink:["/chat"],label:"Chat Messages",minRole:cw.USER_ROLE_READONLY,icon:"chat"},{navItem:"matches",routerLink:["/matches"],label:"Matches",minRole:cw.USER_ROLE_READONLY,icon:"running-matches"},{navItem:"apiexplorer",routerLink:["/apiexplorer"],label:"API Explorer",minRole:cw.USER_ROLE_DEVELOPER,icon:"api-explorer"}],this.loading=!1,this.routerSub=this.router.events.pipe(function(t){let e=arguments.length,n=Aw;E(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);let i=null;e>=2&&(i=arguments[1]);let r=Number.POSITIVE_INFINITY;return e>=3&&(r=arguments[2]),function(e){return e.lift(new Dw(t,i,r,n))}}(2e3)).subscribe(t=>{if(0===t.length)return;const e=t[t.length-1];e instanceof lg&&(this.loading=!0),e instanceof cg&&(this.loading=!1),e instanceof hg&&(this.loading=!1),e instanceof ug&&(this.loading=!1,this.error=e.error)}),this.segmentRouterSub=e.events.pipe((s=(t,e)=>!(e instanceof cg)||t.url===e.url,t=>t.lift(new Iw(s,undefined)))).subscribe(t=>{})}ngOnInit(){this.route.data.subscribe(t=>{this.error=t.error?t.error:""})}getSessionRole(){return this.authService.sessionRole}getUsername(){return this.authService.username}logout(){this.authService.logout().subscribe(()=>{this.router.navigate(["/login"])})}ngOnDestroy(){this.segmentRouterSub.unsubscribe(),this.routerSub.unsubscribe()}onSidebarNavChange(t){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(Db),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:40,vars:11,consts:[[1,"container-fluid"],[1,"row"],["ngbNav","",1,"col-md-2","d-none","d-md-block","sidebar","position-fixed","px-0",3,"navChange"],["sidenav","ngbNav"],[1,"flex-column","text-uppercase"],[3,"ngbNavItem"],[3,"routerLink"],["src","/static/svg/logo.svg","alt","","width","175","height","",1,"logo-full","mx-3","mt-3","mb-1"],["src","/static/svg/logo-icon.svg","alt","","width","32","height","",1,"logo-icon","mx-3","mt-3","mb-1"],["ngFor","",3,"ngForOf"],["href","https://cloud.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/heroiccloud.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"link-text"],["href","https://heroiclabs.com/docs","target","_blank",1,"nav-link"],["src","/static/svg/docs.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://forum.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/forum.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://heroiclabs.com/blog","target","_blank",1,"nav-link"],["src","/static/svg/blog.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"logged-in-as","nav-link","disabled"],["ngbNavLink","","routerLinkActive","active",3,"routerLink","click"],["src","/static/svg/log-out.svg","alt","","width","24","height","",1,"mr-1"],["role","main",1,"ml-sm-auto","col-md-10","col-lg-10","main-extended","px-4","py-4"],["class","mx-auto",4,"ngIf"],["class","loading mx-auto",4,"ngIf"],[4,"ngIf"],[3,"ngbNavItem",4,"ngIf"],["ngbNavLink","","routerLinkActive","active",3,"routerLink"],["alt","","width","24","height","",1,"link-icon","mr-1",3,"src"],[1,"mx-auto"],[1,"pb-2"],["src","/static/svg/red-triangle.svg",1,"mr-2",2,"width","1em","height","1em"],[1,"mr-2","d-inline","font-weight-bold"],[1,"loading","mx-auto"],["src","/static/spinner.svg",1,"p-1","loading"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"nav",2,3),Vo("navChange",function(t){return e.onSidebarNavChange(t)}),Mo(4,"div",4),Oo(5,5),Mo(6,"a",6),$o(7,"img",7),$o(8,"img",8),Io(),Po(),$o(9,"hr"),Do(10,P_,2,2,"ng-template",9),$o(11,"hr"),Mo(12,"a",10),$o(13,"img",11),Mo(14,"span",12),va(15,"Heroic Cloud"),Io(),Io(),Mo(16,"a",13),$o(17,"img",14),Mo(18,"span",12),va(19,"Documentation"),Io(),Io(),Mo(20,"a",15),$o(21,"img",16),Mo(22,"span",12),va(23,"Forum"),Io(),Io(),Mo(24,"a",17),$o(25,"img",18),Mo(26,"span",12),va(27,"Heroic Labs Blog"),Io(),Io(),$o(28,"hr"),Mo(29,"div",19),va(30),Io(),Oo(31,5),Mo(32,"a",20),Vo("click",function(){return e.logout()}),$o(33,"img",21),Mo(34,"span",12),va(35,"Logout"),Io(),Io(),Po(),Io(),Io(),Mo(36,"main",22),Do(37,N_,8,1,"div",23),Do(38,B_,2,0,"div",24),Do(39,U_,1,0,"router-outlet",25),Io(),Io(),Io()),2&t&&(Qr(5),Fo("ngbNavItem","logo"),Qr(1),Fo("routerLink",Ul(9,V_)),Qr(4),Fo("ngForOf",e.routes),Qr(20),ba("Logged in as: ",e.getUsername(),""),Qr(1),Fo("ngbNavItem","logout"),Qr(1),Fo("routerLink",Ul(10,H_)),Qr(5),Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.error&&e.loading),Qr(1),Fo("ngIf",!e.error&&!e.loading))},directives:[f_,p_,Mv,Ph,g_,$v,Bh,Ov],styles:[".nav-link.no-active[_ngcontent-%COMP%]{background-color:initial!important}.nav-item[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-top-color:#708090}.sidebar[_ngcontent-%COMP%]{background-color:#333564;position:fixed;top:0;bottom:0;left:0;z-index:100;font-family:Montserrat,sans-serif;overflow-y:auto}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{color:#fff;font-size:12px;letter-spacing:.1em;opacity:.6;font-weight:500!important}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover{opacity:1;background-color:hsla(0,0%,88.2%,.1)}.sidebar[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-color:#fff;opacity:.2}.active[_ngcontent-%COMP%]{opacity:1}.nav-link.active[_ngcontent-%COMP%]{opacity:1;color:#a69bff}.navbar-collapse[_ngcontent-%COMP%]{letter-spacing:0;text-transform:capitalize}.logo-icon[_ngcontent-%COMP%]{display:none}.link-text[_ngcontent-%COMP%]{padding-left:4px}@media screen and (max-width:1200px){.main-extended[_ngcontent-%COMP%]{width:94.333333%!important;max-width:94.333333%!important;flex:0 0 94.333333%!important}.sidebar[_ngcontent-%COMP%]{min-width:65px!important;width:5.66%!important;max-width:5.66%!important}.sidebar[_ngcontent-%COMP%] .logo-full[_ngcontent-%COMP%]{display:none}.sidebar[_ngcontent-%COMP%] .logo-icon[_ngcontent-%COMP%]{display:block}.sidebar[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{width:30px}.sidebar[_ngcontent-%COMP%] .link-text[_ngcontent-%COMP%], .sidebar[_ngcontent-%COMP%] .logged-in-as[_ngcontent-%COMP%]{display:none}}"]}),t})(),z_=(()=>{class t{constructor(t,e,n){this.authService=t,this.router=e,this.globals=n}canActivate(t,e){return!0}canActivateChild(t,e){const n=this.globals.restrictedPages.get(t.url[0].path);return!(null!==n&&n{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}{}class Y_{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new J_(t,this.dueTime,this.scheduler))}}class J_ extends f{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Q_,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Q_(t){t.debouncedNext()}function Z_(){}var tC=function(t){return null==t?Z_:function(){return this.querySelector(t)}};function eC(){return[]}var nC=function(t){return null==t?eC:function(){return this.querySelectorAll(t)}},iC=function(t){return function(){return this.matches(t)}},rC=function(t){return new Array(t.length)};function sC(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function oC(t,e,n,i,r,s){for(var o,a=0,l=e.length,c=s.length;ae?1:t>=e?0:NaN}sC.prototype={constructor:sC,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var cC="http://www.w3.org/1999/xhtml",hC={svg:"http://www.w3.org/2000/svg",xhtml:cC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},uC=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),hC.hasOwnProperty(e)?{space:hC[e],local:t}:t};function dC(t){return function(){this.removeAttribute(t)}}function pC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fC(t,e){return function(){this.setAttribute(t,e)}}function gC(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function mC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function vC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var yC=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function bC(t){return function(){this.style.removeProperty(t)}}function wC(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xC(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function _C(t,e){return t.style.getPropertyValue(e)||yC(t).getComputedStyle(t,null).getPropertyValue(e)}function CC(t){return function(){delete this[t]}}function SC(t,e){return function(){this[t]=e}}function EC(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function kC(t){return t.trim().split(/^|\s+/)}function AC(t){return t.classList||new DC(t)}function DC(t){this._node=t,this._names=kC(t.getAttribute("class")||"")}function TC(t,e){for(var n=AC(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var zC=function(t){var e=uC(t);return(e.local?jC:HC)(e)};function WC(){return null}function GC(){var t=this.parentNode;t&&t.removeChild(this)}function qC(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function KC(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var XC={},YC=null;function JC(t,e,n){return t=QC(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function QC(t,e,n){return function(i){var r=YC;YC=i;try{t.call(this,this.__data__,e,n)}finally{YC=r}}}function ZC(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function tS(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i=x&&(x=w+1);!(b=v[x])&&++x=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=lC);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s1?this.each((null==e?bC:"function"==typeof e?xC:wC)(t,e,null==n?"":n)):_C(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?CC:"function"==typeof e?EC:SC)(t,e)):this.node()[t]},classed:function(t,e){var n=kC(t+"");if(arguments.length<2){for(var i=AC(this.node()),r=-1,s=n.length;++r=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function fS(t,e){for(var n,i=0,r=t.length;i0)for(var n,i,r=new Array(n),s=0;s>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?US(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?US(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=TS.exec(t))?new jS(e[1],e[2],e[3],1):(e=RS.exec(t))?new jS(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=FS.exec(t))?US(e[1],e[2],e[3],e[4]):(e=LS.exec(t))?US(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=MS.exec(t))?qS(e[1],e[2]/100,e[3]/100,1):(e=IS.exec(t))?qS(e[1],e[2]/100,e[3]/100,e[4]):$S.hasOwnProperty(t)?BS($S[t]):"transparent"===t?new jS(NaN,NaN,NaN,0):null}function BS(t){return new jS(t>>16&255,t>>8&255,255&t,1)}function US(t,e,n,i){return i<=0&&(t=e=n=NaN),new jS(t,e,n,i)}function VS(t){return t instanceof _S||(t=NS(t)),t?new jS((t=t.rgb()).r,t.g,t.b,t.opacity):new jS}function HS(t,e,n,i){return 1===arguments.length?VS(t):new jS(t,e,n,null==i?1:i)}function jS(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function zS(){return"#"+GS(this.r)+GS(this.g)+GS(this.b)}function WS(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function GS(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function qS(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new XS(t,e,n,i)}function KS(t){if(t instanceof XS)return new XS(t.h,t.s,t.l,t.opacity);if(t instanceof _S||(t=NS(t)),!t)return new XS;if(t instanceof XS)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n0&&l<1?0:o,new XS(o,a,l,t.opacity)}function XS(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function YS(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function JS(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}wS(_S,NS,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:OS,formatHex:OS,formatHsl:function(){return KS(this).formatHsl()},formatRgb:PS,toString:PS}),wS(jS,HS,xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zS,formatHex:zS,formatRgb:WS,toString:WS})),wS(XS,function(t,e,n,i){return 1===arguments.length?KS(t):new XS(t,e,n,null==i?1:i)},xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new XS(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new XS(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new jS(YS(t>=240?t-240:t+120,r,i),YS(t,r,i),YS(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var QS=function(t){return function(){return t}};function ZS(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):QS(isNaN(t)?e:t)}var tE=function t(e){var n=function(t){return 1==(t=+t)?ZS:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):QS(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=HS(t)).r,(e=HS(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),o=ZS(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function eE(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1];return JS((n-i/e)*e,i>0?t[i-1]:2*r-s,r,s,is&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:aE(n,i)})),s=hE.lastIndex;return s=0&&e._call.call(null,t),e=e._next;--mE}()}finally{mE=0,function(){for(var t,e,n=rE,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:rE=e);sE=t,RE(i)}(),wE=0}}function TE(){var t=_E.now(),e=t-bE;e>1e3&&(xE-=e,bE=t)}function RE(t){mE||(vE&&(vE=clearTimeout(vE)),t-wE>24?(t<1/0&&(vE=setTimeout(DE,t-_E.now()-xE)),yE&&(yE=clearInterval(yE))):(yE||(bE=_E.now(),yE=setInterval(TE,1e3)),mE=1,CE(DE)))}kE.prototype=AE.prototype={constructor:kE,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?SE():+n)+(null==e?0:+e),this._next||sE===this||(sE?sE._next=this:rE=this,sE=this),this._call=t,this._time=n,RE()},stop:function(){this._call&&(this._call=null,this._time=1/0,RE())}};var FE=function(t,e,n){var i=new kE;return i.restart(function(n){i.stop(),t(n+e)},e=null==e?0:+e,n),i},LE=mS("start","end","cancel","interrupt"),ME=[],IE=function(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(l){var c,h,u,d;if(1!==n.state)return a();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return FE(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c0)throw new Error("too late; already scheduled");return n}function OE(t,e){var n=PE(t,e);if(n.state>3)throw new Error("too late; already running");return n}function PE(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var NE,BE,UE,VE,HE=function(t,e){var n,i,r,s=t.__transition,o=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}},jE=180/Math.PI,zE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},WE=function(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:aE(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:aE(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:aE(t,n)},{i:a-2,x:aE(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?$E:OE;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var gk=lS.prototype.constructor;function mk(t){return function(){this.style.removeProperty(t)}}function vk(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function yk(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&vk(t,s,n)),i}return s._value=e,s}function bk(t){return function(e){this.textContent=t.call(this,e)}}function wk(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&bk(i)),e}return i._value=t,i}var xk=0;function _k(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ck(){return++xk}var Sk=lS.prototype;_k.prototype=(function(t){return lS().transition(t)}).prototype={constructor:_k,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=tC(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;oe?1:t>=e?0:NaN},Qk=function(t){let e=t,n=t;function i(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)<0?i=s+1:r=s}return i}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Jk(t(e),n)}(t)),{left:i,center:function(t,n,r,s){null==r&&(r=0),null==s&&(s=t.length);const o=i(t,n,r,s-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)>0?r=s:i=s+1}return i}}},Zk=Math.sqrt(50),tA=Math.sqrt(10),eA=Math.sqrt(2);function nA(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=Zk?10:s>=tA?5:s>=eA?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=Zk?10:s>=tA?5:s>=eA?2:1)}function iA(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=Zk?r*=10:s>=tA?r*=5:s>=eA&&(r*=2),e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return rA.setTime(+e),sA.setTime(+i),t(rA),t(sA),Math.floor(n(rA,sA))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var aA=oA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});aA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var lA=aA,cA=oA(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),hA=1e3,uA=6e4,dA=36e5;function pA(t){return oA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/6048e5})}var fA=pA(0),gA=(pA(1),pA(2),pA(3),pA(4),pA(5),pA(6),oA(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/864e5,t=>t.getDate()-1)),mA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA-t.getMinutes()*uA)},function(t,e){t.setTime(+t+e*dA)},function(t,e){return(e-t)/dA},function(t){return t.getHours()}),vA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA)},function(t,e){t.setTime(+t+e*uA)},function(t,e){return(e-t)/uA},function(t){return t.getMinutes()}),yA=oA(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*hA)},function(t,e){return(e-t)/hA},function(t){return t.getUTCSeconds()}),bA=oA(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});bA.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?oA(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):bA:null};var wA=bA,xA=new Date,_A=new Date;function CA(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return xA.setTime(+e),_A.setTime(+i),t(xA),t(_A),Math.floor(n(xA,_A))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var SA=864e5,EA=6048e5;function kA(t){return CA(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/EA})}var AA=kA(0),DA=kA(1),TA=(kA(2),kA(3),kA(4)),RA=(kA(5),kA(6),CA(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/SA},function(t){return t.getUTCDate()-1}));function FA(t){return CA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/EA})}var LA=FA(0),MA=FA(1),IA=(FA(2),FA(3),FA(4)),$A=(FA(5),FA(6),CA(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/SA},function(t){return t.getDate()-1})),OA=CA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});OA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var PA=OA,NA=CA(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});NA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var BA=NA;function UA(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function VA(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function HA(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var jA,zA,WA={"-":"",_:" ",0:"0"},GA=/^\s*\d+/,qA=/^%/,KA=/[\\^$*+?|[\]().{}]/g;function XA(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s68?1900:2e3),n+i[0].length):-1}function oD(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function aD(t,e,n){var i=GA.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function lD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function cD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function hD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function uD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function dD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function pD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function fD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function gD(t,e,n){var i=GA.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function mD(t,e,n){var i=qA.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function vD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function yD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function bD(t,e){return XA(t.getDate(),e,2)}function wD(t,e){return XA(t.getHours(),e,2)}function xD(t,e){return XA(t.getHours()%12||12,e,2)}function _D(t,e){return XA(1+$A.count(PA(t),t),e,3)}function CD(t,e){return XA(t.getMilliseconds(),e,3)}function SD(t,e){return CD(t,e)+"000"}function ED(t,e){return XA(t.getMonth()+1,e,2)}function kD(t,e){return XA(t.getMinutes(),e,2)}function AD(t,e){return XA(t.getSeconds(),e,2)}function DD(t){var e=t.getDay();return 0===e?7:e}function TD(t,e){return XA(LA.count(PA(t)-1,t),e,2)}function RD(t){var e=t.getDay();return e>=4||0===e?IA(t):IA.ceil(t)}function FD(t,e){return t=RD(t),XA(IA.count(PA(t),t)+(4===PA(t).getDay()),e,2)}function LD(t){return t.getDay()}function MD(t,e){return XA(MA.count(PA(t)-1,t),e,2)}function ID(t,e){return XA(t.getFullYear()%100,e,2)}function $D(t,e){return XA((t=RD(t)).getFullYear()%100,e,2)}function OD(t,e){return XA(t.getFullYear()%1e4,e,4)}function PD(t,e){var n=t.getDay();return XA((t=n>=4||0===n?IA(t):IA.ceil(t)).getFullYear()%1e4,e,4)}function ND(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+XA(e/60|0,"0",2)+XA(e%60,"0",2)}function BD(t,e){return XA(t.getUTCDate(),e,2)}function UD(t,e){return XA(t.getUTCHours(),e,2)}function VD(t,e){return XA(t.getUTCHours()%12||12,e,2)}function HD(t,e){return XA(1+RA.count(BA(t),t),e,3)}function jD(t,e){return XA(t.getUTCMilliseconds(),e,3)}function zD(t,e){return jD(t,e)+"000"}function WD(t,e){return XA(t.getUTCMonth()+1,e,2)}function GD(t,e){return XA(t.getUTCMinutes(),e,2)}function qD(t,e){return XA(t.getUTCSeconds(),e,2)}function KD(t){var e=t.getUTCDay();return 0===e?7:e}function XD(t,e){return XA(AA.count(BA(t)-1,t),e,2)}function YD(t){var e=t.getUTCDay();return e>=4||0===e?TA(t):TA.ceil(t)}function JD(t,e){return t=YD(t),XA(TA.count(BA(t),t)+(4===BA(t).getUTCDay()),e,2)}function QD(t){return t.getUTCDay()}function ZD(t,e){return XA(DA.count(BA(t)-1,t),e,2)}function tT(t,e){return XA(t.getUTCFullYear()%100,e,2)}function eT(t,e){return XA((t=YD(t)).getUTCFullYear()%100,e,2)}function nT(t,e){return XA(t.getUTCFullYear()%1e4,e,4)}function iT(t,e){var n=t.getUTCDay();return XA((t=n>=4||0===n?TA(t):TA.ceil(t)).getUTCFullYear()%1e4,e,4)}function rT(){return"+0000"}function sT(){return"%"}function oT(t){return+t}function aT(t){return Math.floor(+t/1e3)}jA=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,c=JA(r),h=QA(r),u=JA(s),d=QA(s),p=JA(o),f=QA(o),g=JA(a),m=QA(a),v=JA(l),y=QA(l),b={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:bD,e:bD,f:SD,g:$D,G:PD,H:wD,I:xD,j:_D,L:CD,m:ED,M:kD,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:oT,s:aT,S:AD,u:DD,U:TD,V:FD,w:LD,W:MD,x:null,X:null,y:ID,Y:OD,Z:ND,"%":sT},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:BD,e:BD,f:zD,g:eT,G:iT,H:UD,I:VD,j:HD,L:jD,m:WD,M:GD,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:oT,s:aT,S:qD,u:KD,U:XD,V:JD,w:QD,W:ZD,x:null,X:null,y:tT,Y:nT,Z:rT,"%":sT},x={a:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y[i[0].toLowerCase()],n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m[i[0].toLowerCase()],n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:cD,e:cD,f:gD,g:sD,G:rD,H:uD,I:uD,j:hD,L:fD,m:lD,M:dD,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=h[i[0].toLowerCase()],n+i[0].length):-1},q:aD,Q:vD,s:yD,S:pD,u:tD,U:eD,V:nD,w:ZA,W:iD,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:sD,Y:rD,Z:oD,"%":mD};function _(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=VA(HA(s.y,0,1))).getUTCDay(),i=r>4||0===r?DA.ceil(i):DA(i),i=RA.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=UA(HA(s.y,0,1))).getDay(),i=r>4||0===r?MA.ceil(i):MA(i),i=$A.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?VA(HA(s.y,0,1)).getUTCDay():UA(HA(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,VA(s)):UA(s)}}function S(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=x[r in WA?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=_(n,b),b.X=_(i,b),b.c=_(e,b),w.x=_(n,w),w.X=_(i,w),w.c=_(e,w),{format:function(t){var e=_(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=C(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=C(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),zA=jA.format;var lT=function(t){return null===t?NaN:+t};const cT=Qk(Jk).right;Qk(lT);var hT=cT,uT=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function dT(t){return+t}var pT=[0,1];function fT(t){return t}function gT(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function mT(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r(e=o[l-1])&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?vT:mT,r=s=null,u}function u(e){return isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(c(e)))}return u.invert=function(n){return c(e((s||(s=i(a,o.map(t),aE)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,dT),h()):o.slice()},u.range=function(t){return arguments.length?(a=Array.from(t),h()):a.slice()},u.rangeRound=function(t){return a=Array.from(t),l=uT,h()},u.clamp=function(t){return arguments.length?(c=!!t||fT,h()):c!==fT},u.interpolate=function(t){return arguments.length?(l=t,h()):l},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,i){return t=n,e=i,h()}}()(fT,fT)}function wT(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var xT=31536e6;function _T(t){return new Date(t)}function CT(t){return t instanceof Date?+t:+new Date(+t)}function ST(t,e,n,i,r,s,o,a,l){var c=bT(),h=c.invert,u=c.domain,d=l(".%L"),p=l(":%S"),f=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),v=l("%b %d"),y=l("%B"),b=l("%Y"),w=[[o,1,1e3],[o,5,5e3],[o,15,15e3],[o,30,3e4],[s,1,6e4],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,xT]];function x(a){return(o(a)=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AT(t){if(!(e=kT.exec(t)))throw new Error("invalid format: "+t);var e;return new DT({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function DT(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function TT(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}AT.prototype=DT.prototype,DT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var RT,FT,LT,MT,IT=function(t){return(t=TT(Math.abs(t)))?t[1]:NaN},$T=function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},OT={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return $T(100*t,e)},r:$T,s:function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(RT=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+TT(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},PT=function(t){return t},NT=Array.prototype.map,BT=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function UT(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),s=new Array(r=Math.ceil(e-t+1));++a0;){if((r=nA(l,c,n))===i)return s[o]=l,s[a]=c,e(s);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function VT(){var t=bT();return t.copy=function(){return yT(t,VT())},wT.apply(t,arguments),UT(t)}FT=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?PT:(e=NT.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?PT:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(NT.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=AT(t)).fill,n=t.align,u=t.sign,d=t.symbol,p=t.zero,f=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):OT[y]||(void 0===m&&(m=12),v=!0,y="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?s:/[%p]/.test(y)?l:"",x=OT[y],_=/[defgprs%]/.test(y);function C(t){var r,s,l,d=b,C=w;if("c"===y)C=x(t)+C,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==u&&(S=!1),d=(S?"("===u?u:c:"-"===u||"("===u?"":u)+d,C=("s"===y?BT[8+RT/3]:"")+C+(S&&"("===u?")":""),_)for(r=-1,s=t.length;++r(l=t.charCodeAt(r))||l>57){C=(46===l?o+t.slice(r+1):t.slice(r))+C,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var E=d.length+t.length+C.length,k=E>1)+d+t+C+k.slice(E);break;default:t=k+d+t+C}return a(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return t+""},C}return{format:u,formatPrefix:function(t,e){var n=u(((t=AT(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(IT(e)/3))),r=Math.pow(10,-i),s=BT[8+i/3];return function(t){return n(r*t)+s}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),LT=FT.format,MT=FT.formatPrefix;var HT=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,s=Math.floor(r),o=+n(t[s],s,t);return o+(+n(t[s+1],s+1,t)-o)*(r-s)}}function XT(){var t,e=[],n=[],i=[];function r(){var t=0,r=Math.max(1,n.length);for(i=new Array(r-1);++t0?i[r-1]:e[0],rtR)if(Math.abs(h*a-l*c)>tR&&r){var d=n-s,p=i-o,f=a*a+l*l,g=d*d+p*p,m=Math.sqrt(f),v=Math.sqrt(u),y=r*Math.tan((QT-Math.acos((f+u-g)/(2*m*v)))/2),b=y/v,w=y/m;Math.abs(b-1)>tR&&(this._+="L"+(t+b*c)+","+(e+b*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,c=e+a,h=1^s,u=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>tR||Math.abs(this._y1-c)>tR)&&(this._+="L"+l+","+c),n&&(u<0&&(u=u%ZT+ZT),u>eR?this._+="A"+n+","+n+",0,1,"+h+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>tR&&(this._+="A"+n+","+n+",0,"+ +(u>=QT)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var rR=iR,sR=function(t){return function(){return t}};function oR(t){return t[0]}function aR(t){return t[1]}var lR=function(){var t=oR,e=aR,n=sR(!0),i=null,r=JT,s=null;function o(o){var a,l,c,h=o.length,u=!1;for(null==i&&(s=r(c=rR())),a=0;a<=h;++a)!(a=h;--u)a.point(m[u],v[u]);a.lineEnd(),a.areaEnd()}g&&(m[c]=+t(d,c,l),v[c]=+n(d,c,l),a.point(e?+e(d,c,l):m[c],i?+i(d,c,l):v[c]))}if(p)return a=null,p+""||null}function c(){return lR().defined(r).curve(o).context(s)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:sR(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:sR(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:sR(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:sR(+t),l):i},l.lineX0=l.lineY0=function(){return c().x(t).y(n)},l.lineY1=function(){return c().x(t).y(i)},l.lineX1=function(){return c().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:sR(!!t),l):r},l.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),l):o},l.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),l):s},l},hR=function(){};function uR(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function dR(t,e){this._context=t,this._k=(1-e)/6}function pR(t,e){this._context=t,this._k=(1-e)/6}function fR(t){this._curve=t}dR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:uR(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new dR(t,e)}return n.tension=function(e){return t(+e)},n}(0),pR.prototype={areaStart:hR,areaEnd:hR,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new pR(t,e)}return n.tension=function(e){return t(+e)},n}(0),fR.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Math,Math,Math,Math,Math,Math,Math,Math;var gR=function(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(i-e)/t.value;++a=0;)e+=n[i].value;else e=1;t.value=e}function yR(t,e){var n,i,r,s,o,a=new _R(t),l=+t.value&&(a.value=t.value),c=[a];for(null==e&&(e=bR);n=c.pop();)if(l&&(n.value=+n.data.value),(r=e(n.data))&&(o=r.length))for(n.children=new Array(o),s=o-1;s>=0;--s)c.push(i=n.children[s]=new _R(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(xR)}function bR(t){return t.children}function wR(t){t.data=t.data.data}function xR(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _R(t){this.data=t,this.depth=this.height=0,this.parent=null}!function t(e){function n(t,n,i,r,s){!function(t,e,n,i,r,s){for(var o,a,l,c,h,u,d,p,f,g,m,v=[],y=e.children,b=0,w=0,x=y.length,_=e.value;bd&&(d=a),m=h*h*g,(p=Math.max(d/m,m/u))>f){h-=a;break}f=p}v.push(o={value:h,dice:l1?e:1)},n}((1+Math.sqrt(5))/2),_R.prototype=yR.prototype={constructor:_R,count:function(){return this.eachAfter(vR)},each:function(t){var e,n,i,r,s=this,o=[s];do{for(e=o.reverse(),o=[];s=e.pop();)if(t(s),n=s.children)for(i=0,r=n.length;i=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)i.push(e=e.parent);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return yR(this).eachBefore(wR)}};const CR=["caretElm"];function SR(t,e){}const ER=function(t){return{model:t}};function kR(t,e){if(1&t&&(Mo(0,"span"),Do(1,SR,0,0,"ng-template",5),Io()),2&t){const t=zo();Qr(1),Fo("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Vl(2,ER,t.context))}}function AR(t,e){1&t&&$o(0,"span",6),2&t&&Fo("innerHTML",zo().title,er)}function DR(t,e){if(1&t&&(ln(),cn(),$o(0,"ngx-charts-scale-legend",4)),2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("valueRange",t.legendOptions.domain)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)}}function TR(t,e){if(1&t){const t=No();ln(),cn(),Mo(0,"ngx-charts-legend",5),Vo("labelClick",function(e){return Ie(t),zo().legendLabelClick.emit(e)})("labelActivate",function(e){return Ie(t),zo().legendLabelActivate.emit(e)})("labelDeactivate",function(e){return Ie(t),zo().legendLabelDeactivate.emit(e)}),Io()}if(2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("data",t.legendOptions.domain)("title",t.legendOptions.title)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)("activeEntries",t.activeEntries)}}const RR=["*"],FR=["ngx-charts-axis-label",""],LR=["ticksel"],MR=["ngx-charts-x-axis-ticks",""];function IR(t,e){if(1&t&&(ln(),Mo(0,"g",3),Mo(1,"title"),va(2),Io(),Mo(3,"text",4),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("text-anchor",n.textAnchor)("transform",n.textTransform),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function $R(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",6),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),ko("y1",-t.gridLineHeight)}}function OR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,$R,2,2,"g",5),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}const PR=["ngx-charts-x-axis",""];function NR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksHeight(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("rotateTicks",t.rotateTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickStroke",t.tickStroke)("scale",t.xScale)("orient",t.xOrient)("showGridLines",t.showGridLines)("gridLineHeight",t.dims.height)("width",t.dims.width)("tickValues",t.ticks)}}function BR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient","bottom")("height",t.dims.height)("width",t.dims.width)}}const UR=["ngx-charts-y-axis-ticks",""];function VR(t,e){if(1&t&&(ln(),Mo(0,"g",4),Mo(1,"title"),va(2),Io(),Mo(3,"text",5),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("dy",n.dy)("x",n.x1)("y",n.y1)("text-anchor",n.textAnchor),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function HR(t,e){if(1&t&&(ln(),$o(0,"path",6)),2&t){const t=zo();ko("d",t.referenceAreaPath)("transform",t.gridLineTransform())}}function jR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",zo(3).gridLineWidth)}function zR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",-zo(3).gridLineWidth)}function WR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,jR,1,1,"line",8),Do(2,zR,1,1,"line",8),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),Fo("ngIf","left"===t.orient),Qr(1),Fo("ngIf","right"===t.orient)}}function GR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,WR,3,3,"g",7),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}function qR(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"title"),va(2),Io(),Mo(3,"text",11),va(4),Io(),Io()),2&t){const t=zo(2).$implicit,e=zo();Qr(2),ya(e.tickTrim(e.tickFormat(t.value))),Qr(1),ko("dy",e.dy)("y",-6)("x",e.gridLineWidth)("text-anchor",e.textAnchor),Qr(1),ba(" ",t.name," ")}}function KR(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",10),Do(2,qR,5,6,"g",7),Io()),2&t){const t=zo().$implicit,e=zo();ko("transform",e.transform(t.value)),Qr(1),ko("x2",e.gridLineWidth)("transform",e.gridLineTransform()),Qr(1),Fo("ngIf",e.showRefLabels)}}function XR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,KR,3,4,"g",7),Io()),2&t){const t=zo();Qr(1),Fo("ngIf",t.showRefLines)}}const YR=["ngx-charts-y-axis",""];function JR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksWidth(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickValues",t.ticks)("tickStroke",t.tickStroke)("scale",t.yScale)("orient",t.yOrient)("showGridLines",t.showGridLines)("gridLineWidth",t.dims.width)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)("height",t.dims.height)}}function QR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient",t.yOrient)("height",t.dims.height)("width",t.dims.width)}}const ZR=["ngx-charts-circle-series",""];function tF(t,e){if(1&t&&(ln(),$o(0,"rect",4)),2&t){const t=zo(2);Fo("@animationState","active"),ko("x",t.circle.cx-t.circle.radius)("y",t.circle.cy)("width",2*t.circle.radius)("height",t.circle.height)("fill",t.gradientFill)}}const eF=function(t){return{name:t}};function nF(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"defs"),$o(2,"g",1),Io(),Do(3,tF,1,6,"rect",2),Mo(4,"g",3),Vo("select",function(){Ie(t);const e=zo();return e.onClick(e.circle.data)})("activate",function(){return Ie(t),zo().activateCircle()})("deactivate",function(){return Ie(t),zo().deactivateCircle()}),Io(),Io()}if(2&t){const t=zo();Qr(2),Fo("name",t.gradientId)("stops",t.circle.gradientStops),Qr(1),Fo("ngIf",t.barVisible&&"standard"===t.type),Qr(1),ra("active",t.isActive(Vl(18,eF,t.circle.seriesName))),Fo("cx",t.circle.cx)("cy",t.circle.cy)("r",t.circle.radius)("fill",t.circle.color)("pointerEvents",0===t.circle.value?"none":"all")("data",t.circle.value)("classNames",t.circle.classNames)("tooltipDisabled",t.tooltipDisabled)("tooltipPlacement","top")("tooltipType","tooltip")("tooltipTitle",t.tooltipTemplate?void 0:t.getTooltipText(t.circle))("tooltipTemplate",t.tooltipTemplate)("tooltipContext",t.circle.data)}}const iF=["ngx-charts-circle",""],rF=["ngx-charts-svg-linear-gradient",""];function sF(t,e){if(1&t&&(ln(),$o(0,"stop")),2&t){const t=e.$implicit;ia("stop-color",t.color)("stop-opacity",t.opacity),ko("offset",t.offset+"%")}}const oF=["ngx-charts-area",""];function aF(t,e){if(1&t&&(ln(),Mo(0,"defs"),$o(1,"g",2),Io()),2&t){const t=zo();Qr(1),Fo("name",t.gradientId)("stops",t.gradientStops)}}const lF=["tooltipAnchor"],cF=["ngx-charts-tooltip-area",""];function hF(t,e){if(1&t&&(Mo(0,"div",6),$o(1,"span",7),va(2),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),ia("background-color",t.color),Qr(1),ba(" ",n.getToolTipText(t)," ")}}function uF(t,e){if(1&t&&(ln(),cn(),Mo(0,"div",4),Do(1,hF,3,3,"div",5),Io()),2&t){const t=e.model;Qr(1),Fo("ngForOf",t)}}const dF=["ngx-charts-timeline",""];function pF(t,e){if(1&t&&(Mo(0,"header",4),Mo(1,"span",5),va(2),Io(),Io()),2&t){const t=zo();Qr(2),ya(t.title)}}function fF(t,e){if(1&t){const t=No();Mo(0,"li",6),Mo(1,"ngx-charts-legend-entry",7),Vo("select",function(e){return Ie(t),zo().labelClick.emit(e)})("activate",function(e){return Ie(t),zo().activate(e)})("deactivate",function(e){return Ie(t),zo().deactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(1),Fo("label",t.label)("formattedLabel",t.formattedLabel)("color",t.color)("isActive",n.isActive(t))}}const gF=["tooltipTemplate"],mF=["seriesTooltipTemplate"],vF=function(t,e){return[t,e]},yF=["ngx-charts-line",""];function bF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",7),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateXAxisHeight(e)}),Io()}if(2&t){const t=zo();Fo("xScale",t.xScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showXAxisLabel)("labelText",t.xAxisLabel)("trimTicks",t.trimXAxisTicks)("rotateTicks",t.rotateXAxisTicks)("maxTickLength",t.maxXAxisTickLength)("tickFormatting",t.xAxisTickFormatting)("ticks",t.xAxisTicks)}}function wF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",8),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateYAxisWidth(e)}),Io()}if(2&t){const t=zo();Fo("yScale",t.yScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showYAxisLabel)("labelText",t.yAxisLabel)("trimTicks",t.trimYAxisTicks)("maxTickLength",t.maxYAxisTickLength)("tickFormatting",t.yAxisTickFormatting)("ticks",t.yAxisTicks)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)}}function xF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",9),Io()),2&t){const t=e.$implicit,n=zo();Fo("@animationState","active"),Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("activeEntries",n.activeEntries)("scaleType",n.scaleType)("curve",n.curve)("rangeFillOpacity",n.rangeFillOpacity)("hasRange",n.hasRange)("animations",n.animations)}}function _F(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"g",13),Vo("select",function(e){return Ie(t),zo(2).onClick(e)})("activate",function(e){return Ie(t),zo(2).onActivate(e)})("deactivate",function(e){return Ie(t),zo(2).onDeactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("visibleValue",n.hoveredVertical)("activeEntries",n.activeEntries)("tooltipDisabled",n.tooltipDisabled)("tooltipTemplate",n.tooltipTemplate)}}function CF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",10),Vo("mouseleave",function(){return Ie(t),zo().hideCircles()}),Mo(1,"g",11),Vo("hover",function(e){return Ie(t),zo().updateHoveredVertical(e)}),Io(),Do(2,_F,2,9,"g",12),Io()}if(2&t){const t=zo();Qr(1),Fo("dims",t.dims)("xSet",t.xSet)("xScale",t.xScale)("yScale",t.yScale)("results",t.results)("colors",t.colors)("tooltipDisabled",t.tooltipDisabled)("tooltipTemplate",t.seriesTooltipTemplate),Qr(1),Fo("ngForOf",t.results)}}function SF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",15),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.timelineXScale)("yScale",n.timelineYScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("curve",n.curve)("hasRange",n.hasRange)("animations",n.animations)}}function EF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",14),Vo("onDomainChange",function(e){return Ie(t),zo().updateDomain(e)}),Do(1,SF,2,8,"g",4),Io()}if(2&t){const t=zo();Fo("results",t.results)("view",Hl(10,vF,t.timelineWidth,t.height))("height",t.timelineHeight)("scheme",t.scheme)("customColors",t.customColors)("scaleType",t.scaleType)("legend",t.legend),ko("transform",t.timelineTransform),Qr(1),Fo("ngForOf",t.results)("ngForTrackBy",t.trackBy)}}const kF=["ngx-charts-line-series",""];function AF(t,e){if(1&t&&(ln(),$o(0,"g",4)),2&t){const t=zo();Fo("name",t.gradientId)("stops",t.gradientStops)}}function DF(t,e){if(1&t&&(ln(),$o(0,"g",5)),2&t){const t=zo();ra("active",t.isActive(t.data))("inactive",t.isInactive(t.data)),Fo("data",t.data)("path",t.outerPath)("fill",t.hasGradient?t.gradientUrl:t.colors.getColor(t.data.name))("opacity",t.rangeFillOpacity)("animations",t.animations)}}let TF=(()=>{class t{constructor(t,e,n){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n}static setGlobalRootViewContainer(e){t.globalRootViewContainer=e}getRootViewContainer(){if(this._container)return this._container;if(t.globalRootViewContainer)return t.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(t){this._container=t}getComponentRootNode(t){return t.element?t.element.nativeElement:t.hostView&&t.hostView.rootNodes.length>0?t.hostView.rootNodes[0]:t.location.nativeElement}getRootViewContainerNode(t){return this.getComponentRootNode(t)}projectComponentBindings(t,e){if(e){if(void 0!==e.inputs){const n=Object.getOwnPropertyNames(e.inputs);for(const i of n)t.instance[i]=e.inputs[i]}if(void 0!==e.outputs){const n=Object.getOwnPropertyNames(e.outputs);for(const i of n)t.instance[i]=e.outputs[i]}}return t}appendComponent(t,e={},n){n||(n=this.getRootViewContainer());const i=this.getComponentRootNode(n),r=new X_(i,this.componentFactoryResolver,this.applicationRef,this.injector),s=new G_(t),o=r.attach(s);return this.projectComponentBindings(o,e),o}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(Ua),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t.globalRootViewContainer=null,t})();function RF(t,e,n){let i,r,s;n=n||{};let o=null,a=0;function l(){a=!1===n.leading?0:+new Date,o=null,s=t.apply(i,r)}return function(){const c=+new Date;a||!1!==n.leading||(a=c);const h=e-(c-a);return i=this,r=arguments,h<=0?(clearTimeout(o),o=null,a=c,s=t.apply(i,r)):o||!1===n.trailing||(o=setTimeout(l,h)),s}}var FF=function(t){return t[t.top="top"]="top",t[t.bottom="bottom"]="bottom",t[t.left="left"]="left",t[t.right="right"]="right",t}({});function LF(t,e,n){return"top"===n?t.top-7:"bottom"===n?t.top+t.height-e.height+7:"center"===n?t.top+t.height/2-e.height/2:void 0}function MF(t,e,n){return"left"===n?t.left-7:"right"===n?t.left+t.width-e.width+7:"center"===n?t.left+t.width/2-e.width/2:void 0}class IF{static calculateVerticalAlignment(t,e,n){let i=LF(t,e,n);return i+e.height>window.innerHeight&&(i=window.innerHeight-e.height),i}static calculateVerticalCaret(t,e,n,i){let r;"top"===i&&(r=t.height/2-n.height/2+7),"bottom"===i&&(r=e.height-t.height/2-n.height/2-7),"center"===i&&(r=e.height/2-n.height/2);const s=LF(t,e,i);return s+e.height>window.innerHeight&&(r+=s+e.height-window.innerHeight),r}static calculateHorizontalAlignment(t,e,n){let i=MF(t,e,n);return i+e.width>window.innerWidth&&(i=window.innerWidth-e.width),i}static calculateHorizontalCaret(t,e,n,i){let r;"left"===i&&(r=t.width/2-n.width/2+7),"right"===i&&(r=e.width-t.width/2-n.width/2-7),"center"===i&&(r=e.width/2-n.width/2);const s=MF(t,e,i);return s+e.width>window.innerWidth&&(r+=s+e.width-window.innerWidth),r}static shouldFlip(t,e,n,i){let r=!1;return"right"===n&&t.left+t.width+e.width+i>window.innerWidth&&(r=!0),"left"===n&&t.left-e.width-i<0&&(r=!0),"top"===n&&t.top-e.height-i<0&&(r=!0),"bottom"===n&&t.top+t.height+e.height+i>window.innerHeight&&(r=!0),r}static positionCaret(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=-7,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.left?(o=e.width,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.top?(s=e.height,o=IF.calculateHorizontalCaret(n,e,i,r)):t===FF.bottom&&(s=-7,o=IF.calculateHorizontalCaret(n,e,i,r)),{top:s,left:o}}static positionContent(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=n.left+n.width+i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.left?(o=n.left-e.width-i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.top?(s=n.top-e.height-i,o=IF.calculateHorizontalAlignment(n,e,r)):t===FF.bottom&&(s=n.top+n.height+i,o=IF.calculateHorizontalAlignment(n,e,r)),{top:s,left:o}}static determinePlacement(t,e,n,i){if(IF.shouldFlip(n,e,t,i)){if(t===FF.right)return FF.left;if(t===FF.left)return FF.right;if(t===FF.top)return FF.bottom;if(t===FF.bottom)return FF.top}return t}}let $F=(()=>{class t{constructor(t,e){this.element=t,this.renderer=e}get cssClasses(){let t="ngx-charts-tooltip-content";return t+=" position-"+this.placement,t+=" type-"+this.type,t+=" "+this.cssClass,t}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){const t=this.element.nativeElement,e=this.host.nativeElement.getBoundingClientRect();if(!e.height&&!e.width)return;const n=t.getBoundingClientRect();this.checkFlip(e,n),this.positionContent(t,e,n),this.showCaret&&this.positionCaret(e,n),setTimeout(()=>this.renderer.addClass(t,"animate"),1)}positionContent(t,e,n){const{top:i,left:r}=IF.positionContent(this.placement,n,e,this.spacing,this.alignment);this.renderer.setStyle(t,"top",i+"px"),this.renderer.setStyle(t,"left",r+"px")}positionCaret(t,e){const n=this.caretElm.nativeElement,i=n.getBoundingClientRect(),{top:r,left:s}=IF.positionCaret(this.placement,e,t,i,this.alignment);this.renderer.setStyle(n,"top",r+"px"),this.renderer.setStyle(n,"left",s+"px")}checkFlip(t,e){this.placement=IF.determinePlacement(this.placement,e,t,this.spacing)}onWindowResize(){this.position()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-tooltip-content"]],viewQuery:function(t,e){if(1&t&&sc(CR,!0),2&t){let t;ic(t=lc())&&(e.caretElm=t.first)}},hostVars:2,hostBindings:function(t,e){1&t&&Vo("resize",function(){return e.onWindowResize()},!1,hr),2&t&&sa(e.cssClasses)},inputs:{placement:"placement",host:"host",showCaret:"showCaret",type:"type",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},decls:6,vars:6,consts:[[3,"hidden"],["caretElm",""],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(t,e){var n;1&t&&(Mo(0,"div"),$o(1,"span",0,1),Mo(3,"div",2),Do(4,kR,2,4,"span",3),Do(5,AR,1,1,"span",4),Io(),Io()),2&t&&(Qr(1),"tooltip-caret position-",n=e.placement,"",la(ri,oa,Ao(Le(),"tooltip-caret position-",n,""),!0),Fo("hidden",!e.showCaret),Qr(3),Fo("ngIf",!e.title),Qr(1),Fo("ngIf",e.title))},directives:[Bh,Gh],styles:[".ngx-charts-tooltip-content{border-radius:3px;display:block;font-weight:400;opacity:0;pointer-events:none!important;position:fixed;z-index:5000}.ngx-charts-tooltip-content.type-popover{background:#fff;border:1px solid #72809b;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);color:#060709;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-bottom:7px solid #fff;border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip{background:rgba(0,0,0,.75);color:#fff;font-size:12px;padding:0 10px;pointer-events:auto;text-align:center}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-bottom:7px solid rgba(0,0,0,.75);border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content .tooltip-label{display:block;font-size:1em;line-height:1em;padding:8px 5px 5px}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.position-right{transform:translate3d(10px,0,0)}.ngx-charts-tooltip-content.position-left{transform:translate3d(-10px,0,0)}.ngx-charts-tooltip-content.position-top{transform:translate3d(0,-10px,0)}.ngx-charts-tooltip-content.position-bottom{transform:translate3d(0,10px,0)}.ngx-charts-tooltip-content.animate{opacity:1;pointer-events:auto;transform:translateZ(0);transition:opacity .3s,transform .3s}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{line-height:1.2em;padding:5px 0;text-align:left}.tooltip-item .tooltip-item-color{border-radius:3px;color:#5b646b;display:inline-block;height:12px;margin-right:5px;width:12px}"],encapsulation:2}),function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);s>3&&o&&Object.defineProperty(e,n,o)}([function(t,e,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,e,{configurable:!0,enumerable:n.enumerable,value:RF(n.value,100,void 0)}),this[e]}}}],t.prototype,"onWindowResize",null),t})(),OF=(()=>{class t extends class{constructor(t){this.injectionService=t,this.defaults={},this.components=new Map}getByType(t=this.type){return this.components.get(t)}create(t){return this.createByType(this.type,t)}createByType(t,e){e=this.assignDefaults(e);const n=this.injectComponent(t,e);return this.register(t,n),n}destroy(t){const e=this.components.get(t.componentType);if(e&&e.length){const n=e.indexOf(t);n>-1&&(e[n].destroy(),e.splice(n,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(t){const e=this.components.get(t);if(e&&e.length){let t=e.length-1;for(;t>=0;)this.destroy(e[t--])}}injectComponent(t,e){return this.injectionService.appendComponent(t,e)}assignDefaults(t){const e=Object.assign({},this.defaults.inputs),n=Object.assign({},this.defaults.outputs);return t.inputs||t.outputs||(t={inputs:t}),e&&(t.inputs=Object.assign(Object.assign({},e),t.inputs)),n&&(t.outputs=Object.assign(Object.assign({},n),t.outputs)),t}register(t,e){this.components.has(t)||this.components.set(t,[]),this.components.get(t).push(e)}}{constructor(t){super(t),this.type=$F}}return t.\u0275fac=function(e){return new(e||t)(bi(TF))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),PF=(()=>{class t{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new Wl,this.legendLabelActivate=new Wl,this.legendLabelDeactivate=new Wl}ngOnChanges(t){this.update()}update(){let t=0;this.showLegend&&(this.legendType=this.getLegendType(),this.legendOptions&&"right"!==this.legendOptions.position||(t="scaleLegend"===this.legendType?1:2)),this.chartWidth=Math.floor(this.view[0]*(12-t)/12),this.legendWidth=this.legendOptions&&"right"!==this.legendOptions.position?this.chartWidth:Math.floor(this.view[0]*t/12)}getLegendType(){return"linear"===this.legendOptions.scaleType?"scaleLegend":"legend"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-chart"]],inputs:{showLegend:"showLegend",animations:"animations",legendType:"legendType",view:"view",legendOptions:"legendOptions",data:"data",legendData:"legendData",colors:"colors",activeEntries:"activeEntries"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},features:[Pa([OF]),le],ngContentSelectors:RR,decls:5,vars:8,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"horizontal","valueRange","colors","height","width",4,"ngIf"],["class","chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0),ln(),Mo(1,"svg",1),qo(2),Io(),Do(3,DR,1,5,"ngx-charts-scale-legend",2),Do(4,TR,1,7,"ngx-charts-legend",3),Io()),2&t&&(ia("width",e.view[0],"px"),Fo("@animationState","active")("@.disabled",!e.animations),Qr(1),ko("width",e.chartWidth)("height",e.view[1]),Qr(2),Fo("ngIf",e.showLegend&&"scaleLegend"===e.legendType),Qr(1),Fo("ngIf",e.showLegend&&"legend"===e.legendType))},directives:function(){return[Bh,fL,dL]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru("500ms 100ms",Lu({opacity:1}))])])]},changeDetection:0}),t})(),NF=(()=>{class t{constructor(t,e){this.element=t,this.zone=e,this.visible=new Wl,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const t=()=>{if(!this.element)return;const{offsetHeight:e,offsetWidth:n}=this.element.nativeElement;e&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t())})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275dir=Wt({type:t,selectors:[["visibility-observer"]],outputs:{visible:"visible"}}),t})(),BF=(()=>{class t{constructor(t,e,n){this.chartElement=t,this.zone=e,this.cd=n,this.scheme="cool",this.schemeType="ordinal",this.animations=!0,this.select=new Wl}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new NF(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(t){this.update()}update(){if(this.results=this.results?this.cloneData(this.results):[],this.view)this.width=this.view[0],this.height=this.view[1];else{const t=this.getContainerDims();t&&(this.width=t.width,this.height=t.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let t,e;const n=this.chartElement.nativeElement;if(null!==n.parentNode){const i=n.parentNode.getBoundingClientRect();t=i.width,e=i.height}return t&&e?{width:t,height:e}:null}formatDates(){for(let t=0;tn.lift(new Y_(t,e))}(200)).subscribe(t=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=t}cloneData(t){const e=[];for(const n of t){const t={name:n.name};if(void 0!==n.value&&(t.value=n.value),void 0!==n.series){t.series=[];for(const e of n.series){const n=Object.assign({},e);t.series.push(n)}}void 0!==n.extra&&(t.extra=JSON.parse(JSON.stringify(n.extra))),e.push(t)}return e}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["base-chart"]],inputs:{scheme:"scheme",schemeType:"schemeType",animations:"animations",results:"results",view:"view",customColors:"customColors"},outputs:{select:"select"},features:[le],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"div")},encapsulation:2}),t})(),UF=(()=>{class t{constructor(t){this.textHeight=25,this.margin=5,this.element=t.nativeElement}ngOnChanges(t){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case"top":case"bottom":this.y=this.offset,this.x=this.width/2;break;case"left":this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case"right":this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)"}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},features:[le],attrs:FR,decls:2,vars:6,template:function(t,e){1&t&&(ln(),Mo(0,"text"),va(1),Io()),2&t&&(ko("stroke-width",e.strokeWidth)("x",e.x)("y",e.y)("text-anchor",e.textAnchor)("transform",e.transform),Qr(1),ba(" ",e.label," "))},encapsulation:2,changeDetection:0}),t})();function VF(t,e=16){return"string"!=typeof t?"number"==typeof t?t+"":"":(t=t.trim()).length<=e?t:t.slice(0,e)+"..."}function HF(t,e){if(t.length>e){const n=[],i=Math.floor(t.length/e);for(let e=0;e{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.dimensionsChanged=new Wl,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor="middle",this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);t!==this.height&&(this.height=t,this.dimensionsChanged.emit({height:t}),setTimeout(()=>this.updateDims()))}update(){const t=this.scale;this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()};const e=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.adjustedScale=this.scale.bandwidth?function(t){return this.scale(t)+.5*this.scale.bandwidth()}:this.scale,this.textTransform="",e&&0!==e?(this.textTransform=`rotate(${e})`,this.textAnchor="end",this.verticalSpacing=10):this.textAnchor="middle",setTimeout(()=>this.updateDims())}getRotationAngle(t){let e=0;this.maxTicksLength=0;for(let s=0;sthis.maxTicksLength&&(this.maxTicksLength=n)}const n=8*Math.min(this.maxTicksLength,this.maxAllowedLength);let i=n;const r=Math.floor(this.width/t.length);for(;i>r&&e>-90;)e-=30,i=Math.cos(e*(Math.PI/180))*n;return e}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(100);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.width/t)}tickTransform(t){return"translate("+this.adjustedScale(t)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",rotateTicks:"rotateTicks",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineHeight:"gridLineHeight",width:"width"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:MR,decls:4,vars:2,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[4,"ngIf"],["y2","0",1,"gridline-path","gridline-path-vertical"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,IR,5,7,"g",1),Io(),Do(3,OR,2,2,"g",2)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.ticks))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),zF=(()=>{class t{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient="bottom",this.xAxisOffset=0,this.dimensionsChanged=new Wl,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5}ngOnChanges(t){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,void 0!==this.xAxisTickCount&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:t}){const e=t+25+5;e!==this.labelOffset&&(this.labelOffset=e,setTimeout(()=>{this.dimensionsChanged.emit({height:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(t,e){if(1&t&&sc(jF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{rotateTicks:"rotateTicks",showGridLines:"showGridLines",xOrient:"xOrient",xAxisOffset:"xAxisOffset",xScale:"xScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickInterval:"xAxisTickInterval",xAxisTickCount:"xAxisTickCount"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:PR,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,NR,1,12,"g",0),Do(2,BR,1,5,"g",1),Io()),2&t&&(ko("class",e.xAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.xScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,jF,UF],encapsulation:2,changeDetection:0}),t})(),WF=(()=>{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.dimensionsChanged=new Wl,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor="middle",this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);t!==this.width&&(this.width=t,this.dimensionsChanged.emit({width:t}),setTimeout(()=>this.updateDims()))}update(){let t;const e="top"===this.orient||"right"===this.orient?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,t=this.scale,this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()},this.adjustedScale=t.bandwidth?function(e){return t(e)+.5*t.bandwidth()}:t,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case"top":case"bottom":this.transform=function(t){return"translate("+this.adjustedScale(t)+",0)"},this.textAnchor="middle",this.y2=this.innerTickSize*e,this.y1=this.tickSpacing*e,this.dy=e<0?"0em":".71em";break;case"left":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="end",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em";break;case"right":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="start",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em"}setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(t=>t.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(t=>t.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=function(t,e,n,i,r,[s,o,a,l]){let c="";return c="M"+[t+r,e],c+="h"+((n=0===(n=Math.floor(n))?1:n)-2*r),c+=o?`a${[r,r]} 0 0 1 ${[r,r]}`:`h${r}v${r}`,c+="v"+((i=0===(i=Math.floor(i))?1:i)-2*r),c+=l?`a${[r,r]} 0 0 1 ${[-r,r]}`:`v${r}h${-r}`,c+="h"+(2*r-n),c+=a?`a${[r,r]} 0 0 1 ${[-r,-r]}`:`h${-r}v${-r}`,c+="v"+(2*r-i),c+=s?`a${[r,r]} 0 0 1 ${[r,-r]}`:`v${-r}h${r}`,c+="z",c}(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(50);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.height/t)}tickTransform(t){return`translate(${this.adjustedScale(t)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:UR,decls:6,vars:4,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[1,"reference-area"],[4,"ngIf"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,VR,5,9,"g",1),Io(),Do(3,HR,1,2,"path",2),Do(4,GR,2,2,"g",3),Do(5,XR,2,1,"g",3)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngIf",e.referenceLineLength>1&&e.refMax&&e.refMin&&e.showRefLines),Qr(1),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.referenceLines))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),GF=(()=>{class t{constructor(){this.showGridLines=!1,this.yOrient="left",this.yAxisOffset=0,this.dimensionsChanged=new Wl,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5}ngOnChanges(t){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),"right"===this.yOrient?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):(this.offset=this.offset,this.transform=`translate(${this.offset} , 0)`),void 0!==this.yAxisTickCount&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:t}){t!==this.labelOffset&&"right"===this.yOrient?(this.labelOffset=t+this.labelOffset,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0)):t!==this.labelOffset&&(this.labelOffset=t,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(t,e){if(1&t&&sc(WF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{showGridLines:"showGridLines",yOrient:"yOrient",yAxisOffset:"yAxisOffset",yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showLabel:"showLabel",labelText:"labelText",yAxisTickInterval:"yAxisTickInterval",yAxisTickCount:"yAxisTickCount",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:YR,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,JR,1,14,"g",0),Do(2,QR,1,5,"g",1),Io()),2&t&&(ko("class",e.yAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.yScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,WF,UF],encapsulation:2,changeDetection:0}),t})(),qF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();var KF=function(t){return t[t.popover="popover"]="popover",t[t.tooltip="tooltip"]="tooltip",t}({}),XF=function(t){return t[t.left="left"]="left",t[t.center="center"]="center",t[t.right="right"]="right",t}({}),YF=function(t){return t[t.all="all"]="all",t[t.focus="focus"]="focus",t[t.mouseover="mouseover"]="mouseover",t}({});let JF=(()=>{class t{constructor(t,e,n){this.tooltipService=t,this.viewContainerRef=e,this.renderer=n,this.tooltipCssClass="",this.tooltipTitle="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=FF.top,this.tooltipAlignment=XF.center,this.tooltipType=KF.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=YF.all,this.tooltipImmediateExit=!1,this.show=new Wl,this.hide=new Wl}get listensForFocus(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.focus}get listensForHover(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.mouseover}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(t){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(t))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(t){if(this.component||this.tooltipDisabled)return;const e=t?0:this.tooltipShowTimeout;clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();const t=this.createBoundOptions();this.component=this.tooltipService.create(t),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},e)}addHideListeners(t){this.mouseEnterContentEvent=this.renderer.listen(t,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(t,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen(document,"click",e=>{t.contains(e.target)||this.hideTooltip()}))}hideTooltip(t=!1){if(!this.component)return;const e=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),t?e():this.timeout=setTimeout(e,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}}return t.\u0275fac=function(e){return new(e||t)(Ro(OF),Ro(El),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-tooltip",""]],hostBindings:function(t,e){1&t&&Vo("focusin",function(){return e.onFocus()})("blur",function(){return e.onBlur()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(t){return e.onMouseLeave(t.target)})("click",function(){return e.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipTitle:"tooltipTitle",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipShowEvent:"tooltipShowEvent",tooltipImmediateExit:"tooltipImmediateExit",tooltipTemplate:"tooltipTemplate",tooltipContext:"tooltipContext"},outputs:{show:"show",hide:"hide"}}),t})(),QF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[TF,OF],imports:[[qh]]}),t})();function ZF(t){return t instanceof Date?t.toLocaleDateString():t.toLocaleString()}function tL(t){return t.toLocaleString().replace(/[&'`"<>]/g,t=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"}[t]))}const eL={};function nL(){let t=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return t="a"+t,eL[t]?nL():(eL[t]=!0,t)}let iL,rL=(()=>{class t{constructor(){this.type="standard",this.tooltipDisabled=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.barVisible=!1}ngOnInit(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`}ngOnChanges(t){this.update()}update(){this.circle=this.getActiveCircle()}getActiveCircle(){const t=this.data.series.findIndex(t=>{const e=t.name;return e&&this.visibleValue&&e.toString()===this.visibleValue.toString()&&void 0!==t.value});if(-1!==t)return this.mapDataPointToCircle(this.data.series[t],t)}mapDataPointToCircle(t,e){const n=this.data.name,i=t.value,r=t.name,s=ZF(r);let o;o=this.xScale("time"===this.scaleType?r:"linear"===this.scaleType?Number(r):r);const a=this.yScale("standard"===this.type?i:t.d1),l=this.yScale.range()[0]-a;let c;return c=this.colors.getColor("linear"===this.colors.scaleType?"standard"===this.type?i:t.d1:n),{classNames:["circle-data-"+e],value:i,label:r,data:Object.assign({},t,{series:n,value:i,name:r}),cx:o,cy:a,radius:5,height:l,tooltipLabel:s,color:c,opacity:1,seriesName:n,gradientStops:this.getGradientStops(c),min:t.min,max:t.max}}getTooltipText({tooltipLabel:t,value:e,seriesName:n,min:i,max:r}){return`\n ${tL(n)} \u2022 ${tL(t)}\n ${e.toLocaleString()}${this.getTooltipMinMaxText(i,r)}\n `}getTooltipMinMaxText(t,e){if(void 0!==t||void 0!==e){let n=" (";return void 0!==t?(void 0===e&&(n+="\u2265"),n+=t.toLocaleString(),void 0!==e&&(n+=" - ")):void 0!==e&&(n+="\u2264"),void 0!==e&&(n+=e.toLocaleString()),n+=")",n}return""}getGradientStops(t){return[{offset:0,color:t,opacity:.2},{offset:100,color:t,opacity:1}]}onClick(t){this.select.emit(t)}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}activateCircle(){this.barVisible=!0,this.activate.emit({name:this.data.name})}deactivateCircle(){this.barVisible=!1,this.circle.opacity=0,this.deactivate.emit({name:this.data.name})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle-series",""]],inputs:{type:"type",tooltipDisabled:"tooltipDisabled",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",visibleValue:"visibleValue",activeEntries:"activeEntries",tooltipTemplate:"tooltipTemplate"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:ZR,decls:1,vars:1,consts:[[4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["class","tooltip-bar",4,"ngIf"],["ngx-charts-circle","","ngx-tooltip","",1,"circle",3,"cx","cy","r","fill","pointerEvents","data","classNames","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","select","activate","deactivate"],[1,"tooltip-bar"]],template:function(t,e){1&t&&Do(0,nF,5,20,"g",0),2&t&&Fo("ngIf",e.circle)},directives:function(){return[Bh,oL,sL,JF]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru(250,Lu({opacity:1}))])])]},changeDetection:0}),t})(),sL=(()=>{class t{constructor(){this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl}onClick(){this.select.emit(this.data)}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}ngOnChanges(t){this.classNames=Array.isArray(this.classNames)?this.classNames.join(" "):"",this.classNames+="circle"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle",""]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{classNames:"classNames",cx:"cx",cy:"cy",r:"r",fill:"fill",stroke:"stroke",data:"data",circleOpacity:"circleOpacity",pointerEvents:"pointerEvents"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:iF,decls:1,vars:8,template:function(t,e){1&t&&(ln(),$o(0,"circle")),2&t&&ko("cx",e.cx)("cy",e.cy)("r",e.r)("fill",e.fill)("stroke",e.stroke)("opacity",e.circleOpacity)("class",e.classNames)("pointer-events",e.pointerEvents)},encapsulation:2,changeDetection:0}),t})(),oL=(()=>{class t{constructor(){this.orientation="vertical"}ngOnChanges(t){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%","horizontal"===this.orientation?this.x2="100%":"vertical"===this.orientation&&(this.y1="100%")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},features:[le],attrs:rF,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(t,e){1&t&&(ln(),Mo(0,"linearGradient",0),Do(1,sF,1,5,"stop",1),Io()),2&t&&(Fo("id",e.name),ko("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2),Qr(1),Fo("ngForOf",e.stops))},directives:[Ph],encapsulation:2,changeDetection:0}),t})(),aL=(()=>{class t{constructor(t){this.opacity=1,this.startOpacity=.5,this.endOpacity=1,this.gradient=!1,this.animations=!0,this.select=new Wl,this.initialized=!1,this.hasGradient=!1,this.element=t.nativeElement}ngOnChanges(t){this.initialized?this.update():(this.loadAnimation(),this.initialized=!0)}update(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl()}loadAnimation(){this.areaPath=this.startingPath,setTimeout(this.update.bind(this),100)}updatePathEl(){const t=cS(this.element).select(".area");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.startOpacity},{offset:100,color:this.fill,opacity:this.endOpacity}]}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-area",""]],inputs:{opacity:"opacity",startOpacity:"startOpacity",endOpacity:"endOpacity",gradient:"gradient",animations:"animations",data:"data",path:"path",startingPath:"startingPath",fill:"fill",activeLabel:"activeLabel",stops:"stops"},outputs:{select:"select"},features:[le],attrs:oF,decls:2,vars:5,consts:[[4,"ngIf"],[1,"area"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"]],template:function(t,e){1&t&&(Do(0,aF,2,2,"defs",0),ln(),$o(1,"path",1)),2&t&&(Fo("ngIf",e.gradient),Qr(1),ia("opacity",e.opacity),ko("d",e.areaPath)("fill",e.gradient?e.gradientFill:e.fill))},directives:[Bh,oL],encapsulation:2,changeDetection:0}),t})();"undefined"!=typeof window?iL=window:"undefined"!=typeof global&&(iL=global);const lL=iL.MouseEvent;function cL(t,e=!1,n=!0){if("function"==typeof lL)return new lL(t,{bubbles:e,cancelable:n});{const i=document.createEvent("MouseEvent");return i.initEvent(t,e,n),i}}let hL=(()=>{class t{constructor(){this.anchorOpacity=0,this.anchorPos=-1,this.anchorValues=[],this.showPercentage=!1,this.tooltipDisabled=!1,this.hover=new Wl}getValues(t){const e=[];for(const n of this.results){const i=n.series.find(e=>e.name.toString()===t.toString());let r=n.name;if(r instanceof Date&&(r=r.toLocaleDateString()),i){const t=i.name;let s,o=i.value;if(this.showPercentage&&(o=(i.d1-i.d0).toFixed(2)+"%"),"linear"===this.colors.scaleType){let t=o;i.d1&&(t=i.d1),s=this.colors.getColor(t)}else s=this.colors.getColor(n.name);const a=Object.assign({},i,{value:o,name:t,series:r,min:i.min,max:i.max,color:s});e.push(a)}}return e}mouseMove(t){const e=t.pageX-t.target.getBoundingClientRect().left,n=this.findClosestPointIndex(e),i=this.xSet[n];if(this.anchorPos=this.xScale(i),this.anchorPos=Math.max(0,this.anchorPos),this.anchorPos=Math.min(this.dims.width,this.anchorPos),this.anchorValues=this.getValues(i),this.anchorPos!==this.lastAnchorPos){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=.7,this.hover.emit({value:i}),this.showTooltip(),this.lastAnchorPos=this.anchorPos}}findClosestPointIndex(t){let e=0,n=this.xSet.length-1,i=Number.MAX_VALUE,r=0;for(;e<=n;){const s=(e+n)/2|0,o=this.xScale(this.xSet[s]),a=Math.abs(o-t);if(at)){i=0,r=s;break}n=s-1}}return r}showTooltip(){const t=cL("mouseenter");this.tooltipAnchor.nativeElement.dispatchEvent(t)}hideTooltip(){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=0,this.lastAnchorPos=-1}getToolTipText(t){let e="";return e+=void 0!==t.series?t.series:"???",e+=": ",void 0!==t.value&&(e+=t.value.toLocaleString()),void 0===t.min&&void 0===t.max||(e+=" (",void 0!==t.min?(void 0===t.max&&(e+="\u2265"),e+=t.min.toLocaleString(),void 0!==t.max&&(e+=" - ")):void 0!==t.max&&(e+="\u2264"),void 0!==t.max&&(e+=t.max.toLocaleString()),e+=")"),e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-tooltip-area",""]],viewQuery:function(t,e){if(1&t&&sc(lF,!0),2&t){let t;ic(t=lc())&&(e.tooltipAnchor=t.first)}},inputs:{showPercentage:"showPercentage",tooltipDisabled:"tooltipDisabled",dims:"dims",xSet:"xSet",xScale:"xScale",yScale:"yScale",results:"results",colors:"colors",tooltipTemplate:"tooltipTemplate"},outputs:{hover:"hover"},attrs:cF,decls:6,vars:18,consts:[["y","0",1,"tooltip-area",2,"opacity","0","cursor","auto",3,"mousemove","mouseleave"],["defaultTooltipTemplate",""],["y","0","ngx-tooltip","",1,"tooltip-anchor",3,"tooltipDisabled","tooltipPlacement","tooltipType","tooltipSpacing","tooltipTemplate","tooltipContext","tooltipImmediateExit"],["tooltipAnchor",""],[1,"area-tooltip-container"],["class","tooltip-item",4,"ngFor","ngForOf"],[1,"tooltip-item"],[1,"tooltip-item-color"]],template:function(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"rect",0),Vo("mousemove",function(t){return e.mouseMove(t)})("mouseleave",function(){return e.hideTooltip()}),Io(),Do(2,uF,2,1,"ng-template",null,1,dc),$o(4,"rect",2,3),Io()),2&t){const t=To(3);Qr(1),ko("x",0)("width",e.dims.width)("height",e.dims.height),Qr(3),ia("opacity",e.anchorOpacity)("pointer-events","none"),Fo("@animationState",0!==e.anchorOpacity?"active":"inactive")("tooltipDisabled",e.tooltipDisabled)("tooltipPlacement","right")("tooltipType","tooltip")("tooltipSpacing",15)("tooltipTemplate",e.tooltipTemplate?e.tooltipTemplate:t)("tooltipContext",e.anchorValues)("tooltipImmediateExit",!0),ko("x",e.anchorPos)("width",1)("height",e.dims.height)}},directives:[JF,Ph],encapsulation:2,data:{animation:[Tu("animationState",[Mu("inactive => active",[Lu({opacity:0}),Ru(250,Lu({opacity:.7}))]),Mu("active => inactive",[Lu({opacity:.7}),Ru(250,Lu({opacity:0}))])])]},changeDetection:0}),t})(),uL=(()=>{class t{constructor(t,e){this.cd=e,this.height=50,this.select=new Wl,this.onDomainChange=new Wl,this.initialized=!1,this.element=t.nativeElement}ngOnChanges(t){this.update(),this.initialized||(this.addBrush(),this.initialized=!0)}update(){this.dims=this.getDims(),this.height=this.dims.height;const t=this.view[1]-this.height;this.xDomain=this.getXDomain(),this.xScale=this.getXScale(),this.brush&&this.updateBrush(),this.transform=`translate(0 , ${t})`,this.filterId="filter"+nL().toString(),this.filter=`url(#${this.filterId})`,this.cd.markForCheck()}getXDomain(){let t=[];for(const n of this.results)for(const e of n.series)t.includes(e.name)||t.push(e.name);let e=[];return"time"===this.scaleType?e=[Math.min(...t),Math.max(...t)]:"linear"===this.scaleType?(t=t.map(t=>Number(t)),e=[Math.min(...t),Math.max(...t)]):e=t,e}getXScale(){let t;return"time"===this.scaleType?t=ET().range([0,this.dims.width]).domain(this.xDomain):"linear"===this.scaleType?t=VT().range([0,this.dims.width]).domain(this.xDomain):"ordinal"===this.scaleType&&(t=qT().range([0,this.dims.width]).padding(.1).domain(this.xDomain)),t}addBrush(){if(this.brush)return;const t=this.height,e=this.view[0];this.brush=function(t){var e,n=qk,i=Gk,r=Kk,s=!0,o=mS("start","brush","end"),a=6;function l(e){var n=e.property("__brush",g).selectAll(".overlay").data([Wk("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Uk.overlay).merge(n).each(function(){var t=Xk(this).extent;cS(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Wk("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Uk.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Uk[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=cS(this),e=Xk(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function h(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new u(t,e,n):i}function u(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(){if((!e||YC.touches)&&i.apply(this,arguments)){var n,r,o,a,l,u,d,p,f,g,m,v=this,y=YC.target.__data__.type,b="selection"===(s&&YC.metaKey?y="overlay":y)?Fk:s&&YC.altKey?Ik:Mk,w=t===Bk?null:jk[y],x=t===Nk?null:zk[y],_=Xk(v),C=_.extent,S=_.selection,E=C[0][0],k=C[0][1],A=C[1][0],D=C[1][1],T=0,R=0,F=w&&x&&s&&YC.shiftKey,L=YC.touches?Pk(YC.changedTouches[0].identifier):gE,M=L(v),I=M,$=h(v,arguments,!0).beforestart();"overlay"===y?(S&&(f=!0),_.selection=S=[[n=t===Bk?E:M[0],o=t===Nk?k:M[1]],[l=t===Bk?A:n,d=t===Nk?D:o]]):(n=S[0][0],o=S[0][1],l=S[1][0],d=S[1][1]),r=n,a=o,u=l,p=d;var O=cS(v).attr("pointer-events","none"),P=O.selectAll(".overlay").attr("cursor",Uk[y]);if(YC.touches)$.moved=B,$.ended=V;else{var N=cS(YC.view).on("mousemove.brush",B,!0).on("mouseup.brush",V,!0);s&&N.on("keydown.brush",H,!0).on("keyup.brush",j,!0),yS(YC.view)}Tk(),HE(v),c.call(v),$.start()}function B(){var t=L(v);!F||g||m||(Math.abs(t[0]-I[0])>Math.abs(t[1]-I[1])?m=!0:g=!0),I=t,f=!0,Rk(),U()}function U(){var t;switch(T=I[0]-M[0],R=I[1]-M[1],b){case Lk:case Fk:w&&(T=Math.max(E-n,Math.min(A-l,T)),r=n+T,u=l+T),x&&(R=Math.max(k-o,Math.min(D-d,R)),a=o+R,p=d+R);break;case Mk:w<0?(T=Math.max(E-n,Math.min(A-n,T)),r=n+T,u=l):w>0&&(T=Math.max(E-l,Math.min(A-l,T)),r=n,u=l+T),x<0?(R=Math.max(k-o,Math.min(D-o,R)),a=o+R,p=d):x>0&&(R=Math.max(k-d,Math.min(D-d,R)),a=o,p=d+R);break;case Ik:w&&(r=Math.max(E,Math.min(A,n-T*w)),u=Math.max(E,Math.min(A,l+T*w))),x&&(a=Math.max(k,Math.min(D,o-R*x)),p=Math.max(k,Math.min(D,d+R*x)))}u0&&(n=r-T),x<0?d=p-R:x>0&&(o=a-R),b=Lk,P.attr("cursor",Uk.selection),U());break;default:return}Rk()}function j(){switch(YC.keyCode){case 16:F&&(g=m=F=!1,U());break;case 18:b===Ik&&(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk,U());break;case 32:b===Lk&&(YC.altKey?(w&&(l=u-T*w,n=r+T*w),x&&(d=p-R*x,o=a+R*x),b=Ik):(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk),P.attr("cursor",Uk[y]),U());break;default:return}Rk()}}function p(){h(this,arguments).moved()}function f(){h(this,arguments).ended()}function g(){var e=this.__brush||{selection:null};return e.extent=Ok(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n){e.selection?e.on("start.brush",function(){h(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){h(this,arguments).end()}).tween("brush",function(){var e=this,i=e.__brush,r=h(e,arguments),s=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=dE(s,o);function l(t){i.selection=1===t&&null===o?null:a(t),c.call(e),r.brush()}return null!==s&&null!==o?l:l(1)}):e.each(function(){var e=this,i=arguments,r=e.__brush,s=t.input("function"==typeof n?n.apply(e,i):n,r.extent),o=h(e,i).beforestart();HE(e),r.selection=null===s?null:s,c.call(e),o.start().brush().end()})},l.clear=function(t){l.move(t,null)},u.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){!function(t,e,n,i){var r=YC;t.sourceEvent=YC,YC=t;try{e.apply(n,i)}finally{YC=r}}(new Dk(l,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Ak(Ok(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ak(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Ak(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(s=!!t,l):s},l.on=function(){var t=o.on.apply(o,arguments);return t===o?l:t},l}(Nk).extent([[0,0],[e,t]]).on("brush end",()=>{const t=(YC.selection||this.xScale.range()).map(this.xScale.invert);this.onDomainChange.emit(t),this.cd.markForCheck()}),cS(this.element).select(".brush").call(this.brush)}updateBrush(){this.brush&&(this.brush.extent([[0,0],[this.view[0],this.height]]),cS(this.element).select(".brush").call(this.brush),cS(this.element).select(".selection").attr("fill",void 0).attr("stroke",void 0).attr("fill-opacity",void 0),this.cd.markForCheck())}getDims(){return{width:this.view[0],height:this.height}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-timeline",""]],inputs:{height:"height",view:"view",state:"state",results:"results",scheme:"scheme",customColors:"customColors",legend:"legend",miniChart:"miniChart",autoScale:"autoScale",scaleType:"scaleType"},outputs:{select:"select",onDomainChange:"onDomainChange"},features:[le],attrs:dF,ngContentSelectors:RR,decls:7,vars:4,consts:[[1,"timeline"],["in","SourceGraphic","type","matrix","values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"],[1,"embedded-chart"],["x","0","y","0",1,"brush-background"],[1,"brush"]],template:function(t,e){1&t&&(Go(),ln(),Mo(0,"g",0),Mo(1,"filter"),$o(2,"feColorMatrix",1),Io(),Mo(3,"g",2),qo(4),Io(),$o(5,"rect",3),$o(6,"g",4),Io()),2&t&&(ko("transform",e.transform),Qr(1),ko("id",e.filterId),Qr(4),ko("width",e.view[0])("height",e.height))},styles:[".timeline .brush-background{fill:rgba(0,0,0,.05)}.timeline .brush .selection{fill:rgba(0,0,0,.1);stroke:#888;stroke-width:1px}.timeline .brush .handle{fill-opacity:0}.timeline .embedded-chart{opacity:.6}"],encapsulation:2,changeDetection:0}),t})(),dL=(()=>{class t{constructor(t){this.cd=t,this.horizontal=!1,this.labelClick=new Wl,this.labelActivate=new Wl,this.labelDeactivate=new Wl,this.legendEntries=[]}ngOnChanges(t){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){const t=[];for(const e of this.data){const n=ZF(e);-1===t.findIndex(t=>t.label===n)&&t.push({label:e,formattedLabel:n,color:this.colors.getColor(e)})}return t}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.label===e.name)}activate(t){this.labelActivate.emit(t)}deactivate(t){this.labelDeactivate.emit(t)}trackBy(t,e){return e.label}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend"]],inputs:{horizontal:"horizontal",data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},features:[le],decls:5,vars:9,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"label","formattedLabel","color","isActive","select","activate","deactivate"]],template:function(t,e){1&t&&(Mo(0,"div"),Do(1,pF,3,1,"header",0),Mo(2,"div",1),Mo(3,"ul",2),Do(4,fF,2,4,"li",3),Io(),Io(),Io()),2&t&&(ia("width",e.width,"px"),Qr(1),Fo("ngIf",(null==e.title?null:e.title.length)>0),Qr(2),ia("max-height",e.height-45,"px"),ra("horizontal-legend",e.horizontal),Qr(1),Fo("ngForOf",e.legendEntries)("ngForTrackBy",e.trackBy))},directives:function(){return[Bh,Ph,pL]},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{font-size:14px;font-weight:700;margin-bottom:5px;margin-left:10px;overflow:hidden;white-space:nowrap}.chart-legend li,.chart-legend ul{list-style:none;margin:0;padding:0}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{background:rgba(0,0,0,.05);border-radius:3px;float:left;line-height:85%;list-style:none;overflow-x:hidden;overflow-y:auto;text-align:left;white-space:nowrap;width:100%}.chart-legend .legend-label{color:#afb7c8;cursor:pointer;font-size:90%;margin:8px}.chart-legend .legend-label:hover{color:#000;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{border-radius:3px;color:#5b646b;display:inline-block;height:15px;margin-right:5px;width:15px}.chart-legend .legend-label-text{font-size:12px;line-height:15px;vertical-align:top;width:calc(100% - 20px)}.chart-legend .legend-label-text,.chart-legend .legend-title-text{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-legend .legend-title-text{line-height:16px;vertical-align:bottom}"],encapsulation:2,changeDetection:0}),t})(),pL=(()=>{class t{constructor(){this.isActive=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.toggle=new Wl}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(t,e){1&t&&Vo("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{isActive:"isActive",color:"color",label:"label",formattedLabel:"formattedLabel"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},decls:4,vars:6,consts:[["tabindex","-1",3,"title","click"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(t,e){1&t&&(Mo(0,"span",0),Vo("click",function(){return e.select.emit(e.formattedLabel)}),Mo(1,"span",1),Vo("click",function(){return e.toggle.emit(e.formattedLabel)}),Io(),Mo(2,"span",2),va(3),Io(),Io()),2&t&&(ra("active",e.isActive),Fo("title",e.formattedLabel),Qr(1),ia("background-color",e.color),Qr(2),ba(" ",e.trimmedLabel," "))},encapsulation:2,changeDetection:0}),t})(),fL=(()=>{class t{constructor(t){this.sanitizer=t,this.horizontal=!1}ngOnChanges(t){const e=this.gradientString(this.colors.range(),this.colors.domain());this.gradient=this.sanitizer.bypassSecurityTrustStyle(`linear-gradient(to ${this.horizontal?"right":"bottom"}, ${e})`)}gradientString(t,e){e.push(1);const n=[];return t.reverse().forEach((t,i)=>{n.push(`${t} ${Math.round(100*e[i])}%`)}),n.join(", ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(_u))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-scale-legend"]],inputs:{horizontal:"horizontal",valueRange:"valueRange",colors:"colors",height:"height",width:"width"},features:[le],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"span"),va(3),Io(),Io(),$o(4,"div",2),Mo(5,"div",1),Mo(6,"span"),va(7),Io(),Io(),Io()),2&t&&(ia("height",e.horizontal?void 0:e.height,"px")("width",e.width,"px"),ra("horizontal-legend",e.horizontal),Qr(3),ya(e.valueRange[1].toLocaleString()),Qr(1),ia("background",e.gradient),Qr(3),ya(e.valueRange[0].toLocaleString()))},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{display:flex;flex-direction:column;text-align:center}.chart-legend .scale-legend-wrap{border-radius:5px;display:inline-block;flex:1;margin:0 auto;width:30px}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{height:30px;margin:0 16px;width:auto}"],encapsulation:2,changeDetection:0}),t})(),gL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,qF,QF],qh,qF,QF]}),t})(),mL=[{name:"vivid",selectable:!0,group:"Ordinal",domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:"Ordinal",domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:"Ordinal",domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:"Ordinal",domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:"Continuous",domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:"Continuous",domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:"Continuous",domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:"Ordinal",domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:"Ordinal",domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:"Ordinal",domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:"Ordinal",domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:"Ordinal",domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:"Ordinal",domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:"Ordinal",domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:"Ordinal",domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}];class vL{constructor(t,e,n,i){"string"==typeof t&&(t=mL.find(e=>e.name===t)),this.colorDomain=t.domain,this.scaleType=e,this.domain=n,this.customColors=i,this.scale=this.generateColorScheme(t,e,this.domain)}generateColorScheme(t,e,n){let i;if("string"==typeof t&&(t=mL.find(e=>e.name===t)),"quantile"===e)i=XT().range(t.domain).domain(n);else if("ordinal"===e)i=zT().range(t.domain).domain(n);else if("linear"===e){const e=[...t.domain];1===e.length&&(e.push(e[0]),this.colorDomain=e);const n=HT(0,1,1/e.length);i=VT().domain(n).range(e)}return i}getColor(t){if(null==t)throw new Error("Value can not be null");if("linear"===this.scaleType){const e=VT().domain(this.domain).range([0,1]);return this.scale(e(t))}{if("function"==typeof this.customColors)return this.customColors(t);const e=t.toString();let n;return this.customColors&&this.customColors.length>0&&(n=this.customColors.find(t=>t.name.toLowerCase()===e.toLowerCase())),n?n.value:this.scale(t)}}getLinearGradientStops(t,e){void 0===e&&(e=this.domain[0]);const n=VT().domain(this.domain).range([0,1]),i=WT().domain(this.colorDomain).range([0,1]),r=this.getColor(t),s=n(e),o=this.getColor(e),a=n(t);let l=1,c=s;const h=[];for(h.push({color:o,offset:s,originalOffset:s,opacity:1});c=(a-i.bandwidth()).toFixed(4))break;h.push({color:t,offset:e,opacity:1}),c=e,l++}}if(h[h.length-1].offset<100&&h.push({color:r,offset:a,opacity:1}),a===s)h[0].offset=0,h[1].offset=100;else if(100!==h[h.length-1].offset)for(const u of h)u.offset=(u.offset-s)/(a-s)*100;return h}}let yL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),bL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),wL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),xL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),_L=(()=>{class t{constructor(t){this.element=t,this.fill="none",this.animations=!0,this.select=new Wl,this.initialized=!1}ngOnChanges(t){this.initialized?this.updatePathEl():(this.initialized=!0,this.initialPath=this.path)}updatePathEl(){const t=cS(this.element.nativeElement).select(".line");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line",""]],inputs:{fill:"fill",animations:"animations",path:"path",stroke:"stroke",data:"data"},outputs:{select:"select"},features:[le],attrs:yF,decls:1,vars:4,consts:[["stroke-width","1.5px",1,"line"]],template:function(t,e){1&t&&(ln(),$o(0,"path",0)),2&t&&(Fo("@animationState","active"),ko("d",e.initialPath)("fill",e.fill)("stroke",e.stroke))},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({strokeDasharray:2e3,strokeDashoffset:2e3}),Ru(1e3,Lu({strokeDashoffset:0}))])])]},changeDetection:0}),t})(),CL=(()=>{class t extends BF{constructor(){super(...arguments),this.legendTitle="Legend",this.legendPosition="right",this.showGridLines=!0,this.curve=JT,this.activeEntries=[],this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.roundDomains=!1,this.tooltipDisabled=!1,this.showRefLines=!1,this.showRefLabels=!0,this.activate=new Wl,this.deactivate=new Wl,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.timelineHeight=50,this.timelinePadding=10}update(){super.update(),this.dims=function({width:t,height:e,margins:n,showXAxis:i=!1,showYAxis:r=!1,xAxisHeight:s=0,yAxisWidth:o=0,showXLabel:a=!1,showYLabel:l=!1,showLegend:c=!1,legendType:h="ordinal",legendPosition:u="right",columns:d=12}){let p=n[3],f=t,g=e-n[0]-n[2];if(c&&"right"===u&&(d-="ordinal"===h?2:1),f=f*d/12,f=f-n[1]-n[3],i&&(g-=5,g-=s,a)&&(g-=30),r&&(f-=5,f-=o,p+=o,p+=10,l)){const t=30;f-=t,p+=t}return f=Math.max(0,f),g=Math.max(0,g),{width:Math.floor(f),height:Math.floor(g),xOffset:Math.floor(p)}}({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.timeline&&(this.dims.height-=this.timelineHeight+this.margin[2]+this.timelinePadding),this.xDomain=this.getXDomain(),this.filteredDomain&&(this.xDomain=this.filteredDomain),this.yDomain=this.getYDomain(),this.seriesDomain=this.getSeriesDomain(),this.xScale=this.getXScale(this.xDomain,this.dims.width),this.yScale=this.getYScale(this.yDomain,this.dims.height),this.updateTimeline(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]})`,this.clipPathId="clip"+nL().toString(),this.clipPath=`url(#${this.clipPathId})`}updateTimeline(){this.timeline&&(this.timelineWidth=this.dims.width,this.timelineXDomain=this.getXDomain(),this.timelineXScale=this.getXScale(this.timelineXDomain,this.timelineWidth),this.timelineYScale=this.getYScale(this.yDomain,this.timelineHeight),this.timelineTransform=`translate(${this.dims.xOffset}, ${-this.margin[2]})`)}getXDomain(){let t=function(t){const e=new Set;for(const n of t)for(const t of n.series)e.add(t.name);return Array.from(e)}(this.results);this.scaleType=function(t,e=!0){return e&&t.every(t=>t instanceof Date)?"time":t.every(t=>"number"==typeof t)?"linear":"ordinal"}(t);let e,n,i=[];return"linear"===this.scaleType&&(t=t.map(t=>Number(t))),"time"!==this.scaleType&&"linear"!==this.scaleType||(e=this.xScaleMin?this.xScaleMin:Math.min(...t),n=this.xScaleMax?this.xScaleMax:Math.max(...t)),"time"===this.scaleType?(i=[new Date(e),new Date(n)],this.xSet=[...t].sort((t,e)=>{const n=t.getTime(),i=e.getTime();return n>i?1:i>n?-1:0})):"linear"===this.scaleType?(i=[e,n],this.xSet=[...t].sort((t,e)=>t-e)):(i=t,this.xSet=t),i}getYDomain(){const t=[];for(const n of this.results)for(const e of n.series)t.indexOf(e.value)<0&&t.push(e.value),void 0!==e.min&&(this.hasRange=!0,t.indexOf(e.min)<0&&t.push(e.min)),void 0!==e.max&&(this.hasRange=!0,t.indexOf(e.max)<0&&t.push(e.max));const e=[...t];return this.autoScale||e.push(0),[this.yScaleMin?this.yScaleMin:Math.min(...e),this.yScaleMax?this.yScaleMax:Math.max(...e)]}getSeriesDomain(){return this.results.map(t=>t.name)}getXScale(t,e){let n;return"time"===this.scaleType?n=ET().range([0,e]).domain(t):"linear"===this.scaleType?(n=VT().range([0,e]).domain(t),this.roundDomains&&(n=n.nice())):"ordinal"===this.scaleType&&(n=qT().range([0,e]).padding(.1).domain(t)),n}getYScale(t,e){const n=VT().range([e,0]).domain(t);return this.roundDomains?n.nice():n}updateDomain(t){this.filteredDomain=t,this.xDomain=this.filteredDomain,this.xScale=this.getXScale(this.xDomain,this.dims.width)}updateHoveredVertical(t){this.hoveredVertical=t.value,this.deactivateAll()}hideCircles(){this.hoveredVertical=null,this.deactivateAll()}onClick(t){this.select.emit(t)}trackBy(t,e){return e.name}setColors(){let t;t="ordinal"===this.schemeType?this.seriesDomain:this.yDomain,this.colors=new vL(this.scheme,this.schemeType,t,this.customColors)}getLegendOptions(){const t={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return"ordinal"===t.scaleType?(t.domain=this.seriesDomain,t.colors=this.colors,t.title=this.legendTitle):(t.domain=this.yDomain,t.colors=this.colors.scale),t}updateYAxisWidth({width:t}){this.yAxisWidth=t,this.update()}updateXAxisHeight({height:t}){this.xAxisHeight=t,this.update()}onActivate(t){this.deactivateAll(),this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value)>-1||(this.activeEntries=[t],this.activate.emit({value:t,entries:this.activeEntries}))}onDeactivate(t){const e=this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value);this.activeEntries.splice(e,1),this.activeEntries=[...this.activeEntries],this.deactivate.emit({value:t,entries:this.activeEntries})}deactivateAll(){this.activeEntries=[...this.activeEntries];for(const t of this.activeEntries)this.deactivate.emit({value:t,entries:[]});this.activeEntries=[]}}return t.\u0275fac=function(e){return SL(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-line-chart"]],contentQueries:function(t,e,n){if(1&t&&(ac(n,gF,!0),ac(n,mF,!0)),2&t){let t;ic(t=lc())&&(e.tooltipTemplate=t.first),ic(t=lc())&&(e.seriesTooltipTemplate=t.first)}},hostBindings:function(t,e){1&t&&Vo("mouseleave",function(){return e.hideCircles()})},inputs:{legendTitle:"legendTitle",legendPosition:"legendPosition",showGridLines:"showGridLines",curve:"curve",activeEntries:"activeEntries",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",roundDomains:"roundDomains",tooltipDisabled:"tooltipDisabled",showRefLines:"showRefLines",showRefLabels:"showRefLabels",legend:"legend",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",autoScale:"autoScale",timeline:"timeline",gradient:"gradient",schemeType:"schemeType",rangeFillOpacity:"rangeFillOpacity",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",referenceLines:"referenceLines",xScaleMin:"xScaleMin",xScaleMax:"xScaleMax",yScaleMin:"yScaleMin",yScaleMax:"yScaleMax"},outputs:{activate:"activate",deactivate:"deactivate"},features:[po],decls:11,vars:20,consts:[[3,"view","showLegend","legendOptions","activeEntries","animations","legendLabelClick","legendLabelActivate","legendLabelDeactivate"],[1,"line-chart","chart"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"mouseleave",4,"ngIf"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange",4,"ngIf"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","activeEntries","scaleType","curve","rangeFillOpacity","hasRange","animations"],[3,"mouseleave"],["ngx-charts-tooltip-area","",3,"dims","xSet","xScale","yScale","results","colors","tooltipDisabled","tooltipTemplate","hover"],[4,"ngFor","ngForOf"],["ngx-charts-circle-series","",3,"xScale","yScale","colors","data","scaleType","visibleValue","activeEntries","tooltipDisabled","tooltipTemplate","select","activate","deactivate"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","scaleType","curve","hasRange","animations"]],template:function(t,e){1&t&&(Mo(0,"ngx-charts-chart",0),Vo("legendLabelClick",function(t){return e.onClick(t)})("legendLabelActivate",function(t){return e.onActivate(t)})("legendLabelDeactivate",function(t){return e.onDeactivate(t)}),ln(),Mo(1,"defs"),Mo(2,"clipPath"),$o(3,"rect"),Io(),Io(),Mo(4,"g",1),Do(5,bF,1,10,"g",2),Do(6,wF,1,12,"g",3),Mo(7,"g"),Do(8,xF,2,11,"g",4),Do(9,CF,3,9,"g",5),Io(),Io(),Do(10,EF,2,13,"g",6),Io()),2&t&&(Fo("view",Hl(17,vF,e.width,e.height))("showLegend",e.legend)("legendOptions",e.legendOptions)("activeEntries",e.activeEntries)("animations",e.animations),Qr(2),ko("id",e.clipPathId),Qr(1),ko("width",e.dims.width+10)("height",e.dims.height+10)("transform","translate(-5, -5)"),Qr(1),ko("transform",e.transform),Qr(1),Fo("ngIf",e.xAxis),Qr(1),Fo("ngIf",e.yAxis),Qr(1),ko("clip-path",e.clipPath),Qr(1),Fo("ngForOf",e.results)("ngForTrackBy",e.trackBy),Qr(1),Fo("ngIf",!e.tooltipDisabled),Qr(1),Fo("ngIf",e.timeline&&"ordinal"!=e.scaleType))},directives:function(){return[PF,Bh,Ph,zF,GF,EL,hL,rL,uL]},styles:[".ngx-charts{float:left;overflow:visible}.ngx-charts .arc,.ngx-charts .bar,.ngx-charts .circle{cursor:pointer}.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .card.active,.ngx-charts .card:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .arc:focus,.ngx-charts .bar:focus,.ngx-charts .card:focus,.ngx-charts .cell:focus{outline:none}.ngx-charts .arc.hidden,.ngx-charts .bar.hidden,.ngx-charts .card.hidden,.ngx-charts .cell.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .area-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .line-series.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .polar-series-path.inactive{opacity:.2;transition:opacity .1s ease-in-out}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:400}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{fill:none;stroke:#ddd;stroke-width:1}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-dasharray:5;stroke-dashoffset:5;stroke-width:1}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill:#000;fill-opacity:.05}.ngx-charts .gridline-path-dotted{fill:none;stroke:#ddd;stroke-dasharray:1,20;stroke-dashoffset:3;stroke-width:1}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:rgba(0,0,0,.05)}"],encapsulation:2,data:{animation:[Tu("animationState",[Mu(":leave",[Lu({opacity:1}),Ru(500,Lu({opacity:0}))])])]},changeDetection:0}),t})();const SL=Gn(CL);let EL=(()=>{class t{constructor(){this.animations=!0}ngOnChanges(t){this.update()}update(){this.updateGradients();const t=this.sortData(this.data.series),e=this.getLineGenerator();this.path=e(t)||"";const n=this.getAreaGenerator();if(this.areaPath=n(t)||"",this.hasRange){const e=this.getRangeGenerator();this.outerPath=e(t)||""}if(this.hasGradient){this.stroke=this.gradientUrl;const t=this.data.series.map(t=>t.value),e=Math.max(...t);e===Math.min(...t)&&(this.stroke=this.colors.getColor(e))}else this.stroke=this.colors.getColor(this.data.name)}getLineGenerator(){return lR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y(t=>this.yScale(t.value)).curve(this.curve)}getRangeGenerator(){return cR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y0(t=>this.yScale("number"==typeof t.min?t.min:t.value)).y1(t=>this.yScale("number"==typeof t.max?t.max:t.value)).curve(this.curve)}getAreaGenerator(){return cR().x(t=>this.xScale(t.name)).y0(()=>this.yScale.range()[0]).y1(t=>this.yScale(t.value)).curve(this.curve)}sortData(t){return"linear"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>"asc"===n?t[e]-i[e]:i[e]-t[e])}(t,"name"):"time"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>{const r=t[e].getTime(),s=i[e].getTime();return"asc"===n?r>s?1:s>r?-1:0:r>s?-1:s>r?1:0})}(t,"name"):function(t,e,n="asc",i){return t.sort((t,r)=>{const s=r[e],o=i.indexOf(t[e]),a=i.indexOf(s);return"asc"===n?o-a:a-o})}(t,"name","asc",this.xScale.domain())}updateGradients(){if("linear"===this.colors.scaleType){this.hasGradient=!0,this.gradientId="grad"+nL().toString(),this.gradientUrl=`url(#${this.gradientId})`;const t=this.data.series.map(t=>t.value),e=Math.max(...t),n=Math.min(...t);this.gradientStops=this.colors.getLinearGradientStops(e,n),this.areaGradientStops=this.colors.getLinearGradientStops(e)}else this.hasGradient=!1,this.gradientStops=void 0,this.areaGradientStops=void 0}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}isInactive(t){return!(!this.activeEntries||0===this.activeEntries.length)&&void 0===this.activeEntries.find(e=>t.name===e.name)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line-series",""]],inputs:{animations:"animations",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",curve:"curve",activeEntries:"activeEntries",rangeFillOpacity:"rangeFillOpacity",hasRange:"hasRange"},features:[le],attrs:kF,decls:6,vars:22,consts:[["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops",4,"ngIf"],["ngx-charts-area","",1,"line-highlight",3,"data","path","fill","opacity","startOpacity","gradient","stops","animations"],["ngx-charts-line","",1,"line-series",3,"data","path","stroke","animations"],["ngx-charts-area","","class","line-series-range",3,"data","path","fill","active","inactive","opacity","animations",4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["ngx-charts-area","",1,"line-series-range",3,"data","path","fill","opacity","animations"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Mo(1,"defs"),Do(2,AF,1,2,"g",0),Io(),$o(3,"g",1),$o(4,"g",2),Do(5,DF,1,9,"g",3),Io()),2&t&&(Qr(2),Fo("ngIf",e.hasGradient),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.areaPath)("fill",e.hasGradient?e.gradientUrl:e.colors.getColor(e.data.name))("opacity",.25)("startOpacity",0)("gradient",!0)("stops",e.areaGradientStops)("animations",e.animations),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.path)("stroke",e.stroke)("animations",e.animations),Qr(1),Fo("ngIf",e.hasRange))},directives:[Bh,aL,_L,oL],encapsulation:2,changeDetection:0}),t})(),kL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})();Math;let AL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),DL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,kL]]}),t})(),TL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),RL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),FL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,bL]]}),t})(),LL=(()=>{class t{constructor(){"undefined"!=typeof SVGElement&&void 0===SVGElement.prototype.contains&&(SVGElement.prototype.contains=HTMLDivElement.prototype.contains)}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[gL,yL,bL,wL,xL,kL,DL,TL,AL,RL,FL]}),t})();function ML(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function IL(t,e){1&t&&$o(0,"img",31)}function $L(t,e){1&t&&$o(0,"img",32)}function OL(t,e){1&t&&$o(0,"img",33)}function PL(t,e){1&t&&$o(0,"img",34)}function NL(t,e){if(1&t&&(Mo(0,"tr",24),Mo(1,"td"),Oo(2,25),Do(3,IL,1,0,"img",26),Do(4,$L,1,0,"img",27),Do(5,OL,1,0,"img",28),Do(6,PL,1,0,"img",29),Po(),Mo(7,"span"),va(8),Io(),Io(),Mo(9,"td"),va(10),Mo(11,"span",30),va(12),Io(),Io(),Mo(13,"td"),va(14),Mo(15,"span",30),va(16),Io(),Io(),Mo(17,"td"),va(18),Mo(19,"span",30),va(20),Io(),Io(),Mo(21,"td"),va(22),Mo(23,"span",30),va(24),Io(),Io(),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(2),Fo("ngSwitch",t.health),Qr(1),Fo("ngSwitchCase",0),Qr(1),Fo("ngSwitchCase",1),Qr(1),Fo("ngSwitchCase",2),Qr(1),Fo("ngSwitchCase",3),Qr(2),ya(t.name),Qr(2),ba("",t.session_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxSessionCount()-t.session_count," delta)"),Qr(2),ba("",t.presence_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxPresenceCount()-t.presence_count," delta)"),Qr(2),ba("",t.match_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxMatchCount()-t.match_count," delta)"),Qr(2),ba("",t.goroutine_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxGoroutineCount()-t.goroutine_count," delta)")}}function BL(t,e){if(1&t&&(Mo(0,"tbody"),Do(1,NL,25,18,"tr",22),Mo(2,"tr",3),$o(3,"td",23),Mo(4,"th",3),va(5),Io(),Mo(6,"th",3),va(7),Io(),Mo(8,"th",3),va(9),Io(),Mo(10,"th",3),va(11),Io(),Io(),Io()),2&t){const t=zo();Qr(1),Fo("ngForOf",t.statusData.nodes),Qr(4),ya(t.getTotalSessionCount()),Qr(2),ya(t.getMaxPresenceCount()),Qr(2),ya(t.getTotalMatchCount()),Qr(2),ya(t.getTotalGorountineCount())}}function UL(t,e){if(1&t&&(Mo(0,"option",35),va(1),Io()),2&t){const t=e.$implicit,n=zo();Ko("value",t),Qr(1),ya(n.ranges[t])}}const VL=function(t){return{"background-color":t}};function HL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function jL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,HL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function zL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",37),Do(2,jL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.latencyGraphData)}}function WL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function GL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,WL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function qL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",43),Do(2,GL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.rateGraphData)}}function KL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function XL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,KL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function YL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",44),Do(2,XL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.inputGraphData)}}function JL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function QL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,JL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function ZL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",45),Do(2,QL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.outputGraphData)}}let tM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.showDelta=!1,this.rateGraphData=[],this.latencyGraphData=[],this.inputGraphData=[],this.outputGraphData=[],this.ranges={1:"last 1 minute",10:"last 10 minutes",30:"last 30 minutes",60:"last 1 hour",1440:"last 24 hours"},this.rangesKeys=Object.keys(this.ranges).map(t=>+t),this.colorScheme={domain:["#5AA454","#E44D25","#1e59cf","#7aa3e5","#a8385d","#d0bd00"]},this.samples=60}ngOnInit(){this.rangeForm=this.formBuilder.group({rangeMinutes:[10]}),this.route.data.subscribe(t=>{this.initData(t[0]),this.refresh(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}refresh(){this.consoleService.getStatus("").subscribe(t=>{this.statusData=t,this.rateGraphData=this.updateData(this.rateGraphData,"avg_rate_sec",t),this.latencyGraphData=this.updateData(this.latencyGraphData,"avg_latency_ms",t),this.inputGraphData=this.updateData(this.inputGraphData,"avg_input_kbs",t),this.outputGraphData=this.updateData(this.outputGraphData,"avg_output_kbs",t)})}generateSeries(){let t=new Date;t.setMilliseconds(0);const e=[];for(let n=0;n({name:t,value:0}))}initData(t){const e=this.generateSeries();this.latencyGraphData=t.map(t=>({name:t,series:e})),this.rateGraphData=t.map(t=>({name:t,series:e})),this.inputGraphData=t.map(t=>({name:t,series:e})),this.outputGraphData=t.map(t=>({name:t,series:e}))}updateData(t,e,n){var i;const r=n.nodes,s=[],o=n.timestamp,a=t.map(t=>t.name),l=r.map(t=>t.name),c=this.diff(a,l);for(const h of t)c.includes(h.name)&&s.push({name:h.name,series:this.shiftData(h.series,0,o)});for(const h of r){let n=[],r={};const a=null===(i=t.find(t=>t.name===h.name))||void 0===i?void 0:i.series;n=this.shiftData(a||this.generateSeries(),h[e],o),r={name:h.name,series:n},s.push(r)}return s}shiftData(t,e,n){const i=t.slice(1);return i.push({name:new Date(n),value:e}),i}getPeriod(){return Math.floor(60*this.f.rangeMinutes.value/this.samples)}setRange(t){this.rangeForm.reset({rangeMinutes:+t.target.value}),this.reset()}reset(){this.consoleService.getStatus("").subscribe(t=>{var e;this.initData(t.nodes.map(t=>t.name)),null===(e=this.$refreshTimer)||void 0===e||e.unsubscribe(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}diff(t,e){const n=new Set(t);for(const i of e)n.delete(i);return Array.from(n)}get f(){return this.rangeForm.controls}ngOnDestroy(){this.$refreshTimer.unsubscribe()}getTotalSessionCount(){return this.statusData.nodes.reduce((t,e)=>t+e.session_count,0)}getMaxSessionCount(){return Math.max(...this.statusData.nodes.map(t=>t.session_count))}getMaxPresenceCount(){return Math.max(...this.statusData.nodes.map(t=>t.presence_count))}getMaxMatchCount(){return Math.max(...this.statusData.nodes.map(t=>t.match_count))}getTotalMatchCount(){return this.statusData.nodes.reduce((t,e)=>t+e.match_count,0)}getMaxGoroutineCount(){return Math.max(...this.statusData.nodes.map(t=>t.goroutine_count))}getTotalGorountineCount(){return this.statusData.nodes.reduce((t,e)=>t+e.goroutine_count,0)}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-status"]],decls:62,vars:10,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"status-table","table","table-sm","table-striped","mb-4",3,"mouseover","mouseout"],[1,"thead-light"],["scope","col"],[4,"ngIf"],[3,"formGroup"],[1,"row","no-gutters","justify-content-end"],[1,"col-12","text-right"],["ngbDropdown","","role","group",1,"btn-group"],["formControlName","rangeMinutes",1,"custom-select","custom-select-sm","ml-3",3,"change"],[3,"value",4,"ngFor","ngForOf"],[1,"row"],[1,"col-6","d-inline-flex","justify-content-between","align-items-center"],[1,"graph-title"],[1,"d-inline"],[1,"col-6"],["class","graph",4,"ngIf"],[1,"row","mt-4"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","clickable",4,"ngFor","ngForOf"],[1,"border-0"],[1,"clickable"],[3,"ngSwitch"],["class","mr-2","src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",4,"ngSwitchCase"],["class","mr-2","src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",4,"ngSwitchCase"],["class","mr-2","src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",4,"ngSwitchCase"],["class","mr-2","src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",4,"ngSwitchCase"],[1,"text-muted","small",3,"hidden"],["src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",1,"mr-2"],["src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",1,"mr-2"],["src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",1,"mr-2"],["src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",1,"mr-2"],[3,"value"],[1,"graph"],["xAxisLabel","Time","yAxisLabel","Latency (ms)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["seriesTooltipTemplate",""],[1,"chart-legend"],[4,"ngFor","ngForOf"],[1,"legend-label-color",3,"ngStyle"],[1,"legend-label-text"],["xAxisLabel","Time","yAxisLabel","Request Count",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Input (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Output (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Status"),Io(),Do(2,ML,4,2,"ngb-alert",1),Mo(3,"table",2),Vo("mouseover",function(){return e.showDelta=!0})("mouseout",function(){return e.showDelta=!1}),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Node name"),Io(),Mo(8,"th",4),va(9,"Sessions"),Io(),Mo(10,"th",4),va(11,"Presences"),Io(),Mo(12,"th",4),va(13,"Authoritative Matches"),Io(),Mo(14,"th",4),va(15,"Goroutines"),Io(),Io(),Io(),Do(16,BL,12,5,"tbody",5),Io(),Mo(17,"form",6),Mo(18,"div",7),Mo(19,"div",8),Mo(20,"span"),va(21,"View:"),Io(),Mo(22,"div",9),Mo(23,"select",10),Vo("change",function(t){return e.setRange(t)}),Do(24,UL,2,2,"option",11),function(t,e){const n=Me();let i;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new ie("302",`The pipe '${t}' could not be found!`)}("sortNumbers",n.pipeRegistry),n.data[45]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(45,i.onDestroy)):i=n.data[45];const r=i.factory||(i.factory=ne(i.type)),s=bt(Ro);try{const t=An(!1),e=r();An(t),function(t,e,n,i){45>=t.data.length&&(t.data[45]=null,t.blueprint[45]=null),e[45]=i}(n,Le(),0,e)}finally{bt(s)}}(),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",12),Mo(27,"div",13),Mo(28,"div",14),Mo(29,"h5",15),va(30,"Processing Latency"),Io(),Mo(31,"small"),va(32," (ms)"),Io(),Io(),Io(),Mo(33,"div",13),Mo(34,"div",14),Mo(35,"h5",15),va(36,"Rate"),Io(),Mo(37,"small"),va(38," (rpc/s)"),Io(),Io(),Io(),Io(),Mo(39,"div",12),Mo(40,"div",16),Do(41,zL,4,12,"div",17),Io(),Mo(42,"div",16),Do(43,qL,4,12,"div",17),Io(),Io(),Mo(44,"div",18),Mo(45,"div",13),Mo(46,"div",14),Mo(47,"h5",15),va(48,"Input"),Io(),Mo(49,"small"),va(50," (kb/s)"),Io(),Io(),Io(),Mo(51,"div",13),Mo(52,"div",14),Mo(53,"h5",15),va(54,"Output"),Io(),Mo(55,"small"),va(56," (kb/s)"),Io(),Io(),Io(),Io(),Mo(57,"div",12),Mo(58,"div",16),Do(59,YL,4,12,"div",17),Io(),Mo(60,"div",16),Do(61,ZL,4,12,"div",17),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(14),Fo("ngIf",e.statusData),Qr(1),Fo("formGroup",e.rangeForm),Qr(7),Fo("ngForOf",function(t,e,n){const i=t+Kt,r=Le(),s=_e(r,i);return function(t,e){return wo.isWrapped(e)&&(e=wo.unwrap(e),t[je()]=Jr),e}(r,function(t,e){return t[1].data[e].pure}(r,i)?zl(r,He(),e,s.transform,n,s):s.transform(n))}(25,8,e.rangesKeys)),Qr(17),Fo("ngIf",e.latencyGraphData.length>0),Qr(2),Fo("ngIf",e.rateGraphData.length>0),Qr(16),Fo("ngIf",e.inputGraphData.length>0),Qr(2),Fo("ngIf",e.outputGraphData.length>0))},directives:function(){return[Bh,pb,Ry,mb,Kx,Uy,Ty,yb,Ph,_x,jh,zh,T_,Vy,Wy,CL,Wh]},pipes:function(){return[nM]},styles:[".graph[_ngcontent-%COMP%]{height:450px;border-radius:5px;border:1px solid #dadae9}.graph-title[_ngcontent-%COMP%]{padding:.5rem .5rem .5rem 0}.table[_ngcontent-%COMP%]{table-layout:fixed}h4[_ngcontent-%COMP%]{margin-bottom:0}.status-table[_ngcontent-%COMP%]{empty-cells:hide}.status-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:500}.status-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border:1px solid #dadae9;padding:.6em 1em}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%]{border:2px solid #dadae9;background-color:#f5f5f5}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:2px solid #dadae9}"]}),t})(),eM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),nM=(()=>{class t{transform(t){return t.sort((t,e)=>t-e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe={type:(e={name:"sortNumbers",type:t,pure:!1}).type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null},t;var e})();var iM=n("ZR4k"),rM=n("Iab2");const sM=["fileSelector"];function oM(t,e){if(1&t&&(Mo(0,"div",8),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.dropZoneLabel)}}function aM(t,e){if(1&t){const t=No();Mo(0,"div"),Mo(1,"input",9),Vo("click",function(e){return Ie(t),zo(2).openFileSelector(e)}),Io(),Io()}if(2&t){const t=zo(2);Qr(1),Ko("value",t.browseBtnLabel),Fo("className",t.browseBtnClassName)}}function lM(t,e){if(1&t&&(Do(0,oM,2,1,"div",6),Do(1,aM,2,2,"div",7)),2&t){const t=zo();Fo("ngIf",t.dropZoneLabel),Qr(1),Fo("ngIf",t.showBrowseBtn)}}function cM(t,e){}const hM=function(t){return{openFileSelector:t}};class uM{constructor(t,e){this.relativePath=t,this.fileEntry=e}}let dM=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-file-drop-content-tmp",""]]}),t})(),pM=(()=>{class t{constructor(t,e){this.zone=t,this.renderer=e,this.accept="*",this.directory=!1,this.multiple=!0,this.dropZoneLabel="",this.dropZoneClassName="ngx-file-drop__drop-zone",this.useDragEnter=!1,this.contentClassName="ngx-file-drop__content",this.showBrowseBtn=!1,this.browseBtnClassName="btn btn-primary btn-xs ngx-file-drop__browse-btn",this.browseBtnLabel="Browse files",this.onFileDrop=new Wl,this.onFileOver=new Wl,this.onFileLeave=new Wl,this.isDraggingOverDropZone=!1,this.globalDraggingInProgress=!1,this.files=[],this.numOfActiveReadEntries=0,this.helperFormEl=null,this.fileInputPlaceholderEl=null,this.dropEventTimerSubscription=null,this._disabled=!1,this.openFileSelector=t=>{this.fileSelector&&this.fileSelector.nativeElement&&this.fileSelector.nativeElement.click()},this.globalDragStartListener=this.renderer.listen("document","dragstart",t=>{this.globalDraggingInProgress=!0}),this.globalDragEndListener=this.renderer.listen("document","dragend",t=>{this.globalDraggingInProgress=!1})}get disabled(){return this._disabled}set disabled(t){this._disabled=null!=t&&""+t!="false"}ngOnDestroy(){this.dropEventTimerSubscription&&(this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=null),this.globalDragStartListener(),this.globalDragEndListener(),this.files=[],this.helperFormEl=null,this.fileInputPlaceholderEl=null}onDragOver(t){this.useDragEnter?this.preventAndStop(t):this.isDropzoneDisabled()||this.useDragEnter||(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragEnter(t){!this.isDropzoneDisabled()&&this.useDragEnter&&(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragLeave(t){this.isDropzoneDisabled()||(this.isDraggingOverDropZone&&(this.isDraggingOverDropZone=!1,this.onFileLeave.emit(t)),this.preventAndStop(t))}dropFiles(t){if(!this.isDropzoneDisabled()&&(this.isDraggingOverDropZone=!1,t.dataTransfer)){let e;t.dataTransfer.dropEffect="copy",e=t.dataTransfer.items?t.dataTransfer.items:t.dataTransfer.files,this.preventAndStop(t),this.checkFiles(e)}}uploadFiles(t){!this.isDropzoneDisabled()&&t.target&&(this.checkFiles(t.target.files||[]),this.resetFileInput())}checkFiles(t){for(let e=0;e{t(n)}},e=new uM(t.name,t);this.addToQueue(e)}}this.dropEventTimerSubscription&&this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=Bw(200,200).subscribe(()=>{if(this.files.length>0&&0===this.numOfActiveReadEntries){const t=this.files;this.files=[],this.onFileDrop.emit(t)}})}traverseFileTree(t,e){if(t.isFile){const n=new uM(e,t);this.files.push(n)}else{e+="/";const n=t.createReader();let i=[];const r=()=>{this.numOfActiveReadEntries++,n.readEntries(n=>{if(n.length)i=i.concat(n),r();else if(0===i.length){const n=new uM(e,t);this.zone.run(()=>{this.addToQueue(n)})}else for(let t=0;t{this.traverseFileTree(i[t],e+i[t].name)});this.numOfActiveReadEntries--})};r()}}resetFileInput(){if(this.fileSelector&&this.fileSelector.nativeElement){const t=this.fileSelector.nativeElement,e=t.parentElement,n=this.getHelperFormElement(),i=this.getFileInputPlaceholderElement();e!==n&&(this.renderer.insertBefore(e,i,t),this.renderer.appendChild(n,t),n.reset(),this.renderer.insertBefore(e,t,i),this.renderer.removeChild(e,i))}}getHelperFormElement(){return this.helperFormEl||(this.helperFormEl=this.renderer.createElement("form")),this.helperFormEl}getFileInputPlaceholderElement(){return this.fileInputPlaceholderEl||(this.fileInputPlaceholderEl=this.renderer.createElement("div")),this.fileInputPlaceholderEl}canGetAsEntry(t){return!!t.webkitGetAsEntry}isDropzoneDisabled(){return this.globalDraggingInProgress||this.disabled}addToQueue(t){this.files.push(t)}preventAndStop(t){t.stopPropagation(),t.preventDefault()}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ic),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-file-drop"]],contentQueries:function(t,e,n){if(1&t&&ac(n,dM,!0,yl),2&t){let t;ic(t=lc())&&(e.contentTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&rc(sM,!0),2&t){let t;ic(t=lc())&&(e.fileSelector=t.first)}},inputs:{accept:"accept",directory:"directory",multiple:"multiple",dropZoneLabel:"dropZoneLabel",dropZoneClassName:"dropZoneClassName",useDragEnter:"useDragEnter",contentClassName:"contentClassName",showBrowseBtn:"showBrowseBtn",browseBtnClassName:"browseBtnClassName",browseBtnLabel:"browseBtnLabel",disabled:"disabled"},outputs:{onFileDrop:"onFileDrop",onFileOver:"onFileOver",onFileLeave:"onFileLeave"},decls:7,vars:15,consts:[[3,"className","drop","dragover","dragenter","dragleave"],[3,"className"],["type","file",1,"ngx-file-drop__file-input",3,"accept","multiple","change"],["fileSelector",""],["defaultContentTemplate",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","ngx-file-drop__drop-zone-label",4,"ngIf"],[4,"ngIf"],[1,"ngx-file-drop__drop-zone-label"],["type","button",3,"className","value","click"]],template:function(t,e){if(1&t&&(Mo(0,"div",0),Vo("drop",function(t){return e.dropFiles(t)})("dragover",function(t){return e.onDragOver(t)})("dragenter",function(t){return e.onDragEnter(t)})("dragleave",function(t){return e.onDragLeave(t)}),Mo(1,"div",1),Mo(2,"input",2,3),Vo("change",function(t){return e.uploadFiles(t)}),Io(),Do(4,lM,2,2,"ng-template",null,4,dc),Do(6,cM,0,0,"ng-template",5),Io(),Io()),2&t){const t=To(5);ra("ngx-file-drop__drop-zone--over",e.isDraggingOverDropZone),Fo("className",e.dropZoneClassName),Qr(1),Fo("className",e.contentClassName),Qr(1),Fo("accept",e.accept)("multiple",e.multiple),ko("directory",e.directory||void 0)("webkitdirectory",e.directory||void 0)("mozdirectory",e.directory||void 0)("msdirectory",e.directory||void 0)("odirectory",e.directory||void 0),Qr(4),Fo("ngTemplateOutlet",e.contentTemplate||t)("ngTemplateOutletContext",Vl(13,hM,e.openFileSelector))}},directives:[Gh,Bh],styles:[".ngx-file-drop__drop-zone[_ngcontent-%COMP%]{border:2px dotted #0782d0;border-radius:30px;height:100px;margin:auto}.ngx-file-drop__drop-zone--over[_ngcontent-%COMP%]{background-color:hsla(0,0%,57.6%,.5)}.ngx-file-drop__content[_ngcontent-%COMP%]{align-items:center;color:#0782d0;display:flex;height:100px;justify-content:center}.ngx-file-drop__drop-zone-label[_ngcontent-%COMP%]{text-align:center}.ngx-file-drop__file-input[_ngcontent-%COMP%]{display:none}"]}),t})(),fM=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:function(){return[pM]}}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[],imports:[[qh]]}),t})();function gM(t,e){1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3,"Failed to retrieve configuration."),Io(),Io()),2&t&&Fo("dismissible",!1)}function mM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(2).$implicit;Fo("id",t.name),Qr(1),ya(t.value)}}function vM(t,e){1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t&&Fo("id",zo(2).$implicit.name)}function yM(t,e){if(1&t&&(Mo(0,"div",35),Mo(1,"b"),va(2),Io(),Mo(3,"label",27),Mo(4,"a",28),$o(5,"img",10),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.flatConfig[t+1].name),Qr(1),Fo("for",e.flatConfig[t+1].name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",e.flatConfig[t+1].name,"",nr)}}function bM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(3).index,e=zo();Fo("id",e.flatConfig[t+1].name),Qr(1),ya(e.flatConfig[t+1].value)}}function wM(t,e){if(1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t){const t=zo(3).index;Fo("id",zo().flatConfig[t+1].name)}}function xM(t,e){if(1&t&&(Mo(0,"div",36),Do(1,bM,2,2,"span",29),Do(2,wM,2,1,"span",30),Io()),2&t){const t=zo(2).index,e=zo();Qr(1),Fo("ngIf",!e.isEmpty(e.flatConfig[t+1].value)),Qr(1),Fo("ngIf",e.isEmpty(e.flatConfig[t+1].value))}}function _M(t,e){if(1&t&&(Mo(0,"div",26),Mo(1,"div",7),Mo(2,"b"),va(3),Io(),Mo(4,"label",27),Mo(5,"a",28),$o(6,"img",10),Io(),Io(),Io(),Mo(7,"div",7),Do(8,mM,2,2,"span",29),Do(9,vM,2,1,"span",30),Io(),Do(10,yM,6,3,"div",31),Do(11,xM,3,2,"div",32),Io()),2&t){const t=zo(),e=t.index,n=t.$implicit,i=zo();ra("border-top-0",e>0),Qr(3),ya(n.name),Qr(1),Fo("for",n.name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",n.value.name,"",nr),Qr(3),Fo("ngIf",!i.isEmpty(n.value)),Qr(1),Fo("ngIf",i.isEmpty(n.value)),Qr(1),Fo("ngIf",e{class t{constructor(t,e,n,i,r,s){this.config=t,this.route=e,this.httpClient=n,this.modalService=i,this.consoleService=r,this.formBuilder=s,this.configError="",this.uploadError="",this.deleteError="",this.uploading=!1,this.uploadSuccess=!1,this.deleteSuccess=!1,this.deleting=!1,this.apiConfig=t}ngOnInit(){this.route.data.subscribe(t=>{this.nakamaVersion=t[0].server_version;const e=JSON.parse(t[0].config);this.jsonConfig=e,this.flatConfig=this.flattenConfig(e)},t=>{this.configError=t}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])]})}flattenConfig(t){const e=[];return this.traverseConfig("",t,e),e.sort((t,e)=>t.name.localeCompare(e.name))}traverseConfig(t,e,n){for(const i in e)"env"!==i&&(Array.isArray(e[i])?n.push({name:t+i,value:e[i].join(", ")}):"object"==typeof e[i]?this.traverseConfig(i+".",e[i],n):n.push({name:t+i,value:e[i]}))}isEmpty(t){return""===t||0===t}exportYaml(){const t=new Blob([Object(iM.safeDump)(this.jsonConfig)],{type:"text/yaml;charset=utf-8"});rM.saveAs(t,"config.yaml")}dropped(t){this.uploadError="",this.uploadSuccess=!1;for(const e of t)if(e.fileEntry.isFile){const t=e.fileEntry.name.split("."),n=["json","csv"];t.length>1&&n.includes(t[t.length-1].toLowerCase())?e.fileEntry.file(t=>{this.uploadFile(t)}):this.uploadError="Invalid file: must have extension .json or .csv"}}uploadFile(t){const e=new FormData;e.append(t.name,t),this.uploading=!0,this.httpClient.post(this.apiConfig.host+"/v2/console/storage/import",e,{headers:{Authorization:"Bearer "}}).subscribe(()=>{this.uploading=!1,this.uploadSuccess=!0},t=>{this.uploading=!1,this.uploadError=t})}deleteData(){this.deleteError="",this.deleting=!0,this.consoleService.deleteAllData("").pipe(sx(2e3)).subscribe(()=>{this.deleting=!1,this.deleteError="",this.deleteSuccess=!0},t=>{this.deleting=!1,this.deleteError=t})}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}get f(){return this.confirmDeleteForm.controls}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(uw),Ro(pm),Ro(qb),Ro(a_),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:43,vars:11,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"pb-4"],[1,"d-flex","justify-content-between","mb-4","align-items-baseline"],[1,"btn","btn-primary","btn-sm",3,"click"],[1,"config-table"],[4,"ngFor","ngForOf"],[1,"row","py-2","border","border-top-0","add-border-larger","mb-5"],[1,"col-lg-3"],[1,"pl-1"],["target","_blank","href","https://heroiclabs.com/docs/install-configuration/#runtime.env",1,"d-inline"],["src","/static/svg/hint.svg","alt","","width","16","height",""],[1,"col-lg-9"],[4,"ngIf"],[1,"section-divider","d-flex","mb-4"],["type","success",3,"dismissible","close",4,"ngIf"],["accept",".json,.csv","dropZoneClassName","drop-zone","contentClassName","drop-zone-content","dropZoneLabel","Drop CSV or JSON file here",3,"disabled","onFileDrop"],["ngx-file-drop-content-tmp",""],["role","alert",1,"alert","alert-danger","d-flex","justify-content-between","align-items-center"],["src","/static/svg/red-triangle.svg","alt","","width","16","height",""],[1,"pl-2"],["confirmDelete",""],["type","button",1,"btn","btn-danger",3,"disabled","click"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","row py-2 border",3,"border-top-0",4,"ngIf"],[1,"row","py-2","border"],[1,"pl-1",3,"for"],["target","_blank",1,"d-inline",3,"href"],["class","text-break-all",3,"id",4,"ngIf"],["class","text-muted",3,"id",4,"ngIf"],["class","col-md-3 left-line",4,"ngIf"],["class","col-md-3",4,"ngIf"],[1,"text-break-all",3,"id"],[1,"text-muted",3,"id"],[1,"col-md-3","left-line"],[1,"col-md-3"],["class","mb-0 text-break-all",4,"ngFor","ngForOf"],[1,"mb-0","text-break-all"],[1,"mb-0","text-muted"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"click"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],[1,"mt-2"],["autocomplete","off",3,"formGroup"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,e){if(1&t){const t=No();Do(0,gM,4,1,"ngb-alert",0),Mo(1,"h2",1),va(2,"Server Configuration"),Io(),Mo(3,"div",2),Mo(4,"h5"),Mo(5,"b"),va(6,"Server version:"),Io(),va(7),Io(),Mo(8,"button",3),Vo("click",function(){return e.exportYaml()}),va(9,"Export Configuration"),Io(),Io(),Mo(10,"div",4),Do(11,CM,2,1,"ng-container",5),Mo(12,"div",6),Mo(13,"div",7),Mo(14,"b"),va(15,"runtime.env"),Io(),Mo(16,"label",8),Mo(17,"a",9),$o(18,"img",10),Io(),Io(),Io(),Mo(19,"div",11),Do(20,EM,2,1,"div",12),Do(21,kM,3,0,"div",12),Io(),Io(),Io(),Mo(22,"h5",13),va(23,"Import storage data"),Io(),Mo(24,"p"),va(25,"Import storage objects from a CSV or JSON file by dragging and dropping it below."),Io(),Do(26,AM,6,2,"ngb-alert",0),Do(27,DM,4,1,"ngb-alert",14),Mo(28,"ngx-file-drop",15),Vo("onFileDrop",function(t){return e.dropped(t)}),Do(29,TM,2,0,"ng-template",16),Io(),Mo(30,"h5",13),va(31,"Delete all data"),Io(),Do(32,RM,6,2,"ngb-alert",0),Do(33,FM,4,1,"ngb-alert",14),Mo(34,"div",17),Mo(35,"div"),$o(36,"img",18),Mo(37,"small",19),va(38,"Warning - this operation is not reversible!"),Io(),Io(),Do(39,MM,19,5,"ng-template",null,20,dc),Mo(41,"button",21),Vo("click",function(){Ie(t);const n=To(40);return e.openDeleteDataModal(n)}),va(42,"Delete all"),Io(),Io()}2&t&&(Fo("ngIf",e.configError),Qr(7),ba(" ",e.nakamaVersion,""),Qr(4),Fo("ngForOf",e.flatConfig),Qr(9),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&e.jsonConfig.runtime.env.length>0),Qr(1),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&0===e.jsonConfig.runtime.env.length),Qr(5),Fo("ngIf",e.uploadError),Qr(1),Fo("ngIf",e.uploadSuccess),Qr(1),Fo("disabled",e.uploading),Qr(4),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(8),Fo("disabled",e.deleting))},directives:[Bh,Ph,pM,dM,_x,pb,Ry,mb,ay,Ty,yb,$h],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.text-break-all[_ngcontent-%COMP%]{word-break:break-all;word-wrap:anywhere}.config-table[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]:nth-child(2n){background-color:#fafafc}.config-table[_ngcontent-%COMP%] .left-line[_ngcontent-%COMP%]{border-left:1px solid #dadae9}"]}),t})(),$M=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getConfig("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function OM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function PM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",51),va(2,"No additional users are setup. Create a new user below."),Io(),Io()),2&t&&(Qr(1),Fo("colSpan",4))}function NM(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Mo(6,"span",36),va(7,"Administrator"),Io(),Mo(8,"span",36),va(9,"Developer"),Io(),Mo(10,"span",36),va(11,"Maintainer"),Io(),Mo(12,"span",36),va(13,"View Only"),Io(),Io(),Mo(14,"td"),Mo(15,"button",52),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().deleteUser(n.username)}),va(16,"Delete"),Io(),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.username),Qr(2),ya(t.email),Qr(2),Fo("hidden",t.role!==n.adminRole),Qr(2),Fo("hidden",t.role!==n.developerRole),Qr(2),Fo("hidden",t.role!==n.maintainerRole),Qr(2),Fo("hidden",t.role!==n.readonlyRole)}}function BM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3,"An error occurred:"),Io(),Mo(4,"p",53),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.userCreateError)}}const UM=function(t){return{"is-invalid":t}};let VM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.userCreateError="",this.users=[],this.adminRole=cw.USER_ROLE_ADMIN,this.developerRole=cw.USER_ROLE_DEVELOPER,this.maintainerRole=cw.USER_ROLE_MAINTAINER,this.readonlyRole=cw.USER_ROLE_READONLY}ngOnInit(){this.createUserForm=this.formBuilder.group({username:["",py.required],email:["",[py.required,py.email]],password:["",py.compose([py.required,py.minLength(8)])],role:[+this.readonlyRole,py.required],newsletter:[!1]}),this.route.data.subscribe(t=>{const e=t[0];this.users.length=0,this.users.push(...e.users)},t=>{this.error=t})}deleteUser(t){this.error="",this.consoleService.deleteUser("",t).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(t=>{this.error="",this.users.length=0,this.users.push(...t.users)},t=>{this.error=t})}addUser(){this.userCreateError="",this.createUserForm.disable();let t=cw.USER_ROLE_READONLY;switch(this.f.role.value){case 1:t=cw.USER_ROLE_ADMIN;break;case 2:t=cw.USER_ROLE_DEVELOPER;break;case 3:t=cw.USER_ROLE_MAINTAINER;break;case 4:t=cw.USER_ROLE_READONLY}this.consoleService.addUser("",{username:this.f.username.value,email:this.f.email.value,password:this.f.password.value,role:t,newsletter_subscription:this.f.newsletter.value}).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(e=>{this.userCreateError="",this.createUserForm.reset({role:+t}),this.createUserForm.enable(),this.users.length=0,this.users.push(...e.users)},t=>{this.userCreateError=t,this.createUserForm.enable()})}get f(){return this.createUserForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-users"]],decls:121,vars:24,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"user-details","mb-5","table","table-bordered","table-sm","table-striped"],[1,"thead-light"],[2,"width","400px"],[2,"width","300px"],[2,"width","90px"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"section-divider","d-flex","mb-4"],[1,"mb-4","alert-permissions",3,"type"],[1,"alert-title","font-weight-bold"],[1,"d-flex","flex-wrap","flex-row"],[1,"col","col-md-3","p-4","flex-fill","flex-grow-1"],[1,"d-flex","align-items-center","mb-3"],["src","/static/svg/role-admin.svg","alt","","width","30","height","",1,"mr-2"],[1,"m-0","font-weight-bold"],["src","/static/svg/role-developer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-maintainer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-viewonly.svg","alt","","width","30","height","",1,"mr-2"],[1,"add-border","rounded"],[3,"formGroup","ngSubmit"],[1,"row","no-gutters"],[1,"col","d-flex","justify-content-between","align-items-center"],[1,"col-md-3"],["for","email",1,"d-inline"],[1,"col-md-9","ml-0","p-0"],["type","email","id","email","placeholder","email@example.com","required","","formControlName","email",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control",3,"ngClass"],["for","password",1,"d-inline"],["type","password","id","password","placeholder","Password","required","","formControlName","password",1,"form-control",3,"ngClass"],[1,"d-inline"],[1,"btn-group"],["disabled","",1,"btn","btn-outline-dark","disabled"],[3,"hidden"],["ngbDropdown","","role","group",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","add-border-single-row-bottom","mb-4"],[1,"col","d-flex","align-items-center"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","newsletter","formControlName","newsletter",1,"custom-control-input","mr-2","my-2"],["for","newsletter",1,"form-check-label","custom-control-label"],[1,""],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"text-muted",3,"colSpan"],["type","button",1,"btn","btn-danger","btn-outline-dark",3,"click"],[1,"mb-0","pl-4"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Management"),Io(),Do(2,OM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Username"),Io(),Mo(8,"th"),va(9,"Email"),Io(),Mo(10,"th",5),va(11,"Role"),Io(),Mo(12,"th",6),va(13,"Action"),Io(),Io(),Io(),Mo(14,"tbody"),Do(15,PM,3,1,"tr",7),Do(16,NM,17,6,"tr",8),Io(),Io(),Mo(17,"h5",9),va(18,"Add new user"),Io(),Mo(19,"ngb-alert",10),Mo(20,"h6",11),va(21,"User roles"),Io(),Mo(22,"div",12),Mo(23,"div",13),Mo(24,"div",14),$o(25,"img",15),Mo(26,"h6",16),va(27,"Administrator"),Io(),Io(),Mo(28,"small"),va(29," Owners have complete control over the server, its users and resources. "),Io(),Io(),Mo(30,"div",13),Mo(31,"div",14),$o(32,"img",17),Mo(33,"h6",16),va(34,"Developer"),Io(),Io(),Mo(35,"small"),va(36," Like Administrators, Developers have complete control over the server, resources and data. However they cannot add, change or delete console users. "),Io(),Io(),Mo(37,"div",13),Mo(38,"div",14),$o(39,"img",18),Mo(40,"h6",16),va(41,"Maintainer"),Io(),Io(),Mo(42,"small"),va(43," Maintainers have access to adding, changing and delete client resources such as accounts, storage and leaderboard records. They don't have access to the API Explorer or the console users. "),Io(),Io(),Mo(44,"div",13),Mo(45,"div",14),$o(46,"img",19),Mo(47,"h6",16),va(48,"View Only"),Io(),Io(),Mo(49,"small"),va(50," View Only users can only view client resources but cannot make any changes to the data whatsoever. "),Io(),Io(),Io(),Io(),Do(51,BM,6,2,"ngb-alert",1),Mo(52,"div",20),Mo(53,"form",21),Vo("ngSubmit",function(){return e.addUser()}),Mo(54,"div",22),Mo(55,"div",23),Mo(56,"div",24),Mo(57,"label",25),va(58,"Email"),Io(),Io(),Mo(59,"div",26),$o(60,"input",27),Mo(61,"div",28),va(62,"Email is required"),Io(),Io(),Io(),Io(),Mo(63,"div",22),Mo(64,"div",23),Mo(65,"div",24),Mo(66,"label",29),va(67,"Username"),Io(),Io(),Mo(68,"div",26),$o(69,"input",30),Mo(70,"div",28),va(71,"Username is required"),Io(),Io(),Io(),Io(),Mo(72,"div",22),Mo(73,"div",23),Mo(74,"div",24),Mo(75,"label",31),va(76,"Password"),Io(),Io(),Mo(77,"div",26),$o(78,"input",32),Mo(79,"div",28),va(80,"Password is required, must be 8 chars or longer and consist of at least a capital letter, a small letter and a number."),Io(),Io(),Io(),Io(),Mo(81,"div",22),Mo(82,"div",23),Mo(83,"div",24),Mo(84,"label",33),va(85,"Role"),Io(),Io(),Mo(86,"div",26),Mo(87,"div",34),Mo(88,"button",35),Mo(89,"span",36),va(90,"Administrator"),Io(),Mo(91,"span",36),va(92,"Developer"),Io(),Mo(93,"span",36),va(94,"Maintainer"),Io(),Mo(95,"span",36),va(96,"View Only"),Io(),Io(),Mo(97,"div",37),$o(98,"button",38),Mo(99,"div",39),Mo(100,"button",40),Vo("click",function(){return e.f.role.setValue(+e.adminRole)}),va(101,"Administrator"),Io(),Mo(102,"button",40),Vo("click",function(){return e.f.role.setValue(+e.developerRole)}),va(103,"Developer"),Io(),Mo(104,"button",40),Vo("click",function(){return e.f.role.setValue(+e.maintainerRole)}),va(105,"Maintainer"),Io(),Mo(106,"button",40),Vo("click",function(){return e.f.role.setValue(+e.readonlyRole)}),va(107,"View Only"),Io(),Io(),Io(),Io(),Mo(108,"div",28),va(109,"Role is required"),Io(),Io(),Io(),Io(),Mo(110,"div",41),Mo(111,"div",42),$o(112,"div",24),Mo(113,"div",26),Mo(114,"div",43),$o(115,"input",44),Mo(116,"label",45),va(117,"Subscribe to Heroic Labs' newsletters to receive latest updates to Nakama and other news."),Io(),Io(),Io(),Io(),Io(),Mo(118,"div",46),Mo(119,"button",47),va(120,"Save"),Io(),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",0===e.users.length),Qr(1),Fo("ngForOf",e.users),Qr(3),Fo("type","secondary"),Qr(32),Fo("ngIf",e.userCreateError),Qr(2),Fo("formGroup",e.createUserForm),Qr(7),Fo("ngClass",Vl(18,UM,e.f.email.dirty&&e.f.email.errors)),Qr(1),Fo("hidden",e.f.email.disabled||e.f.email.valid||e.f.email.pristine),Qr(8),Fo("ngClass",Vl(20,UM,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(8),Fo("ngClass",Vl(22,UM,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(10),Fo("hidden",e.f.role.value!==+e.adminRole),Qr(2),Fo("hidden",e.f.role.value!==+e.developerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.maintainerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.readonlyRole),Qr(13),Fo("hidden",e.f.role.disabled||e.f.role.valid||e.f.role.pristine),Qr(11),Fo("disabled",e.createUserForm.invalid))},directives:[Bh,Ph,_x,pb,Ry,mb,ay,wb,Ty,yb,$h,Kx,qx,Wx,zx,ry],styles:[".user-details[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.user-details[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.user-details[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.6em 1em}.alert-permissions[_ngcontent-%COMP%]{padding:0}.alert-permissions[_ngcontent-%COMP%] .alert-title[_ngcontent-%COMP%]{padding:1rem}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%]{border-top:1px solid #dadae9;margin:0}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]{border-right:1px solid #dadae9}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]:last-child{border-right:none}"]}),t})(),HM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listUsers("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jM(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Failed to retrieve runtime information: ",t.error,"")}}function zM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function WM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Go modules were found."),Io(),$o(3,"td"),Io())}function GM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function qM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Lua modules were found."),Io(),$o(3,"td"),Io())}function KM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function XM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No JavaScript modules were found."),Io(),$o(3,"td"),Io())}const YM=function(){return["/apiexplorer"]},JM=function(t){return{endpoint:t}};function QM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function ZM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Go RPC functions were found."),Io(),Io())}function tI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function eI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Lua RPC functions were found."),Io(),Io())}function nI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function iI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No JavaScript RPC functions were found."),Io(),Io())}let rI=(()=>{class t{constructor(t,e){this.route=t,this.consoleService=e,this.error=""}ngOnInit(){this.route.data.subscribe(t=>{this.runtimeInfo=t[0]},t=>{this.error=t})}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:51,vars:13,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"runtime-table","mb-4","table","table-sm","table-bordered","mb-5"],[1,"thead-light"],[2,"width","180px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["colspan","2"],[1,"mb-4","section-divider","d-flex"],[1,"runtime-table","table","table-sm","table-bordered"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","200px"],[1,"text-muted"],[2,"width","180px","text-align","center"],[1,"btn","btn-sm","btn-secondary",3,"routerLink","queryParams"],["colspan","2",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Runtime Modules"),Io(),Do(2,jM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th"),va(7,"Go Modules"),Io(),Mo(8,"th",4),va(9,"Last Modified"),Io(),Io(),Io(),Mo(10,"tbody"),Do(11,zM,5,2,"tr",5),Do(12,WM,4,0,"tr",6),Io(),Mo(13,"thead",3),Mo(14,"tr"),Mo(15,"th",7),va(16,"Lua Modules"),Io(),Io(),Io(),Mo(17,"tbody"),Do(18,GM,5,2,"tr",5),Do(19,qM,4,0,"tr",6),Io(),Mo(20,"thead",3),Mo(21,"tr"),Mo(22,"th",7),va(23,"JavaScript Modules"),Io(),Io(),Io(),Mo(24,"tbody"),Do(25,KM,5,2,"tr",5),Do(26,XM,4,0,"tr",6),Io(),Io(),Mo(27,"h4",8),va(28,"Registered RPC Functions"),Io(),Mo(29,"table",9),Mo(30,"thead",3),Mo(31,"tr"),Mo(32,"th",7),va(33,"Go RPC Functions"),Io(),Io(),Io(),Mo(34,"tbody"),Do(35,QM,7,6,"tr",5),Do(36,ZM,3,0,"tr",6),Io(),Mo(37,"thead",3),Mo(38,"tr"),Mo(39,"th",7),va(40,"Lua RPC Functions"),Io(),Io(),Io(),Mo(41,"tbody"),Do(42,tI,7,6,"tr",5),Do(43,eI,3,0,"tr",6),Io(),Mo(44,"thead",3),Mo(45,"tr"),Mo(46,"th",7),va(47,"JavaScript RPC Functions"),Io(),Io(),Io(),Mo(48,"tbody"),Do(49,nI,7,6,"tr",5),Do(50,iI,3,0,"tr",6),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(9),Fo("ngForOf",e.runtimeInfo.go_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_modules.length),Qr(9),Fo("ngForOf",e.runtimeInfo.go_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_rpc_functions.length))},directives:[Bh,Ph,_x,Mv],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.opaque[_ngcontent-%COMP%]{opacity:1%}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.runtime-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.runtime-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.runtime-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-left:1em;padding-right:1em;vertical-align:middle}"]}),t})(),sI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getRuntime("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function oI(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by collection"),Io())}function aI(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.f.collection.value)}}function lI(t,e){if(1&t){const t=No();Mo(0,"button",34),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().f.collection.setValue(n)}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function cI(t,e){if(1&t&&(Mo(0,"ngb-alert",35),$o(1,"img",36),Mo(2,"h6",37),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying storage objects: ",t.error,"")}}function hI(t,e){1&t&&(Mo(0,"th",38),va(1,"Remove"),Io())}function uI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",39),va(2,"No storage objects found - change the filter criteria or add new objects."),Io(),Io())}function dI(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteObject(e,i,r)}),va(2,"Delete"),Io(),Io()}}function pI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(2),Io(),Mo(3,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(4),Io(),Mo(5,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(6),Io(),Mo(7,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(8),Io(),Do(9,dI,3,0,"td",41),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.collection),Qr(2),ya(t.key),Qr(2),ya(t.user_id),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let fI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.collections=[],this.objects=[],this.objectCount=0,this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({collection:[""],key:[""],user_id:[""]});const t=this.route.snapshot.queryParamMap;this.f.collection.setValue(t.get("collection")),this.f.key.setValue(t.get("key")),this.f.user_id.setValue(t.get("user_id")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.collection.value||this.f.user_id.value)&&this.search(0),this.route.data.subscribe(t=>{this.collections.length=0,this.collections.push(...t[0].collections),this.objectCount=t[1].total_count,this.nextCursor=t[1].next_cursor,this.prevCursor=t[1].prev_cursor,this.objects.length=0,this.objects.push(...t[1].objects)},t=>{this.error=t})}disableSearch(){return!(!this.f.key.value||""===this.f.key.value||this.f.collection.value&&""!==this.f.collection.value)}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listStorage("",this.f.user_id.value,this.f.key.value,this.f.collection.value,e).subscribe(t=>{this.error="",this.objectCount=t.total_count,this.nextCursor=t.next_cursor,this.objects.length=0,this.objects.push(...t.objects),this.router.navigate([],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteObject(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteStorageObject("",n.collection,n.key,n.user_id,n.version).subscribe(()=>{this.error="",this.objectCount--,this.objects.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}viewObject(t){this.router.navigate(["/storage",t.collection,t.key,t.user_id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:50,vars:15,consts:[[1,"pb-1"],[1,"pb-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius",3,"disabled"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",1,"btn","btn-secondary","text-secondary",3,"hidden","click"],[1,"dropdown-divider",3,"hidden"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","text","formControlName","key","placeholder","Filter by key",1,"form-control"],["type","text","formControlName","user_id","placeholder","Filter by user ID",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","submit",1,"btn","btn-primary",3,"disabled","click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Storage Objects"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"button",9),Do(12,oI,2,0,"span",10),Do(13,aI,2,1,"span",10),Io(),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.collection.reset()}),va(16,"\u2718 Deselect collection"),Io(),$o(17,"div",13),Do(18,lI,2,1,"button",14),Io(),Io(),Io(),$o(19,"input",15),$o(20,"input",16),Mo(21,"div",17),Mo(22,"span",18),Vo("click",function(){return e.f.user_id.setValue(e.systemUserId)}),$o(23,"img",19),Io(),Io(),Mo(24,"div",17),Mo(25,"button",20),Vo("click",function(){return e.search(0)}),va(26,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(27,"div",21),Mo(28,"div",22),Mo(29,"button",23),Vo("click",function(){return e.search(0)}),$o(30,"img",24),Io(),Mo(31,"button",23),Vo("click",function(){return e.search(1)}),$o(32,"img",25),Io(),Io(),Io(),Io(),Io(),Do(33,cI,4,2,"ngb-alert",26),Mo(34,"div",27),Mo(35,"table",28),Mo(36,"thead",29),Mo(37,"tr"),Mo(38,"th"),va(39,"Collection Name"),Io(),Mo(40,"th"),va(41,"Key Name"),Io(),Mo(42,"th",30),va(43,"User ID"),Io(),Mo(44,"th",31),va(45,"Last Update"),Io(),Do(46,hI,2,0,"th",32),Io(),Io(),Mo(47,"tbody"),Do(48,uI,3,0,"tr",10),Do(49,pI,10,5,"tr",33),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.objectCount," objects found."),Qr(4),Fo("formGroup",e.searchForm),Qr(4),Fo("disabled",0===e.collections.length),Qr(1),Fo("ngIf",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngIf",e.f.collection.value&&""!==e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngForOf",e.collections),Qr(7),Fo("disabled",e.disableSearch()),Qr(4),Fo("disabled",0===e.objects.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.objects.length),Qr(1),Fo("ngForOf",e.objects))},directives:[pb,Ry,mb,Kx,qx,Bh,Wx,zx,Ph,ay,Ty,yb,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),gI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listStorageCollections("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("collection"),i=t.queryParamMap.get("key"),r=t.queryParamMap.get("user_id");return this.consoleService.listStorage("",r,i,n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var vI=n("bU/s");const yI=["editor"];function bI(t,e){if(1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",39),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while modifying storage object: ",t.error,"")}}function wI(t,e){1&t&&(Mo(0,"ngb-alert",40),$o(1,"img",41),Mo(2,"h6",39),va(3,"Storage object was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function xI(t,e){1&t&&(Mo(0,"span"),va(1,"Save as a copy"),Io())}function _I(t,e){1&t&&va(0,"Save")}function CI(t,e){if(1&t&&(Mo(0,"button",42),Do(1,xI,2,0,"span",43),Do(2,_I,1,0,"ng-template",null,44,dc),Io()),2&t){const t=To(3),e=zo();Fo("disabled",e.updating),Qr(1),Fo("ngIf",e.object.collection!==e.f.collection.value||e.object.key!==e.f.keyname.value||e.object.user_id!==e.f.user_id.value)("ngIfElse",t)}}const SI=function(){return["/storage"]},EI=function(t){return{collection:t}},kI=function(t,e){return{collection:t,key:e}},AI=function(t,e,n){return{collection:t,key:e,user_id:n}},DI=function(t){return{"is-invalid":t}};let TI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.objectForm=this.formBuilder.group({collection:["",py.required],keyname:["",py.required],user_id:["",py.required],permission_read:[0,py.required],permission_write:[0,py.required]}),this.route.data.subscribe(t=>{this.object=t[0],this.f.collection.setValue(this.object.collection),this.f.keyname.setValue(this.object.key),this.f.user_id.setValue(this.object.user_id),this.f.permission_read.setValue(this.object.permission_read),this.f.permission_write.setValue(this.object.permission_write),this.updateAllowed()||this.objectForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.object.value),null,2);this.aceEditor.session.setValue(t)}updateObject(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(n){return this.error=n,void(this.updating=!1)}let e=this.object.version;this.object.collection===this.f.collection.value&&this.object.key===this.f.keyname.value&&this.object.user_id===this.f.user_id.value||(e=""),this.consoleService.writeStorageObject("",this.f.collection.value,this.f.keyname.value,this.f.user_id.value,{version:e,value:t,permission_read:this.f.permission_read.value,permission_write:this.f.permission_write.value}).subscribe(t=>{this.updated=!0,this.updating=!1,this.object.version=t.version,""===e&&(this.object.collection=this.f.collection.value,this.object.key=this.f.keyname.value,this.object.user_id=this.f.user_id.value,this.object.permission_read=this.f.permission_read.value,this.object.permission_write=this.f.permission_write.value)},t=>{this.error=t,this.updating=!1})}deleteObject(){this.error="",this.updated=!1,this.updating=!1;const t=this.object;this.consoleService.deleteStorageObject("",t.collection,t.key,t.user_id,t.version).subscribe(()=>{this.router.navigate(["/storage"],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value}})},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.objectForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(yI,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:88,vars:50,consts:[[1,"pb-1"],[1,"storage-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink","queryParams"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","collection",1,"d-inline"],["type","text","id","collection","placeholder","Collection","required","","formControlName","collection",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","key",1,"d-inline"],["type","text","id","key","placeholder","Key","required","","formControlName","keyname",1,"form-control","form-control-sm","my-2",3,"ngClass"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","required","","formControlName","user_id",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","permission_read",1,"d-inline"],["ngbRadioGroup","","id","permission_read","name","permission_read","formControlName","permission_read",1,"btn-group","btn-group-toggle"],["ngbButtonLabel","",1,"btn-outline-secondary"],["ngbButton","","type","radio",3,"disabled","value"],["for","version",1,"d-inline"],["type","text","id","version","placeholder","Version","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","permission_write",1,"d-inline"],["ngbRadioGroup","","id","permission_write","name","permission_write","formControlName","permission_write",1,"btn-group","btn-group-toggle"],[1,"row","add-border-single-row-bottom","mb-3"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mt-3","mb-3",2,"height","500px"],[2,"height","500px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"],[4,"ngIf","ngIfElse"],["elseBlock",""]],template:function(t,e){var n,i,r,s,o,a;1&t&&(Mo(0,"h2",0),va(1,"Storage Object"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),va(6,"Storage"),Io(),Mo(7,"li",4),Mo(8,"a",5),va(9),Io(),Io(),Mo(10,"li",4),Mo(11,"a",5),va(12),Io(),Io(),Mo(13,"li",4),Mo(14,"a",5),va(15),Io(),Io(),Io(),Io(),Io(),Do(16,bI,4,2,"ngb-alert",6),Do(17,wI,4,1,"ngb-alert",7),Mo(18,"form",8),Vo("ngSubmit",function(){return e.updateObject()}),Mo(19,"div",9),Mo(20,"div",10),Mo(21,"div",11),Mo(22,"label",12),va(23,"Collection"),Io(),Io(),$o(24,"input",13),Mo(25,"div",14),va(26,"Collection is required"),Io(),Io(),Mo(27,"div",10),Mo(28,"div",11),Mo(29,"label",15),va(30,"Key"),Io(),Io(),$o(31,"input",16),Mo(32,"div",14),va(33,"Key is required"),Io(),Io(),Io(),Mo(34,"div",9),Mo(35,"div",10),Mo(36,"div",11),Mo(37,"label",17),va(38,"User ID"),Io(),Io(),$o(39,"input",18),Mo(40,"div",14),va(41,"User ID is required"),Io(),Io(),Mo(42,"div",19),Mo(43,"div",11),Mo(44,"label",20),va(45,"Read Permission"),Io(),Io(),Mo(46,"div",21),Mo(47,"label",22),$o(48,"input",23),va(49," No Read "),Io(),Mo(50,"label",22),$o(51,"input",23),va(52," Owner Read "),Io(),Mo(53,"label",22),$o(54,"input",23),va(55," Public Read "),Io(),Io(),Io(),Io(),Mo(56,"div",9),Mo(57,"div",10),Mo(58,"div",11),Mo(59,"label",24),va(60,"Version"),Io(),Io(),$o(61,"input",25),Io(),Mo(62,"div",19),Mo(63,"div",11),Mo(64,"label",26),va(65,"Write Permission"),Io(),Io(),Mo(66,"div",27),Mo(67,"label",22),$o(68,"input",23),va(69," No Write "),Io(),Mo(70,"label",22),$o(71,"input",23),va(72," Owner Write "),Io(),Io(),Io(),Io(),Mo(73,"div",28),Mo(74,"div",10),Mo(75,"div",11),Mo(76,"label",29),va(77,"Create Time"),Io(),Io(),$o(78,"input",30),Io(),Mo(79,"div",10),Mo(80,"div",11),Mo(81,"label",31),va(82,"Update Time"),Io(),Io(),$o(83,"input",32),Io(),Io(),Mo(84,"div",33),$o(85,"div",34,35),Io(),Do(87,CI,4,3,"button",36),Io()),2&t&&(Qr(8),Fo("routerLink",Ul(32,SI))("queryParams",Vl(33,EI,e.object.collection)),Qr(1),ya(e.object.collection),Qr(2),Fo("routerLink",Ul(35,SI))("queryParams",Hl(36,kI,e.object.collection,e.object.key)),Qr(1),ya(e.object.key),Qr(2),Fo("routerLink",Ul(39,SI))("queryParams",(n=40,i=AI,r=e.object.collection,s=e.object.key,o=e.object.user_id,function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Eo(t,e,n,i);return So(t,e+2,r)||s}(t,l,r,s,o)?Co(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):jl(t,l+3)}(Le(),He(),n,i,r,s,o,a))),Qr(1),ya(e.object.user_id),Qr(1),Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.objectForm),Qr(6),Fo("ngClass",Vl(44,DI,e.f.collection.dirty&&e.f.collection.errors)),Qr(1),Fo("hidden",e.f.collection.disabled||e.f.collection.valid||e.f.collection.pristine),Qr(6),Fo("ngClass",Vl(46,DI,e.f.keyname.dirty&&e.f.keyname.errors)),Qr(1),Fo("hidden",e.f.keyname.disabled||e.f.keyname.valid||e.f.keyname.pristine),Qr(7),Fo("ngClass",Vl(48,DI,e.f.user_id.dirty&&e.f.user_id.errors)),Qr(1),Fo("hidden",e.f.user_id.disabled||e.f.user_id.valid||e.f.user_id.pristine),Qr(8),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(3),Fo("disabled",!e.updateAllowed())("value",2),Qr(7),Fo("value",e.object.version),Qr(7),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(7),Fo("value",e.object.create_time),Qr(5),Fo("value",e.object.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Mv,Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,kx,Sx,Ax,_x],styles:[".storage-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})(),RI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("collection"),i=t.paramMap.get("key"),r=t.paramMap.get("user_id");return this.consoleService.getStorage("",n,i,r)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FI(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function LI(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function MI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function II(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function $I(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function OI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function PI(t,e){if(1&t){const t=No();Mo(0,"td",18),Mo(1,"button",19),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLeaderboard(e,i,r)}),va(2,"Delete"),Io(),Io()}}function NI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(2),Io(),Mo(3,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(4),Io(),Mo(5,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(6),Io(),Mo(7,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(8),Io(),Do(9,MI,2,0,"td",15),Do(10,II,2,0,"td",15),Do(11,$I,2,0,"td",15),Do(12,OI,2,0,"td",15),Do(13,PI,3,0,"td",16),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(n.orderString[t.sort_order]),Qr(2),ya(n.operatorString[t.operator]),Qr(2),ya(""===t.reset_schedule?"-":t.reset_schedule),Qr(1),Fo("ngIf",t.authoritative),Qr(1),Fo("ngIf",!t.authoritative),Qr(1),Fo("ngIf",t.tournament),Qr(1),Fo("ngIf",!t.tournament),Qr(1),Fo("ngIf",n.deleteAllowed())}}function BI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",20),va(2,"No leaderboards were found."),Io(),Io())}let UI=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.authService=n,this.consoleService=i,this.error="",this.leaderboards=[],this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"}}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboards.length=0,this.leaderboards.push(...t[0].leaderboards)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}deleteLeaderboard(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboard("",n.id).subscribe(()=>{this.error="",this.leaderboards.splice(e,1)},t=>{this.error=t})}viewLeaderboardEntries(t){this.router.navigate(["/leaderboards",t.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(mw),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:5,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","130px"],[2,"width","100px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[3,"click"],["class","text-center",3,"click",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"text-center",3,"click"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboards"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FI,4,2,"ngb-alert",2),Mo(5,"table",3),Mo(6,"thead",4),Mo(7,"tr"),Mo(8,"th"),va(9,"Leaderboard ID"),Io(),Mo(10,"th",5),va(11,"Sort Order"),Io(),Mo(12,"th",5),va(13,"Operator"),Io(),Mo(14,"th",5),va(15,"Reset Schedule"),Io(),Mo(16,"th",6),va(17,"Authoritative"),Io(),Mo(18,"th",6),va(19,"Tournament"),Io(),Do(20,LI,2,0,"th",7),Io(),Io(),Mo(21,"tbody"),Do(22,NI,14,9,"tr",8),Do(23,BI,3,0,"tr",9),Io(),Io()),2&t&&(Qr(3),ba("",e.leaderboards.length," leaderboards found."),Qr(1),Fo("ngIf",e.error),Qr(16),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngForOf",e.leaderboards),Qr(1),Fo("ngIf",0===e.leaderboards.length))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),VI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listLeaderboards("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function HI(t,e){if(1&t&&(Mo(0,"ngb-alert",31),$o(1,"img",32),Mo(2,"h6",33),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying accounts: ",t.error,"")}}function jI(t,e){1&t&&(Mo(0,"th",34),va(1,"Remove"),Io())}function zI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",35),va(2,"No users found - change the filter criteria or add new user accounts."),Io(),Io())}function WI(t,e){1&t&&$o(0,"td")}function GI(t,e){if(1&t){const t=No();Mo(0,"td",38),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteAccount(e,i,r)}),va(2,"Delete"),Io(),Io()}}function qI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(8),Io(),Do(9,WI,1,0,"td",29),Do(10,GI,3,0,"td",37),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.username),Qr(2),ya(t.display_name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let KI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.accountsCount=0,this.accounts=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""],filter_type:[0]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.f.filter_type.setValue(+t.get("filter_type")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.filter.value||this.f.filter_type.value)&&this.search(0),this.route.data.subscribe(t=>{this.accounts.length=0,t&&(this.accounts.push(...t[0].users),this.accountsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listAccounts("",this.f.filter.value,this.f.filter_type.value&&1===this.f.filter_type.value,e).subscribe(t=>{this.error="",this.accounts.length=0,this.accounts.push(...t.users),this.accountsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,filter_type:this.f.filter_type.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteAccount(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteAccount("",n.id,!1).subscribe(()=>{this.error="",this.accounts.splice(e,1),this.accountsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewAccount(t){this.router.navigate(["/accounts",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:45,vars:9,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by user ID, social provider ID, device ID, or username (use '%' for prefix or suffix wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],["ngbDropdown","","role","group","aria-label","Button group with nested dropdown",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split",3,"disabled"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Accounts"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"span",9),Vo("click",function(){return e.f.filter.setValue(e.systemUserId)}),$o(12,"img",10),Io(),Io(),Mo(13,"div",8),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.filter_type.setValue(0),e.search(0)}),va(16,"Search"),Io(),Mo(17,"div",13),$o(18,"button",14),Mo(19,"div",15),Mo(20,"button",16),Vo("click",function(){return e.f.filter_type.setValue(1),e.search(0)}),va(21,"Tombstones"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(22,"div",17),Mo(23,"div",18),Mo(24,"button",19),Vo("click",function(){return e.search(0)}),$o(25,"img",20),Io(),Mo(26,"button",19),Vo("click",function(){return e.search(1)}),$o(27,"img",21),Io(),Io(),Io(),Io(),Io(),Do(28,HI,4,2,"ngb-alert",22),Mo(29,"div",23),Mo(30,"table",24),Mo(31,"thead",25),Mo(32,"tr"),Mo(33,"th",26),va(34,"User ID"),Io(),Mo(35,"th"),va(36,"Username"),Io(),Mo(37,"th"),va(38,"Display Name"),Io(),Mo(39,"th",27),va(40,"Last Update"),Io(),Do(41,jI,2,0,"th",28),Io(),Io(),Mo(42,"tbody"),Do(43,zI,3,0,"tr",29),Do(44,qI,11,6,"tr",30),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.accountsCount," accounts found."),Qr(4),Fo("formGroup",e.searchForm),Qr(11),Fo("disabled",!e.f.filter.value||""===e.f.filter.value),Qr(6),Fo("disabled",0===e.accounts.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.accounts.length),Qr(1),Fo("ngForOf",e.accounts))},directives:[pb,Ry,mb,ay,Ty,yb,Kx,qx,Wx,zx,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),XI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter"),i=t.queryParamMap.get("tombstones");return this.consoleService.listAccounts("",n,"true"===i,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function YI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().exportAccount(e)}),$o(1,"img",16),va(2,"Export"),Io()}}function JI(t,e){1&t&&(Mo(0,"span"),va(1,"Unban"),Io())}function QI(t,e){1&t&&(Mo(0,"span"),va(1,"Ban"),Io())}function ZI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().banUnbanAccount(e)}),$o(1,"img",17),Do(2,JI,2,0,"span",18),Do(3,QI,2,0,"span",18),Io()}if(2&t){const t=zo();Qr(2),Fo("ngIf",t.account.disable_time),Qr(1),Fo("ngIf",!t.account.disable_time)}}function t$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!1)}),$o(1,"img",20),va(2,"Delete"),Io()}}function e$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!0)}),$o(1,"img",21),va(2,"Recorded delete"),Io()}}function n$(t,e){if(1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const i$=function(t,e){return["/accounts",t,e]};function r$(t,e){if(1&t&&(Mo(0,"div"),Oo(1,25),Mo(2,"a",26),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,i$,n.account.user.id,t.path)),Qr(1),ya(t.label)}}const s$=function(){return["/accounts"]},o$=function(){return["/storage"]},a$=function(t){return{user_id:t}};let l$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Profile",path:"profile"},{label:"Authentication",path:"authentication"},{label:"Friends",path:"friends"},{label:"Groups",path:"groups"},{label:"Wallet",path:"wallet"},{label:"Purchases",path:"purchases"},{label:"Subscriptions",path:"subscriptions"}]}ngOnInit(){this.route.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAccount(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteAccount("",this.account.user.id,e).subscribe(()=>{this.error="",this.router.navigate(["/accounts"])},t=>{this.error=t})}banUnbanAccount(t){t.target.disabled=!0,this.error="",this.account.disable_time?this.consoleService.unbanAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=null,t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1}):this.consoleService.banAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=Date.now().toString(),t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1})}exportAccount(t){t.target.disabled=!0,this.error="",this.consoleService.exportAccount("",this.account.user.id).subscribe(e=>{this.error="";const n=this.account.user.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:14,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["ngbNavItem","storage"],["ngbNavLink","",3,"routerLink","queryParams"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["src","/static/svg/ban.svg","alt","","width","13","height","13",1,"mr-2"],[4,"ngIf"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["src","/static/svg/bin-recorded.svg","alt","","width","15","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Account"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Account"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,YI,3,0,"button",7),Do(12,ZI,4,2,"button",7),Do(13,t$,3,0,"button",8),Do(14,e$,3,0,"button",8),Io(),Io(),Do(15,n$,4,2,"ngb-alert",9),Mo(16,"nav",10,11),Do(18,r$,4,6,"div",12),Mo(19,"div"),Oo(20,13),Mo(21,"a",14),va(22," Storage "),Io(),Po(),Io(),Io(),$o(23,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(10,s$)),Qr(3),ya(e.account.user.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.banAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views),Qr(3),Fo("routerLink",Ul(11,o$))("queryParams",Vl(12,a$,e.account.user.id)))},directives:[Mv,Bh,f_,Ph,p_,g_,Ov,_x,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),c$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getAccount("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const h$=["editor"];function u$(t,e){if(1&t&&(Mo(0,"ngb-alert",29),$o(1,"img",30),Mo(2,"h6",31),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function d$(t,e){1&t&&(Mo(0,"ngb-alert",32),$o(1,"img",33),Mo(2,"h6",31),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function p$(t,e){1&t&&(Mo(0,"button",34),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const f$=function(t){return{"is-invalid":t}};let g$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({username:["",py.required],display_name:[""],avatar_url:[""],location:[""],timezone:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.username.setValue(this.account.user.username),this.f.display_name.setValue(this.account.user.display_name),this.f.avatar_url.setValue(this.account.user.avatar_url),this.f.location.setValue(this.account.user.location),this.f.timezone.setValue(this.account.user.timezone),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.user.metadata),null,2);this.aceEditor.session.setValue(t)}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{username:this.f.username.value,display_name:this.f.display_name.value,avatar_url:this.f.avatar_url.value,location:this.f.location.value,timezone:this.f.timezone.value,metadata:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(h$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:53,vars:11,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","display_name",1,"d-inline"],["type","text","id","display_name","placeholder","Display Name","formControlName","display_name",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","location",1,"d-inline"],["type","text","id","location","placeholder","Location","formControlName","location",1,"form-control","form-control-sm","my-2"],["for","timezone",1,"d-inline"],["type","text","id","timezone","placeholder","Timezone","formControlName","timezone",1,"form-control","form-control-sm","my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,u$,4,2,"ngb-alert",0),Do(1,d$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"User ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Username"),Io(),Io(),$o(13,"input",9),Mo(14,"div",10),va(15,"Username is required"),Io(),Io(),Io(),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",11),va(20,"Display Name"),Io(),Io(),$o(21,"input",12),Io(),Mo(22,"div",13),Mo(23,"div",5),Mo(24,"label",14),va(25,"Avatar URL"),Io(),Io(),$o(26,"input",15),Io(),Io(),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"div",5),Mo(30,"label",16),va(31,"Location"),Io(),Io(),$o(32,"input",17),Io(),Mo(33,"div",13),Mo(34,"div",5),Mo(35,"label",18),va(36,"Timezone"),Io(),Io(),$o(37,"input",19),Io(),Io(),Mo(38,"div",20),Mo(39,"div",4),Mo(40,"div",5),Mo(41,"label",21),va(42,"Create Time"),Io(),Io(),$o(43,"input",22),Io(),Mo(44,"div",4),Mo(45,"div",5),Mo(46,"label",23),va(47,"Update Time"),Io(),Io(),$o(48,"input",24),Io(),Io(),Mo(49,"div",25),$o(50,"div",26,27),Io(),Do(52,p$,2,1,"button",28),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(6),Fo("value",e.account.user.id),Qr(5),Fo("ngClass",Vl(9,f$,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(29),Fo("value",e.account.user.create_time),Qr(5),Fo("value",e.account.user.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,_x],styles:[""]}),t})();function m$(t,e){if(1&t&&(Mo(0,"ngb-alert",36),$o(1,"img",37),Mo(2,"h6",38),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function v$(t,e){1&t&&(Mo(0,"ngb-alert",39),$o(1,"img",40),Mo(2,"h6",38),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function y$(t,e){if(1&t&&(Mo(0,"option",41),va(1),Io()),2&t){const t=e.$implicit,n=e.index;Ko("value",n),Fo("selected",0===n),Qr(1),ya(t.id)}}function b$(t,e){1&t&&(Mo(0,"button",42),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}let w$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({email:[""],password:[""],selected_device_id_index:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.email.setValue(this.account.email),this.f.password.setValue(""),this.f.selected_device_id_index.setValue(0),0===this.account.devices.length&&this.f.selected_device_id_index.disable(),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t={email:this.f.email.value};this.f.password.dirty&&(t.password=this.f.password.value),this.consoleService.updateAccount("",this.account.user.id,t).subscribe(t=>{this.updated=!0,this.updating=!1,this.f.password.reset()},t=>{this.error=t,this.updating=!1})}unlinkDeviceId(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkDevice("",this.account.user.id,{device_id:this.account.devices[this.f.selected_device_id_index.value].id}).subscribe(()=>{this.error="",this.account.devices.splice(this.f.selected_device_id_index.value,1),this.f.selected_device_id_index.setValue(0)},t=>{this.error=t})}unlinkCustomID(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkCustom("",this.account.user.id).subscribe(()=>{this.error="",this.account.custom_id=null},t=>{this.error=t})}unlinkFacebook(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebook("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_id=null},t=>{this.error=t})}unlinkFacebookInstantGames(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebookInstantGame("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_instant_game_id=null},t=>{this.error=t})}unlinkApple(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkApple("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.apple_id=null},t=>{this.error=t})}unlinkGameCenter(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGameCenter("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.gamecenter_id=null},t=>{this.error=t})}unlinkGoogle(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGoogle("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.google_id=null},t=>{this.error=t})}unlinkSteam(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkSteam("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.steam_id=null},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}copyDeviceIdToClipboard(t){const e=document.createElement("textarea");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.opacity="0",e.value=this.account.devices[t].id,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:102,vars:21,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","selected_device_id_index",1,"d-inline"],[1,"input-group"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["src","/static/svg/copy.svg","alt","","width","16","height","",1,""],["id","selected_device_id_index","formControlName","selected_device_id_index",1,"form-control","custom-select","custom-select-sm"],[3,"value","selected",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","button",1,"btn","btn-sm","btn-outline-danger",3,"disabled","click"],["for","custom_id",1,"d-inline"],["type","text","id","custom_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","facebook_id",1,"d-inline"],["type","text","id","facebook_id","disabled","",1,"form-control","form-control-sm",3,"value"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","facebook_instant_game_id",1,"d-inline"],["type","text","id","facebook_instant_game_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","apple_id",1,"d-inline"],["type","text","id","apple_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","gamecenter_id",1,"d-inline"],["type","text","id","gamecenter_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","google_id",1,"d-inline"],["type","text","id","google_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","steam_id",1,"d-inline"],["type","text","id","steam_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","email",1,"d-inline"],["type","text","id","email","placeholder","Email","formControlName","email",1,"form-control","form-control-sm"],["for","password",1,"d-inline"],["type","text","id","password","placeholder","Password","formControlName","password",1,"form-control","form-control-sm"],[1,"row","remove-sides"],[1,"small"],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[3,"value","selected"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,m$,4,2,"ngb-alert",0),Do(1,v$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Device IDs"),Io(),Io(),Mo(8,"div",7),Mo(9,"button",8),Vo("click",function(){return e.copyDeviceIdToClipboard(e.f.selected_device_id_index.value)}),$o(10,"img",9),va(11," Copy "),Io(),Mo(12,"select",10),Do(13,y$,2,3,"option",11),Io(),Mo(14,"div",12),Mo(15,"button",13),Vo("click",function(t){return e.unlinkDeviceId(t)}),va(16,"Unlink"),Io(),Io(),Io(),Io(),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",14),va(20,"Custom ID"),Io(),Io(),Mo(21,"div",7),$o(22,"input",15),Mo(23,"div",12),Mo(24,"button",13),Vo("click",function(t){return e.unlinkCustomID(t)}),va(25,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",3),Mo(27,"div",4),Mo(28,"div",5),Mo(29,"label",16),va(30,"Facebook ID"),Io(),Io(),Mo(31,"div",7),$o(32,"input",17),Mo(33,"div",12),Mo(34,"button",13),Vo("click",function(t){return e.unlinkFacebook(t)}),va(35,"Unlink"),Io(),Io(),Io(),Io(),Mo(36,"div",18),Mo(37,"div",5),Mo(38,"label",19),va(39,"FB Instant Game ID"),Io(),Io(),Mo(40,"div",7),$o(41,"input",20),Mo(42,"div",12),Mo(43,"button",13),Vo("click",function(t){return e.unlinkFacebookInstantGames(t)}),va(44,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(45,"div",3),Mo(46,"div",4),Mo(47,"div",5),Mo(48,"label",21),va(49,"Apple ID"),Io(),Io(),Mo(50,"div",7),$o(51,"input",22),Mo(52,"div",12),Mo(53,"button",13),Vo("click",function(t){return e.unlinkApple(t)}),va(54,"Unlink"),Io(),Io(),Io(),Io(),Mo(55,"div",18),Mo(56,"div",5),Mo(57,"label",23),va(58,"GameCenter ID"),Io(),Io(),Mo(59,"div",7),$o(60,"input",24),Mo(61,"div",12),Mo(62,"button",13),Vo("click",function(t){return e.unlinkGameCenter(t)}),va(63,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(64,"div",3),Mo(65,"div",4),Mo(66,"div",5),Mo(67,"label",25),va(68,"Google ID"),Io(),Io(),Mo(69,"div",7),$o(70,"input",26),Mo(71,"div",12),Mo(72,"button",13),Vo("click",function(t){return e.unlinkGoogle(t)}),va(73,"Unlink"),Io(),Io(),Io(),Io(),Mo(74,"div",4),Mo(75,"div",5),Mo(76,"label",27),va(77,"Steam ID"),Io(),Io(),Mo(78,"div",7),$o(79,"input",28),Mo(80,"div",12),Mo(81,"button",13),Vo("click",function(t){return e.unlinkSteam(t)}),va(82,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(83,"div",3),Mo(84,"div",4),Mo(85,"div",5),Mo(86,"label",29),va(87,"Email"),Io(),$o(88,"br"),Io(),$o(89,"input",30),Io(),Mo(90,"div",4),Mo(91,"div",5),Mo(92,"label",31),va(93,"Password"),Io(),Io(),$o(94,"input",32),Io(),Io(),Mo(95,"div",33),Mo(96,"div",4),$o(97,"div",5),Mo(98,"span",34),va(99),Io(),Io(),$o(100,"div",4),Io(),Do(101,b$,2,1,"button",35),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(11),Fo("ngForOf",e.account.devices),Qr(2),Fo("disabled",!e.updateAllowed()||0===e.account.devices.length),Qr(7),Fo("value",e.account.custom_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.custom_id||""===e.account.custom_id),Qr(8),Fo("value",e.account.user.facebook_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_id||""===e.account.user.facebook_id),Qr(7),Fo("value",e.account.user.facebook_instant_game_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_instant_game_id||""===e.account.user.facebook_instant_game_id),Qr(8),Fo("value",e.account.user.apple_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.apple_id||""===e.account.user.apple_id),Qr(7),Fo("value",e.account.user.gamecenter_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.gamecenter_id||""===e.account.user.gamecenter_id),Qr(8),Fo("value",e.account.user.google_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.google_id||""===e.account.user.google_id),Qr(7),Fo("value",e.account.user.steam_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.steam_id||""===e.account.user.steam_id),Qr(18),ba("Verification Status: ",null===e.account.verify_time?"Not Verified":"Verified",""),Qr(2),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Ph,ay,_x,Vy,Wy],styles:[".custom-select[_ngcontent-%COMP%]{height:auto}"]}),t})();const x$=["editor"];function _$(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function C$(t,e){1&t&&(Mo(0,"ngb-alert",27),$o(1,"img",28),Mo(2,"h6",26),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function S$(t,e){if(1&t){const t=No();Mo(0,"button",29),Vo("click",function(){return Ie(t),zo().updateWallet()}),va(1,"Save"),Io()}2&t&&Fo("disabled",zo().updating)}function E$(t,e){1&t&&(Mo(0,"th",30),va(1,"Remove"),Io())}function k$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",31),va(2,"No wallet ledger items found."),Io(),Io())}function A$(t,e){1&t&&$o(0,"div",37)}function D$(t,e){1&t&&$o(0,"div",38)}function T$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLedgerItem(e,i,r)}),va(2,"Delete"),Io(),Io()}}function R$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",40),Mo(2,"pre",41),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function F$(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",32),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.walletLedgerMetadataOpen[n]=!i.walletLedgerMetadataOpen[n]}),Do(3,A$,1,0,"div",33),Do(4,D$,1,0,"div",34),Io(),va(5),Io(),Mo(6,"td",35),Mo(7,"pre",36),va(8),Io(),Io(),Mo(9,"td"),va(10),Io(),Do(11,T$,3,0,"td",22),Io(),Do(12,R$,5,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.walletLedgerMetadataOpen[t]),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t]),Qr(1),ba(" ",n.id," "),Qr(3),ya(n.changeset),Qr(2),ya(n.update_time),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t])}}let L$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.walletLedger=[],this.walletLedgerMetadataOpen=[],this.updating=!1,this.updated=!1,this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.walletLedger.length=0,this.walletLedger.push(...t[0].items),this.walletLedgerMetadataOpen.length=this.walletLedger.length,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}loadData(t){this.consoleService.getWalletLedger("",this.userID,this.limit,t).subscribe(t=>{this.walletLedger=t.items,this.walletLedgerMetadataOpen=[],this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.wallet),null,2);this.aceEditor.session.setValue(t)}updateWallet(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{wallet:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteLedgerItem(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteWalletLedger("",this.account.user.id,n.id).subscribe(()=>{this.error="",this.walletLedger.splice(e,1),this.walletLedgerMetadataOpen.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(x$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:32,vars:9,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","button","class","btn btn-primary",3,"disabled","click",4,"ngIf"],[1,"my-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","315px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"disabled","click"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"align-middle"],[1,"m-0","p-0"],[1,"arrow-right"],[1,"arrow-down"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","5",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,_$,4,2,"ngb-alert",0),Do(1,C$,4,1,"ngb-alert",1),Mo(2,"div",2),$o(3,"div",3,4),Io(),Do(5,S$,2,1,"button",5),$o(6,"hr",6),Mo(7,"div",7),Mo(8,"div",8),$o(9,"div",9),Mo(10,"div",10),Mo(11,"div",11),Mo(12,"button",12),Vo("click",function(){return e.loadData("")}),$o(13,"img",13),Io(),Mo(14,"button",12),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(15,"img",14),Io(),Mo(16,"button",12),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(17,"img",15),Io(),Io(),Io(),Io(),Io(),Mo(18,"div",16),Mo(19,"table",17),Mo(20,"thead",18),Mo(21,"tr"),Mo(22,"th",19),va(23,"ID"),Io(),Mo(24,"th"),va(25,"Changeset"),Io(),Mo(26,"th",20),va(27,"Update Time"),Io(),Do(28,E$,2,0,"th",21),Io(),Io(),Mo(29,"tbody"),Do(30,k$,3,0,"tr",22),Do(31,F$,13,7,"ng-template",23),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(4),Fo("ngIf",e.updateAllowed()),Qr(7),Fo("disabled",0===e.walletLedger.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(12),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.walletLedger.length),Qr(1),Fo("ngForOf",e.walletLedger))},directives:[Bh,Ph,_x],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}"]}),t})(),M$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getWalletLedger("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function I$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function $$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function O$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No friends found."),Io(),Io())}function P$(t,e){1&t&&(Mo(0,"span"),va(1,"Friend (0)"),Io())}function N$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Sent (1)"),Io())}function B$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Received (2)"),Io())}function U$(t,e){1&t&&(Mo(0,"span"),va(1,"Blocked (3)"),Io())}function V$(t,e){if(1&t){const t=No();Mo(0,"td",16),Mo(1,"button",17),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteFriend(e,i,r)}),va(2,"Delete"),Io(),Io()}}function H$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Do(6,P$,2,0,"span",8),Do(7,N$,2,0,"span",8),Do(8,B$,2,0,"span",8),Do(9,U$,2,0,"span",8),Io(),Mo(10,"td"),va(11),Io(),Do(12,V$,3,0,"td",15),Io()),2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let j$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.friends=[]}ngOnInit(){this.route.data.subscribe(t=>{this.friends.length=0,this.friends.push(...t[0].friends)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteFriend(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteFriend("",this.account.user.id,n.user.id).subscribe(()=>{this.error="",this.friends.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,I$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"User ID"),Io(),Mo(7,"th"),va(8,"Username"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,$$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,O$,3,0,"tr",8),Do(16,H$,13,8,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.friends.length),Qr(1),Fo("ngForOf",e.friends))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),z$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getFriends("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function W$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function G$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function q$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No group membership found."),Io(),Io())}function K$(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function X$(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function Y$(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function J$(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function Q$(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function Z$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",16),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function tO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,K$,2,0,"span",8),Do(7,X$,2,0,"span",8),Do(8,Y$,2,0,"span",8),Do(9,J$,2,0,"span",8),Do(10,Q$,2,0,"span",8),Io(),Mo(11,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,Z$,3,0,"td",8),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.group.id),Qr(2),ya(t.group.name),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.group.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let eO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.groups=[]}ngOnInit(){this.route.data.subscribe(t=>{this.groups.length=0,this.groups.push(...t[0].user_groups)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",this.account.user.id,n.group.id).subscribe(()=>{this.error="",this.groups.splice(e,1)},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/groups",t.group.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,W$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"Group ID"),Io(),Mo(7,"th"),va(8,"Name"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,G$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,q$,3,0,"tr",8),Do(16,tO,14,9,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),nO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getGroups("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const iO=["editor"];function rO(t,e){if(1&t&&(Mo(0,"ngb-alert",34),$o(1,"img",35),Mo(2,"h6",36),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function sO(t,e){1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",36),va(3,"Group was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function oO(t,e){1&t&&(Mo(0,"button",39),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const aO=function(t){return["/accounts",t]},lO=function(t){return{"is-invalid":t}};let cO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.groupForm=this.formBuilder.group({name:["",py.required],description:[""],avatar_url:[""],lang_tag:[""],open:[""],max_count:[""]}),this.route.parent.data.subscribe(t=>{this.group=t[0],this.f.name.setValue(this.group.name),this.f.description.setValue(this.group.description),this.f.avatar_url.setValue(this.group.avatar_url),this.f.lang_tag.setValue(this.group.lang_tag),this.f.open.setValue(this.group.open),this.f.max_count.setValue(this.group.max_count),this.updateAllowed()||this.groupForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.group.metadata),null,2);this.aceEditor.session.setValue(t)}updateGroup(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}if(this.f.max_count.value{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.groupForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(iO,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:71,vars:16,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","group_id",1,"d-inline"],["type","text","id","group_id","placeholder","Group ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","creator_id",1,"d-inline"],[2,"width","100%",3,"routerLink"],["type","text","id","creator_id","placeholder","Creator ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","name",1,"d-inline"],["type","text","id","name","placeholder","Name","required","","formControlName","name",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","formControlName","description",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","lang_tag",1,"d-inline"],["type","text","id","lang_tag","placeholder","Language","formControlName","lang_tag",1,"form-control","form-control-sm","my-2"],["type","text","id","edge_count","placeholder","Members","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_count",1,"d-inline"],["type","text","id","max_count","placeholder","Max Count","formControlName","max_count",1,"form-control","form-control-sm","my-2"],["type","checkbox","id","open","formControlName","open",1,"my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,rO,4,2,"ngb-alert",0),Do(1,sO,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateGroup()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Group ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Creator ID"),Io(),Io(),Mo(13,"a",9),$o(14,"input",10),Io(),Io(),Io(),Mo(15,"div",3),Mo(16,"div",4),Mo(17,"div",5),Mo(18,"label",11),va(19,"Name"),Io(),Io(),$o(20,"input",12),Mo(21,"div",13),va(22,"Name is required"),Io(),Io(),Mo(23,"div",4),Mo(24,"div",5),Mo(25,"label",14),va(26,"Description"),Io(),Io(),$o(27,"input",15),Io(),Io(),Mo(28,"div",3),Mo(29,"div",16),Mo(30,"div",5),Mo(31,"label",17),va(32,"Avatar URL"),Io(),Io(),$o(33,"input",18),Io(),Mo(34,"div",4),Mo(35,"div",5),Mo(36,"label",19),va(37,"Language"),Io(),Io(),$o(38,"input",20),Io(),Io(),Mo(39,"div",3),Mo(40,"div",4),Mo(41,"div",5),Mo(42,"label",8),va(43,"Members"),Io(),Io(),$o(44,"input",21),Io(),Mo(45,"div",16),Mo(46,"div",5),Mo(47,"label",22),va(48,"Max Count"),Io(),Io(),$o(49,"input",23),Io(),Io(),Mo(50,"div",3),Mo(51,"div",16),Mo(52,"div",5),Mo(53,"label",22),va(54,"Open"),Io(),Io(),$o(55,"input",24),Io(),Io(),Mo(56,"div",25),Mo(57,"div",4),Mo(58,"div",5),Mo(59,"label",26),va(60,"Create Time"),Io(),Io(),$o(61,"input",27),Io(),Mo(62,"div",4),Mo(63,"div",5),Mo(64,"label",28),va(65,"Update Time"),Io(),Io(),$o(66,"input",29),Io(),Io(),Mo(67,"div",30),$o(68,"div",31,32),Io(),Do(70,oO,2,1,"button",33),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.groupForm),Qr(6),Fo("value",e.group.id),Qr(5),Fo("routerLink",Vl(12,aO,e.group.creator_id)),Qr(1),Fo("value",e.group.creator_id),Qr(6),Fo("ngClass",Vl(14,lO,e.f.name.dirty&&e.f.name.errors)),Qr(1),Fo("hidden",e.f.name.disabled||e.f.name.valid||e.f.name.pristine),Qr(23),Fo("value",e.group.edge_count),Qr(17),Fo("value",e.group.create_time),Qr(5),Fo("value",e.group.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Mv,ay,wb,Ty,yb,$h,ry,_x],styles:[""]}),t})();function hO(t,e){if(1&t&&(Mo(0,"ngb-alert",13),$o(1,"img",14),Mo(2,"h6",15),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function uO(t,e){1&t&&(Mo(0,"span"),va(1,"Add by membership state"),Io())}function dO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.activeState)}}function pO(t,e){if(1&t){const t=No();Mo(0,"button",20),Vo("click",function(){Ie(t);const n=e.$implicit;return zo(2).activeState=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function fO(t,e){if(1&t&&(Mo(0,"div",16),Mo(1,"button",17),Do(2,uO,2,0,"span",11),Do(3,dO,2,1,"span",11),Io(),Mo(4,"div",18),Do(5,pO,2,1,"button",19),Io(),Io()),2&t){const t=zo();Qr(2),Fo("ngIf",!t.activeState||""===t.activeState),Qr(1),Fo("ngIf",t.activeState&&""!==t.activeState),Qr(2),Fo("ngForOf",t.states)}}function gO(t,e){if(1&t){const t=No();Mo(0,"div",21),Mo(1,"div",22),Mo(2,"div",23),Mo(3,"form",24),Mo(4,"div",25),$o(5,"input",26),Mo(6,"div",27),Mo(7,"div",28),Mo(8,"button",29),Vo("click",function(){return Ie(t),zo().add()}),va(9,"Add"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io()}if(2&t){const t=zo();Qr(3),Fo("formGroup",t.addForm)}}function mO(t,e){1&t&&(Mo(0,"th",30),va(1,"Demote"),Io())}function vO(t,e){1&t&&(Mo(0,"th",30),va(1,"Promote"),Io())}function yO(t,e){1&t&&(Mo(0,"th",31),va(1,"Remove"),Io())}function bO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No group membership found."),Io(),Io())}function wO(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function xO(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function _O(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function CO(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function SO(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function EO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().demoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",38),$o(3,"path",39),Io(),Io(),Io()}}function kO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().promoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",40),$o(3,"path",41),Io(),Io(),Io()}}function AO(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function DO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,wO,2,0,"span",11),Do(7,xO,2,0,"span",11),Do(8,_O,2,0,"span",11),Do(9,CO,2,0,"span",11),Do(10,SO,2,0,"span",11),Io(),Mo(11,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,EO,4,0,"td",34),Do(14,kO,4,0,"td",34),Do(15,AO,3,0,"td",35),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.user.update_time),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed())}}let TO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.authService=r,this.error="",this.members=[],this.activeState="Add Member",this.states=["Add Member","Join"],this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.onSameUrlNavigation="reload",this.addForm=this.formBuilder.group({ids:[""]})}ngOnInit(){this.route.data.subscribe(t=>{this.members.length=0,this.members.push(...t[0].group_users)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}editionAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",n.user.id,this.group.id).subscribe(()=>{this.members.splice(e,1)},t=>{this.error=t})}demoteGroupUser(t,e,n){this.error="",this.consoleService.demoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state++},t=>{this.error=t})}promoteGroupUser(t,e,n){this.error="",this.consoleService.promoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state--},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/accounts",t.user.id],{relativeTo:this.route})}add(){this.consoleService.addGroupUsers("",this.group.id,{ids:this.f.ids.value,join_request:"Join"===this.activeState}).subscribe(()=>{this.error="",this.router.navigate([this.router.url])},t=>{this.error=t})}get f(){return this.addForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:21,vars:8,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["class","btn-group mb-1","ngbDropdown","",4,"ngIf"],["class","row no-gutters mb-4",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 70px",4,"ngIf"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup"],[1,"input-group"],["id","ids","type","text","formControlName","ids","placeholder","Add user IDs as members, comma-separated",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],[2,"width","70px"],[2,"width","90px"],["colSpan","7",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],["class","text-center align-middle",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-outline-secondary",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-down"],["fill-rule","evenodd","d","M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-up"],["fill-rule","evenodd","d","M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"],[1,"text-center","align-middle"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,hO,4,2,"ngb-alert",0),Do(1,fO,6,3,"div",1),Do(2,gO,10,1,"div",2),Mo(3,"div",3),Mo(4,"table",4),Mo(5,"thead",5),Mo(6,"tr"),Mo(7,"th",6),va(8,"User ID"),Io(),Mo(9,"th"),va(10,"Name"),Io(),Mo(11,"th",7),va(12,"State"),Io(),Mo(13,"th",8),va(14,"Update Time"),Io(),Do(15,mO,2,0,"th",9),Do(16,vO,2,0,"th",9),Do(17,yO,2,0,"th",10),Io(),Io(),Mo(18,"tbody"),Do(19,bO,3,0,"tr",11),Do(20,DO,16,11,"tr",12),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.group.open&&e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(13),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(2),Fo("ngIf",0===e.members.length),Qr(1),Fo("ngForOf",e.members))},directives:[Bh,Ph,_x,Kx,qx,Wx,zx,pb,Ry,mb,ay,Ty,yb],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),RO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getMembers("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FO(t,e){if(1&t&&(Mo(0,"ngb-alert",28),$o(1,"img",29),Mo(2,"h6",30),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function LO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeType)}}function MO(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeType=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function IO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeNode)}}function $O(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeNode=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function OO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No realtime matches were found."),Io(),Io())}function PO(t,e){1&t&&$o(0,"div",40)}function NO(t,e){1&t&&$o(0,"div",41)}function BO(t,e){if(1&t){const t=No();Mo(0,"div",37),Vo("click",function(){Ie(t);const e=zo(),n=e.index,i=e.$implicit,r=zo();return r.getMatchState(n,i),r.matchStatesOpen[n]=!r.matchStatesOpen[n]}),Do(1,PO,1,0,"div",38),Do(2,NO,1,0,"div",39),Io()}if(2&t){const t=zo().index,e=zo();Qr(1),Fo("ngIf",!e.matchStatesOpen[t]),Qr(1),Fo("ngIf",e.matchStatesOpen[t])}}function UO(t,e){1&t&&$o(0,"div",42)}function VO(t,e){1&t&&(Mo(0,"span"),va(1,"Yes"),Io())}function HO(t,e){1&t&&(Mo(0,"span"),va(1,"No"),Io())}function jO(t,e){1&t&&$o(0,"img",51)}function zO(t,e){if(1&t&&(Mo(0,"div"),Mo(1,"small"),Mo(2,"b"),va(3,"Current Tick"),Io(),Io(),Mo(4,"pre",47),Mo(5,"small"),va(6),Io(),Io(),Mo(7,"small"),Mo(8,"b"),va(9,"Match State"),Io(),Io(),Mo(10,"pre",47),Mo(11,"small"),va(12),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(6),ya(e.matchStates[t].tick),Qr(6),ya(e.matchStates[t].state)}}function WO(t,e){1&t&&$o(0,"img",51)}function GO(t,e){if(1&t&&(Mo(0,"pre",47),Mo(1,"small"),va(2),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.getMatchPresencesString(e.matchStates[t].presences))}}function qO(t,e){if(1&t&&(Mo(0,"tr",43),Mo(1,"td",44),Mo(2,"div",45),Mo(3,"div",46),Mo(4,"small"),Mo(5,"b"),va(6,"Match Label"),Io(),Io(),Mo(7,"pre",47),Mo(8,"small"),va(9),Io(),Io(),Io(),Mo(10,"div",48),Do(11,jO,1,0,"img",49),Do(12,zO,13,2,"div",7),Io(),Mo(13,"div",48),Mo(14,"small"),Mo(15,"b"),va(16,"Match Presences"),Io(),Io(),Do(17,WO,1,0,"img",49),Do(18,GO,3,1,"pre",50),Io(),Io(),Io(),Io()),2&t){const t=zo(),e=t.$implicit,n=t.index,i=zo();Qr(9),ya(e.api_match.label),Qr(2),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n]),Qr(5),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n])}}function KO(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Do(2,BO,3,2,"div",33),Do(3,UO,1,0,"div",34),va(4),Io(),Mo(5,"td"),va(6),Io(),Mo(7,"td",35),Do(8,VO,2,0,"span",7),Do(9,HO,2,0,"span",7),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Io(),Do(16,qO,19,5,"tr",36)),2&t){const t=e.index,n=e.$implicit,i=zo();Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(1),ba(" ",n.api_match.match_id," "),Qr(2),ya(n.api_match.size),Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(2),ya(n.node),Qr(2),ya(n.api_match.handler_name),Qr(2),ya(n.api_match.authoritative?n.api_match.tick_rate:"-"),Qr(1),Fo("ngIf",i.matchStatesOpen[t])}}let XO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.formBuilder=n,this.consoleService=i,this.error="",this.matches=[],this.matchStates=[],this.matchStatesOpen=[],this.updated=!1,this.activeType="All",this.types=["All","Authoritative","Relayed"],this.activeNode="All Nodes",this.nodes=["All Nodes"],this.searchForm1=this.formBuilder.group({match_id:""}),this.searchForm2=this.formBuilder.group({match_id:""}),this.searchForm3=this.formBuilder.group({query:""})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.match_id.setValue(t.get("match_id")),this.f2.match_id.setValue(t.get("match_id")),this.f3.query.setValue(t.get("query"));let e=t.get("type");this.type=Number(e);let n=t.get("node");if(this.route.data.subscribe(t=>{console.log(t),t&&(t[0]&&(this.error="",this.matches.length=0,this.matches.push(...t[0].matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length),t[1]&&this.nodes.push(...t[1]),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=0,this.activeType=this.types[0]):0==this.type||1==this.type||2==this.type?this.activeType=this.types[this.type]:this.error="Invalid type",null!==n){let t=!1;this.nodes.forEach(e=>{n===e&&(this.activeNode=n,t=!0)}),t||(this.error="Invalid node.")}}search(){const t=this.getType();this.type=t,JO(this.consoleService,t,0==t?this.f1.match_id.value:this.f2.match_id.value,this.f3.query.value,this.activeNode===this.nodes[0]?"":this.activeNode).subscribe(t=>this.postData(t),t=>{this.error=t})}postData(t){let e;switch(this.error="",this.matches.length=0,this.matches.push(...t.matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length,this.type){case 0:e={type:this.type,match_id:this.f1.match_id.value};break;case 1:e={type:this.type,query:this.f3.query.value},this.activeNode!==this.nodes[0]&&(e.node=this.activeNode);break;case 2:e={type:this.type,match_id:this.f2.match_id.value}}this.router.navigate([],{relativeTo:this.route,queryParams:e})}getType(){let t=0;return this.types.forEach((e,n)=>{this.activeType===e&&(t=n)}),t}getMatchState(t,e){this.matchStatesOpen[t]||(this.matchStates[t]=null,this.error="",this.consoleService.getMatchState("",e.api_match.match_id).subscribe(e=>{this.matchStatesOpen[t]=!0,this.matchStates[t]=e},e=>{this.matchStatesOpen[t]=!1,this.matchStates[t]=null,this.error=e}))}getMatchPresencesString(t){return JSON.stringify(t)}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(_b),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:53,vars:16,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"input-group","mb-1"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-right"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","match_id","placeholder","Filter by match ID",1,"form-control"],["type","text","formControlName","query","placeholder","Filter by query or match ID",1,"form-control","border-right-0"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-left"],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","140px"],[2,"width","100px"],[2,"width","130px"],[2,"width","90px"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","button","ngbDropdownItem","",3,"click"],["colSpan","8",1,"text-muted"],["class","arrow",3,"click",4,"ngIf"],["class","d-inline-block mr-3",4,"ngIf"],[1,"text-center"],["class","open-row",4,"ngIf"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"d-inline-block","mr-3"],[1,"open-row"],["colspan","6",1,"align-middle"],[1,"d-flex","p-0"],[1,"p-3","w-33","border"],[1,"pre-wrap","m-0","p-0"],[1,"p-3","w-33","border","border-left-0"],["src","/static/spinner.svg","class","d-block","width","16",4,"ngIf"],["class","pre-wrap m-0 p-0",4,"ngIf"],["src","/static/spinner.svg","width","16",1,"d-block"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Active Matches"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FO,4,2,"ngb-alert",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"div",5),Mo(8,"button",6),Do(9,LO,2,1,"span",7),Io(),Mo(10,"div",8),Do(11,MO,2,1,"button",9),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"button",11),Vo("click",function(){return e.search()}),va(14,"Search"),Io(),Io(),Io(),Mo(15,"div",12),Mo(16,"div",13),Mo(17,"div",14),Mo(18,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(19,"div",16),$o(20,"input",17),Io(),Io(),Mo(21,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(22,"div",16),$o(23,"input",17),Io(),Io(),Mo(24,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(25,"div",16),$o(26,"input",18),Mo(27,"div",10),Mo(28,"div",5),Mo(29,"button",19),Do(30,IO,2,1,"span",7),Io(),Mo(31,"div",8),Do(32,$O,2,1,"button",9),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(33,"div",20),Mo(34,"table",21),Mo(35,"thead",22),Mo(36,"tr"),Mo(37,"th"),Mo(38,"span"),va(39,"Match ID"),Io(),Io(),Mo(40,"th",23),va(41,"Presence Count"),Io(),Mo(42,"th",24),va(43,"Authoritative"),Io(),Mo(44,"th",24),va(45,"Node"),Io(),Mo(46,"th",25),va(47,"Handler Name"),Io(),Mo(48,"th",26),va(49,"Tick Rate"),Io(),Io(),Io(),Mo(50,"tbody"),Do(51,OO,3,0,"tr",7),Do(52,KO,17,10,"ng-template",27),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.matches.length," running matches found."),Qr(1),Fo("ngIf",e.error),Qr(5),Fo("ngIf",e.activeType&&""!==e.activeType),Qr(2),Fo("ngForOf",e.types),Qr(7),Fo("hidden","All"!==e.activeType)("formGroup",e.searchForm1),Qr(3),Fo("hidden","Relayed"!==e.activeType)("formGroup",e.searchForm2),Qr(3),Fo("hidden","Authoritative"!==e.activeType)("formGroup",e.searchForm3),Qr(6),Fo("ngIf",e.activeNode&&""!==e.activeNode),Qr(2),Fo("ngForOf",e.nodes),Qr(6),ra("pl-3",e.matches.length>0),Qr(13),Fo("ngIf",0===e.matches.length),Qr(1),Fo("ngForOf",e.matches))},directives:[Bh,Kx,qx,Wx,Ph,pb,Ry,mb,ay,Ty,yb,_x,zx],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}.open-row[_ngcontent-%COMP%]{background:#fafafc}.w-33[_ngcontent-%COMP%]{width:33.3333%!important}.dropdown-radius-right[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),YO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));return JO(this.consoleService,n,t.queryParamMap.get("match_id"),t.queryParamMap.get("query"),t.queryParamMap.get("node")).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JO(t,e,n,i,r){switch(e){case 0:return t.listMatches("",null,null,null,null,null,n);case 1:return t.listMatches("",null,!0,null,null,null,null,i,r);case 2:return t.listMatches("",null,!1,null,null,null,n)}return ff(null)}let QO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function ZO(t,e){if(1&t&&(Mo(0,"ngb-alert",25),$o(1,"img",26),Mo(2,"h6",27),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying groups: ",t.error,"")}}function tP(t,e){1&t&&(Mo(0,"th",28),va(1,"Remove"),Io())}function eP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No groups found - change the filter criteria or add new user groups."),Io(),Io())}function nP(t,e){1&t&&$o(0,"td")}function iP(t,e){if(1&t){const t=No();Mo(0,"td",32),Mo(1,"button",33),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroup(e,i,r)}),va(2,"Delete"),Io(),Io()}}function rP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(2),Io(),Mo(3,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(4),Io(),Mo(5,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(6),Io(),Do(7,nP,1,0,"td",23),Do(8,iP,3,0,"td",31),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let sP=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.groupsCount=0,this.groups=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):this.f.filter.value&&this.search(0),this.route.data.subscribe(t=>{this.groups.length=0,t&&(this.groups.push(...t[0].groups),this.groupsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listGroups("",this.f.filter.value,e).subscribe(t=>{this.error="",this.groups.length=0,this.groups.push(...t.groups),this.groupsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteGroup(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroup("",n.id).subscribe(()=>{this.error="",this.groups.splice(e,1),this.groupsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewGroup(t){this.router.navigate(["/groups",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:35,vars:8,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by group ID or name (use '%' for wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Groups"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"div",9),Mo(12,"button",10),Vo("click",function(){return e.search(0)}),va(13,"Search"),Io(),Io(),Io(),Io(),Io(),Io(),Mo(14,"div",11),Mo(15,"div",12),Mo(16,"button",13),Vo("click",function(){return e.search(0)}),$o(17,"img",14),Io(),Mo(18,"button",13),Vo("click",function(){return e.search(1)}),$o(19,"img",15),Io(),Io(),Io(),Io(),Io(),Do(20,ZO,4,2,"ngb-alert",16),Mo(21,"div",17),Mo(22,"table",18),Mo(23,"thead",19),Mo(24,"tr"),Mo(25,"th",20),va(26,"Group ID"),Io(),Mo(27,"th"),va(28,"Name"),Io(),Mo(29,"th",21),va(30,"Last Update"),Io(),Do(31,tP,2,0,"th",22),Io(),Io(),Mo(32,"tbody"),Do(33,eP,3,0,"tr",23),Do(34,rP,9,5,"tr",24),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.groupsCount," groups found."),Qr(4),Fo("formGroup",e.searchForm),Qr(9),Fo("disabled",0===e.groups.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(11),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[pb,Ry,mb,ay,Ty,yb,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),oP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter");return this.consoleService.listGroups("",n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function aP(t,e){if(1&t){const t=No();Mo(0,"button",13),Vo("click",function(e){return Ie(t),zo().exportGroup(e)}),$o(1,"img",14),va(2,"Export"),Io()}}function lP(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().deleteGroup(e,!1)}),$o(1,"img",16),va(2,"Delete"),Io()}}function cP(t,e){if(1&t&&(Mo(0,"ngb-alert",17),$o(1,"img",18),Mo(2,"h6",19),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const hP=function(t,e){return["/groups",t,e]};function uP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,20),Mo(2,"a",21),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,hP,n.group.id,t.path)),Qr(1),ya(t.label)}}const dP=function(){return["/groups"]};let pP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Members",path:"members"}]}ngOnInit(){this.route.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}deleteGroup(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteGroup("",this.group.id).subscribe(()=>{this.error="",this.router.navigate(["/groups"])},t=>{this.error=t})}exportGroup(t){t.target.disabled=!0,this.error="",this.consoleService.exportGroup("",this.group.id).subscribe(e=>{this.error="";const n=this.group.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:18,vars:7,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Group"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Group"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,aP,3,0,"button",7),Do(12,lP,3,0,"button",8),Io(),Io(),Do(13,cP,4,2,"ngb-alert",9),Mo(14,"nav",10,11),Do(16,uP,4,6,"div",12),Io(),$o(17,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(6,dP)),Qr(3),ya(e.group.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),fP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getGroup("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function gP(t,e){if(1&t){const t=No();Mo(0,"button",12),Vo("click",function(e){return Ie(t),zo().deleteLeaderboard(e)}),$o(1,"img",13),va(2,"Delete Leaderboard"),Io()}}function mP(t,e){if(1&t&&(Mo(0,"ngb-alert",14),$o(1,"img",15),Mo(2,"h6",16),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const vP=function(t,e){return["/leaderboards",t,e]};function yP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,17),Mo(2,"a",18),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,vP,n.leaderboard.id,t.path)),Qr(1),ya(t.label)}}const bP=function(){return["/leaderboards"]};let wP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Records",path:"records"}]}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}deleteLeaderboard(t){t.target.disabled=!0,this.error="",this.consoleService.deleteLeaderboard("",this.leaderboard.id).subscribe(()=>{this.error="",this.router.navigate(["/leaderboards"])},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:6,consts:[[1,"pb-1"],[1,"leaderboard-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-danger btn-danger-icon",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["leaderboardNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-danger","btn-danger-icon",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","13","height","13",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboard"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Leaderboards"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,gP,3,0,"button",7),Io(),Io(),Do(12,mP,4,2,"ngb-alert",8),Mo(13,"nav",9,10),Do(15,yP,4,6,"div",11),Io(),$o(16,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(5,bP)),Qr(3),ya(e.leaderboard.id),Qr(2),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.leaderboard-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.leaderboard-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),xP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getLeaderboard("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const _P=["editor"];function CP(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function SP(t,e){if(1&t&&(Mo(0,"div",27),Mo(1,"h6"),va(2,"Tournament"),Io(),$o(3,"hr",28),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"label",29),va(8,"Title"),Io(),Io(),$o(9,"input",30),Io(),Mo(10,"div",3),Mo(11,"div",4),Mo(12,"label",31),va(13,"Description"),Io(),Io(),$o(14,"input",32),Io(),Io(),Mo(15,"div",2),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"label",33),va(19,"Category"),Io(),Io(),$o(20,"input",34),Io(),Mo(21,"div",3),Mo(22,"div",4),Mo(23,"label",35),va(24,"Max Num Score"),Io(),Io(),$o(25,"input",36),Io(),Io(),Mo(26,"div",2),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"label",37),va(30,"Size"),Io(),Io(),$o(31,"input",38),Io(),Mo(32,"div",3),Mo(33,"div",4),Mo(34,"label",39),va(35,"Max Size"),Io(),Io(),$o(36,"input",40),Io(),Io(),Mo(37,"div",2),Mo(38,"div",3),Mo(39,"div",4),Mo(40,"label",41),va(41,"Duration"),Io(),Io(),$o(42,"input",42),Io(),Mo(43,"div",3),Mo(44,"div",4),Mo(45,"label",43),va(46,"Join Required"),Io(),Io(),$o(47,"input",44),Io(),Io(),Mo(48,"div",2),Mo(49,"div",3),Mo(50,"div",4),Mo(51,"label",45),va(52,"Start Time"),Io(),Io(),$o(53,"input",46),Io(),Mo(54,"div",3),Mo(55,"div",4),Mo(56,"label",47),va(57,"End Time"),Io(),Io(),$o(58,"input",48),Io(),Io(),Mo(59,"div",2),Mo(60,"div",3),Mo(61,"div",4),Mo(62,"label",49),va(63,"Start Active"),Io(),Io(),$o(64,"input",50),Io(),Mo(65,"div",3),Mo(66,"div",4),Mo(67,"label",51),va(68,"End Active"),Io(),Io(),$o(69,"input",52),Io(),Io(),Io()),2&t){const t=zo();Qr(9),Fo("value",t.leaderboard.title),Qr(5),Fo("value",t.leaderboard.description),Qr(6),Fo("value",t.leaderboard.category),Qr(5),Fo("value",t.leaderboard.max_num_score),Qr(6),Fo("value",t.leaderboard.size),Qr(5),Fo("value",t.leaderboard.max_size),Qr(6),Fo("value",t.leaderboard.duration),Qr(5),Fo("value",t.leaderboard.join_required),Qr(6),Fo("value",t.leaderboard.start_time),Qr(5),Fo("value",t.leaderboard.end_time),Qr(6),Fo("value",t.leaderboard.start_active),Qr(5),Fo("value",t.leaderboard.end_active)}}let EP=(()=>{class t{constructor(t){this.route=t,this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"},this.error=""}ngOnInit(){this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}ngAfterViewInit(){if(vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.leaderboard.metadata){const t=JSON.stringify(JSON.parse(this.leaderboard.metadata),null,2);this.aceEditor.session.setValue(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(_P,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:50,vars:10,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border","mb-3"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","id",1,"d-inline"],["type","text","id","id","placeholder","ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","authoritative",1,"d-inline"],["type","text","id","authoritative","placeholder","Authoritative","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","sortorder",1,"d-inline"],["type","text","id","sortorder","placeholder","Sort Order","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","operator",1,"d-inline"],["type","text","id","operator","placeholder","Operator","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","reset",1,"d-inline"],["type","text","id","reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"row","add-border-single-row-bottom"],["type","text","id","prev_reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["type","text","id","next_reset","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["class","mt-4",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"mt-4"],[1,"mb-4"],["for","title",1,"d-inline"],["type","text","id","title","placeholder","Title","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","category",1,"d-inline"],["type","text","id","category","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_num_score",1,"d-inline"],["type","text","id","max_num_score","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","size",1,"d-inline"],["type","text","id","size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_size",1,"d-inline"],["type","text","id","max_size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","duration",1,"d-inline"],["type","text","id","duration","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","join_required",1,"d-inline"],["type","text","id","join_required","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_time",1,"d-inline"],["type","text","id","start_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_time",1,"d-inline"],["type","text","id","end_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_active",1,"d-inline"],["type","text","id","start_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_active",1,"d-inline"],["type","text","id","end_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"]],template:function(t,e){1&t&&(Do(0,CP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"label",5),va(6,"ID"),Io(),Io(),$o(7,"input",6),Io(),Mo(8,"div",3),Mo(9,"div",4),Mo(10,"label",7),va(11,"Authoritative"),Io(),Io(),$o(12,"input",8),Io(),Io(),Mo(13,"div",2),Mo(14,"div",3),Mo(15,"div",4),Mo(16,"label",9),va(17,"Sort Order"),Io(),Io(),$o(18,"input",10),Io(),Mo(19,"div",3),Mo(20,"div",4),Mo(21,"label",11),va(22,"Operator"),Io(),Io(),$o(23,"input",12),Io(),Io(),Mo(24,"div",2),Mo(25,"div",3),Mo(26,"div",4),Mo(27,"label",13),va(28,"Reset Schedule"),Io(),Io(),$o(29,"input",14),Io(),Mo(30,"div",3),Mo(31,"div",4),Mo(32,"label",15),va(33,"Create Time"),Io(),Io(),$o(34,"input",16),Io(),Io(),Mo(35,"div",17),Mo(36,"div",3),Mo(37,"div",4),Mo(38,"label",13),va(39,"Prev Reset"),Io(),Io(),$o(40,"input",18),Io(),Mo(41,"div",3),Mo(42,"div",4),Mo(43,"label",15),va(44,"Next Reset"),Io(),Io(),$o(45,"input",19),Io(),Io(),Io(),Do(46,SP,70,12,"div",20),Mo(47,"div",21),$o(48,"div",22,23),Io()),2&t&&(Fo("ngIf",e.error),Qr(7),Fo("value",e.leaderboard.id),Qr(5),Fo("value",e.leaderboard.authoritative),Qr(6),Fo("value",e.orderString[e.leaderboard.sort_order]),Qr(5),Fo("value",e.operatorString[e.leaderboard.operator]),Qr(6),Fo("value",e.leaderboard.reset_schedule),Qr(5),Fo("value",e.leaderboard.create_time),Qr(6),Fo("value",e.leaderboard.prev_reset),Qr(5),Fo("value",e.leaderboard.next_reset),Qr(1),Fo("ngIf",e.leaderboard.tournament))},directives:[Bh,_x],styles:[".leaderboard-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})();function kP(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function AP(t,e){1&t&&(Mo(0,"th",22),va(1,"Remove"),Io())}function DP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",23),va(2,"No records found."),Io(),Io())}function TP(t,e){1&t&&$o(0,"div",28)}function RP(t,e){1&t&&$o(0,"div",29)}function FP(t,e){if(1&t){const t=No();Mo(0,"td",30),Mo(1,"button",31),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteRecord(e,i,r)}),va(2,"Delete"),Io(),Io()}}function LP(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",32),Mo(2,"pre",33),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function MP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",24),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.recordsMetadataOpen[n]=!i.recordsMetadataOpen[n]}),Do(3,TP,1,0,"div",25),Do(4,RP,1,0,"div",26),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Mo(16,"td"),va(17),Io(),Do(18,FP,3,0,"td",27),Io(),Do(19,LP,5,1,"tr",17)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.recordsMetadataOpen[t]),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t]),Qr(1),ba(" ",n.owner_id," "),Qr(2),ya(n.username),Qr(2),ya(n.score),Qr(2),ya(n.subscore),Qr(2),ya(n.rank),Qr(2),ya(n.num_score),Qr(2),ya(n.expiry_time?n.expiry_time:"-"),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t])}}let IP=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.authService=n,this.error="",this.records=[],this.recordsMetadataOpen=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.route.data.subscribe(t=>{this.records.length=0,this.records.push(...t[0].records),this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}loadRecords(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listLeaderboardRecords("",this.leaderboard.id,null,100,e,null).subscribe(t=>{this.error="",this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor,this.records.length=0,this.records.push(...t.records),this.recordsMetadataOpen.length=0,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t})}deleteRecord(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboardRecord("",n.leaderboard_id,n.owner_id).subscribe(()=>{this.error="",this.records.splice(e,1),this.recordsMetadataOpen.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:34,vars:7,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","380px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","8",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,kP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadRecords(0)}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadRecords(-1)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadRecords(1)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th",13),va(17,"Owner ID"),Io(),Mo(18,"th"),va(19,"Username"),Io(),Mo(20,"th",14),va(21,"Score"),Io(),Mo(22,"th",14),va(23,"Subscore"),Io(),Mo(24,"th",14),va(25,"Rank"),Io(),Mo(26,"th",14),va(27,"No. of scores"),Io(),Mo(28,"th",15),va(29,"Expiry Time"),Io(),Do(30,AP,2,0,"th",16),Io(),Io(),Mo(31,"tbody"),Do(32,DP,3,0,"tr",17),Do(33,MP,20,11,"ng-template",18),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.records.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(20),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.records.length),Qr(1),Fo("ngForOf",e.records))},directives:[Bh,Ph,_x],styles:[""]}),t})(),$P=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listLeaderboardRecords("",n,null,100,null,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const OP=["editor"],PP=["editorResponse"];function NP(t,e){if(1&t&&(Mo(0,"ngb-alert",23),$o(1,"img",24),Mo(2,"h6",25),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error whilst making RPC call: ",t.error,"")}}function BP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}function UP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}let VP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.error="",this.rpcEndpoints=[],this.endpoints=[]}ngOnInit(){this.endpointCallForm=this.formBuilder.group({method:["",py.required],user_id:[""]}),this.f.method.valueChanges.subscribe(t=>{const e=this.endpoints.concat(this.rpcEndpoints).find(e=>e.method===t?e:null);this.updateQueryParam(e.method),this.setupRequestBody(e.body_template)}),this.route.data.subscribe(t=>{const e=t[0];this.endpoints.length=0,this.endpoints.push(...e.endpoints),this.rpcEndpoints.length=0,this.rpcEndpoints.push(...e.rpc_endpoints)},t=>{this.error=t});const t=this.endpoints.concat(this.rpcEndpoints).find(t=>t.method===this.route.snapshot.queryParamMap.get("endpoint")?t:null);null!=t&&this.f.method.setValue(t.method)}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.aceEditorResponse=vI.edit(this.editorResponse.nativeElement),this.aceEditorResponse.setReadOnly(!0)}sendRequest(){this.error="";let t=this.aceEditor.session.getValue();if(""!==t)try{t=JSON.stringify(JSON.parse(t))}catch(i){return void(this.error=i)}const e={user_id:this.f.user_id.value,body:t};let n=null;n=this.isRpcEndpoint(this.f.method.value)?this.consoleService.callRpcEndpoint("",this.f.method.value,e):this.consoleService.callApiEndpoint("",this.f.method.value,e),n.subscribe(e=>{if(e.error_message&&""!==e.error_message)this.aceEditorResponse.session.setValue(e.error_message);else{t="";try{t=JSON.stringify(JSON.parse(e.body),null,2)}catch(i){return void(this.error=i)}this.aceEditorResponse.session.setValue(t)}},t=>{this.aceEditorResponse.session.setValue(""),this.error=t})}isRpcEndpoint(t){return null!=this.rpcEndpoints.find(e=>e.method===t?e:null)}setupRequestBody(t){if(null!=this.aceEditor){if(!t||""===t)return this.aceEditor.session.setValue(""),void this.aceEditor.setReadOnly(!this.isRpcEndpoint(this.f.method.value));try{const e=JSON.stringify(JSON.parse(t),null,2);this.aceEditor.session.setValue(e),this.aceEditor.setReadOnly(!1)}catch(e){return void(this.error=e)}}else console.log("problem?")}updateQueryParam(t){this.router.navigate([],{relativeTo:this.route,queryParams:{endpoint:t},queryParamsHandling:"merge"})}get f(){return this.endpointCallForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&(sc(OP,!0),sc(PP,!0)),2&t){let t;ic(t=lc())&&(e.editor=t.first),ic(t=lc())&&(e.editorResponse=t.first)}},decls:35,vars:6,consts:[[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["id","method","formControlName","method",1,"form-control","custom-select","dropdown-radius"],["disabled","",3,"value"],[3,"value",4,"ngFor","ngForOf"],["disabled","",1,"text-muted"],["type","text","formControlName","user_id","placeholder","set user ID as request context",1,"form-control","border-right-0"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"d-flex"],[1,"w-50","py-3"],[1,"mb-4"],[1,"card","p-2","mb-3"],[2,"height","500px"],["editor",""],[1,"w-50","pl-3","py-3"],["editorResponse",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"value"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"API Explorer"),Io(),Do(2,NP,4,2,"ngb-alert",1),Mo(3,"div",2),Mo(4,"div",3),Mo(5,"div",4),Mo(6,"form",5),Vo("ngSubmit",function(){return e.sendRequest()}),Mo(7,"div",6),Mo(8,"div",7),Mo(9,"select",8),Mo(10,"option",9),va(11,"Select Endpoint"),Io(),Do(12,BP,2,2,"option",10),Mo(13,"option",11),va(14,"----"),Io(),Do(15,UP,2,2,"option",10),Io(),Io(),$o(16,"input",12),Mo(17,"div",13),Mo(18,"button",14),va(19,"Send Request"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(20,"div",15),Mo(21,"div",16),Mo(22,"h5"),va(23,"Request Body"),Io(),$o(24,"hr",17),Mo(25,"div",18),$o(26,"div",19,20),Io(),Io(),Mo(28,"div",21),Mo(29,"h5"),va(30,"Response"),Io(),$o(31,"hr",17),Mo(32,"div",18),$o(33,"div",19,22),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(4),Fo("formGroup",e.endpointCallForm),Qr(4),Fo("value",""),Qr(2),Fo("ngForOf",e.rpcEndpoints),Qr(3),Fo("ngForOf",e.endpoints),Qr(3),Fo("disabled",e.f.method.invalid))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Vy,Wy,Ph,ay,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}"]}),t})(),HP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listApiEndpoints("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jP(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function zP(t,e){1&t&&$o(0,"div",23)}function WP(t,e){1&t&&$o(0,"div",24)}function GP(t,e){if(1&t&&(Mo(0,"tr",25),Mo(1,"td",26),Mo(2,"div",27),Mo(3,"div"),Mo(4,"small"),Mo(5,"b"),va(6,"Provider Response"),Io(),Io(),Io(),Mo(7,"div"),Mo(8,"pre",28),Mo(9,"small"),va(10),Io(),Io(),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(10),ya(t.provider_response)}}function qP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",19),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.purchasesRowsOpen[n]=!i.purchasesRowsOpen[n]}),Do(3,zP,1,0,"div",20),Do(4,WP,1,0,"div",21),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Io(),Do(16,GP,11,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.purchasesRowsOpen[t]),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t]),Qr(1),ba(" ",n.product_id," "),Qr(2),ya(n.transaction_id),Qr(2),ya(i.getStoreText(n.store)),Qr(2),ya(n.purchase_time),Qr(2),ya(n.create_time),Qr(2),ya(i.getRefundText(n.refund_time)),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t])}}function KP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No purchases were found."),Io(),Io())}let XP=(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.purchases=[],this.purchasesRowsOpen=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.purchases=t[0].validated_purchases,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listPurchases("",this.userID,this.limit,t).subscribe(t=>{this.purchases=t.validated_purchases,this.purchasesRowsOpen=[],this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}getRefundText(t){return"1970-01-01T00:00:00Z"===t?"":t}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-purchases"]],decls:31,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"open-row"],["colspan","6"],[1,"p-2"],[1,"pre-wrap","m-0","p-0"],["colspan","6",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,jP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Create Time"),Io(),Mo(26,"th",13),va(27,"Refund Time"),Io(),Io(),Io(),Mo(28,"tbody"),Do(29,qP,17,9,"ng-template",14),Do(30,KP,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.purchases.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(19),Fo("ngForOf",e.purchases),Qr(1),Fo("ngIf",0===e.purchases.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),YP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listPurchases("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JP(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by type"),Io())}function QP(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeFilter)}}function ZP(t,e){if(1&t){const t=No();Mo(0,"button",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeFilter=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function tN(t,e){if(1&t&&(Mo(0,"h6"),va(1),Io()),2&t){const t=zo();Qr(1),ba("Showing results for chat room label: ",t.f1.label.value,"")}}const eN=function(t){return["/groups",t]};function nN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for group ID: "),Mo(2,"a",41),va(3),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(2,eN,t.route.snapshot.queryParamMap.get("group_id"))),Qr(1),ya(t.f2.group_id.value)}}const iN=function(t){return["/accounts",t]};function rN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for user IDs: "),Mo(2,"a",41),va(3),Io(),va(4,", "),Mo(5,"a",41),va(6),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(4,iN,t.route.snapshot.queryParamMap.get("user_id_one"))),Qr(1),ya(t.f3.user_id_one.value),Qr(2),Fo("routerLink",Vl(6,iN,t.route.snapshot.queryParamMap.get("user_id_two"))),Qr(1),ya(t.f3.user_id_two.value)}}function sN(t,e){if(1&t&&(Mo(0,"ngb-alert",42),$o(1,"img",43),Mo(2,"h6",44),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying messages: ",t.error,"")}}function oN(t,e){1&t&&(Mo(0,"th",45),va(1,"Remove"),Io())}function aN(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",46),va(2,"No messages found."),Io(),Io()),2&t){const t=zo();Qr(1),ko("colspan",t.deleteAllowed()?6:5)}}function lN(t,e){1&t&&$o(0,"div",55)}function cN(t,e){1&t&&$o(0,"div",56)}function hN(t,e){1&t&&$o(0,"td")}function uN(t,e){if(1&t){const t=No();Mo(0,"td",57),Mo(1,"button",58),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteMessage(e,i,r)}),va(2,"Delete"),Io(),Io()}}function dN(t,e){if(1&t&&(Mo(0,"tr",59),Mo(1,"td"),va(2),Io(),Io()),2&t){const t=zo().$implicit,e=zo();Qr(1),ko("colspan",e.deleteAllowed()?6:5),Qr(1),ba(" ",t.content," ")}}function pN(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",47),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",48),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",49),Mo(8,"div",50),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.messageStatesOpen[n]=!i.messageStatesOpen[n]}),Do(9,lN,1,0,"div",51),Do(10,cN,1,0,"div",52),Io(),va(11),Io(),Mo(12,"td"),va(13),Io(),Do(14,hN,1,0,"td",3),Do(15,uN,3,0,"td",53),Io(),Do(16,dN,3,2,"tr",54)}if(2&t){const t=e.$implicit,n=e.index,i=zo();Qr(2),ya(t.code),Qr(2),ya(t.sender_id),Qr(2),ya(t.username),Qr(3),Fo("ngIf",!i.messageStatesOpen[n]),Qr(1),Fo("ngIf",i.messageStatesOpen[n]),Qr(1),ba(" ",t.content," "),Qr(2),ya(t.create_time),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id===i.systemUserId),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id!==i.systemUserId),Qr(1),Fo("ngIf",i.messageStatesOpen[n])}}function fN(t,e){if(1&t&&(Mo(0,"ngb-alert",60),$o(1,"img",43),Mo(2,"h6",44),va(3,"Failed to delete data."),Io(),Mo(4,"p",61),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.deleteError)}}function gN(t,e){if(1&t){const t=No();Mo(0,"ngb-alert",62),Vo("close",function(){return Ie(t),zo().deleteSuccess=!1}),$o(1,"img",63),Mo(2,"h6",44),va(3),Io(),Io()}if(2&t){const t=zo();Fo("dismissible",!0),Qr(3),wa("",t.total_deleted," messages ",t.total_deleted>0?"successfully":""," deleted.")}}const mN=function(t){return{"is-invalid":t}};function vN(t,e){if(1&t&&(Mo(0,"div",64),Mo(1,"h5",65),va(2,"Delete messages"),Io(),Mo(3,"button",66),Vo("click",function(){return e.$implicit.dismiss()}),Mo(4,"span",67),va(5,"\xd7"),Io(),Io(),Io(),Mo(6,"div",68),Mo(7,"div",69),Mo(8,"form",70),Mo(9,"div",71),Mo(10,"p"),Mo(11,"b"),va(12,"Choose how many days to retain: "),Io(),$o(13,"input",72),Io(),Io(),$o(14,"input",73),Io(),Io(),Io(),Mo(15,"div",74),Mo(16,"button",75),Vo("click",function(){return e.$implicit.dismiss()}),va(17,"Cancel"),Io(),Mo(18,"button",76),Vo("click",function(){return e.$implicit.close()}),va(19,"DELETE"),Io(),Io()),2&t){const t=zo();Qr(8),Fo("formGroup",t.confirmDeleteForm),Qr(6),Fo("ngClass",Vl(3,mN,t.f.delete.touched&&t.f.delete.invalid)),Qr(4),Fo("disabled",t.f.delete.invalid)}}function yN(t,e){if(1&t){const t=No();Mo(0,"button",76),Vo("click",function(){Ie(t);const e=zo(),n=To(68);return e.openDeleteDataModal(n)}),va(1,"Delete messages"),Io()}2&t&&Fo("disabled",zo().deleting)}let bN=(()=>{class t{constructor(t,e,n,i,r,s){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.modalService=s,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.messages=[],this.nextCursor="",this.deleteError="",this.deleteSuccess=!1,this.deleting=!1,this.total_deleted=0,this.activeFilter="",this.filters=["Chat Room","Group Chat","Direct Chat"],this.messageStatesOpen=[],this.searchForm1=this.formBuilder.group({label:""}),this.searchForm2=this.formBuilder.group({group_id:""}),this.searchForm3=this.formBuilder.group({user_id_one:"",user_id_two:""}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])],days:30})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.label.setValue(t.get("label")),this.f2.group_id.setValue(t.get("group_id")),this.f3.user_id_one.setValue(t.get("user_id_one")),this.f3.user_id_two.setValue(t.get("user_id_two")),this.nextCursor=t.get("cursor");let e=t.get("type");this.type=Number(e),this.route.data.subscribe(t=>{t&&(t[0]&&(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t[0].messages),this.nextCursor=t[0].next_cursor),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=2,this.activeFilter=this.filters[0]):2==this.type||3==this.type||4==this.type?this.activeFilter=this.filters[this.type-2]:this.error="Invalid type."}search(t){let e="";switch(t){case 0:e="";break;case 1:e=this.nextCursor}this.updateMessages(this.type,this.f1.label.value,this.f2.group_id.value,this.f3.user_id_one.value,this.f3.user_id_two.value,e)}updateMessages(t,e,n,i,r,s){switch(t){case 2:this.consoleService.listChannelMessages("",t.toString(),e,null,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 3:this.consoleService.listChannelMessages("",t.toString(),null,n,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 4:this.consoleService.listChannelMessages("",t.toString(),null,null,i,r,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t})}}postData(t,e){let n;switch(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t.messages),this.nextCursor=t.next_cursor,this.type){case 2:n={type:this.type,label:this.f1.label.value,cursor:e};break;case 3:n={type:this.type,group_id:this.f2.group_id.value,cursor:e};break;case 4:n={type:this.type,user_id_one:this.f3.user_id_one.value,user_id_two:this.f3.user_id_two.value,cursor:e}}this.router.navigate([],{relativeTo:this.route,queryParams:n})}deleteMessage(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteChannelMessages("",null,[n.message_id]).subscribe(()=>{this.error="",this.messageStatesOpen.splice(e,1),this.messages.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteMessagesAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}get f(){return this.confirmDeleteForm.controls}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}deleteData(){this.deleteError="",this.deleting=!0;let t=new Date;t.setDate(t.getDate()-this.f.days.value),this.consoleService.deleteChannelMessages("",t.toISOString(),null).subscribe(t=>{this.total_deleted=Number(t.total),this.deleting=!1,this.deleteError="",this.deleteSuccess=!0;const e=this.route.snapshot.queryParamMap;let n=e.get("type"),i=e.get("label");i||(i="0");let r=e.get("group_id"),s=e.get("user_id_one"),o=e.get("user_id_two"),a=e.get("cursor");a||(a=""),n&&this.updateMessages(Number(n),i,r,s,o,a)},t=>{this.deleting=!1,this.deleteError=t})}viewAccount(t){this.router.navigate(["/accounts",t.sender_id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b),Ro(a_))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:70,vars:21,consts:[[1,"pb-1"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup"],[1,"input-group"],["type","text","formControlName","label","placeholder","Search by chat room label",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],["type","text","formControlName","group_id","placeholder","Search by group ID",1,"form-control","border-right-0"],["type","text","formControlName","user_id_one","placeholder","Search by user ID 1",1,"form-control","border-right-0"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","text","formControlName","user_id_two","placeholder","Search by user ID 2",1,"form-control","border-right-0"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered",2,"table-layout","fixed"],[1,"thead-light"],[2,"width","60px"],[2,"width","320px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",3,"dismissible",4,"ngIf"],["type","success",3,"dismissible","close",4,"ngIf"],["role","alert",1,"d-flex","justify-content-between","align-items-center"],["confirmDelete",""],["type","button","class","btn btn-danger",3,"disabled","click",4,"ngIf"],["type","button","ngbDropdownItem","",3,"click"],[2,"width","100%",3,"routerLink"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[1,"text-muted"],[3,"click"],[2,"text-overflow","ellipsis","overflow","hidden",3,"click"],[2,"white-space","nowrap","text-overflow","ellipsis","overflow","hidden"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],[1,"open-row"],["type","danger",3,"dismissible"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],["autocomplete","off",3,"formGroup"],[1,"mt-2"],["type","number","value","30","min","0","formControlName","days",2,"width","80px"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-danger",3,"disabled","click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Chat Messages"),Io(),Mo(2,"div",1),Mo(3,"button",2),Do(4,JP,2,0,"span",3),Do(5,QP,2,1,"span",3),Io(),Mo(6,"div",4),Do(7,ZP,2,1,"button",5),Io(),Io(),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"form",9),Mo(12,"div",10),$o(13,"input",11),Mo(14,"div",12),Mo(15,"div",13),Mo(16,"button",14),Vo("click",function(){return e.type=2,e.search(0)}),va(17,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(18,"form",9),Mo(19,"div",10),$o(20,"input",15),Mo(21,"div",12),Mo(22,"div",13),Mo(23,"button",14),Vo("click",function(){return e.type=3,e.search(0)}),va(24,"Search "),Io(),Io(),Io(),Io(),Io(),Mo(25,"form",9),Mo(26,"div",10),$o(27,"input",16),Mo(28,"div",12),Mo(29,"span",17),Vo("click",function(){return e.f3.user_id_one.setValue(e.systemUserId)}),$o(30,"img",18),Io(),Io(),$o(31,"input",19),Mo(32,"div",12),Mo(33,"div",13),Mo(34,"button",14),Vo("click",function(){return e.type=4,e.search(0)}),va(35,"Search "),Io(),Io(),Io(),Io(),Io(),Io(),Mo(36,"div",20),Mo(37,"div",21),Mo(38,"button",22),Vo("click",function(){return e.search(0)}),$o(39,"img",23),Io(),Mo(40,"button",22),Vo("click",function(){return e.search(1)}),$o(41,"img",24),Io(),Io(),Io(),Io(),Io(),Do(42,tN,2,1,"h6",3),Do(43,nN,4,4,"h6",3),Do(44,rN,7,8,"h6",3),Do(45,sN,4,2,"ngb-alert",25),Mo(46,"div",26),Mo(47,"table",27),Mo(48,"thead",28),Mo(49,"tr"),Mo(50,"th",29),va(51,"Code"),Io(),Mo(52,"th",30),va(53,"Sender ID"),Io(),Mo(54,"th",31),va(55,"Username"),Io(),Mo(56,"th"),va(57,"Content"),Io(),Mo(58,"th",32),va(59,"Create Time"),Io(),Do(60,oN,2,0,"th",33),Io(),Io(),Mo(61,"tbody"),Do(62,aN,3,1,"tr",3),Do(63,pN,17,10,"ng-template",34),Io(),Io(),Io(),Do(64,fN,6,2,"ngb-alert",35),Do(65,gN,4,3,"ngb-alert",36),Mo(66,"div",37),Do(67,vN,20,5,"ng-template",null,38,dc),Do(69,yN,2,1,"button",39),Io()),2&t&&(Qr(4),Fo("ngIf",!e.activeFilter||""===e.activeFilter),Qr(1),Fo("ngIf",e.activeFilter&&""!==e.activeFilter),Qr(2),Fo("ngForOf",e.filters),Qr(4),Fo("hidden","Chat Room"!==e.activeFilter)("formGroup",e.searchForm1),Qr(7),Fo("hidden","Group Chat"!==e.activeFilter)("formGroup",e.searchForm2),Qr(7),Fo("hidden","Direct Chat"!==e.activeFilter)("formGroup",e.searchForm3),Qr(13),Fo("disabled",0===e.messages.length),Qr(2),Fo("disabled",""===e.nextCursor||null===e.nextCursor),Qr(2),Fo("ngIf",0!=e.messages.length&&""===e.error&&2==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&3==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&4==e.type),Qr(1),Fo("ngIf",e.error),Qr(15),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.messages.length),Qr(1),Fo("ngForOf",e.messages),Qr(1),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(4),Fo("ngIf",e.deleteMessagesAllowed()))},directives:[Kx,qx,Bh,Wx,Ph,pb,Ry,mb,ay,Ty,yb,zx,Mv,_x,Ly,$h],styles:[".input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.open-row[_ngcontent-%COMP%]{background:#fafafc}"]}),t})(),wN=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));switch(n){case 2:return this.consoleService.listChannelMessages("",n.toString(),t.queryParamMap.get("label"),null,null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 3:return this.consoleService.listChannelMessages("",n.toString(),null,t.queryParamMap.get("group_id"),null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 4:return this.consoleService.listChannelMessages("",n.toString(),null,null,t.queryParamMap.get("user_id_one"),t.queryParamMap.get("user_id_two"),encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));default:return ff(null)}}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function xN(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function _N(t,e){1&t&&$o(0,"div",23)}function CN(t,e){1&t&&$o(0,"div",24)}function SN(t,e){if(1&t&&(Mo(0,"tr",25),Mo(1,"td",26),Mo(2,"div",27),Mo(3,"div"),Mo(4,"small"),Mo(5,"b"),va(6,"Provider Response"),Io(),Io(),Io(),Mo(7,"div"),Mo(8,"pre",28),Mo(9,"small"),va(10),Io(),Io(),Io(),Mo(11,"div",29),Mo(12,"small"),Mo(13,"b"),va(14,"Provider Notification"),Io(),Io(),Io(),Mo(15,"div"),Mo(16,"pre",28),Mo(17,"small"),va(18),Io(),Io(),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(10),ya(t.provider_response),Qr(8),ya(t.provider_notification)}}function EN(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",19),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.subscriptionsRowOpen[n]=!i.subscriptionsRowOpen[n]}),Do(3,_N,1,0,"div",20),Do(4,CN,1,0,"div",21),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Mo(16,"td"),va(17),Io(),Io(),Do(18,SN,19,2,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.subscriptionsRowOpen[t]),Qr(1),Fo("ngIf",i.subscriptionsRowOpen[t]),Qr(1),ba(" ",n.product_id," "),Qr(2),ya(n.original_transaction_id),Qr(2),ya(i.getStoreText(n.store)),Qr(2),ya(n.purchase_time),Qr(2),ya(n.expiry_time),Qr(2),ya(n.create_time),Qr(2),ya(i.getRefundText(n.refund_time)),Qr(1),Fo("ngIf",i.subscriptionsRowOpen[t])}}function kN(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",30),va(2,"No subscriptions were found."),Io(),Io())}const AN=[{path:"",component:j_,canActivate:[_w],canActivateChild:[z_],children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",component:tM,resolve:[eM]},{path:"config",component:IM,resolve:[$M]},{path:"users",component:VM,resolve:[HM]},{path:"modules",component:rI,resolve:[sI]},{path:"storage",component:fI,resolve:[gI,mI],pathMatch:"full"},{path:"storage/:collection/:key/:user_id",component:TI,resolve:[RI],pathMatch:"full"},{path:"leaderboards",component:UI,resolve:[VI]},{path:"leaderboards/:id",component:wP,resolve:[xP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:EP,resolve:[]},{path:"records",component:IP,resolve:[$P]}]},{path:"matches",component:XO,resolve:[YO,QO]},{path:"groups",component:sP,resolve:[oP]},{path:"groups/:id",component:pP,resolve:[fP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:cO,resolve:[]},{path:"members",component:TO,resolve:[RO],runGuardsAndResolvers:"always"}]},{path:"accounts",component:KI,resolve:[XI]},{path:"accounts/:id",component:l$,resolve:[c$],children:[{path:"",redirectTo:"profile",pathMatch:"full"},{path:"profile",component:g$,resolve:[]},{path:"authentication",component:w$,resolve:[]},{path:"wallet",component:L$,resolve:[M$]},{path:"friends",component:j$,resolve:[z$]},{path:"groups",component:eO,resolve:[nO]},{path:"purchases",component:XP,resolve:[YP]},{path:"subscriptions",component:(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.subscriptions=[],this.subscriptionsRowOpen=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.subscriptions=t[0].validated_subscriptions,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listSubscriptions("",this.userID,this.limit,t).subscribe(t=>{this.subscriptions=t.validated_subscriptions,this.subscriptionsRowOpen=[],this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}getRefundText(t){return"1970-01-01T00:00:00Z"===t?"":t}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-subscriptions"]],decls:33,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"open-row"],["colspan","7"],[1,"p-2"],[1,"pre-wrap","m-0","p-0"],[1,"pt-2"],["colspan","7",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,xN,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Original Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Expiry Time"),Io(),Mo(26,"th",13),va(27,"Create Time"),Io(),Mo(28,"th",13),va(29,"Refund Time"),Io(),Io(),Io(),Mo(30,"tbody"),Do(31,EN,19,10,"ng-template",14),Do(32,kN,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.subscriptions.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(21),Fo("ngForOf",e.subscriptions),Qr(1),Fo("ngIf",0===e.subscriptions.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),resolve:[(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listSubscriptions("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()]}]},{path:"apiexplorer",component:VP,resolve:[HP]},{path:"chat",component:bN,resolve:[wN]}]},{path:"login",component:ww,canActivate:[xw]},{path:"**",redirectTo:""}];let DN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[Gv.forRoot(AN,{useHash:!0})],Gv]}),t})(),TN=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:[Ov],styles:[""]}),t})();RegExp(/[&<>"']/g.source);const RN={Tab:9,Enter:13,Esc:27,Space:32,ArrowUp:38,ArrowDown:40,Backspace:8};RN[RN.Tab]="Tab",RN[RN.Enter]="Enter",RN[RN.Esc]="Esc",RN[RN.Space]="Space",RN[RN.ArrowUp]="ArrowUp",RN[RN.ArrowDown]="ArrowDown",RN[RN.Backspace]="Backspace";const FN=new Yn("ng-select-selection-model");class LN{constructor(){this._selected=[]}get value(){return this._selected}select(t,e,n){if(t.selected=!0,(!t.children||!e&&n)&&this._selected.push(t),e)if(t.parent){const e=t.parent.children.length,n=t.parent.children.filter(t=>t.selected).length;t.parent.selected=e===n}else t.children&&(this._setChildrenSelectedState(t.children,!0),this._removeChildren(t),this._selected=n&&this._activeChildren(t)?[...this._selected.filter(e=>e.parent!==t),t]:[...this._selected,...t.children.filter(t=>!t.disabled)])}unselect(t,e){if(this._selected=this._selected.filter(e=>e!==t),t.selected=!1,e)if(t.parent&&t.parent.selected){const e=t.parent.children;this._removeParent(t.parent),this._removeChildren(t.parent),this._selected.push(...e.filter(e=>e!==t&&!e.disabled)),t.parent.selected=!1}else t.children&&(this._setChildrenSelectedState(t.children,!1),this._removeChildren(t))}clear(t){this._selected=t?this._selected.filter(t=>t.disabled):[]}_setChildrenSelectedState(t,e){for(const n of t)n.disabled||(n.selected=e)}_removeChildren(t){this._selected=[...this._selected.filter(e=>e.parent!==t),...t.children.filter(e=>e.parent===t&&e.disabled&&e.selected)]}_removeParent(t){this._selected=this._selected.filter(e=>e!==t)}_activeChildren(t){return t.children.every(t=>!t.disabled||t.selected)}}const MN=function(){return new LN};let IN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:FN,useValue:MN}],imports:[[qh]]}),t})(),$N=(()=>{class t{constructor(t){this.authenticationService=t}intercept(t,e){const n=this.authenticationService.currentSessionValue;return n&&n.token&&(t=t.clone({setHeaders:{Authorization:"Bearer "+n.token}})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),ON=(()=>{class t{constructor(t,e){this.authenticationService=t,this.router=e}intercept(t,e){return e.handle(t).pipe(Yf(e=>(401===e.status?this.authenticationService.logout().subscribe({next:()=>{t.url.includes("/v3/auth")||this.router.navigate(["/login"],{queryParams:{next:this.router.routerState.snapshot.url}})}}):e.status>=500&&console.log(`${e.status}: + ${e.error.message||e.statusText}`),nx(e.error.message||e.statusText))))}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),PN=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:[TN]}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[fw,I_,{provide:uw,useValue:{host:document.location.origin,timeout:15e3}},{provide:Xb,useClass:$N,multi:!0},{provide:Xb,useClass:ON,multi:!0}],imports:[[fM,DN,ku,df,lw,M_,LL,Rb.forRoot({apiKey:"",debug:!1,loadOnInitialization:!1}),pf,Sb,Cb,IN]]}),t})();(function(){if(qc)throw new Error("Cannot enable prod mode after platform setup.");Gc=!1})(),Su().bootstrapModule(PN).then(t=>{window.ngRef&&window.ngRef.destroy(),window.ngRef=t}).catch(t=>console.error(t))},zn8P:function(t,e){function n(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,0]]]); \ No newline at end of file diff --git a/console/ui/dist/prod/index.html b/console/ui/dist/prod/index.html index 4dc4ef3171..651d7b7d34 100644 --- a/console/ui/dist/prod/index.html +++ b/console/ui/dist/prod/index.html @@ -10,5 +10,5 @@ - + diff --git a/console/ui/dist/prod/static/main.fccf1eefb431fad17814.js b/console/ui/dist/prod/static/main.eae8e312bbf936b64915.js similarity index 97% rename from console/ui/dist/prod/static/main.fccf1eefb431fad17814.js rename to console/ui/dist/prod/static/main.eae8e312bbf936b64915.js index d86c3aadd8..b196f3ccc5 100644 --- a/console/ui/dist/prod/static/main.fccf1eefb431fad17814.js +++ b/console/ui/dist/prod/static/main.eae8e312bbf936b64915.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+U4B":function(t,e,n){var i;i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=t,n.c=e,n.p="",n(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),s=n(8),o=n(15);function a(t,e,n){var o=null,a=function(t,e){n&&n(t,e),o&&o.visit(t,e)},l="function"==typeof n?a:null,c=!1;if(e){var h="boolean"==typeof e.attachComment&&e.attachComment;((c="boolean"==typeof e.comment&&e.comment)||h)&&((o=new i.CommentHandler).attach=h,e.comment=!0,l=a)}var u,d=!1;e&&"string"==typeof e.sourceType&&(d="module"===e.sourceType),u=e&&"boolean"==typeof e.jsx&&e.jsx?new r.JSXParser(t,e,l):new s.Parser(t,e,l);var p=d?u.parseModule():u.parseScript();return c&&o&&(p.comments=o.comments),u.config.tokens&&(p.tokens=u.tokens),u.config.tolerant&&(p.errors=u.errorHandler.errors),p}e.parse=a,e.parseModule=function(t,e,n){var i=e||{};return i.sourceType="module",a(t,i,n)},e.parseScript=function(t,e,n){var i=e||{};return i.sourceType="script",a(t,i,n)},e.tokenize=function(t,e,n){var i,r=new o.Tokenizer(t,e);i=[];try{for(;;){var s=r.getNextToken();if(!s)break;n&&(s=n(s)),i.push(s)}}catch(a){r.errorHandler.tolerate(a)}return r.errorHandler.tolerant&&(i.errors=r.errors()),i};var l=n(2);e.Syntax=l.Syntax,e.version="4.0.1"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r=function(){function t(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return t.prototype.insertInnerComments=function(t,e){if(t.type===i.Syntax.BlockStatement&&0===t.body.length){for(var n=[],r=this.leading.length-1;r>=0;--r){var s=this.leading[r];e.end.offset>=s.start&&(n.unshift(s.comment),this.leading.splice(r,1),this.trailing.splice(r,1))}n.length&&(t.innerComments=n)}},t.prototype.findTrailingComments=function(t){var e=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var i=this.trailing[n];i.start>=t.end.offset&&e.unshift(i.comment)}return this.trailing.length=0,e}var r=this.stack[this.stack.length-1];if(r&&r.node.trailingComments){var s=r.node.trailingComments[0];s&&s.range[0]>=t.end.offset&&(e=r.node.trailingComments,delete r.node.trailingComments)}return e},t.prototype.findLeadingComments=function(t){for(var e,n=[];this.stack.length>0&&(s=this.stack[this.stack.length-1])&&s.start>=t.start.offset;)e=s.node,this.stack.pop();if(e){for(var i=(e.leadingComments?e.leadingComments.length:0)-1;i>=0;--i){var r=e.leadingComments[i];r.range[1]<=t.start.offset&&(n.unshift(r),e.leadingComments.splice(i,1))}return e.leadingComments&&0===e.leadingComments.length&&delete e.leadingComments,n}for(i=this.leading.length-1;i>=0;--i){var s;(s=this.leading[i]).start<=t.start.offset&&(n.unshift(s.comment),this.leading.splice(i,1))}return n},t.prototype.visitNode=function(t,e){if(!(t.type===i.Syntax.Program&&t.body.length>0)){this.insertInnerComments(t,e);var n=this.findTrailingComments(e),r=this.findLeadingComments(e);r.length>0&&(t.leadingComments=r),n.length>0&&(t.trailingComments=n),this.stack.push({node:t,start:e.start.offset})}},t.prototype.visitComment=function(t,e){var n="L"===t.type[0]?"Line":"Block",i={type:n,value:t.value};if(t.range&&(i.range=t.range),t.loc&&(i.loc=t.loc),this.comments.push(i),this.attach){var r={comment:{type:n,value:t.value,range:[e.start.offset,e.end.offset]},start:e.start.offset};t.loc&&(r.comment.loc=t.loc),t.type=n,this.leading.push(r),this.trailing.push(r)}},t.prototype.visit=function(t,e){"LineComment"===t.type||"BlockComment"===t.type?this.visitComment(t,e):this.attach&&this.visitNode(t,e)},t}();e.CommentHandler=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=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])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=n(4),o=n(5),a=n(6),l=n(7),c=n(8),h=n(13),u=n(14);function d(t){var e;switch(t.type){case a.JSXSyntax.JSXIdentifier:e=t.name;break;case a.JSXSyntax.JSXNamespacedName:var n=t;e=d(n.namespace)+":"+d(n.name);break;case a.JSXSyntax.JSXMemberExpression:var i=t;e=d(i.object)+"."+d(i.property)}return e}h.TokenName[100]="JSXIdentifier",h.TokenName[101]="JSXText";var p=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return r(e,t),e.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},e.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},e.prototype.finishJSX=function(){this.nextToken()},e.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},e.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.scanXHTMLEntity=function(t){for(var e="&",n=!0,i=!1,r=!1,o=!1;!this.scanner.eof()&&n&&!i;){var a=this.scanner.source[this.scanner.index];if(a===t)break;if(i=";"===a,e+=a,++this.scanner.index,!i)switch(e.length){case 2:r="#"===a;break;case 3:r&&(n=(o="x"===a)||s.Character.isDecimalDigit(a.charCodeAt(0)),r=r&&!o);break;default:n=(n=n&&!(r&&!s.Character.isDecimalDigit(a.charCodeAt(0))))&&!(o&&!s.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&i&&e.length>2){var l=e.substr(1,e.length-2);r&&l.length>1?e=String.fromCharCode(parseInt(l.substr(1),10)):o&&l.length>2?e=String.fromCharCode(parseInt("0"+l.substr(1),16)):r||o||!u.XHTMLEntities[l]||(e=u.XHTMLEntities[l])}return e},e.prototype.lexJSX=function(){var t=this.scanner.source.charCodeAt(this.scanner.index);if(60===t||62===t||47===t||58===t||61===t||123===t||125===t)return{type:7,value:r=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===t||39===t){for(var e=this.scanner.index,n=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==n;)i+="&"===l?this.scanXHTMLEntity(n):l;return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(46===t){var r,o=this.scanner.source.charCodeAt(this.scanner.index+1),a=this.scanner.source.charCodeAt(this.scanner.index+2);return e=this.scanner.index,this.scanner.index+=(r=46===o&&46===a?"...":".").length,{type:7,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(96===t)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(t)&&92!==t){for(e=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(e,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}return this.scanner.lex()},e.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var t=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(t)),t},e.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var t=this.scanner.index,e="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,e+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var i={type:101,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index};return e.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(i)),i},e.prototype.peekJSXToken=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.lexJSX();return this.scanner.restoreState(t),e},e.prototype.expectJSX=function(t){var e=this.nextJSXToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},e.prototype.matchJSX=function(t){var e=this.peekJSXToken();return 7===e.type&&e.value===t},e.prototype.parseJSXIdentifier=function(){var t=this.createJSXNode(),e=this.nextJSXToken();return 100!==e.type&&this.throwUnexpectedToken(e),this.finalize(t,new o.JSXIdentifier(e.value))},e.prototype.parseJSXElementName=function(){var t=this.createJSXNode(),e=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=e;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(n,i))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var r=e;this.expectJSX(".");var s=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXMemberExpression(r,s))}return e},e.prototype.parseJSXAttributeName=function(){var t,e=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var i=n;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(i,r))}else t=n;return t},e.prototype.parseJSXStringLiteralAttribute=function(){var t=this.createJSXNode(),e=this.nextJSXToken();8!==e.type&&this.throwUnexpectedToken(e);var n=this.getTokenRaw(e);return this.finalize(t,new l.Literal(e.value,n))},e.prototype.parseJSXExpressionAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXExpressionContainer(e))},e.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},e.prototype.parseJSXNameValueAttribute=function(){var t=this.createJSXNode(),e=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(t,new o.JSXAttribute(e,n))},e.prototype.parseJSXSpreadAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXSpreadAttribute(e))},e.prototype.parseJSXAttributes=function(){for(var t=[];!this.matchJSX("/")&&!this.matchJSX(">");){var e=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();t.push(e)}return t},e.prototype.parseJSXOpeningElement=function(){var t=this.createJSXNode();this.expectJSX("<");var e=this.parseJSXElementName(),n=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(e,i,n))},e.prototype.parseJSXBoundaryElement=function(){var t=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var e=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(t,new o.JSXClosingElement(e))}var n=this.parseJSXElementName(),i=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(n,r,i))},e.prototype.parseJSXEmptyExpression=function(){var t=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(t,new o.JSXEmptyExpression)},e.prototype.parseJSXExpressionContainer=function(){var t,e=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new o.JSXExpressionContainer(t))},e.prototype.parseJSXChildren=function(){for(var t=[];!this.scanner.eof();){var e=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;s=this.finalize(t.node,new o.JSXElement(t.opening,t.children,t.closing)),(t=e[e.length-1]).children.push(s),e.pop()}}return t},e.prototype.parseJSXElement=function(){var t=this.createJSXNode(),e=this.parseJSXOpeningElement(),n=[],i=null;if(!e.selfClosing){var r=this.parseComplexJSXElement({node:t,opening:e,closing:i,children:n});n=r.children,i=r.closing}return this.finalize(t,new o.JSXElement(e,n,i))},e.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var t=this.parseJSXElement();return this.finishJSX(),t},e.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},e}(c.Parser);e.JSXParser=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(t){return t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&n.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(t))},isIdentifierPart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&n.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(t))},isDecimalDigit:function(t){return t>=48&&t<=57},isHexDigit:function(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102},isOctalDigit:function(t){return t>=48&&t<=55}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6);e.JSXClosingElement=function(t){this.type=i.JSXSyntax.JSXClosingElement,this.name=t},e.JSXElement=function(t,e,n){this.type=i.JSXSyntax.JSXElement,this.openingElement=t,this.children=e,this.closingElement=n},e.JSXEmptyExpression=function(){this.type=i.JSXSyntax.JSXEmptyExpression},e.JSXExpressionContainer=function(t){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=t},e.JSXIdentifier=function(t){this.type=i.JSXSyntax.JSXIdentifier,this.name=t},e.JSXMemberExpression=function(t,e){this.type=i.JSXSyntax.JSXMemberExpression,this.object=t,this.property=e},e.JSXAttribute=function(t,e){this.type=i.JSXSyntax.JSXAttribute,this.name=t,this.value=e},e.JSXNamespacedName=function(t,e){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=t,this.name=e},e.JSXOpeningElement=function(t,e,n){this.type=i.JSXSyntax.JSXOpeningElement,this.name=t,this.selfClosing=e,this.attributes=n},e.JSXSpreadAttribute=function(t){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=t},e.JSXText=function(t,e){this.type=i.JSXSyntax.JSXText,this.value=t,this.raw=e}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);e.ArrayExpression=function(t){this.type=i.Syntax.ArrayExpression,this.elements=t},e.ArrayPattern=function(t){this.type=i.Syntax.ArrayPattern,this.elements=t},e.ArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!1},e.AssignmentExpression=function(t,e,n){this.type=i.Syntax.AssignmentExpression,this.operator=t,this.left=e,this.right=n},e.AssignmentPattern=function(t,e){this.type=i.Syntax.AssignmentPattern,this.left=t,this.right=e},e.AsyncArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!0},e.AsyncFunctionDeclaration=function(t,e,n){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AsyncFunctionExpression=function(t,e,n){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AwaitExpression=function(t){this.type=i.Syntax.AwaitExpression,this.argument=t},e.BinaryExpression=function(t,e,n){this.type="||"===t||"&&"===t?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=t,this.left=e,this.right=n},e.BlockStatement=function(t){this.type=i.Syntax.BlockStatement,this.body=t},e.BreakStatement=function(t){this.type=i.Syntax.BreakStatement,this.label=t},e.CallExpression=function(t,e){this.type=i.Syntax.CallExpression,this.callee=t,this.arguments=e},e.CatchClause=function(t,e){this.type=i.Syntax.CatchClause,this.param=t,this.body=e},e.ClassBody=function(t){this.type=i.Syntax.ClassBody,this.body=t},e.ClassDeclaration=function(t,e,n){this.type=i.Syntax.ClassDeclaration,this.id=t,this.superClass=e,this.body=n},e.ClassExpression=function(t,e,n){this.type=i.Syntax.ClassExpression,this.id=t,this.superClass=e,this.body=n},e.ComputedMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=t,this.property=e},e.ConditionalExpression=function(t,e,n){this.type=i.Syntax.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n},e.ContinueStatement=function(t){this.type=i.Syntax.ContinueStatement,this.label=t},e.DebuggerStatement=function(){this.type=i.Syntax.DebuggerStatement},e.Directive=function(t,e){this.type=i.Syntax.ExpressionStatement,this.expression=t,this.directive=e},e.DoWhileStatement=function(t,e){this.type=i.Syntax.DoWhileStatement,this.body=t,this.test=e},e.EmptyStatement=function(){this.type=i.Syntax.EmptyStatement},e.ExportAllDeclaration=function(t){this.type=i.Syntax.ExportAllDeclaration,this.source=t},e.ExportDefaultDeclaration=function(t){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=t},e.ExportNamedDeclaration=function(t,e,n){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=t,this.specifiers=e,this.source=n},e.ExportSpecifier=function(t,e){this.type=i.Syntax.ExportSpecifier,this.exported=e,this.local=t},e.ExpressionStatement=function(t){this.type=i.Syntax.ExpressionStatement,this.expression=t},e.ForInStatement=function(t,e,n){this.type=i.Syntax.ForInStatement,this.left=t,this.right=e,this.body=n,this.each=!1},e.ForOfStatement=function(t,e,n){this.type=i.Syntax.ForOfStatement,this.left=t,this.right=e,this.body=n},e.ForStatement=function(t,e,n,r){this.type=i.Syntax.ForStatement,this.init=t,this.test=e,this.update=n,this.body=r},e.FunctionDeclaration=function(t,e,n,r){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.FunctionExpression=function(t,e,n,r){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.Identifier=function(t){this.type=i.Syntax.Identifier,this.name=t},e.IfStatement=function(t,e,n){this.type=i.Syntax.IfStatement,this.test=t,this.consequent=e,this.alternate=n},e.ImportDeclaration=function(t,e){this.type=i.Syntax.ImportDeclaration,this.specifiers=t,this.source=e},e.ImportDefaultSpecifier=function(t){this.type=i.Syntax.ImportDefaultSpecifier,this.local=t},e.ImportNamespaceSpecifier=function(t){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=t},e.ImportSpecifier=function(t,e){this.type=i.Syntax.ImportSpecifier,this.local=t,this.imported=e},e.LabeledStatement=function(t,e){this.type=i.Syntax.LabeledStatement,this.label=t,this.body=e},e.Literal=function(t,e){this.type=i.Syntax.Literal,this.value=t,this.raw=e},e.MetaProperty=function(t,e){this.type=i.Syntax.MetaProperty,this.meta=t,this.property=e},e.MethodDefinition=function(t,e,n,r,s){this.type=i.Syntax.MethodDefinition,this.key=t,this.computed=e,this.value=n,this.kind=r,this.static=s},e.Module=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="module"},e.NewExpression=function(t,e){this.type=i.Syntax.NewExpression,this.callee=t,this.arguments=e},e.ObjectExpression=function(t){this.type=i.Syntax.ObjectExpression,this.properties=t},e.ObjectPattern=function(t){this.type=i.Syntax.ObjectPattern,this.properties=t},e.Property=function(t,e,n,r,s,o){this.type=i.Syntax.Property,this.key=e,this.computed=n,this.value=r,this.kind=t,this.method=s,this.shorthand=o},e.RegexLiteral=function(t,e,n,r){this.type=i.Syntax.Literal,this.value=t,this.raw=e,this.regex={pattern:n,flags:r}},e.RestElement=function(t){this.type=i.Syntax.RestElement,this.argument=t},e.ReturnStatement=function(t){this.type=i.Syntax.ReturnStatement,this.argument=t},e.Script=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="script"},e.SequenceExpression=function(t){this.type=i.Syntax.SequenceExpression,this.expressions=t},e.SpreadElement=function(t){this.type=i.Syntax.SpreadElement,this.argument=t},e.StaticMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=t,this.property=e},e.Super=function(){this.type=i.Syntax.Super},e.SwitchCase=function(t,e){this.type=i.Syntax.SwitchCase,this.test=t,this.consequent=e},e.SwitchStatement=function(t,e){this.type=i.Syntax.SwitchStatement,this.discriminant=t,this.cases=e},e.TaggedTemplateExpression=function(t,e){this.type=i.Syntax.TaggedTemplateExpression,this.tag=t,this.quasi=e},e.TemplateElement=function(t,e){this.type=i.Syntax.TemplateElement,this.value=t,this.tail=e},e.TemplateLiteral=function(t,e){this.type=i.Syntax.TemplateLiteral,this.quasis=t,this.expressions=e},e.ThisExpression=function(){this.type=i.Syntax.ThisExpression},e.ThrowStatement=function(t){this.type=i.Syntax.ThrowStatement,this.argument=t},e.TryStatement=function(t,e,n){this.type=i.Syntax.TryStatement,this.block=t,this.handler=e,this.finalizer=n},e.UnaryExpression=function(t,e){this.type=i.Syntax.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0},e.UpdateExpression=function(t,e,n){this.type=i.Syntax.UpdateExpression,this.operator=t,this.argument=e,this.prefix=n},e.VariableDeclaration=function(t,e){this.type=i.Syntax.VariableDeclaration,this.declarations=t,this.kind=e},e.VariableDeclarator=function(t,e){this.type=i.Syntax.VariableDeclarator,this.id=t,this.init=e},e.WhileStatement=function(t,e){this.type=i.Syntax.WhileStatement,this.test=t,this.body=e},e.WithStatement=function(t,e){this.type=i.Syntax.WithStatement,this.object=t,this.body=e},e.YieldExpression=function(t,e){this.type=i.Syntax.YieldExpression,this.argument=t,this.delegate=e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(10),s=n(11),o=n(7),a=n(12),l=n(2),c=n(13),h="ArrowParameterPlaceHolder",u=function(){function t(t,e,n){void 0===e&&(e={}),this.config={range:"boolean"==typeof e.range&&e.range,loc:"boolean"==typeof e.loc&&e.loc,source:null,tokens:"boolean"==typeof e.tokens&&e.tokens,comment:"boolean"==typeof e.comment&&e.comment,tolerant:"boolean"==typeof e.tolerant&&e.tolerant},this.config.loc&&e.source&&null!==e.source&&(this.config.source=String(e.source)),this.delegate=n,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return t.prototype.throwError=function(t){for(var e=[],n=1;n0&&this.delegate)for(var e=0;e>="===t||">>>="===t||"&="===t||"^="===t||"|="===t},t.prototype.isolateCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=e,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=i,r},t.prototype.inheritCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&e,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=i||this.context.firstCoverInitializedNameError,r},t.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},t.prototype.parsePrimaryExpression=function(){var t,e,n,i=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(i,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(e.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal("true"===e.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(null,n));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,e=this.nextRegexToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.RegexLiteral(e.regex,n,e.pattern,e.flags));break;default:t=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(i,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(i,new o.ThisExpression)):t=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken())}return t},t.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new o.SpreadElement(e))},t.prototype.parseArrayInitializer=function(){var t=this.createNode(),e=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),e.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),e.push(n)}else e.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new o.ArrayExpression(e))},t.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var e=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var i=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=e,this.context.allowStrictDirective=n,i},t.prototype.parsePropertyMethodFunction=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),e=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var i=this.parseFormalParameters(),r=this.parsePropertyMethod(i);return this.context.allowYield=e,this.context.await=n,this.finalize(t,new o.AsyncFunctionExpression(null,i.params,r))},t.prototype.parseObjectPropertyKey=function(){var t,e=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,s.Messages.StrictOctalLiteral);var i=this.getTokenRaw(n);t=this.finalize(e,new o.Literal(n.value,i));break;case 3:case 1:case 5:case 4:t=this.finalize(e,new o.Identifier(n.value));break;case 7:"["===n.value?(t=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):t=this.throwUnexpectedToken(n);break;default:t=this.throwUnexpectedToken(n)}return t},t.prototype.isPropertyKey=function(t,e){return t.type===l.Syntax.Identifier&&t.name===e||t.type===l.Syntax.Literal&&t.value===e},t.prototype.parseObjectProperty=function(t){var e,n=this.createNode(),i=this.lookahead,r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(3===i.type){var d=i.value;this.nextToken(),l=this.match("["),r=(u=!(this.hasLineTerminator||"async"!==d||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(d))}else this.match("*")?this.nextToken():(l=this.match("["),r=this.parseObjectPropertyKey());var p=this.qualifiedPropertyName(this.lookahead);if(3===i.type&&!u&&"get"===i.value&&p)e="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===i.type&&!u&&"set"===i.value&&p)e="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===i.type&&"*"===i.value&&p)e="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(r||this.throwUnexpectedToken(this.lookahead),e="init",this.match(":")&&!u)!l&&this.isPropertyKey(r,"__proto__")&&(t.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===i.type)if(d=this.finalize(n,new o.Identifier(i.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),h=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new o.AssignmentPattern(d,f))}else h=!0,a=d;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(e,r,l,a,c,h))},t.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var e=[],n={value:!1};!this.match("}");)e.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new o.ObjectExpression(e))},t.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateLiteral=function(){var t=this.createNode(),e=[],n=[],i=this.parseTemplateHead();for(n.push(i);!i.tail;)e.push(this.parseExpression()),i=this.parseTemplateElement(),n.push(i);return this.finalize(t,new o.TemplateLiteral(n,e))},t.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:t.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case l.Syntax.ArrayExpression:t.type=l.Syntax.ArrayPattern;for(var e=0;e")||this.expect("=>"),t={type:h,params:[],async:!1};else{var e=this.lookahead,n=[];if(this.match("..."))t=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:h,params:[t],async:!1};else{var i=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(t);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s")||this.expect("=>"),this.context.isBindingElement=!1,s=0;s")&&(t.type===l.Syntax.Identifier&&"yield"===t.name&&(i=!0,t={type:h,params:[t],async:!1}),!i)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===l.Syntax.SequenceExpression)for(s=0;s")){for(var l=0;l0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var r=[t,this.lookahead],s=e,a=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[s,n.value,a],c=[i];!((i=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&i<=c[c.length-1];){a=l.pop();var h=l.pop();c.pop(),s=l.pop(),r.pop();var u=this.startNode(r[r.length-1]);l.push(this.finalize(u,new o.BinaryExpression(h,s,a)))}l.push(this.nextToken().value),c.push(i),r.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var d=l.length-1;e=l[d];for(var p=r.pop();d>1;){var f=r.pop();u=this.startNode(f,p&&p.lineStart),e=this.finalize(u,new o.BinaryExpression(h=l[d-1],l[d-2],e)),d-=2,p=f}}return e},t.prototype.parseConditionalExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var r=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.ConditionalExpression(e,i,r)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return e},t.prototype.checkPatternParam=function(t,e){switch(e.type){case l.Syntax.Identifier:this.validateParam(t,e,e.name);break;case l.Syntax.RestElement:this.checkPatternParam(t,e.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(t,e.left);break;case l.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=t.async,a=this.reinterpretAsCoverFormalsList(t);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,u=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var d=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=r;var f=this.startNode(e);this.expect("=>");var g=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,g=this.parseFunctionSourceElements(),this.context.allowIn=m}else g=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=g.type!==l.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),t=this.finalize(f,r?new o.AsyncArrowFunctionExpression(a.params,g,v):new o.ArrowFunctionExpression(a.params,g,v)),this.context.strict=c,this.context.allowStrictDirective=u,this.context.allowYield=d,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===l.Syntax.Identifier){var y=t;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var b=(n=this.nextToken()).value,w=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.AssignmentExpression(b,t,w)),this.context.firstCoverInitializedNameError=null}}return t},t.prototype.parseExpression=function(){var t=this.lookahead,e=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(e);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(t),new o.SequenceExpression(n))}return e},t.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement()}else t=this.parseStatement();return t},t.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseStatementListItem());return this.expect("}"),this.finalize(t,new o.BlockStatement(e))},t.prototype.parseLexicalBinding=function(t,e){var n=this.createNode(),i=this.parsePattern([],t);this.context.strict&&i.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return"const"===t?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!e.inFor&&i.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),r=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(i,r))},t.prototype.parseBindingList=function(t,e){for(var n=[this.parseLexicalBinding(t,e)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(t,e));return n},t.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.scanner.lex();return this.scanner.restoreState(t),3===e.type||7===e.type&&"["===e.value||7===e.type&&"{"===e.value||4===e.type&&"let"===e.value||4===e.type&&"yield"===e.value},t.prototype.parseLexicalDeclaration=function(t){var e=this.createNode(),n=this.nextToken().value;i.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var r=this.parseBindingList(n,t);return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(r,n))},t.prototype.parseBindingRestElement=function(t,e){var n=this.createNode();this.expect("...");var i=this.parsePattern(t,e);return this.finalize(n,new o.RestElement(i))},t.prototype.parseArrayPattern=function(t,e){var n=this.createNode();this.expect("[");for(var i=[];!this.match("]");)if(this.match(","))this.nextToken(),i.push(null);else{if(this.match("...")){i.push(this.parseBindingRestElement(t,e));break}i.push(this.parsePatternWithDefault(t,e)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(i))},t.prototype.parsePropertyPattern=function(t,e){var n,i,r=this.createNode(),s=!1,a=!1;if(3===this.lookahead.type){var l=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(r,new o.Identifier(l.value));if(this.match("=")){t.push(l),a=!0,this.nextToken();var h=this.parseAssignmentExpression();i=this.finalize(this.startNode(l),new o.AssignmentPattern(c,h))}else this.match(":")?(this.expect(":"),i=this.parsePatternWithDefault(t,e)):(t.push(l),a=!0,i=c)}else s=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),i=this.parsePatternWithDefault(t,e);return this.finalize(r,new o.Property("init",n,s,i,!1,a))},t.prototype.parseObjectPattern=function(t,e){var n=this.createNode(),i=[];for(this.expect("{");!this.match("}");)i.push(this.parsePropertyPattern(t,e)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(i))},t.prototype.parsePattern=function(t,e){var n;return this.match("[")?n=this.parseArrayPattern(t,e):this.match("{")?n=this.parseObjectPattern(t,e):(!this.matchKeyword("let")||"const"!==e&&"let"!==e||this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),t.push(this.lookahead),n=this.parseVariableIdentifier(e)),n},t.prototype.parsePatternWithDefault=function(t,e){var n=this.lookahead,i=this.parsePattern(t,e);if(this.match("=")){this.nextToken();var r=this.context.allowYield;this.context.allowYield=!0;var s=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=r,i=this.finalize(this.startNode(n),new o.AssignmentPattern(i,s))}return i},t.prototype.parseVariableIdentifier=function(t){var e=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==t)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(e,new o.Identifier(n.value))},t.prototype.parseVariableDeclaration=function(t){var e=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===l.Syntax.Identifier||t.inFor||this.expect("="),this.finalize(e,new o.VariableDeclarator(n,i))},t.prototype.parseVariableDeclarationList=function(t){var e={inFor:t.inFor},n=[];for(n.push(this.parseVariableDeclaration(e));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(e));return n},t.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var e=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(e,"var"))},t.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new o.EmptyStatement)},t.prototype.parseExpressionStatement=function(){var t=this.createNode(),e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ExpressionStatement(e))},t.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},t.prototype.parseIfStatement=function(){var t,e=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(e,new o.IfStatement(i,t,n))},t.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var e=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=e,this.expectKeyword("while"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new o.DoWhileStatement(n,i))},t.prototype.parseWhileStatement=function(){var t,e=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var i=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=i}return this.finalize(e,new o.WhileStatement(n,t))},t.prototype.parseForStatement=function(){var t,e,n,i=null,r=null,a=null,c=!0,h=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){i=this.createNode(),this.nextToken();var u=this.context.allowIn;this.context.allowIn=!1;var d=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=u,1===d.length&&this.matchKeyword("in")){var p=d[0];p.init&&(p.id.type===l.Syntax.ArrayPattern||p.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseExpression(),i=null}else 1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){i=this.createNode();var f=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(u=this.context.allowIn,this.context.allowIn=!1,d=this.parseBindingList(f,{inFor:!0}),this.context.allowIn=u,1===d.length&&null===d[0].init&&this.matchKeyword("in")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseExpression(),i=null):1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(this.consumeSemicolon(),i=this.finalize(i,new o.VariableDeclaration(d,f)))):(i=this.finalize(i,new o.Identifier(f)),this.nextToken(),t=i,e=this.parseExpression(),i=null)}else{var g=this.lookahead;if(u=this.context.allowIn,this.context.allowIn=!1,i=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=u,this.matchKeyword("in"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseExpression(),i=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseAssignmentExpression(),i=null,c=!1;else{if(this.match(",")){for(var m=[i];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));i=this.finalize(this.startNode(g),new o.SequenceExpression(m))}this.expect(";")}}if(void 0===t&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return this.finalize(h,void 0===t?new o.ForStatement(i,r,a,n):c?new o.ForInStatement(t,e,n):new o.ForOfStatement(t,e,n))},t.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();e=n,Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(t,new o.ContinueStatement(e))},t.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name),e=n}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(t,new o.BreakStatement(e))},t.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var e=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ReturnStatement(e))},t.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var t,e=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new o.WithStatement(n,t))},t.prototype.parseSwitchCase=function(){var t,e=this.createNode();this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(e,new o.SwitchCase(t,n))},t.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var e=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var i=[],r=!1;for(this.expect("{");!this.match("}");){var a=this.parseSwitchCase();null===a.test&&(r&&this.throwError(s.Messages.MultipleDefaultsInSwitch),r=!0),i.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(t,new o.SwitchStatement(e,i))},t.prototype.parseLabelledStatement=function(){var t,e=this.createNode(),n=this.parseExpression();if(n.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var i=n,r="$"+i.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)&&this.throwError(s.Messages.Redeclaration,"Label",i.name),this.context.labelSet[r]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,h=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):h.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),a=h}else a=this.parseStatement();delete this.context.labelSet[r],t=new o.LabeledStatement(i,a)}else this.consumeSemicolon(),t=new o.ExpressionStatement(n);return this.finalize(e,t)},t.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ThrowStatement(e))},t.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var e=[],n=this.parsePattern(e),i={},r=0;r0&&this.tolerateError(s.Messages.BadGetterArity);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseSetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(s.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseGeneratorMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!0))},t.prototype.isStartOfExpression=function(){var t=!0,e=this.lookahead.value;switch(this.lookahead.type){case 7:t="["===e||"("===e||"{"===e||"+"===e||"-"===e||"!"===e||"~"===e||"++"===e||"--"===e||"/"===e||"/="===e;break;case 4:t="class"===e||"delete"===e||"function"===e||"let"===e||"new"===e||"super"===e||"this"===e||"typeof"===e||"void"===e||"yield"===e}return t},t.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var e=null,n=!1;if(!this.hasLineTerminator){var i=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),e=this.parseAssignmentExpression()):this.isStartOfExpression()&&(e=this.parseAssignmentExpression()),this.context.allowYield=i}return this.finalize(t,new o.YieldExpression(e,n))},t.prototype.parseClassElement=function(t){var e=this.lookahead,n=this.createNode(),i="",r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(r=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(e=this.lookahead,h=!0,l=this.match("["),this.match("*")?this.nextToken():r=this.parseObjectPropertyKey()),3===e.type&&!this.hasLineTerminator&&"async"===e.value){var d=this.lookahead.value;":"!==d&&"("!==d&&"*"!==d&&(u=!0,e=this.lookahead,r=this.parseObjectPropertyKey(),3===e.type&&"constructor"===e.value&&this.tolerateUnexpectedToken(e,s.Messages.ConstructorIsAsync))}var p=this.qualifiedPropertyName(this.lookahead);return 3===e.type?"get"===e.value&&p?(i="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===e.value&&p&&(i="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===e.type&&"*"===e.value&&p&&(i="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!i&&r&&this.match("(")&&(i="init",a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),i||this.throwUnexpectedToken(this.lookahead),"init"===i&&(i="method"),l||(h&&this.isPropertyKey(r,"prototype")&&this.throwUnexpectedToken(e,s.Messages.StaticPrototype),!h&&this.isPropertyKey(r,"constructor")&&(("method"!==i||!c||a&&a.generator)&&this.throwUnexpectedToken(e,s.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(e,s.Messages.DuplicateConstructor):t.value=!0,i="constructor")),this.finalize(n,new o.MethodDefinition(r,l,a,i,h))},t.prototype.parseClassElementList=function(){var t=[],e={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(e));return this.expect("}"),t},t.prototype.parseClassBody=function(){var t=this.createNode(),e=this.parseClassElementList();return this.finalize(t,new o.ClassBody(e))},t.prototype.parseClassDeclaration=function(t){var e=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var i=t&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var s=this.parseClassBody();return this.context.strict=n,this.finalize(e,new o.ClassDeclaration(i,r,s))},t.prototype.parseClassExpression=function(){var t=this.createNode(),e=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var r=this.parseClassBody();return this.context.strict=e,this.finalize(t,new o.ClassExpression(n,i,r))},t.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Module(e))},t.prototype.parseScript=function(){for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Script(e))},t.prototype.parseModuleSpecifier=function(){var t=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var e=this.nextToken(),n=this.getTokenRaw(e);return this.finalize(t,new o.Literal(e.value,n))},t.prototype.parseImportSpecifier=function(){var t,e,n=this.createNode();return 3===this.lookahead.type?(e=t=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),e=this.parseVariableIdentifier())):(e=t=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),e=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(e,t))},t.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},t.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName();return this.finalize(t,new o.ImportDefaultSpecifier(e))},t.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var e=this.parseIdentifierName();return this.finalize(t,new o.ImportNamespaceSpecifier(e))},t.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var t,e=this.createNode();this.expectKeyword("import");var n=[];return 8===this.lookahead.type||(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken()),t=this.parseModuleSpecifier(),this.consumeSemicolon(),this.finalize(e,new o.ImportDeclaration(n,t))},t.prototype.parseExportSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName(),n=e;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(t,new o.ExportSpecifier(e,n))},t.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var t,e=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),t=this.finalize(e,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){this.nextToken(),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null));else{var r=[],a=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),r.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),a=this.parseModuleSpecifier(),this.consumeSemicolon()):l?this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value):this.consumeSemicolon(),t=this.finalize(e,new o.ExportNamedDeclaration(null,r,a))}return t},t}();e.Parser=u},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assert=function(t,e){if(!t)throw new Error("ASSERT: "+e)}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.errors=[],this.tolerant=!1}return t.prototype.recordError=function(t){this.errors.push(t)},t.prototype.tolerate=function(t){if(!this.tolerant)throw t;this.recordError(t)},t.prototype.constructError=function(t,e){var n=new Error(t);try{throw n}catch(i){Object.create&&Object.defineProperty&&(n=Object.create(i),Object.defineProperty(n,"column",{value:e}))}return n},t.prototype.createError=function(t,e,n,i){var r=this.constructError("Line "+e+": "+i,n);return r.index=t,r.lineNumber=e,r.description=i,r},t.prototype.throwError=function(t,e,n,i){throw this.createError(t,e,n,i)},t.prototype.tolerateError=function(t,e,n,i){var r=this.createError(t,e,n,i);if(!this.tolerant)throw r;this.recordError(r)},t}();e.ErrorHandler=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(4),s=n(11);function o(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function a(t){return"01234567".indexOf(t)}var l=function(){function t(t,e){this.source=t,this.errorHandler=e,this.trackComment=!1,this.isModule=!1,this.length=t.length,this.index=0,this.lineNumber=t.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return t.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},t.prototype.restoreState=function(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart},t.prototype.eof=function(){return this.index>=this.length},t.prototype.throwUnexpectedToken=function(t){return void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.tolerateUnexpectedToken=function(t){void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.skipSingleLineComment=function(t){var e,n,i=[];for(this.trackComment&&(i=[],e=this.index-t,n={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,r.Character.isLineTerminator(s))return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart-1},i.push({multiLine:!1,slice:[e+t,this.index-1],range:[e,this.index-1],loc:n})),13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},i.push({multiLine:!1,slice:[e+t,this.index],range:[e,this.index],loc:n})),i},t.prototype.skipMultiLineComment=function(){var t,e,n=[];for(this.trackComment&&(n=[],t=this.index-2,e={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(r.Character.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1))return this.index+=2,this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:e})),n;++this.index}else++this.index}return this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:e})),this.tolerateUnexpectedToken(),n},t.prototype.scanComments=function(){var t;this.trackComment&&(t=[]);for(var e=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(r.Character.isWhiteSpace(n))++this.index;else if(r.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,e=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var i=this.skipSingleLineComment(2);this.trackComment&&(t=t.concat(i)),e=!0}else{if(42!==n)break;this.index+=2,i=this.skipMultiLineComment(),this.trackComment&&(t=t.concat(i))}else if(e&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,i=this.skipSingleLineComment(3),this.trackComment&&(t=t.concat(i))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,i=this.skipSingleLineComment(4),this.trackComment&&(t=t.concat(i))}}return t},t.prototype.isFutureReservedWord=function(t){switch(t){case"enum":case"export":case"import":case"super":return!0;default:return!1}},t.prototype.isStrictModeReservedWord=function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},t.prototype.isRestrictedWord=function(t){return"eval"===t||"arguments"===t},t.prototype.isKeyword=function(t){switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}},t.prototype.codePointAt=function(t){var e=this.source.charCodeAt(t);if(e>=55296&&e<=56319){var n=this.source.charCodeAt(t+1);n>=56320&&n<=57343&&(e=1024*(e-55296)+n-56320+65536)}return e},t.prototype.scanHexEscape=function(t){for(var e="u"===t?4:2,n=0,i=0;i1114111||"}"!==t)&&this.throwUnexpectedToken(),r.Character.fromCodePoint(e)},t.prototype.getIdentifier=function(){for(var t=this.index++;!this.eof();){var e=this.source.charCodeAt(this.index);if(92===e)return this.index=t,this.getComplexIdentifier();if(e>=55296&&e<57343)return this.index=t,this.getComplexIdentifier();if(!r.Character.isIdentifierPart(e))break;++this.index}return this.source.slice(t,this.index)},t.prototype.getComplexIdentifier=function(){var t,e=this.codePointAt(this.index),n=r.Character.fromCodePoint(e);for(this.index+=n.length,92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierStart(t.charCodeAt(0))||this.throwUnexpectedToken(),n=t);!this.eof()&&(e=this.codePointAt(this.index),r.Character.isIdentifierPart(e));)n+=t=r.Character.fromCodePoint(e),this.index+=t.length,92===e&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierPart(t.charCodeAt(0))||this.throwUnexpectedToken(),n+=t);return n},t.prototype.octalToDecimal=function(t){var e="0"!==t,n=a(t);return!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(e=!0,n=8*n+a(this.source[this.index++]),"0123".indexOf(t)>=0&&!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:e}},t.prototype.scanIdentifier=function(){var t,e=this.index,n=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier();if(3!=(t=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&e+n.length!==this.index){var i=this.index;this.index=e,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=i}return{type:t,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var t=this.index,e=this.source[this.index];switch(e){case"(":case"{":"{"===e&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,e="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(e=this.source.substr(this.index,4))?this.index+=4:"==="===(e=e.substr(0,3))||"!=="===e||">>>"===e||"<<="===e||">>="===e||"**="===e?this.index+=3:"&&"===(e=e.substr(0,2))||"||"===e||"=="===e||"!="===e||"+="===e||"-="===e||"*="===e||"/="===e||"++"===e||"--"===e||"<<"===e||">>"===e||"&="===e||"|="===e||"^="===e||"%="===e||"<="===e||">="===e||"=>"===e||"**"===e?this.index+=2:"<>=!+-*%&|^/".indexOf(e=this.source[this.index])>=0&&++this.index}return this.index===t&&this.throwUnexpectedToken(),{type:7,value:e,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanHexLiteral=function(t){for(var e="";!this.eof()&&r.Character.isHexDigit(this.source.charCodeAt(this.index));)e+=this.source[this.index++];return 0===e.length&&this.throwUnexpectedToken(),r.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+e,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanBinaryLiteral=function(t){for(var e,n="";!this.eof()&&("0"===(e=this.source[this.index])||"1"===e);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(e=this.source.charCodeAt(this.index),(r.Character.isIdentifierStart(e)||r.Character.isDecimalDigit(e))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanOctalLiteral=function(t,e){var n="",i=!1;for(r.Character.isOctalDigit(t.charCodeAt(0))?(i=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return i||0!==n.length||this.throwUnexpectedToken(),(r.Character.isIdentifierStart(this.source.charCodeAt(this.index))||r.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var t=this.index+1;t=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(t,e,n){var r=parseInt(e||n,16);return r>1114111&&i.throwUnexpectedToken(s.Messages.InvalidRegExp),r<=65535?String.fromCharCode(r):"\uffff"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"\uffff"));try{RegExp(n)}catch(r){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,e)}catch(o){return null}},t.prototype.scanRegExpBody=function(){var t=this.source[this.index];i.assert("/"===t,"Regular expression literal must start with a slash");for(var e=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e+=t=this.source[this.index++],"\\"===t)t=this.source[this.index++],r.Character.isLineTerminator(t.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e+=t;else if(r.Character.isLineTerminator(t.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===t&&(n=!1);else{if("/"===t){o=!0;break}"["===t&&(n=!0)}return o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e.substr(1,e.length-2)},t.prototype.scanRegExpFlags=function(){for(var t="";!this.eof();){var e=this.source[this.index];if(!r.Character.isIdentifierPart(e.charCodeAt(0)))break;if(++this.index,"\\"!==e||this.eof())t+=e;else if("u"===(e=this.source[this.index])){++this.index;var n=this.index,i=this.scanHexEscape("u");if(null!==i)for(t+=i;n=55296&&t<57343&&r.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t}();e.Scanner=l},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",times:"\xd7",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",divide:"\xf7",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",frasl:"\u2044",euro:"\u20ac",image:"\u2111",weierp:"\u2118",real:"\u211c",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lArr:"\u21d0",uArr:"\u21d1",rArr:"\u21d2",dArr:"\u21d3",hArr:"\u21d4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27e8",rang:"\u27e9"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),r=n(12),s=n(13),o=function(){function t(){this.values=[],this.curly=this.paren=-1}return t.prototype.beforeFunctionExpression=function(t){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)>=0},t.prototype.isRegexStart=function(){var t=this.values[this.values.length-1],e=null!==t;switch(t){case"this":case"]":e=!1;break;case")":var n=this.values[this.paren-1];e="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(e=!1,"function"===this.values[this.curly-3])e=!!(i=this.values[this.curly-4])&&!this.beforeFunctionExpression(i);else if("function"===this.values[this.curly-4]){var i;e=!(i=this.values[this.curly-5])||!this.beforeFunctionExpression(i)}}return e},t.prototype.push=function(t){7===t.type||4===t.type?("{"===t.value?this.curly=this.values.length:"("===t.value&&(this.paren=this.values.length),this.values.push(t.value)):this.values.push(null)},t}(),a=function(){function t(t,e){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=!!e&&"boolean"==typeof e.tolerant&&e.tolerant,this.scanner=new r.Scanner(t,this.errorHandler),this.scanner.trackComment=!!e&&"boolean"==typeof e.comment&&e.comment,this.trackRange=!!e&&"boolean"==typeof e.range&&e.range,this.trackLoc=!!e&&"boolean"==typeof e.loc&&e.loc,this.buffer=[],this.reader=new o}return t.prototype.errors=function(){return this.errorHandler.errors},t.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var e=0;e>10),56320+(t-65536&1023))}for(var _=new Array(256),C=new Array(256),S=0;S<256;S++)_[S]=w(S)?1:0,C[S]=w(S);function E(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||a,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function k(t,e){return new r(e,new s(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function A(t,e){throw k(t,e)}function D(t,e){t.onWarning&&t.onWarning.call(null,k(t,e))}var T={YAML:function(t,e,n){var i,r,s;null!==t.version&&A(t,"duplication of %YAML directive"),1!==n.length&&A(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&A(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&A(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&D(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&A(t,"TAG directive accepts exactly two arguments"),r=n[1],d.test(i=n[0])||A(t,"ill-formed tag handle (first argument) of the TAG directive"),l.call(t.tagMap,i)&&A(t,'there is a previously declared suffix for "'+i+'" tag handle'),p.test(r)||A(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=r}};function R(t,e,n,i){var r,s,o,a;if(e1&&(t.result+=i.repeat("\n",e-1))}function P(t,e){var n,i,r=t.tag,s=t.anchor,o=[],a=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),i=t.input.charCodeAt(t.position);0!==i&&45===i&&v(t.input.charCodeAt(t.position+1));)if(a=!0,t.position++,I(t,!0,-1)&&t.lineIndent<=e)o.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,U(t,e,3,!1,!0),o.push(t.result),I(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)A(t,"bad indentation of a sequence entry");else if(t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente)&&(U(t,e,4,!0,r)&&(g?p=t.result:f=t.result),g||(L(t,h,u,d,p,f,s,o),d=p=f=null),I(t,!0,-1),a=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==a)A(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===s?A(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):h?A(t,"repeat of an indentation width identifier"):(u=e+s-1,h=!0)}if(m(o)){do{o=t.input.charCodeAt(++t.position)}while(m(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!g(o)&&0!==o)}for(;0!==o;){for(M(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!h||t.lineIndentu&&(u=t.lineIndent),g(o))d++;else{if(t.lineIndent0){for(r=o,s=0;r>0;r--)(o=b(a=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+o:A(t,"expected hexadecimal character");t.result+=x(s),t.position++}else A(t,"unknown escape sequence");n=i=t.position}else g(a)?(R(t,n,i,!0),O(t,I(t,!1,e)),n=i=t.position):t.position===t.lineStart&&$(t)?A(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}A(t,"unexpected end of the stream within a double quoted scalar")}(t,p)?E=!0:function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!v(i)&&!y(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&A(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||A(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],I(t,!0,-1),!0}(t)?(E=!0,null===t.tag&&null===t.anchor||A(t,"alias node should not have any properties")):function(t,e,n){var i,r,s,o,a,l,c,h,u=t.kind,d=t.result;if(v(h=t.input.charCodeAt(t.position))||y(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(v(i=t.input.charCodeAt(t.position+1))||n&&y(i)))return!1;for(t.kind="scalar",t.result="",r=s=t.position,o=!1;0!==h;){if(58===h){if(v(i=t.input.charCodeAt(t.position+1))||n&&y(i))break}else if(35===h){if(v(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&$(t)||n&&y(h))break;if(g(h)){if(a=t.line,l=t.lineStart,c=t.lineIndent,I(t,!1,-1),t.lineIndent>=e){o=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=a,t.lineStart=l,t.lineIndent=c;break}}o&&(R(t,r,s,!1),O(t,t.line-a),r=s=t.position,o=!1),m(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return R(t,r,s,!1),!!t.result||(t.kind=u,t.result=d,!1)}(t,p,1===n)&&(E=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===w&&(E=c&&P(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&A(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),h=0,u=t.implicitTypes.length;h tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result)?(t.result=d.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):A(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):A(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||E}function V(t){var e,n,i,r,s=t.position,o=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(r=t.input.charCodeAt(t.position))&&(I(t,!0,-1),r=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==r));){for(o=!0,r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);for(i=[],(n=t.input.slice(e,t.position)).length<1&&A(t,"directive name must not be less than one character in length");0!==r;){for(;m(r);)r=t.input.charCodeAt(++t.position);if(35===r){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&!g(r));break}if(g(r))break;for(e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==r&&M(t),l.call(T,n)?T[n](t,n,i):D(t,'unknown document directive "'+n+'"')}I(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,I(t,!0,-1)):o&&A(t,"directives end mark is expected"),U(t,t.lineIndent-1,4,!1,!0),I(t,!0,-1),t.checkLineBreaks&&h.test(t.input.slice(s,t.position))&&D(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&$(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,I(t,!0,-1)):t.position0?o-4:o;for(n=0;n>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[h++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function h(t,e,n){for(var r,s=[],o=e;o>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},HUeH:function(t,e,n){"use strict";var i=n("ClZL"),r=n("XP29");function s(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n("hyoZ"),t.exports.Schema=n("3lC6"),t.exports.FAILSAFE_SCHEMA=n("2YgE"),t.exports.JSON_SCHEMA=n("+VNs"),t.exports.CORE_SCHEMA=n("RSjF"),t.exports.DEFAULT_SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_FULL_SCHEMA=n("VtPO"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=r.dump,t.exports.safeDump=r.safeDump,t.exports.YAMLException=n("w+qe"),t.exports.MINIMAL_SCHEMA=n("2YgE"),t.exports.SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_SCHEMA=n("VtPO"),t.exports.scan=s("scan"),t.exports.parse=s("parse"),t.exports.compose=s("compose"),t.exports.addConstructor=s("addConstructor")},Iab2:function(t,e,n){var i,r;void 0===(r="function"==typeof(i=function(){"use strict";function e(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){o(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function n(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,s=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(t,s,o){var a=r.URL||r.webkitURL,l=document.createElement("a");l.download=s=s||t.name||"download",l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?i(l):n(l.href)?e(t,s,o):i(l,l.target="_blank")):(l.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){i(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,r,s){if(r=r||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,s),r);else if(n(t))e(t,r,s);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){i(o)})}}:function(t,n,i,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,i);var a="application/octet-stream"===t.type,l=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var h=new FileReader;h.onloadend=function(){var t=h.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},h.readAsDataURL(t)}else{var u=r.URL||r.webkitURL,d=u.createObjectURL(t);o?o.location=d:location.href=d,o=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});r.saveAs=o.saveAs=o,t.exports=o})?i.apply(e,[]):i)||(t.exports=r)},LFvy:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},Ljib:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},MERt:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},Njqi:function(t,e,n){"use strict";var i;try{i=n("+U4B")}catch(s){"undefined"!=typeof window&&(i=window.esprima)}var r=n("hyoZ");t.exports=new r("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e=i.parse("("+t+")",{range:!0});return"Program"===e.type&&1===e.body.length&&"ExpressionStatement"===e.body[0].type&&("ArrowFunctionExpression"===e.body[0].expression.type||"FunctionExpression"===e.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,n="("+t+")",r=i.parse(n,{range:!0}),s=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"ArrowFunctionExpression"!==r.body[0].expression.type&&"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(t){s.push(t.name)}),e=r.body[0].expression.body.range,new Function(s,"BlockStatement"===r.body[0].expression.body.type?n.slice(e[0]+1,e[1]-1):"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},Pe6h:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ"),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!s.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,i,r;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){r.unshift(parseFloat(t,10))}),e=0,i=1,r.forEach(function(t){e+=t*i,i*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||i.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(t))return"-0.0";return n=t.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},RSjF:function(t,e,n){"use strict";var i=n("3lC6");t.exports=new i({include:[n("+VNs")]})},UQ3f:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},VtPO:function(t,e,n){"use strict";var i=n("3lC6");t.exports=i.DEFAULT=new i({include:[n("Z3Ei")],explicit:[n("MERt"),n("UQ3f"),n("Njqi")]})},XP29:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("w+qe"),s=n("VtPO"),o=n("Z3Ei"),a=Object.prototype.toString,l=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},h=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function u(t){var e,n,s;if(e=t.toString(16).toUpperCase(),t<=255)n="x",s=2;else if(t<=65535)n="u",s=4;else{if(!(t<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+i.repeat("0",s-e.length)+e}function d(t){this.schema=t.schema||s,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=i.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,i,r,s,o,a,c;if(null===e)return{};for(n={},r=0,s=(i=Object.keys(e)).length;r0?e.charCodeAt(o-1):null,f=f&&v(a,l)}else{for(o=0;or&&" "!==e[p+1],p=o);else if(!m(a))return 5;l=o>0?e.charCodeAt(o-1):null,f=f&&v(a,l)}u=u||d&&o-p-1>r&&" "!==e[p+1]}return h||u?i>9&&y(e)?5:u?4:3:f&&!function(e){return function(t,e){var n,i;for(n=0,i=t.implicitTypes.length;n-1&&n>=t.flowLevel,t.indent,o)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+w(e,t.indent)+x(p(e,s));case 4:return">"+w(e,t.indent)+x(p(function(t,e){for(var n,i,r,s=/(\n+)([^\n]*)/g,o=(r=t.indexOf("\n"),s.lastIndex=r=-1!==r?r:t.length,_(t.slice(0,r),e)),a="\n"===t[0]||" "===t[0];i=s.exec(t);){var l=i[2];n=" "===l[0],o+=i[1]+(a||n||""===l?"":"\n")+_(l,e),a=n}return o}(e,o),s));case 5:return'"'+function(t){for(var e,n,i,r="",s=0;s=55296&&e<=56319&&(n=t.charCodeAt(s+1))>=56320&&n<=57343?(r+=u(1024*(e-55296)+n-56320+65536),s++):r+=!(i=c[e])&&m(e)?t[s]:i||u(e);return r}(e)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function w(t,e){var n=y(t)?String(e):"",i="\n"===t[t.length-1];return n+(!i||"\n"!==t[t.length-2]&&"\n"!==t?i?"":"-":"+")+"\n"}function x(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function _(t,e){if(""===t||" "===t[0])return t;for(var n,i,r=/ [^ ]/g,s=0,o=0,a=0,l="";n=r.exec(t);)(a=n.index)-s>e&&(l+="\n"+t.slice(s,i=o>s?o:a),s=i+1),o=a;return l+="\n",(l+=t.length-s>e&&o>s?t.slice(s,o)+"\n"+t.slice(o+1):t.slice(s)).slice(1)}function C(t,e,n){var i,s,o,c,h,u;for(o=0,c=(s=n?t.explicitTypes:t.implicitTypes).length;o tag resolver accepts not "'+u+'" style');i=h.represent[u](e,u)}t.dump=i}return!0}return!1}function S(t,e,n,i,s,o){t.tag=null,t.dump=n,C(t,n,!1)||C(t,n,!0);var l=a.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var c,h,u="[object Object]"===l||"[object Array]"===l;if(u&&(h=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||h||2!==t.indent&&e>0)&&(s=!1),h&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(u&&h&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(function(t,e,n,i){var s,o,a,l,c,h,u="",d=t.tag,p=Object.keys(n);if(!0===t.sortKeys)p.sort();else if("function"==typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new r("sortKeys must be a boolean or a function");for(s=0,o=p.length;s1024)&&(t.dump&&10===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,c&&(h+=f(t,e)),S(t,e+1,l,!0,c)&&(t.dump&&10===t.dump.charCodeAt(0)?h+=":":h+=": ",u+=h+=t.dump));t.tag=d,t.dump=u||"{}"}(t,e,t.dump,s),h&&(t.dump="&ref_"+c+t.dump)):(function(t,e,n){var i,r,s,o,a,l="",c=t.tag,h=Object.keys(n);for(i=0,r=h.length;i1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),S(t,e,o,!1,!1)&&(l+=a+=t.dump));t.tag=c,t.dump="{"+l+"}"}(t,e,t.dump),h&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===l){var d=t.noArrayIndent&&e>0?e-1:e;i&&0!==t.dump.length?(function(t,e,n,i){var r,s,o="",a=t.tag;for(r=0,s=n.length;r "+t.dump)}return!0}function E(t,e){var n,i,r=[],s=[];for(k(t,r,s),n=0,i=s.length;n=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=s.match(/ Gecko\/\d+/),e.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,e.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,e.isAIR=s.indexOf("AdobeAIR")>=0,e.isAndroid=s.indexOf("Android")>=0,e.isChromeOS=s.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./useragent");if(e.buildDom=function t(e,n,i){if("string"==typeof e&&e){var r=document.createTextNode(e);return n&&n.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&n&&n.appendChild(e),e;if("string"!=typeof e[0]||!e[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var r=document.createElement("div");e.HI_DPI&&void 0!==r.style.transform&&(e.HAS_CSS_TRANSFORMS=!0),i.isEdge||void 0===r.style.animationName||(e.HAS_CSS_ANIMATION=!0),r=null}e.translate=e.HAS_CSS_TRANSFORMS?function(t,e,n){t.style.transform="translate("+Math.round(e)+"px, "+Math.round(n)+"px)"}:function(t,e,n){t.style.top=Math.round(n)+"px",t.style.left=Math.round(e)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,e,n){"use strict";e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},e.implement=function(t,n){e.mixin(t,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./oop"),r=function(){var t,e,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(e in n.FUNCTION_KEYS)t=n.FUNCTION_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);for(e in n.PRINTABLE_KEYS)t=n.PRINTABLE_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)n.KEY_MODS[e]=t.filter(function(t){return e&n.KEY_MODS[t]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(e,r),e.keyCodeToString=function(t){var e=r[t];return"string"!=typeof e&&(e=String.fromCharCode(t)),e.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i,r=t("./keys"),s=t("./useragent"),o=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){i={passive:!1}}})}catch(t){}}(),i}function c(t,e,n){this.elem=t,this.type=e,this.callback=n}c.prototype.destroy=function(){u(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=e.addListener=function(t,e,n,i){t.addEventListener(e,n,l()),i&&i.$toDestroy.push(new c(t,e,n))},u=e.removeListener=function(t,e,n){t.removeEventListener(e,n,l())};e.stopEvent=function(t){return e.stopPropagation(t),e.preventDefault(t),!1},e.stopPropagation=function(t){t.stopPropagation&&t.stopPropagation()},e.preventDefault=function(t){t.preventDefault&&t.preventDefault()},e.getButton=function(t){return"dblclick"==t.type?0:"contextmenu"==t.type||s.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.button},e.capture=function(t,e,n){var i=t&&t.ownerDocument||document;function r(t){e&&e(t),n&&n(t),u(i,"mousemove",e),u(i,"mouseup",r),u(i,"dragstart",r)}return h(i,"mousemove",e),h(i,"mouseup",r),h(i,"dragstart",r),r},e.addMouseWheelListener=function(t,e,n){"onmousewheel"in t?h(t,"mousewheel",function(t){void 0!==t.wheelDeltaX?(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8):(t.wheelX=0,t.wheelY=-t.wheelDelta/8),e(t)},n):"onwheel"in t?h(t,"wheel",function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0)}e(t)},n):h(t,"DOMMouseScroll",function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),e(t)},n)},e.addMultiMouseDownListener=function(t,n,i,r,o){var a,l,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(t){if(0!==e.getButton(t)?u=0:t.detail>1?++u>4&&(u=1):u=1,s.isIE){var o=Math.abs(t.clientX-a)>5||Math.abs(t.clientY-l)>5;c&&!o||(u=1),c&&clearTimeout(c),c=setTimeout(function(){c=null},n[u-1]||600),1==u&&(a=t.clientX,l=t.clientY)}if(t._clicks=u,i[r]("mousedown",t),u>4)u=0;else if(u>1)return i[r](d[u],t)}Array.isArray(t)||(t=[t]),t.forEach(function(t){h(t,"mousedown",p,o)})};var d=function(t){return 0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0)};function p(t,e,n){var i=d(e);if(!s.isMac&&o){if(e.getModifierState&&(e.getModifierState("OS")||e.getModifierState("Win"))&&(i|=8),o.altGr){if(3==(3&i))return;o.altGr=0}if(18===n||17===n){var l="location"in e?e.location:e.keyLocation;17===n&&1===l?1==o[n]&&(a=e.timeStamp):18===n&&3===i&&2===l&&e.timeStamp-a<50&&(o.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),i||13!==n||3!==(l="location"in e?e.location:e.keyLocation)||(t(e,i,-n),!e.defaultPrevented)){if(s.isChromeOS&&8&i){if(t(e,i,n),e.defaultPrevented)return;i&=-9}return!!(i||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&t(e,i,n)}}function f(){o=Object.create(null)}if(e.getModifierString=function(t){return r.KEY_MODS[d(t)]},e.addCommandKeyListener=function(t,n,i){if(s.isOldGecko||s.isOpera&&!("KeyboardEvent"in window)){var r=null;h(t,"keydown",function(t){r=t.keyCode},i),h(t,"keypress",function(t){return p(n,t,r)},i)}else{var a=null;h(t,"keydown",function(t){o[t.keyCode]=(o[t.keyCode]||0)+1;var e=p(n,t,t.keyCode);return a=t.defaultPrevented,e},i),h(t,"keypress",function(t){a&&(t.ctrlKey||t.altKey||t.shiftKey||t.metaKey)&&(e.stopEvent(t),a=null)},i),h(t,"keyup",function(t){o[t.keyCode]=null},i),o||(f(),h(window,"focus",f))}},"object"==typeof window&&window.postMessage&&!s.isOldIE){var g=1;e.nextTick=function(t,n){n=n||window;var i="zero-timeout-message-"+g++,r=function(s){s.data==i&&(e.stopPropagation(s),u(n,"message",r),t())};h(n,"message",r),n.postMessage(i,"*")}}e.$idleBlocked=!1,e.onIdle=function(t,n){return setTimeout(function n(){e.$idleBlocked?setTimeout(n,100):t()},n)},e.$idleBlockId=null,e.blockIdle=function(t){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout(function(){e.$idleBlocked=!1},t||100)},e.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame=e.nextFrame?e.nextFrame.bind(window):function(t){setTimeout(t,17)}}),ace.define("ace/range",["require","exports","module"],function(t,e,n){"use strict";var i=function(t,e,n,i){this.start={row:t,column:e},this.end={row:n,column:i}};(function(){this.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(t,e){return 0==this.compare(t,e)},this.compareRange=function(t){var e,n=t.end,i=t.start;return 1==(e=this.compare(n.row,n.column))?1==(e=this.compare(i.row,i.column))?2:0==e?1:0:-1==e?-2:-1==(e=this.compare(i.row,i.column))?-1:1==e?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(t){var e=this.compareRange(t);return-1==e||0==e||1==e},this.isEnd=function(t,e){return this.end.row==t&&this.end.column==e},this.isStart=function(t,e){return this.start.row==t&&this.start.column==e},this.setStart=function(t,e){"object"==typeof t?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=e)},this.setEnd=function(t,e){"object"==typeof t?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=e)},this.inside=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)&&!this.isStart(t,e)},this.insideStart=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)},this.insideEnd=function(t,e){return 0==this.compare(t,e)&&!this.isStart(t,e)},this.compare=function(t,e){return this.isMultiLine()||t!==this.start.row?tthis.end.row?1:this.start.row===t?e>=this.start.column?0:-1:this.end.row===t?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(t,e){return this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.compareEnd=function(t,e){return this.end.row==t&&this.end.column==e?1:this.compare(t,e)},this.compareInside=function(t,e){return this.end.row==t&&this.end.column==e?1:this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.clipRows=function(t,e){if(this.end.row>e)var n={row:e+1,column:0};else this.end.rowe)var r={row:e+1,column:0};else this.start.row0;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n};var i=/^\s\s*/,r=/\s\s*$/;e.stringTrimLeft=function(t){return t.replace(i,"")},e.stringTrimRight=function(t){return t.replace(r,"")},e.copyObject=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.copyArray=function(t){for(var e=[],n=0,i=t.length;nDate.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=t("../lib/dom"),o=t("../lib/lang"),a=t("../clipboard"),l=r.isChrome<18,c=r.isIE,h=r.isChrome>63,u=400,d=t("../lib/keys"),p=d.KEY_MODS,f=r.isIOS,g=f?/\s/:/\n/,m=r.isMobile;e.TextInput=function(t,e){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",t.insertBefore(n,t.firstChild);var v=!1,y=!1,b=!1,w=!1,x="";m||(n.style.fontSize="1px");var _=!1,C=!1,S="",E=0,k=0,A=0;try{var D=document.activeElement===n}catch(G){}i.addListener(n,"blur",function(t){C||(e.onBlur(t),D=!1)},e),i.addListener(n,"focus",function(t){if(!C){if(D=!0,r.isEdge)try{if(!document.hasFocus())return}catch(t){}e.onFocus(t),r.isEdge?setTimeout(T):T()}},e),this.$focusScroll=!1,this.focus=function(){if(x||h||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var t=n.style.top;n.style.position="fixed",n.style.top="0px";try{var e=0!=n.getBoundingClientRect().top}catch(G){return}var i=[];if(e)for(var r=n.parentElement;r&&1==r.nodeType;)i.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;n.focus({preventScroll:!0}),e&&i.forEach(function(t){t.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=t)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return D},e.on("beforeEndOperation",function(){var t=e.curOp,i=t&&t.command&&t.command.name;"insertstring"!=i&&(b&&i&&(t.docChanged||t.selectionChanged)&&(S=n.value="",U()),T())});var T=f?function(t){if(D&&(!v||t)&&!w){t||(t="");var i="\n ab"+t+"cde fg\n";i!=n.value&&(n.value=S=i);var r=4+(t.length||(e.selection.isEmpty()?0:1));4==E&&k==r||n.setSelectionRange(4,r),E=4,k=r}}:function(){if(!b&&!w&&(D||F)){b=!0;var t=0,i=0,r="";if(e.session){var s=e.selection,o=s.getRange(),a=s.cursor.row;if(t=o.start.column,i=o.end.column,r=e.session.getLine(a),o.start.row!=a){var l=e.session.getLine(a-1);t=o.start.rowa+1?c.length:i,i+=r.length+1,r=r+"\n"+c}else m&&a>0&&(r="\n"+r,i+=1,t+=1);r.length>u&&(t0&&S[d]==t[d];)d++,a--;for(c=c.slice(d),d=1;l>0&&S.length-d>E-1&&S[S.length-d]==t[t.length-d];)d++,l--;h-=d-1,u-=d-1;var p=c.length-d+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(i||c||h||a||l||u))return"";w=!0;var f=!1;return r.isAndroid&&". "==c&&(c=" ",f=!0),c&&!a&&!l&&!h&&!u||_?e.onTextInput(c):e.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:u}),w=!1,S=t,E=s,k=o,A=u,f?"\n":c},M=function(t){if(b)return B();if(t&&t.inputType){if("historyUndo"==t.inputType)return e.execCommand("undo");if("historyRedo"==t.inputType)return e.execCommand("redo")}var i=n.value,r=L(i,!0);(i.length>500||g.test(r)||m&&E<1&&E==k)&&T()},I=function(t,e,n){var i=t.clipboardData||window.clipboardData;if(i&&!l){var r=c||n?"Text":"text/plain";try{return e?!1!==i.setData(r,e):i.getData(r)}catch(t){if(!n)return I(t,e,!0)}}},$=function(t,r){var s=e.getCopyText();if(!s)return i.preventDefault(t);I(t,s)?(f&&(T(s),v=s,setTimeout(function(){v=!1},10)),r?e.onCut():e.onCopy(),i.preventDefault(t)):(v=!0,n.value=s,n.select(),setTimeout(function(){v=!1,T(),r?e.onCut():e.onCopy()}))},O=function(t){$(t,!0)},P=function(t){$(t,!1)},N=function(t){var s=I(t);a.pasteCancelled()||("string"==typeof s?(s&&e.onPaste(s,t),r.isIE&&setTimeout(T),i.preventDefault(t)):(n.value="",y=!0))};i.addCommandKeyListener(n,e.onCommandKey.bind(e),e),i.addListener(n,"select",function(t){b||(v?v=!1:function(t){return 0===t.selectionStart&&t.selectionEnd>=S.length&&t.value===S&&S&&t.selectionEnd!==k}(n)?(e.selectAll(),T()):m&&n.selectionStart!=E&&T())},e),i.addListener(n,"input",M,e),i.addListener(n,"cut",O,e),i.addListener(n,"copy",P,e),i.addListener(n,"paste",N,e),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(t,"keydown",function(t){if((!r.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:P(t);break;case 86:N(t);break;case 88:O(t)}},e);var B=function(){if(b&&e.onCompositionUpdate&&!e.$readOnly){if(_)return V();b.useTextareaForIME?e.onCompositionUpdate(n.value):(L(n.value),b.markerRange&&(b.context&&(b.markerRange.start.column=b.selectionStart=b.context.compositionStartOffset),b.markerRange.end.column=b.markerRange.start.column+k-b.selectionStart+A))}},U=function(t){e.onCompositionEnd&&!e.$readOnly&&(b=!1,e.onCompositionEnd(),e.off("mousedown",V),t&&M())};function V(){C=!0,n.blur(),n.focus(),C=!1}var H,j=o.delayedCall(B,50).schedule.bind(null,null);function z(){clearTimeout(H),H=setTimeout(function(){x&&(n.style.cssText=x,x=""),e.renderer.$isMousePressed=!1,e.renderer.$keepTextAreaAtCursor&&e.renderer.$moveTextAreaToCursor()},0)}i.addListener(n,"compositionstart",function(t){if(!b&&e.onCompositionStart&&!e.$readOnly&&(b={},!_)){t.data&&(b.useTextareaForIME=!1),setTimeout(B,0),e._signal("compositionStart"),e.on("mousedown",V);var i=e.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,b.markerRange=i,b.selectionStart=E,e.onCompositionStart(b),b.useTextareaForIME?(S=n.value="",E=0,k=0):(n.msGetInputContext&&(b.context=n.msGetInputContext()),n.getInputContext&&(b.context=n.getInputContext()))}},e),i.addListener(n,"compositionupdate",B,e),i.addListener(n,"keyup",function(t){27==t.keyCode&&n.value.lengthk&&"\n"==S[s]?o=d.end:ik&&S.slice(0,s).split("\n").length>2?o=d.down:s>k&&" "==S[s-1]?(o=d.right,a=p.option):(s>k||s==k&&k!=E&&i==s)&&(o=d.right),i!==s&&(a|=p.shift),o){if(!e.onCommandKey({},a,o)&&e.commands){o=d.keyCodeToString(o);var l=e.commands.findKeyCommand(a,o);l&&e.execCommand(l)}E=i,k=s,T("")}}};document.addEventListener("selectionchange",s),e.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,e,n)},e.$setUserAgentForTests=function(t,e){m=t,f=e}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/useragent");function r(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function s(t,e){if(t.start.row==t.end.row)var n=2*e.column-t.start.column-t.end.column;else n=t.start.row!=t.end.row-1||t.start.column||t.end.column?2*e.row-t.start.row-t.end.row:e.column-4;return n<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}(function(){this.onMouseDown=function(t){var e=t.inSelection(),n=t.getDocumentPosition();this.mousedownEvent=t;var r=this.editor,s=t.getButton();return 0!==s?((r.getSelectionRange().isEmpty()||1==s)&&r.selection.moveToPosition(n),void(2==s&&(r.textInput.onContextMenu(t.domEvent),i.isMozilla||t.preventDefault()))):(this.mousedownEvent.time=Date.now(),!e||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(t),this.startSelect(n,t.domEvent._clicks>1),t.preventDefault()):(this.setState("focusWait"),void this.captureMouse(t)))},this.startSelect=function(t,e){t=t||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(t):e||n.selection.moveToPosition(t),e||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)t=this.$clickSelection.end;else if(1==i)t=this.$clickSelection.start;else{var r=s(this.$clickSelection,n);n=r.cursor,t=r.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(t){var e,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[t](i.row,i.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==o&&a<=0)e=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&o>=0)e=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==o&&1==a)i=r.end,e=r.start;else{var l=s(this.$clickSelection,i);i=l.cursor,e=l.anchor}n.selection.setSelectionAnchor(e.row,e.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var t,e,n=(t=this.mousedownEvent.y,e=this.y,Math.sqrt(Math.pow(this.x-this.mousedownEvent.x,2)+Math.pow(e-t,2))),i=Date.now();(n>0||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(t){var e=t.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(t){var e=t.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(t){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(t){if(!t.getAccelKey()){t.getShiftKey()&&t.wheelY&&!t.wheelX&&(t.wheelX=t.wheelY,t.wheelY=0);var e=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=t.domEvent.timeStamp,r=i-n.t,s=r?t.wheelX/r:n.vx,o=r?t.wheelY/r:n.vy;r<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&e.renderer.isScrollableBy(t.wheelX*t.speed,0)&&(l=!0),a<=1&&e.renderer.isScrollableBy(0,t.wheelY*t.speed)&&(l=!0),l?n.allowed=i:i-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=s,n.vy=o,l?(e.renderer.scrollBy(t.wheelX*t.speed,t.wheelY*t.speed),t.stop()):void 0}}}).call(r.prototype),e.DefaultHandlers=r}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(t,e,n){"use strict";t("./lib/oop");var i=t("./lib/dom");function r(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(t){this.getElement().textContent=t},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(t,e){this.getElement().style.left=t+"px",this.getElement().style.top=e+"px"},this.setClassName=function(t){i.addCssClass(this.getElement(),t)},this.show=function(t,e,n){null!=t&&this.setText(t),null!=e&&null!=n&&this.setPosition(e,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),e.Tooltip=r}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/oop"),s=t("../lib/event"),o=t("../tooltip").Tooltip;function a(t){o.call(this,t)}r.inherits(a,o),(function(){this.setPosition=function(t,e){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),s=this.getHeight();(t+=15)+r>n&&(t-=t+r-n),(e+=15)+s>i&&(e-=20+s),o.prototype.setPosition.call(this,t,e)}}).call(a.prototype),e.GutterHandler=function(t){var e,n,r,o=t.editor,l=o.renderer.$gutterLayer,c=new a(o.container);function h(){e&&(e=clearTimeout(e)),r&&(c.hide(),r=null,o._signal("hideGutterTooltip",c),o.off("mousewheel",h))}function u(t){c.setPosition(t.x,t.y)}t.editor.setDefaultHandler("guttermousedown",function(e){if(o.isFocused()&&0==e.getButton()&&"foldWidgets"!=l.getRegion(e)){var n=e.getDocumentPosition().row,i=o.session.selection;if(e.getShiftKey())i.selectTo(n,0);else{if(2==e.domEvent.detail)return o.selectAll(),e.preventDefault();t.$clickSelection=o.selection.getLineRange(n)}return t.setState("selectByLines"),t.captureMouse(e),e.preventDefault()}}),t.editor.setDefaultHandler("guttermousemove",function(s){if(i.hasCssClass(s.domEvent.target||s.domEvent.srcElement,"ace_fold-widget"))return h();r&&t.$tooltipFollowsMouse&&u(s),n=s,e||(e=setTimeout(function(){e=null,n&&!t.isMousePressed?function(){var e=n.getDocumentPosition().row,i=l.$annotations[e];if(!i)return h();if(e==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return h()}if(r!=i)if(r=i.text.join("
"),c.setHtml(r),c.show(),o._signal("showGutterTooltip",c),o.on("mousewheel",h),t.$tooltipFollowsMouse)u(n);else{var d=n.domEvent.target.getBoundingClientRect(),p=c.getElement().style;p.left=d.right+"px",p.top=d.bottom+"px"}}():h()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(t){n=null,r&&!e&&(e=setTimeout(function(){e=null,h()},50))},o),o.on("changeSession",h)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=e.MouseEvent=function(t,e){this.domEvent=t,this.editor=e,this.x=this.clientX=t.clientX,this.y=this.clientY=t.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var t=this.editor.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=t.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/event"),s=t("../lib/useragent");function o(t){var e=t.editor,n=i.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),e.on("mousedown",this.onMouseDown.bind(t));var o,l,c,h,u,d,p,f,g,m,v,y=e.container,b=0;function w(){var t=d;(function(t,n){var i=Date.now();m&&n&&t.row==n.row&&n&&t.column==n.column?a(v.x,v.y,l,c)>5?m=null:i-m>=200&&(e.renderer.scrollCursorIntoView(),m=null):(e.moveCursorToPosition(t),m=i,v={x:l,y:c})})(d=e.renderer.screenToTextCoordinates(l,c),t),function(t,n){var i=Date.now(),r=e.renderer.layerConfig.lineHeight,s=e.renderer.layerConfig.characterWidth,o=e.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:c-o.top,bottom:o.bottom-c}},h=Math.min(a.x.left,a.x.right),u=Math.min(a.y.top,a.y.bottom),d={row:t.row,column:t.column};h/s<=2&&(d.column+=a.x.left=200&&e.renderer.scrollCursorIntoView(d):g=i:g=null}(d,t)}function x(){u=e.selection.toOrientedRange(),o=e.session.addMarker(u,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),w(),h=setInterval(w,20),b=0,r.addListener(document,"mousemove",S)}function _(){clearInterval(h),e.session.removeMarker(o),o=null,e.selection.fromOrientedRange(u),e.isFocused()&&!f&&e.$resetCursorStyle(),u=null,d=null,b=0,g=null,m=null,r.removeListener(document,"mousemove",S)}this.onDragStart=function(t){if(this.cancelDrag||!y.draggable){var i=this;return setTimeout(function(){i.startSelect(),i.captureMouse(t)},0),t.preventDefault()}u=e.getSelectionRange();var r=t.dataTransfer;r.effectAllowed=e.getReadOnly()?"copy":"copyMove",s.isOpera&&(e.container.appendChild(n),n.scrollTop=0),r.setDragImage&&r.setDragImage(n,0,0),s.isOpera&&e.container.removeChild(n),r.clearData(),r.setData("Text",e.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(t){y.draggable=!1,f=!1,this.setState(null),e.getReadOnly()||(p||"move"!=t.dataTransfer.dropEffect||e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||x(),b++,t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragOver=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||(x(),b++),null!==C&&(C=null),t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragLeave=function(t){if(--b<=0&&o)return _(),p=null,r.preventDefault(t)},this.onDrop=function(t){if(d){var n=t.dataTransfer;if(f)switch(p){case"move":u=u.contains(d.row,d.column)?{start:d,end:d}:e.moveText(u,d);break;case"copy":u=e.moveText(u,d,!0)}else{var i=n.getData("Text");u={start:d,end:e.session.insert(d,i)},e.focus(),p=null}return _(),r.preventDefault(t)}},r.addListener(y,"dragstart",this.onDragStart.bind(t),e),r.addListener(y,"dragend",this.onDragEnd.bind(t),e),r.addListener(y,"dragenter",this.onDragEnter.bind(t),e),r.addListener(y,"dragover",this.onDragOver.bind(t),e),r.addListener(y,"dragleave",this.onDragLeave.bind(t),e),r.addListener(y,"drop",this.onDrop.bind(t),e);var C=null;function S(){null==C&&(C=setTimeout(function(){null!=C&&o&&_()},20))}function E(t){var e=t.types;return!e||Array.prototype.some.call(e,function(t){return"text/plain"==t||"Text"==t})}function k(t){var e=["copy","copymove","all","uninitialized"],n=s.isMac?t.altKey:t.ctrlKey,i="uninitialized";try{i=t.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r="none";return n&&e.indexOf(i)>=0?r="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?r="move":e.indexOf(i)>=0&&(r="copy"),r}}function a(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor;t.container.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging"),t.renderer.setCursorStyle(s.isWin?"default":"move"),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&e.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),i=t.getButton();if(1===(t.domEvent.detail||1)&&0===i&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=t.domEvent.target||t.domEvent.srcElement;"unselectable"in r&&(r.unselectable="on"),e.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,e.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(o.prototype),e.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./mouse_event").MouseEvent,r=t("../lib/event"),s=t("../lib/dom");e.addTouchListeners=function(t,e){var n,o,a,l,c,h,u,d,p,f="scroll",g=0,m=0,v=0,y=0;function b(){var t,n,i;p||(t=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var r,o,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,r=e.getCopyText(),o=e.session.getUndoManager().hasUndo(),void p.replaceChild(s.buildDom(n?["span",!r&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],r&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],r&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],t&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),p.firstChild);"paste"==a?t.readText().then(function(t){e.execCommand(a,t)}):a&&("cut"!=a&&"copy"!=a||(t?t.writeText(e.getCopyText()):document.execCommand("copy")),e.execCommand(a)),p.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&e.focus()},p=s.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(t){f="menu",t.stopPropagation(),t.preventDefault(),e.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),i(t)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],e.container));var r=e.selection.cursor,o=e.renderer.textToScreenCoordinates(r.row,r.column),a=e.renderer.textToScreenCoordinates(0,0).pageX,l=e.renderer.scrollLeft,c=e.container.getBoundingClientRect();p.style.top=o.pageY-c.top-3+"px",o.pageX-c.left1)return clearTimeout(c),c=null,a=-1,void(f="zoom");d=e.$mouseHandler.isMousePressed=!0;var s=e.renderer.layerConfig.lineHeight,h=e.renderer.layerConfig.lineHeight,p=t.timeStamp;l=p;var b=r[0],w=b.clientX,_=b.clientY;Math.abs(n-w)+Math.abs(o-_)>s&&(a=-1),n=t.clientX=w,o=t.clientY=_,v=y=0;var C=new i(t,e);if(u=C.getDocumentPosition(),p-a<500&&1==r.length&&!g)m++,t.preventDefault(),t.button=0,function(){c=null,clearTimeout(c),e.selection.moveToPosition(u);var t=m>=2?e.selection.getLineRange(u.row):e.session.getBracketRange(u);t&&!t.isEmpty()?e.selection.setRange(t):e.selection.selectWord(),f="wait"}();else{m=0;var S=e.selection.cursor,E=e.selection.isEmpty()?S:e.selection.anchor,k=e.renderer.$cursorLayer.getPixelPosition(S,!0),A=e.renderer.$cursorLayer.getPixelPosition(E,!0),D=e.renderer.scroller.getBoundingClientRect(),T=e.renderer.layerConfig.offset,R=e.renderer.scrollLeft,F=function(t,e){return(t/=h)*t+(e=e/s-.75)*e};if(t.clientXM?"cursor":"anchor"),f=M<3.5?"anchor":L<3.5?"cursor":"scroll",c=setTimeout(x,450)}a=p},e),r.addListener(t,"touchend",function(t){d=e.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==f?(f="",g=0):c?(e.selection.moveToPosition(u),g=0,b()):"scroll"==f?(g+=60,h=setInterval(function(){g--<=0&&(clearInterval(h),h=null),Math.abs(v)<.01&&(v=0),Math.abs(y)<.01&&(y=0),g<20&&(v*=.9),g<20&&(y*=.9);var t=e.session.getScrollTop();e.renderer.scrollBy(10*v,10*y),t==e.session.getScrollTop()&&(g=0)},10),w()):b(),clearTimeout(c),c=null},e),r.addListener(t,"touchmove",function(t){c&&(clearTimeout(c),c=null);var r=t.touches;if(!(r.length>1||"zoom"==f)){var s=r[0],a=n-s.clientX,h=o-s.clientY;if("wait"==f){if(!(a*a+h*h>4))return t.preventDefault();f="cursor"}n=s.clientX,o=s.clientY,t.clientX=s.clientX,t.clientY=s.clientY;var u=t.timeStamp,d=u-l;if(l=u,"scroll"==f){var p=new i(t,e);p.speed=1,p.wheelX=a,p.wheelY=h,10*Math.abs(a)1&&(r=n[n.length-2]);var o=l[e+"Path"];return null==o?o=l.basePath:"/"==i&&(e=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+e+i+r+this.get("suffix")},e.setModuleUrl=function(t,e){return l.$moduleUrls[t]=e},e.$loading={},e.loadModule=function(n,i){var r,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{r=t(n)}catch(l){}if(r&&!e.$loading[n])return i&&i(r);if(e.$loading[n]||(e.$loading[n]=[]),e.$loading[n].push(i),!(e.$loading[n].length>1)){var a=function(){t([n],function(t){e._emit("load.module",{name:n,module:t});var i=e.$loading[n];e.$loading[n]=null,i.forEach(function(e){e&&e(t)})})};if(!e.get("packaged"))return a();s.loadScript(e.moduleUrl(n,o),a),c()}};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};function h(r){if(a&&a.document){l.packaged=r||t.packaged||i.packaged||a.define&&n("B9Yq").packaged;for(var s,o={},c="",h=document.currentScript||document._currentScript,u=(h&&h.ownerDocument||document).getElementsByTagName("script"),d=0;d=t){for(s=u+1;s=t;)s++;for(a=u,l=s-1;a=e.length||2!=(l=n[r-1])&&3!=l||2!=(c=e[r+1])&&3!=c?4:(s&&(c=3),c==l?c:4);case 10:return 2==(l=r>0?n[r-1]:5)&&r+10&&2==n[r-1])return 2;if(s)return 4;for(p=r+1,d=e.length;p=1425&&g<=2303||64286==g)&&(1==l||7==l))return 1}return r<1||5==(l=e[r-1])?4:n[r-1];case 5:return s=!1,o=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case u:return 4}}function m(t){var e=t.charCodeAt(0),n=e>>8;return 0==n?e>191?0:d[e]:5==n?/[\u0591-\u05f4]/.test(t)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(t)?12:/[\u0660-\u0669\u066b-\u066c]/.test(t)?3:1642==e?h:/[\u06f0-\u06f9]/.test(t)?2:7:32==n&&e<=8287?p[255&e]:254==n&&e>=65136?7:4}e.L=0,e.R=1,e.EN=2,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="\xb7",e.doBidiReorder=function(t,n,h){if(t.length<2)return{};var d=t.split(""),p=new Array(d.length),v=new Array(d.length),y=[];i=h?1:0,function(t,e,n,h){var u=i?c:l,d=null,p=null,f=null,v=0,y=null,b=-1,w=null,x=null,_=[];if(!h)for(w=0,h=[];w0)if(16==y){for(w=b;w-1){for(w=b;w=0&&8==h[C];C--)e[C]=i}}(d,y,d.length,n);for(var b=0;b7&&n[b]<13||4===n[b]||n[b]===u)?y[b]=e.ON_R:b>0&&"\u0644"===d[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[b])&&(y[b-1]=y[b]=e.R_H,b++);for(d[d.length-1]===e.DOT&&(y[d.length-1]=e.B),"\u202b"===d[0]&&(y[0]=e.RLE),b=0;b=0&&(t=this.session.$docRowCache[n])}return t},this.getSplitIndex=function(){var t=0,e=this.session.$screenRowCache;if(e.length)for(var n,i=this.session.$getRowCacheIndex(e,this.currentRow);this.currentRow-t>0&&(n=this.session.$getRowCacheIndex(e,this.currentRow-t-1))===i;)i=n,t++;else t=this.currentRow;return t},this.updateRowLine=function(t,e){void 0===t&&(t=this.getDocumentRow());var n=t===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(t),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[t];s&&(void 0===e&&(e=this.getSplitIndex()),e>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=ee?this.session.getOverwrite()?t:t-1:e,r=i.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&t<=e&&s[r]%2!=0&&r++;for(var a=0;ae&&s[r]%2==0&&(o+=this.charWidths[s[r]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(t,e){var n,i=this.bidiMap,r=i.bidiLevels,s=[],o=0,a=Math.min(t,e)-this.wrapIndent,l=Math.max(t,e)-this.wrapIndent,c=!1,h=!1,u=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,p=0;p=a&&dn+s/2;){if(n+=s,i===r.length-1){s=0;break}s=this.charWidths[r[++i]]}return i>0&&r[i-1]%2!=0&&r[i]%2==0?(t0&&r[i-1]%2==0&&r[i]%2!=0?e=1+(t>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===s&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?e=1+this.bidiMap.logicalFromVisual[i]:(i>0&&r[i-1]%2!=0&&0!==s&&i--,e=this.bidiMap.logicalFromVisual[i]),0===e&&this.isRtlDir&&e++,e+this.wrapIndent}}).call(o.prototype),e.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/lang"),s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(t){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),e.$isEmpty||e.$silent||e._emit("changeSelection"),e.$keepDesiredColumnOnChange||t.old.column==t.value.column||(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,e.$isEmpty||e.$silent||e._emit("changeSelection")})};(function(){i.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?o.fromPoints(e,e):this.isBackwards()?o.fromPoints(e,t):o.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var n=e?t.end:t.start,i=e?t.start:t.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(t,e,n,i){if(!this.$silent){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(n,i),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(void 0===e){var n=t||this.lead;t=n.row,e=n.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var n,i="number"==typeof t?t:this.lead.row,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,!0===e?new o(i,0,n,this.session.getLine(n).length):new o(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,n){var i=t.column,r=t.column+e;return n<0&&(i=t.column-e,r=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(i,r).split(" ").length-1==e},this.moveCursorLeft=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===e.column)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=i)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,e,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(i)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(e)),e>=n.length)return this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,n)}},this.$shortWordEndIndex=function(t){var e,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(t))n=this.session.tokenRe.lastIndex;else{for(;(e=t[n])&&i.test(e);)n++;if(n<1)for(r.lastIndex=0;(e=t[n])&&!r.test(e);)if(r.lastIndex=0,n++,i.test(e)){if(n>2){n--;break}for(;(e=t[n])&&i.test(e);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e),r=this.session.getFoldAt(t,e,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(e==n.length){var s=this.doc.getLength();do{t++,i=this.doc.getLine(t)}while(t0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var s=r.stringReverse(i),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===e&&(0!==t&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=t&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];t<0?t-=r.rowsAbove||0:t>0&&(t+=r.rowCount-(r.rowsAbove||0))}var s=this.session.screenToDocumentPosition(i.row+t,i.column,n);this.moveCursorTo(s.row,s.column+e,0===e)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,n){var i=this.session.getFoldAt(t,e,1);i&&(t=i.start.row,e=i.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(r.charAt(e))&&r.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,n){var i=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var n=this.getCursor();return o.fromPoints(e,n)}catch(i){return o.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(t){var e=t.clone();return e.isBackwards=t.cursor==t.start,e});else(t=this.getRange()).isBackwards=this.isBackwards();return t},this.fromJSON=function(t){if(null==t.start){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var n=o.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),e.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(t,e,n){"use strict";var i=t("./config"),r=2e3,s=function(t){for(var e in this.states=t,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[e],i=[],r=0,s=this.matchMappings[e]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(t,e){return"\\"+(parseInt(e,10)+r+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),s[r]=l,r+=u,i.push(h),c.onMatch||(c.onMatch=null)}}i.length||(s[0]=0,i.push("$")),a.forEach(function(t){t.splitRegex=this.createSplitterRegexp(t.regex,o)},this),this.regExps[e]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(t){r=0|t},this.$applyToken=function(t){var e=this.splitRegex.exec(t).slice(1),n=this.token.apply(this,e);if("string"==typeof n)return[{type:n,value:t}];for(var i=[],r=0,s=n.length;rh){var v=t.substring(h,m-g.length);d.type==p?d.value+=v:(d.type&&c.push(d),d={type:p,value:v})}for(var y=0;yr){for(u>2*t.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:t});h1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},this.reportError=i.reportError}).call(s.prototype),e.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(t,e){if(e)for(var n in t){for(var i=t[n],r=0;r=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var t=this.$rowTokens,e=this.$tokenIndex,n=t[e].start;if(void 0!==n)return n;for(n=0;e>0;)n+=t[e-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var t=this.$rowTokens[this.$tokenIndex],e=this.getCurrentTokenColumn();return new i(this.$row,e,this.$row,e+t.value.length)}}).call(r.prototype),e.TokenIterator=r}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,e,n){"use strict";var i,r=t("../../lib/oop"),s=t("../behaviour").Behaviour,o=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},u={'"':'"',"'":"'"},d=function(t){var e=-1;if(t.multiSelect&&(e=t.selection.index,h.rangeCount!=t.multiSelect.rangeCount&&(h={rangeCount:t.multiSelect.rangeCount})),h[e])return i=h[e];i=h[e]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(t,e,n,i){var r=t.end.row-t.start.row;return{text:n+e+i,selection:[0,t.start.column+1,r,t.end.column+(r?0:1)]}},f=function(t){this.add("braces","insertion",function(e,n,r,s,o){var l=r.getCursorPosition(),c=s.doc.getLine(l.row);if("{"==o){d(r);var h=r.getSelectionRange(),u=s.doc.getTextRange(h);if(""!==u&&"{"!==u&&r.getWrapBehavioursEnabled())return p(h,u,"{","}");if(f.isSaneInsertion(r,s))return/[\]\}\)]/.test(c[l.column])||r.inMultiSelectMode||t&&t.braces?(f.recordAutoInsert(r,s,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(r,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(r),"}"==c.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,c,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(r);var g="";if(f.isMaybeInsertedClosing(l,c)&&(g=a.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var m=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(s.getLine(m.row))}else{if(!g)return void f.clearMaybeInsertedClosing();v=this.$getIndent(c)}var y=v+s.getTabString();return{text:"\n"+y+"\n"+v+g,selection:[1,y.length,1,y.length]}}f.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(t,e,n,r,s){var o=r.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==r.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(t,e,n,i,r){if("("==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(d(n),")"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("brackets","insertion",function(t,e,n,i,r){if("["==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(d(n),"]"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("string_dquotes","insertion",function(t,e,n,i,r){var s=i.$mode.$quotes||u;if(1==r.length&&s[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;d(n);var o=r,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return p(a,l,o,o);if(!l){var c=n.getCursorPosition(),h=i.doc.getLine(c.row),f=h.substring(c.column-1,c.column),g=h.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==f&&m&&/escape/.test(m.type))return null;var y,b=m&&/string|escape/.test(m.type),w=!v||/string|escape/.test(v.type);if(g==o)(y=b!==w)&&/string\.end/.test(v.type)&&(y=!1);else{if(b&&!w)return null;if(b&&w)return null;var x=i.$mode.tokenRe;x.lastIndex=0;var _=x.test(f);x.lastIndex=0;var C=x.test(f);if(_||C)return null;if(g&&!/[\s;,.})\]\\]/.test(g))return null;var S=h[c.column-2];if(f==o&&(S==o||x.test(S)))return null;y=!0}return{text:y?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(t,e,n,i,r){var s=i.$mode.$quotes||u,o=i.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==o))return r.end.column++,r})};f.isSaneInsertion=function(t,e){var n=t.getCursorPosition(),i=new o(e,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(t.session.getLine(n.row)[n.column]))return!0;var r=new o(e,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},f.$matchTokenType=function(t,e){return e.indexOf(t.type||t)>-1},f.recordAutoInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isAutoInsertedClosing(r,s,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=r.row,i.autoInsertedLineEnd=n+s.substr(r.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isMaybeInsertedClosing(r,s)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=r.row,i.maybeInsertedLineStart=s.substr(0,r.column)+n,i.maybeInsertedLineEnd=s.substr(r.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(t,e,n){return i.autoInsertedBrackets>0&&t.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&e.substr(t.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(t,e){return i.maybeInsertedBrackets>0&&t.row===i.maybeInsertedRow&&e.substr(t.column)===i.maybeInsertedLineEnd&&e.substr(0,t.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},r.inherits(f,s),e.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(t,e,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,s=[],o=0;o2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,f=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+l.escapeRegExp(p)+")"),m=new RegExp("(?:"+l.escapeRegExp(f)+")\\s*$"),v=function(t,e){b(t,e)||s&&!/\S/.test(t)||(r.insertInLine({row:e,column:t.length},f),r.insertInLine({row:e,column:a},p))},y=function(t,e){var n;(n=t.match(m))&&r.removeInLine(e,t.length-n[0].length,t.length),(n=t.match(g))&&r.removeInLine(e,n[1].length,n[0].length)},b=function(t,n){if(g.test(t))return!0;for(var i=e.getTokens(n),r=0;rt.length&&(x=t.length)}),a==1/0&&(a=x,s=!1,o=!1),h&&a%c!=0&&(a=Math.floor(a/c)*c),w(o?y:v)},this.toggleBlockComment=function(t,e,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var s,o,a=(g=new c(e,i.row,i.column)).getCurrentToken(),l=e.selection.toOrientedRange();if(a&&/comment/.test(a.type)){for(var u,d;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(r.start))){var p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m;u=new h(p,f,p,f+r.start.length);break}a=g.stepBackward()}var g;for(a=(g=new c(e,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var m;if(-1!=(m=a.value.indexOf(r.end))){p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m,d=new h(p,f,p,f+r.end.length);break}a=g.stepForward()}d&&e.remove(d),u&&(e.remove(u),s=u.start.row,o=-r.start.length)}else o=r.start.length,s=n.start.row,e.insert(n.end,r.end),e.insert(n.start,r.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),e.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(t,e,n){return this.$getIndent(e)},this.checkOutdent=function(t,e,n){return!1},this.autoOutdent=function(t,e,n){},this.$getIndent=function(t){return t.match(/^\s*/)[0]},this.createWorker=function(t){return null},this.createModeDelegates=function(t){for(var e in this.$embeds=[],this.$modes={},t)if(t[e]){var n=t[e],r=n.prototype.$id,s=i.$modes[r];s||(i.$modes[r]=s=new n),i.$modes[e]||(i.$modes[e]=s),this.$embeds.push(e),this.$modes[e]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(e=0;ethis.row)){var n=function(e,n,i){var r="insert"==e.action,s=(r?1:-1)*(e.end.row-e.start.row),o=(r?1:-1)*(e.end.column-e.start.column),a=e.start,l=r?a:e.end;return t(n,a,i)?{row:n.row,column:n.column}:t(l,n,!i)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(t,e,n){var i;if(i=n?{row:t,column:e}:this.$clipPositionToDocument(t,e),this.row!=i.row||this.column!=i.column){var r={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:r,value:i})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,e))),e<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./apply_delta").applyDelta,s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=t("./anchor").Anchor,l=function(t){this.$lines=[""],0===t.length?this.$lines=[""]:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){i.implement(this,s),this.setValue=function(t){var e=this.getLength()-1;this.remove(new o(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},t)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(t,e){return new a(this,t,e)},this.$split=0==="aaa".split(/a/).length?function(t){return t.replace(/\r\n|\r/g,"\n").split("\n")}:function(t){return t.split(/\r\n|\r|\n/)},this.$detectNewLine=function(t){var e=t.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return"\r\n"==t||"\r"==t||"\n"==t},this.getLine=function(t){return this.$lines[t]||""},this.getLines=function(t,e){return this.$lines.slice(t,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(t){var e;if(t.start.row===t.end.row)e=[this.getLine(t.start.row).substring(t.start.column,t.end.column)];else{(e=this.getLines(t.start.row,t.end.row))[0]=(e[0]||"").substring(t.start.column);var n=e.length-1;t.end.row-t.start.row==n&&(e[n]=e[n].substring(0,t.end.column))}return e},this.insertLines=function(t,e){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(t,e)},this.removeLines=function(t,e){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(t,e)},this.insertNewLine=function(t){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(t,["",""])},this.insert=function(t,e){return this.getLength()<=1&&this.$detectNewLine(e),this.insertMergedLines(t,this.$split(e))},this.insertInLine=function(t,e){var n=this.clippedPos(t.row,t.column),i=this.pos(t.row,t.column+e.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[e]},!0),this.clonePos(i)},this.clippedPos=function(t,e){var n=this.getLength();void 0===t?t=n:t<0?t=0:t>=n&&(t=n-1,e=void 0);var i=this.getLine(t);return null==e&&(e=i.length),{row:t,column:e=Math.min(Math.max(e,0),i.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(t,e){return{row:t,column:e}},this.$clipPosition=function(t){var e=this.getLength();return t.row>=e?(t.row=Math.max(0,e-1),t.column=this.getLine(e-1).length):(t.row=Math.max(0,t.row),t.column=Math.min(Math.max(t.column,0),this.getLine(t.row).length)),t},this.insertFullLines=function(t,e){var n=0;(t=Math.min(Math.max(t,0),this.getLength()))0,i=e=0&&this.applyDelta({start:this.pos(t,this.getLine(t).length),end:this.pos(t+1,0),action:"remove",lines:["",""]})},this.replace=function(t,e){return t instanceof o||(t=o.fromPoints(t.start,t.end)),0===e.length&&t.isEmpty()?t.start:e==this.getTextRange(t)?t.end:(this.remove(t),e?this.insert(t.start,e):t.start)},this.applyDeltas=function(t){for(var e=0;e=0;e--)this.revertDelta(t[e])},this.applyDelta=function(t,e){var n="insert"==t.action;(n?t.lines.length<=1&&!t.lines[0]:!o.comparePoints(t.start,t.end))||(n&&t.lines.length>2e4?this.$splitAndapplyLargeDelta(t,2e4):(r(this.$lines,t,e),this._signal("change",t)))},this.$safeApplyDelta=function(t){var e=this.$lines.length;("remove"==t.action&&t.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=e,-1==i&&(i=e),s<=i&&n.fireUpdateEvent(s,i)}}};(function(){i.implement(this,r),this.setTokenizer=function(t){this.tokenizer=t,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(t){this.doc=t,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(t,e){this._signal("update",{data:{first:t,last:e}})},this.start=function(t){this.currentLine=Math.min(t||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.lines[e]=null;else if("remove"==t.action)this.lines.splice(e,n+1,null),this.states.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(t){return this.lines[t]||this.$tokenizeRow(t)},this.getState=function(t){return this.currentLine==t&&this.$tokenizeRow(t),this.states[t]||"start"},this.$tokenizeRow=function(t){var e=this.doc.getLine(t),n=this.tokenizer.getLineTokens(e,this.states[t-1],t);return this.states[t]+""!=n.state+""?(this.states[t]=n.state,this.lines[t+1]=null,this.currentLine>t+1&&(this.currentLine=t+1)):this.currentLine==t&&(this.currentLine=t+1),this.lines[t]=n.tokens}}).call(s.prototype),e.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=(t("./lib/oop"),t("./range").Range),s=function(t,e,n){this.setRegexp(t),this.clazz=e,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+""!=t+""&&(this.regExp=t,this.cache=[])},this.update=function(t,e,n,s){if(this.regExp)for(var o=s.lastRow,a=s.firstRow;a<=o;a++){var l=this.cache[a];null==l&&((l=i.getMatchOffsets(n.getLine(a),this.regExp)).length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(t){return new r(a,t.offset,a,t.offset+t.length)}),this.cache[a]=l.length?l:"");for(var c=l.length;c--;)e.drawSingleLineMarker(t,l[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),e.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../range").Range;function r(t,e){this.foldData=t,Array.isArray(e)?this.folds=e:e=this.folds=[e];var n=e[e.length-1];this.range=new i(e[0].start.row,e[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(t),this.folds.sort(function(t,e){return-t.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(t.start.row,t.start.column)>0?(this.end.row=t.end.row,this.end.column=t.end.column):this.range.compareStart(t.end.row,t.end.column)<0&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(t,e,n){var i,r,s=0,o=this.folds,a=!0;null==e&&(e=this.end.row,n=this.end.column);for(var l=0;l0)){var l=i(t,o.start);return 0===a?e&&0!==l?-s-2:s:l>0||0===l&&!e?s:-s-1}}return-s-1},this.add=function(t){var e=!t.isEmpty(),n=this.pointIndex(t.start,e);n<0&&(n=-n-1);var i=this.pointIndex(t.end,e,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,t)},this.addList=function(t){for(var e=[],n=t.length;n--;)e.push.apply(e,this.add(t[n]));return e},this.substractPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges.splice(e,1)},this.merge=function(){for(var t,e=[],n=this.ranges,r=(n=n.sort(function(t,e){return i(t.start,e.start)}))[0],s=1;s=0},this.containsPoint=function(t){return this.pointIndex(t)>=0},this.rangeAtPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges[e]},this.clipRows=function(t,e){var n=this.ranges;if(n[0].start.row>e||n[n.length-1].start.row=i);o++);if("insert"==t.action){for(var l=r-i,c=-e.column+n.column;oi);o++)if(h.start.row==i&&h.start.column>=e.column&&(h.start.column==e.column&&this.$bias<=0||(h.start.column+=c,h.start.row+=l)),h.end.row==i&&h.end.column>=e.column){if(h.end.column==e.column&&this.$bias<0)continue;h.end.column==e.column&&c>0&&oh.start.column&&h.end.column==s[o+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l}}else for(l=i-r,c=e.column-n.column;or);o++)h.end.rowe.column)&&(h.end.column=e.column,h.end.row=e.row):(h.end.column+=c,h.end.row+=l):h.end.row>r&&(h.end.row+=l),h.start.rowe.column)&&(h.start.column=e.column,h.start.row=e.row):(h.start.column+=c,h.start.row+=l):h.start.row>r&&(h.start.row+=l);if(0!=l&&o=t)return r;if(r.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var n=this.$foldData,i=0;for(e&&(i=n.indexOf(e)),-1==i&&(i=0);i=t)return r}return null},this.getFoldedRowCount=function(t,e){for(var n=this.$foldData,i=e-t+1,r=0;r=e){a=t?i-=e-a:i=0);break}o>=t&&(i-=a>=t?o-a:o-t+1)}return i},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(t,e){return t.start.row-e.start.row}),t},this.addFold=function(t,e){var n,i=this.$foldData,o=!1;t instanceof s?n=t:(n=new s(e,t)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,h=n.end.column,u=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1);if(u&&d==u)return u.addSubFold(n);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(c,h)&&this.removeFold(d);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach(function(t){n.addSubFold(t)}));for(var f=0;f0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(t){this.expandFold(t)},this)},this.unfold=function(t,e){var n,r;if(null==t?(n=new i(0,0,this.getLength(),0),null==e&&(e=!0)):n="number"==typeof t?new i(t,0,t,this.getLine(t).length):"row"in t?i.fromPoints(t,t):t,r=this.getFoldsInRangeList(n),0!=e?this.removeFolds(r):this.expandFolds(r),r.length)return r},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var n=this.getFoldLine(t,e);return n?n.end.row:t},this.getRowFoldStart=function(t,e){var n=this.getFoldLine(t,e);return n?n.start.row:t},this.getFoldDisplayLine=function(t,e,n,i,r){null==i&&(i=t.start.row),null==r&&(r=0),null==e&&(e=t.end.row),null==n&&(n=this.getLine(e).length);var s=this.doc,o="";return t.walk(function(t,e,n,a){if(!(eh)break}while(s&&l.test(s.type));s=r.stepBackward()}else s=r.getCurrentToken();return c.end.row=r.getCurrentTokenRow(),c.end.column=r.getCurrentTokenColumn()+s.value.length-2,c}},this.foldAll=function(t,e,n,i){null==n&&(n=1e5);var r=this.foldWidgets;if(r){e=e||this.getLength();for(var s=t=t||0;s=t&&(s=o.end.row,o.collapseChildren=n,this.addFold("...",o))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var n=t.getTokens(e),i=0;i=0;){var s=n[r];if(null==s&&(s=n[r]=this.getFoldWidget(r)),"start"==s){var o=this.getFoldWidgetRange(r);if(i||(i=o),o&&o.end.row>=t)break}r--}return{range:-1!==r&&o,firstRange:i}},this.onFoldWidgetClick=function(t,e){if(!this.$toggleFoldWidget(t,{children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey})){var n=e.target||e.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var n=this.getFoldWidget(t),i=this.getLine(t),r="end"===n?-1:1,s=this.getFoldAt(t,-1===r?0:i.length,r);if(s)return e.children||e.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(t,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(e.siblings){var a=this.getParentFoldRangeData(t);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,e.all?1e4:0)}else e.children?(c=o?o.end.row:this.getLength(),this.foldAll(t+1,c,e.all?1e4:0)):o&&(e.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var n=this.$toggleFoldWidget(e,{});if(!n){var i=this.getParentFoldRangeData(e,!0);if(n=i.range||i.firstRange){var r=this.getFoldAt(e=n.start.row,this.getLine(e).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.foldWidgets[e]=null;else if("remove"==t.action)this.foldWidgets.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,e,n){"use strict";var i=t("../token_iterator").TokenIterator,r=t("../range").Range;e.BracketMatch=function(){this.findMatchingBracket=function(t,e){if(0==t.column)return null;var n=e||this.getLine(t.row).charAt(t.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t):null},this.getBracketRange=function(t){var e,n=this.getLine(t.row),i=!0,s=n.charAt(t.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(t.column),t={row:t.row,column:t.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),i=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],t)))return null;e=r.fromPoints(t,a),i||(e.end.column++,e.start.column--),e.cursor=e.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],t)))return null;e=r.fromPoints(a,t),i||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(t){var e=this.getLine(t.row),n=e.charAt(t.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=e.charAt(t.column),t={row:t.row,column:t.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!i)return null;var s=new r(t.row,t.column-1,t.row,t.column),o=i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t);return o?[s,new r(o.row,o.column,o.row,o.column+1)]:[s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==r){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else h==t&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;ln&&(this.$docRowCache.splice(n,e),this.$screenRowCache.splice(n,e))},this.$getRowCacheIndex=function(t,e){for(var n=0,i=t.length-1;n<=i;){var r=n+i>>1,s=t[r];if(e>s)n=r+1;else{if(!(e=e);s++);return(n=i[s])?(n.index=s,n.start=r-n.value.length,n):null},this.setUndoManager=function(t){if(this.$undoManager=t,this.$informUndoManager&&this.$informUndoManager.cancel(),t){var e=this;t.addSession(this),this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(t){this.setOption("useSoftTabs",t)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(t){this.setOption("tabSize",t)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(t){return this.$useSoftTabs&&t.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(t){this.setOption("navigateWithinSoftTabs",t)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(t){this.setOption("overwrite",t)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(t,e){this.$decorations[t]||(this.$decorations[t]=""),this.$decorations[t]+=" "+e,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(t,e){this.$decorations[t]=(this.$decorations[t]||"").replace(" "+e,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(t){this.$breakpoints=[];for(var e=0;e0&&(i=!!n.charAt(e-1).match(this.tokenRe)),i||(i=!!n.charAt(e).match(this.tokenRe)),i)var r=this.tokenRe;else r=/^\s+$/.test(n.slice(e-1,e+1))?/\s/:this.nonTokenRe;var s=e;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(r));s++}for(var o=e;ot&&(t=e.screenWidth)}),this.lineWidgetWidth=t},this.$computeWidth=function(t){if(this.$modified||t){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,s=this.$foldData[r],o=s?s.start.row:1/0,a=e.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[r++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(e[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(t,e){return this.doc.getLines(t,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(t,e){return this.doc.insert(t,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(t,e){return this.doc.removeFullLines(t,e)},this.undoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=t.length-1;-1!=n;n--){var i=t[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!e&&this.$undoSelect&&(t.selectionBefore?this.selection.fromJSON(t.selectionBefore):this.selection.setRange(this.$getUndoSelection(t,!0))),this.$fromUndo=!1}},this.redoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=0;nt.end.column&&(s.start.column+=c),s.end.row==t.end.row&&s.end.column>t.end.column&&(s.end.column+=c)),l&&s.start.row>=t.end.row&&(s.start.row+=l,s.end.row+=l)),s.end=this.insert(s.start,i),r.length){var o=t.start,a=s.start,l=a.row-o.row,c=a.column-o.column;this.addFolds(r.map(function(t){return(t=t.clone()).start.row==o.row&&(t.start.column+=c),t.end.row==o.row&&(t.end.column+=c),t.start.row+=l,t.end.row+=l,t}))}return s},this.indentRows=function(t,e,n){n=n.replace(/\t/g,this.getTabString());for(var i=t;i<=e;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(t){for(var e=t.collapseRows(),n=new h(0,0,0,0),i=this.getTabSize(),r=e.start.row;r<=e.end.row;++r){var s=this.getLine(r);n.start.row=r,n.end.row=r;for(var o=0;o0){var r;if((r=this.getRowFoldEnd(e+n))>this.doc.getLength()-1)return 0;i=r-e}else t=this.$clipRowToDocument(t),i=(e=this.$clipRowToDocument(e))-t+1;var s=new h(t,0,e,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(t){return(t=t.clone()).start.row+=i,t.end.row+=i,t}),a=0==n?this.doc.getLines(t,e):this.doc.removeFullLines(t,e);return this.doc.insertFullLines(t+i,a),o.length&&this.addFolds(o),i},this.moveLinesUp=function(t,e){return this.$moveLines(t,e,-1)},this.moveLinesDown=function(t,e){return this.$moveLines(t,e,1)},this.duplicateLines=function(t,e){return this.$moveLines(t,e,0)},this.$clipRowToDocument=function(t){return Math.max(0,Math.min(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(t,e){return e<0?0:Math.min(this.doc.getLine(t).length,e)},this.$clipPositionToDocument=function(t,e){if(e=Math.max(0,e),t<0)t=0,e=0;else{var n=this.doc.getLength();t>=n?(t=n-1,e=this.doc.getLine(n-1).length):e=Math.min(this.doc.getLine(t).length,e)}return{row:t,column:e}},this.$clipRangeToDocument=function(t){t.start.row<0?(t.start.row=0,t.start.column=0):t.start.column=this.$clipColumnToRow(t.start.row,t.start.column);var e=this.doc.getLength()-1;return t.end.row>e?(t.end.row=e,t.end.column=this.doc.getLine(e).length):t.end.column=this.$clipColumnToRow(t.end.row,t.end.column),t},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(t){if(t!=this.$useWrapMode){if(this.$useWrapMode=t,this.$modified=!0,this.$resetRowCache(0),t){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(t,e){this.$wrapLimitRange.min===t&&this.$wrapLimitRange.max===e||(this.$wrapLimitRange={min:t,max:e},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(t,e){var n=this.$wrapLimitRange;n.max<0&&(n={min:e,max:e});var i=this.$constrainWrapLimit(t,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(t,e,n){return e&&(t=Math.max(e,t)),n&&(t=Math.min(n,t)),t},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(t){this.setWrapLimitRange(t,t)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(t){var e=this.$useWrapMode,n=t.action,i=t.start,r=t.end,s=i.row,o=r.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[e?"$wrapData":"$rowLengthCache"].splice(s,a);var c=this.$foldData;l=this.getFoldsInRange(t),this.removeFolds(l);var h=0;if(g=this.getFoldLine(r.row)){g.addRemoveChars(r.row,r.column,i.column-r.column),g.shiftRow(-a);var u=this.getFoldLine(s);u&&u!==g&&(u.merge(g),g=u),h=c.indexOf(g)+1}for(;h=r.row&&g.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var p=e?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,d),c=this.$foldData,h=0,g=this.getFoldLine(s)){var f=g.range.compareInside(i.row,i.column);0==f?(g=g.split(i.row,i.column))&&(g.shiftRow(a),g.addRemoveChars(o,0,r.column-i.column)):-1==f&&(g.addRemoveChars(s,0,r.column-i.column),g.shiftRow(a)),h=c.indexOf(g)+1}for(;h=s&&g.shiftRow(a)}}else a=Math.abs(t.start.column-t.end.column),"remove"===n&&(l=this.getFoldsInRange(t),this.removeFolds(l),a=-a),(g=this.getFoldLine(s))&&g.addRemoveChars(s,i.column,a);return e&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,e?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(t,e,n){this.$rowLengthCache[t]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(n,i){var r,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,h=n;for(i=Math.min(i,o.length-1);h<=i;)(s=this.getFoldLine(h,s))?(r=[],s.walk((function(n,i,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,r.length))[0]=t;for(var c=1;c=4352&&t<=4447||t>=4515&&t<=4519||t>=4602&&t<=4607||t>=9001&&t<=9002||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12283||t>=12288&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12589||t>=12593&&t<=12686||t>=12688&&t<=12730||t>=12736&&t<=12771||t>=12784&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=13054||t>=13056&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=55216&&t<=55238||t>=55243&&t<=55291||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=65281&&t<=65376||t>=65504&&t<=65510)}this.$computeWrapSplits=function(n,i,r){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,c=this.$wrapAsCode,h=this.$indentedSoftWrap,u=i<=Math.max(2*r,8)||!1===h?0:Math.floor(i/2);function d(t){for(var e=t-a,i=a;ii-p;){var f=a+i-p;if(n[f-1]>=10&&n[f]>=10)d(f);else if(n[f]!=t&&n[f]!=e){for(var g=Math.max(f-(i-(i>>2)),a-1);f>g&&n[f]g&&n[f]g&&9==n[f];)f--}else for(;f>g&&n[f]<10;)f--;f>g?d(++f):(2==n[f=a+i]&&f--,d(f-p))}else{for(;f!=a-1&&n[f]!=t;f--);if(f>a){d(f);continue}for(f=a+i;f39&&o<48||o>57&&o<64?r.push(9):o>=4352&&n(o)?r.push(1,2):r.push(1)}return r},this.$getStringScreenWidth=function(t,e,i){if(0==e)return[0,0];var r,s;for(null==e&&(e=1/0),i=i||0,s=0;s=4352&&n(r)?i+=2:i+=1,!(i>e));s++);return[i,s]},this.lineWidgets=null,this.getRowLength=function(t){var e=1;return this.lineWidgets&&(e+=this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0),this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+e:e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(t){if(this.$useWrapMode){var e=this.screenToDocumentPosition(t,Number.MAX_VALUE),n=this.$wrapData[e.row];return n.length&&n[0]=0){a=c[h],s=this.$docRowCache[h];var d=t>c[u-1]}else d=!u;for(var p=this.getLength()-1,f=this.getNextFoldLine(s),g=f?f.start.row:1/0;a<=t&&!(a+(l=this.getRowLength(s))>t||s>=p);)a+=l,++s>g&&(g=(f=this.getNextFoldLine(s=f.end.row+1,f))?f.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(f&&f.start.row<=s)i=this.getFoldDisplayLine(f),s=f.start.row;else{if(a+l<=t||s>p)return{row:p,column:this.getLine(p).length};i=this.getLine(s),f=null}var m=0,v=Math.floor(t-a);if(this.$useWrapMode){var y=this.$wrapData[s];y&&(r=y[v],v>0&&y.length&&(m=y.indent,i=i.substring(o=y[v-1]||y[y.length-1])))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,s,v)&&(e=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(i,e-m)[1],this.$useWrapMode&&o>=r&&(o=r-1),f?f.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(t,e){if(void 0===e)var n=this.$clipPositionToDocument(t.row,t.column);else n=this.$clipPositionToDocument(t,e);var i,r=0,s=null;(i=this.getFoldAt(t=n.row,e=n.column,1))&&(t=i.start.row,e=i.start.column);var o,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,t),h=l.length;if(h&&c>=0){a=l[c],r=this.$screenRowCache[c];var u=t>l[h-1]}else u=!h;for(var d=this.getNextFoldLine(a),p=d?d.start.row:1/0;a=p){if((o=d.end.row+1)>t)break;p=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;r+=this.getRowLength(a),a=o,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(r))}var f="";d&&a>=p?(f=this.getFoldDisplayLine(d,t,e),s=d.start.row):(f=this.getLine(t).substring(0,e),s=t);var g=0;if(this.$useWrapMode){var m=this.$wrapData[s];if(m){for(var v=0;f.length>=m[v];)r++,v++;f=f.substring(m[v-1]||0,f.length),g=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(r+=this.lineWidgets[a].rowsAbove),{row:r,column:g+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(t,e){return this.documentToScreenPosition(t,e).column},this.documentToScreenRow=function(t,e){return this.documentToScreenPosition(t,e).row},this.getScreenLength=function(){var t=0,e=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=(a=0,(e=this.$foldData[a++])?e.start.row:1/0);ir&&(i=e.end.row+1,r=(e=this.$foldData[a++])?e.start.row:1/0)}else{t=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[i,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=n}).call(f.prototype),t("./edit_session/folding").Folding.call(f.prototype),t("./edit_session/bracket_match").BracketMatch.call(f.prototype),o.defineOptions(f.prototype,"session",{wrap:{set:function(t){if(t&&"off"!=t?"free"==t?t=!0:"printMargin"==t?t=-1:"string"==typeof t&&(t=parseInt(t,10)||!1):t=!1,this.$wrap!=t)if(this.$wrap=t,t){var e="number"==typeof t?t:null;this.setWrapLimitRange(e,e),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(t){(t="auto"==t?"text"!=this.$mode.type:"text"!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){(t=parseInt(t))>0&&this.$tabSize!==t&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(t){this.setFoldStyle(t)},handlesSet:!0},overwrite:{set:function(t){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=t("./lib/oop"),s=t("./range").Range,o=function(){this.$options={}};(function(){this.set=function(t){return r.mixin(this.$options,t),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var i=null;return n.forEach(function(t,n,r,o){return i=new s(t,n,r,o),!(n==o&&e.start&&e.start.start&&0!=e.skipCurrent&&i.isEqual(e.start)&&(i=null,1))}),i},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,r=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),o=[],a=e.re;if(e.$isMultiLine){var l,c=a.length,h=r.length-c;t:for(var u=a.offset||0;u<=h;u++){for(var d=0;dg||(o.push(l=new s(u,g,u+c-1,m)),c>2&&(u=u+c-2))}}else for(var v=0;vx&&o[d].end.row==n.end.row;)d--;for(o=o.slice(v,d+1),v=0,d=o.length;v=a;n--)if(u(n,Number.MAX_VALUE,t))return;if(0!=e.wrap)for(n=l,a=o.row;n>=a;n--)if(u(n,Number.MAX_VALUE,t))return}};else c=function(t){var n=o.row;if(!u(n,o.column,t)){for(n+=1;n<=l;n++)if(u(n,0,t))return;if(0!=e.wrap)for(n=a,l=o.row;n<=l;n++)if(u(n,0,t))return}};if(e.$isMultiLine)var h=n.length,u=function(e,r,s){var o=i?e-h+1:e;if(!(o<0)){var a=t.getLine(o),l=a.search(n[0]);if(!(!i&&lr))return!!s(o,l,o+h-1,u)||void 0}}};else u=i?function(e,i,r){var s,o=t.getLine(e),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){if(l=s.index,!(h=s[0].length)){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+h>i)break;a.push(s.index,h)}for(var c=a.length-1;c>=0;c-=2){var h,u=a[c-1];if(r(e,u,e,u+(h=a[c])))return!0}}:function(e,i,r){var s,o,a=t.getLine(e);for(n.lastIndex=i;o=n.exec(a);){var l=o[0].length;if(r(e,s=o.index,e,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:c}}}).call(o.prototype),e.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/keys"),r=t("../lib/useragent"),s=i.KEY_MODS;function o(t,e){this.platform=e||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function a(t,e){o.call(this,t,e),this.$singleCommand=!1}a.prototype=o.prototype,(function(){function t(t){return"object"==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(t,e){var n=t&&("string"==typeof t?t:t.name);t=this.commands[n],e||delete this.commands[n];var i=this.commandKeyBinding;for(var r in i){var s=i[r];if(s==t)delete i[r];else if(Array.isArray(s)){var o=s.indexOf(t);-1!=o&&(s.splice(o,1),1==s.length&&(i[r]=s[0]))}}},this.bindKey=function(t,e,n){if("object"==typeof t&&t&&(null==n&&(n=t.position),t=t[this.platform]),t)return"function"==typeof e?this.addCommand({exec:e,bindKey:t,name:e.name||t}):void t.split("|").forEach(function(t){var i="";if(-1!=t.indexOf(" ")){var r=t.split(/\s+/);t=r.pop(),r.forEach(function(t){var e=this.parseKeys(t);this._addCommandToBinding(i+=(i?" ":"")+(s[e.hashId]+e.key),"chainKeys")},this),i+=" "}var o=this.parseKeys(t);this._addCommandToBinding(i+(s[o.hashId]+o.key),e,n)},this)},this._addCommandToBinding=function(e,n,i){var r,s=this.commandKeyBinding;if(n)if(!s[e]||this.$singleCommand)s[e]=n;else{Array.isArray(s[e])?-1!=(r=s[e].indexOf(n))&&s[e].splice(r,1):s[e]=[s[e]],"number"!=typeof i&&(i=t(n));var o=s[e];for(r=0;ri);r++);o.splice(r,0,n)}else delete s[e]},this.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var n=t[e];if(n){if("string"==typeof n)return this.bindKey(n,e);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=e),this.addCommand(n))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(t){return t}),n=e.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else{if(!e.length)return{key:n,hashId:-1};if(1==e.length&&"shift"==e[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=e.length;o--;){var a=i.KEY_MODS[e[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+e[o]+" in "+t),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(t,e){return this.commandKeyBinding[s[t]+e]},this.handleKeyboard=function(t,e,n,i){if(!(i<0)){var r=s[e]+n,o=this.commandKeyBinding[r];return t.$keyChain&&(t.$keyChain+=" "+r,o=this.commandKeyBinding[t.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(t.$keyChain&&(e&&4!=e||1!=n.length?(-1==e||i>0)&&(t.$keyChain=""):t.$keyChain=t.$keyChain.slice(0,-r.length-1)),{command:o}):(t.$keyChain=t.$keyChain||r,{command:"null"})}},this.getStatusText=function(t,e){return e.$keyChain||""}}).call(o.prototype),e.HashHandler=o,e.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../keyboard/hash_handler").MultiHashHandler,s=t("../lib/event_emitter").EventEmitter,o=function(t,e){r.call(this,e,t),this.byName=this.commands,this.setDefaultHandler("exec",function(t){return t.command.exec(t.editor,t.args||{})})};i.inherits(o,r),(function(){i.implement(this,s),this.exec=function(t,e,n){if(Array.isArray(t)){for(var i=t.length;i--;)if(this.exec(t[i],e,n))return!0;return!1}if("string"==typeof t&&(t=this.commands[t]),!t)return!1;if(e&&e.$readOnly&&!t.readOnly)return!1;if(0!=this.$checkCommandState&&t.isAvailable&&!t.isAvailable(e))return!1;var r={editor:e,command:t,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.toggleRecording=function(t){if(!this.$inReplay)return t&&t._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(t){return t.map(function(t){return"string"!=typeof t[0]&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}).call(o.prototype),e.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=t("../config"),s=t("../range").Range;function o(t,e){return{win:t,mac:e}}e.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(t,e){"number"!=typeof e||isNaN(e)||t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty()?t.selection.getLineRange():t.selection.getRange();t._emit("cut",e),e.isEmpty()||t.session.remove(e),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(i.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(t){for(var e=t.selection.isBackwards(),n=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),r=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),o=t.session.doc.getLine(n.row).length,a=t.session.doc.getTextRange(t.selection.getRange()).replace(/\n\s*/," ").length,l=t.session.doc.getLine(n.row),c=n.row+1;c<=r.row+1;c++){var h=i.stringTrimLeft(i.stringTrimRight(t.session.doc.getLine(c)));0!==h.length&&(h=" "+h),l+=h}r.row+10?(t.selection.moveCursorTo(n.row,n.column),t.selection.selectTo(n.row,n.column+a)):(o=t.session.doc.getLine(n.row).length>o?o+1:o,t.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(t){var e=t.session.doc.getLength()-1,n=t.session.doc.getLine(e).length,i=t.selection.rangeList.ranges,r=[];i.length<1&&(i=[t.selection.getRange()]);for(var o=0;o=r.lastRow||i.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(t){if(this.$mergeUndoDeltas){var e=this.prevOp,n=this.$mergeableCommands,i=e.command&&t.command.name==e.command.name;if("insertstring"==t.command.name){var r=t.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(e.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(t.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(t.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,e){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var n=this;v.loadModule(["keybinding",t],function(i){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(i&&i.handler),e&&e()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),e&&e()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(t){if(this.session!=t){this.curOp&&this.endOperation(),this.curOp={};var e=this.session;if(e){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=t,t?(this.$onDocumentChange=this.onDocumentChange.bind(this),t.on("change",this.$onDocumentChange),this.renderer.setSession(t),this.$onChangeMode=this.onChangeMode.bind(this),t.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),t.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),t.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),t.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),t.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),t.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=t.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(t)),this._signal("changeSession",{session:t,oldSession:e}),this.curOp=null,e&&e._signal("changeEditor",{oldEditor:this}),t&&t._signal("changeEditor",{editor:this}),t&&t.bgTokenizer&&t.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(t,e){return this.session.doc.setValue(t),e?1==e?this.navigateFileEnd():-1==e&&this.navigateFileStart():this.selectAll(),t},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(t){this.renderer.onResize(t)},this.setTheme=function(t,e){this.renderer.setTheme(t,e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(t){this.renderer.setStyle(t)},this.unsetStyle=function(t){this.renderer.unsetStyle(t)},this.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},this.setFontSize=function(t){this.setOption("fontSize",t)},this.$highlightBrackets=function(){if(!this.$highlightPending){var t=this;this.$highlightPending=!0,setTimeout(function(){t.$highlightPending=!1;var e=t.session;if(e&&e.bgTokenizer){e.$bracketHighlight&&(e.$bracketHighlight.markerIds.forEach(function(t){e.removeMarker(t)}),e.$bracketHighlight=null);var n=e.getMatchingBracketRanges(t.getCursorPosition());if(!n&&e.$mode.getMatching&&(n=e.$mode.getMatching(t.session)),n){var i="ace_bracket";Array.isArray(n)?1==n.length&&(i="ace_error_bracket"):n=[n],2==n.length&&(0==p.comparePoints(n[0].end,n[1].start)?n=[p.fromPoints(n[0].start,n[1].end)]:0==p.comparePoints(n[0].start,n[1].end)&&(n=[p.fromPoints(n[1].start,n[0].end)])),e.$bracketHighlight={ranges:n,markerIds:n.map(function(t){return e.addMarker(t,i,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var t=this;this.$highlightTagPending=!0,setTimeout(function(){t.$highlightTagPending=!1;var e=t.session;if(e&&e.bgTokenizer){var n=t.getCursorPosition(),i=new y(t.session,n.row,n.column),r=i.getCurrentToken();if(!r||!/\b(?:tag-open|tag-name)/.test(r.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1===r.type.indexOf("tag-open")||(r=i.stepForward())){var s=r.value,o=r.value,a=0,l=i.stepBackward();if("<"===l.value)do{l=r,(r=i.stepForward())&&(-1!==r.type.indexOf("tag-name")?s===(o=r.value)&&("<"===l.value?a++:""===r.value&&a--)}while(r&&a>=0);else{do{if(r=l,l=i.stepBackward(),r)if(-1!==r.type.indexOf("tag-name"))s===r.value&&("<"===l.value?a++:""===r.value){for(var c=0,h=l;h;){if(-1!==h.type.indexOf("tag-name")&&h.value===s){a--;break}if("<"===h.value)break;h=i.stepBackward(),c++}for(var u=0;u1||(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(t){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(n,"ace_selection",i)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var t=this.session,e=this.getSelectionRange();if(!e.isEmpty()&&!e.isMultiLine()){var n=e.start.column,i=e.end.column,r=t.getLine(e.start.row),s=r.substring(n,i);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=r.substring(n-1,i+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(t){this.renderer.updateText(),this._emit("changeMode",t)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var t=this.getSelectedText(),e=this.session.doc.getNewLineCharacter(),n=!1;if(!t&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;ra.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,h=n.getState(r.row),u=(a=n.getLine(r.row),i.checkOutdent(h,a,t));if(n.insert(r,t),s&&s.selection&&this.selection.setSelectionRange(2==s.selection.length?new p(r.row,c+s.selection[0],r.row,c+s.selection[1]):new p(r.row+s.selection[0],s.selection[1],r.row+s.selection[2],s.selection[3])),this.$enableAutoIndent){if(n.getDocument().isNewLine(t)){var d=i.getNextLineIndent(h,a.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},d)}u&&i.autoOutdent(h,n,r.row)}},this.autoIndent=function(){var t,e,n=this.session,i=n.getMode();if(this.selection.isEmpty())t=0,e=n.doc.getLength()-1;else{var r=this.getSelectionRange();t=r.start.row,e=r.end.row}for(var s,o,a,l="",c="",h="",u=n.getTabString(),d=t;d<=e;d++)d>0&&(l=n.getState(d-1),c=n.getLine(d-1),h=i.getNextLineIndent(l,c,u)),s=n.getLine(d),h!==(o=i.$getIndent(s))&&(o.length>0&&(a=new p(d,0,d,o.length),n.remove(a)),h.length>0&&n.insert({row:d,column:0},h)),i.autoOutdent(l,n,d)},this.onTextInput=function(t,e){if(!e)return this.keyBinding.onTextInput(t);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,t,e);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(t,e){var n;(e.extendLeft||e.extendRight)&&((n=this.selection.getRange()).start.column-=e.extendLeft,n.end.column+=e.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),t||n.isEmpty()||this.remove()),!t&&this.selection.isEmpty()||this.insert(t,!0),(e.restoreStart||e.restoreEnd)&&((n=this.selection.getRange()).start.column-=e.restoreStart,n.end.column-=e.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(t,e,n){return this.keyBinding.onCommandKey(t,e,n)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption("scrollSpeed",t)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(t){this.setOption("dragDelay",t)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(t){this.setOption("selectionStyle",t)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(t){this.setOption("highlightActiveLine",t)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(t){this.setOption("highlightSelectedWord",t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption("readOnly",t)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(t){this.setOption("behavioursEnabled",t)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(t){this.setOption("wrapBehavioursEnabled",t)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(t){this.setOption("showFoldWidgets",t)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(t){this.selection.isEmpty()&&("left"==t?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(e.start.row),r=n.getMode().transformAction(i,"deletion",this,n,e);if(0===e.end.column){var s=n.getTextRange(e);if("\n"==s[s.length-1]){var o=n.getLine(e.end.row);/^\s+$/.test(o)&&(e.end.column=o.length)}}r&&(e=r)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var t=this.getCursorPosition(),e=t.column;if(0!==e){var n,i,r=this.session.getLine(t.row);ee.toLowerCase()?1:0});var r=new p(0,0,0,0);for(i=t.first;i<=t.last;i++){var s=e.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,e.replace(r,n[i-t.first])}},this.toggleCommentLines=function(){var t=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(t,this.session,e.first,e.last)},this.toggleBlockComment=function(){var t=this.getCursorPosition(),e=this.session.getState(t.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,n,t)},this.getNumberAt=function(t,e){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(t);n.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(t){var e=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new p(e,n-1,e,n),r=this.session.getTextRange(i);if(!isNaN(parseFloat(r))&&isFinite(r)){var s=this.getNumberAt(e,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),l+=t*=o!==s.end&&n=a&&o<=l&&(n=e,c.selection.clearSelection(),c.moveCursorTo(t,a+i),c.selection.selectTo(t,l+i)),a=l});for(var h,u=this.$toggleWordPairs,d=0;dp+1)break;p=f.last}for(h--,a=this.session.$moveLines(d,p,e?0:t),e&&-1==t&&(u=h+1);u<=h;)o[u].moveBy(a,0),u++;e||(a=0),l+=a}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(t){this.renderer.showComposition(t)},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(t,e){var n=this.renderer,i=this.renderer.layerConfig,r=t*Math.floor(i.height/i.lineHeight);!0===e?this.selection.$moveSelection(function(){this.moveCursorBy(r,0)}):!1===e&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,r*i.lineHeight),null!=e&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(t,e,n,i){this.renderer.scrollToLine(t,e,n,i)},this.centerSelection=function(){var t=this.getSelectionRange(),e={row:Math.floor(t.start.row+(t.end.row-t.start.row)/2),column:Math.floor(t.start.column+(t.end.column-t.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(t,e){this.selection.moveCursorTo(t,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(t,e){var n=this.getCursorPosition(),i=new y(this.session,n.row,n.column),r=i.getCurrentToken(),s=r||i.stepForward();if(s){var o,a,l=!1,c={},h=n.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;h=0;--s)this.$tryReplace(n[s],t)&&i++;return this.selection.setSelectionRange(r),i},this.$tryReplace=function(t,e){var n=this.session.getTextRange(t);return null!==(e=this.$search.replace(n,e))?(t.end=this.session.replace(t,e),t):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(t,e,n){e||(e={}),"string"==typeof t||t instanceof RegExp?e.needle=t:"object"==typeof t&&i.mixin(e,t);var r=this.selection.getRange();null==e.needle&&((t=this.session.getTextRange(r)||this.$search.$options.needle)||(r=this.session.getWordRange(r.start.row,r.start.column),t=this.session.getTextRange(r)),this.$search.set({needle:t})),this.$search.set(e),e.start||this.$search.set({start:r});var s=this.$search.find(this.session);return e.preventScroll?s:s?(this.revealRange(s,n),s):(e.backwards?r.start=r.end:r.end=r.start,void this.selection.setRange(r))},this.findNext=function(t,e){this.find({skipCurrent:!0,backwards:!1},t,e)},this.findPrevious=function(t,e){this.find(t,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(t,e){this.session.unfold(t),this.selection.setSelectionRange(t);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(t.start,t.end,.5),!1!==e&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(t){t.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(t){if(t){var e,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var r=this.$scrollAnchor;r.style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild);var s=this.on("changeSelection",function(){i=!0}),o=this.renderer.on("beforeRender",function(){i&&(e=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(i&&e&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var t=n.renderer,s=t.$cursorLayer.$pixelPos,o=t.layerConfig,a=s.top-o.offset;null!=(i=s.top>=0&&a+e.top<0||!(s.topwindow.innerHeight)&&null)&&(r.style.top=a+"px",r.style.left=s.left+"px",r.style.height=o.lineHeight+"px",r.scrollIntoView(i)),i=e=null}});this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var t=this.$cursorStyle||"ace",e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(t)),e.isBlinking=!this.$readOnly&&"wide"!=t,r.setCssClass(e.element,"ace_slim-cursors",/slim/.test(t)))},this.prompt=function(t,e,n){var i=this;v.loadModule("./ext/prompt",function(r){r.prompt(i,t,e,n)})}}).call(w.prototype),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:t})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(t){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(t){this.textInput.setReadOnly(t),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(t){this.textInput.setCopyWithEmptySelection(t)},initialValue:!1},cursorStyle:{set:function(t){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(t){this.session.setValue(t)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(t){this.setSession(t)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(t){this.renderer.$gutterLayer.setShowLineNumbers(t),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),t&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(t){this.$showLineNumbers&&t?x.attach(this):x.detach(this)}},placeholder:{set:function(t){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var t=this.session&&(this.renderer.$composition||this.getValue());if(t&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(t||this.renderer.placeholderNode)!t&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var e=r.createElement("div");e.className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode)}}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var x={getText:function(t,e){return(Math.abs(t.selection.lead.row-e)||e+1+(e<9?"\xb7":""))+""},getWidth:function(t,e,n){return Math.max(e.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(t,e){e.renderer.$loop.schedule(e.renderer.CHANGE_GUTTER)},attach:function(t){t.renderer.$gutterLayer.$renderer=this,t.on("changeSelection",this.update),this.update(null,t)},detach:function(t){t.renderer.$gutterLayer.$renderer==this&&(t.renderer.$gutterLayer.$renderer=null),t.off("changeSelection",this.update),this.update(null,t)}};e.Editor=w}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(t){this.$session=t},this.add=function(t,e,n){this.$fromUndo||t!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==e&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),t.id=this.$rev=++this.$maxRev),"remove"!=t.action&&"insert"!=t.action||(this.$lastDelta=t),this.lastDeltas.push(t))},this.addSelection=function(t,e){this.selections.push({value:t,rev:e||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(t,e){null==e&&(e=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=t)break;r.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(t){null==t&&(t=this.$rev),this.mark=t},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(t){return t?a(t):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var r=t("./range").Range,s=r.comparePoints;function o(t){return{row:t.row,column:t.column}}function a(t){if(t=t||this,Array.isArray(t))return t.map(a).join("\n");var e="";return t.action?(e="insert"==t.action?"+":"-",e+="["+t.lines+"]"):t.value&&(e=Array.isArray(t.value)?t.value.map(l).join("\n"):l(t.value)),t.start&&(e+=l(t)),(t.id||t.rev)&&(e+="\t("+(t.id||t.rev)+")"),e}function l(t){return t.start.row+":"+t.start.column+"=>"+t.end.row+":"+t.end.column}function c(t,e){var n="insert"==t.action,i="insert"==e.action;if(n&&i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}else if(!n&&i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(!n&&!i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}return[e,t]}function h(t,e){for(var n=t.length;n--;)for(var i=0;i=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,r.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&i)s(e.start,t.end)>=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,r.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{var o,a;if(!(s(e.end,t.start)<=0))return s(t.start,e.start)<0&&(o=t,t=f(t,e.start)),s(t.end,e.end)>0&&(a=f(t,e.end)),p(e.end,t.start,t.end,-1),a&&!o&&(t.lines=a.lines,t.start=a.start,t.end=a.end,a=t),[e,o,a].filter(Boolean);d(t,e,-1)}return[e,t]}function d(t,e,n){p(t.start,e.start,e.end,n),p(t.end,e.start,e.end,n)}function p(t,e,n,i){t.row==(1==i?e:n).row&&(t.column+=i*(n.column-e.column)),t.row+=i*(n.row-e.row)}function f(t,e){var n=t.lines,i=t.end;t.end=o(e);var r=t.end.row-t.start.row,s=n.splice(r,n.length),a=r?e.column:e.column-t.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(e),end:i,lines:s,action:t.action}}function g(t,e){e=function(t){return{start:o(t.start),end:o(t.end),action:t.action,lines:t.lines.slice()}}(e);for(var n=t.length;n--;){for(var i=t[n],r=0;rs&&(s=(r=e.getNextFoldLine(l=r.end.row+1,r))?r.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,t,this.session,c),this.$lines.push(o)),this.$renderCell(o,t,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(t)},this.$updateGutterWidth=function(t){var e=this.session,n=e.gutterRenderer||this.$renderer,i=e.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||e.$useWrapMode)&&(r=e.getLength()+i-1);var s=n?n.getWidth(e,r,t):r.toString().length*t.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!this.$cursorCell||this.$cursorCell.row!=t){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var e=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&r&&r.start.row==e[n-1].row))break;i=e[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(t){var e=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(e,t))return this.update(t);this.$lines.moveContainer(t);var n=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!e||i0;r--)this.$lines.shift();if(i>n)for(r=this.session.getFoldedRowCount(n+1,i);r>0;r--)this.$lines.pop();t.firstRowi&&this.$lines.push(this.$renderLines(t,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t)},this.$renderLines=function(t,e,n){for(var i=[],r=e,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;r>o&&(o=(s=this.session.getNextFoldLine(r=s.end.row+1,s))?s.start.row:1/0),!(r>n);){var a=this.$lines.createCell(r,t,this.session,c);this.$renderCell(a,t,s,r),i.push(a),r++}return i},this.$renderCell=function(t,e,n,r){var s=t.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],c=o.$firstLineNumber,h=o.$breakpoints,u=o.$decorations,d=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,f=n?n.start.row:Number.MAX_VALUE,g="ace_gutter-cell ";if(this.$highlightGutterLine&&(r==this.$cursorRow||n&&r=f&&this.$cursorRow<=n.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),h[r]&&(g+=h[r]),u[r]&&(g+=u[r]),this.$annotations[r]&&(g+=this.$annotations[r].className),s.className!=g&&(s.className=g),p){var m=p[r];null==m&&(m=p[r]=o.getFoldWidget(r))}m?(g="ace_fold-widget ace_"+m,l.className!=(g+="start"==m&&r==f&&rn.right-e.right?"foldWidgets":void 0}}).call(l.prototype),e.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../range").Range,r=t("../lib/dom"),s=function(t){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",t.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.elt=function(t,e){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=e,n.className=t},this.update=function(t){if(t){var e;for(var n in this.config=t,this.i=0,this.markers){var i=this.markers[n];if(i.range){var r=i.range.clipRows(t.firstRow,t.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),i.renderer){var s=this.$getTop(r.start.row,t);i.renderer(e,r,this.$padding+r.start.column*t.characterWidth,s,t)}else"fullLine"==i.type?this.drawFullLineMarker(e,r,i.clazz,t):"screenLine"==i.type?this.drawScreenLineMarker(e,r,i.clazz,t):r.isMultiLine()?"text"==i.type?this.drawTextMarker(e,r,i.clazz,t):this.drawMultiLineMarker(e,r,i.clazz,t):this.drawSingleLineMarker(e,r,i.clazz+" ace_start ace_br15",t)}else i.update(e,this,this.session,t)}if(-1!=this.i)for(;this.id?4:0)|(c==l?8:0)),r,c==l?0:1,s)},this.drawMultiLineMarker=function(t,e,n,i,r){var s,o=this.$padding,a=i.lineHeight,l=this.$getTop(e.start.row,i),c=o+e.start.column*i.characterWidth;if(r=r||"",this.session.$bidiHandler.isBidiRow(e.start.row)?((s=e.clone()).end.row=s.start.row,s.end.column=this.session.getLine(s.start.row).length,this.drawBidiSingleLineMarker(t,s,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(e.end.row)?((s=e.clone()).start.row=s.end.row,s.start.column=0,this.drawBidiSingleLineMarker(t,s,n+" ace_br12",i,null,r)):(l=this.$getTop(e.end.row,i),this.elt(n+" ace_br12","height:"+a+"px;width:"+e.end.column*i.characterWidth+"px;top:"+l+"px;left:"+o+"px;"+(r||""))),!((a=(e.end.row-e.start.row-1)*i.lineHeight)<=0)){l=this.$getTop(e.start.row+1,i);var h=(e.start.column?1:0)|(e.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+o+"px;"+(r||""))}},this.drawSingleLineMarker=function(t,e,n,i,r,s){if(this.session.$bidiHandler.isBidiRow(e.start.row))return this.drawBidiSingleLineMarker(t,e,n,i,r,s);var o=i.lineHeight,a=(e.end.column+(r||0)-e.start.column)*i.characterWidth,l=this.$getTop(e.start.row,i);this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+(this.$padding+e.start.column*i.characterWidth)+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(t,e,n,i,r,s){var o=i.lineHeight,a=this.$getTop(e.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(e.start.column,e.end.column).forEach(function(t){this.elt(n,"height:"+o+"px;width:"+t.width+(r||0)+"px;top:"+a+"px;left:"+(l+t.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i),o=i.lineHeight;e.start.row!=e.end.row&&(o+=this.$getTop(e.end.row,i)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i);this.elt(n,"height:"+i.lineHeight+"px;top:"+s+"px;left:0;right:0;"+(r||""))}}).call(s.prototype),e.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("./lines").Lines,a=t("../lib/event_emitter").EventEmitter,l=function(t){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){i.implement(this,a),this.EOF_CHAR="\xb6",this.EOL_CHAR_LF="\xac",this.EOL_CHAR_CRLF="\xa4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\xb7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var t=this.session.doc,e="\n"==t.getNewLineCharacter()&&"windows"!=t.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(t){this.$padding=t,this.element.style.margin="0 "+t+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on("changeCharacterSize",(function(t){this._signal("changeCharacterSize",t)}).bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,"string"==typeof t?(this.showSpaces=/tab/i.test(t),this.showTabs=/space/i.test(t),this.showEOL=/eol/i.test(t)):this.showSpaces=this.showTabs=this.showEOL=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var t=this.session.getTabSize();this.tabSize=t;for(var e=this.$tabStrings=[0],n=1;nh&&(h=(l=this.session.getNextFoldLine(a=l.end.row+1,l))?l.start.row:1/0),!(a>r);){var u=s[o++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==h&&l),c&&(u.style.top=this.$lines.computeLineTop(a,t,this.session)+"px");var d=t.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(c=!0,u.style.height=d)}a++}if(c)for(;o0;i--)this.$lines.shift();if(e.lastRow>t.lastRow)for(i=this.session.getFoldedRowCount(t.lastRow+1,e.lastRow);i>0;i--)this.$lines.pop();t.firstRowe.lastRow&&this.$lines.push(this.$renderLinesFragment(t,e.lastRow+1,t.lastRow))},this.$renderLinesFragment=function(t,e,n){for(var i=[],s=e,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(a=(o=this.session.getNextFoldLine(s=o.end.row+1,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,t,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(s,t,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(s,t,this.session)+"px"),this.$renderLine(c,s,s==a&&o),c.className=this.$useLineGroups()?"ace_line_group":"ace_line",i.push(l),s++}return i},this.update=function(t){this.$lines.moveContainer(t),this.config=t;for(var e=t.firstRow,n=t.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(t,e,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(t,e,n,i){for(var r,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),c=0;r=a.exec(i);){var h=r[1],u=r[2],d=r[3],p=r[4],f=r[5];if(o.showSpaces||!u){var g=c!=r.index?i.slice(c,r.index):"";if(c=r.index+r[0].length,g&&l.appendChild(this.dom.createTextNode(g,this.element)),h){var m=o.session.getScreenTabSize(e+r.index);l.appendChild(o.$tabStrings[m].cloneNode(!0)),e+=m-1}else u?o.showSpaces?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=s.stringRepeat(o.SPACE_CHAR,u.length),l.appendChild(y)):l.appendChild(this.com.createTextNode(u,this.element)):d?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(y)):p?(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className=o.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=o.showSpaces?o.SPACE_CHAR:p,l.appendChild(y)):f&&(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className="ace_cjk",y.textContent=f,l.appendChild(y))}}if(l.appendChild(this.dom.createTextNode(c?i.slice(c):i,this.element)),this.$textToken[n.type])t.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==n.type&&(y.style.width=n.value.length*this.config.characterWidth+"px"),y.className=v,y.appendChild(l),t.appendChild(y)}return e+i.length},this.renderIndentGuide=function(t,e,n){var i=e.search(this.$indentGuideRe);if(i<=0||i>=n)return e;if(" "==e[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,h,u.substring(0,o-i)),u=u.substring(o-i),i=o,l=this.$createLineElement(),t.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat("\xa0",n.indent),this.element)),a=0,o=n[++r]||Number.MAX_VALUE;0!=u.length&&(i+=u.length,a=this.$renderToken(l,a,h,u))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(t,e){var n=0,i=e[0],r=i.value;this.displayIndentGuides&&(r=this.renderIndentGuide(t,r)),r&&(n=this.$renderToken(t,n,i,r));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(t,n,i,r);n=this.$renderToken(t,n,i,r)}},this.$renderOverflowMessage=function(t,e,n,i,r){n&&this.$renderToken(t,e,n,i.slice(0,this.MAX_LINE_LENGTH-e));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=r?"":"",t.appendChild(s)},this.$renderLine=function(t,e,n){if(n||0==n||(n=this.session.getFoldLine(e)),n)var i=this.$getFoldLineTokens(e,n);else i=this.session.getTokens(e);var r=t;if(i.length){var s=this.session.getRowSplitData(e);s&&s.length?(this.$renderWrappedLine(t,i,s),r=t.lastChild):(r=t,this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r)),this.$renderSimpleLine(r,i))}else this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r));if(this.showEOL&&r){n&&(e=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o)}},this.$getFoldLineTokens=function(t,e){var n=this.session,i=[],r=n.getTokens(t);return e.walk(function(t,e,s,o,a){null!=t?i.push({type:"fold",value:t}):(a&&(r=n.getTokens(e)),r.length&&function(t,e,n){for(var r=0,s=0;s+t[r].value.lengthn-e&&(o=o.substring(0,n-e)),i.push({type:t[r].type,value:o}),s=e+o.length,r+=1);sn?{type:t[r].type,value:o.substring(0,n-s)}:t[r]),s+=o.length,r+=1}}(r,o,s))},e.end.row,this.session.getLine(e.end.row).length),i},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),e.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=function(t){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",t.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(t){for(var e=this.cursors,n=e.length;n--;)i.setStyle(e[n].style,"opacity",t?"":"0")},this.$startCssAnimation=function(){for(var t=this.cursors,e=t.length;e--;)t[e].style.animationDuration=this.blinkInterval+"ms";setTimeout((function(){i.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},this.$stopCssAnimation=function(){i.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t!=this.smoothBlinking&&(this.smoothBlinking=t,i.setCssClass(this.element,"ace_smooth-blinking",t),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var t=i.createElement("div");return t.className="ace_cursor",this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(this.cursors.length>1){var t=this.cursors.pop();return t.parentNode.removeChild(t),t}},this.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var t=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&i.removeCssClass(this.element,"ace_smooth-blinking"),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout((function(){i.addCssClass(this.element,"ace_smooth-blinking")}).bind(this)),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var e=(function(){this.timeoutId=setTimeout(function(){t(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){t(!0),e()},this.blinkInterval),e()}else this.$stopCssAnimation()},this.getPixelPosition=function(t,e){if(!this.config||!this.session)return{left:0,top:0};t||(t=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(t);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,t.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(e?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(t,e){return t.top>=0&&t.topt.height+t.offset||o.top<0)&&n>1)){var a=this.cursors[r++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,t,e[n],this.session):this.isCursorInView(o,t)?(i.setStyle(l,"display","block"),i.translate(a,o.left,o.top),i.setStyle(l,"width",Math.round(t.characterWidth)+"px"),i.setStyle(l,"height",t.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),e.Cursor=r}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./lib/event"),o=t("./lib/event_emitter").EventEmitter,a=32768,l=function(t){this.element=r.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=r.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xa0",this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){i.implement(this,o),this.setVisible=function(t){this.element.style.display=t?"":"none",this.isVisible=t,this.coeff=1}}).call(l.prototype);var c=function(t,e){l.call(this,t),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=r.scrollbarWidth(t.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(c,l),(function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+"px"},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,t>a?(this.coeff=a/t,t=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=t+"px"},this.setScrollTop=function(t){this.scrollTop!=t&&(this.skipEvent=!0,this.scrollTop=t,this.element.scrollTop=t*this.coeff)}}).call(c.prototype);var h=function(t,e){l.call(this,t),this.scrollLeft=0,this.height=e.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(h,l),(function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(t){this.element.style.width=t+"px"},this.setInnerWidth=function(t){this.inner.style.width=t+"px"},this.setScrollWidth=function(t){this.inner.style.width=t+"px"},this.setScrollLeft=function(t){this.scrollLeft!=t&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=t)}}).call(h.prototype),e.ScrollBar=c,e.ScrollBarV=c,e.ScrollBarH=h,e.VScrollBar=c,e.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,e,n){"use strict";var i=t("./lib/event"),r=function(t,e){this.onRender=t,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=e||window;var n=this;this._flush=function(t){n.pending=!1;var e=n.changes;if(e&&(i.blockIdle(100),n.changes=0,n.onRender(e)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(t){this.changes=this.changes|t,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(t){var e=this.changes;return this.changes=0,e}}).call(r.prototype),e.RenderLoop=r}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,e,n){var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("../lib/event"),a=t("../lib/useragent"),l=t("../lib/event_emitter").EventEmitter,c=256,h="function"==typeof ResizeObserver,u=200,d=e.FontMetrics=function(t){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),t.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",c),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(t,e){t.width=t.height="auto",t.left=t.top="0px",t.visibility="hidden",t.position="absolute",t.whiteSpace="pre",a.isIE<8?t["font-family"]="inherit":t.font="inherit",t.overflow=e?"hidden":"visible"},this.checkForSizeChanges=function(t){if(void 0===t&&(t=this.$measureSizes()),t&&(this.$characterSize.width!==t.width||this.$characterSize.height!==t.height)){this.$measureNode.style.fontWeight="bold";var e=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=t,this.charSizes=Object.create(null),this.allowBoldFonts=e&&e.width===t.width&&e.height===t.height,this._emit("changeCharacterSize",{data:t})}},this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver(function(e){t.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(t){var e={height:(t||this.$measureNode).clientHeight,width:(t||this.$measureNode).clientWidth/c};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.textContent=s.stringRepeat(t,c),this.$main.getBoundingClientRect().width/c},this.getCharacterWidth=function(t){var e=this.charSizes[t];return void 0===e&&(e=this.charSizes[t]=this.$measureCharWidth(t)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function t(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*t(e.parentElement):1},this.$initTransformMeasureNodes=function(){var t=function(t,e){return["div",{style:"position: absolute;top:"+t+"px;left:"+e+"px;"}]};this.els=r.buildDom([t(0,0),t(u,0),t(0,u),t(u,u)],this.el)},this.transformCoordinates=function(t,e){function n(t,e,n){var i=t[1]*e[0]-t[0]*e[1];return[(-e[1]*n[0]+e[0]*n[1])/i,(+t[1]*n[0]-t[0]*n[1])/i]}function i(t,e){return[t[0]-e[0],t[1]-e[1]]}function r(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t*e[0],t*e[1]]}function o(t){var e=t.getBoundingClientRect();return[e.left,e.top]}t&&(t=s(1/this.$getZoom(this.el),t)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),c=o(this.els[2]),h=o(this.els[3]),d=n(i(h,l),i(h,c),i(r(l,c),r(h,a))),p=s(1+d[0],i(l,a)),f=s(1+d[1],i(c,a));if(e){var g=e,m=d[0]*g[0]/u+d[1]*g[1]/u+1,v=r(s(g[0],p),s(g[1],f));return r(s(1/m/u,v),a)}var y=i(t,a),b=n(i(p,s(d[0],y)),i(f,s(d[1],y)),y);return s(u,b)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./config"),o=t("./layer/gutter").Gutter,a=t("./layer/marker").Marker,l=t("./layer/text").Text,c=t("./layer/cursor").Cursor,h=t("./scrollbar").HScrollBar,u=t("./scrollbar").VScrollBar,d=t("./renderloop").RenderLoop,p=t("./layer/font_metrics").FontMetrics,f=t("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=t("./lib/useragent"),v=m.isIE;r.importCssString(g,"ace_editor.css");var y=function(t,e){var n=this;this.container=t||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(e),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var i=this.$textLayer=new l(this.content);this.canvas=i.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollTop(t.data-n.scrollMargin.top)}),this.scrollBarH.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollLeft(t.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(t){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",t)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&t.getScrollTop()<=0&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(t,e,n){if(void 0===e&&(e=1/0),this.$changedLines?(this.$changedLines.firstRow>t&&(this.$changedLines.firstRow=t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(t,e,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=t?1:0;var r=this.container;i||(i=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var s=this.$updateCachedSize(t,e,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;t&&(this.$gutterLayer.$padding=null),t?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(t,e,n,i){var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if((i-=this.$extraHeight||0)&&(t||o.height!=i)&&(o.height=i,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(t||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==e&&(e=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=e,r.setStyle(this.scrollBarH.element.style,"left",e+"px"),r.setStyle(this.scroller.style,"left",e+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-e-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l),r.setStyle(this.scroller.style,"right",l),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||t)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!i,s&&this._signal("resize",a),s},this.onGutterResize=function(t){var e=this.$showGutter?t:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var t=Math.floor((this.$size.scrollerWidth-2*this.$padding)/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(t){this.setOption("animatedScroll",t)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(t){this.setOption("showInvisibles",t),this.session.$bidiHandler.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(t){this.setOption("displayIndentGuides",t)},this.setShowPrintMargin=function(t){this.setOption("showPrintMargin",t)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(t){this.setOption("printMarginColumn",t)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(t){return this.setOption("showGutter",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var t=r.createElement("div");t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",t.appendChild(this.$printMarginEl),this.content.insertBefore(t,this.content.firstChild)}var e=this.$printMarginEl.style;e.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var t=this.textarea.style,e=this.$composition;if(this.$keepTextAreaAtCursor||e){var n=this.$cursorLayer.$pixelPos;if(n){e&&e.markerRange&&(n=this.$cursorLayer.getPixelPosition(e.markerRange.start,!0));var i=this.layerConfig,s=n.top,o=n.left,a=e&&e.useTextareaForIME?this.lineHeight:v?0:1;if((s-=i.offset)<0||s>i.height-a)r.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;e?e.useTextareaForIME?l=this.characterWidth*this.session.$getStringScreenWidth(this.textarea.value)[0]:s+=this.lineHeight+2:s+=this.lineHeight,(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,r.setStyle(t,"height",a+"px"),r.setStyle(t,"width",l+"px"),r.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,c))}}}else r.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var t=this.layerConfig,e=t.lastRow;return this.session.documentToScreenRow(e,0)*t.lineHeight-this.session.getScrollTop()>t.height-t.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(t,e,n,i){var r=this.scrollMargin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(t,e,n,i){var r=this.margin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption("hScrollBarAlwaysVisible",t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption("vScrollBarAlwaysVisible",t)},this.$updateScrollBarV=function(){var t=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&this.scrollTop>(t-=(e-this.lineHeight)*this.$scrollPastEnd)-e&&(t=this.scrollTop+e,this.scrollBarV.scrollTop=null),this.scrollBarV.setScrollHeight(t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(t,e){if(this.$changes&&(t|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(t||e)){if(this.$size.$dirty)return this.$changes|=t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(t&this.CHANGE_FULL||t&this.CHANGE_SIZE||t&this.CHANGE_TEXT||t&this.CHANGE_LINES||t&this.CHANGE_SCROLL||t&this.CHANGE_H_SCROLL){if(t|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;i>0&&(this.scrollTop=i,t|=this.CHANGE_SCROLL,t|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-n.offset);var s=n.minHeight+"px";r.setStyle(this.content.style,"width",n.width+2*this.$padding+"px"),r.setStyle(this.content.style,"height",s)}if(t&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),t&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);if(t&this.CHANGE_SCROLL)return this.$changedLines=null,t&this.CHANGE_TEXT||t&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(t&this.CHANGE_GUTTER||t&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):t&this.CHANGE_LINES?(this.$updateLines()||t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):t&this.CHANGE_TEXT||t&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):t&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",t)}else this.$changes|=t},this.$autosize=function(){var t=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,n=Math.min(e,Math.max((this.$minLines||1)*this.lineHeight,t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&t>e;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var t=this.session,e=this.$size,n=e.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||e.scrollerWidth-r-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=e.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(e.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var h=this.scrollMargin;this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,i-e.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,r+2*this.$padding-e.scrollerWidth+h.right)));var u=!n&&(this.$vScrollBarAlwaysVisible||e.scrollerHeight-i+c<0||this.scrollTop>h.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var p,f,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),y=v+m,b=this.lineHeight;v=t.screenToDocumentRow(v,0);var w=t.getFoldLine(v);w&&(v=w.start.row),p=t.documentToScreenRow(v,0),f=t.getRowLength(v)*b,y=Math.min(t.screenToDocumentRow(y,0),t.getLength()-1),l=e.scrollerHeight+t.getRowLength(y)*b+f,g=this.scrollTop-p*b;var x=0;return(this.layerConfig.width!=r||o)&&(x=this.CHANGE_H_SCROLL),(o||d)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal("scrollbarVisibilityChanged"),d&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:v,firstRowScreen:p,lastRow:y,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:g,gutterOffset:b?Math.max(0,Math.ceil((g+e.height-e.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),x},this.$updateLines=function(){if(this.$changedLines){var t=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(t>n.lastRow+1||ethis.$textLayer.MAX_LINE_LENGTH&&(t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(t*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(t,e){this.$gutterLayer.addGutterDecoration(t,e)},this.removeGutterDecoration=function(t,e){this.$gutterLayer.removeGutterDecoration(t,e)},this.updateBreakpoints=function(t){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(t){this.$gutterLayer.setAnnotations(t),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(t,e,n){this.scrollCursorIntoView(t,n),this.scrollCursorIntoView(e,n)},this.scrollCursorIntoView=function(t,e,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(t),r=i.left,s=i.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(e&&l+o>s+this.lineHeight&&(s-=e*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ar?(r=1-this.scrollMargin.top||e>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=Math.floor((e+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:r}},this.screenToTextCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((e+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),r)},this.textToScreenCoordinates=function(t,e){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(t,e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,t)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth));return{pageX:n.left+r-this.scrollLeft,pageY:n.top+i.row*this.lineHeight-this.scrollTop}},this.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},this.showComposition=function(t){this.$composition=t,t.cssText||(t.cssText=this.textarea.style.cssText),null==t.useTextareaForIME&&(t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):t.markerId=this.session.addMarker(t.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(t){var e=this.session.selection.cursor;this.addToken(t,"composition_placeholder",e.row,e.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var t=this.session.selection.cursor;this.removeExtraToken(t.row,t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(t,e,n,i){var r=this.session;r.bgTokenizer.lines[n]=null;var s={type:e,value:t},o=r.getTokens(n);if(null==i)o.push(s);else for(var a=0,l=0;l50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(l.prototype),e.UIWorkerClient=function(t,e,n){var i=null,r=!1,a=Object.create(s),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(t){c.push(t),i&&(r?setTimeout(u):u())}});h.setEmitSync=function(t){r=t};var u=function(){var t=c.shift();t.command?i[t.command].apply(i,t.args):t.event&&a._signal(t.event,t.data)};return a.postMessage=function(t){h.onMessage({data:t})},a.callback=function(t,e){this.postMessage({type:"call",id:e,data:t})},a.emit=function(t,e){this.postMessage({type:"event",name:t,data:e})},o.loadModule(["worker",e],function(t){for(i=new t[n](a);c.length;)u()}),h},e.WorkerClient=l,e.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./range").Range,r=t("./lib/event_emitter").EventEmitter,s=t("./lib/oop"),o=function(t,e,n,i,r,s){var o=this;this.length=e,this.session=t,this.doc=t.getDocument(),this.mainClass=r,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=t.getUndoManager().$undoStack||t.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),t.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,r),this.setup=function(){var t=this,e=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new i(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var i=e.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),t.others.push(i)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,e=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),e.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,s=e.start.column-this.pos.column;if(this.updateAnchors(t),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===t.action)for(var o=this.others.length-1;o>=0;o--)this.doc.insertMergedLines(l={row:(a=this.others[o]).row,column:a.column+s},t.lines);else if("remove"===t.action)for(o=this.others.length-1;o>=0;o--){var a,l;this.doc.remove(new i((l={row:(a=this.others[o]).row,column:a.column+s}).row,l.column,l.row,l.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(t){this.pos.onChange(t);for(var e=this.others.length;e--;)this.others[e].onChange(t);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var t=this,e=this.session,n=function(n,r){e.removeMarker(n.markerId),n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},this.onCursorChange=function(t){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",t)):(this.hideOtherMarkers(),this._emit("cursorLeave",t))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var t=this.session.getUndoManager(),e=(t.$undoStack||t.$undostack).length-this.$undoStackDepth,n=0;n1?t.multiSelect.joinSelections():t.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(t){t.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(t){t.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(t){t.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(t){t.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(t){return t&&t.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new i(e.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,e,n){var i=t("./range_list").RangeList,r=t("./range").Range,s=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,a=t("./lib/event"),l=t("./lib/lang"),c=t("./commands/multi_select_commands");e.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(0,t("./search").Search),u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(t,e){if(t){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(t),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),e||this.fromOrientedRange(t);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}t.cursor||(t.cursor=t.end);var i=this.rangeList.add(t);return this.$onAddRange(t),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),e||this.fromOrientedRange(t)}},this.toSingleRange=function(t){t=t||this.ranges[0];var e=this.rangeList.removeAll();e.length&&this.$onRemoveRange(e),t&&this.fromOrientedRange(t)},this.substractPoint=function(t){var e=this.rangeList.substractPoint(t);if(e)return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var t=this.rangeList.merge();t.length&&this.$onRemoveRange(t)},this.$onAddRange=function(t){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(t),this._signal("addRange",{range:t})},this.$onRemoveRange=function(t){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var e=this.rangeList.ranges.pop();t.push(e),this.rangeCount=0}for(var n=t.length;n--;){var i=this.ranges.indexOf(t[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:t}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(e=e||this.ranges[0])&&!e.isEqual(this.getRange())&&this.fromOrientedRange(e)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var t=this.ranges.length?this.ranges:[this.getRange()],e=[],n=0;n1){var t=this.rangeList.ranges,e=t[t.length-1],n=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(n,e.cursor==e.start)}else{var i=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(t,e,n){var i=[],s=t.column0;)y--;if(y>0)for(var b=0;i[b].isEmpty();)b++;for(var w=y;w>=b;w--)i[w].isEmpty()&&i.splice(w,1)}return i}}).call(s.prototype);var d=t("./editor").Editor;function p(t){t.$multiselectOnSessionChange||(t.$onAddRange=t.$onAddRange.bind(t),t.$onRemoveRange=t.$onRemoveRange.bind(t),t.$onMultiSelect=t.$onMultiSelect.bind(t),t.$onSingleSelect=t.$onSingleSelect.bind(t),t.$multiselectOnSessionChange=e.onSessionChange.bind(t),t.$checkMultiselectChange=t.$checkMultiselectChange.bind(t),t.$multiselectOnSessionChange(t),t.on("changeSession",t.$multiselectOnSessionChange),t.on("mousedown",o),t.commands.addCommands(c.defaultCommands),function(t){if(t.textInput){var e=t.textInput.getElement(),n=!1;a.addListener(e,"keydown",function(e){t.$blockSelectEnabled&&18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey)?n||(t.renderer.setMouseCursor("crosshair"),n=!0):n&&i()},t),a.addListener(e,"keyup",i,t),a.addListener(e,"blur",i,t)}function i(e){n&&(t.renderer.setMouseCursor(""),n=!1)}}(t))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(t){t.cursor||(t.cursor=t.end);var e=this.getSelectionStyle();return t.marker=this.session.addMarker(t,"ace_selection",e),this.session.$selectionMarkers.push(t),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,t},this.removeSelectionMarker=function(t){if(t.marker){this.session.removeMarker(t.marker);var e=this.session.$selectionMarkers.indexOf(t);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(t){for(var e=this.session.$selectionMarkers,n=t.length;n--;){var i=t[n];if(i.marker){this.session.removeMarker(i.marker);var r=e.indexOf(i);-1!=r&&e.splice(r,1)}}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(t){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(t){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(t){var e=t.command,n=t.editor;if(n.multiSelect){if(e.multiSelectAction)"forEach"==e.multiSelectAction?i=n.forEachSelection(e,t.args):"forEachLine"==e.multiSelectAction?i=n.forEachSelection(e,t.args,!0):"single"==e.multiSelectAction?(n.exitMultiSelectMode(),i=e.exec(n,t.args||{})):i=e.multiSelectAction(n,t.args||{});else{var i=e.exec(n,t.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(t,e,n){if(!this.inVirtualSelectionMode){var i,r=1==n||n&&n.$byLines,o=this.session,a=this.selection,l=(n&&n.keepOrder?a:a.rangeList).ranges;if(!l.length)return t.exec?t.exec(this,e||{}):t(this,e||{});var c=a._eventRegistry;a._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var u=l.length;u--;){if(r)for(;u>0&&l[u].start.row==l[u-1].end.row;)u--;h.fromOrientedRange(l[u]),h.index=u,this.selection=o.selection=h;var d=t.exec?t.exec(this,e||{}):t(this,e||{});i||void 0===d||(i=d),h.toOrientedRange(l[u])}h.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=c,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var p=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),p&&p.from==p.to&&this.renderer.animateScrolling(p.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var t="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var e=this.multiSelect.rangeList.ranges,n=[],i=0;io&&(o=n.column),ih?t.insert(i,l.stringRepeat(" ",s-h)):t.remove(new r(i.row,i.column,i.row,i.column-s+h)),e.start.column=e.end.column=o,e.start.row=e.end.row=i.row,e.cursor=e.end}),e.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),u=h.start.row,d=h.end.row,p=u==d;if(p){var f,g=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d0);u<0&&(u=0),d>=g&&(d=g-1)}var m=this.session.removeFullLines(u,d);m=this.$reAlignText(m,p),this.session.insert({row:u,column:0},m.join("\n")+"\n"),p||(h.start.column=0,h.end.column=m[m.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(t,e){var n,i,r,s=!0,o=!0;return t.map(function(t){var e=t.match(/(\s*)(.*?)(\s*)([=:].*)/);return e?null==n?(n=e[1].length,i=e[2].length,r=e[3].length,e):(n+i+r!=e[1].length+e[2].length+e[3].length&&(o=!1),n!=e[1].length&&(s=!1),n>e[1].length&&(n=e[1].length),ie[3].length&&(r=e[3].length),e):[t]}).map(e?c:s?o?function(t){return t[2]?a(n+i-t[2].length)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}:c:function(t){return t[2]?a(n)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]});function a(t){return l.stringRepeat(" ",t)}function c(t){return t[2]?a(n)+t[2]+a(i-t[2].length+r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}}}).call(d.prototype),e.onSessionChange=function(t){var e=t.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var n=t.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),e&&(e.multiSelect.on("addRange",this.$onAddRange),e.multiSelect.on("removeRange",this.$onRemoveRange),e.multiSelect.on("multiSelect",this.$onMultiSelect),e.multiSelect.on("singleSelect",this.$onSingleSelect),e.multiSelect.lead.on("change",this.$checkMultiselectChange),e.multiSelect.anchor.on("change",this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},e.MultiSelect=p,t("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(t){p(this),t?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../../range").Range,r=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(t,e,n){var i=t.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==e&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(t,e,n){return null},this.indentationBlock=function(t,e,n){var r=/\S/,s=t.getLine(e),o=s.search(r);if(-1!=o){for(var a=n||s.length,l=t.getLength(),c=e,h=e;++ec){var p=t.getLine(h).length;return new i(c,a,h,p)}}},this.openingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r+1},a=t.$findClosingBracket(e,o,s);if(a){var l=t.foldWidgets[a.row];return null==l&&(l=t.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=t.getLine(a.row).length),i.fromPoints(o,a)}},this.closingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r},a=t.$findOpeningBracket(e,o);if(a)return a.column++,o.column--,i.fromPoints(a,o)}}).call(r.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";e.isDark=!1,e.cssClass="ace-tm",e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',e.$id="ace/theme/textmate",t("../lib/dom").importCssString(e.cssText,e.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./lib/dom");function r(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(t){var e;return e=this.lineWidgets&&this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0,this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1+e:1+e},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on("beforeRender",this.measureWidgets),t.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(t){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(t,e){var n=e.lineWidgets;if(n&&t.action){for(var i=t.data,r=i.start.row,s=i.end.row,o="add"==t.action,a=r+1;ae[n].column&&n++,s.unshift(n,0),e.splice.apply(e,s),this.$updateRows()}}},this.$updateRows=function(){var t=this.session.lineWidgets;if(t){var e=!0;t.forEach(function(t,n){if(t)for(e=!1,t.row=n;t.$oldWidget;)t.$oldWidget.row=n,t=t.$oldWidget}),e&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(t){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var e=this.session.lineWidgets[t.row];return e&&(t.$oldWidget=e,e.el&&e.el.parentNode&&(e.el.parentNode.removeChild(e.el),e._inDocument=!1)),this.session.lineWidgets[t.row]=t,t},this.addLineWidget=function(t){if(this.$registerLineWidget(t),t.session=this.session,!this.editor)return t;var e=this.editor.renderer;t.html&&!t.el&&(t.el=i.createElement("div"),t.el.innerHTML=t.html),t.el&&(i.addCssClass(t.el,"ace_lineWidgetContainer"),t.el.style.position="absolute",t.el.style.zIndex=5,e.container.appendChild(t.el),t._inDocument=!0,t.coverGutter||(t.el.style.zIndex=3),null==t.pixelHeight&&(t.pixelHeight=t.el.offsetHeight)),null==t.rowCount&&(t.rowCount=t.pixelHeight/e.layerConfig.lineHeight);var n=this.session.getFoldAt(t.row,0);if(t.$fold=n,n){var r=this.session.lineWidgets;t.row!=n.end.row||r[n.start.row]?t.hidden=!0:r[n.start.row]=t}return this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows(),this.renderWidgets(null,e),this.onWidgetChanged(t),t},this.removeLineWidget=function(t){if(t._inDocument=!1,t.session=null,t.el&&t.el.parentNode&&t.el.parentNode.removeChild(t.el),t.editor&&t.editor.destroy)try{t.editor.destroy()}catch(n){}if(this.session.lineWidgets){var e=this.session.lineWidgets[t.row];if(e==t)this.session.lineWidgets[t.row]=t.$oldWidget,t.$oldWidget&&this.onWidgetChanged(t.$oldWidget);else for(;e;){if(e.$oldWidget==t){e.$oldWidget=t.$oldWidget;break}e=e.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(t){for(var e=this.session.lineWidgets,n=e&&e[t],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(t){this.session._changedWidgets.push(t),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(t,e){var n=this.session._changedWidgets,i=e.layerConfig;if(n&&n.length){for(var r=1/0,s=0;s0&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,e.$cursorLayer.config=n;for(var o=r;o<=s;o++){var a=i[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,e.container.appendChild(a.el));var l=e.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:e.gutterWidth;a.fixedWidth||(c-=e.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.el.style.right=a.fixedWidth?e.scrollBar.getWidth()+"px":""}}}}}).call(r.prototype),e.LineWidgets=r}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(t,e,n){"use strict";var i=t("../line_widgets").LineWidgets,r=t("../lib/dom"),s=t("../range").Range;e.showErrorMarker=function(t,e){var n=t.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(t));var o=t.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(t){return"errorMarker"==t.type})[0];l?l.destroy():a-=e;var c,h=function(t,e,n){var i=t.getAnnotations().sort(s.comparePoints);if(i.length){var r=function(t,e,n){for(var i=0,r=t.length-1;i<=r;){var s=i+r>>1,o=n(e,t[s]);if(o>0)i=s+1;else{if(!(o<0))return s;r=s-1}}return-(i+1)}(i,{row:e,column:-1},s.comparePoints);r<0&&(r=-r-1),r>=i.length?r=n>0?0:i.length-1:0===r&&n<0&&(r=i.length-1);var o=i[r];if(o&&n){if(o.row===e){do{o=i[r+=n]}while(o&&o.row===e);if(!o)return i.slice()}var a=[];e=o.row;do{a[n<0?"unshift":"push"](o),o=i[r+=n]}while(o&&o.row==e);return a.length&&a}}}(n,a,e);if(h){var u=h[0];o.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,o.row=u.row,c=t.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(o.row),t.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},p=d.el.appendChild(r.createElement("div")),f=d.el.appendChild(r.createElement("div"));f.className="error_widget_arrow "+c.className;var g=t.renderer.$cursorLayer.getPixelPosition(o).left;f.style.left=g+t.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",p.className="error_widget "+c.className,p.innerHTML=c.text.join("
"),p.appendChild(r.createElement("div"));var m=function(t,e,n){if(0===e&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(d),t.off("changeSelection",d.destroy),t.off("changeSession",d.destroy),t.off("mouseup",d.destroy),t.off("change",d.destroy))},t.keyBinding.addKeyboardHandler(m),t.on("changeSelection",d.destroy),t.on("changeSession",d.destroy),t.on("mouseup",d.destroy),t.on("change",d.destroy),t.session.widgetManager.addLineWidget(d),d.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(t,e,i){"use strict";t("./lib/fixoldbrowsers");var r=t("./lib/dom"),s=t("./lib/event"),o=t("./range").Range,a=t("./editor").Editor,l=t("./edit_session").EditSession,c=t("./undomanager").UndoManager,h=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),e.config=t("./config"),e.require=t,e.define=n("B9Yq"),e.edit=function(t,n){if("string"==typeof t){var i=t;if(!(t=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(t&&t.env&&t.env.editor instanceof a)return t.env.editor;var o="";if(t&&/input|textarea/i.test(t.tagName)){var l=t;o=l.value,t=r.createElement("pre"),l.parentNode.replaceChild(t,l)}else t&&(o=t.textContent,t.innerHTML="");var c=e.createEditSession(o),u=new a(new h(t),c,n),d={document:c,editor:u,onResize:u.resize.bind(u,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),u.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},e.createEditSession=function(t,e){var n=new l(t,e);return n.setUndoManager(new c),n},e.Range=o,e.Editor=a,e.EditSession=l,e.UndoManager=c,e.VirtualRenderer=h,e.version=e.config.version}),ace.require(["ace/ace"],function(e){for(var n in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(n)&&(window.ace[n]=e[n]);window.ace.default=window.ace,t&&(t.exports=window.ace)})}).call(this,n("YuTi")(t))},hyoZ:function(t,e,n){"use strict";var i=n("w+qe"),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=function(t,e){var n,o;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===r.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(o={},null!==(n=e.styleAliases||null)&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){o[String(e)]=t})}),o),-1===s.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},jO2K:function(t,e,n){"use strict";var i;try{i=n("tjlA").Buffer}catch(o){}var r=n("hyoZ"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,o=s;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,r=t.replace(/[\r\n=]/g,""),o=r.length,a=s,l=0,c=[];for(e=0;e>16&255),c.push(l>>8&255),c.push(255&l)),l=l<<6|a.indexOf(r.charAt(e));return 0==(n=o%4*6)?(c.push(l>>16&255),c.push(l>>8&255),c.push(255&l)):18===n?(c.push(l>>10&255),c.push(l>>2&255)):12===n&&c.push(l>>4&255),i?i.from?i.from(c):new i(c):c},predicate:function(t){return i&&i.isBuffer(t)},represent:function(t){var e,n,i="",r=0,o=t.length,a=s;for(e=0;e>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},"kVK+":function(t,e){e.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,h=-7,u=n?r-1:0,d=n?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,h=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},peYA:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},pzZA:function(t,e,n){"use strict";var i=n("hyoZ"),r=Object.prototype.hasOwnProperty;t.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(r.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},spQ0:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},tN50:function(t,e,n){"use strict";var i=n("Y2Yi");function r(t,e,n,i,r){this.name=t,this.buffer=e,this.position=n,this.line=i,this.column=r}r.prototype.getSnippet=function(t,e){var n,r,s,o,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",r=this.position;r>0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(this.position-(r-=1)>e/2-1){n=" ... ",r+=5;break}for(s="",o=this.position;oe/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(r,o),i.repeat(" ",t)+n+a+s+"\n"+i.repeat(" ",t+this.position-r+n.length)+"^"},r.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=r},tjlA:function(t,e,n){"use strict";var i=n("H7XF"),r=n("kVK+"),s=n("49sm");function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function v(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,i,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var h=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var u=!0,d=0;dr&&(i=r):i=r;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function E(t,e,n){return i.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+u<=n)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(i.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),i.push(h),r+=u}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);for(var n="",i=0;i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,i,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,r),h=t.slice(e,n),u=0;ur)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function D(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;rr)&&(n=r);for(var s="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,i,r,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,s=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function $(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,s=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function O(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,i,s){return s||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function N(t,e,n,i,s){return s||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[t+--e]*r;return i},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+r]=t/s&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):$(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):$(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}},vQl5:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},"w+qe":function(t,e,n){"use strict";function i(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}(i.prototype=Object.create(Error.prototype)).constructor=i,i.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=i},ydHo:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ");function s(t){return 48<=t&&t<=55}function o(t){return 48<=t&&t<=57}t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=t.length,r=0,a=!1;if(!i)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===i)return!0;if("b"===(e=t[++r])){for(r++;r=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},zUnb:function(t,e,n){"use strict";function i(t){return"function"==typeof t}n.r(e);let r=!1;const s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}};function o(t){setTimeout(()=>{throw t},0)}const a={closed:!0,next(t){},error(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;o(t)},complete(){}},l=(()=>Array.isArray||(t=>t&&"number"==typeof t.length))();function c(t){return null!==t&&"object"==typeof t}const h=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();let u=(()=>{class t{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:s,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(let t=0;tt.concat(e instanceof h?e.errors:e),[])}const p=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class f extends u{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!t){this.destination=a;break}if("object"==typeof t){t instanceof f?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,t,e,n)}}[p](){return this}static create(t,e,n){const i=new f(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class g extends f{constructor(t,e,n,r){let s;super(),this._parentSubscriber=t;let o=this;i(e)?s=e:e&&(s=e.next,n=e.error,r=e.complete,e!==a&&(o=Object.create(e),i(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=n,this._complete=r}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=s;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):o(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;o(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw n;o(n)}}__tryOrSetError(t,e,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(o(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const m=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function v(t){return t}let y=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof f)return t;if(t[p])return t[p]()}return t||e||n?new f(t,e,n):new f(a)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),s.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){s.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof f?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=b(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[m](){return this}pipe(...t){return 0===t.length?this:(0===(e=t).length?v:1===e.length?e[0]:function(t){return e.reduce((t,e)=>e(t),t)})(this);var e}toPromise(t){return new(t=b(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function b(t){if(t||(t=s.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const w=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class x extends u{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class _ extends f{constructor(t){super(t),this.destination=t}}let C=(()=>{class t extends y{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new _(this)}lift(t){const e=new S(this,this);return e.operator=t,e}next(t){if(this.closed)throw new w;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew S(t,e),t})();class S extends C{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):u.EMPTY}}function E(t){return t&&"function"==typeof t.schedule}function k(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new A(t,e))}}class A{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new D(t,this.project,this.thisArg))}}class D extends f{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const T=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function M(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const I=t=>{if(t&&"function"==typeof t[m])return i=t,t=>{const e=i[m]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(L(t))return T(t);if(M(t))return n=t,t=>(n.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,o),t);if(t&&"function"==typeof t[F])return e=t,t=>{const n=e[F]();for(;;){let e;try{e=n.next()}catch(i){return t.error(i),t}if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t};{const e=c(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var e,n,i};function $(t,e){return new y(n=>{const i=new u;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function O(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[m]}(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>{const r=t[m]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(M(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(L(t))return $(t,e);if(function(t){return t&&"function"==typeof t[F]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new y(n=>{const i=new u;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[F](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof y?t:new y(I(t))}class P extends f{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class N extends f{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function B(t,e){if(!e.closed)return t instanceof y?t.subscribe(e):I(t)(e)}function U(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(U((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new V(t,n)))}class V{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new H(t,this.project,this.concurrent))}}class H extends N{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function j(t=Number.POSITIVE_INFINITY){return U(v,t)}function z(t,e){return e?$(t,e):new y(T(t))}function W(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return E(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof y?t[0]:j(e)(z(t,n))}function G(){return function(t){return t.lift(new q(t))}}class q{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new K(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class K extends f{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,!i||n&&i!==n||i.unsubscribe()}}class X extends y{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new u,t.add(this.source.subscribe(new J(this.getSubject(),this))),t.closed&&(this._connection=null,t=u.EMPTY)),t}refCount(){return G()(this)}}const Y=(()=>{const t=X.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class J extends _{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function Q(){return new C}function Z(){return t=>{return G()((e=Q,function(t){let n;n="function"==typeof e?e:function(){return e};const i=Object.create(t,Y);return i.source=t,i.subjectFactory=n,i})(t));var e}}function tt(t){for(let e in t)if(t[e]===tt)return e;throw Error("Could not find renamed property on target object.")}function et(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function nt(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(nt).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function it(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const rt=tt({__forward_ref__:tt});function st(t){return t.__forward_ref__=st,t.toString=function(){return nt(this())},t}function ot(t){return at(t)?t():t}function at(t){return"function"==typeof t&&t.hasOwnProperty(rt)&&t.__forward_ref__===st}function lt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function ct(t){return{factory:t.factory,providers:t.providers||[],imports:t.imports||[]}}function ht(t){return ut(t,pt)||ut(t,gt)}function ut(t,e){return t.hasOwnProperty(e)?t[e]:null}function dt(t){return t&&(t.hasOwnProperty(ft)||t.hasOwnProperty(mt))?t[ft]:null}const pt=tt({"\u0275prov":tt}),ft=tt({"\u0275inj":tt}),gt=tt({ngInjectableDef:tt}),mt=tt({ngInjectorDef:tt});var vt=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});let yt;function bt(t){const e=yt;return yt=t,e}function wt(t,e,n){const i=ht(t);if(i&&"root"==i.providedIn)return void 0===i.value?i.value=i.factory():i.value;if(n&vt.Optional)return null;if(void 0!==e)return e;throw new Error(`Injector: NOT_FOUND [${nt(t)}]`)}function xt(t){return{toString:t}.toString()}var _t=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}({}),Ct=function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({});const St="undefined"!=typeof globalThis&&globalThis,Et="undefined"!=typeof window&&window,kt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,At="undefined"!=typeof global&&global,Dt=St||At||Et||kt,Tt={},Rt=[],Ft=tt({"\u0275cmp":tt}),Lt=tt({"\u0275dir":tt}),Mt=tt({"\u0275pipe":tt}),It=tt({"\u0275mod":tt}),$t=tt({"\u0275loc":tt}),Ot=tt({"\u0275fac":tt}),Pt=tt({__NG_ELEMENT_ID__:tt});let Nt=0;function Bt(t){return xt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===_t.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||Rt,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||Ct.Emulated,id:"c",styles:t.styles||Rt,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Nt++,n.inputs=zt(t.inputs,e),n.outputs=zt(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(Ut):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(Vt):null,n})}function Ut(t){return Gt(t)||function(t){return t[Lt]||null}(t)}function Vt(t){return function(t){return t[Mt]||null}(t)}const Ht={};function jt(t){const e={type:t.type,bootstrap:t.bootstrap||Rt,declarations:t.declarations||Rt,imports:t.imports||Rt,exports:t.exports||Rt,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&xt(()=>{Ht[t.id]=t.type}),e}function zt(t,e){if(null==t)return Tt;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const Wt=Bt;function Gt(t){return t[Ft]||null}function qt(t,e){const n=t[It]||null;if(!n&&!0===e)throw new Error(`Type ${nt(t)} does not have '\u0275mod' property.`);return n}const Kt=20,Xt=10;function Yt(t){return Array.isArray(t)&&"object"==typeof t[1]}function Jt(t){return Array.isArray(t)&&!0===t[1]}function Qt(t){return 0!=(8&t.flags)}function Zt(t){return 2==(2&t.flags)}function te(t){return 1==(1&t.flags)}function ee(t){return null!==t.template}function ne(t,e){return t.hasOwnProperty(Ot)?t[Ot]:null}class ie extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function re(t){return"string"==typeof t?t:null==t?"":String(t)}function se(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():re(t)}function oe(t,e){const n=e?" in "+e:"";throw new ie("201",`No provider for ${se(t)} found${n}`)}class ae{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function le(){return ce}function ce(t){return t.type.prototype.ngOnChanges&&(t.setInput=ue),he}function he(){const t=de(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Tt)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function ue(t,e,n,i){const r=de(t)||function(t,e){return t.__ngSimpleChanges__=e}(t,{previous:Tt,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new ae(l&&l.currentValue,e,o===Tt),t[i]=e}function de(t){return t.__ngSimpleChanges__||null}le.ngInherit=!0;const pe="http://www.w3.org/2000/svg";let fe=void 0;function ge(){return void 0!==fe?fe:"undefined"!=typeof document?document:void 0}function me(t){return!!t.listen}const ve={createRenderer:(t,e)=>ge()};function ye(t){for(;Array.isArray(t);)t=t[0];return t}function be(t,e){return ye(e[t])}function we(t,e){return ye(e[t.index])}function xe(t,e){return t.data[e]}function _e(t,e){return t[e]}function Ce(t,e){const n=e[t];return Yt(n)?n:n[0]}function Se(t){const e=function(t){return t.__ngContext__||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Ee(t){return 4==(4&t[2])}function ke(t){return 128==(128&t[2])}function Ae(t,e){return null==e?null:t[e]}function De(t){t[18]=0}function Te(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Re={lFrame:tn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Fe(){return Re.bindingsEnabled}function Le(){return Re.lFrame.lView}function Me(){return Re.lFrame.tView}function Ie(t){Re.lFrame.contextLView=t}function $e(){let t=Oe();for(;null!==t&&64===t.type;)t=t.parent;return t}function Oe(){return Re.lFrame.currentTNode}function Pe(t,e){const n=Re.lFrame;n.currentTNode=t,n.isParent=e}function Ne(){return Re.lFrame.isParent}function Be(){Re.lFrame.isParent=!1}function Ue(){return Re.isInCheckNoChangesMode}function Ve(t){Re.isInCheckNoChangesMode=t}function He(){const t=Re.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function je(){return Re.lFrame.bindingIndex}function ze(){return Re.lFrame.bindingIndex++}function We(t){const e=Re.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function Ge(t,e){const n=Re.lFrame;n.bindingIndex=n.bindingRootIndex=t,qe(e)}function qe(t){Re.lFrame.currentDirectiveIndex=t}function Ke(){return Re.lFrame.currentQueryIndex}function Xe(t){Re.lFrame.currentQueryIndex=t}function Ye(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function Je(t,e,n){if(n&vt.SkipSelf){let i=e,r=t;for(;i=i.parent,!(null!==i||n&vt.Host||(i=Ye(r),null===i)||(r=r[15],10&i.type)););if(null===i)return!1;e=i,t=r}const i=Re.lFrame=Ze();return i.currentTNode=e,i.lView=t,!0}function Qe(t){const e=Ze(),n=t[1];Re.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function Ze(){const t=Re.lFrame,e=null===t?null:t.child;return null===e?tn(t):e}function tn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function en(){const t=Re.lFrame;return Re.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const nn=en;function rn(){const t=en();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function sn(){return Re.lFrame.selectedIndex}function on(t){Re.lFrame.selectedIndex=t}function an(){const t=Re.lFrame;return xe(t.tView,t.selectedIndex)}function ln(){Re.lFrame.currentNamespace=pe}function cn(){Re.lFrame.currentNamespace=null}function hn(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[o]<0&&(t[18]+=65536),(s>11>16&&(3&t[2])===e&&(t[2]+=2048,s.call(o)):s.call(o)}const mn=-1;class vn{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function yn(t,e,n){const i=me(t);let r=0;for(;re){o=s-1;break}}}for(;s>16,i=e;for(;n>0;)i=i[15],n--;return i}let kn=!0;function An(t){const e=kn;return kn=t,e}let Dn=0;function Tn(t,e){const n=Fn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Rn(i.data,t),Rn(e,null),Rn(i.blueprint,null));const r=Ln(t,e),s=t.injectorIndex;if(Cn(r)){const t=Sn(r),n=En(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Rn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Fn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function Ln(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return mn;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return mn}function Mn(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Pt)&&(i=n[Pt]),null==i&&(i=n[Pt]=Dn++);const r=255&i,s=1<=0?255&e:Nn:e}(n);if("function"==typeof s){if(!Je(e,t,i))return i&vt.Host?In(r,n,i):$n(e,n,i,r);try{const t=s();if(null!=t||i&vt.Optional)return t;oe(n)}finally{nn()}}else if("number"==typeof s){let r=null,o=Fn(t,e),a=mn,l=i&vt.Host?e[16][6]:null;for((-1===o||i&vt.SkipSelf)&&(a=-1===o?Ln(t,e):e[o+8],a!==mn&&jn(i,!1)?(r=e[1],o=Sn(a),e=En(a,e)):o=-1);-1!==o;){const t=e[1];if(Hn(s,o,t.data)){const t=Bn(o,e,n,r,i,l);if(t!==Pn)return t}a=e[o+8],a!==mn&&jn(i,e[1].data[o+8]===l)&&Hn(s,o,e)?(r=t,o=Sn(a),e=En(a,e)):o=-1}}}return $n(e,n,i,r)}const Pn={};function Nn(){return new zn($e(),Le())}function Bn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Un(a,o,n,null==i?Zt(a)&&kn:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==l?Vn(e,o,l,a):Pn}function Un(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,h=r?a+c:t.directiveEnd;for(let u=i?a:a+c;u=l&&t.type===n)return u}if(r){const t=o[l];if(t&&ee(t)&&t.type===n)return l}return null}function Vn(t,e,n,i){let r=t[n];const s=e.data;if(r instanceof vn){const o=r;o.resolving&&function(t,e){throw new ie("200","Circular dependency in DI detected for "+t)}(se(s[n]));const a=An(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?bt(o.injectImpl):null;Je(t,i,vt.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ce(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&bt(l),An(a),o.resolving=!1,nn()}}return r}function Hn(t,e,n){const i=64&t,r=32&t;let s;return s=128&t?i?r?n[e+7]:n[e+6]:r?n[e+5]:n[e+4]:i?r?n[e+3]:n[e+2]:r?n[e+1]:n[e],!!(s&1<{const t=Wn(ot(e));return t?t():null};let n=ne(e);if(null===n){const t=dt(e);n=t&&t.factory}return n||null}function Gn(t){return xt(()=>{const e=t.prototype.constructor,n=e[Ot]||Wn(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Ot]||Wn(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function qn(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(Kn)?t[Kn]:Object.defineProperty(t,Kn,{value:[]})[Kn];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class Yn{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=lt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return"InjectionToken "+this._desc}}const Jn=new Yn("AnalyzeForEntryComponents"),Qn=Function;function Zn(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ti(t,e):e(t))}function ei(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ni(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function ii(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function si(t,e){const n=oi(t,e);if(n>=0)return t[1|n]}function oi(t,e){return function(t,e,n){let i=0,r=t.length>>1;for(;r!==i;){const n=i+(r-i>>1),s=t[n<<1];if(e===s)return n<<1;s>e?r=n:i=n+1}return~(r<<1)}(t,e)}const ai=Xn("Inject",t=>({token:t})),li=Xn("Optional"),ci=Xn("Self"),hi=Xn("SkipSelf"),ui={},di=/\n/gm,pi="__source",fi=tt({provide:String,useValue:tt});let gi,mi=void 0;function vi(t){const e=mi;return mi=t,e}function yi(t,e=vt.Default){if(void 0===mi)throw new Error("inject() must be called from an injection context");return null===mi?wt(t,void 0,e):mi.get(t,e&vt.Optional?null:void 0,e)}function bi(t,e=vt.Default){return(yt||yi)(ot(t),e)}function wi(t){const e=[];for(let n=0;nt,createScript:t=>t,createScriptURL:t=>t})}catch(e){}return gi}())||void 0===e?void 0:e.createHTML(t))||t}class _i{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see https://g.co/ng/security#xss)"}}class Ci extends _i{getTypeName(){return"HTML"}}class Si extends _i{getTypeName(){return"Style"}}class Ei extends _i{getTypeName(){return"Script"}}class ki extends _i{getTypeName(){return"URL"}}class Ai extends _i{getTypeName(){return"ResourceURL"}}function Di(t){return t instanceof _i?t.changingThisBreaksApplicationSecurity:t}function Ti(t,e){const n=Ri(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Ri(t){return t instanceof _i&&t.getTypeName()||null}class Fi{getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(xi(t),"text/html").body;return e.removeChild(e.firstChild),e}catch(e){return null}}}class Li{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=xi(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=xi(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0$i(t.trim())).join(", ")),this.buf.push(" ",e,'="',Yi(o),'"')}var i;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();Hi.hasOwnProperty(e)&&!Ni.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(Yi(t))}checkClobberedElement(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}}const Ki=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xi=/([^\#-~ |!])/g;function Yi(t){return t.replace(/&/g,"&").replace(Ki,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Xi,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Ji;function Qi(t,e){let n=null;try{Ji=Ji||function(t){return function(){try{return!!(new window.DOMParser).parseFromString(xi(""),"text/html")}catch(t){return!1}}()?new Fi:new Li(t)}(t);let i=e?String(e):"";n=Ji.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=Ji.getInertBodyElement(i)}while(i!==s);return(new qi).sanitizeChildren(Zi(n)||n)}finally{if(n){const t=Zi(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function Zi(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var tr=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}({});function er(t){const e=ir();return e?e.sanitize(tr.HTML,t)||"":Ti(t,"HTML")?Di(t):Qi(ge(),re(t))}function nr(t){const e=ir();return e?e.sanitize(tr.URL,t)||"":Ti(t,"URL")?Di(t):$i(re(t))}function ir(){const t=Le();return t&&t[12]}function rr(t){return t.ngDebugContext}function sr(t){return t.ngOriginalError}function or(t,...e){t.error(...e)}class ar{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t.ngErrorLogger||or}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?rr(t)?rr(t):this._findContext(sr(t)):null}_findOriginalError(t){let e=sr(t);for(;e&&sr(e);)e=sr(e);return e}}function lr(t,e){t.__ngContext__=e}const cr=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Dt))();function hr(t){return{name:"window",target:t.ownerDocument.defaultView}}function ur(t){return t instanceof Function?t():t}var dr=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({});function pr(t,e){return(void 0)(t,e)}function fr(t){const e=t[3];return Jt(e)?e[3]:e}function gr(t){return vr(t[13])}function mr(t){return vr(t[4])}function vr(t){for(;null!==t&&!Jt(t);)t=t[4];return t}function yr(t,e,n,i,r){if(null!=i){let s,o=!1;Jt(i)?s=i:Yt(i)&&(o=!0,i=i[0]);const a=ye(i);0===t&&null!==n?null==r?kr(e,n,a):Er(e,n,a,r||null,!0):1===t&&null!==n?Er(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Dr(t,e);i&&function(t,e,n,i){me(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==ye(n)&&yr(e,t,i,s,r);for(let o=Xt;o0&&(t[n-1][4]=i[4]);const o=ni(t,Xt+e);$r(i[1],r=i,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}var r;return i}function _r(t,e){if(!(256&e[2])){const n=e[11];me(n)&&n.destroyNode&&$r(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Cr(t[1],t);for(;e;){let n=null;if(Yt(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)Yt(e)&&Cr(e[1],e),e=e[3];null===e&&(e=t),Yt(e)&&Cr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Cr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),t+=2}else{const e=i[r=n[t+1]];n[t].call(e)}if(null!==i)for(let t=r+1;ts?"":r[h+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==Br(e,c,0)||2&i&&c!==t){if(Wr(i))return!1;o=!0}}}}else{if(!o&&!Wr(i)&&!Wr(l))return!1;if(o&&Wr(l))continue;o=!1,i=l|1&i}}return Wr(i)||o}function Wr(t){return 0==(1&t)}function Gr(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""===r||Wr(o)||(e+=Xr(s,r),r=""),i=o,s=s||!Wr(i);n++}return""!==r&&(e+=Xr(s,r)),e}const Jr={};function Qr(t){Zr(Me(),Le(),sn()+t,Ue())}function Zr(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&un(e,i,n)}else{const i=t.preOrderHooks;null!==i&&dn(e,i,0,n)}on(n)}function ts(t,e){return t<<17|e<<2}function es(t){return t>>17&32767}function ns(t){return 2|t}function is(t){return(131068&t)>>2}function rs(t,e){return-131069&t|e<<2}function ss(t){return 1|t}function os(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;iKt&&Zr(t,e,Kt,Ue()),n(i,r)}finally{on(s)}}function fs(t,e,n){if(Qt(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function Ss(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Es(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function ks(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&Is(n)}}function Is(t){for(let n=gr(t);null!==n;n=mr(n))for(let t=Xt;t0&&Is(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&Is(i)}}function $s(t,e){const n=Ce(e,t),i=n[1];!function(t,e){for(let n=e.length;nPromise.resolve(null))();function Hs(t){return t[7]||(t[7]=[])}function js(t){return t.cleanup||(t.cleanup=[])}function zs(t,e){const n=t[9],i=n?n.get(ar,null):null;i&&i.handleError(e)}function Ws(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ti([t],t=>this.processInjectorType(t,[],r)),this.records.set(Ks,oo(void 0,this));const s=this.records.get(Ys);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:nt(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=ui,n=vt.Default){this.assertNotDestroyed();const i=vi(this);try{if(!(n&vt.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=("function"==typeof(r=t)||"object"==typeof r&&r instanceof Yn)&&ht(t);e=n&&this.injectableDefInScope(n)?oo(ro(t),Js):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&vt.Self?eo():this.parent).get(t,e=n&vt.Optional&&e===ui?null:e)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(nt(t)),i)throw s;return function(t,e,n,i){const r=t.ngTempTokenPath;throw e[pi]&&r.unshift(e[pi]),t.message=function(t,e,n,i=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let r=nt(e);if(Array.isArray(e))r=e.map(nt).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):nt(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(di,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t.ngTempTokenPath=null,t}(s,t,"R3InjectorError",this.source)}throw s}finally{vi(i)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(nt(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ot(t)))return!1;let i=dt(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=dt(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ti(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||Zs))}}this.injectorDefTypes.add(s),this.records.set(s,oo(i.factory,Js));const a=i.providers;if(null!=a&&!o){const e=t;ti(a,t=>this.processProvider(t,e,a))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=lo(t=ot(t))?t:ot(t&&t.provide);const r=function(t,e,n){return ao(t)?oo(void 0,t.useValue):oo(so(t),Js)}(t);if(lo(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=oo(void 0,Js,!0),e.factory=()=>wi(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){var n;return e.value===Js&&(e.value=Qs,e.value=e.factory()),"object"==typeof e.value&&e.value&&null!==(n=e.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){return!!t.providedIn&&("string"==typeof t.providedIn?"any"===t.providedIn||t.providedIn===this.scope:this.injectorDefTypes.has(t.providedIn))}}function ro(t){const e=ht(t),n=null!==e?e.factory:ne(t);if(null!==n)return n;const i=dt(t);if(null!==i)return i.factory;if(t instanceof Yn)throw new Error(`Token ${nt(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=ii(e,"?");throw new Error(`Can't resolve all parameters for ${nt(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[pt]||t[gt]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function so(t,e,n){let i=void 0;if(lo(t)){const e=ot(t);return ne(e)||ro(e)}if(ao(t))i=()=>ot(t.useValue);else if((r=t)&&r.useFactory)i=()=>t.useFactory(...wi(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>bi(ot(t.useExisting));else{const e=ot(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return ne(e)||ro(e);i=()=>new e(...wi(t.deps))}var r;return i}function oo(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function ao(t){return null!==t&&"object"==typeof t&&fi in t}function lo(t){return"function"==typeof t}const co=function(t,e,n){return function(t,e=null,n=null,i){const r=no(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};let ho=(()=>{class t{static create(t,e){return Array.isArray(t)?co(t,e,""):co(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=ui,t.NULL=new Xs,t.\u0275prov=lt({token:t,providedIn:"any",factory:()=>bi(Ks)}),t.__NG_ELEMENT_ID__=-1,t})();function uo(t,e){hn(Se(t)[1],$e())}function po(t){let e=Object.getPrototypeOf(t.type.prototype).constructor,n=!0;const i=[t];for(;e;){let r=void 0;if(ee(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=fo(t.inputs),e.declaredInputs=fo(t.declaredInputs),e.outputs=fo(t.outputs);const n=r.hostBindings;n&&vo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&go(t,s),o&&mo(t,o),et(t.inputs,r.inputs),et(t.declaredInputs,r.declaredInputs),et(t.outputs,r.outputs),ee(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=xn(r.hostAttrs,n=xn(n,r.hostAttrs))}}(i)}function fo(t){return t===Tt?{}:t===Rt?[]:t}function go(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function mo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function vo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}let yo=null;function bo(){if(!yo){const t=Dt.Symbol;if(t&&t.iterator)yo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(ye(t[i.index])).target:i.index;if(me(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,u=!1;else{s=jo(i,e,s,!1);const t=n.listen(p.name||f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=jo(i,e,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=jo(i,e,s,!1);const d=i.outputs;let p;if(u&&null!==d&&(p=d[r])){const t=p.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Re.lFrame.contextLView))[8]}(t)}function Wo(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Zo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ta(t){return t.substring(Zo.key,Zo.keyEnd)}function ea(t,e){const n=Zo.textEnd;return n===e?-1:(e=Zo.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Zo.key=e,n),na(t,e,n))}function na(t,e,n){for(;e=0;n=ea(e,n))ri(t,ta(e),!0)}function aa(t,e,n,i){const r=Le(),s=Me(),o=We(2);s.firstUpdatePass&&ha(s,t,o,i),e!==Jr&&So(r,o,e)&&pa(s,s.data[sn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=nt(Di(t)))),t}(e,n),i,o)}function la(t,e,n,i){const r=Me(),s=We(2);r.firstUpdatePass&&ha(r,null,s,i);const o=Le();if(n!==Jr&&So(o,s,n)){const a=r.data[sn()];if(ma(a,i)&&!ca(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=it(t,n||"")),Lo(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===Jr&&(r=Yo);let l=0,c=0,h=0=t.expandoStartIndex}function ha(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[sn()],o=ca(t,n);ma(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=function(t){const e=Re.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=da(n=ua(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=ua(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==is(i))return t[es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=ua(null,t,e,n[1],i),n=da(n,e.attrs,i),function(t,e,n,i){t[es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i=void 0;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(h=!0)}else c=n;if(r)if(0!==l){const e=es(t[a+1]);t[i+1]=ts(e,a),0!==e&&(t[e+1]=rs(t[e+1],i)),t[a+1]=131071&t[a+1]|i<<17}else t[i+1]=ts(a,0),0!==a&&(t[a+1]=rs(t[a+1],i)),a=i;else t[i+1]=ts(l,0),0===a?a=i:t[l+1]=rs(t[l+1],i),l=i;h&&(t[i+1]=ns(t[i+1])),Jo(t,c,i,!0),Jo(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&oi(s,e)>=0&&(n[i+1]=ss(n[i+1]))}(e,c,t,i,s),o=ts(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function ua(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let h=n[r+1];h===Jr&&(h=c?Yo:void 0);let u=c?si(h,i):l===i?h:void 0;if(s&&!ga(u)&&(u=si(e,i)),ga(u)&&(a=u,o))return a;const d=t[r+1];r=o?es(d):is(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=si(t,i))}return a}function ga(t){return void 0!==t}function ma(t,e){return 0!=(t.flags&(e?16:32))}function va(t,e=""){const n=Le(),i=Me(),r=t+Kt,s=i.firstCreatePass?ls(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return me(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Fr(i,n,o,s),Pe(s,!1)}function ya(t){return ba("",t,""),ya}function ba(t,e,n){const i=Le(),r=Ao(i,t,e,n);return r!==Jr&&Gs(i,sn(),r),ba}function wa(t,e,n,i,r){const s=Le(),o=function(t,e,n,i,r,s){const o=Eo(t,je(),n,r);return We(2),o?e+re(n)+i+re(r)+s:Jr}(s,t,e,n,i,r);return o!==Jr&&Gs(s,sn(),o),wa}function xa(t,e,n){const i=Le();return So(i,ze(),e)&&xs(Me(),an(),i,t,e,i[11],n,!0),xa}const _a=void 0;var Ca=["en",[["a","p"],["AM","PM"],_a],[["AM","PM"],_a,_a],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],_a,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],_a,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",_a,"{1} 'at' {0}",_a],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let Sa={};function Ea(t){return t in Sa||(Sa[t]=Dt.ng&&Dt.ng.common&&Dt.ng.common.locales&&Dt.ng.common.locales[t]),Sa[t]}var ka=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}({});const Aa="en-US";let Da=Aa;function Ta(t){var e,n;n="Expected localeId to be defined",null==(e=t)&&function(t,e,n,i){throw new Error("ASSERTION ERROR: "+t+` [Expected=> null != ${e} <=Actual]`)}(n,e),"string"==typeof t&&(Da=t.toLowerCase().replace(/_/g,"-"))}function Ra(t,e,n,i,r){if(t=ot(t),Array.isArray(t))for(let s=0;s>20;if(lo(t)||!t.multi){const i=new vn(l,r,Ro),p=Ma(a,e,r?h:h+d,u);-1===p?(Mn(Tn(c,o),s,a),Fa(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=Ma(a,e,h+d,u),f=Ma(a,e,h,h+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Mn(Tn(c,o),s,a);const h=function(t,e,n,i,r){const s=new vn(t,n,Ro);return s.multi=[],s.index=e,s.componentProviders=0,La(s,r,i&&!n),s}(r?$a:Ia,n.length,r,i,l);!r&&m&&(n[f].providerFactory=h),Fa(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(h),o.push(h)}else Fa(s,t,p>-1?p:f,La(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function Fa(t,e,n,i){const r=lo(e);if(r||e.useClass){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function La(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function Ma(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=Me();if(i.firstCreatePass){const r=ee(t);Ra(n,i.data,i.blueprint,r,!0),Ra(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class Na{}class Ba{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${nt(t)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=t,e}(t)}}let Ua=(()=>{class t{}return t.NULL=new Ba,t})();function Va(...t){}function Ha(t,e){return new za(we(t,e))}const ja=function(){return Ha($e(),Le())};let za=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=ja,t})();class Wa{}let Ga=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>qa(),t})();const qa=function(){const t=Le(),e=Ce($e().index,t);return function(t){return t[11]}(Yt(e)?e:t)};let Ka=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>null}),t})();class Xa{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Ya=new Xa("11.0.5");class Ja{constructor(){}supports(t){return xo(t)}create(t){return new Za(t)}}const Qa=(t,e)=>e;class Za{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Qa}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):t=this._addAfter(new tl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new nl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new nl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class tl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class el{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class nl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new el,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function il(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new ol(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class ol{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let al=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new Ja])}),t})(),ll=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new rl])}),t})();function cl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(ye(s)),Jt(s))for(let t=Xt;t-1&&this._viewContainerRef.detach(t),this._viewContainerRef=null}_r(this._lView[1],this._lView)}onDestroy(t){bs(this._lView[1],this._lView,null,t)}markForCheck(){Ps(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ns(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Ve(!0);try{Ns(t,e,n)}finally{Ve(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t}detachFromAppRef(){var t;this._appRef=null,$r(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class ul extends hl{constructor(t){super(t),this._view=t}detectChanges(){Bs(this._view)}checkNoChanges(){!function(t){Ve(!0);try{Bs(t)}finally{Ve(!1)}}(this._view)}get context(){return null}}const dl=function(t=!1){return function(t,e,n){if(!n&&Zt(t)){const n=Ce(t.index,e);return new hl(n,n)}return 47&t.type?new hl(e[16],e):null}($e(),Le(),t)};let pl=(()=>{class t{}return t.__NG_ELEMENT_ID__=dl,t.__ChangeDetectorRef__=!0,t})();const fl=[new rl],gl=new al([new Ja]),ml=new ll(fl),vl=function(){return xl($e(),Le())};let yl=(()=>{class t{}return t.__NG_ELEMENT_ID__=vl,t})();const bl=yl,wl=class extends bl{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=as(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),hs(e,n,t),new hl(n)}};function xl(t,e){return 4&t.type?new wl(e,t,Ha(t,e)):null}class _l{}class Cl{}const Sl=function(){return Rl($e(),Le())};let El=(()=>{class t{}return t.__NG_ELEMENT_ID__=Sl,t})();const kl=El,Al=class extends kl{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ha(this._hostTNode,this._hostLView)}get injector(){return new zn(this._hostTNode,this._hostLView)}get parentInjector(){const t=Ln(this._hostTNode,this._hostLView);if(Cn(t)){const e=En(t,this._hostLView),n=Sn(t);return new zn(e[1].data[n+8],e)}return new zn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=Dl(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-Xt}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(_l,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(Jt(n[3])){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new Al(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=Xt+i,s=n.length;i>0&&(n[r-1][4]=e),icr});class $l extends Na{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=t.selectors.map(Yr).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return Ml(this.componentDef.inputs)}get outputs(){return Ml(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,Fl,r);return s!==Fl||i===Fl?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Wa,ve),o=r.get(Ka,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(me(t))return t.selectRootElement(e,n===Ct.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):br(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?pe:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),h=this.componentDef.onPush?576:528,u={components:[],scheduler:cr,clean:Vs,playerHandler:null,flags:0},d=ys(0,null,null,1,0,null,null,null,null,null),p=as(null,d,u,h,null,null,s,a,o,r);let f,g;Qe(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=ls(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(qs(a,l,!0),null!==t&&(yn(r,t,l),null!==a.classes&&Nr(r,t,a.classes),null!==a.styles&&Pr(r,t,a.styles)));const c=i.createRenderer(t,e),h=as(n,vs(e),null,e.onPush?64:16,n[20],a,i,c,null,null);return o.firstCreatePass&&(Mn(Tn(a,n),o,e.type),Es(o,a),As(a,n.length,1)),Os(n,h),n[20]=h}(c,this.componentDef,p,s,a);if(c)if(n)yn(a,c,["ng-version",Ya.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&Nr(a,c,e.join(" "))}if(g=xe(d,Kt),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=$e();e.contentQueries(1,o,t.directiveStart)}const a=$e();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(on(a.index),Cs(n[1],a,0,a.directiveStart,a.directiveEnd,e),Ss(e,o)),o}(t,this.componentDef,p,u,[uo]),hs(d,p,null)}finally{rn()}return new Ol(this.componentType,f,Ha(g,p),p,g)}}class Ol extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new ul(i),this.componentType=t}get injector(){return new zn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Pl=new Map;class Nl extends _l{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Ll(this);const n=qt(t),i=t[$t]||null;i&&Ta(i),this._bootstrapComponents=ur(n.bootstrap),this._r3Injector=no(t,e,[{provide:_l,useValue:this},{provide:Ua,useValue:this.componentFactoryResolver}],nt(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=ho.THROW_IF_NOT_FOUND,n=vt.Default){return t===ho||t===_l||t===Ks?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Bl extends Cl{constructor(t){super(),this.moduleType=t,null!==qt(t)&&function(t){const e=new Set;!function t(n){const i=qt(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${nt(e)} vs ${nt(e.name)}`)}(r,Pl.get(r),n),Pl.set(r,n));const s=ur(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Nl(this.moduleType,t)}}function Ul(t,e,n){const i=He()+t,r=Le();return r[i]===Jr?Co(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Vl(t,e,n,i){return zl(Le(),He(),t,e,n,i)}function Hl(t,e,n,i,r){return function(t,e,n,i,r,s,o){const a=e+n;return Eo(t,a,r,s)?Co(t,a+2,o?i.call(o,r,s):i(r,s)):jl(t,a+2)}(Le(),He(),t,e,n,i,r)}function jl(t,e){const n=t[e];return n===Jr?void 0:n}function zl(t,e,n,i,r,s){const o=e+n;return So(t,o,r)?Co(t,o+1,s?i.call(s,r):i(r)):jl(t,o+1)}const Wl=class extends C{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){let i,r=t=>null,s=()=>null;t&&"object"==typeof t?(i=this.__isAsync?e=>{setTimeout(()=>t.next(e))}:e=>{t.next(e)},t.error&&(r=this.__isAsync?e=>{setTimeout(()=>t.error(e))}:e=>{t.error(e)}),t.complete&&(s=this.__isAsync?()=>{setTimeout(()=>t.complete())}:()=>{t.complete()})):(i=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)},e&&(r=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)}),n&&(s=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const o=super.subscribe(i,r,s);return t instanceof u&&t.add(o),o}};function Gl(){return this._results[bo()]()}class ql{constructor(){this.dirty=!0,this._results=[],this.changes=new Wl,this.length=0;const t=bo(),e=ql.prototype;e[t]||(e[t]=Gl)}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t){this._results=Zn(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Kl{constructor(t){this.queryList=t,this.matches=null}clone(){return new Kl(this.queryList)}setDirty(){this.queryList.setDirty()}}class Xl{constructor(t=[]){this.queries=t}createEmbeddedView(t){const e=t.queries;if(null!==e){const n=null!==t.contentQueries?t.contentQueries[0]:e.length,i=[];for(let t=0;t0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=Xt;t{class t{constructor(t){this.appInits=t,this.resolve=Va,this.reject=Va,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(bi(pc,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const gc=new Yn("AppId"),mc={provide:gc,useFactory:function(){return`${vc()}${vc()}${vc()}`},deps:[]};function vc(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const yc=new Yn("Platform Initializer"),bc=new Yn("Platform ID"),wc=new Yn("appBootstrapListener");let xc=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const _c=new Yn("LocaleId"),Cc=new Yn("DefaultCurrencyCode");class Sc{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const Ec=function(t){return new Bl(t)},kc=Ec,Ac=function(t){return Promise.resolve(Ec(t))},Dc=function(t){const e=Ec(t),n=ur(qt(t).declarations).reduce((t,e)=>{const n=Gt(e);return n&&t.push(new $l(n)),t},[]);return new Sc(e,n)},Tc=Dc,Rc=function(t){return Promise.resolve(Dc(t))};let Fc=(()=>{class t{constructor(){this.compileModuleSync=kc,this.compileModuleAsync=Ac,this.compileModuleAndAllComponentsSync=Tc,this.compileModuleAndAllComponentsAsync=Rc}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Lc=(()=>Promise.resolve(0))();function Mc(t){"undefined"==typeof Zone?Lc.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Ic{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Wl(!1),this.onMicrotaskEmpty=new Wl(!1),this.onStable=new Wl(!1),this.onError=new Wl(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const n=this;n._nesting=0,n._outer=n._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(n._inner=n._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(n._inner=n._inner.fork(Zone.longStackTraceZoneSpec)),n.shouldCoalesceEventChangeDetection=e,n.lastRequestAnimationFrameId=-1,n.nativeRequestAnimationFrame=function(){let t=Dt.requestAnimationFrame,e=Dt.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=!!t.shouldCoalesceEventChangeDetection&&t.nativeRequestAnimationFrame&&(()=>{!function(t){-1===t.lastRequestAnimationFrameId&&(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Dt,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Pc(t),Oc(t)},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Pc(t))}(t)});t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0,maybeDelayChangeDetection:e},onInvokeTask:(n,i,r,s,o,a)=>{try{return Nc(t),n.invokeTask(r,s,o,a)}finally{e&&"eventTask"===s.type&&e(),Bc(t)}},onInvoke:(e,n,i,r,s,o,a)=>{try{return Nc(t),e.invoke(i,r,s,o,a)}finally{Bc(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Pc(t),Oc(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(n)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ic.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Ic.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,$c,Va,Va);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const $c={};function Oc(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Pc(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||t.shouldCoalesceEventChangeDetection&&-1!==t.lastRequestAnimationFrameId)}function Nc(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Bc(t){t._nesting--,Oc(t)}class Uc{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Wl,this.onMicrotaskEmpty=new Wl,this.onStable=new Wl,this.onError=new Wl}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Vc=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Mc(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(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()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Hc=(()=>{class t{constructor(){this._applications=new Map,Wc.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Wc.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class jc{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let zc,Wc=new jc,Gc=!0,qc=!1;function Kc(){return qc=!0,Gc}const Xc=new Yn("AllowMultipleToken");class Yc{constructor(t,e){this.name=t,this.token=e}}function Jc(t,e,n=[]){const i="Platform: "+e,r=new Yn(i);return(e=[])=>{let s=Qc();if(!s||s.injector.get(Xc,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:Ys,useValue:"platform"});!function(t){if(zc&&!zc.destroyed&&!zc.injector.get(Xc,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");zc=t.get(Zc);const e=t.get(yc,null);e&&e.forEach(t=>t())}(ho.create({providers:t,name:i}))}return function(t){const e=Qc();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}(r)}}function Qc(){return zc&&!zc.destroyed?zc:null}let Zc=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new Uc:("zone.js"===t?void 0:t)||new Ic({enableLongStackTrace:Kc(),shouldCoalesceEventChangeDetection:e}),n}(e?e.ngZone:void 0,e&&e.ngZoneEventCoalescing||!1),i=[{provide:Ic,useValue:n}];return n.run(()=>{const e=ho.create({providers:i,parent:this.injector,name:t.moduleType.name}),r=t.create(e),s=r.injector.get(ar,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{s.handleError(t)}});r.onDestroy(()=>{nh(this._modules,r),t.unsubscribe()})}),function(t,e,n){try{const i=n();return Bo(i)?i.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):i}catch(i){throw e.runOutsideAngular(()=>t.handleError(i)),i}}(s,n,()=>{const t=r.injector.get(fc);return t.runInitializers(),t.donePromise.then(()=>(Ta(r.injector.get(_c,Aa)||Aa),this._moduleDoBootstrap(r),r))})})}bootstrapModule(t,e=[]){const n=th({},e);return function(t,e,n){const i=new Bl(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(eh);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${nt(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)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function th(t,e){return Array.isArray(e)?e.reduce(th,t):Object.assign(Object.assign({},t),e)}let eh=(()=>{class t{constructor(t,e,n,i,r,s){this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=s,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new y(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),a=new y(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Ic.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=W(o,a.pipe(Z()))}bootstrap(t,e){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.");let n;n=t instanceof Na?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=n.isBoundToModule?void 0:this._injector.get(_l),r=n.create(ho.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Vc,null),a=o&&r.injector.get(Hc);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),nh(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),Kc()&&this._console.log("Angular is running in development mode. Call enableProdMode() to enable production mode."),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;nh(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(wc,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic),bi(xc),bi(ho),bi(ar),bi(Ua),bi(fc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function nh(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ih{}class rh{}const sh={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let oh=(()=>{class t{constructor(t,e){this._compiler=t,this._config=e||sh}load(t){return this.loadAndCompile(t)}loadAndCompile(t){let[e,i]=t.split("#");return void 0===i&&(i="default"),n("zn8P")(e).then(t=>t[i]).then(t=>ah(t,e,i)).then(t=>this._compiler.compileModuleAsync(t))}loadFactory(t){let[e,i]=t.split("#"),r="NgFactory";return void 0===i&&(i="default",r=""),n("zn8P")(this._config.factoryPathPrefix+e+this._config.factoryPathSuffix).then(t=>t[i+r]).then(t=>ah(t,e,i))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fc),bi(rh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function ah(t,e,n){if(!t)throw new Error(`Cannot find '${n}' in '${e}'`);return t}const lh=Jc(null,"core",[{provide:bc,useValue:"unknown"},{provide:Zc,deps:[ho]},{provide:Hc,deps:[]},{provide:xc,deps:[]}]),ch=[{provide:eh,useClass:eh,deps:[Ic,xc,ho,ar,Ua,fc]},{provide:Il,deps:[Ic],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:fc,useClass:fc,deps:[[new li,pc]]},{provide:Fc,useClass:Fc,deps:[]},mc,{provide:al,useFactory:function(){return gl},deps:[]},{provide:ll,useFactory:function(){return ml},deps:[]},{provide:_c,useFactory:function(t){return Ta(t=t||"undefined"!=typeof $localize&&$localize.locale||Aa),t},deps:[[new ai(_c),new li,new hi]]},{provide:Cc,useValue:"USD"}];let hh=(()=>{class t{constructor(t){}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(eh))},providers:ch}),t})(),uh=null;function dh(){return uh}const ph=new Yn("DocumentToken");let fh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:gh,token:t,providedIn:"platform"}),t})();function gh(){return bi(vh)}const mh=new Yn("Location Initialized");let vh=(()=>{class t extends fh{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=dh().getLocation(),this._history=dh().getHistory()}getBaseHrefFromDOM(){return dh().getBaseHref(this._doc)}onPopState(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)}onHashChange(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){yh()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){yh()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:bh,token:t,providedIn:"platform"}),t})();function yh(){return!!window.history.pushState}function bh(){return new vh(bi(ph))}function wh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function xh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function _h(t){return t&&"?"!==t[0]?"?"+t:t}let Ch=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:Sh,token:t,providedIn:"root"}),t})();function Sh(t){const e=bi(ph).location;return new kh(bi(fh),e&&e.origin||"")}const Eh=new Yn("appBaseHref");let kh=(()=>{class t extends Ch{constructor(t,e){if(super(),this._platformLocation=t,null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)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.");this._baseHref=e}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return wh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+_h(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Ah=(()=>{class t extends Ch{constructor(t,e){super(),this._platformLocation=t,this._baseHref="",null!=e&&(this._baseHref=e)}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e}prepareExternalUrl(t){const e=wh(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Dh=(()=>{class t{constructor(t,e){this._subject=new Wl,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=xh(Rh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+_h(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,Rh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(bi(Ch),bi(fh))},t.normalizeQueryParams=_h,t.joinWithSlash=wh,t.stripTrailingSlash=xh,t.\u0275prov=lt({factory:Th,token:t,providedIn:"root"}),t})();function Th(){return new Dh(bi(Ch),bi(fh))}function Rh(t){return t.replace(/\/index.html$/,"")}var Fh=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}({});class Lh{}let Mh=(()=>{class t extends Lh{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=Ea(e);if(n)return n;const i=e.split("-")[0];if(n=Ea(i),n)return n;if("en"===i)return Ca;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[ka.PluralCase]}(e||this.locale)(t)){case Fh.Zero:return"zero";case Fh.One:return"one";case Fh.Two:return"two";case Fh.Few:return"few";case Fh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(bi(_c))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Ih(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let $h=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(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&&(xo(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+nt(t.item));this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(al),Ro(ll),Ro(za),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Oh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ph=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(e){throw new Error(`Cannot find a differ supporting object '${n}' of type '${t=n,t.name||typeof t}'. NgFor only supports binding to Iterables such as Arrays.`)}}var t;if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new Oh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new Nh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new Nh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(al))},t.\u0275dir=Wt({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Nh{constructor(t,e){this.record=t,this.view=e}}let Bh=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Uh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){Vh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Vh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Uh{constructor(){this.$implicit=null,this.ngIf=null}}function Vh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${nt(e)}'.`)}class Hh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let jh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Hh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(jh,1))},t.\u0275dir=Wt({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Wh=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(ll),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),Gh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(this._shouldRecreateView(t)){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(t){const e=t.ngTemplateOutletContext;return!!t.ngTemplateOutlet||e&&this._hasContextShapeChanged(e)}_hasContextShapeChanged(t){const e=Object.keys(t.previousValue||{}),n=Object.keys(t.currentValue||{});if(e.length===n.length){for(let t of n)if(-1===e.indexOf(t))return!0;return!1}return!0}_updateExistingContext(t){for(let e of Object.keys(t))this._viewRef.context[e]=this.ngTemplateOutletContext[e]}}return t.\u0275fac=function(e){return new(e||t)(Ro(El))},t.\u0275dir=Wt({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[le]}),t})(),qh=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:Lh,useClass:Mh}]}),t})(),Kh=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new Xh(bi(ph),window,bi(ar))}),t})();class Xh{constructor(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(this.supportsScrolling()){const e=this.document.getElementById(t)||this.document.getElementsByName(t)[0];e&&this.scrollToElement(e)}}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,i=e.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],i-r[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=Yh(this.window.history)||Yh(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch(t){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(t){return!1}}}function Yh(t){return Object.getOwnPropertyDescriptor(t,"scrollRestoration")}class Jh extends class extends class{}{constructor(){super()}supportsDOMEvents(){return!0}}{static makeCurrent(){var t;t=new Jh,uh||(uh=t)}getProperty(t,e){return t[e]}log(t){window.console&&window.console.log&&window.console.log(t)}logGroup(t){window.console&&window.console.group&&window.console.group(t)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){return t.parentNode&&t.parentNode.removeChild(t),t}getValue(t){return t.value}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(t){const e=Zh||(Zh=document.querySelector("base"),Zh)?Zh.getAttribute("href"):null;return null==e?null:(n=e,Qh||(Qh=document.createElement("a")),Qh.setAttribute("href",n),"/"===Qh.pathname.charAt(0)?Qh.pathname:"/"+Qh.pathname);var n}resetBaseElement(){Zh=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(t){return Ih(document.cookie,t)}}let Qh,Zh=null;const tu=new Yn("TRANSITION_ID"),eu=[{provide:pc,useFactory:function(t,e,n){return()=>{n.get(fc).donePromise.then(()=>{const n=dh();Array.prototype.slice.apply(e.querySelectorAll("style[ng-transition]")).filter(e=>e.getAttribute("ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[tu,ph,ho],multi:!0}];class nu{static init(){var t;t=new nu,Wc=t}addToWindow(t){Dt.getAngularTestability=(e,n=!0)=>{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Dt.getAllAngularTestabilities=()=>t.getAllTestabilities(),Dt.getAllAngularRootElements=()=>t.getAllRootElements(),Dt.frameworkStabilizers||(Dt.frameworkStabilizers=[]),Dt.frameworkStabilizers.push(t=>{const e=Dt.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?dh().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}const iu=new Yn("EventManagerPlugins");let ru=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),au=(()=>{class t extends ou{constructor(t){super(),this._doc=t,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(t.head)}_addStylesToHost(t,e){t.forEach(t=>{const n=this._doc.createElement("style");n.textContent=t,this._styleNodes.add(e.appendChild(n))})}addHost(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)}removeHost(t){this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach(e=>this._addStylesToHost(t,e))}ngOnDestroy(){this._styleNodes.forEach(t=>dh().remove(t))}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},cu=/%COMP%/g;function hu(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let du=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new pu(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case Ct.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new fu(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case Ct.ShadowDom:return new gu(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=hu(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(bi(ru),bi(au),bi(gc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class pu{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(lu[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=lu[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=lu[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(dr.DashCase|dr.Important)?t.style.setProperty(e,n,i&dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,uu(n)):this.eventManager.addEventListener(t,e,uu(n))}}class fu extends pu{constructor(t,e,n,i){super(t),this.component=n;const r=hu(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(cu,i+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(cu,i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class gu extends pu{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=hu(i.id,i.styles,[]);for(let s=0;s{class t extends su{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const vu=["alt","control","meta","shift"],yu={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},bu={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},wu={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let xu=(()=>{class t extends su{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dh().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(vu.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&bu.hasOwnProperty(e)&&(e=bu[e]))}return yu[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),vu.forEach(i=>{i!=n&&(0,wu[i])(t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),_u=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return bi(Cu)},token:t,providedIn:"root"}),t})(),Cu=(()=>{class t extends _u{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case tr.NONE:return e;case tr.HTML:return Ti(e,"HTML")?Di(e):Qi(this._doc,String(e));case tr.STYLE:return Ti(e,"Style")?Di(e):e;case tr.SCRIPT:if(Ti(e,"Script"))return Di(e);throw new Error("unsafe value used in a script context");case tr.URL:return Ri(e),Ti(e,"URL")?Di(e):$i(String(e));case tr.RESOURCE_URL:if(Ti(e,"ResourceURL"))return Di(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return new Ci(t)}bypassSecurityTrustStyle(t){return new Si(t)}bypassSecurityTrustScript(t){return new Ei(t)}bypassSecurityTrustUrl(t){return new ki(t)}bypassSecurityTrustResourceUrl(t){return new Ai(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return t=bi(Ks),new Cu(t.get(ph));var t},token:t,providedIn:"root"}),t})();const Su=Jc(lh,"browser",[{provide:bc,useValue:"browser"},{provide:yc,useValue:function(){Jh.makeCurrent(),nu.init()},multi:!0},{provide:ph,useFactory:function(){return function(t){fe=t}(document),document},deps:[]}]),Eu=[[],{provide:Ys,useValue:"root"},{provide:ar,useFactory:function(){return new ar},deps:[]},{provide:iu,useClass:mu,multi:!0,deps:[ph,Ic,bc]},{provide:iu,useClass:xu,multi:!0,deps:[ph]},[],{provide:du,useClass:du,deps:[ru,au,gc]},{provide:Wa,useExisting:du},{provide:ou,useExisting:au},{provide:au,useClass:au,deps:[ph]},{provide:Vc,useClass:Vc,deps:[Ic]},{provide:ru,useClass:ru,deps:[iu,Ic]},[]];let ku=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:gc,useValue:e.appId},{provide:tu,useExisting:gc},eu]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:Eu,imports:[qh,hh]}),t})();"undefined"!=typeof window&&window;class Au{}const Du="*";function Tu(t,e){return{type:7,name:t,definitions:e,options:{}}}function Ru(t,e=null){return{type:4,styles:e,timings:t}}function Fu(t,e=null){return{type:2,steps:t,options:e}}function Lu(t){return{type:6,styles:t,offset:null}}function Mu(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function Iu(t){Promise.resolve(null).then(t)}class $u{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Iu(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Ou{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Iu(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Pu(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Nu(t){switch(t.length){case 0:return new $u;case 1:return t[0];default:return new Ou(t)}}function Bu(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,h=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Du:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}h[i]=a}),i||a.push(h),c=h,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function Uu(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&Vu(n,"start",t)));break;case"done":t.onDone(()=>i(n&&Vu(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&Vu(n,"destroy",t)))}}function Vu(t,e,n){const i=n.totalTime,r=Hu(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function Hu(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function ju(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function zu(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let Wu=(t,e)=>!1,Gu=(t,e)=>!1,qu=(t,e,n)=>[];const Ku=Pu();(Ku||"undefined"!=typeof Element)&&(Wu=(t,e)=>t.contains(e),Gu=(()=>{if(Ku||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):Gu}})(),qu=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let nd=(()=>{class t{validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new $u(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),id=(()=>{class t{}return t.NOOP=new nd,t})();const rd="ng-enter",sd="ng-leave",od="ng-trigger",ad=".ng-trigger",ld="ng-animating",cd=".ng-animating";function hd(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:ud(parseFloat(e[1]),e[2])}function ud(t,e){switch(e){case"s":return 1e3*t;default:return t}}function dd(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=ud(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=ud(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function pd(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function fd(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else pd(t,n);return n}function gd(t,e,n){return n?e+":"+n+";":""}function md(t){let e="";for(let n=0;n{const r=Ed(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Pu()&&md(t))}function yd(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=Ed(e);t.style[n]=""}),Pu()&&md(t))}function bd(t){return Array.isArray(t)?1==t.length?t[0]:Fu(t):t}const wd=new RegExp("{{\\s*(.+?)\\s*}}","g");function xd(t){let e=[];if("string"==typeof t){let n;for(;n=wd.exec(t);)e.push(n[1]);wd.lastIndex=0}return e}function _d(t,e,n){const i=t.toString(),r=i.replace(wd,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push("Please provide a value for the animation param "+i),r=""),r.toString()});return r==i?t:r}function Cd(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Sd=/-+([a-z0-9])/g;function Ed(t){return t.replace(Sd,(...t)=>t[1].toUpperCase())}function kd(t,e){return 0===t||0===e}function Ad(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Id(r,o)),"<"!=s[0]||r==Rd&&o==Rd||e.push(Id(o,r))}(t,n,e)):n.push(t),n}const Ld=new Set(["true","1"]),Md=new Set(["false","0"]);function Id(t,e){const n=Ld.has(t)||Md.has(t),i=Ld.has(e)||Md.has(e);return(r,s)=>{let o=t==Rd||t==r,a=e==Rd||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Ld.has(t):Md.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Ld.has(e):Md.has(e)),o&&a}}const $d=new RegExp("s*:selfs*,?","g");function Od(t,e,n){return new Pd(t).build(e,n)}class Pd{constructor(t){this._driver=t}build(t,e){const n=new Nd(e);return this._resetContextStyleTimingState(n),Dd(this,bd(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(Bd(t)){const e=t;Object.keys(e).forEach(t=>{xd(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Cd(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Dd(this,bd(t.animation),e);return{type:1,matchers:Fd(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Ud(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Dd(this,t,e)),options:Ud(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Dd(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:Ud(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return Vd(dd(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=Vd(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||dd(i,e),Vd(n.duration,n.delay,n.easing)}(t.timings,e.errors);let i;e.currentAnimateTimings=n;let r=t.styles?t.styles:Lu({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Lu(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Du?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(Bd(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=xd(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=h>0?i==u?1:h*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Dd(this,bd(t.animation),e),options:Ud(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:Ud(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:Ud(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace($d,"")),[t=t.replace(/@\*/g,ad).replace(/@\w+/g,t=>".ng-trigger-"+t.substr(1)).replace(/:animating/g,cd),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,ju(e.collectedStyles,e.currentQuerySelector,{});const o=Dd(this,bd(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:Ud(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:dd(t.timings,e.errors,!0);return{type:12,animation:Dd(this,bd(t.animation),e),timings:n,options:null}}}class Nd{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function Bd(t){return!Array.isArray(t)&&"object"==typeof t}function Ud(t){var e;return t?(t=pd(t)).params&&(t.params=(e=t.params)?pd(e):null):t={},t}function Vd(t,e,n){return{duration:t,delay:e,easing:n}}function Hd(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class jd{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const zd=new RegExp(":enter","g"),Wd=new RegExp(":leave","g");function Gd(t,e,n,i,r,s={},o={},a,l,c=[]){return(new qd).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class qd{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new jd;const h=new Xd(t,e,l,i,r,c,[]);h.options=a,h.currentTimeline.setStyles([s],null,h.errors,a),Dd(this,n,h);const u=h.timelines.filter(t=>t.containsAnimation());if(u.length&&Object.keys(o).length){const t=u[u.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,h.errors,a)}return u.length?u.map(t=>t.buildKeyframes()):[Hd(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?hd(n.duration):null,s=null!=n.delay?hd(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Dd(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Kd);const t=hd(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Dd(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?hd(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Dd(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return dd(e.params?_d(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?hd(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Kd);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Dd(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Dd(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const Kd={};class Xd{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Kd,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Yd(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=hd(n.duration)),null!=n.delay&&(i.delay=hd(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{e&&t.hasOwnProperty(n)||(t[n]=_d(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new Xd(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=Kd,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new Jd(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(zd,"."+this._enterClassName)).replace(Wd,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return r||0!=o.length||s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class Yd{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new Yd(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Du,this._currentKeyframe[t]=Du}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Du})):fd(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=_d(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Du),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=fd(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Du&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Cd(t.values()):[],s=e.size?Cd(e.values()):[];if(n){const t=i[0],e=pd(t);t.offset=0,e.offset=1,i=[t,e]}return Hd(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Jd extends Yd{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.element=e,this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=fd(t[0],!1);a.offset=0,r.push(a);const l=fd(t[0],!1);l.offset=Qd(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=fd(t[i],!1);o.offset=Qd((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return Hd(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function Qd(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class Zd{}class tp extends Zd{normalizePropertyName(t,e){return Ed(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(ep[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const ep=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function np(t,e,n,i,r,s,o,a,l,c,h,u,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:d}}const ip={};class rp{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const h=[],u=this.ast.options&&this.ast.options.params||ip,d=this.buildStyles(n,o&&o.params||ip,h),p=a&&a.params||ip,f=this.buildStyles(i,p,h),g=new Set,m=new Map,v=new Map,y="void"===i,b={params:Object.assign(Object.assign({},u),p)},w=c?[]:Gd(t,e,this.ast.animation,r,s,d,f,b,l,h);let x=0;if(w.forEach(t=>{x=Math.max(t.duration+t.delay,x)}),h.length)return np(e,this._triggerName,n,i,y,d,f,[],[],m,v,x,h);w.forEach(t=>{const n=t.element,i=ju(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=ju(v,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const _=Cd(g.values());return np(e,this._triggerName,n,i,y,d,f,w,_,m,v,x)}}class sp{constructor(t,e){this.styles=t,this.defaultParams=e}buildStyles(t,e){const n={},i=pd(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=_d(s,i,e)),n[t]=s})}}),n}}class op{constructor(t,e){this.name=t,this.ast=e,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new sp(t.style,t.options&&t.options.params||{})}),ap(this.states,"true","1"),ap(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new rp(t,e,this.states))}),this.fallbackTransition=new rp(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function ap(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const lp=new jd;class cp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Od(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=Bu(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=Gd(this._driver,e,r,rd,sd,{},{},n,lp,i),s.forEach(t=>{const e=ju(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error("Unable to create the animation due to the following errors: "+i.join("\n"));o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Du)})});const a=Nu(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e}listen(t,e,n,i){const r=Hu(e,"","","");return Uu(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const hp="ng-animate-queued",up="ng-animate-disabled",dp=".ng-animate-disabled",pp=[],fp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},gp={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class mp{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=null!=(i=n?t.value:t)?i:null,n){const e=pd(t);delete e.value,this.options=e}else this.options={};var i;this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const vp="void",yp=new mp(vp);class bp{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,kp(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if("start"!=(r=n)&&"done"!=r)throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);var r;const s=ju(this._elementListeners,t,[]),o={name:e,phase:n,callback:i};s.push(o);const a=ju(this._engine.statesByElement,t,{});return a.hasOwnProperty(e)||(kp(t,od),kp(t,"ng-trigger-"+e),a[e]=yp),()=>{this._engine.afterFlush(()=>{const t=s.indexOf(o);t>=0&&s.splice(t,1),this._triggers[e]||delete a[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new xp(this.id,e,t);let o=this._engine.statesByElement.get(t);o||(kp(t,od),kp(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new mp(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=yp),l.value!==vp&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{yd(t,n),vd(t,i)})}return}const c=ju(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let h=r.matchTransition(a.value,l.value,t,l.params),u=!1;if(!h){if(!i)return;h=r.fallbackTransition,u=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:a,toState:l,player:s,isFallbackTransition:u}),u||(kp(t,hp),s.onStart(()=>{Ap(t,hp)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,ad,!0);n.forEach(t=>{if(t.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,vp,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&Nu(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t);if(e){const n=new Set;e.forEach(e=>{const i=e.name;if(n.has(i))return;n.add(i);const r=this._triggers[i].fallbackTransition,s=this._engine.statesByElement.get(t)[i]||yp,o=new mp(vp),a=new xp(this.id,i,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:i,transition:r,fromState:s,toState:o,player:a,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t.__ng_removed;i&&i!==fp||(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){kp(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=Hu(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,Uu(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class wp{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new bp(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),kp(t,up)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Ap(t,up))}removeNode(t,e,n,i){if(_p(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e.__ng_removed={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return _p(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,ad,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,cd,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Nu(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t.__ng_removed;if(e&&e.setForRemoval){if(t.__ng_removed=fp,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,dp)&&this.markElementAsDisabled(t,!1),this.driver.query(t,dp,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?Nu(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))}_flushAnimations(t,e){const n=new jd,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=rd+f++;p.set(e,n),t.forEach(t=>kp(t,n))});const g=[],m=new Set,v=new Set;for(let R=0;Rm.add(t)):v.add(t))}const y=new Map,b=Ep(u,Array.from(m));b.forEach((t,e)=>{const n=sd+f++;y.set(e,n),t.forEach(t=>kp(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Ap(t,n))}),b.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Ap(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const w=[],x=[];for(let R=this._namespaceList.length-1;R>=0;R--)this._namespaceList[R].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(w.push(e),this.collectedEnterElements.length){const t=r.__ng_removed;if(t&&t.setForMove)return void e.destroy()}const c=!h||!this.driver.containsElement(h,r),u=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,u,c);if(f.errors&&f.errors.length)x.push(f);else{if(c)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>ju(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(x.length){const t=[];x.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),w.forEach(t=>t.destroy()),this.reportError(t)}const _=new Map,C=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(C.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,_))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{ju(_,e,[]).push(t),t.destroy()})});const S=g.filter(t=>Rp(t,a,l)),E=new Map;Sp(E,this.driver,v,l,Du).forEach(t=>{Rp(t,a,l)&&S.push(t)});const k=new Map;d.forEach((t,e)=>{Sp(k,this.driver,new Set(t),a,"!")}),S.forEach(t=>{const e=E.get(t),n=k.get(t);E.set(t,Object.assign(Object.assign({},e),n))});const A=[],D=[],T={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>vd(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=T;if(C.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=C.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>C.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,_,r,k,E);if(s.setRealPlayer(n),t===T)A.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=Nu(e)),i.push(s)}}else yd(e,o.fromStyles),s.onDestroy(()=>vd(e,o.toStyles)),D.push(s),c.has(e)&&i.push(s)}),D.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=Nu(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let R=0;R!t.destroyed);i.length?Dp(this,t,i):this.processLeaveNode(t)}return g.length=0,A.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),A}elementContainsData(t,e){let n=!1;const i=e.__ng_removed;return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==vp;e.forEach(e=>{e.queued||(t||e.triggerName==i)&&s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=ju(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}yd(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,h=new Set,u=e.timelines.map(e=>{const u=e.element;c.add(u);const d=u.__ng_removed;if(d&&d.removedBeforeQueried)return new $u(e.duration,e.delay);const p=u!==a,f=function(t){const e=[];return Tp(t,e),e}((n.get(u)||pp).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===u),g=r.get(u),m=s.get(u),v=Bu(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,v,f);if(e.subTimeline&&i&&h.add(u),p){const e=new xp(t,o,u);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{ju(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>kp(t,ld));const d=Nu(u);return d.onDestroy(()=>{c.forEach(t=>Ap(t,ld)),vd(a,e.toStyles)}),h.forEach(t=>{ju(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new $u(t.duration,t.delay)}}class xp{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new $u,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>Uu(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){ju(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function _p(t){return t&&1===t.nodeType}function Cp(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function Sp(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Cp(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);n&&0!=n.length||(i.__ng_removed=gp,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Cp(t,s[a++])),o}function Ep(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}function kp(t,e){if(t.classList)t.classList.add(e);else{let n=t.$$classes;n||(n=t.$$classes={}),n[e]=!0}}function Ap(t,e){if(t.classList)t.classList.remove(e);else{let n=t.$$classes;n&&delete n[e]}}function Dp(t,e,n){Nu(n).onDone(()=>t.processLeaveNode(e))}function Tp(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Fp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new wp(t,e,n),this._timelineEngine=new cp(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Od(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e){return new op(t,e)}(i,e),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=zu(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=zu(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Lp(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Ip(e[0]),e.length>1&&(i=Ip(e[e.length-1]))):e&&(n=Ip(e)),n||i?new Mp(t,n,i):null}let Mp=(()=>{class t{constructor(e,n,i){this._element=e,this._startStyles=n,this._endStyles=i,this._state=0;let r=t.initialStylesByElement.get(e);r||t.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vd(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vd(this._element,this._initialStyles),this._endStyles&&(vd(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(yd(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(yd(this._element,this._endStyles),this._endStyles=null),vd(this._element,this._initialStyles),this._state=3)}}return t.initialStylesByElement=new WeakMap,t})();function Ip(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){!function(t,e){const n=zp(t,"").trim();n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Hp(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=zp(t,"").split(","),i=Vp(n,e);i>=0&&(n.splice(i,1),jp(t,"",n.join(",")))}(this._element,this._name))}}function Bp(t,e,n){jp(t,"PlayState",n,Up(t,e))}function Up(t,e){const n=zp(t,"");return n.indexOf(",")>0?Vp(n.split(","),e):Vp([n],e)}function Vp(t,e){for(let n=0;n=0)return n;return-1}function Hp(t,e,n){n?t.removeEventListener(Pp,e):t.addEventListener(Pp,e)}function jp(t,e,n,i){const r=Op+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function zp(t,e){return t.style[Op+e]||""}class Wp{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Np(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Td(this.element,n))})}this.currentSnapshot=t}}class Gp extends $u{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=ed(e)}init(){!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){this._startingStyles&&(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class qp{constructor(){this._count=0,this._head=document.querySelector("head")}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>ed(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=r+"}\n"}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof Wp),l={};kd(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"!=n&&"easing"!=n&&(e[n]=t[n])})}),e}(e=Ad(t,e,l));if(0==n)return new Gp(t,c);const h="gen_css_kf_"+this._count++,u=this.buildKeyframeElement(t,h,e);document.querySelector("head").appendChild(u);const d=Lp(t,e),p=new Wp(t,e,h,n,i,r,c,d);return p.onDestroy(()=>{var t;(t=u).parentNode.removeChild(t)}),p}}class Kp{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Td(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Xp{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Yp().toString()),this._cssKeyframesDriver=new qp}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof Kp);kd(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const h=Lp(t,e=Ad(t,e=e.map(t=>fd(t,!1)),l));return new Kp(t,e,a,h)}}function Yp(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}let Jp=(()=>{class t extends Au{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:Ct.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Fu(t):t;return tf(this._renderer,null,e,"register",[n]),new Qp(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Qp extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new Zp(this._id,t,e||{},this._renderer)}}class Zp{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return tf(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset")}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function tf(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const ef="@",nf="@.disabled";let rf=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new sf("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new of(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(Fp),bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class sf{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==ef&&e==nf?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class of extends sf{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==ef?"."==e.charAt(1)&&e==nf?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if(e.charAt(0)==ef){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return r.charAt(0)!=ef&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let af=(()=>{class t extends Fp{constructor(t,e,n){super(t.body,e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(id),bi(Zd))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lf=new Yn("AnimationModuleType"),cf=[{provide:Au,useClass:Jp},{provide:Zd,useFactory:function(){return new tp}},{provide:Fp,useClass:af},{provide:Wa,useFactory:function(t,e,n){return new rf(t,e,n)},deps:[du,Fp,Ic]}],hf=[{provide:id,useFactory:function(){return"function"==typeof Yp()?new Xp:new qp}},{provide:lf,useValue:"BrowserAnimations"},...cf],uf=[{provide:id,useClass:nd},{provide:lf,useValue:"NoopAnimations"},...cf];let df=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:hf,imports:[ku]}),t})(),pf=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:uf,imports:[ku]}),t})();function ff(...t){let e=t[t.length-1];return E(e)?(t.pop(),$(t,e)):z(t)}class gf extends C{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new w;return this._value}next(t){super.next(this._value=t)}}class mf extends f{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class vf extends f{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function yf(t,e,n,i,r=new vf(t,n,i)){if(!r.closed)return e instanceof y?e.subscribe(r):I(e)(r)}const bf={};class wf{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new xf(t,this.resultSelector))}}class xf extends mf{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(bf),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t})(),Cf=new y(t=>t.complete());function Sf(t){return t?function(t){return new y(e=>t.schedule(()=>e.complete()))}(t):Cf}function Ef(t){return new y(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?O(n):Sf()).subscribe(e)})}function kf(){return j(1)}function Af(t,e){return function(n){return n.lift(new Df(t,e))}}class Df{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Tf(t,this.predicate,this.thisArg))}}class Tf extends f{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}const Rf=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Ff(t){return function(e){return 0===t?Sf():e.lift(new Lf(t))}}class Lf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Mf(t,this.total))}}class Mf extends f{constructor(t,e){super(t),this.total=e,this.ring=new Array,this.count=0}_next(t){const e=this.ring,n=this.total,i=this.count++;e.length0){const n=this.count>=this.total?this.total:this.count,i=this.ring;for(let r=0;re.lift(new $f(t))}class $f{constructor(t){this.errorFactory=t}call(t,e){return e.subscribe(new Of(t,this.errorFactory))}}class Of extends f{constructor(t,e){super(t),this.errorFactory=e,this.hasValue=!1}_next(t){this.hasValue=!0,this.destination.next(t)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function Pf(){return new _f}function Nf(t=null){return e=>e.lift(new Bf(t))}class Bf{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new Uf(t,this.defaultValue))}}class Uf extends f{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Vf(t,e){return"function"==typeof e?n=>n.pipe(Vf((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))))):e=>e.lift(new Hf(t))}class Hf{constructor(t){this.project=t}call(t,e){return e.subscribe(new jf(t,this.project))}}class jf extends N{constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new P(this),i=this.destination;i.add(n),this.innerSubscription=B(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;t&&!t.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}function zf(t){return e=>0===t?Sf():e.lift(new Wf(t))}class Wf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Gf(t,this.total))}}class Gf extends f{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function qf(...t){return kf()(ff(...t))}class Kf{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new Xf(t,this.accumulator,this.seed,this.hasSeed))}}class Xf extends f{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}function Yf(t){return function(e){const n=new Jf(t),i=e.lift(n);return n.caught=i}}class Jf{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Qf(t,this.selector,this.caught))}}class Qf extends N{constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new P(this);this.add(i);const r=B(n,i);r!==i&&this.add(r)}}}function Zf(t,e){return U(t,e,1)}function tg(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,zf(1),n?Nf(e):If(()=>new _f))}function eg(){}function ng(t,e,n){return function(i){return i.lift(new ig(t,e,n))}}class ig{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new rg(t,this.nextOrObserver,this.error,this.complete))}}class rg extends f{constructor(t,e,n,r){super(t),this._tapNext=eg,this._tapError=eg,this._tapComplete=eg,this._tapError=n||eg,this._tapComplete=r||eg,i(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||eg,this._tapError=e.error||eg,this._tapComplete=e.complete||eg)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}class sg{constructor(t){this.callback=t}call(t,e){return e.subscribe(new og(t,this.callback))}}class og extends f{constructor(t,e){super(t),this.add(new u(e))}}class ag{constructor(t,e){this.id=t,this.url=e}}class lg extends ag{constructor(t,e,n="imperative",i=null){super(t,e),this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class cg extends ag{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class hg extends ag{constructor(t,e,n){super(t,e),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class ug extends ag{constructor(t,e,n){super(t,e),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class dg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fg extends ag{constructor(t,e,n,i,r){super(t,e),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class gg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class mg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class vg{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class yg{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class bg{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class wg{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class xg{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class _g{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Cg{constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Sg="primary";class Eg{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function kg(t){return new Eg(t)}function Ag(t){const e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function Dg(t,e,n){const i=n.path.split("/");if(i.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||i.lengthi[e]===t)}return t===e}function Fg(t){return Array.prototype.concat.apply([],t)}function Lg(t){return t.length>0?t[t.length-1]:null}function Mg(t,e){for(const n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Ig(t){return Uo(t)?t:Bo(t)?O(Promise.resolve(t)):ff(t)}function $g(t,e,n){return n?function(t,e){return Tg(t,e)}(t.queryParams,e.queryParams)&&Og(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>Rg(t[n],e[n]))}(t.queryParams,e.queryParams)&&Pg(t.root,e.root)}function Og(t,e){if(!Hg(t.segments,e.segments))return!1;if(t.numberOfChildren!==e.numberOfChildren)return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Og(t.children[n],e.children[n]))return!1}return!0}function Pg(t,e){return Ng(t,e,e.segments)}function Ng(t,e,n){if(t.segments.length>n.length)return!!Hg(t.segments.slice(0,n.length),n)&&!e.hasChildren();if(t.segments.length===n.length){if(!Hg(t.segments,n))return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Pg(t.children[n],e.children[n]))return!1}return!0}{const i=n.slice(0,t.segments.length),r=n.slice(t.segments.length);return!!Hg(t.segments,i)&&!!t.children.primary&&Ng(t.children.primary,e,r)}}class Bg{constructor(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return Gg.serialize(this)}}class Ug{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Mg(e,(t,e)=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return qg(this)}}class Vg{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=kg(this.parameters)),this._parameterMap}toString(){return tm(this)}}function Hg(t,e){return t.length===e.length&&t.every((t,n)=>t.path===e[n].path)}function jg(t,e){let n=[];return Mg(t.children,(t,i)=>{i===Sg&&(n=n.concat(e(t,i)))}),Mg(t.children,(t,i)=>{i!==Sg&&(n=n.concat(e(t,i)))}),n}class zg{}class Wg{parse(t){const e=new sm(t);return new Bg(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){return`${"/"+Kg(t.root,!0)}${function(t){const e=Object.keys(t).map(e=>{const n=t[e];return Array.isArray(n)?n.map(t=>`${Yg(e)}=${Yg(t)}`).join("&"):`${Yg(e)}=${Yg(n)}`});return e.length?"?"+e.join("&"):""}(t.queryParams)}${"string"==typeof t.fragment?"#"+encodeURI(t.fragment):""}`}}const Gg=new Wg;function qg(t){return t.segments.map(t=>tm(t)).join("/")}function Kg(t,e){if(!t.hasChildren())return qg(t);if(e){const e=t.children.primary?Kg(t.children.primary,!1):"",n=[];return Mg(t.children,(t,e)=>{e!==Sg&&n.push(`${e}:${Kg(t,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}{const e=jg(t,(e,n)=>n===Sg?[Kg(t.children.primary,!1)]:[`${n}:${Kg(e,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children.primary?`${qg(t)}/${e[0]}`:`${qg(t)}/(${e.join("//")})`}}function Xg(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Yg(t){return Xg(t).replace(/%3B/gi,";")}function Jg(t){return Xg(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Qg(t){return decodeURIComponent(t)}function Zg(t){return Qg(t.replace(/\+/g,"%20"))}function tm(t){return`${Jg(t.path)}${e=t.parameters,Object.keys(e).map(t=>`;${Jg(t)}=${Jg(e[t])}`).join("")}`;var e}const em=/^[^\/()?;=#]+/;function nm(t){const e=t.match(em);return e?e[0]:""}const im=/^[^=?&#]+/,rm=/^[^?&#]+/;class sm{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ug([],{}):new Ug([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n.primary=new Ug(t,e)),n}parseSegment(){const t=nm(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new Vg(Qg(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=nm(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=nm(this.remaining);t&&(n=t,this.capture(n))}t[Qg(e)]=Qg(n)}parseQueryParam(t){const e=function(t){const e=t.match(im);return e?e[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=function(t){const e=t.match(rm);return e?e[0]:""}(this.remaining);t&&(n=t,this.capture(n))}const i=Zg(e),r=Zg(n);if(t.hasOwnProperty(i)){let e=t[i];Array.isArray(e)||(e=[e],t[i]=e),e.push(r)}else t[i]=r}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=nm(this.remaining),i=this.remaining[n.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let r=void 0;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):t&&(r=Sg);const s=this.parseChildren();e[r]=1===Object.keys(s).length?s.primary:new Ug([],s),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class om{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=am(t,this._root);return e?e.children.map(t=>t.value):[]}firstChild(t){const e=am(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=lm(t,this._root);return e.length<2?[]:e[e.length-2].children.map(t=>t.value).filter(e=>e!==t)}pathFromRoot(t){return lm(t,this._root).map(t=>t.value)}}function am(t,e){if(t===e.value)return e;for(const n of e.children){const e=am(t,n);if(e)return e}return null}function lm(t,e){if(t===e.value)return[e];for(const n of e.children){const i=lm(t,n);if(i.length)return i.unshift(e),i}return[]}class cm{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function hm(t){const e={};return t&&t.children.forEach(t=>e[t.value.outlet]=t),e}class um extends om{constructor(t,e){super(t),this.snapshot=e,vm(this,t)}toString(){return this.snapshot.toString()}}function dm(t,e){const n=function(t,e){const n=new gm([],{},{},"",{},Sg,e,null,t.root,-1,{});return new mm("",new cm(n,[]))}(t,e),i=new gf([new Vg("",{})]),r=new gf({}),s=new gf({}),o=new gf({}),a=new gf(""),l=new pm(i,r,o,a,s,Sg,e,n.root);return l.snapshot=n.root,new um(new cm(l,[]),n)}class pm{constructor(t,e,n,i,r,s,o,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(k(t=>kg(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(k(t=>kg(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function fm(t,e="emptyOnly"){const n=t.pathFromRoot;let i=0;if("always"!==e)for(i=n.length-1;i>=1;){const t=n[i],e=n[i-1];if(t.routeConfig&&""===t.routeConfig.path)i--;else{if(e.component)break;i--}}return function(t){return t.reduce((t,e)=>({params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(i))}class gm{constructor(t,e,n,i,r,s,o,a,l,c,h){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this.routeConfig=a,this._urlSegment=l,this._lastPathIndex=c,this._resolve=h}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=kg(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(t=>t.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class mm extends om{constructor(t,e){super(e),this.url=t,vm(this,e)}toString(){return ym(this._root)}}function vm(t,e){e.value._routerState=t,e.children.forEach(e=>vm(t,e))}function ym(t){const e=t.children.length>0?` { ${t.children.map(ym).join(", ")} } `:"";return`${t.value}${e}`}function bm(t){if(t.snapshot){const e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Tg(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Tg(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(let n=0;nTg(t.parameters,i[e].parameters))&&!(!t.parent!=!e.parent)&&(!t.parent||wm(t.parent,e.parent))}function xm(t,e,n){if(n&&t.shouldReuseRoute(e.value,n.value.snapshot)){const i=n.value;i._futureSnapshot=e.value;const r=function(t,e,n){return e.children.map(e=>{for(const i of n.children)if(t.shouldReuseRoute(e.value,i.value.snapshot))return xm(t,e,i);return xm(t,e)})}(t,e,n);return new cm(i,r)}{const n=t.retrieve(e.value);if(n){const t=n.route;return _m(e,t),t}{const n=new pm(new gf((i=e.value).url),new gf(i.params),new gf(i.queryParams),new gf(i.fragment),new gf(i.data),i.outlet,i.component,i),r=e.children.map(e=>xm(t,e));return new cm(n,r)}}var i}function _m(t,e){if(t.value.routeConfig!==e.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==e.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");e.value._futureSnapshot=t.value;for(let n=0;n{s[e]=Array.isArray(t)?t.map(t=>""+t):""+t}),new Bg(n.root===t?e:km(n.root,t,e),s,r)}function km(t,e,n){const i={};return Mg(t.children,(t,r)=>{i[r]=t===e?n:km(t,e,n)}),new Ug(t.segments,i)}class Am{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Cm(n[0]))throw new Error("Root segment cannot have matrix parameters");const i=n.find(Sm);if(i&&i!==Lg(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Dm{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}function Tm(t,e,n){if(t||(t=new Ug([],{})),0===t.segments.length&&t.hasChildren())return Rm(t,e,n);const i=function(t,e,n){let i=0,r=e;const s={match:!1,pathIndex:0,commandIndex:0};for(;r=n.length)return s;const e=t.segments[r],o=n[i];if(Sm(o))break;const a=""+o,l=i0&&void 0===a)break;if(a&&l&&"object"==typeof l&&void 0===l.outlets){if(!Im(a,l,e))return s;i+=2}else{if(!Im(a,{},e))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(t,e,n),r=n.slice(i.commandIndex);if(i.match&&i.pathIndex{"string"==typeof n&&(n=[n]),null!==n&&(r[i]=Tm(t.children[i],e,n))}),Mg(t.children,(t,e)=>{void 0===i[e]&&(r[e]=t)}),new Ug(t.segments,r)}}function Fm(t,e,n){const i=t.segments.slice(0,e);let r=0;for(;r{"string"==typeof t&&(t=[t]),null!==t&&(e[n]=Fm(new Ug([],{}),0,t))}),e}function Mm(t){const e={};return Mg(t,(t,n)=>e[n]=""+t),e}function Im(t,e,n){return t==n.path&&Tg(e,n.parameters)}class $m{constructor(t,e,n,i){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=i}activate(t){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),bm(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{const e=t.value.outlet;this.deactivateRoutes(t,i[e],n),delete i[e]}),Mg(i,(t,e)=>{this.deactivateRouteAndItsChildren(t,n)})}deactivateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(i===r)if(i.component){const r=n.getContext(i.outlet);r&&this.deactivateChildRoutes(t,e,r.children)}else this.deactivateChildRoutes(t,e,n);else r&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const n=e.getContext(t.value.outlet);if(n&&n.outlet){const e=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:e,route:t,contexts:i})}}deactivateRouteAndOutlet(t,e){const n=e.getContext(t.value.outlet);if(n){const i=hm(t),r=t.value.component?n.children:e;Mg(i,(t,e)=>this.deactivateRouteAndItsChildren(t,r)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{this.activateRoutes(t,i[t.value.outlet],n),this.forwardEvent(new _g(t.value.snapshot))}),t.children.length&&this.forwardEvent(new wg(t.value.snapshot))}activateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(bm(i),i===r)if(i.component){const r=n.getOrCreateContext(i.outlet);this.activateChildRoutes(t,e,r.children)}else this.activateChildRoutes(t,e,n);else if(i.component){const e=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const t=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),e.children.onOutletReAttached(t.contexts),e.attachRef=t.componentRef,e.route=t.route.value,e.outlet&&e.outlet.attach(t.componentRef,t.route.value),Om(t.route)}else{const n=function(t){for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(i.snapshot),r=n?n.module.componentFactoryResolver:null;e.attachRef=null,e.route=i,e.resolver=r,e.outlet&&e.outlet.activateWith(i,r),this.activateChildRoutes(t,null,e.children)}}else this.activateChildRoutes(t,null,n)}}function Om(t){bm(t.value),t.children.forEach(Om)}class Pm{constructor(t,e){this.routes=t,this.module=e}}function Nm(t){return"function"==typeof t}function Bm(t){return t instanceof Bg}const Um=Symbol("INITIAL_VALUE");function Vm(){return Vf(t=>function(...t){let e=void 0,n=void 0;return E(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&l(t[0])&&(t=t[0]),z(t,n).lift(new wf(e))}(...t.map(t=>t.pipe(zf(1),function(...t){const e=t[t.length-1];return E(e)?(t.pop(),n=>qf(t,n,e)):e=>qf(t,e)}(Um)))).pipe(function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new Kf(t,e,n))}}((t,e)=>{let n=!1;return e.reduce((t,i,r)=>{if(t!==Um)return t;if(i===Um&&(n=!0),!n){if(!1===i)return i;if(r===e.length-1||Bm(i))return i}return t},t)},Um),Af(t=>t!==Um),k(t=>Bm(t)?t:!0===t),zf(1)))}let Hm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:function(){return[Ov]},encapsulation:2}),t})();function jm(t,e=""){for(let n=0;ne.error(new Km(t)))}function Jm(t){return new y(e=>e.error(new Xm(t)))}function Qm(t){return new y(e=>e.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Zm{constructor(t,e,n,i,r){this.configLoader=e,this.urlSerializer=n,this.urlTree=i,this.config=r,this.allowRedirects=!0,this.ngModule=t.get(_l)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Sg).pipe(k(t=>this.createUrlTree(t,this.urlTree.queryParams,this.urlTree.fragment))).pipe(Yf(t=>{if(t instanceof Xm)return this.allowRedirects=!1,this.match(t.urlTree);if(t instanceof Km)throw this.noMatchError(t);throw t}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,Sg).pipe(k(e=>this.createUrlTree(e,t.queryParams,t.fragment))).pipe(Yf(t=>{if(t instanceof Km)throw this.noMatchError(t);throw t}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,n){const i=t.segments.length>0?new Ug([],{[Sg]:t}):t;return new Bg(i,e,n)}expandSegmentGroup(t,e,n,i){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(k(t=>new Ug([],t))):this.expandSegment(t,n,e,n.segments,i,!0)}expandChildren(t,e,n){return function(t,e){if(0===Object.keys(t).length)return ff({});const n=[],i=[],r={};return Mg(t,(t,s)=>{const o=e(s,t).pipe(k(t=>r[s]=t));s===Sg?n.push(o):i.push(o)}),ff.apply(null,n.concat(i)).pipe(kf(),function(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,Ff(1),n?Nf(e):If(()=>new _f))}(),k(()=>r))}(n.children,(n,i)=>this.expandSegmentGroup(t,e,i,n))}expandSegment(t,e,n,i,r,s){const o=function(t){return t.reduce((t,e)=>{const n=qm(e);return t.has(n)?t.get(n).push(e):t.set(n,[e]),t},new Map)}(n);o.has(r)||o.set(r,[]);const a=n=>O(n).pipe(Zf(o=>this.expandSegmentAgainstRoute(t,e,n,o,i,r,s).pipe(Yf(t=>{if(t instanceof Km)return ff(null);throw t}))),tg(t=>null!==t),Yf(t=>{if(t instanceof _f||"EmptyError"===t.name){if(this.noLeftoversInUrl(e,i,r))return ff(new Ug([],{}));throw new Km(e)}throw t}));return O(Array.from(o.entries()).map(([t,e])=>{const n=a(e);return t===r?n:n.pipe(k(()=>null),Yf(()=>ff(null)))})).pipe(t=>t.lift(new wf(void 0)),tg(),k(t=>t.find(t=>null!==t)))}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}expandSegmentAgainstRoute(t,e,n,i,r,s,o){return qm(i)!==s&&""!==i.path?Ym(e):void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,e,i,r):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s):Ym(e)}expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,i,s):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,n,i){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Jm(r):this.lineralizeSegments(n,r).pipe(U(n=>{const r=new Ug(n,{});return this.expandSegment(t,r,e,n,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){const{matched:o,consumedSegments:a,lastChild:l,positionalParamSegments:c}=tv(e,i,r);if(!o)return Ym(e);const h=this.applyRedirectCommands(a,i.redirectTo,c);return i.redirectTo.startsWith("/")?Jm(h):this.lineralizeSegments(i,h).pipe(U(i=>this.expandSegment(t,e,n,i.concat(r.slice(l)),s,!1)))}matchSegmentAgainstRoute(t,e,n,i){if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(k(t=>(n._loadedConfig=t,new Ug(i,{})))):ff(new Ug(i,{}));const{matched:r,consumedSegments:s,lastChild:o}=tv(e,n,i);if(!r)return Ym(e);const a=i.slice(o);return this.getChildConfig(t,n,i).pipe(U(t=>{const n=t.module,i=t.routes,{segmentGroup:r,slicedSegments:o}=function(t,e,n,i){return n.length>0&&function(t,e,n){return n.some(n=>nv(t,e,n)&&qm(n)!==Sg)}(t,n,i)?{segmentGroup:ev(new Ug(e,function(t,e){const n={};n.primary=e;for(const i of t)""===i.path&&qm(i)!==Sg&&(n[qm(i)]=new Ug([],{}));return n}(i,new Ug(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some(n=>nv(t,e,n))}(t,n,i)?{segmentGroup:ev(new Ug(t.segments,function(t,e,n,i){const r={};for(const s of n)nv(t,e,s)&&!i[qm(s)]&&(r[qm(s)]=new Ug([],{}));return Object.assign(Object.assign({},i),r)}(t,n,i,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,s,a,i);return 0===o.length&&r.hasChildren()?this.expandChildren(n,i,r).pipe(k(t=>new Ug(s,t))):0===i.length&&0===o.length?ff(new Ug(s,{})):this.expandSegment(n,r,i,o,Sg,!0).pipe(k(t=>new Ug(s.concat(t.segments),t.children)))}))}getChildConfig(t,e,n){return e.children?ff(new Pm(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?ff(e._loadedConfig):this.runCanLoadGuards(t.injector,e,n).pipe(U(n=>n?this.configLoader.load(t.injector,e).pipe(k(t=>(e._loadedConfig=t,t))):function(t){return new y(e=>e.error(Ag(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):ff(new Pm([],t))}runCanLoadGuards(t,e,n){const i=e.canLoad;return i&&0!==i.length?ff(i.map(i=>{const r=t.get(i);let s;if(function(t){return t&&Nm(t.canLoad)}(r))s=r.canLoad(e,n);else{if(!Nm(r))throw new Error("Invalid CanLoad guard");s=r(e,n)}return Ig(s)})).pipe(Vm(),ng(t=>{if(!Bm(t))return;const e=Ag(`Redirecting to "${this.urlSerializer.serialize(t)}"`);throw e.url=t,e}),k(t=>!0===t)):ff(!0)}lineralizeSegments(t,e){let n=[],i=e.root;for(;;){if(n=n.concat(i.segments),0===i.numberOfChildren)return ff(n);if(i.numberOfChildren>1||!i.children.primary)return Qm(t.redirectTo);i=i.children.primary}}applyRedirectCommands(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)}applyRedirectCreatreUrlTree(t,e,n,i){const r=this.createSegmentGroup(t,e.root,n,i);return new Bg(r,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const n={};return Mg(t,(t,i)=>{if("string"==typeof t&&t.startsWith(":")){const r=t.substring(1);n[i]=e[r]}else n[i]=t}),n}createSegmentGroup(t,e,n,i){const r=this.createSegments(t,e.segments,n,i);let s={};return Mg(e.children,(e,r)=>{s[r]=this.createSegmentGroup(t,e,n,i)}),new Ug(r,s)}createSegments(t,e,n,i){return e.map(e=>e.path.startsWith(":")?this.findPosParam(t,e,i):this.findOrReturn(e,n))}findPosParam(t,e,n){const i=n[e.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return i}findOrReturn(t,e){let n=0;for(const i of e){if(i.path===t.path)return e.splice(n),i;n++}return t}}function tv(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:{}};const i=(e.matcher||Dg)(n,t,e);return i?{matched:!0,consumedSegments:i.consumed,lastChild:i.consumed.length,positionalParamSegments:i.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function ev(t){if(1===t.numberOfChildren&&t.children.primary){const e=t.children.primary;return new Ug(t.segments.concat(e.segments),e.children)}return t}function nv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}class iv{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class rv{constructor(t,e){this.component=t,this.route=e}}function sv(t,e,n){const i=t._root;return av(i,e?e._root:null,n,[i.value])}function ov(t,e,n){const i=function(t){if(!t)return null;for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(i?i.module.injector:n).get(t)}function av(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=hm(e);return t.children.forEach(t=>{!function(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=t.value,o=e?e.value:null,a=n?n.getContext(t.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){const l=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!Hg(t.url,e.url);case"pathParamsOrQueryParamsChange":return!Hg(t.url,e.url)||!Tg(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!wm(t,e)||!Tg(t.queryParams,e.queryParams);case"paramsChange":default:return!wm(t,e)}}(o,s,s.routeConfig.runGuardsAndResolvers);l?r.canActivateChecks.push(new iv(i)):(s.data=o.data,s._resolvedData=o._resolvedData),av(t,e,s.component?a?a.children:null:n,i,r),l&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new rv(a.outlet.component,o))}else o&&lv(e,a,r),r.canActivateChecks.push(new iv(i)),av(t,null,s.component?a?a.children:null:n,i,r)}(t,s[t.value.outlet],n,i.concat([t.value]),r),delete s[t.value.outlet]}),Mg(s,(t,e)=>lv(t,n.getContext(e),r)),r}function lv(t,e,n){const i=hm(t),r=t.value;Mg(i,(t,i)=>{lv(t,r.component?e?e.children.getContext(i):null:e,n)}),n.canDeactivateChecks.push(new rv(r.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,r))}function cv(t,e){return null!==t&&e&&e(new xg(t)),ff(!0)}function hv(t,e){return null!==t&&e&&e(new bg(t)),ff(!0)}function uv(t,e,n){const i=e.routeConfig?e.routeConfig.canActivate:null;return i&&0!==i.length?ff(i.map(i=>Ef(()=>{const r=ov(i,e,n);let s;if(function(t){return t&&Nm(t.canActivate)}(r))s=Ig(r.canActivate(e,t));else{if(!Nm(r))throw new Error("Invalid CanActivate guard");s=Ig(r(e,t))}return s.pipe(tg())}))).pipe(Vm()):ff(!0)}function dv(t,e,n){const i=e[e.length-1],r=e.slice(0,e.length-1).reverse().map(t=>function(t){const e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)).filter(t=>null!==t).map(e=>Ef(()=>ff(e.guards.map(r=>{const s=ov(r,e.node,n);let o;if(function(t){return t&&Nm(t.canActivateChild)}(s))o=Ig(s.canActivateChild(i,t));else{if(!Nm(s))throw new Error("Invalid CanActivateChild guard");o=Ig(s(i,t))}return o.pipe(tg())})).pipe(Vm())));return ff(r).pipe(Vm())}class pv{}class fv{constructor(t,e,n,i,r,s){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=i,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=s}recognize(){try{const t=vv(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,Sg),n=new gm([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Sg,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new cm(n,e),r=new mm(this.url,i);return this.inheritParamsAndData(r._root),ff(r)}catch(t){return new y(e=>e.error(t))}}inheritParamsAndData(t){const e=t.value,n=fm(e,this.paramsInheritanceStrategy);e.params=Object.freeze(n.params),e.data=Object.freeze(n.data),t.children.forEach(t=>this.inheritParamsAndData(t))}processSegmentGroup(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)}processChildren(t,e){const n=jg(e,(e,n)=>this.processSegmentGroup(t,e,n));return function(t){const e={};t.forEach(t=>{const n=e[t.value.outlet];if(n){const e=n.url.map(t=>t.toString()).join("/"),i=t.value.url.map(t=>t.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${e}' and '${i}'.`)}e[t.value.outlet]=t.value})}(n),n.sort((t,e)=>t.value.outlet===Sg?-1:e.value.outlet===Sg?1:t.value.outlet.localeCompare(e.value.outlet)),n}processSegment(t,e,n,i){for(const s of t)try{return this.processSegmentAgainstRoute(s,e,n,i)}catch(r){if(!(r instanceof pv))throw r}if(this.noLeftoversInUrl(e,n,i))return[];throw new pv}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}processSegmentAgainstRoute(t,e,n,i){if(t.redirectTo)throw new pv;if((t.outlet||Sg)!==i)throw new pv;let r,s=[],o=[];if("**"===t.path){const s=n.length>0?Lg(n).parameters:{};r=new gm(n,s,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+n.length,wv(t))}else{const a=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new pv;return{consumedSegments:[],lastChild:0,parameters:{}}}const i=(e.matcher||Dg)(n,t,e);if(!i)throw new pv;const r={};Mg(i.posParams,(t,e)=>{r[e]=t.path});const s=i.consumed.length>0?Object.assign(Object.assign({},r),i.consumed[i.consumed.length-1].parameters):r;return{consumedSegments:i.consumed,lastChild:i.consumed.length,parameters:s}}(e,t,n);s=a.consumedSegments,o=n.slice(a.lastChild),r=new gm(s,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+s.length,wv(t))}const a=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),{segmentGroup:l,slicedSegments:c}=vv(e,s,o,a,this.relativeLinkResolution);if(0===c.length&&l.hasChildren()){const t=this.processChildren(a,l);return[new cm(r,t)]}if(0===a.length&&0===c.length)return[new cm(r,[])];const h=this.processSegment(a,l,c,Sg);return[new cm(r,h)]}}function gv(t){let e=t;for(;e._sourceSegment;)e=e._sourceSegment;return e}function mv(t){let e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,n+=e._segmentIndexShift?e._segmentIndexShift:0;return n-1}function vv(t,e,n,i,r){if(n.length>0&&function(t,e,n){return n.some(n=>yv(t,e,n)&&qm(n)!==Sg)}(t,n,i)){const r=new Ug(e,function(t,e,n,i){const r={};r.primary=i,i._sourceSegment=t,i._segmentIndexShift=e.length;for(const s of n)if(""===s.path&&qm(s)!==Sg){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift=e.length,r[qm(s)]=n}return r}(t,e,i,new Ug(n,t.children)));return r._sourceSegment=t,r._segmentIndexShift=e.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some(n=>yv(t,e,n))}(t,n,i)){const s=new Ug(t.segments,function(t,e,n,i,r,s){const o={};for(const a of i)if(yv(t,n,a)&&!r[qm(a)]){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift="legacy"===s?t.segments.length:e.length,o[qm(a)]=n}return Object.assign(Object.assign({},r),o)}(t,e,n,i,t.children,r));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}const s=new Ug(t.segments,t.children);return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}function yv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function bv(t){return t.data||{}}function wv(t){return t.resolve||{}}function xv(t){return function(e){return e.pipe(Vf(e=>{const n=t(e);return n?O(n).pipe(k(()=>e)):O([e])}))}}class _v extends class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}{}const Cv=new Yn("ROUTES");class Sv{constructor(t,e,n,i){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=i}load(t,e){return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(k(n=>{this.onLoadEndListener&&this.onLoadEndListener(e);const i=n.create(t);return new Pm(Fg(i.injector.get(Cv)).map(Gm),i)}))}loadModuleFactory(t){return"string"==typeof t?O(this.loader.load(t)):Ig(t()).pipe(U(t=>t instanceof Cl?ff(t):O(this.compiler.compileModuleAsync(t))))}}class Ev{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new kv,this.attachRef=null}}class kv{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new Ev,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}class Av{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function Dv(t){throw t}function Tv(t,e,n){return e.parse("/")}function Rv(t,e){return ff(null)}let Fv=(()=>{class t{constructor(t,e,n,i,r,s,o,a){this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=i,this.config=a,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new C,this.errorHandler=Dv,this.malformedUriErrorHandler=Tv,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Rv,afterPreactivation:Rv},this.urlHandlingStrategy=new Av,this.routeReuseStrategy=new _v,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.ngModule=r.get(_l),this.console=r.get(xc);const l=r.get(Ic);this.isNgZoneEnabled=l instanceof Ic,this.resetConfig(a),this.currentUrlTree=new Bg(new Ug([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Sv(s,o,t=>this.triggerEvent(new vg(t)),t=>this.triggerEvent(new yg(t))),this.routerState=dm(this.currentUrlTree,this.rootComponentType),this.transitions=new gf({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()}setupNavigations(t){const e=this.events;return t.pipe(Af(t=>0!==t.id),k(t=>Object.assign(Object.assign({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl)})),Vf(t=>{let n=!1,i=!1;return ff(t).pipe(ng(t=>{this.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Vf(t=>{const n=!this.navigated||t.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return ff(t).pipe(Vf(t=>{const n=this.transitions.getValue();return e.next(new lg(t.id,this.serializeUrl(t.extractedUrl),t.source,t.restoredState)),n!==this.transitions.getValue()?Cf:[t]}),Vf(t=>Promise.resolve(t)),(i=this.ngModule.injector,r=this.configLoader,s=this.urlSerializer,o=this.config,function(t){return t.pipe(Vf(t=>function(t,e,n,i,r){return new Zm(t,e,n,i,r).apply()}(i,r,s,t.extractedUrl,o).pipe(k(e=>Object.assign(Object.assign({},t),{urlAfterRedirects:e})))))}),ng(t=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:t.urlAfterRedirects})}),function(t,e,n,i,r){return function(s){return s.pipe(U(s=>function(t,e,n,i,r="emptyOnly",s="legacy"){return new fv(t,e,n,i,r,s).recognize()}(t,e,s.urlAfterRedirects,n(s.urlAfterRedirects),i,r).pipe(k(t=>Object.assign(Object.assign({},s),{targetSnapshot:t})))))}}(this.rootComponentType,this.config,t=>this.serializeUrl(t),this.paramsInheritanceStrategy,this.relativeLinkResolution),ng(t=>{"eager"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),ng(t=>{const n=new dg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.next(n)}));var i,r,s,o;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:i,source:r,restoredState:s,extras:o}=t,a=new lg(n,this.serializeUrl(i),r,s);e.next(a);const l=dm(i,this.rootComponentType).snapshot;return ff(Object.assign(Object.assign({},t),{targetSnapshot:l,urlAfterRedirects:i,extras:Object.assign(Object.assign({},o),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=t.rawUrl,this.browserUrlTree=t.urlAfterRedirects,t.resolve(null),Cf}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.beforePreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),ng(t=>{const e=new pg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),k(t=>Object.assign(Object.assign({},t),{guards:sv(t.targetSnapshot,t.currentSnapshot,this.rootContexts)})),function(t,e){return function(n){return n.pipe(U(n=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:o}}=n;return 0===o.length&&0===s.length?ff(Object.assign(Object.assign({},n),{guardsResult:!0})):function(t,e,n,i){return O(t).pipe(U(t=>function(t,e,n,i,r){const s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return s&&0!==s.length?ff(s.map(s=>{const o=ov(s,e,r);let a;if(function(t){return t&&Nm(t.canDeactivate)}(o))a=Ig(o.canDeactivate(t,e,n,i));else{if(!Nm(o))throw new Error("Invalid CanDeactivate guard");a=Ig(o(t,e,n,i))}return a.pipe(tg())})).pipe(Vm()):ff(!0)}(t.component,t.route,n,e,i)),tg(t=>!0!==t,!0))}(o,i,r,t).pipe(U(n=>n&&"boolean"==typeof n?function(t,e,n,i){return O(e).pipe(Zf(e=>O([hv(e.route.parent,i),cv(e.route,i),dv(t,e.path,n),uv(t,e.route,n)]).pipe(kf(),tg(t=>!0!==t,!0))),tg(t=>!0!==t,!0))}(i,s,t,e):ff(n)),k(t=>Object.assign(Object.assign({},n),{guardsResult:t})))}))}}(this.ngModule.injector,t=>this.triggerEvent(t)),ng(t=>{if(Bm(t.guardsResult)){const e=Ag(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);throw e.url=t.guardsResult,e}}),ng(t=>{const e=new fg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);this.triggerEvent(e)}),Af(t=>{if(!t.guardsResult){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"");return e.next(n),t.resolve(!1),!1}return!0}),xv(t=>{if(t.guards.canActivateChecks.length)return ff(t).pipe(ng(t=>{const e=new gg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),Vf(t=>{let n=!1;return ff(t).pipe((i=this.paramsInheritanceStrategy,r=this.ngModule.injector,function(t){return t.pipe(U(t=>{const{targetSnapshot:e,guards:{canActivateChecks:n}}=t;if(!n.length)return ff(t);let s=0;return O(n).pipe(Zf(t=>function(t,e,n,i){return function(t,e,n,i){const r=Object.keys(t);if(0===r.length)return ff({});const s={};return O(r).pipe(U(r=>function(t,e,n,i){const r=ov(t,e,i);return Ig(r.resolve?r.resolve(e,n):r(e,n))}(t[r],e,n,i).pipe(ng(t=>{s[r]=t}))),Ff(1),U(()=>Object.keys(s).length===r.length?ff(s):Cf))}(t._resolve,t,e,i).pipe(k(e=>(t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),fm(t,n).resolve),null)))}(t.route,e,i,r)),ng(()=>s++),Ff(1),U(e=>s===n.length?ff(t):Cf))}))}),ng({next:()=>n=!0,complete:()=>{if(!n){const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");e.next(n),t.resolve(!1)}}}));var i,r}),ng(t=>{const e=new mg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}))}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.afterPreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),k(t=>{const e=function(t,e,n){const i=xm(t,e._root,n?n._root:void 0);return new um(i,e)}(this.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:e})}),ng(t=>{this.currentUrlTree=t.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl),this.routerState=t.targetRouterState,"deferred"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),(s=this.rootContexts,o=this.routeReuseStrategy,a=t=>this.triggerEvent(t),k(t=>(new $m(o,t.targetRouterState,t.currentRouterState,a).activate(s),t))),ng({next(){n=!0},complete(){n=!0}}),(r=()=>{if(!n&&!i){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),`Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);e.next(n),t.resolve(!1)}this.currentNavigation=null},t=>t.lift(new sg(r))),Yf(n=>{if(i=!0,(r=n)&&r.ngNavigationCancelingError){const i=Bm(n.url);i||(this.navigated=!0,this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));const r=new hg(t.id,this.serializeUrl(t.extractedUrl),n.message);e.next(r),i?setTimeout(()=>{const e=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);return this.scheduleNavigation(e,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})},0):t.resolve(!1)}else{this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);const i=new ug(t.id,this.serializeUrl(t.extractedUrl),n);e.next(i);try{t.resolve(this.errorHandler(n))}catch(s){t.reject(s)}}var r;return Cf}));var r,s,o,a}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}getTransition(){const t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const e=this.extractLocationChangeInfoFromEvent(t);this.shouldScheduleNavigation(this.lastLocationChangeInfo,e)&&setTimeout(()=>{const{source:t,state:n,urlTree:i}=e,r={replaceUrl:!0};if(n){const t=Object.assign({},n);delete t.navigationId,0!==Object.keys(t).length&&(r.state=t)}this.scheduleNavigation(i,t,n,r)},0),this.lastLocationChangeInfo=e}))}extractLocationChangeInfoFromEvent(t){var e;return{source:"popstate"===t.type?"popstate":"hashchange",urlTree:this.parseUrl(t.url),state:(null===(e=t.state)||void 0===e?void 0:e.navigationId)?t.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(t,e){if(!t)return!0;const n=e.urlTree.toString()===t.urlTree.toString();return!(e.transitionId===t.transitionId&&n&&("hashchange"===e.source&&"popstate"===t.source||"popstate"===e.source&&"hashchange"===t.source))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){jm(t),this.config=t.map(Gm),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)}createUrlTree(t,e={}){const{relativeTo:n,queryParams:i,fragment:r,queryParamsHandling:s,preserveFragment:o}=e,a=n||this.routerState.root,l=o?this.currentUrlTree.fragment:r;let c=null;switch(s){case"merge":c=Object.assign(Object.assign({},this.currentUrlTree.queryParams),i);break;case"preserve":c=this.currentUrlTree.queryParams;break;default:c=i||null}return null!==c&&(c=this.removeEmptyProps(c)),function(t,e,n,i,r){if(0===n.length)return Em(e.root,e.root,e,i,r);const s=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Am(!0,0,t);let e=0,n=!1;const i=t.reduce((t,i,r)=>{if("object"==typeof i&&null!=i){if(i.outlets){const e={};return Mg(i.outlets,(t,n)=>{e[n]="string"==typeof t?t.split("/"):t}),[...t,{outlets:e}]}if(i.segmentPath)return[...t,i.segmentPath]}return"string"!=typeof i?[...t,i]:0===r?(i.split("/").forEach((i,r)=>{0==r&&"."===i||(0==r&&""===i?n=!0:".."===i?e++:""!=i&&t.push(i))}),t):[...t,i]},[]);return new Am(n,e,i)}(n);if(s.toRoot())return Em(e.root,new Ug([],{}),e,i,r);const o=function(t,e,n){if(t.isAbsolute)return new Dm(e.root,!0,0);if(-1===n.snapshot._lastPathIndex){const t=n.snapshot._urlSegment;return new Dm(t,t===e.root,0)}const i=Cm(t.commands[0])?0:1;return function(t,e,n){let i=t,r=e,s=n;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new Dm(i,!1,r-s)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(s,e,t),a=o.processChildren?Rm(o.segmentGroup,o.index,s.commands):Tm(o.segmentGroup,o.index,s.commands);return Em(o.segmentGroup,a,e,i,r)}(a,this.currentUrlTree,t,c,l)}navigateByUrl(t,e={skipLocationChange:!1}){const n=Bm(t)?t:this.parseUrl(t),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,e)}navigate(t,e={skipLocationChange:!1}){return function(t){for(let e=0;e{const i=t[n];return null!=i&&(e[n]=i),e},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.events.next(new cg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,t.resolve(!0)},t=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(t,e,n,i,r){const s=this.getTransition(),o="imperative"!==e&&"imperative"===(null==s?void 0:s.source),a=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===t.toString();if(o&&a)return Promise.resolve(!0);let l,c,h;r?(l=r.resolve,c=r.reject,h=r.promise):h=new Promise((t,e)=>{l=t,c=e});const u=++this.navigationId;return this.setTransition({id:u,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:i,resolve:l,reject:c,promise:h,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),h.catch(t=>Promise.reject(t))}setBrowserUrl(t,e,n,i){const r=this.urlSerializer.serialize(t);i=i||{},this.location.isCurrentPathEqualTo(r)||e?this.location.replaceState(r,"",Object.assign(Object.assign({},i),{navigationId:n})):this.location.go(r,"",Object.assign(Object.assign({},i),{navigationId:n}))}resetStateAndUrl(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qn),bi(zg),bi(kv),bi(Dh),bi(ho),bi(ih),bi(Fc),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Lv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.route=e,this.commands=[],this.onChanges=new C,null==n&&i.setAttribute(r.nativeElement,"tabindex","0")}ngOnChanges(t){this.onChanges.next(this)}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}onClick(){const t={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,t),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),qn("tabindex"),Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})(),Mv=(()=>{class t{constructor(t,e,n){this.router=t,this.route=e,this.locationStrategy=n,this.commands=[],this.onChanges=new C,this.subscription=t.events.subscribe(t=>{t instanceof cg&&this.updateTargetUrlAndHref()})}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}ngOnChanges(t){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(t,e,n,i,r){if(0!==t||e||n||i||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const s={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,s),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),Ro(Ch))},t.\u0275dir=Wt({type:t,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.onClick(t.button,t.ctrlKey,t.shiftKey,t.altKey,t.metaKey)}),2&t&&(xa("href",e.href,nr),ko("target",e.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})();function Iv(t){return""===t||!!t}let $v=(()=>{class t{constructor(t,e,n,i,r,s){this.router=t,this.element=e,this.renderer=n,this.cdr=i,this.link=r,this.linkWithHref=s,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=t.events.subscribe(t=>{t instanceof cg&&this.update()})}ngAfterContentInit(){O([this.links.changes,this.linksWithHrefs.changes,ff(null)]).pipe(j()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var t;null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe();const e=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(t=>!!t).map(t=>t.onChanges);this.linkInputChangesSubscription=O(e).pipe(j()).subscribe(t=>{this.isActive!==this.isLinkActive(this.router)(t)&&this.update()})}set routerLinkActive(t){const e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(t=>!!t)}ngOnChanges(t){this.update()}ngOnDestroy(){var t;this.routerEventsSubscription.unsubscribe(),null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const t=this.hasActiveLinks();this.isActive!==t&&(this.isActive=t,this.cdr.markForCheck(),this.classes.forEach(e=>{t?this.renderer.addClass(this.element.nativeElement,e):this.renderer.removeClass(this.element.nativeElement,e)}))})}isLinkActive(t){return e=>t.isActive(e.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.linkWithHref&&t(this.linkWithHref)||this.links.some(t)||this.linksWithHrefs.some(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(za),Ro(Ga),Ro(pl),Ro(Lv,8),Ro(Mv,8))},t.\u0275dir=Wt({type:t,selectors:[["","routerLinkActive",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Lv,!0),ac(n,Mv,!0)),2&t){let t;ic(t=lc())&&(e.links=t),ic(t=lc())&&(e.linksWithHrefs=t)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[le]}),t})(),Ov=(()=>{class t{constructor(t,e,n,i,r){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=r,this.activated=null,this._activatedRoute=null,this.activateEvents=new Wl,this.deactivateEvents=new Wl,this.name=i||Sg,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),i=this.parentContexts.getOrCreateContext(this.name).children,r=new Pv(t,i,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return t.\u0275fac=function(e){return new(e||t)(Ro(kv),Ro(El),Ro(Ua),qn("name"),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class Pv{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===pm?this.route:t===kv?this.childContexts:this.parent.get(t,e)}}class Nv{}class Bv{preload(t,e){return ff(null)}}let Uv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.injector=i,this.preloadingStrategy=r,this.loader=new Sv(e,n,e=>t.triggerEvent(new vg(e)),e=>t.triggerEvent(new yg(e)))}setUpPreloading(){this.subscription=this.router.events.pipe(Af(t=>t instanceof cg),Zf(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(_l);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,e){const n=[];for(const i of e)if(i.loadChildren&&!i.canLoad&&i._loadedConfig){const t=i._loadedConfig;n.push(this.processRoutes(t.module,t.routes))}else i.loadChildren&&!i.canLoad?n.push(this.preloadConfig(t,i)):i.children&&n.push(this.processRoutes(t,i.children));return O(n).pipe(j(),k(t=>{}))}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>this.loader.load(t.injector,e).pipe(U(t=>(e._loadedConfig=t,this.processRoutes(t.module,t.routes)))))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(ih),bi(Fc),bi(ho),bi(Nv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Vv=(()=>{class t{constructor(t,e,n={}){this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof lg?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof cg&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Cg&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.router.triggerEvent(new Cg(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(Kh),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Hv=new Yn("ROUTER_CONFIGURATION"),jv=new Yn("ROUTER_FORROOT_GUARD"),zv=[Dh,{provide:zg,useClass:Wg},{provide:Fv,useFactory:function(t,e,n,i,r,s,o,a={},l,c){const h=new Fv(null,t,e,n,i,r,s,Fg(o));if(l&&(h.urlHandlingStrategy=l),c&&(h.routeReuseStrategy=c),function(t,e){t.errorHandler&&(e.errorHandler=t.errorHandler),t.malformedUriErrorHandler&&(e.malformedUriErrorHandler=t.malformedUriErrorHandler),t.onSameUrlNavigation&&(e.onSameUrlNavigation=t.onSameUrlNavigation),t.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=t.paramsInheritanceStrategy),t.relativeLinkResolution&&(e.relativeLinkResolution=t.relativeLinkResolution),t.urlUpdateStrategy&&(e.urlUpdateStrategy=t.urlUpdateStrategy)}(a,h),a.enableTracing){const t=dh();h.events.subscribe(e=>{t.logGroup("Router Event: "+e.constructor.name),t.log(e.toString()),t.log(e),t.logGroupEnd()})}return h},deps:[zg,kv,Dh,ho,ih,Fc,Cv,Hv,[class{},new li],[class{},new li]]},kv,{provide:pm,useFactory:function(t){return t.routerState.root},deps:[Fv]},{provide:ih,useClass:oh},Uv,Bv,class{preload(t,e){return e().pipe(Yf(()=>ff(null)))}},{provide:Hv,useValue:{enableTracing:!1}}];function Wv(){return new Yc("Router",Fv)}let Gv=(()=>{class t{constructor(t,e){}static forRoot(e,n){return{ngModule:t,providers:[zv,Yv(e),{provide:jv,useFactory:Xv,deps:[[Fv,new li,new hi]]},{provide:Hv,useValue:n||{}},{provide:Ch,useFactory:Kv,deps:[fh,[new ai(Eh),new li],Hv]},{provide:Vv,useFactory:qv,deps:[Fv,Kh,Hv]},{provide:Nv,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Bv},{provide:Yc,multi:!0,useFactory:Wv},[Jv,{provide:pc,multi:!0,useFactory:Qv,deps:[Jv]},{provide:ty,useFactory:Zv,deps:[Jv]},{provide:wc,multi:!0,useExisting:ty}]]}}static forChild(e){return{ngModule:t,providers:[Yv(e)]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(jv,8),bi(Fv,8))}}),t})();function qv(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Vv(t,e,n)}function Kv(t,e,n={}){return n.useHash?new Ah(t,e):new kh(t,e)}function Xv(t){return"guarded"}function Yv(t){return[{provide:Jn,multi:!0,useValue:t},{provide:Cv,multi:!0,useValue:t}]}let Jv=(()=>{class t{constructor(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new C}appInitializer(){return this.injector.get(mh,Promise.resolve(null)).then(()=>{let t=null;const e=new Promise(e=>t=e),n=this.injector.get(Fv),i=this.injector.get(Hv);return"disabled"===i.initialNavigation?(n.setUpLocationChangeListener(),t(!0)):"enabled"===i.initialNavigation||"enabledBlocking"===i.initialNavigation?(n.hooks.afterPreactivation=()=>this.initNavigation?ff(null):(this.initNavigation=!0,t(!0),this.resultOfPreactivationDone),n.initialNavigation()):t(!0),e})}bootstrapListener(t){const e=this.injector.get(Hv),n=this.injector.get(Uv),i=this.injector.get(Vv),r=this.injector.get(Fv),s=this.injector.get(eh);t===s.components[0]&&("enabledNonBlocking"!==e.initialNavigation&&void 0!==e.initialNavigation||r.initialNavigation(),n.setUpPreloading(),i.init(),r.resetRootComponentType(s.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Qv(t){return t.appInitializer.bind(t)}function Zv(t){return t.bootstrapListener.bind(t)}const ty=new Yn("Router Initializer");function ey(t,e){return new y(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,s!==i&&c||(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}const ny=new Yn("NgValueAccessor"),iy={provide:ny,useExisting:st(()=>ry),multi:!0};let ry=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.checked)})("blur",function(){return e.onTouched()})},features:[Pa([iy])]}),t})();const sy={provide:ny,useExisting:st(()=>ay),multi:!0},oy=new Yn("CompositionEventMode");let ay=(()=>{class t{constructor(t,e,n){this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=t=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=dh()?dh().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(oy,8))},t.\u0275dir=Wt({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[Pa([sy])]}),t})();function ly(t){return null==t||0===t.length}function cy(t){return null!=t&&"number"==typeof t.length}const hy=new Yn("NgValidators"),uy=new Yn("NgAsyncValidators"),dy=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class py{static min(t){return e=>{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}}static required(t){return ly(t.value)?{required:!0}:null}static requiredTrue(t){return!0===t.value?null:{required:!0}}static email(t){return ly(t.value)||dy.test(t.value)?null:{email:!0}}static minLength(t){return e=>ly(e.value)||!cy(e.value)?null:e.value.lengthcy(e.value)&&e.value.length>t?{maxlength:{requiredLength:t,actualLength:e.value.length}}:null}static pattern(t){if(!t)return py.nullValidator;let e,n;return"string"==typeof t?(n="","^"!==t.charAt(0)&&(n+="^"),n+=t,"$"!==t.charAt(t.length-1)&&(n+="$"),e=new RegExp(n)):(n=t.toString(),e=t),t=>{if(ly(t.value))return null;const i=t.value;return e.test(i)?null:{pattern:{requiredPattern:n,actualValue:i}}}}static nullValidator(t){return null}static compose(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return my(vy(t,e))}}static composeAsync(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return function(...t){if(1===t.length){const e=t[0];if(l(e))return ey(e,null);if(c(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ey(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return ey(t=1===t.length&&l(t[0])?t[0]:t,null).pipe(k(t=>e(...t)))}return ey(t,null)}(vy(t,e).map(gy)).pipe(k(my))}}}function fy(t){return null!=t}function gy(t){const e=Bo(t)?O(t):t;return Uo(e),e}function my(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function vy(t,e){return e.map(e=>e(t))}function yy(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function by(t){return null!=t?py.compose(yy(t)):null}function wy(t){return null!=t?py.composeAsync(yy(t)):null}function xy(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function _y(t){return t._rawValidators}function Cy(t){return t._rawAsyncValidators}let Sy=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=by(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=wy(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t}),t})(),Ey=(()=>{class t extends Sy{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(e){return ky(e||t)},t.\u0275dir=Wt({type:t,features:[po]}),t})();const ky=Gn(Ey);class Ay extends Sy{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class Dy{constructor(t){this._cd=t}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}let Ty=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ay,2))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})(),Ry=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,2))},t.\u0275dir=Wt({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})();const Fy={provide:ny,useExisting:st(()=>Ly),multi:!0};let Ly=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Fy])]}),t})();const My={provide:ny,useExisting:st(()=>$y),multi:!0};let Iy=(()=>{class t{constructor(){this._accessors=[]}add(t,e){this._accessors.push([t,e])}remove(t){for(let e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)}select(t){this._accessors.forEach(e=>{this._isSameGroup(e,t)&&e[1]!==t&&e[1].fireUncheck(t.value)})}_isSameGroup(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),$y=(()=>{class t{constructor(t,e,n,i){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=i,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(Ay),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(t){this._fn=t,this.onChange=()=>{t(this.value),this._registry.select(this)}}fireUncheck(t){this.writeValue(t)}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(Iy),Ro(ho))},t.\u0275dir=Wt({type:t,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("blur",function(){return e.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[Pa([My])]}),t})();const Oy={provide:ny,useExisting:st(()=>Py),multi:!0};let Py=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Oy])]}),t})();const Ny={provide:ny,useExisting:st(()=>Uy),multi:!0};function By(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let Uy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=By(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(t){this.onChange=e=>{this.value=this._getOptionValue(e),t(this.value)}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const e of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(e),t))return e;return null}_getOptionValue(t){const e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},inputs:{compareWith:"compareWith"},features:[Pa([Ny])]}),t})(),Vy=(()=>{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(By(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(Uy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();const Hy={provide:ny,useExisting:st(()=>zy),multi:!0};function jy(t,e){return null==t?""+e:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let zy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let e;if(this.value=t,Array.isArray(t)){const n=t.map(t=>this._getOptionId(t));e=(t,e)=>{t._setSelected(n.indexOf(e.toString())>-1)}}else e=(t,e)=>{t._setSelected(!1)};this._optionMap.forEach(e)}registerOnChange(t){this.onChange=e=>{const n=[];if(void 0!==e.selectedOptions){const t=e.selectedOptions;for(let e=0;e{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(zy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();function Gy(t,e){Ky(t,e,!0),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&Yy(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&Yy(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function qy(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function Ky(t,e,n){const i=_y(t);null!==e.validator?t.setValidators(xy(i,e.validator)):"function"==typeof i&&t.setValidators([i]);const r=Cy(t);if(null!==e.asyncValidator?t.setAsyncValidators(xy(r,e.asyncValidator)):"function"==typeof r&&t.setAsyncValidators([r]),n){const n=()=>t.updateValueAndValidity();qy(e._rawValidators,n),qy(e._rawAsyncValidators,n)}}function Xy(t,e,n){if(null!==t){if(null!==e.validator){const n=_y(t);Array.isArray(n)&&n.length>0&&t.setValidators(n.filter(t=>t!==e.validator))}if(null!==e.asyncValidator){const n=Cy(t);Array.isArray(n)&&n.length>0&&t.setAsyncValidators(n.filter(t=>t!==e.asyncValidator))}}if(n){const t=()=>{};qy(e._rawValidators,t),qy(e._rawAsyncValidators,t)}}function Yy(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Jy(t,e){Ky(t,e,!1)}const Qy=[ry,Py,Ly,Uy,zy,$y];function Zy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const tb="VALID",eb="INVALID",nb="PENDING",ib="DISABLED";function rb(t){return(lb(t)?t.validators:t)||null}function sb(t){return Array.isArray(t)?by(t):t||null}function ob(t,e){return(lb(e)?e.asyncValidators:t)||null}function ab(t){return Array.isArray(t)?wy(t):t||null}function lb(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class cb{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=sb(this._rawValidators),this._composedAsyncValidatorFn=ab(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===tb}get invalid(){return this.status===eb}get pending(){return this.status==nb}get disabled(){return this.status===ib}get enabled(){return this.status!==ib}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=sb(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=ab(t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=nb,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=ib,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=tb,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==tb&&this.status!==nb||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ib:tb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=nb,this._hasOwnPendingAsyncValidator=!0;const e=gy(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e)return null;if(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length)return null;let i=t;return e.forEach(t=>{i=i instanceof ub?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof db&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Wl,this.statusChanges=new Wl}_calculateStatus(){return this._allControlsDisabled()?ib:this.errors?eb:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(nb)?nb:this._anyControlsHaveStatus(eb)?eb:tb}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){lb(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class hb extends cb{constructor(t=null,e,n){super(rb(e),ob(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Zy(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Zy(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class ub extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof hb?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>t(this.controls[e],e))}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class db extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}at(t){return this.controls[t]}push(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()}insert(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()}removeAt(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof hb?t.value:t.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}let pb=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})();const fb=new Yn("NgModelWithFormControlWarning"),gb={provide:Ey,useExisting:st(()=>mb)};let mb=(()=>{class t extends Ey{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new Wl,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return Gy(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){Zy(this.directives,t)}addFormGroup(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormGroup(t){}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormArray(t){}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,e=this.directives,this.form._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=this.form.get(t.path);t.control!==e&&(function(t,e){const n=()=>{};e.valueAccessor.registerOnChange(n),e.valueAccessor.registerOnTouched(n),Xy(t,e,!0),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}(t.control||null,t),e&&Gy(e,t),t.control=e)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Ky(this.form,this,!1),this._oldForm&&Xy(this._oldForm,this,!1)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(hy,10),Ro(uy,10))},t.\u0275dir=Wt({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&Vo("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Pa([gb]),po,le]}),t})();const vb={provide:Ay,useExisting:st(()=>yb)};let yb=(()=>{class t extends Ay{constructor(t,e,n,i,r){super(),this._ngModelWarningConfig=r,this._added=!1,this.update=new Wl,this._ngModelWarningSent=!1,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=function(t,e){if(!e)return null;Array.isArray(e);let n=void 0,i=void 0,r=void 0;return e.forEach(t=>{var e;t.constructor===ay?n=t:(e=t,Qy.some(t=>e.constructor===t)?i=t:r=t)}),r||i||n||null}(0,i)}set isDisabled(t){}ngOnChanges(t){this._added||this._setUpControl(),function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return t=null==this.name?this.name:this.name.toString(),[...this._parent.path,t];var t}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,13),Ro(hy,10),Ro(uy,10),Ro(ny,10),Ro(fb,8))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[Pa([vb]),po,le]}),t._ngModelWarningSentOnce=!1,t})();const bb={provide:hy,useExisting:st(()=>wb),multi:!0};let wb=(()=>{class t{constructor(){this._required=!1}get required(){return this._required}set required(t){this._required=null!=t&&!1!==t&&""+t!="false",this._onChange&&this._onChange()}validate(t){return this.required?py.required(t):null}registerOnValidatorChange(t){this._onChange=t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(t,e){2&t&&ko("required",e.required?"":null)},inputs:{required:"required"},features:[Pa([bb])]}),t})(),xb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),_b=(()=>{class t{group(t,e=null){const n=this._reduceControls(t);let i=null,r=null,s=void 0;return null!=e&&(function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(e)?(i=null!=e.validators?e.validators:null,r=null!=e.asyncValidators?e.asyncValidators:null,s=null!=e.updateOn?e.updateOn:void 0):(i=null!=e.validator?e.validator:null,r=null!=e.asyncValidator?e.asyncValidator:null)),new ub(n,{asyncValidators:r,updateOn:s,validators:i})}control(t,e,n){return new hb(t,e,n)}array(t,e,n){const i=t.map(t=>this._createControl(t));return new db(i,e,n)}_reduceControls(t){const e={};return Object.keys(t).forEach(n=>{e[n]=this._createControl(t[n])}),e}_createControl(t){return t instanceof hb||t instanceof ub||t instanceof db?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Cb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[Iy],imports:[xb]}),t})(),Sb=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:fb,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[_b,Iy],imports:[xb]}),t})();const Eb=new Yn("ngx-segment-analytics.config"),kb={debug:!1,loadOnInitialization:!0,segmentHost:"cdn.segment.com",segmentUri:"/analytics.js/v1/$API_KEY$/analytics.min.js"};let Ab=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Db=(()=>{class t{constructor(t,e,n){if(this._w=t,this._doc=e,this._config=Object.assign(Object.assign({},kb),n),!this._config.loadOnInitialization||void 0!==this._config.apiKey&&""!==this._config.apiKey){if(void 0===this._w.analytics||void 0===this._w.analytics.initialize||!1===this._w.analytics.initialize){if(void 0!==this._w.analytics&&!0===this._w.analytics.invoked)return void console.error("Segment snippet included twice.");this._config.debug&&console.log("Segment initialization..."),this._w.analytics=[],this._w.analytics.invoked=!0,this._w.analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware"],this._w.analytics.factory=t=>(...e)=>(e.unshift(t),this._w.analytics.push(e),this._w.analytics),this._w.analytics.methods.forEach(t=>{this._w.analytics[t]=this._w.analytics.factory(t)}),this._w.analytics.load=(t,e)=>{const n=this._doc.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://"+this._config.segmentHost+this._config.segmentUri.replace("$API_KEY$",t);const i=this._doc.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),this._w.analytics._loadOptions=e},this._w.analytics.SNIPPET_VERSION="4.1.0",this._config.loadOnInitialization&&this.load(this._config.apiKey)}}else console.error("The API Key cannot be an empty string if Segment must be loaded on initialization.")}load(t,e){this._w.analytics.load(t,e),this._config.debug&&console.log("Segment initialized"),this.debug(this._config.debug)}identify(t,e,n){return new Promise(i=>{this._w.analytics.identify(t,e,n,t=>i(this))})}track(t,e,n){return new Promise(i=>{this._w.analytics.track(t,e,n,t=>i(this))})}page(t,e,n,i){return new Promise(r=>{this._w.analytics.page(t,e,n,i,t=>r(this))})}group(t,e){return new Promise(n=>{this._w.analytics.group(t,e,t=>n(this))})}alias(t,e,n){return new Promise(i=>{this._w.analytics.alias(t,e,n,t=>i(this))})}ready(){return new Promise(t=>{this._w.analytics.ready(e=>t(this))})}user(){return this._w.analytics.user()}id(){return this._w.analytics.id()}traits(){return this._w.analytics.traits()}reset(){this._w.analytics.reset()}debug(t){this._w.analytics.debug(t)}on(t,e){this._w.analytics.on(t,e)}trackLink(t,e,n){this._w.analytics.trackLink(t,e,n)}trackForm(t,e,n){this._w.analytics.trackForm(t,e,n)}timeout(t){this._w.analytics.timeout(t)}addSourceMiddleware(t){this._w.analytics.addSourceMiddleware(t)}get plugins(){return this._w.analytics.plugins}}return t.\u0275fac=function(e){return new(e||t)(bi(Ab),bi(ph),bi(Eb))},t.\u0275prov=lt({factory:function(){return new t(bi(Ab),bi(ph),bi(Eb))},token:t,providedIn:"root"}),t})();function Tb(t){return function(t){return"browser"===t}(t)?window:{}}let Rb=(()=>{class t{constructor(t){if(t)throw new Error("SegmentModule is already loaded. Import it in the AppModule only")}static forRoot(e){return{ngModule:t,providers:[{provide:Eb,useValue:e},Db]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:[{provide:Ab,useFactory:Tb,deps:[bc]}],imports:[[qh]]}),t})();class Fb{}class Lb{}class Mb{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof Mb?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new Mb;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Mb?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class Ib{encodeKey(t){return $b(t)}encodeValue(t){return $b(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}function $b(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class Ob{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new Ib,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Ob({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat([t]),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(t.value),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(t.value);-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}function Pb(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Nb(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Bb(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Ub{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new Mb),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),a)),t.setParams&&(l=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),l)),new Ub(e,n,r,{params:l,headers:a,reportProgress:o,responseType:i,withCredentials:s})}}var Vb=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({});class Hb{constructor(t,e=200,n="OK"){this.headers=t.headers||new Mb,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class jb extends Hb{constructor(t={}){super(t),this.type=Vb.ResponseHeader}clone(t={}){return new jb({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class zb extends Hb{constructor(t={}){super(t),this.type=Vb.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new zb({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Wb extends Hb{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(t.url||"(unknown url)"):`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Gb(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let qb=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Ub)i=t;else{let r=void 0;r=n.headers instanceof Mb?n.headers:new Mb(n.headers);let s=void 0;n.params&&(s=n.params instanceof Ob?n.params:new Ob({fromObject:n.params})),i=new Ub(t,e,void 0!==n.body?n.body:null,{headers:r,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=ff(i).pipe(Zf(t=>this.handler.handle(t)));if(t instanceof Ub||"events"===n.observe)return r;const s=r.pipe(Af(t=>t instanceof zb));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(k(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(k(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Ob).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Gb(n,e))}post(t,e,n={}){return this.request("POST",t,Gb(n,e))}put(t,e,n={}){return this.request("PUT",t,Gb(n,e))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Kb{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const Xb=new Yn("HTTP_INTERCEPTORS");let Yb=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Jb=/^\)\]\}',?\n/;class Qb{}let Zb=(()=>{class t{constructor(){}build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),tw=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new y(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new Mb(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new jb({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Jb,"");try{l=""!==l?JSON.parse(l):null}catch(h){l=t,c&&(c=!1,l={error:h,text:l})}}c?(e.next(new zb({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new Wb({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new Wb({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Vb.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&n.responseText&&(r.partialText=n.responseText),e.next(r)},h=t=>{let n={type:Vb.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",h)),n.send(i),e.next({type:Vb.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("load",o),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",h)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const ew=new Yn("XSRF_COOKIE_NAME"),nw=new Yn("XSRF_HEADER_NAME");class iw{}let rw=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Ih(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(bc),bi(ew))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),sw=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null===i||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(iw),bi(nw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),ow=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(Xb,[]);this.chain=t.reduceRight((t,e)=>new Kb(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(Lb),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),aw=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:sw,useClass:Yb}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:ew,useValue:e.cookieName}:[],e.headerName?{provide:nw,useValue:e.headerName}:[]]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[sw,{provide:Xb,useExisting:sw,multi:!0},{provide:iw,useClass:rw},{provide:ew,useValue:"XSRF-TOKEN"},{provide:nw,useValue:"X-XSRF-TOKEN"}]}),t})(),lw=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[qb,{provide:Fb,useClass:ow},tw,{provide:Lb,useExisting:tw},Zb,{provide:Qb,useExisting:Zb}],imports:[[aw.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();var cw=function(t){return t[t.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",t[t.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",t[t.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",t[t.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",t[t.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",t}({}),hw=function(t){return t[t.APPLE_APP_STORE=0]="APPLE_APP_STORE",t[t.GOOGLE_PLAY_STORE=1]="GOOGLE_PLAY_STORE",t[t.HUAWEI_APP_GALLERY=2]="HUAWEI_APP_GALLERY",t}({});class uw{}let dw=(()=>{class t{constructor(t,e){this.httpClient=t,this.config=e||{host:"http://127.0.0.1:7120",timeoutMs:5e3}}deleteAccounts(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/account",{params:e,headers:this.getTokenAuthHeaders(t)})}listAccounts(t,e,n,i){let r=new Ob;return e&&(r=r.set("filter",e)),(n||!1===n)&&(r=r.set("tombstones",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/account",{params:r,headers:this.getTokenAuthHeaders(t)})}getWalletLedger(t,e,n,i){const r=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet`;let s=new Ob;return n&&(s=s.set("limit",String(n))),i&&(s=s.set("cursor",i)),this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}deleteAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return(n||!1===n)&&(r=r.set("record_deletion",String(n))),this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getAccount(t,e){const n="/v2/console/account/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}banAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/ban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}exportAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getFriends(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteFriend(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getGroups(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/group`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteGroupUser(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/group/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}unbanAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkApple(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/apple`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkCustom(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/custom`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkDevice(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/device`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}unlinkEmail(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/email`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebook(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebook`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebookInstantGame(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebookinstantgame`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGameCenter(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/gamecenter`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGoogle(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/google`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkSteam(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/steam`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteWalletLedger(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteAllData(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/all",{params:e,headers:this.getTokenAuthHeaders(t)})}listApiEndpoints(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/api/endpoints",{params:e,headers:this.getTokenAuthHeaders(t)})}callRpcEndpoint(t,e,n){const i="/v2/console/api/endpoints/rpc/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}callApiEndpoint(t,e,n){const i="/v2/console/api/endpoints/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}authenticate(t){let e=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate",t,{params:e})}authenticateLogout(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate/logout",e,{params:n,headers:this.getTokenAuthHeaders(t)})}listChannelMessages(t,e,n,i,r,s,o){let a=new Ob;return e&&(a=a.set("type",e)),n&&(a=a.set("label",n)),i&&(a=a.set("group_id",i)),r&&(a=a.set("user_id_one",r)),s&&(a=a.set("user_id_two",s)),o&&(a=a.set("cursor",o)),this.httpClient.get(this.config.host+"/v2/console/channel",{params:a,headers:this.getTokenAuthHeaders(t)})}getConfig(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/config",{params:e,headers:this.getTokenAuthHeaders(t)})}listGroups(t,e,n){let i=new Ob;return e&&(i=i.set("filter",e)),n&&(i=i.set("cursor",n)),this.httpClient.get(this.config.host+"/v2/console/group",{params:i,headers:this.getTokenAuthHeaders(t)})}demoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/demote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}promoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/promote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}addGroupUsers(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/add`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateGroup(t,e,n){const i="/v2/console/group/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}exportGroup(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getMembers(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/member`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}listLeaderboards(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/leaderboard",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboardRecord(t,e,n){const i=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/owner/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}listLeaderboardRecords(t,e,n,i,r,s){const o=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/records`;let a=new Ob;return n&&n.forEach(t=>a=a.append("owner_ids",String(t))),i&&(a=a.set("limit",String(i))),r&&(a=a.set("cursor",r)),s&&(a=a.set("expiry",s)),this.httpClient.get(this.config.host+o,{params:a,headers:this.getTokenAuthHeaders(t)})}listMatches(t,e,n,i,r,s,o,a,l){let c=new Ob;return e&&(c=c.set("limit",String(e))),(n||!1===n)&&(c=c.set("authoritative",String(n))),i&&(c=c.set("label",i)),r&&(c=c.set("min_size",String(r))),s&&(c=c.set("max_size",String(s))),o&&(c=c.set("match_id",o)),a&&(c=c.set("query",a)),l&&(c=c.set("node",l)),this.httpClient.get(this.config.host+"/v2/console/match",{params:c,headers:this.getTokenAuthHeaders(t)})}getMatchState(t,e){const n=`/v2/console/match/${e=encodeURIComponent(String(e))}/state`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteChannelMessages(t,e,n){let i=new Ob;return e&&(i=i.set("before",e)),n&&n.forEach(t=>i=i.append("ids",String(t))),this.httpClient.delete(this.config.host+"/v2/console/message",{params:i,headers:this.getTokenAuthHeaders(t)})}listPurchases(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/purchase",{params:r,headers:this.getTokenAuthHeaders(t)})}getRuntime(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/runtime",{params:e,headers:this.getTokenAuthHeaders(t)})}getStatus(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/status",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorage(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/storage",{params:e,headers:this.getTokenAuthHeaders(t)})}listStorage(t,e,n,i,r){let s=new Ob;return e&&(s=s.set("user_id",e)),n&&(s=s.set("key",n)),i&&(s=s.set("collection",i)),r&&(s=s.set("cursor",r)),this.httpClient.get(this.config.host+"/v2/console/storage",{params:s,headers:this.getTokenAuthHeaders(t)})}listStorageCollections(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/storage/collections",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return r&&(o=o.set("version",r)),this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}getStorage(t,e,n,i){const r=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let s=new Ob;return this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}writeStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return this.httpClient.put(this.config.host+s,r,{params:o,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject2(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}/${r=encodeURIComponent(String(r))}`;let o=new Ob;return this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}listSubscriptions(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/subscription",{params:r,headers:this.getTokenAuthHeaders(t)})}deleteUser(t,e){let n=new Ob;return e&&(n=n.set("username",e)),this.httpClient.delete(this.config.host+"/v2/console/user",{params:n,headers:this.getTokenAuthHeaders(t)})}listUsers(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/user",{params:e,headers:this.getTokenAuthHeaders(t)})}addUser(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/user",e,{params:n,headers:this.getTokenAuthHeaders(t)})}getTokenAuthHeaders(t){return(new Mb).set("Authorization","Bearer "+t)}getBasicAuthHeaders(t,e){return(new Mb).set("Authorization","Basic "+btoa(t+":"+e))}}return t.\u0275fac=function(e){return new(e||t)(bi(qb),bi(uw,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const pw=new Yn("window"),fw=[{provide:pw,useFactory:()=>window}],gw="currentSession";let mw=(()=>{class t{constructor(t,e,n,i){this.window=t,this.segment=e,this.http=n,this.consoleService=i;const r=JSON.parse(localStorage.getItem(gw));r&&this.segmentIdentify(r),this.currentSessionSubject=new gf(r),this.currentSession=this.currentSessionSubject.asObservable()}get currentSessionValue(){return this.currentSessionSubject.getValue()}get username(){const t=this.currentSessionSubject.getValue().token;return JSON.parse(atob(t.split(".")[1])).usn}get sessionRole(){const t=this.currentSessionSubject.getValue().token;switch(JSON.parse(atob(t.split(".")[1])).rol){case 1:return cw.USER_ROLE_ADMIN;case 2:return cw.USER_ROLE_DEVELOPER;case 3:return cw.USER_ROLE_MAINTAINER;case 4:return cw.USER_ROLE_READONLY;default:return cw.USER_ROLE_UNKNOWN}}login(t,e){return this.consoleService.authenticate({username:t,password:e}).pipe(ng(t=>{localStorage.setItem(gw,JSON.stringify(t)),this.currentSessionSubject.next(t),this.segmentIdentify(t)}))}logout(){var t;return this.currentSessionSubject.getValue()?this.consoleService.authenticateLogout("",{token:null===(t=this.currentSessionSubject.getValue())||void 0===t?void 0:t.token}).pipe(ng(()=>{localStorage.removeItem(gw),this.currentSessionSubject.next(null)})):Cf}segmentIdentify(t){const e=JSON.parse(atob(t.token.split(".")[1]));this.segment.identify(null,{username:e.usn,email:e.ema,cookie:e.cki})}}return t.\u0275fac=function(e){return new(e||t)(bi(pw),bi(Db),bi(qb),bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function vw(t,e){if(1&t&&(Mo(0,"div",17),va(1),Io()),2&t){const t=zo();Qr(1),ba(" ",t.error," ")}}const yw=function(t){return{"was-validated":t}},bw=function(t){return{"is-invalid":t}};let ww=(()=>{class t{constructor(t,e,n,i,r){this.segment=t,this.formBuilder=e,this.route=n,this.router=i,this.authenticationService=r,this.error=""}ngOnInit(){this.segment.page("/login"),this.loginForm=this.formBuilder.group({username:["",py.compose([py.required])],password:["",py.compose([py.required,py.minLength(8)])]}),this.returnUrl=this.route.snapshot.queryParams.next||"/"}onSubmit(){this.submitted=!0,this.error="",this.loginForm.invalid||this.authenticationService.login(this.f.username.value,this.f.password.value).subscribe(t=>{this.loginForm.reset(),this.submitted=!1,this.router.navigate([this.returnUrl])},t=>{this.error=t,this.submitted=!1})}get f(){return this.loginForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(Db),Ro(_b),Ro(pm),Ro(Fv),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:26,vars:14,consts:[[1,"bg-grad","d-flex","h-100"],[1,"align-self-center","mx-auto"],[1,"text-center","mb-4"],["src","/static/svg/logo.svg","alt","Nakama Logo","width","175"],["class","alert alert-warning","role","alert",4,"ngIf"],[1,"card"],[1,"card-body"],[1,"text-center"],[3,"formGroup","ngClass","ngSubmit"],[1,"form-group","form-row"],[1,"col-sm-12"],["for","username"],["type","text","id","username","formControlName","username","required","","autofocus","",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","password"],["type","password","id","password","formControlName","password","required","",1,"form-control",3,"ngClass"],[1,"btn","btn-primary","btn-lg","btn-block",3,"disabled"],["role","alert",1,"alert","alert-warning"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"h1",2),$o(3,"img",3),Io(),Do(4,vw,2,1,"div",4),Mo(5,"div",5),Mo(6,"div",6),Mo(7,"h3",7),va(8,"Login"),Io(),Mo(9,"form",8),Vo("ngSubmit",function(){return e.onSubmit()}),Mo(10,"div",9),Mo(11,"div",10),Mo(12,"label",11),va(13,"Username"),Io(),$o(14,"input",12),Mo(15,"div",13),va(16,"Please enter a username."),Io(),Io(),Io(),Mo(17,"div",9),Mo(18,"div",10),Mo(19,"label",14),va(20,"Password"),Io(),$o(21,"input",15),Mo(22,"div",13),va(23,"Password must be at least 8 characters."),Io(),Io(),Io(),Mo(24,"button",16),va(25,"Login"),Io(),Io(),Io(),Io(),Io(),Io()),2&t&&(Qr(4),Fo("ngIf",e.error),Qr(5),Fo("formGroup",e.loginForm)("ngClass",Vl(8,yw,e.submitted)),Qr(5),Fo("ngClass",Vl(10,bw,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(6),Fo("ngClass",Vl(12,bw,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(2),Fo("disabled",!e.loginForm.valid||e.submitted))},directives:[Bh,pb,Ry,mb,$h,ay,Ty,yb,wb],styles:["div[_ngcontent-%COMP%] .mx-auto[_ngcontent-%COMP%]{width:420px}"]}),t})(),xw=(()=>{class t{constructor(t,e){this.authService=t,this.router=e}canActivate(t,e){return!this.authService.currentSessionValue||(this.router.navigate(["/"]),!1)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),_w=(()=>{class t{constructor(t,e){this.router=t,this.authenticationService=e}canActivate(t,e){return!!this.authenticationService.currentSessionValue||(this.router.navigate(["/login"],{queryParams:{next:e.url}}),!1)}canActivateChild(t,e){return this.canActivate(t,e)}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Cw extends u{constructor(t,e){super()}schedule(t,e=0){return this}}class Sw extends Cw{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n=!1,i=void 0;try{this.work(t)}catch(r){n=!0,i=!!r&&r||new Error(r)}if(n)return this.unsubscribe(),i}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}let Ew=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class kw extends Ew{constructor(t,e=Ew.now){super(t,()=>kw.delegate&&kw.delegate!==this?kw.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return kw.delegate&&kw.delegate!==this?kw.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const Aw=new kw(Sw);class Dw{constructor(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}call(t,e){return e.subscribe(new Rw(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))}}class Tw{constructor(){this.buffer=[]}}class Rw extends f{constructor(t,e,n,i,r){super(t),this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=i,this.scheduler=r,this.contexts=[];const s=this.openContext();if(this.timespanOnly=null==n||n<0,this.timespanOnly)this.add(s.closeAction=r.schedule(Fw,e,{subscriber:this,context:s,bufferTimeSpan:e}));else{const t={bufferTimeSpan:e,bufferCreationInterval:n,subscriber:this,scheduler:r};this.add(s.closeAction=r.schedule(Mw,e,{subscriber:this,context:s})),this.add(r.schedule(Lw,n,t))}}_next(t){const e=this.contexts,n=e.length;let i;for(let r=0;r0;){const n=t.shift();e.next(n.buffer)}super._complete()}_unsubscribe(){this.contexts=null}onBufferFull(t){this.closeContext(t);const e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();const e=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(Fw,e,{subscriber:this,context:t,bufferTimeSpan:e}))}}openContext(){const t=new Tw;return this.contexts.push(t),t}closeContext(t){this.destination.next(t.buffer);const e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)}}function Fw(t){const e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Lw(t){const{bufferCreationInterval:e,bufferTimeSpan:n,subscriber:i,scheduler:r}=t,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(Mw,n,{subscriber:i,context:s})),this.schedule(t,e))}function Mw(t){const{subscriber:e,context:n}=t;e.closeContext(n)}class Iw{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new $w(t,this.compare,this.keySelector))}}class $w extends f{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}function Ow(t,e,n,r){return i(n)&&(r=n,n=void 0),r?Ow(t,e,n).pipe(k(t=>l(t)?r(...t):r(t))):new y(i=>{Pw(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Pw(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s=0}function Bw(t=0,e,n){let i=-1;return Nw(e)?i=Number(e)<1?1:Number(e):E(e)&&(n=e),E(n)||(n=Aw),new y(e=>{const r=Nw(t)?t:+t-n.now();return n.schedule(Uw,r,{index:0,period:i,subscriber:e})})}function Uw(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Vw(...t){if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return z(t,void 0).lift(new Hw)}class Hw{call(t,e){return e.subscribe(new jw(t))}}class jw extends mf{constructor(t){super(t),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(t){this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(let n=0;nthis.index}hasCompleted(){return this.array.length===this.index}}class Xw extends N{constructor(t,e,n){super(t),this.parent=e,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[F](){return this}next(){const t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(t){this.buffer.push(t),this.parent.checkIterators()}subscribe(){return B(this.observable,new P(this))}}function Yw(t){return e=>e.lift(new Jw(t))}class Jw{constructor(t){this.notifier=t}call(t,e){const n=new Qw(t),i=B(this.notifier,new P(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Qw extends N{constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Zw(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new tx(t,n))}}class tx{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new ex(t,this.observables,this.project))}}class ex extends mf{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function nx(t,e){return new y(e?n=>e.schedule(ix,0,{error:t,subscriber:n}):e=>e.error(t))}function ix({error:t,subscriber:e}){e.error(t)}let rx=(()=>{class t{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return ff(this.value);case"E":return nx(this.error);case"C":return Sf()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new t("N",e):t.undefinedValueNotification}static createError(e){return new t("E",void 0,e)}static createComplete(){return t.completeNotification}}return t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t})();function sx(t,e=Aw){var n;const i=(n=t)instanceof Date&&!isNaN(+n)?+t-e.now():Math.abs(t);return t=>t.lift(new ox(i,e))}class ox{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new ax(t,this.delay,this.scheduler))}}class ax extends f{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(ax.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new lx(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(rx.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(rx.createComplete()),this.unsubscribe()}}class lx{constructor(t,e){this.time=t,this.notification=e}}function cx(t,e){if(1&t){const t=No();Mo(0,"button",1),Vo("click",function(){return Ie(t),zo().close()}),Mo(1,"span",2),va(2,"\xd7"),Io(),Io()}}const hx=["*"],ux=["dialog"];function dx(t){return null!=t}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const px={animation:!0,transitionTimerDelayMs:5};let fx=(()=>{class t{constructor(){this.animation=px.animation}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})();const gx=()=>{},{transitionTimerDelayMs:mx}=px,vx=new Map,yx=(t,e,n)=>{let i=n.context||{};const r=vx.get(t);if(r)switch(n.runningTransition){case"continue":return Cf;case"stop":r.transition$.complete(),i=Object.assign(r.context,i),vx.delete(t)}!function(t){t||document}(t);const s=e(t,i)||gx;if(!n.animation||"none"===window.getComputedStyle(t).transitionProperty)return s(),ff(void 0);const o=new C,a=o.pipe(function(...t){return e=>qf(e,ff(...t))}(!0));vx.set(t,{transition$:o,context:i});const l=function(t){const{transitionDelay:e,transitionDuration:n}=window.getComputedStyle(t);return 1e3*(parseFloat(e)+parseFloat(n))}(t),c=Ow(t,"transitionend").pipe(Yw(a),Af(({target:e})=>e===t));return Vw(Bw(l+mx).pipe(Yw(a)),c).pipe(Yw(a)).subscribe(()=>{vx.delete(t),s(),o.next(),o.complete()}),o.asObservable()};let bx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),wx=(()=>{class t{constructor(t){this.dismissible=!0,this.type="warning",this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const xx=({classList:t})=>{t.remove("show")};let _x=(()=>{class t{constructor(t,e,n){this._renderer=e,this._element=n,this.closed=new Wl,this.dismissible=t.dismissible,this.type=t.type,this.animation=t.animation}close(){const t=yx(this._element.nativeElement,xx,{animation:this.animation,runningTransition:"continue"});return t.subscribe(()=>this.closed.emit()),t}ngOnChanges(t){const e=t.type;e&&!e.firstChange&&(this._renderer.removeClass(this._element.nativeElement,"alert-"+e.previousValue),this._renderer.addClass(this._element.nativeElement,"alert-"+e.currentValue))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,"alert-"+this.type)}}return t.\u0275fac=function(e){return new(e||t)(Ro(wx),Ro(Ga),Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert","show"],hostVars:4,hostBindings:function(t,e){2&t&&ra("fade",e.animation)("alert-dismissible",e.dismissible)},inputs:{dismissible:"dismissible",type:"type",animation:"animation"},outputs:{closed:"closed"},exportAs:["ngbAlert"],features:[le],ngContentSelectors:hx,decls:2,vars:1,consts:function(){let t,e;return t=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,e=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,[["type","button","class","close","aria-label",t,3,"click",4,"ngIf"],["type","button","aria-label",e,1,"close",3,"click"],["aria-hidden","true"]]},template:function(t,e){1&t&&(Go(),qo(0),Do(1,cx,3,0,"button",0)),2&t&&(Qr(1),Fo("ngIf",e.dismissible))},directives:[Bh],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),t})(),Cx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Sx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbButtonLabel",""]],hostVars:8,hostBindings:function(t,e){2&t&&ra("btn",!0)("active",e.active)("disabled",e.disabled)("focus",e.focused)}}),t})(),Ex=0,kx=(()=>{class t{constructor(){this._radios=new Set,this._value=null,this.name="ngb-radio-"+Ex++,this.onChange=t=>{},this.onTouched=()=>{}}get disabled(){return this._disabled}set disabled(t){this.setDisabledState(t)}onRadioChange(t){this.writeValue(t.value),this.onChange(t.value)}onRadioValueUpdate(){this._updateRadiosValue()}register(t){this._radios.add(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._disabled=t,this._updateRadiosDisabled()}unregister(t){this._radios.delete(t)}writeValue(t){this._value=t,this._updateRadiosValue()}_updateRadiosValue(){this._radios.forEach(t=>t.updateValue(this._value))}_updateRadiosDisabled(){this._radios.forEach(t=>t.updateDisabled())}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbRadioGroup",""]],hostAttrs:["role","radiogroup"],inputs:{name:"name"},features:[Pa([{provide:ny,useExisting:st(()=>t),multi:!0}])]}),t})(),Ax=(()=>{class t{constructor(t,e,n,i,r){this._group=t,this._label=e,this._renderer=n,this._element=i,this._cd=r,this._value=null,this._group.register(this),this.updateDisabled()}set value(t){this._value=t;const e=t?t.toString():"";this._renderer.setProperty(this._element.nativeElement,"value",e),this._group.onRadioValueUpdate()}set disabled(t){this._disabled=!1!==t,this.updateDisabled()}set focused(t){this._label&&(this._label.focused=t),t||this._group.onTouched()}get checked(){return this._checked}get disabled(){return this._group.disabled||this._disabled}get value(){return this._value}get nameAttr(){return this.name||this._group.name}ngOnDestroy(){this._group.unregister(this)}onChange(){this._group.onRadioChange(this)}updateValue(t){this.value!==t&&this._cd.markForCheck(),this._checked=this.value===t,this._label.active=this._checked}updateDisabled(){this._label.disabled=this.disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(kx),Ro(Sx),Ro(Ga),Ro(za),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["","ngbButton","","type","radio"]],hostVars:3,hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("focus",function(){return e.focused=!0})("blur",function(){return e.focused=!1}),2&t&&xa("checked",e.checked)("disabled",e.disabled)("name",e.nameAttr)},inputs:{value:"value",disabled:"disabled",name:"name"}}),t})(),Dx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Tx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Rx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();var Fx=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown",t}({});const Lx=(t,e)=>!!e&&e.some(e=>e.contains(t)),Mx=(t,e)=>!e||null!=function(t,e){return e?void 0===t.closest?null:t.closest(e):null}(t,e),Ix="undefined"!=typeof navigator&&!!navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));function $x(t,e,n,i,r,s,o,a){var l;n&&t.runOutsideAngular((l=()=>{const l=Ow(e,"keydown").pipe(Yw(r),Af(t=>t.which===Fx.Escape),ng(t=>t.preventDefault())),c=Ow(e,"mousedown").pipe(k(t=>{const e=t.target;return 2!==t.button&&!Lx(e,o)&&("inside"===n?Lx(e,s)&&Mx(e,a):"outside"===n?!Lx(e,s):Mx(e,a)||!Lx(e,s))}),Yw(r)),h=Ow(e,"mouseup").pipe(Zw(c),Af(([t,e])=>e),sx(0),Yw(r));Vw([l.pipe(k(t=>0)),h.pipe(k(t=>1))]).subscribe(e=>t.run(()=>i(e)))},Ix?()=>setTimeout(()=>l(),100):l))}const Ox=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function Px(t){const e=Array.from(t.querySelectorAll(Ox)).filter(t=>-1!==t.tabIndex);return[e[0],e[e.length-1]]}const Nx=/\s+/,Bx=new class{getAllStyles(t){return window.getComputedStyle(t)}getStyle(t,e){return this.getAllStyles(t)[e]}isStaticPositioned(t){return"static"===(this.getStyle(t,"position")||"static")}offsetParent(t){let e=t.offsetParent||document.documentElement;for(;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement}position(t,e=!0){let n,i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const e=this.offsetParent(t);n=this.offset(t,!1),e!==document.documentElement&&(i=this.offset(e,!1)),i.top+=e.clientTop,i.left+=e.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(t,e=!0){const n=t.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,r=window.pageXOffset-document.documentElement.clientLeft;let s={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+r,right:n.right+r};return e&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s}positionElements(t,e,n,i){const[r="top",s="center"]=n.split("-"),o=i?this.offset(t,!1):this.position(t,!1),a=this.getAllStyles(e),l=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),h=parseFloat(a.marginLeft),u=parseFloat(a.marginRight);let d=0,p=0;switch(r){case"top":d=o.top-(e.offsetHeight+l+c);break;case"bottom":d=o.top+o.height;break;case"left":p=o.left-(e.offsetWidth+h+u);break;case"right":p=o.left+o.width}switch(s){case"top":d=o.top;break;case"bottom":d=o.top+o.height-e.offsetHeight;break;case"left":p=o.left;break;case"right":p=o.left+o.width-e.offsetWidth;break;case"center":"top"===r||"bottom"===r?p=o.left+o.width/2-e.offsetWidth/2:d=o.top+o.height/2-e.offsetHeight/2}e.style.transform=`translate(${Math.round(p)}px, ${Math.round(d)}px)`;const f=e.getBoundingClientRect(),g=document.documentElement,m=window.innerHeight||g.clientHeight,v=window.innerWidth||g.clientWidth;return f.left>=0&&f.top>=0&&f.right<=v&&f.bottom<=m}};function Ux(t,e,n,i,r){let s=Array.isArray(n)?n:n.split(Nx);const o=["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"],a=e.classList,l=t=>{const[e,n]=t.split("-"),i=[];return r&&(i.push(`${r}-${e}`),n&&i.push(`${r}-${e}-${n}`),i.forEach(t=>{a.add(t)})),i};r&&o.forEach(t=>{a.remove(`${r}-${t}`)});let c=s.findIndex(t=>"auto"===t);c>=0&&o.forEach(function(t){null==s.find(e=>-1!==e.search("^"+t))&&s.splice(c++,1,t)});const h=e.style;h.position="absolute",h.top="0",h.left="0",h["will-change"]="transform";let u=null,d=!1;for(u of s){let n=l(u);if(Bx.positionElements(t,e,u,i)){d=!0;break}r&&n.forEach(t=>{a.remove(t)})}return d||(u=s[0],l(u),Bx.positionElements(t,e,u,i)),u}new Date(1882,10,12),new Date(2174,10,25);let Vx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,Cb]]}),t})(),Hx=(()=>{class t{constructor(){this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),jx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["",8,"navbar"]]}),t})(),zx=(()=>{class t{constructor(t){this.elementRef=t,this._disabled=!1}set disabled(t){this._disabled=""===t||!0===t}get disabled(){return this._disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownItem",""]],hostAttrs:[1,"dropdown-item"],hostVars:2,hostBindings:function(t,e){2&t&&ra("disabled",e.disabled)},inputs:{disabled:"disabled"}}),t})(),Wx=(()=>{class t{constructor(t,e){this.dropdown=t,this.placement="bottom",this.isOpen=!1,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownMenu",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,zx,!1),2&t){let t;ic(t=lc())&&(e.menuItems=t)}},hostVars:5,hostBindings:function(t,e){1&t&&Vo("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Enter",function(t){return e.dropdown.onKeyDown(t)})("keydown.Space",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&(ko("x-placement",e.placement),ra("dropdown-menu",!0)("show",e.dropdown.isOpen()))}}),t})(),Gx=(()=>{class t{constructor(t,e){this.dropdown=t,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownAnchor",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){2&t&&ko("aria-expanded",e.dropdown.isOpen())}}),t})(),qx=(()=>{class t extends Gx{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownToggle",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){1&t&&Vo("click",function(){return e.dropdown.toggle()})("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&ko("aria-expanded",e.dropdown.isOpen())},features:[Pa([{provide:Gx,useExisting:st(()=>t)}]),po]}),t})(),Kx=(()=>{class t{constructor(t,e,n,i,r,s,o){this._changeDetector=t,this._document=n,this._ngZone=i,this._elementRef=r,this._renderer=s,this._closed$=new C,this._bodyContainer=null,this._open=!1,this.openChange=new Wl,this.placement=e.placement,this.container=e.container,this.autoClose=e.autoClose,this.display=o?"static":"dynamic",this._zoneSubscription=i.onStable.subscribe(()=>{this._positionMenu()})}ngAfterContentInit(){this._ngZone.onStable.pipe(zf(1)).subscribe(()=>{this._applyPlacementClasses(),this._open&&this._setCloseHandlers()})}ngOnChanges(t){t.container&&this._open&&this._applyContainer(this.container),t.placement&&!t.placement.isFirstChange&&this._applyPlacementClasses()}isOpen(){return this._open}open(){this._open||(this._open=!0,this._applyContainer(this.container),this.openChange.emit(!0),this._setCloseHandlers(),this._anchor&&this._anchor.nativeElement.focus())}_setCloseHandlers(){$x(this._ngZone,this._document,this.autoClose,t=>{this.close(),0===t&&this._anchor.nativeElement.focus()},this._closed$,this._menu?[this._menu.nativeElement]:[],this._anchor?[this._anchor.nativeElement]:[],".dropdown-item,.dropdown-divider")}close(){this._open&&(this._open=!1,this._resetContainer(),this._closed$.next(),this.openChange.emit(!1),this._changeDetector.markForCheck())}toggle(){this.isOpen()?this.close():this.open()}ngOnDestroy(){this._resetContainer(),this._closed$.next(),this._zoneSubscription.unsubscribe()}onKeyDown(t){const e=t.which,n=this._getMenuElements();let i=-1,r=null;const s=this._isEventFromToggle(t);if(!s&&n.length&&n.forEach((e,n)=>{e.contains(t.target)&&(r=e),e===this._document.activeElement&&(i=n)}),e!==Fx.Space&&e!==Fx.Enter){if(e!==Fx.Tab){if(s||r){if(this.open(),n.length){switch(e){case Fx.ArrowDown:i=Math.min(i+1,n.length-1);break;case Fx.ArrowUp:if(this._isDropup()&&-1===i){i=n.length-1;break}i=Math.max(i-1,0);break;case Fx.Home:i=0;break;case Fx.End:i=n.length-1}n[i].focus()}t.preventDefault()}}else if(t.target&&this.isOpen()&&this.autoClose){if(this._anchor.nativeElement===t.target)return void("body"!==this.container||t.shiftKey?t.shiftKey&&this.close():(this._renderer.setAttribute(this._menu.nativeElement,"tabindex","0"),this._menu.nativeElement.focus(),this._renderer.removeAttribute(this._menu.nativeElement,"tabindex")));if("body"===this.container){const e=this._menu.nativeElement.querySelectorAll(Ox);t.shiftKey&&t.target===e[0]?(this._anchor.nativeElement.focus(),t.preventDefault()):t.shiftKey||t.target!==e[e.length-1]||(this._anchor.nativeElement.focus(),this.close())}else Ow(t.target,"focusout").pipe(zf(1)).subscribe(({relatedTarget:t})=>{this._elementRef.nativeElement.contains(t)||this.close()})}}else!r||!0!==this.autoClose&&"inside"!==this.autoClose||Ow(r,"click").pipe(zf(1)).subscribe(()=>this.close())}_isDropup(){return this._elementRef.nativeElement.classList.contains("dropup")}_isEventFromToggle(t){return this._anchor.nativeElement.contains(t.target)}_getMenuElements(){const t=this._menu;return null==t?[]:t.menuItems.filter(t=>!t.disabled).map(t=>t.elementRef.nativeElement)}_positionMenu(){const t=this._menu;this.isOpen()&&t&&this._applyPlacementClasses("dynamic"===this.display?Ux(this._anchor.nativeElement,this._bodyContainer||this._menu.nativeElement,this.placement,"body"===this.container):this._getFirstPlacement(this.placement))}_getFirstPlacement(t){return Array.isArray(t)?t[0]:t.split(" ")[0]}_resetContainer(){const t=this._renderer;if(this._menu){const e=this._menu.nativeElement;t.appendChild(this._elementRef.nativeElement,e),t.removeStyle(e,"position"),t.removeStyle(e,"transform")}this._bodyContainer&&(t.removeChild(this._document.body,this._bodyContainer),this._bodyContainer=null)}_applyContainer(t=null){if(this._resetContainer(),"body"===t){const t=this._renderer,e=this._menu.nativeElement,n=this._bodyContainer=this._bodyContainer||t.createElement("div");t.setStyle(n,"position","absolute"),t.setStyle(e,"position","static"),t.setStyle(n,"z-index","1050"),t.appendChild(n,e),t.appendChild(this._document.body,n)}}_applyPlacementClasses(t){const e=this._menu;if(e){t||(t=this._getFirstPlacement(this.placement));const n=this._renderer,i=this._elementRef.nativeElement;n.removeClass(i,"dropup"),n.removeClass(i,"dropdown"),e.placement="static"===this.display?null:t;const r=-1!==t.search("^top")?"dropup":"dropdown";n.addClass(i,r);const s=this._bodyContainer;s&&(n.removeClass(s,"dropup"),n.removeClass(s,"dropdown"),n.addClass(s,r))}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl),Ro(Hx),Ro(ph),Ro(Ic),Ro(za),Ro(Ga),Ro(jx,8))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdown",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Wx,!0),ac(n,Gx,!0)),2&t){let t;ic(t=lc())&&(e._menu=t.first),ic(t=lc())&&(e._anchor=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("show",e.isOpen())},inputs:{_open:["open","_open"],placement:"placement",container:"container",autoClose:"autoClose",display:"display"},outputs:{openChange:"openChange"},exportAs:["ngbDropdown"],features:[le]}),t})(),Xx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Yx=(()=>{class t{constructor(t){this.backdrop=!0,this.keyboard=!0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();class Jx{constructor(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}}class Qx{constructor(t,e,n,i,r,s,o){this._type=t,this._injector=e,this._viewContainerRef=n,this._renderer=i,this._ngZone=r,this._componentFactoryResolver=s,this._applicationRef=o,this._windowRef=null,this._contentRef=null}open(t,e,n=!1){this._windowRef||(this._contentRef=this._getContentRef(t,e),this._windowRef=this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type),this._viewContainerRef.length,this._injector,this._contentRef.nodes));const{nativeElement:i}=this._windowRef.location,r=this._ngZone.onStable.asObservable().pipe(zf(1)).pipe(U(()=>this._ngZone.run(()=>yx(i,({classList:t})=>t.add("show"),{animation:n,runningTransition:"continue"}))));return{windowRef:this._windowRef,transition$:r}}close(t=!1){return this._windowRef?yx(this._windowRef.location.nativeElement,({classList:t})=>t.remove("show"),{animation:t,runningTransition:"stop"}).pipe(ng(()=>{var t;this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null),(null===(t=this._contentRef)||void 0===t?void 0:t.viewRef)&&(this._applicationRef.detachView(this._contentRef.viewRef),this._contentRef.viewRef.destroy(),this._contentRef=null)})):ff(void 0)}_getContentRef(t,e){if(t){if(t instanceof yl){const n=t.createEmbeddedView(e);return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}return new Jx([[this._renderer.createText(""+t)]])}return new Jx([])}}const Zx=()=>{};let t_=(()=>{class t{constructor(t){this._document=t}compensate(){const t=this._getWidth();return this._isPresent(t)?this._adjustBody(t):Zx}_adjustBody(t){const e=this._document.body,n=e.style.paddingRight,i=parseFloat(window.getComputedStyle(e)["padding-right"]);return e.style["padding-right"]=i+t+"px",()=>e.style["padding-right"]=n}_isPresent(t){const e=this._document.body.getBoundingClientRect();return window.innerWidth-(e.left+e.right)>=t-.1*t}_getWidth(){const t=this._document.createElement("div");t.className="modal-scrollbar-measure";const e=this._document.body;e.appendChild(t);const n=t.getBoundingClientRect().width-t.clientWidth;return e.removeChild(t),n}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return new t(bi(ph))},token:t,providedIn:"root"}),t})(),e_=(()=>{class t{constructor(t,e){this._el=t,this._zone=e}ngOnInit(){this._zone.onStable.asObservable().pipe(zf(1)).subscribe(()=>{yx(this._el.nativeElement,({classList:t})=>t.add("show"),{animation:this.animation,runningTransition:"continue"})})}hide(){return yx(this._el.nativeElement,({classList:t})=>t.remove("show"),{animation:this.animation,runningTransition:"stop"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:6,hostBindings:function(t,e){2&t&&(sa("modal-backdrop"+(e.backdropClass?" "+e.backdropClass:"")),ra("show",!e.animation)("fade",e.animation))},inputs:{animation:"animation",backdropClass:"backdropClass"},decls:0,vars:0,template:function(t,e){},encapsulation:2}),t})();class n_{close(t){}dismiss(t){}}class i_{constructor(t,e,n,i){this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,this._beforeDismiss=i,this._closed=new C,this._dismissed=new C,this._hidden=new C,t.instance.dismissEvent.subscribe(t=>{this.dismiss(t)}),this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}get closed(){return this._closed.asObservable().pipe(Yw(this._hidden))}get dismissed(){return this._dismissed.asObservable().pipe(Yw(this._hidden))}get hidden(){return this._hidden.asObservable()}get shown(){return this._windowCmptRef.instance.shown.asObservable()}close(t){this._windowCmptRef&&(this._closed.next(t),this._resolve(t),this._removeModalElements())}_dismiss(t){this._dismissed.next(t),this._reject(t),this._removeModalElements()}dismiss(t){if(this._windowCmptRef)if(this._beforeDismiss){const e=this._beforeDismiss();e&&e.then?e.then(e=>{!1!==e&&this._dismiss(t)},()=>{}):!1!==e&&this._dismiss(t)}else this._dismiss(t)}_removeModalElements(){const t=this._windowCmptRef.instance.hide(),e=this._backdropCmptRef?this._backdropCmptRef.instance.hide():ff(void 0);t.subscribe(()=>{const{nativeElement:t}=this._windowCmptRef.location;t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._contentRef=null}),e.subscribe(()=>{if(this._backdropCmptRef){const{nativeElement:t}=this._backdropCmptRef.location;t.parentNode.removeChild(t),this._backdropCmptRef.destroy(),this._backdropCmptRef=null}}),zw(t,e).subscribe(()=>{this._hidden.next(),this._hidden.complete()})}}var r_=function(t){return t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC",t}({});let s_=(()=>{class t{constructor(t,e,n){this._document=t,this._elRef=e,this._zone=n,this._closed$=new C,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new Wl,this.shown=new C,this.hidden=new C}dismiss(t){this.dismissEvent.emit(t)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){this._show()}ngOnDestroy(){this._disableEventHandling()}hide(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"stop"},n=zw(yx(t,()=>t.classList.remove("show"),e),yx(this._dialogEl.nativeElement,()=>{},e));return n.subscribe(()=>{this.hidden.next(),this.hidden.complete()}),this._disableEventHandling(),this._restoreFocus(),n}_show(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"continue"};zw(yx(t,()=>t.classList.add("show"),e),yx(this._dialogEl.nativeElement,()=>{},e)).subscribe(()=>{this.shown.next(),this.shown.complete()}),this._enableEventHandling(),this._setFocus()}_enableEventHandling(){const{nativeElement:t}=this._elRef;this._zone.runOutsideAngular(()=>{Ow(t,"keydown").pipe(Yw(this._closed$),Af(t=>t.which===Fx.Escape)).subscribe(t=>{this.keyboard?requestAnimationFrame(()=>{t.defaultPrevented||this._zone.run(()=>this.dismiss(r_.ESC))}):"static"===this.backdrop&&this._bumpBackdrop()});let e=!1;Ow(this._dialogEl.nativeElement,"mousedown").pipe(Yw(this._closed$),ng(()=>e=!1),Vf(()=>Ow(t,"mouseup").pipe(Yw(this._closed$),zf(1))),Af(({target:e})=>t===e)).subscribe(()=>{e=!0}),Ow(t,"click").pipe(Yw(this._closed$)).subscribe(({target:n})=>{t===n&&("static"===this.backdrop?this._bumpBackdrop():!0!==this.backdrop||e||this._zone.run(()=>this.dismiss(r_.BACKDROP_CLICK))),e=!1})})}_disableEventHandling(){this._closed$.next()}_setFocus(){const{nativeElement:t}=this._elRef;if(!t.contains(document.activeElement)){const e=t.querySelector("[ngbAutofocus]"),n=Px(t)[0];(e||n||t).focus()}}_restoreFocus(){const t=this._document.body,e=this._elWithFocus;let n;n=e&&e.focus&&t.contains(e)?e:t,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null})}_bumpBackdrop(){"static"===this.backdrop&&yx(this._elRef.nativeElement,({classList:t})=>(t.add("modal-static"),()=>t.remove("modal-static")),{animation:this.animation,runningTransition:"continue"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(ph),Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-window"]],viewQuery:function(t,e){if(1&t&&rc(ux,!0),2&t){let t;ic(t=lc())&&(e._dialogEl=t.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:7,hostBindings:function(t,e){2&t&&(ko("aria-modal",!0)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),sa("modal d-block"+(e.windowClass?" "+e.windowClass:"")),ra("fade",e.animation))},inputs:{backdrop:"backdrop",keyboard:"keyboard",animation:"animation",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:hx,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0,1),Mo(2,"div",2),qo(3),Io(),Io()),2&t&&sa("modal-dialog"+(e.size?" modal-"+e.size:"")+(e.centered?" modal-dialog-centered":"")+(e.scrollable?" modal-dialog-scrollable":""))},styles:["ngb-modal-window .component-host-scrollable{-ms-flex-direction:column;display:-ms-flexbox;display:flex;flex-direction:column;overflow:hidden}"],encapsulation:2}),t})(),o_=(()=>{class t{constructor(t,e,n,i,r,s){this._applicationRef=t,this._injector=e,this._document=n,this._scrollBar=i,this._rendererFactory=r,this._ngZone=s,this._activeWindowCmptHasChanged=new C,this._ariaHiddenValues=new Map,this._backdropAttributes=["animation","backdropClass"],this._modalRefs=[],this._windowAttributes=["animation","ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new Wl,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const t=this._windowCmpts[this._windowCmpts.length-1];((t,e,n,i=!1)=>{this._ngZone.runOutsideAngular(()=>{const t=Ow(e,"focusin").pipe(Yw(n),k(t=>t.target));Ow(e,"keydown").pipe(Yw(n),Af(t=>t.which===Fx.Tab),Zw(t)).subscribe(([t,n])=>{const[i,r]=Px(e);n!==i&&n!==e||!t.shiftKey||(r.focus(),t.preventDefault()),n!==r||t.shiftKey||(i.focus(),t.preventDefault())}),i&&Ow(e,"click").pipe(Yw(n),Zw(t),k(t=>t[1])).subscribe(t=>t.focus())})})(0,t.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(t.location.nativeElement)}})}open(t,e,n,i){const r=i.container instanceof HTMLElement?i.container:dx(i.container)?this._document.querySelector(i.container):this._document.body,s=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(s.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!r)throw new Error(`The specified modal container "${i.container||"body"}" was not found in the DOM.`);const l=new n_,c=this._getContentRef(t,i.injector||e,n,l,i);let h=!1!==i.backdrop?this._attachBackdrop(t,r):void 0,u=this._attachWindowComponent(t,r,c),d=new i_(u,c,h,i.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(u),d.result.then(o,o),d.result.then(a,a),l.close=t=>{d.close(t)},l.dismiss=t=>{d.dismiss(t)},this._applyWindowOptions(u.instance,i),1===this._modalRefs.length&&s.addClass(this._document.body,"modal-open"),h&&h.instance&&this._applyBackdropOptions(h.instance,i),d}get activeInstances(){return this._activeInstances}dismissAll(t){this._modalRefs.forEach(e=>e.dismiss(t))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(t,e){let n=t.resolveComponentFactory(e_).create(this._injector);return this._applicationRef.attachView(n.hostView),e.appendChild(n.location.nativeElement),n}_attachWindowComponent(t,e,n){let i=t.resolveComponentFactory(s_).create(this._injector,n.nodes);return this._applicationRef.attachView(i.hostView),e.appendChild(i.location.nativeElement),i}_applyWindowOptions(t,e){this._windowAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_applyBackdropOptions(t,e){this._backdropAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_getContentRef(t,e,n,i,r){return n?n instanceof yl?this._createFromTemplateRef(n,i):"string"==typeof n?this._createFromString(n):this._createFromComponent(t,e,n,i,r):new Jx([])}_createFromTemplateRef(t,e){const n=t.createEmbeddedView({$implicit:e,close(t){e.close(t)},dismiss(t){e.dismiss(t)}});return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}_createFromString(t){const e=this._document.createTextNode(""+t);return new Jx([[e]])}_createFromComponent(t,e,n,i,r){const s=t.resolveComponentFactory(n),o=ho.create({providers:[{provide:n_,useValue:i}],parent:e}),a=s.create(o),l=a.location.nativeElement;return r.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(a.hostView),new Jx([[l]],a.hostView,a)}_setAriaHidden(t){const e=t.parentElement;e&&t!==this._document.body&&(Array.from(e.children).forEach(e=>{e!==t&&"SCRIPT"!==e.nodeName&&(this._ariaHiddenValues.set(e,e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),this._setAriaHidden(e))}_revertAriaHidden(){this._ariaHiddenValues.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(t){const e=()=>{const e=this._modalRefs.indexOf(t);e>-1&&(this._modalRefs.splice(e,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(t),this._activeInstances.emit(this._modalRefs),t.result.then(e,e)}_registerWindowCmpt(t){this._windowCmpts.push(t),this._activeWindowCmptHasChanged.next(),t.onDestroy(()=>{const e=this._windowCmpts.indexOf(t);e>-1&&(this._windowCmpts.splice(e,1),this._activeWindowCmptHasChanged.next())})}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(ho),bi(ph),bi(t_),bi(Wa),bi(Ic))},t.\u0275prov=lt({factory:function(){return new t(bi(eh),bi(Ks),bi(ph),bi(t_),bi(Wa),bi(Ic))},token:t,providedIn:"root"}),t})(),a_=(()=>{class t{constructor(t,e,n,i){this._moduleCFR=t,this._injector=e,this._modalStack=n,this._config=i}open(t,e={}){const n=Object.assign({},this._config,e);return this._modalStack.open(this._moduleCFR,this._injector,t,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(t){this._modalStack.dismissAll(t)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return t.\u0275fac=function(e){return new(e||t)(bi(Ua),bi(ho),bi(o_),bi(Yx))},t.\u0275prov=lt({factory:function(){return new t(bi(Ua),bi(Ks),bi(o_),bi(Yx))},token:t,providedIn:"root"}),t})(),l_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[a_]}),t})(),c_=(()=>{class t{constructor(t){this.destroyOnHide=!0,this.orientation="horizontal",this.roles="tablist",this.keyboard=!1,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const h_=t=>dx(t)&&""!==t;let u_=0,d_=(()=>{class t{constructor(t){this.templateRef=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["ng-template","ngbNavContent",""]]}),t})(),p_=(()=>{class t{constructor(t,e){this.elementRef=e,this.disabled=!1,this.shown=new Wl,this.hidden=new Wl,this._nav=t}ngAfterContentChecked(){this.contentTpl=this.contentTpls.first}ngOnInit(){dx(this.domId)||(this.domId="ngb-nav-"+u_++)}get active(){return this._nav.activeId===this.id}get id(){return h_(this._id)?this._id:this.domId}get panelDomId(){return this.domId+"-panel"}isPanelInDom(){return(dx(this.destroyOnHide)?!this.destroyOnHide:!this._nav.destroyOnHide)||this.active}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>f_)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNavItem",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,d_,!1),2&t){let t;ic(t=lc())&&(e.contentTpls=t)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("nav-item",!0)},inputs:{disabled:"disabled",domId:"domId",destroyOnHide:"destroyOnHide",_id:["ngbNavItem","_id"]},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbNavItem"]}),t})(),f_=(()=>{class t{constructor(t,e,n,i){this.role=t,this._cd=n,this._document=i,this.activeIdChange=new Wl,this.shown=new Wl,this.hidden=new Wl,this.destroy$=new C,this.navItemChange$=new C,this.navChange=new Wl,this.animation=e.animation,this.destroyOnHide=e.destroyOnHide,this.orientation=e.orientation,this.roles=e.roles,this.keyboard=e.keyboard}click(t){t.disabled||this._updateActiveId(t.id)}onKeyDown(t){if("tablist"!==this.roles||!this.keyboard)return;const e=t.which,n=this.links.filter(t=>!t.navItem.disabled),{length:i}=n;let r=-1;if(n.forEach((t,e)=>{t.elRef.nativeElement===this._document.activeElement&&(r=e)}),i){switch(e){case Fx.ArrowLeft:if("vertical"===this.orientation)return;r=(r-1+i)%i;break;case Fx.ArrowRight:if("vertical"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowDown:if("horizontal"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowUp:if("horizontal"===this.orientation)return;r=(r-1+i)%i;break;case Fx.Home:r=0;break;case Fx.End:r=i-1}"changeWithArrows"===this.keyboard&&this.select(n[r].navItem.id),n[r].elRef.nativeElement.focus(),t.preventDefault()}}select(t){this._updateActiveId(t,!1)}ngAfterContentInit(){if(!dx(this.activeId)){const t=this.items.first?this.items.first.id:null;h_(t)&&(this._updateActiveId(t,!1),this._cd.detectChanges())}this.items.changes.pipe(Yw(this.destroy$)).subscribe(()=>this._notifyItemChanged(this.activeId))}ngOnChanges({activeId:t}){t&&!t.firstChange&&this._notifyItemChanged(t.currentValue)}ngOnDestroy(){this.destroy$.next()}_updateActiveId(t,e=!0){if(this.activeId!==t){let n=!1;e&&this.navChange.emit({activeId:this.activeId,nextId:t,preventDefault:()=>{n=!0}}),n||(this.activeId=t,this.activeIdChange.emit(t),this._notifyItemChanged(t))}}_notifyItemChanged(t){this.navItemChange$.next(this._getItemById(t))}_getItemById(t){return this.items&&this.items.find(e=>e.id===t)||null}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(c_),Ro(pl),Ro(ph))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNav",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,p_,!1),ac(n,g_,!0)),2&t){let t;ic(t=lc())&&(e.items=t),ic(t=lc())&&(e.links=t)}},hostVars:6,hostBindings:function(t,e){1&t&&Vo("keydown.arrowLeft",function(t){return e.onKeyDown(t)})("keydown.arrowRight",function(t){return e.onKeyDown(t)})("keydown.arrowDown",function(t){return e.onKeyDown(t)})("keydown.arrowUp",function(t){return e.onKeyDown(t)})("keydown.Home",function(t){return e.onKeyDown(t)})("keydown.End",function(t){return e.onKeyDown(t)}),2&t&&(ko("aria-orientation","vertical"===e.orientation&&"tablist"===e.roles?"vertical":void 0)("role",e.role?e.role:e.roles?"tablist":void 0),ra("nav",!0)("flex-column","vertical"===e.orientation))},inputs:{animation:"animation",destroyOnHide:"destroyOnHide",orientation:"orientation",roles:"roles",keyboard:"keyboard",activeId:"activeId"},outputs:{activeIdChange:"activeIdChange",shown:"shown",hidden:"hidden",navChange:"navChange"},exportAs:["ngbNav"],features:[le]}),t})(),g_=(()=>{class t{constructor(t,e,n,i){this.role=t,this.navItem=e,this.nav=n,this.elRef=i}hasNavItemClass(){return this.navItem.elementRef.nativeElement.nodeType===Node.COMMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(p_),Ro(f_),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["a","ngbNavLink",""]],hostAttrs:["href",""],hostVars:14,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.nav.click(e.navItem),t.preventDefault()}),2&t&&(xa("id",e.navItem.domId),ko("role",e.role?e.role:e.nav.roles?"tab":void 0)("tabindex",e.navItem.disabled?-1:void 0)("aria-controls",e.navItem.isPanelInDom()?e.navItem.panelDomId:null)("aria-selected",e.navItem.active)("aria-disabled",e.navItem.disabled),ra("nav-link",!0)("nav-item",e.hasNavItemClass())("active",e.navItem.active)("disabled",e.navItem.disabled))}}),t})(),m_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),v_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();class y_{constructor(t,e){this.open=t,this.close=e,e||(this.close=t)}isManual(){return"manual"===this.open||"manual"===this.close}}const b_={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]},w_=t=>t>0?sx(t):t=>t;let x_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),__=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),C_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),S_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),E_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),k_=(()=>{class t{constructor(t){this.autoClose=!0,this.placement="auto",this.triggers="hover focus",this.disableTooltip=!1,this.openDelay=0,this.closeDelay=0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})(),A_=0,D_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngb-tooltip-window"]],hostAttrs:["role","tooltip"],hostVars:5,hostBindings:function(t,e){2&t&&(xa("id",e.id),sa("tooltip"+(e.tooltipClass?" "+e.tooltipClass:"")),ra("fade",e.animation))},inputs:{animation:"animation",id:"id",tooltipClass:"tooltipClass"},ngContentSelectors:hx,decls:3,vars:0,consts:[[1,"arrow"],[1,"tooltip-inner"]],template:function(t,e){1&t&&(Go(),$o(0,"div",0),Mo(1,"div",1),qo(2),Io())},styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{bottom:.4rem;top:auto}"],encapsulation:2,changeDetection:0}),t})(),T_=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this._elementRef=t,this._renderer=e,this._ngZone=o,this._document=a,this._changeDetector=l,this.shown=new Wl,this.hidden=new Wl,this._ngbTooltipWindowId="ngb-tooltip-"+A_++,this._windowRef=null,this.animation=s.animation,this.autoClose=s.autoClose,this.placement=s.placement,this.triggers=s.triggers,this.container=s.container,this.disableTooltip=s.disableTooltip,this.tooltipClass=s.tooltipClass,this.openDelay=s.openDelay,this.closeDelay=s.closeDelay,this._popupService=new Qx(D_,n,r,e,this._ngZone,i,c),this._zoneSubscription=o.onStable.subscribe(()=>{this._windowRef&&Ux(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-tooltip")})}set ngbTooltip(t){this._ngbTooltip=t,!t&&this._windowRef&&this.close()}get ngbTooltip(){return this._ngbTooltip}open(t){if(!this._windowRef&&this._ngbTooltip&&!this.disableTooltip){const{windowRef:e,transition$:n}=this._popupService.open(this._ngbTooltip,t,this.animation);this._windowRef=e,this._windowRef.instance.animation=this.animation,this._windowRef.instance.tooltipClass=this.tooltipClass,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),$x(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),n.subscribe(()=>this.shown.emit())}}close(){null!=this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(this.animation).subscribe(()=>{this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck()}))}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=function(t,e,n,i,r,s,o=0,a=0){const l=function(t,e=b_){const n=(t||"").trim();if(0===n.length)return[];const i=n.split(/\s+/).map(t=>t.split(":")).map(t=>{let n=e[t[0]]||t;return new y_(n[0],n[1])}),r=i.filter(t=>t.isManual());if(r.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===r.length&&i.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return i}(n);if(1===l.length&&l[0].isManual())return()=>{};const c=function(t,e,n,i){return new y(r=>{const s=[],o=()=>r.next(!0),a=()=>r.next(!1),l=()=>r.next(!i());return n.forEach(n=>{n.open===n.close?s.push(t.listen(e,n.open,l)):s.push(t.listen(e,n.open,o),t.listen(e,n.close,a))}),()=>{s.forEach(t=>t())}})}(t,e,l,i).pipe(function(t,e,n){return i=>{let r=null;const s=i.pipe(k(t=>({open:t})),Af(t=>{const e=n();return e===t.open||r&&r.open!==e?(r&&r.open!==t.open&&(r=null),!1):(r=t,!0)}),Z());return W(s.pipe(Af(t=>t.open),w_(t)),s.pipe(Af(t=>!t.open),w_(e))).pipe(Af(t=>t===r&&(r=null,t.open!==n())),k(t=>t.open))}}(o,a,i)).subscribe(t=>t?r():s());return()=>c.unsubscribe()}(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({tooltipClass:t}){t&&this.isOpen()&&(this._windowRef.instance.tooltipClass=t.currentValue)}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(ho),Ro(Ua),Ro(El),Ro(k_),Ro(Ic),Ro(ph),Ro(pl),Ro(eh))},t.\u0275dir=Wt({type:t,selectors:[["","ngbTooltip",""]],inputs:{animation:"animation",autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disableTooltip:"disableTooltip",tooltipClass:"tooltipClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbTooltip:"ngbTooltip"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbTooltip"],features:[le]}),t})(),R_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();new Yn("live announcer delay",{providedIn:"root",factory:function(){return 100}});let F_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();const L_=[bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_];let M_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[L_,bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_]}),t})(),I_=(()=>{class t{constructor(){this.restrictedPages=new Map([["users",cw.USER_ROLE_ADMIN],["config",cw.USER_ROLE_DEVELOPER],["modules",cw.USER_ROLE_DEVELOPER],["apiexplorer",cw.USER_ROLE_DEVELOPER]])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function $_(t,e){if(1&t&&(Oo(0,5),Mo(1,"a",27),$o(2,"img",28),Mo(3,"span",12),va(4),Io(),Io(),Po()),2&t){const t=zo().$implicit;Fo("ngbNavItem",t.navItem),Qr(1),Fo("routerLink",t.routerLink),Qr(1),Xo("src","/static/svg/",t.icon,".svg",nr),Qr(2),ya(t.label)}}function O_(t,e){1&t&&$o(0,"hr")}function P_(t,e){if(1&t&&(Do(0,$_,5,4,"ng-container",26),Do(1,O_,1,0,"hr",25)),2&t){const t=e.$implicit;Fo("ngIf",zo().getSessionRole()<=t.minRole),Qr(1),Fo("ngIf",t.separator)}}function N_(t,e){if(1&t&&(Mo(0,"div",29),Mo(1,"h2",30),$o(2,"img",31),va(3,"An error has occurred!"),Io(),Mo(4,"h6",32),va(5),Io(),Mo(6,"p"),va(7,"Please refresh the page to try again."),Io(),Io()),2&t){const t=zo();Qr(5),ya(t.error)}}function B_(t,e){1&t&&(Mo(0,"div",33),$o(1,"img",34),Io())}function U_(t,e){1&t&&$o(0,"router-outlet")}const V_=function(){return["/"]},H_=function(){return["/login"]};let j_=(()=>{class t{constructor(t,e,n,i,r){var s;this.route=t,this.router=e,this.segment=n,this.consoleService=i,this.authService=r,this.loading=!0,this.error="",this.routes=[{navItem:"status",routerLink:["/status"],label:"Status",minRole:cw.USER_ROLE_READONLY,icon:"status"},{navItem:"users",routerLink:["/users"],label:"User Management",minRole:cw.USER_ROLE_ADMIN,icon:"user-management"},{navItem:"config",routerLink:["/config"],label:"Configuration",minRole:cw.USER_ROLE_DEVELOPER,icon:"configuration"},{navItem:"modules",routerLink:["/modules"],label:"Runtime Modules",minRole:cw.USER_ROLE_DEVELOPER,separator:!0,icon:"runtime-modules"},{navItem:"accounts",routerLink:["/accounts"],label:"Accounts",minRole:cw.USER_ROLE_READONLY,icon:"accounts"},{navItem:"groups",routerLink:["/groups"],label:"Groups",minRole:cw.USER_ROLE_READONLY,icon:"groups"},{navItem:"storage",routerLink:["/storage"],label:"Storage",minRole:cw.USER_ROLE_READONLY,icon:"storage"},{navItem:"leaderboards",routerLink:["/leaderboards"],label:"Leaderboards",minRole:cw.USER_ROLE_READONLY,icon:"leaderboard"},{navItem:"chat",routerLink:["/chat"],label:"Chat Messages",minRole:cw.USER_ROLE_READONLY,icon:"chat"},{navItem:"matches",routerLink:["/matches"],label:"Matches",minRole:cw.USER_ROLE_READONLY,icon:"running-matches"},{navItem:"apiexplorer",routerLink:["/apiexplorer"],label:"API Explorer",minRole:cw.USER_ROLE_DEVELOPER,icon:"api-explorer"}],this.loading=!1,this.routerSub=this.router.events.pipe(function(t){let e=arguments.length,n=Aw;E(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);let i=null;e>=2&&(i=arguments[1]);let r=Number.POSITIVE_INFINITY;return e>=3&&(r=arguments[2]),function(e){return e.lift(new Dw(t,i,r,n))}}(2e3)).subscribe(t=>{if(0===t.length)return;const e=t[t.length-1];e instanceof lg&&(this.loading=!0),e instanceof cg&&(this.loading=!1),e instanceof hg&&(this.loading=!1),e instanceof ug&&(this.loading=!1,this.error=e.error)}),this.segmentRouterSub=e.events.pipe((s=(t,e)=>!(e instanceof cg)||t.url===e.url,t=>t.lift(new Iw(s,undefined)))).subscribe(t=>{t&&n.page(t.url)})}ngOnInit(){this.route.data.subscribe(t=>{this.error=t.error?t.error:""})}getSessionRole(){return this.authService.sessionRole}getUsername(){return this.authService.username}logout(){this.authService.logout().subscribe(()=>{this.router.navigate(["/login"])})}ngOnDestroy(){this.segmentRouterSub.unsubscribe(),this.routerSub.unsubscribe()}onSidebarNavChange(t){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(Db),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:40,vars:11,consts:[[1,"container-fluid"],[1,"row"],["ngbNav","",1,"col-md-2","d-none","d-md-block","sidebar","position-fixed","px-0",3,"navChange"],["sidenav","ngbNav"],[1,"flex-column","text-uppercase"],[3,"ngbNavItem"],[3,"routerLink"],["src","/static/svg/logo.svg","alt","","width","175","height","",1,"logo-full","mx-3","mt-3","mb-1"],["src","/static/svg/logo-icon.svg","alt","","width","32","height","",1,"logo-icon","mx-3","mt-3","mb-1"],["ngFor","",3,"ngForOf"],["href","https://cloud.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/heroiccloud.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"link-text"],["href","https://heroiclabs.com/docs","target","_blank",1,"nav-link"],["src","/static/svg/docs.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://forum.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/forum.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://heroiclabs.com/blog","target","_blank",1,"nav-link"],["src","/static/svg/blog.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"logged-in-as","nav-link","disabled"],["ngbNavLink","","routerLinkActive","active",3,"routerLink","click"],["src","/static/svg/log-out.svg","alt","","width","24","height","",1,"mr-1"],["role","main",1,"ml-sm-auto","col-md-10","col-lg-10","main-extended","px-4","py-4"],["class","mx-auto",4,"ngIf"],["class","loading mx-auto",4,"ngIf"],[4,"ngIf"],[3,"ngbNavItem",4,"ngIf"],["ngbNavLink","","routerLinkActive","active",3,"routerLink"],["alt","","width","24","height","",1,"link-icon","mr-1",3,"src"],[1,"mx-auto"],[1,"pb-2"],["src","/static/svg/red-triangle.svg",1,"mr-2",2,"width","1em","height","1em"],[1,"mr-2","d-inline","font-weight-bold"],[1,"loading","mx-auto"],["src","/static/spinner.svg",1,"p-1","loading"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"nav",2,3),Vo("navChange",function(t){return e.onSidebarNavChange(t)}),Mo(4,"div",4),Oo(5,5),Mo(6,"a",6),$o(7,"img",7),$o(8,"img",8),Io(),Po(),$o(9,"hr"),Do(10,P_,2,2,"ng-template",9),$o(11,"hr"),Mo(12,"a",10),$o(13,"img",11),Mo(14,"span",12),va(15,"Heroic Cloud"),Io(),Io(),Mo(16,"a",13),$o(17,"img",14),Mo(18,"span",12),va(19,"Documentation"),Io(),Io(),Mo(20,"a",15),$o(21,"img",16),Mo(22,"span",12),va(23,"Forum"),Io(),Io(),Mo(24,"a",17),$o(25,"img",18),Mo(26,"span",12),va(27,"Heroic Labs Blog"),Io(),Io(),$o(28,"hr"),Mo(29,"div",19),va(30),Io(),Oo(31,5),Mo(32,"a",20),Vo("click",function(){return e.logout()}),$o(33,"img",21),Mo(34,"span",12),va(35,"Logout"),Io(),Io(),Po(),Io(),Io(),Mo(36,"main",22),Do(37,N_,8,1,"div",23),Do(38,B_,2,0,"div",24),Do(39,U_,1,0,"router-outlet",25),Io(),Io(),Io()),2&t&&(Qr(5),Fo("ngbNavItem","logo"),Qr(1),Fo("routerLink",Ul(9,V_)),Qr(4),Fo("ngForOf",e.routes),Qr(20),ba("Logged in as: ",e.getUsername(),""),Qr(1),Fo("ngbNavItem","logout"),Qr(1),Fo("routerLink",Ul(10,H_)),Qr(5),Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.error&&e.loading),Qr(1),Fo("ngIf",!e.error&&!e.loading))},directives:[f_,p_,Mv,Ph,g_,$v,Bh,Ov],styles:[".nav-link.no-active[_ngcontent-%COMP%]{background-color:initial!important}.nav-item[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-top-color:#708090}.sidebar[_ngcontent-%COMP%]{background-color:#333564;position:fixed;top:0;bottom:0;left:0;z-index:100;font-family:Montserrat,sans-serif;overflow-y:auto}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{color:#fff;font-size:12px;letter-spacing:.1em;opacity:.6;font-weight:500!important}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover{opacity:1;background-color:hsla(0,0%,88.2%,.1)}.sidebar[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-color:#fff;opacity:.2}.active[_ngcontent-%COMP%]{opacity:1}.nav-link.active[_ngcontent-%COMP%]{opacity:1;color:#a69bff}.navbar-collapse[_ngcontent-%COMP%]{letter-spacing:0;text-transform:capitalize}.logo-icon[_ngcontent-%COMP%]{display:none}.link-text[_ngcontent-%COMP%]{padding-left:4px}@media screen and (max-width:1200px){.main-extended[_ngcontent-%COMP%]{width:94.333333%!important;max-width:94.333333%!important;flex:0 0 94.333333%!important}.sidebar[_ngcontent-%COMP%]{min-width:65px!important;width:5.66%!important;max-width:5.66%!important}.sidebar[_ngcontent-%COMP%] .logo-full[_ngcontent-%COMP%]{display:none}.sidebar[_ngcontent-%COMP%] .logo-icon[_ngcontent-%COMP%]{display:block}.sidebar[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{width:30px}.sidebar[_ngcontent-%COMP%] .link-text[_ngcontent-%COMP%], .sidebar[_ngcontent-%COMP%] .logged-in-as[_ngcontent-%COMP%]{display:none}}"]}),t})(),z_=(()=>{class t{constructor(t,e,n){this.authService=t,this.router=e,this.globals=n}canActivate(t,e){return!0}canActivateChild(t,e){const n=this.globals.restrictedPages.get(t.url[0].path);return!(null!==n&&n{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}{}class Y_{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new J_(t,this.dueTime,this.scheduler))}}class J_ extends f{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Q_,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Q_(t){t.debouncedNext()}function Z_(){}var tC=function(t){return null==t?Z_:function(){return this.querySelector(t)}};function eC(){return[]}var nC=function(t){return null==t?eC:function(){return this.querySelectorAll(t)}},iC=function(t){return function(){return this.matches(t)}},rC=function(t){return new Array(t.length)};function sC(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function oC(t,e,n,i,r,s){for(var o,a=0,l=e.length,c=s.length;ae?1:t>=e?0:NaN}sC.prototype={constructor:sC,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var cC="http://www.w3.org/1999/xhtml",hC={svg:"http://www.w3.org/2000/svg",xhtml:cC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},uC=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),hC.hasOwnProperty(e)?{space:hC[e],local:t}:t};function dC(t){return function(){this.removeAttribute(t)}}function pC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fC(t,e){return function(){this.setAttribute(t,e)}}function gC(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function mC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function vC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var yC=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function bC(t){return function(){this.style.removeProperty(t)}}function wC(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xC(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function _C(t,e){return t.style.getPropertyValue(e)||yC(t).getComputedStyle(t,null).getPropertyValue(e)}function CC(t){return function(){delete this[t]}}function SC(t,e){return function(){this[t]=e}}function EC(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function kC(t){return t.trim().split(/^|\s+/)}function AC(t){return t.classList||new DC(t)}function DC(t){this._node=t,this._names=kC(t.getAttribute("class")||"")}function TC(t,e){for(var n=AC(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var zC=function(t){var e=uC(t);return(e.local?jC:HC)(e)};function WC(){return null}function GC(){var t=this.parentNode;t&&t.removeChild(this)}function qC(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function KC(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var XC={},YC=null;function JC(t,e,n){return t=QC(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function QC(t,e,n){return function(i){var r=YC;YC=i;try{t.call(this,this.__data__,e,n)}finally{YC=r}}}function ZC(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function tS(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i=x&&(x=w+1);!(b=v[x])&&++x=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=lC);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s1?this.each((null==e?bC:"function"==typeof e?xC:wC)(t,e,null==n?"":n)):_C(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?CC:"function"==typeof e?EC:SC)(t,e)):this.node()[t]},classed:function(t,e){var n=kC(t+"");if(arguments.length<2){for(var i=AC(this.node()),r=-1,s=n.length;++r=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function fS(t,e){for(var n,i=0,r=t.length;i0)for(var n,i,r=new Array(n),s=0;s>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?US(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?US(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=TS.exec(t))?new jS(e[1],e[2],e[3],1):(e=RS.exec(t))?new jS(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=FS.exec(t))?US(e[1],e[2],e[3],e[4]):(e=LS.exec(t))?US(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=MS.exec(t))?qS(e[1],e[2]/100,e[3]/100,1):(e=IS.exec(t))?qS(e[1],e[2]/100,e[3]/100,e[4]):$S.hasOwnProperty(t)?BS($S[t]):"transparent"===t?new jS(NaN,NaN,NaN,0):null}function BS(t){return new jS(t>>16&255,t>>8&255,255&t,1)}function US(t,e,n,i){return i<=0&&(t=e=n=NaN),new jS(t,e,n,i)}function VS(t){return t instanceof _S||(t=NS(t)),t?new jS((t=t.rgb()).r,t.g,t.b,t.opacity):new jS}function HS(t,e,n,i){return 1===arguments.length?VS(t):new jS(t,e,n,null==i?1:i)}function jS(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function zS(){return"#"+GS(this.r)+GS(this.g)+GS(this.b)}function WS(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function GS(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function qS(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new XS(t,e,n,i)}function KS(t){if(t instanceof XS)return new XS(t.h,t.s,t.l,t.opacity);if(t instanceof _S||(t=NS(t)),!t)return new XS;if(t instanceof XS)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n0&&l<1?0:o,new XS(o,a,l,t.opacity)}function XS(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function YS(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function JS(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}wS(_S,NS,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:OS,formatHex:OS,formatHsl:function(){return KS(this).formatHsl()},formatRgb:PS,toString:PS}),wS(jS,HS,xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zS,formatHex:zS,formatRgb:WS,toString:WS})),wS(XS,function(t,e,n,i){return 1===arguments.length?KS(t):new XS(t,e,n,null==i?1:i)},xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new XS(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new XS(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new jS(YS(t>=240?t-240:t+120,r,i),YS(t,r,i),YS(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var QS=function(t){return function(){return t}};function ZS(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):QS(isNaN(t)?e:t)}var tE=function t(e){var n=function(t){return 1==(t=+t)?ZS:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):QS(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=HS(t)).r,(e=HS(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),o=ZS(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function eE(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1];return JS((n-i/e)*e,i>0?t[i-1]:2*r-s,r,s,is&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:aE(n,i)})),s=hE.lastIndex;return s=0&&e._call.call(null,t),e=e._next;--mE}()}finally{mE=0,function(){for(var t,e,n=rE,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:rE=e);sE=t,RE(i)}(),wE=0}}function TE(){var t=_E.now(),e=t-bE;e>1e3&&(xE-=e,bE=t)}function RE(t){mE||(vE&&(vE=clearTimeout(vE)),t-wE>24?(t<1/0&&(vE=setTimeout(DE,t-_E.now()-xE)),yE&&(yE=clearInterval(yE))):(yE||(bE=_E.now(),yE=setInterval(TE,1e3)),mE=1,CE(DE)))}kE.prototype=AE.prototype={constructor:kE,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?SE():+n)+(null==e?0:+e),this._next||sE===this||(sE?sE._next=this:rE=this,sE=this),this._call=t,this._time=n,RE()},stop:function(){this._call&&(this._call=null,this._time=1/0,RE())}};var FE=function(t,e,n){var i=new kE;return i.restart(function(n){i.stop(),t(n+e)},e=null==e?0:+e,n),i},LE=mS("start","end","cancel","interrupt"),ME=[],IE=function(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(l){var c,h,u,d;if(1!==n.state)return a();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return FE(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c0)throw new Error("too late; already scheduled");return n}function OE(t,e){var n=PE(t,e);if(n.state>3)throw new Error("too late; already running");return n}function PE(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var NE,BE,UE,VE,HE=function(t,e){var n,i,r,s=t.__transition,o=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}},jE=180/Math.PI,zE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},WE=function(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:aE(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:aE(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:aE(t,n)},{i:a-2,x:aE(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?$E:OE;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var gk=lS.prototype.constructor;function mk(t){return function(){this.style.removeProperty(t)}}function vk(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function yk(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&vk(t,s,n)),i}return s._value=e,s}function bk(t){return function(e){this.textContent=t.call(this,e)}}function wk(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&bk(i)),e}return i._value=t,i}var xk=0;function _k(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ck(){return++xk}var Sk=lS.prototype;_k.prototype=(function(t){return lS().transition(t)}).prototype={constructor:_k,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=tC(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;oe?1:t>=e?0:NaN},Qk=function(t){let e=t,n=t;function i(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)<0?i=s+1:r=s}return i}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Jk(t(e),n)}(t)),{left:i,center:function(t,n,r,s){null==r&&(r=0),null==s&&(s=t.length);const o=i(t,n,r,s-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)>0?r=s:i=s+1}return i}}},Zk=Math.sqrt(50),tA=Math.sqrt(10),eA=Math.sqrt(2);function nA(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=Zk?10:s>=tA?5:s>=eA?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=Zk?10:s>=tA?5:s>=eA?2:1)}function iA(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=Zk?r*=10:s>=tA?r*=5:s>=eA&&(r*=2),e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return rA.setTime(+e),sA.setTime(+i),t(rA),t(sA),Math.floor(n(rA,sA))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var aA=oA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});aA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var lA=aA,cA=oA(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),hA=1e3,uA=6e4,dA=36e5;function pA(t){return oA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/6048e5})}var fA=pA(0),gA=(pA(1),pA(2),pA(3),pA(4),pA(5),pA(6),oA(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/864e5,t=>t.getDate()-1)),mA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA-t.getMinutes()*uA)},function(t,e){t.setTime(+t+e*dA)},function(t,e){return(e-t)/dA},function(t){return t.getHours()}),vA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA)},function(t,e){t.setTime(+t+e*uA)},function(t,e){return(e-t)/uA},function(t){return t.getMinutes()}),yA=oA(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*hA)},function(t,e){return(e-t)/hA},function(t){return t.getUTCSeconds()}),bA=oA(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});bA.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?oA(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):bA:null};var wA=bA,xA=new Date,_A=new Date;function CA(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return xA.setTime(+e),_A.setTime(+i),t(xA),t(_A),Math.floor(n(xA,_A))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var SA=864e5,EA=6048e5;function kA(t){return CA(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/EA})}var AA=kA(0),DA=kA(1),TA=(kA(2),kA(3),kA(4)),RA=(kA(5),kA(6),CA(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/SA},function(t){return t.getUTCDate()-1}));function FA(t){return CA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/EA})}var LA=FA(0),MA=FA(1),IA=(FA(2),FA(3),FA(4)),$A=(FA(5),FA(6),CA(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/SA},function(t){return t.getDate()-1})),OA=CA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});OA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var PA=OA,NA=CA(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});NA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var BA=NA;function UA(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function VA(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function HA(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var jA,zA,WA={"-":"",_:" ",0:"0"},GA=/^\s*\d+/,qA=/^%/,KA=/[\\^$*+?|[\]().{}]/g;function XA(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s68?1900:2e3),n+i[0].length):-1}function oD(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function aD(t,e,n){var i=GA.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function lD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function cD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function hD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function uD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function dD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function pD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function fD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function gD(t,e,n){var i=GA.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function mD(t,e,n){var i=qA.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function vD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function yD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function bD(t,e){return XA(t.getDate(),e,2)}function wD(t,e){return XA(t.getHours(),e,2)}function xD(t,e){return XA(t.getHours()%12||12,e,2)}function _D(t,e){return XA(1+$A.count(PA(t),t),e,3)}function CD(t,e){return XA(t.getMilliseconds(),e,3)}function SD(t,e){return CD(t,e)+"000"}function ED(t,e){return XA(t.getMonth()+1,e,2)}function kD(t,e){return XA(t.getMinutes(),e,2)}function AD(t,e){return XA(t.getSeconds(),e,2)}function DD(t){var e=t.getDay();return 0===e?7:e}function TD(t,e){return XA(LA.count(PA(t)-1,t),e,2)}function RD(t){var e=t.getDay();return e>=4||0===e?IA(t):IA.ceil(t)}function FD(t,e){return t=RD(t),XA(IA.count(PA(t),t)+(4===PA(t).getDay()),e,2)}function LD(t){return t.getDay()}function MD(t,e){return XA(MA.count(PA(t)-1,t),e,2)}function ID(t,e){return XA(t.getFullYear()%100,e,2)}function $D(t,e){return XA((t=RD(t)).getFullYear()%100,e,2)}function OD(t,e){return XA(t.getFullYear()%1e4,e,4)}function PD(t,e){var n=t.getDay();return XA((t=n>=4||0===n?IA(t):IA.ceil(t)).getFullYear()%1e4,e,4)}function ND(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+XA(e/60|0,"0",2)+XA(e%60,"0",2)}function BD(t,e){return XA(t.getUTCDate(),e,2)}function UD(t,e){return XA(t.getUTCHours(),e,2)}function VD(t,e){return XA(t.getUTCHours()%12||12,e,2)}function HD(t,e){return XA(1+RA.count(BA(t),t),e,3)}function jD(t,e){return XA(t.getUTCMilliseconds(),e,3)}function zD(t,e){return jD(t,e)+"000"}function WD(t,e){return XA(t.getUTCMonth()+1,e,2)}function GD(t,e){return XA(t.getUTCMinutes(),e,2)}function qD(t,e){return XA(t.getUTCSeconds(),e,2)}function KD(t){var e=t.getUTCDay();return 0===e?7:e}function XD(t,e){return XA(AA.count(BA(t)-1,t),e,2)}function YD(t){var e=t.getUTCDay();return e>=4||0===e?TA(t):TA.ceil(t)}function JD(t,e){return t=YD(t),XA(TA.count(BA(t),t)+(4===BA(t).getUTCDay()),e,2)}function QD(t){return t.getUTCDay()}function ZD(t,e){return XA(DA.count(BA(t)-1,t),e,2)}function tT(t,e){return XA(t.getUTCFullYear()%100,e,2)}function eT(t,e){return XA((t=YD(t)).getUTCFullYear()%100,e,2)}function nT(t,e){return XA(t.getUTCFullYear()%1e4,e,4)}function iT(t,e){var n=t.getUTCDay();return XA((t=n>=4||0===n?TA(t):TA.ceil(t)).getUTCFullYear()%1e4,e,4)}function rT(){return"+0000"}function sT(){return"%"}function oT(t){return+t}function aT(t){return Math.floor(+t/1e3)}jA=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,c=JA(r),h=QA(r),u=JA(s),d=QA(s),p=JA(o),f=QA(o),g=JA(a),m=QA(a),v=JA(l),y=QA(l),b={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:bD,e:bD,f:SD,g:$D,G:PD,H:wD,I:xD,j:_D,L:CD,m:ED,M:kD,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:oT,s:aT,S:AD,u:DD,U:TD,V:FD,w:LD,W:MD,x:null,X:null,y:ID,Y:OD,Z:ND,"%":sT},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:BD,e:BD,f:zD,g:eT,G:iT,H:UD,I:VD,j:HD,L:jD,m:WD,M:GD,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:oT,s:aT,S:qD,u:KD,U:XD,V:JD,w:QD,W:ZD,x:null,X:null,y:tT,Y:nT,Z:rT,"%":sT},x={a:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y[i[0].toLowerCase()],n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m[i[0].toLowerCase()],n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:cD,e:cD,f:gD,g:sD,G:rD,H:uD,I:uD,j:hD,L:fD,m:lD,M:dD,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=h[i[0].toLowerCase()],n+i[0].length):-1},q:aD,Q:vD,s:yD,S:pD,u:tD,U:eD,V:nD,w:ZA,W:iD,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:sD,Y:rD,Z:oD,"%":mD};function _(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=VA(HA(s.y,0,1))).getUTCDay(),i=r>4||0===r?DA.ceil(i):DA(i),i=RA.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=UA(HA(s.y,0,1))).getDay(),i=r>4||0===r?MA.ceil(i):MA(i),i=$A.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?VA(HA(s.y,0,1)).getUTCDay():UA(HA(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,VA(s)):UA(s)}}function S(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=x[r in WA?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=_(n,b),b.X=_(i,b),b.c=_(e,b),w.x=_(n,w),w.X=_(i,w),w.c=_(e,w),{format:function(t){var e=_(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=C(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=C(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),zA=jA.format;var lT=function(t){return null===t?NaN:+t};const cT=Qk(Jk).right;Qk(lT);var hT=cT,uT=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function dT(t){return+t}var pT=[0,1];function fT(t){return t}function gT(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function mT(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r(e=o[l-1])&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?vT:mT,r=s=null,u}function u(e){return isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(c(e)))}return u.invert=function(n){return c(e((s||(s=i(a,o.map(t),aE)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,dT),h()):o.slice()},u.range=function(t){return arguments.length?(a=Array.from(t),h()):a.slice()},u.rangeRound=function(t){return a=Array.from(t),l=uT,h()},u.clamp=function(t){return arguments.length?(c=!!t||fT,h()):c!==fT},u.interpolate=function(t){return arguments.length?(l=t,h()):l},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,i){return t=n,e=i,h()}}()(fT,fT)}function wT(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var xT=31536e6;function _T(t){return new Date(t)}function CT(t){return t instanceof Date?+t:+new Date(+t)}function ST(t,e,n,i,r,s,o,a,l){var c=bT(),h=c.invert,u=c.domain,d=l(".%L"),p=l(":%S"),f=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),v=l("%b %d"),y=l("%B"),b=l("%Y"),w=[[o,1,1e3],[o,5,5e3],[o,15,15e3],[o,30,3e4],[s,1,6e4],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,xT]];function x(a){return(o(a)=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AT(t){if(!(e=kT.exec(t)))throw new Error("invalid format: "+t);var e;return new DT({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function DT(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function TT(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}AT.prototype=DT.prototype,DT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var RT,FT,LT,MT,IT=function(t){return(t=TT(Math.abs(t)))?t[1]:NaN},$T=function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},OT={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return $T(100*t,e)},r:$T,s:function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(RT=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+TT(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},PT=function(t){return t},NT=Array.prototype.map,BT=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function UT(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),s=new Array(r=Math.ceil(e-t+1));++a0;){if((r=nA(l,c,n))===i)return s[o]=l,s[a]=c,e(s);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function VT(){var t=bT();return t.copy=function(){return yT(t,VT())},wT.apply(t,arguments),UT(t)}FT=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?PT:(e=NT.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?PT:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(NT.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=AT(t)).fill,n=t.align,u=t.sign,d=t.symbol,p=t.zero,f=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):OT[y]||(void 0===m&&(m=12),v=!0,y="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?s:/[%p]/.test(y)?l:"",x=OT[y],_=/[defgprs%]/.test(y);function C(t){var r,s,l,d=b,C=w;if("c"===y)C=x(t)+C,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==u&&(S=!1),d=(S?"("===u?u:c:"-"===u||"("===u?"":u)+d,C=("s"===y?BT[8+RT/3]:"")+C+(S&&"("===u?")":""),_)for(r=-1,s=t.length;++r(l=t.charCodeAt(r))||l>57){C=(46===l?o+t.slice(r+1):t.slice(r))+C,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var E=d.length+t.length+C.length,k=E>1)+d+t+C+k.slice(E);break;default:t=k+d+t+C}return a(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return t+""},C}return{format:u,formatPrefix:function(t,e){var n=u(((t=AT(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(IT(e)/3))),r=Math.pow(10,-i),s=BT[8+i/3];return function(t){return n(r*t)+s}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),LT=FT.format,MT=FT.formatPrefix;var HT=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,s=Math.floor(r),o=+n(t[s],s,t);return o+(+n(t[s+1],s+1,t)-o)*(r-s)}}function XT(){var t,e=[],n=[],i=[];function r(){var t=0,r=Math.max(1,n.length);for(i=new Array(r-1);++t0?i[r-1]:e[0],rtR)if(Math.abs(h*a-l*c)>tR&&r){var d=n-s,p=i-o,f=a*a+l*l,g=d*d+p*p,m=Math.sqrt(f),v=Math.sqrt(u),y=r*Math.tan((QT-Math.acos((f+u-g)/(2*m*v)))/2),b=y/v,w=y/m;Math.abs(b-1)>tR&&(this._+="L"+(t+b*c)+","+(e+b*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,c=e+a,h=1^s,u=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>tR||Math.abs(this._y1-c)>tR)&&(this._+="L"+l+","+c),n&&(u<0&&(u=u%ZT+ZT),u>eR?this._+="A"+n+","+n+",0,1,"+h+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>tR&&(this._+="A"+n+","+n+",0,"+ +(u>=QT)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var rR=iR,sR=function(t){return function(){return t}};function oR(t){return t[0]}function aR(t){return t[1]}var lR=function(){var t=oR,e=aR,n=sR(!0),i=null,r=JT,s=null;function o(o){var a,l,c,h=o.length,u=!1;for(null==i&&(s=r(c=rR())),a=0;a<=h;++a)!(a=h;--u)a.point(m[u],v[u]);a.lineEnd(),a.areaEnd()}g&&(m[c]=+t(d,c,l),v[c]=+n(d,c,l),a.point(e?+e(d,c,l):m[c],i?+i(d,c,l):v[c]))}if(p)return a=null,p+""||null}function c(){return lR().defined(r).curve(o).context(s)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:sR(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:sR(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:sR(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:sR(+t),l):i},l.lineX0=l.lineY0=function(){return c().x(t).y(n)},l.lineY1=function(){return c().x(t).y(i)},l.lineX1=function(){return c().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:sR(!!t),l):r},l.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),l):o},l.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),l):s},l},hR=function(){};function uR(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function dR(t,e){this._context=t,this._k=(1-e)/6}function pR(t,e){this._context=t,this._k=(1-e)/6}function fR(t){this._curve=t}dR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:uR(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new dR(t,e)}return n.tension=function(e){return t(+e)},n}(0),pR.prototype={areaStart:hR,areaEnd:hR,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new pR(t,e)}return n.tension=function(e){return t(+e)},n}(0),fR.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Math,Math,Math,Math,Math,Math,Math,Math;var gR=function(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(i-e)/t.value;++a=0;)e+=n[i].value;else e=1;t.value=e}function yR(t,e){var n,i,r,s,o,a=new _R(t),l=+t.value&&(a.value=t.value),c=[a];for(null==e&&(e=bR);n=c.pop();)if(l&&(n.value=+n.data.value),(r=e(n.data))&&(o=r.length))for(n.children=new Array(o),s=o-1;s>=0;--s)c.push(i=n.children[s]=new _R(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(xR)}function bR(t){return t.children}function wR(t){t.data=t.data.data}function xR(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _R(t){this.data=t,this.depth=this.height=0,this.parent=null}!function t(e){function n(t,n,i,r,s){!function(t,e,n,i,r,s){for(var o,a,l,c,h,u,d,p,f,g,m,v=[],y=e.children,b=0,w=0,x=y.length,_=e.value;bd&&(d=a),m=h*h*g,(p=Math.max(d/m,m/u))>f){h-=a;break}f=p}v.push(o={value:h,dice:l1?e:1)},n}((1+Math.sqrt(5))/2),_R.prototype=yR.prototype={constructor:_R,count:function(){return this.eachAfter(vR)},each:function(t){var e,n,i,r,s=this,o=[s];do{for(e=o.reverse(),o=[];s=e.pop();)if(t(s),n=s.children)for(i=0,r=n.length;i=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)i.push(e=e.parent);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return yR(this).eachBefore(wR)}};const CR=["caretElm"];function SR(t,e){}const ER=function(t){return{model:t}};function kR(t,e){if(1&t&&(Mo(0,"span"),Do(1,SR,0,0,"ng-template",5),Io()),2&t){const t=zo();Qr(1),Fo("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Vl(2,ER,t.context))}}function AR(t,e){1&t&&$o(0,"span",6),2&t&&Fo("innerHTML",zo().title,er)}function DR(t,e){if(1&t&&(ln(),cn(),$o(0,"ngx-charts-scale-legend",4)),2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("valueRange",t.legendOptions.domain)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)}}function TR(t,e){if(1&t){const t=No();ln(),cn(),Mo(0,"ngx-charts-legend",5),Vo("labelClick",function(e){return Ie(t),zo().legendLabelClick.emit(e)})("labelActivate",function(e){return Ie(t),zo().legendLabelActivate.emit(e)})("labelDeactivate",function(e){return Ie(t),zo().legendLabelDeactivate.emit(e)}),Io()}if(2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("data",t.legendOptions.domain)("title",t.legendOptions.title)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)("activeEntries",t.activeEntries)}}const RR=["*"],FR=["ngx-charts-axis-label",""],LR=["ticksel"],MR=["ngx-charts-x-axis-ticks",""];function IR(t,e){if(1&t&&(ln(),Mo(0,"g",3),Mo(1,"title"),va(2),Io(),Mo(3,"text",4),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("text-anchor",n.textAnchor)("transform",n.textTransform),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function $R(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",6),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),ko("y1",-t.gridLineHeight)}}function OR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,$R,2,2,"g",5),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}const PR=["ngx-charts-x-axis",""];function NR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksHeight(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("rotateTicks",t.rotateTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickStroke",t.tickStroke)("scale",t.xScale)("orient",t.xOrient)("showGridLines",t.showGridLines)("gridLineHeight",t.dims.height)("width",t.dims.width)("tickValues",t.ticks)}}function BR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient","bottom")("height",t.dims.height)("width",t.dims.width)}}const UR=["ngx-charts-y-axis-ticks",""];function VR(t,e){if(1&t&&(ln(),Mo(0,"g",4),Mo(1,"title"),va(2),Io(),Mo(3,"text",5),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("dy",n.dy)("x",n.x1)("y",n.y1)("text-anchor",n.textAnchor),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function HR(t,e){if(1&t&&(ln(),$o(0,"path",6)),2&t){const t=zo();ko("d",t.referenceAreaPath)("transform",t.gridLineTransform())}}function jR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",zo(3).gridLineWidth)}function zR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",-zo(3).gridLineWidth)}function WR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,jR,1,1,"line",8),Do(2,zR,1,1,"line",8),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),Fo("ngIf","left"===t.orient),Qr(1),Fo("ngIf","right"===t.orient)}}function GR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,WR,3,3,"g",7),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}function qR(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"title"),va(2),Io(),Mo(3,"text",11),va(4),Io(),Io()),2&t){const t=zo(2).$implicit,e=zo();Qr(2),ya(e.tickTrim(e.tickFormat(t.value))),Qr(1),ko("dy",e.dy)("y",-6)("x",e.gridLineWidth)("text-anchor",e.textAnchor),Qr(1),ba(" ",t.name," ")}}function KR(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",10),Do(2,qR,5,6,"g",7),Io()),2&t){const t=zo().$implicit,e=zo();ko("transform",e.transform(t.value)),Qr(1),ko("x2",e.gridLineWidth)("transform",e.gridLineTransform()),Qr(1),Fo("ngIf",e.showRefLabels)}}function XR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,KR,3,4,"g",7),Io()),2&t){const t=zo();Qr(1),Fo("ngIf",t.showRefLines)}}const YR=["ngx-charts-y-axis",""];function JR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksWidth(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickValues",t.ticks)("tickStroke",t.tickStroke)("scale",t.yScale)("orient",t.yOrient)("showGridLines",t.showGridLines)("gridLineWidth",t.dims.width)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)("height",t.dims.height)}}function QR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient",t.yOrient)("height",t.dims.height)("width",t.dims.width)}}const ZR=["ngx-charts-circle-series",""];function tF(t,e){if(1&t&&(ln(),$o(0,"rect",4)),2&t){const t=zo(2);Fo("@animationState","active"),ko("x",t.circle.cx-t.circle.radius)("y",t.circle.cy)("width",2*t.circle.radius)("height",t.circle.height)("fill",t.gradientFill)}}const eF=function(t){return{name:t}};function nF(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"defs"),$o(2,"g",1),Io(),Do(3,tF,1,6,"rect",2),Mo(4,"g",3),Vo("select",function(){Ie(t);const e=zo();return e.onClick(e.circle.data)})("activate",function(){return Ie(t),zo().activateCircle()})("deactivate",function(){return Ie(t),zo().deactivateCircle()}),Io(),Io()}if(2&t){const t=zo();Qr(2),Fo("name",t.gradientId)("stops",t.circle.gradientStops),Qr(1),Fo("ngIf",t.barVisible&&"standard"===t.type),Qr(1),ra("active",t.isActive(Vl(18,eF,t.circle.seriesName))),Fo("cx",t.circle.cx)("cy",t.circle.cy)("r",t.circle.radius)("fill",t.circle.color)("pointerEvents",0===t.circle.value?"none":"all")("data",t.circle.value)("classNames",t.circle.classNames)("tooltipDisabled",t.tooltipDisabled)("tooltipPlacement","top")("tooltipType","tooltip")("tooltipTitle",t.tooltipTemplate?void 0:t.getTooltipText(t.circle))("tooltipTemplate",t.tooltipTemplate)("tooltipContext",t.circle.data)}}const iF=["ngx-charts-circle",""],rF=["ngx-charts-svg-linear-gradient",""];function sF(t,e){if(1&t&&(ln(),$o(0,"stop")),2&t){const t=e.$implicit;ia("stop-color",t.color)("stop-opacity",t.opacity),ko("offset",t.offset+"%")}}const oF=["ngx-charts-area",""];function aF(t,e){if(1&t&&(ln(),Mo(0,"defs"),$o(1,"g",2),Io()),2&t){const t=zo();Qr(1),Fo("name",t.gradientId)("stops",t.gradientStops)}}const lF=["tooltipAnchor"],cF=["ngx-charts-tooltip-area",""];function hF(t,e){if(1&t&&(Mo(0,"div",6),$o(1,"span",7),va(2),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),ia("background-color",t.color),Qr(1),ba(" ",n.getToolTipText(t)," ")}}function uF(t,e){if(1&t&&(ln(),cn(),Mo(0,"div",4),Do(1,hF,3,3,"div",5),Io()),2&t){const t=e.model;Qr(1),Fo("ngForOf",t)}}const dF=["ngx-charts-timeline",""];function pF(t,e){if(1&t&&(Mo(0,"header",4),Mo(1,"span",5),va(2),Io(),Io()),2&t){const t=zo();Qr(2),ya(t.title)}}function fF(t,e){if(1&t){const t=No();Mo(0,"li",6),Mo(1,"ngx-charts-legend-entry",7),Vo("select",function(e){return Ie(t),zo().labelClick.emit(e)})("activate",function(e){return Ie(t),zo().activate(e)})("deactivate",function(e){return Ie(t),zo().deactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(1),Fo("label",t.label)("formattedLabel",t.formattedLabel)("color",t.color)("isActive",n.isActive(t))}}const gF=["tooltipTemplate"],mF=["seriesTooltipTemplate"],vF=function(t,e){return[t,e]},yF=["ngx-charts-line",""];function bF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",7),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateXAxisHeight(e)}),Io()}if(2&t){const t=zo();Fo("xScale",t.xScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showXAxisLabel)("labelText",t.xAxisLabel)("trimTicks",t.trimXAxisTicks)("rotateTicks",t.rotateXAxisTicks)("maxTickLength",t.maxXAxisTickLength)("tickFormatting",t.xAxisTickFormatting)("ticks",t.xAxisTicks)}}function wF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",8),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateYAxisWidth(e)}),Io()}if(2&t){const t=zo();Fo("yScale",t.yScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showYAxisLabel)("labelText",t.yAxisLabel)("trimTicks",t.trimYAxisTicks)("maxTickLength",t.maxYAxisTickLength)("tickFormatting",t.yAxisTickFormatting)("ticks",t.yAxisTicks)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)}}function xF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",9),Io()),2&t){const t=e.$implicit,n=zo();Fo("@animationState","active"),Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("activeEntries",n.activeEntries)("scaleType",n.scaleType)("curve",n.curve)("rangeFillOpacity",n.rangeFillOpacity)("hasRange",n.hasRange)("animations",n.animations)}}function _F(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"g",13),Vo("select",function(e){return Ie(t),zo(2).onClick(e)})("activate",function(e){return Ie(t),zo(2).onActivate(e)})("deactivate",function(e){return Ie(t),zo(2).onDeactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("visibleValue",n.hoveredVertical)("activeEntries",n.activeEntries)("tooltipDisabled",n.tooltipDisabled)("tooltipTemplate",n.tooltipTemplate)}}function CF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",10),Vo("mouseleave",function(){return Ie(t),zo().hideCircles()}),Mo(1,"g",11),Vo("hover",function(e){return Ie(t),zo().updateHoveredVertical(e)}),Io(),Do(2,_F,2,9,"g",12),Io()}if(2&t){const t=zo();Qr(1),Fo("dims",t.dims)("xSet",t.xSet)("xScale",t.xScale)("yScale",t.yScale)("results",t.results)("colors",t.colors)("tooltipDisabled",t.tooltipDisabled)("tooltipTemplate",t.seriesTooltipTemplate),Qr(1),Fo("ngForOf",t.results)}}function SF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",15),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.timelineXScale)("yScale",n.timelineYScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("curve",n.curve)("hasRange",n.hasRange)("animations",n.animations)}}function EF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",14),Vo("onDomainChange",function(e){return Ie(t),zo().updateDomain(e)}),Do(1,SF,2,8,"g",4),Io()}if(2&t){const t=zo();Fo("results",t.results)("view",Hl(10,vF,t.timelineWidth,t.height))("height",t.timelineHeight)("scheme",t.scheme)("customColors",t.customColors)("scaleType",t.scaleType)("legend",t.legend),ko("transform",t.timelineTransform),Qr(1),Fo("ngForOf",t.results)("ngForTrackBy",t.trackBy)}}const kF=["ngx-charts-line-series",""];function AF(t,e){if(1&t&&(ln(),$o(0,"g",4)),2&t){const t=zo();Fo("name",t.gradientId)("stops",t.gradientStops)}}function DF(t,e){if(1&t&&(ln(),$o(0,"g",5)),2&t){const t=zo();ra("active",t.isActive(t.data))("inactive",t.isInactive(t.data)),Fo("data",t.data)("path",t.outerPath)("fill",t.hasGradient?t.gradientUrl:t.colors.getColor(t.data.name))("opacity",t.rangeFillOpacity)("animations",t.animations)}}let TF=(()=>{class t{constructor(t,e,n){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n}static setGlobalRootViewContainer(e){t.globalRootViewContainer=e}getRootViewContainer(){if(this._container)return this._container;if(t.globalRootViewContainer)return t.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(t){this._container=t}getComponentRootNode(t){return t.element?t.element.nativeElement:t.hostView&&t.hostView.rootNodes.length>0?t.hostView.rootNodes[0]:t.location.nativeElement}getRootViewContainerNode(t){return this.getComponentRootNode(t)}projectComponentBindings(t,e){if(e){if(void 0!==e.inputs){const n=Object.getOwnPropertyNames(e.inputs);for(const i of n)t.instance[i]=e.inputs[i]}if(void 0!==e.outputs){const n=Object.getOwnPropertyNames(e.outputs);for(const i of n)t.instance[i]=e.outputs[i]}}return t}appendComponent(t,e={},n){n||(n=this.getRootViewContainer());const i=this.getComponentRootNode(n),r=new X_(i,this.componentFactoryResolver,this.applicationRef,this.injector),s=new G_(t),o=r.attach(s);return this.projectComponentBindings(o,e),o}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(Ua),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t.globalRootViewContainer=null,t})();function RF(t,e,n){let i,r,s;n=n||{};let o=null,a=0;function l(){a=!1===n.leading?0:+new Date,o=null,s=t.apply(i,r)}return function(){const c=+new Date;a||!1!==n.leading||(a=c);const h=e-(c-a);return i=this,r=arguments,h<=0?(clearTimeout(o),o=null,a=c,s=t.apply(i,r)):o||!1===n.trailing||(o=setTimeout(l,h)),s}}var FF=function(t){return t[t.top="top"]="top",t[t.bottom="bottom"]="bottom",t[t.left="left"]="left",t[t.right="right"]="right",t}({});function LF(t,e,n){return"top"===n?t.top-7:"bottom"===n?t.top+t.height-e.height+7:"center"===n?t.top+t.height/2-e.height/2:void 0}function MF(t,e,n){return"left"===n?t.left-7:"right"===n?t.left+t.width-e.width+7:"center"===n?t.left+t.width/2-e.width/2:void 0}class IF{static calculateVerticalAlignment(t,e,n){let i=LF(t,e,n);return i+e.height>window.innerHeight&&(i=window.innerHeight-e.height),i}static calculateVerticalCaret(t,e,n,i){let r;"top"===i&&(r=t.height/2-n.height/2+7),"bottom"===i&&(r=e.height-t.height/2-n.height/2-7),"center"===i&&(r=e.height/2-n.height/2);const s=LF(t,e,i);return s+e.height>window.innerHeight&&(r+=s+e.height-window.innerHeight),r}static calculateHorizontalAlignment(t,e,n){let i=MF(t,e,n);return i+e.width>window.innerWidth&&(i=window.innerWidth-e.width),i}static calculateHorizontalCaret(t,e,n,i){let r;"left"===i&&(r=t.width/2-n.width/2+7),"right"===i&&(r=e.width-t.width/2-n.width/2-7),"center"===i&&(r=e.width/2-n.width/2);const s=MF(t,e,i);return s+e.width>window.innerWidth&&(r+=s+e.width-window.innerWidth),r}static shouldFlip(t,e,n,i){let r=!1;return"right"===n&&t.left+t.width+e.width+i>window.innerWidth&&(r=!0),"left"===n&&t.left-e.width-i<0&&(r=!0),"top"===n&&t.top-e.height-i<0&&(r=!0),"bottom"===n&&t.top+t.height+e.height+i>window.innerHeight&&(r=!0),r}static positionCaret(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=-7,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.left?(o=e.width,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.top?(s=e.height,o=IF.calculateHorizontalCaret(n,e,i,r)):t===FF.bottom&&(s=-7,o=IF.calculateHorizontalCaret(n,e,i,r)),{top:s,left:o}}static positionContent(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=n.left+n.width+i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.left?(o=n.left-e.width-i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.top?(s=n.top-e.height-i,o=IF.calculateHorizontalAlignment(n,e,r)):t===FF.bottom&&(s=n.top+n.height+i,o=IF.calculateHorizontalAlignment(n,e,r)),{top:s,left:o}}static determinePlacement(t,e,n,i){if(IF.shouldFlip(n,e,t,i)){if(t===FF.right)return FF.left;if(t===FF.left)return FF.right;if(t===FF.top)return FF.bottom;if(t===FF.bottom)return FF.top}return t}}let $F=(()=>{class t{constructor(t,e){this.element=t,this.renderer=e}get cssClasses(){let t="ngx-charts-tooltip-content";return t+=" position-"+this.placement,t+=" type-"+this.type,t+=" "+this.cssClass,t}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){const t=this.element.nativeElement,e=this.host.nativeElement.getBoundingClientRect();if(!e.height&&!e.width)return;const n=t.getBoundingClientRect();this.checkFlip(e,n),this.positionContent(t,e,n),this.showCaret&&this.positionCaret(e,n),setTimeout(()=>this.renderer.addClass(t,"animate"),1)}positionContent(t,e,n){const{top:i,left:r}=IF.positionContent(this.placement,n,e,this.spacing,this.alignment);this.renderer.setStyle(t,"top",i+"px"),this.renderer.setStyle(t,"left",r+"px")}positionCaret(t,e){const n=this.caretElm.nativeElement,i=n.getBoundingClientRect(),{top:r,left:s}=IF.positionCaret(this.placement,e,t,i,this.alignment);this.renderer.setStyle(n,"top",r+"px"),this.renderer.setStyle(n,"left",s+"px")}checkFlip(t,e){this.placement=IF.determinePlacement(this.placement,e,t,this.spacing)}onWindowResize(){this.position()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-tooltip-content"]],viewQuery:function(t,e){if(1&t&&sc(CR,!0),2&t){let t;ic(t=lc())&&(e.caretElm=t.first)}},hostVars:2,hostBindings:function(t,e){1&t&&Vo("resize",function(){return e.onWindowResize()},!1,hr),2&t&&sa(e.cssClasses)},inputs:{placement:"placement",host:"host",showCaret:"showCaret",type:"type",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},decls:6,vars:6,consts:[[3,"hidden"],["caretElm",""],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(t,e){var n;1&t&&(Mo(0,"div"),$o(1,"span",0,1),Mo(3,"div",2),Do(4,kR,2,4,"span",3),Do(5,AR,1,1,"span",4),Io(),Io()),2&t&&(Qr(1),"tooltip-caret position-",n=e.placement,"",la(ri,oa,Ao(Le(),"tooltip-caret position-",n,""),!0),Fo("hidden",!e.showCaret),Qr(3),Fo("ngIf",!e.title),Qr(1),Fo("ngIf",e.title))},directives:[Bh,Gh],styles:[".ngx-charts-tooltip-content{border-radius:3px;display:block;font-weight:400;opacity:0;pointer-events:none!important;position:fixed;z-index:5000}.ngx-charts-tooltip-content.type-popover{background:#fff;border:1px solid #72809b;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);color:#060709;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-bottom:7px solid #fff;border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip{background:rgba(0,0,0,.75);color:#fff;font-size:12px;padding:0 10px;pointer-events:auto;text-align:center}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-bottom:7px solid rgba(0,0,0,.75);border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content .tooltip-label{display:block;font-size:1em;line-height:1em;padding:8px 5px 5px}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.position-right{transform:translate3d(10px,0,0)}.ngx-charts-tooltip-content.position-left{transform:translate3d(-10px,0,0)}.ngx-charts-tooltip-content.position-top{transform:translate3d(0,-10px,0)}.ngx-charts-tooltip-content.position-bottom{transform:translate3d(0,10px,0)}.ngx-charts-tooltip-content.animate{opacity:1;pointer-events:auto;transform:translateZ(0);transition:opacity .3s,transform .3s}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{line-height:1.2em;padding:5px 0;text-align:left}.tooltip-item .tooltip-item-color{border-radius:3px;color:#5b646b;display:inline-block;height:12px;margin-right:5px;width:12px}"],encapsulation:2}),function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);s>3&&o&&Object.defineProperty(e,n,o)}([function(t,e,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,e,{configurable:!0,enumerable:n.enumerable,value:RF(n.value,100,void 0)}),this[e]}}}],t.prototype,"onWindowResize",null),t})(),OF=(()=>{class t extends class{constructor(t){this.injectionService=t,this.defaults={},this.components=new Map}getByType(t=this.type){return this.components.get(t)}create(t){return this.createByType(this.type,t)}createByType(t,e){e=this.assignDefaults(e);const n=this.injectComponent(t,e);return this.register(t,n),n}destroy(t){const e=this.components.get(t.componentType);if(e&&e.length){const n=e.indexOf(t);n>-1&&(e[n].destroy(),e.splice(n,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(t){const e=this.components.get(t);if(e&&e.length){let t=e.length-1;for(;t>=0;)this.destroy(e[t--])}}injectComponent(t,e){return this.injectionService.appendComponent(t,e)}assignDefaults(t){const e=Object.assign({},this.defaults.inputs),n=Object.assign({},this.defaults.outputs);return t.inputs||t.outputs||(t={inputs:t}),e&&(t.inputs=Object.assign(Object.assign({},e),t.inputs)),n&&(t.outputs=Object.assign(Object.assign({},n),t.outputs)),t}register(t,e){this.components.has(t)||this.components.set(t,[]),this.components.get(t).push(e)}}{constructor(t){super(t),this.type=$F}}return t.\u0275fac=function(e){return new(e||t)(bi(TF))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),PF=(()=>{class t{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new Wl,this.legendLabelActivate=new Wl,this.legendLabelDeactivate=new Wl}ngOnChanges(t){this.update()}update(){let t=0;this.showLegend&&(this.legendType=this.getLegendType(),this.legendOptions&&"right"!==this.legendOptions.position||(t="scaleLegend"===this.legendType?1:2)),this.chartWidth=Math.floor(this.view[0]*(12-t)/12),this.legendWidth=this.legendOptions&&"right"!==this.legendOptions.position?this.chartWidth:Math.floor(this.view[0]*t/12)}getLegendType(){return"linear"===this.legendOptions.scaleType?"scaleLegend":"legend"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-chart"]],inputs:{showLegend:"showLegend",animations:"animations",legendType:"legendType",view:"view",legendOptions:"legendOptions",data:"data",legendData:"legendData",colors:"colors",activeEntries:"activeEntries"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},features:[Pa([OF]),le],ngContentSelectors:RR,decls:5,vars:8,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"horizontal","valueRange","colors","height","width",4,"ngIf"],["class","chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0),ln(),Mo(1,"svg",1),qo(2),Io(),Do(3,DR,1,5,"ngx-charts-scale-legend",2),Do(4,TR,1,7,"ngx-charts-legend",3),Io()),2&t&&(ia("width",e.view[0],"px"),Fo("@animationState","active")("@.disabled",!e.animations),Qr(1),ko("width",e.chartWidth)("height",e.view[1]),Qr(2),Fo("ngIf",e.showLegend&&"scaleLegend"===e.legendType),Qr(1),Fo("ngIf",e.showLegend&&"legend"===e.legendType))},directives:function(){return[Bh,fL,dL]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru("500ms 100ms",Lu({opacity:1}))])])]},changeDetection:0}),t})(),NF=(()=>{class t{constructor(t,e){this.element=t,this.zone=e,this.visible=new Wl,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const t=()=>{if(!this.element)return;const{offsetHeight:e,offsetWidth:n}=this.element.nativeElement;e&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t())})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275dir=Wt({type:t,selectors:[["visibility-observer"]],outputs:{visible:"visible"}}),t})(),BF=(()=>{class t{constructor(t,e,n){this.chartElement=t,this.zone=e,this.cd=n,this.scheme="cool",this.schemeType="ordinal",this.animations=!0,this.select=new Wl}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new NF(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(t){this.update()}update(){if(this.results=this.results?this.cloneData(this.results):[],this.view)this.width=this.view[0],this.height=this.view[1];else{const t=this.getContainerDims();t&&(this.width=t.width,this.height=t.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let t,e;const n=this.chartElement.nativeElement;if(null!==n.parentNode){const i=n.parentNode.getBoundingClientRect();t=i.width,e=i.height}return t&&e?{width:t,height:e}:null}formatDates(){for(let t=0;tn.lift(new Y_(t,e))}(200)).subscribe(t=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=t}cloneData(t){const e=[];for(const n of t){const t={name:n.name};if(void 0!==n.value&&(t.value=n.value),void 0!==n.series){t.series=[];for(const e of n.series){const n=Object.assign({},e);t.series.push(n)}}void 0!==n.extra&&(t.extra=JSON.parse(JSON.stringify(n.extra))),e.push(t)}return e}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["base-chart"]],inputs:{scheme:"scheme",schemeType:"schemeType",animations:"animations",results:"results",view:"view",customColors:"customColors"},outputs:{select:"select"},features:[le],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"div")},encapsulation:2}),t})(),UF=(()=>{class t{constructor(t){this.textHeight=25,this.margin=5,this.element=t.nativeElement}ngOnChanges(t){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case"top":case"bottom":this.y=this.offset,this.x=this.width/2;break;case"left":this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case"right":this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)"}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},features:[le],attrs:FR,decls:2,vars:6,template:function(t,e){1&t&&(ln(),Mo(0,"text"),va(1),Io()),2&t&&(ko("stroke-width",e.strokeWidth)("x",e.x)("y",e.y)("text-anchor",e.textAnchor)("transform",e.transform),Qr(1),ba(" ",e.label," "))},encapsulation:2,changeDetection:0}),t})();function VF(t,e=16){return"string"!=typeof t?"number"==typeof t?t+"":"":(t=t.trim()).length<=e?t:t.slice(0,e)+"..."}function HF(t,e){if(t.length>e){const n=[],i=Math.floor(t.length/e);for(let e=0;e{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.dimensionsChanged=new Wl,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor="middle",this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);t!==this.height&&(this.height=t,this.dimensionsChanged.emit({height:t}),setTimeout(()=>this.updateDims()))}update(){const t=this.scale;this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()};const e=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.adjustedScale=this.scale.bandwidth?function(t){return this.scale(t)+.5*this.scale.bandwidth()}:this.scale,this.textTransform="",e&&0!==e?(this.textTransform=`rotate(${e})`,this.textAnchor="end",this.verticalSpacing=10):this.textAnchor="middle",setTimeout(()=>this.updateDims())}getRotationAngle(t){let e=0;this.maxTicksLength=0;for(let s=0;sthis.maxTicksLength&&(this.maxTicksLength=n)}const n=8*Math.min(this.maxTicksLength,this.maxAllowedLength);let i=n;const r=Math.floor(this.width/t.length);for(;i>r&&e>-90;)e-=30,i=Math.cos(e*(Math.PI/180))*n;return e}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(100);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.width/t)}tickTransform(t){return"translate("+this.adjustedScale(t)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",rotateTicks:"rotateTicks",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineHeight:"gridLineHeight",width:"width"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:MR,decls:4,vars:2,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[4,"ngIf"],["y2","0",1,"gridline-path","gridline-path-vertical"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,IR,5,7,"g",1),Io(),Do(3,OR,2,2,"g",2)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.ticks))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),zF=(()=>{class t{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient="bottom",this.xAxisOffset=0,this.dimensionsChanged=new Wl,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5}ngOnChanges(t){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,void 0!==this.xAxisTickCount&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:t}){const e=t+25+5;e!==this.labelOffset&&(this.labelOffset=e,setTimeout(()=>{this.dimensionsChanged.emit({height:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(t,e){if(1&t&&sc(jF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{rotateTicks:"rotateTicks",showGridLines:"showGridLines",xOrient:"xOrient",xAxisOffset:"xAxisOffset",xScale:"xScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickInterval:"xAxisTickInterval",xAxisTickCount:"xAxisTickCount"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:PR,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,NR,1,12,"g",0),Do(2,BR,1,5,"g",1),Io()),2&t&&(ko("class",e.xAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.xScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,jF,UF],encapsulation:2,changeDetection:0}),t})(),WF=(()=>{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.dimensionsChanged=new Wl,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor="middle",this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);t!==this.width&&(this.width=t,this.dimensionsChanged.emit({width:t}),setTimeout(()=>this.updateDims()))}update(){let t;const e="top"===this.orient||"right"===this.orient?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,t=this.scale,this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()},this.adjustedScale=t.bandwidth?function(e){return t(e)+.5*t.bandwidth()}:t,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case"top":case"bottom":this.transform=function(t){return"translate("+this.adjustedScale(t)+",0)"},this.textAnchor="middle",this.y2=this.innerTickSize*e,this.y1=this.tickSpacing*e,this.dy=e<0?"0em":".71em";break;case"left":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="end",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em";break;case"right":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="start",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em"}setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(t=>t.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(t=>t.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=function(t,e,n,i,r,[s,o,a,l]){let c="";return c="M"+[t+r,e],c+="h"+((n=0===(n=Math.floor(n))?1:n)-2*r),c+=o?`a${[r,r]} 0 0 1 ${[r,r]}`:`h${r}v${r}`,c+="v"+((i=0===(i=Math.floor(i))?1:i)-2*r),c+=l?`a${[r,r]} 0 0 1 ${[-r,r]}`:`v${r}h${-r}`,c+="h"+(2*r-n),c+=a?`a${[r,r]} 0 0 1 ${[-r,-r]}`:`h${-r}v${-r}`,c+="v"+(2*r-i),c+=s?`a${[r,r]} 0 0 1 ${[r,-r]}`:`v${-r}h${r}`,c+="z",c}(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(50);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.height/t)}tickTransform(t){return`translate(${this.adjustedScale(t)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:UR,decls:6,vars:4,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[1,"reference-area"],[4,"ngIf"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,VR,5,9,"g",1),Io(),Do(3,HR,1,2,"path",2),Do(4,GR,2,2,"g",3),Do(5,XR,2,1,"g",3)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngIf",e.referenceLineLength>1&&e.refMax&&e.refMin&&e.showRefLines),Qr(1),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.referenceLines))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),GF=(()=>{class t{constructor(){this.showGridLines=!1,this.yOrient="left",this.yAxisOffset=0,this.dimensionsChanged=new Wl,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5}ngOnChanges(t){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),"right"===this.yOrient?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):(this.offset=this.offset,this.transform=`translate(${this.offset} , 0)`),void 0!==this.yAxisTickCount&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:t}){t!==this.labelOffset&&"right"===this.yOrient?(this.labelOffset=t+this.labelOffset,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0)):t!==this.labelOffset&&(this.labelOffset=t,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(t,e){if(1&t&&sc(WF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{showGridLines:"showGridLines",yOrient:"yOrient",yAxisOffset:"yAxisOffset",yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showLabel:"showLabel",labelText:"labelText",yAxisTickInterval:"yAxisTickInterval",yAxisTickCount:"yAxisTickCount",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:YR,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,JR,1,14,"g",0),Do(2,QR,1,5,"g",1),Io()),2&t&&(ko("class",e.yAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.yScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,WF,UF],encapsulation:2,changeDetection:0}),t})(),qF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();var KF=function(t){return t[t.popover="popover"]="popover",t[t.tooltip="tooltip"]="tooltip",t}({}),XF=function(t){return t[t.left="left"]="left",t[t.center="center"]="center",t[t.right="right"]="right",t}({}),YF=function(t){return t[t.all="all"]="all",t[t.focus="focus"]="focus",t[t.mouseover="mouseover"]="mouseover",t}({});let JF=(()=>{class t{constructor(t,e,n){this.tooltipService=t,this.viewContainerRef=e,this.renderer=n,this.tooltipCssClass="",this.tooltipTitle="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=FF.top,this.tooltipAlignment=XF.center,this.tooltipType=KF.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=YF.all,this.tooltipImmediateExit=!1,this.show=new Wl,this.hide=new Wl}get listensForFocus(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.focus}get listensForHover(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.mouseover}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(t){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(t))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(t){if(this.component||this.tooltipDisabled)return;const e=t?0:this.tooltipShowTimeout;clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();const t=this.createBoundOptions();this.component=this.tooltipService.create(t),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},e)}addHideListeners(t){this.mouseEnterContentEvent=this.renderer.listen(t,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(t,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen(document,"click",e=>{t.contains(e.target)||this.hideTooltip()}))}hideTooltip(t=!1){if(!this.component)return;const e=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),t?e():this.timeout=setTimeout(e,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}}return t.\u0275fac=function(e){return new(e||t)(Ro(OF),Ro(El),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-tooltip",""]],hostBindings:function(t,e){1&t&&Vo("focusin",function(){return e.onFocus()})("blur",function(){return e.onBlur()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(t){return e.onMouseLeave(t.target)})("click",function(){return e.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipTitle:"tooltipTitle",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipShowEvent:"tooltipShowEvent",tooltipImmediateExit:"tooltipImmediateExit",tooltipTemplate:"tooltipTemplate",tooltipContext:"tooltipContext"},outputs:{show:"show",hide:"hide"}}),t})(),QF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[TF,OF],imports:[[qh]]}),t})();function ZF(t){return t instanceof Date?t.toLocaleDateString():t.toLocaleString()}function tL(t){return t.toLocaleString().replace(/[&'`"<>]/g,t=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"}[t]))}const eL={};function nL(){let t=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return t="a"+t,eL[t]?nL():(eL[t]=!0,t)}let iL,rL=(()=>{class t{constructor(){this.type="standard",this.tooltipDisabled=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.barVisible=!1}ngOnInit(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`}ngOnChanges(t){this.update()}update(){this.circle=this.getActiveCircle()}getActiveCircle(){const t=this.data.series.findIndex(t=>{const e=t.name;return e&&this.visibleValue&&e.toString()===this.visibleValue.toString()&&void 0!==t.value});if(-1!==t)return this.mapDataPointToCircle(this.data.series[t],t)}mapDataPointToCircle(t,e){const n=this.data.name,i=t.value,r=t.name,s=ZF(r);let o;o=this.xScale("time"===this.scaleType?r:"linear"===this.scaleType?Number(r):r);const a=this.yScale("standard"===this.type?i:t.d1),l=this.yScale.range()[0]-a;let c;return c=this.colors.getColor("linear"===this.colors.scaleType?"standard"===this.type?i:t.d1:n),{classNames:["circle-data-"+e],value:i,label:r,data:Object.assign({},t,{series:n,value:i,name:r}),cx:o,cy:a,radius:5,height:l,tooltipLabel:s,color:c,opacity:1,seriesName:n,gradientStops:this.getGradientStops(c),min:t.min,max:t.max}}getTooltipText({tooltipLabel:t,value:e,seriesName:n,min:i,max:r}){return`\n ${tL(n)} \u2022 ${tL(t)}\n ${e.toLocaleString()}${this.getTooltipMinMaxText(i,r)}\n `}getTooltipMinMaxText(t,e){if(void 0!==t||void 0!==e){let n=" (";return void 0!==t?(void 0===e&&(n+="\u2265"),n+=t.toLocaleString(),void 0!==e&&(n+=" - ")):void 0!==e&&(n+="\u2264"),void 0!==e&&(n+=e.toLocaleString()),n+=")",n}return""}getGradientStops(t){return[{offset:0,color:t,opacity:.2},{offset:100,color:t,opacity:1}]}onClick(t){this.select.emit(t)}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}activateCircle(){this.barVisible=!0,this.activate.emit({name:this.data.name})}deactivateCircle(){this.barVisible=!1,this.circle.opacity=0,this.deactivate.emit({name:this.data.name})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle-series",""]],inputs:{type:"type",tooltipDisabled:"tooltipDisabled",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",visibleValue:"visibleValue",activeEntries:"activeEntries",tooltipTemplate:"tooltipTemplate"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:ZR,decls:1,vars:1,consts:[[4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["class","tooltip-bar",4,"ngIf"],["ngx-charts-circle","","ngx-tooltip","",1,"circle",3,"cx","cy","r","fill","pointerEvents","data","classNames","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","select","activate","deactivate"],[1,"tooltip-bar"]],template:function(t,e){1&t&&Do(0,nF,5,20,"g",0),2&t&&Fo("ngIf",e.circle)},directives:function(){return[Bh,oL,sL,JF]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru(250,Lu({opacity:1}))])])]},changeDetection:0}),t})(),sL=(()=>{class t{constructor(){this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl}onClick(){this.select.emit(this.data)}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}ngOnChanges(t){this.classNames=Array.isArray(this.classNames)?this.classNames.join(" "):"",this.classNames+="circle"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle",""]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{classNames:"classNames",cx:"cx",cy:"cy",r:"r",fill:"fill",stroke:"stroke",data:"data",circleOpacity:"circleOpacity",pointerEvents:"pointerEvents"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:iF,decls:1,vars:8,template:function(t,e){1&t&&(ln(),$o(0,"circle")),2&t&&ko("cx",e.cx)("cy",e.cy)("r",e.r)("fill",e.fill)("stroke",e.stroke)("opacity",e.circleOpacity)("class",e.classNames)("pointer-events",e.pointerEvents)},encapsulation:2,changeDetection:0}),t})(),oL=(()=>{class t{constructor(){this.orientation="vertical"}ngOnChanges(t){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%","horizontal"===this.orientation?this.x2="100%":"vertical"===this.orientation&&(this.y1="100%")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},features:[le],attrs:rF,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(t,e){1&t&&(ln(),Mo(0,"linearGradient",0),Do(1,sF,1,5,"stop",1),Io()),2&t&&(Fo("id",e.name),ko("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2),Qr(1),Fo("ngForOf",e.stops))},directives:[Ph],encapsulation:2,changeDetection:0}),t})(),aL=(()=>{class t{constructor(t){this.opacity=1,this.startOpacity=.5,this.endOpacity=1,this.gradient=!1,this.animations=!0,this.select=new Wl,this.initialized=!1,this.hasGradient=!1,this.element=t.nativeElement}ngOnChanges(t){this.initialized?this.update():(this.loadAnimation(),this.initialized=!0)}update(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl()}loadAnimation(){this.areaPath=this.startingPath,setTimeout(this.update.bind(this),100)}updatePathEl(){const t=cS(this.element).select(".area");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.startOpacity},{offset:100,color:this.fill,opacity:this.endOpacity}]}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-area",""]],inputs:{opacity:"opacity",startOpacity:"startOpacity",endOpacity:"endOpacity",gradient:"gradient",animations:"animations",data:"data",path:"path",startingPath:"startingPath",fill:"fill",activeLabel:"activeLabel",stops:"stops"},outputs:{select:"select"},features:[le],attrs:oF,decls:2,vars:5,consts:[[4,"ngIf"],[1,"area"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"]],template:function(t,e){1&t&&(Do(0,aF,2,2,"defs",0),ln(),$o(1,"path",1)),2&t&&(Fo("ngIf",e.gradient),Qr(1),ia("opacity",e.opacity),ko("d",e.areaPath)("fill",e.gradient?e.gradientFill:e.fill))},directives:[Bh,oL],encapsulation:2,changeDetection:0}),t})();"undefined"!=typeof window?iL=window:"undefined"!=typeof global&&(iL=global);const lL=iL.MouseEvent;function cL(t,e=!1,n=!0){if("function"==typeof lL)return new lL(t,{bubbles:e,cancelable:n});{const i=document.createEvent("MouseEvent");return i.initEvent(t,e,n),i}}let hL=(()=>{class t{constructor(){this.anchorOpacity=0,this.anchorPos=-1,this.anchorValues=[],this.showPercentage=!1,this.tooltipDisabled=!1,this.hover=new Wl}getValues(t){const e=[];for(const n of this.results){const i=n.series.find(e=>e.name.toString()===t.toString());let r=n.name;if(r instanceof Date&&(r=r.toLocaleDateString()),i){const t=i.name;let s,o=i.value;if(this.showPercentage&&(o=(i.d1-i.d0).toFixed(2)+"%"),"linear"===this.colors.scaleType){let t=o;i.d1&&(t=i.d1),s=this.colors.getColor(t)}else s=this.colors.getColor(n.name);const a=Object.assign({},i,{value:o,name:t,series:r,min:i.min,max:i.max,color:s});e.push(a)}}return e}mouseMove(t){const e=t.pageX-t.target.getBoundingClientRect().left,n=this.findClosestPointIndex(e),i=this.xSet[n];if(this.anchorPos=this.xScale(i),this.anchorPos=Math.max(0,this.anchorPos),this.anchorPos=Math.min(this.dims.width,this.anchorPos),this.anchorValues=this.getValues(i),this.anchorPos!==this.lastAnchorPos){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=.7,this.hover.emit({value:i}),this.showTooltip(),this.lastAnchorPos=this.anchorPos}}findClosestPointIndex(t){let e=0,n=this.xSet.length-1,i=Number.MAX_VALUE,r=0;for(;e<=n;){const s=(e+n)/2|0,o=this.xScale(this.xSet[s]),a=Math.abs(o-t);if(at)){i=0,r=s;break}n=s-1}}return r}showTooltip(){const t=cL("mouseenter");this.tooltipAnchor.nativeElement.dispatchEvent(t)}hideTooltip(){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=0,this.lastAnchorPos=-1}getToolTipText(t){let e="";return e+=void 0!==t.series?t.series:"???",e+=": ",void 0!==t.value&&(e+=t.value.toLocaleString()),void 0===t.min&&void 0===t.max||(e+=" (",void 0!==t.min?(void 0===t.max&&(e+="\u2265"),e+=t.min.toLocaleString(),void 0!==t.max&&(e+=" - ")):void 0!==t.max&&(e+="\u2264"),void 0!==t.max&&(e+=t.max.toLocaleString()),e+=")"),e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-tooltip-area",""]],viewQuery:function(t,e){if(1&t&&sc(lF,!0),2&t){let t;ic(t=lc())&&(e.tooltipAnchor=t.first)}},inputs:{showPercentage:"showPercentage",tooltipDisabled:"tooltipDisabled",dims:"dims",xSet:"xSet",xScale:"xScale",yScale:"yScale",results:"results",colors:"colors",tooltipTemplate:"tooltipTemplate"},outputs:{hover:"hover"},attrs:cF,decls:6,vars:18,consts:[["y","0",1,"tooltip-area",2,"opacity","0","cursor","auto",3,"mousemove","mouseleave"],["defaultTooltipTemplate",""],["y","0","ngx-tooltip","",1,"tooltip-anchor",3,"tooltipDisabled","tooltipPlacement","tooltipType","tooltipSpacing","tooltipTemplate","tooltipContext","tooltipImmediateExit"],["tooltipAnchor",""],[1,"area-tooltip-container"],["class","tooltip-item",4,"ngFor","ngForOf"],[1,"tooltip-item"],[1,"tooltip-item-color"]],template:function(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"rect",0),Vo("mousemove",function(t){return e.mouseMove(t)})("mouseleave",function(){return e.hideTooltip()}),Io(),Do(2,uF,2,1,"ng-template",null,1,dc),$o(4,"rect",2,3),Io()),2&t){const t=To(3);Qr(1),ko("x",0)("width",e.dims.width)("height",e.dims.height),Qr(3),ia("opacity",e.anchorOpacity)("pointer-events","none"),Fo("@animationState",0!==e.anchorOpacity?"active":"inactive")("tooltipDisabled",e.tooltipDisabled)("tooltipPlacement","right")("tooltipType","tooltip")("tooltipSpacing",15)("tooltipTemplate",e.tooltipTemplate?e.tooltipTemplate:t)("tooltipContext",e.anchorValues)("tooltipImmediateExit",!0),ko("x",e.anchorPos)("width",1)("height",e.dims.height)}},directives:[JF,Ph],encapsulation:2,data:{animation:[Tu("animationState",[Mu("inactive => active",[Lu({opacity:0}),Ru(250,Lu({opacity:.7}))]),Mu("active => inactive",[Lu({opacity:.7}),Ru(250,Lu({opacity:0}))])])]},changeDetection:0}),t})(),uL=(()=>{class t{constructor(t,e){this.cd=e,this.height=50,this.select=new Wl,this.onDomainChange=new Wl,this.initialized=!1,this.element=t.nativeElement}ngOnChanges(t){this.update(),this.initialized||(this.addBrush(),this.initialized=!0)}update(){this.dims=this.getDims(),this.height=this.dims.height;const t=this.view[1]-this.height;this.xDomain=this.getXDomain(),this.xScale=this.getXScale(),this.brush&&this.updateBrush(),this.transform=`translate(0 , ${t})`,this.filterId="filter"+nL().toString(),this.filter=`url(#${this.filterId})`,this.cd.markForCheck()}getXDomain(){let t=[];for(const n of this.results)for(const e of n.series)t.includes(e.name)||t.push(e.name);let e=[];return"time"===this.scaleType?e=[Math.min(...t),Math.max(...t)]:"linear"===this.scaleType?(t=t.map(t=>Number(t)),e=[Math.min(...t),Math.max(...t)]):e=t,e}getXScale(){let t;return"time"===this.scaleType?t=ET().range([0,this.dims.width]).domain(this.xDomain):"linear"===this.scaleType?t=VT().range([0,this.dims.width]).domain(this.xDomain):"ordinal"===this.scaleType&&(t=qT().range([0,this.dims.width]).padding(.1).domain(this.xDomain)),t}addBrush(){if(this.brush)return;const t=this.height,e=this.view[0];this.brush=function(t){var e,n=qk,i=Gk,r=Kk,s=!0,o=mS("start","brush","end"),a=6;function l(e){var n=e.property("__brush",g).selectAll(".overlay").data([Wk("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Uk.overlay).merge(n).each(function(){var t=Xk(this).extent;cS(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Wk("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Uk.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Uk[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=cS(this),e=Xk(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function h(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new u(t,e,n):i}function u(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(){if((!e||YC.touches)&&i.apply(this,arguments)){var n,r,o,a,l,u,d,p,f,g,m,v=this,y=YC.target.__data__.type,b="selection"===(s&&YC.metaKey?y="overlay":y)?Fk:s&&YC.altKey?Ik:Mk,w=t===Bk?null:jk[y],x=t===Nk?null:zk[y],_=Xk(v),C=_.extent,S=_.selection,E=C[0][0],k=C[0][1],A=C[1][0],D=C[1][1],T=0,R=0,F=w&&x&&s&&YC.shiftKey,L=YC.touches?Pk(YC.changedTouches[0].identifier):gE,M=L(v),I=M,$=h(v,arguments,!0).beforestart();"overlay"===y?(S&&(f=!0),_.selection=S=[[n=t===Bk?E:M[0],o=t===Nk?k:M[1]],[l=t===Bk?A:n,d=t===Nk?D:o]]):(n=S[0][0],o=S[0][1],l=S[1][0],d=S[1][1]),r=n,a=o,u=l,p=d;var O=cS(v).attr("pointer-events","none"),P=O.selectAll(".overlay").attr("cursor",Uk[y]);if(YC.touches)$.moved=B,$.ended=V;else{var N=cS(YC.view).on("mousemove.brush",B,!0).on("mouseup.brush",V,!0);s&&N.on("keydown.brush",H,!0).on("keyup.brush",j,!0),yS(YC.view)}Tk(),HE(v),c.call(v),$.start()}function B(){var t=L(v);!F||g||m||(Math.abs(t[0]-I[0])>Math.abs(t[1]-I[1])?m=!0:g=!0),I=t,f=!0,Rk(),U()}function U(){var t;switch(T=I[0]-M[0],R=I[1]-M[1],b){case Lk:case Fk:w&&(T=Math.max(E-n,Math.min(A-l,T)),r=n+T,u=l+T),x&&(R=Math.max(k-o,Math.min(D-d,R)),a=o+R,p=d+R);break;case Mk:w<0?(T=Math.max(E-n,Math.min(A-n,T)),r=n+T,u=l):w>0&&(T=Math.max(E-l,Math.min(A-l,T)),r=n,u=l+T),x<0?(R=Math.max(k-o,Math.min(D-o,R)),a=o+R,p=d):x>0&&(R=Math.max(k-d,Math.min(D-d,R)),a=o,p=d+R);break;case Ik:w&&(r=Math.max(E,Math.min(A,n-T*w)),u=Math.max(E,Math.min(A,l+T*w))),x&&(a=Math.max(k,Math.min(D,o-R*x)),p=Math.max(k,Math.min(D,d+R*x)))}u0&&(n=r-T),x<0?d=p-R:x>0&&(o=a-R),b=Lk,P.attr("cursor",Uk.selection),U());break;default:return}Rk()}function j(){switch(YC.keyCode){case 16:F&&(g=m=F=!1,U());break;case 18:b===Ik&&(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk,U());break;case 32:b===Lk&&(YC.altKey?(w&&(l=u-T*w,n=r+T*w),x&&(d=p-R*x,o=a+R*x),b=Ik):(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk),P.attr("cursor",Uk[y]),U());break;default:return}Rk()}}function p(){h(this,arguments).moved()}function f(){h(this,arguments).ended()}function g(){var e=this.__brush||{selection:null};return e.extent=Ok(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n){e.selection?e.on("start.brush",function(){h(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){h(this,arguments).end()}).tween("brush",function(){var e=this,i=e.__brush,r=h(e,arguments),s=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=dE(s,o);function l(t){i.selection=1===t&&null===o?null:a(t),c.call(e),r.brush()}return null!==s&&null!==o?l:l(1)}):e.each(function(){var e=this,i=arguments,r=e.__brush,s=t.input("function"==typeof n?n.apply(e,i):n,r.extent),o=h(e,i).beforestart();HE(e),r.selection=null===s?null:s,c.call(e),o.start().brush().end()})},l.clear=function(t){l.move(t,null)},u.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){!function(t,e,n,i){var r=YC;t.sourceEvent=YC,YC=t;try{e.apply(n,i)}finally{YC=r}}(new Dk(l,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Ak(Ok(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ak(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Ak(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(s=!!t,l):s},l.on=function(){var t=o.on.apply(o,arguments);return t===o?l:t},l}(Nk).extent([[0,0],[e,t]]).on("brush end",()=>{const t=(YC.selection||this.xScale.range()).map(this.xScale.invert);this.onDomainChange.emit(t),this.cd.markForCheck()}),cS(this.element).select(".brush").call(this.brush)}updateBrush(){this.brush&&(this.brush.extent([[0,0],[this.view[0],this.height]]),cS(this.element).select(".brush").call(this.brush),cS(this.element).select(".selection").attr("fill",void 0).attr("stroke",void 0).attr("fill-opacity",void 0),this.cd.markForCheck())}getDims(){return{width:this.view[0],height:this.height}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-timeline",""]],inputs:{height:"height",view:"view",state:"state",results:"results",scheme:"scheme",customColors:"customColors",legend:"legend",miniChart:"miniChart",autoScale:"autoScale",scaleType:"scaleType"},outputs:{select:"select",onDomainChange:"onDomainChange"},features:[le],attrs:dF,ngContentSelectors:RR,decls:7,vars:4,consts:[[1,"timeline"],["in","SourceGraphic","type","matrix","values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"],[1,"embedded-chart"],["x","0","y","0",1,"brush-background"],[1,"brush"]],template:function(t,e){1&t&&(Go(),ln(),Mo(0,"g",0),Mo(1,"filter"),$o(2,"feColorMatrix",1),Io(),Mo(3,"g",2),qo(4),Io(),$o(5,"rect",3),$o(6,"g",4),Io()),2&t&&(ko("transform",e.transform),Qr(1),ko("id",e.filterId),Qr(4),ko("width",e.view[0])("height",e.height))},styles:[".timeline .brush-background{fill:rgba(0,0,0,.05)}.timeline .brush .selection{fill:rgba(0,0,0,.1);stroke:#888;stroke-width:1px}.timeline .brush .handle{fill-opacity:0}.timeline .embedded-chart{opacity:.6}"],encapsulation:2,changeDetection:0}),t})(),dL=(()=>{class t{constructor(t){this.cd=t,this.horizontal=!1,this.labelClick=new Wl,this.labelActivate=new Wl,this.labelDeactivate=new Wl,this.legendEntries=[]}ngOnChanges(t){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){const t=[];for(const e of this.data){const n=ZF(e);-1===t.findIndex(t=>t.label===n)&&t.push({label:e,formattedLabel:n,color:this.colors.getColor(e)})}return t}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.label===e.name)}activate(t){this.labelActivate.emit(t)}deactivate(t){this.labelDeactivate.emit(t)}trackBy(t,e){return e.label}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend"]],inputs:{horizontal:"horizontal",data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},features:[le],decls:5,vars:9,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"label","formattedLabel","color","isActive","select","activate","deactivate"]],template:function(t,e){1&t&&(Mo(0,"div"),Do(1,pF,3,1,"header",0),Mo(2,"div",1),Mo(3,"ul",2),Do(4,fF,2,4,"li",3),Io(),Io(),Io()),2&t&&(ia("width",e.width,"px"),Qr(1),Fo("ngIf",(null==e.title?null:e.title.length)>0),Qr(2),ia("max-height",e.height-45,"px"),ra("horizontal-legend",e.horizontal),Qr(1),Fo("ngForOf",e.legendEntries)("ngForTrackBy",e.trackBy))},directives:function(){return[Bh,Ph,pL]},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{font-size:14px;font-weight:700;margin-bottom:5px;margin-left:10px;overflow:hidden;white-space:nowrap}.chart-legend li,.chart-legend ul{list-style:none;margin:0;padding:0}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{background:rgba(0,0,0,.05);border-radius:3px;float:left;line-height:85%;list-style:none;overflow-x:hidden;overflow-y:auto;text-align:left;white-space:nowrap;width:100%}.chart-legend .legend-label{color:#afb7c8;cursor:pointer;font-size:90%;margin:8px}.chart-legend .legend-label:hover{color:#000;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{border-radius:3px;color:#5b646b;display:inline-block;height:15px;margin-right:5px;width:15px}.chart-legend .legend-label-text{font-size:12px;line-height:15px;vertical-align:top;width:calc(100% - 20px)}.chart-legend .legend-label-text,.chart-legend .legend-title-text{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-legend .legend-title-text{line-height:16px;vertical-align:bottom}"],encapsulation:2,changeDetection:0}),t})(),pL=(()=>{class t{constructor(){this.isActive=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.toggle=new Wl}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(t,e){1&t&&Vo("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{isActive:"isActive",color:"color",label:"label",formattedLabel:"formattedLabel"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},decls:4,vars:6,consts:[["tabindex","-1",3,"title","click"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(t,e){1&t&&(Mo(0,"span",0),Vo("click",function(){return e.select.emit(e.formattedLabel)}),Mo(1,"span",1),Vo("click",function(){return e.toggle.emit(e.formattedLabel)}),Io(),Mo(2,"span",2),va(3),Io(),Io()),2&t&&(ra("active",e.isActive),Fo("title",e.formattedLabel),Qr(1),ia("background-color",e.color),Qr(2),ba(" ",e.trimmedLabel," "))},encapsulation:2,changeDetection:0}),t})(),fL=(()=>{class t{constructor(t){this.sanitizer=t,this.horizontal=!1}ngOnChanges(t){const e=this.gradientString(this.colors.range(),this.colors.domain());this.gradient=this.sanitizer.bypassSecurityTrustStyle(`linear-gradient(to ${this.horizontal?"right":"bottom"}, ${e})`)}gradientString(t,e){e.push(1);const n=[];return t.reverse().forEach((t,i)=>{n.push(`${t} ${Math.round(100*e[i])}%`)}),n.join(", ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(_u))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-scale-legend"]],inputs:{horizontal:"horizontal",valueRange:"valueRange",colors:"colors",height:"height",width:"width"},features:[le],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"span"),va(3),Io(),Io(),$o(4,"div",2),Mo(5,"div",1),Mo(6,"span"),va(7),Io(),Io(),Io()),2&t&&(ia("height",e.horizontal?void 0:e.height,"px")("width",e.width,"px"),ra("horizontal-legend",e.horizontal),Qr(3),ya(e.valueRange[1].toLocaleString()),Qr(1),ia("background",e.gradient),Qr(3),ya(e.valueRange[0].toLocaleString()))},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{display:flex;flex-direction:column;text-align:center}.chart-legend .scale-legend-wrap{border-radius:5px;display:inline-block;flex:1;margin:0 auto;width:30px}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{height:30px;margin:0 16px;width:auto}"],encapsulation:2,changeDetection:0}),t})(),gL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,qF,QF],qh,qF,QF]}),t})(),mL=[{name:"vivid",selectable:!0,group:"Ordinal",domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:"Ordinal",domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:"Ordinal",domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:"Ordinal",domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:"Continuous",domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:"Continuous",domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:"Continuous",domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:"Ordinal",domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:"Ordinal",domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:"Ordinal",domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:"Ordinal",domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:"Ordinal",domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:"Ordinal",domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:"Ordinal",domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:"Ordinal",domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}];class vL{constructor(t,e,n,i){"string"==typeof t&&(t=mL.find(e=>e.name===t)),this.colorDomain=t.domain,this.scaleType=e,this.domain=n,this.customColors=i,this.scale=this.generateColorScheme(t,e,this.domain)}generateColorScheme(t,e,n){let i;if("string"==typeof t&&(t=mL.find(e=>e.name===t)),"quantile"===e)i=XT().range(t.domain).domain(n);else if("ordinal"===e)i=zT().range(t.domain).domain(n);else if("linear"===e){const e=[...t.domain];1===e.length&&(e.push(e[0]),this.colorDomain=e);const n=HT(0,1,1/e.length);i=VT().domain(n).range(e)}return i}getColor(t){if(null==t)throw new Error("Value can not be null");if("linear"===this.scaleType){const e=VT().domain(this.domain).range([0,1]);return this.scale(e(t))}{if("function"==typeof this.customColors)return this.customColors(t);const e=t.toString();let n;return this.customColors&&this.customColors.length>0&&(n=this.customColors.find(t=>t.name.toLowerCase()===e.toLowerCase())),n?n.value:this.scale(t)}}getLinearGradientStops(t,e){void 0===e&&(e=this.domain[0]);const n=VT().domain(this.domain).range([0,1]),i=WT().domain(this.colorDomain).range([0,1]),r=this.getColor(t),s=n(e),o=this.getColor(e),a=n(t);let l=1,c=s;const h=[];for(h.push({color:o,offset:s,originalOffset:s,opacity:1});c=(a-i.bandwidth()).toFixed(4))break;h.push({color:t,offset:e,opacity:1}),c=e,l++}}if(h[h.length-1].offset<100&&h.push({color:r,offset:a,opacity:1}),a===s)h[0].offset=0,h[1].offset=100;else if(100!==h[h.length-1].offset)for(const u of h)u.offset=(u.offset-s)/(a-s)*100;return h}}let yL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),bL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),wL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),xL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),_L=(()=>{class t{constructor(t){this.element=t,this.fill="none",this.animations=!0,this.select=new Wl,this.initialized=!1}ngOnChanges(t){this.initialized?this.updatePathEl():(this.initialized=!0,this.initialPath=this.path)}updatePathEl(){const t=cS(this.element.nativeElement).select(".line");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line",""]],inputs:{fill:"fill",animations:"animations",path:"path",stroke:"stroke",data:"data"},outputs:{select:"select"},features:[le],attrs:yF,decls:1,vars:4,consts:[["stroke-width","1.5px",1,"line"]],template:function(t,e){1&t&&(ln(),$o(0,"path",0)),2&t&&(Fo("@animationState","active"),ko("d",e.initialPath)("fill",e.fill)("stroke",e.stroke))},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({strokeDasharray:2e3,strokeDashoffset:2e3}),Ru(1e3,Lu({strokeDashoffset:0}))])])]},changeDetection:0}),t})(),CL=(()=>{class t extends BF{constructor(){super(...arguments),this.legendTitle="Legend",this.legendPosition="right",this.showGridLines=!0,this.curve=JT,this.activeEntries=[],this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.roundDomains=!1,this.tooltipDisabled=!1,this.showRefLines=!1,this.showRefLabels=!0,this.activate=new Wl,this.deactivate=new Wl,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.timelineHeight=50,this.timelinePadding=10}update(){super.update(),this.dims=function({width:t,height:e,margins:n,showXAxis:i=!1,showYAxis:r=!1,xAxisHeight:s=0,yAxisWidth:o=0,showXLabel:a=!1,showYLabel:l=!1,showLegend:c=!1,legendType:h="ordinal",legendPosition:u="right",columns:d=12}){let p=n[3],f=t,g=e-n[0]-n[2];if(c&&"right"===u&&(d-="ordinal"===h?2:1),f=f*d/12,f=f-n[1]-n[3],i&&(g-=5,g-=s,a)&&(g-=30),r&&(f-=5,f-=o,p+=o,p+=10,l)){const t=30;f-=t,p+=t}return f=Math.max(0,f),g=Math.max(0,g),{width:Math.floor(f),height:Math.floor(g),xOffset:Math.floor(p)}}({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.timeline&&(this.dims.height-=this.timelineHeight+this.margin[2]+this.timelinePadding),this.xDomain=this.getXDomain(),this.filteredDomain&&(this.xDomain=this.filteredDomain),this.yDomain=this.getYDomain(),this.seriesDomain=this.getSeriesDomain(),this.xScale=this.getXScale(this.xDomain,this.dims.width),this.yScale=this.getYScale(this.yDomain,this.dims.height),this.updateTimeline(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]})`,this.clipPathId="clip"+nL().toString(),this.clipPath=`url(#${this.clipPathId})`}updateTimeline(){this.timeline&&(this.timelineWidth=this.dims.width,this.timelineXDomain=this.getXDomain(),this.timelineXScale=this.getXScale(this.timelineXDomain,this.timelineWidth),this.timelineYScale=this.getYScale(this.yDomain,this.timelineHeight),this.timelineTransform=`translate(${this.dims.xOffset}, ${-this.margin[2]})`)}getXDomain(){let t=function(t){const e=new Set;for(const n of t)for(const t of n.series)e.add(t.name);return Array.from(e)}(this.results);this.scaleType=function(t,e=!0){return e&&t.every(t=>t instanceof Date)?"time":t.every(t=>"number"==typeof t)?"linear":"ordinal"}(t);let e,n,i=[];return"linear"===this.scaleType&&(t=t.map(t=>Number(t))),"time"!==this.scaleType&&"linear"!==this.scaleType||(e=this.xScaleMin?this.xScaleMin:Math.min(...t),n=this.xScaleMax?this.xScaleMax:Math.max(...t)),"time"===this.scaleType?(i=[new Date(e),new Date(n)],this.xSet=[...t].sort((t,e)=>{const n=t.getTime(),i=e.getTime();return n>i?1:i>n?-1:0})):"linear"===this.scaleType?(i=[e,n],this.xSet=[...t].sort((t,e)=>t-e)):(i=t,this.xSet=t),i}getYDomain(){const t=[];for(const n of this.results)for(const e of n.series)t.indexOf(e.value)<0&&t.push(e.value),void 0!==e.min&&(this.hasRange=!0,t.indexOf(e.min)<0&&t.push(e.min)),void 0!==e.max&&(this.hasRange=!0,t.indexOf(e.max)<0&&t.push(e.max));const e=[...t];return this.autoScale||e.push(0),[this.yScaleMin?this.yScaleMin:Math.min(...e),this.yScaleMax?this.yScaleMax:Math.max(...e)]}getSeriesDomain(){return this.results.map(t=>t.name)}getXScale(t,e){let n;return"time"===this.scaleType?n=ET().range([0,e]).domain(t):"linear"===this.scaleType?(n=VT().range([0,e]).domain(t),this.roundDomains&&(n=n.nice())):"ordinal"===this.scaleType&&(n=qT().range([0,e]).padding(.1).domain(t)),n}getYScale(t,e){const n=VT().range([e,0]).domain(t);return this.roundDomains?n.nice():n}updateDomain(t){this.filteredDomain=t,this.xDomain=this.filteredDomain,this.xScale=this.getXScale(this.xDomain,this.dims.width)}updateHoveredVertical(t){this.hoveredVertical=t.value,this.deactivateAll()}hideCircles(){this.hoveredVertical=null,this.deactivateAll()}onClick(t){this.select.emit(t)}trackBy(t,e){return e.name}setColors(){let t;t="ordinal"===this.schemeType?this.seriesDomain:this.yDomain,this.colors=new vL(this.scheme,this.schemeType,t,this.customColors)}getLegendOptions(){const t={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return"ordinal"===t.scaleType?(t.domain=this.seriesDomain,t.colors=this.colors,t.title=this.legendTitle):(t.domain=this.yDomain,t.colors=this.colors.scale),t}updateYAxisWidth({width:t}){this.yAxisWidth=t,this.update()}updateXAxisHeight({height:t}){this.xAxisHeight=t,this.update()}onActivate(t){this.deactivateAll(),this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value)>-1||(this.activeEntries=[t],this.activate.emit({value:t,entries:this.activeEntries}))}onDeactivate(t){const e=this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value);this.activeEntries.splice(e,1),this.activeEntries=[...this.activeEntries],this.deactivate.emit({value:t,entries:this.activeEntries})}deactivateAll(){this.activeEntries=[...this.activeEntries];for(const t of this.activeEntries)this.deactivate.emit({value:t,entries:[]});this.activeEntries=[]}}return t.\u0275fac=function(e){return SL(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-line-chart"]],contentQueries:function(t,e,n){if(1&t&&(ac(n,gF,!0),ac(n,mF,!0)),2&t){let t;ic(t=lc())&&(e.tooltipTemplate=t.first),ic(t=lc())&&(e.seriesTooltipTemplate=t.first)}},hostBindings:function(t,e){1&t&&Vo("mouseleave",function(){return e.hideCircles()})},inputs:{legendTitle:"legendTitle",legendPosition:"legendPosition",showGridLines:"showGridLines",curve:"curve",activeEntries:"activeEntries",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",roundDomains:"roundDomains",tooltipDisabled:"tooltipDisabled",showRefLines:"showRefLines",showRefLabels:"showRefLabels",legend:"legend",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",autoScale:"autoScale",timeline:"timeline",gradient:"gradient",schemeType:"schemeType",rangeFillOpacity:"rangeFillOpacity",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",referenceLines:"referenceLines",xScaleMin:"xScaleMin",xScaleMax:"xScaleMax",yScaleMin:"yScaleMin",yScaleMax:"yScaleMax"},outputs:{activate:"activate",deactivate:"deactivate"},features:[po],decls:11,vars:20,consts:[[3,"view","showLegend","legendOptions","activeEntries","animations","legendLabelClick","legendLabelActivate","legendLabelDeactivate"],[1,"line-chart","chart"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"mouseleave",4,"ngIf"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange",4,"ngIf"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","activeEntries","scaleType","curve","rangeFillOpacity","hasRange","animations"],[3,"mouseleave"],["ngx-charts-tooltip-area","",3,"dims","xSet","xScale","yScale","results","colors","tooltipDisabled","tooltipTemplate","hover"],[4,"ngFor","ngForOf"],["ngx-charts-circle-series","",3,"xScale","yScale","colors","data","scaleType","visibleValue","activeEntries","tooltipDisabled","tooltipTemplate","select","activate","deactivate"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","scaleType","curve","hasRange","animations"]],template:function(t,e){1&t&&(Mo(0,"ngx-charts-chart",0),Vo("legendLabelClick",function(t){return e.onClick(t)})("legendLabelActivate",function(t){return e.onActivate(t)})("legendLabelDeactivate",function(t){return e.onDeactivate(t)}),ln(),Mo(1,"defs"),Mo(2,"clipPath"),$o(3,"rect"),Io(),Io(),Mo(4,"g",1),Do(5,bF,1,10,"g",2),Do(6,wF,1,12,"g",3),Mo(7,"g"),Do(8,xF,2,11,"g",4),Do(9,CF,3,9,"g",5),Io(),Io(),Do(10,EF,2,13,"g",6),Io()),2&t&&(Fo("view",Hl(17,vF,e.width,e.height))("showLegend",e.legend)("legendOptions",e.legendOptions)("activeEntries",e.activeEntries)("animations",e.animations),Qr(2),ko("id",e.clipPathId),Qr(1),ko("width",e.dims.width+10)("height",e.dims.height+10)("transform","translate(-5, -5)"),Qr(1),ko("transform",e.transform),Qr(1),Fo("ngIf",e.xAxis),Qr(1),Fo("ngIf",e.yAxis),Qr(1),ko("clip-path",e.clipPath),Qr(1),Fo("ngForOf",e.results)("ngForTrackBy",e.trackBy),Qr(1),Fo("ngIf",!e.tooltipDisabled),Qr(1),Fo("ngIf",e.timeline&&"ordinal"!=e.scaleType))},directives:function(){return[PF,Bh,Ph,zF,GF,EL,hL,rL,uL]},styles:[".ngx-charts{float:left;overflow:visible}.ngx-charts .arc,.ngx-charts .bar,.ngx-charts .circle{cursor:pointer}.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .card.active,.ngx-charts .card:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .arc:focus,.ngx-charts .bar:focus,.ngx-charts .card:focus,.ngx-charts .cell:focus{outline:none}.ngx-charts .arc.hidden,.ngx-charts .bar.hidden,.ngx-charts .card.hidden,.ngx-charts .cell.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .area-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .line-series.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .polar-series-path.inactive{opacity:.2;transition:opacity .1s ease-in-out}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:400}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{fill:none;stroke:#ddd;stroke-width:1}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-dasharray:5;stroke-dashoffset:5;stroke-width:1}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill:#000;fill-opacity:.05}.ngx-charts .gridline-path-dotted{fill:none;stroke:#ddd;stroke-dasharray:1,20;stroke-dashoffset:3;stroke-width:1}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:rgba(0,0,0,.05)}"],encapsulation:2,data:{animation:[Tu("animationState",[Mu(":leave",[Lu({opacity:1}),Ru(500,Lu({opacity:0}))])])]},changeDetection:0}),t})();const SL=Gn(CL);let EL=(()=>{class t{constructor(){this.animations=!0}ngOnChanges(t){this.update()}update(){this.updateGradients();const t=this.sortData(this.data.series),e=this.getLineGenerator();this.path=e(t)||"";const n=this.getAreaGenerator();if(this.areaPath=n(t)||"",this.hasRange){const e=this.getRangeGenerator();this.outerPath=e(t)||""}if(this.hasGradient){this.stroke=this.gradientUrl;const t=this.data.series.map(t=>t.value),e=Math.max(...t);e===Math.min(...t)&&(this.stroke=this.colors.getColor(e))}else this.stroke=this.colors.getColor(this.data.name)}getLineGenerator(){return lR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y(t=>this.yScale(t.value)).curve(this.curve)}getRangeGenerator(){return cR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y0(t=>this.yScale("number"==typeof t.min?t.min:t.value)).y1(t=>this.yScale("number"==typeof t.max?t.max:t.value)).curve(this.curve)}getAreaGenerator(){return cR().x(t=>this.xScale(t.name)).y0(()=>this.yScale.range()[0]).y1(t=>this.yScale(t.value)).curve(this.curve)}sortData(t){return"linear"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>"asc"===n?t[e]-i[e]:i[e]-t[e])}(t,"name"):"time"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>{const r=t[e].getTime(),s=i[e].getTime();return"asc"===n?r>s?1:s>r?-1:0:r>s?-1:s>r?1:0})}(t,"name"):function(t,e,n="asc",i){return t.sort((t,r)=>{const s=r[e],o=i.indexOf(t[e]),a=i.indexOf(s);return"asc"===n?o-a:a-o})}(t,"name","asc",this.xScale.domain())}updateGradients(){if("linear"===this.colors.scaleType){this.hasGradient=!0,this.gradientId="grad"+nL().toString(),this.gradientUrl=`url(#${this.gradientId})`;const t=this.data.series.map(t=>t.value),e=Math.max(...t),n=Math.min(...t);this.gradientStops=this.colors.getLinearGradientStops(e,n),this.areaGradientStops=this.colors.getLinearGradientStops(e)}else this.hasGradient=!1,this.gradientStops=void 0,this.areaGradientStops=void 0}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}isInactive(t){return!(!this.activeEntries||0===this.activeEntries.length)&&void 0===this.activeEntries.find(e=>t.name===e.name)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line-series",""]],inputs:{animations:"animations",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",curve:"curve",activeEntries:"activeEntries",rangeFillOpacity:"rangeFillOpacity",hasRange:"hasRange"},features:[le],attrs:kF,decls:6,vars:22,consts:[["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops",4,"ngIf"],["ngx-charts-area","",1,"line-highlight",3,"data","path","fill","opacity","startOpacity","gradient","stops","animations"],["ngx-charts-line","",1,"line-series",3,"data","path","stroke","animations"],["ngx-charts-area","","class","line-series-range",3,"data","path","fill","active","inactive","opacity","animations",4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["ngx-charts-area","",1,"line-series-range",3,"data","path","fill","opacity","animations"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Mo(1,"defs"),Do(2,AF,1,2,"g",0),Io(),$o(3,"g",1),$o(4,"g",2),Do(5,DF,1,9,"g",3),Io()),2&t&&(Qr(2),Fo("ngIf",e.hasGradient),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.areaPath)("fill",e.hasGradient?e.gradientUrl:e.colors.getColor(e.data.name))("opacity",.25)("startOpacity",0)("gradient",!0)("stops",e.areaGradientStops)("animations",e.animations),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.path)("stroke",e.stroke)("animations",e.animations),Qr(1),Fo("ngIf",e.hasRange))},directives:[Bh,aL,_L,oL],encapsulation:2,changeDetection:0}),t})(),kL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})();Math;let AL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),DL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,kL]]}),t})(),TL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),RL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),FL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,bL]]}),t})(),LL=(()=>{class t{constructor(){"undefined"!=typeof SVGElement&&void 0===SVGElement.prototype.contains&&(SVGElement.prototype.contains=HTMLDivElement.prototype.contains)}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[gL,yL,bL,wL,xL,kL,DL,TL,AL,RL,FL]}),t})();function ML(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function IL(t,e){1&t&&$o(0,"img",31)}function $L(t,e){1&t&&$o(0,"img",32)}function OL(t,e){1&t&&$o(0,"img",33)}function PL(t,e){1&t&&$o(0,"img",34)}function NL(t,e){if(1&t&&(Mo(0,"tr",24),Mo(1,"td"),Oo(2,25),Do(3,IL,1,0,"img",26),Do(4,$L,1,0,"img",27),Do(5,OL,1,0,"img",28),Do(6,PL,1,0,"img",29),Po(),Mo(7,"span"),va(8),Io(),Io(),Mo(9,"td"),va(10),Mo(11,"span",30),va(12),Io(),Io(),Mo(13,"td"),va(14),Mo(15,"span",30),va(16),Io(),Io(),Mo(17,"td"),va(18),Mo(19,"span",30),va(20),Io(),Io(),Mo(21,"td"),va(22),Mo(23,"span",30),va(24),Io(),Io(),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(2),Fo("ngSwitch",t.health),Qr(1),Fo("ngSwitchCase",0),Qr(1),Fo("ngSwitchCase",1),Qr(1),Fo("ngSwitchCase",2),Qr(1),Fo("ngSwitchCase",3),Qr(2),ya(t.name),Qr(2),ba("",t.session_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxSessionCount()-t.session_count," delta)"),Qr(2),ba("",t.presence_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxPresenceCount()-t.presence_count," delta)"),Qr(2),ba("",t.match_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxMatchCount()-t.match_count," delta)"),Qr(2),ba("",t.goroutine_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxGoroutineCount()-t.goroutine_count," delta)")}}function BL(t,e){if(1&t&&(Mo(0,"tbody"),Do(1,NL,25,18,"tr",22),Mo(2,"tr",3),$o(3,"td",23),Mo(4,"th",3),va(5),Io(),Mo(6,"th",3),va(7),Io(),Mo(8,"th",3),va(9),Io(),Mo(10,"th",3),va(11),Io(),Io(),Io()),2&t){const t=zo();Qr(1),Fo("ngForOf",t.statusData.nodes),Qr(4),ya(t.getTotalSessionCount()),Qr(2),ya(t.getMaxPresenceCount()),Qr(2),ya(t.getTotalMatchCount()),Qr(2),ya(t.getTotalGorountineCount())}}function UL(t,e){if(1&t&&(Mo(0,"option",35),va(1),Io()),2&t){const t=e.$implicit,n=zo();Ko("value",t),Qr(1),ya(n.ranges[t])}}const VL=function(t){return{"background-color":t}};function HL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function jL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,HL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function zL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",37),Do(2,jL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.latencyGraphData)}}function WL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function GL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,WL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function qL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",43),Do(2,GL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.rateGraphData)}}function KL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function XL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,KL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function YL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",44),Do(2,XL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.inputGraphData)}}function JL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function QL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,JL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function ZL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",45),Do(2,QL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.outputGraphData)}}let tM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.showDelta=!1,this.rateGraphData=[],this.latencyGraphData=[],this.inputGraphData=[],this.outputGraphData=[],this.ranges={1:"last 1 minute",10:"last 10 minutes",30:"last 30 minutes",60:"last 1 hour",1440:"last 24 hours"},this.rangesKeys=Object.keys(this.ranges).map(t=>+t),this.colorScheme={domain:["#5AA454","#E44D25","#1e59cf","#7aa3e5","#a8385d","#d0bd00"]},this.samples=60}ngOnInit(){this.rangeForm=this.formBuilder.group({rangeMinutes:[10]}),this.route.data.subscribe(t=>{this.initData(t[0]),this.refresh(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}refresh(){this.consoleService.getStatus("").subscribe(t=>{this.statusData=t,this.rateGraphData=this.updateData(this.rateGraphData,"avg_rate_sec",t),this.latencyGraphData=this.updateData(this.latencyGraphData,"avg_latency_ms",t),this.inputGraphData=this.updateData(this.inputGraphData,"avg_input_kbs",t),this.outputGraphData=this.updateData(this.outputGraphData,"avg_output_kbs",t)})}generateSeries(){let t=new Date;t.setMilliseconds(0);const e=[];for(let n=0;n({name:t,value:0}))}initData(t){const e=this.generateSeries();this.latencyGraphData=t.map(t=>({name:t,series:e})),this.rateGraphData=t.map(t=>({name:t,series:e})),this.inputGraphData=t.map(t=>({name:t,series:e})),this.outputGraphData=t.map(t=>({name:t,series:e}))}updateData(t,e,n){var i;const r=n.nodes,s=[],o=n.timestamp,a=t.map(t=>t.name),l=r.map(t=>t.name),c=this.diff(a,l);for(const h of t)c.includes(h.name)&&s.push({name:h.name,series:this.shiftData(h.series,0,o)});for(const h of r){let n=[],r={};const a=null===(i=t.find(t=>t.name===h.name))||void 0===i?void 0:i.series;n=this.shiftData(a||this.generateSeries(),h[e],o),r={name:h.name,series:n},s.push(r)}return s}shiftData(t,e,n){const i=t.slice(1);return i.push({name:new Date(n),value:e}),i}getPeriod(){return Math.floor(60*this.f.rangeMinutes.value/this.samples)}setRange(t){this.rangeForm.reset({rangeMinutes:+t.target.value}),this.reset()}reset(){this.consoleService.getStatus("").subscribe(t=>{var e;this.initData(t.nodes.map(t=>t.name)),null===(e=this.$refreshTimer)||void 0===e||e.unsubscribe(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}diff(t,e){const n=new Set(t);for(const i of e)n.delete(i);return Array.from(n)}get f(){return this.rangeForm.controls}ngOnDestroy(){this.$refreshTimer.unsubscribe()}getTotalSessionCount(){return this.statusData.nodes.reduce((t,e)=>t+e.session_count,0)}getMaxSessionCount(){return Math.max(...this.statusData.nodes.map(t=>t.session_count))}getMaxPresenceCount(){return Math.max(...this.statusData.nodes.map(t=>t.presence_count))}getMaxMatchCount(){return Math.max(...this.statusData.nodes.map(t=>t.match_count))}getTotalMatchCount(){return this.statusData.nodes.reduce((t,e)=>t+e.match_count,0)}getMaxGoroutineCount(){return Math.max(...this.statusData.nodes.map(t=>t.goroutine_count))}getTotalGorountineCount(){return this.statusData.nodes.reduce((t,e)=>t+e.goroutine_count,0)}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-status"]],decls:62,vars:10,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"status-table","table","table-sm","table-striped","mb-4",3,"mouseover","mouseout"],[1,"thead-light"],["scope","col"],[4,"ngIf"],[3,"formGroup"],[1,"row","no-gutters","justify-content-end"],[1,"col-12","text-right"],["ngbDropdown","","role","group",1,"btn-group"],["formControlName","rangeMinutes",1,"custom-select","custom-select-sm","ml-3",3,"change"],[3,"value",4,"ngFor","ngForOf"],[1,"row"],[1,"col-6","d-inline-flex","justify-content-between","align-items-center"],[1,"graph-title"],[1,"d-inline"],[1,"col-6"],["class","graph",4,"ngIf"],[1,"row","mt-4"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","clickable",4,"ngFor","ngForOf"],[1,"border-0"],[1,"clickable"],[3,"ngSwitch"],["class","mr-2","src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",4,"ngSwitchCase"],["class","mr-2","src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",4,"ngSwitchCase"],["class","mr-2","src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",4,"ngSwitchCase"],["class","mr-2","src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",4,"ngSwitchCase"],[1,"text-muted","small",3,"hidden"],["src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",1,"mr-2"],["src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",1,"mr-2"],["src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",1,"mr-2"],["src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",1,"mr-2"],[3,"value"],[1,"graph"],["xAxisLabel","Time","yAxisLabel","Latency (ms)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["seriesTooltipTemplate",""],[1,"chart-legend"],[4,"ngFor","ngForOf"],[1,"legend-label-color",3,"ngStyle"],[1,"legend-label-text"],["xAxisLabel","Time","yAxisLabel","Request Count",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Input (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Output (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Status"),Io(),Do(2,ML,4,2,"ngb-alert",1),Mo(3,"table",2),Vo("mouseover",function(){return e.showDelta=!0})("mouseout",function(){return e.showDelta=!1}),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Node name"),Io(),Mo(8,"th",4),va(9,"Sessions"),Io(),Mo(10,"th",4),va(11,"Presences"),Io(),Mo(12,"th",4),va(13,"Authoritative Matches"),Io(),Mo(14,"th",4),va(15,"Goroutines"),Io(),Io(),Io(),Do(16,BL,12,5,"tbody",5),Io(),Mo(17,"form",6),Mo(18,"div",7),Mo(19,"div",8),Mo(20,"span"),va(21,"View:"),Io(),Mo(22,"div",9),Mo(23,"select",10),Vo("change",function(t){return e.setRange(t)}),Do(24,UL,2,2,"option",11),function(t,e){const n=Me();let i;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new ie("302",`The pipe '${t}' could not be found!`)}("sortNumbers",n.pipeRegistry),n.data[45]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(45,i.onDestroy)):i=n.data[45];const r=i.factory||(i.factory=ne(i.type)),s=bt(Ro);try{const t=An(!1),e=r();An(t),function(t,e,n,i){45>=t.data.length&&(t.data[45]=null,t.blueprint[45]=null),e[45]=i}(n,Le(),0,e)}finally{bt(s)}}(),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",12),Mo(27,"div",13),Mo(28,"div",14),Mo(29,"h5",15),va(30,"Processing Latency"),Io(),Mo(31,"small"),va(32," (ms)"),Io(),Io(),Io(),Mo(33,"div",13),Mo(34,"div",14),Mo(35,"h5",15),va(36,"Rate"),Io(),Mo(37,"small"),va(38," (rpc/s)"),Io(),Io(),Io(),Io(),Mo(39,"div",12),Mo(40,"div",16),Do(41,zL,4,12,"div",17),Io(),Mo(42,"div",16),Do(43,qL,4,12,"div",17),Io(),Io(),Mo(44,"div",18),Mo(45,"div",13),Mo(46,"div",14),Mo(47,"h5",15),va(48,"Input"),Io(),Mo(49,"small"),va(50," (kb/s)"),Io(),Io(),Io(),Mo(51,"div",13),Mo(52,"div",14),Mo(53,"h5",15),va(54,"Output"),Io(),Mo(55,"small"),va(56," (kb/s)"),Io(),Io(),Io(),Io(),Mo(57,"div",12),Mo(58,"div",16),Do(59,YL,4,12,"div",17),Io(),Mo(60,"div",16),Do(61,ZL,4,12,"div",17),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(14),Fo("ngIf",e.statusData),Qr(1),Fo("formGroup",e.rangeForm),Qr(7),Fo("ngForOf",function(t,e,n){const i=t+Kt,r=Le(),s=_e(r,i);return function(t,e){return wo.isWrapped(e)&&(e=wo.unwrap(e),t[je()]=Jr),e}(r,function(t,e){return t[1].data[e].pure}(r,i)?zl(r,He(),e,s.transform,n,s):s.transform(n))}(25,8,e.rangesKeys)),Qr(17),Fo("ngIf",e.latencyGraphData.length>0),Qr(2),Fo("ngIf",e.rateGraphData.length>0),Qr(16),Fo("ngIf",e.inputGraphData.length>0),Qr(2),Fo("ngIf",e.outputGraphData.length>0))},directives:function(){return[Bh,pb,Ry,mb,Kx,Uy,Ty,yb,Ph,_x,jh,zh,T_,Vy,Wy,CL,Wh]},pipes:function(){return[nM]},styles:[".graph[_ngcontent-%COMP%]{height:450px;border-radius:5px;border:1px solid #dadae9}.graph-title[_ngcontent-%COMP%]{padding:.5rem .5rem .5rem 0}.table[_ngcontent-%COMP%]{table-layout:fixed}h4[_ngcontent-%COMP%]{margin-bottom:0}.status-table[_ngcontent-%COMP%]{empty-cells:hide}.status-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:500}.status-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border:1px solid #dadae9;padding:.6em 1em}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%]{border:2px solid #dadae9;background-color:#f5f5f5}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:2px solid #dadae9}"]}),t})(),eM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),nM=(()=>{class t{transform(t){return t.sort((t,e)=>t-e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe={type:(e={name:"sortNumbers",type:t,pure:!1}).type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null},t;var e})();var iM=n("ZR4k"),rM=n("Iab2");const sM=["fileSelector"];function oM(t,e){if(1&t&&(Mo(0,"div",8),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.dropZoneLabel)}}function aM(t,e){if(1&t){const t=No();Mo(0,"div"),Mo(1,"input",9),Vo("click",function(e){return Ie(t),zo(2).openFileSelector(e)}),Io(),Io()}if(2&t){const t=zo(2);Qr(1),Ko("value",t.browseBtnLabel),Fo("className",t.browseBtnClassName)}}function lM(t,e){if(1&t&&(Do(0,oM,2,1,"div",6),Do(1,aM,2,2,"div",7)),2&t){const t=zo();Fo("ngIf",t.dropZoneLabel),Qr(1),Fo("ngIf",t.showBrowseBtn)}}function cM(t,e){}const hM=function(t){return{openFileSelector:t}};class uM{constructor(t,e){this.relativePath=t,this.fileEntry=e}}let dM=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-file-drop-content-tmp",""]]}),t})(),pM=(()=>{class t{constructor(t,e){this.zone=t,this.renderer=e,this.accept="*",this.directory=!1,this.multiple=!0,this.dropZoneLabel="",this.dropZoneClassName="ngx-file-drop__drop-zone",this.useDragEnter=!1,this.contentClassName="ngx-file-drop__content",this.showBrowseBtn=!1,this.browseBtnClassName="btn btn-primary btn-xs ngx-file-drop__browse-btn",this.browseBtnLabel="Browse files",this.onFileDrop=new Wl,this.onFileOver=new Wl,this.onFileLeave=new Wl,this.isDraggingOverDropZone=!1,this.globalDraggingInProgress=!1,this.files=[],this.numOfActiveReadEntries=0,this.helperFormEl=null,this.fileInputPlaceholderEl=null,this.dropEventTimerSubscription=null,this._disabled=!1,this.openFileSelector=t=>{this.fileSelector&&this.fileSelector.nativeElement&&this.fileSelector.nativeElement.click()},this.globalDragStartListener=this.renderer.listen("document","dragstart",t=>{this.globalDraggingInProgress=!0}),this.globalDragEndListener=this.renderer.listen("document","dragend",t=>{this.globalDraggingInProgress=!1})}get disabled(){return this._disabled}set disabled(t){this._disabled=null!=t&&""+t!="false"}ngOnDestroy(){this.dropEventTimerSubscription&&(this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=null),this.globalDragStartListener(),this.globalDragEndListener(),this.files=[],this.helperFormEl=null,this.fileInputPlaceholderEl=null}onDragOver(t){this.useDragEnter?this.preventAndStop(t):this.isDropzoneDisabled()||this.useDragEnter||(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragEnter(t){!this.isDropzoneDisabled()&&this.useDragEnter&&(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragLeave(t){this.isDropzoneDisabled()||(this.isDraggingOverDropZone&&(this.isDraggingOverDropZone=!1,this.onFileLeave.emit(t)),this.preventAndStop(t))}dropFiles(t){if(!this.isDropzoneDisabled()&&(this.isDraggingOverDropZone=!1,t.dataTransfer)){let e;t.dataTransfer.dropEffect="copy",e=t.dataTransfer.items?t.dataTransfer.items:t.dataTransfer.files,this.preventAndStop(t),this.checkFiles(e)}}uploadFiles(t){!this.isDropzoneDisabled()&&t.target&&(this.checkFiles(t.target.files||[]),this.resetFileInput())}checkFiles(t){for(let e=0;e{t(n)}},e=new uM(t.name,t);this.addToQueue(e)}}this.dropEventTimerSubscription&&this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=Bw(200,200).subscribe(()=>{if(this.files.length>0&&0===this.numOfActiveReadEntries){const t=this.files;this.files=[],this.onFileDrop.emit(t)}})}traverseFileTree(t,e){if(t.isFile){const n=new uM(e,t);this.files.push(n)}else{e+="/";const n=t.createReader();let i=[];const r=()=>{this.numOfActiveReadEntries++,n.readEntries(n=>{if(n.length)i=i.concat(n),r();else if(0===i.length){const n=new uM(e,t);this.zone.run(()=>{this.addToQueue(n)})}else for(let t=0;t{this.traverseFileTree(i[t],e+i[t].name)});this.numOfActiveReadEntries--})};r()}}resetFileInput(){if(this.fileSelector&&this.fileSelector.nativeElement){const t=this.fileSelector.nativeElement,e=t.parentElement,n=this.getHelperFormElement(),i=this.getFileInputPlaceholderElement();e!==n&&(this.renderer.insertBefore(e,i,t),this.renderer.appendChild(n,t),n.reset(),this.renderer.insertBefore(e,t,i),this.renderer.removeChild(e,i))}}getHelperFormElement(){return this.helperFormEl||(this.helperFormEl=this.renderer.createElement("form")),this.helperFormEl}getFileInputPlaceholderElement(){return this.fileInputPlaceholderEl||(this.fileInputPlaceholderEl=this.renderer.createElement("div")),this.fileInputPlaceholderEl}canGetAsEntry(t){return!!t.webkitGetAsEntry}isDropzoneDisabled(){return this.globalDraggingInProgress||this.disabled}addToQueue(t){this.files.push(t)}preventAndStop(t){t.stopPropagation(),t.preventDefault()}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ic),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-file-drop"]],contentQueries:function(t,e,n){if(1&t&&ac(n,dM,!0,yl),2&t){let t;ic(t=lc())&&(e.contentTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&rc(sM,!0),2&t){let t;ic(t=lc())&&(e.fileSelector=t.first)}},inputs:{accept:"accept",directory:"directory",multiple:"multiple",dropZoneLabel:"dropZoneLabel",dropZoneClassName:"dropZoneClassName",useDragEnter:"useDragEnter",contentClassName:"contentClassName",showBrowseBtn:"showBrowseBtn",browseBtnClassName:"browseBtnClassName",browseBtnLabel:"browseBtnLabel",disabled:"disabled"},outputs:{onFileDrop:"onFileDrop",onFileOver:"onFileOver",onFileLeave:"onFileLeave"},decls:7,vars:15,consts:[[3,"className","drop","dragover","dragenter","dragleave"],[3,"className"],["type","file",1,"ngx-file-drop__file-input",3,"accept","multiple","change"],["fileSelector",""],["defaultContentTemplate",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","ngx-file-drop__drop-zone-label",4,"ngIf"],[4,"ngIf"],[1,"ngx-file-drop__drop-zone-label"],["type","button",3,"className","value","click"]],template:function(t,e){if(1&t&&(Mo(0,"div",0),Vo("drop",function(t){return e.dropFiles(t)})("dragover",function(t){return e.onDragOver(t)})("dragenter",function(t){return e.onDragEnter(t)})("dragleave",function(t){return e.onDragLeave(t)}),Mo(1,"div",1),Mo(2,"input",2,3),Vo("change",function(t){return e.uploadFiles(t)}),Io(),Do(4,lM,2,2,"ng-template",null,4,dc),Do(6,cM,0,0,"ng-template",5),Io(),Io()),2&t){const t=To(5);ra("ngx-file-drop__drop-zone--over",e.isDraggingOverDropZone),Fo("className",e.dropZoneClassName),Qr(1),Fo("className",e.contentClassName),Qr(1),Fo("accept",e.accept)("multiple",e.multiple),ko("directory",e.directory||void 0)("webkitdirectory",e.directory||void 0)("mozdirectory",e.directory||void 0)("msdirectory",e.directory||void 0)("odirectory",e.directory||void 0),Qr(4),Fo("ngTemplateOutlet",e.contentTemplate||t)("ngTemplateOutletContext",Vl(13,hM,e.openFileSelector))}},directives:[Gh,Bh],styles:[".ngx-file-drop__drop-zone[_ngcontent-%COMP%]{border:2px dotted #0782d0;border-radius:30px;height:100px;margin:auto}.ngx-file-drop__drop-zone--over[_ngcontent-%COMP%]{background-color:hsla(0,0%,57.6%,.5)}.ngx-file-drop__content[_ngcontent-%COMP%]{align-items:center;color:#0782d0;display:flex;height:100px;justify-content:center}.ngx-file-drop__drop-zone-label[_ngcontent-%COMP%]{text-align:center}.ngx-file-drop__file-input[_ngcontent-%COMP%]{display:none}"]}),t})(),fM=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:function(){return[pM]}}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[],imports:[[qh]]}),t})();function gM(t,e){1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3,"Failed to retrieve configuration."),Io(),Io()),2&t&&Fo("dismissible",!1)}function mM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(2).$implicit;Fo("id",t.name),Qr(1),ya(t.value)}}function vM(t,e){1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t&&Fo("id",zo(2).$implicit.name)}function yM(t,e){if(1&t&&(Mo(0,"div",35),Mo(1,"b"),va(2),Io(),Mo(3,"label",27),Mo(4,"a",28),$o(5,"img",10),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.flatConfig[t+1].name),Qr(1),Fo("for",e.flatConfig[t+1].name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",e.flatConfig[t+1].name,"",nr)}}function bM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(3).index,e=zo();Fo("id",e.flatConfig[t+1].name),Qr(1),ya(e.flatConfig[t+1].value)}}function wM(t,e){if(1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t){const t=zo(3).index;Fo("id",zo().flatConfig[t+1].name)}}function xM(t,e){if(1&t&&(Mo(0,"div",36),Do(1,bM,2,2,"span",29),Do(2,wM,2,1,"span",30),Io()),2&t){const t=zo(2).index,e=zo();Qr(1),Fo("ngIf",!e.isEmpty(e.flatConfig[t+1].value)),Qr(1),Fo("ngIf",e.isEmpty(e.flatConfig[t+1].value))}}function _M(t,e){if(1&t&&(Mo(0,"div",26),Mo(1,"div",7),Mo(2,"b"),va(3),Io(),Mo(4,"label",27),Mo(5,"a",28),$o(6,"img",10),Io(),Io(),Io(),Mo(7,"div",7),Do(8,mM,2,2,"span",29),Do(9,vM,2,1,"span",30),Io(),Do(10,yM,6,3,"div",31),Do(11,xM,3,2,"div",32),Io()),2&t){const t=zo(),e=t.index,n=t.$implicit,i=zo();ra("border-top-0",e>0),Qr(3),ya(n.name),Qr(1),Fo("for",n.name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",n.value.name,"",nr),Qr(3),Fo("ngIf",!i.isEmpty(n.value)),Qr(1),Fo("ngIf",i.isEmpty(n.value)),Qr(1),Fo("ngIf",e{class t{constructor(t,e,n,i,r,s){this.config=t,this.route=e,this.httpClient=n,this.modalService=i,this.consoleService=r,this.formBuilder=s,this.configError="",this.uploadError="",this.deleteError="",this.uploading=!1,this.uploadSuccess=!1,this.deleteSuccess=!1,this.deleting=!1,this.apiConfig=t}ngOnInit(){this.route.data.subscribe(t=>{this.nakamaVersion=t[0].server_version;const e=JSON.parse(t[0].config);this.jsonConfig=e,this.flatConfig=this.flattenConfig(e)},t=>{this.configError=t}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])]})}flattenConfig(t){const e=[];return this.traverseConfig("",t,e),e.sort((t,e)=>t.name.localeCompare(e.name))}traverseConfig(t,e,n){for(const i in e)"env"!==i&&(Array.isArray(e[i])?n.push({name:t+i,value:e[i].join(", ")}):"object"==typeof e[i]?this.traverseConfig(i+".",e[i],n):n.push({name:t+i,value:e[i]}))}isEmpty(t){return""===t||0===t}exportYaml(){const t=new Blob([Object(iM.safeDump)(this.jsonConfig)],{type:"text/yaml;charset=utf-8"});rM.saveAs(t,"config.yaml")}dropped(t){this.uploadError="",this.uploadSuccess=!1;for(const e of t)if(e.fileEntry.isFile){const t=e.fileEntry.name.split("."),n=["json","csv"];t.length>1&&n.includes(t[t.length-1].toLowerCase())?e.fileEntry.file(t=>{this.uploadFile(t)}):this.uploadError="Invalid file: must have extension .json or .csv"}}uploadFile(t){const e=new FormData;e.append(t.name,t),this.uploading=!0,this.httpClient.post(this.apiConfig.host+"/v2/console/storage/import",e,{headers:{Authorization:"Bearer "}}).subscribe(()=>{this.uploading=!1,this.uploadSuccess=!0},t=>{this.uploading=!1,this.uploadError=t})}deleteData(){this.deleteError="",this.deleting=!0,this.consoleService.deleteAllData("").pipe(sx(2e3)).subscribe(()=>{this.deleting=!1,this.deleteError="",this.deleteSuccess=!0},t=>{this.deleting=!1,this.deleteError=t})}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}get f(){return this.confirmDeleteForm.controls}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(uw),Ro(pm),Ro(qb),Ro(a_),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:43,vars:11,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"pb-4"],[1,"d-flex","justify-content-between","mb-4","align-items-baseline"],[1,"btn","btn-primary","btn-sm",3,"click"],[1,"config-table"],[4,"ngFor","ngForOf"],[1,"row","py-2","border","border-top-0","add-border-larger","mb-5"],[1,"col-lg-3"],[1,"pl-1"],["target","_blank","href","https://heroiclabs.com/docs/install-configuration/#runtime.env",1,"d-inline"],["src","/static/svg/hint.svg","alt","","width","16","height",""],[1,"col-lg-9"],[4,"ngIf"],[1,"section-divider","d-flex","mb-4"],["type","success",3,"dismissible","close",4,"ngIf"],["accept",".json,.csv","dropZoneClassName","drop-zone","contentClassName","drop-zone-content","dropZoneLabel","Drop CSV or JSON file here",3,"disabled","onFileDrop"],["ngx-file-drop-content-tmp",""],["role","alert",1,"alert","alert-danger","d-flex","justify-content-between","align-items-center"],["src","/static/svg/red-triangle.svg","alt","","width","16","height",""],[1,"pl-2"],["confirmDelete",""],["type","button",1,"btn","btn-danger",3,"disabled","click"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","row py-2 border",3,"border-top-0",4,"ngIf"],[1,"row","py-2","border"],[1,"pl-1",3,"for"],["target","_blank",1,"d-inline",3,"href"],["class","text-break-all",3,"id",4,"ngIf"],["class","text-muted",3,"id",4,"ngIf"],["class","col-md-3 left-line",4,"ngIf"],["class","col-md-3",4,"ngIf"],[1,"text-break-all",3,"id"],[1,"text-muted",3,"id"],[1,"col-md-3","left-line"],[1,"col-md-3"],["class","mb-0 text-break-all",4,"ngFor","ngForOf"],[1,"mb-0","text-break-all"],[1,"mb-0","text-muted"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"click"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],[1,"mt-2"],["autocomplete","off",3,"formGroup"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,e){if(1&t){const t=No();Do(0,gM,4,1,"ngb-alert",0),Mo(1,"h2",1),va(2,"Server Configuration"),Io(),Mo(3,"div",2),Mo(4,"h5"),Mo(5,"b"),va(6,"Server version:"),Io(),va(7),Io(),Mo(8,"button",3),Vo("click",function(){return e.exportYaml()}),va(9,"Export Configuration"),Io(),Io(),Mo(10,"div",4),Do(11,CM,2,1,"ng-container",5),Mo(12,"div",6),Mo(13,"div",7),Mo(14,"b"),va(15,"runtime.env"),Io(),Mo(16,"label",8),Mo(17,"a",9),$o(18,"img",10),Io(),Io(),Io(),Mo(19,"div",11),Do(20,EM,2,1,"div",12),Do(21,kM,3,0,"div",12),Io(),Io(),Io(),Mo(22,"h5",13),va(23,"Import storage data"),Io(),Mo(24,"p"),va(25,"Import storage objects from a CSV or JSON file by dragging and dropping it below."),Io(),Do(26,AM,6,2,"ngb-alert",0),Do(27,DM,4,1,"ngb-alert",14),Mo(28,"ngx-file-drop",15),Vo("onFileDrop",function(t){return e.dropped(t)}),Do(29,TM,2,0,"ng-template",16),Io(),Mo(30,"h5",13),va(31,"Delete all data"),Io(),Do(32,RM,6,2,"ngb-alert",0),Do(33,FM,4,1,"ngb-alert",14),Mo(34,"div",17),Mo(35,"div"),$o(36,"img",18),Mo(37,"small",19),va(38,"Warning - this operation is not reversible!"),Io(),Io(),Do(39,MM,19,5,"ng-template",null,20,dc),Mo(41,"button",21),Vo("click",function(){Ie(t);const n=To(40);return e.openDeleteDataModal(n)}),va(42,"Delete all"),Io(),Io()}2&t&&(Fo("ngIf",e.configError),Qr(7),ba(" ",e.nakamaVersion,""),Qr(4),Fo("ngForOf",e.flatConfig),Qr(9),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&e.jsonConfig.runtime.env.length>0),Qr(1),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&0===e.jsonConfig.runtime.env.length),Qr(5),Fo("ngIf",e.uploadError),Qr(1),Fo("ngIf",e.uploadSuccess),Qr(1),Fo("disabled",e.uploading),Qr(4),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(8),Fo("disabled",e.deleting))},directives:[Bh,Ph,pM,dM,_x,pb,Ry,mb,ay,Ty,yb,$h],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.text-break-all[_ngcontent-%COMP%]{word-break:break-all;word-wrap:anywhere}.config-table[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]:nth-child(2n){background-color:#fafafc}.config-table[_ngcontent-%COMP%] .left-line[_ngcontent-%COMP%]{border-left:1px solid #dadae9}"]}),t})(),$M=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getConfig("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function OM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function PM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",51),va(2,"No additional users are setup. Create a new user below."),Io(),Io()),2&t&&(Qr(1),Fo("colSpan",4))}function NM(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Mo(6,"span",36),va(7,"Administrator"),Io(),Mo(8,"span",36),va(9,"Developer"),Io(),Mo(10,"span",36),va(11,"Maintainer"),Io(),Mo(12,"span",36),va(13,"View Only"),Io(),Io(),Mo(14,"td"),Mo(15,"button",52),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().deleteUser(n.username)}),va(16,"Delete"),Io(),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.username),Qr(2),ya(t.email),Qr(2),Fo("hidden",t.role!==n.adminRole),Qr(2),Fo("hidden",t.role!==n.developerRole),Qr(2),Fo("hidden",t.role!==n.maintainerRole),Qr(2),Fo("hidden",t.role!==n.readonlyRole)}}function BM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3,"An error occurred:"),Io(),Mo(4,"p",53),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.userCreateError)}}const UM=function(t){return{"is-invalid":t}};let VM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.userCreateError="",this.users=[],this.adminRole=cw.USER_ROLE_ADMIN,this.developerRole=cw.USER_ROLE_DEVELOPER,this.maintainerRole=cw.USER_ROLE_MAINTAINER,this.readonlyRole=cw.USER_ROLE_READONLY}ngOnInit(){this.createUserForm=this.formBuilder.group({username:["",py.required],email:["",[py.required,py.email]],password:["",py.compose([py.required,py.minLength(8)])],role:[+this.readonlyRole,py.required],newsletter:[!1]}),this.route.data.subscribe(t=>{const e=t[0];this.users.length=0,this.users.push(...e.users)},t=>{this.error=t})}deleteUser(t){this.error="",this.consoleService.deleteUser("",t).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(t=>{this.error="",this.users.length=0,this.users.push(...t.users)},t=>{this.error=t})}addUser(){this.userCreateError="",this.createUserForm.disable();let t=cw.USER_ROLE_READONLY;switch(this.f.role.value){case 1:t=cw.USER_ROLE_ADMIN;break;case 2:t=cw.USER_ROLE_DEVELOPER;break;case 3:t=cw.USER_ROLE_MAINTAINER;break;case 4:t=cw.USER_ROLE_READONLY}this.consoleService.addUser("",{username:this.f.username.value,email:this.f.email.value,password:this.f.password.value,role:t,newsletter_subscription:this.f.newsletter.value}).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(e=>{this.userCreateError="",this.createUserForm.reset({role:+t}),this.createUserForm.enable(),this.users.length=0,this.users.push(...e.users)},t=>{this.userCreateError=t,this.createUserForm.enable()})}get f(){return this.createUserForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-users"]],decls:121,vars:24,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"user-details","mb-5","table","table-bordered","table-sm","table-striped"],[1,"thead-light"],[2,"width","400px"],[2,"width","300px"],[2,"width","90px"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"section-divider","d-flex","mb-4"],[1,"mb-4","alert-permissions",3,"type"],[1,"alert-title","font-weight-bold"],[1,"d-flex","flex-wrap","flex-row"],[1,"col","col-md-3","p-4","flex-fill","flex-grow-1"],[1,"d-flex","align-items-center","mb-3"],["src","/static/svg/role-admin.svg","alt","","width","30","height","",1,"mr-2"],[1,"m-0","font-weight-bold"],["src","/static/svg/role-developer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-maintainer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-viewonly.svg","alt","","width","30","height","",1,"mr-2"],[1,"add-border","rounded"],[3,"formGroup","ngSubmit"],[1,"row","no-gutters"],[1,"col","d-flex","justify-content-between","align-items-center"],[1,"col-md-3"],["for","email",1,"d-inline"],[1,"col-md-9","ml-0","p-0"],["type","email","id","email","placeholder","email@example.com","required","","formControlName","email",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control",3,"ngClass"],["for","password",1,"d-inline"],["type","password","id","password","placeholder","Password","required","","formControlName","password",1,"form-control",3,"ngClass"],[1,"d-inline"],[1,"btn-group"],["disabled","",1,"btn","btn-outline-dark","disabled"],[3,"hidden"],["ngbDropdown","","role","group",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","add-border-single-row-bottom","mb-4"],[1,"col","d-flex","align-items-center"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","newsletter","formControlName","newsletter",1,"custom-control-input","mr-2","my-2"],["for","newsletter",1,"form-check-label","custom-control-label"],[1,""],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"text-muted",3,"colSpan"],["type","button",1,"btn","btn-danger","btn-outline-dark",3,"click"],[1,"mb-0","pl-4"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Management"),Io(),Do(2,OM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Username"),Io(),Mo(8,"th"),va(9,"Email"),Io(),Mo(10,"th",5),va(11,"Role"),Io(),Mo(12,"th",6),va(13,"Action"),Io(),Io(),Io(),Mo(14,"tbody"),Do(15,PM,3,1,"tr",7),Do(16,NM,17,6,"tr",8),Io(),Io(),Mo(17,"h5",9),va(18,"Add new user"),Io(),Mo(19,"ngb-alert",10),Mo(20,"h6",11),va(21,"User roles"),Io(),Mo(22,"div",12),Mo(23,"div",13),Mo(24,"div",14),$o(25,"img",15),Mo(26,"h6",16),va(27,"Administrator"),Io(),Io(),Mo(28,"small"),va(29," Owners have complete control over the server, its users and resources. "),Io(),Io(),Mo(30,"div",13),Mo(31,"div",14),$o(32,"img",17),Mo(33,"h6",16),va(34,"Developer"),Io(),Io(),Mo(35,"small"),va(36," Like Administrators, Developers have complete control over the server, resources and data. However they cannot add, change or delete console users. "),Io(),Io(),Mo(37,"div",13),Mo(38,"div",14),$o(39,"img",18),Mo(40,"h6",16),va(41,"Maintainer"),Io(),Io(),Mo(42,"small"),va(43," Maintainers have access to adding, changing and delete client resources such as accounts, storage and leaderboard records. They don't have access to the API Explorer or the console users. "),Io(),Io(),Mo(44,"div",13),Mo(45,"div",14),$o(46,"img",19),Mo(47,"h6",16),va(48,"View Only"),Io(),Io(),Mo(49,"small"),va(50," View Only users can only view client resources but cannot make any changes to the data whatsoever. "),Io(),Io(),Io(),Io(),Do(51,BM,6,2,"ngb-alert",1),Mo(52,"div",20),Mo(53,"form",21),Vo("ngSubmit",function(){return e.addUser()}),Mo(54,"div",22),Mo(55,"div",23),Mo(56,"div",24),Mo(57,"label",25),va(58,"Email"),Io(),Io(),Mo(59,"div",26),$o(60,"input",27),Mo(61,"div",28),va(62,"Email is required"),Io(),Io(),Io(),Io(),Mo(63,"div",22),Mo(64,"div",23),Mo(65,"div",24),Mo(66,"label",29),va(67,"Username"),Io(),Io(),Mo(68,"div",26),$o(69,"input",30),Mo(70,"div",28),va(71,"Username is required"),Io(),Io(),Io(),Io(),Mo(72,"div",22),Mo(73,"div",23),Mo(74,"div",24),Mo(75,"label",31),va(76,"Password"),Io(),Io(),Mo(77,"div",26),$o(78,"input",32),Mo(79,"div",28),va(80,"Password is required, must be 8 chars or longer and consist of at least a capital letter, a small letter and a number."),Io(),Io(),Io(),Io(),Mo(81,"div",22),Mo(82,"div",23),Mo(83,"div",24),Mo(84,"label",33),va(85,"Role"),Io(),Io(),Mo(86,"div",26),Mo(87,"div",34),Mo(88,"button",35),Mo(89,"span",36),va(90,"Administrator"),Io(),Mo(91,"span",36),va(92,"Developer"),Io(),Mo(93,"span",36),va(94,"Maintainer"),Io(),Mo(95,"span",36),va(96,"View Only"),Io(),Io(),Mo(97,"div",37),$o(98,"button",38),Mo(99,"div",39),Mo(100,"button",40),Vo("click",function(){return e.f.role.setValue(+e.adminRole)}),va(101,"Administrator"),Io(),Mo(102,"button",40),Vo("click",function(){return e.f.role.setValue(+e.developerRole)}),va(103,"Developer"),Io(),Mo(104,"button",40),Vo("click",function(){return e.f.role.setValue(+e.maintainerRole)}),va(105,"Maintainer"),Io(),Mo(106,"button",40),Vo("click",function(){return e.f.role.setValue(+e.readonlyRole)}),va(107,"View Only"),Io(),Io(),Io(),Io(),Mo(108,"div",28),va(109,"Role is required"),Io(),Io(),Io(),Io(),Mo(110,"div",41),Mo(111,"div",42),$o(112,"div",24),Mo(113,"div",26),Mo(114,"div",43),$o(115,"input",44),Mo(116,"label",45),va(117,"Subscribe to Heroic Labs' newsletters to receive latest updates to Nakama and other news."),Io(),Io(),Io(),Io(),Io(),Mo(118,"div",46),Mo(119,"button",47),va(120,"Save"),Io(),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",0===e.users.length),Qr(1),Fo("ngForOf",e.users),Qr(3),Fo("type","secondary"),Qr(32),Fo("ngIf",e.userCreateError),Qr(2),Fo("formGroup",e.createUserForm),Qr(7),Fo("ngClass",Vl(18,UM,e.f.email.dirty&&e.f.email.errors)),Qr(1),Fo("hidden",e.f.email.disabled||e.f.email.valid||e.f.email.pristine),Qr(8),Fo("ngClass",Vl(20,UM,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(8),Fo("ngClass",Vl(22,UM,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(10),Fo("hidden",e.f.role.value!==+e.adminRole),Qr(2),Fo("hidden",e.f.role.value!==+e.developerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.maintainerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.readonlyRole),Qr(13),Fo("hidden",e.f.role.disabled||e.f.role.valid||e.f.role.pristine),Qr(11),Fo("disabled",e.createUserForm.invalid))},directives:[Bh,Ph,_x,pb,Ry,mb,ay,wb,Ty,yb,$h,Kx,qx,Wx,zx,ry],styles:[".user-details[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.user-details[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.user-details[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.6em 1em}.alert-permissions[_ngcontent-%COMP%]{padding:0}.alert-permissions[_ngcontent-%COMP%] .alert-title[_ngcontent-%COMP%]{padding:1rem}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%]{border-top:1px solid #dadae9;margin:0}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]{border-right:1px solid #dadae9}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]:last-child{border-right:none}"]}),t})(),HM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listUsers("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jM(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Failed to retrieve runtime information: ",t.error,"")}}function zM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function WM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Go modules were found."),Io(),$o(3,"td"),Io())}function GM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function qM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Lua modules were found."),Io(),$o(3,"td"),Io())}function KM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function XM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No JavaScript modules were found."),Io(),$o(3,"td"),Io())}const YM=function(){return["/apiexplorer"]},JM=function(t){return{endpoint:t}};function QM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function ZM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Go RPC functions were found."),Io(),Io())}function tI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function eI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Lua RPC functions were found."),Io(),Io())}function nI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function iI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No JavaScript RPC functions were found."),Io(),Io())}let rI=(()=>{class t{constructor(t,e){this.route=t,this.consoleService=e,this.error=""}ngOnInit(){this.route.data.subscribe(t=>{this.runtimeInfo=t[0]},t=>{this.error=t})}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:51,vars:13,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"runtime-table","mb-4","table","table-sm","table-bordered","mb-5"],[1,"thead-light"],[2,"width","180px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["colspan","2"],[1,"mb-4","section-divider","d-flex"],[1,"runtime-table","table","table-sm","table-bordered"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","200px"],[1,"text-muted"],[2,"width","180px","text-align","center"],[1,"btn","btn-sm","btn-secondary",3,"routerLink","queryParams"],["colspan","2",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Runtime Modules"),Io(),Do(2,jM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th"),va(7,"Go Modules"),Io(),Mo(8,"th",4),va(9,"Last Modified"),Io(),Io(),Io(),Mo(10,"tbody"),Do(11,zM,5,2,"tr",5),Do(12,WM,4,0,"tr",6),Io(),Mo(13,"thead",3),Mo(14,"tr"),Mo(15,"th",7),va(16,"Lua Modules"),Io(),Io(),Io(),Mo(17,"tbody"),Do(18,GM,5,2,"tr",5),Do(19,qM,4,0,"tr",6),Io(),Mo(20,"thead",3),Mo(21,"tr"),Mo(22,"th",7),va(23,"JavaScript Modules"),Io(),Io(),Io(),Mo(24,"tbody"),Do(25,KM,5,2,"tr",5),Do(26,XM,4,0,"tr",6),Io(),Io(),Mo(27,"h4",8),va(28,"Registered RPC Functions"),Io(),Mo(29,"table",9),Mo(30,"thead",3),Mo(31,"tr"),Mo(32,"th",7),va(33,"Go RPC Functions"),Io(),Io(),Io(),Mo(34,"tbody"),Do(35,QM,7,6,"tr",5),Do(36,ZM,3,0,"tr",6),Io(),Mo(37,"thead",3),Mo(38,"tr"),Mo(39,"th",7),va(40,"Lua RPC Functions"),Io(),Io(),Io(),Mo(41,"tbody"),Do(42,tI,7,6,"tr",5),Do(43,eI,3,0,"tr",6),Io(),Mo(44,"thead",3),Mo(45,"tr"),Mo(46,"th",7),va(47,"JavaScript RPC Functions"),Io(),Io(),Io(),Mo(48,"tbody"),Do(49,nI,7,6,"tr",5),Do(50,iI,3,0,"tr",6),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(9),Fo("ngForOf",e.runtimeInfo.go_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_modules.length),Qr(9),Fo("ngForOf",e.runtimeInfo.go_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_rpc_functions.length))},directives:[Bh,Ph,_x,Mv],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.opaque[_ngcontent-%COMP%]{opacity:1%}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.runtime-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.runtime-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.runtime-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-left:1em;padding-right:1em;vertical-align:middle}"]}),t})(),sI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getRuntime("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function oI(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by collection"),Io())}function aI(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.f.collection.value)}}function lI(t,e){if(1&t){const t=No();Mo(0,"button",34),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().f.collection.setValue(n)}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function cI(t,e){if(1&t&&(Mo(0,"ngb-alert",35),$o(1,"img",36),Mo(2,"h6",37),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying storage objects: ",t.error,"")}}function hI(t,e){1&t&&(Mo(0,"th",38),va(1,"Remove"),Io())}function uI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",39),va(2,"No storage objects found - change the filter criteria or add new objects."),Io(),Io())}function dI(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteObject(e,i,r)}),va(2,"Delete"),Io(),Io()}}function pI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(2),Io(),Mo(3,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(4),Io(),Mo(5,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(6),Io(),Mo(7,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(8),Io(),Do(9,dI,3,0,"td",41),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.collection),Qr(2),ya(t.key),Qr(2),ya(t.user_id),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let fI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.collections=[],this.objects=[],this.objectCount=0,this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({collection:[""],key:[""],user_id:[""]});const t=this.route.snapshot.queryParamMap;this.f.collection.setValue(t.get("collection")),this.f.key.setValue(t.get("key")),this.f.user_id.setValue(t.get("user_id")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.collection.value||this.f.user_id.value)&&this.search(0),this.route.data.subscribe(t=>{this.collections.length=0,this.collections.push(...t[0].collections),this.objectCount=t[1].total_count,this.nextCursor=t[1].next_cursor,this.prevCursor=t[1].prev_cursor,this.objects.length=0,this.objects.push(...t[1].objects)},t=>{this.error=t})}disableSearch(){return!(!this.f.key.value||""===this.f.key.value||this.f.collection.value&&""!==this.f.collection.value)}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listStorage("",this.f.user_id.value,this.f.key.value,this.f.collection.value,e).subscribe(t=>{this.error="",this.objectCount=t.total_count,this.nextCursor=t.next_cursor,this.objects.length=0,this.objects.push(...t.objects),this.router.navigate([],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteObject(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteStorageObject("",n.collection,n.key,n.user_id,n.version).subscribe(()=>{this.error="",this.objectCount--,this.objects.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}viewObject(t){this.router.navigate(["/storage",t.collection,t.key,t.user_id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:50,vars:15,consts:[[1,"pb-1"],[1,"pb-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius",3,"disabled"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",1,"btn","btn-secondary","text-secondary",3,"hidden","click"],[1,"dropdown-divider",3,"hidden"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","text","formControlName","key","placeholder","Filter by key",1,"form-control"],["type","text","formControlName","user_id","placeholder","Filter by user ID",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","submit",1,"btn","btn-primary",3,"disabled","click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Storage Objects"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"button",9),Do(12,oI,2,0,"span",10),Do(13,aI,2,1,"span",10),Io(),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.collection.reset()}),va(16,"\u2718 Deselect collection"),Io(),$o(17,"div",13),Do(18,lI,2,1,"button",14),Io(),Io(),Io(),$o(19,"input",15),$o(20,"input",16),Mo(21,"div",17),Mo(22,"span",18),Vo("click",function(){return e.f.user_id.setValue(e.systemUserId)}),$o(23,"img",19),Io(),Io(),Mo(24,"div",17),Mo(25,"button",20),Vo("click",function(){return e.search(0)}),va(26,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(27,"div",21),Mo(28,"div",22),Mo(29,"button",23),Vo("click",function(){return e.search(0)}),$o(30,"img",24),Io(),Mo(31,"button",23),Vo("click",function(){return e.search(1)}),$o(32,"img",25),Io(),Io(),Io(),Io(),Io(),Do(33,cI,4,2,"ngb-alert",26),Mo(34,"div",27),Mo(35,"table",28),Mo(36,"thead",29),Mo(37,"tr"),Mo(38,"th"),va(39,"Collection Name"),Io(),Mo(40,"th"),va(41,"Key Name"),Io(),Mo(42,"th",30),va(43,"User ID"),Io(),Mo(44,"th",31),va(45,"Last Update"),Io(),Do(46,hI,2,0,"th",32),Io(),Io(),Mo(47,"tbody"),Do(48,uI,3,0,"tr",10),Do(49,pI,10,5,"tr",33),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.objectCount," objects found."),Qr(4),Fo("formGroup",e.searchForm),Qr(4),Fo("disabled",0===e.collections.length),Qr(1),Fo("ngIf",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngIf",e.f.collection.value&&""!==e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngForOf",e.collections),Qr(7),Fo("disabled",e.disableSearch()),Qr(4),Fo("disabled",0===e.objects.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.objects.length),Qr(1),Fo("ngForOf",e.objects))},directives:[pb,Ry,mb,Kx,qx,Bh,Wx,zx,Ph,ay,Ty,yb,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),gI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listStorageCollections("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("collection"),i=t.queryParamMap.get("key"),r=t.queryParamMap.get("user_id");return this.consoleService.listStorage("",r,i,n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var vI=n("bU/s");const yI=["editor"];function bI(t,e){if(1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",39),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while modifying storage object: ",t.error,"")}}function wI(t,e){1&t&&(Mo(0,"ngb-alert",40),$o(1,"img",41),Mo(2,"h6",39),va(3,"Storage object was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function xI(t,e){1&t&&(Mo(0,"span"),va(1,"Save as a copy"),Io())}function _I(t,e){1&t&&va(0,"Save")}function CI(t,e){if(1&t&&(Mo(0,"button",42),Do(1,xI,2,0,"span",43),Do(2,_I,1,0,"ng-template",null,44,dc),Io()),2&t){const t=To(3),e=zo();Fo("disabled",e.updating),Qr(1),Fo("ngIf",e.object.collection!==e.f.collection.value||e.object.key!==e.f.keyname.value||e.object.user_id!==e.f.user_id.value)("ngIfElse",t)}}const SI=function(){return["/storage"]},EI=function(t){return{collection:t}},kI=function(t,e){return{collection:t,key:e}},AI=function(t,e,n){return{collection:t,key:e,user_id:n}},DI=function(t){return{"is-invalid":t}};let TI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.objectForm=this.formBuilder.group({collection:["",py.required],keyname:["",py.required],user_id:["",py.required],permission_read:[0,py.required],permission_write:[0,py.required]}),this.route.data.subscribe(t=>{this.object=t[0],this.f.collection.setValue(this.object.collection),this.f.keyname.setValue(this.object.key),this.f.user_id.setValue(this.object.user_id),this.f.permission_read.setValue(this.object.permission_read),this.f.permission_write.setValue(this.object.permission_write),this.updateAllowed()||this.objectForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.object.value),null,2);this.aceEditor.session.setValue(t)}updateObject(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(n){return this.error=n,void(this.updating=!1)}let e=this.object.version;this.object.collection===this.f.collection.value&&this.object.key===this.f.keyname.value&&this.object.user_id===this.f.user_id.value||(e=""),this.consoleService.writeStorageObject("",this.f.collection.value,this.f.keyname.value,this.f.user_id.value,{version:e,value:t,permission_read:this.f.permission_read.value,permission_write:this.f.permission_write.value}).subscribe(t=>{this.updated=!0,this.updating=!1,this.object.version=t.version,""===e&&(this.object.collection=this.f.collection.value,this.object.key=this.f.keyname.value,this.object.user_id=this.f.user_id.value,this.object.permission_read=this.f.permission_read.value,this.object.permission_write=this.f.permission_write.value)},t=>{this.error=t,this.updating=!1})}deleteObject(){this.error="",this.updated=!1,this.updating=!1;const t=this.object;this.consoleService.deleteStorageObject("",t.collection,t.key,t.user_id,t.version).subscribe(()=>{this.router.navigate(["/storage"],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value}})},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.objectForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(yI,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:88,vars:50,consts:[[1,"pb-1"],[1,"storage-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink","queryParams"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","collection",1,"d-inline"],["type","text","id","collection","placeholder","Collection","required","","formControlName","collection",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","key",1,"d-inline"],["type","text","id","key","placeholder","Key","required","","formControlName","keyname",1,"form-control","form-control-sm","my-2",3,"ngClass"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","required","","formControlName","user_id",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","permission_read",1,"d-inline"],["ngbRadioGroup","","id","permission_read","name","permission_read","formControlName","permission_read",1,"btn-group","btn-group-toggle"],["ngbButtonLabel","",1,"btn-outline-secondary"],["ngbButton","","type","radio",3,"disabled","value"],["for","version",1,"d-inline"],["type","text","id","version","placeholder","Version","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","permission_write",1,"d-inline"],["ngbRadioGroup","","id","permission_write","name","permission_write","formControlName","permission_write",1,"btn-group","btn-group-toggle"],[1,"row","add-border-single-row-bottom","mb-3"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mt-3","mb-3",2,"height","500px"],[2,"height","500px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"],[4,"ngIf","ngIfElse"],["elseBlock",""]],template:function(t,e){var n,i,r,s,o,a;1&t&&(Mo(0,"h2",0),va(1,"Storage Object"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),va(6,"Storage"),Io(),Mo(7,"li",4),Mo(8,"a",5),va(9),Io(),Io(),Mo(10,"li",4),Mo(11,"a",5),va(12),Io(),Io(),Mo(13,"li",4),Mo(14,"a",5),va(15),Io(),Io(),Io(),Io(),Io(),Do(16,bI,4,2,"ngb-alert",6),Do(17,wI,4,1,"ngb-alert",7),Mo(18,"form",8),Vo("ngSubmit",function(){return e.updateObject()}),Mo(19,"div",9),Mo(20,"div",10),Mo(21,"div",11),Mo(22,"label",12),va(23,"Collection"),Io(),Io(),$o(24,"input",13),Mo(25,"div",14),va(26,"Collection is required"),Io(),Io(),Mo(27,"div",10),Mo(28,"div",11),Mo(29,"label",15),va(30,"Key"),Io(),Io(),$o(31,"input",16),Mo(32,"div",14),va(33,"Key is required"),Io(),Io(),Io(),Mo(34,"div",9),Mo(35,"div",10),Mo(36,"div",11),Mo(37,"label",17),va(38,"User ID"),Io(),Io(),$o(39,"input",18),Mo(40,"div",14),va(41,"User ID is required"),Io(),Io(),Mo(42,"div",19),Mo(43,"div",11),Mo(44,"label",20),va(45,"Read Permission"),Io(),Io(),Mo(46,"div",21),Mo(47,"label",22),$o(48,"input",23),va(49," No Read "),Io(),Mo(50,"label",22),$o(51,"input",23),va(52," Owner Read "),Io(),Mo(53,"label",22),$o(54,"input",23),va(55," Public Read "),Io(),Io(),Io(),Io(),Mo(56,"div",9),Mo(57,"div",10),Mo(58,"div",11),Mo(59,"label",24),va(60,"Version"),Io(),Io(),$o(61,"input",25),Io(),Mo(62,"div",19),Mo(63,"div",11),Mo(64,"label",26),va(65,"Write Permission"),Io(),Io(),Mo(66,"div",27),Mo(67,"label",22),$o(68,"input",23),va(69," No Write "),Io(),Mo(70,"label",22),$o(71,"input",23),va(72," Owner Write "),Io(),Io(),Io(),Io(),Mo(73,"div",28),Mo(74,"div",10),Mo(75,"div",11),Mo(76,"label",29),va(77,"Create Time"),Io(),Io(),$o(78,"input",30),Io(),Mo(79,"div",10),Mo(80,"div",11),Mo(81,"label",31),va(82,"Update Time"),Io(),Io(),$o(83,"input",32),Io(),Io(),Mo(84,"div",33),$o(85,"div",34,35),Io(),Do(87,CI,4,3,"button",36),Io()),2&t&&(Qr(8),Fo("routerLink",Ul(32,SI))("queryParams",Vl(33,EI,e.object.collection)),Qr(1),ya(e.object.collection),Qr(2),Fo("routerLink",Ul(35,SI))("queryParams",Hl(36,kI,e.object.collection,e.object.key)),Qr(1),ya(e.object.key),Qr(2),Fo("routerLink",Ul(39,SI))("queryParams",(n=40,i=AI,r=e.object.collection,s=e.object.key,o=e.object.user_id,function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Eo(t,e,n,i);return So(t,e+2,r)||s}(t,l,r,s,o)?Co(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):jl(t,l+3)}(Le(),He(),n,i,r,s,o,a))),Qr(1),ya(e.object.user_id),Qr(1),Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.objectForm),Qr(6),Fo("ngClass",Vl(44,DI,e.f.collection.dirty&&e.f.collection.errors)),Qr(1),Fo("hidden",e.f.collection.disabled||e.f.collection.valid||e.f.collection.pristine),Qr(6),Fo("ngClass",Vl(46,DI,e.f.keyname.dirty&&e.f.keyname.errors)),Qr(1),Fo("hidden",e.f.keyname.disabled||e.f.keyname.valid||e.f.keyname.pristine),Qr(7),Fo("ngClass",Vl(48,DI,e.f.user_id.dirty&&e.f.user_id.errors)),Qr(1),Fo("hidden",e.f.user_id.disabled||e.f.user_id.valid||e.f.user_id.pristine),Qr(8),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(3),Fo("disabled",!e.updateAllowed())("value",2),Qr(7),Fo("value",e.object.version),Qr(7),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(7),Fo("value",e.object.create_time),Qr(5),Fo("value",e.object.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Mv,Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,kx,Sx,Ax,_x],styles:[".storage-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})(),RI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("collection"),i=t.paramMap.get("key"),r=t.paramMap.get("user_id");return this.consoleService.getStorage("",n,i,r)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FI(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function LI(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function MI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function II(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function $I(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function OI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function PI(t,e){if(1&t){const t=No();Mo(0,"td",18),Mo(1,"button",19),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLeaderboard(e,i,r)}),va(2,"Delete"),Io(),Io()}}function NI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(2),Io(),Mo(3,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(4),Io(),Mo(5,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(6),Io(),Mo(7,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(8),Io(),Do(9,MI,2,0,"td",15),Do(10,II,2,0,"td",15),Do(11,$I,2,0,"td",15),Do(12,OI,2,0,"td",15),Do(13,PI,3,0,"td",16),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(n.orderString[t.sort_order]),Qr(2),ya(n.operatorString[t.operator]),Qr(2),ya(""===t.reset_schedule?"-":t.reset_schedule),Qr(1),Fo("ngIf",t.authoritative),Qr(1),Fo("ngIf",!t.authoritative),Qr(1),Fo("ngIf",t.tournament),Qr(1),Fo("ngIf",!t.tournament),Qr(1),Fo("ngIf",n.deleteAllowed())}}function BI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",20),va(2,"No leaderboards were found."),Io(),Io())}let UI=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.authService=n,this.consoleService=i,this.error="",this.leaderboards=[],this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"}}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboards.length=0,this.leaderboards.push(...t[0].leaderboards)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}deleteLeaderboard(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboard("",n.id).subscribe(()=>{this.error="",this.leaderboards.splice(e,1)},t=>{this.error=t})}viewLeaderboardEntries(t){this.router.navigate(["/leaderboards",t.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(mw),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:5,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","130px"],[2,"width","100px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[3,"click"],["class","text-center",3,"click",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"text-center",3,"click"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboards"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FI,4,2,"ngb-alert",2),Mo(5,"table",3),Mo(6,"thead",4),Mo(7,"tr"),Mo(8,"th"),va(9,"Leaderboard ID"),Io(),Mo(10,"th",5),va(11,"Sort Order"),Io(),Mo(12,"th",5),va(13,"Operator"),Io(),Mo(14,"th",5),va(15,"Reset Schedule"),Io(),Mo(16,"th",6),va(17,"Authoritative"),Io(),Mo(18,"th",6),va(19,"Tournament"),Io(),Do(20,LI,2,0,"th",7),Io(),Io(),Mo(21,"tbody"),Do(22,NI,14,9,"tr",8),Do(23,BI,3,0,"tr",9),Io(),Io()),2&t&&(Qr(3),ba("",e.leaderboards.length," leaderboards found."),Qr(1),Fo("ngIf",e.error),Qr(16),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngForOf",e.leaderboards),Qr(1),Fo("ngIf",0===e.leaderboards.length))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),VI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listLeaderboards("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function HI(t,e){if(1&t&&(Mo(0,"ngb-alert",31),$o(1,"img",32),Mo(2,"h6",33),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying accounts: ",t.error,"")}}function jI(t,e){1&t&&(Mo(0,"th",34),va(1,"Remove"),Io())}function zI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",35),va(2,"No users found - change the filter criteria or add new user accounts."),Io(),Io())}function WI(t,e){1&t&&$o(0,"td")}function GI(t,e){if(1&t){const t=No();Mo(0,"td",38),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteAccount(e,i,r)}),va(2,"Delete"),Io(),Io()}}function qI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(8),Io(),Do(9,WI,1,0,"td",29),Do(10,GI,3,0,"td",37),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.username),Qr(2),ya(t.display_name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let KI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.accountsCount=0,this.accounts=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""],filter_type:[0]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.f.filter_type.setValue(+t.get("filter_type")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.filter.value||this.f.filter_type.value)&&this.search(0),this.route.data.subscribe(t=>{this.accounts.length=0,t&&(this.accounts.push(...t[0].users),this.accountsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listAccounts("",this.f.filter.value,this.f.filter_type.value&&1===this.f.filter_type.value,e).subscribe(t=>{this.error="",this.accounts.length=0,this.accounts.push(...t.users),this.accountsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,filter_type:this.f.filter_type.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteAccount(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteAccount("",n.id,!1).subscribe(()=>{this.error="",this.accounts.splice(e,1),this.accountsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewAccount(t){this.router.navigate(["/accounts",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:45,vars:9,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by user ID, social provider ID, device ID, or username (use '%' for prefix or suffix wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],["ngbDropdown","","role","group","aria-label","Button group with nested dropdown",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split",3,"disabled"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Accounts"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"span",9),Vo("click",function(){return e.f.filter.setValue(e.systemUserId)}),$o(12,"img",10),Io(),Io(),Mo(13,"div",8),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.filter_type.setValue(0),e.search(0)}),va(16,"Search"),Io(),Mo(17,"div",13),$o(18,"button",14),Mo(19,"div",15),Mo(20,"button",16),Vo("click",function(){return e.f.filter_type.setValue(1),e.search(0)}),va(21,"Tombstones"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(22,"div",17),Mo(23,"div",18),Mo(24,"button",19),Vo("click",function(){return e.search(0)}),$o(25,"img",20),Io(),Mo(26,"button",19),Vo("click",function(){return e.search(1)}),$o(27,"img",21),Io(),Io(),Io(),Io(),Io(),Do(28,HI,4,2,"ngb-alert",22),Mo(29,"div",23),Mo(30,"table",24),Mo(31,"thead",25),Mo(32,"tr"),Mo(33,"th",26),va(34,"User ID"),Io(),Mo(35,"th"),va(36,"Username"),Io(),Mo(37,"th"),va(38,"Display Name"),Io(),Mo(39,"th",27),va(40,"Last Update"),Io(),Do(41,jI,2,0,"th",28),Io(),Io(),Mo(42,"tbody"),Do(43,zI,3,0,"tr",29),Do(44,qI,11,6,"tr",30),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.accountsCount," accounts found."),Qr(4),Fo("formGroup",e.searchForm),Qr(11),Fo("disabled",!e.f.filter.value||""===e.f.filter.value),Qr(6),Fo("disabled",0===e.accounts.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.accounts.length),Qr(1),Fo("ngForOf",e.accounts))},directives:[pb,Ry,mb,ay,Ty,yb,Kx,qx,Wx,zx,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),XI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter"),i=t.queryParamMap.get("tombstones");return this.consoleService.listAccounts("",n,"true"===i,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function YI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().exportAccount(e)}),$o(1,"img",16),va(2,"Export"),Io()}}function JI(t,e){1&t&&(Mo(0,"span"),va(1,"Unban"),Io())}function QI(t,e){1&t&&(Mo(0,"span"),va(1,"Ban"),Io())}function ZI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().banUnbanAccount(e)}),$o(1,"img",17),Do(2,JI,2,0,"span",18),Do(3,QI,2,0,"span",18),Io()}if(2&t){const t=zo();Qr(2),Fo("ngIf",t.account.disable_time),Qr(1),Fo("ngIf",!t.account.disable_time)}}function t$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!1)}),$o(1,"img",20),va(2,"Delete"),Io()}}function e$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!0)}),$o(1,"img",21),va(2,"Recorded delete"),Io()}}function n$(t,e){if(1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const i$=function(t,e){return["/accounts",t,e]};function r$(t,e){if(1&t&&(Mo(0,"div"),Oo(1,25),Mo(2,"a",26),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,i$,n.account.user.id,t.path)),Qr(1),ya(t.label)}}const s$=function(){return["/accounts"]},o$=function(){return["/storage"]},a$=function(t){return{user_id:t}};let l$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Profile",path:"profile"},{label:"Authentication",path:"authentication"},{label:"Friends",path:"friends"},{label:"Groups",path:"groups"},{label:"Wallet",path:"wallet"},{label:"Purchases",path:"purchases"},{label:"Subscriptions",path:"subscriptions"}]}ngOnInit(){this.route.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAccount(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteAccount("",this.account.user.id,e).subscribe(()=>{this.error="",this.router.navigate(["/accounts"])},t=>{this.error=t})}banUnbanAccount(t){t.target.disabled=!0,this.error="",this.account.disable_time?this.consoleService.unbanAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=null,t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1}):this.consoleService.banAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=Date.now().toString(),t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1})}exportAccount(t){t.target.disabled=!0,this.error="",this.consoleService.exportAccount("",this.account.user.id).subscribe(e=>{this.error="";const n=this.account.user.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:14,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["ngbNavItem","storage"],["ngbNavLink","",3,"routerLink","queryParams"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["src","/static/svg/ban.svg","alt","","width","13","height","13",1,"mr-2"],[4,"ngIf"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["src","/static/svg/bin-recorded.svg","alt","","width","15","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Account"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Account"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,YI,3,0,"button",7),Do(12,ZI,4,2,"button",7),Do(13,t$,3,0,"button",8),Do(14,e$,3,0,"button",8),Io(),Io(),Do(15,n$,4,2,"ngb-alert",9),Mo(16,"nav",10,11),Do(18,r$,4,6,"div",12),Mo(19,"div"),Oo(20,13),Mo(21,"a",14),va(22," Storage "),Io(),Po(),Io(),Io(),$o(23,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(10,s$)),Qr(3),ya(e.account.user.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.banAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views),Qr(3),Fo("routerLink",Ul(11,o$))("queryParams",Vl(12,a$,e.account.user.id)))},directives:[Mv,Bh,f_,Ph,p_,g_,Ov,_x,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),c$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getAccount("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const h$=["editor"];function u$(t,e){if(1&t&&(Mo(0,"ngb-alert",29),$o(1,"img",30),Mo(2,"h6",31),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function d$(t,e){1&t&&(Mo(0,"ngb-alert",32),$o(1,"img",33),Mo(2,"h6",31),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function p$(t,e){1&t&&(Mo(0,"button",34),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const f$=function(t){return{"is-invalid":t}};let g$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({username:["",py.required],display_name:[""],avatar_url:[""],location:[""],timezone:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.username.setValue(this.account.user.username),this.f.display_name.setValue(this.account.user.display_name),this.f.avatar_url.setValue(this.account.user.avatar_url),this.f.location.setValue(this.account.user.location),this.f.timezone.setValue(this.account.user.timezone),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.user.metadata),null,2);this.aceEditor.session.setValue(t)}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{username:this.f.username.value,display_name:this.f.display_name.value,avatar_url:this.f.avatar_url.value,location:this.f.location.value,timezone:this.f.timezone.value,metadata:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(h$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:53,vars:11,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","display_name",1,"d-inline"],["type","text","id","display_name","placeholder","Display Name","formControlName","display_name",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","location",1,"d-inline"],["type","text","id","location","placeholder","Location","formControlName","location",1,"form-control","form-control-sm","my-2"],["for","timezone",1,"d-inline"],["type","text","id","timezone","placeholder","Timezone","formControlName","timezone",1,"form-control","form-control-sm","my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,u$,4,2,"ngb-alert",0),Do(1,d$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"User ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Username"),Io(),Io(),$o(13,"input",9),Mo(14,"div",10),va(15,"Username is required"),Io(),Io(),Io(),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",11),va(20,"Display Name"),Io(),Io(),$o(21,"input",12),Io(),Mo(22,"div",13),Mo(23,"div",5),Mo(24,"label",14),va(25,"Avatar URL"),Io(),Io(),$o(26,"input",15),Io(),Io(),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"div",5),Mo(30,"label",16),va(31,"Location"),Io(),Io(),$o(32,"input",17),Io(),Mo(33,"div",13),Mo(34,"div",5),Mo(35,"label",18),va(36,"Timezone"),Io(),Io(),$o(37,"input",19),Io(),Io(),Mo(38,"div",20),Mo(39,"div",4),Mo(40,"div",5),Mo(41,"label",21),va(42,"Create Time"),Io(),Io(),$o(43,"input",22),Io(),Mo(44,"div",4),Mo(45,"div",5),Mo(46,"label",23),va(47,"Update Time"),Io(),Io(),$o(48,"input",24),Io(),Io(),Mo(49,"div",25),$o(50,"div",26,27),Io(),Do(52,p$,2,1,"button",28),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(6),Fo("value",e.account.user.id),Qr(5),Fo("ngClass",Vl(9,f$,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(29),Fo("value",e.account.user.create_time),Qr(5),Fo("value",e.account.user.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,_x],styles:[""]}),t})();function m$(t,e){if(1&t&&(Mo(0,"ngb-alert",36),$o(1,"img",37),Mo(2,"h6",38),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function v$(t,e){1&t&&(Mo(0,"ngb-alert",39),$o(1,"img",40),Mo(2,"h6",38),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function y$(t,e){if(1&t&&(Mo(0,"option",41),va(1),Io()),2&t){const t=e.$implicit,n=e.index;Ko("value",n),Fo("selected",0===n),Qr(1),ya(t.id)}}function b$(t,e){1&t&&(Mo(0,"button",42),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}let w$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({email:[""],password:[""],selected_device_id_index:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.email.setValue(this.account.email),this.f.password.setValue(""),this.f.selected_device_id_index.setValue(0),0===this.account.devices.length&&this.f.selected_device_id_index.disable(),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t={email:this.f.email.value};this.f.password.dirty&&(t.password=this.f.password.value),this.consoleService.updateAccount("",this.account.user.id,t).subscribe(t=>{this.updated=!0,this.updating=!1,this.f.password.reset()},t=>{this.error=t,this.updating=!1})}unlinkDeviceId(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkDevice("",this.account.user.id,{device_id:this.account.devices[this.f.selected_device_id_index.value].id}).subscribe(()=>{this.error="",this.account.devices.splice(this.f.selected_device_id_index.value,1),this.f.selected_device_id_index.setValue(0)},t=>{this.error=t})}unlinkCustomID(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkCustom("",this.account.user.id).subscribe(()=>{this.error="",this.account.custom_id=null},t=>{this.error=t})}unlinkFacebook(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebook("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_id=null},t=>{this.error=t})}unlinkFacebookInstantGames(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebookInstantGame("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_instant_game_id=null},t=>{this.error=t})}unlinkApple(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkApple("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.apple_id=null},t=>{this.error=t})}unlinkGameCenter(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGameCenter("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.gamecenter_id=null},t=>{this.error=t})}unlinkGoogle(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGoogle("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.google_id=null},t=>{this.error=t})}unlinkSteam(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkSteam("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.steam_id=null},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}copyDeviceIdToClipboard(t){const e=document.createElement("textarea");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.opacity="0",e.value=this.account.devices[t].id,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:102,vars:21,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","selected_device_id_index",1,"d-inline"],[1,"input-group"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["src","/static/svg/copy.svg","alt","","width","16","height","",1,""],["id","selected_device_id_index","formControlName","selected_device_id_index",1,"form-control","custom-select","custom-select-sm"],[3,"value","selected",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","button",1,"btn","btn-sm","btn-outline-danger",3,"disabled","click"],["for","custom_id",1,"d-inline"],["type","text","id","custom_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","facebook_id",1,"d-inline"],["type","text","id","facebook_id","disabled","",1,"form-control","form-control-sm",3,"value"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","facebook_instant_game_id",1,"d-inline"],["type","text","id","facebook_instant_game_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","apple_id",1,"d-inline"],["type","text","id","apple_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","gamecenter_id",1,"d-inline"],["type","text","id","gamecenter_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","google_id",1,"d-inline"],["type","text","id","google_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","steam_id",1,"d-inline"],["type","text","id","steam_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","email",1,"d-inline"],["type","text","id","email","placeholder","Email","formControlName","email",1,"form-control","form-control-sm"],["for","password",1,"d-inline"],["type","text","id","password","placeholder","Password","formControlName","password",1,"form-control","form-control-sm"],[1,"row","remove-sides"],[1,"small"],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[3,"value","selected"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,m$,4,2,"ngb-alert",0),Do(1,v$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Device IDs"),Io(),Io(),Mo(8,"div",7),Mo(9,"button",8),Vo("click",function(){return e.copyDeviceIdToClipboard(e.f.selected_device_id_index.value)}),$o(10,"img",9),va(11," Copy "),Io(),Mo(12,"select",10),Do(13,y$,2,3,"option",11),Io(),Mo(14,"div",12),Mo(15,"button",13),Vo("click",function(t){return e.unlinkDeviceId(t)}),va(16,"Unlink"),Io(),Io(),Io(),Io(),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",14),va(20,"Custom ID"),Io(),Io(),Mo(21,"div",7),$o(22,"input",15),Mo(23,"div",12),Mo(24,"button",13),Vo("click",function(t){return e.unlinkCustomID(t)}),va(25,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",3),Mo(27,"div",4),Mo(28,"div",5),Mo(29,"label",16),va(30,"Facebook ID"),Io(),Io(),Mo(31,"div",7),$o(32,"input",17),Mo(33,"div",12),Mo(34,"button",13),Vo("click",function(t){return e.unlinkFacebook(t)}),va(35,"Unlink"),Io(),Io(),Io(),Io(),Mo(36,"div",18),Mo(37,"div",5),Mo(38,"label",19),va(39,"FB Instant Game ID"),Io(),Io(),Mo(40,"div",7),$o(41,"input",20),Mo(42,"div",12),Mo(43,"button",13),Vo("click",function(t){return e.unlinkFacebookInstantGames(t)}),va(44,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(45,"div",3),Mo(46,"div",4),Mo(47,"div",5),Mo(48,"label",21),va(49,"Apple ID"),Io(),Io(),Mo(50,"div",7),$o(51,"input",22),Mo(52,"div",12),Mo(53,"button",13),Vo("click",function(t){return e.unlinkApple(t)}),va(54,"Unlink"),Io(),Io(),Io(),Io(),Mo(55,"div",18),Mo(56,"div",5),Mo(57,"label",23),va(58,"GameCenter ID"),Io(),Io(),Mo(59,"div",7),$o(60,"input",24),Mo(61,"div",12),Mo(62,"button",13),Vo("click",function(t){return e.unlinkGameCenter(t)}),va(63,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(64,"div",3),Mo(65,"div",4),Mo(66,"div",5),Mo(67,"label",25),va(68,"Google ID"),Io(),Io(),Mo(69,"div",7),$o(70,"input",26),Mo(71,"div",12),Mo(72,"button",13),Vo("click",function(t){return e.unlinkGoogle(t)}),va(73,"Unlink"),Io(),Io(),Io(),Io(),Mo(74,"div",4),Mo(75,"div",5),Mo(76,"label",27),va(77,"Steam ID"),Io(),Io(),Mo(78,"div",7),$o(79,"input",28),Mo(80,"div",12),Mo(81,"button",13),Vo("click",function(t){return e.unlinkSteam(t)}),va(82,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(83,"div",3),Mo(84,"div",4),Mo(85,"div",5),Mo(86,"label",29),va(87,"Email"),Io(),$o(88,"br"),Io(),$o(89,"input",30),Io(),Mo(90,"div",4),Mo(91,"div",5),Mo(92,"label",31),va(93,"Password"),Io(),Io(),$o(94,"input",32),Io(),Io(),Mo(95,"div",33),Mo(96,"div",4),$o(97,"div",5),Mo(98,"span",34),va(99),Io(),Io(),$o(100,"div",4),Io(),Do(101,b$,2,1,"button",35),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(11),Fo("ngForOf",e.account.devices),Qr(2),Fo("disabled",!e.updateAllowed()||0===e.account.devices.length),Qr(7),Fo("value",e.account.custom_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.custom_id||""===e.account.custom_id),Qr(8),Fo("value",e.account.user.facebook_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_id||""===e.account.user.facebook_id),Qr(7),Fo("value",e.account.user.facebook_instant_game_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_instant_game_id||""===e.account.user.facebook_instant_game_id),Qr(8),Fo("value",e.account.user.apple_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.apple_id||""===e.account.user.apple_id),Qr(7),Fo("value",e.account.user.gamecenter_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.gamecenter_id||""===e.account.user.gamecenter_id),Qr(8),Fo("value",e.account.user.google_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.google_id||""===e.account.user.google_id),Qr(7),Fo("value",e.account.user.steam_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.steam_id||""===e.account.user.steam_id),Qr(18),ba("Verification Status: ",null===e.account.verify_time?"Not Verified":"Verified",""),Qr(2),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Ph,ay,_x,Vy,Wy],styles:[".custom-select[_ngcontent-%COMP%]{height:auto}"]}),t})();const x$=["editor"];function _$(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function C$(t,e){1&t&&(Mo(0,"ngb-alert",27),$o(1,"img",28),Mo(2,"h6",26),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function S$(t,e){if(1&t){const t=No();Mo(0,"button",29),Vo("click",function(){return Ie(t),zo().updateWallet()}),va(1,"Save"),Io()}2&t&&Fo("disabled",zo().updating)}function E$(t,e){1&t&&(Mo(0,"th",30),va(1,"Remove"),Io())}function k$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",31),va(2,"No wallet ledger items found."),Io(),Io())}function A$(t,e){1&t&&$o(0,"div",37)}function D$(t,e){1&t&&$o(0,"div",38)}function T$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLedgerItem(e,i,r)}),va(2,"Delete"),Io(),Io()}}function R$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",40),Mo(2,"pre",41),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function F$(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",32),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.walletLedgerMetadataOpen[n]=!i.walletLedgerMetadataOpen[n]}),Do(3,A$,1,0,"div",33),Do(4,D$,1,0,"div",34),Io(),va(5),Io(),Mo(6,"td",35),Mo(7,"pre",36),va(8),Io(),Io(),Mo(9,"td"),va(10),Io(),Do(11,T$,3,0,"td",22),Io(),Do(12,R$,5,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.walletLedgerMetadataOpen[t]),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t]),Qr(1),ba(" ",n.id," "),Qr(3),ya(n.changeset),Qr(2),ya(n.update_time),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t])}}let L$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.walletLedger=[],this.walletLedgerMetadataOpen=[],this.updating=!1,this.updated=!1,this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.walletLedger.length=0,this.walletLedger.push(...t[0].items),this.walletLedgerMetadataOpen.length=this.walletLedger.length,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}loadData(t){this.consoleService.getWalletLedger("",this.userID,this.limit,t).subscribe(t=>{this.walletLedger=t.items,this.walletLedgerMetadataOpen=[],this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.wallet),null,2);this.aceEditor.session.setValue(t)}updateWallet(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{wallet:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteLedgerItem(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteWalletLedger("",this.account.user.id,n.id).subscribe(()=>{this.error="",this.walletLedger.splice(e,1),this.walletLedgerMetadataOpen.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(x$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:32,vars:9,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","button","class","btn btn-primary",3,"disabled","click",4,"ngIf"],[1,"my-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","315px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"disabled","click"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"align-middle"],[1,"m-0","p-0"],[1,"arrow-right"],[1,"arrow-down"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","5",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,_$,4,2,"ngb-alert",0),Do(1,C$,4,1,"ngb-alert",1),Mo(2,"div",2),$o(3,"div",3,4),Io(),Do(5,S$,2,1,"button",5),$o(6,"hr",6),Mo(7,"div",7),Mo(8,"div",8),$o(9,"div",9),Mo(10,"div",10),Mo(11,"div",11),Mo(12,"button",12),Vo("click",function(){return e.loadData("")}),$o(13,"img",13),Io(),Mo(14,"button",12),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(15,"img",14),Io(),Mo(16,"button",12),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(17,"img",15),Io(),Io(),Io(),Io(),Io(),Mo(18,"div",16),Mo(19,"table",17),Mo(20,"thead",18),Mo(21,"tr"),Mo(22,"th",19),va(23,"ID"),Io(),Mo(24,"th"),va(25,"Changeset"),Io(),Mo(26,"th",20),va(27,"Update Time"),Io(),Do(28,E$,2,0,"th",21),Io(),Io(),Mo(29,"tbody"),Do(30,k$,3,0,"tr",22),Do(31,F$,13,7,"ng-template",23),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(4),Fo("ngIf",e.updateAllowed()),Qr(7),Fo("disabled",0===e.walletLedger.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(12),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.walletLedger.length),Qr(1),Fo("ngForOf",e.walletLedger))},directives:[Bh,Ph,_x],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}"]}),t})(),M$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getWalletLedger("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function I$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function $$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function O$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No friends found."),Io(),Io())}function P$(t,e){1&t&&(Mo(0,"span"),va(1,"Friend (0)"),Io())}function N$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Sent (1)"),Io())}function B$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Received (2)"),Io())}function U$(t,e){1&t&&(Mo(0,"span"),va(1,"Blocked (3)"),Io())}function V$(t,e){if(1&t){const t=No();Mo(0,"td",16),Mo(1,"button",17),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteFriend(e,i,r)}),va(2,"Delete"),Io(),Io()}}function H$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Do(6,P$,2,0,"span",8),Do(7,N$,2,0,"span",8),Do(8,B$,2,0,"span",8),Do(9,U$,2,0,"span",8),Io(),Mo(10,"td"),va(11),Io(),Do(12,V$,3,0,"td",15),Io()),2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let j$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.friends=[]}ngOnInit(){this.route.data.subscribe(t=>{this.friends.length=0,this.friends.push(...t[0].friends)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteFriend(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteFriend("",this.account.user.id,n.user.id).subscribe(()=>{this.error="",this.friends.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,I$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"User ID"),Io(),Mo(7,"th"),va(8,"Username"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,$$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,O$,3,0,"tr",8),Do(16,H$,13,8,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.friends.length),Qr(1),Fo("ngForOf",e.friends))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),z$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getFriends("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function W$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function G$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function q$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No group membership found."),Io(),Io())}function K$(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function X$(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function Y$(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function J$(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function Q$(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function Z$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",16),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function tO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,K$,2,0,"span",8),Do(7,X$,2,0,"span",8),Do(8,Y$,2,0,"span",8),Do(9,J$,2,0,"span",8),Do(10,Q$,2,0,"span",8),Io(),Mo(11,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,Z$,3,0,"td",8),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.group.id),Qr(2),ya(t.group.name),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.group.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let eO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.groups=[]}ngOnInit(){this.route.data.subscribe(t=>{this.groups.length=0,this.groups.push(...t[0].user_groups)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",this.account.user.id,n.group.id).subscribe(()=>{this.error="",this.groups.splice(e,1)},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/groups",t.group.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,W$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"Group ID"),Io(),Mo(7,"th"),va(8,"Name"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,G$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,q$,3,0,"tr",8),Do(16,tO,14,9,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),nO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getGroups("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const iO=["editor"];function rO(t,e){if(1&t&&(Mo(0,"ngb-alert",34),$o(1,"img",35),Mo(2,"h6",36),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function sO(t,e){1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",36),va(3,"Group was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function oO(t,e){1&t&&(Mo(0,"button",39),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const aO=function(t){return["/accounts",t]},lO=function(t){return{"is-invalid":t}};let cO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.groupForm=this.formBuilder.group({name:["",py.required],description:[""],avatar_url:[""],lang_tag:[""],open:[""],max_count:[""]}),this.route.parent.data.subscribe(t=>{this.group=t[0],this.f.name.setValue(this.group.name),this.f.description.setValue(this.group.description),this.f.avatar_url.setValue(this.group.avatar_url),this.f.lang_tag.setValue(this.group.lang_tag),this.f.open.setValue(this.group.open),this.f.max_count.setValue(this.group.max_count),this.updateAllowed()||this.groupForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.group.metadata),null,2);this.aceEditor.session.setValue(t)}updateGroup(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}if(this.f.max_count.value{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.groupForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(iO,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:71,vars:16,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","group_id",1,"d-inline"],["type","text","id","group_id","placeholder","Group ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","creator_id",1,"d-inline"],[2,"width","100%",3,"routerLink"],["type","text","id","creator_id","placeholder","Creator ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","name",1,"d-inline"],["type","text","id","name","placeholder","Name","required","","formControlName","name",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","formControlName","description",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","lang_tag",1,"d-inline"],["type","text","id","lang_tag","placeholder","Language","formControlName","lang_tag",1,"form-control","form-control-sm","my-2"],["type","text","id","edge_count","placeholder","Members","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_count",1,"d-inline"],["type","text","id","max_count","placeholder","Max Count","formControlName","max_count",1,"form-control","form-control-sm","my-2"],["type","checkbox","id","open","formControlName","open",1,"my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,rO,4,2,"ngb-alert",0),Do(1,sO,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateGroup()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Group ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Creator ID"),Io(),Io(),Mo(13,"a",9),$o(14,"input",10),Io(),Io(),Io(),Mo(15,"div",3),Mo(16,"div",4),Mo(17,"div",5),Mo(18,"label",11),va(19,"Name"),Io(),Io(),$o(20,"input",12),Mo(21,"div",13),va(22,"Name is required"),Io(),Io(),Mo(23,"div",4),Mo(24,"div",5),Mo(25,"label",14),va(26,"Description"),Io(),Io(),$o(27,"input",15),Io(),Io(),Mo(28,"div",3),Mo(29,"div",16),Mo(30,"div",5),Mo(31,"label",17),va(32,"Avatar URL"),Io(),Io(),$o(33,"input",18),Io(),Mo(34,"div",4),Mo(35,"div",5),Mo(36,"label",19),va(37,"Language"),Io(),Io(),$o(38,"input",20),Io(),Io(),Mo(39,"div",3),Mo(40,"div",4),Mo(41,"div",5),Mo(42,"label",8),va(43,"Members"),Io(),Io(),$o(44,"input",21),Io(),Mo(45,"div",16),Mo(46,"div",5),Mo(47,"label",22),va(48,"Max Count"),Io(),Io(),$o(49,"input",23),Io(),Io(),Mo(50,"div",3),Mo(51,"div",16),Mo(52,"div",5),Mo(53,"label",22),va(54,"Open"),Io(),Io(),$o(55,"input",24),Io(),Io(),Mo(56,"div",25),Mo(57,"div",4),Mo(58,"div",5),Mo(59,"label",26),va(60,"Create Time"),Io(),Io(),$o(61,"input",27),Io(),Mo(62,"div",4),Mo(63,"div",5),Mo(64,"label",28),va(65,"Update Time"),Io(),Io(),$o(66,"input",29),Io(),Io(),Mo(67,"div",30),$o(68,"div",31,32),Io(),Do(70,oO,2,1,"button",33),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.groupForm),Qr(6),Fo("value",e.group.id),Qr(5),Fo("routerLink",Vl(12,aO,e.group.creator_id)),Qr(1),Fo("value",e.group.creator_id),Qr(6),Fo("ngClass",Vl(14,lO,e.f.name.dirty&&e.f.name.errors)),Qr(1),Fo("hidden",e.f.name.disabled||e.f.name.valid||e.f.name.pristine),Qr(23),Fo("value",e.group.edge_count),Qr(17),Fo("value",e.group.create_time),Qr(5),Fo("value",e.group.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Mv,ay,wb,Ty,yb,$h,ry,_x],styles:[""]}),t})();function hO(t,e){if(1&t&&(Mo(0,"ngb-alert",13),$o(1,"img",14),Mo(2,"h6",15),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function uO(t,e){1&t&&(Mo(0,"span"),va(1,"Add by membership state"),Io())}function dO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.activeState)}}function pO(t,e){if(1&t){const t=No();Mo(0,"button",20),Vo("click",function(){Ie(t);const n=e.$implicit;return zo(2).activeState=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function fO(t,e){if(1&t&&(Mo(0,"div",16),Mo(1,"button",17),Do(2,uO,2,0,"span",11),Do(3,dO,2,1,"span",11),Io(),Mo(4,"div",18),Do(5,pO,2,1,"button",19),Io(),Io()),2&t){const t=zo();Qr(2),Fo("ngIf",!t.activeState||""===t.activeState),Qr(1),Fo("ngIf",t.activeState&&""!==t.activeState),Qr(2),Fo("ngForOf",t.states)}}function gO(t,e){if(1&t){const t=No();Mo(0,"div",21),Mo(1,"div",22),Mo(2,"div",23),Mo(3,"form",24),Mo(4,"div",25),$o(5,"input",26),Mo(6,"div",27),Mo(7,"div",28),Mo(8,"button",29),Vo("click",function(){return Ie(t),zo().add()}),va(9,"Add"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io()}if(2&t){const t=zo();Qr(3),Fo("formGroup",t.addForm)}}function mO(t,e){1&t&&(Mo(0,"th",30),va(1,"Demote"),Io())}function vO(t,e){1&t&&(Mo(0,"th",30),va(1,"Promote"),Io())}function yO(t,e){1&t&&(Mo(0,"th",31),va(1,"Remove"),Io())}function bO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No group membership found."),Io(),Io())}function wO(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function xO(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function _O(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function CO(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function SO(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function EO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().demoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",38),$o(3,"path",39),Io(),Io(),Io()}}function kO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().promoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",40),$o(3,"path",41),Io(),Io(),Io()}}function AO(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function DO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,wO,2,0,"span",11),Do(7,xO,2,0,"span",11),Do(8,_O,2,0,"span",11),Do(9,CO,2,0,"span",11),Do(10,SO,2,0,"span",11),Io(),Mo(11,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,EO,4,0,"td",34),Do(14,kO,4,0,"td",34),Do(15,AO,3,0,"td",35),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.user.update_time),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed())}}let TO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.authService=r,this.error="",this.members=[],this.activeState="Add Member",this.states=["Add Member","Join"],this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.onSameUrlNavigation="reload",this.addForm=this.formBuilder.group({ids:[""]})}ngOnInit(){this.route.data.subscribe(t=>{this.members.length=0,this.members.push(...t[0].group_users)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}editionAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",n.user.id,this.group.id).subscribe(()=>{this.members.splice(e,1)},t=>{this.error=t})}demoteGroupUser(t,e,n){this.error="",this.consoleService.demoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state++},t=>{this.error=t})}promoteGroupUser(t,e,n){this.error="",this.consoleService.promoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state--},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/accounts",t.user.id],{relativeTo:this.route})}add(){this.consoleService.addGroupUsers("",this.group.id,{ids:this.f.ids.value,join_request:"Join"===this.activeState}).subscribe(()=>{this.error="",this.router.navigate([this.router.url])},t=>{this.error=t})}get f(){return this.addForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:21,vars:8,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["class","btn-group mb-1","ngbDropdown","",4,"ngIf"],["class","row no-gutters mb-4",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 70px",4,"ngIf"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup"],[1,"input-group"],["id","ids","type","text","formControlName","ids","placeholder","Add user IDs as members, comma-separated",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],[2,"width","70px"],[2,"width","90px"],["colSpan","7",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],["class","text-center align-middle",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-outline-secondary",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-down"],["fill-rule","evenodd","d","M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-up"],["fill-rule","evenodd","d","M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"],[1,"text-center","align-middle"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,hO,4,2,"ngb-alert",0),Do(1,fO,6,3,"div",1),Do(2,gO,10,1,"div",2),Mo(3,"div",3),Mo(4,"table",4),Mo(5,"thead",5),Mo(6,"tr"),Mo(7,"th",6),va(8,"User ID"),Io(),Mo(9,"th"),va(10,"Name"),Io(),Mo(11,"th",7),va(12,"State"),Io(),Mo(13,"th",8),va(14,"Update Time"),Io(),Do(15,mO,2,0,"th",9),Do(16,vO,2,0,"th",9),Do(17,yO,2,0,"th",10),Io(),Io(),Mo(18,"tbody"),Do(19,bO,3,0,"tr",11),Do(20,DO,16,11,"tr",12),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.group.open&&e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(13),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(2),Fo("ngIf",0===e.members.length),Qr(1),Fo("ngForOf",e.members))},directives:[Bh,Ph,_x,Kx,qx,Wx,zx,pb,Ry,mb,ay,Ty,yb],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),RO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getMembers("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FO(t,e){if(1&t&&(Mo(0,"ngb-alert",28),$o(1,"img",29),Mo(2,"h6",30),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function LO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeType)}}function MO(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeType=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function IO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeNode)}}function $O(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeNode=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function OO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No realtime matches were found."),Io(),Io())}function PO(t,e){1&t&&$o(0,"div",40)}function NO(t,e){1&t&&$o(0,"div",41)}function BO(t,e){if(1&t){const t=No();Mo(0,"div",37),Vo("click",function(){Ie(t);const e=zo(),n=e.index,i=e.$implicit,r=zo();return r.getMatchState(n,i),r.matchStatesOpen[n]=!r.matchStatesOpen[n]}),Do(1,PO,1,0,"div",38),Do(2,NO,1,0,"div",39),Io()}if(2&t){const t=zo().index,e=zo();Qr(1),Fo("ngIf",!e.matchStatesOpen[t]),Qr(1),Fo("ngIf",e.matchStatesOpen[t])}}function UO(t,e){1&t&&$o(0,"div",42)}function VO(t,e){1&t&&(Mo(0,"span"),va(1,"Yes"),Io())}function HO(t,e){1&t&&(Mo(0,"span"),va(1,"No"),Io())}function jO(t,e){1&t&&$o(0,"img",51)}function zO(t,e){if(1&t&&(Mo(0,"div"),Mo(1,"small"),Mo(2,"b"),va(3,"Current Tick"),Io(),Io(),Mo(4,"pre",47),Mo(5,"small"),va(6),Io(),Io(),Mo(7,"small"),Mo(8,"b"),va(9,"Match State"),Io(),Io(),Mo(10,"pre",47),Mo(11,"small"),va(12),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(6),ya(e.matchStates[t].tick),Qr(6),ya(e.matchStates[t].state)}}function WO(t,e){1&t&&$o(0,"img",51)}function GO(t,e){if(1&t&&(Mo(0,"pre",47),Mo(1,"small"),va(2),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.getMatchPresencesString(e.matchStates[t].presences))}}function qO(t,e){if(1&t&&(Mo(0,"tr",43),Mo(1,"td",44),Mo(2,"div",45),Mo(3,"div",46),Mo(4,"small"),Mo(5,"b"),va(6,"Match Label"),Io(),Io(),Mo(7,"pre",47),Mo(8,"small"),va(9),Io(),Io(),Io(),Mo(10,"div",48),Do(11,jO,1,0,"img",49),Do(12,zO,13,2,"div",7),Io(),Mo(13,"div",48),Mo(14,"small"),Mo(15,"b"),va(16,"Match Presences"),Io(),Io(),Do(17,WO,1,0,"img",49),Do(18,GO,3,1,"pre",50),Io(),Io(),Io(),Io()),2&t){const t=zo(),e=t.$implicit,n=t.index,i=zo();Qr(9),ya(e.api_match.label),Qr(2),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n]),Qr(5),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n])}}function KO(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Do(2,BO,3,2,"div",33),Do(3,UO,1,0,"div",34),va(4),Io(),Mo(5,"td"),va(6),Io(),Mo(7,"td",35),Do(8,VO,2,0,"span",7),Do(9,HO,2,0,"span",7),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Io(),Do(16,qO,19,5,"tr",36)),2&t){const t=e.index,n=e.$implicit,i=zo();Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(1),ba(" ",n.api_match.match_id," "),Qr(2),ya(n.api_match.size),Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(2),ya(n.node),Qr(2),ya(n.api_match.handler_name),Qr(2),ya(n.api_match.authoritative?n.api_match.tick_rate:"-"),Qr(1),Fo("ngIf",i.matchStatesOpen[t])}}let XO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.formBuilder=n,this.consoleService=i,this.error="",this.matches=[],this.matchStates=[],this.matchStatesOpen=[],this.updated=!1,this.activeType="All",this.types=["All","Authoritative","Relayed"],this.activeNode="All Nodes",this.nodes=["All Nodes"],this.searchForm1=this.formBuilder.group({match_id:""}),this.searchForm2=this.formBuilder.group({match_id:""}),this.searchForm3=this.formBuilder.group({query:""})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.match_id.setValue(t.get("match_id")),this.f2.match_id.setValue(t.get("match_id")),this.f3.query.setValue(t.get("query"));let e=t.get("type");this.type=Number(e);let n=t.get("node");if(this.route.data.subscribe(t=>{console.log(t),t&&(t[0]&&(this.error="",this.matches.length=0,this.matches.push(...t[0].matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length),t[1]&&this.nodes.push(...t[1]),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=0,this.activeType=this.types[0]):0==this.type||1==this.type||2==this.type?this.activeType=this.types[this.type]:this.error="Invalid type",null!==n){let t=!1;this.nodes.forEach(e=>{n===e&&(this.activeNode=n,t=!0)}),t||(this.error="Invalid node.")}}search(){const t=this.getType();this.type=t,JO(this.consoleService,t,0==t?this.f1.match_id.value:this.f2.match_id.value,this.f3.query.value,this.activeNode===this.nodes[0]?"":this.activeNode).subscribe(t=>this.postData(t),t=>{this.error=t})}postData(t){let e;switch(this.error="",this.matches.length=0,this.matches.push(...t.matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length,this.type){case 0:e={type:this.type,match_id:this.f1.match_id.value};break;case 1:e={type:this.type,query:this.f3.query.value},this.activeNode!==this.nodes[0]&&(e.node=this.activeNode);break;case 2:e={type:this.type,match_id:this.f2.match_id.value}}this.router.navigate([],{relativeTo:this.route,queryParams:e})}getType(){let t=0;return this.types.forEach((e,n)=>{this.activeType===e&&(t=n)}),t}getMatchState(t,e){this.matchStatesOpen[t]||(this.matchStates[t]=null,this.error="",this.consoleService.getMatchState("",e.api_match.match_id).subscribe(e=>{this.matchStatesOpen[t]=!0,this.matchStates[t]=e},e=>{this.matchStatesOpen[t]=!1,this.matchStates[t]=null,this.error=e}))}getMatchPresencesString(t){return JSON.stringify(t)}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(_b),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:53,vars:16,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"input-group","mb-1"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-right"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","match_id","placeholder","Filter by match ID",1,"form-control"],["type","text","formControlName","query","placeholder","Filter by query or match ID",1,"form-control","border-right-0"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-left"],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","140px"],[2,"width","100px"],[2,"width","130px"],[2,"width","90px"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","button","ngbDropdownItem","",3,"click"],["colSpan","8",1,"text-muted"],["class","arrow",3,"click",4,"ngIf"],["class","d-inline-block mr-3",4,"ngIf"],[1,"text-center"],["class","open-row",4,"ngIf"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"d-inline-block","mr-3"],[1,"open-row"],["colspan","6",1,"align-middle"],[1,"d-flex","p-0"],[1,"p-3","w-33","border"],[1,"pre-wrap","m-0","p-0"],[1,"p-3","w-33","border","border-left-0"],["src","/static/spinner.svg","class","d-block","width","16",4,"ngIf"],["class","pre-wrap m-0 p-0",4,"ngIf"],["src","/static/spinner.svg","width","16",1,"d-block"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Active Matches"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FO,4,2,"ngb-alert",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"div",5),Mo(8,"button",6),Do(9,LO,2,1,"span",7),Io(),Mo(10,"div",8),Do(11,MO,2,1,"button",9),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"button",11),Vo("click",function(){return e.search()}),va(14,"Search"),Io(),Io(),Io(),Mo(15,"div",12),Mo(16,"div",13),Mo(17,"div",14),Mo(18,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(19,"div",16),$o(20,"input",17),Io(),Io(),Mo(21,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(22,"div",16),$o(23,"input",17),Io(),Io(),Mo(24,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(25,"div",16),$o(26,"input",18),Mo(27,"div",10),Mo(28,"div",5),Mo(29,"button",19),Do(30,IO,2,1,"span",7),Io(),Mo(31,"div",8),Do(32,$O,2,1,"button",9),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(33,"div",20),Mo(34,"table",21),Mo(35,"thead",22),Mo(36,"tr"),Mo(37,"th"),Mo(38,"span"),va(39,"Match ID"),Io(),Io(),Mo(40,"th",23),va(41,"Presence Count"),Io(),Mo(42,"th",24),va(43,"Authoritative"),Io(),Mo(44,"th",24),va(45,"Node"),Io(),Mo(46,"th",25),va(47,"Handler Name"),Io(),Mo(48,"th",26),va(49,"Tick Rate"),Io(),Io(),Io(),Mo(50,"tbody"),Do(51,OO,3,0,"tr",7),Do(52,KO,17,10,"ng-template",27),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.matches.length," running matches found."),Qr(1),Fo("ngIf",e.error),Qr(5),Fo("ngIf",e.activeType&&""!==e.activeType),Qr(2),Fo("ngForOf",e.types),Qr(7),Fo("hidden","All"!==e.activeType)("formGroup",e.searchForm1),Qr(3),Fo("hidden","Relayed"!==e.activeType)("formGroup",e.searchForm2),Qr(3),Fo("hidden","Authoritative"!==e.activeType)("formGroup",e.searchForm3),Qr(6),Fo("ngIf",e.activeNode&&""!==e.activeNode),Qr(2),Fo("ngForOf",e.nodes),Qr(6),ra("pl-3",e.matches.length>0),Qr(13),Fo("ngIf",0===e.matches.length),Qr(1),Fo("ngForOf",e.matches))},directives:[Bh,Kx,qx,Wx,Ph,pb,Ry,mb,ay,Ty,yb,_x,zx],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}.open-row[_ngcontent-%COMP%]{background:#fafafc}.w-33[_ngcontent-%COMP%]{width:33.3333%!important}.dropdown-radius-right[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),YO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));return JO(this.consoleService,n,t.queryParamMap.get("match_id"),t.queryParamMap.get("query"),t.queryParamMap.get("node")).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JO(t,e,n,i,r){switch(e){case 0:return t.listMatches("",null,null,null,null,null,n);case 1:return t.listMatches("",null,!0,null,null,null,null,i,r);case 2:return t.listMatches("",null,!1,null,null,null,n)}return ff(null)}let QO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function ZO(t,e){if(1&t&&(Mo(0,"ngb-alert",25),$o(1,"img",26),Mo(2,"h6",27),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying groups: ",t.error,"")}}function tP(t,e){1&t&&(Mo(0,"th",28),va(1,"Remove"),Io())}function eP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No groups found - change the filter criteria or add new user groups."),Io(),Io())}function nP(t,e){1&t&&$o(0,"td")}function iP(t,e){if(1&t){const t=No();Mo(0,"td",32),Mo(1,"button",33),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroup(e,i,r)}),va(2,"Delete"),Io(),Io()}}function rP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(2),Io(),Mo(3,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(4),Io(),Mo(5,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(6),Io(),Do(7,nP,1,0,"td",23),Do(8,iP,3,0,"td",31),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let sP=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.groupsCount=0,this.groups=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):this.f.filter.value&&this.search(0),this.route.data.subscribe(t=>{this.groups.length=0,t&&(this.groups.push(...t[0].groups),this.groupsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listGroups("",this.f.filter.value,e).subscribe(t=>{this.error="",this.groups.length=0,this.groups.push(...t.groups),this.groupsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteGroup(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroup("",n.id).subscribe(()=>{this.error="",this.groups.splice(e,1),this.groupsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewGroup(t){this.router.navigate(["/groups",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:35,vars:8,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by group ID or name (use '%' for wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Groups"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"div",9),Mo(12,"button",10),Vo("click",function(){return e.search(0)}),va(13,"Search"),Io(),Io(),Io(),Io(),Io(),Io(),Mo(14,"div",11),Mo(15,"div",12),Mo(16,"button",13),Vo("click",function(){return e.search(0)}),$o(17,"img",14),Io(),Mo(18,"button",13),Vo("click",function(){return e.search(1)}),$o(19,"img",15),Io(),Io(),Io(),Io(),Io(),Do(20,ZO,4,2,"ngb-alert",16),Mo(21,"div",17),Mo(22,"table",18),Mo(23,"thead",19),Mo(24,"tr"),Mo(25,"th",20),va(26,"Group ID"),Io(),Mo(27,"th"),va(28,"Name"),Io(),Mo(29,"th",21),va(30,"Last Update"),Io(),Do(31,tP,2,0,"th",22),Io(),Io(),Mo(32,"tbody"),Do(33,eP,3,0,"tr",23),Do(34,rP,9,5,"tr",24),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.groupsCount," groups found."),Qr(4),Fo("formGroup",e.searchForm),Qr(9),Fo("disabled",0===e.groups.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(11),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[pb,Ry,mb,ay,Ty,yb,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),oP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter");return this.consoleService.listGroups("",n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function aP(t,e){if(1&t){const t=No();Mo(0,"button",13),Vo("click",function(e){return Ie(t),zo().exportGroup(e)}),$o(1,"img",14),va(2,"Export"),Io()}}function lP(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().deleteGroup(e,!1)}),$o(1,"img",16),va(2,"Delete"),Io()}}function cP(t,e){if(1&t&&(Mo(0,"ngb-alert",17),$o(1,"img",18),Mo(2,"h6",19),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const hP=function(t,e){return["/groups",t,e]};function uP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,20),Mo(2,"a",21),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,hP,n.group.id,t.path)),Qr(1),ya(t.label)}}const dP=function(){return["/groups"]};let pP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Members",path:"members"}]}ngOnInit(){this.route.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}deleteGroup(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteGroup("",this.group.id).subscribe(()=>{this.error="",this.router.navigate(["/groups"])},t=>{this.error=t})}exportGroup(t){t.target.disabled=!0,this.error="",this.consoleService.exportGroup("",this.group.id).subscribe(e=>{this.error="";const n=this.group.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:18,vars:7,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Group"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Group"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,aP,3,0,"button",7),Do(12,lP,3,0,"button",8),Io(),Io(),Do(13,cP,4,2,"ngb-alert",9),Mo(14,"nav",10,11),Do(16,uP,4,6,"div",12),Io(),$o(17,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(6,dP)),Qr(3),ya(e.group.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),fP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getGroup("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function gP(t,e){if(1&t){const t=No();Mo(0,"button",12),Vo("click",function(e){return Ie(t),zo().deleteLeaderboard(e)}),$o(1,"img",13),va(2,"Delete Leaderboard"),Io()}}function mP(t,e){if(1&t&&(Mo(0,"ngb-alert",14),$o(1,"img",15),Mo(2,"h6",16),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const vP=function(t,e){return["/leaderboards",t,e]};function yP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,17),Mo(2,"a",18),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,vP,n.leaderboard.id,t.path)),Qr(1),ya(t.label)}}const bP=function(){return["/leaderboards"]};let wP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Records",path:"records"}]}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}deleteLeaderboard(t){t.target.disabled=!0,this.error="",this.consoleService.deleteLeaderboard("",this.leaderboard.id).subscribe(()=>{this.error="",this.router.navigate(["/leaderboards"])},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:6,consts:[[1,"pb-1"],[1,"leaderboard-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-danger btn-danger-icon",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["leaderboardNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-danger","btn-danger-icon",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","13","height","13",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboard"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Leaderboards"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,gP,3,0,"button",7),Io(),Io(),Do(12,mP,4,2,"ngb-alert",8),Mo(13,"nav",9,10),Do(15,yP,4,6,"div",11),Io(),$o(16,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(5,bP)),Qr(3),ya(e.leaderboard.id),Qr(2),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.leaderboard-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.leaderboard-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),xP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getLeaderboard("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const _P=["editor"];function CP(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function SP(t,e){if(1&t&&(Mo(0,"div",27),Mo(1,"h6"),va(2,"Tournament"),Io(),$o(3,"hr",28),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"label",29),va(8,"Title"),Io(),Io(),$o(9,"input",30),Io(),Mo(10,"div",3),Mo(11,"div",4),Mo(12,"label",31),va(13,"Description"),Io(),Io(),$o(14,"input",32),Io(),Io(),Mo(15,"div",2),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"label",33),va(19,"Category"),Io(),Io(),$o(20,"input",34),Io(),Mo(21,"div",3),Mo(22,"div",4),Mo(23,"label",35),va(24,"Max Num Score"),Io(),Io(),$o(25,"input",36),Io(),Io(),Mo(26,"div",2),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"label",37),va(30,"Size"),Io(),Io(),$o(31,"input",38),Io(),Mo(32,"div",3),Mo(33,"div",4),Mo(34,"label",39),va(35,"Max Size"),Io(),Io(),$o(36,"input",40),Io(),Io(),Mo(37,"div",2),Mo(38,"div",3),Mo(39,"div",4),Mo(40,"label",41),va(41,"Duration"),Io(),Io(),$o(42,"input",42),Io(),Mo(43,"div",3),Mo(44,"div",4),Mo(45,"label",43),va(46,"Join Required"),Io(),Io(),$o(47,"input",44),Io(),Io(),Mo(48,"div",2),Mo(49,"div",3),Mo(50,"div",4),Mo(51,"label",45),va(52,"Start Time"),Io(),Io(),$o(53,"input",46),Io(),Mo(54,"div",3),Mo(55,"div",4),Mo(56,"label",47),va(57,"End Time"),Io(),Io(),$o(58,"input",48),Io(),Io(),Mo(59,"div",2),Mo(60,"div",3),Mo(61,"div",4),Mo(62,"label",49),va(63,"Start Active"),Io(),Io(),$o(64,"input",50),Io(),Mo(65,"div",3),Mo(66,"div",4),Mo(67,"label",51),va(68,"End Active"),Io(),Io(),$o(69,"input",52),Io(),Io(),Io()),2&t){const t=zo();Qr(9),Fo("value",t.leaderboard.title),Qr(5),Fo("value",t.leaderboard.description),Qr(6),Fo("value",t.leaderboard.category),Qr(5),Fo("value",t.leaderboard.max_num_score),Qr(6),Fo("value",t.leaderboard.size),Qr(5),Fo("value",t.leaderboard.max_size),Qr(6),Fo("value",t.leaderboard.duration),Qr(5),Fo("value",t.leaderboard.join_required),Qr(6),Fo("value",t.leaderboard.start_time),Qr(5),Fo("value",t.leaderboard.end_time),Qr(6),Fo("value",t.leaderboard.start_active),Qr(5),Fo("value",t.leaderboard.end_active)}}let EP=(()=>{class t{constructor(t){this.route=t,this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"},this.error=""}ngOnInit(){this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}ngAfterViewInit(){if(vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.leaderboard.metadata){const t=JSON.stringify(JSON.parse(this.leaderboard.metadata),null,2);this.aceEditor.session.setValue(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(_P,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:50,vars:10,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border","mb-3"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","id",1,"d-inline"],["type","text","id","id","placeholder","ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","authoritative",1,"d-inline"],["type","text","id","authoritative","placeholder","Authoritative","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","sortorder",1,"d-inline"],["type","text","id","sortorder","placeholder","Sort Order","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","operator",1,"d-inline"],["type","text","id","operator","placeholder","Operator","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","reset",1,"d-inline"],["type","text","id","reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"row","add-border-single-row-bottom"],["type","text","id","prev_reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["type","text","id","next_reset","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["class","mt-4",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"mt-4"],[1,"mb-4"],["for","title",1,"d-inline"],["type","text","id","title","placeholder","Title","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","category",1,"d-inline"],["type","text","id","category","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_num_score",1,"d-inline"],["type","text","id","max_num_score","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","size",1,"d-inline"],["type","text","id","size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_size",1,"d-inline"],["type","text","id","max_size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","duration",1,"d-inline"],["type","text","id","duration","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","join_required",1,"d-inline"],["type","text","id","join_required","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_time",1,"d-inline"],["type","text","id","start_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_time",1,"d-inline"],["type","text","id","end_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_active",1,"d-inline"],["type","text","id","start_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_active",1,"d-inline"],["type","text","id","end_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"]],template:function(t,e){1&t&&(Do(0,CP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"label",5),va(6,"ID"),Io(),Io(),$o(7,"input",6),Io(),Mo(8,"div",3),Mo(9,"div",4),Mo(10,"label",7),va(11,"Authoritative"),Io(),Io(),$o(12,"input",8),Io(),Io(),Mo(13,"div",2),Mo(14,"div",3),Mo(15,"div",4),Mo(16,"label",9),va(17,"Sort Order"),Io(),Io(),$o(18,"input",10),Io(),Mo(19,"div",3),Mo(20,"div",4),Mo(21,"label",11),va(22,"Operator"),Io(),Io(),$o(23,"input",12),Io(),Io(),Mo(24,"div",2),Mo(25,"div",3),Mo(26,"div",4),Mo(27,"label",13),va(28,"Reset Schedule"),Io(),Io(),$o(29,"input",14),Io(),Mo(30,"div",3),Mo(31,"div",4),Mo(32,"label",15),va(33,"Create Time"),Io(),Io(),$o(34,"input",16),Io(),Io(),Mo(35,"div",17),Mo(36,"div",3),Mo(37,"div",4),Mo(38,"label",13),va(39,"Prev Reset"),Io(),Io(),$o(40,"input",18),Io(),Mo(41,"div",3),Mo(42,"div",4),Mo(43,"label",15),va(44,"Next Reset"),Io(),Io(),$o(45,"input",19),Io(),Io(),Io(),Do(46,SP,70,12,"div",20),Mo(47,"div",21),$o(48,"div",22,23),Io()),2&t&&(Fo("ngIf",e.error),Qr(7),Fo("value",e.leaderboard.id),Qr(5),Fo("value",e.leaderboard.authoritative),Qr(6),Fo("value",e.orderString[e.leaderboard.sort_order]),Qr(5),Fo("value",e.operatorString[e.leaderboard.operator]),Qr(6),Fo("value",e.leaderboard.reset_schedule),Qr(5),Fo("value",e.leaderboard.create_time),Qr(6),Fo("value",e.leaderboard.prev_reset),Qr(5),Fo("value",e.leaderboard.next_reset),Qr(1),Fo("ngIf",e.leaderboard.tournament))},directives:[Bh,_x],styles:[".leaderboard-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})();function kP(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function AP(t,e){1&t&&(Mo(0,"th",22),va(1,"Remove"),Io())}function DP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",23),va(2,"No records found."),Io(),Io())}function TP(t,e){1&t&&$o(0,"div",28)}function RP(t,e){1&t&&$o(0,"div",29)}function FP(t,e){if(1&t){const t=No();Mo(0,"td",30),Mo(1,"button",31),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteRecord(e,i,r)}),va(2,"Delete"),Io(),Io()}}function LP(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",32),Mo(2,"pre",33),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function MP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",24),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.recordsMetadataOpen[n]=!i.recordsMetadataOpen[n]}),Do(3,TP,1,0,"div",25),Do(4,RP,1,0,"div",26),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Mo(16,"td"),va(17),Io(),Do(18,FP,3,0,"td",27),Io(),Do(19,LP,5,1,"tr",17)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.recordsMetadataOpen[t]),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t]),Qr(1),ba(" ",n.owner_id," "),Qr(2),ya(n.username),Qr(2),ya(n.score),Qr(2),ya(n.subscore),Qr(2),ya(n.rank),Qr(2),ya(n.num_score),Qr(2),ya(n.expiry_time?n.expiry_time:"-"),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t])}}let IP=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.authService=n,this.error="",this.records=[],this.recordsMetadataOpen=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.route.data.subscribe(t=>{this.records.length=0,this.records.push(...t[0].records),this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}loadRecords(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listLeaderboardRecords("",this.leaderboard.id,null,100,e,null).subscribe(t=>{this.error="",this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor,this.records.length=0,this.records.push(...t.records),this.recordsMetadataOpen.length=0,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t})}deleteRecord(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboardRecord("",n.leaderboard_id,n.owner_id).subscribe(()=>{this.error="",this.records.splice(e,1),this.recordsMetadataOpen.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:34,vars:7,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","380px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","8",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,kP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadRecords(0)}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadRecords(-1)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadRecords(1)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th",13),va(17,"Owner ID"),Io(),Mo(18,"th"),va(19,"Username"),Io(),Mo(20,"th",14),va(21,"Score"),Io(),Mo(22,"th",14),va(23,"Subscore"),Io(),Mo(24,"th",14),va(25,"Rank"),Io(),Mo(26,"th",14),va(27,"No. of scores"),Io(),Mo(28,"th",15),va(29,"Expiry Time"),Io(),Do(30,AP,2,0,"th",16),Io(),Io(),Mo(31,"tbody"),Do(32,DP,3,0,"tr",17),Do(33,MP,20,11,"ng-template",18),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.records.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(20),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.records.length),Qr(1),Fo("ngForOf",e.records))},directives:[Bh,Ph,_x],styles:[""]}),t})(),$P=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listLeaderboardRecords("",n,null,100,null,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const OP=["editor"],PP=["editorResponse"];function NP(t,e){if(1&t&&(Mo(0,"ngb-alert",23),$o(1,"img",24),Mo(2,"h6",25),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error whilst making RPC call: ",t.error,"")}}function BP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}function UP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}let VP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.error="",this.rpcEndpoints=[],this.endpoints=[]}ngOnInit(){this.endpointCallForm=this.formBuilder.group({method:["",py.required],user_id:[""]}),this.f.method.valueChanges.subscribe(t=>{const e=this.endpoints.concat(this.rpcEndpoints).find(e=>e.method===t?e:null);this.updateQueryParam(e.method),this.setupRequestBody(e.body_template)}),this.route.data.subscribe(t=>{const e=t[0];this.endpoints.length=0,this.endpoints.push(...e.endpoints),this.rpcEndpoints.length=0,this.rpcEndpoints.push(...e.rpc_endpoints)},t=>{this.error=t});const t=this.endpoints.concat(this.rpcEndpoints).find(t=>t.method===this.route.snapshot.queryParamMap.get("endpoint")?t:null);null!=t&&this.f.method.setValue(t.method)}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.aceEditorResponse=vI.edit(this.editorResponse.nativeElement),this.aceEditorResponse.setReadOnly(!0)}sendRequest(){this.error="";let t=this.aceEditor.session.getValue();if(""!==t)try{t=JSON.stringify(JSON.parse(t))}catch(i){return void(this.error=i)}const e={user_id:this.f.user_id.value,body:t};let n=null;n=this.isRpcEndpoint(this.f.method.value)?this.consoleService.callRpcEndpoint("",this.f.method.value,e):this.consoleService.callApiEndpoint("",this.f.method.value,e),n.subscribe(e=>{if(e.error_message&&""!==e.error_message)this.aceEditorResponse.session.setValue(e.error_message);else{t="";try{t=JSON.stringify(JSON.parse(e.body),null,2)}catch(i){return void(this.error=i)}this.aceEditorResponse.session.setValue(t)}},t=>{this.aceEditorResponse.session.setValue(""),this.error=t})}isRpcEndpoint(t){return null!=this.rpcEndpoints.find(e=>e.method===t?e:null)}setupRequestBody(t){if(null!=this.aceEditor){if(!t||""===t)return this.aceEditor.session.setValue(""),void this.aceEditor.setReadOnly(!this.isRpcEndpoint(this.f.method.value));try{const e=JSON.stringify(JSON.parse(t),null,2);this.aceEditor.session.setValue(e),this.aceEditor.setReadOnly(!1)}catch(e){return void(this.error=e)}}else console.log("problem?")}updateQueryParam(t){this.router.navigate([],{relativeTo:this.route,queryParams:{endpoint:t},queryParamsHandling:"merge"})}get f(){return this.endpointCallForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&(sc(OP,!0),sc(PP,!0)),2&t){let t;ic(t=lc())&&(e.editor=t.first),ic(t=lc())&&(e.editorResponse=t.first)}},decls:35,vars:6,consts:[[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["id","method","formControlName","method",1,"form-control","custom-select","dropdown-radius"],["disabled","",3,"value"],[3,"value",4,"ngFor","ngForOf"],["disabled","",1,"text-muted"],["type","text","formControlName","user_id","placeholder","set user ID as request context",1,"form-control","border-right-0"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"d-flex"],[1,"w-50","py-3"],[1,"mb-4"],[1,"card","p-2","mb-3"],[2,"height","500px"],["editor",""],[1,"w-50","pl-3","py-3"],["editorResponse",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"value"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"API Explorer"),Io(),Do(2,NP,4,2,"ngb-alert",1),Mo(3,"div",2),Mo(4,"div",3),Mo(5,"div",4),Mo(6,"form",5),Vo("ngSubmit",function(){return e.sendRequest()}),Mo(7,"div",6),Mo(8,"div",7),Mo(9,"select",8),Mo(10,"option",9),va(11,"Select Endpoint"),Io(),Do(12,BP,2,2,"option",10),Mo(13,"option",11),va(14,"----"),Io(),Do(15,UP,2,2,"option",10),Io(),Io(),$o(16,"input",12),Mo(17,"div",13),Mo(18,"button",14),va(19,"Send Request"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(20,"div",15),Mo(21,"div",16),Mo(22,"h5"),va(23,"Request Body"),Io(),$o(24,"hr",17),Mo(25,"div",18),$o(26,"div",19,20),Io(),Io(),Mo(28,"div",21),Mo(29,"h5"),va(30,"Response"),Io(),$o(31,"hr",17),Mo(32,"div",18),$o(33,"div",19,22),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(4),Fo("formGroup",e.endpointCallForm),Qr(4),Fo("value",""),Qr(2),Fo("ngForOf",e.rpcEndpoints),Qr(3),Fo("ngForOf",e.endpoints),Qr(3),Fo("disabled",e.f.method.invalid))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Vy,Wy,Ph,ay,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}"]}),t})(),HP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listApiEndpoints("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jP(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function zP(t,e){1&t&&$o(0,"div",23)}function WP(t,e){1&t&&$o(0,"div",24)}function GP(t,e){if(1&t&&(Mo(0,"tr",25),Mo(1,"td",26),Mo(2,"div",27),Mo(3,"div"),Mo(4,"small"),Mo(5,"b"),va(6,"Provider Response"),Io(),Io(),Io(),Mo(7,"div"),Mo(8,"pre",28),Mo(9,"small"),va(10),Io(),Io(),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(10),ya(t.provider_response)}}function qP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",19),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.purchasesRowsOpen[n]=!i.purchasesRowsOpen[n]}),Do(3,zP,1,0,"div",20),Do(4,WP,1,0,"div",21),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Io(),Do(14,GP,11,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.purchasesRowsOpen[t]),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t]),Qr(1),ba(" ",n.product_id," "),Qr(2),ya(n.transaction_id),Qr(2),ya(i.getStoreText(n.store)),Qr(2),ya(n.purchase_time),Qr(2),ya(n.create_time),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t])}}function KP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No purchases were found."),Io(),Io())}let XP=(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.purchases=[],this.purchasesRowsOpen=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.purchases=t[0].validated_purchases,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listPurchases("",this.userID,this.limit,t).subscribe(t=>{this.purchases=t.validated_purchases,this.purchasesRowsOpen=[],this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-purchases"]],decls:29,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"open-row"],["colspan","7"],[1,"p-2"],[1,"pre-wrap","m-0","p-0"],["colspan","5",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,jP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Create Time"),Io(),Io(),Io(),Mo(26,"tbody"),Do(27,qP,15,8,"ng-template",14),Do(28,KP,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.purchases.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(17),Fo("ngForOf",e.purchases),Qr(1),Fo("ngIf",0===e.purchases.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),YP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listPurchases("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JP(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by type"),Io())}function QP(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeFilter)}}function ZP(t,e){if(1&t){const t=No();Mo(0,"button",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeFilter=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function tN(t,e){if(1&t&&(Mo(0,"h6"),va(1),Io()),2&t){const t=zo();Qr(1),ba("Showing results for chat room label: ",t.f1.label.value,"")}}const eN=function(t){return["/groups",t]};function nN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for group ID: "),Mo(2,"a",41),va(3),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(2,eN,t.route.snapshot.queryParamMap.get("group_id"))),Qr(1),ya(t.f2.group_id.value)}}const iN=function(t){return["/accounts",t]};function rN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for user IDs: "),Mo(2,"a",41),va(3),Io(),va(4,", "),Mo(5,"a",41),va(6),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(4,iN,t.route.snapshot.queryParamMap.get("user_id_one"))),Qr(1),ya(t.f3.user_id_one.value),Qr(2),Fo("routerLink",Vl(6,iN,t.route.snapshot.queryParamMap.get("user_id_two"))),Qr(1),ya(t.f3.user_id_two.value)}}function sN(t,e){if(1&t&&(Mo(0,"ngb-alert",42),$o(1,"img",43),Mo(2,"h6",44),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying messages: ",t.error,"")}}function oN(t,e){1&t&&(Mo(0,"th",45),va(1,"Remove"),Io())}function aN(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",46),va(2,"No messages found."),Io(),Io()),2&t){const t=zo();Qr(1),ko("colspan",t.deleteAllowed()?6:5)}}function lN(t,e){1&t&&$o(0,"div",55)}function cN(t,e){1&t&&$o(0,"div",56)}function hN(t,e){1&t&&$o(0,"td")}function uN(t,e){if(1&t){const t=No();Mo(0,"td",57),Mo(1,"button",58),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteMessage(e,i,r)}),va(2,"Delete"),Io(),Io()}}function dN(t,e){if(1&t&&(Mo(0,"tr",59),Mo(1,"td"),va(2),Io(),Io()),2&t){const t=zo().$implicit,e=zo();Qr(1),ko("colspan",e.deleteAllowed()?6:5),Qr(1),ba(" ",t.content," ")}}function pN(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",47),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",48),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",49),Mo(8,"div",50),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.messageStatesOpen[n]=!i.messageStatesOpen[n]}),Do(9,lN,1,0,"div",51),Do(10,cN,1,0,"div",52),Io(),va(11),Io(),Mo(12,"td"),va(13),Io(),Do(14,hN,1,0,"td",3),Do(15,uN,3,0,"td",53),Io(),Do(16,dN,3,2,"tr",54)}if(2&t){const t=e.$implicit,n=e.index,i=zo();Qr(2),ya(t.code),Qr(2),ya(t.sender_id),Qr(2),ya(t.username),Qr(3),Fo("ngIf",!i.messageStatesOpen[n]),Qr(1),Fo("ngIf",i.messageStatesOpen[n]),Qr(1),ba(" ",t.content," "),Qr(2),ya(t.create_time),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id===i.systemUserId),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id!==i.systemUserId),Qr(1),Fo("ngIf",i.messageStatesOpen[n])}}function fN(t,e){if(1&t&&(Mo(0,"ngb-alert",60),$o(1,"img",43),Mo(2,"h6",44),va(3,"Failed to delete data."),Io(),Mo(4,"p",61),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.deleteError)}}function gN(t,e){if(1&t){const t=No();Mo(0,"ngb-alert",62),Vo("close",function(){return Ie(t),zo().deleteSuccess=!1}),$o(1,"img",63),Mo(2,"h6",44),va(3),Io(),Io()}if(2&t){const t=zo();Fo("dismissible",!0),Qr(3),wa("",t.total_deleted," messages ",t.total_deleted>0?"successfully":""," deleted.")}}const mN=function(t){return{"is-invalid":t}};function vN(t,e){if(1&t&&(Mo(0,"div",64),Mo(1,"h5",65),va(2,"Delete messages"),Io(),Mo(3,"button",66),Vo("click",function(){return e.$implicit.dismiss()}),Mo(4,"span",67),va(5,"\xd7"),Io(),Io(),Io(),Mo(6,"div",68),Mo(7,"div",69),Mo(8,"form",70),Mo(9,"div",71),Mo(10,"p"),Mo(11,"b"),va(12,"Choose how many days to retain: "),Io(),$o(13,"input",72),Io(),Io(),$o(14,"input",73),Io(),Io(),Io(),Mo(15,"div",74),Mo(16,"button",75),Vo("click",function(){return e.$implicit.dismiss()}),va(17,"Cancel"),Io(),Mo(18,"button",76),Vo("click",function(){return e.$implicit.close()}),va(19,"DELETE"),Io(),Io()),2&t){const t=zo();Qr(8),Fo("formGroup",t.confirmDeleteForm),Qr(6),Fo("ngClass",Vl(3,mN,t.f.delete.touched&&t.f.delete.invalid)),Qr(4),Fo("disabled",t.f.delete.invalid)}}function yN(t,e){if(1&t){const t=No();Mo(0,"button",76),Vo("click",function(){Ie(t);const e=zo(),n=To(68);return e.openDeleteDataModal(n)}),va(1,"Delete messages"),Io()}2&t&&Fo("disabled",zo().deleting)}let bN=(()=>{class t{constructor(t,e,n,i,r,s){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.modalService=s,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.messages=[],this.nextCursor="",this.deleteError="",this.deleteSuccess=!1,this.deleting=!1,this.total_deleted=0,this.activeFilter="",this.filters=["Chat Room","Group Chat","Direct Chat"],this.messageStatesOpen=[],this.searchForm1=this.formBuilder.group({label:""}),this.searchForm2=this.formBuilder.group({group_id:""}),this.searchForm3=this.formBuilder.group({user_id_one:"",user_id_two:""}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])],days:30})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.label.setValue(t.get("label")),this.f2.group_id.setValue(t.get("group_id")),this.f3.user_id_one.setValue(t.get("user_id_one")),this.f3.user_id_two.setValue(t.get("user_id_two")),this.nextCursor=t.get("cursor");let e=t.get("type");this.type=Number(e),this.route.data.subscribe(t=>{t&&(t[0]&&(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t[0].messages),this.nextCursor=t[0].next_cursor),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=2,this.activeFilter=this.filters[0]):2==this.type||3==this.type||4==this.type?this.activeFilter=this.filters[this.type-2]:this.error="Invalid type."}search(t){let e="";switch(t){case 0:e="";break;case 1:e=this.nextCursor}this.updateMessages(this.type,this.f1.label.value,this.f2.group_id.value,this.f3.user_id_one.value,this.f3.user_id_two.value,e)}updateMessages(t,e,n,i,r,s){switch(t){case 2:this.consoleService.listChannelMessages("",t.toString(),e,null,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 3:this.consoleService.listChannelMessages("",t.toString(),null,n,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 4:this.consoleService.listChannelMessages("",t.toString(),null,null,i,r,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t})}}postData(t,e){let n;switch(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t.messages),this.nextCursor=t.next_cursor,this.type){case 2:n={type:this.type,label:this.f1.label.value,cursor:e};break;case 3:n={type:this.type,group_id:this.f2.group_id.value,cursor:e};break;case 4:n={type:this.type,user_id_one:this.f3.user_id_one.value,user_id_two:this.f3.user_id_two.value,cursor:e}}this.router.navigate([],{relativeTo:this.route,queryParams:n})}deleteMessage(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteChannelMessages("",null,[n.message_id]).subscribe(()=>{this.error="",this.messageStatesOpen.splice(e,1),this.messages.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteMessagesAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}get f(){return this.confirmDeleteForm.controls}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}deleteData(){this.deleteError="",this.deleting=!0;let t=new Date;t.setDate(t.getDate()-this.f.days.value),this.consoleService.deleteChannelMessages("",t.toISOString(),null).subscribe(t=>{this.total_deleted=Number(t.total),this.deleting=!1,this.deleteError="",this.deleteSuccess=!0;const e=this.route.snapshot.queryParamMap;let n=e.get("type"),i=e.get("label");i||(i="0");let r=e.get("group_id"),s=e.get("user_id_one"),o=e.get("user_id_two"),a=e.get("cursor");a||(a=""),n&&this.updateMessages(Number(n),i,r,s,o,a)},t=>{this.deleting=!1,this.deleteError=t})}viewAccount(t){this.router.navigate(["/accounts",t.sender_id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b),Ro(a_))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:70,vars:21,consts:[[1,"pb-1"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup"],[1,"input-group"],["type","text","formControlName","label","placeholder","Search by chat room label",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],["type","text","formControlName","group_id","placeholder","Search by group ID",1,"form-control","border-right-0"],["type","text","formControlName","user_id_one","placeholder","Search by user ID 1",1,"form-control","border-right-0"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","text","formControlName","user_id_two","placeholder","Search by user ID 2",1,"form-control","border-right-0"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered",2,"table-layout","fixed"],[1,"thead-light"],[2,"width","60px"],[2,"width","320px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",3,"dismissible",4,"ngIf"],["type","success",3,"dismissible","close",4,"ngIf"],["role","alert",1,"d-flex","justify-content-between","align-items-center"],["confirmDelete",""],["type","button","class","btn btn-danger",3,"disabled","click",4,"ngIf"],["type","button","ngbDropdownItem","",3,"click"],[2,"width","100%",3,"routerLink"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[1,"text-muted"],[3,"click"],[2,"text-overflow","ellipsis","overflow","hidden",3,"click"],[2,"white-space","nowrap","text-overflow","ellipsis","overflow","hidden"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],[1,"open-row"],["type","danger",3,"dismissible"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],["autocomplete","off",3,"formGroup"],[1,"mt-2"],["type","number","value","30","min","0","formControlName","days",2,"width","80px"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-danger",3,"disabled","click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Chat Messages"),Io(),Mo(2,"div",1),Mo(3,"button",2),Do(4,JP,2,0,"span",3),Do(5,QP,2,1,"span",3),Io(),Mo(6,"div",4),Do(7,ZP,2,1,"button",5),Io(),Io(),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"form",9),Mo(12,"div",10),$o(13,"input",11),Mo(14,"div",12),Mo(15,"div",13),Mo(16,"button",14),Vo("click",function(){return e.type=2,e.search(0)}),va(17,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(18,"form",9),Mo(19,"div",10),$o(20,"input",15),Mo(21,"div",12),Mo(22,"div",13),Mo(23,"button",14),Vo("click",function(){return e.type=3,e.search(0)}),va(24,"Search "),Io(),Io(),Io(),Io(),Io(),Mo(25,"form",9),Mo(26,"div",10),$o(27,"input",16),Mo(28,"div",12),Mo(29,"span",17),Vo("click",function(){return e.f3.user_id_one.setValue(e.systemUserId)}),$o(30,"img",18),Io(),Io(),$o(31,"input",19),Mo(32,"div",12),Mo(33,"div",13),Mo(34,"button",14),Vo("click",function(){return e.type=4,e.search(0)}),va(35,"Search "),Io(),Io(),Io(),Io(),Io(),Io(),Mo(36,"div",20),Mo(37,"div",21),Mo(38,"button",22),Vo("click",function(){return e.search(0)}),$o(39,"img",23),Io(),Mo(40,"button",22),Vo("click",function(){return e.search(1)}),$o(41,"img",24),Io(),Io(),Io(),Io(),Io(),Do(42,tN,2,1,"h6",3),Do(43,nN,4,4,"h6",3),Do(44,rN,7,8,"h6",3),Do(45,sN,4,2,"ngb-alert",25),Mo(46,"div",26),Mo(47,"table",27),Mo(48,"thead",28),Mo(49,"tr"),Mo(50,"th",29),va(51,"Code"),Io(),Mo(52,"th",30),va(53,"Sender ID"),Io(),Mo(54,"th",31),va(55,"Username"),Io(),Mo(56,"th"),va(57,"Content"),Io(),Mo(58,"th",32),va(59,"Create Time"),Io(),Do(60,oN,2,0,"th",33),Io(),Io(),Mo(61,"tbody"),Do(62,aN,3,1,"tr",3),Do(63,pN,17,10,"ng-template",34),Io(),Io(),Io(),Do(64,fN,6,2,"ngb-alert",35),Do(65,gN,4,3,"ngb-alert",36),Mo(66,"div",37),Do(67,vN,20,5,"ng-template",null,38,dc),Do(69,yN,2,1,"button",39),Io()),2&t&&(Qr(4),Fo("ngIf",!e.activeFilter||""===e.activeFilter),Qr(1),Fo("ngIf",e.activeFilter&&""!==e.activeFilter),Qr(2),Fo("ngForOf",e.filters),Qr(4),Fo("hidden","Chat Room"!==e.activeFilter)("formGroup",e.searchForm1),Qr(7),Fo("hidden","Group Chat"!==e.activeFilter)("formGroup",e.searchForm2),Qr(7),Fo("hidden","Direct Chat"!==e.activeFilter)("formGroup",e.searchForm3),Qr(13),Fo("disabled",0===e.messages.length),Qr(2),Fo("disabled",""===e.nextCursor||null===e.nextCursor),Qr(2),Fo("ngIf",0!=e.messages.length&&""===e.error&&2==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&3==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&4==e.type),Qr(1),Fo("ngIf",e.error),Qr(15),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.messages.length),Qr(1),Fo("ngForOf",e.messages),Qr(1),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(4),Fo("ngIf",e.deleteMessagesAllowed()))},directives:[Kx,qx,Bh,Wx,Ph,pb,Ry,mb,ay,Ty,yb,zx,Mv,_x,Ly,$h],styles:[".input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.open-row[_ngcontent-%COMP%]{background:#fafafc}"]}),t})(),wN=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));switch(n){case 2:return this.consoleService.listChannelMessages("",n.toString(),t.queryParamMap.get("label"),null,null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 3:return this.consoleService.listChannelMessages("",n.toString(),null,t.queryParamMap.get("group_id"),null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 4:return this.consoleService.listChannelMessages("",n.toString(),null,null,t.queryParamMap.get("user_id_one"),t.queryParamMap.get("user_id_two"),encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));default:return ff(null)}}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function xN(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function _N(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),va(6),Io(),Mo(7,"td"),va(8),Io(),Mo(9,"td"),va(10),Io(),Mo(11,"td"),va(12),Io(),Io()),2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.product_id),Qr(2),ya(t.original_transaction_id),Qr(2),ya(n.getStoreText(t.store)),Qr(2),ya(t.purchase_time),Qr(2),ya(t.expiry_time),Qr(2),ya(t.create_time)}}function CN(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",19),va(2,"No purchases were found."),Io(),Io())}const SN=[{path:"",component:j_,canActivate:[_w],canActivateChild:[z_],children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",component:tM,resolve:[eM]},{path:"config",component:IM,resolve:[$M]},{path:"users",component:VM,resolve:[HM]},{path:"modules",component:rI,resolve:[sI]},{path:"storage",component:fI,resolve:[gI,mI],pathMatch:"full"},{path:"storage/:collection/:key/:user_id",component:TI,resolve:[RI],pathMatch:"full"},{path:"leaderboards",component:UI,resolve:[VI]},{path:"leaderboards/:id",component:wP,resolve:[xP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:EP,resolve:[]},{path:"records",component:IP,resolve:[$P]}]},{path:"matches",component:XO,resolve:[YO,QO]},{path:"groups",component:sP,resolve:[oP]},{path:"groups/:id",component:pP,resolve:[fP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:cO,resolve:[]},{path:"members",component:TO,resolve:[RO],runGuardsAndResolvers:"always"}]},{path:"accounts",component:KI,resolve:[XI]},{path:"accounts/:id",component:l$,resolve:[c$],children:[{path:"",redirectTo:"profile",pathMatch:"full"},{path:"profile",component:g$,resolve:[]},{path:"authentication",component:w$,resolve:[]},{path:"wallet",component:L$,resolve:[M$]},{path:"friends",component:j$,resolve:[z$]},{path:"groups",component:eO,resolve:[nO]},{path:"purchases",component:XP,resolve:[YP]},{path:"subscriptions",component:(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.subscriptions=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.subscriptions=t[0].validated_subscriptions,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listSubscriptions("",this.userID,this.limit,t).subscribe(t=>{this.subscriptions=t.validated_subscriptions,this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-subscriptions"]],decls:31,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["colspan","6",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,xN,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Original Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Expiry Time"),Io(),Mo(26,"th",13),va(27,"Create Time"),Io(),Io(),Io(),Mo(28,"tbody"),Do(29,_N,13,6,"ng-template",14),Do(30,CN,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.subscriptions.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(19),Fo("ngForOf",e.subscriptions),Qr(1),Fo("ngIf",0===e.subscriptions.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),resolve:[(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listSubscriptions("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()]}]},{path:"apiexplorer",component:VP,resolve:[HP]},{path:"chat",component:bN,resolve:[wN]}]},{path:"login",component:ww,canActivate:[xw]},{path:"**",redirectTo:""}];let EN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[Gv.forRoot(SN,{useHash:!0})],Gv]}),t})(),kN=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:[Ov],styles:[""]}),t})();RegExp(/[&<>"']/g.source);const AN={Tab:9,Enter:13,Esc:27,Space:32,ArrowUp:38,ArrowDown:40,Backspace:8};AN[AN.Tab]="Tab",AN[AN.Enter]="Enter",AN[AN.Esc]="Esc",AN[AN.Space]="Space",AN[AN.ArrowUp]="ArrowUp",AN[AN.ArrowDown]="ArrowDown",AN[AN.Backspace]="Backspace";const DN=new Yn("ng-select-selection-model");class TN{constructor(){this._selected=[]}get value(){return this._selected}select(t,e,n){if(t.selected=!0,(!t.children||!e&&n)&&this._selected.push(t),e)if(t.parent){const e=t.parent.children.length,n=t.parent.children.filter(t=>t.selected).length;t.parent.selected=e===n}else t.children&&(this._setChildrenSelectedState(t.children,!0),this._removeChildren(t),this._selected=n&&this._activeChildren(t)?[...this._selected.filter(e=>e.parent!==t),t]:[...this._selected,...t.children.filter(t=>!t.disabled)])}unselect(t,e){if(this._selected=this._selected.filter(e=>e!==t),t.selected=!1,e)if(t.parent&&t.parent.selected){const e=t.parent.children;this._removeParent(t.parent),this._removeChildren(t.parent),this._selected.push(...e.filter(e=>e!==t&&!e.disabled)),t.parent.selected=!1}else t.children&&(this._setChildrenSelectedState(t.children,!1),this._removeChildren(t))}clear(t){this._selected=t?this._selected.filter(t=>t.disabled):[]}_setChildrenSelectedState(t,e){for(const n of t)n.disabled||(n.selected=e)}_removeChildren(t){this._selected=[...this._selected.filter(e=>e.parent!==t),...t.children.filter(e=>e.parent===t&&e.disabled&&e.selected)]}_removeParent(t){this._selected=this._selected.filter(e=>e!==t)}_activeChildren(t){return t.children.every(t=>!t.disabled||t.selected)}}const RN=function(){return new TN};let FN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:DN,useValue:RN}],imports:[[qh]]}),t})(),LN=(()=>{class t{constructor(t){this.authenticationService=t}intercept(t,e){const n=this.authenticationService.currentSessionValue;return n&&n.token&&(t=t.clone({setHeaders:{Authorization:"Bearer "+n.token}})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),MN=(()=>{class t{constructor(t,e){this.authenticationService=t,this.router=e}intercept(t,e){return e.handle(t).pipe(Yf(e=>(401===e.status?this.authenticationService.logout().subscribe({next:()=>{t.url.includes("/v3/auth")||this.router.navigate(["/login"],{queryParams:{next:this.router.routerState.snapshot.url}})}}):e.status>=500&&console.log(`${e.status}: + ${e.error.message||e.statusText}`),nx(e.error.message||e.statusText))))}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),IN=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:[kN]}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[fw,I_,{provide:uw,useValue:{host:document.location.origin,timeout:15e3}},{provide:Xb,useClass:LN,multi:!0},{provide:Xb,useClass:MN,multi:!0}],imports:[[fM,EN,ku,df,lw,M_,LL,Rb.forRoot({apiKey:"dHl7FTjJ9icepBjEdOCcyMFQYL1BBiQO",debug:!1,loadOnInitialization:!0}),pf,Sb,Cb,FN]]}),t})();(function(){if(qc)throw new Error("Cannot enable prod mode after platform setup.");Gc=!1})(),Su().bootstrapModule(IN).then(t=>{window.ngRef&&window.ngRef.destroy(),window.ngRef=t}).catch(t=>console.error(t))},zn8P:function(t,e){function n(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+U4B":function(t,e,n){var i;i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=t,n.c=e,n.p="",n(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),s=n(8),o=n(15);function a(t,e,n){var o=null,a=function(t,e){n&&n(t,e),o&&o.visit(t,e)},l="function"==typeof n?a:null,c=!1;if(e){var h="boolean"==typeof e.attachComment&&e.attachComment;((c="boolean"==typeof e.comment&&e.comment)||h)&&((o=new i.CommentHandler).attach=h,e.comment=!0,l=a)}var u,d=!1;e&&"string"==typeof e.sourceType&&(d="module"===e.sourceType),u=e&&"boolean"==typeof e.jsx&&e.jsx?new r.JSXParser(t,e,l):new s.Parser(t,e,l);var p=d?u.parseModule():u.parseScript();return c&&o&&(p.comments=o.comments),u.config.tokens&&(p.tokens=u.tokens),u.config.tolerant&&(p.errors=u.errorHandler.errors),p}e.parse=a,e.parseModule=function(t,e,n){var i=e||{};return i.sourceType="module",a(t,i,n)},e.parseScript=function(t,e,n){var i=e||{};return i.sourceType="script",a(t,i,n)},e.tokenize=function(t,e,n){var i,r=new o.Tokenizer(t,e);i=[];try{for(;;){var s=r.getNextToken();if(!s)break;n&&(s=n(s)),i.push(s)}}catch(a){r.errorHandler.tolerate(a)}return r.errorHandler.tolerant&&(i.errors=r.errors()),i};var l=n(2);e.Syntax=l.Syntax,e.version="4.0.1"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r=function(){function t(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return t.prototype.insertInnerComments=function(t,e){if(t.type===i.Syntax.BlockStatement&&0===t.body.length){for(var n=[],r=this.leading.length-1;r>=0;--r){var s=this.leading[r];e.end.offset>=s.start&&(n.unshift(s.comment),this.leading.splice(r,1),this.trailing.splice(r,1))}n.length&&(t.innerComments=n)}},t.prototype.findTrailingComments=function(t){var e=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var i=this.trailing[n];i.start>=t.end.offset&&e.unshift(i.comment)}return this.trailing.length=0,e}var r=this.stack[this.stack.length-1];if(r&&r.node.trailingComments){var s=r.node.trailingComments[0];s&&s.range[0]>=t.end.offset&&(e=r.node.trailingComments,delete r.node.trailingComments)}return e},t.prototype.findLeadingComments=function(t){for(var e,n=[];this.stack.length>0&&(s=this.stack[this.stack.length-1])&&s.start>=t.start.offset;)e=s.node,this.stack.pop();if(e){for(var i=(e.leadingComments?e.leadingComments.length:0)-1;i>=0;--i){var r=e.leadingComments[i];r.range[1]<=t.start.offset&&(n.unshift(r),e.leadingComments.splice(i,1))}return e.leadingComments&&0===e.leadingComments.length&&delete e.leadingComments,n}for(i=this.leading.length-1;i>=0;--i){var s;(s=this.leading[i]).start<=t.start.offset&&(n.unshift(s.comment),this.leading.splice(i,1))}return n},t.prototype.visitNode=function(t,e){if(!(t.type===i.Syntax.Program&&t.body.length>0)){this.insertInnerComments(t,e);var n=this.findTrailingComments(e),r=this.findLeadingComments(e);r.length>0&&(t.leadingComments=r),n.length>0&&(t.trailingComments=n),this.stack.push({node:t,start:e.start.offset})}},t.prototype.visitComment=function(t,e){var n="L"===t.type[0]?"Line":"Block",i={type:n,value:t.value};if(t.range&&(i.range=t.range),t.loc&&(i.loc=t.loc),this.comments.push(i),this.attach){var r={comment:{type:n,value:t.value,range:[e.start.offset,e.end.offset]},start:e.start.offset};t.loc&&(r.comment.loc=t.loc),t.type=n,this.leading.push(r),this.trailing.push(r)}},t.prototype.visit=function(t,e){"LineComment"===t.type||"BlockComment"===t.type?this.visitComment(t,e):this.attach&&this.visitNode(t,e)},t}();e.CommentHandler=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=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])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=n(4),o=n(5),a=n(6),l=n(7),c=n(8),h=n(13),u=n(14);function d(t){var e;switch(t.type){case a.JSXSyntax.JSXIdentifier:e=t.name;break;case a.JSXSyntax.JSXNamespacedName:var n=t;e=d(n.namespace)+":"+d(n.name);break;case a.JSXSyntax.JSXMemberExpression:var i=t;e=d(i.object)+"."+d(i.property)}return e}h.TokenName[100]="JSXIdentifier",h.TokenName[101]="JSXText";var p=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return r(e,t),e.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},e.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},e.prototype.finishJSX=function(){this.nextToken()},e.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},e.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.scanXHTMLEntity=function(t){for(var e="&",n=!0,i=!1,r=!1,o=!1;!this.scanner.eof()&&n&&!i;){var a=this.scanner.source[this.scanner.index];if(a===t)break;if(i=";"===a,e+=a,++this.scanner.index,!i)switch(e.length){case 2:r="#"===a;break;case 3:r&&(n=(o="x"===a)||s.Character.isDecimalDigit(a.charCodeAt(0)),r=r&&!o);break;default:n=(n=n&&!(r&&!s.Character.isDecimalDigit(a.charCodeAt(0))))&&!(o&&!s.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&i&&e.length>2){var l=e.substr(1,e.length-2);r&&l.length>1?e=String.fromCharCode(parseInt(l.substr(1),10)):o&&l.length>2?e=String.fromCharCode(parseInt("0"+l.substr(1),16)):r||o||!u.XHTMLEntities[l]||(e=u.XHTMLEntities[l])}return e},e.prototype.lexJSX=function(){var t=this.scanner.source.charCodeAt(this.scanner.index);if(60===t||62===t||47===t||58===t||61===t||123===t||125===t)return{type:7,value:r=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===t||39===t){for(var e=this.scanner.index,n=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==n;)i+="&"===l?this.scanXHTMLEntity(n):l;return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(46===t){var r,o=this.scanner.source.charCodeAt(this.scanner.index+1),a=this.scanner.source.charCodeAt(this.scanner.index+2);return e=this.scanner.index,this.scanner.index+=(r=46===o&&46===a?"...":".").length,{type:7,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}if(96===t)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(t)&&92!==t){for(e=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(e,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index}}return this.scanner.lex()},e.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var t=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(t)),t},e.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var t=this.scanner.index,e="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,e+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var i={type:101,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index};return e.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(i)),i},e.prototype.peekJSXToken=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.lexJSX();return this.scanner.restoreState(t),e},e.prototype.expectJSX=function(t){var e=this.nextJSXToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},e.prototype.matchJSX=function(t){var e=this.peekJSXToken();return 7===e.type&&e.value===t},e.prototype.parseJSXIdentifier=function(){var t=this.createJSXNode(),e=this.nextJSXToken();return 100!==e.type&&this.throwUnexpectedToken(e),this.finalize(t,new o.JSXIdentifier(e.value))},e.prototype.parseJSXElementName=function(){var t=this.createJSXNode(),e=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=e;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(n,i))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var r=e;this.expectJSX(".");var s=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXMemberExpression(r,s))}return e},e.prototype.parseJSXAttributeName=function(){var t,e=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var i=n;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(i,r))}else t=n;return t},e.prototype.parseJSXStringLiteralAttribute=function(){var t=this.createJSXNode(),e=this.nextJSXToken();8!==e.type&&this.throwUnexpectedToken(e);var n=this.getTokenRaw(e);return this.finalize(t,new l.Literal(e.value,n))},e.prototype.parseJSXExpressionAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXExpressionContainer(e))},e.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},e.prototype.parseJSXNameValueAttribute=function(){var t=this.createJSXNode(),e=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(t,new o.JSXAttribute(e,n))},e.prototype.parseJSXSpreadAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new o.JSXSpreadAttribute(e))},e.prototype.parseJSXAttributes=function(){for(var t=[];!this.matchJSX("/")&&!this.matchJSX(">");){var e=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();t.push(e)}return t},e.prototype.parseJSXOpeningElement=function(){var t=this.createJSXNode();this.expectJSX("<");var e=this.parseJSXElementName(),n=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(e,i,n))},e.prototype.parseJSXBoundaryElement=function(){var t=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var e=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(t,new o.JSXClosingElement(e))}var n=this.parseJSXElementName(),i=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new o.JSXOpeningElement(n,r,i))},e.prototype.parseJSXEmptyExpression=function(){var t=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(t,new o.JSXEmptyExpression)},e.prototype.parseJSXExpressionContainer=function(){var t,e=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new o.JSXExpressionContainer(t))},e.prototype.parseJSXChildren=function(){for(var t=[];!this.scanner.eof();){var e=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;s=this.finalize(t.node,new o.JSXElement(t.opening,t.children,t.closing)),(t=e[e.length-1]).children.push(s),e.pop()}}return t},e.prototype.parseJSXElement=function(){var t=this.createJSXNode(),e=this.parseJSXOpeningElement(),n=[],i=null;if(!e.selfClosing){var r=this.parseComplexJSXElement({node:t,opening:e,closing:i,children:n});n=r.children,i=r.closing}return this.finalize(t,new o.JSXElement(e,n,i))},e.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var t=this.parseJSXElement();return this.finishJSX(),t},e.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},e}(c.Parser);e.JSXParser=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(t){return t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&n.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(t))},isIdentifierPart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&n.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(t))},isDecimalDigit:function(t){return t>=48&&t<=57},isHexDigit:function(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102},isOctalDigit:function(t){return t>=48&&t<=55}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6);e.JSXClosingElement=function(t){this.type=i.JSXSyntax.JSXClosingElement,this.name=t},e.JSXElement=function(t,e,n){this.type=i.JSXSyntax.JSXElement,this.openingElement=t,this.children=e,this.closingElement=n},e.JSXEmptyExpression=function(){this.type=i.JSXSyntax.JSXEmptyExpression},e.JSXExpressionContainer=function(t){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=t},e.JSXIdentifier=function(t){this.type=i.JSXSyntax.JSXIdentifier,this.name=t},e.JSXMemberExpression=function(t,e){this.type=i.JSXSyntax.JSXMemberExpression,this.object=t,this.property=e},e.JSXAttribute=function(t,e){this.type=i.JSXSyntax.JSXAttribute,this.name=t,this.value=e},e.JSXNamespacedName=function(t,e){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=t,this.name=e},e.JSXOpeningElement=function(t,e,n){this.type=i.JSXSyntax.JSXOpeningElement,this.name=t,this.selfClosing=e,this.attributes=n},e.JSXSpreadAttribute=function(t){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=t},e.JSXText=function(t,e){this.type=i.JSXSyntax.JSXText,this.value=t,this.raw=e}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);e.ArrayExpression=function(t){this.type=i.Syntax.ArrayExpression,this.elements=t},e.ArrayPattern=function(t){this.type=i.Syntax.ArrayPattern,this.elements=t},e.ArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!1},e.AssignmentExpression=function(t,e,n){this.type=i.Syntax.AssignmentExpression,this.operator=t,this.left=e,this.right=n},e.AssignmentPattern=function(t,e){this.type=i.Syntax.AssignmentPattern,this.left=t,this.right=e},e.AsyncArrowFunctionExpression=function(t,e,n){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!0},e.AsyncFunctionDeclaration=function(t,e,n){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AsyncFunctionExpression=function(t,e,n){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0},e.AwaitExpression=function(t){this.type=i.Syntax.AwaitExpression,this.argument=t},e.BinaryExpression=function(t,e,n){this.type="||"===t||"&&"===t?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=t,this.left=e,this.right=n},e.BlockStatement=function(t){this.type=i.Syntax.BlockStatement,this.body=t},e.BreakStatement=function(t){this.type=i.Syntax.BreakStatement,this.label=t},e.CallExpression=function(t,e){this.type=i.Syntax.CallExpression,this.callee=t,this.arguments=e},e.CatchClause=function(t,e){this.type=i.Syntax.CatchClause,this.param=t,this.body=e},e.ClassBody=function(t){this.type=i.Syntax.ClassBody,this.body=t},e.ClassDeclaration=function(t,e,n){this.type=i.Syntax.ClassDeclaration,this.id=t,this.superClass=e,this.body=n},e.ClassExpression=function(t,e,n){this.type=i.Syntax.ClassExpression,this.id=t,this.superClass=e,this.body=n},e.ComputedMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=t,this.property=e},e.ConditionalExpression=function(t,e,n){this.type=i.Syntax.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n},e.ContinueStatement=function(t){this.type=i.Syntax.ContinueStatement,this.label=t},e.DebuggerStatement=function(){this.type=i.Syntax.DebuggerStatement},e.Directive=function(t,e){this.type=i.Syntax.ExpressionStatement,this.expression=t,this.directive=e},e.DoWhileStatement=function(t,e){this.type=i.Syntax.DoWhileStatement,this.body=t,this.test=e},e.EmptyStatement=function(){this.type=i.Syntax.EmptyStatement},e.ExportAllDeclaration=function(t){this.type=i.Syntax.ExportAllDeclaration,this.source=t},e.ExportDefaultDeclaration=function(t){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=t},e.ExportNamedDeclaration=function(t,e,n){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=t,this.specifiers=e,this.source=n},e.ExportSpecifier=function(t,e){this.type=i.Syntax.ExportSpecifier,this.exported=e,this.local=t},e.ExpressionStatement=function(t){this.type=i.Syntax.ExpressionStatement,this.expression=t},e.ForInStatement=function(t,e,n){this.type=i.Syntax.ForInStatement,this.left=t,this.right=e,this.body=n,this.each=!1},e.ForOfStatement=function(t,e,n){this.type=i.Syntax.ForOfStatement,this.left=t,this.right=e,this.body=n},e.ForStatement=function(t,e,n,r){this.type=i.Syntax.ForStatement,this.init=t,this.test=e,this.update=n,this.body=r},e.FunctionDeclaration=function(t,e,n,r){this.type=i.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.FunctionExpression=function(t,e,n,r){this.type=i.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=r,this.expression=!1,this.async=!1},e.Identifier=function(t){this.type=i.Syntax.Identifier,this.name=t},e.IfStatement=function(t,e,n){this.type=i.Syntax.IfStatement,this.test=t,this.consequent=e,this.alternate=n},e.ImportDeclaration=function(t,e){this.type=i.Syntax.ImportDeclaration,this.specifiers=t,this.source=e},e.ImportDefaultSpecifier=function(t){this.type=i.Syntax.ImportDefaultSpecifier,this.local=t},e.ImportNamespaceSpecifier=function(t){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=t},e.ImportSpecifier=function(t,e){this.type=i.Syntax.ImportSpecifier,this.local=t,this.imported=e},e.LabeledStatement=function(t,e){this.type=i.Syntax.LabeledStatement,this.label=t,this.body=e},e.Literal=function(t,e){this.type=i.Syntax.Literal,this.value=t,this.raw=e},e.MetaProperty=function(t,e){this.type=i.Syntax.MetaProperty,this.meta=t,this.property=e},e.MethodDefinition=function(t,e,n,r,s){this.type=i.Syntax.MethodDefinition,this.key=t,this.computed=e,this.value=n,this.kind=r,this.static=s},e.Module=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="module"},e.NewExpression=function(t,e){this.type=i.Syntax.NewExpression,this.callee=t,this.arguments=e},e.ObjectExpression=function(t){this.type=i.Syntax.ObjectExpression,this.properties=t},e.ObjectPattern=function(t){this.type=i.Syntax.ObjectPattern,this.properties=t},e.Property=function(t,e,n,r,s,o){this.type=i.Syntax.Property,this.key=e,this.computed=n,this.value=r,this.kind=t,this.method=s,this.shorthand=o},e.RegexLiteral=function(t,e,n,r){this.type=i.Syntax.Literal,this.value=t,this.raw=e,this.regex={pattern:n,flags:r}},e.RestElement=function(t){this.type=i.Syntax.RestElement,this.argument=t},e.ReturnStatement=function(t){this.type=i.Syntax.ReturnStatement,this.argument=t},e.Script=function(t){this.type=i.Syntax.Program,this.body=t,this.sourceType="script"},e.SequenceExpression=function(t){this.type=i.Syntax.SequenceExpression,this.expressions=t},e.SpreadElement=function(t){this.type=i.Syntax.SpreadElement,this.argument=t},e.StaticMemberExpression=function(t,e){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=t,this.property=e},e.Super=function(){this.type=i.Syntax.Super},e.SwitchCase=function(t,e){this.type=i.Syntax.SwitchCase,this.test=t,this.consequent=e},e.SwitchStatement=function(t,e){this.type=i.Syntax.SwitchStatement,this.discriminant=t,this.cases=e},e.TaggedTemplateExpression=function(t,e){this.type=i.Syntax.TaggedTemplateExpression,this.tag=t,this.quasi=e},e.TemplateElement=function(t,e){this.type=i.Syntax.TemplateElement,this.value=t,this.tail=e},e.TemplateLiteral=function(t,e){this.type=i.Syntax.TemplateLiteral,this.quasis=t,this.expressions=e},e.ThisExpression=function(){this.type=i.Syntax.ThisExpression},e.ThrowStatement=function(t){this.type=i.Syntax.ThrowStatement,this.argument=t},e.TryStatement=function(t,e,n){this.type=i.Syntax.TryStatement,this.block=t,this.handler=e,this.finalizer=n},e.UnaryExpression=function(t,e){this.type=i.Syntax.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0},e.UpdateExpression=function(t,e,n){this.type=i.Syntax.UpdateExpression,this.operator=t,this.argument=e,this.prefix=n},e.VariableDeclaration=function(t,e){this.type=i.Syntax.VariableDeclaration,this.declarations=t,this.kind=e},e.VariableDeclarator=function(t,e){this.type=i.Syntax.VariableDeclarator,this.id=t,this.init=e},e.WhileStatement=function(t,e){this.type=i.Syntax.WhileStatement,this.test=t,this.body=e},e.WithStatement=function(t,e){this.type=i.Syntax.WithStatement,this.object=t,this.body=e},e.YieldExpression=function(t,e){this.type=i.Syntax.YieldExpression,this.argument=t,this.delegate=e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(10),s=n(11),o=n(7),a=n(12),l=n(2),c=n(13),h="ArrowParameterPlaceHolder",u=function(){function t(t,e,n){void 0===e&&(e={}),this.config={range:"boolean"==typeof e.range&&e.range,loc:"boolean"==typeof e.loc&&e.loc,source:null,tokens:"boolean"==typeof e.tokens&&e.tokens,comment:"boolean"==typeof e.comment&&e.comment,tolerant:"boolean"==typeof e.tolerant&&e.tolerant},this.config.loc&&e.source&&null!==e.source&&(this.config.source=String(e.source)),this.delegate=n,this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return t.prototype.throwError=function(t){for(var e=[],n=1;n0&&this.delegate)for(var e=0;e>="===t||">>>="===t||"&="===t||"^="===t||"|="===t},t.prototype.isolateCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=e,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=i,r},t.prototype.inheritCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,i=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var r=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&e,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=i||this.context.firstCoverInitializedNameError,r},t.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},t.prototype.parsePrimaryExpression=function(){var t,e,n,i=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(i,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(e.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal("true"===e.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.Literal(null,n));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,e=this.nextRegexToken(),n=this.getTokenRaw(e),t=this.finalize(i,new o.RegexLiteral(e.regex,n,e.pattern,e.flags));break;default:t=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(i,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(i,new o.ThisExpression)):t=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken())}return t},t.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new o.SpreadElement(e))},t.prototype.parseArrayInitializer=function(){var t=this.createNode(),e=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),e.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),e.push(n)}else e.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new o.ArrayExpression(e))},t.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var e=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var i=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=e,this.context.allowStrictDirective=n,i},t.prototype.parsePropertyMethodFunction=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),e=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var i=this.parseFormalParameters(),r=this.parsePropertyMethod(i);return this.context.allowYield=e,this.context.await=n,this.finalize(t,new o.AsyncFunctionExpression(null,i.params,r))},t.prototype.parseObjectPropertyKey=function(){var t,e=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,s.Messages.StrictOctalLiteral);var i=this.getTokenRaw(n);t=this.finalize(e,new o.Literal(n.value,i));break;case 3:case 1:case 5:case 4:t=this.finalize(e,new o.Identifier(n.value));break;case 7:"["===n.value?(t=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):t=this.throwUnexpectedToken(n);break;default:t=this.throwUnexpectedToken(n)}return t},t.prototype.isPropertyKey=function(t,e){return t.type===l.Syntax.Identifier&&t.name===e||t.type===l.Syntax.Literal&&t.value===e},t.prototype.parseObjectProperty=function(t){var e,n=this.createNode(),i=this.lookahead,r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(3===i.type){var d=i.value;this.nextToken(),l=this.match("["),r=(u=!(this.hasLineTerminator||"async"!==d||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(d))}else this.match("*")?this.nextToken():(l=this.match("["),r=this.parseObjectPropertyKey());var p=this.qualifiedPropertyName(this.lookahead);if(3===i.type&&!u&&"get"===i.value&&p)e="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===i.type&&!u&&"set"===i.value&&p)e="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===i.type&&"*"===i.value&&p)e="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(r||this.throwUnexpectedToken(this.lookahead),e="init",this.match(":")&&!u)!l&&this.isPropertyKey(r,"__proto__")&&(t.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===i.type)if(d=this.finalize(n,new o.Identifier(i.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),h=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new o.AssignmentPattern(d,f))}else h=!0,a=d;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(e,r,l,a,c,h))},t.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var e=[],n={value:!1};!this.match("}");)e.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new o.ObjectExpression(e))},t.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var t=this.createNode(),e=this.nextToken();return this.finalize(t,new o.TemplateElement({raw:e.value,cooked:e.cooked},e.tail))},t.prototype.parseTemplateLiteral=function(){var t=this.createNode(),e=[],n=[],i=this.parseTemplateHead();for(n.push(i);!i.tail;)e.push(this.parseExpression()),i=this.parseTemplateElement(),n.push(i);return this.finalize(t,new o.TemplateLiteral(n,e))},t.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:t.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case l.Syntax.ArrayExpression:t.type=l.Syntax.ArrayPattern;for(var e=0;e")||this.expect("=>"),t={type:h,params:[],async:!1};else{var e=this.lookahead,n=[];if(this.match("..."))t=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:h,params:[t],async:!1};else{var i=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var r=[];for(this.context.isAssignmentTarget=!1,r.push(t);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s")||this.expect("=>"),this.context.isBindingElement=!1,s=0;s")&&(t.type===l.Syntax.Identifier&&"yield"===t.name&&(i=!0,t={type:h,params:[t],async:!1}),!i)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===l.Syntax.SequenceExpression)for(s=0;s")){for(var l=0;l0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var r=[t,this.lookahead],s=e,a=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[s,n.value,a],c=[i];!((i=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&i<=c[c.length-1];){a=l.pop();var h=l.pop();c.pop(),s=l.pop(),r.pop();var u=this.startNode(r[r.length-1]);l.push(this.finalize(u,new o.BinaryExpression(h,s,a)))}l.push(this.nextToken().value),c.push(i),r.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var d=l.length-1;e=l[d];for(var p=r.pop();d>1;){var f=r.pop();u=this.startNode(f,p&&p.lineStart),e=this.finalize(u,new o.BinaryExpression(h=l[d-1],l[d-2],e)),d-=2,p=f}}return e},t.prototype.parseConditionalExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var r=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.ConditionalExpression(e,i,r)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return e},t.prototype.checkPatternParam=function(t,e){switch(e.type){case l.Syntax.Identifier:this.validateParam(t,e,e.name);break;case l.Syntax.RestElement:this.checkPatternParam(t,e.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(t,e.left);break;case l.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=t.async,a=this.reinterpretAsCoverFormalsList(t);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,u=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var d=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=r;var f=this.startNode(e);this.expect("=>");var g=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,g=this.parseFunctionSourceElements(),this.context.allowIn=m}else g=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=g.type!==l.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),t=this.finalize(f,r?new o.AsyncArrowFunctionExpression(a.params,g,v):new o.ArrowFunctionExpression(a.params,g,v)),this.context.strict=c,this.context.allowStrictDirective=u,this.context.allowYield=d,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===l.Syntax.Identifier){var y=t;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var b=(n=this.nextToken()).value,w=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.AssignmentExpression(b,t,w)),this.context.firstCoverInitializedNameError=null}}return t},t.prototype.parseExpression=function(){var t=this.lookahead,e=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(e);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(t),new o.SequenceExpression(n))}return e},t.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement()}else t=this.parseStatement();return t},t.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseStatementListItem());return this.expect("}"),this.finalize(t,new o.BlockStatement(e))},t.prototype.parseLexicalBinding=function(t,e){var n=this.createNode(),i=this.parsePattern([],t);this.context.strict&&i.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return"const"===t?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!e.inFor&&i.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),r=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(i,r))},t.prototype.parseBindingList=function(t,e){for(var n=[this.parseLexicalBinding(t,e)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(t,e));return n},t.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.scanner.lex();return this.scanner.restoreState(t),3===e.type||7===e.type&&"["===e.value||7===e.type&&"{"===e.value||4===e.type&&"let"===e.value||4===e.type&&"yield"===e.value},t.prototype.parseLexicalDeclaration=function(t){var e=this.createNode(),n=this.nextToken().value;i.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var r=this.parseBindingList(n,t);return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(r,n))},t.prototype.parseBindingRestElement=function(t,e){var n=this.createNode();this.expect("...");var i=this.parsePattern(t,e);return this.finalize(n,new o.RestElement(i))},t.prototype.parseArrayPattern=function(t,e){var n=this.createNode();this.expect("[");for(var i=[];!this.match("]");)if(this.match(","))this.nextToken(),i.push(null);else{if(this.match("...")){i.push(this.parseBindingRestElement(t,e));break}i.push(this.parsePatternWithDefault(t,e)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(i))},t.prototype.parsePropertyPattern=function(t,e){var n,i,r=this.createNode(),s=!1,a=!1;if(3===this.lookahead.type){var l=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(r,new o.Identifier(l.value));if(this.match("=")){t.push(l),a=!0,this.nextToken();var h=this.parseAssignmentExpression();i=this.finalize(this.startNode(l),new o.AssignmentPattern(c,h))}else this.match(":")?(this.expect(":"),i=this.parsePatternWithDefault(t,e)):(t.push(l),a=!0,i=c)}else s=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),i=this.parsePatternWithDefault(t,e);return this.finalize(r,new o.Property("init",n,s,i,!1,a))},t.prototype.parseObjectPattern=function(t,e){var n=this.createNode(),i=[];for(this.expect("{");!this.match("}");)i.push(this.parsePropertyPattern(t,e)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(i))},t.prototype.parsePattern=function(t,e){var n;return this.match("[")?n=this.parseArrayPattern(t,e):this.match("{")?n=this.parseObjectPattern(t,e):(!this.matchKeyword("let")||"const"!==e&&"let"!==e||this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),t.push(this.lookahead),n=this.parseVariableIdentifier(e)),n},t.prototype.parsePatternWithDefault=function(t,e){var n=this.lookahead,i=this.parsePattern(t,e);if(this.match("=")){this.nextToken();var r=this.context.allowYield;this.context.allowYield=!0;var s=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=r,i=this.finalize(this.startNode(n),new o.AssignmentPattern(i,s))}return i},t.prototype.parseVariableIdentifier=function(t){var e=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==t)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(e,new o.Identifier(n.value))},t.prototype.parseVariableDeclaration=function(t){var e=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===l.Syntax.Identifier||t.inFor||this.expect("="),this.finalize(e,new o.VariableDeclarator(n,i))},t.prototype.parseVariableDeclarationList=function(t){var e={inFor:t.inFor},n=[];for(n.push(this.parseVariableDeclaration(e));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(e));return n},t.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var e=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(e,"var"))},t.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new o.EmptyStatement)},t.prototype.parseExpressionStatement=function(){var t=this.createNode(),e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ExpressionStatement(e))},t.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},t.prototype.parseIfStatement=function(){var t,e=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(e,new o.IfStatement(i,t,n))},t.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var e=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=e,this.expectKeyword("while"),this.expect("(");var i=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new o.DoWhileStatement(n,i))},t.prototype.parseWhileStatement=function(){var t,e=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var i=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=i}return this.finalize(e,new o.WhileStatement(n,t))},t.prototype.parseForStatement=function(){var t,e,n,i=null,r=null,a=null,c=!0,h=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){i=this.createNode(),this.nextToken();var u=this.context.allowIn;this.context.allowIn=!1;var d=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=u,1===d.length&&this.matchKeyword("in")){var p=d[0];p.init&&(p.id.type===l.Syntax.ArrayPattern||p.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseExpression(),i=null}else 1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(i=this.finalize(i,new o.VariableDeclaration(d,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){i=this.createNode();var f=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(u=this.context.allowIn,this.context.allowIn=!1,d=this.parseBindingList(f,{inFor:!0}),this.context.allowIn=u,1===d.length&&null===d[0].init&&this.matchKeyword("in")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseExpression(),i=null):1===d.length&&null===d[0].init&&this.matchContextualKeyword("of")?(i=this.finalize(i,new o.VariableDeclaration(d,f)),this.nextToken(),t=i,e=this.parseAssignmentExpression(),i=null,c=!1):(this.consumeSemicolon(),i=this.finalize(i,new o.VariableDeclaration(d,f)))):(i=this.finalize(i,new o.Identifier(f)),this.nextToken(),t=i,e=this.parseExpression(),i=null)}else{var g=this.lookahead;if(u=this.context.allowIn,this.context.allowIn=!1,i=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=u,this.matchKeyword("in"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseExpression(),i=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&i.type!==l.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(i),t=i,e=this.parseAssignmentExpression(),i=null,c=!1;else{if(this.match(",")){for(var m=[i];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));i=this.finalize(this.startNode(g),new o.SequenceExpression(m))}this.expect(";")}}if(void 0===t&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return this.finalize(h,void 0===t?new o.ForStatement(i,r,a,n):c?new o.ForInStatement(t,e,n):new o.ForOfStatement(t,e,n))},t.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();e=n,Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(t,new o.ContinueStatement(e))},t.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();Object.prototype.hasOwnProperty.call(this.context.labelSet,"$"+n.name)||this.throwError(s.Messages.UnknownLabel,n.name),e=n}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(t,new o.BreakStatement(e))},t.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var e=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ReturnStatement(e))},t.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var t,e=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new o.WithStatement(n,t))},t.prototype.parseSwitchCase=function(){var t,e=this.createNode();this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(e,new o.SwitchCase(t,n))},t.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var e=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var i=[],r=!1;for(this.expect("{");!this.match("}");){var a=this.parseSwitchCase();null===a.test&&(r&&this.throwError(s.Messages.MultipleDefaultsInSwitch),r=!0),i.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(t,new o.SwitchStatement(e,i))},t.prototype.parseLabelledStatement=function(){var t,e=this.createNode(),n=this.parseExpression();if(n.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var i=n,r="$"+i.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)&&this.throwError(s.Messages.Redeclaration,"Label",i.name),this.context.labelSet[r]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,h=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):h.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),a=h}else a=this.parseStatement();delete this.context.labelSet[r],t=new o.LabeledStatement(i,a)}else this.consumeSemicolon(),t=new o.ExpressionStatement(n);return this.finalize(e,t)},t.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new o.ThrowStatement(e))},t.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var e=[],n=this.parsePattern(e),i={},r=0;r0&&this.tolerateError(s.Messages.BadGetterArity);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseSetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(s.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter);var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!1))},t.prototype.parseGeneratorMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var i=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new o.FunctionExpression(null,n.params,i,!0))},t.prototype.isStartOfExpression=function(){var t=!0,e=this.lookahead.value;switch(this.lookahead.type){case 7:t="["===e||"("===e||"{"===e||"+"===e||"-"===e||"!"===e||"~"===e||"++"===e||"--"===e||"/"===e||"/="===e;break;case 4:t="class"===e||"delete"===e||"function"===e||"let"===e||"new"===e||"super"===e||"this"===e||"typeof"===e||"void"===e||"yield"===e}return t},t.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var e=null,n=!1;if(!this.hasLineTerminator){var i=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),e=this.parseAssignmentExpression()):this.isStartOfExpression()&&(e=this.parseAssignmentExpression()),this.context.allowYield=i}return this.finalize(t,new o.YieldExpression(e,n))},t.prototype.parseClassElement=function(t){var e=this.lookahead,n=this.createNode(),i="",r=null,a=null,l=!1,c=!1,h=!1,u=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(r=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(e=this.lookahead,h=!0,l=this.match("["),this.match("*")?this.nextToken():r=this.parseObjectPropertyKey()),3===e.type&&!this.hasLineTerminator&&"async"===e.value){var d=this.lookahead.value;":"!==d&&"("!==d&&"*"!==d&&(u=!0,e=this.lookahead,r=this.parseObjectPropertyKey(),3===e.type&&"constructor"===e.value&&this.tolerateUnexpectedToken(e,s.Messages.ConstructorIsAsync))}var p=this.qualifiedPropertyName(this.lookahead);return 3===e.type?"get"===e.value&&p?(i="get",l=this.match("["),r=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===e.value&&p&&(i="set",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===e.type&&"*"===e.value&&p&&(i="init",l=this.match("["),r=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!i&&r&&this.match("(")&&(i="init",a=u?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),i||this.throwUnexpectedToken(this.lookahead),"init"===i&&(i="method"),l||(h&&this.isPropertyKey(r,"prototype")&&this.throwUnexpectedToken(e,s.Messages.StaticPrototype),!h&&this.isPropertyKey(r,"constructor")&&(("method"!==i||!c||a&&a.generator)&&this.throwUnexpectedToken(e,s.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(e,s.Messages.DuplicateConstructor):t.value=!0,i="constructor")),this.finalize(n,new o.MethodDefinition(r,l,a,i,h))},t.prototype.parseClassElementList=function(){var t=[],e={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(e));return this.expect("}"),t},t.prototype.parseClassBody=function(){var t=this.createNode(),e=this.parseClassElementList();return this.finalize(t,new o.ClassBody(e))},t.prototype.parseClassDeclaration=function(t){var e=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var i=t&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var s=this.parseClassBody();return this.context.strict=n,this.finalize(e,new o.ClassDeclaration(i,r,s))},t.prototype.parseClassExpression=function(){var t=this.createNode(),e=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var r=this.parseClassBody();return this.context.strict=e,this.finalize(t,new o.ClassExpression(n,i,r))},t.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Module(e))},t.prototype.parseScript=function(){for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new o.Script(e))},t.prototype.parseModuleSpecifier=function(){var t=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var e=this.nextToken(),n=this.getTokenRaw(e);return this.finalize(t,new o.Literal(e.value,n))},t.prototype.parseImportSpecifier=function(){var t,e,n=this.createNode();return 3===this.lookahead.type?(e=t=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),e=this.parseVariableIdentifier())):(e=t=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),e=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(e,t))},t.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},t.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName();return this.finalize(t,new o.ImportDefaultSpecifier(e))},t.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var e=this.parseIdentifierName();return this.finalize(t,new o.ImportNamespaceSpecifier(e))},t.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var t,e=this.createNode();this.expectKeyword("import");var n=[];return 8===this.lookahead.type||(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken()),t=this.parseModuleSpecifier(),this.consumeSemicolon(),this.finalize(e,new o.ImportDeclaration(n,t))},t.prototype.parseExportSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName(),n=e;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(t,new o.ExportSpecifier(e,n))},t.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var t,e=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),t=this.finalize(e,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),t=this.finalize(e,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){this.nextToken(),this.matchContextualKeyword("from")||this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value),this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),t=this.finalize(e,new o.ExportNamedDeclaration(n,[],null));else{var r=[],a=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),r.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),a=this.parseModuleSpecifier(),this.consumeSemicolon()):l?this.throwError(this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.lookahead.value):this.consumeSemicolon(),t=this.finalize(e,new o.ExportNamedDeclaration(null,r,a))}return t},t}();e.Parser=u},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assert=function(t,e){if(!t)throw new Error("ASSERT: "+e)}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.errors=[],this.tolerant=!1}return t.prototype.recordError=function(t){this.errors.push(t)},t.prototype.tolerate=function(t){if(!this.tolerant)throw t;this.recordError(t)},t.prototype.constructError=function(t,e){var n=new Error(t);try{throw n}catch(i){Object.create&&Object.defineProperty&&(n=Object.create(i),Object.defineProperty(n,"column",{value:e}))}return n},t.prototype.createError=function(t,e,n,i){var r=this.constructError("Line "+e+": "+i,n);return r.index=t,r.lineNumber=e,r.description=i,r},t.prototype.throwError=function(t,e,n,i){throw this.createError(t,e,n,i)},t.prototype.tolerateError=function(t,e,n,i){var r=this.createError(t,e,n,i);if(!this.tolerant)throw r;this.recordError(r)},t}();e.ErrorHandler=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),r=n(4),s=n(11);function o(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function a(t){return"01234567".indexOf(t)}var l=function(){function t(t,e){this.source=t,this.errorHandler=e,this.trackComment=!1,this.isModule=!1,this.length=t.length,this.index=0,this.lineNumber=t.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return t.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},t.prototype.restoreState=function(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart},t.prototype.eof=function(){return this.index>=this.length},t.prototype.throwUnexpectedToken=function(t){return void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.tolerateUnexpectedToken=function(t){void 0===t&&(t=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.skipSingleLineComment=function(t){var e,n,i=[];for(this.trackComment&&(i=[],e=this.index-t,n={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,r.Character.isLineTerminator(s))return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart-1},i.push({multiLine:!1,slice:[e+t,this.index-1],range:[e,this.index-1],loc:n})),13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},i.push({multiLine:!1,slice:[e+t,this.index],range:[e,this.index],loc:n})),i},t.prototype.skipMultiLineComment=function(){var t,e,n=[];for(this.trackComment&&(n=[],t=this.index-2,e={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(r.Character.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1))return this.index+=2,this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:e})),n;++this.index}else++this.index}return this.trackComment&&(e.end={line:this.lineNumber,column:this.index-this.lineStart},n.push({multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:e})),this.tolerateUnexpectedToken(),n},t.prototype.scanComments=function(){var t;this.trackComment&&(t=[]);for(var e=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(r.Character.isWhiteSpace(n))++this.index;else if(r.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,e=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var i=this.skipSingleLineComment(2);this.trackComment&&(t=t.concat(i)),e=!0}else{if(42!==n)break;this.index+=2,i=this.skipMultiLineComment(),this.trackComment&&(t=t.concat(i))}else if(e&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,i=this.skipSingleLineComment(3),this.trackComment&&(t=t.concat(i))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,i=this.skipSingleLineComment(4),this.trackComment&&(t=t.concat(i))}}return t},t.prototype.isFutureReservedWord=function(t){switch(t){case"enum":case"export":case"import":case"super":return!0;default:return!1}},t.prototype.isStrictModeReservedWord=function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},t.prototype.isRestrictedWord=function(t){return"eval"===t||"arguments"===t},t.prototype.isKeyword=function(t){switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}},t.prototype.codePointAt=function(t){var e=this.source.charCodeAt(t);if(e>=55296&&e<=56319){var n=this.source.charCodeAt(t+1);n>=56320&&n<=57343&&(e=1024*(e-55296)+n-56320+65536)}return e},t.prototype.scanHexEscape=function(t){for(var e="u"===t?4:2,n=0,i=0;i1114111||"}"!==t)&&this.throwUnexpectedToken(),r.Character.fromCodePoint(e)},t.prototype.getIdentifier=function(){for(var t=this.index++;!this.eof();){var e=this.source.charCodeAt(this.index);if(92===e)return this.index=t,this.getComplexIdentifier();if(e>=55296&&e<57343)return this.index=t,this.getComplexIdentifier();if(!r.Character.isIdentifierPart(e))break;++this.index}return this.source.slice(t,this.index)},t.prototype.getComplexIdentifier=function(){var t,e=this.codePointAt(this.index),n=r.Character.fromCodePoint(e);for(this.index+=n.length,92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierStart(t.charCodeAt(0))||this.throwUnexpectedToken(),n=t);!this.eof()&&(e=this.codePointAt(this.index),r.Character.isIdentifierPart(e));)n+=t=r.Character.fromCodePoint(e),this.index+=t.length,92===e&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,t=this.scanUnicodeCodePointEscape()):null!==(t=this.scanHexEscape("u"))&&"\\"!==t&&r.Character.isIdentifierPart(t.charCodeAt(0))||this.throwUnexpectedToken(),n+=t);return n},t.prototype.octalToDecimal=function(t){var e="0"!==t,n=a(t);return!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(e=!0,n=8*n+a(this.source[this.index++]),"0123".indexOf(t)>=0&&!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:e}},t.prototype.scanIdentifier=function(){var t,e=this.index,n=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier();if(3!=(t=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&e+n.length!==this.index){var i=this.index;this.index=e,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=i}return{type:t,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var t=this.index,e=this.source[this.index];switch(e){case"(":case"{":"{"===e&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,e="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(e=this.source.substr(this.index,4))?this.index+=4:"==="===(e=e.substr(0,3))||"!=="===e||">>>"===e||"<<="===e||">>="===e||"**="===e?this.index+=3:"&&"===(e=e.substr(0,2))||"||"===e||"=="===e||"!="===e||"+="===e||"-="===e||"*="===e||"/="===e||"++"===e||"--"===e||"<<"===e||">>"===e||"&="===e||"|="===e||"^="===e||"%="===e||"<="===e||">="===e||"=>"===e||"**"===e?this.index+=2:"<>=!+-*%&|^/".indexOf(e=this.source[this.index])>=0&&++this.index}return this.index===t&&this.throwUnexpectedToken(),{type:7,value:e,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanHexLiteral=function(t){for(var e="";!this.eof()&&r.Character.isHexDigit(this.source.charCodeAt(this.index));)e+=this.source[this.index++];return 0===e.length&&this.throwUnexpectedToken(),r.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+e,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanBinaryLiteral=function(t){for(var e,n="";!this.eof()&&("0"===(e=this.source[this.index])||"1"===e);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(e=this.source.charCodeAt(this.index),(r.Character.isIdentifierStart(e)||r.Character.isDecimalDigit(e))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanOctalLiteral=function(t,e){var n="",i=!1;for(r.Character.isOctalDigit(t.charCodeAt(0))?(i=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&r.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return i||0!==n.length||this.throwUnexpectedToken(),(r.Character.isIdentifierStart(this.source.charCodeAt(this.index))||r.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var t=this.index+1;t=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(t,e,n){var r=parseInt(e||n,16);return r>1114111&&i.throwUnexpectedToken(s.Messages.InvalidRegExp),r<=65535?String.fromCharCode(r):"\uffff"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"\uffff"));try{RegExp(n)}catch(r){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(t,e)}catch(o){return null}},t.prototype.scanRegExpBody=function(){var t=this.source[this.index];i.assert("/"===t,"Regular expression literal must start with a slash");for(var e=this.source[this.index++],n=!1,o=!1;!this.eof();)if(e+=t=this.source[this.index++],"\\"===t)t=this.source[this.index++],r.Character.isLineTerminator(t.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e+=t;else if(r.Character.isLineTerminator(t.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===t&&(n=!1);else{if("/"===t){o=!0;break}"["===t&&(n=!0)}return o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),e.substr(1,e.length-2)},t.prototype.scanRegExpFlags=function(){for(var t="";!this.eof();){var e=this.source[this.index];if(!r.Character.isIdentifierPart(e.charCodeAt(0)))break;if(++this.index,"\\"!==e||this.eof())t+=e;else if("u"===(e=this.source[this.index])){++this.index;var n=this.index,i=this.scanHexEscape("u");if(null!==i)for(t+=i;n=55296&&t<57343&&r.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t}();e.Scanner=l},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",times:"\xd7",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",divide:"\xf7",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",frasl:"\u2044",euro:"\u20ac",image:"\u2111",weierp:"\u2118",real:"\u211c",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lArr:"\u21d0",uArr:"\u21d1",rArr:"\u21d2",dArr:"\u21d3",hArr:"\u21d4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27e8",rang:"\u27e9"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),r=n(12),s=n(13),o=function(){function t(){this.values=[],this.curly=this.paren=-1}return t.prototype.beforeFunctionExpression=function(t){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)>=0},t.prototype.isRegexStart=function(){var t=this.values[this.values.length-1],e=null!==t;switch(t){case"this":case"]":e=!1;break;case")":var n=this.values[this.paren-1];e="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(e=!1,"function"===this.values[this.curly-3])e=!!(i=this.values[this.curly-4])&&!this.beforeFunctionExpression(i);else if("function"===this.values[this.curly-4]){var i;e=!(i=this.values[this.curly-5])||!this.beforeFunctionExpression(i)}}return e},t.prototype.push=function(t){7===t.type||4===t.type?("{"===t.value?this.curly=this.values.length:"("===t.value&&(this.paren=this.values.length),this.values.push(t.value)):this.values.push(null)},t}(),a=function(){function t(t,e){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=!!e&&"boolean"==typeof e.tolerant&&e.tolerant,this.scanner=new r.Scanner(t,this.errorHandler),this.scanner.trackComment=!!e&&"boolean"==typeof e.comment&&e.comment,this.trackRange=!!e&&"boolean"==typeof e.range&&e.range,this.trackLoc=!!e&&"boolean"==typeof e.loc&&e.loc,this.buffer=[],this.reader=new o}return t.prototype.errors=function(){return this.errorHandler.errors},t.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var e=0;e>10),56320+(t-65536&1023))}for(var _=new Array(256),C=new Array(256),S=0;S<256;S++)_[S]=w(S)?1:0,C[S]=w(S);function E(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||a,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function k(t,e){return new r(e,new s(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function A(t,e){throw k(t,e)}function D(t,e){t.onWarning&&t.onWarning.call(null,k(t,e))}var T={YAML:function(t,e,n){var i,r,s;null!==t.version&&A(t,"duplication of %YAML directive"),1!==n.length&&A(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&A(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&A(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&D(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&A(t,"TAG directive accepts exactly two arguments"),r=n[1],d.test(i=n[0])||A(t,"ill-formed tag handle (first argument) of the TAG directive"),l.call(t.tagMap,i)&&A(t,'there is a previously declared suffix for "'+i+'" tag handle'),p.test(r)||A(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=r}};function R(t,e,n,i){var r,s,o,a;if(e1&&(t.result+=i.repeat("\n",e-1))}function P(t,e){var n,i,r=t.tag,s=t.anchor,o=[],a=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),i=t.input.charCodeAt(t.position);0!==i&&45===i&&v(t.input.charCodeAt(t.position+1));)if(a=!0,t.position++,I(t,!0,-1)&&t.lineIndent<=e)o.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,U(t,e,3,!1,!0),o.push(t.result),I(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)A(t,"bad indentation of a sequence entry");else if(t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente?w=1:t.lineIndent===e?w=0:t.lineIndente)&&(U(t,e,4,!0,r)&&(g?p=t.result:f=t.result),g||(L(t,h,u,d,p,f,s,o),d=p=f=null),I(t,!0,-1),a=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==a)A(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===s?A(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):h?A(t,"repeat of an indentation width identifier"):(u=e+s-1,h=!0)}if(m(o)){do{o=t.input.charCodeAt(++t.position)}while(m(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!g(o)&&0!==o)}for(;0!==o;){for(M(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!h||t.lineIndentu&&(u=t.lineIndent),g(o))d++;else{if(t.lineIndent0){for(r=o,s=0;r>0;r--)(o=b(a=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+o:A(t,"expected hexadecimal character");t.result+=x(s),t.position++}else A(t,"unknown escape sequence");n=i=t.position}else g(a)?(R(t,n,i,!0),O(t,I(t,!1,e)),n=i=t.position):t.position===t.lineStart&&$(t)?A(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}A(t,"unexpected end of the stream within a double quoted scalar")}(t,p)?E=!0:function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!v(i)&&!y(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&A(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||A(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],I(t,!0,-1),!0}(t)?(E=!0,null===t.tag&&null===t.anchor||A(t,"alias node should not have any properties")):function(t,e,n){var i,r,s,o,a,l,c,h,u=t.kind,d=t.result;if(v(h=t.input.charCodeAt(t.position))||y(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(v(i=t.input.charCodeAt(t.position+1))||n&&y(i)))return!1;for(t.kind="scalar",t.result="",r=s=t.position,o=!1;0!==h;){if(58===h){if(v(i=t.input.charCodeAt(t.position+1))||n&&y(i))break}else if(35===h){if(v(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&$(t)||n&&y(h))break;if(g(h)){if(a=t.line,l=t.lineStart,c=t.lineIndent,I(t,!1,-1),t.lineIndent>=e){o=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=a,t.lineStart=l,t.lineIndent=c;break}}o&&(R(t,r,s,!1),O(t,t.line-a),r=s=t.position,o=!1),m(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return R(t,r,s,!1),!!t.result||(t.kind=u,t.result=d,!1)}(t,p,1===n)&&(E=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===w&&(E=c&&P(t,f))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&A(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),h=0,u=t.implicitTypes.length;h tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result)?(t.result=d.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):A(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):A(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||E}function V(t){var e,n,i,r,s=t.position,o=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(r=t.input.charCodeAt(t.position))&&(I(t,!0,-1),r=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==r));){for(o=!0,r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);for(i=[],(n=t.input.slice(e,t.position)).length<1&&A(t,"directive name must not be less than one character in length");0!==r;){for(;m(r);)r=t.input.charCodeAt(++t.position);if(35===r){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&!g(r));break}if(g(r))break;for(e=t.position;0!==r&&!v(r);)r=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==r&&M(t),l.call(T,n)?T[n](t,n,i):D(t,'unknown document directive "'+n+'"')}I(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,I(t,!0,-1)):o&&A(t,"directives end mark is expected"),U(t,t.lineIndent-1,4,!1,!0),I(t,!0,-1),t.checkLineBreaks&&h.test(t.input.slice(s,t.position))&&D(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&$(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,I(t,!0,-1)):t.position0?o-4:o;for(n=0;n>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[h++]=255&e),1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,s=[],o=16383,a=0,l=n-r;al?l:a+o));return 1===r?s.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&s.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function h(t,e,n){for(var r,s=[],o=e;o>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},HUeH:function(t,e,n){"use strict";var i=n("ClZL"),r=n("XP29");function s(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n("hyoZ"),t.exports.Schema=n("3lC6"),t.exports.FAILSAFE_SCHEMA=n("2YgE"),t.exports.JSON_SCHEMA=n("+VNs"),t.exports.CORE_SCHEMA=n("RSjF"),t.exports.DEFAULT_SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_FULL_SCHEMA=n("VtPO"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=r.dump,t.exports.safeDump=r.safeDump,t.exports.YAMLException=n("w+qe"),t.exports.MINIMAL_SCHEMA=n("2YgE"),t.exports.SAFE_SCHEMA=n("Z3Ei"),t.exports.DEFAULT_SCHEMA=n("VtPO"),t.exports.scan=s("scan"),t.exports.parse=s("parse"),t.exports.compose=s("compose"),t.exports.addConstructor=s("addConstructor")},Iab2:function(t,e,n){var i,r;void 0===(r="function"==typeof(i=function(){"use strict";function e(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){o(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function n(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,s=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(t,s,o){var a=r.URL||r.webkitURL,l=document.createElement("a");l.download=s=s||t.name||"download",l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?i(l):n(l.href)?e(t,s,o):i(l,l.target="_blank")):(l.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){i(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,r,s){if(r=r||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,s),r);else if(n(t))e(t,r,s);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){i(o)})}}:function(t,n,i,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,i);var a="application/octet-stream"===t.type,l=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var h=new FileReader;h.onloadend=function(){var t=h.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},h.readAsDataURL(t)}else{var u=r.URL||r.webkitURL,d=u.createObjectURL(t);o?o.location=d:location.href=d,o=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});r.saveAs=o.saveAs=o,t.exports=o})?i.apply(e,[]):i)||(t.exports=r)},LFvy:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},Ljib:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},MERt:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},Njqi:function(t,e,n){"use strict";var i;try{i=n("+U4B")}catch(s){"undefined"!=typeof window&&(i=window.esprima)}var r=n("hyoZ");t.exports=new r("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e=i.parse("("+t+")",{range:!0});return"Program"===e.type&&1===e.body.length&&"ExpressionStatement"===e.body[0].type&&("ArrowFunctionExpression"===e.body[0].expression.type||"FunctionExpression"===e.body[0].expression.type)}catch(n){return!1}},construct:function(t){var e,n="("+t+")",r=i.parse(n,{range:!0}),s=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"ArrowFunctionExpression"!==r.body[0].expression.type&&"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(t){s.push(t.name)}),e=r.body[0].expression.body.range,new Function(s,"BlockStatement"===r.body[0].expression.body.type?n.slice(e[0]+1,e[1]-1):"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},Pe6h:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ"),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!s.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,i,r;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){r.unshift(parseFloat(t,10))}),e=0,i=1,r.forEach(function(t){e+=t*i,i*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||i.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(t))return"-0.0";return n=t.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},RSjF:function(t,e,n){"use strict";var i=n("3lC6");t.exports=new i({include:[n("+VNs")]})},UQ3f:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),i="";if("/"===e[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==e[e.length-i.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),i="";return"/"===e[0]&&(n&&(i=n[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},VtPO:function(t,e,n){"use strict";var i=n("3lC6");t.exports=i.DEFAULT=new i({include:[n("Z3Ei")],explicit:[n("MERt"),n("UQ3f"),n("Njqi")]})},XP29:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("w+qe"),s=n("VtPO"),o=n("Z3Ei"),a=Object.prototype.toString,l=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},h=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function u(t){var e,n,s;if(e=t.toString(16).toUpperCase(),t<=255)n="x",s=2;else if(t<=65535)n="u",s=4;else{if(!(t<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+i.repeat("0",s-e.length)+e}function d(t){this.schema=t.schema||s,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=i.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,i,r,s,o,a,c;if(null===e)return{};for(n={},r=0,s=(i=Object.keys(e)).length;r0?e.charCodeAt(o-1):null,f=f&&v(a,l)}else{for(o=0;or&&" "!==e[p+1],p=o);else if(!m(a))return 5;l=o>0?e.charCodeAt(o-1):null,f=f&&v(a,l)}u=u||d&&o-p-1>r&&" "!==e[p+1]}return h||u?i>9&&y(e)?5:u?4:3:f&&!function(e){return function(t,e){var n,i;for(n=0,i=t.implicitTypes.length;n-1&&n>=t.flowLevel,t.indent,o)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+w(e,t.indent)+x(p(e,s));case 4:return">"+w(e,t.indent)+x(p(function(t,e){for(var n,i,r,s=/(\n+)([^\n]*)/g,o=(r=t.indexOf("\n"),s.lastIndex=r=-1!==r?r:t.length,_(t.slice(0,r),e)),a="\n"===t[0]||" "===t[0];i=s.exec(t);){var l=i[2];n=" "===l[0],o+=i[1]+(a||n||""===l?"":"\n")+_(l,e),a=n}return o}(e,o),s));case 5:return'"'+function(t){for(var e,n,i,r="",s=0;s=55296&&e<=56319&&(n=t.charCodeAt(s+1))>=56320&&n<=57343?(r+=u(1024*(e-55296)+n-56320+65536),s++):r+=!(i=c[e])&&m(e)?t[s]:i||u(e);return r}(e)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function w(t,e){var n=y(t)?String(e):"",i="\n"===t[t.length-1];return n+(!i||"\n"!==t[t.length-2]&&"\n"!==t?i?"":"-":"+")+"\n"}function x(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function _(t,e){if(""===t||" "===t[0])return t;for(var n,i,r=/ [^ ]/g,s=0,o=0,a=0,l="";n=r.exec(t);)(a=n.index)-s>e&&(l+="\n"+t.slice(s,i=o>s?o:a),s=i+1),o=a;return l+="\n",(l+=t.length-s>e&&o>s?t.slice(s,o)+"\n"+t.slice(o+1):t.slice(s)).slice(1)}function C(t,e,n){var i,s,o,c,h,u;for(o=0,c=(s=n?t.explicitTypes:t.implicitTypes).length;o tag resolver accepts not "'+u+'" style');i=h.represent[u](e,u)}t.dump=i}return!0}return!1}function S(t,e,n,i,s,o){t.tag=null,t.dump=n,C(t,n,!1)||C(t,n,!0);var l=a.call(t.dump);i&&(i=t.flowLevel<0||t.flowLevel>e);var c,h,u="[object Object]"===l||"[object Array]"===l;if(u&&(h=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||h||2!==t.indent&&e>0)&&(s=!1),h&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(u&&h&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(function(t,e,n,i){var s,o,a,l,c,h,u="",d=t.tag,p=Object.keys(n);if(!0===t.sortKeys)p.sort();else if("function"==typeof t.sortKeys)p.sort(t.sortKeys);else if(t.sortKeys)throw new r("sortKeys must be a boolean or a function");for(s=0,o=p.length;s1024)&&(t.dump&&10===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,c&&(h+=f(t,e)),S(t,e+1,l,!0,c)&&(t.dump&&10===t.dump.charCodeAt(0)?h+=":":h+=": ",u+=h+=t.dump));t.tag=d,t.dump=u||"{}"}(t,e,t.dump,s),h&&(t.dump="&ref_"+c+t.dump)):(function(t,e,n){var i,r,s,o,a,l="",c=t.tag,h=Object.keys(n);for(i=0,r=h.length;i1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),S(t,e,o,!1,!1)&&(l+=a+=t.dump));t.tag=c,t.dump="{"+l+"}"}(t,e,t.dump),h&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===l){var d=t.noArrayIndent&&e>0?e-1:e;i&&0!==t.dump.length?(function(t,e,n,i){var r,s,o="",a=t.tag;for(r=0,s=n.length;r "+t.dump)}return!0}function E(t,e){var n,i,r=[],s=[];for(k(t,r,s),n=0,i=s.length;n=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=s.match(/ Gecko\/\d+/),e.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,e.isEdge=parseFloat(s.split(" Edge/")[1])||void 0,e.isAIR=s.indexOf("AdobeAIR")>=0,e.isAndroid=s.indexOf("Android")>=0,e.isChromeOS=s.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./useragent");if(e.buildDom=function t(e,n,i){if("string"==typeof e&&e){var r=document.createTextNode(e);return n&&n.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&n&&n.appendChild(e),e;if("string"!=typeof e[0]||!e[0]){for(var s=[],o=0;o=1.5,"undefined"!=typeof document){var r=document.createElement("div");e.HI_DPI&&void 0!==r.style.transform&&(e.HAS_CSS_TRANSFORMS=!0),i.isEdge||void 0===r.style.animationName||(e.HAS_CSS_ANIMATION=!0),r=null}e.translate=e.HAS_CSS_TRANSFORMS?function(t,e,n){t.style.transform="translate("+Math.round(e)+"px, "+Math.round(n)+"px)"}:function(t,e,n){t.style.top=Math.round(n)+"px",t.style.left=Math.round(e)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,e,n){"use strict";e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},e.implement=function(t,n){e.mixin(t,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./oop"),r=function(){var t,e,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(e in n.FUNCTION_KEYS)t=n.FUNCTION_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);for(e in n.PRINTABLE_KEYS)t=n.PRINTABLE_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)n.KEY_MODS[e]=t.filter(function(t){return e&n.KEY_MODS[t]}).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(e,r),e.keyCodeToString=function(t){var e=r[t];return"string"!=typeof e&&(e=String.fromCharCode(t)),e.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i,r=t("./keys"),s=t("./useragent"),o=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){i={passive:!1}}})}catch(t){}}(),i}function c(t,e,n){this.elem=t,this.type=e,this.callback=n}c.prototype.destroy=function(){u(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=e.addListener=function(t,e,n,i){t.addEventListener(e,n,l()),i&&i.$toDestroy.push(new c(t,e,n))},u=e.removeListener=function(t,e,n){t.removeEventListener(e,n,l())};e.stopEvent=function(t){return e.stopPropagation(t),e.preventDefault(t),!1},e.stopPropagation=function(t){t.stopPropagation&&t.stopPropagation()},e.preventDefault=function(t){t.preventDefault&&t.preventDefault()},e.getButton=function(t){return"dblclick"==t.type?0:"contextmenu"==t.type||s.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.button},e.capture=function(t,e,n){var i=t&&t.ownerDocument||document;function r(t){e&&e(t),n&&n(t),u(i,"mousemove",e),u(i,"mouseup",r),u(i,"dragstart",r)}return h(i,"mousemove",e),h(i,"mouseup",r),h(i,"dragstart",r),r},e.addMouseWheelListener=function(t,e,n){"onmousewheel"in t?h(t,"mousewheel",function(t){void 0!==t.wheelDeltaX?(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8):(t.wheelX=0,t.wheelY=-t.wheelDelta/8),e(t)},n):"onwheel"in t?h(t,"wheel",function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0)}e(t)},n):h(t,"DOMMouseScroll",function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),e(t)},n)},e.addMultiMouseDownListener=function(t,n,i,r,o){var a,l,c,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(t){if(0!==e.getButton(t)?u=0:t.detail>1?++u>4&&(u=1):u=1,s.isIE){var o=Math.abs(t.clientX-a)>5||Math.abs(t.clientY-l)>5;c&&!o||(u=1),c&&clearTimeout(c),c=setTimeout(function(){c=null},n[u-1]||600),1==u&&(a=t.clientX,l=t.clientY)}if(t._clicks=u,i[r]("mousedown",t),u>4)u=0;else if(u>1)return i[r](d[u],t)}Array.isArray(t)||(t=[t]),t.forEach(function(t){h(t,"mousedown",p,o)})};var d=function(t){return 0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0)};function p(t,e,n){var i=d(e);if(!s.isMac&&o){if(e.getModifierState&&(e.getModifierState("OS")||e.getModifierState("Win"))&&(i|=8),o.altGr){if(3==(3&i))return;o.altGr=0}if(18===n||17===n){var l="location"in e?e.location:e.keyLocation;17===n&&1===l?1==o[n]&&(a=e.timeStamp):18===n&&3===i&&2===l&&e.timeStamp-a<50&&(o.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),i||13!==n||3!==(l="location"in e?e.location:e.keyLocation)||(t(e,i,-n),!e.defaultPrevented)){if(s.isChromeOS&&8&i){if(t(e,i,n),e.defaultPrevented)return;i&=-9}return!!(i||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&t(e,i,n)}}function f(){o=Object.create(null)}if(e.getModifierString=function(t){return r.KEY_MODS[d(t)]},e.addCommandKeyListener=function(t,n,i){if(s.isOldGecko||s.isOpera&&!("KeyboardEvent"in window)){var r=null;h(t,"keydown",function(t){r=t.keyCode},i),h(t,"keypress",function(t){return p(n,t,r)},i)}else{var a=null;h(t,"keydown",function(t){o[t.keyCode]=(o[t.keyCode]||0)+1;var e=p(n,t,t.keyCode);return a=t.defaultPrevented,e},i),h(t,"keypress",function(t){a&&(t.ctrlKey||t.altKey||t.shiftKey||t.metaKey)&&(e.stopEvent(t),a=null)},i),h(t,"keyup",function(t){o[t.keyCode]=null},i),o||(f(),h(window,"focus",f))}},"object"==typeof window&&window.postMessage&&!s.isOldIE){var g=1;e.nextTick=function(t,n){n=n||window;var i="zero-timeout-message-"+g++,r=function(s){s.data==i&&(e.stopPropagation(s),u(n,"message",r),t())};h(n,"message",r),n.postMessage(i,"*")}}e.$idleBlocked=!1,e.onIdle=function(t,n){return setTimeout(function n(){e.$idleBlocked?setTimeout(n,100):t()},n)},e.$idleBlockId=null,e.blockIdle=function(t){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout(function(){e.$idleBlocked=!1},t||100)},e.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame=e.nextFrame?e.nextFrame.bind(window):function(t){setTimeout(t,17)}}),ace.define("ace/range",["require","exports","module"],function(t,e,n){"use strict";var i=function(t,e,n,i){this.start={row:t,column:e},this.end={row:n,column:i}};(function(){this.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(t,e){return 0==this.compare(t,e)},this.compareRange=function(t){var e,n=t.end,i=t.start;return 1==(e=this.compare(n.row,n.column))?1==(e=this.compare(i.row,i.column))?2:0==e?1:0:-1==e?-2:-1==(e=this.compare(i.row,i.column))?-1:1==e?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(t){var e=this.compareRange(t);return-1==e||0==e||1==e},this.isEnd=function(t,e){return this.end.row==t&&this.end.column==e},this.isStart=function(t,e){return this.start.row==t&&this.start.column==e},this.setStart=function(t,e){"object"==typeof t?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=e)},this.setEnd=function(t,e){"object"==typeof t?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=e)},this.inside=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)&&!this.isStart(t,e)},this.insideStart=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)},this.insideEnd=function(t,e){return 0==this.compare(t,e)&&!this.isStart(t,e)},this.compare=function(t,e){return this.isMultiLine()||t!==this.start.row?tthis.end.row?1:this.start.row===t?e>=this.start.column?0:-1:this.end.row===t?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(t,e){return this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.compareEnd=function(t,e){return this.end.row==t&&this.end.column==e?1:this.compare(t,e)},this.compareInside=function(t,e){return this.end.row==t&&this.end.column==e?1:this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.clipRows=function(t,e){if(this.end.row>e)var n={row:e+1,column:0};else this.end.rowe)var r={row:e+1,column:0};else this.start.row0;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n};var i=/^\s\s*/,r=/\s\s*$/;e.stringTrimLeft=function(t){return t.replace(i,"")},e.stringTrimRight=function(t){return t.replace(r,"")},e.copyObject=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.copyArray=function(t){for(var e=[],n=0,i=t.length;nDate.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=t("../lib/dom"),o=t("../lib/lang"),a=t("../clipboard"),l=r.isChrome<18,c=r.isIE,h=r.isChrome>63,u=400,d=t("../lib/keys"),p=d.KEY_MODS,f=r.isIOS,g=f?/\s/:/\n/,m=r.isMobile;e.TextInput=function(t,e){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",t.insertBefore(n,t.firstChild);var v=!1,y=!1,b=!1,w=!1,x="";m||(n.style.fontSize="1px");var _=!1,C=!1,S="",E=0,k=0,A=0;try{var D=document.activeElement===n}catch(G){}i.addListener(n,"blur",function(t){C||(e.onBlur(t),D=!1)},e),i.addListener(n,"focus",function(t){if(!C){if(D=!0,r.isEdge)try{if(!document.hasFocus())return}catch(t){}e.onFocus(t),r.isEdge?setTimeout(T):T()}},e),this.$focusScroll=!1,this.focus=function(){if(x||h||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var t=n.style.top;n.style.position="fixed",n.style.top="0px";try{var e=0!=n.getBoundingClientRect().top}catch(G){return}var i=[];if(e)for(var r=n.parentElement;r&&1==r.nodeType;)i.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;n.focus({preventScroll:!0}),e&&i.forEach(function(t){t.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="","0px"==n.style.top&&(n.style.top=t)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return D},e.on("beforeEndOperation",function(){var t=e.curOp,i=t&&t.command&&t.command.name;"insertstring"!=i&&(b&&i&&(t.docChanged||t.selectionChanged)&&(S=n.value="",U()),T())});var T=f?function(t){if(D&&(!v||t)&&!w){t||(t="");var i="\n ab"+t+"cde fg\n";i!=n.value&&(n.value=S=i);var r=4+(t.length||(e.selection.isEmpty()?0:1));4==E&&k==r||n.setSelectionRange(4,r),E=4,k=r}}:function(){if(!b&&!w&&(D||F)){b=!0;var t=0,i=0,r="";if(e.session){var s=e.selection,o=s.getRange(),a=s.cursor.row;if(t=o.start.column,i=o.end.column,r=e.session.getLine(a),o.start.row!=a){var l=e.session.getLine(a-1);t=o.start.rowa+1?c.length:i,i+=r.length+1,r=r+"\n"+c}else m&&a>0&&(r="\n"+r,i+=1,t+=1);r.length>u&&(t0&&S[d]==t[d];)d++,a--;for(c=c.slice(d),d=1;l>0&&S.length-d>E-1&&S[S.length-d]==t[t.length-d];)d++,l--;h-=d-1,u-=d-1;var p=c.length-d+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(i||c||h||a||l||u))return"";w=!0;var f=!1;return r.isAndroid&&". "==c&&(c=" ",f=!0),c&&!a&&!l&&!h&&!u||_?e.onTextInput(c):e.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:u}),w=!1,S=t,E=s,k=o,A=u,f?"\n":c},M=function(t){if(b)return B();if(t&&t.inputType){if("historyUndo"==t.inputType)return e.execCommand("undo");if("historyRedo"==t.inputType)return e.execCommand("redo")}var i=n.value,r=L(i,!0);(i.length>500||g.test(r)||m&&E<1&&E==k)&&T()},I=function(t,e,n){var i=t.clipboardData||window.clipboardData;if(i&&!l){var r=c||n?"Text":"text/plain";try{return e?!1!==i.setData(r,e):i.getData(r)}catch(t){if(!n)return I(t,e,!0)}}},$=function(t,r){var s=e.getCopyText();if(!s)return i.preventDefault(t);I(t,s)?(f&&(T(s),v=s,setTimeout(function(){v=!1},10)),r?e.onCut():e.onCopy(),i.preventDefault(t)):(v=!0,n.value=s,n.select(),setTimeout(function(){v=!1,T(),r?e.onCut():e.onCopy()}))},O=function(t){$(t,!0)},P=function(t){$(t,!1)},N=function(t){var s=I(t);a.pasteCancelled()||("string"==typeof s?(s&&e.onPaste(s,t),r.isIE&&setTimeout(T),i.preventDefault(t)):(n.value="",y=!0))};i.addCommandKeyListener(n,e.onCommandKey.bind(e),e),i.addListener(n,"select",function(t){b||(v?v=!1:function(t){return 0===t.selectionStart&&t.selectionEnd>=S.length&&t.value===S&&S&&t.selectionEnd!==k}(n)?(e.selectAll(),T()):m&&n.selectionStart!=E&&T())},e),i.addListener(n,"input",M,e),i.addListener(n,"cut",O,e),i.addListener(n,"copy",P,e),i.addListener(n,"paste",N,e),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(t,"keydown",function(t){if((!r.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:P(t);break;case 86:N(t);break;case 88:O(t)}},e);var B=function(){if(b&&e.onCompositionUpdate&&!e.$readOnly){if(_)return V();b.useTextareaForIME?e.onCompositionUpdate(n.value):(L(n.value),b.markerRange&&(b.context&&(b.markerRange.start.column=b.selectionStart=b.context.compositionStartOffset),b.markerRange.end.column=b.markerRange.start.column+k-b.selectionStart+A))}},U=function(t){e.onCompositionEnd&&!e.$readOnly&&(b=!1,e.onCompositionEnd(),e.off("mousedown",V),t&&M())};function V(){C=!0,n.blur(),n.focus(),C=!1}var H,j=o.delayedCall(B,50).schedule.bind(null,null);function z(){clearTimeout(H),H=setTimeout(function(){x&&(n.style.cssText=x,x=""),e.renderer.$isMousePressed=!1,e.renderer.$keepTextAreaAtCursor&&e.renderer.$moveTextAreaToCursor()},0)}i.addListener(n,"compositionstart",function(t){if(!b&&e.onCompositionStart&&!e.$readOnly&&(b={},!_)){t.data&&(b.useTextareaForIME=!1),setTimeout(B,0),e._signal("compositionStart"),e.on("mousedown",V);var i=e.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,b.markerRange=i,b.selectionStart=E,e.onCompositionStart(b),b.useTextareaForIME?(S=n.value="",E=0,k=0):(n.msGetInputContext&&(b.context=n.msGetInputContext()),n.getInputContext&&(b.context=n.getInputContext()))}},e),i.addListener(n,"compositionupdate",B,e),i.addListener(n,"keyup",function(t){27==t.keyCode&&n.value.lengthk&&"\n"==S[s]?o=d.end:ik&&S.slice(0,s).split("\n").length>2?o=d.down:s>k&&" "==S[s-1]?(o=d.right,a=p.option):(s>k||s==k&&k!=E&&i==s)&&(o=d.right),i!==s&&(a|=p.shift),o){if(!e.onCommandKey({},a,o)&&e.commands){o=d.keyCodeToString(o);var l=e.commands.findKeyCommand(a,o);l&&e.execCommand(l)}E=i,k=s,T("")}}};document.addEventListener("selectionchange",s),e.on("destroy",function(){document.removeEventListener("selectionchange",s)})}(0,e,n)},e.$setUserAgentForTests=function(t,e){m=t,f=e}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/useragent");function r(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(e){t[e]=this[e]},this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function s(t,e){if(t.start.row==t.end.row)var n=2*e.column-t.start.column-t.end.column;else n=t.start.row!=t.end.row-1||t.start.column||t.end.column?2*e.row-t.start.row-t.end.row:e.column-4;return n<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}(function(){this.onMouseDown=function(t){var e=t.inSelection(),n=t.getDocumentPosition();this.mousedownEvent=t;var r=this.editor,s=t.getButton();return 0!==s?((r.getSelectionRange().isEmpty()||1==s)&&r.selection.moveToPosition(n),void(2==s&&(r.textInput.onContextMenu(t.domEvent),i.isMozilla||t.preventDefault()))):(this.mousedownEvent.time=Date.now(),!e||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(t),this.startSelect(n,t.domEvent._clicks>1),t.preventDefault()):(this.setState("focusWait"),void this.captureMouse(t)))},this.startSelect=function(t,e){t=t||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(t):e||n.selection.moveToPosition(t),e||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)t=this.$clickSelection.end;else if(1==i)t=this.$clickSelection.start;else{var r=s(this.$clickSelection,n);n=r.cursor,t=r.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(t){var e,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[t](i.row,i.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==o&&a<=0)e=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&o>=0)e=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==o&&1==a)i=r.end,e=r.start;else{var l=s(this.$clickSelection,i);i=l.cursor,e=l.anchor}n.selection.setSelectionAnchor(e.row,e.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var t,e,n=(t=this.mousedownEvent.y,e=this.y,Math.sqrt(Math.pow(this.x-this.mousedownEvent.x,2)+Math.pow(e-t,2))),i=Date.now();(n>0||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(t){var e=t.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(t){var e=t.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(t){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(t){if(!t.getAccelKey()){t.getShiftKey()&&t.wheelY&&!t.wheelX&&(t.wheelX=t.wheelY,t.wheelY=0);var e=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=t.domEvent.timeStamp,r=i-n.t,s=r?t.wheelX/r:n.vx,o=r?t.wheelY/r:n.vy;r<550&&(s=(s+n.vx)/2,o=(o+n.vy)/2);var a=Math.abs(s/o),l=!1;return a>=1&&e.renderer.isScrollableBy(t.wheelX*t.speed,0)&&(l=!0),a<=1&&e.renderer.isScrollableBy(0,t.wheelY*t.speed)&&(l=!0),l?n.allowed=i:i-n.allowed<550&&(Math.abs(s)<=1.5*Math.abs(n.vx)&&Math.abs(o)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=s,n.vy=o,l?(e.renderer.scrollBy(t.wheelX*t.speed,t.wheelY*t.speed),t.stop()):void 0}}}).call(r.prototype),e.DefaultHandlers=r}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(t,e,n){"use strict";t("./lib/oop");var i=t("./lib/dom");function r(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(t){this.getElement().textContent=t},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(t,e){this.getElement().style.left=t+"px",this.getElement().style.top=e+"px"},this.setClassName=function(t){i.addCssClass(this.getElement(),t)},this.show=function(t,e,n){null!=t&&this.setText(t),null!=e&&null!=n&&this.setPosition(e,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),e.Tooltip=r}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/oop"),s=t("../lib/event"),o=t("../tooltip").Tooltip;function a(t){o.call(this,t)}r.inherits(a,o),(function(){this.setPosition=function(t,e){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),s=this.getHeight();(t+=15)+r>n&&(t-=t+r-n),(e+=15)+s>i&&(e-=20+s),o.prototype.setPosition.call(this,t,e)}}).call(a.prototype),e.GutterHandler=function(t){var e,n,r,o=t.editor,l=o.renderer.$gutterLayer,c=new a(o.container);function h(){e&&(e=clearTimeout(e)),r&&(c.hide(),r=null,o._signal("hideGutterTooltip",c),o.off("mousewheel",h))}function u(t){c.setPosition(t.x,t.y)}t.editor.setDefaultHandler("guttermousedown",function(e){if(o.isFocused()&&0==e.getButton()&&"foldWidgets"!=l.getRegion(e)){var n=e.getDocumentPosition().row,i=o.session.selection;if(e.getShiftKey())i.selectTo(n,0);else{if(2==e.domEvent.detail)return o.selectAll(),e.preventDefault();t.$clickSelection=o.selection.getLineRange(n)}return t.setState("selectByLines"),t.captureMouse(e),e.preventDefault()}}),t.editor.setDefaultHandler("guttermousemove",function(s){if(i.hasCssClass(s.domEvent.target||s.domEvent.srcElement,"ace_fold-widget"))return h();r&&t.$tooltipFollowsMouse&&u(s),n=s,e||(e=setTimeout(function(){e=null,n&&!t.isMousePressed?function(){var e=n.getDocumentPosition().row,i=l.$annotations[e];if(!i)return h();if(e==o.session.getLength()){var s=o.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>o.session.documentToScreenRow(a.row,a.column))return h()}if(r!=i)if(r=i.text.join("
"),c.setHtml(r),c.show(),o._signal("showGutterTooltip",c),o.on("mousewheel",h),t.$tooltipFollowsMouse)u(n);else{var d=n.domEvent.target.getBoundingClientRect(),p=c.getElement().style;p.left=d.right+"px",p.top=d.bottom+"px"}}():h()},50))}),s.addListener(o.renderer.$gutter,"mouseout",function(t){n=null,r&&!e&&(e=setTimeout(function(){e=null,h()},50))},o),o.on("changeSession",h)}}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),s=e.MouseEvent=function(t,e){this.domEvent=t,this.editor=e,this.x=this.clientX=t.clientX,this.y=this.clientY=t.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var t=this.editor.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=t.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/event"),s=t("../lib/useragent");function o(t){var e=t.editor,n=i.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(e){t[e]=this[e]},this),e.on("mousedown",this.onMouseDown.bind(t));var o,l,c,h,u,d,p,f,g,m,v,y=e.container,b=0;function w(){var t=d;(function(t,n){var i=Date.now();m&&n&&t.row==n.row&&n&&t.column==n.column?a(v.x,v.y,l,c)>5?m=null:i-m>=200&&(e.renderer.scrollCursorIntoView(),m=null):(e.moveCursorToPosition(t),m=i,v={x:l,y:c})})(d=e.renderer.screenToTextCoordinates(l,c),t),function(t,n){var i=Date.now(),r=e.renderer.layerConfig.lineHeight,s=e.renderer.layerConfig.characterWidth,o=e.renderer.scroller.getBoundingClientRect(),a={x:{left:l-o.left,right:o.right-l},y:{top:c-o.top,bottom:o.bottom-c}},h=Math.min(a.x.left,a.x.right),u=Math.min(a.y.top,a.y.bottom),d={row:t.row,column:t.column};h/s<=2&&(d.column+=a.x.left=200&&e.renderer.scrollCursorIntoView(d):g=i:g=null}(d,t)}function x(){u=e.selection.toOrientedRange(),o=e.session.addMarker(u,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),w(),h=setInterval(w,20),b=0,r.addListener(document,"mousemove",S)}function _(){clearInterval(h),e.session.removeMarker(o),o=null,e.selection.fromOrientedRange(u),e.isFocused()&&!f&&e.$resetCursorStyle(),u=null,d=null,b=0,g=null,m=null,r.removeListener(document,"mousemove",S)}this.onDragStart=function(t){if(this.cancelDrag||!y.draggable){var i=this;return setTimeout(function(){i.startSelect(),i.captureMouse(t)},0),t.preventDefault()}u=e.getSelectionRange();var r=t.dataTransfer;r.effectAllowed=e.getReadOnly()?"copy":"copyMove",s.isOpera&&(e.container.appendChild(n),n.scrollTop=0),r.setDragImage&&r.setDragImage(n,0,0),s.isOpera&&e.container.removeChild(n),r.clearData(),r.setData("Text",e.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(t){y.draggable=!1,f=!1,this.setState(null),e.getReadOnly()||(p||"move"!=t.dataTransfer.dropEffect||e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||x(),b++,t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragOver=function(t){if(!e.getReadOnly()&&E(t.dataTransfer))return l=t.clientX,c=t.clientY,o||(x(),b++),null!==C&&(C=null),t.dataTransfer.dropEffect=p=k(t),r.preventDefault(t)},this.onDragLeave=function(t){if(--b<=0&&o)return _(),p=null,r.preventDefault(t)},this.onDrop=function(t){if(d){var n=t.dataTransfer;if(f)switch(p){case"move":u=u.contains(d.row,d.column)?{start:d,end:d}:e.moveText(u,d);break;case"copy":u=e.moveText(u,d,!0)}else{var i=n.getData("Text");u={start:d,end:e.session.insert(d,i)},e.focus(),p=null}return _(),r.preventDefault(t)}},r.addListener(y,"dragstart",this.onDragStart.bind(t),e),r.addListener(y,"dragend",this.onDragEnd.bind(t),e),r.addListener(y,"dragenter",this.onDragEnter.bind(t),e),r.addListener(y,"dragover",this.onDragOver.bind(t),e),r.addListener(y,"dragleave",this.onDragLeave.bind(t),e),r.addListener(y,"drop",this.onDrop.bind(t),e);var C=null;function S(){null==C&&(C=setTimeout(function(){null!=C&&o&&_()},20))}function E(t){var e=t.types;return!e||Array.prototype.some.call(e,function(t){return"text/plain"==t||"Text"==t})}function k(t){var e=["copy","copymove","all","uninitialized"],n=s.isMac?t.altKey:t.ctrlKey,i="uninitialized";try{i=t.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r="none";return n&&e.indexOf(i)>=0?r="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?r="move":e.indexOf(i)>=0&&(r="copy"),r}}function a(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor;t.container.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging"),t.renderer.setCursorStyle(s.isWin?"default":"move"),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;s.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&e.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),i=t.getButton();if(1===(t.domEvent.detail||1)&&0===i&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=t.domEvent.target||t.domEvent.srcElement;"unselectable"in r&&(r.unselectable="on"),e.getDragDelay()?(s.isWebKit&&(this.cancelDrag=!0,e.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(o.prototype),e.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./mouse_event").MouseEvent,r=t("../lib/event"),s=t("../lib/dom");e.addTouchListeners=function(t,e){var n,o,a,l,c,h,u,d,p,f="scroll",g=0,m=0,v=0,y=0;function b(){var t,n,i;p||(t=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var r,o,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,r=e.getCopyText(),o=e.session.getUndoManager().hasUndo(),void p.replaceChild(s.buildDom(n?["span",!r&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],r&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],r&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],t&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),p.firstChild);"paste"==a?t.readText().then(function(t){e.execCommand(a,t)}):a&&("cut"!=a&&"copy"!=a||(t?t.writeText(e.getCopyText()):document.execCommand("copy")),e.execCommand(a)),p.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&e.focus()},p=s.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(t){f="menu",t.stopPropagation(),t.preventDefault(),e.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),i(t)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],e.container));var r=e.selection.cursor,o=e.renderer.textToScreenCoordinates(r.row,r.column),a=e.renderer.textToScreenCoordinates(0,0).pageX,l=e.renderer.scrollLeft,c=e.container.getBoundingClientRect();p.style.top=o.pageY-c.top-3+"px",o.pageX-c.left1)return clearTimeout(c),c=null,a=-1,void(f="zoom");d=e.$mouseHandler.isMousePressed=!0;var s=e.renderer.layerConfig.lineHeight,h=e.renderer.layerConfig.lineHeight,p=t.timeStamp;l=p;var b=r[0],w=b.clientX,_=b.clientY;Math.abs(n-w)+Math.abs(o-_)>s&&(a=-1),n=t.clientX=w,o=t.clientY=_,v=y=0;var C=new i(t,e);if(u=C.getDocumentPosition(),p-a<500&&1==r.length&&!g)m++,t.preventDefault(),t.button=0,function(){c=null,clearTimeout(c),e.selection.moveToPosition(u);var t=m>=2?e.selection.getLineRange(u.row):e.session.getBracketRange(u);t&&!t.isEmpty()?e.selection.setRange(t):e.selection.selectWord(),f="wait"}();else{m=0;var S=e.selection.cursor,E=e.selection.isEmpty()?S:e.selection.anchor,k=e.renderer.$cursorLayer.getPixelPosition(S,!0),A=e.renderer.$cursorLayer.getPixelPosition(E,!0),D=e.renderer.scroller.getBoundingClientRect(),T=e.renderer.layerConfig.offset,R=e.renderer.scrollLeft,F=function(t,e){return(t/=h)*t+(e=e/s-.75)*e};if(t.clientXM?"cursor":"anchor"),f=M<3.5?"anchor":L<3.5?"cursor":"scroll",c=setTimeout(x,450)}a=p},e),r.addListener(t,"touchend",function(t){d=e.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==f?(f="",g=0):c?(e.selection.moveToPosition(u),g=0,b()):"scroll"==f?(g+=60,h=setInterval(function(){g--<=0&&(clearInterval(h),h=null),Math.abs(v)<.01&&(v=0),Math.abs(y)<.01&&(y=0),g<20&&(v*=.9),g<20&&(y*=.9);var t=e.session.getScrollTop();e.renderer.scrollBy(10*v,10*y),t==e.session.getScrollTop()&&(g=0)},10),w()):b(),clearTimeout(c),c=null},e),r.addListener(t,"touchmove",function(t){c&&(clearTimeout(c),c=null);var r=t.touches;if(!(r.length>1||"zoom"==f)){var s=r[0],a=n-s.clientX,h=o-s.clientY;if("wait"==f){if(!(a*a+h*h>4))return t.preventDefault();f="cursor"}n=s.clientX,o=s.clientY,t.clientX=s.clientX,t.clientY=s.clientY;var u=t.timeStamp,d=u-l;if(l=u,"scroll"==f){var p=new i(t,e);p.speed=1,p.wheelX=a,p.wheelY=h,10*Math.abs(a)1&&(r=n[n.length-2]);var o=l[e+"Path"];return null==o?o=l.basePath:"/"==i&&(e=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+e+i+r+this.get("suffix")},e.setModuleUrl=function(t,e){return l.$moduleUrls[t]=e},e.$loading={},e.loadModule=function(n,i){var r,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{r=t(n)}catch(l){}if(r&&!e.$loading[n])return i&&i(r);if(e.$loading[n]||(e.$loading[n]=[]),e.$loading[n].push(i),!(e.$loading[n].length>1)){var a=function(){t([n],function(t){e._emit("load.module",{name:n,module:t});var i=e.$loading[n];e.$loading[n]=null,i.forEach(function(e){e&&e(t)})})};if(!e.get("packaged"))return a();s.loadScript(e.moduleUrl(n,o),a),c()}};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};function h(r){if(a&&a.document){l.packaged=r||t.packaged||i.packaged||a.define&&n("B9Yq").packaged;for(var s,o={},c="",h=document.currentScript||document._currentScript,u=(h&&h.ownerDocument||document).getElementsByTagName("script"),d=0;d=t){for(s=u+1;s=t;)s++;for(a=u,l=s-1;a=e.length||2!=(l=n[r-1])&&3!=l||2!=(c=e[r+1])&&3!=c?4:(s&&(c=3),c==l?c:4);case 10:return 2==(l=r>0?n[r-1]:5)&&r+10&&2==n[r-1])return 2;if(s)return 4;for(p=r+1,d=e.length;p=1425&&g<=2303||64286==g)&&(1==l||7==l))return 1}return r<1||5==(l=e[r-1])?4:n[r-1];case 5:return s=!1,o=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:s=!1;case u:return 4}}function m(t){var e=t.charCodeAt(0),n=e>>8;return 0==n?e>191?0:d[e]:5==n?/[\u0591-\u05f4]/.test(t)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(t)?12:/[\u0660-\u0669\u066b-\u066c]/.test(t)?3:1642==e?h:/[\u06f0-\u06f9]/.test(t)?2:7:32==n&&e<=8287?p[255&e]:254==n&&e>=65136?7:4}e.L=0,e.R=1,e.EN=2,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="\xb7",e.doBidiReorder=function(t,n,h){if(t.length<2)return{};var d=t.split(""),p=new Array(d.length),v=new Array(d.length),y=[];i=h?1:0,function(t,e,n,h){var u=i?c:l,d=null,p=null,f=null,v=0,y=null,b=-1,w=null,x=null,_=[];if(!h)for(w=0,h=[];w0)if(16==y){for(w=b;w-1){for(w=b;w=0&&8==h[C];C--)e[C]=i}}(d,y,d.length,n);for(var b=0;b7&&n[b]<13||4===n[b]||n[b]===u)?y[b]=e.ON_R:b>0&&"\u0644"===d[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[b])&&(y[b-1]=y[b]=e.R_H,b++);for(d[d.length-1]===e.DOT&&(y[d.length-1]=e.B),"\u202b"===d[0]&&(y[0]=e.RLE),b=0;b=0&&(t=this.session.$docRowCache[n])}return t},this.getSplitIndex=function(){var t=0,e=this.session.$screenRowCache;if(e.length)for(var n,i=this.session.$getRowCacheIndex(e,this.currentRow);this.currentRow-t>0&&(n=this.session.$getRowCacheIndex(e,this.currentRow-t-1))===i;)i=n,t++;else t=this.currentRow;return t},this.updateRowLine=function(t,e){void 0===t&&(t=this.getDocumentRow());var n=t===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(t),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[t];s&&(void 0===e&&(e=this.getSplitIndex()),e>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=ee?this.session.getOverwrite()?t:t-1:e,r=i.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&t<=e&&s[r]%2!=0&&r++;for(var a=0;ae&&s[r]%2==0&&(o+=this.charWidths[s[r]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(t,e){var n,i=this.bidiMap,r=i.bidiLevels,s=[],o=0,a=Math.min(t,e)-this.wrapIndent,l=Math.max(t,e)-this.wrapIndent,c=!1,h=!1,u=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,p=0;p=a&&dn+s/2;){if(n+=s,i===r.length-1){s=0;break}s=this.charWidths[r[++i]]}return i>0&&r[i-1]%2!=0&&r[i]%2==0?(t0&&r[i-1]%2==0&&r[i]%2!=0?e=1+(t>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===s&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?e=1+this.bidiMap.logicalFromVisual[i]:(i>0&&r[i-1]%2!=0&&0!==s&&i--,e=this.bidiMap.logicalFromVisual[i]),0===e&&this.isRtlDir&&e++,e+this.wrapIndent}}).call(o.prototype),e.BidiHandler=o}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/lang"),s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(t){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),e.$isEmpty||e.$silent||e._emit("changeSelection"),e.$keepDesiredColumnOnChange||t.old.column==t.value.column||(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,e.$isEmpty||e.$silent||e._emit("changeSelection")})};(function(){i.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?o.fromPoints(e,e):this.isBackwards()?o.fromPoints(e,t):o.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var n=e?t.end:t.start,i=e?t.start:t.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(t,e,n,i){if(!this.$silent){var r=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(n,i),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||s)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(void 0===e){var n=t||this.lead;t=n.row,e=n.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var n,i="number"==typeof t?t:this.lead.row,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,!0===e?new o(i,0,n,this.session.getLine(n).length):new o(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,n){var i=t.column,r=t.column+e;return n<0&&(i=t.column-e,r=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(i,r).split(" ").length-1==e},this.moveCursorLeft=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===e.column)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=i)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,e,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(i)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(e)),e>=n.length)return this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t0&&this.moveCursorWordLeft());this.session.tokenRe.exec(s)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,n)}},this.$shortWordEndIndex=function(t){var e,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(t))n=this.session.tokenRe.lastIndex;else{for(;(e=t[n])&&i.test(e);)n++;if(n<1)for(r.lastIndex=0;(e=t[n])&&!r.test(e);)if(r.lastIndex=0,n++,i.test(e)){if(n>2){n--;break}for(;(e=t[n])&&i.test(e);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e),r=this.session.getFoldAt(t,e,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(e==n.length){var s=this.doc.getLength();do{t++,i=this.doc.getLine(t)}while(t0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var s=r.stringReverse(i),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===e&&(0!==t&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=t&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];t<0?t-=r.rowsAbove||0:t>0&&(t+=r.rowCount-(r.rowsAbove||0))}var s=this.session.screenToDocumentPosition(i.row+t,i.column,n);this.moveCursorTo(s.row,s.column+e,0===e)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,n){var i=this.session.getFoldAt(t,e,1);i&&(t=i.start.row,e=i.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(r.charAt(e))&&r.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,n){var i=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var n=this.getCursor();return o.fromPoints(e,n)}catch(i){return o.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(t){var e=t.clone();return e.isBackwards=t.cursor==t.start,e});else(t=this.getRange()).isBackwards=this.isBackwards();return t},this.fromJSON=function(t){if(null==t.start){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var n=o.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),e.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(t,e,n){"use strict";var i=t("./config"),r=2e3,s=function(t){for(var e in this.states=t,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[e],i=[],r=0,s=this.matchMappings[e]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(t,e){return"\\"+(parseInt(e,10)+r+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),s[r]=l,r+=u,i.push(h),c.onMatch||(c.onMatch=null)}}i.length||(s[0]=0,i.push("$")),a.forEach(function(t){t.splitRegex=this.createSplitterRegexp(t.regex,o)},this),this.regExps[e]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(t){r=0|t},this.$applyToken=function(t){var e=this.splitRegex.exec(t).slice(1),n=this.token.apply(this,e);if("string"==typeof n)return[{type:n,value:t}];for(var i=[],r=0,s=n.length;rh){var v=t.substring(h,m-g.length);d.type==p?d.value+=v:(d.type&&c.push(d),d={type:p,value:v})}for(var y=0;yr){for(u>2*t.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:t});h1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},this.reportError=i.reportError}).call(s.prototype),e.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(t,e){if(e)for(var n in t){for(var i=t[n],r=0;r=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var t=this.$rowTokens,e=this.$tokenIndex,n=t[e].start;if(void 0!==n)return n;for(n=0;e>0;)n+=t[e-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var t=this.$rowTokens[this.$tokenIndex],e=this.getCurrentTokenColumn();return new i(this.$row,e,this.$row,e+t.value.length)}}).call(r.prototype),e.TokenIterator=r}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,e,n){"use strict";var i,r=t("../../lib/oop"),s=t("../behaviour").Behaviour,o=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},u={'"':'"',"'":"'"},d=function(t){var e=-1;if(t.multiSelect&&(e=t.selection.index,h.rangeCount!=t.multiSelect.rangeCount&&(h={rangeCount:t.multiSelect.rangeCount})),h[e])return i=h[e];i=h[e]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(t,e,n,i){var r=t.end.row-t.start.row;return{text:n+e+i,selection:[0,t.start.column+1,r,t.end.column+(r?0:1)]}},f=function(t){this.add("braces","insertion",function(e,n,r,s,o){var l=r.getCursorPosition(),c=s.doc.getLine(l.row);if("{"==o){d(r);var h=r.getSelectionRange(),u=s.doc.getTextRange(h);if(""!==u&&"{"!==u&&r.getWrapBehavioursEnabled())return p(h,u,"{","}");if(f.isSaneInsertion(r,s))return/[\]\}\)]/.test(c[l.column])||r.inMultiSelectMode||t&&t.braces?(f.recordAutoInsert(r,s,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert(r,s,"{"),{text:"{",selection:[1,1]})}else if("}"==o){if(d(r),"}"==c.substring(l.column,l.column+1)&&null!==s.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&f.isAutoInsertedClosing(l,c,o))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==o||"\r\n"==o){d(r);var g="";if(f.isMaybeInsertedClosing(l,c)&&(g=a.stringRepeat("}",i.maybeInsertedBrackets),f.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var m=s.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(s.getLine(m.row))}else{if(!g)return void f.clearMaybeInsertedClosing();v=this.$getIndent(c)}var y=v+s.getTabString();return{text:"\n"+y+"\n"+v+g,selection:[1,y.length,1,y.length]}}f.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(t,e,n,r,s){var o=r.doc.getTextRange(s);if(!s.isMultiLine()&&"{"==o){if(d(n),"}"==r.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(t,e,n,i,r){if("("==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("parens","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(d(n),")"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("brackets","insertion",function(t,e,n,i,r){if("["==r){d(n);var s=n.getSelectionRange(),o=i.doc.getTextRange(s);if(""!==o&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(f.isSaneInsertion(n,i))return f.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){d(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&f.isAutoInsertedClosing(a,l,r))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}),this.add("brackets","deletion",function(t,e,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(d(n),"]"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r}),this.add("string_dquotes","insertion",function(t,e,n,i,r){var s=i.$mode.$quotes||u;if(1==r.length&&s[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;d(n);var o=r,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&s[l])&&n.getWrapBehavioursEnabled())return p(a,l,o,o);if(!l){var c=n.getCursorPosition(),h=i.doc.getLine(c.row),f=h.substring(c.column-1,c.column),g=h.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==f&&m&&/escape/.test(m.type))return null;var y,b=m&&/string|escape/.test(m.type),w=!v||/string|escape/.test(v.type);if(g==o)(y=b!==w)&&/string\.end/.test(v.type)&&(y=!1);else{if(b&&!w)return null;if(b&&w)return null;var x=i.$mode.tokenRe;x.lastIndex=0;var _=x.test(f);x.lastIndex=0;var C=x.test(f);if(_||C)return null;if(g&&!/[\s;,.})\]\\]/.test(g))return null;var S=h[c.column-2];if(f==o&&(S==o||x.test(S)))return null;y=!0}return{text:y?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(t,e,n,i,r){var s=i.$mode.$quotes||u,o=i.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(o)&&(d(n),i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==o))return r.end.column++,r})};f.isSaneInsertion=function(t,e){var n=t.getCursorPosition(),i=new o(e,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(t.session.getLine(n.row)[n.column]))return!0;var r=new o(e,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},f.$matchTokenType=function(t,e){return e.indexOf(t.type||t)>-1},f.recordAutoInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isAutoInsertedClosing(r,s,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=r.row,i.autoInsertedLineEnd=n+s.substr(r.column),i.autoInsertedBrackets++},f.recordMaybeInsert=function(t,e,n){var r=t.getCursorPosition(),s=e.doc.getLine(r.row);this.isMaybeInsertedClosing(r,s)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=r.row,i.maybeInsertedLineStart=s.substr(0,r.column)+n,i.maybeInsertedLineEnd=s.substr(r.column),i.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(t,e,n){return i.autoInsertedBrackets>0&&t.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&e.substr(t.column)===i.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(t,e){return i.maybeInsertedBrackets>0&&t.row===i.maybeInsertedRow&&e.substr(t.column)===i.maybeInsertedLineEnd&&e.substr(0,t.column)==i.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},r.inherits(f,s),e.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(t,e,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,s=[],o=0;o2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,f=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+l.escapeRegExp(p)+")"),m=new RegExp("(?:"+l.escapeRegExp(f)+")\\s*$"),v=function(t,e){b(t,e)||s&&!/\S/.test(t)||(r.insertInLine({row:e,column:t.length},f),r.insertInLine({row:e,column:a},p))},y=function(t,e){var n;(n=t.match(m))&&r.removeInLine(e,t.length-n[0].length,t.length),(n=t.match(g))&&r.removeInLine(e,n[1].length,n[0].length)},b=function(t,n){if(g.test(t))return!0;for(var i=e.getTokens(n),r=0;rt.length&&(x=t.length)}),a==1/0&&(a=x,s=!1,o=!1),h&&a%c!=0&&(a=Math.floor(a/c)*c),w(o?y:v)},this.toggleBlockComment=function(t,e,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var s,o,a=(g=new c(e,i.row,i.column)).getCurrentToken(),l=e.selection.toOrientedRange();if(a&&/comment/.test(a.type)){for(var u,d;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(r.start))){var p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m;u=new h(p,f,p,f+r.start.length);break}a=g.stepBackward()}var g;for(a=(g=new c(e,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var m;if(-1!=(m=a.value.indexOf(r.end))){p=g.getCurrentTokenRow(),f=g.getCurrentTokenColumn()+m,d=new h(p,f,p,f+r.end.length);break}a=g.stepForward()}d&&e.remove(d),u&&(e.remove(u),s=u.start.row,o=-r.start.length)}else o=r.start.length,s=n.start.row,e.insert(n.end,r.end),e.insert(n.start,r.start);l.start.row==s&&(l.start.column+=o),l.end.row==s&&(l.end.column+=o),e.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(t,e,n){return this.$getIndent(e)},this.checkOutdent=function(t,e,n){return!1},this.autoOutdent=function(t,e,n){},this.$getIndent=function(t){return t.match(/^\s*/)[0]},this.createWorker=function(t){return null},this.createModeDelegates=function(t){for(var e in this.$embeds=[],this.$modes={},t)if(t[e]){var n=t[e],r=n.prototype.$id,s=i.$modes[r];s||(i.$modes[r]=s=new n),i.$modes[e]||(i.$modes[e]=s),this.$embeds.push(e),this.$modes[e]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(e=0;ethis.row)){var n=function(e,n,i){var r="insert"==e.action,s=(r?1:-1)*(e.end.row-e.start.row),o=(r?1:-1)*(e.end.column-e.start.column),a=e.start,l=r?a:e.end;return t(n,a,i)?{row:n.row,column:n.column}:t(l,n,!i)?{row:n.row+s,column:n.column+(n.row==l.row?o:0)}:{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(t,e,n){var i;if(i=n?{row:t,column:e}:this.$clipPositionToDocument(t,e),this.row!=i.row||this.column!=i.column){var r={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:r,value:i})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,e))),e<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./apply_delta").applyDelta,s=t("./lib/event_emitter").EventEmitter,o=t("./range").Range,a=t("./anchor").Anchor,l=function(t){this.$lines=[""],0===t.length?this.$lines=[""]:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){i.implement(this,s),this.setValue=function(t){var e=this.getLength()-1;this.remove(new o(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},t)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(t,e){return new a(this,t,e)},this.$split=0==="aaa".split(/a/).length?function(t){return t.replace(/\r\n|\r/g,"\n").split("\n")}:function(t){return t.split(/\r\n|\r|\n/)},this.$detectNewLine=function(t){var e=t.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return"\r\n"==t||"\r"==t||"\n"==t},this.getLine=function(t){return this.$lines[t]||""},this.getLines=function(t,e){return this.$lines.slice(t,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(t){var e;if(t.start.row===t.end.row)e=[this.getLine(t.start.row).substring(t.start.column,t.end.column)];else{(e=this.getLines(t.start.row,t.end.row))[0]=(e[0]||"").substring(t.start.column);var n=e.length-1;t.end.row-t.start.row==n&&(e[n]=e[n].substring(0,t.end.column))}return e},this.insertLines=function(t,e){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(t,e)},this.removeLines=function(t,e){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(t,e)},this.insertNewLine=function(t){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(t,["",""])},this.insert=function(t,e){return this.getLength()<=1&&this.$detectNewLine(e),this.insertMergedLines(t,this.$split(e))},this.insertInLine=function(t,e){var n=this.clippedPos(t.row,t.column),i=this.pos(t.row,t.column+e.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[e]},!0),this.clonePos(i)},this.clippedPos=function(t,e){var n=this.getLength();void 0===t?t=n:t<0?t=0:t>=n&&(t=n-1,e=void 0);var i=this.getLine(t);return null==e&&(e=i.length),{row:t,column:e=Math.min(Math.max(e,0),i.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(t,e){return{row:t,column:e}},this.$clipPosition=function(t){var e=this.getLength();return t.row>=e?(t.row=Math.max(0,e-1),t.column=this.getLine(e-1).length):(t.row=Math.max(0,t.row),t.column=Math.min(Math.max(t.column,0),this.getLine(t.row).length)),t},this.insertFullLines=function(t,e){var n=0;(t=Math.min(Math.max(t,0),this.getLength()))0,i=e=0&&this.applyDelta({start:this.pos(t,this.getLine(t).length),end:this.pos(t+1,0),action:"remove",lines:["",""]})},this.replace=function(t,e){return t instanceof o||(t=o.fromPoints(t.start,t.end)),0===e.length&&t.isEmpty()?t.start:e==this.getTextRange(t)?t.end:(this.remove(t),e?this.insert(t.start,e):t.start)},this.applyDeltas=function(t){for(var e=0;e=0;e--)this.revertDelta(t[e])},this.applyDelta=function(t,e){var n="insert"==t.action;(n?t.lines.length<=1&&!t.lines[0]:!o.comparePoints(t.start,t.end))||(n&&t.lines.length>2e4?this.$splitAndapplyLargeDelta(t,2e4):(r(this.$lines,t,e),this._signal("change",t)))},this.$safeApplyDelta=function(t){var e=this.$lines.length;("remove"==t.action&&t.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=e,-1==i&&(i=e),s<=i&&n.fireUpdateEvent(s,i)}}};(function(){i.implement(this,r),this.setTokenizer=function(t){this.tokenizer=t,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(t){this.doc=t,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(t,e){this._signal("update",{data:{first:t,last:e}})},this.start=function(t){this.currentLine=Math.min(t||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.lines[e]=null;else if("remove"==t.action)this.lines.splice(e,n+1,null),this.states.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(t){return this.lines[t]||this.$tokenizeRow(t)},this.getState=function(t){return this.currentLine==t&&this.$tokenizeRow(t),this.states[t]||"start"},this.$tokenizeRow=function(t){var e=this.doc.getLine(t),n=this.tokenizer.getLineTokens(e,this.states[t-1],t);return this.states[t]+""!=n.state+""?(this.states[t]=n.state,this.lines[t+1]=null,this.currentLine>t+1&&(this.currentLine=t+1)):this.currentLine==t&&(this.currentLine=t+1),this.lines[t]=n.tokens}}).call(s.prototype),e.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=(t("./lib/oop"),t("./range").Range),s=function(t,e,n){this.setRegexp(t),this.clazz=e,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+""!=t+""&&(this.regExp=t,this.cache=[])},this.update=function(t,e,n,s){if(this.regExp)for(var o=s.lastRow,a=s.firstRow;a<=o;a++){var l=this.cache[a];null==l&&((l=i.getMatchOffsets(n.getLine(a),this.regExp)).length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(t){return new r(a,t.offset,a,t.offset+t.length)}),this.cache[a]=l.length?l:"");for(var c=l.length;c--;)e.drawSingleLineMarker(t,l[c].toScreenRange(n),this.clazz,s)}}}).call(s.prototype),e.SearchHighlight=s}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../range").Range;function r(t,e){this.foldData=t,Array.isArray(e)?this.folds=e:e=this.folds=[e];var n=e[e.length-1];this.range=new i(e[0].start.row,e[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach(function(e){e.start.row+=t,e.end.row+=t})},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(t),this.folds.sort(function(t,e){return-t.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(t.start.row,t.start.column)>0?(this.end.row=t.end.row,this.end.column=t.end.column):this.range.compareStart(t.end.row,t.end.column)<0&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(t,e,n){var i,r,s=0,o=this.folds,a=!0;null==e&&(e=this.end.row,n=this.end.column);for(var l=0;l0)){var l=i(t,o.start);return 0===a?e&&0!==l?-s-2:s:l>0||0===l&&!e?s:-s-1}}return-s-1},this.add=function(t){var e=!t.isEmpty(),n=this.pointIndex(t.start,e);n<0&&(n=-n-1);var i=this.pointIndex(t.end,e,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,t)},this.addList=function(t){for(var e=[],n=t.length;n--;)e.push.apply(e,this.add(t[n]));return e},this.substractPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges.splice(e,1)},this.merge=function(){for(var t,e=[],n=this.ranges,r=(n=n.sort(function(t,e){return i(t.start,e.start)}))[0],s=1;s=0},this.containsPoint=function(t){return this.pointIndex(t)>=0},this.rangeAtPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges[e]},this.clipRows=function(t,e){var n=this.ranges;if(n[0].start.row>e||n[n.length-1].start.row=i);o++);if("insert"==t.action){for(var l=r-i,c=-e.column+n.column;oi);o++)if(h.start.row==i&&h.start.column>=e.column&&(h.start.column==e.column&&this.$bias<=0||(h.start.column+=c,h.start.row+=l)),h.end.row==i&&h.end.column>=e.column){if(h.end.column==e.column&&this.$bias<0)continue;h.end.column==e.column&&c>0&&oh.start.column&&h.end.column==s[o+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l}}else for(l=i-r,c=e.column-n.column;or);o++)h.end.rowe.column)&&(h.end.column=e.column,h.end.row=e.row):(h.end.column+=c,h.end.row+=l):h.end.row>r&&(h.end.row+=l),h.start.rowe.column)&&(h.start.column=e.column,h.start.row=e.row):(h.start.column+=c,h.start.row+=l):h.start.row>r&&(h.start.row+=l);if(0!=l&&o=t)return r;if(r.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var n=this.$foldData,i=0;for(e&&(i=n.indexOf(e)),-1==i&&(i=0);i=t)return r}return null},this.getFoldedRowCount=function(t,e){for(var n=this.$foldData,i=e-t+1,r=0;r=e){a=t?i-=e-a:i=0);break}o>=t&&(i-=a>=t?o-a:o-t+1)}return i},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(t,e){return t.start.row-e.start.row}),t},this.addFold=function(t,e){var n,i=this.$foldData,o=!1;t instanceof s?n=t:(n=new s(e,t)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,h=n.end.column,u=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1);if(u&&d==u)return u.addSubFold(n);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(c,h)&&this.removeFold(d);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach(function(t){n.addSubFold(t)}));for(var f=0;f0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(t){this.expandFold(t)},this)},this.unfold=function(t,e){var n,r;if(null==t?(n=new i(0,0,this.getLength(),0),null==e&&(e=!0)):n="number"==typeof t?new i(t,0,t,this.getLine(t).length):"row"in t?i.fromPoints(t,t):t,r=this.getFoldsInRangeList(n),0!=e?this.removeFolds(r):this.expandFolds(r),r.length)return r},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var n=this.getFoldLine(t,e);return n?n.end.row:t},this.getRowFoldStart=function(t,e){var n=this.getFoldLine(t,e);return n?n.start.row:t},this.getFoldDisplayLine=function(t,e,n,i,r){null==i&&(i=t.start.row),null==r&&(r=0),null==e&&(e=t.end.row),null==n&&(n=this.getLine(e).length);var s=this.doc,o="";return t.walk(function(t,e,n,a){if(!(eh)break}while(s&&l.test(s.type));s=r.stepBackward()}else s=r.getCurrentToken();return c.end.row=r.getCurrentTokenRow(),c.end.column=r.getCurrentTokenColumn()+s.value.length-2,c}},this.foldAll=function(t,e,n,i){null==n&&(n=1e5);var r=this.foldWidgets;if(r){e=e||this.getLength();for(var s=t=t||0;s=t&&(s=o.end.row,o.collapseChildren=n,this.addFold("...",o))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var n=t.getTokens(e),i=0;i=0;){var s=n[r];if(null==s&&(s=n[r]=this.getFoldWidget(r)),"start"==s){var o=this.getFoldWidgetRange(r);if(i||(i=o),o&&o.end.row>=t)break}r--}return{range:-1!==r&&o,firstRange:i}},this.onFoldWidgetClick=function(t,e){if(!this.$toggleFoldWidget(t,{children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey})){var n=e.target||e.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var n=this.getFoldWidget(t),i=this.getLine(t),r="end"===n?-1:1,s=this.getFoldAt(t,-1===r?0:i.length,r);if(s)return e.children||e.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(t,!0);if(o&&!o.isMultiLine()&&(s=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(s.range))return this.removeFold(s),s;if(e.siblings){var a=this.getParentFoldRangeData(t);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,e.all?1e4:0)}else e.children?(c=o?o.end.row:this.getLength(),this.foldAll(t+1,c,e.all?1e4:0)):o&&(e.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var n=this.$toggleFoldWidget(e,{});if(!n){var i=this.getParentFoldRangeData(e,!0);if(n=i.range||i.firstRange){var r=this.getFoldAt(e=n.start.row,this.getLine(e).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.foldWidgets[e]=null;else if("remove"==t.action)this.foldWidgets.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,e,n){"use strict";var i=t("../token_iterator").TokenIterator,r=t("../range").Range;e.BracketMatch=function(){this.findMatchingBracket=function(t,e){if(0==t.column)return null;var n=e||this.getLine(t.row).charAt(t.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t):null},this.getBracketRange=function(t){var e,n=this.getLine(t.row),i=!0,s=n.charAt(t.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=n.charAt(t.column),t={row:t.row,column:t.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),i=!1),!o)return null;if(o[1]){if(!(a=this.$findClosingBracket(o[1],t)))return null;e=r.fromPoints(t,a),i||(e.end.column++,e.start.column--),e.cursor=e.end}else{var a;if(!(a=this.$findOpeningBracket(o[2],t)))return null;e=r.fromPoints(a,t),i||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(t){var e=this.getLine(t.row),n=e.charAt(t.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=e.charAt(t.column),t={row:t.row,column:t.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!i)return null;var s=new r(t.row,t.column-1,t.row,t.column),o=i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t);return o?[s,new r(o.row,o.column,o.row,o.column+1)]:[s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==r){if(0==(s-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else h==t&&(s+=1);l-=1}do{a=o.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(t,e,n){var r=this.$brackets[t],s=1,o=new i(this,e.row,e.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-o.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;ln&&(this.$docRowCache.splice(n,e),this.$screenRowCache.splice(n,e))},this.$getRowCacheIndex=function(t,e){for(var n=0,i=t.length-1;n<=i;){var r=n+i>>1,s=t[r];if(e>s)n=r+1;else{if(!(e=e);s++);return(n=i[s])?(n.index=s,n.start=r-n.value.length,n):null},this.setUndoManager=function(t){if(this.$undoManager=t,this.$informUndoManager&&this.$informUndoManager.cancel(),t){var e=this;t.addSession(this),this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(t){this.setOption("useSoftTabs",t)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(t){this.setOption("tabSize",t)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(t){return this.$useSoftTabs&&t.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(t){this.setOption("navigateWithinSoftTabs",t)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(t){this.setOption("overwrite",t)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(t,e){this.$decorations[t]||(this.$decorations[t]=""),this.$decorations[t]+=" "+e,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(t,e){this.$decorations[t]=(this.$decorations[t]||"").replace(" "+e,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(t){this.$breakpoints=[];for(var e=0;e0&&(i=!!n.charAt(e-1).match(this.tokenRe)),i||(i=!!n.charAt(e).match(this.tokenRe)),i)var r=this.tokenRe;else r=/^\s+$/.test(n.slice(e-1,e+1))?/\s/:this.nonTokenRe;var s=e;if(s>0){do{s--}while(s>=0&&n.charAt(s).match(r));s++}for(var o=e;ot&&(t=e.screenWidth)}),this.lineWidgetWidth=t},this.$computeWidth=function(t){if(this.$modified||t){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,s=this.$foldData[r],o=s?s.start.row:1/0,a=e.length,l=0;lo){if((l=s.end.row+1)>=a)break;o=(s=this.$foldData[r++])?s.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(e[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(t,e){return this.doc.getLines(t,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(t,e){return this.doc.insert(t,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(t,e){return this.doc.removeFullLines(t,e)},this.undoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=t.length-1;-1!=n;n--){var i=t[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!e&&this.$undoSelect&&(t.selectionBefore?this.selection.fromJSON(t.selectionBefore):this.selection.setRange(this.$getUndoSelection(t,!0))),this.$fromUndo=!1}},this.redoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=0;nt.end.column&&(s.start.column+=c),s.end.row==t.end.row&&s.end.column>t.end.column&&(s.end.column+=c)),l&&s.start.row>=t.end.row&&(s.start.row+=l,s.end.row+=l)),s.end=this.insert(s.start,i),r.length){var o=t.start,a=s.start,l=a.row-o.row,c=a.column-o.column;this.addFolds(r.map(function(t){return(t=t.clone()).start.row==o.row&&(t.start.column+=c),t.end.row==o.row&&(t.end.column+=c),t.start.row+=l,t.end.row+=l,t}))}return s},this.indentRows=function(t,e,n){n=n.replace(/\t/g,this.getTabString());for(var i=t;i<=e;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(t){for(var e=t.collapseRows(),n=new h(0,0,0,0),i=this.getTabSize(),r=e.start.row;r<=e.end.row;++r){var s=this.getLine(r);n.start.row=r,n.end.row=r;for(var o=0;o0){var r;if((r=this.getRowFoldEnd(e+n))>this.doc.getLength()-1)return 0;i=r-e}else t=this.$clipRowToDocument(t),i=(e=this.$clipRowToDocument(e))-t+1;var s=new h(t,0,e,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(t){return(t=t.clone()).start.row+=i,t.end.row+=i,t}),a=0==n?this.doc.getLines(t,e):this.doc.removeFullLines(t,e);return this.doc.insertFullLines(t+i,a),o.length&&this.addFolds(o),i},this.moveLinesUp=function(t,e){return this.$moveLines(t,e,-1)},this.moveLinesDown=function(t,e){return this.$moveLines(t,e,1)},this.duplicateLines=function(t,e){return this.$moveLines(t,e,0)},this.$clipRowToDocument=function(t){return Math.max(0,Math.min(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(t,e){return e<0?0:Math.min(this.doc.getLine(t).length,e)},this.$clipPositionToDocument=function(t,e){if(e=Math.max(0,e),t<0)t=0,e=0;else{var n=this.doc.getLength();t>=n?(t=n-1,e=this.doc.getLine(n-1).length):e=Math.min(this.doc.getLine(t).length,e)}return{row:t,column:e}},this.$clipRangeToDocument=function(t){t.start.row<0?(t.start.row=0,t.start.column=0):t.start.column=this.$clipColumnToRow(t.start.row,t.start.column);var e=this.doc.getLength()-1;return t.end.row>e?(t.end.row=e,t.end.column=this.doc.getLine(e).length):t.end.column=this.$clipColumnToRow(t.end.row,t.end.column),t},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(t){if(t!=this.$useWrapMode){if(this.$useWrapMode=t,this.$modified=!0,this.$resetRowCache(0),t){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(t,e){this.$wrapLimitRange.min===t&&this.$wrapLimitRange.max===e||(this.$wrapLimitRange={min:t,max:e},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(t,e){var n=this.$wrapLimitRange;n.max<0&&(n={min:e,max:e});var i=this.$constrainWrapLimit(t,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(t,e,n){return e&&(t=Math.max(e,t)),n&&(t=Math.min(n,t)),t},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(t){this.setWrapLimitRange(t,t)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(t){var e=this.$useWrapMode,n=t.action,i=t.start,r=t.end,s=i.row,o=r.row,a=o-s,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[e?"$wrapData":"$rowLengthCache"].splice(s,a);var c=this.$foldData;l=this.getFoldsInRange(t),this.removeFolds(l);var h=0;if(g=this.getFoldLine(r.row)){g.addRemoveChars(r.row,r.column,i.column-r.column),g.shiftRow(-a);var u=this.getFoldLine(s);u&&u!==g&&(u.merge(g),g=u),h=c.indexOf(g)+1}for(;h=r.row&&g.shiftRow(-a);o=s}else{var d=Array(a);d.unshift(s,0);var p=e?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,d),c=this.$foldData,h=0,g=this.getFoldLine(s)){var f=g.range.compareInside(i.row,i.column);0==f?(g=g.split(i.row,i.column))&&(g.shiftRow(a),g.addRemoveChars(o,0,r.column-i.column)):-1==f&&(g.addRemoveChars(s,0,r.column-i.column),g.shiftRow(a)),h=c.indexOf(g)+1}for(;h=s&&g.shiftRow(a)}}else a=Math.abs(t.start.column-t.end.column),"remove"===n&&(l=this.getFoldsInRange(t),this.removeFolds(l),a=-a),(g=this.getFoldLine(s))&&g.addRemoveChars(s,i.column,a);return e&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,e?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),l},this.$updateRowLengthCache=function(t,e,n){this.$rowLengthCache[t]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(n,i){var r,s,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,h=n;for(i=Math.min(i,o.length-1);h<=i;)(s=this.getFoldLine(h,s))?(r=[],s.walk((function(n,i,s,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,r.length))[0]=t;for(var c=1;c=4352&&t<=4447||t>=4515&&t<=4519||t>=4602&&t<=4607||t>=9001&&t<=9002||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12283||t>=12288&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12589||t>=12593&&t<=12686||t>=12688&&t<=12730||t>=12736&&t<=12771||t>=12784&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=13054||t>=13056&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=55216&&t<=55238||t>=55243&&t<=55291||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=65281&&t<=65376||t>=65504&&t<=65510)}this.$computeWrapSplits=function(n,i,r){if(0==n.length)return[];var s=[],o=n.length,a=0,l=0,c=this.$wrapAsCode,h=this.$indentedSoftWrap,u=i<=Math.max(2*r,8)||!1===h?0:Math.floor(i/2);function d(t){for(var e=t-a,i=a;ii-p;){var f=a+i-p;if(n[f-1]>=10&&n[f]>=10)d(f);else if(n[f]!=t&&n[f]!=e){for(var g=Math.max(f-(i-(i>>2)),a-1);f>g&&n[f]g&&n[f]g&&9==n[f];)f--}else for(;f>g&&n[f]<10;)f--;f>g?d(++f):(2==n[f=a+i]&&f--,d(f-p))}else{for(;f!=a-1&&n[f]!=t;f--);if(f>a){d(f);continue}for(f=a+i;f39&&o<48||o>57&&o<64?r.push(9):o>=4352&&n(o)?r.push(1,2):r.push(1)}return r},this.$getStringScreenWidth=function(t,e,i){if(0==e)return[0,0];var r,s;for(null==e&&(e=1/0),i=i||0,s=0;s=4352&&n(r)?i+=2:i+=1,!(i>e));s++);return[i,s]},this.lineWidgets=null,this.getRowLength=function(t){var e=1;return this.lineWidgets&&(e+=this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0),this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+e:e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(t){if(this.$useWrapMode){var e=this.screenToDocumentPosition(t,Number.MAX_VALUE),n=this.$wrapData[e.row];return n.length&&n[0]=0){a=c[h],s=this.$docRowCache[h];var d=t>c[u-1]}else d=!u;for(var p=this.getLength()-1,f=this.getNextFoldLine(s),g=f?f.start.row:1/0;a<=t&&!(a+(l=this.getRowLength(s))>t||s>=p);)a+=l,++s>g&&(g=(f=this.getNextFoldLine(s=f.end.row+1,f))?f.start.row:1/0),d&&(this.$docRowCache.push(s),this.$screenRowCache.push(a));if(f&&f.start.row<=s)i=this.getFoldDisplayLine(f),s=f.start.row;else{if(a+l<=t||s>p)return{row:p,column:this.getLine(p).length};i=this.getLine(s),f=null}var m=0,v=Math.floor(t-a);if(this.$useWrapMode){var y=this.$wrapData[s];y&&(r=y[v],v>0&&y.length&&(m=y.indent,i=i.substring(o=y[v-1]||y[y.length-1])))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,s,v)&&(e=this.$bidiHandler.offsetToCol(n)),o+=this.$getStringScreenWidth(i,e-m)[1],this.$useWrapMode&&o>=r&&(o=r-1),f?f.idxToPosition(o):{row:s,column:o}},this.documentToScreenPosition=function(t,e){if(void 0===e)var n=this.$clipPositionToDocument(t.row,t.column);else n=this.$clipPositionToDocument(t,e);var i,r=0,s=null;(i=this.getFoldAt(t=n.row,e=n.column,1))&&(t=i.start.row,e=i.start.column);var o,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,t),h=l.length;if(h&&c>=0){a=l[c],r=this.$screenRowCache[c];var u=t>l[h-1]}else u=!h;for(var d=this.getNextFoldLine(a),p=d?d.start.row:1/0;a=p){if((o=d.end.row+1)>t)break;p=(d=this.getNextFoldLine(o,d))?d.start.row:1/0}else o=a+1;r+=this.getRowLength(a),a=o,u&&(this.$docRowCache.push(a),this.$screenRowCache.push(r))}var f="";d&&a>=p?(f=this.getFoldDisplayLine(d,t,e),s=d.start.row):(f=this.getLine(t).substring(0,e),s=t);var g=0;if(this.$useWrapMode){var m=this.$wrapData[s];if(m){for(var v=0;f.length>=m[v];)r++,v++;f=f.substring(m[v-1]||0,f.length),g=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(r+=this.lineWidgets[a].rowsAbove),{row:r,column:g+this.$getStringScreenWidth(f)[0]}},this.documentToScreenColumn=function(t,e){return this.documentToScreenPosition(t,e).column},this.documentToScreenRow=function(t,e){return this.documentToScreenPosition(t,e).row},this.getScreenLength=function(){var t=0,e=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=(a=0,(e=this.$foldData[a++])?e.start.row:1/0);ir&&(i=e.end.row+1,r=(e=this.$foldData[a++])?e.start.row:1/0)}else{t=this.getLength();for(var o=this.$foldData,a=0;an);s++);return[i,s]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=n}).call(f.prototype),t("./edit_session/folding").Folding.call(f.prototype),t("./edit_session/bracket_match").BracketMatch.call(f.prototype),o.defineOptions(f.prototype,"session",{wrap:{set:function(t){if(t&&"off"!=t?"free"==t?t=!0:"printMargin"==t?t=-1:"string"==typeof t&&(t=parseInt(t,10)||!1):t=!1,this.$wrap!=t)if(this.$wrap=t,t){var e="number"==typeof t?t:null;this.setWrapLimitRange(e,e),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(t){(t="auto"==t?"text"!=this.$mode.type:"text"!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){(t=parseInt(t))>0&&this.$tabSize!==t&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(t){this.setFoldStyle(t)},handlesSet:!0},overwrite:{set:function(t){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=f}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,e,n){"use strict";var i=t("./lib/lang"),r=t("./lib/oop"),s=t("./range").Range,o=function(){this.$options={}};(function(){this.set=function(t){return r.mixin(this.$options,t),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var i=null;return n.forEach(function(t,n,r,o){return i=new s(t,n,r,o),!(n==o&&e.start&&e.start.start&&0!=e.skipCurrent&&i.isEqual(e.start)&&(i=null,1))}),i},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,r=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),o=[],a=e.re;if(e.$isMultiLine){var l,c=a.length,h=r.length-c;t:for(var u=a.offset||0;u<=h;u++){for(var d=0;dg||(o.push(l=new s(u,g,u+c-1,m)),c>2&&(u=u+c-2))}}else for(var v=0;vx&&o[d].end.row==n.end.row;)d--;for(o=o.slice(v,d+1),v=0,d=o.length;v=a;n--)if(u(n,Number.MAX_VALUE,t))return;if(0!=e.wrap)for(n=l,a=o.row;n>=a;n--)if(u(n,Number.MAX_VALUE,t))return}};else c=function(t){var n=o.row;if(!u(n,o.column,t)){for(n+=1;n<=l;n++)if(u(n,0,t))return;if(0!=e.wrap)for(n=a,l=o.row;n<=l;n++)if(u(n,0,t))return}};if(e.$isMultiLine)var h=n.length,u=function(e,r,s){var o=i?e-h+1:e;if(!(o<0)){var a=t.getLine(o),l=a.search(n[0]);if(!(!i&&lr))return!!s(o,l,o+h-1,u)||void 0}}};else u=i?function(e,i,r){var s,o=t.getLine(e),a=[],l=0;for(n.lastIndex=0;s=n.exec(o);){if(l=s.index,!(h=s[0].length)){if(l>=o.length)break;n.lastIndex=l+=1}if(s.index+h>i)break;a.push(s.index,h)}for(var c=a.length-1;c>=0;c-=2){var h,u=a[c-1];if(r(e,u,e,u+(h=a[c])))return!0}}:function(e,i,r){var s,o,a=t.getLine(e);for(n.lastIndex=i;o=n.exec(a);){var l=o[0].length;if(r(e,s=o.index,e,s+l))return!0;if(!l&&(n.lastIndex=s+=1,s>=a.length))return!1}};return{forEach:c}}}).call(o.prototype),e.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("../lib/keys"),r=t("../lib/useragent"),s=i.KEY_MODS;function o(t,e){this.platform=e||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function a(t,e){o.call(this,t,e),this.$singleCommand=!1}a.prototype=o.prototype,(function(){function t(t){return"object"==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(t,e){var n=t&&("string"==typeof t?t:t.name);t=this.commands[n],e||delete this.commands[n];var i=this.commandKeyBinding;for(var r in i){var s=i[r];if(s==t)delete i[r];else if(Array.isArray(s)){var o=s.indexOf(t);-1!=o&&(s.splice(o,1),1==s.length&&(i[r]=s[0]))}}},this.bindKey=function(t,e,n){if("object"==typeof t&&t&&(null==n&&(n=t.position),t=t[this.platform]),t)return"function"==typeof e?this.addCommand({exec:e,bindKey:t,name:e.name||t}):void t.split("|").forEach(function(t){var i="";if(-1!=t.indexOf(" ")){var r=t.split(/\s+/);t=r.pop(),r.forEach(function(t){var e=this.parseKeys(t);this._addCommandToBinding(i+=(i?" ":"")+(s[e.hashId]+e.key),"chainKeys")},this),i+=" "}var o=this.parseKeys(t);this._addCommandToBinding(i+(s[o.hashId]+o.key),e,n)},this)},this._addCommandToBinding=function(e,n,i){var r,s=this.commandKeyBinding;if(n)if(!s[e]||this.$singleCommand)s[e]=n;else{Array.isArray(s[e])?-1!=(r=s[e].indexOf(n))&&s[e].splice(r,1):s[e]=[s[e]],"number"!=typeof i&&(i=t(n));var o=s[e];for(r=0;ri);r++);o.splice(r,0,n)}else delete s[e]},this.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var n=t[e];if(n){if("string"==typeof n)return this.bindKey(n,e);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=e),this.addCommand(n))}},this)},this.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},this.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(t){return t}),n=e.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else{if(!e.length)return{key:n,hashId:-1};if(1==e.length&&"shift"==e[0])return{key:n.toUpperCase(),hashId:-1}}for(var s=0,o=e.length;o--;){var a=i.KEY_MODS[e[o]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+e[o]+" in "+t),!1;s|=a}return{key:n,hashId:s}},this.findKeyCommand=function(t,e){return this.commandKeyBinding[s[t]+e]},this.handleKeyboard=function(t,e,n,i){if(!(i<0)){var r=s[e]+n,o=this.commandKeyBinding[r];return t.$keyChain&&(t.$keyChain+=" "+r,o=this.commandKeyBinding[t.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(t.$keyChain&&(e&&4!=e||1!=n.length?(-1==e||i>0)&&(t.$keyChain=""):t.$keyChain=t.$keyChain.slice(0,-r.length-1)),{command:o}):(t.$keyChain=t.$keyChain||r,{command:"null"})}},this.getStatusText=function(t,e){return e.$keyChain||""}}).call(o.prototype),e.HashHandler=o,e.MultiHashHandler=a}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../keyboard/hash_handler").MultiHashHandler,s=t("../lib/event_emitter").EventEmitter,o=function(t,e){r.call(this,e,t),this.byName=this.commands,this.setDefaultHandler("exec",function(t){return t.command.exec(t.editor,t.args||{})})};i.inherits(o,r),(function(){i.implement(this,s),this.exec=function(t,e,n){if(Array.isArray(t)){for(var i=t.length;i--;)if(this.exec(t[i],e,n))return!0;return!1}if("string"==typeof t&&(t=this.commands[t]),!t)return!1;if(e&&e.$readOnly&&!t.readOnly)return!1;if(0!=this.$checkCommandState&&t.isAvailable&&!t.isAvailable(e))return!1;var r={editor:e,command:t,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.toggleRecording=function(t){if(!this.$inReplay)return t&&t._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach(function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(t){return t.map(function(t){return"string"!=typeof t[0]&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}).call(o.prototype),e.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,e,n){"use strict";var i=t("../lib/lang"),r=t("../config"),s=t("../range").Range;function o(t,e){return{win:t,mac:e}}e.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(t,e){"number"!=typeof e||isNaN(e)||t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty()?t.selection.getLineRange():t.selection.getRange();t._emit("cut",e),e.isEmpty()||t.session.remove(e),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(i.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(t){for(var e=t.selection.isBackwards(),n=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),r=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),o=t.session.doc.getLine(n.row).length,a=t.session.doc.getTextRange(t.selection.getRange()).replace(/\n\s*/," ").length,l=t.session.doc.getLine(n.row),c=n.row+1;c<=r.row+1;c++){var h=i.stringTrimLeft(i.stringTrimRight(t.session.doc.getLine(c)));0!==h.length&&(h=" "+h),l+=h}r.row+10?(t.selection.moveCursorTo(n.row,n.column),t.selection.selectTo(n.row,n.column+a)):(o=t.session.doc.getLine(n.row).length>o?o+1:o,t.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(t){var e=t.session.doc.getLength()-1,n=t.session.doc.getLine(e).length,i=t.selection.rangeList.ranges,r=[];i.length<1&&(i=[t.selection.getRange()]);for(var o=0;o=r.lastRow||i.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(t){if(this.$mergeUndoDeltas){var e=this.prevOp,n=this.$mergeableCommands,i=e.command&&t.command.name==e.command.name;if("insertstring"==t.command.name){var r=t.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(e.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(t.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(t.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,e){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var n=this;v.loadModule(["keybinding",t],function(i){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(i&&i.handler),e&&e()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),e&&e()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(t){if(this.session!=t){this.curOp&&this.endOperation(),this.curOp={};var e=this.session;if(e){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=t,t?(this.$onDocumentChange=this.onDocumentChange.bind(this),t.on("change",this.$onDocumentChange),this.renderer.setSession(t),this.$onChangeMode=this.onChangeMode.bind(this),t.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),t.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),t.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),t.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),t.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),t.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=t.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(t)),this._signal("changeSession",{session:t,oldSession:e}),this.curOp=null,e&&e._signal("changeEditor",{oldEditor:this}),t&&t._signal("changeEditor",{editor:this}),t&&t.bgTokenizer&&t.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(t,e){return this.session.doc.setValue(t),e?1==e?this.navigateFileEnd():-1==e&&this.navigateFileStart():this.selectAll(),t},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(t){this.renderer.onResize(t)},this.setTheme=function(t,e){this.renderer.setTheme(t,e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(t){this.renderer.setStyle(t)},this.unsetStyle=function(t){this.renderer.unsetStyle(t)},this.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},this.setFontSize=function(t){this.setOption("fontSize",t)},this.$highlightBrackets=function(){if(!this.$highlightPending){var t=this;this.$highlightPending=!0,setTimeout(function(){t.$highlightPending=!1;var e=t.session;if(e&&e.bgTokenizer){e.$bracketHighlight&&(e.$bracketHighlight.markerIds.forEach(function(t){e.removeMarker(t)}),e.$bracketHighlight=null);var n=e.getMatchingBracketRanges(t.getCursorPosition());if(!n&&e.$mode.getMatching&&(n=e.$mode.getMatching(t.session)),n){var i="ace_bracket";Array.isArray(n)?1==n.length&&(i="ace_error_bracket"):n=[n],2==n.length&&(0==p.comparePoints(n[0].end,n[1].start)?n=[p.fromPoints(n[0].start,n[1].end)]:0==p.comparePoints(n[0].start,n[1].end)&&(n=[p.fromPoints(n[1].start,n[0].end)])),e.$bracketHighlight={ranges:n,markerIds:n.map(function(t){return e.addMarker(t,i,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var t=this;this.$highlightTagPending=!0,setTimeout(function(){t.$highlightTagPending=!1;var e=t.session;if(e&&e.bgTokenizer){var n=t.getCursorPosition(),i=new y(t.session,n.row,n.column),r=i.getCurrentToken();if(!r||!/\b(?:tag-open|tag-name)/.test(r.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1===r.type.indexOf("tag-open")||(r=i.stepForward())){var s=r.value,o=r.value,a=0,l=i.stepBackward();if("<"===l.value)do{l=r,(r=i.stepForward())&&(-1!==r.type.indexOf("tag-name")?s===(o=r.value)&&("<"===l.value?a++:""===r.value&&a--)}while(r&&a>=0);else{do{if(r=l,l=i.stepBackward(),r)if(-1!==r.type.indexOf("tag-name"))s===r.value&&("<"===l.value?a++:""===r.value){for(var c=0,h=l;h;){if(-1!==h.type.indexOf("tag-name")&&h.value===s){a--;break}if("<"===h.value)break;h=i.stepBackward(),c++}for(var u=0;u1||(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(t){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(n,"ace_selection",i)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var t=this.session,e=this.getSelectionRange();if(!e.isEmpty()&&!e.isMultiLine()){var n=e.start.column,i=e.end.column,r=t.getLine(e.start.row),s=r.substring(n,i);if(!(s.length>5e3)&&/[\w\d]/.test(s)){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),a=r.substring(n-1,i+1);if(o.test(a))return o}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(t){this.renderer.updateText(),this._emit("changeMode",t)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var t=this.getSelectedText(),e=this.session.doc.getNewLineCharacter(),n=!1;if(!t&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;ra.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,h=n.getState(r.row),u=(a=n.getLine(r.row),i.checkOutdent(h,a,t));if(n.insert(r,t),s&&s.selection&&this.selection.setSelectionRange(2==s.selection.length?new p(r.row,c+s.selection[0],r.row,c+s.selection[1]):new p(r.row+s.selection[0],s.selection[1],r.row+s.selection[2],s.selection[3])),this.$enableAutoIndent){if(n.getDocument().isNewLine(t)){var d=i.getNextLineIndent(h,a.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},d)}u&&i.autoOutdent(h,n,r.row)}},this.autoIndent=function(){var t,e,n=this.session,i=n.getMode();if(this.selection.isEmpty())t=0,e=n.doc.getLength()-1;else{var r=this.getSelectionRange();t=r.start.row,e=r.end.row}for(var s,o,a,l="",c="",h="",u=n.getTabString(),d=t;d<=e;d++)d>0&&(l=n.getState(d-1),c=n.getLine(d-1),h=i.getNextLineIndent(l,c,u)),s=n.getLine(d),h!==(o=i.$getIndent(s))&&(o.length>0&&(a=new p(d,0,d,o.length),n.remove(a)),h.length>0&&n.insert({row:d,column:0},h)),i.autoOutdent(l,n,d)},this.onTextInput=function(t,e){if(!e)return this.keyBinding.onTextInput(t);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,t,e);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(t,e){var n;(e.extendLeft||e.extendRight)&&((n=this.selection.getRange()).start.column-=e.extendLeft,n.end.column+=e.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),t||n.isEmpty()||this.remove()),!t&&this.selection.isEmpty()||this.insert(t,!0),(e.restoreStart||e.restoreEnd)&&((n=this.selection.getRange()).start.column-=e.restoreStart,n.end.column-=e.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(t,e,n){return this.keyBinding.onCommandKey(t,e,n)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption("scrollSpeed",t)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(t){this.setOption("dragDelay",t)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(t){this.setOption("selectionStyle",t)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(t){this.setOption("highlightActiveLine",t)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(t){this.setOption("highlightSelectedWord",t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption("readOnly",t)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(t){this.setOption("behavioursEnabled",t)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(t){this.setOption("wrapBehavioursEnabled",t)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(t){this.setOption("showFoldWidgets",t)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(t){this.selection.isEmpty()&&("left"==t?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(e.start.row),r=n.getMode().transformAction(i,"deletion",this,n,e);if(0===e.end.column){var s=n.getTextRange(e);if("\n"==s[s.length-1]){var o=n.getLine(e.end.row);/^\s+$/.test(o)&&(e.end.column=o.length)}}r&&(e=r)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var t=this.getCursorPosition(),e=t.column;if(0!==e){var n,i,r=this.session.getLine(t.row);ee.toLowerCase()?1:0});var r=new p(0,0,0,0);for(i=t.first;i<=t.last;i++){var s=e.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,e.replace(r,n[i-t.first])}},this.toggleCommentLines=function(){var t=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(t,this.session,e.first,e.last)},this.toggleBlockComment=function(){var t=this.getCursorPosition(),e=this.session.getState(t.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,n,t)},this.getNumberAt=function(t,e){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(t);n.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(t){var e=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new p(e,n-1,e,n),r=this.session.getTextRange(i);if(!isNaN(parseFloat(r))&&isFinite(r)){var s=this.getNumberAt(e,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,a=s.start+s.value.length-o,l=parseFloat(s.value);l*=Math.pow(10,a),l+=t*=o!==s.end&&n=a&&o<=l&&(n=e,c.selection.clearSelection(),c.moveCursorTo(t,a+i),c.selection.selectTo(t,l+i)),a=l});for(var h,u=this.$toggleWordPairs,d=0;dp+1)break;p=f.last}for(h--,a=this.session.$moveLines(d,p,e?0:t),e&&-1==t&&(u=h+1);u<=h;)o[u].moveBy(a,0),u++;e||(a=0),l+=a}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(t){this.renderer.showComposition(t)},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(t,e){var n=this.renderer,i=this.renderer.layerConfig,r=t*Math.floor(i.height/i.lineHeight);!0===e?this.selection.$moveSelection(function(){this.moveCursorBy(r,0)}):!1===e&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,r*i.lineHeight),null!=e&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(t,e,n,i){this.renderer.scrollToLine(t,e,n,i)},this.centerSelection=function(){var t=this.getSelectionRange(),e={row:Math.floor(t.start.row+(t.end.row-t.start.row)/2),column:Math.floor(t.start.column+(t.end.column-t.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(t,e){this.selection.moveCursorTo(t,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(t,e){var n=this.getCursorPosition(),i=new y(this.session,n.row,n.column),r=i.getCurrentToken(),s=r||i.stepForward();if(s){var o,a,l=!1,c={},h=n.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;h=0;--s)this.$tryReplace(n[s],t)&&i++;return this.selection.setSelectionRange(r),i},this.$tryReplace=function(t,e){var n=this.session.getTextRange(t);return null!==(e=this.$search.replace(n,e))?(t.end=this.session.replace(t,e),t):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(t,e,n){e||(e={}),"string"==typeof t||t instanceof RegExp?e.needle=t:"object"==typeof t&&i.mixin(e,t);var r=this.selection.getRange();null==e.needle&&((t=this.session.getTextRange(r)||this.$search.$options.needle)||(r=this.session.getWordRange(r.start.row,r.start.column),t=this.session.getTextRange(r)),this.$search.set({needle:t})),this.$search.set(e),e.start||this.$search.set({start:r});var s=this.$search.find(this.session);return e.preventScroll?s:s?(this.revealRange(s,n),s):(e.backwards?r.start=r.end:r.end=r.start,void this.selection.setRange(r))},this.findNext=function(t,e){this.find({skipCurrent:!0,backwards:!1},t,e)},this.findPrevious=function(t,e){this.find(t,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(t,e){this.session.unfold(t),this.selection.setSelectionRange(t);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(t.start,t.end,.5),!1!==e&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(t){t.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(t){if(t){var e,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var r=this.$scrollAnchor;r.style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild);var s=this.on("changeSelection",function(){i=!0}),o=this.renderer.on("beforeRender",function(){i&&(e=n.renderer.container.getBoundingClientRect())}),a=this.renderer.on("afterRender",function(){if(i&&e&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var t=n.renderer,s=t.$cursorLayer.$pixelPos,o=t.layerConfig,a=s.top-o.offset;null!=(i=s.top>=0&&a+e.top<0||!(s.topwindow.innerHeight)&&null)&&(r.style.top=a+"px",r.style.left=s.left+"px",r.style.height=o.lineHeight+"px",r.scrollIntoView(i)),i=e=null}});this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",o))}}},this.$resetCursorStyle=function(){var t=this.$cursorStyle||"ace",e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(t)),e.isBlinking=!this.$readOnly&&"wide"!=t,r.setCssClass(e.element,"ace_slim-cursors",/slim/.test(t)))},this.prompt=function(t,e,n){var i=this;v.loadModule("./ext/prompt",function(r){r.prompt(i,t,e,n)})}}).call(w.prototype),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:t})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(t){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(t){this.textInput.setReadOnly(t),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(t){this.textInput.setCopyWithEmptySelection(t)},initialValue:!1},cursorStyle:{set:function(t){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(t){this.session.setValue(t)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(t){this.setSession(t)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(t){this.renderer.$gutterLayer.setShowLineNumbers(t),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),t&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(t){this.$showLineNumbers&&t?x.attach(this):x.detach(this)}},placeholder:{set:function(t){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var t=this.session&&(this.renderer.$composition||this.getValue());if(t&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(t||this.renderer.placeholderNode)!t&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var e=r.createElement("div");e.className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode)}}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var x={getText:function(t,e){return(Math.abs(t.selection.lead.row-e)||e+1+(e<9?"\xb7":""))+""},getWidth:function(t,e,n){return Math.max(e.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(t,e){e.renderer.$loop.schedule(e.renderer.CHANGE_GUTTER)},attach:function(t){t.renderer.$gutterLayer.$renderer=this,t.on("changeSelection",this.update),this.update(null,t)},detach:function(t){t.renderer.$gutterLayer.$renderer==this&&(t.renderer.$gutterLayer.$renderer=null),t.off("changeSelection",this.update),this.update(null,t)}};e.Editor=w}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(t){this.$session=t},this.add=function(t,e,n){this.$fromUndo||t!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==e&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),t.id=this.$rev=++this.$maxRev),"remove"!=t.action&&"insert"!=t.action||(this.$lastDelta=t),this.lastDeltas.push(t))},this.addSelection=function(t,e){this.selections.push({value:t,rev:e||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(t,e){null==e&&(e=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=t)break;r.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(t){null==t&&(t=this.$rev),this.mark=t},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(t){return t?a(t):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var r=t("./range").Range,s=r.comparePoints;function o(t){return{row:t.row,column:t.column}}function a(t){if(t=t||this,Array.isArray(t))return t.map(a).join("\n");var e="";return t.action?(e="insert"==t.action?"+":"-",e+="["+t.lines+"]"):t.value&&(e=Array.isArray(t.value)?t.value.map(l).join("\n"):l(t.value)),t.start&&(e+=l(t)),(t.id||t.rev)&&(e+="\t("+(t.id||t.rev)+")"),e}function l(t){return t.start.row+":"+t.start.column+"=>"+t.end.row+":"+t.end.column}function c(t,e){var n="insert"==t.action,i="insert"==e.action;if(n&&i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}else if(!n&&i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.start,t.start)<=0))return null;d(t,e,1)}else if(!n&&!i)if(s(e.start,t.start)>=0)d(e,t,1);else{if(!(s(e.end,t.start)<=0))return null;d(t,e,-1)}return[e,t]}function h(t,e){for(var n=t.length;n--;)for(var i=0;i=0?d(t,e,-1):(s(t.start,e.start)<=0||d(t,r.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&i)s(e.start,t.end)>=0?d(e,t,-1):(s(e.start,t.start)<=0||d(e,r.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&!i)if(s(e.start,t.end)>=0)d(e,t,-1);else{var o,a;if(!(s(e.end,t.start)<=0))return s(t.start,e.start)<0&&(o=t,t=f(t,e.start)),s(t.end,e.end)>0&&(a=f(t,e.end)),p(e.end,t.start,t.end,-1),a&&!o&&(t.lines=a.lines,t.start=a.start,t.end=a.end,a=t),[e,o,a].filter(Boolean);d(t,e,-1)}return[e,t]}function d(t,e,n){p(t.start,e.start,e.end,n),p(t.end,e.start,e.end,n)}function p(t,e,n,i){t.row==(1==i?e:n).row&&(t.column+=i*(n.column-e.column)),t.row+=i*(n.row-e.row)}function f(t,e){var n=t.lines,i=t.end;t.end=o(e);var r=t.end.row-t.start.row,s=n.splice(r,n.length),a=r?e.column:e.column-t.start.column;return n.push(s[0].substring(0,a)),s[0]=s[0].substr(a),{start:o(e),end:i,lines:s,action:t.action}}function g(t,e){e=function(t){return{start:o(t.start),end:o(t.end),action:t.action,lines:t.lines.slice()}}(e);for(var n=t.length;n--;){for(var i=t[n],r=0;rs&&(s=(r=e.getNextFoldLine(l=r.end.row+1,r))?r.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(o=this.$lines.get(++a))?o.row=l:(o=this.$lines.createCell(l,t,this.session,c),this.$lines.push(o)),this.$renderCell(o,t,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(t)},this.$updateGutterWidth=function(t){var e=this.session,n=e.gutterRenderer||this.$renderer,i=e.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||e.$useWrapMode)&&(r=e.getLength()+i-1);var s=n?n.getWidth(e,r,t):r.toString().length*t.characterWidth,o=this.$padding||this.$computePadding();(s+=o.left+o.right)===this.gutterWidth||isNaN(s)||(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!this.$cursorCell||this.$cursorCell.row!=t){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var e=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&r&&r.start.row==e[n-1].row))break;i=e[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(t){var e=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(e,t))return this.update(t);this.$lines.moveContainer(t);var n=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!e||i0;r--)this.$lines.shift();if(i>n)for(r=this.session.getFoldedRowCount(n+1,i);r>0;r--)this.$lines.pop();t.firstRowi&&this.$lines.push(this.$renderLines(t,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t)},this.$renderLines=function(t,e,n){for(var i=[],r=e,s=this.session.getNextFoldLine(r),o=s?s.start.row:1/0;r>o&&(o=(s=this.session.getNextFoldLine(r=s.end.row+1,s))?s.start.row:1/0),!(r>n);){var a=this.$lines.createCell(r,t,this.session,c);this.$renderCell(a,t,s,r),i.push(a),r++}return i},this.$renderCell=function(t,e,n,r){var s=t.element,o=this.session,a=s.childNodes[0],l=s.childNodes[1],c=o.$firstLineNumber,h=o.$breakpoints,u=o.$decorations,d=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,f=n?n.start.row:Number.MAX_VALUE,g="ace_gutter-cell ";if(this.$highlightGutterLine&&(r==this.$cursorRow||n&&r=f&&this.$cursorRow<=n.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),h[r]&&(g+=h[r]),u[r]&&(g+=u[r]),this.$annotations[r]&&(g+=this.$annotations[r].className),s.className!=g&&(s.className=g),p){var m=p[r];null==m&&(m=p[r]=o.getFoldWidget(r))}m?(g="ace_fold-widget ace_"+m,l.className!=(g+="start"==m&&r==f&&rn.right-e.right?"foldWidgets":void 0}}).call(l.prototype),e.Gutter=l}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../range").Range,r=t("../lib/dom"),s=function(t){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",t.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.elt=function(t,e){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=e,n.className=t},this.update=function(t){if(t){var e;for(var n in this.config=t,this.i=0,this.markers){var i=this.markers[n];if(i.range){var r=i.range.clipRows(t.firstRow,t.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),i.renderer){var s=this.$getTop(r.start.row,t);i.renderer(e,r,this.$padding+r.start.column*t.characterWidth,s,t)}else"fullLine"==i.type?this.drawFullLineMarker(e,r,i.clazz,t):"screenLine"==i.type?this.drawScreenLineMarker(e,r,i.clazz,t):r.isMultiLine()?"text"==i.type?this.drawTextMarker(e,r,i.clazz,t):this.drawMultiLineMarker(e,r,i.clazz,t):this.drawSingleLineMarker(e,r,i.clazz+" ace_start ace_br15",t)}else i.update(e,this,this.session,t)}if(-1!=this.i)for(;this.id?4:0)|(c==l?8:0)),r,c==l?0:1,s)},this.drawMultiLineMarker=function(t,e,n,i,r){var s,o=this.$padding,a=i.lineHeight,l=this.$getTop(e.start.row,i),c=o+e.start.column*i.characterWidth;if(r=r||"",this.session.$bidiHandler.isBidiRow(e.start.row)?((s=e.clone()).end.row=s.start.row,s.end.column=this.session.getLine(s.start.row).length,this.drawBidiSingleLineMarker(t,s,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(e.end.row)?((s=e.clone()).start.row=s.end.row,s.start.column=0,this.drawBidiSingleLineMarker(t,s,n+" ace_br12",i,null,r)):(l=this.$getTop(e.end.row,i),this.elt(n+" ace_br12","height:"+a+"px;width:"+e.end.column*i.characterWidth+"px;top:"+l+"px;left:"+o+"px;"+(r||""))),!((a=(e.end.row-e.start.row-1)*i.lineHeight)<=0)){l=this.$getTop(e.start.row+1,i);var h=(e.start.column?1:0)|(e.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+o+"px;"+(r||""))}},this.drawSingleLineMarker=function(t,e,n,i,r,s){if(this.session.$bidiHandler.isBidiRow(e.start.row))return this.drawBidiSingleLineMarker(t,e,n,i,r,s);var o=i.lineHeight,a=(e.end.column+(r||0)-e.start.column)*i.characterWidth,l=this.$getTop(e.start.row,i);this.elt(n,"height:"+o+"px;width:"+a+"px;top:"+l+"px;left:"+(this.$padding+e.start.column*i.characterWidth)+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(t,e,n,i,r,s){var o=i.lineHeight,a=this.$getTop(e.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(e.start.column,e.end.column).forEach(function(t){this.elt(n,"height:"+o+"px;width:"+t.width+(r||0)+"px;top:"+a+"px;left:"+(l+t.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i),o=i.lineHeight;e.start.row!=e.end.row&&(o+=this.$getTop(e.end.row,i)-s),this.elt(n,"height:"+o+"px;top:"+s+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(t,e,n,i,r){var s=this.$getTop(e.start.row,i);this.elt(n,"height:"+i.lineHeight+"px;top:"+s+"px;left:0;right:0;"+(r||""))}}).call(s.prototype),e.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("./lines").Lines,a=t("../lib/event_emitter").EventEmitter,l=function(t){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){i.implement(this,a),this.EOF_CHAR="\xb6",this.EOL_CHAR_LF="\xac",this.EOL_CHAR_CRLF="\xa4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\xb7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var t=this.session.doc,e="\n"==t.getNewLineCharacter()&&"windows"!=t.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(t){this.$padding=t,this.element.style.margin="0 "+t+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on("changeCharacterSize",(function(t){this._signal("changeCharacterSize",t)}).bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,"string"==typeof t?(this.showSpaces=/tab/i.test(t),this.showTabs=/space/i.test(t),this.showEOL=/eol/i.test(t)):this.showSpaces=this.showTabs=this.showEOL=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var t=this.session.getTabSize();this.tabSize=t;for(var e=this.$tabStrings=[0],n=1;nh&&(h=(l=this.session.getNextFoldLine(a=l.end.row+1,l))?l.start.row:1/0),!(a>r);){var u=s[o++];if(u){this.dom.removeChildren(u),this.$renderLine(u,a,a==h&&l),c&&(u.style.top=this.$lines.computeLineTop(a,t,this.session)+"px");var d=t.lineHeight*this.session.getRowLength(a)+"px";u.style.height!=d&&(c=!0,u.style.height=d)}a++}if(c)for(;o0;i--)this.$lines.shift();if(e.lastRow>t.lastRow)for(i=this.session.getFoldedRowCount(t.lastRow+1,e.lastRow);i>0;i--)this.$lines.pop();t.firstRowe.lastRow&&this.$lines.push(this.$renderLinesFragment(t,e.lastRow+1,t.lastRow))},this.$renderLinesFragment=function(t,e,n){for(var i=[],s=e,o=this.session.getNextFoldLine(s),a=o?o.start.row:1/0;s>a&&(a=(o=this.session.getNextFoldLine(s=o.end.row+1,o))?o.start.row:1/0),!(s>n);){var l=this.$lines.createCell(s,t,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(s,t,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(s,t,this.session)+"px"),this.$renderLine(c,s,s==a&&o),c.className=this.$useLineGroups()?"ace_line_group":"ace_line",i.push(l),s++}return i},this.update=function(t){this.$lines.moveContainer(t),this.config=t;for(var e=t.firstRow,n=t.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(t,e,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(t,e,n,i){for(var r,o=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),c=0;r=a.exec(i);){var h=r[1],u=r[2],d=r[3],p=r[4],f=r[5];if(o.showSpaces||!u){var g=c!=r.index?i.slice(c,r.index):"";if(c=r.index+r[0].length,g&&l.appendChild(this.dom.createTextNode(g,this.element)),h){var m=o.session.getScreenTabSize(e+r.index);l.appendChild(o.$tabStrings[m].cloneNode(!0)),e+=m-1}else u?o.showSpaces?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=s.stringRepeat(o.SPACE_CHAR,u.length),l.appendChild(y)):l.appendChild(this.com.createTextNode(u,this.element)):d?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=s.stringRepeat(o.SPACE_CHAR,d.length),l.appendChild(y)):p?(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className=o.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=o.showSpaces?o.SPACE_CHAR:p,l.appendChild(y)):f&&(e+=1,(y=this.dom.createElement("span")).style.width=2*o.config.characterWidth+"px",y.className="ace_cjk",y.textContent=f,l.appendChild(y))}}if(l.appendChild(this.dom.createTextNode(c?i.slice(c):i,this.element)),this.$textToken[n.type])t.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==n.type&&(y.style.width=n.value.length*this.config.characterWidth+"px"),y.className=v,y.appendChild(l),t.appendChild(y)}return e+i.length},this.renderIndentGuide=function(t,e,n){var i=e.search(this.$indentGuideRe);if(i<=0||i>=n)return e;if(" "==e[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,s=0;s=o;)a=this.$renderToken(l,a,h,u.substring(0,o-i)),u=u.substring(o-i),i=o,l=this.$createLineElement(),t.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat("\xa0",n.indent),this.element)),a=0,o=n[++r]||Number.MAX_VALUE;0!=u.length&&(i+=u.length,a=this.$renderToken(l,a,h,u))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(t,e){var n=0,i=e[0],r=i.value;this.displayIndentGuides&&(r=this.renderIndentGuide(t,r)),r&&(n=this.$renderToken(t,n,i,r));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(t,n,i,r);n=this.$renderToken(t,n,i,r)}},this.$renderOverflowMessage=function(t,e,n,i,r){n&&this.$renderToken(t,e,n,i.slice(0,this.MAX_LINE_LENGTH-e));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=r?"":"",t.appendChild(s)},this.$renderLine=function(t,e,n){if(n||0==n||(n=this.session.getFoldLine(e)),n)var i=this.$getFoldLineTokens(e,n);else i=this.session.getTokens(e);var r=t;if(i.length){var s=this.session.getRowSplitData(e);s&&s.length?(this.$renderWrappedLine(t,i,s),r=t.lastChild):(r=t,this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r)),this.$renderSimpleLine(r,i))}else this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r));if(this.showEOL&&r){n&&(e=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o)}},this.$getFoldLineTokens=function(t,e){var n=this.session,i=[],r=n.getTokens(t);return e.walk(function(t,e,s,o,a){null!=t?i.push({type:"fold",value:t}):(a&&(r=n.getTokens(e)),r.length&&function(t,e,n){for(var r=0,s=0;s+t[r].value.lengthn-e&&(o=o.substring(0,n-e)),i.push({type:t[r].type,value:o}),s=e+o.length,r+=1);sn?{type:t[r].type,value:o.substring(0,n-s)}:t[r]),s+=o.length,r+=1}}(r,o,s))},e.end.row,this.session.getLine(e.end.row).length),i},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),e.Text=l}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("../lib/dom"),r=function(t){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",t.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(t){for(var e=this.cursors,n=e.length;n--;)i.setStyle(e[n].style,"opacity",t?"":"0")},this.$startCssAnimation=function(){for(var t=this.cursors,e=t.length;e--;)t[e].style.animationDuration=this.blinkInterval+"ms";setTimeout((function(){i.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},this.$stopCssAnimation=function(){i.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t!=this.smoothBlinking&&(this.smoothBlinking=t,i.setCssClass(this.element,"ace_smooth-blinking",t),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var t=i.createElement("div");return t.className="ace_cursor",this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(this.cursors.length>1){var t=this.cursors.pop();return t.parentNode.removeChild(t),t}},this.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var t=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&i.removeCssClass(this.element,"ace_smooth-blinking"),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout((function(){i.addCssClass(this.element,"ace_smooth-blinking")}).bind(this)),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var e=(function(){this.timeoutId=setTimeout(function(){t(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){t(!0),e()},this.blinkInterval),e()}else this.$stopCssAnimation()},this.getPixelPosition=function(t,e){if(!this.config||!this.session)return{left:0,top:0};t||(t=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(t);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,t.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(e?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(t,e){return t.top>=0&&t.topt.height+t.offset||o.top<0)&&n>1)){var a=this.cursors[r++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,o,t,e[n],this.session):this.isCursorInView(o,t)?(i.setStyle(l,"display","block"),i.translate(a,o.left,o.top),i.setStyle(l,"width",Math.round(t.characterWidth)+"px"),i.setStyle(l,"height",t.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),e.Cursor=r}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./lib/event"),o=t("./lib/event_emitter").EventEmitter,a=32768,l=function(t){this.element=r.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=r.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xa0",this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){i.implement(this,o),this.setVisible=function(t){this.element.style.display=t?"":"none",this.isVisible=t,this.coeff=1}}).call(l.prototype);var c=function(t,e){l.call(this,t),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=r.scrollbarWidth(t.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(c,l),(function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+"px"},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,t>a?(this.coeff=a/t,t=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=t+"px"},this.setScrollTop=function(t){this.scrollTop!=t&&(this.skipEvent=!0,this.scrollTop=t,this.element.scrollTop=t*this.coeff)}}).call(c.prototype);var h=function(t,e){l.call(this,t),this.scrollLeft=0,this.height=e.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(h,l),(function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(t){this.element.style.width=t+"px"},this.setInnerWidth=function(t){this.inner.style.width=t+"px"},this.setScrollWidth=function(t){this.inner.style.width=t+"px"},this.setScrollLeft=function(t){this.scrollLeft!=t&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=t)}}).call(h.prototype),e.ScrollBar=c,e.ScrollBarV=c,e.ScrollBarH=h,e.VScrollBar=c,e.HScrollBar=h}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,e,n){"use strict";var i=t("./lib/event"),r=function(t,e){this.onRender=t,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=e||window;var n=this;this._flush=function(t){n.pending=!1;var e=n.changes;if(e&&(i.blockIdle(100),n.changes=0,n.onRender(e)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(t){this.changes=this.changes|t,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(t){var e=this.changes;return this.changes=0,e}}).call(r.prototype),e.RenderLoop=r}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,e,n){var i=t("../lib/oop"),r=t("../lib/dom"),s=t("../lib/lang"),o=t("../lib/event"),a=t("../lib/useragent"),l=t("../lib/event_emitter").EventEmitter,c=256,h="function"==typeof ResizeObserver,u=200,d=e.FontMetrics=function(t){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),t.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",c),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(t,e){t.width=t.height="auto",t.left=t.top="0px",t.visibility="hidden",t.position="absolute",t.whiteSpace="pre",a.isIE<8?t["font-family"]="inherit":t.font="inherit",t.overflow=e?"hidden":"visible"},this.checkForSizeChanges=function(t){if(void 0===t&&(t=this.$measureSizes()),t&&(this.$characterSize.width!==t.width||this.$characterSize.height!==t.height)){this.$measureNode.style.fontWeight="bold";var e=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=t,this.charSizes=Object.create(null),this.allowBoldFonts=e&&e.width===t.width&&e.height===t.height,this._emit("changeCharacterSize",{data:t})}},this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver(function(e){t.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=o.onIdle(function e(){t.checkForSizeChanges(),o.onIdle(e,500)},500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(t){var e={height:(t||this.$measureNode).clientHeight,width:(t||this.$measureNode).clientWidth/c};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.textContent=s.stringRepeat(t,c),this.$main.getBoundingClientRect().width/c},this.getCharacterWidth=function(t){var e=this.charSizes[t];return void 0===e&&(e=this.charSizes[t]=this.$measureCharWidth(t)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function t(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*t(e.parentElement):1},this.$initTransformMeasureNodes=function(){var t=function(t,e){return["div",{style:"position: absolute;top:"+t+"px;left:"+e+"px;"}]};this.els=r.buildDom([t(0,0),t(u,0),t(0,u),t(u,u)],this.el)},this.transformCoordinates=function(t,e){function n(t,e,n){var i=t[1]*e[0]-t[0]*e[1];return[(-e[1]*n[0]+e[0]*n[1])/i,(+t[1]*n[0]-t[0]*n[1])/i]}function i(t,e){return[t[0]-e[0],t[1]-e[1]]}function r(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t*e[0],t*e[1]]}function o(t){var e=t.getBoundingClientRect();return[e.left,e.top]}t&&(t=s(1/this.$getZoom(this.el),t)),this.els||this.$initTransformMeasureNodes();var a=o(this.els[0]),l=o(this.els[1]),c=o(this.els[2]),h=o(this.els[3]),d=n(i(h,l),i(h,c),i(r(l,c),r(h,a))),p=s(1+d[0],i(l,a)),f=s(1+d[1],i(c,a));if(e){var g=e,m=d[0]*g[0]/u+d[1]*g[1]/u+1,v=r(s(g[0],p),s(g[1],f));return r(s(1/m/u,v),a)}var y=i(t,a),b=n(i(p,s(d[0],y)),i(f,s(d[1],y)),y);return s(u,b)}}).call(d.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),s=t("./config"),o=t("./layer/gutter").Gutter,a=t("./layer/marker").Marker,l=t("./layer/text").Text,c=t("./layer/cursor").Cursor,h=t("./scrollbar").HScrollBar,u=t("./scrollbar").VScrollBar,d=t("./renderloop").RenderLoop,p=t("./layer/font_metrics").FontMetrics,f=t("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=t("./lib/useragent"),v=m.isIE;r.importCssString(g,"ace_editor.css");var y=function(t,e){var n=this;this.container=t||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(e),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var i=this.$textLayer=new l(this.content);this.canvas=i.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollTop(t.data-n.scrollMargin.top)}),this.scrollBarH.on("scroll",function(t){n.$scrollAnimation||n.session.setScrollLeft(t.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(t){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",t)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,f),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&t.getScrollTop()<=0&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(t,e,n){if(void 0===e&&(e=1/0),this.$changedLines?(this.$changedLines.firstRow>t&&(this.$changedLines.firstRow=t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(t,e,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=t?1:0;var r=this.container;i||(i=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var s=this.$updateCachedSize(t,e,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;t&&(this.$gutterLayer.$padding=null),t?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(t,e,n,i){var s=0,o=this.$size,a={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if((i-=this.$extraHeight||0)&&(t||o.height!=i)&&(o.height=i,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL),n&&(t||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,null==e&&(e=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=e,r.setStyle(this.scrollBarH.element.style,"left",e+"px"),r.setStyle(this.scroller.style,"left",e+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-e-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l),r.setStyle(this.scroller.style,"right",l),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||t)&&(s|=this.CHANGE_FULL)}return o.$dirty=!n||!i,s&&this._signal("resize",a),s},this.onGutterResize=function(t){var e=this.$showGutter?t:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var t=Math.floor((this.$size.scrollerWidth-2*this.$padding)/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(t){this.setOption("animatedScroll",t)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(t){this.setOption("showInvisibles",t),this.session.$bidiHandler.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(t){this.setOption("displayIndentGuides",t)},this.setShowPrintMargin=function(t){this.setOption("showPrintMargin",t)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(t){this.setOption("printMarginColumn",t)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(t){return this.setOption("showGutter",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var t=r.createElement("div");t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",t.appendChild(this.$printMarginEl),this.content.insertBefore(t,this.content.firstChild)}var e=this.$printMarginEl.style;e.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var t=this.textarea.style,e=this.$composition;if(this.$keepTextAreaAtCursor||e){var n=this.$cursorLayer.$pixelPos;if(n){e&&e.markerRange&&(n=this.$cursorLayer.getPixelPosition(e.markerRange.start,!0));var i=this.layerConfig,s=n.top,o=n.left,a=e&&e.useTextareaForIME?this.lineHeight:v?0:1;if((s-=i.offset)<0||s>i.height-a)r.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;e?e.useTextareaForIME?l=this.characterWidth*this.session.$getStringScreenWidth(this.textarea.value)[0]:s+=this.lineHeight+2:s+=this.lineHeight,(o-=this.scrollLeft)>this.$size.scrollerWidth-l&&(o=this.$size.scrollerWidth-l),o+=this.gutterWidth+this.margin.left,r.setStyle(t,"height",a+"px"),r.setStyle(t,"width",l+"px"),r.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-l),Math.min(s,c))}}}else r.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var t=this.layerConfig,e=t.lastRow;return this.session.documentToScreenRow(e,0)*t.lineHeight-this.session.getScrollTop()>t.height-t.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(t,e,n,i){var r=this.scrollMargin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(t,e,n,i){var r=this.margin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption("hScrollBarAlwaysVisible",t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption("vScrollBarAlwaysVisible",t)},this.$updateScrollBarV=function(){var t=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&this.scrollTop>(t-=(e-this.lineHeight)*this.$scrollPastEnd)-e&&(t=this.scrollTop+e,this.scrollBarV.scrollTop=null),this.scrollBarV.setScrollHeight(t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(t,e){if(this.$changes&&(t|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(t||e)){if(this.$size.$dirty)return this.$changes|=t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(t&this.CHANGE_FULL||t&this.CHANGE_SIZE||t&this.CHANGE_TEXT||t&this.CHANGE_LINES||t&this.CHANGE_SCROLL||t&this.CHANGE_H_SCROLL){if(t|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;i>0&&(this.scrollTop=i,t|=this.CHANGE_SCROLL,t|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-n.offset);var s=n.minHeight+"px";r.setStyle(this.content.style,"width",n.width+2*this.$padding+"px"),r.setStyle(this.content.style,"height",s)}if(t&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),t&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);if(t&this.CHANGE_SCROLL)return this.$changedLines=null,t&this.CHANGE_TEXT||t&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(t&this.CHANGE_GUTTER||t&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):t&this.CHANGE_LINES?(this.$updateLines()||t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):t&this.CHANGE_TEXT||t&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):t&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",t)}else this.$changes|=t},this.$autosize=function(){var t=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,n=Math.min(e,Math.max((this.$minLines||1)*this.lineHeight,t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&t>e;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var t=this.session,e=this.$size,n=e.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),s=!n&&(this.$hScrollBarAlwaysVisible||e.scrollerWidth-r-2*this.$padding<0),o=this.$horizScroll!==s;o&&(this.$horizScroll=s,this.scrollBarH.setVisible(s));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=e.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(e.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var h=this.scrollMargin;this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,i-e.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,r+2*this.$padding-e.scrollerWidth+h.right)));var u=!n&&(this.$vScrollBarAlwaysVisible||e.scrollerHeight-i+c<0||this.scrollTop>h.top),d=a!==u;d&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var p,f,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),y=v+m,b=this.lineHeight;v=t.screenToDocumentRow(v,0);var w=t.getFoldLine(v);w&&(v=w.start.row),p=t.documentToScreenRow(v,0),f=t.getRowLength(v)*b,y=Math.min(t.screenToDocumentRow(y,0),t.getLength()-1),l=e.scrollerHeight+t.getRowLength(y)*b+f,g=this.scrollTop-p*b;var x=0;return(this.layerConfig.width!=r||o)&&(x=this.CHANGE_H_SCROLL),(o||d)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal("scrollbarVisibilityChanged"),d&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:v,firstRowScreen:p,lastRow:y,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:g,gutterOffset:b?Math.max(0,Math.ceil((g+e.height-e.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),x},this.$updateLines=function(){if(this.$changedLines){var t=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(t>n.lastRow+1||ethis.$textLayer.MAX_LINE_LENGTH&&(t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(t*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(t,e){this.$gutterLayer.addGutterDecoration(t,e)},this.removeGutterDecoration=function(t,e){this.$gutterLayer.removeGutterDecoration(t,e)},this.updateBreakpoints=function(t){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(t){this.$gutterLayer.setAnnotations(t),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(t,e,n){this.scrollCursorIntoView(t,n),this.scrollCursorIntoView(e,n)},this.scrollCursorIntoView=function(t,e,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(t),r=i.left,s=i.top,o=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+o>s?(e&&l+o>s+this.lineHeight&&(s-=e*this.$size.scrollerHeight),0===s&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):l+this.$size.scrollerHeight-ar?(r=1-this.scrollMargin.top||e>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=Math.floor((e+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:a,side:s-a>0?1:-1,offsetX:r}},this.screenToTextCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,s=r/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),a=Math.floor((e+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(o,0),r)},this.textToScreenCoordinates=function(t,e){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(t,e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,t)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth));return{pageX:n.left+r-this.scrollLeft,pageY:n.top+i.row*this.lineHeight-this.scrollTop}},this.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},this.showComposition=function(t){this.$composition=t,t.cssText||(t.cssText=this.textarea.style.cssText),null==t.useTextareaForIME&&(t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):t.markerId=this.session.addMarker(t.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(t){var e=this.session.selection.cursor;this.addToken(t,"composition_placeholder",e.row,e.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var t=this.session.selection.cursor;this.removeExtraToken(t.row,t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(t,e,n,i){var r=this.session;r.bgTokenizer.lines[n]=null;var s={type:e,value:t},o=r.getTokens(n);if(null==i)o.push(s);else for(var a=0,l=0;l50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(l.prototype),e.UIWorkerClient=function(t,e,n){var i=null,r=!1,a=Object.create(s),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(t){c.push(t),i&&(r?setTimeout(u):u())}});h.setEmitSync=function(t){r=t};var u=function(){var t=c.shift();t.command?i[t.command].apply(i,t.args):t.event&&a._signal(t.event,t.data)};return a.postMessage=function(t){h.onMessage({data:t})},a.callback=function(t,e){this.postMessage({type:"call",id:e,data:t})},a.emit=function(t,e){this.postMessage({type:"event",name:t,data:e})},o.loadModule(["worker",e],function(t){for(i=new t[n](a);c.length;)u()}),h},e.WorkerClient=l,e.createWorker=a}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,e,n){"use strict";var i=t("./range").Range,r=t("./lib/event_emitter").EventEmitter,s=t("./lib/oop"),o=function(t,e,n,i,r,s){var o=this;this.length=e,this.session=t,this.doc=t.getDocument(),this.mainClass=r,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var a=t.getUndoManager().$undoStack||t.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),t.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,r),this.setup=function(){var t=this,e=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new i(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var i=e.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),t.others.push(i)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,e=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),e.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,s=e.start.column-this.pos.column;if(this.updateAnchors(t),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===t.action)for(var o=this.others.length-1;o>=0;o--)this.doc.insertMergedLines(l={row:(a=this.others[o]).row,column:a.column+s},t.lines);else if("remove"===t.action)for(o=this.others.length-1;o>=0;o--){var a,l;this.doc.remove(new i((l={row:(a=this.others[o]).row,column:a.column+s}).row,l.column,l.row,l.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(t){this.pos.onChange(t);for(var e=this.others.length;e--;)this.others[e].onChange(t);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var t=this,e=this.session,n=function(n,r){e.removeMarker(n.markerId),n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},this.onCursorChange=function(t){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",t)):(this.hideOtherMarkers(),this._emit("cursorLeave",t))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var t=this.session.getUndoManager(),e=(t.$undoStack||t.$undostack).length-this.$undoStackDepth,n=0;n1?t.multiSelect.joinSelections():t.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(t){t.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(t){t.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(t){t.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(t){t.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(t){return t&&t.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new i(e.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,e,n){var i=t("./range_list").RangeList,r=t("./range").Range,s=t("./selection").Selection,o=t("./mouse/multi_select_handler").onMouseDown,a=t("./lib/event"),l=t("./lib/lang"),c=t("./commands/multi_select_commands");e.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(0,t("./search").Search),u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(t,e){if(t){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(t),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),e||this.fromOrientedRange(t);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}t.cursor||(t.cursor=t.end);var i=this.rangeList.add(t);return this.$onAddRange(t),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),e||this.fromOrientedRange(t)}},this.toSingleRange=function(t){t=t||this.ranges[0];var e=this.rangeList.removeAll();e.length&&this.$onRemoveRange(e),t&&this.fromOrientedRange(t)},this.substractPoint=function(t){var e=this.rangeList.substractPoint(t);if(e)return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var t=this.rangeList.merge();t.length&&this.$onRemoveRange(t)},this.$onAddRange=function(t){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(t),this._signal("addRange",{range:t})},this.$onRemoveRange=function(t){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var e=this.rangeList.ranges.pop();t.push(e),this.rangeCount=0}for(var n=t.length;n--;){var i=this.ranges.indexOf(t[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:t}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(e=e||this.ranges[0])&&!e.isEqual(this.getRange())&&this.fromOrientedRange(e)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var t=this.ranges.length?this.ranges:[this.getRange()],e=[],n=0;n1){var t=this.rangeList.ranges,e=t[t.length-1],n=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(n,e.cursor==e.start)}else{var i=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,s).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(t,e,n){var i=[],s=t.column0;)y--;if(y>0)for(var b=0;i[b].isEmpty();)b++;for(var w=y;w>=b;w--)i[w].isEmpty()&&i.splice(w,1)}return i}}).call(s.prototype);var d=t("./editor").Editor;function p(t){t.$multiselectOnSessionChange||(t.$onAddRange=t.$onAddRange.bind(t),t.$onRemoveRange=t.$onRemoveRange.bind(t),t.$onMultiSelect=t.$onMultiSelect.bind(t),t.$onSingleSelect=t.$onSingleSelect.bind(t),t.$multiselectOnSessionChange=e.onSessionChange.bind(t),t.$checkMultiselectChange=t.$checkMultiselectChange.bind(t),t.$multiselectOnSessionChange(t),t.on("changeSession",t.$multiselectOnSessionChange),t.on("mousedown",o),t.commands.addCommands(c.defaultCommands),function(t){if(t.textInput){var e=t.textInput.getElement(),n=!1;a.addListener(e,"keydown",function(e){t.$blockSelectEnabled&&18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey)?n||(t.renderer.setMouseCursor("crosshair"),n=!0):n&&i()},t),a.addListener(e,"keyup",i,t),a.addListener(e,"blur",i,t)}function i(e){n&&(t.renderer.setMouseCursor(""),n=!1)}}(t))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(t){t.cursor||(t.cursor=t.end);var e=this.getSelectionStyle();return t.marker=this.session.addMarker(t,"ace_selection",e),this.session.$selectionMarkers.push(t),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,t},this.removeSelectionMarker=function(t){if(t.marker){this.session.removeMarker(t.marker);var e=this.session.$selectionMarkers.indexOf(t);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(t){for(var e=this.session.$selectionMarkers,n=t.length;n--;){var i=t[n];if(i.marker){this.session.removeMarker(i.marker);var r=e.indexOf(i);-1!=r&&e.splice(r,1)}}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(t){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(t){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(t){var e=t.command,n=t.editor;if(n.multiSelect){if(e.multiSelectAction)"forEach"==e.multiSelectAction?i=n.forEachSelection(e,t.args):"forEachLine"==e.multiSelectAction?i=n.forEachSelection(e,t.args,!0):"single"==e.multiSelectAction?(n.exitMultiSelectMode(),i=e.exec(n,t.args||{})):i=e.multiSelectAction(n,t.args||{});else{var i=e.exec(n,t.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(t,e,n){if(!this.inVirtualSelectionMode){var i,r=1==n||n&&n.$byLines,o=this.session,a=this.selection,l=(n&&n.keepOrder?a:a.rangeList).ranges;if(!l.length)return t.exec?t.exec(this,e||{}):t(this,e||{});var c=a._eventRegistry;a._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var u=l.length;u--;){if(r)for(;u>0&&l[u].start.row==l[u-1].end.row;)u--;h.fromOrientedRange(l[u]),h.index=u,this.selection=o.selection=h;var d=t.exec?t.exec(this,e||{}):t(this,e||{});i||void 0===d||(i=d),h.toOrientedRange(l[u])}h.detach(),this.selection=o.selection=a,this.inVirtualSelectionMode=!1,a._eventRegistry=c,a.mergeOverlappingRanges(),a.ranges[0]&&a.fromOrientedRange(a.ranges[0]);var p=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),p&&p.from==p.to&&this.renderer.animateScrolling(p.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var t="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var e=this.multiSelect.rangeList.ranges,n=[],i=0;io&&(o=n.column),ih?t.insert(i,l.stringRepeat(" ",s-h)):t.remove(new r(i.row,i.column,i.row,i.column-s+h)),e.start.column=e.end.column=o,e.start.row=e.end.row=i.row,e.cursor=e.end}),e.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),u=h.start.row,d=h.end.row,p=u==d;if(p){var f,g=this.session.getLength();do{f=this.session.getLine(d)}while(/[=:]/.test(f)&&++d0);u<0&&(u=0),d>=g&&(d=g-1)}var m=this.session.removeFullLines(u,d);m=this.$reAlignText(m,p),this.session.insert({row:u,column:0},m.join("\n")+"\n"),p||(h.start.column=0,h.end.column=m[m.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(t,e){var n,i,r,s=!0,o=!0;return t.map(function(t){var e=t.match(/(\s*)(.*?)(\s*)([=:].*)/);return e?null==n?(n=e[1].length,i=e[2].length,r=e[3].length,e):(n+i+r!=e[1].length+e[2].length+e[3].length&&(o=!1),n!=e[1].length&&(s=!1),n>e[1].length&&(n=e[1].length),ie[3].length&&(r=e[3].length),e):[t]}).map(e?c:s?o?function(t){return t[2]?a(n+i-t[2].length)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}:c:function(t){return t[2]?a(n)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]});function a(t){return l.stringRepeat(" ",t)}function c(t){return t[2]?a(n)+t[2]+a(i-t[2].length+r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}}}).call(d.prototype),e.onSessionChange=function(t){var e=t.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var n=t.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),e&&(e.multiSelect.on("addRange",this.$onAddRange),e.multiSelect.on("removeRange",this.$onRemoveRange),e.multiSelect.on("multiSelect",this.$onMultiSelect),e.multiSelect.on("singleSelect",this.$onSingleSelect),e.multiSelect.lead.on("change",this.$checkMultiselectChange),e.multiSelect.anchor.on("change",this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},e.MultiSelect=p,t("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(t){p(this),t?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,e,n){"use strict";var i=t("../../range").Range,r=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(t,e,n){var i=t.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==e&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(t,e,n){return null},this.indentationBlock=function(t,e,n){var r=/\S/,s=t.getLine(e),o=s.search(r);if(-1!=o){for(var a=n||s.length,l=t.getLength(),c=e,h=e;++ec){var p=t.getLine(h).length;return new i(c,a,h,p)}}},this.openingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r+1},a=t.$findClosingBracket(e,o,s);if(a){var l=t.foldWidgets[a.row];return null==l&&(l=t.getFoldWidget(a.row)),"start"==l&&a.row>o.row&&(a.row--,a.column=t.getLine(a.row).length),i.fromPoints(o,a)}},this.closingBracketBlock=function(t,e,n,r,s){var o={row:n,column:r},a=t.$findOpeningBracket(e,o);if(a)return a.column++,o.column--,i.fromPoints(a,o)}}).call(r.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";e.isDark=!1,e.cssClass="ace-tm",e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',e.$id="ace/theme/textmate",t("../lib/dom").importCssString(e.cssText,e.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,e,n){"use strict";var i=t("./lib/dom");function r(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(t){var e;return e=this.lineWidgets&&this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0,this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1+e:1+e},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)}),t},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on("beforeRender",this.measureWidgets),t.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(t){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(t,e){var n=e.lineWidgets;if(n&&t.action){for(var i=t.data,r=i.start.row,s=i.end.row,o="add"==t.action,a=r+1;ae[n].column&&n++,s.unshift(n,0),e.splice.apply(e,s),this.$updateRows()}}},this.$updateRows=function(){var t=this.session.lineWidgets;if(t){var e=!0;t.forEach(function(t,n){if(t)for(e=!1,t.row=n;t.$oldWidget;)t.$oldWidget.row=n,t=t.$oldWidget}),e&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(t){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var e=this.session.lineWidgets[t.row];return e&&(t.$oldWidget=e,e.el&&e.el.parentNode&&(e.el.parentNode.removeChild(e.el),e._inDocument=!1)),this.session.lineWidgets[t.row]=t,t},this.addLineWidget=function(t){if(this.$registerLineWidget(t),t.session=this.session,!this.editor)return t;var e=this.editor.renderer;t.html&&!t.el&&(t.el=i.createElement("div"),t.el.innerHTML=t.html),t.el&&(i.addCssClass(t.el,"ace_lineWidgetContainer"),t.el.style.position="absolute",t.el.style.zIndex=5,e.container.appendChild(t.el),t._inDocument=!0,t.coverGutter||(t.el.style.zIndex=3),null==t.pixelHeight&&(t.pixelHeight=t.el.offsetHeight)),null==t.rowCount&&(t.rowCount=t.pixelHeight/e.layerConfig.lineHeight);var n=this.session.getFoldAt(t.row,0);if(t.$fold=n,n){var r=this.session.lineWidgets;t.row!=n.end.row||r[n.start.row]?t.hidden=!0:r[n.start.row]=t}return this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows(),this.renderWidgets(null,e),this.onWidgetChanged(t),t},this.removeLineWidget=function(t){if(t._inDocument=!1,t.session=null,t.el&&t.el.parentNode&&t.el.parentNode.removeChild(t.el),t.editor&&t.editor.destroy)try{t.editor.destroy()}catch(n){}if(this.session.lineWidgets){var e=this.session.lineWidgets[t.row];if(e==t)this.session.lineWidgets[t.row]=t.$oldWidget,t.$oldWidget&&this.onWidgetChanged(t.$oldWidget);else for(;e;){if(e.$oldWidget==t){e.$oldWidget=t.$oldWidget;break}e=e.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(t){for(var e=this.session.lineWidgets,n=e&&e[t],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(t){this.session._changedWidgets.push(t),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(t,e){var n=this.session._changedWidgets,i=e.layerConfig;if(n&&n.length){for(var r=1/0,s=0;s0&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,e.$cursorLayer.config=n;for(var o=r;o<=s;o++){var a=i[o];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,e.container.appendChild(a.el));var l=e.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:e.gutterWidth;a.fixedWidth||(c-=e.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.el.style.right=a.fixedWidth?e.scrollBar.getWidth()+"px":""}}}}}).call(r.prototype),e.LineWidgets=r}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(t,e,n){"use strict";var i=t("../line_widgets").LineWidgets,r=t("../lib/dom"),s=t("../range").Range;e.showErrorMarker=function(t,e){var n=t.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(t));var o=t.getCursorPosition(),a=o.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(t){return"errorMarker"==t.type})[0];l?l.destroy():a-=e;var c,h=function(t,e,n){var i=t.getAnnotations().sort(s.comparePoints);if(i.length){var r=function(t,e,n){for(var i=0,r=t.length-1;i<=r;){var s=i+r>>1,o=n(e,t[s]);if(o>0)i=s+1;else{if(!(o<0))return s;r=s-1}}return-(i+1)}(i,{row:e,column:-1},s.comparePoints);r<0&&(r=-r-1),r>=i.length?r=n>0?0:i.length-1:0===r&&n<0&&(r=i.length-1);var o=i[r];if(o&&n){if(o.row===e){do{o=i[r+=n]}while(o&&o.row===e);if(!o)return i.slice()}var a=[];e=o.row;do{a[n<0?"unshift":"push"](o),o=i[r+=n]}while(o&&o.row==e);return a.length&&a}}}(n,a,e);if(h){var u=h[0];o.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,o.row=u.row,c=t.renderer.$gutterLayer.$annotations[o.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(o.row),t.selection.moveToPosition(o);var d={row:o.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},p=d.el.appendChild(r.createElement("div")),f=d.el.appendChild(r.createElement("div"));f.className="error_widget_arrow "+c.className;var g=t.renderer.$cursorLayer.getPixelPosition(o).left;f.style.left=g+t.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",p.className="error_widget "+c.className,p.innerHTML=c.text.join("
"),p.appendChild(r.createElement("div"));var m=function(t,e,n){if(0===e&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(d),t.off("changeSelection",d.destroy),t.off("changeSession",d.destroy),t.off("mouseup",d.destroy),t.off("change",d.destroy))},t.keyBinding.addKeyboardHandler(m),t.on("changeSelection",d.destroy),t.on("changeSession",d.destroy),t.on("mouseup",d.destroy),t.on("change",d.destroy),t.session.widgetManager.addLineWidget(d),d.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(t,e,i){"use strict";t("./lib/fixoldbrowsers");var r=t("./lib/dom"),s=t("./lib/event"),o=t("./range").Range,a=t("./editor").Editor,l=t("./edit_session").EditSession,c=t("./undomanager").UndoManager,h=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),e.config=t("./config"),e.require=t,e.define=n("B9Yq"),e.edit=function(t,n){if("string"==typeof t){var i=t;if(!(t=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(t&&t.env&&t.env.editor instanceof a)return t.env.editor;var o="";if(t&&/input|textarea/i.test(t.tagName)){var l=t;o=l.value,t=r.createElement("pre"),l.parentNode.replaceChild(t,l)}else t&&(o=t.textContent,t.innerHTML="");var c=e.createEditSession(o),u=new a(new h(t),c,n),d={document:c,editor:u,onResize:u.resize.bind(u,null)};return l&&(d.textarea=l),s.addListener(window,"resize",d.onResize),u.on("destroy",function(){s.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},e.createEditSession=function(t,e){var n=new l(t,e);return n.setUndoManager(new c),n},e.Range=o,e.Editor=a,e.EditSession=l,e.UndoManager=c,e.VirtualRenderer=h,e.version=e.config.version}),ace.require(["ace/ace"],function(e){for(var n in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(n)&&(window.ace[n]=e[n]);window.ace.default=window.ace,t&&(t.exports=window.ace)})}).call(this,n("YuTi")(t))},hyoZ:function(t,e,n){"use strict";var i=n("w+qe"),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=function(t,e){var n,o;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===r.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(o={},null!==(n=e.styleAliases||null)&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){o[String(e)]=t})}),o),-1===s.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},jO2K:function(t,e,n){"use strict";var i;try{i=n("tjlA").Buffer}catch(o){}var r=n("hyoZ"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,o=s;for(n=0;n64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,r=t.replace(/[\r\n=]/g,""),o=r.length,a=s,l=0,c=[];for(e=0;e>16&255),c.push(l>>8&255),c.push(255&l)),l=l<<6|a.indexOf(r.charAt(e));return 0==(n=o%4*6)?(c.push(l>>16&255),c.push(l>>8&255),c.push(255&l)):18===n?(c.push(l>>10&255),c.push(l>>2&255)):12===n&&c.push(l>>4&255),i?i.from?i.from(c):new i(c):c},predicate:function(t){return i&&i.isBuffer(t)},represent:function(t){var e,n,i="",r=0,o=t.length,a=s;for(e=0;e>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},"kVK+":function(t,e){e.read=function(t,e,n,i,r){var s,o,a=8*r-i-1,l=(1<>1,h=-7,u=n?r-1:0,d=n?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,n,i,r,s){var o,a,l,c=8*s-r-1,h=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<0;t[n+p]=255&o,p+=f,o/=256,c-=8);t[n+p-f]|=128*g}},peYA:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},pzZA:function(t,e,n){"use strict";var i=n("hyoZ"),r=Object.prototype.hasOwnProperty;t.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(r.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},spQ0:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},tN50:function(t,e,n){"use strict";var i=n("Y2Yi");function r(t,e,n,i,r){this.name=t,this.buffer=e,this.position=n,this.line=i,this.column=r}r.prototype.getSnippet=function(t,e){var n,r,s,o,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",r=this.position;r>0&&-1==="\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(this.position-(r-=1)>e/2-1){n=" ... ",r+=5;break}for(s="",o=this.position;oe/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(r,o),i.repeat(" ",t)+n+a+s+"\n"+i.repeat(" ",t+this.position-r+n.length)+"^"},r.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=r},tjlA:function(t,e,n){"use strict";var i=n("H7XF"),r=n("kVK+"),s=n("49sm");function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(i)return U(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function v(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,i,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,i,r){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var h=-1;for(s=n;sa&&(n=a-l),s=n;s>=0;s--){for(var u=!0,d=0;dr&&(i=r):i=r;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,r.push(n%256),r.push(i);return r}(e,t.length-n),t,n,i)}function E(t,e,n){return i.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+u<=n)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[r+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:o=t[r+2],128==(192&(s=t[r+1]))&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+2],a=t[r+3],128==(192&(s=t[r+1]))&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(i.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),i.push(h),r+=u}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);for(var n="",i=0;i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,i,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,r),h=t.slice(e,n),u=0;ur)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function D(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;rr)&&(n=r);for(var s="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,i,r,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function I(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,s=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function $(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,s=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function O(t,e,n,i,r,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,i,s){return s||O(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function N(t,e,n,i,s){return s||O(t,0,n,8),r.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[t+--e]*r;return i},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=this[t],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var i=e,r=1,s=this[t+--i];i>0&&(r*=256);)s+=this[t+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+r]=t/s&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):$(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):$(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function V(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}},vQl5:function(t,e,n){"use strict";var i=n("hyoZ");t.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},"w+qe":function(t,e,n){"use strict";function i(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}(i.prototype=Object.create(Error.prototype)).constructor=i,i.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=i},ydHo:function(t,e,n){"use strict";var i=n("Y2Yi"),r=n("hyoZ");function s(t){return 48<=t&&t<=55}function o(t){return 48<=t&&t<=57}t.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=t.length,r=0,a=!1;if(!i)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===i)return!0;if("b"===(e=t[++r])){for(r++;r=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},zUnb:function(t,e,n){"use strict";function i(t){return"function"==typeof t}n.r(e);let r=!1;const s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}};function o(t){setTimeout(()=>{throw t},0)}const a={closed:!0,next(t){},error(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;o(t)},complete(){}},l=(()=>Array.isArray||(t=>t&&"number"==typeof t.length))();function c(t){return null!==t&&"object"==typeof t}const h=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();let u=(()=>{class t{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:s,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(let t=0;tt.concat(e instanceof h?e.errors:e),[])}const p=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class f extends u{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!t){this.destination=a;break}if("object"==typeof t){t instanceof f?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,t,e,n)}}[p](){return this}static create(t,e,n){const i=new f(t,e,n);return i.syncErrorThrowable=!1,i}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class g extends f{constructor(t,e,n,r){let s;super(),this._parentSubscriber=t;let o=this;i(e)?s=e:e&&(s=e.next,n=e.error,r=e.complete,e!==a&&(o=Object.create(e),i(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=n,this._complete=r}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;s.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=s;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):o(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;o(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw n;o(n)}}__tryOrSetError(t,e,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(i){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=i,t.syncErrorThrown=!0,!0):(o(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const m=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function v(t){return t}let y=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:i}=this,r=function(t,e,n){if(t){if(t instanceof f)return t;if(t[p])return t[p]()}return t||e||n?new f(t,e,n):new f(a)}(t,e,n);if(r.add(i?i.call(r,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),s.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){s.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof f?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=b(e))((e,n)=>{let i;i=this.subscribe(e=>{try{t(e)}catch(r){n(r),i&&i.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[m](){return this}pipe(...t){return 0===t.length?this:(0===(e=t).length?v:1===e.length?e[0]:function(t){return e.reduce((t,e)=>e(t),t)})(this);var e}toPromise(t){return new(t=b(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function b(t){if(t||(t=s.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const w=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class x extends u{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class _ extends f{constructor(t){super(t),this.destination=t}}let C=(()=>{class t extends y{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new _(this)}lift(t){const e=new S(this,this);return e.operator=t,e}next(t){if(this.closed)throw new w;if(!this.isStopped){const{observers:e}=this,n=e.length,i=e.slice();for(let r=0;rnew S(t,e),t})();class S extends C{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):u.EMPTY}}function E(t){return t&&"function"==typeof t.schedule}function k(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new A(t,e))}}class A{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new D(t,this.project,this.thisArg))}}class D extends f{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const T=t=>e=>{for(let n=0,i=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function M(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const I=t=>{if(t&&"function"==typeof t[m])return i=t,t=>{const e=i[m]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(L(t))return T(t);if(M(t))return n=t,t=>(n.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,o),t);if(t&&"function"==typeof t[F])return e=t,t=>{const n=e[F]();for(;;){let e;try{e=n.next()}catch(i){return t.error(i),t}if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t};{const e=c(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var e,n,i};function $(t,e){return new y(n=>{const i=new u;let r=0;return i.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||i.add(this.schedule())):n.complete()})),i})}function O(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[m]}(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>{const r=t[m]();i.add(r.subscribe({next(t){i.add(e.schedule(()=>n.next(t)))},error(t){i.add(e.schedule(()=>n.error(t)))},complete(){i.add(e.schedule(()=>n.complete()))}}))})),i})}(t,e);if(M(t))return function(t,e){return new y(n=>{const i=new u;return i.add(e.schedule(()=>t.then(t=>{i.add(e.schedule(()=>{n.next(t),i.add(e.schedule(()=>n.complete()))}))},t=>{i.add(e.schedule(()=>n.error(t)))}))),i})}(t,e);if(L(t))return $(t,e);if(function(t){return t&&"function"==typeof t[F]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new y(n=>{const i=new u;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=t[F](),i.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(i){return void n.error(i)}e?n.complete():(n.next(t),this.schedule())}))})),i})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof y?t:new y(I(t))}class P extends f{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class N extends f{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function B(t,e){if(!e.closed)return t instanceof y?t.subscribe(e):I(t)(e)}function U(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(U((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new V(t,n)))}class V{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new H(t,this.project,this.concurrent))}}class H extends N{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function j(t=Number.POSITIVE_INFINITY){return U(v,t)}function z(t,e){return e?$(t,e):new y(T(t))}function W(...t){let e=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return E(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof i&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof y?t[0]:j(e)(z(t,n))}function G(){return function(t){return t.lift(new q(t))}}class q{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const i=new K(t,n),r=e.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class K extends f{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,i=t._connection;this.connection=null,!i||n&&i!==n||i.unsubscribe()}}class X extends y{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new u,t.add(this.source.subscribe(new J(this.getSubject(),this))),t.closed&&(this._connection=null,t=u.EMPTY)),t}refCount(){return G()(this)}}const Y=(()=>{const t=X.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class J extends _{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function Q(){return new C}function Z(){return t=>{return G()((e=Q,function(t){let n;n="function"==typeof e?e:function(){return e};const i=Object.create(t,Y);return i.source=t,i.subjectFactory=n,i})(t));var e}}function tt(t){for(let e in t)if(t[e]===tt)return e;throw Error("Could not find renamed property on target object.")}function et(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function nt(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(nt).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function it(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const rt=tt({__forward_ref__:tt});function st(t){return t.__forward_ref__=st,t.toString=function(){return nt(this())},t}function ot(t){return at(t)?t():t}function at(t){return"function"==typeof t&&t.hasOwnProperty(rt)&&t.__forward_ref__===st}function lt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function ct(t){return{factory:t.factory,providers:t.providers||[],imports:t.imports||[]}}function ht(t){return ut(t,pt)||ut(t,gt)}function ut(t,e){return t.hasOwnProperty(e)?t[e]:null}function dt(t){return t&&(t.hasOwnProperty(ft)||t.hasOwnProperty(mt))?t[ft]:null}const pt=tt({"\u0275prov":tt}),ft=tt({"\u0275inj":tt}),gt=tt({ngInjectableDef:tt}),mt=tt({ngInjectorDef:tt});var vt=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});let yt;function bt(t){const e=yt;return yt=t,e}function wt(t,e,n){const i=ht(t);if(i&&"root"==i.providedIn)return void 0===i.value?i.value=i.factory():i.value;if(n&vt.Optional)return null;if(void 0!==e)return e;throw new Error(`Injector: NOT_FOUND [${nt(t)}]`)}function xt(t){return{toString:t}.toString()}var _t=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}({}),Ct=function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({});const St="undefined"!=typeof globalThis&&globalThis,Et="undefined"!=typeof window&&window,kt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,At="undefined"!=typeof global&&global,Dt=St||At||Et||kt,Tt={},Rt=[],Ft=tt({"\u0275cmp":tt}),Lt=tt({"\u0275dir":tt}),Mt=tt({"\u0275pipe":tt}),It=tt({"\u0275mod":tt}),$t=tt({"\u0275loc":tt}),Ot=tt({"\u0275fac":tt}),Pt=tt({__NG_ELEMENT_ID__:tt});let Nt=0;function Bt(t){return xt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===_t.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||Rt,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||Ct.Emulated,id:"c",styles:t.styles||Rt,_:null,setInput:null,schemas:t.schemas||null,tView:null},i=t.directives,r=t.features,s=t.pipes;return n.id+=Nt++,n.inputs=zt(t.inputs,e),n.outputs=zt(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(Ut):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(Vt):null,n})}function Ut(t){return Gt(t)||function(t){return t[Lt]||null}(t)}function Vt(t){return function(t){return t[Mt]||null}(t)}const Ht={};function jt(t){const e={type:t.type,bootstrap:t.bootstrap||Rt,declarations:t.declarations||Rt,imports:t.imports||Rt,exports:t.exports||Rt,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&xt(()=>{Ht[t.id]=t.type}),e}function zt(t,e){if(null==t)return Tt;const n={};for(const i in t)if(t.hasOwnProperty(i)){let r=t[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,e&&(e[r]=s)}return n}const Wt=Bt;function Gt(t){return t[Ft]||null}function qt(t,e){const n=t[It]||null;if(!n&&!0===e)throw new Error(`Type ${nt(t)} does not have '\u0275mod' property.`);return n}const Kt=20,Xt=10;function Yt(t){return Array.isArray(t)&&"object"==typeof t[1]}function Jt(t){return Array.isArray(t)&&!0===t[1]}function Qt(t){return 0!=(8&t.flags)}function Zt(t){return 2==(2&t.flags)}function te(t){return 1==(1&t.flags)}function ee(t){return null!==t.template}function ne(t,e){return t.hasOwnProperty(Ot)?t[Ot]:null}class ie extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function re(t){return"string"==typeof t?t:null==t?"":String(t)}function se(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():re(t)}function oe(t,e){const n=e?" in "+e:"";throw new ie("201",`No provider for ${se(t)} found${n}`)}class ae{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function le(){return ce}function ce(t){return t.type.prototype.ngOnChanges&&(t.setInput=ue),he}function he(){const t=de(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===Tt)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function ue(t,e,n,i){const r=de(t)||function(t,e){return t.__ngSimpleChanges__=e}(t,{previous:Tt,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],l=o[a];s[a]=new ae(l&&l.currentValue,e,o===Tt),t[i]=e}function de(t){return t.__ngSimpleChanges__||null}le.ngInherit=!0;const pe="http://www.w3.org/2000/svg";let fe=void 0;function ge(){return void 0!==fe?fe:"undefined"!=typeof document?document:void 0}function me(t){return!!t.listen}const ve={createRenderer:(t,e)=>ge()};function ye(t){for(;Array.isArray(t);)t=t[0];return t}function be(t,e){return ye(e[t])}function we(t,e){return ye(e[t.index])}function xe(t,e){return t.data[e]}function _e(t,e){return t[e]}function Ce(t,e){const n=e[t];return Yt(n)?n:n[0]}function Se(t){const e=function(t){return t.__ngContext__||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Ee(t){return 4==(4&t[2])}function ke(t){return 128==(128&t[2])}function Ae(t,e){return null==e?null:t[e]}function De(t){t[18]=0}function Te(t,e){t[5]+=e;let n=t,i=t[3];for(;null!==i&&(1===e&&1===n[5]||-1===e&&0===n[5]);)i[5]+=e,n=i,i=i[3]}const Re={lFrame:tn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Fe(){return Re.bindingsEnabled}function Le(){return Re.lFrame.lView}function Me(){return Re.lFrame.tView}function Ie(t){Re.lFrame.contextLView=t}function $e(){let t=Oe();for(;null!==t&&64===t.type;)t=t.parent;return t}function Oe(){return Re.lFrame.currentTNode}function Pe(t,e){const n=Re.lFrame;n.currentTNode=t,n.isParent=e}function Ne(){return Re.lFrame.isParent}function Be(){Re.lFrame.isParent=!1}function Ue(){return Re.isInCheckNoChangesMode}function Ve(t){Re.isInCheckNoChangesMode=t}function He(){const t=Re.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function je(){return Re.lFrame.bindingIndex}function ze(){return Re.lFrame.bindingIndex++}function We(t){const e=Re.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function Ge(t,e){const n=Re.lFrame;n.bindingIndex=n.bindingRootIndex=t,qe(e)}function qe(t){Re.lFrame.currentDirectiveIndex=t}function Ke(){return Re.lFrame.currentQueryIndex}function Xe(t){Re.lFrame.currentQueryIndex=t}function Ye(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function Je(t,e,n){if(n&vt.SkipSelf){let i=e,r=t;for(;i=i.parent,!(null!==i||n&vt.Host||(i=Ye(r),null===i)||(r=r[15],10&i.type)););if(null===i)return!1;e=i,t=r}const i=Re.lFrame=Ze();return i.currentTNode=e,i.lView=t,!0}function Qe(t){const e=Ze(),n=t[1];Re.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function Ze(){const t=Re.lFrame,e=null===t?null:t.child;return null===e?tn(t):e}function tn(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function en(){const t=Re.lFrame;return Re.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const nn=en;function rn(){const t=en();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function sn(){return Re.lFrame.selectedIndex}function on(t){Re.lFrame.selectedIndex=t}function an(){const t=Re.lFrame;return xe(t.tView,t.selectedIndex)}function ln(){Re.lFrame.currentNamespace=pe}function cn(){Re.lFrame.currentNamespace=null}function hn(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n=i)break}else e[o]<0&&(t[18]+=65536),(s>11>16&&(3&t[2])===e&&(t[2]+=2048,s.call(o)):s.call(o)}const mn=-1;class vn{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function yn(t,e,n){const i=me(t);let r=0;for(;re){o=s-1;break}}}for(;s>16,i=e;for(;n>0;)i=i[15],n--;return i}let kn=!0;function An(t){const e=kn;return kn=t,e}let Dn=0;function Tn(t,e){const n=Fn(t,e);if(-1!==n)return n;const i=e[1];i.firstCreatePass&&(t.injectorIndex=e.length,Rn(i.data,t),Rn(e,null),Rn(i.blueprint,null));const r=Ln(t,e),s=t.injectorIndex;if(Cn(r)){const t=Sn(r),n=En(r,e),i=n[1].data;for(let r=0;r<8;r++)e[s+r]=n[t+r]|i[t+r]}return e[s+8]=r,s}function Rn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Fn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function Ln(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,i=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(i=2===e?t.declTNode:1===e?r[6]:null,null===i)return mn;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return mn}function Mn(t,e,n){!function(t,e,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(Pt)&&(i=n[Pt]),null==i&&(i=n[Pt]=Dn++);const r=255&i,s=1<=0?255&e:Nn:e}(n);if("function"==typeof s){if(!Je(e,t,i))return i&vt.Host?In(r,n,i):$n(e,n,i,r);try{const t=s();if(null!=t||i&vt.Optional)return t;oe(n)}finally{nn()}}else if("number"==typeof s){let r=null,o=Fn(t,e),a=mn,l=i&vt.Host?e[16][6]:null;for((-1===o||i&vt.SkipSelf)&&(a=-1===o?Ln(t,e):e[o+8],a!==mn&&jn(i,!1)?(r=e[1],o=Sn(a),e=En(a,e)):o=-1);-1!==o;){const t=e[1];if(Hn(s,o,t.data)){const t=Bn(o,e,n,r,i,l);if(t!==Pn)return t}a=e[o+8],a!==mn&&jn(i,e[1].data[o+8]===l)&&Hn(s,o,e)?(r=t,o=Sn(a),e=En(a,e)):o=-1}}}return $n(e,n,i,r)}const Pn={};function Nn(){return new zn($e(),Le())}function Bn(t,e,n,i,r,s){const o=e[1],a=o.data[t+8],l=Un(a,o,n,null==i?Zt(a)&&kn:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==l?Vn(e,o,l,a):Pn}function Un(t,e,n,i,r){const s=t.providerIndexes,o=e.data,a=1048575&s,l=t.directiveStart,c=s>>20,h=r?a+c:t.directiveEnd;for(let u=i?a:a+c;u=l&&t.type===n)return u}if(r){const t=o[l];if(t&&ee(t)&&t.type===n)return l}return null}function Vn(t,e,n,i){let r=t[n];const s=e.data;if(r instanceof vn){const o=r;o.resolving&&function(t,e){throw new ie("200","Circular dependency in DI detected for "+t)}(se(s[n]));const a=An(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?bt(o.injectImpl):null;Je(t,i,vt.Default);try{r=t[n]=o.factory(void 0,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&function(t,e,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const i=ce(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s))}(n,s[n],e)}finally{null!==l&&bt(l),An(a),o.resolving=!1,nn()}}return r}function Hn(t,e,n){const i=64&t,r=32&t;let s;return s=128&t?i?r?n[e+7]:n[e+6]:r?n[e+5]:n[e+4]:i?r?n[e+3]:n[e+2]:r?n[e+1]:n[e],!!(s&1<{const t=Wn(ot(e));return t?t():null};let n=ne(e);if(null===n){const t=dt(e);n=t&&t.factory}return n||null}function Gn(t){return xt(()=>{const e=t.prototype.constructor,n=e[Ot]||Wn(e),i=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==i;){const t=r[Ot]||Wn(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function qn(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let i=0;for(;i{const i=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return i.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,i){const r=t.hasOwnProperty(Kn)?t[Kn]:Object.defineProperty(t,Kn,{value:[]})[Kn];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class Yn{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=lt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return"InjectionToken "+this._desc}}const Jn=new Yn("AnalyzeForEntryComponents"),Qn=Function;function Zn(t,e){void 0===e&&(e=t);for(let n=0;nArray.isArray(t)?ti(t,e):e(t))}function ei(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ni(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function ii(t,e){const n=[];for(let i=0;i=0?t[1|i]=n:(i=~i,function(t,e,n,i){let r=t.length;if(r==e)t.push(n,i);else if(1===r)t.push(i,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=i}}(t,i,e,n)),i}function si(t,e){const n=oi(t,e);if(n>=0)return t[1|n]}function oi(t,e){return function(t,e,n){let i=0,r=t.length>>1;for(;r!==i;){const n=i+(r-i>>1),s=t[n<<1];if(e===s)return n<<1;s>e?r=n:i=n+1}return~(r<<1)}(t,e)}const ai=Xn("Inject",t=>({token:t})),li=Xn("Optional"),ci=Xn("Self"),hi=Xn("SkipSelf"),ui={},di=/\n/gm,pi="__source",fi=tt({provide:String,useValue:tt});let gi,mi=void 0;function vi(t){const e=mi;return mi=t,e}function yi(t,e=vt.Default){if(void 0===mi)throw new Error("inject() must be called from an injection context");return null===mi?wt(t,void 0,e):mi.get(t,e&vt.Optional?null:void 0,e)}function bi(t,e=vt.Default){return(yt||yi)(ot(t),e)}function wi(t){const e=[];for(let n=0;nt,createScript:t=>t,createScriptURL:t=>t})}catch(e){}return gi}())||void 0===e?void 0:e.createHTML(t))||t}class _i{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see https://g.co/ng/security#xss)"}}class Ci extends _i{getTypeName(){return"HTML"}}class Si extends _i{getTypeName(){return"Style"}}class Ei extends _i{getTypeName(){return"Script"}}class ki extends _i{getTypeName(){return"URL"}}class Ai extends _i{getTypeName(){return"ResourceURL"}}function Di(t){return t instanceof _i?t.changingThisBreaksApplicationSecurity:t}function Ti(t,e){const n=Ri(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}function Ri(t){return t instanceof _i&&t.getTypeName()||null}class Fi{getInertBodyElement(t){t=""+t;try{const e=(new window.DOMParser).parseFromString(xi(t),"text/html").body;return e.removeChild(e.firstChild),e}catch(e){return null}}}class Li{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=xi(t),e;const n=this.inertDocument.createElement("body");return n.innerHTML=xi(t),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let i=e.length-1;0$i(t.trim())).join(", ")),this.buf.push(" ",e,'="',Yi(o),'"')}var i;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();Hi.hasOwnProperty(e)&&!Ni.hasOwnProperty(e)&&(this.buf.push(""))}chars(t){this.buf.push(Yi(t))}checkClobberedElement(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}}const Ki=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xi=/([^\#-~ |!])/g;function Yi(t){return t.replace(/&/g,"&").replace(Ki,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Xi,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Ji;function Qi(t,e){let n=null;try{Ji=Ji||function(t){return function(){try{return!!(new window.DOMParser).parseFromString(xi(""),"text/html")}catch(t){return!1}}()?new Fi:new Li(t)}(t);let i=e?String(e):"";n=Ji.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=Ji.getInertBodyElement(i)}while(i!==s);return(new qi).sanitizeChildren(Zi(n)||n)}finally{if(n){const t=Zi(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function Zi(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var tr=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}({});function er(t){const e=ir();return e?e.sanitize(tr.HTML,t)||"":Ti(t,"HTML")?Di(t):Qi(ge(),re(t))}function nr(t){const e=ir();return e?e.sanitize(tr.URL,t)||"":Ti(t,"URL")?Di(t):$i(re(t))}function ir(){const t=Le();return t&&t[12]}function rr(t){return t.ngDebugContext}function sr(t){return t.ngOriginalError}function or(t,...e){t.error(...e)}class ar{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),i=function(t){return t.ngErrorLogger||or}(t);i(this._console,"ERROR",t),e&&i(this._console,"ORIGINAL ERROR",e),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?rr(t)?rr(t):this._findContext(sr(t)):null}_findOriginalError(t){let e=sr(t);for(;e&&sr(e);)e=sr(e);return e}}function lr(t,e){t.__ngContext__=e}const cr=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Dt))();function hr(t){return{name:"window",target:t.ownerDocument.defaultView}}function ur(t){return t instanceof Function?t():t}var dr=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({});function pr(t,e){return(void 0)(t,e)}function fr(t){const e=t[3];return Jt(e)?e[3]:e}function gr(t){return vr(t[13])}function mr(t){return vr(t[4])}function vr(t){for(;null!==t&&!Jt(t);)t=t[4];return t}function yr(t,e,n,i,r){if(null!=i){let s,o=!1;Jt(i)?s=i:Yt(i)&&(o=!0,i=i[0]);const a=ye(i);0===t&&null!==n?null==r?kr(e,n,a):Er(e,n,a,r||null,!0):1===t&&null!==n?Er(e,n,a,r||null,!0):2===t?function(t,e,n){const i=Dr(t,e);i&&function(t,e,n,i){me(t)?t.removeChild(e,n,i):e.removeChild(n)}(t,i,e,n)}(e,a,o):3===t&&e.destroyNode(a),null!=s&&function(t,e,n,i,r){const s=n[7];s!==ye(n)&&yr(e,t,i,s,r);for(let o=Xt;o0&&(t[n-1][4]=i[4]);const o=ni(t,Xt+e);$r(i[1],r=i,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}var r;return i}function _r(t,e){if(!(256&e[2])){const n=e[11];me(n)&&n.destroyNode&&$r(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Cr(t[1],t);for(;e;){let n=null;if(Yt(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)Yt(e)&&Cr(e[1],e),e=e[3];null===e&&(e=t),Yt(e)&&Cr(e[1],e),n=e&&e[4]}e=n}}(e)}}function Cr(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let i=0;i=0?i[r=l]():i[r=-l].unsubscribe(),t+=2}else{const e=i[r=n[t+1]];n[t].call(e)}if(null!==i)for(let t=r+1;ts?"":r[h+1].toLowerCase();const e=8&i?t:null;if(e&&-1!==Br(e,c,0)||2&i&&c!==t){if(Wr(i))return!1;o=!0}}}}else{if(!o&&!Wr(i)&&!Wr(l))return!1;if(o&&Wr(l))continue;o=!1,i=l|1&i}}return Wr(i)||o}function Wr(t){return 0==(1&t)}function Gr(t,e,n,i){if(null===e)return-1;let r=0;if(i||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""===r||Wr(o)||(e+=Xr(s,r),r=""),i=o,s=s||!Wr(i);n++}return""!==r&&(e+=Xr(s,r)),e}const Jr={};function Qr(t){Zr(Me(),Le(),sn()+t,Ue())}function Zr(t,e,n,i){if(!i)if(3==(3&e[2])){const i=t.preOrderCheckHooks;null!==i&&un(e,i,n)}else{const i=t.preOrderHooks;null!==i&&dn(e,i,0,n)}on(n)}function ts(t,e){return t<<17|e<<2}function es(t){return t>>17&32767}function ns(t){return 2|t}function is(t){return(131068&t)>>2}function rs(t,e){return-131069&t|e<<2}function ss(t){return 1|t}function os(t,e){const n=t.contentQueries;if(null!==n)for(let i=0;iKt&&Zr(t,e,Kt,Ue()),n(i,r)}finally{on(s)}}function fs(t,e,n){if(Qt(e)){const i=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function Ss(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Es(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function ks(t,e,n){if(n){if(e.exportAs)for(let i=0;i0&&Is(n)}}function Is(t){for(let n=gr(t);null!==n;n=mr(n))for(let t=Xt;t0&&Is(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&Is(i)}}function $s(t,e){const n=Ce(e,t),i=n[1];!function(t,e){for(let n=e.length;nPromise.resolve(null))();function Hs(t){return t[7]||(t[7]=[])}function js(t){return t.cleanup||(t.cleanup=[])}function zs(t,e){const n=t[9],i=n?n.get(ar,null):null;i&&i.handleError(e)}function Ws(t,e,n,i,r){for(let s=0;sthis.processProvider(n,t,e)),ti([t],t=>this.processInjectorType(t,[],r)),this.records.set(Ks,oo(void 0,this));const s=this.records.get(Ys);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof t?null:nt(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=ui,n=vt.Default){this.assertNotDestroyed();const i=vi(this);try{if(!(n&vt.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=("function"==typeof(r=t)||"object"==typeof r&&r instanceof Yn)&&ht(t);e=n&&this.injectableDefInScope(n)?oo(ro(t),Js):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&vt.Self?eo():this.parent).get(t,e=n&vt.Optional&&e===ui?null:e)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(nt(t)),i)throw s;return function(t,e,n,i){const r=t.ngTempTokenPath;throw e[pi]&&r.unshift(e[pi]),t.message=function(t,e,n,i=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let r=nt(e);if(Array.isArray(e))r=e.map(nt).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t.push(n+":"+("string"==typeof i?JSON.stringify(i):nt(i)))}r=`{${t.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${t.replace(di,"\n ")}`}("\n"+t.message,r,n,i),t.ngTokenPath=r,t.ngTempTokenPath=null,t}(s,t,"R3InjectorError",this.source)}throw s}finally{vi(i)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(nt(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=ot(t)))return!1;let i=dt(t);const r=null==i&&t.ngModule||void 0,s=void 0===r?t:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=dt(r)),null==i)return!1;if(null!=i.imports&&!o){let t;n.push(s);try{ti(i.imports,i=>{this.processInjectorType(i,e,n)&&(void 0===t&&(t=[]),t.push(i))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,i||Zs))}}this.injectorDefTypes.add(s),this.records.set(s,oo(i.factory,Js));const a=i.providers;if(null!=a&&!o){const e=t;ti(a,t=>this.processProvider(t,e,a))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let i=lo(t=ot(t))?t:ot(t&&t.provide);const r=function(t,e,n){return ao(t)?oo(void 0,t.useValue):oo(so(t),Js)}(t);if(lo(t)||!0!==t.multi)this.records.get(i);else{let e=this.records.get(i);e||(e=oo(void 0,Js,!0),e.factory=()=>wi(e.multi),this.records.set(i,e)),i=t,e.multi.push(t)}this.records.set(i,r)}hydrate(t,e){var n;return e.value===Js&&(e.value=Qs,e.value=e.factory()),"object"==typeof e.value&&e.value&&null!==(n=e.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){return!!t.providedIn&&("string"==typeof t.providedIn?"any"===t.providedIn||t.providedIn===this.scope:this.injectorDefTypes.has(t.providedIn))}}function ro(t){const e=ht(t),n=null!==e?e.factory:ne(t);if(null!==n)return n;const i=dt(t);if(null!==i)return i.factory;if(t instanceof Yn)throw new Error(`Token ${nt(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=ii(e,"?");throw new Error(`Can't resolve all parameters for ${nt(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[pt]||t[gt]);if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function so(t,e,n){let i=void 0;if(lo(t)){const e=ot(t);return ne(e)||ro(e)}if(ao(t))i=()=>ot(t.useValue);else if((r=t)&&r.useFactory)i=()=>t.useFactory(...wi(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))i=()=>bi(ot(t.useExisting));else{const e=ot(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return ne(e)||ro(e);i=()=>new e(...wi(t.deps))}var r;return i}function oo(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function ao(t){return null!==t&&"object"==typeof t&&fi in t}function lo(t){return"function"==typeof t}const co=function(t,e,n){return function(t,e=null,n=null,i){const r=no(t,e,n,i);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};let ho=(()=>{class t{static create(t,e){return Array.isArray(t)?co(t,e,""):co(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=ui,t.NULL=new Xs,t.\u0275prov=lt({token:t,providedIn:"any",factory:()=>bi(Ks)}),t.__NG_ELEMENT_ID__=-1,t})();function uo(t,e){hn(Se(t)[1],$e())}function po(t){let e=Object.getPrototypeOf(t.type.prototype).constructor,n=!0;const i=[t];for(;e;){let r=void 0;if(ee(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){i.push(r);const e=t;e.inputs=fo(t.inputs),e.declaredInputs=fo(t.declaredInputs),e.outputs=fo(t.outputs);const n=r.hostBindings;n&&vo(t,n);const s=r.viewQuery,o=r.contentQueries;if(s&&go(t,s),o&&mo(t,o),et(t.inputs,r.inputs),et(t.declaredInputs,r.declaredInputs),et(t.outputs,r.outputs),ee(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let i=0;i=0;i--){const r=t[i];r.hostVars=e+=r.hostVars,r.hostAttrs=xn(r.hostAttrs,n=xn(n,r.hostAttrs))}}(i)}function fo(t){return t===Tt?{}:t===Rt?[]:t}function go(t,e){const n=t.viewQuery;t.viewQuery=n?(t,i)=>{e(t,i),n(t,i)}:e}function mo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,i,r)=>{e(t,i,r),n(t,i,r)}:e}function vo(t,e){const n=t.hostBindings;t.hostBindings=n?(t,i)=>{e(t,i),n(t,i)}:e}let yo=null;function bo(){if(!yo){const t=Dt.Symbol;if(t&&t.iterator)yo=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;ea(ye(t[i.index])).target:i.index;if(me(n)){let o=null;if(!a&&l&&(o=function(t,e,n,i){const r=t.cleanup;if(null!=r)for(let s=0;sn?t[n]:null}"string"==typeof t&&(s+=2)}return null}(t,e,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,u=!1;else{s=jo(i,e,s,!1);const t=n.listen(p.name||f,r,s);h.push(s,t),c&&c.push(r,m,g,g+1)}}else s=jo(i,e,s,!0),f.addEventListener(r,s,o),h.push(s),c&&c.push(r,m,g,o)}else s=jo(i,e,s,!1);const d=i.outputs;let p;if(u&&null!==d&&(p=d[r])){const t=p.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,Re.lFrame.contextLView))[8]}(t)}function Wo(t,e){let n=null;const i=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let r=0;r=0}const Zo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function ta(t){return t.substring(Zo.key,Zo.keyEnd)}function ea(t,e){const n=Zo.textEnd;return n===e?-1:(e=Zo.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Zo.key=e,n),na(t,e,n))}function na(t,e,n){for(;e=0;n=ea(e,n))ri(t,ta(e),!0)}function aa(t,e,n,i){const r=Le(),s=Me(),o=We(2);s.firstUpdatePass&&ha(s,t,o,i),e!==Jr&&So(r,o,e)&&pa(s,s.data[sn()],r,r[11],t,r[o+1]=function(t,e){return null==t||("string"==typeof e?t+=e:"object"==typeof t&&(t=nt(Di(t)))),t}(e,n),i,o)}function la(t,e,n,i){const r=Me(),s=We(2);r.firstUpdatePass&&ha(r,null,s,i);const o=Le();if(n!==Jr&&So(o,s,n)){const a=r.data[sn()];if(ma(a,i)&&!ca(r,s)){let t=i?a.classesWithoutHost:a.stylesWithoutHost;null!==t&&(n=it(t,n||"")),Lo(r,a,o,n,i)}else!function(t,e,n,i,r,s,o,a){r===Jr&&(r=Yo);let l=0,c=0,h=0=t.expandoStartIndex}function ha(t,e,n,i){const r=t.data;if(null===r[n+1]){const s=r[sn()],o=ca(t,n);ma(s,i)&&null===e&&!o&&(e=!1),e=function(t,e,n,i){const r=function(t){const e=Re.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}(t);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(n=da(n=ua(null,t,e,n,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=ua(r,t,e,n,i),null===s){let n=function(t,e,n){const i=n?e.classBindings:e.styleBindings;if(0!==is(i))return t[es(i)]}(t,e,i);void 0!==n&&Array.isArray(n)&&(n=ua(null,t,e,n[1],i),n=da(n,e.attrs,i),function(t,e,n,i){t[es(n?e.classBindings:e.styleBindings)]=i}(t,e,i,n))}else s=function(t,e,n){let i=void 0;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(h=!0)}else c=n;if(r)if(0!==l){const e=es(t[a+1]);t[i+1]=ts(e,a),0!==e&&(t[e+1]=rs(t[e+1],i)),t[a+1]=131071&t[a+1]|i<<17}else t[i+1]=ts(a,0),0!==a&&(t[a+1]=rs(t[a+1],i)),a=i;else t[i+1]=ts(l,0),0===a?a=i:t[l+1]=rs(t[l+1],i),l=i;h&&(t[i+1]=ns(t[i+1])),Jo(t,c,i,!0),Jo(t,c,i,!1),function(t,e,n,i,r){const s=r?t.residualClasses:t.residualStyles;null!=s&&"string"==typeof e&&oi(s,e)>=0&&(n[i+1]=ss(n[i+1]))}(e,c,t,i,s),o=ts(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,n,o,i)}}function ua(t,e,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a0;){const e=t[r],s=Array.isArray(e),l=s?e[1]:e,c=null===l;let h=n[r+1];h===Jr&&(h=c?Yo:void 0);let u=c?si(h,i):l===i?h:void 0;if(s&&!ga(u)&&(u=si(e,i)),ga(u)&&(a=u,o))return a;const d=t[r+1];r=o?es(d):is(d)}if(null!==e){let t=s?e.residualClasses:e.residualStyles;null!=t&&(a=si(t,i))}return a}function ga(t){return void 0!==t}function ma(t,e){return 0!=(t.flags&(e?16:32))}function va(t,e=""){const n=Le(),i=Me(),r=t+Kt,s=i.firstCreatePass?ls(i,r,1,e,null):i.data[r],o=n[r]=function(t,e){return me(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Fr(i,n,o,s),Pe(s,!1)}function ya(t){return ba("",t,""),ya}function ba(t,e,n){const i=Le(),r=Ao(i,t,e,n);return r!==Jr&&Gs(i,sn(),r),ba}function wa(t,e,n,i,r){const s=Le(),o=function(t,e,n,i,r,s){const o=Eo(t,je(),n,r);return We(2),o?e+re(n)+i+re(r)+s:Jr}(s,t,e,n,i,r);return o!==Jr&&Gs(s,sn(),o),wa}function xa(t,e,n){const i=Le();return So(i,ze(),e)&&xs(Me(),an(),i,t,e,i[11],n,!0),xa}const _a=void 0;var Ca=["en",[["a","p"],["AM","PM"],_a],[["AM","PM"],_a,_a],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],_a,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],_a,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",_a,"{1} 'at' {0}",_a],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let Sa={};function Ea(t){return t in Sa||(Sa[t]=Dt.ng&&Dt.ng.common&&Dt.ng.common.locales&&Dt.ng.common.locales[t]),Sa[t]}var ka=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}({});const Aa="en-US";let Da=Aa;function Ta(t){var e,n;n="Expected localeId to be defined",null==(e=t)&&function(t,e,n,i){throw new Error("ASSERTION ERROR: "+t+` [Expected=> null != ${e} <=Actual]`)}(n,e),"string"==typeof t&&(Da=t.toLowerCase().replace(/_/g,"-"))}function Ra(t,e,n,i,r){if(t=ot(t),Array.isArray(t))for(let s=0;s>20;if(lo(t)||!t.multi){const i=new vn(l,r,Ro),p=Ma(a,e,r?h:h+d,u);-1===p?(Mn(Tn(c,o),s,a),Fa(s,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(i),o.push(i)):(n[p]=i,o[p]=i)}else{const p=Ma(a,e,h+d,u),f=Ma(a,e,h,h+d),g=p>=0&&n[p],m=f>=0&&n[f];if(r&&!m||!r&&!g){Mn(Tn(c,o),s,a);const h=function(t,e,n,i,r){const s=new vn(t,n,Ro);return s.multi=[],s.index=e,s.componentProviders=0,La(s,r,i&&!n),s}(r?$a:Ia,n.length,r,i,l);!r&&m&&(n[f].providerFactory=h),Fa(s,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(h),o.push(h)}else Fa(s,t,p>-1?p:f,La(n[r?f:p],l,!r&&i));!r&&i&&m&&n[f].componentProviders++}}}function Fa(t,e,n,i){const r=lo(e);if(r||e.useClass){const s=(e.useClass||e).prototype.ngOnDestroy;if(s){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[i,s]):o[t+1].push(i,s)}else o.push(n,s)}}}function La(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function Ma(t,e,n,i){for(let r=n;r{n.providersResolver=(n,i)=>function(t,e,n){const i=Me();if(i.firstCreatePass){const r=ee(t);Ra(n,i.data,i.blueprint,r,!0),Ra(e,i.data,i.blueprint,r,!1)}}(n,i?i(t):t,e)}}class Na{}class Ba{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${nt(t)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=t,e}(t)}}let Ua=(()=>{class t{}return t.NULL=new Ba,t})();function Va(...t){}function Ha(t,e){return new za(we(t,e))}const ja=function(){return Ha($e(),Le())};let za=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=ja,t})();class Wa{}let Ga=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>qa(),t})();const qa=function(){const t=Le(),e=Ce($e().index,t);return function(t){return t[11]}(Yt(e)?e:t)};let Ka=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>null}),t})();class Xa{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const Ya=new Xa("11.0.5");class Ja{constructor(){}supports(t){return xo(t)}create(t){return new Za(t)}}const Qa=(t,e)=>e;class Za{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Qa}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,i=0,r=null;for(;e||n;){const s=!n||e&&e.currentIndex{i=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,t,i,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,i,e),s=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,i){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,i)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,i)):t=this._addAfter(new tl(e,n),r,i),t}_verifyReinsertion(t,e,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,r=t._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const i=null===e?this._itHead:e._next;return t._next=i,t._prev=e,null===i?this._itTail=t:i._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new nl),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new nl),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class tl{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class el{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class nl{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new el,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function il(t,e,n){const i=t.previousIndex;if(null===i)return i;let r=0;return n&&i{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const i=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,i)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new ol(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class ol{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let al=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new Ja])}),t})(),ll=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new hi,new li]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new t([new rl])}),t})();function cl(t,e,n,i,r=!1){for(;null!==n;){const s=e[n.index];if(null!==s&&i.push(ye(s)),Jt(s))for(let t=Xt;t-1&&this._viewContainerRef.detach(t),this._viewContainerRef=null}_r(this._lView[1],this._lView)}onDestroy(t){bs(this._lView[1],this._lView,null,t)}markForCheck(){Ps(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ns(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){Ve(!0);try{Ns(t,e,n)}finally{Ve(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t}detachFromAppRef(){var t;this._appRef=null,$r(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class ul extends hl{constructor(t){super(t),this._view=t}detectChanges(){Bs(this._view)}checkNoChanges(){!function(t){Ve(!0);try{Bs(t)}finally{Ve(!1)}}(this._view)}get context(){return null}}const dl=function(t=!1){return function(t,e,n){if(!n&&Zt(t)){const n=Ce(t.index,e);return new hl(n,n)}return 47&t.type?new hl(e[16],e):null}($e(),Le(),t)};let pl=(()=>{class t{}return t.__NG_ELEMENT_ID__=dl,t.__ChangeDetectorRef__=!0,t})();const fl=[new rl],gl=new al([new Ja]),ml=new ll(fl),vl=function(){return xl($e(),Le())};let yl=(()=>{class t{}return t.__NG_ELEMENT_ID__=vl,t})();const bl=yl,wl=class extends bl{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=as(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(e)),hs(e,n,t),new hl(n)}};function xl(t,e){return 4&t.type?new wl(e,t,Ha(t,e)):null}class _l{}class Cl{}const Sl=function(){return Rl($e(),Le())};let El=(()=>{class t{}return t.__NG_ELEMENT_ID__=Sl,t})();const kl=El,Al=class extends kl{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return Ha(this._hostTNode,this._hostLView)}get injector(){return new zn(this._hostTNode,this._hostLView)}get parentInjector(){const t=Ln(this._hostTNode,this._hostLView);if(Cn(t)){const e=En(t,this._hostLView),n=Sn(t);return new zn(e[1].data[n+8],e)}return new zn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=Dl(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-Xt}createEmbeddedView(t,e,n){const i=t.createEmbeddedView(e||{});return this.insert(i,n),i}createComponent(t,e,n,i,r){const s=n||this.parentInjector;if(!r&&null==t.ngModule&&s){const t=s.get(_l,null);t&&(r=t)}const o=t.create(s,i,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,i=n[1];if(Jt(n[3])){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],i=new Al(e,e[6],e[3]);i.detach(i.indexOf(t))}}const r=this._adjustIndex(e),s=this._lContainer;!function(t,e,n,i){const r=Xt+i,s=n.length;i>0&&(n[r-1][4]=e),icr});class $l extends Na{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=t.selectors.map(Yr).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return Ml(this.componentDef.inputs)}get outputs(){return Ml(this.componentDef.outputs)}create(t,e,n,i){const r=(i=i||this.ngModule)?function(t,e){return{get:(n,i,r)=>{const s=t.get(n,Fl,r);return s!==Fl||i===Fl?s:e.get(n,i,r)}}}(t,i.injector):t,s=r.get(Wa,ve),o=r.get(Ka,null),a=s.createRenderer(null,this.componentDef),l=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(me(t))return t.selectRootElement(e,n===Ct.ShadowDom);let i="string"==typeof e?t.querySelector(e):e;return i.textContent="",i}(a,n,this.componentDef.encapsulation):br(s.createRenderer(null,this.componentDef),l,function(t){const e=t.toLowerCase();return"svg"===e?pe:"math"===e?"http://www.w3.org/1998/MathML/":null}(l)),h=this.componentDef.onPush?576:528,u={components:[],scheduler:cr,clean:Vs,playerHandler:null,flags:0},d=ys(0,null,null,1,0,null,null,null,null,null),p=as(null,d,u,h,null,null,s,a,o,r);let f,g;Qe(p);try{const t=function(t,e,n,i,r,s){const o=n[1];n[20]=t;const a=ls(o,20,2,"#host",null),l=a.mergedAttrs=e.hostAttrs;null!==l&&(qs(a,l,!0),null!==t&&(yn(r,t,l),null!==a.classes&&Nr(r,t,a.classes),null!==a.styles&&Pr(r,t,a.styles)));const c=i.createRenderer(t,e),h=as(n,vs(e),null,e.onPush?64:16,n[20],a,i,c,null,null);return o.firstCreatePass&&(Mn(Tn(a,n),o,e.type),Es(o,a),As(a,n.length,1)),Os(n,h),n[20]=h}(c,this.componentDef,p,s,a);if(c)if(n)yn(a,c,["ng-version",Ya.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let i=1,r=2;for(;i0&&Nr(a,c,e.join(" "))}if(g=xe(d,Kt),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=$e();e.contentQueries(1,o,t.directiveStart)}const a=$e();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(on(a.index),Cs(n[1],a,0,a.directiveStart,a.directiveEnd,e),Ss(e,o)),o}(t,this.componentDef,p,u,[uo]),hs(d,p,null)}finally{rn()}return new Ol(this.componentType,f,Ha(g,p),p,g)}}class Ol extends class{}{constructor(t,e,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new ul(i),this.componentType=t}get injector(){return new zn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const Pl=new Map;class Nl extends _l{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Ll(this);const n=qt(t),i=t[$t]||null;i&&Ta(i),this._bootstrapComponents=ur(n.bootstrap),this._r3Injector=no(t,e,[{provide:_l,useValue:this},{provide:Ua,useValue:this.componentFactoryResolver}],nt(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=ho.THROW_IF_NOT_FOUND,n=vt.Default){return t===ho||t===_l||t===Ks?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Bl extends Cl{constructor(t){super(),this.moduleType=t,null!==qt(t)&&function(t){const e=new Set;!function t(n){const i=qt(n,!0),r=i.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${nt(e)} vs ${nt(e.name)}`)}(r,Pl.get(r),n),Pl.set(r,n));const s=ur(i.imports);for(const o of s)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new Nl(this.moduleType,t)}}function Ul(t,e,n){const i=He()+t,r=Le();return r[i]===Jr?Co(r,i,n?e.call(n):e()):function(t,e){return t[e]}(r,i)}function Vl(t,e,n,i){return zl(Le(),He(),t,e,n,i)}function Hl(t,e,n,i,r){return function(t,e,n,i,r,s,o){const a=e+n;return Eo(t,a,r,s)?Co(t,a+2,o?i.call(o,r,s):i(r,s)):jl(t,a+2)}(Le(),He(),t,e,n,i,r)}function jl(t,e){const n=t[e];return n===Jr?void 0:n}function zl(t,e,n,i,r,s){const o=e+n;return So(t,o,r)?Co(t,o+1,s?i.call(s,r):i(r)):jl(t,o+1)}const Wl=class extends C{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){let i,r=t=>null,s=()=>null;t&&"object"==typeof t?(i=this.__isAsync?e=>{setTimeout(()=>t.next(e))}:e=>{t.next(e)},t.error&&(r=this.__isAsync?e=>{setTimeout(()=>t.error(e))}:e=>{t.error(e)}),t.complete&&(s=this.__isAsync?()=>{setTimeout(()=>t.complete())}:()=>{t.complete()})):(i=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)},e&&(r=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)}),n&&(s=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const o=super.subscribe(i,r,s);return t instanceof u&&t.add(o),o}};function Gl(){return this._results[bo()]()}class ql{constructor(){this.dirty=!0,this._results=[],this.changes=new Wl,this.length=0;const t=bo(),e=ql.prototype;e[t]||(e[t]=Gl)}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t){this._results=Zn(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Kl{constructor(t){this.queryList=t,this.matches=null}clone(){return new Kl(this.queryList)}setDirty(){this.queryList.setDirty()}}class Xl{constructor(t=[]){this.queries=t}createEmbeddedView(t){const e=t.queries;if(null!==e){const n=null!==t.contentQueries?t.contentQueries[0]:e.length,i=[];for(let t=0;t0)i.push(o[t/2]);else{const r=s[t+1],o=e[-n];for(let t=Xt;t{class t{constructor(t){this.appInits=t,this.resolve=Va,this.reject=Va,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(bi(pc,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const gc=new Yn("AppId"),mc={provide:gc,useFactory:function(){return`${vc()}${vc()}${vc()}`},deps:[]};function vc(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const yc=new Yn("Platform Initializer"),bc=new Yn("Platform ID"),wc=new Yn("appBootstrapListener");let xc=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const _c=new Yn("LocaleId"),Cc=new Yn("DefaultCurrencyCode");class Sc{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const Ec=function(t){return new Bl(t)},kc=Ec,Ac=function(t){return Promise.resolve(Ec(t))},Dc=function(t){const e=Ec(t),n=ur(qt(t).declarations).reduce((t,e)=>{const n=Gt(e);return n&&t.push(new $l(n)),t},[]);return new Sc(e,n)},Tc=Dc,Rc=function(t){return Promise.resolve(Dc(t))};let Fc=(()=>{class t{constructor(){this.compileModuleSync=kc,this.compileModuleAsync=Ac,this.compileModuleAndAllComponentsSync=Tc,this.compileModuleAndAllComponentsAsync=Rc}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Lc=(()=>Promise.resolve(0))();function Mc(t){"undefined"==typeof Zone?Lc.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Ic{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Wl(!1),this.onMicrotaskEmpty=new Wl(!1),this.onStable=new Wl(!1),this.onError=new Wl(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const n=this;n._nesting=0,n._outer=n._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(n._inner=n._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(n._inner=n._inner.fork(Zone.longStackTraceZoneSpec)),n.shouldCoalesceEventChangeDetection=e,n.lastRequestAnimationFrameId=-1,n.nativeRequestAnimationFrame=function(){let t=Dt.requestAnimationFrame,e=Dt.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=!!t.shouldCoalesceEventChangeDetection&&t.nativeRequestAnimationFrame&&(()=>{!function(t){-1===t.lastRequestAnimationFrameId&&(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Dt,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,Pc(t),Oc(t)},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),Pc(t))}(t)});t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0,maybeDelayChangeDetection:e},onInvokeTask:(n,i,r,s,o,a)=>{try{return Nc(t),n.invokeTask(r,s,o,a)}finally{e&&"eventTask"===s.type&&e(),Bc(t)}},onInvoke:(e,n,i,r,s,o,a)=>{try{return Nc(t),e.invoke(i,r,s,o,a)}finally{Bc(t)}},onHasTask:(e,n,i,r)=>{e.hasTask(i,r),n===i&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,Pc(t),Oc(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,i,r)=>(e.handleError(i,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(n)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ic.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Ic.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,t,$c,Va,Va);try{return r.runTask(s,e,n)}finally{r.cancelTask(s)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const $c={};function Oc(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Pc(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||t.shouldCoalesceEventChangeDetection&&-1!==t.lastRequestAnimationFrameId)}function Nc(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Bc(t){t._nesting--,Oc(t)}class Uc{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Wl,this.onMicrotaskEmpty=new Wl,this.onStable=new Wl,this.onError=new Wl}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,i){return t.apply(e,n)}}let Vc=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Mc(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let i=-1;e&&e>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==i),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:i,updateCb:n})}whenStable(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()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Hc=(()=>{class t{constructor(){this._applications=new Map,Wc.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return Wc.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class jc{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let zc,Wc=new jc,Gc=!0,qc=!1;function Kc(){return qc=!0,Gc}const Xc=new Yn("AllowMultipleToken");class Yc{constructor(t,e){this.name=t,this.token=e}}function Jc(t,e,n=[]){const i="Platform: "+e,r=new Yn(i);return(e=[])=>{let s=Qc();if(!s||s.injector.get(Xc,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:Ys,useValue:"platform"});!function(t){if(zc&&!zc.destroyed&&!zc.injector.get(Xc,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");zc=t.get(Zc);const e=t.get(yc,null);e&&e.forEach(t=>t())}(ho.create({providers:t,name:i}))}return function(t){const e=Qc();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}(r)}}function Qc(){return zc&&!zc.destroyed?zc:null}let Zc=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new Uc:("zone.js"===t?void 0:t)||new Ic({enableLongStackTrace:Kc(),shouldCoalesceEventChangeDetection:e}),n}(e?e.ngZone:void 0,e&&e.ngZoneEventCoalescing||!1),i=[{provide:Ic,useValue:n}];return n.run(()=>{const e=ho.create({providers:i,parent:this.injector,name:t.moduleType.name}),r=t.create(e),s=r.injector.get(ar,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{s.handleError(t)}});r.onDestroy(()=>{nh(this._modules,r),t.unsubscribe()})}),function(t,e,n){try{const i=n();return Bo(i)?i.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):i}catch(i){throw e.runOutsideAngular(()=>t.handleError(i)),i}}(s,n,()=>{const t=r.injector.get(fc);return t.runInitializers(),t.donePromise.then(()=>(Ta(r.injector.get(_c,Aa)||Aa),this._moduleDoBootstrap(r),r))})})}bootstrapModule(t,e=[]){const n=th({},e);return function(t,e,n){const i=new Bl(n);return Promise.resolve(i)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(eh);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${nt(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)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function th(t,e){return Array.isArray(e)?e.reduce(th,t):Object.assign(Object.assign({},t),e)}let eh=(()=>{class t{constructor(t,e,n,i,r,s){this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=s,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const o=new y(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),a=new y(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Ic.assertNotInAngularZone(),Mc(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Ic.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=W(o,a.pipe(Z()))}bootstrap(t,e){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.");let n;n=t instanceof Na?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const i=n.isBoundToModule?void 0:this._injector.get(_l),r=n.create(ho.NULL,[],e||n.selector,i),s=r.location.nativeElement,o=r.injector.get(Vc,null),a=o&&r.injector.get(Hc);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),nh(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),Kc()&&this._console.log("Angular is running in development mode. Call enableProdMode() to enable production mode."),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;nh(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(wc,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(bi(Ic),bi(xc),bi(ho),bi(ar),bi(Ua),bi(fc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function nh(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ih{}class rh{}const sh={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let oh=(()=>{class t{constructor(t,e){this._compiler=t,this._config=e||sh}load(t){return this.loadAndCompile(t)}loadAndCompile(t){let[e,i]=t.split("#");return void 0===i&&(i="default"),n("zn8P")(e).then(t=>t[i]).then(t=>ah(t,e,i)).then(t=>this._compiler.compileModuleAsync(t))}loadFactory(t){let[e,i]=t.split("#"),r="NgFactory";return void 0===i&&(i="default",r=""),n("zn8P")(this._config.factoryPathPrefix+e+this._config.factoryPathSuffix).then(t=>t[i+r]).then(t=>ah(t,e,i))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fc),bi(rh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function ah(t,e,n){if(!t)throw new Error(`Cannot find '${n}' in '${e}'`);return t}const lh=Jc(null,"core",[{provide:bc,useValue:"unknown"},{provide:Zc,deps:[ho]},{provide:Hc,deps:[]},{provide:xc,deps:[]}]),ch=[{provide:eh,useClass:eh,deps:[Ic,xc,ho,ar,Ua,fc]},{provide:Il,deps:[Ic],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:fc,useClass:fc,deps:[[new li,pc]]},{provide:Fc,useClass:Fc,deps:[]},mc,{provide:al,useFactory:function(){return gl},deps:[]},{provide:ll,useFactory:function(){return ml},deps:[]},{provide:_c,useFactory:function(t){return Ta(t=t||"undefined"!=typeof $localize&&$localize.locale||Aa),t},deps:[[new ai(_c),new li,new hi]]},{provide:Cc,useValue:"USD"}];let hh=(()=>{class t{constructor(t){}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(eh))},providers:ch}),t})(),uh=null;function dh(){return uh}const ph=new Yn("DocumentToken");let fh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:gh,token:t,providedIn:"platform"}),t})();function gh(){return bi(vh)}const mh=new Yn("Location Initialized");let vh=(()=>{class t extends fh{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=dh().getLocation(),this._history=dh().getHistory()}getBaseHrefFromDOM(){return dh().getBaseHref(this._doc)}onPopState(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)}onHashChange(t){dh().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){yh()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){yh()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:bh,token:t,providedIn:"platform"}),t})();function yh(){return!!window.history.pushState}function bh(){return new vh(bi(ph))}function wh(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function xh(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function _h(t){return t&&"?"!==t[0]?"?"+t:t}let Ch=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:Sh,token:t,providedIn:"root"}),t})();function Sh(t){const e=bi(ph).location;return new kh(bi(fh),e&&e.origin||"")}const Eh=new Yn("appBaseHref");let kh=(()=>{class t extends Ch{constructor(t,e){if(super(),this._platformLocation=t,null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)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.");this._baseHref=e}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return wh(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+_h(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){const r=this.prepareExternalUrl(n+_h(i));this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Ah=(()=>{class t extends Ch{constructor(t,e){super(),this._platformLocation=t,this._baseHref="",null!=e&&(this._baseHref=e)}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e}prepareExternalUrl(t){const e=wh(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(t,e,r)}replaceState(t,e,n,i){let r=this.prepareExternalUrl(n+_h(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(bi(fh),bi(Eh,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Dh=(()=>{class t{constructor(t,e){this._subject=new Wl,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=xh(Rh(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+_h(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,Rh(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+_h(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(bi(Ch),bi(fh))},t.normalizeQueryParams=_h,t.joinWithSlash=wh,t.stripTrailingSlash=xh,t.\u0275prov=lt({factory:Th,token:t,providedIn:"root"}),t})();function Th(){return new Dh(bi(Ch),bi(fh))}function Rh(t){return t.replace(/\/index.html$/,"")}var Fh=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}({});class Lh{}let Mh=(()=>{class t extends Lh{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=Ea(e);if(n)return n;const i=e.split("-")[0];if(n=Ea(i),n)return n;if("en"===i)return Ca;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[ka.PluralCase]}(e||this.locale)(t)){case Fh.Zero:return"zero";case Fh.One:return"one";case Fh.Two:return"two";case Fh.Few:return"few";case Fh.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(bi(_c))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Ih(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[i,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(i.trim()===e)return decodeURIComponent(r)}return null}let $h=(()=>{class t{constructor(t,e,n,i){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(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&&(xo(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+nt(t.item));this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(al),Ro(ll),Ro(za),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Oh{constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Ph=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(e){throw new Error(`Cannot find a differ supporting object '${n}' of type '${t=n,t.name||typeof t}'. NgFor only supports binding to Iterables such as Arrays.`)}}var t;if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,i)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new Oh(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new Nh(t,n);e.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new Nh(t,r);e.push(s)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(al))},t.\u0275dir=Wt({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Nh{constructor(t,e){this.record=t,this.view=e}}let Bh=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Uh,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){Vh("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Vh("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Uh{constructor(){this.$implicit=null,this.ngIf=null}}function Vh(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${nt(e)}'.`)}class Hh{constructor(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()}}let jh=(()=>{class t{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let e=0;e{class t{constructor(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new Hh(t,e)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return t.\u0275fac=function(e){return new(e||t)(Ro(El),Ro(yl),Ro(jh,1))},t.\u0275dir=Wt({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),t})(),Wh=(()=>{class t{constructor(t,e,n){this._ngEl=t,this._differs=e,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,e){const[n,i]=t.split(".");null!=(e=null!=e&&i?`${e}${i}`:e)?this._renderer.setStyle(this._ngEl.nativeElement,n,e):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(t){t.forEachRemovedItem(t=>this._setStyle(t.key,null)),t.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),t.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(ll),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),t})(),Gh=(()=>{class t{constructor(t){this._viewContainerRef=t,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(t){if(this._shouldRecreateView(t)){const t=this._viewContainerRef;this._viewRef&&t.remove(t.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?t.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(t){const e=t.ngTemplateOutletContext;return!!t.ngTemplateOutlet||e&&this._hasContextShapeChanged(e)}_hasContextShapeChanged(t){const e=Object.keys(t.previousValue||{}),n=Object.keys(t.currentValue||{});if(e.length===n.length){for(let t of n)if(-1===e.indexOf(t))return!0;return!1}return!0}_updateExistingContext(t){for(let e of Object.keys(t))this._viewRef.context[e]=this.ngTemplateOutletContext[e]}}return t.\u0275fac=function(e){return new(e||t)(Ro(El))},t.\u0275dir=Wt({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[le]}),t})(),qh=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:Lh,useClass:Mh}]}),t})(),Kh=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>new Xh(bi(ph),window,bi(ar))}),t})();class Xh{constructor(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(this.supportsScrolling()){const e=this.document.getElementById(t)||this.document.getElementsByName(t)[0];e&&this.scrollToElement(e)}}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,i=e.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],i-r[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const t=Yh(this.window.history)||Yh(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch(t){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(t){return!1}}}function Yh(t){return Object.getOwnPropertyDescriptor(t,"scrollRestoration")}class Jh extends class extends class{}{constructor(){super()}supportsDOMEvents(){return!0}}{static makeCurrent(){var t;t=new Jh,uh||(uh=t)}getProperty(t,e){return t[e]}log(t){window.console&&window.console.log&&window.console.log(t)}logGroup(t){window.console&&window.console.group&&window.console.group(t)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){return t.parentNode&&t.parentNode.removeChild(t),t}getValue(t){return t.value}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(t){const e=Zh||(Zh=document.querySelector("base"),Zh)?Zh.getAttribute("href"):null;return null==e?null:(n=e,Qh||(Qh=document.createElement("a")),Qh.setAttribute("href",n),"/"===Qh.pathname.charAt(0)?Qh.pathname:"/"+Qh.pathname);var n}resetBaseElement(){Zh=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(t){return Ih(document.cookie,t)}}let Qh,Zh=null;const tu=new Yn("TRANSITION_ID"),eu=[{provide:pc,useFactory:function(t,e,n){return()=>{n.get(fc).donePromise.then(()=>{const n=dh();Array.prototype.slice.apply(e.querySelectorAll("style[ng-transition]")).filter(e=>e.getAttribute("ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[tu,ph,ho],multi:!0}];class nu{static init(){var t;t=new nu,Wc=t}addToWindow(t){Dt.getAngularTestability=(e,n=!0)=>{const i=t.findTestabilityInTree(e,n);if(null==i)throw new Error("Could not find testability for element.");return i},Dt.getAllAngularTestabilities=()=>t.getAllTestabilities(),Dt.getAllAngularRootElements=()=>t.getAllRootElements(),Dt.frameworkStabilizers||(Dt.frameworkStabilizers=[]),Dt.frameworkStabilizers.push(t=>{const e=Dt.getAllAngularTestabilities();let n=e.length,i=!1;const r=function(e){i=i||e,n--,0==n&&t(i)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const i=t.getTestability(e);return null!=i?i:n?dh().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}const iu=new Yn("EventManagerPlugins");let ru=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let i=0;i{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),au=(()=>{class t extends ou{constructor(t){super(),this._doc=t,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(t.head)}_addStylesToHost(t,e){t.forEach(t=>{const n=this._doc.createElement("style");n.textContent=t,this._styleNodes.add(e.appendChild(n))})}addHost(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)}removeHost(t){this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach(e=>this._addStylesToHost(t,e))}ngOnDestroy(){this._styleNodes.forEach(t=>dh().remove(t))}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},cu=/%COMP%/g;function hu(t,e,n){for(let i=0;i{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let du=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new pu(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case Ct.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new fu(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case Ct.ShadowDom:return new gu(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=hu(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(bi(ru),bi(au),bi(gc))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class pu{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(lu[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,i){if(i){e=i+":"+e;const r=lu[i];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const i=lu[n];i?t.removeAttributeNS(i,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&(dr.DashCase|dr.Important)?t.style.setProperty(e,n,i&dr.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&dr.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,uu(n)):this.eventManager.addEventListener(t,e,uu(n))}}class fu extends pu{constructor(t,e,n,i){super(t),this.component=n;const r=hu(i+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(cu,i+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(cu,i+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class gu extends pu{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=hu(i.id,i.styles,[]);for(let s=0;s{class t extends su{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const vu=["alt","control","meta","shift"],yu={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},bu={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},wu={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let xu=(()=>{class t extends su{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,i){const r=t.parseEventName(n),s=t.eventCallback(r.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>dh().onAndCancel(e,r.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=t._normalizeKey(n.pop());let s="";if(vu.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),s+=t+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&bu.hasOwnProperty(e)&&(e=bu[e]))}return yu[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),vu.forEach(i=>{i!=n&&(0,wu[i])(t)&&(e+=i+".")}),e+=n,e}static eventCallback(e,n,i){return r=>{t.getEventFullKey(r)===e&&i.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),_u=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return bi(Cu)},token:t,providedIn:"root"}),t})(),Cu=(()=>{class t extends _u{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case tr.NONE:return e;case tr.HTML:return Ti(e,"HTML")?Di(e):Qi(this._doc,String(e));case tr.STYLE:return Ti(e,"Style")?Di(e):e;case tr.SCRIPT:if(Ti(e,"Script"))return Di(e);throw new Error("unsafe value used in a script context");case tr.URL:return Ri(e),Ti(e,"URL")?Di(e):$i(String(e));case tr.RESOURCE_URL:if(Ti(e,"ResourceURL"))return Di(e);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return new Ci(t)}bypassSecurityTrustStyle(t){return new Si(t)}bypassSecurityTrustScript(t){return new Ei(t)}bypassSecurityTrustUrl(t){return new ki(t)}bypassSecurityTrustResourceUrl(t){return new Ai(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return t=bi(Ks),new Cu(t.get(ph));var t},token:t,providedIn:"root"}),t})();const Su=Jc(lh,"browser",[{provide:bc,useValue:"browser"},{provide:yc,useValue:function(){Jh.makeCurrent(),nu.init()},multi:!0},{provide:ph,useFactory:function(){return function(t){fe=t}(document),document},deps:[]}]),Eu=[[],{provide:Ys,useValue:"root"},{provide:ar,useFactory:function(){return new ar},deps:[]},{provide:iu,useClass:mu,multi:!0,deps:[ph,Ic,bc]},{provide:iu,useClass:xu,multi:!0,deps:[ph]},[],{provide:du,useClass:du,deps:[ru,au,gc]},{provide:Wa,useExisting:du},{provide:ou,useExisting:au},{provide:au,useClass:au,deps:[ph]},{provide:Vc,useClass:Vc,deps:[Ic]},{provide:ru,useClass:ru,deps:[iu,Ic]},[]];let ku=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:gc,useValue:e.appId},{provide:tu,useExisting:gc},eu]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:Eu,imports:[qh,hh]}),t})();"undefined"!=typeof window&&window;class Au{}const Du="*";function Tu(t,e){return{type:7,name:t,definitions:e,options:{}}}function Ru(t,e=null){return{type:4,styles:e,timings:t}}function Fu(t,e=null){return{type:2,steps:t,options:e}}function Lu(t){return{type:6,styles:t,offset:null}}function Mu(t,e,n=null){return{type:1,expr:t,animation:e,options:n}}function Iu(t){Promise.resolve(null).then(t)}class $u{constructor(t=0,e=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Iu(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Ou{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let e=0,n=0,i=0;const r=this.players.length;0==r?Iu(()=>this._onFinish()):this.players.forEach(t=>{t.onDone(()=>{++e==r&&this._onFinish()}),t.onDestroy(()=>{++n==r&&this._onDestroy()}),t.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((t,e)=>Math.max(t,e.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const e=t*this.totalTime;this.players.forEach(t=>{const n=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(n)})}getPosition(){const t=this.players.reduce((t,e)=>null===t||e.totalTime>t.totalTime?e:t,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}function Pu(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Nu(t){switch(t.length){case 0:return new $u;case 1:return t[0];default:return new Ou(t)}}function Bu(t,e,n,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(t=>{const n=t.offset,i=n==l,h=i&&c||{};Object.keys(t).forEach(n=>{let i=n,a=t[n];if("offset"!==n)switch(i=e.normalizePropertyName(i,o),a){case"!":a=r[n];break;case Du:a=s[n];break;default:a=e.normalizeStyleValue(n,i,a,o)}h[i]=a}),i||a.push(h),c=h,l=n}),o.length){const t="\n - ";throw new Error(`Unable to animate due to the following errors:${t}${o.join(t)}`)}return a}function Uu(t,e,n,i){switch(e){case"start":t.onStart(()=>i(n&&Vu(n,"start",t)));break;case"done":t.onDone(()=>i(n&&Vu(n,"done",t)));break;case"destroy":t.onDestroy(()=>i(n&&Vu(n,"destroy",t)))}}function Vu(t,e,n){const i=n.totalTime,r=Hu(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,null==i?t.totalTime:i,!!n.disabled),s=t._data;return null!=s&&(r._data=s),r}function Hu(t,e,n,i,r="",s=0,o){return{element:t,triggerName:e,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function ju(t,e,n){let i;return t instanceof Map?(i=t.get(e),i||t.set(e,i=n)):(i=t[e],i||(i=t[e]=n)),i}function zu(t){const e=t.indexOf(":");return[t.substring(1,e),t.substr(e+1)]}let Wu=(t,e)=>!1,Gu=(t,e)=>!1,qu=(t,e,n)=>[];const Ku=Pu();(Ku||"undefined"!=typeof Element)&&(Wu=(t,e)=>t.contains(e),Gu=(()=>{if(Ku||Element.prototype.matches)return(t,e)=>t.matches(e);{const t=Element.prototype,e=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;return e?(t,n)=>e.apply(t,[n]):Gu}})(),qu=(t,e,n)=>{let i=[];if(n){const n=t.querySelectorAll(e);for(let t=0;t{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=t[n]}),e}let nd=(()=>{class t{validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return n||""}animate(t,e,n,i,r,s=[],o){return new $u(n,i)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),id=(()=>{class t{}return t.NOOP=new nd,t})();const rd="ng-enter",sd="ng-leave",od="ng-trigger",ad=".ng-trigger",ld="ng-animating",cd=".ng-animating";function hd(t){if("number"==typeof t)return t;const e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:ud(parseFloat(e[1]),e[2])}function ud(t,e){switch(e){case"s":return 1e3*t;default:return t}}function dd(t,e,n){return t.hasOwnProperty("duration")?t:function(t,e,n){let i,r=0,s="";if("string"==typeof t){const n=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return e.push(`The provided timing value "${t}" is invalid.`),{duration:0,delay:0,easing:""};i=ud(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=ud(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=t;if(!n){let n=!1,s=e.length;i<0&&(e.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(e.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&e.splice(s,0,`The provided timing value "${t}" is invalid.`)}return{duration:i,delay:r,easing:s}}(t,e,n)}function pd(t,e={}){return Object.keys(t).forEach(n=>{e[n]=t[n]}),e}function fd(t,e,n={}){if(e)for(let i in t)n[i]=t[i];else pd(t,n);return n}function gd(t,e,n){return n?e+":"+n+";":""}function md(t){let e="";for(let n=0;n{const r=Ed(i);n&&!n.hasOwnProperty(i)&&(n[i]=t.style[r]),t.style[r]=e[i]}),Pu()&&md(t))}function yd(t,e){t.style&&(Object.keys(e).forEach(e=>{const n=Ed(e);t.style[n]=""}),Pu()&&md(t))}function bd(t){return Array.isArray(t)?1==t.length?t[0]:Fu(t):t}const wd=new RegExp("{{\\s*(.+?)\\s*}}","g");function xd(t){let e=[];if("string"==typeof t){let n;for(;n=wd.exec(t);)e.push(n[1]);wd.lastIndex=0}return e}function _d(t,e,n){const i=t.toString(),r=i.replace(wd,(t,i)=>{let r=e[i];return e.hasOwnProperty(i)||(n.push("Please provide a value for the animation param "+i),r=""),r.toString()});return r==i?t:r}function Cd(t){const e=[];let n=t.next();for(;!n.done;)e.push(n.value),n=t.next();return e}const Sd=/-+([a-z0-9])/g;function Ed(t){return t.replace(Sd,(...t)=>t[1].toUpperCase())}function kd(t,e){return 0===t||0===e}function Ad(t,e,n){const i=Object.keys(n);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(t=>{s.hasOwnProperty(t)||o.push(t),s[t]=n[t]}),o.length)for(var r=1;rfunction(t,e,n){if(":"==t[0]){const i=function(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,e)=>parseFloat(e)>parseFloat(t);case":decrement":return(t,e)=>parseFloat(e) *"}}(t,n);if("function"==typeof i)return void e.push(i);t=i}const i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${t}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(Id(r,o)),"<"!=s[0]||r==Rd&&o==Rd||e.push(Id(o,r))}(t,n,e)):n.push(t),n}const Ld=new Set(["true","1"]),Md=new Set(["false","0"]);function Id(t,e){const n=Ld.has(t)||Md.has(t),i=Ld.has(e)||Md.has(e);return(r,s)=>{let o=t==Rd||t==r,a=e==Rd||e==s;return!o&&n&&"boolean"==typeof r&&(o=r?Ld.has(t):Md.has(t)),!a&&i&&"boolean"==typeof s&&(a=s?Ld.has(e):Md.has(e)),o&&a}}const $d=new RegExp("s*:selfs*,?","g");function Od(t,e,n){return new Pd(t).build(e,n)}class Pd{constructor(t){this._driver=t}build(t,e){const n=new Nd(e);return this._resetContextStyleTimingState(n),Dd(this,bd(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles={},t.collectedStyles[""]={},t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,i=e.depCount=0;const r=[],s=[];return"@"==t.name.charAt(0)&&e.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),t.definitions.forEach(t=>{if(this._resetContextStyleTimingState(e),0==t.type){const n=t,i=n.name;i.toString().split(/\s*,\s*/).forEach(t=>{n.name=t,r.push(this.visitState(n,e))}),n.name=i}else if(1==t.type){const r=this.visitTransition(t,e);n+=r.queryCount,i+=r.depCount,s.push(r)}else e.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:t.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(t,e){const n=this.visitStyle(t.styles,e),i=t.options&&t.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(t=>{if(Bd(t)){const e=t;Object.keys(e).forEach(t=>{xd(e[t]).forEach(t=>{s.hasOwnProperty(t)||r.add(t)})})}}),r.size){const n=Cd(r.values());e.errors.push(`state("${t.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:t.name,style:n,options:i?{params:i}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;const n=Dd(this,bd(t.animation),e);return{type:1,matchers:Fd(t.expr,e.errors),animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Ud(t.options)}}visitSequence(t,e){return{type:2,steps:t.steps.map(t=>Dd(this,t,e)),options:Ud(t.options)}}visitGroup(t,e){const n=e.currentTime;let i=0;const r=t.steps.map(t=>{e.currentTime=n;const r=Dd(this,t,e);return i=Math.max(i,e.currentTime),r});return e.currentTime=i,{type:3,steps:r,options:Ud(t.options)}}visitAnimate(t,e){const n=function(t,e){let n=null;if(t.hasOwnProperty("duration"))n=t;else if("number"==typeof t)return Vd(dd(t,e).duration,0,"");const i=t;if(i.split(/\s+/).some(t=>"{"==t.charAt(0)&&"{"==t.charAt(1))){const t=Vd(0,0,"");return t.dynamic=!0,t.strValue=i,t}return n=n||dd(i,e),Vd(n.duration,n.delay,n.easing)}(t.timings,e.errors);let i;e.currentAnimateTimings=n;let r=t.styles?t.styles:Lu({});if(5==r.type)i=this.visitKeyframes(r,e);else{let r=t.styles,s=!1;if(!r){s=!0;const t={};n.easing&&(t.easing=n.easing),r=Lu(t)}e.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,e);o.isEmptyStep=s,i=o}return e.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(t,e){const n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){const n=[];Array.isArray(t.styles)?t.styles.forEach(t=>{"string"==typeof t?t==Du?n.push(t):e.errors.push(`The provided style string value ${t} is not allowed.`):n.push(t)}):n.push(t.styles);let i=!1,r=null;return n.forEach(t=>{if(Bd(t)){const e=t,n=e.easing;if(n&&(r=n,delete e.easing),!i)for(let t in e)if(e[t].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:t.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(t,e){const n=e.currentAnimateTimings;let i=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(t=>{"string"!=typeof t&&Object.keys(t).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void e.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=e.collectedStyles[e.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(e.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),e.options&&function(t,e,n){const i=e.params||{},r=xd(t);r.length&&r.forEach(t=>{i.hasOwnProperty(t)||n.push(`Unable to resolve the local animation param ${t} in the given list of values`)})}(t[n],e.options,e.errors)})})}visitKeyframes(t,e){const n={type:5,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const l=t.steps.map(t=>{const n=this._makeStyleAst(t,e);let l=null!=n.offset?n.offset:function(t){if("string"==typeof t)return null;let e=null;if(Array.isArray(t))t.forEach(t=>{if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}});else if(Bd(t)&&t.hasOwnProperty("offset")){const n=t;e=parseFloat(n.offset),delete n.offset}return e}(n.styles),c=0;return null!=l&&(i++,c=n.offset=l),o=o||c<0||c>1,s=s||c0&&i{const s=h>0?i==u?1:h*i:r[i],o=s*f;e.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(t,e),t.offset=s,n.styles.push(t)}),n}visitReference(t,e){return{type:8,animation:Dd(this,bd(t.animation),e),options:Ud(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:9,options:Ud(t.options)}}visitAnimateRef(t,e){return{type:10,animation:this.visitReference(t.animation,e),options:Ud(t.options)}}visitQuery(t,e){const n=e.currentQuerySelector,i=t.options||{};e.queryCount++,e.currentQuery=t;const[r,s]=function(t){const e=!!t.split(/\s*,\s*/).find(t=>":self"==t);return e&&(t=t.replace($d,"")),[t=t.replace(/@\*/g,ad).replace(/@\w+/g,t=>".ng-trigger-"+t.substr(1)).replace(/:animating/g,cd),e]}(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,ju(e.collectedStyles,e.currentQuerySelector,{});const o=Dd(this,bd(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:t.selector,options:Ud(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push("stagger() can only be used inside of query()");const n="full"===t.timings?{duration:0,delay:0,easing:"full"}:dd(t.timings,e.errors,!0);return{type:12,animation:Dd(this,bd(t.animation),e),timings:n,options:null}}}class Nd{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function Bd(t){return!Array.isArray(t)&&"object"==typeof t}function Ud(t){var e;return t?(t=pd(t)).params&&(t.params=(e=t.params)?pd(e):null):t={},t}function Vd(t,e,n){return{duration:t,delay:e,easing:n}}function Hd(t,e,n,i,r,s,o=null,a=!1){return{type:1,element:t,keyframes:e,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class jd{constructor(){this._map=new Map}consume(t){let e=this._map.get(t);return e?this._map.delete(t):e=[],e}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const zd=new RegExp(":enter","g"),Wd=new RegExp(":leave","g");function Gd(t,e,n,i,r,s={},o={},a,l,c=[]){return(new qd).buildKeyframes(t,e,n,i,r,s,o,a,l,c)}class qd{buildKeyframes(t,e,n,i,r,s,o,a,l,c=[]){l=l||new jd;const h=new Xd(t,e,l,i,r,c,[]);h.options=a,h.currentTimeline.setStyles([s],null,h.errors,a),Dd(this,n,h);const u=h.timelines.filter(t=>t.containsAnimation());if(u.length&&Object.keys(o).length){const t=u[u.length-1];t.allowOnlyTimelineStyles()||t.setStyles([o],null,h.errors,a)}return u.length?u.map(t=>t.buildKeyframes()):[Hd(e,[],[],[],0,0,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){const n=e.subInstructions.consume(e.element);if(n){const i=e.createSubContext(t.options),r=e.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&e.transformIntoNewTimeline(s)}e.previousNode=t}visitAnimateRef(t,e){const n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_visitSubInstructions(t,e,n){let i=e.currentTimeline.currentTime;const r=null!=n.duration?hd(n.duration):null,s=null!=n.delay?hd(n.delay):null;return 0!==r&&t.forEach(t=>{const n=e.appendInstructionToTimeline(t,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(t,e){e.updateOptions(t.options,!0),Dd(this,t.animation,e),e.previousNode=t}visitSequence(t,e){const n=e.subContextCount;let i=e;const r=t.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Kd);const t=hd(r.delay);i.delayNextStep(t)}t.steps.length&&(t.steps.forEach(t=>Dd(this,t,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){const n=[];let i=e.currentTimeline.currentTime;const r=t.options&&t.options.delay?hd(t.options.delay):0;t.steps.forEach(s=>{const o=e.createSubContext(t.options);r&&o.delayNextStep(r),Dd(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(t=>e.currentTimeline.mergeTimelineCollectedStyles(t)),e.transformIntoNewTimeline(i),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){const n=t.strValue;return dd(e.params?_d(n,e.params,e.errors):n,e.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){const n=e.currentAnimateTimings=this._visitTiming(t.timings,e),i=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),i.snapshotCurrentStyles());const r=t.style;5==r.type?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){const n=e.currentTimeline,i=e.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){const n=e.currentAnimateTimings,i=e.currentTimeline.duration,r=n.duration,s=e.createSubContext().currentTimeline;s.easing=n.easing,t.styles.forEach(t=>{s.forwardTime((t.offset||0)*r),s.setStyles(t.styles,t.easing,e.errors,e.options),s.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(s),e.transformIntoNewTimeline(i+r),e.previousNode=t}visitQuery(t,e){const n=e.currentTimeline.currentTime,i=t.options||{},r=i.delay?hd(i.delay):0;r&&(6===e.previousNode.type||0==n&&e.currentTimeline.getCurrentStyleProperties().length)&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Kd);let s=n;const o=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{e.currentQueryIndex=i;const o=e.createSubContext(t.options,n);r&&o.delayNextStep(r),n===e.element&&(a=o.currentTimeline),Dd(this,t.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(s),a&&(e.currentTimeline.mergeTimelineCollectedStyles(a),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){const n=e.parentContext,i=e.currentTimeline,r=t.timings,s=Math.abs(r.duration),o=s*(e.currentQueryTotal-1);let a=s*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=e.currentTimeline;a&&l.delayNextStep(a);const c=l.currentTime;Dd(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=i.currentTime-c+(i.startTime-n.currentTimeline.startTime)}}const Kd={};class Xd{constructor(t,e,n,i,r,s,o,a){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=Kd,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Yd(this._driver,e,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;const n=t;let i=this.options;null!=n.duration&&(i.duration=hd(n.duration)),null!=n.delay&&(i.delay=hd(n.delay));const r=n.params;if(r){let t=i.params;t||(t=this.options.params={}),Object.keys(r).forEach(n=>{e&&t.hasOwnProperty(n)||(t[n]=_d(r[n],t,this.errors))})}}_copyOptions(){const t={};if(this.options){const e=this.options.params;if(e){const n=t.params={};Object.keys(e).forEach(t=>{n[t]=e[t]})}}return t}createSubContext(t=null,e,n){const i=e||this.element,r=new Xd(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=Kd,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){const i={duration:null!=e?e:t.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+t.delay,easing:""},r=new Jd(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,i,t.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,i,r,s){let o=[];if(i&&o.push(this.element),t.length>0){t=(t=t.replace(zd,"."+this._enterClassName)).replace(Wd,"."+this._leaveClassName);let e=this._driver.query(this.element,t,1!=n);0!==n&&(e=n<0?e.slice(e.length+n,e.length):e.slice(0,n)),o.push(...e)}return r||0!=o.length||s.push(`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`),o}}class Yd{constructor(t,e,n,i){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const e=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new Yd(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles[t]=e,this._globalTimelineStyles[t]=e,this._styleSummary[t]={time:this.currentTime,value:e}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&(this._previousKeyframe.easing=t),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||Du,this._currentKeyframe[t]=Du}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,i){e&&(this._previousKeyframe.easing=e);const r=i&&i.params||{},s=function(t,e){const n={};let i;return t.forEach(t=>{"*"===t?(i=i||Object.keys(e),i.forEach(t=>{n[t]=Du})):fd(t,!1,n)}),n}(t,this._globalTimelineStyles);Object.keys(s).forEach(t=>{const e=_d(s[t],r,n);this._pendingStyles[t]=e,this._localTimelineStyles.hasOwnProperty(t)||(this._backFill[t]=this._globalTimelineStyles.hasOwnProperty(t)?this._globalTimelineStyles[t]:Du),this._updateStyle(t,e)})}applyStylesToKeyframe(){const t=this._pendingStyles,e=Object.keys(t);0!=e.length&&(this._pendingStyles={},e.forEach(e=>{this._currentKeyframe[e]=t[e]}),Object.keys(this._localTimelineStyles).forEach(t=>{this._currentKeyframe.hasOwnProperty(t)||(this._currentKeyframe[t]=this._localTimelineStyles[t])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(t=>{const e=this._localTimelineStyles[t];this._pendingStyles[t]=e,this._updateStyle(t,e)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){Object.keys(t._styleSummary).forEach(e=>{const n=this._styleSummary[e],i=t._styleSummary[e];(!n||i.time>n.time)&&this._updateStyle(e,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=fd(r,!0);Object.keys(o).forEach(n=>{const i=o[n];"!"==i?t.add(n):i==Du&&e.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=t.size?Cd(t.values()):[],s=e.size?Cd(e.values()):[];if(n){const t=i[0],e=pd(t);t.offset=0,e.offset=1,i=[t,e]}return Hd(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Jd extends Yd{constructor(t,e,n,i,r,s,o=!1){super(t,e,s.delay),this.element=e,this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],s=n+e,o=e/s,a=fd(t[0],!1);a.offset=0,r.push(a);const l=fd(t[0],!1);l.offset=Qd(o),r.push(l);const c=t.length-1;for(let i=1;i<=c;i++){let o=fd(t[i],!1);o.offset=Qd((e+o.offset*n)/s),r.push(o)}n=s,e=0,i="",t=r}return Hd(this.element,t,this.preStyleProps,this.postStyleProps,n,e,i,!0)}}function Qd(t,e=3){const n=Math.pow(10,e-1);return Math.round(t*n)/n}class Zd{}class tp extends Zd{normalizePropertyName(t,e){return Ed(t)}normalizeStyleValue(t,e,n,i){let r="";const s=n.toString().trim();if(ep[e]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const e=n.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&i.push(`Please provide a CSS unit value for ${t}:${n}`)}return s+r}}const ep=(()=>function(t){const e={};return t.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function np(t,e,n,i,r,s,o,a,l,c,h,u,d){return{type:0,element:t,triggerName:e,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:d}}const ip={};class rp{constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,i){return function(t,e,n,i,r){return t.some(t=>t(e,n,i,r))}(this.ast.matchers,t,e,n,i)}buildStyles(t,e,n){const i=this._stateStyles["*"],r=this._stateStyles[t],s=i?i.buildStyles(e,n):{};return r?r.buildStyles(e,n):s}build(t,e,n,i,r,s,o,a,l,c){const h=[],u=this.ast.options&&this.ast.options.params||ip,d=this.buildStyles(n,o&&o.params||ip,h),p=a&&a.params||ip,f=this.buildStyles(i,p,h),g=new Set,m=new Map,v=new Map,y="void"===i,b={params:Object.assign(Object.assign({},u),p)},w=c?[]:Gd(t,e,this.ast.animation,r,s,d,f,b,l,h);let x=0;if(w.forEach(t=>{x=Math.max(t.duration+t.delay,x)}),h.length)return np(e,this._triggerName,n,i,y,d,f,[],[],m,v,x,h);w.forEach(t=>{const n=t.element,i=ju(m,n,{});t.preStyleProps.forEach(t=>i[t]=!0);const r=ju(v,n,{});t.postStyleProps.forEach(t=>r[t]=!0),n!==e&&g.add(n)});const _=Cd(g.values());return np(e,this._triggerName,n,i,y,d,f,w,_,m,v,x)}}class sp{constructor(t,e){this.styles=t,this.defaultParams=e}buildStyles(t,e){const n={},i=pd(this.defaultParams);return Object.keys(t).forEach(e=>{const n=t[e];null!=n&&(i[e]=n)}),this.styles.styles.forEach(t=>{if("string"!=typeof t){const r=t;Object.keys(r).forEach(t=>{let s=r[t];s.length>1&&(s=_d(s,i,e)),n[t]=s})}}),n}}class op{constructor(t,e){this.name=t,this.ast=e,this.transitionFactories=[],this.states={},e.states.forEach(t=>{this.states[t.name]=new sp(t.style,t.options&&t.options.params||{})}),ap(this.states,"true","1"),ap(this.states,"false","0"),e.transitions.forEach(e=>{this.transitionFactories.push(new rp(t,e,this.states))}),this.fallbackTransition=new rp(t,{type:1,animation:{type:2,steps:[],options:null},matchers:[(t,e)=>!0],options:null,queryCount:0,depCount:0},this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,i){return this.transitionFactories.find(r=>r.match(t,e,n,i))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}}function ap(t,e,n){t.hasOwnProperty(e)?t.hasOwnProperty(n)||(t[n]=t[e]):t.hasOwnProperty(n)&&(t[e]=t[n])}const lp=new jd;class cp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(t,e){const n=[],i=Od(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=i}_buildPlayer(t,e,n){const i=t.element,r=Bu(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(i,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){const i=[],r=this._animations[t];let s;const o=new Map;if(r?(s=Gd(this._driver,e,r,rd,sd,{},{},n,lp,i),s.forEach(t=>{const e=ju(o,t.element,{});t.postStyleProps.forEach(t=>e[t]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error("Unable to create the animation due to the following errors: "+i.join("\n"));o.forEach((t,e)=>{Object.keys(t).forEach(n=>{t[n]=this._driver.computeStyle(e,n,Du)})});const a=Nu(s.map(t=>{const e=o.get(t.element);return this._buildPlayer(t,{},e)}));return this._playersById[t]=a,a.onDestroy(()=>this.destroy(t)),this.players.push(a),a}destroy(t){const e=this._getPlayer(t);e.destroy(),delete this._playersById[t];const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){const e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e}listen(t,e,n,i){const r=Hu(e,"","","");return Uu(this._getPlayer(t),n,r,i),()=>{}}command(t,e,n,i){if("register"==n)return void this.register(t,i[0]);if("create"==n)return void this.create(t,e,i[0]||{});const r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(t)}}}const hp="ng-animate-queued",up="ng-animate-disabled",dp=".ng-animate-disabled",pp=[],fp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},gp={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class mp{constructor(t,e=""){this.namespaceId=e;const n=t&&t.hasOwnProperty("value");if(this.value=null!=(i=n?t.value:t)?i:null,n){const e=pd(t);delete e.value,this.options=e}else this.options={};var i;this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(t){const e=t.params;if(e){const t=this.options.params;Object.keys(e).forEach(n=>{null==t[n]&&(t[n]=e[n])})}}}const vp="void",yp=new mp(vp);class bp{constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,kp(e,this._hostClassName)}listen(t,e,n,i){if(!this._triggers.hasOwnProperty(e))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${e}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`);if("start"!=(r=n)&&"done"!=r)throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${e}" is not supported!`);var r;const s=ju(this._elementListeners,t,[]),o={name:e,phase:n,callback:i};s.push(o);const a=ju(this._engine.statesByElement,t,{});return a.hasOwnProperty(e)||(kp(t,od),kp(t,"ng-trigger-"+e),a[e]=yp),()=>{this._engine.afterFlush(()=>{const t=s.indexOf(o);t>=0&&s.splice(t,1),this._triggers[e]||delete a[e]})}}register(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)}_getTrigger(t){const e=this._triggers[t];if(!e)throw new Error(`The provided animation trigger "${t}" has not been registered!`);return e}trigger(t,e,n,i=!0){const r=this._getTrigger(e),s=new xp(this.id,e,t);let o=this._engine.statesByElement.get(t);o||(kp(t,od),kp(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,o={}));let a=o[e];const l=new mp(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o[e]=l,a||(a=yp),l.value!==vp&&a.value===l.value){if(!function(t,e){const n=Object.keys(t),i=Object.keys(e);if(n.length!=i.length)return!1;for(let r=0;r{yd(t,n),vd(t,i)})}return}const c=ju(this._engine.playersByElement,t,[]);c.forEach(t=>{t.namespaceId==this.id&&t.triggerName==e&&t.queued&&t.destroy()});let h=r.matchTransition(a.value,l.value,t,l.params),u=!1;if(!h){if(!i)return;h=r.fallbackTransition,u=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:h,fromState:a,toState:l,player:s,isFallbackTransition:u}),u||(kp(t,hp),s.onStart(()=>{Ap(t,hp)})),s.onDone(()=>{let e=this.players.indexOf(s);e>=0&&this.players.splice(e,1);const n=this._engine.playersByElement.get(t);if(n){let t=n.indexOf(s);t>=0&&n.splice(t,1)}}),this.players.push(s),c.push(s),s}deregister(t){delete this._triggers[t],this._engine.statesByElement.forEach((e,n)=>{delete e[t]}),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(e=>e.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const e=this._engine.playersByElement.get(t);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){const n=this._engine.driver.query(t,ad,!0);n.forEach(t=>{if(t.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(t);n.size?n.forEach(n=>n.triggerLeaveAnimation(t,e,!1,!0)):this.clearElementCache(t)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(t=>this.clearElementCache(t)))}triggerLeaveAnimation(t,e,n,i){const r=this._engine.statesByElement.get(t);if(r){const s=[];if(Object.keys(r).forEach(e=>{if(this._triggers[e]){const n=this.trigger(t,e,vp,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&Nu(s).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const e=this._elementListeners.get(t);if(e){const n=new Set;e.forEach(e=>{const i=e.name;if(n.has(i))return;n.add(i);const r=this._triggers[i].fallbackTransition,s=this._engine.statesByElement.get(t)[i]||yp,o=new mp(vp),a=new xp(this.id,i,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:i,transition:r,fromState:s,toState:o,player:a,isFallbackTransition:!0})})}}removeNode(t,e){const n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let i=!1;if(n.totalAnimations){const e=n.players.length?n.playersByQueriedElement.get(t):[];if(e&&e.length)i=!0;else{let e=t;for(;e=e.parentNode;)if(n.statesByElement.get(e)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(t),i)n.markElementAsRemoved(this.id,t,!1,e);else{const i=t.__ng_removed;i&&i!==fp||(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){kp(t,this._hostClassName)}drainQueuedTransitions(t){const e=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(e=>{if(e.name==n.triggerName){const i=Hu(r,n.triggerName,n.fromState.value,n.toState.value);i._data=t,Uu(n.player,e.phase,i,e.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(n)}),this._queue=[],e.sort((t,e)=>{const n=t.transition.ast.depCount,i=e.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(t.element,e.element)?1:-1})}destroy(t){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}elementContainsData(t){let e=!1;return this._elementListeners.has(t)&&(e=!0),e=!!this._queue.find(e=>e.element===t)||e,e}}class wp{constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(t,e)=>{}}_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}get queuedPlayers(){const t=[];return this._namespaceList.forEach(e=>{e.players.forEach(e=>{e.queued&&t.push(e)})}),t}createNamespace(t,e){const n=new bp(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,e)){this._namespaceList.splice(r+1,0,t),i=!0;break}i||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let i=this._namespaceLookup[t];i&&i.register(e,n)&&this.totalAnimations++}destroy(t,e){if(!t)return;const n=this._fetchNamespace(t);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[t];const e=this._namespaceList.indexOf(n);e>=0&&this._namespaceList.splice(e,1)}),this.afterFlushAnimationsDone(()=>n.destroy(e))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const e=new Set,n=this.statesByElement.get(t);if(n){const t=Object.keys(n);for(let i=0;i=0&&this.collectedLeaveElements.splice(t,1)}if(t){const i=this._fetchNamespace(t);i&&i.insertNode(e,n)}i&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),kp(t,up)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Ap(t,up))}removeNode(t,e,n,i){if(_p(e)){const r=t?this._fetchNamespace(t):null;if(r?r.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i),n){const n=this.namespacesByHostElement.get(e);n&&n.id!==t&&n.removeNode(e,i)}}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,n,i){this.collectedLeaveElements.push(e),e.__ng_removed={namespaceId:t,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(t,e,n,i,r){return _p(e)?this._fetchNamespace(t).listen(e,n,i,r):()=>{}}_buildInstruction(t,e,n,i,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,i,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,ad,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(t,cd,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(t){const e=this.playersByElement.get(t);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(t){const e=this.playersByQueriedElement.get(t);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Nu(this.players).onDone(()=>t());t()})}processLeaveNode(t){const e=t.__ng_removed;if(e&&e.setForRemoval){if(t.__ng_removed=fp,e.namespaceId){this.destroyInnerAnimations(t);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}this.driver.matchesElement(t,dp)&&this.markElementAsDisabled(t,!1),this.driver.query(t,dp,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,e)=>this._balanceNamespaceList(t,e)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nt()),this._flushFns=[],this._whenQuietFns.length){const t=this._whenQuietFns;this._whenQuietFns=[],e.length?Nu(e).onDone(()=>{t.forEach(t=>t())}):t.forEach(t=>t())}}reportError(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))}_flushAnimations(t,e){const n=new jd,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,c=new Set;this.disabledNodes.forEach(t=>{c.add(t);const e=this.driver.query(t,".ng-animate-queued",!0);for(let n=0;n{const n=rd+f++;p.set(e,n),t.forEach(t=>kp(t,n))});const g=[],m=new Set,v=new Set;for(let R=0;Rm.add(t)):v.add(t))}const y=new Map,b=Ep(u,Array.from(m));b.forEach((t,e)=>{const n=sd+f++;y.set(e,n),t.forEach(t=>kp(t,n))}),t.push(()=>{d.forEach((t,e)=>{const n=p.get(e);t.forEach(t=>Ap(t,n))}),b.forEach((t,e)=>{const n=y.get(e);t.forEach(t=>Ap(t,n))}),g.forEach(t=>{this.processLeaveNode(t)})});const w=[],x=[];for(let R=this._namespaceList.length-1;R>=0;R--)this._namespaceList[R].drainQueuedTransitions(e).forEach(t=>{const e=t.player,r=t.element;if(w.push(e),this.collectedEnterElements.length){const t=r.__ng_removed;if(t&&t.setForMove)return void e.destroy()}const c=!h||!this.driver.containsElement(h,r),u=y.get(r),d=p.get(r),f=this._buildInstruction(t,n,d,u,c);if(f.errors&&f.errors.length)x.push(f);else{if(c)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);if(t.isFallbackTransition)return e.onStart(()=>yd(r,f.fromStyles)),e.onDestroy(()=>vd(r,f.toStyles)),void i.push(e);f.timelines.forEach(t=>t.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:e,element:r}),f.queriedElements.forEach(t=>ju(o,t,[]).push(e)),f.preStyleProps.forEach((t,e)=>{const n=Object.keys(t);if(n.length){let t=a.get(e);t||a.set(e,t=new Set),n.forEach(e=>t.add(e))}}),f.postStyleProps.forEach((t,e)=>{const n=Object.keys(t);let i=l.get(e);i||l.set(e,i=new Set),n.forEach(t=>i.add(t))})}});if(x.length){const t=[];x.forEach(e=>{t.push(`@${e.triggerName} has failed due to:\n`),e.errors.forEach(e=>t.push(`- ${e}\n`))}),w.forEach(t=>t.destroy()),this.reportError(t)}const _=new Map,C=new Map;s.forEach(t=>{const e=t.element;n.has(e)&&(C.set(e,e),this._beforeAnimationBuild(t.player.namespaceId,t.instruction,_))}),i.forEach(t=>{const e=t.element;this._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach(t=>{ju(_,e,[]).push(t),t.destroy()})});const S=g.filter(t=>Rp(t,a,l)),E=new Map;Sp(E,this.driver,v,l,Du).forEach(t=>{Rp(t,a,l)&&S.push(t)});const k=new Map;d.forEach((t,e)=>{Sp(k,this.driver,new Set(t),a,"!")}),S.forEach(t=>{const e=E.get(t),n=k.get(t);E.set(t,Object.assign(Object.assign({},e),n))});const A=[],D=[],T={};s.forEach(t=>{const{element:e,player:s,instruction:o}=t;if(n.has(e)){if(c.has(e))return s.onDestroy(()=>vd(e,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let t=T;if(C.size>1){let n=e;const i=[];for(;n=n.parentNode;){const e=C.get(n);if(e){t=e;break}i.push(n)}i.forEach(e=>C.set(e,t))}const n=this._buildAnimation(s.namespaceId,o,_,r,k,E);if(s.setRealPlayer(n),t===T)A.push(s);else{const e=this.playersByElement.get(t);e&&e.length&&(s.parentPlayer=Nu(e)),i.push(s)}}else yd(e,o.fromStyles),s.onDestroy(()=>vd(e,o.toStyles)),D.push(s),c.has(e)&&i.push(s)}),D.forEach(t=>{const e=r.get(t.element);if(e&&e.length){const n=Nu(e);t.setRealPlayer(n)}}),i.forEach(t=>{t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()});for(let R=0;R!t.destroyed);i.length?Dp(this,t,i):this.processLeaveNode(t)}return g.length=0,A.forEach(t=>{this.players.push(t),t.onDone(()=>{t.destroy();const e=this.players.indexOf(t);this.players.splice(e,1)}),t.play()}),A}elementContainsData(t,e){let n=!1;const i=e.__ng_removed;return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,i,r){let s=[];if(e){const e=this.playersByQueriedElement.get(t);e&&(s=e)}else{const e=this.playersByElement.get(t);if(e){const t=!r||r==vp;e.forEach(e=>{e.queued||(t||e.triggerName==i)&&s.push(e)})}}return(n||i)&&(s=s.filter(t=>!(n&&n!=t.namespaceId||i&&i!=t.triggerName))),s}_beforeAnimationBuild(t,e,n){const i=e.element,r=e.isRemovalTransition?void 0:t,s=e.isRemovalTransition?void 0:e.triggerName;for(const o of e.timelines){const t=o.element,a=t!==i,l=ju(n,t,[]);this._getPreviousPlayers(t,a,r,s,e.toState).forEach(t=>{const e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),l.push(t)})}yd(i,e.fromStyles)}_buildAnimation(t,e,n,i,r,s){const o=e.triggerName,a=e.element,l=[],c=new Set,h=new Set,u=e.timelines.map(e=>{const u=e.element;c.add(u);const d=u.__ng_removed;if(d&&d.removedBeforeQueried)return new $u(e.duration,e.delay);const p=u!==a,f=function(t){const e=[];return Tp(t,e),e}((n.get(u)||pp).map(t=>t.getRealPlayer())).filter(t=>!!t.element&&t.element===u),g=r.get(u),m=s.get(u),v=Bu(0,this._normalizer,0,e.keyframes,g,m),y=this._buildPlayer(e,v,f);if(e.subTimeline&&i&&h.add(u),p){const e=new xp(t,o,u);e.setRealPlayer(y),l.push(e)}return y});l.forEach(t=>{ju(this.playersByQueriedElement,t.element,[]).push(t),t.onDone(()=>function(t,e,n){let i;if(t instanceof Map){if(i=t.get(e),i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&t.delete(e)}}else if(i=t[e],i){if(i.length){const t=i.indexOf(n);i.splice(t,1)}0==i.length&&delete t[e]}return i}(this.playersByQueriedElement,t.element,t))}),c.forEach(t=>kp(t,ld));const d=Nu(u);return d.onDestroy(()=>{c.forEach(t=>Ap(t,ld)),vd(a,e.toStyles)}),h.forEach(t=>{ju(i,t,[]).push(d)}),d}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new $u(t.duration,t.delay)}}class xp{constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n,this._player=new $u,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach(e=>{this._queuedCallbacks[e].forEach(n=>Uu(t,e,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){ju(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const e=this._player;e.triggerCallback&&e.triggerCallback(t)}}function _p(t){return t&&1===t.nodeType}function Cp(t,e){const n=t.style.display;return t.style.display=null!=e?e:"none",n}function Sp(t,e,n,i,r){const s=[];n.forEach(t=>s.push(Cp(t)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(t=>{const n=s[t]=e.computeStyle(i,t,r);n&&0!=n.length||(i.__ng_removed=gp,o.push(i))}),t.set(i,s)});let a=0;return n.forEach(t=>Cp(t,s[a++])),o}function Ep(t,e){const n=new Map;if(t.forEach(t=>n.set(t,[])),0==e.length)return n;const i=new Set(e),r=new Map;function s(t){if(!t)return 1;let e=r.get(t);if(e)return e;const o=t.parentNode;return e=n.has(o)?o:i.has(o)?1:s(o),r.set(t,e),e}return e.forEach(t=>{const e=s(t);1!==e&&n.get(e).push(t)}),n}function kp(t,e){if(t.classList)t.classList.add(e);else{let n=t.$$classes;n||(n=t.$$classes={}),n[e]=!0}}function Ap(t,e){if(t.classList)t.classList.remove(e);else{let n=t.$$classes;n&&delete n[e]}}function Dp(t,e,n){Nu(n).onDone(()=>t.processLeaveNode(e))}function Tp(t,e){for(let n=0;nr.add(t)):e.set(t,i),n.delete(t),!0}class Fp{constructor(t,e,n){this.bodyNode=t,this._driver=e,this._triggerCache={},this.onRemovalComplete=(t,e)=>{},this._transitionEngine=new wp(t,e,n),this._timelineEngine=new cp(t,e,n),this._transitionEngine.onRemovalComplete=(t,e)=>this.onRemovalComplete(t,e)}registerTrigger(t,e,n,i,r){const s=t+"-"+i;let o=this._triggerCache[s];if(!o){const t=[],e=Od(this._driver,r,t);if(t.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${t.join("\n - ")}`);o=function(t,e){return new op(t,e)}(i,e),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(e,i,o)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,i){this._transitionEngine.insertNode(t,e,n,i)}onRemove(t,e,n,i){this._transitionEngine.removeNode(t,e,i||!1,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,i){if("@"==n.charAt(0)){const[t,r]=zu(n);this._timelineEngine.command(t,e,r,i)}else this._transitionEngine.trigger(t,e,n,i)}listen(t,e,n,i,r){if("@"==n.charAt(0)){const[t,i]=zu(n);return this._timelineEngine.listen(t,e,i,r)}return this._transitionEngine.listen(t,e,n,i,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function Lp(t,e){let n=null,i=null;return Array.isArray(e)&&e.length?(n=Ip(e[0]),e.length>1&&(i=Ip(e[e.length-1]))):e&&(n=Ip(e)),n||i?new Mp(t,n,i):null}let Mp=(()=>{class t{constructor(e,n,i){this._element=e,this._startStyles=n,this._endStyles=i,this._state=0;let r=t.initialStylesByElement.get(e);r||t.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vd(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vd(this._element,this._initialStyles),this._endStyles&&(vd(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(yd(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(yd(this._element,this._endStyles),this._endStyles=null),vd(this._element,this._initialStyles),this._state=3)}}return t.initialStylesByElement=new WeakMap,t})();function Ip(t){let e=null;const n=Object.keys(t);for(let i=0;ithis._handleCallback(t)}apply(){!function(t,e){const n=zp(t,"").trim();n.length&&(function(t,e){let n=0;for(let i=0;i=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),Hp(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(t,e){const n=zp(t,"").split(","),i=Vp(n,e);i>=0&&(n.splice(i,1),jp(t,"",n.join(",")))}(this._element,this._name))}}function Bp(t,e,n){jp(t,"PlayState",n,Up(t,e))}function Up(t,e){const n=zp(t,"");return n.indexOf(",")>0?Vp(n.split(","),e):Vp([n],e)}function Vp(t,e){for(let n=0;n=0)return n;return-1}function Hp(t,e,n){n?t.removeEventListener(Pp,e):t.addEventListener(Pp,e)}function jp(t,e,n,i){const r=Op+e;if(null!=i){const e=t.style[r];if(e.length){const t=e.split(",");t[i]=n,n=t.join(",")}}t.style[r]=n}function zp(t,e){return t.style[Op+e]||""}class Wp{constructor(t,e,n,i,r,s,o,a){this.element=t,this.keyframes=e,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}destroy(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(t=>t()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}finish(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(t){this._styler.setPosition(t)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Np(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}beforeDestroy(){this.init();const t={};if(this.hasStarted()){const e=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(t[n]=e?this._finalStyles[n]:Td(this.element,n))})}this.currentSnapshot=t}}class Gp extends $u{constructor(t,e){super(),this.element=t,this._startingStyles={},this.__initialized=!1,this._styles=ed(e)}init(){!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(t=>{this._startingStyles[t]=this.element.style[t]}),super.init())}play(){this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(t=>this.element.style.setProperty(t,this._styles[t])),super.play())}destroy(){this._startingStyles&&(Object.keys(this._startingStyles).forEach(t=>{const e=this._startingStyles[t];e?this.element.style.setProperty(t,e):this.element.style.removeProperty(t)}),this._startingStyles=null,super.destroy())}}class qp{constructor(){this._count=0,this._head=document.querySelector("head")}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}buildKeyframeElement(t,e,n){n=n.map(t=>ed(t));let i=`@keyframes ${e} {\n`,r="";n.forEach(t=>{r=" ";const e=parseFloat(t.offset);i+=`${r}${100*e}% {\n`,r+=" ",Object.keys(t).forEach(e=>{const n=t[e];switch(e){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${e}: ${n};\n`)}}),i+=r+"}\n"}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(t,e,n,i,r,s=[],o){const a=s.filter(t=>t instanceof Wp),l={};kd(n,i)&&a.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const c=function(t){let e={};return t&&(Array.isArray(t)?t:[t]).forEach(t=>{Object.keys(t).forEach(n=>{"offset"!=n&&"easing"!=n&&(e[n]=t[n])})}),e}(e=Ad(t,e,l));if(0==n)return new Gp(t,c);const h="gen_css_kf_"+this._count++,u=this.buildKeyframeElement(t,h,e);document.querySelector("head").appendChild(u);const d=Lp(t,e),p=new Wp(t,e,h,n,i,r,c,d);return p.onDestroy(()=>{var t;(t=u).parentNode.removeChild(t)}),p}}class Kp{constructor(t,e,n,i){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(t,e,n){return t.animate(e,n)}onStart(t){this._onStartFns.push(t)}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer.currentTime=t*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(e=>{"offset"!=e&&(t[e]=this._finished?this._finalKeyframe[e]:Td(this.element,e))}),this.currentSnapshot=t}triggerCallback(t){const e="start"==t?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}}class Xp{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Yp().toString()),this._cssKeyframesDriver=new qp}validateStyleProperty(t){return Ju(t)}matchesElement(t,e){return Qu(t,e)}containsElement(t,e){return Zu(t,e)}query(t,e,n){return td(t,e,n)}computeStyle(t,e,n){return window.getComputedStyle(t)[e]}overrideWebAnimationsSupport(t){this._isNativeImpl=t}animate(t,e,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(t,e,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const l={},c=s.filter(t=>t instanceof Kp);kd(n,i)&&c.forEach(t=>{let e=t.currentSnapshot;Object.keys(e).forEach(t=>l[t]=e[t])});const h=Lp(t,e=Ad(t,e=e.map(t=>fd(t,!1)),l));return new Kp(t,e,a,h)}}function Yp(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}let Jp=(()=>{class t extends Au{constructor(t,e){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(e.body,{id:"0",encapsulation:Ct.None,styles:[],data:{animation:[]}})}build(t){const e=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(t)?Fu(t):t;return tf(this._renderer,null,e,"register",[n]),new Qp(e,this._renderer)}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(ph))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Qp extends class{}{constructor(t,e){super(),this._id=t,this._renderer=e}create(t,e){return new Zp(this._id,t,e||{},this._renderer)}}class Zp{constructor(t,e,n,i){this.id=t,this.element=e,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(t,e){return this._renderer.listen(this.element,`@@${this.id}:${t}`,e)}_command(t,...e){return tf(this._renderer,this.element,this.id,t,e)}onDone(t){this._listen("done",t)}onStart(t){this._listen("start",t)}onDestroy(t){this._listen("destroy",t)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset")}setPosition(t){this._command("setPosition",t)}getPosition(){var t,e;return null!==(e=null===(t=this._renderer.engine.players[+this.id])||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}}function tf(t,e,n,i,r){return t.setProperty(e,`@@${n}:${i}`,r)}const ef="@",nf="@.disabled";let rf=(()=>{class t{constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),e.onRemovalComplete=(t,e)=>{e&&e.parentNode(t)&&e.removeChild(t.parentNode,t)}}createRenderer(t,e){const n=this.delegate.createRenderer(t,e);if(!(t&&e&&e.data&&e.data.animation)){let t=this._rendererCache.get(n);return t||(t=new sf("",n,this.engine),this._rendererCache.set(n,t)),t}const i=e.id,r=e.id+"-"+this._currentId;this._currentId++,this.engine.register(r,t);const s=e=>{Array.isArray(e)?e.forEach(s):this.engine.registerTrigger(i,r,t,e.name,e)};return e.data.animation.forEach(s),new of(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){t>=0&&te(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(t=>{const[e,n]=t;e(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([e,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return t.\u0275fac=function(e){return new(e||t)(bi(Wa),bi(Fp),bi(Ic))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class sf{constructor(t,e,n){this.namespaceId=t,this.delegate=e,this.engine=n,this.destroyNode=this.delegate.destroyNode?t=>e.destroyNode(t):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,i=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,i)}removeChild(t,e,n){this.engine.onRemove(this.namespaceId,e,this.delegate,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,i){this.delegate.setAttribute(t,e,n,i)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,i){this.delegate.setStyle(t,e,n,i)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==ef&&e==nf?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.delegate.listen(t,e,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}}class of extends sf{constructor(t,e,n,i){super(e,n,i),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==ef?"."==e.charAt(1)&&e==nf?this.disableAnimations(t,n=void 0===n||!!n):this.engine.process(this.namespaceId,t,e.substr(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n){if(e.charAt(0)==ef){const i=function(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(t);let r=e.substr(1),s="";return r.charAt(0)!=ef&&([r,s]=function(t){const e=t.indexOf(".");return[t.substring(0,e),t.substr(e+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,t=>{this.factory.scheduleListenerCallback(t._data||-1,n,t)})}return this.delegate.listen(t,e,n)}}let af=(()=>{class t extends Fp{constructor(t,e,n){super(t.body,e,n)}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(id),bi(Zd))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const lf=new Yn("AnimationModuleType"),cf=[{provide:Au,useClass:Jp},{provide:Zd,useFactory:function(){return new tp}},{provide:Fp,useClass:af},{provide:Wa,useFactory:function(t,e,n){return new rf(t,e,n)},deps:[du,Fp,Ic]}],hf=[{provide:id,useFactory:function(){return"function"==typeof Yp()?new Xp:new qp}},{provide:lf,useValue:"BrowserAnimations"},...cf],uf=[{provide:id,useClass:nd},{provide:lf,useValue:"NoopAnimations"},...cf];let df=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:hf,imports:[ku]}),t})(),pf=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:uf,imports:[ku]}),t})();function ff(...t){let e=t[t.length-1];return E(e)?(t.pop(),$(t,e)):z(t)}class gf extends C{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new w;return this._value}next(t){super.next(this._value=t)}}class mf extends f{notifyNext(t,e,n,i,r){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}class vf extends f{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function yf(t,e,n,i,r=new vf(t,n,i)){if(!r.closed)return e instanceof y?e.subscribe(r):I(e)(r)}const bf={};class wf{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new xf(t,this.resultSelector))}}class xf extends mf{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(bf),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n{function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t})(),Cf=new y(t=>t.complete());function Sf(t){return t?function(t){return new y(e=>t.schedule(()=>e.complete()))}(t):Cf}function Ef(t){return new y(e=>{let n;try{n=t()}catch(i){return void e.error(i)}return(n?O(n):Sf()).subscribe(e)})}function kf(){return j(1)}function Af(t,e){return function(n){return n.lift(new Df(t,e))}}class Df{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new Tf(t,this.predicate,this.thisArg))}}class Tf extends f{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}const Rf=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})();function Ff(t){return function(e){return 0===t?Sf():e.lift(new Lf(t))}}class Lf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Mf(t,this.total))}}class Mf extends f{constructor(t,e){super(t),this.total=e,this.ring=new Array,this.count=0}_next(t){const e=this.ring,n=this.total,i=this.count++;e.length0){const n=this.count>=this.total?this.total:this.count,i=this.ring;for(let r=0;re.lift(new $f(t))}class $f{constructor(t){this.errorFactory=t}call(t,e){return e.subscribe(new Of(t,this.errorFactory))}}class Of extends f{constructor(t,e){super(t),this.errorFactory=e,this.hasValue=!1}_next(t){this.hasValue=!0,this.destination.next(t)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function Pf(){return new _f}function Nf(t=null){return e=>e.lift(new Bf(t))}class Bf{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new Uf(t,this.defaultValue))}}class Uf extends f{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Vf(t,e){return"function"==typeof e?n=>n.pipe(Vf((n,i)=>O(t(n,i)).pipe(k((t,r)=>e(n,t,i,r))))):e=>e.lift(new Hf(t))}class Hf{constructor(t){this.project=t}call(t,e){return e.subscribe(new jf(t,this.project))}}class jf extends N{constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(i){return void this.destination.error(i)}this._innerSub(e)}_innerSub(t){const e=this.innerSubscription;e&&e.unsubscribe();const n=new P(this),i=this.destination;i.add(n),this.innerSubscription=B(t,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;t&&!t.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(t){this.destination.next(t)}}function zf(t){return e=>0===t?Sf():e.lift(new Wf(t))}class Wf{constructor(t){if(this.total=t,this.total<0)throw new Rf}call(t,e){return e.subscribe(new Gf(t,this.total))}}class Gf extends f{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function qf(...t){return kf()(ff(...t))}class Kf{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new Xf(t,this.accumulator,this.seed,this.hasSeed))}}class Xf extends f{constructor(t,e,n,i){super(t),this.accumulator=e,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}function Yf(t){return function(e){const n=new Jf(t),i=e.lift(n);return n.caught=i}}class Jf{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Qf(t,this.selector,this.caught))}}class Qf extends N{constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const i=new P(this);this.add(i);const r=B(n,i);r!==i&&this.add(r)}}}function Zf(t,e){return U(t,e,1)}function tg(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,zf(1),n?Nf(e):If(()=>new _f))}function eg(){}function ng(t,e,n){return function(i){return i.lift(new ig(t,e,n))}}class ig{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new rg(t,this.nextOrObserver,this.error,this.complete))}}class rg extends f{constructor(t,e,n,r){super(t),this._tapNext=eg,this._tapError=eg,this._tapComplete=eg,this._tapError=n||eg,this._tapComplete=r||eg,i(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||eg,this._tapError=e.error||eg,this._tapComplete=e.complete||eg)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}class sg{constructor(t){this.callback=t}call(t,e){return e.subscribe(new og(t,this.callback))}}class og extends f{constructor(t,e){super(t),this.add(new u(e))}}class ag{constructor(t,e){this.id=t,this.url=e}}class lg extends ag{constructor(t,e,n="imperative",i=null){super(t,e),this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class cg extends ag{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class hg extends ag{constructor(t,e,n){super(t,e),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class ug extends ag{constructor(t,e,n){super(t,e),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class dg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class fg extends ag{constructor(t,e,n,i,r){super(t,e),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class gg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class mg extends ag{constructor(t,e,n,i){super(t,e),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class vg{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class yg{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class bg{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class wg{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class xg{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class _g{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Cg{constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Sg="primary";class Eg{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function kg(t){return new Eg(t)}function Ag(t){const e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function Dg(t,e,n){const i=n.path.split("/");if(i.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||i.lengthi[e]===t)}return t===e}function Fg(t){return Array.prototype.concat.apply([],t)}function Lg(t){return t.length>0?t[t.length-1]:null}function Mg(t,e){for(const n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Ig(t){return Uo(t)?t:Bo(t)?O(Promise.resolve(t)):ff(t)}function $g(t,e,n){return n?function(t,e){return Tg(t,e)}(t.queryParams,e.queryParams)&&Og(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>Rg(t[n],e[n]))}(t.queryParams,e.queryParams)&&Pg(t.root,e.root)}function Og(t,e){if(!Hg(t.segments,e.segments))return!1;if(t.numberOfChildren!==e.numberOfChildren)return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Og(t.children[n],e.children[n]))return!1}return!0}function Pg(t,e){return Ng(t,e,e.segments)}function Ng(t,e,n){if(t.segments.length>n.length)return!!Hg(t.segments.slice(0,n.length),n)&&!e.hasChildren();if(t.segments.length===n.length){if(!Hg(t.segments,n))return!1;for(const n in e.children){if(!t.children[n])return!1;if(!Pg(t.children[n],e.children[n]))return!1}return!0}{const i=n.slice(0,t.segments.length),r=n.slice(t.segments.length);return!!Hg(t.segments,i)&&!!t.children.primary&&Ng(t.children.primary,e,r)}}class Bg{constructor(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return Gg.serialize(this)}}class Ug{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Mg(e,(t,e)=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return qg(this)}}class Vg{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=kg(this.parameters)),this._parameterMap}toString(){return tm(this)}}function Hg(t,e){return t.length===e.length&&t.every((t,n)=>t.path===e[n].path)}function jg(t,e){let n=[];return Mg(t.children,(t,i)=>{i===Sg&&(n=n.concat(e(t,i)))}),Mg(t.children,(t,i)=>{i!==Sg&&(n=n.concat(e(t,i)))}),n}class zg{}class Wg{parse(t){const e=new sm(t);return new Bg(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){return`${"/"+Kg(t.root,!0)}${function(t){const e=Object.keys(t).map(e=>{const n=t[e];return Array.isArray(n)?n.map(t=>`${Yg(e)}=${Yg(t)}`).join("&"):`${Yg(e)}=${Yg(n)}`});return e.length?"?"+e.join("&"):""}(t.queryParams)}${"string"==typeof t.fragment?"#"+encodeURI(t.fragment):""}`}}const Gg=new Wg;function qg(t){return t.segments.map(t=>tm(t)).join("/")}function Kg(t,e){if(!t.hasChildren())return qg(t);if(e){const e=t.children.primary?Kg(t.children.primary,!1):"",n=[];return Mg(t.children,(t,e)=>{e!==Sg&&n.push(`${e}:${Kg(t,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}{const e=jg(t,(e,n)=>n===Sg?[Kg(t.children.primary,!1)]:[`${n}:${Kg(e,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children.primary?`${qg(t)}/${e[0]}`:`${qg(t)}/(${e.join("//")})`}}function Xg(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Yg(t){return Xg(t).replace(/%3B/gi,";")}function Jg(t){return Xg(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Qg(t){return decodeURIComponent(t)}function Zg(t){return Qg(t.replace(/\+/g,"%20"))}function tm(t){return`${Jg(t.path)}${e=t.parameters,Object.keys(e).map(t=>`;${Jg(t)}=${Jg(e[t])}`).join("")}`;var e}const em=/^[^\/()?;=#]+/;function nm(t){const e=t.match(em);return e?e[0]:""}const im=/^[^=?&#]+/,rm=/^[^?&#]+/;class sm{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ug([],{}):new Ug([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n.primary=new Ug(t,e)),n}parseSegment(){const t=nm(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new Vg(Qg(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=nm(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=nm(this.remaining);t&&(n=t,this.capture(n))}t[Qg(e)]=Qg(n)}parseQueryParam(t){const e=function(t){const e=t.match(im);return e?e[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=function(t){const e=t.match(rm);return e?e[0]:""}(this.remaining);t&&(n=t,this.capture(n))}const i=Zg(e),r=Zg(n);if(t.hasOwnProperty(i)){let e=t[i];Array.isArray(e)||(e=[e],t[i]=e),e.push(r)}else t[i]=r}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=nm(this.remaining),i=this.remaining[n.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let r=void 0;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):t&&(r=Sg);const s=this.parseChildren();e[r]=1===Object.keys(s).length?s.primary:new Ug([],s),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class om{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=am(t,this._root);return e?e.children.map(t=>t.value):[]}firstChild(t){const e=am(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=lm(t,this._root);return e.length<2?[]:e[e.length-2].children.map(t=>t.value).filter(e=>e!==t)}pathFromRoot(t){return lm(t,this._root).map(t=>t.value)}}function am(t,e){if(t===e.value)return e;for(const n of e.children){const e=am(t,n);if(e)return e}return null}function lm(t,e){if(t===e.value)return[e];for(const n of e.children){const i=lm(t,n);if(i.length)return i.unshift(e),i}return[]}class cm{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function hm(t){const e={};return t&&t.children.forEach(t=>e[t.value.outlet]=t),e}class um extends om{constructor(t,e){super(t),this.snapshot=e,vm(this,t)}toString(){return this.snapshot.toString()}}function dm(t,e){const n=function(t,e){const n=new gm([],{},{},"",{},Sg,e,null,t.root,-1,{});return new mm("",new cm(n,[]))}(t,e),i=new gf([new Vg("",{})]),r=new gf({}),s=new gf({}),o=new gf({}),a=new gf(""),l=new pm(i,r,o,a,s,Sg,e,n.root);return l.snapshot=n.root,new um(new cm(l,[]),n)}class pm{constructor(t,e,n,i,r,s,o,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(k(t=>kg(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(k(t=>kg(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function fm(t,e="emptyOnly"){const n=t.pathFromRoot;let i=0;if("always"!==e)for(i=n.length-1;i>=1;){const t=n[i],e=n[i-1];if(t.routeConfig&&""===t.routeConfig.path)i--;else{if(e.component)break;i--}}return function(t){return t.reduce((t,e)=>({params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(i))}class gm{constructor(t,e,n,i,r,s,o,a,l,c,h){this.url=t,this.params=e,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this.routeConfig=a,this._urlSegment=l,this._lastPathIndex=c,this._resolve=h}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=kg(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=kg(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(t=>t.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class mm extends om{constructor(t,e){super(e),this.url=t,vm(this,e)}toString(){return ym(this._root)}}function vm(t,e){e.value._routerState=t,e.children.forEach(e=>vm(t,e))}function ym(t){const e=t.children.length>0?` { ${t.children.map(ym).join(", ")} } `:"";return`${t.value}${e}`}function bm(t){if(t.snapshot){const e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Tg(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Tg(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(let n=0;nTg(t.parameters,i[e].parameters))&&!(!t.parent!=!e.parent)&&(!t.parent||wm(t.parent,e.parent))}function xm(t,e,n){if(n&&t.shouldReuseRoute(e.value,n.value.snapshot)){const i=n.value;i._futureSnapshot=e.value;const r=function(t,e,n){return e.children.map(e=>{for(const i of n.children)if(t.shouldReuseRoute(e.value,i.value.snapshot))return xm(t,e,i);return xm(t,e)})}(t,e,n);return new cm(i,r)}{const n=t.retrieve(e.value);if(n){const t=n.route;return _m(e,t),t}{const n=new pm(new gf((i=e.value).url),new gf(i.params),new gf(i.queryParams),new gf(i.fragment),new gf(i.data),i.outlet,i.component,i),r=e.children.map(e=>xm(t,e));return new cm(n,r)}}var i}function _m(t,e){if(t.value.routeConfig!==e.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==e.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");e.value._futureSnapshot=t.value;for(let n=0;n{s[e]=Array.isArray(t)?t.map(t=>""+t):""+t}),new Bg(n.root===t?e:km(n.root,t,e),s,r)}function km(t,e,n){const i={};return Mg(t.children,(t,r)=>{i[r]=t===e?n:km(t,e,n)}),new Ug(t.segments,i)}class Am{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Cm(n[0]))throw new Error("Root segment cannot have matrix parameters");const i=n.find(Sm);if(i&&i!==Lg(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Dm{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}function Tm(t,e,n){if(t||(t=new Ug([],{})),0===t.segments.length&&t.hasChildren())return Rm(t,e,n);const i=function(t,e,n){let i=0,r=e;const s={match:!1,pathIndex:0,commandIndex:0};for(;r=n.length)return s;const e=t.segments[r],o=n[i];if(Sm(o))break;const a=""+o,l=i0&&void 0===a)break;if(a&&l&&"object"==typeof l&&void 0===l.outlets){if(!Im(a,l,e))return s;i+=2}else{if(!Im(a,{},e))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(t,e,n),r=n.slice(i.commandIndex);if(i.match&&i.pathIndex{"string"==typeof n&&(n=[n]),null!==n&&(r[i]=Tm(t.children[i],e,n))}),Mg(t.children,(t,e)=>{void 0===i[e]&&(r[e]=t)}),new Ug(t.segments,r)}}function Fm(t,e,n){const i=t.segments.slice(0,e);let r=0;for(;r{"string"==typeof t&&(t=[t]),null!==t&&(e[n]=Fm(new Ug([],{}),0,t))}),e}function Mm(t){const e={};return Mg(t,(t,n)=>e[n]=""+t),e}function Im(t,e,n){return t==n.path&&Tg(e,n.parameters)}class $m{constructor(t,e,n,i){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=i}activate(t){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),bm(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{const e=t.value.outlet;this.deactivateRoutes(t,i[e],n),delete i[e]}),Mg(i,(t,e)=>{this.deactivateRouteAndItsChildren(t,n)})}deactivateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(i===r)if(i.component){const r=n.getContext(i.outlet);r&&this.deactivateChildRoutes(t,e,r.children)}else this.deactivateChildRoutes(t,e,n);else r&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const n=e.getContext(t.value.outlet);if(n&&n.outlet){const e=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:e,route:t,contexts:i})}}deactivateRouteAndOutlet(t,e){const n=e.getContext(t.value.outlet);if(n){const i=hm(t),r=t.value.component?n.children:e;Mg(i,(t,e)=>this.deactivateRouteAndItsChildren(t,r)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(t,e,n){const i=hm(e);t.children.forEach(t=>{this.activateRoutes(t,i[t.value.outlet],n),this.forwardEvent(new _g(t.value.snapshot))}),t.children.length&&this.forwardEvent(new wg(t.value.snapshot))}activateRoutes(t,e,n){const i=t.value,r=e?e.value:null;if(bm(i),i===r)if(i.component){const r=n.getOrCreateContext(i.outlet);this.activateChildRoutes(t,e,r.children)}else this.activateChildRoutes(t,e,n);else if(i.component){const e=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const t=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),e.children.onOutletReAttached(t.contexts),e.attachRef=t.componentRef,e.route=t.route.value,e.outlet&&e.outlet.attach(t.componentRef,t.route.value),Om(t.route)}else{const n=function(t){for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(i.snapshot),r=n?n.module.componentFactoryResolver:null;e.attachRef=null,e.route=i,e.resolver=r,e.outlet&&e.outlet.activateWith(i,r),this.activateChildRoutes(t,null,e.children)}}else this.activateChildRoutes(t,null,n)}}function Om(t){bm(t.value),t.children.forEach(Om)}class Pm{constructor(t,e){this.routes=t,this.module=e}}function Nm(t){return"function"==typeof t}function Bm(t){return t instanceof Bg}const Um=Symbol("INITIAL_VALUE");function Vm(){return Vf(t=>function(...t){let e=void 0,n=void 0;return E(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&l(t[0])&&(t=t[0]),z(t,n).lift(new wf(e))}(...t.map(t=>t.pipe(zf(1),function(...t){const e=t[t.length-1];return E(e)?(t.pop(),n=>qf(t,n,e)):e=>qf(t,e)}(Um)))).pipe(function(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new Kf(t,e,n))}}((t,e)=>{let n=!1;return e.reduce((t,i,r)=>{if(t!==Um)return t;if(i===Um&&(n=!0),!n){if(!1===i)return i;if(r===e.length-1||Bm(i))return i}return t},t)},Um),Af(t=>t!==Um),k(t=>Bm(t)?t:!0===t),zf(1)))}let Hm=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:function(){return[Ov]},encapsulation:2}),t})();function jm(t,e=""){for(let n=0;ne.error(new Km(t)))}function Jm(t){return new y(e=>e.error(new Xm(t)))}function Qm(t){return new y(e=>e.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Zm{constructor(t,e,n,i,r){this.configLoader=e,this.urlSerializer=n,this.urlTree=i,this.config=r,this.allowRedirects=!0,this.ngModule=t.get(_l)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Sg).pipe(k(t=>this.createUrlTree(t,this.urlTree.queryParams,this.urlTree.fragment))).pipe(Yf(t=>{if(t instanceof Xm)return this.allowRedirects=!1,this.match(t.urlTree);if(t instanceof Km)throw this.noMatchError(t);throw t}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,Sg).pipe(k(e=>this.createUrlTree(e,t.queryParams,t.fragment))).pipe(Yf(t=>{if(t instanceof Km)throw this.noMatchError(t);throw t}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,n){const i=t.segments.length>0?new Ug([],{[Sg]:t}):t;return new Bg(i,e,n)}expandSegmentGroup(t,e,n,i){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(k(t=>new Ug([],t))):this.expandSegment(t,n,e,n.segments,i,!0)}expandChildren(t,e,n){return function(t,e){if(0===Object.keys(t).length)return ff({});const n=[],i=[],r={};return Mg(t,(t,s)=>{const o=e(s,t).pipe(k(t=>r[s]=t));s===Sg?n.push(o):i.push(o)}),ff.apply(null,n.concat(i)).pipe(kf(),function(t,e){const n=arguments.length>=2;return i=>i.pipe(t?Af((e,n)=>t(e,n,i)):v,Ff(1),n?Nf(e):If(()=>new _f))}(),k(()=>r))}(n.children,(n,i)=>this.expandSegmentGroup(t,e,i,n))}expandSegment(t,e,n,i,r,s){const o=function(t){return t.reduce((t,e)=>{const n=qm(e);return t.has(n)?t.get(n).push(e):t.set(n,[e]),t},new Map)}(n);o.has(r)||o.set(r,[]);const a=n=>O(n).pipe(Zf(o=>this.expandSegmentAgainstRoute(t,e,n,o,i,r,s).pipe(Yf(t=>{if(t instanceof Km)return ff(null);throw t}))),tg(t=>null!==t),Yf(t=>{if(t instanceof _f||"EmptyError"===t.name){if(this.noLeftoversInUrl(e,i,r))return ff(new Ug([],{}));throw new Km(e)}throw t}));return O(Array.from(o.entries()).map(([t,e])=>{const n=a(e);return t===r?n:n.pipe(k(()=>null),Yf(()=>ff(null)))})).pipe(t=>t.lift(new wf(void 0)),tg(),k(t=>t.find(t=>null!==t)))}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}expandSegmentAgainstRoute(t,e,n,i,r,s,o){return qm(i)!==s&&""!==i.path?Ym(e):void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,e,i,r):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s):Ym(e)}expandSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,i,s):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,n,i){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Jm(r):this.lineralizeSegments(n,r).pipe(U(n=>{const r=new Ug(n,{});return this.expandSegment(t,r,e,n,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,i,r,s){const{matched:o,consumedSegments:a,lastChild:l,positionalParamSegments:c}=tv(e,i,r);if(!o)return Ym(e);const h=this.applyRedirectCommands(a,i.redirectTo,c);return i.redirectTo.startsWith("/")?Jm(h):this.lineralizeSegments(i,h).pipe(U(i=>this.expandSegment(t,e,n,i.concat(r.slice(l)),s,!1)))}matchSegmentAgainstRoute(t,e,n,i){if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(k(t=>(n._loadedConfig=t,new Ug(i,{})))):ff(new Ug(i,{}));const{matched:r,consumedSegments:s,lastChild:o}=tv(e,n,i);if(!r)return Ym(e);const a=i.slice(o);return this.getChildConfig(t,n,i).pipe(U(t=>{const n=t.module,i=t.routes,{segmentGroup:r,slicedSegments:o}=function(t,e,n,i){return n.length>0&&function(t,e,n){return n.some(n=>nv(t,e,n)&&qm(n)!==Sg)}(t,n,i)?{segmentGroup:ev(new Ug(e,function(t,e){const n={};n.primary=e;for(const i of t)""===i.path&&qm(i)!==Sg&&(n[qm(i)]=new Ug([],{}));return n}(i,new Ug(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some(n=>nv(t,e,n))}(t,n,i)?{segmentGroup:ev(new Ug(t.segments,function(t,e,n,i){const r={};for(const s of n)nv(t,e,s)&&!i[qm(s)]&&(r[qm(s)]=new Ug([],{}));return Object.assign(Object.assign({},i),r)}(t,n,i,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,s,a,i);return 0===o.length&&r.hasChildren()?this.expandChildren(n,i,r).pipe(k(t=>new Ug(s,t))):0===i.length&&0===o.length?ff(new Ug(s,{})):this.expandSegment(n,r,i,o,Sg,!0).pipe(k(t=>new Ug(s.concat(t.segments),t.children)))}))}getChildConfig(t,e,n){return e.children?ff(new Pm(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?ff(e._loadedConfig):this.runCanLoadGuards(t.injector,e,n).pipe(U(n=>n?this.configLoader.load(t.injector,e).pipe(k(t=>(e._loadedConfig=t,t))):function(t){return new y(e=>e.error(Ag(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):ff(new Pm([],t))}runCanLoadGuards(t,e,n){const i=e.canLoad;return i&&0!==i.length?ff(i.map(i=>{const r=t.get(i);let s;if(function(t){return t&&Nm(t.canLoad)}(r))s=r.canLoad(e,n);else{if(!Nm(r))throw new Error("Invalid CanLoad guard");s=r(e,n)}return Ig(s)})).pipe(Vm(),ng(t=>{if(!Bm(t))return;const e=Ag(`Redirecting to "${this.urlSerializer.serialize(t)}"`);throw e.url=t,e}),k(t=>!0===t)):ff(!0)}lineralizeSegments(t,e){let n=[],i=e.root;for(;;){if(n=n.concat(i.segments),0===i.numberOfChildren)return ff(n);if(i.numberOfChildren>1||!i.children.primary)return Qm(t.redirectTo);i=i.children.primary}}applyRedirectCommands(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)}applyRedirectCreatreUrlTree(t,e,n,i){const r=this.createSegmentGroup(t,e.root,n,i);return new Bg(r,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const n={};return Mg(t,(t,i)=>{if("string"==typeof t&&t.startsWith(":")){const r=t.substring(1);n[i]=e[r]}else n[i]=t}),n}createSegmentGroup(t,e,n,i){const r=this.createSegments(t,e.segments,n,i);let s={};return Mg(e.children,(e,r)=>{s[r]=this.createSegmentGroup(t,e,n,i)}),new Ug(r,s)}createSegments(t,e,n,i){return e.map(e=>e.path.startsWith(":")?this.findPosParam(t,e,i):this.findOrReturn(e,n))}findPosParam(t,e,n){const i=n[e.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return i}findOrReturn(t,e){let n=0;for(const i of e){if(i.path===t.path)return e.splice(n),i;n++}return t}}function tv(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:{}};const i=(e.matcher||Dg)(n,t,e);return i?{matched:!0,consumedSegments:i.consumed,lastChild:i.consumed.length,positionalParamSegments:i.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function ev(t){if(1===t.numberOfChildren&&t.children.primary){const e=t.children.primary;return new Ug(t.segments.concat(e.segments),e.children)}return t}function nv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}class iv{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class rv{constructor(t,e){this.component=t,this.route=e}}function sv(t,e,n){const i=t._root;return av(i,e?e._root:null,n,[i.value])}function ov(t,e,n){const i=function(t){if(!t)return null;for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(i?i.module.injector:n).get(t)}function av(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=hm(e);return t.children.forEach(t=>{!function(t,e,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=t.value,o=e?e.value:null,a=n?n.getContext(t.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){const l=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!Hg(t.url,e.url);case"pathParamsOrQueryParamsChange":return!Hg(t.url,e.url)||!Tg(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!wm(t,e)||!Tg(t.queryParams,e.queryParams);case"paramsChange":default:return!wm(t,e)}}(o,s,s.routeConfig.runGuardsAndResolvers);l?r.canActivateChecks.push(new iv(i)):(s.data=o.data,s._resolvedData=o._resolvedData),av(t,e,s.component?a?a.children:null:n,i,r),l&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new rv(a.outlet.component,o))}else o&&lv(e,a,r),r.canActivateChecks.push(new iv(i)),av(t,null,s.component?a?a.children:null:n,i,r)}(t,s[t.value.outlet],n,i.concat([t.value]),r),delete s[t.value.outlet]}),Mg(s,(t,e)=>lv(t,n.getContext(e),r)),r}function lv(t,e,n){const i=hm(t),r=t.value;Mg(i,(t,i)=>{lv(t,r.component?e?e.children.getContext(i):null:e,n)}),n.canDeactivateChecks.push(new rv(r.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,r))}function cv(t,e){return null!==t&&e&&e(new xg(t)),ff(!0)}function hv(t,e){return null!==t&&e&&e(new bg(t)),ff(!0)}function uv(t,e,n){const i=e.routeConfig?e.routeConfig.canActivate:null;return i&&0!==i.length?ff(i.map(i=>Ef(()=>{const r=ov(i,e,n);let s;if(function(t){return t&&Nm(t.canActivate)}(r))s=Ig(r.canActivate(e,t));else{if(!Nm(r))throw new Error("Invalid CanActivate guard");s=Ig(r(e,t))}return s.pipe(tg())}))).pipe(Vm()):ff(!0)}function dv(t,e,n){const i=e[e.length-1],r=e.slice(0,e.length-1).reverse().map(t=>function(t){const e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)).filter(t=>null!==t).map(e=>Ef(()=>ff(e.guards.map(r=>{const s=ov(r,e.node,n);let o;if(function(t){return t&&Nm(t.canActivateChild)}(s))o=Ig(s.canActivateChild(i,t));else{if(!Nm(s))throw new Error("Invalid CanActivateChild guard");o=Ig(s(i,t))}return o.pipe(tg())})).pipe(Vm())));return ff(r).pipe(Vm())}class pv{}class fv{constructor(t,e,n,i,r,s){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=i,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=s}recognize(){try{const t=vv(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,Sg),n=new gm([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Sg,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new cm(n,e),r=new mm(this.url,i);return this.inheritParamsAndData(r._root),ff(r)}catch(t){return new y(e=>e.error(t))}}inheritParamsAndData(t){const e=t.value,n=fm(e,this.paramsInheritanceStrategy);e.params=Object.freeze(n.params),e.data=Object.freeze(n.data),t.children.forEach(t=>this.inheritParamsAndData(t))}processSegmentGroup(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)}processChildren(t,e){const n=jg(e,(e,n)=>this.processSegmentGroup(t,e,n));return function(t){const e={};t.forEach(t=>{const n=e[t.value.outlet];if(n){const e=n.url.map(t=>t.toString()).join("/"),i=t.value.url.map(t=>t.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${e}' and '${i}'.`)}e[t.value.outlet]=t.value})}(n),n.sort((t,e)=>t.value.outlet===Sg?-1:e.value.outlet===Sg?1:t.value.outlet.localeCompare(e.value.outlet)),n}processSegment(t,e,n,i){for(const s of t)try{return this.processSegmentAgainstRoute(s,e,n,i)}catch(r){if(!(r instanceof pv))throw r}if(this.noLeftoversInUrl(e,n,i))return[];throw new pv}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}processSegmentAgainstRoute(t,e,n,i){if(t.redirectTo)throw new pv;if((t.outlet||Sg)!==i)throw new pv;let r,s=[],o=[];if("**"===t.path){const s=n.length>0?Lg(n).parameters:{};r=new gm(n,s,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+n.length,wv(t))}else{const a=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new pv;return{consumedSegments:[],lastChild:0,parameters:{}}}const i=(e.matcher||Dg)(n,t,e);if(!i)throw new pv;const r={};Mg(i.posParams,(t,e)=>{r[e]=t.path});const s=i.consumed.length>0?Object.assign(Object.assign({},r),i.consumed[i.consumed.length-1].parameters):r;return{consumedSegments:i.consumed,lastChild:i.consumed.length,parameters:s}}(e,t,n);s=a.consumedSegments,o=n.slice(a.lastChild),r=new gm(s,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,bv(t),i,t.component,t,gv(e),mv(e)+s.length,wv(t))}const a=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),{segmentGroup:l,slicedSegments:c}=vv(e,s,o,a,this.relativeLinkResolution);if(0===c.length&&l.hasChildren()){const t=this.processChildren(a,l);return[new cm(r,t)]}if(0===a.length&&0===c.length)return[new cm(r,[])];const h=this.processSegment(a,l,c,Sg);return[new cm(r,h)]}}function gv(t){let e=t;for(;e._sourceSegment;)e=e._sourceSegment;return e}function mv(t){let e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,n+=e._segmentIndexShift?e._segmentIndexShift:0;return n-1}function vv(t,e,n,i,r){if(n.length>0&&function(t,e,n){return n.some(n=>yv(t,e,n)&&qm(n)!==Sg)}(t,n,i)){const r=new Ug(e,function(t,e,n,i){const r={};r.primary=i,i._sourceSegment=t,i._segmentIndexShift=e.length;for(const s of n)if(""===s.path&&qm(s)!==Sg){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift=e.length,r[qm(s)]=n}return r}(t,e,i,new Ug(n,t.children)));return r._sourceSegment=t,r._segmentIndexShift=e.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some(n=>yv(t,e,n))}(t,n,i)){const s=new Ug(t.segments,function(t,e,n,i,r,s){const o={};for(const a of i)if(yv(t,n,a)&&!r[qm(a)]){const n=new Ug([],{});n._sourceSegment=t,n._segmentIndexShift="legacy"===s?t.segments.length:e.length,o[qm(a)]=n}return Object.assign(Object.assign({},r),o)}(t,e,n,i,t.children,r));return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}const s=new Ug(t.segments,t.children);return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}function yv(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function bv(t){return t.data||{}}function wv(t){return t.resolve||{}}function xv(t){return function(e){return e.pipe(Vf(e=>{const n=t(e);return n?O(n).pipe(k(()=>e)):O([e])}))}}class _v extends class{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}{}const Cv=new Yn("ROUTES");class Sv{constructor(t,e,n,i){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=i}load(t,e){return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(k(n=>{this.onLoadEndListener&&this.onLoadEndListener(e);const i=n.create(t);return new Pm(Fg(i.injector.get(Cv)).map(Gm),i)}))}loadModuleFactory(t){return"string"==typeof t?O(this.loader.load(t)):Ig(t()).pipe(U(t=>t instanceof Cl?ff(t):O(this.compiler.compileModuleAsync(t))))}}class Ev{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new kv,this.attachRef=null}}class kv{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new Ev,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}class Av{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function Dv(t){throw t}function Tv(t,e,n){return e.parse("/")}function Rv(t,e){return ff(null)}let Fv=(()=>{class t{constructor(t,e,n,i,r,s,o,a){this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=i,this.config=a,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new C,this.errorHandler=Dv,this.malformedUriErrorHandler=Tv,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Rv,afterPreactivation:Rv},this.urlHandlingStrategy=new Av,this.routeReuseStrategy=new _v,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.ngModule=r.get(_l),this.console=r.get(xc);const l=r.get(Ic);this.isNgZoneEnabled=l instanceof Ic,this.resetConfig(a),this.currentUrlTree=new Bg(new Ug([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Sv(s,o,t=>this.triggerEvent(new vg(t)),t=>this.triggerEvent(new yg(t))),this.routerState=dm(this.currentUrlTree,this.rootComponentType),this.transitions=new gf({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()}setupNavigations(t){const e=this.events;return t.pipe(Af(t=>0!==t.id),k(t=>Object.assign(Object.assign({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl)})),Vf(t=>{let n=!1,i=!1;return ff(t).pipe(ng(t=>{this.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Vf(t=>{const n=!this.navigated||t.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return ff(t).pipe(Vf(t=>{const n=this.transitions.getValue();return e.next(new lg(t.id,this.serializeUrl(t.extractedUrl),t.source,t.restoredState)),n!==this.transitions.getValue()?Cf:[t]}),Vf(t=>Promise.resolve(t)),(i=this.ngModule.injector,r=this.configLoader,s=this.urlSerializer,o=this.config,function(t){return t.pipe(Vf(t=>function(t,e,n,i,r){return new Zm(t,e,n,i,r).apply()}(i,r,s,t.extractedUrl,o).pipe(k(e=>Object.assign(Object.assign({},t),{urlAfterRedirects:e})))))}),ng(t=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:t.urlAfterRedirects})}),function(t,e,n,i,r){return function(s){return s.pipe(U(s=>function(t,e,n,i,r="emptyOnly",s="legacy"){return new fv(t,e,n,i,r,s).recognize()}(t,e,s.urlAfterRedirects,n(s.urlAfterRedirects),i,r).pipe(k(t=>Object.assign(Object.assign({},s),{targetSnapshot:t})))))}}(this.rootComponentType,this.config,t=>this.serializeUrl(t),this.paramsInheritanceStrategy,this.relativeLinkResolution),ng(t=>{"eager"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),ng(t=>{const n=new dg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.next(n)}));var i,r,s,o;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:i,source:r,restoredState:s,extras:o}=t,a=new lg(n,this.serializeUrl(i),r,s);e.next(a);const l=dm(i,this.rootComponentType).snapshot;return ff(Object.assign(Object.assign({},t),{targetSnapshot:l,urlAfterRedirects:i,extras:Object.assign(Object.assign({},o),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=t.rawUrl,this.browserUrlTree=t.urlAfterRedirects,t.resolve(null),Cf}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.beforePreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),ng(t=>{const e=new pg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),k(t=>Object.assign(Object.assign({},t),{guards:sv(t.targetSnapshot,t.currentSnapshot,this.rootContexts)})),function(t,e){return function(n){return n.pipe(U(n=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:o}}=n;return 0===o.length&&0===s.length?ff(Object.assign(Object.assign({},n),{guardsResult:!0})):function(t,e,n,i){return O(t).pipe(U(t=>function(t,e,n,i,r){const s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return s&&0!==s.length?ff(s.map(s=>{const o=ov(s,e,r);let a;if(function(t){return t&&Nm(t.canDeactivate)}(o))a=Ig(o.canDeactivate(t,e,n,i));else{if(!Nm(o))throw new Error("Invalid CanDeactivate guard");a=Ig(o(t,e,n,i))}return a.pipe(tg())})).pipe(Vm()):ff(!0)}(t.component,t.route,n,e,i)),tg(t=>!0!==t,!0))}(o,i,r,t).pipe(U(n=>n&&"boolean"==typeof n?function(t,e,n,i){return O(e).pipe(Zf(e=>O([hv(e.route.parent,i),cv(e.route,i),dv(t,e.path,n),uv(t,e.route,n)]).pipe(kf(),tg(t=>!0!==t,!0))),tg(t=>!0!==t,!0))}(i,s,t,e):ff(n)),k(t=>Object.assign(Object.assign({},n),{guardsResult:t})))}))}}(this.ngModule.injector,t=>this.triggerEvent(t)),ng(t=>{if(Bm(t.guardsResult)){const e=Ag(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);throw e.url=t.guardsResult,e}}),ng(t=>{const e=new fg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);this.triggerEvent(e)}),Af(t=>{if(!t.guardsResult){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"");return e.next(n),t.resolve(!1),!1}return!0}),xv(t=>{if(t.guards.canActivateChecks.length)return ff(t).pipe(ng(t=>{const e=new gg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),Vf(t=>{let n=!1;return ff(t).pipe((i=this.paramsInheritanceStrategy,r=this.ngModule.injector,function(t){return t.pipe(U(t=>{const{targetSnapshot:e,guards:{canActivateChecks:n}}=t;if(!n.length)return ff(t);let s=0;return O(n).pipe(Zf(t=>function(t,e,n,i){return function(t,e,n,i){const r=Object.keys(t);if(0===r.length)return ff({});const s={};return O(r).pipe(U(r=>function(t,e,n,i){const r=ov(t,e,i);return Ig(r.resolve?r.resolve(e,n):r(e,n))}(t[r],e,n,i).pipe(ng(t=>{s[r]=t}))),Ff(1),U(()=>Object.keys(s).length===r.length?ff(s):Cf))}(t._resolve,t,e,i).pipe(k(e=>(t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),fm(t,n).resolve),null)))}(t.route,e,i,r)),ng(()=>s++),Ff(1),U(e=>s===n.length?ff(t):Cf))}))}),ng({next:()=>n=!0,complete:()=>{if(!n){const n=new hg(t.id,this.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");e.next(n),t.resolve(!1)}}}));var i,r}),ng(t=>{const e=new mg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}))}),xv(t=>{const{targetSnapshot:e,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=t;return this.hooks.afterPreactivation(e,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),k(t=>{const e=function(t,e,n){const i=xm(t,e._root,n?n._root:void 0);return new um(i,e)}(this.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:e})}),ng(t=>{this.currentUrlTree=t.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl),this.routerState=t.targetRouterState,"deferred"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),(s=this.rootContexts,o=this.routeReuseStrategy,a=t=>this.triggerEvent(t),k(t=>(new $m(o,t.targetRouterState,t.currentRouterState,a).activate(s),t))),ng({next(){n=!0},complete(){n=!0}}),(r=()=>{if(!n&&!i){this.resetUrlToCurrentUrlTree();const n=new hg(t.id,this.serializeUrl(t.extractedUrl),`Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);e.next(n),t.resolve(!1)}this.currentNavigation=null},t=>t.lift(new sg(r))),Yf(n=>{if(i=!0,(r=n)&&r.ngNavigationCancelingError){const i=Bm(n.url);i||(this.navigated=!0,this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));const r=new hg(t.id,this.serializeUrl(t.extractedUrl),n.message);e.next(r),i?setTimeout(()=>{const e=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);return this.scheduleNavigation(e,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})},0):t.resolve(!1)}else{this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);const i=new ug(t.id,this.serializeUrl(t.extractedUrl),n);e.next(i);try{t.resolve(this.errorHandler(n))}catch(s){t.reject(s)}}var r;return Cf}));var r,s,o,a}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}getTransition(){const t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{const e=this.extractLocationChangeInfoFromEvent(t);this.shouldScheduleNavigation(this.lastLocationChangeInfo,e)&&setTimeout(()=>{const{source:t,state:n,urlTree:i}=e,r={replaceUrl:!0};if(n){const t=Object.assign({},n);delete t.navigationId,0!==Object.keys(t).length&&(r.state=t)}this.scheduleNavigation(i,t,n,r)},0),this.lastLocationChangeInfo=e}))}extractLocationChangeInfoFromEvent(t){var e;return{source:"popstate"===t.type?"popstate":"hashchange",urlTree:this.parseUrl(t.url),state:(null===(e=t.state)||void 0===e?void 0:e.navigationId)?t.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(t,e){if(!t)return!0;const n=e.urlTree.toString()===t.urlTree.toString();return!(e.transitionId===t.transitionId&&n&&("hashchange"===e.source&&"popstate"===t.source||"popstate"===e.source&&"hashchange"===t.source))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){jm(t),this.config=t.map(Gm),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)}createUrlTree(t,e={}){const{relativeTo:n,queryParams:i,fragment:r,queryParamsHandling:s,preserveFragment:o}=e,a=n||this.routerState.root,l=o?this.currentUrlTree.fragment:r;let c=null;switch(s){case"merge":c=Object.assign(Object.assign({},this.currentUrlTree.queryParams),i);break;case"preserve":c=this.currentUrlTree.queryParams;break;default:c=i||null}return null!==c&&(c=this.removeEmptyProps(c)),function(t,e,n,i,r){if(0===n.length)return Em(e.root,e.root,e,i,r);const s=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Am(!0,0,t);let e=0,n=!1;const i=t.reduce((t,i,r)=>{if("object"==typeof i&&null!=i){if(i.outlets){const e={};return Mg(i.outlets,(t,n)=>{e[n]="string"==typeof t?t.split("/"):t}),[...t,{outlets:e}]}if(i.segmentPath)return[...t,i.segmentPath]}return"string"!=typeof i?[...t,i]:0===r?(i.split("/").forEach((i,r)=>{0==r&&"."===i||(0==r&&""===i?n=!0:".."===i?e++:""!=i&&t.push(i))}),t):[...t,i]},[]);return new Am(n,e,i)}(n);if(s.toRoot())return Em(e.root,new Ug([],{}),e,i,r);const o=function(t,e,n){if(t.isAbsolute)return new Dm(e.root,!0,0);if(-1===n.snapshot._lastPathIndex){const t=n.snapshot._urlSegment;return new Dm(t,t===e.root,0)}const i=Cm(t.commands[0])?0:1;return function(t,e,n){let i=t,r=e,s=n;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new Dm(i,!1,r-s)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+i,t.numberOfDoubleDots)}(s,e,t),a=o.processChildren?Rm(o.segmentGroup,o.index,s.commands):Tm(o.segmentGroup,o.index,s.commands);return Em(o.segmentGroup,a,e,i,r)}(a,this.currentUrlTree,t,c,l)}navigateByUrl(t,e={skipLocationChange:!1}){const n=Bm(t)?t:this.parseUrl(t),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,e)}navigate(t,e={skipLocationChange:!1}){return function(t){for(let e=0;e{const i=t[n];return null!=i&&(e[n]=i),e},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.events.next(new cg(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,t.resolve(!0)},t=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(t,e,n,i,r){const s=this.getTransition(),o="imperative"!==e&&"imperative"===(null==s?void 0:s.source),a=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===t.toString();if(o&&a)return Promise.resolve(!0);let l,c,h;r?(l=r.resolve,c=r.reject,h=r.promise):h=new Promise((t,e)=>{l=t,c=e});const u=++this.navigationId;return this.setTransition({id:u,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:i,resolve:l,reject:c,promise:h,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),h.catch(t=>Promise.reject(t))}setBrowserUrl(t,e,n,i){const r=this.urlSerializer.serialize(t);i=i||{},this.location.isCurrentPathEqualTo(r)||e?this.location.replaceState(r,"",Object.assign(Object.assign({},i),{navigationId:n})):this.location.go(r,"",Object.assign(Object.assign({},i),{navigationId:n}))}resetStateAndUrl(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qn),bi(zg),bi(kv),bi(Dh),bi(ho),bi(ih),bi(Fc),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Lv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.route=e,this.commands=[],this.onChanges=new C,null==n&&i.setAttribute(r.nativeElement,"tabindex","0")}ngOnChanges(t){this.onChanges.next(this)}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}onClick(){const t={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,t),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),qn("tabindex"),Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})(),Mv=(()=>{class t{constructor(t,e,n){this.router=t,this.route=e,this.locationStrategy=n,this.commands=[],this.onChanges=new C,this.subscription=t.events.subscribe(t=>{t instanceof cg&&this.updateTargetUrlAndHref()})}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}ngOnChanges(t){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(t,e,n,i,r){if(0!==t||e||n||i||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const s={skipLocationChange:Iv(this.skipLocationChange),replaceUrl:Iv(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,s),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:Iv(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(pm),Ro(Ch))},t.\u0275dir=Wt({type:t,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.onClick(t.button,t.ctrlKey,t.shiftKey,t.altKey,t.metaKey)}),2&t&&(xa("href",e.href,nr),ko("target",e.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[le]}),t})();function Iv(t){return""===t||!!t}let $v=(()=>{class t{constructor(t,e,n,i,r,s){this.router=t,this.element=e,this.renderer=n,this.cdr=i,this.link=r,this.linkWithHref=s,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=t.events.subscribe(t=>{t instanceof cg&&this.update()})}ngAfterContentInit(){O([this.links.changes,this.linksWithHrefs.changes,ff(null)]).pipe(j()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var t;null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe();const e=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(t=>!!t).map(t=>t.onChanges);this.linkInputChangesSubscription=O(e).pipe(j()).subscribe(t=>{this.isActive!==this.isLinkActive(this.router)(t)&&this.update()})}set routerLinkActive(t){const e=Array.isArray(t)?t:t.split(" ");this.classes=e.filter(t=>!!t)}ngOnChanges(t){this.update()}ngOnDestroy(){var t;this.routerEventsSubscription.unsubscribe(),null===(t=this.linkInputChangesSubscription)||void 0===t||t.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const t=this.hasActiveLinks();this.isActive!==t&&(this.isActive=t,this.cdr.markForCheck(),this.classes.forEach(e=>{t?this.renderer.addClass(this.element.nativeElement,e):this.renderer.removeClass(this.element.nativeElement,e)}))})}isLinkActive(t){return e=>t.isActive(e.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.linkWithHref&&t(this.linkWithHref)||this.links.some(t)||this.linksWithHrefs.some(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Fv),Ro(za),Ro(Ga),Ro(pl),Ro(Lv,8),Ro(Mv,8))},t.\u0275dir=Wt({type:t,selectors:[["","routerLinkActive",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Lv,!0),ac(n,Mv,!0)),2&t){let t;ic(t=lc())&&(e.links=t),ic(t=lc())&&(e.linksWithHrefs=t)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[le]}),t})(),Ov=(()=>{class t{constructor(t,e,n,i,r){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=r,this.activated=null,this._activatedRoute=null,this.activateEvents=new Wl,this.deactivateEvents=new Wl,this.name=i||Sg,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),i=this.parentContexts.getOrCreateContext(this.name).children,r=new Pv(t,i,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return t.\u0275fac=function(e){return new(e||t)(Ro(kv),Ro(El),Ro(Ua),qn("name"),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class Pv{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===pm?this.route:t===kv?this.childContexts:this.parent.get(t,e)}}class Nv{}class Bv{preload(t,e){return ff(null)}}let Uv=(()=>{class t{constructor(t,e,n,i,r){this.router=t,this.injector=i,this.preloadingStrategy=r,this.loader=new Sv(e,n,e=>t.triggerEvent(new vg(e)),e=>t.triggerEvent(new yg(e)))}setUpPreloading(){this.subscription=this.router.events.pipe(Af(t=>t instanceof cg),Zf(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(_l);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,e){const n=[];for(const i of e)if(i.loadChildren&&!i.canLoad&&i._loadedConfig){const t=i._loadedConfig;n.push(this.processRoutes(t.module,t.routes))}else i.loadChildren&&!i.canLoad?n.push(this.preloadConfig(t,i)):i.children&&n.push(this.processRoutes(t,i.children));return O(n).pipe(j(),k(t=>{}))}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>this.loader.load(t.injector,e).pipe(U(t=>(e._loadedConfig=t,this.processRoutes(t.module,t.routes)))))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(ih),bi(Fc),bi(ho),bi(Nv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Vv=(()=>{class t{constructor(t,e,n={}){this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof lg?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof cg&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Cg&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.router.triggerEvent(new Cg(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(Kh),bi(void 0))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Hv=new Yn("ROUTER_CONFIGURATION"),jv=new Yn("ROUTER_FORROOT_GUARD"),zv=[Dh,{provide:zg,useClass:Wg},{provide:Fv,useFactory:function(t,e,n,i,r,s,o,a={},l,c){const h=new Fv(null,t,e,n,i,r,s,Fg(o));if(l&&(h.urlHandlingStrategy=l),c&&(h.routeReuseStrategy=c),function(t,e){t.errorHandler&&(e.errorHandler=t.errorHandler),t.malformedUriErrorHandler&&(e.malformedUriErrorHandler=t.malformedUriErrorHandler),t.onSameUrlNavigation&&(e.onSameUrlNavigation=t.onSameUrlNavigation),t.paramsInheritanceStrategy&&(e.paramsInheritanceStrategy=t.paramsInheritanceStrategy),t.relativeLinkResolution&&(e.relativeLinkResolution=t.relativeLinkResolution),t.urlUpdateStrategy&&(e.urlUpdateStrategy=t.urlUpdateStrategy)}(a,h),a.enableTracing){const t=dh();h.events.subscribe(e=>{t.logGroup("Router Event: "+e.constructor.name),t.log(e.toString()),t.log(e),t.logGroupEnd()})}return h},deps:[zg,kv,Dh,ho,ih,Fc,Cv,Hv,[class{},new li],[class{},new li]]},kv,{provide:pm,useFactory:function(t){return t.routerState.root},deps:[Fv]},{provide:ih,useClass:oh},Uv,Bv,class{preload(t,e){return e().pipe(Yf(()=>ff(null)))}},{provide:Hv,useValue:{enableTracing:!1}}];function Wv(){return new Yc("Router",Fv)}let Gv=(()=>{class t{constructor(t,e){}static forRoot(e,n){return{ngModule:t,providers:[zv,Yv(e),{provide:jv,useFactory:Xv,deps:[[Fv,new li,new hi]]},{provide:Hv,useValue:n||{}},{provide:Ch,useFactory:Kv,deps:[fh,[new ai(Eh),new li],Hv]},{provide:Vv,useFactory:qv,deps:[Fv,Kh,Hv]},{provide:Nv,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Bv},{provide:Yc,multi:!0,useFactory:Wv},[Jv,{provide:pc,multi:!0,useFactory:Qv,deps:[Jv]},{provide:ty,useFactory:Zv,deps:[Jv]},{provide:wc,multi:!0,useExisting:ty}]]}}static forChild(e){return{ngModule:t,providers:[Yv(e)]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(jv,8),bi(Fv,8))}}),t})();function qv(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Vv(t,e,n)}function Kv(t,e,n={}){return n.useHash?new Ah(t,e):new kh(t,e)}function Xv(t){return"guarded"}function Yv(t){return[{provide:Jn,multi:!0,useValue:t},{provide:Cv,multi:!0,useValue:t}]}let Jv=(()=>{class t{constructor(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new C}appInitializer(){return this.injector.get(mh,Promise.resolve(null)).then(()=>{let t=null;const e=new Promise(e=>t=e),n=this.injector.get(Fv),i=this.injector.get(Hv);return"disabled"===i.initialNavigation?(n.setUpLocationChangeListener(),t(!0)):"enabled"===i.initialNavigation||"enabledBlocking"===i.initialNavigation?(n.hooks.afterPreactivation=()=>this.initNavigation?ff(null):(this.initNavigation=!0,t(!0),this.resultOfPreactivationDone),n.initialNavigation()):t(!0),e})}bootstrapListener(t){const e=this.injector.get(Hv),n=this.injector.get(Uv),i=this.injector.get(Vv),r=this.injector.get(Fv),s=this.injector.get(eh);t===s.components[0]&&("enabledNonBlocking"!==e.initialNavigation&&void 0!==e.initialNavigation||r.initialNavigation(),n.setUpPreloading(),i.init(),r.resetRootComponentType(s.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}}return t.\u0275fac=function(e){return new(e||t)(bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Qv(t){return t.appInitializer.bind(t)}function Zv(t){return t.bootstrapListener.bind(t)}const ty=new Yn("Router Initializer");function ey(t,e){return new y(n=>{const i=t.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=t},error:t=>n.error(t),complete:()=>{s++,s!==i&&c||(o===i&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}const ny=new Yn("NgValueAccessor"),iy={provide:ny,useExisting:st(()=>ry),multi:!0};let ry=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"checked",t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.checked)})("blur",function(){return e.onTouched()})},features:[Pa([iy])]}),t})();const sy={provide:ny,useExisting:st(()=>ay),multi:!0},oy=new Yn("CompositionEventMode");let ay=(()=>{class t{constructor(t,e,n){this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=t=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=dh()?dh().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(oy,8))},t.\u0275dir=Wt({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[Pa([sy])]}),t})();function ly(t){return null==t||0===t.length}function cy(t){return null!=t&&"number"==typeof t.length}const hy=new Yn("NgValidators"),uy=new Yn("NgAsyncValidators"),dy=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class py{static min(t){return e=>{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n{if(ly(e.value)||ly(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}}static required(t){return ly(t.value)?{required:!0}:null}static requiredTrue(t){return!0===t.value?null:{required:!0}}static email(t){return ly(t.value)||dy.test(t.value)?null:{email:!0}}static minLength(t){return e=>ly(e.value)||!cy(e.value)?null:e.value.lengthcy(e.value)&&e.value.length>t?{maxlength:{requiredLength:t,actualLength:e.value.length}}:null}static pattern(t){if(!t)return py.nullValidator;let e,n;return"string"==typeof t?(n="","^"!==t.charAt(0)&&(n+="^"),n+=t,"$"!==t.charAt(t.length-1)&&(n+="$"),e=new RegExp(n)):(n=t.toString(),e=t),t=>{if(ly(t.value))return null;const i=t.value;return e.test(i)?null:{pattern:{requiredPattern:n,actualValue:i}}}}static nullValidator(t){return null}static compose(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return my(vy(t,e))}}static composeAsync(t){if(!t)return null;const e=t.filter(fy);return 0==e.length?null:function(t){return function(...t){if(1===t.length){const e=t[0];if(l(e))return ey(e,null);if(c(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return ey(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return ey(t=1===t.length&&l(t[0])?t[0]:t,null).pipe(k(t=>e(...t)))}return ey(t,null)}(vy(t,e).map(gy)).pipe(k(my))}}}function fy(t){return null!=t}function gy(t){const e=Bo(t)?O(t):t;return Uo(e),e}function my(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function vy(t,e){return e.map(e=>e(t))}function yy(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function by(t){return null!=t?py.compose(yy(t)):null}function wy(t){return null!=t?py.composeAsync(yy(t)):null}function xy(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}function _y(t){return t._rawValidators}function Cy(t){return t._rawAsyncValidators}let Sy=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=by(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=wy(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t}),t})(),Ey=(()=>{class t extends Sy{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(e){return ky(e||t)},t.\u0275dir=Wt({type:t,features:[po]}),t})();const ky=Gn(Ey);class Ay extends Sy{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class Dy{constructor(t){this._cd=t}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}let Ty=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ay,2))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})(),Ry=(()=>{class t extends Dy{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,2))},t.\u0275dir=Wt({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(t,e){2&t&&ra("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[po]}),t})();const Fy={provide:ny,useExisting:st(()=>Ly),multi:!0};let Ly=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==t?"":t)}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Fy])]}),t})();const My={provide:ny,useExisting:st(()=>$y),multi:!0};let Iy=(()=>{class t{constructor(){this._accessors=[]}add(t,e){this._accessors.push([t,e])}remove(t){for(let e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)}select(t){this._accessors.forEach(e=>{this._isSameGroup(e,t)&&e[1]!==t&&e[1].fireUncheck(t.value)})}_isSameGroup(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),$y=(()=>{class t{constructor(t,e,n,i){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=i,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(Ay),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(t){this._state=t===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(t){this._fn=t,this.onChange=()=>{t(this.value),this._registry.select(this)}}fireUncheck(t){this.writeValue(t)}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za),Ro(Iy),Ro(ho))},t.\u0275dir=Wt({type:t,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("blur",function(){return e.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[Pa([My])]}),t})();const Oy={provide:ny,useExisting:st(()=>Py),multi:!0};let Py=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}writeValue(t){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(t))}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[Pa([Oy])]}),t})();const Ny={provide:ny,useExisting:st(()=>Uy),multi:!0};function By(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let Uy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const e=this._getOptionId(t);null==e&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=By(e,t);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(t){this.onChange=e=>{this.value=this._getOptionValue(e),t(this.value)}}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const e of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(e),t))return e;return null}_getOptionValue(t){const e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ga),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,e){1&t&&Vo("change",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},inputs:{compareWith:"compareWith"},features:[Pa([Ny])]}),t})(),Vy=(()=>{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(By(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(Uy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();const Hy={provide:ny,useExisting:st(()=>zy),multi:!0};function jy(t,e){return null==t?""+e:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let zy=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=t=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let e;if(this.value=t,Array.isArray(t)){const n=t.map(t=>this._getOptionId(t));e=(t,e)=>{t._setSelected(n.indexOf(e.toString())>-1)}}else e=(t,e)=>{t._setSelected(!1)};this._optionMap.forEach(e)}registerOnChange(t){this.onChange=e=>{const n=[];if(void 0!==e.selectedOptions){const t=e.selectedOptions;for(let e=0;e{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(jy(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(zy,9))},t.\u0275dir=Wt({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();function Gy(t,e){Ky(t,e,!0),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&Yy(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&Yy(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e)}function qy(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function Ky(t,e,n){const i=_y(t);null!==e.validator?t.setValidators(xy(i,e.validator)):"function"==typeof i&&t.setValidators([i]);const r=Cy(t);if(null!==e.asyncValidator?t.setAsyncValidators(xy(r,e.asyncValidator)):"function"==typeof r&&t.setAsyncValidators([r]),n){const n=()=>t.updateValueAndValidity();qy(e._rawValidators,n),qy(e._rawAsyncValidators,n)}}function Xy(t,e,n){if(null!==t){if(null!==e.validator){const n=_y(t);Array.isArray(n)&&n.length>0&&t.setValidators(n.filter(t=>t!==e.validator))}if(null!==e.asyncValidator){const n=Cy(t);Array.isArray(n)&&n.length>0&&t.setAsyncValidators(n.filter(t=>t!==e.asyncValidator))}}if(n){const t=()=>{};qy(e._rawValidators,t),qy(e._rawAsyncValidators,t)}}function Yy(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Jy(t,e){Ky(t,e,!1)}const Qy=[ry,Py,Ly,Uy,zy,$y];function Zy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const tb="VALID",eb="INVALID",nb="PENDING",ib="DISABLED";function rb(t){return(lb(t)?t.validators:t)||null}function sb(t){return Array.isArray(t)?by(t):t||null}function ob(t,e){return(lb(e)?e.asyncValidators:t)||null}function ab(t){return Array.isArray(t)?wy(t):t||null}function lb(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class cb{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=sb(this._rawValidators),this._composedAsyncValidatorFn=ab(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===tb}get invalid(){return this.status===eb}get pending(){return this.status==nb}get disabled(){return this.status===ib}get enabled(){return this.status!==ib}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=sb(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=ab(t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=nb,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=ib,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=tb,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==tb&&this.status!==nb||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ib:tb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=nb,this._hasOwnPendingAsyncValidator=!0;const e=gy(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e)return null;if(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length)return null;let i=t;return e.forEach(t=>{i=i instanceof ub?i.controls.hasOwnProperty(t)?i.controls[t]:null:i instanceof db&&i.at(t)||null}),i}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Wl,this.statusChanges=new Wl}_calculateStatus(){return this._allControlsDisabled()?ib:this.errors?eb:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(nb)?nb:this._anyControlsHaveStatus(eb)?eb:tb}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){lb(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class hb extends cb{constructor(t=null,e,n){super(rb(e),ob(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Zy(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Zy(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class ub extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t={},e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof hb?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>t(this.controls[e],e))}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,i)=>{n=e(n,t,i)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class db extends cb{constructor(t,e,n){super(rb(e),ob(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}at(t){return this.controls[t]}push(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()}insert(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()}removeAt(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t=[],e={}){this._forEachChild((n,i)=>{n.reset(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof hb?t.value:t.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}let pb=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})();const fb=new Yn("NgModelWithFormControlWarning"),gb={provide:Ey,useExisting:st(()=>mb)};let mb=(()=>{class t extends Ey{constructor(t,e){super(),this.validators=t,this.asyncValidators=e,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new Wl,this._setValidators(t),this._setAsyncValidators(e)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const e=this.form.get(t.path);return Gy(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e}getControl(t){return this.form.get(t.path)}removeControl(t){Zy(this.directives,t)}addFormGroup(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormGroup(t){}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){const e=this.form.get(t.path);Jy(e,t),e.updateValueAndValidity({emitEvent:!1})}removeFormArray(t){}getFormArray(t){return this.form.get(t.path)}updateModel(t,e){this.form.get(t.path).setValue(e)}onSubmit(t){return this.submitted=!0,e=this.directives,this.form._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const e=this.form.get(t.path);t.control!==e&&(function(t,e){const n=()=>{};e.valueAccessor.registerOnChange(n),e.valueAccessor.registerOnTouched(n),Xy(t,e,!0),t&&(e._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}(t.control||null,t),e&&Gy(e,t),t.control=e)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Ky(this.form,this,!1),this._oldForm&&Xy(this._oldForm,this,!1)}_checkFormPresent(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(hy,10),Ro(uy,10))},t.\u0275dir=Wt({type:t,selectors:[["","formGroup",""]],hostBindings:function(t,e){1&t&&Vo("submit",function(t){return e.onSubmit(t)})("reset",function(){return e.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[Pa([gb]),po,le]}),t})();const vb={provide:Ay,useExisting:st(()=>yb)};let yb=(()=>{class t extends Ay{constructor(t,e,n,i,r){super(),this._ngModelWarningConfig=r,this._added=!1,this.update=new Wl,this._ngModelWarningSent=!1,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=function(t,e){if(!e)return null;Array.isArray(e);let n=void 0,i=void 0,r=void 0;return e.forEach(t=>{var e;t.constructor===ay?n=t:(e=t,Qy.some(t=>e.constructor===t)?i=t:r=t)}),r||i||n||null}(0,i)}set isDisabled(t){}ngOnChanges(t){this._added||this._setUpControl(),function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return t=null==this.name?this.name:this.name.toString(),[...this._parent.path,t];var t}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ey,13),Ro(hy,10),Ro(uy,10),Ro(ny,10),Ro(fb,8))},t.\u0275dir=Wt({type:t,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[Pa([vb]),po,le]}),t._ngModelWarningSentOnce=!1,t})();const bb={provide:hy,useExisting:st(()=>wb),multi:!0};let wb=(()=>{class t{constructor(){this._required=!1}get required(){return this._required}set required(t){this._required=null!=t&&!1!==t&&""+t!="false",this._onChange&&this._onChange()}validate(t){return this.required?py.required(t):null}registerOnValidatorChange(t){this._onChange=t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(t,e){2&t&&ko("required",e.required?"":null)},inputs:{required:"required"},features:[Pa([bb])]}),t})(),xb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),_b=(()=>{class t{group(t,e=null){const n=this._reduceControls(t);let i=null,r=null,s=void 0;return null!=e&&(function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(e)?(i=null!=e.validators?e.validators:null,r=null!=e.asyncValidators?e.asyncValidators:null,s=null!=e.updateOn?e.updateOn:void 0):(i=null!=e.validator?e.validator:null,r=null!=e.asyncValidator?e.asyncValidator:null)),new ub(n,{asyncValidators:r,updateOn:s,validators:i})}control(t,e,n){return new hb(t,e,n)}array(t,e,n){const i=t.map(t=>this._createControl(t));return new db(i,e,n)}_reduceControls(t){const e={};return Object.keys(t).forEach(n=>{e[n]=this._createControl(t[n])}),e}_createControl(t){return t instanceof hb||t instanceof ub||t instanceof db?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Cb=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[Iy],imports:[xb]}),t})(),Sb=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:fb,useValue:e.warnOnNgModelWithFormControl}]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[_b,Iy],imports:[xb]}),t})();const Eb=new Yn("ngx-segment-analytics.config"),kb={debug:!1,loadOnInitialization:!0,segmentHost:"cdn.segment.com",segmentUri:"/analytics.js/v1/$API_KEY$/analytics.min.js"};let Ab=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Db=(()=>{class t{constructor(t,e,n){if(this._w=t,this._doc=e,this._config=Object.assign(Object.assign({},kb),n),!this._config.loadOnInitialization||void 0!==this._config.apiKey&&""!==this._config.apiKey){if(void 0===this._w.analytics||void 0===this._w.analytics.initialize||!1===this._w.analytics.initialize){if(void 0!==this._w.analytics&&!0===this._w.analytics.invoked)return void console.error("Segment snippet included twice.");this._config.debug&&console.log("Segment initialization..."),this._w.analytics=[],this._w.analytics.invoked=!0,this._w.analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware"],this._w.analytics.factory=t=>(...e)=>(e.unshift(t),this._w.analytics.push(e),this._w.analytics),this._w.analytics.methods.forEach(t=>{this._w.analytics[t]=this._w.analytics.factory(t)}),this._w.analytics.load=(t,e)=>{const n=this._doc.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://"+this._config.segmentHost+this._config.segmentUri.replace("$API_KEY$",t);const i=this._doc.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),this._w.analytics._loadOptions=e},this._w.analytics.SNIPPET_VERSION="4.1.0",this._config.loadOnInitialization&&this.load(this._config.apiKey)}}else console.error("The API Key cannot be an empty string if Segment must be loaded on initialization.")}load(t,e){this._w.analytics.load(t,e),this._config.debug&&console.log("Segment initialized"),this.debug(this._config.debug)}identify(t,e,n){return new Promise(i=>{this._w.analytics.identify(t,e,n,t=>i(this))})}track(t,e,n){return new Promise(i=>{this._w.analytics.track(t,e,n,t=>i(this))})}page(t,e,n,i){return new Promise(r=>{this._w.analytics.page(t,e,n,i,t=>r(this))})}group(t,e){return new Promise(n=>{this._w.analytics.group(t,e,t=>n(this))})}alias(t,e,n){return new Promise(i=>{this._w.analytics.alias(t,e,n,t=>i(this))})}ready(){return new Promise(t=>{this._w.analytics.ready(e=>t(this))})}user(){return this._w.analytics.user()}id(){return this._w.analytics.id()}traits(){return this._w.analytics.traits()}reset(){this._w.analytics.reset()}debug(t){this._w.analytics.debug(t)}on(t,e){this._w.analytics.on(t,e)}trackLink(t,e,n){this._w.analytics.trackLink(t,e,n)}trackForm(t,e,n){this._w.analytics.trackForm(t,e,n)}timeout(t){this._w.analytics.timeout(t)}addSourceMiddleware(t){this._w.analytics.addSourceMiddleware(t)}get plugins(){return this._w.analytics.plugins}}return t.\u0275fac=function(e){return new(e||t)(bi(Ab),bi(ph),bi(Eb))},t.\u0275prov=lt({factory:function(){return new t(bi(Ab),bi(ph),bi(Eb))},token:t,providedIn:"root"}),t})();function Tb(t){return function(t){return"browser"===t}(t)?window:{}}let Rb=(()=>{class t{constructor(t){if(t)throw new Error("SegmentModule is already loaded. Import it in the AppModule only")}static forRoot(e){return{ngModule:t,providers:[{provide:Eb,useValue:e},Db]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)(bi(t,12))},providers:[{provide:Ab,useFactory:Tb,deps:[bc]}],imports:[[qh]]}),t})();class Fb{}class Lb{}class Mb{constructor(t){this.normalizedNames=new Map,this.lazyUpdate=null,t?this.lazyInit="string"==typeof t?()=>{this.headers=new Map,t.split("\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const n=t.slice(0,e),i=n.toLowerCase(),r=t.slice(e+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(t).forEach(e=>{let n=t[e];const i=e.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(e,i))})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();const e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof Mb?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){const e=new Mb;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Mb?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){const e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(t.name,e);const i=("a"===t.op?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":const r=t.value;if(r){let t=this.headers.get(e);if(!t)return;t=t.filter(t=>-1===r.indexOf(t)),0===t.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,t)}else this.headers.delete(e),this.normalizedNames.delete(e)}}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}}class Ib{encodeKey(t){return $b(t)}encodeValue(t){return $b(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}}function $b(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class Ob{constructor(t={}){if(this.updates=null,this.cloneFrom=null,this.encoder=t.encoder||new Ib,t.fromString){if(t.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(t,e){const n=new Map;return t.length>0&&t.split("&").forEach(t=>{const i=t.indexOf("="),[r,s]=-1==i?[e.decodeKey(t),""]:[e.decodeKey(t.slice(0,i)),e.decodeValue(t.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{const n=t.fromObject[e];this.map.set(e,Array.isArray(n)?n:[n])})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();const e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{const e=this.encoder.encodeKey(t);return this.map.get(t).map(t=>e+"="+this.encoder.encodeValue(t)).join("&")}).filter(t=>""!==t).join("&")}clone(t){const e=new Ob({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat([t]),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":const e=("a"===t.op?this.map.get(t.param):void 0)||[];e.push(t.value),this.map.set(t.param,e);break;case"d":if(void 0===t.value){this.map.delete(t.param);break}{let e=this.map.get(t.param)||[];const n=e.indexOf(t.value);-1!==n&&e.splice(n,1),e.length>0?this.map.set(t.param,e):this.map.delete(t.param)}}}),this.cloneFrom=this.updates=null)}}function Pb(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer}function Nb(t){return"undefined"!=typeof Blob&&t instanceof Blob}function Bb(t){return"undefined"!=typeof FormData&&t instanceof FormData}class Ub{constructor(t,e,n,i){let r;if(this.url=e,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=t.toUpperCase(),function(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new Mb),this.params){const t=this.params.toString();if(0===t.length)this.urlWithParams=e;else{const n=e.indexOf("?");this.urlWithParams=e+(-1===n?"?":ne.set(n,t.setHeaders[n]),a)),t.setParams&&(l=Object.keys(t.setParams).reduce((e,n)=>e.set(n,t.setParams[n]),l)),new Ub(e,n,r,{params:l,headers:a,reportProgress:o,responseType:i,withCredentials:s})}}var Vb=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}({});class Hb{constructor(t,e=200,n="OK"){this.headers=t.headers||new Mb,this.status=void 0!==t.status?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}}class jb extends Hb{constructor(t={}){super(t),this.type=Vb.ResponseHeader}clone(t={}){return new jb({headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class zb extends Hb{constructor(t={}){super(t),this.type=Vb.Response,this.body=void 0!==t.body?t.body:null}clone(t={}){return new zb({body:void 0!==t.body?t.body:this.body,headers:t.headers||this.headers,status:void 0!==t.status?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}}class Wb extends Hb{constructor(t){super(t,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(t.url||"(unknown url)"):`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}}function Gb(t,e){return{body:e,headers:t.headers,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials}}let qb=(()=>{class t{constructor(t){this.handler=t}request(t,e,n={}){let i;if(t instanceof Ub)i=t;else{let r=void 0;r=n.headers instanceof Mb?n.headers:new Mb(n.headers);let s=void 0;n.params&&(s=n.params instanceof Ob?n.params:new Ob({fromObject:n.params})),i=new Ub(t,e,void 0!==n.body?n.body:null,{headers:r,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=ff(i).pipe(Zf(t=>this.handler.handle(t)));if(t instanceof Ub||"events"===n.observe)return r;const s=r.pipe(Af(t=>t instanceof zb));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return t.body}));case"blob":return s.pipe(k(t=>{if(null!==t.body&&!(t.body instanceof Blob))throw new Error("Response is not a Blob.");return t.body}));case"text":return s.pipe(k(t=>{if(null!==t.body&&"string"!=typeof t.body)throw new Error("Response is not a string.");return t.body}));case"json":default:return s.pipe(k(t=>t.body))}case"response":return s;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(t,e={}){return this.request("DELETE",t,e)}get(t,e={}){return this.request("GET",t,e)}head(t,e={}){return this.request("HEAD",t,e)}jsonp(t,e){return this.request("JSONP",t,{params:(new Ob).append(e,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,e={}){return this.request("OPTIONS",t,e)}patch(t,e,n={}){return this.request("PATCH",t,Gb(n,e))}post(t,e,n={}){return this.request("POST",t,Gb(n,e))}put(t,e,n={}){return this.request("PUT",t,Gb(n,e))}}return t.\u0275fac=function(e){return new(e||t)(bi(Fb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class Kb{constructor(t,e){this.next=t,this.interceptor=e}handle(t){return this.interceptor.intercept(t,this.next)}}const Xb=new Yn("HTTP_INTERCEPTORS");let Yb=(()=>{class t{intercept(t,e){return e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Jb=/^\)\]\}',?\n/;class Qb{}let Zb=(()=>{class t{constructor(){}build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),tw=(()=>{class t{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new y(e=>{const n=this.xhrFactory.build();if(n.open(t.method,t.urlWithParams),t.withCredentials&&(n.withCredentials=!0),t.headers.forEach((t,e)=>n.setRequestHeader(t,e.join(","))),t.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&n.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();n.responseType="json"!==e?e:"text"}const i=t.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const e=1223===n.status?204:n.status,i=n.statusText||"OK",s=new Mb(n.getAllResponseHeaders()),o=function(t){return"responseURL"in t&&t.responseURL?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}(n)||t.url;return r=new jb({headers:s,status:e,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),l=null;204!==r&&(l=void 0===n.response?n.responseText:n.response),0===r&&(r=l?200:0);let c=r>=200&&r<300;if("json"===t.responseType&&"string"==typeof l){const t=l;l=l.replace(Jb,"");try{l=""!==l?JSON.parse(l):null}catch(h){l=t,c&&(c=!1,l={error:h,text:l})}}c?(e.next(new zb({body:l,headers:i,status:r,statusText:o,url:a||void 0})),e.complete()):e.error(new Wb({error:l,headers:i,status:r,statusText:o,url:a||void 0}))},a=t=>{const{url:i}=s(),r=new Wb({error:t,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});e.error(r)};let l=!1;const c=i=>{l||(e.next(s()),l=!0);let r={type:Vb.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===t.responseType&&n.responseText&&(r.partialText=n.responseText),e.next(r)},h=t=>{let n={type:Vb.UploadProgress,loaded:t.loaded};t.lengthComputable&&(n.total=t.total),e.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),t.reportProgress&&(n.addEventListener("progress",c),null!==i&&n.upload&&n.upload.addEventListener("progress",h)),n.send(i),e.next({type:Vb.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("load",o),t.reportProgress&&(n.removeEventListener("progress",c),null!==i&&n.upload&&n.upload.removeEventListener("progress",h)),n.readyState!==n.DONE&&n.abort()}})}}return t.\u0275fac=function(e){return new(e||t)(bi(Qb))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const ew=new Yn("XSRF_COOKIE_NAME"),nw=new Yn("XSRF_HEADER_NAME");class iw{}let rw=(()=>{class t{constructor(t,e,n){this.doc=t,this.platform=e,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Ih(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return t.\u0275fac=function(e){return new(e||t)(bi(ph),bi(bc),bi(ew))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),sw=(()=>{class t{constructor(t,e){this.tokenService=t,this.headerName=e}intercept(t,e){const n=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||n.startsWith("http://")||n.startsWith("https://"))return e.handle(t);const i=this.tokenService.getToken();return null===i||t.headers.has(this.headerName)||(t=t.clone({headers:t.headers.set(this.headerName,i)})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(iw),bi(nw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),ow=(()=>{class t{constructor(t,e){this.backend=t,this.injector=e,this.chain=null}handle(t){if(null===this.chain){const t=this.injector.get(Xb,[]);this.chain=t.reduceRight((t,e)=>new Kb(t,e),this.backend)}return this.chain.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(Lb),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),aw=(()=>{class t{static disable(){return{ngModule:t,providers:[{provide:sw,useClass:Yb}]}}static withOptions(e={}){return{ngModule:t,providers:[e.cookieName?{provide:ew,useValue:e.cookieName}:[],e.headerName?{provide:nw,useValue:e.headerName}:[]]}}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[sw,{provide:Xb,useExisting:sw,multi:!0},{provide:iw,useClass:rw},{provide:ew,useValue:"XSRF-TOKEN"},{provide:nw,useValue:"X-XSRF-TOKEN"}]}),t})(),lw=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[qb,{provide:Fb,useClass:ow},tw,{provide:Lb,useExisting:tw},Zb,{provide:Qb,useExisting:Zb}],imports:[[aw.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),t})();var cw=function(t){return t[t.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",t[t.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",t[t.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",t[t.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",t[t.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",t}({}),hw=function(t){return t[t.APPLE_APP_STORE=0]="APPLE_APP_STORE",t[t.GOOGLE_PLAY_STORE=1]="GOOGLE_PLAY_STORE",t[t.HUAWEI_APP_GALLERY=2]="HUAWEI_APP_GALLERY",t}({});class uw{}let dw=(()=>{class t{constructor(t,e){this.httpClient=t,this.config=e||{host:"http://127.0.0.1:7120",timeoutMs:5e3}}deleteAccounts(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/account",{params:e,headers:this.getTokenAuthHeaders(t)})}listAccounts(t,e,n,i){let r=new Ob;return e&&(r=r.set("filter",e)),(n||!1===n)&&(r=r.set("tombstones",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/account",{params:r,headers:this.getTokenAuthHeaders(t)})}getWalletLedger(t,e,n,i){const r=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet`;let s=new Ob;return n&&(s=s.set("limit",String(n))),i&&(s=s.set("cursor",i)),this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}deleteAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return(n||!1===n)&&(r=r.set("record_deletion",String(n))),this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getAccount(t,e){const n="/v2/console/account/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateAccount(t,e,n){const i="/v2/console/account/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}banAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/ban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}exportAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getFriends(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteFriend(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/friend/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}getGroups(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/group`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteGroupUser(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/group/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}unbanAccount(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unban`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkApple(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/apple`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkCustom(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/custom`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkDevice(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/device`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}unlinkEmail(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/email`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebook(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebook`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkFacebookInstantGame(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/facebookinstantgame`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGameCenter(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/gamecenter`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkGoogle(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/google`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}unlinkSteam(t,e){const n=`/v2/console/account/${e=encodeURIComponent(String(e))}/unlink/steam`;let i=new Ob;return this.httpClient.post(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteWalletLedger(t,e,n){const i=`/v2/console/account/${e=encodeURIComponent(String(e))}/wallet/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteAllData(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/all",{params:e,headers:this.getTokenAuthHeaders(t)})}listApiEndpoints(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/api/endpoints",{params:e,headers:this.getTokenAuthHeaders(t)})}callRpcEndpoint(t,e,n){const i="/v2/console/api/endpoints/rpc/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}callApiEndpoint(t,e,n){const i="/v2/console/api/endpoints/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}authenticate(t){let e=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate",t,{params:e})}authenticateLogout(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/authenticate/logout",e,{params:n,headers:this.getTokenAuthHeaders(t)})}listChannelMessages(t,e,n,i,r,s,o){let a=new Ob;return e&&(a=a.set("type",e)),n&&(a=a.set("label",n)),i&&(a=a.set("group_id",i)),r&&(a=a.set("user_id_one",r)),s&&(a=a.set("user_id_two",s)),o&&(a=a.set("cursor",o)),this.httpClient.get(this.config.host+"/v2/console/channel",{params:a,headers:this.getTokenAuthHeaders(t)})}getConfig(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/config",{params:e,headers:this.getTokenAuthHeaders(t)})}listGroups(t,e,n){let i=new Ob;return e&&(i=i.set("filter",e)),n&&(i=i.set("cursor",n)),this.httpClient.get(this.config.host+"/v2/console/group",{params:i,headers:this.getTokenAuthHeaders(t)})}demoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/demote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}promoteGroupMember(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/account/${n=encodeURIComponent(String(n))}/promote`;let r=new Ob;return this.httpClient.post(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}addGroupUsers(t,e,n){const i=`/v2/console/group/${e=encodeURIComponent(String(e))}/add`;let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}deleteGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getGroup(t,e){const n="/v2/console/group/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}updateGroup(t,e,n){const i="/v2/console/group/"+(e=encodeURIComponent(String(e)));let r=new Ob;return this.httpClient.post(this.config.host+i,n,{params:r,headers:this.getTokenAuthHeaders(t)})}exportGroup(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/export`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getMembers(t,e){const n=`/v2/console/group/${e=encodeURIComponent(String(e))}/member`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}listLeaderboards(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/leaderboard",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.delete(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}getLeaderboard(t,e){const n="/v2/console/leaderboard/"+(e=encodeURIComponent(String(e)));let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteLeaderboardRecord(t,e,n){const i=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/owner/${n=encodeURIComponent(String(n))}`;let r=new Ob;return this.httpClient.delete(this.config.host+i,{params:r,headers:this.getTokenAuthHeaders(t)})}listLeaderboardRecords(t,e,n,i,r,s){const o=`/v2/console/leaderboard/${e=encodeURIComponent(String(e))}/records`;let a=new Ob;return n&&n.forEach(t=>a=a.append("owner_ids",String(t))),i&&(a=a.set("limit",String(i))),r&&(a=a.set("cursor",r)),s&&(a=a.set("expiry",s)),this.httpClient.get(this.config.host+o,{params:a,headers:this.getTokenAuthHeaders(t)})}listMatches(t,e,n,i,r,s,o,a,l){let c=new Ob;return e&&(c=c.set("limit",String(e))),(n||!1===n)&&(c=c.set("authoritative",String(n))),i&&(c=c.set("label",i)),r&&(c=c.set("min_size",String(r))),s&&(c=c.set("max_size",String(s))),o&&(c=c.set("match_id",o)),a&&(c=c.set("query",a)),l&&(c=c.set("node",l)),this.httpClient.get(this.config.host+"/v2/console/match",{params:c,headers:this.getTokenAuthHeaders(t)})}getMatchState(t,e){const n=`/v2/console/match/${e=encodeURIComponent(String(e))}/state`;let i=new Ob;return this.httpClient.get(this.config.host+n,{params:i,headers:this.getTokenAuthHeaders(t)})}deleteChannelMessages(t,e,n){let i=new Ob;return e&&(i=i.set("before",e)),n&&n.forEach(t=>i=i.append("ids",String(t))),this.httpClient.delete(this.config.host+"/v2/console/message",{params:i,headers:this.getTokenAuthHeaders(t)})}listPurchases(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/purchase",{params:r,headers:this.getTokenAuthHeaders(t)})}getRuntime(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/runtime",{params:e,headers:this.getTokenAuthHeaders(t)})}getStatus(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/status",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorage(t){let e=new Ob;return this.httpClient.delete(this.config.host+"/v2/console/storage",{params:e,headers:this.getTokenAuthHeaders(t)})}listStorage(t,e,n,i,r){let s=new Ob;return e&&(s=s.set("user_id",e)),n&&(s=s.set("key",n)),i&&(s=s.set("collection",i)),r&&(s=s.set("cursor",r)),this.httpClient.get(this.config.host+"/v2/console/storage",{params:s,headers:this.getTokenAuthHeaders(t)})}listStorageCollections(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/storage/collections",{params:e,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return r&&(o=o.set("version",r)),this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}getStorage(t,e,n,i){const r=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let s=new Ob;return this.httpClient.get(this.config.host+r,{params:s,headers:this.getTokenAuthHeaders(t)})}writeStorageObject(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}`;let o=new Ob;return this.httpClient.put(this.config.host+s,r,{params:o,headers:this.getTokenAuthHeaders(t)})}deleteStorageObject2(t,e,n,i,r){const s=`/v2/console/storage/${e=encodeURIComponent(String(e))}/${n=encodeURIComponent(String(n))}/${i=encodeURIComponent(String(i))}/${r=encodeURIComponent(String(r))}`;let o=new Ob;return this.httpClient.delete(this.config.host+s,{params:o,headers:this.getTokenAuthHeaders(t)})}listSubscriptions(t,e,n,i){let r=new Ob;return e&&(r=r.set("user_id",e)),n&&(r=r.set("limit",String(n))),i&&(r=r.set("cursor",i)),this.httpClient.get(this.config.host+"/v2/console/subscription",{params:r,headers:this.getTokenAuthHeaders(t)})}deleteUser(t,e){let n=new Ob;return e&&(n=n.set("username",e)),this.httpClient.delete(this.config.host+"/v2/console/user",{params:n,headers:this.getTokenAuthHeaders(t)})}listUsers(t){let e=new Ob;return this.httpClient.get(this.config.host+"/v2/console/user",{params:e,headers:this.getTokenAuthHeaders(t)})}addUser(t,e){let n=new Ob;return this.httpClient.post(this.config.host+"/v2/console/user",e,{params:n,headers:this.getTokenAuthHeaders(t)})}getTokenAuthHeaders(t){return(new Mb).set("Authorization","Bearer "+t)}getBasicAuthHeaders(t,e){return(new Mb).set("Authorization","Basic "+btoa(t+":"+e))}}return t.\u0275fac=function(e){return new(e||t)(bi(qb),bi(uw,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const pw=new Yn("window"),fw=[{provide:pw,useFactory:()=>window}],gw="currentSession";let mw=(()=>{class t{constructor(t,e,n,i){this.window=t,this.segment=e,this.http=n,this.consoleService=i;const r=JSON.parse(localStorage.getItem(gw));r&&this.segmentIdentify(r),this.currentSessionSubject=new gf(r),this.currentSession=this.currentSessionSubject.asObservable()}get currentSessionValue(){return this.currentSessionSubject.getValue()}get username(){const t=this.currentSessionSubject.getValue().token;return JSON.parse(atob(t.split(".")[1])).usn}get sessionRole(){const t=this.currentSessionSubject.getValue().token;switch(JSON.parse(atob(t.split(".")[1])).rol){case 1:return cw.USER_ROLE_ADMIN;case 2:return cw.USER_ROLE_DEVELOPER;case 3:return cw.USER_ROLE_MAINTAINER;case 4:return cw.USER_ROLE_READONLY;default:return cw.USER_ROLE_UNKNOWN}}login(t,e){return this.consoleService.authenticate({username:t,password:e}).pipe(ng(t=>{localStorage.setItem(gw,JSON.stringify(t)),this.currentSessionSubject.next(t),this.segmentIdentify(t)}))}logout(){var t;return this.currentSessionSubject.getValue()?this.consoleService.authenticateLogout("",{token:null===(t=this.currentSessionSubject.getValue())||void 0===t?void 0:t.token}).pipe(ng(()=>{localStorage.removeItem(gw),this.currentSessionSubject.next(null)})):Cf}segmentIdentify(t){const e=JSON.parse(atob(t.token.split(".")[1]));this.segment.identify(null,{username:e.usn,email:e.ema,cookie:e.cki})}}return t.\u0275fac=function(e){return new(e||t)(bi(pw),bi(Db),bi(qb),bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function vw(t,e){if(1&t&&(Mo(0,"div",17),va(1),Io()),2&t){const t=zo();Qr(1),ba(" ",t.error," ")}}const yw=function(t){return{"was-validated":t}},bw=function(t){return{"is-invalid":t}};let ww=(()=>{class t{constructor(t,e,n,i,r){this.segment=t,this.formBuilder=e,this.route=n,this.router=i,this.authenticationService=r,this.error=""}ngOnInit(){this.segment.page("/login"),this.loginForm=this.formBuilder.group({username:["",py.compose([py.required])],password:["",py.compose([py.required,py.minLength(8)])]}),this.returnUrl=this.route.snapshot.queryParams.next||"/"}onSubmit(){this.submitted=!0,this.error="",this.loginForm.invalid||this.authenticationService.login(this.f.username.value,this.f.password.value).subscribe(t=>{this.loginForm.reset(),this.submitted=!1,this.router.navigate([this.returnUrl])},t=>{this.error=t,this.submitted=!1})}get f(){return this.loginForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(Db),Ro(_b),Ro(pm),Ro(Fv),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:26,vars:14,consts:[[1,"bg-grad","d-flex","h-100"],[1,"align-self-center","mx-auto"],[1,"text-center","mb-4"],["src","/static/svg/logo.svg","alt","Nakama Logo","width","175"],["class","alert alert-warning","role","alert",4,"ngIf"],[1,"card"],[1,"card-body"],[1,"text-center"],[3,"formGroup","ngClass","ngSubmit"],[1,"form-group","form-row"],[1,"col-sm-12"],["for","username"],["type","text","id","username","formControlName","username","required","","autofocus","",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","password"],["type","password","id","password","formControlName","password","required","",1,"form-control",3,"ngClass"],[1,"btn","btn-primary","btn-lg","btn-block",3,"disabled"],["role","alert",1,"alert","alert-warning"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"h1",2),$o(3,"img",3),Io(),Do(4,vw,2,1,"div",4),Mo(5,"div",5),Mo(6,"div",6),Mo(7,"h3",7),va(8,"Login"),Io(),Mo(9,"form",8),Vo("ngSubmit",function(){return e.onSubmit()}),Mo(10,"div",9),Mo(11,"div",10),Mo(12,"label",11),va(13,"Username"),Io(),$o(14,"input",12),Mo(15,"div",13),va(16,"Please enter a username."),Io(),Io(),Io(),Mo(17,"div",9),Mo(18,"div",10),Mo(19,"label",14),va(20,"Password"),Io(),$o(21,"input",15),Mo(22,"div",13),va(23,"Password must be at least 8 characters."),Io(),Io(),Io(),Mo(24,"button",16),va(25,"Login"),Io(),Io(),Io(),Io(),Io(),Io()),2&t&&(Qr(4),Fo("ngIf",e.error),Qr(5),Fo("formGroup",e.loginForm)("ngClass",Vl(8,yw,e.submitted)),Qr(5),Fo("ngClass",Vl(10,bw,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(6),Fo("ngClass",Vl(12,bw,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(2),Fo("disabled",!e.loginForm.valid||e.submitted))},directives:[Bh,pb,Ry,mb,$h,ay,Ty,yb,wb],styles:["div[_ngcontent-%COMP%] .mx-auto[_ngcontent-%COMP%]{width:420px}"]}),t})(),xw=(()=>{class t{constructor(t,e){this.authService=t,this.router=e}canActivate(t,e){return!this.authService.currentSessionValue||(this.router.navigate(["/"]),!1)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),_w=(()=>{class t{constructor(t,e){this.router=t,this.authenticationService=e}canActivate(t,e){return!!this.authenticationService.currentSessionValue||(this.router.navigate(["/login"],{queryParams:{next:e.url}}),!1)}canActivateChild(t,e){return this.canActivate(t,e)}}return t.\u0275fac=function(e){return new(e||t)(bi(Fv),bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();class Cw extends u{constructor(t,e){super()}schedule(t,e=0){return this}}class Sw extends Cw{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n=!1,i=void 0;try{this.work(t)}catch(r){n=!0,i=!!r&&r||new Error(r)}if(n)return this.unsubscribe(),i}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}let Ew=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class kw extends Ew{constructor(t,e=Ew.now){super(t,()=>kw.delegate&&kw.delegate!==this?kw.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return kw.delegate&&kw.delegate!==this?kw.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const Aw=new kw(Sw);class Dw{constructor(t,e,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=i}call(t,e){return e.subscribe(new Rw(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))}}class Tw{constructor(){this.buffer=[]}}class Rw extends f{constructor(t,e,n,i,r){super(t),this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=i,this.scheduler=r,this.contexts=[];const s=this.openContext();if(this.timespanOnly=null==n||n<0,this.timespanOnly)this.add(s.closeAction=r.schedule(Fw,e,{subscriber:this,context:s,bufferTimeSpan:e}));else{const t={bufferTimeSpan:e,bufferCreationInterval:n,subscriber:this,scheduler:r};this.add(s.closeAction=r.schedule(Mw,e,{subscriber:this,context:s})),this.add(r.schedule(Lw,n,t))}}_next(t){const e=this.contexts,n=e.length;let i;for(let r=0;r0;){const n=t.shift();e.next(n.buffer)}super._complete()}_unsubscribe(){this.contexts=null}onBufferFull(t){this.closeContext(t);const e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();const e=this.bufferTimeSpan;this.add(t.closeAction=this.scheduler.schedule(Fw,e,{subscriber:this,context:t,bufferTimeSpan:e}))}}openContext(){const t=new Tw;return this.contexts.push(t),t}closeContext(t){this.destination.next(t.buffer);const e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)}}function Fw(t){const e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Lw(t){const{bufferCreationInterval:e,bufferTimeSpan:n,subscriber:i,scheduler:r}=t,s=i.openContext();i.closed||(i.add(s.closeAction=r.schedule(Mw,n,{subscriber:i,context:s})),this.schedule(t,e))}function Mw(t){const{subscriber:e,context:n}=t;e.closeContext(n)}class Iw{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new $w(t,this.compare,this.keySelector))}}class $w extends f{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}function Ow(t,e,n,r){return i(n)&&(r=n,n=void 0),r?Ow(t,e,n).pipe(k(t=>l(t)?r(...t):r(t))):new y(i=>{Pw(t,e,function(t){i.next(arguments.length>1?Array.prototype.slice.call(arguments):t)},i,n)})}function Pw(t,e,n,i,r){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){const i=t;t.addEventListener(e,n,r),s=()=>i.removeEventListener(e,n,r)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){const i=t;t.on(e,n),s=()=>i.off(e,n)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){const i=t;t.addListener(e,n),s=()=>i.removeListener(e,n)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let s=0,o=t.length;s=0}function Bw(t=0,e,n){let i=-1;return Nw(e)?i=Number(e)<1?1:Number(e):E(e)&&(n=e),E(n)||(n=Aw),new y(e=>{const r=Nw(t)?t:+t-n.now();return n.schedule(Uw,r,{index:0,period:i,subscriber:e})})}function Uw(t){const{index:e,period:n,subscriber:i}=t;if(i.next(e),!i.closed){if(-1===n)return i.complete();t.index=e+1,this.schedule(t,n)}}function Vw(...t){if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return z(t,void 0).lift(new Hw)}class Hw{call(t,e){return e.subscribe(new jw(t))}}class jw extends mf{constructor(t){super(t),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(t){this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(let n=0;nthis.index}hasCompleted(){return this.array.length===this.index}}class Xw extends N{constructor(t,e,n){super(t),this.parent=e,this.observable=n,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}[F](){return this}next(){const t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}}hasValue(){return this.buffer.length>0}hasCompleted(){return 0===this.buffer.length&&this.isComplete}notifyComplete(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}notifyNext(t){this.buffer.push(t),this.parent.checkIterators()}subscribe(){return B(this.observable,new P(this))}}function Yw(t){return e=>e.lift(new Jw(t))}class Jw{constructor(t){this.notifier=t}call(t,e){const n=new Qw(t),i=B(this.notifier,new P(n));return i&&!n.seenValue?(n.add(i),e.subscribe(n)):n}}class Qw extends N{constructor(t){super(t),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}function Zw(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new tx(t,n))}}class tx{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new ex(t,this.observables,this.project))}}class ex extends mf{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const i=e.length;this.values=new Array(i);for(let r=0;r0){const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function nx(t,e){return new y(e?n=>e.schedule(ix,0,{error:t,subscriber:n}):e=>e.error(t))}function ix({error:t,subscriber:e}){e.error(t)}let rx=(()=>{class t{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return ff(this.value);case"E":return nx(this.error);case"C":return Sf()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new t("N",e):t.undefinedValueNotification}static createError(e){return new t("E",void 0,e)}static createComplete(){return t.completeNotification}}return t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t})();function sx(t,e=Aw){var n;const i=(n=t)instanceof Date&&!isNaN(+n)?+t-e.now():Math.abs(t);return t=>t.lift(new ox(i,e))}class ox{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new ax(t,this.delay,this.scheduler))}}class ax extends f{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,i=t.scheduler,r=t.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const e=Math.max(0,n[0].time-i.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(ax.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new lx(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(rx.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(rx.createComplete()),this.unsubscribe()}}class lx{constructor(t,e){this.time=t,this.notification=e}}function cx(t,e){if(1&t){const t=No();Mo(0,"button",1),Vo("click",function(){return Ie(t),zo().close()}),Mo(1,"span",2),va(2,"\xd7"),Io(),Io()}}const hx=["*"],ux=["dialog"];function dx(t){return null!=t}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const px={animation:!0,transitionTimerDelayMs:5};let fx=(()=>{class t{constructor(){this.animation=px.animation}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})();const gx=()=>{},{transitionTimerDelayMs:mx}=px,vx=new Map,yx=(t,e,n)=>{let i=n.context||{};const r=vx.get(t);if(r)switch(n.runningTransition){case"continue":return Cf;case"stop":r.transition$.complete(),i=Object.assign(r.context,i),vx.delete(t)}!function(t){t||document}(t);const s=e(t,i)||gx;if(!n.animation||"none"===window.getComputedStyle(t).transitionProperty)return s(),ff(void 0);const o=new C,a=o.pipe(function(...t){return e=>qf(e,ff(...t))}(!0));vx.set(t,{transition$:o,context:i});const l=function(t){const{transitionDelay:e,transitionDuration:n}=window.getComputedStyle(t);return 1e3*(parseFloat(e)+parseFloat(n))}(t),c=Ow(t,"transitionend").pipe(Yw(a),Af(({target:e})=>e===t));return Vw(Bw(l+mx).pipe(Yw(a)),c).pipe(Yw(a)).subscribe(()=>{vx.delete(t),s(),o.next(),o.complete()}),o.asObservable()};let bx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),wx=(()=>{class t{constructor(t){this.dismissible=!0,this.type="warning",this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const xx=({classList:t})=>{t.remove("show")};let _x=(()=>{class t{constructor(t,e,n){this._renderer=e,this._element=n,this.closed=new Wl,this.dismissible=t.dismissible,this.type=t.type,this.animation=t.animation}close(){const t=yx(this._element.nativeElement,xx,{animation:this.animation,runningTransition:"continue"});return t.subscribe(()=>this.closed.emit()),t}ngOnChanges(t){const e=t.type;e&&!e.firstChange&&(this._renderer.removeClass(this._element.nativeElement,"alert-"+e.previousValue),this._renderer.addClass(this._element.nativeElement,"alert-"+e.currentValue))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,"alert-"+this.type)}}return t.\u0275fac=function(e){return new(e||t)(Ro(wx),Ro(Ga),Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert","show"],hostVars:4,hostBindings:function(t,e){2&t&&ra("fade",e.animation)("alert-dismissible",e.dismissible)},inputs:{dismissible:"dismissible",type:"type",animation:"animation"},outputs:{closed:"closed"},exportAs:["ngbAlert"],features:[le],ngContentSelectors:hx,decls:2,vars:1,consts:function(){let t,e;return t=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,e=$localize`:@@ngb.alert.close␟f4e529ae5ffd73001d1ff4bbdeeb0a72e342e5c8␟7819314041543176992:Close`,[["type","button","class","close","aria-label",t,3,"click",4,"ngIf"],["type","button","aria-label",e,1,"close",3,"click"],["aria-hidden","true"]]},template:function(t,e){1&t&&(Go(),qo(0),Do(1,cx,3,0,"button",0)),2&t&&(Qr(1),Fo("ngIf",e.dismissible))},directives:[Bh],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),t})(),Cx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Sx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbButtonLabel",""]],hostVars:8,hostBindings:function(t,e){2&t&&ra("btn",!0)("active",e.active)("disabled",e.disabled)("focus",e.focused)}}),t})(),Ex=0,kx=(()=>{class t{constructor(){this._radios=new Set,this._value=null,this.name="ngb-radio-"+Ex++,this.onChange=t=>{},this.onTouched=()=>{}}get disabled(){return this._disabled}set disabled(t){this.setDisabledState(t)}onRadioChange(t){this.writeValue(t.value),this.onChange(t.value)}onRadioValueUpdate(){this._updateRadiosValue()}register(t){this._radios.add(t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this._disabled=t,this._updateRadiosDisabled()}unregister(t){this._radios.delete(t)}writeValue(t){this._value=t,this._updateRadiosValue()}_updateRadiosValue(){this._radios.forEach(t=>t.updateValue(this._value))}_updateRadiosDisabled(){this._radios.forEach(t=>t.updateDisabled())}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["","ngbRadioGroup",""]],hostAttrs:["role","radiogroup"],inputs:{name:"name"},features:[Pa([{provide:ny,useExisting:st(()=>t),multi:!0}])]}),t})(),Ax=(()=>{class t{constructor(t,e,n,i,r){this._group=t,this._label=e,this._renderer=n,this._element=i,this._cd=r,this._value=null,this._group.register(this),this.updateDisabled()}set value(t){this._value=t;const e=t?t.toString():"";this._renderer.setProperty(this._element.nativeElement,"value",e),this._group.onRadioValueUpdate()}set disabled(t){this._disabled=!1!==t,this.updateDisabled()}set focused(t){this._label&&(this._label.focused=t),t||this._group.onTouched()}get checked(){return this._checked}get disabled(){return this._group.disabled||this._disabled}get value(){return this._value}get nameAttr(){return this.name||this._group.name}ngOnDestroy(){this._group.unregister(this)}onChange(){this._group.onRadioChange(this)}updateValue(t){this.value!==t&&this._cd.markForCheck(),this._checked=this.value===t,this._label.active=this._checked}updateDisabled(){this._label.disabled=this.disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(kx),Ro(Sx),Ro(Ga),Ro(za),Ro(pl))},t.\u0275dir=Wt({type:t,selectors:[["","ngbButton","","type","radio"]],hostVars:3,hostBindings:function(t,e){1&t&&Vo("change",function(){return e.onChange()})("focus",function(){return e.focused=!0})("blur",function(){return e.focused=!1}),2&t&&xa("checked",e.checked)("disabled",e.disabled)("name",e.nameAttr)},inputs:{value:"value",disabled:"disabled",name:"name"}}),t})(),Dx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Tx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),Rx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();var Fx=function(t){return t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown",t}({});const Lx=(t,e)=>!!e&&e.some(e=>e.contains(t)),Mx=(t,e)=>!e||null!=function(t,e){return e?void 0===t.closest?null:t.closest(e):null}(t,e),Ix="undefined"!=typeof navigator&&!!navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));function $x(t,e,n,i,r,s,o,a){var l;n&&t.runOutsideAngular((l=()=>{const l=Ow(e,"keydown").pipe(Yw(r),Af(t=>t.which===Fx.Escape),ng(t=>t.preventDefault())),c=Ow(e,"mousedown").pipe(k(t=>{const e=t.target;return 2!==t.button&&!Lx(e,o)&&("inside"===n?Lx(e,s)&&Mx(e,a):"outside"===n?!Lx(e,s):Mx(e,a)||!Lx(e,s))}),Yw(r)),h=Ow(e,"mouseup").pipe(Zw(c),Af(([t,e])=>e),sx(0),Yw(r));Vw([l.pipe(k(t=>0)),h.pipe(k(t=>1))]).subscribe(e=>t.run(()=>i(e)))},Ix?()=>setTimeout(()=>l(),100):l))}const Ox=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function Px(t){const e=Array.from(t.querySelectorAll(Ox)).filter(t=>-1!==t.tabIndex);return[e[0],e[e.length-1]]}const Nx=/\s+/,Bx=new class{getAllStyles(t){return window.getComputedStyle(t)}getStyle(t,e){return this.getAllStyles(t)[e]}isStaticPositioned(t){return"static"===(this.getStyle(t,"position")||"static")}offsetParent(t){let e=t.offsetParent||document.documentElement;for(;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement}position(t,e=!0){let n,i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const e=this.offsetParent(t);n=this.offset(t,!1),e!==document.documentElement&&(i=this.offset(e,!1)),i.top+=e.clientTop,i.left+=e.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(t,e=!0){const n=t.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,r=window.pageXOffset-document.documentElement.clientLeft;let s={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+r,right:n.right+r};return e&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s}positionElements(t,e,n,i){const[r="top",s="center"]=n.split("-"),o=i?this.offset(t,!1):this.position(t,!1),a=this.getAllStyles(e),l=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),h=parseFloat(a.marginLeft),u=parseFloat(a.marginRight);let d=0,p=0;switch(r){case"top":d=o.top-(e.offsetHeight+l+c);break;case"bottom":d=o.top+o.height;break;case"left":p=o.left-(e.offsetWidth+h+u);break;case"right":p=o.left+o.width}switch(s){case"top":d=o.top;break;case"bottom":d=o.top+o.height-e.offsetHeight;break;case"left":p=o.left;break;case"right":p=o.left+o.width-e.offsetWidth;break;case"center":"top"===r||"bottom"===r?p=o.left+o.width/2-e.offsetWidth/2:d=o.top+o.height/2-e.offsetHeight/2}e.style.transform=`translate(${Math.round(p)}px, ${Math.round(d)}px)`;const f=e.getBoundingClientRect(),g=document.documentElement,m=window.innerHeight||g.clientHeight,v=window.innerWidth||g.clientWidth;return f.left>=0&&f.top>=0&&f.right<=v&&f.bottom<=m}};function Ux(t,e,n,i,r){let s=Array.isArray(n)?n:n.split(Nx);const o=["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"],a=e.classList,l=t=>{const[e,n]=t.split("-"),i=[];return r&&(i.push(`${r}-${e}`),n&&i.push(`${r}-${e}-${n}`),i.forEach(t=>{a.add(t)})),i};r&&o.forEach(t=>{a.remove(`${r}-${t}`)});let c=s.findIndex(t=>"auto"===t);c>=0&&o.forEach(function(t){null==s.find(e=>-1!==e.search("^"+t))&&s.splice(c++,1,t)});const h=e.style;h.position="absolute",h.top="0",h.left="0",h["will-change"]="transform";let u=null,d=!1;for(u of s){let n=l(u);if(Bx.positionElements(t,e,u,i)){d=!0;break}r&&n.forEach(t=>{a.remove(t)})}return d||(u=s[0],l(u),Bx.positionElements(t,e,u,i)),u}new Date(1882,10,12),new Date(2174,10,25);let Vx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,Cb]]}),t})(),Hx=(()=>{class t{constructor(){this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"]}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({factory:function(){return new t},token:t,providedIn:"root"}),t})(),jx=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Wt({type:t,selectors:[["",8,"navbar"]]}),t})(),zx=(()=>{class t{constructor(t){this.elementRef=t,this._disabled=!1}set disabled(t){this._disabled=""===t||!0===t}get disabled(){return this._disabled}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownItem",""]],hostAttrs:[1,"dropdown-item"],hostVars:2,hostBindings:function(t,e){2&t&&ra("disabled",e.disabled)},inputs:{disabled:"disabled"}}),t})(),Wx=(()=>{class t{constructor(t,e){this.dropdown=t,this.placement="bottom",this.isOpen=!1,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownMenu",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,zx,!1),2&t){let t;ic(t=lc())&&(e.menuItems=t)}},hostVars:5,hostBindings:function(t,e){1&t&&Vo("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Enter",function(t){return e.dropdown.onKeyDown(t)})("keydown.Space",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&(ko("x-placement",e.placement),ra("dropdown-menu",!0)("show",e.dropdown.isOpen()))}}),t})(),Gx=(()=>{class t{constructor(t,e){this.dropdown=t,this.nativeElement=e.nativeElement}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownAnchor",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){2&t&&ko("aria-expanded",e.dropdown.isOpen())}}),t})(),qx=(()=>{class t extends Gx{constructor(t,e){super(t,e)}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>Kx)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdownToggle",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(t,e){1&t&&Vo("click",function(){return e.dropdown.toggle()})("keydown.ArrowUp",function(t){return e.dropdown.onKeyDown(t)})("keydown.ArrowDown",function(t){return e.dropdown.onKeyDown(t)})("keydown.Home",function(t){return e.dropdown.onKeyDown(t)})("keydown.End",function(t){return e.dropdown.onKeyDown(t)})("keydown.Tab",function(t){return e.dropdown.onKeyDown(t)})("keydown.Shift.Tab",function(t){return e.dropdown.onKeyDown(t)}),2&t&&ko("aria-expanded",e.dropdown.isOpen())},features:[Pa([{provide:Gx,useExisting:st(()=>t)}]),po]}),t})(),Kx=(()=>{class t{constructor(t,e,n,i,r,s,o){this._changeDetector=t,this._document=n,this._ngZone=i,this._elementRef=r,this._renderer=s,this._closed$=new C,this._bodyContainer=null,this._open=!1,this.openChange=new Wl,this.placement=e.placement,this.container=e.container,this.autoClose=e.autoClose,this.display=o?"static":"dynamic",this._zoneSubscription=i.onStable.subscribe(()=>{this._positionMenu()})}ngAfterContentInit(){this._ngZone.onStable.pipe(zf(1)).subscribe(()=>{this._applyPlacementClasses(),this._open&&this._setCloseHandlers()})}ngOnChanges(t){t.container&&this._open&&this._applyContainer(this.container),t.placement&&!t.placement.isFirstChange&&this._applyPlacementClasses()}isOpen(){return this._open}open(){this._open||(this._open=!0,this._applyContainer(this.container),this.openChange.emit(!0),this._setCloseHandlers(),this._anchor&&this._anchor.nativeElement.focus())}_setCloseHandlers(){$x(this._ngZone,this._document,this.autoClose,t=>{this.close(),0===t&&this._anchor.nativeElement.focus()},this._closed$,this._menu?[this._menu.nativeElement]:[],this._anchor?[this._anchor.nativeElement]:[],".dropdown-item,.dropdown-divider")}close(){this._open&&(this._open=!1,this._resetContainer(),this._closed$.next(),this.openChange.emit(!1),this._changeDetector.markForCheck())}toggle(){this.isOpen()?this.close():this.open()}ngOnDestroy(){this._resetContainer(),this._closed$.next(),this._zoneSubscription.unsubscribe()}onKeyDown(t){const e=t.which,n=this._getMenuElements();let i=-1,r=null;const s=this._isEventFromToggle(t);if(!s&&n.length&&n.forEach((e,n)=>{e.contains(t.target)&&(r=e),e===this._document.activeElement&&(i=n)}),e!==Fx.Space&&e!==Fx.Enter){if(e!==Fx.Tab){if(s||r){if(this.open(),n.length){switch(e){case Fx.ArrowDown:i=Math.min(i+1,n.length-1);break;case Fx.ArrowUp:if(this._isDropup()&&-1===i){i=n.length-1;break}i=Math.max(i-1,0);break;case Fx.Home:i=0;break;case Fx.End:i=n.length-1}n[i].focus()}t.preventDefault()}}else if(t.target&&this.isOpen()&&this.autoClose){if(this._anchor.nativeElement===t.target)return void("body"!==this.container||t.shiftKey?t.shiftKey&&this.close():(this._renderer.setAttribute(this._menu.nativeElement,"tabindex","0"),this._menu.nativeElement.focus(),this._renderer.removeAttribute(this._menu.nativeElement,"tabindex")));if("body"===this.container){const e=this._menu.nativeElement.querySelectorAll(Ox);t.shiftKey&&t.target===e[0]?(this._anchor.nativeElement.focus(),t.preventDefault()):t.shiftKey||t.target!==e[e.length-1]||(this._anchor.nativeElement.focus(),this.close())}else Ow(t.target,"focusout").pipe(zf(1)).subscribe(({relatedTarget:t})=>{this._elementRef.nativeElement.contains(t)||this.close()})}}else!r||!0!==this.autoClose&&"inside"!==this.autoClose||Ow(r,"click").pipe(zf(1)).subscribe(()=>this.close())}_isDropup(){return this._elementRef.nativeElement.classList.contains("dropup")}_isEventFromToggle(t){return this._anchor.nativeElement.contains(t.target)}_getMenuElements(){const t=this._menu;return null==t?[]:t.menuItems.filter(t=>!t.disabled).map(t=>t.elementRef.nativeElement)}_positionMenu(){const t=this._menu;this.isOpen()&&t&&this._applyPlacementClasses("dynamic"===this.display?Ux(this._anchor.nativeElement,this._bodyContainer||this._menu.nativeElement,this.placement,"body"===this.container):this._getFirstPlacement(this.placement))}_getFirstPlacement(t){return Array.isArray(t)?t[0]:t.split(" ")[0]}_resetContainer(){const t=this._renderer;if(this._menu){const e=this._menu.nativeElement;t.appendChild(this._elementRef.nativeElement,e),t.removeStyle(e,"position"),t.removeStyle(e,"transform")}this._bodyContainer&&(t.removeChild(this._document.body,this._bodyContainer),this._bodyContainer=null)}_applyContainer(t=null){if(this._resetContainer(),"body"===t){const t=this._renderer,e=this._menu.nativeElement,n=this._bodyContainer=this._bodyContainer||t.createElement("div");t.setStyle(n,"position","absolute"),t.setStyle(e,"position","static"),t.setStyle(n,"z-index","1050"),t.appendChild(n,e),t.appendChild(this._document.body,n)}}_applyPlacementClasses(t){const e=this._menu;if(e){t||(t=this._getFirstPlacement(this.placement));const n=this._renderer,i=this._elementRef.nativeElement;n.removeClass(i,"dropup"),n.removeClass(i,"dropdown"),e.placement="static"===this.display?null:t;const r=-1!==t.search("^top")?"dropup":"dropdown";n.addClass(i,r);const s=this._bodyContainer;s&&(n.removeClass(s,"dropup"),n.removeClass(s,"dropdown"),n.addClass(s,r))}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl),Ro(Hx),Ro(ph),Ro(Ic),Ro(za),Ro(Ga),Ro(jx,8))},t.\u0275dir=Wt({type:t,selectors:[["","ngbDropdown",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,Wx,!0),ac(n,Gx,!0)),2&t){let t;ic(t=lc())&&(e._menu=t.first),ic(t=lc())&&(e._anchor=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("show",e.isOpen())},inputs:{_open:["open","_open"],placement:"placement",container:"container",autoClose:"autoClose",display:"display"},outputs:{openChange:"openChange"},exportAs:["ngbDropdown"],features:[le]}),t})(),Xx=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})(),Yx=(()=>{class t{constructor(t){this.backdrop=!0,this.keyboard=!0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();class Jx{constructor(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}}class Qx{constructor(t,e,n,i,r,s,o){this._type=t,this._injector=e,this._viewContainerRef=n,this._renderer=i,this._ngZone=r,this._componentFactoryResolver=s,this._applicationRef=o,this._windowRef=null,this._contentRef=null}open(t,e,n=!1){this._windowRef||(this._contentRef=this._getContentRef(t,e),this._windowRef=this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type),this._viewContainerRef.length,this._injector,this._contentRef.nodes));const{nativeElement:i}=this._windowRef.location,r=this._ngZone.onStable.asObservable().pipe(zf(1)).pipe(U(()=>this._ngZone.run(()=>yx(i,({classList:t})=>t.add("show"),{animation:n,runningTransition:"continue"}))));return{windowRef:this._windowRef,transition$:r}}close(t=!1){return this._windowRef?yx(this._windowRef.location.nativeElement,({classList:t})=>t.remove("show"),{animation:t,runningTransition:"stop"}).pipe(ng(()=>{var t;this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null),(null===(t=this._contentRef)||void 0===t?void 0:t.viewRef)&&(this._applicationRef.detachView(this._contentRef.viewRef),this._contentRef.viewRef.destroy(),this._contentRef=null)})):ff(void 0)}_getContentRef(t,e){if(t){if(t instanceof yl){const n=t.createEmbeddedView(e);return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}return new Jx([[this._renderer.createText(""+t)]])}return new Jx([])}}const Zx=()=>{};let t_=(()=>{class t{constructor(t){this._document=t}compensate(){const t=this._getWidth();return this._isPresent(t)?this._adjustBody(t):Zx}_adjustBody(t){const e=this._document.body,n=e.style.paddingRight,i=parseFloat(window.getComputedStyle(e)["padding-right"]);return e.style["padding-right"]=i+t+"px",()=>e.style["padding-right"]=n}_isPresent(t){const e=this._document.body.getBoundingClientRect();return window.innerWidth-(e.left+e.right)>=t-.1*t}_getWidth(){const t=this._document.createElement("div");t.className="modal-scrollbar-measure";const e=this._document.body;e.appendChild(t);const n=t.getBoundingClientRect().width-t.clientWidth;return e.removeChild(t),n}}return t.\u0275fac=function(e){return new(e||t)(bi(ph))},t.\u0275prov=lt({factory:function(){return new t(bi(ph))},token:t,providedIn:"root"}),t})(),e_=(()=>{class t{constructor(t,e){this._el=t,this._zone=e}ngOnInit(){this._zone.onStable.asObservable().pipe(zf(1)).subscribe(()=>{yx(this._el.nativeElement,({classList:t})=>t.add("show"),{animation:this.animation,runningTransition:"continue"})})}hide(){return yx(this._el.nativeElement,({classList:t})=>t.remove("show"),{animation:this.animation,runningTransition:"stop"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:6,hostBindings:function(t,e){2&t&&(sa("modal-backdrop"+(e.backdropClass?" "+e.backdropClass:"")),ra("show",!e.animation)("fade",e.animation))},inputs:{animation:"animation",backdropClass:"backdropClass"},decls:0,vars:0,template:function(t,e){},encapsulation:2}),t})();class n_{close(t){}dismiss(t){}}class i_{constructor(t,e,n,i){this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,this._beforeDismiss=i,this._closed=new C,this._dismissed=new C,this._hidden=new C,t.instance.dismissEvent.subscribe(t=>{this.dismiss(t)}),this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}get closed(){return this._closed.asObservable().pipe(Yw(this._hidden))}get dismissed(){return this._dismissed.asObservable().pipe(Yw(this._hidden))}get hidden(){return this._hidden.asObservable()}get shown(){return this._windowCmptRef.instance.shown.asObservable()}close(t){this._windowCmptRef&&(this._closed.next(t),this._resolve(t),this._removeModalElements())}_dismiss(t){this._dismissed.next(t),this._reject(t),this._removeModalElements()}dismiss(t){if(this._windowCmptRef)if(this._beforeDismiss){const e=this._beforeDismiss();e&&e.then?e.then(e=>{!1!==e&&this._dismiss(t)},()=>{}):!1!==e&&this._dismiss(t)}else this._dismiss(t)}_removeModalElements(){const t=this._windowCmptRef.instance.hide(),e=this._backdropCmptRef?this._backdropCmptRef.instance.hide():ff(void 0);t.subscribe(()=>{const{nativeElement:t}=this._windowCmptRef.location;t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._contentRef=null}),e.subscribe(()=>{if(this._backdropCmptRef){const{nativeElement:t}=this._backdropCmptRef.location;t.parentNode.removeChild(t),this._backdropCmptRef.destroy(),this._backdropCmptRef=null}}),zw(t,e).subscribe(()=>{this._hidden.next(),this._hidden.complete()})}}var r_=function(t){return t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC",t}({});let s_=(()=>{class t{constructor(t,e,n){this._document=t,this._elRef=e,this._zone=n,this._closed$=new C,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new Wl,this.shown=new C,this.hidden=new C}dismiss(t){this.dismissEvent.emit(t)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){this._show()}ngOnDestroy(){this._disableEventHandling()}hide(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"stop"},n=zw(yx(t,()=>t.classList.remove("show"),e),yx(this._dialogEl.nativeElement,()=>{},e));return n.subscribe(()=>{this.hidden.next(),this.hidden.complete()}),this._disableEventHandling(),this._restoreFocus(),n}_show(){const{nativeElement:t}=this._elRef,e={animation:this.animation,runningTransition:"continue"};zw(yx(t,()=>t.classList.add("show"),e),yx(this._dialogEl.nativeElement,()=>{},e)).subscribe(()=>{this.shown.next(),this.shown.complete()}),this._enableEventHandling(),this._setFocus()}_enableEventHandling(){const{nativeElement:t}=this._elRef;this._zone.runOutsideAngular(()=>{Ow(t,"keydown").pipe(Yw(this._closed$),Af(t=>t.which===Fx.Escape)).subscribe(t=>{this.keyboard?requestAnimationFrame(()=>{t.defaultPrevented||this._zone.run(()=>this.dismiss(r_.ESC))}):"static"===this.backdrop&&this._bumpBackdrop()});let e=!1;Ow(this._dialogEl.nativeElement,"mousedown").pipe(Yw(this._closed$),ng(()=>e=!1),Vf(()=>Ow(t,"mouseup").pipe(Yw(this._closed$),zf(1))),Af(({target:e})=>t===e)).subscribe(()=>{e=!0}),Ow(t,"click").pipe(Yw(this._closed$)).subscribe(({target:n})=>{t===n&&("static"===this.backdrop?this._bumpBackdrop():!0!==this.backdrop||e||this._zone.run(()=>this.dismiss(r_.BACKDROP_CLICK))),e=!1})})}_disableEventHandling(){this._closed$.next()}_setFocus(){const{nativeElement:t}=this._elRef;if(!t.contains(document.activeElement)){const e=t.querySelector("[ngbAutofocus]"),n=Px(t)[0];(e||n||t).focus()}}_restoreFocus(){const t=this._document.body,e=this._elWithFocus;let n;n=e&&e.focus&&t.contains(e)?e:t,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null})}_bumpBackdrop(){"static"===this.backdrop&&yx(this._elRef.nativeElement,({classList:t})=>(t.add("modal-static"),()=>t.remove("modal-static")),{animation:this.animation,runningTransition:"continue"})}}return t.\u0275fac=function(e){return new(e||t)(Ro(ph),Ro(za),Ro(Ic))},t.\u0275cmp=Bt({type:t,selectors:[["ngb-modal-window"]],viewQuery:function(t,e){if(1&t&&rc(ux,!0),2&t){let t;ic(t=lc())&&(e._dialogEl=t.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:7,hostBindings:function(t,e){2&t&&(ko("aria-modal",!0)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),sa("modal d-block"+(e.windowClass?" "+e.windowClass:"")),ra("fade",e.animation))},inputs:{backdrop:"backdrop",keyboard:"keyboard",animation:"animation",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:hx,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0,1),Mo(2,"div",2),qo(3),Io(),Io()),2&t&&sa("modal-dialog"+(e.size?" modal-"+e.size:"")+(e.centered?" modal-dialog-centered":"")+(e.scrollable?" modal-dialog-scrollable":""))},styles:["ngb-modal-window .component-host-scrollable{-ms-flex-direction:column;display:-ms-flexbox;display:flex;flex-direction:column;overflow:hidden}"],encapsulation:2}),t})(),o_=(()=>{class t{constructor(t,e,n,i,r,s){this._applicationRef=t,this._injector=e,this._document=n,this._scrollBar=i,this._rendererFactory=r,this._ngZone=s,this._activeWindowCmptHasChanged=new C,this._ariaHiddenValues=new Map,this._backdropAttributes=["animation","backdropClass"],this._modalRefs=[],this._windowAttributes=["animation","ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new Wl,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const t=this._windowCmpts[this._windowCmpts.length-1];((t,e,n,i=!1)=>{this._ngZone.runOutsideAngular(()=>{const t=Ow(e,"focusin").pipe(Yw(n),k(t=>t.target));Ow(e,"keydown").pipe(Yw(n),Af(t=>t.which===Fx.Tab),Zw(t)).subscribe(([t,n])=>{const[i,r]=Px(e);n!==i&&n!==e||!t.shiftKey||(r.focus(),t.preventDefault()),n!==r||t.shiftKey||(i.focus(),t.preventDefault())}),i&&Ow(e,"click").pipe(Yw(n),Zw(t),k(t=>t[1])).subscribe(t=>t.focus())})})(0,t.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(t.location.nativeElement)}})}open(t,e,n,i){const r=i.container instanceof HTMLElement?i.container:dx(i.container)?this._document.querySelector(i.container):this._document.body,s=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(s.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!r)throw new Error(`The specified modal container "${i.container||"body"}" was not found in the DOM.`);const l=new n_,c=this._getContentRef(t,i.injector||e,n,l,i);let h=!1!==i.backdrop?this._attachBackdrop(t,r):void 0,u=this._attachWindowComponent(t,r,c),d=new i_(u,c,h,i.beforeDismiss);return this._registerModalRef(d),this._registerWindowCmpt(u),d.result.then(o,o),d.result.then(a,a),l.close=t=>{d.close(t)},l.dismiss=t=>{d.dismiss(t)},this._applyWindowOptions(u.instance,i),1===this._modalRefs.length&&s.addClass(this._document.body,"modal-open"),h&&h.instance&&this._applyBackdropOptions(h.instance,i),d}get activeInstances(){return this._activeInstances}dismissAll(t){this._modalRefs.forEach(e=>e.dismiss(t))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(t,e){let n=t.resolveComponentFactory(e_).create(this._injector);return this._applicationRef.attachView(n.hostView),e.appendChild(n.location.nativeElement),n}_attachWindowComponent(t,e,n){let i=t.resolveComponentFactory(s_).create(this._injector,n.nodes);return this._applicationRef.attachView(i.hostView),e.appendChild(i.location.nativeElement),i}_applyWindowOptions(t,e){this._windowAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_applyBackdropOptions(t,e){this._backdropAttributes.forEach(n=>{dx(e[n])&&(t[n]=e[n])})}_getContentRef(t,e,n,i,r){return n?n instanceof yl?this._createFromTemplateRef(n,i):"string"==typeof n?this._createFromString(n):this._createFromComponent(t,e,n,i,r):new Jx([])}_createFromTemplateRef(t,e){const n=t.createEmbeddedView({$implicit:e,close(t){e.close(t)},dismiss(t){e.dismiss(t)}});return this._applicationRef.attachView(n),new Jx([n.rootNodes],n)}_createFromString(t){const e=this._document.createTextNode(""+t);return new Jx([[e]])}_createFromComponent(t,e,n,i,r){const s=t.resolveComponentFactory(n),o=ho.create({providers:[{provide:n_,useValue:i}],parent:e}),a=s.create(o),l=a.location.nativeElement;return r.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(a.hostView),new Jx([[l]],a.hostView,a)}_setAriaHidden(t){const e=t.parentElement;e&&t!==this._document.body&&(Array.from(e.children).forEach(e=>{e!==t&&"SCRIPT"!==e.nodeName&&(this._ariaHiddenValues.set(e,e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),this._setAriaHidden(e))}_revertAriaHidden(){this._ariaHiddenValues.forEach((t,e)=>{t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(t){const e=()=>{const e=this._modalRefs.indexOf(t);e>-1&&(this._modalRefs.splice(e,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(t),this._activeInstances.emit(this._modalRefs),t.result.then(e,e)}_registerWindowCmpt(t){this._windowCmpts.push(t),this._activeWindowCmptHasChanged.next(),t.onDestroy(()=>{const e=this._windowCmpts.indexOf(t);e>-1&&(this._windowCmpts.splice(e,1),this._activeWindowCmptHasChanged.next())})}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(ho),bi(ph),bi(t_),bi(Wa),bi(Ic))},t.\u0275prov=lt({factory:function(){return new t(bi(eh),bi(Ks),bi(ph),bi(t_),bi(Wa),bi(Ic))},token:t,providedIn:"root"}),t})(),a_=(()=>{class t{constructor(t,e,n,i){this._moduleCFR=t,this._injector=e,this._modalStack=n,this._config=i}open(t,e={}){const n=Object.assign({},this._config,e);return this._modalStack.open(this._moduleCFR,this._injector,t,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(t){this._modalStack.dismissAll(t)}hasOpenModals(){return this._modalStack.hasOpenModals()}}return t.\u0275fac=function(e){return new(e||t)(bi(Ua),bi(ho),bi(o_),bi(Yx))},t.\u0275prov=lt({factory:function(){return new t(bi(Ua),bi(Ks),bi(o_),bi(Yx))},token:t,providedIn:"root"}),t})(),l_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[a_]}),t})(),c_=(()=>{class t{constructor(t){this.destroyOnHide=!0,this.orientation="horizontal",this.roles="tablist",this.keyboard=!1,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})();const h_=t=>dx(t)&&""!==t;let u_=0,d_=(()=>{class t{constructor(t){this.templateRef=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["ng-template","ngbNavContent",""]]}),t})(),p_=(()=>{class t{constructor(t,e){this.elementRef=e,this.disabled=!1,this.shown=new Wl,this.hidden=new Wl,this._nav=t}ngAfterContentChecked(){this.contentTpl=this.contentTpls.first}ngOnInit(){dx(this.domId)||(this.domId="ngb-nav-"+u_++)}get active(){return this._nav.activeId===this.id}get id(){return h_(this._id)?this._id:this.domId}get panelDomId(){return this.domId+"-panel"}isPanelInDom(){return(dx(this.destroyOnHide)?!this.destroyOnHide:!this._nav.destroyOnHide)||this.active}}return t.\u0275fac=function(e){return new(e||t)(Ro(st(()=>f_)),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNavItem",""]],contentQueries:function(t,e,n){if(1&t&&ac(n,d_,!1),2&t){let t;ic(t=lc())&&(e.contentTpls=t)}},hostVars:2,hostBindings:function(t,e){2&t&&ra("nav-item",!0)},inputs:{disabled:"disabled",domId:"domId",destroyOnHide:"destroyOnHide",_id:["ngbNavItem","_id"]},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbNavItem"]}),t})(),f_=(()=>{class t{constructor(t,e,n,i){this.role=t,this._cd=n,this._document=i,this.activeIdChange=new Wl,this.shown=new Wl,this.hidden=new Wl,this.destroy$=new C,this.navItemChange$=new C,this.navChange=new Wl,this.animation=e.animation,this.destroyOnHide=e.destroyOnHide,this.orientation=e.orientation,this.roles=e.roles,this.keyboard=e.keyboard}click(t){t.disabled||this._updateActiveId(t.id)}onKeyDown(t){if("tablist"!==this.roles||!this.keyboard)return;const e=t.which,n=this.links.filter(t=>!t.navItem.disabled),{length:i}=n;let r=-1;if(n.forEach((t,e)=>{t.elRef.nativeElement===this._document.activeElement&&(r=e)}),i){switch(e){case Fx.ArrowLeft:if("vertical"===this.orientation)return;r=(r-1+i)%i;break;case Fx.ArrowRight:if("vertical"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowDown:if("horizontal"===this.orientation)return;r=(r+1)%i;break;case Fx.ArrowUp:if("horizontal"===this.orientation)return;r=(r-1+i)%i;break;case Fx.Home:r=0;break;case Fx.End:r=i-1}"changeWithArrows"===this.keyboard&&this.select(n[r].navItem.id),n[r].elRef.nativeElement.focus(),t.preventDefault()}}select(t){this._updateActiveId(t,!1)}ngAfterContentInit(){if(!dx(this.activeId)){const t=this.items.first?this.items.first.id:null;h_(t)&&(this._updateActiveId(t,!1),this._cd.detectChanges())}this.items.changes.pipe(Yw(this.destroy$)).subscribe(()=>this._notifyItemChanged(this.activeId))}ngOnChanges({activeId:t}){t&&!t.firstChange&&this._notifyItemChanged(t.currentValue)}ngOnDestroy(){this.destroy$.next()}_updateActiveId(t,e=!0){if(this.activeId!==t){let n=!1;e&&this.navChange.emit({activeId:this.activeId,nextId:t,preventDefault:()=>{n=!0}}),n||(this.activeId=t,this.activeIdChange.emit(t),this._notifyItemChanged(t))}}_notifyItemChanged(t){this.navItemChange$.next(this._getItemById(t))}_getItemById(t){return this.items&&this.items.find(e=>e.id===t)||null}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(c_),Ro(pl),Ro(ph))},t.\u0275dir=Wt({type:t,selectors:[["","ngbNav",""]],contentQueries:function(t,e,n){if(1&t&&(ac(n,p_,!1),ac(n,g_,!0)),2&t){let t;ic(t=lc())&&(e.items=t),ic(t=lc())&&(e.links=t)}},hostVars:6,hostBindings:function(t,e){1&t&&Vo("keydown.arrowLeft",function(t){return e.onKeyDown(t)})("keydown.arrowRight",function(t){return e.onKeyDown(t)})("keydown.arrowDown",function(t){return e.onKeyDown(t)})("keydown.arrowUp",function(t){return e.onKeyDown(t)})("keydown.Home",function(t){return e.onKeyDown(t)})("keydown.End",function(t){return e.onKeyDown(t)}),2&t&&(ko("aria-orientation","vertical"===e.orientation&&"tablist"===e.roles?"vertical":void 0)("role",e.role?e.role:e.roles?"tablist":void 0),ra("nav",!0)("flex-column","vertical"===e.orientation))},inputs:{animation:"animation",destroyOnHide:"destroyOnHide",orientation:"orientation",roles:"roles",keyboard:"keyboard",activeId:"activeId"},outputs:{activeIdChange:"activeIdChange",shown:"shown",hidden:"hidden",navChange:"navChange"},exportAs:["ngbNav"],features:[le]}),t})(),g_=(()=>{class t{constructor(t,e,n,i){this.role=t,this.navItem=e,this.nav=n,this.elRef=i}hasNavItemClass(){return this.navItem.elementRef.nativeElement.nodeType===Node.COMMENT_NODE}}return t.\u0275fac=function(e){return new(e||t)(qn("role"),Ro(p_),Ro(f_),Ro(za))},t.\u0275dir=Wt({type:t,selectors:[["a","ngbNavLink",""]],hostAttrs:["href",""],hostVars:14,hostBindings:function(t,e){1&t&&Vo("click",function(t){return e.nav.click(e.navItem),t.preventDefault()}),2&t&&(xa("id",e.navItem.domId),ko("role",e.role?e.role:e.nav.roles?"tab":void 0)("tabindex",e.navItem.disabled?-1:void 0)("aria-controls",e.navItem.isPanelInDom()?e.navItem.panelDomId:null)("aria-selected",e.navItem.active)("aria-disabled",e.navItem.disabled),ra("nav-link",!0)("nav-item",e.hasNavItemClass())("active",e.navItem.active)("disabled",e.navItem.disabled))}}),t})(),m_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),v_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();class y_{constructor(t,e){this.open=t,this.close=e,e||(this.close=t)}isManual(){return"manual"===this.open||"manual"===this.close}}const b_={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]},w_=t=>t>0?sx(t):t=>t;let x_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),__=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),C_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),S_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),E_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})(),k_=(()=>{class t{constructor(t){this.autoClose=!0,this.placement="auto",this.triggers="hover focus",this.disableTooltip=!1,this.openDelay=0,this.closeDelay=0,this.animation=t.animation}}return t.\u0275fac=function(e){return new(e||t)(bi(fx))},t.\u0275prov=lt({factory:function(){return new t(bi(fx))},token:t,providedIn:"root"}),t})(),A_=0,D_=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngb-tooltip-window"]],hostAttrs:["role","tooltip"],hostVars:5,hostBindings:function(t,e){2&t&&(xa("id",e.id),sa("tooltip"+(e.tooltipClass?" "+e.tooltipClass:"")),ra("fade",e.animation))},inputs:{animation:"animation",id:"id",tooltipClass:"tooltipClass"},ngContentSelectors:hx,decls:3,vars:0,consts:[[1,"arrow"],[1,"tooltip-inner"]],template:function(t,e){1&t&&(Go(),$o(0,"div",0),Mo(1,"div",1),qo(2),Io())},styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{bottom:.4rem;top:auto}"],encapsulation:2,changeDetection:0}),t})(),T_=(()=>{class t{constructor(t,e,n,i,r,s,o,a,l,c){this._elementRef=t,this._renderer=e,this._ngZone=o,this._document=a,this._changeDetector=l,this.shown=new Wl,this.hidden=new Wl,this._ngbTooltipWindowId="ngb-tooltip-"+A_++,this._windowRef=null,this.animation=s.animation,this.autoClose=s.autoClose,this.placement=s.placement,this.triggers=s.triggers,this.container=s.container,this.disableTooltip=s.disableTooltip,this.tooltipClass=s.tooltipClass,this.openDelay=s.openDelay,this.closeDelay=s.closeDelay,this._popupService=new Qx(D_,n,r,e,this._ngZone,i,c),this._zoneSubscription=o.onStable.subscribe(()=>{this._windowRef&&Ux(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-tooltip")})}set ngbTooltip(t){this._ngbTooltip=t,!t&&this._windowRef&&this.close()}get ngbTooltip(){return this._ngbTooltip}open(t){if(!this._windowRef&&this._ngbTooltip&&!this.disableTooltip){const{windowRef:e,transition$:n}=this._popupService.open(this._ngbTooltip,t,this.animation);this._windowRef=e,this._windowRef.instance.animation=this.animation,this._windowRef.instance.tooltipClass=this.tooltipClass,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),$x(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),n.subscribe(()=>this.shown.emit())}}close(){null!=this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(this.animation).subscribe(()=>{this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck()}))}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=function(t,e,n,i,r,s,o=0,a=0){const l=function(t,e=b_){const n=(t||"").trim();if(0===n.length)return[];const i=n.split(/\s+/).map(t=>t.split(":")).map(t=>{let n=e[t[0]]||t;return new y_(n[0],n[1])}),r=i.filter(t=>t.isManual());if(r.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===r.length&&i.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return i}(n);if(1===l.length&&l[0].isManual())return()=>{};const c=function(t,e,n,i){return new y(r=>{const s=[],o=()=>r.next(!0),a=()=>r.next(!1),l=()=>r.next(!i());return n.forEach(n=>{n.open===n.close?s.push(t.listen(e,n.open,l)):s.push(t.listen(e,n.open,o),t.listen(e,n.close,a))}),()=>{s.forEach(t=>t())}})}(t,e,l,i).pipe(function(t,e,n){return i=>{let r=null;const s=i.pipe(k(t=>({open:t})),Af(t=>{const e=n();return e===t.open||r&&r.open!==e?(r&&r.open!==t.open&&(r=null),!1):(r=t,!0)}),Z());return W(s.pipe(Af(t=>t.open),w_(t)),s.pipe(Af(t=>!t.open),w_(e))).pipe(Af(t=>t===r&&(r=null,t.open!==n())),k(t=>t.open))}}(o,a,i)).subscribe(t=>t?r():s());return()=>c.unsubscribe()}(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({tooltipClass:t}){t&&this.isOpen()&&(this._windowRef.instance.tooltipClass=t.currentValue)}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga),Ro(ho),Ro(Ua),Ro(El),Ro(k_),Ro(Ic),Ro(ph),Ro(pl),Ro(eh))},t.\u0275dir=Wt({type:t,selectors:[["","ngbTooltip",""]],inputs:{animation:"animation",autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disableTooltip:"disableTooltip",tooltipClass:"tooltipClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbTooltip:"ngbTooltip"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbTooltip"],features:[le]}),t})(),R_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)}}),t})();new Yn("live announcer delay",{providedIn:"root",factory:function(){return 100}});let F_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();const L_=[bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_];let M_=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[L_,bx,Cx,Dx,Tx,Rx,Vx,Xx,l_,m_,v_,x_,__,C_,S_,E_,R_,F_]}),t})(),I_=(()=>{class t{constructor(){this.restrictedPages=new Map([["users",cw.USER_ROLE_ADMIN],["config",cw.USER_ROLE_DEVELOPER],["modules",cw.USER_ROLE_DEVELOPER],["apiexplorer",cw.USER_ROLE_DEVELOPER]])}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function $_(t,e){if(1&t&&(Oo(0,5),Mo(1,"a",27),$o(2,"img",28),Mo(3,"span",12),va(4),Io(),Io(),Po()),2&t){const t=zo().$implicit;Fo("ngbNavItem",t.navItem),Qr(1),Fo("routerLink",t.routerLink),Qr(1),Xo("src","/static/svg/",t.icon,".svg",nr),Qr(2),ya(t.label)}}function O_(t,e){1&t&&$o(0,"hr")}function P_(t,e){if(1&t&&(Do(0,$_,5,4,"ng-container",26),Do(1,O_,1,0,"hr",25)),2&t){const t=e.$implicit;Fo("ngIf",zo().getSessionRole()<=t.minRole),Qr(1),Fo("ngIf",t.separator)}}function N_(t,e){if(1&t&&(Mo(0,"div",29),Mo(1,"h2",30),$o(2,"img",31),va(3,"An error has occurred!"),Io(),Mo(4,"h6",32),va(5),Io(),Mo(6,"p"),va(7,"Please refresh the page to try again."),Io(),Io()),2&t){const t=zo();Qr(5),ya(t.error)}}function B_(t,e){1&t&&(Mo(0,"div",33),$o(1,"img",34),Io())}function U_(t,e){1&t&&$o(0,"router-outlet")}const V_=function(){return["/"]},H_=function(){return["/login"]};let j_=(()=>{class t{constructor(t,e,n,i,r){var s;this.route=t,this.router=e,this.segment=n,this.consoleService=i,this.authService=r,this.loading=!0,this.error="",this.routes=[{navItem:"status",routerLink:["/status"],label:"Status",minRole:cw.USER_ROLE_READONLY,icon:"status"},{navItem:"users",routerLink:["/users"],label:"User Management",minRole:cw.USER_ROLE_ADMIN,icon:"user-management"},{navItem:"config",routerLink:["/config"],label:"Configuration",minRole:cw.USER_ROLE_DEVELOPER,icon:"configuration"},{navItem:"modules",routerLink:["/modules"],label:"Runtime Modules",minRole:cw.USER_ROLE_DEVELOPER,separator:!0,icon:"runtime-modules"},{navItem:"accounts",routerLink:["/accounts"],label:"Accounts",minRole:cw.USER_ROLE_READONLY,icon:"accounts"},{navItem:"groups",routerLink:["/groups"],label:"Groups",minRole:cw.USER_ROLE_READONLY,icon:"groups"},{navItem:"storage",routerLink:["/storage"],label:"Storage",minRole:cw.USER_ROLE_READONLY,icon:"storage"},{navItem:"leaderboards",routerLink:["/leaderboards"],label:"Leaderboards",minRole:cw.USER_ROLE_READONLY,icon:"leaderboard"},{navItem:"chat",routerLink:["/chat"],label:"Chat Messages",minRole:cw.USER_ROLE_READONLY,icon:"chat"},{navItem:"matches",routerLink:["/matches"],label:"Matches",minRole:cw.USER_ROLE_READONLY,icon:"running-matches"},{navItem:"apiexplorer",routerLink:["/apiexplorer"],label:"API Explorer",minRole:cw.USER_ROLE_DEVELOPER,icon:"api-explorer"}],this.loading=!1,this.routerSub=this.router.events.pipe(function(t){let e=arguments.length,n=Aw;E(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);let i=null;e>=2&&(i=arguments[1]);let r=Number.POSITIVE_INFINITY;return e>=3&&(r=arguments[2]),function(e){return e.lift(new Dw(t,i,r,n))}}(2e3)).subscribe(t=>{if(0===t.length)return;const e=t[t.length-1];e instanceof lg&&(this.loading=!0),e instanceof cg&&(this.loading=!1),e instanceof hg&&(this.loading=!1),e instanceof ug&&(this.loading=!1,this.error=e.error)}),this.segmentRouterSub=e.events.pipe((s=(t,e)=>!(e instanceof cg)||t.url===e.url,t=>t.lift(new Iw(s,undefined)))).subscribe(t=>{t&&n.page(t.url)})}ngOnInit(){this.route.data.subscribe(t=>{this.error=t.error?t.error:""})}getSessionRole(){return this.authService.sessionRole}getUsername(){return this.authService.username}logout(){this.authService.logout().subscribe(()=>{this.router.navigate(["/login"])})}ngOnDestroy(){this.segmentRouterSub.unsubscribe(),this.routerSub.unsubscribe()}onSidebarNavChange(t){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(Db),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:40,vars:11,consts:[[1,"container-fluid"],[1,"row"],["ngbNav","",1,"col-md-2","d-none","d-md-block","sidebar","position-fixed","px-0",3,"navChange"],["sidenav","ngbNav"],[1,"flex-column","text-uppercase"],[3,"ngbNavItem"],[3,"routerLink"],["src","/static/svg/logo.svg","alt","","width","175","height","",1,"logo-full","mx-3","mt-3","mb-1"],["src","/static/svg/logo-icon.svg","alt","","width","32","height","",1,"logo-icon","mx-3","mt-3","mb-1"],["ngFor","",3,"ngForOf"],["href","https://cloud.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/heroiccloud.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"link-text"],["href","https://heroiclabs.com/docs","target","_blank",1,"nav-link"],["src","/static/svg/docs.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://forum.heroiclabs.com","target","_blank",1,"nav-link"],["src","/static/svg/forum.svg","alt","","width","24","height","",1,"link-icon","mr-1"],["href","https://heroiclabs.com/blog","target","_blank",1,"nav-link"],["src","/static/svg/blog.svg","alt","","width","24","height","",1,"link-icon","mr-1"],[1,"logged-in-as","nav-link","disabled"],["ngbNavLink","","routerLinkActive","active",3,"routerLink","click"],["src","/static/svg/log-out.svg","alt","","width","24","height","",1,"mr-1"],["role","main",1,"ml-sm-auto","col-md-10","col-lg-10","main-extended","px-4","py-4"],["class","mx-auto",4,"ngIf"],["class","loading mx-auto",4,"ngIf"],[4,"ngIf"],[3,"ngbNavItem",4,"ngIf"],["ngbNavLink","","routerLinkActive","active",3,"routerLink"],["alt","","width","24","height","",1,"link-icon","mr-1",3,"src"],[1,"mx-auto"],[1,"pb-2"],["src","/static/svg/red-triangle.svg",1,"mr-2",2,"width","1em","height","1em"],[1,"mr-2","d-inline","font-weight-bold"],[1,"loading","mx-auto"],["src","/static/spinner.svg",1,"p-1","loading"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"nav",2,3),Vo("navChange",function(t){return e.onSidebarNavChange(t)}),Mo(4,"div",4),Oo(5,5),Mo(6,"a",6),$o(7,"img",7),$o(8,"img",8),Io(),Po(),$o(9,"hr"),Do(10,P_,2,2,"ng-template",9),$o(11,"hr"),Mo(12,"a",10),$o(13,"img",11),Mo(14,"span",12),va(15,"Heroic Cloud"),Io(),Io(),Mo(16,"a",13),$o(17,"img",14),Mo(18,"span",12),va(19,"Documentation"),Io(),Io(),Mo(20,"a",15),$o(21,"img",16),Mo(22,"span",12),va(23,"Forum"),Io(),Io(),Mo(24,"a",17),$o(25,"img",18),Mo(26,"span",12),va(27,"Heroic Labs Blog"),Io(),Io(),$o(28,"hr"),Mo(29,"div",19),va(30),Io(),Oo(31,5),Mo(32,"a",20),Vo("click",function(){return e.logout()}),$o(33,"img",21),Mo(34,"span",12),va(35,"Logout"),Io(),Io(),Po(),Io(),Io(),Mo(36,"main",22),Do(37,N_,8,1,"div",23),Do(38,B_,2,0,"div",24),Do(39,U_,1,0,"router-outlet",25),Io(),Io(),Io()),2&t&&(Qr(5),Fo("ngbNavItem","logo"),Qr(1),Fo("routerLink",Ul(9,V_)),Qr(4),Fo("ngForOf",e.routes),Qr(20),ba("Logged in as: ",e.getUsername(),""),Qr(1),Fo("ngbNavItem","logout"),Qr(1),Fo("routerLink",Ul(10,H_)),Qr(5),Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.error&&e.loading),Qr(1),Fo("ngIf",!e.error&&!e.loading))},directives:[f_,p_,Mv,Ph,g_,$v,Bh,Ov],styles:[".nav-link.no-active[_ngcontent-%COMP%]{background-color:initial!important}.nav-item[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-top-color:#708090}.sidebar[_ngcontent-%COMP%]{background-color:#333564;position:fixed;top:0;bottom:0;left:0;z-index:100;font-family:Montserrat,sans-serif;overflow-y:auto}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{color:#fff;font-size:12px;letter-spacing:.1em;opacity:.6;font-weight:500!important}.sidebar[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover{opacity:1;background-color:hsla(0,0%,88.2%,.1)}.sidebar[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-color:#fff;opacity:.2}.active[_ngcontent-%COMP%]{opacity:1}.nav-link.active[_ngcontent-%COMP%]{opacity:1;color:#a69bff}.navbar-collapse[_ngcontent-%COMP%]{letter-spacing:0;text-transform:capitalize}.logo-icon[_ngcontent-%COMP%]{display:none}.link-text[_ngcontent-%COMP%]{padding-left:4px}@media screen and (max-width:1200px){.main-extended[_ngcontent-%COMP%]{width:94.333333%!important;max-width:94.333333%!important;flex:0 0 94.333333%!important}.sidebar[_ngcontent-%COMP%]{min-width:65px!important;width:5.66%!important;max-width:5.66%!important}.sidebar[_ngcontent-%COMP%] .logo-full[_ngcontent-%COMP%]{display:none}.sidebar[_ngcontent-%COMP%] .logo-icon[_ngcontent-%COMP%]{display:block}.sidebar[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{width:30px}.sidebar[_ngcontent-%COMP%] .link-text[_ngcontent-%COMP%], .sidebar[_ngcontent-%COMP%] .logged-in-as[_ngcontent-%COMP%]{display:none}}"]}),t})(),z_=(()=>{class t{constructor(t,e,n){this.authService=t,this.router=e,this.globals=n}canActivate(t,e){return!0}canActivateChild(t,e){const n=this.globals.restrictedPages.get(t.url[0].path);return!(null!==n&&n{const e=t.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})},this._document=r}attachComponentPortal(t){const e=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component);let n;return t.viewContainerRef?(n=t.viewContainerRef.createComponent(e,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector),this.setDisposeFn(()=>n.destroy())):(n=e.create(t.injector||this._defaultInjector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(n)),n}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context);return n.rootNodes.forEach(t=>this.outletElement.appendChild(t)),n.detectChanges(),this.setDisposeFn(()=>{let t=e.indexOf(n);-1!==t&&e.remove(t)}),n}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}{}class Y_{constructor(t,e){this.dueTime=t,this.scheduler=e}call(t,e){return e.subscribe(new J_(t,this.dueTime,this.scheduler))}}class J_ extends f{constructor(t,e,n){super(t),this.dueTime=e,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Q_,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:t}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}}clearDebounce(){const t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)}}function Q_(t){t.debouncedNext()}function Z_(){}var tC=function(t){return null==t?Z_:function(){return this.querySelector(t)}};function eC(){return[]}var nC=function(t){return null==t?eC:function(){return this.querySelectorAll(t)}},iC=function(t){return function(){return this.matches(t)}},rC=function(t){return new Array(t.length)};function sC(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function oC(t,e,n,i,r,s){for(var o,a=0,l=e.length,c=s.length;ae?1:t>=e?0:NaN}sC.prototype={constructor:sC,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var cC="http://www.w3.org/1999/xhtml",hC={svg:"http://www.w3.org/2000/svg",xhtml:cC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},uC=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),hC.hasOwnProperty(e)?{space:hC[e],local:t}:t};function dC(t){return function(){this.removeAttribute(t)}}function pC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fC(t,e){return function(){this.setAttribute(t,e)}}function gC(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function mC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function vC(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var yC=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function bC(t){return function(){this.style.removeProperty(t)}}function wC(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xC(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function _C(t,e){return t.style.getPropertyValue(e)||yC(t).getComputedStyle(t,null).getPropertyValue(e)}function CC(t){return function(){delete this[t]}}function SC(t,e){return function(){this[t]=e}}function EC(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function kC(t){return t.trim().split(/^|\s+/)}function AC(t){return t.classList||new DC(t)}function DC(t){this._node=t,this._names=kC(t.getAttribute("class")||"")}function TC(t,e){for(var n=AC(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var zC=function(t){var e=uC(t);return(e.local?jC:HC)(e)};function WC(){return null}function GC(){var t=this.parentNode;t&&t.removeChild(this)}function qC(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function KC(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var XC={},YC=null;function JC(t,e,n){return t=QC(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function QC(t,e,n){return function(i){var r=YC;YC=i;try{t.call(this,this.__data__,e,n)}finally{YC=r}}}function ZC(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function tS(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i=x&&(x=w+1);!(b=v[x])&&++x=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=lC);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s1?this.each((null==e?bC:"function"==typeof e?xC:wC)(t,e,null==n?"":n)):_C(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?CC:"function"==typeof e?EC:SC)(t,e)):this.node()[t]},classed:function(t,e){var n=kC(t+"");if(arguments.length<2){for(var i=AC(this.node()),r=-1,s=n.length;++r=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function fS(t,e){for(var n,i=0,r=t.length;i0)for(var n,i,r=new Array(n),s=0;s>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?US(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?US(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=TS.exec(t))?new jS(e[1],e[2],e[3],1):(e=RS.exec(t))?new jS(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=FS.exec(t))?US(e[1],e[2],e[3],e[4]):(e=LS.exec(t))?US(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=MS.exec(t))?qS(e[1],e[2]/100,e[3]/100,1):(e=IS.exec(t))?qS(e[1],e[2]/100,e[3]/100,e[4]):$S.hasOwnProperty(t)?BS($S[t]):"transparent"===t?new jS(NaN,NaN,NaN,0):null}function BS(t){return new jS(t>>16&255,t>>8&255,255&t,1)}function US(t,e,n,i){return i<=0&&(t=e=n=NaN),new jS(t,e,n,i)}function VS(t){return t instanceof _S||(t=NS(t)),t?new jS((t=t.rgb()).r,t.g,t.b,t.opacity):new jS}function HS(t,e,n,i){return 1===arguments.length?VS(t):new jS(t,e,n,null==i?1:i)}function jS(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function zS(){return"#"+GS(this.r)+GS(this.g)+GS(this.b)}function WS(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function GS(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function qS(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new XS(t,e,n,i)}function KS(t){if(t instanceof XS)return new XS(t.h,t.s,t.l,t.opacity);if(t instanceof _S||(t=NS(t)),!t)return new XS;if(t instanceof XS)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n0&&l<1?0:o,new XS(o,a,l,t.opacity)}function XS(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function YS(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function JS(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}wS(_S,NS,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:OS,formatHex:OS,formatHsl:function(){return KS(this).formatHsl()},formatRgb:PS,toString:PS}),wS(jS,HS,xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new jS(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zS,formatHex:zS,formatRgb:WS,toString:WS})),wS(XS,function(t,e,n,i){return 1===arguments.length?KS(t):new XS(t,e,n,null==i?1:i)},xS(_S,{brighter:function(t){return t=null==t?SS:Math.pow(SS,t),new XS(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?CS:Math.pow(CS,t),new XS(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new jS(YS(t>=240?t-240:t+120,r,i),YS(t,r,i),YS(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var QS=function(t){return function(){return t}};function ZS(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):QS(isNaN(t)?e:t)}var tE=function t(e){var n=function(t){return 1==(t=+t)?ZS:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):QS(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=HS(t)).r,(e=HS(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),o=ZS(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function eE(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1];return JS((n-i/e)*e,i>0?t[i-1]:2*r-s,r,s,is&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:aE(n,i)})),s=hE.lastIndex;return s=0&&e._call.call(null,t),e=e._next;--mE}()}finally{mE=0,function(){for(var t,e,n=rE,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:rE=e);sE=t,RE(i)}(),wE=0}}function TE(){var t=_E.now(),e=t-bE;e>1e3&&(xE-=e,bE=t)}function RE(t){mE||(vE&&(vE=clearTimeout(vE)),t-wE>24?(t<1/0&&(vE=setTimeout(DE,t-_E.now()-xE)),yE&&(yE=clearInterval(yE))):(yE||(bE=_E.now(),yE=setInterval(TE,1e3)),mE=1,CE(DE)))}kE.prototype=AE.prototype={constructor:kE,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?SE():+n)+(null==e?0:+e),this._next||sE===this||(sE?sE._next=this:rE=this,sE=this),this._call=t,this._time=n,RE()},stop:function(){this._call&&(this._call=null,this._time=1/0,RE())}};var FE=function(t,e,n){var i=new kE;return i.restart(function(n){i.stop(),t(n+e)},e=null==e?0:+e,n),i},LE=mS("start","end","cancel","interrupt"),ME=[],IE=function(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(l){var c,h,u,d;if(1!==n.state)return a();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return FE(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c0)throw new Error("too late; already scheduled");return n}function OE(t,e){var n=PE(t,e);if(n.state>3)throw new Error("too late; already running");return n}function PE(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var NE,BE,UE,VE,HE=function(t,e){var n,i,r,s=t.__transition,o=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}},jE=180/Math.PI,zE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},WE=function(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:aE(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:aE(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:aE(t,n)},{i:a-2,x:aE(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?$E:OE;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var gk=lS.prototype.constructor;function mk(t){return function(){this.style.removeProperty(t)}}function vk(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function yk(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&vk(t,s,n)),i}return s._value=e,s}function bk(t){return function(e){this.textContent=t.call(this,e)}}function wk(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&bk(i)),e}return i._value=t,i}var xk=0;function _k(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ck(){return++xk}var Sk=lS.prototype;_k.prototype=(function(t){return lS().transition(t)}).prototype={constructor:_k,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=tC(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;oe?1:t>=e?0:NaN},Qk=function(t){let e=t,n=t;function i(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)<0?i=s+1:r=s}return i}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Jk(t(e),n)}(t)),{left:i,center:function(t,n,r,s){null==r&&(r=0),null==s&&(s=t.length);const o=i(t,n,r,s-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i>>1;n(t[s],e)>0?r=s:i=s+1}return i}}},Zk=Math.sqrt(50),tA=Math.sqrt(10),eA=Math.sqrt(2);function nA(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=Zk?10:s>=tA?5:s>=eA?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=Zk?10:s>=tA?5:s>=eA?2:1)}function iA(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=Zk?r*=10:s>=tA?r*=5:s>=eA&&(r*=2),e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return rA.setTime(+e),sA.setTime(+i),t(rA),t(sA),Math.floor(n(rA,sA))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var aA=oA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});aA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?oA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var lA=aA,cA=oA(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),hA=1e3,uA=6e4,dA=36e5;function pA(t){return oA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/6048e5})}var fA=pA(0),gA=(pA(1),pA(2),pA(3),pA(4),pA(5),pA(6),oA(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*uA)/864e5,t=>t.getDate()-1)),mA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA-t.getMinutes()*uA)},function(t,e){t.setTime(+t+e*dA)},function(t,e){return(e-t)/dA},function(t){return t.getHours()}),vA=oA(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hA)},function(t,e){t.setTime(+t+e*uA)},function(t,e){return(e-t)/uA},function(t){return t.getMinutes()}),yA=oA(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*hA)},function(t,e){return(e-t)/hA},function(t){return t.getUTCSeconds()}),bA=oA(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});bA.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?oA(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):bA:null};var wA=bA,xA=new Date,_A=new Date;function CA(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return xA.setTime(+e),_A.setTime(+i),t(xA),t(_A),Math.floor(n(xA,_A))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var SA=864e5,EA=6048e5;function kA(t){return CA(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/EA})}var AA=kA(0),DA=kA(1),TA=(kA(2),kA(3),kA(4)),RA=(kA(5),kA(6),CA(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/SA},function(t){return t.getUTCDate()-1}));function FA(t){return CA(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/EA})}var LA=FA(0),MA=FA(1),IA=(FA(2),FA(3),FA(4)),$A=(FA(5),FA(6),CA(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/SA},function(t){return t.getDate()-1})),OA=CA(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});OA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var PA=OA,NA=CA(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});NA.every=function(t){return isFinite(t=Math.floor(t))&&t>0?CA(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var BA=NA;function UA(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function VA(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function HA(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var jA,zA,WA={"-":"",_:" ",0:"0"},GA=/^\s*\d+/,qA=/^%/,KA=/[\\^$*+?|[\]().{}]/g;function XA(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s68?1900:2e3),n+i[0].length):-1}function oD(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function aD(t,e,n){var i=GA.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function lD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function cD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function hD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function uD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function dD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function pD(t,e,n){var i=GA.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function fD(t,e,n){var i=GA.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function gD(t,e,n){var i=GA.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function mD(t,e,n){var i=qA.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function vD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function yD(t,e,n){var i=GA.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function bD(t,e){return XA(t.getDate(),e,2)}function wD(t,e){return XA(t.getHours(),e,2)}function xD(t,e){return XA(t.getHours()%12||12,e,2)}function _D(t,e){return XA(1+$A.count(PA(t),t),e,3)}function CD(t,e){return XA(t.getMilliseconds(),e,3)}function SD(t,e){return CD(t,e)+"000"}function ED(t,e){return XA(t.getMonth()+1,e,2)}function kD(t,e){return XA(t.getMinutes(),e,2)}function AD(t,e){return XA(t.getSeconds(),e,2)}function DD(t){var e=t.getDay();return 0===e?7:e}function TD(t,e){return XA(LA.count(PA(t)-1,t),e,2)}function RD(t){var e=t.getDay();return e>=4||0===e?IA(t):IA.ceil(t)}function FD(t,e){return t=RD(t),XA(IA.count(PA(t),t)+(4===PA(t).getDay()),e,2)}function LD(t){return t.getDay()}function MD(t,e){return XA(MA.count(PA(t)-1,t),e,2)}function ID(t,e){return XA(t.getFullYear()%100,e,2)}function $D(t,e){return XA((t=RD(t)).getFullYear()%100,e,2)}function OD(t,e){return XA(t.getFullYear()%1e4,e,4)}function PD(t,e){var n=t.getDay();return XA((t=n>=4||0===n?IA(t):IA.ceil(t)).getFullYear()%1e4,e,4)}function ND(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+XA(e/60|0,"0",2)+XA(e%60,"0",2)}function BD(t,e){return XA(t.getUTCDate(),e,2)}function UD(t,e){return XA(t.getUTCHours(),e,2)}function VD(t,e){return XA(t.getUTCHours()%12||12,e,2)}function HD(t,e){return XA(1+RA.count(BA(t),t),e,3)}function jD(t,e){return XA(t.getUTCMilliseconds(),e,3)}function zD(t,e){return jD(t,e)+"000"}function WD(t,e){return XA(t.getUTCMonth()+1,e,2)}function GD(t,e){return XA(t.getUTCMinutes(),e,2)}function qD(t,e){return XA(t.getUTCSeconds(),e,2)}function KD(t){var e=t.getUTCDay();return 0===e?7:e}function XD(t,e){return XA(AA.count(BA(t)-1,t),e,2)}function YD(t){var e=t.getUTCDay();return e>=4||0===e?TA(t):TA.ceil(t)}function JD(t,e){return t=YD(t),XA(TA.count(BA(t),t)+(4===BA(t).getUTCDay()),e,2)}function QD(t){return t.getUTCDay()}function ZD(t,e){return XA(DA.count(BA(t)-1,t),e,2)}function tT(t,e){return XA(t.getUTCFullYear()%100,e,2)}function eT(t,e){return XA((t=YD(t)).getUTCFullYear()%100,e,2)}function nT(t,e){return XA(t.getUTCFullYear()%1e4,e,4)}function iT(t,e){var n=t.getUTCDay();return XA((t=n>=4||0===n?TA(t):TA.ceil(t)).getUTCFullYear()%1e4,e,4)}function rT(){return"+0000"}function sT(){return"%"}function oT(t){return+t}function aT(t){return Math.floor(+t/1e3)}jA=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,c=JA(r),h=QA(r),u=JA(s),d=QA(s),p=JA(o),f=QA(o),g=JA(a),m=QA(a),v=JA(l),y=QA(l),b={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:bD,e:bD,f:SD,g:$D,G:PD,H:wD,I:xD,j:_D,L:CD,m:ED,M:kD,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:oT,s:aT,S:AD,u:DD,U:TD,V:FD,w:LD,W:MD,x:null,X:null,y:ID,Y:OD,Z:ND,"%":sT},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:BD,e:BD,f:zD,g:eT,G:iT,H:UD,I:VD,j:HD,L:jD,m:WD,M:GD,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:oT,s:aT,S:qD,u:KD,U:XD,V:JD,w:QD,W:ZD,x:null,X:null,y:tT,Y:nT,Z:rT,"%":sT},x={a:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y[i[0].toLowerCase()],n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m[i[0].toLowerCase()],n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:cD,e:cD,f:gD,g:sD,G:rD,H:uD,I:uD,j:hD,L:fD,m:lD,M:dD,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=h[i[0].toLowerCase()],n+i[0].length):-1},q:aD,Q:vD,s:yD,S:pD,u:tD,U:eD,V:nD,w:ZA,W:iD,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:sD,Y:rD,Z:oD,"%":mD};function _(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=VA(HA(s.y,0,1))).getUTCDay(),i=r>4||0===r?DA.ceil(i):DA(i),i=RA.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=UA(HA(s.y,0,1))).getDay(),i=r>4||0===r?MA.ceil(i):MA(i),i=$A.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?VA(HA(s.y,0,1)).getUTCDay():UA(HA(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,VA(s)):UA(s)}}function S(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=x[r in WA?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=_(n,b),b.X=_(i,b),b.c=_(e,b),w.x=_(n,w),w.X=_(i,w),w.c=_(e,w),{format:function(t){var e=_(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=C(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=_(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=C(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),zA=jA.format;var lT=function(t){return null===t?NaN:+t};const cT=Qk(Jk).right;Qk(lT);var hT=cT,uT=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function dT(t){return+t}var pT=[0,1];function fT(t){return t}function gT(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function mT(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r(e=o[l-1])&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),i=l>2?vT:mT,r=s=null,u}function u(e){return isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(c(e)))}return u.invert=function(n){return c(e((s||(s=i(a,o.map(t),aE)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,dT),h()):o.slice()},u.range=function(t){return arguments.length?(a=Array.from(t),h()):a.slice()},u.rangeRound=function(t){return a=Array.from(t),l=uT,h()},u.clamp=function(t){return arguments.length?(c=!!t||fT,h()):c!==fT},u.interpolate=function(t){return arguments.length?(l=t,h()):l},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,i){return t=n,e=i,h()}}()(fT,fT)}function wT(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var xT=31536e6;function _T(t){return new Date(t)}function CT(t){return t instanceof Date?+t:+new Date(+t)}function ST(t,e,n,i,r,s,o,a,l){var c=bT(),h=c.invert,u=c.domain,d=l(".%L"),p=l(":%S"),f=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),v=l("%b %d"),y=l("%B"),b=l("%Y"),w=[[o,1,1e3],[o,5,5e3],[o,15,15e3],[o,30,3e4],[s,1,6e4],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,xT]];function x(a){return(o(a)=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AT(t){if(!(e=kT.exec(t)))throw new Error("invalid format: "+t);var e;return new DT({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function DT(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function TT(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}AT.prototype=DT.prototype,DT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var RT,FT,LT,MT,IT=function(t){return(t=TT(Math.abs(t)))?t[1]:NaN},$T=function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")},OT={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return $T(100*t,e)},r:$T,s:function(t,e){var n=TT(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(RT=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+TT(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},PT=function(t){return t},NT=Array.prototype.map,BT=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function UT(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),s=new Array(r=Math.ceil(e-t+1));++a0;){if((r=nA(l,c,n))===i)return s[o]=l,s[a]=c,e(s);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function VT(){var t=bT();return t.copy=function(){return yT(t,VT())},wT.apply(t,arguments),UT(t)}FT=function(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?PT:(e=NT.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?PT:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(NT.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=AT(t)).fill,n=t.align,u=t.sign,d=t.symbol,p=t.zero,f=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):OT[y]||(void 0===m&&(m=12),v=!0,y="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?s:/[%p]/.test(y)?l:"",x=OT[y],_=/[defgprs%]/.test(y);function C(t){var r,s,l,d=b,C=w;if("c"===y)C=x(t)+C,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==u&&(S=!1),d=(S?"("===u?u:c:"-"===u||"("===u?"":u)+d,C=("s"===y?BT[8+RT/3]:"")+C+(S&&"("===u?")":""),_)for(r=-1,s=t.length;++r(l=t.charCodeAt(r))||l>57){C=(46===l?o+t.slice(r+1):t.slice(r))+C,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var E=d.length+t.length+C.length,k=E>1)+d+t+C+k.slice(E);break;default:t=k+d+t+C}return a(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),C.toString=function(){return t+""},C}return{format:u,formatPrefix:function(t,e){var n=u(((t=AT(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(IT(e)/3))),r=Math.pow(10,-i),s=BT[8+i/3];return function(t){return n(r*t)+s}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),LT=FT.format,MT=FT.formatPrefix;var HT=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,s=Math.floor(r),o=+n(t[s],s,t);return o+(+n(t[s+1],s+1,t)-o)*(r-s)}}function XT(){var t,e=[],n=[],i=[];function r(){var t=0,r=Math.max(1,n.length);for(i=new Array(r-1);++t0?i[r-1]:e[0],rtR)if(Math.abs(h*a-l*c)>tR&&r){var d=n-s,p=i-o,f=a*a+l*l,g=d*d+p*p,m=Math.sqrt(f),v=Math.sqrt(u),y=r*Math.tan((QT-Math.acos((f+u-g)/(2*m*v)))/2),b=y/v,w=y/m;Math.abs(b-1)>tR&&(this._+="L"+(t+b*c)+","+(e+b*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>c*p)+","+(this._x1=t+w*a)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,c=e+a,h=1^s,u=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>tR||Math.abs(this._y1-c)>tR)&&(this._+="L"+l+","+c),n&&(u<0&&(u=u%ZT+ZT),u>eR?this._+="A"+n+","+n+",0,1,"+h+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>tR&&(this._+="A"+n+","+n+",0,"+ +(u>=QT)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var rR=iR,sR=function(t){return function(){return t}};function oR(t){return t[0]}function aR(t){return t[1]}var lR=function(){var t=oR,e=aR,n=sR(!0),i=null,r=JT,s=null;function o(o){var a,l,c,h=o.length,u=!1;for(null==i&&(s=r(c=rR())),a=0;a<=h;++a)!(a=h;--u)a.point(m[u],v[u]);a.lineEnd(),a.areaEnd()}g&&(m[c]=+t(d,c,l),v[c]=+n(d,c,l),a.point(e?+e(d,c,l):m[c],i?+i(d,c,l):v[c]))}if(p)return a=null,p+""||null}function c(){return lR().defined(r).curve(o).context(s)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:sR(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:sR(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:sR(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:sR(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:sR(+t),l):i},l.lineX0=l.lineY0=function(){return c().x(t).y(n)},l.lineY1=function(){return c().x(t).y(i)},l.lineX1=function(){return c().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:sR(!!t),l):r},l.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),l):o},l.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),l):s},l},hR=function(){};function uR(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function dR(t,e){this._context=t,this._k=(1-e)/6}function pR(t,e){this._context=t,this._k=(1-e)/6}function fR(t){this._curve=t}dR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:uR(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new dR(t,e)}return n.tension=function(e){return t(+e)},n}(0),pR.prototype={areaStart:hR,areaEnd:hR,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:uR(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new pR(t,e)}return n.tension=function(e){return t(+e)},n}(0),fR.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Math,Math,Math,Math,Math,Math,Math,Math;var gR=function(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(i-e)/t.value;++a=0;)e+=n[i].value;else e=1;t.value=e}function yR(t,e){var n,i,r,s,o,a=new _R(t),l=+t.value&&(a.value=t.value),c=[a];for(null==e&&(e=bR);n=c.pop();)if(l&&(n.value=+n.data.value),(r=e(n.data))&&(o=r.length))for(n.children=new Array(o),s=o-1;s>=0;--s)c.push(i=n.children[s]=new _R(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(xR)}function bR(t){return t.children}function wR(t){t.data=t.data.data}function xR(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _R(t){this.data=t,this.depth=this.height=0,this.parent=null}!function t(e){function n(t,n,i,r,s){!function(t,e,n,i,r,s){for(var o,a,l,c,h,u,d,p,f,g,m,v=[],y=e.children,b=0,w=0,x=y.length,_=e.value;bd&&(d=a),m=h*h*g,(p=Math.max(d/m,m/u))>f){h-=a;break}f=p}v.push(o={value:h,dice:l1?e:1)},n}((1+Math.sqrt(5))/2),_R.prototype=yR.prototype={constructor:_R,count:function(){return this.eachAfter(vR)},each:function(t){var e,n,i,r,s=this,o=[s];do{for(e=o.reverse(),o=[];s=e.pop();)if(t(s),n=s.children)for(i=0,r=n.length;i=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)i.push(e=e.parent);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return yR(this).eachBefore(wR)}};const CR=["caretElm"];function SR(t,e){}const ER=function(t){return{model:t}};function kR(t,e){if(1&t&&(Mo(0,"span"),Do(1,SR,0,0,"ng-template",5),Io()),2&t){const t=zo();Qr(1),Fo("ngTemplateOutlet",t.template)("ngTemplateOutletContext",Vl(2,ER,t.context))}}function AR(t,e){1&t&&$o(0,"span",6),2&t&&Fo("innerHTML",zo().title,er)}function DR(t,e){if(1&t&&(ln(),cn(),$o(0,"ngx-charts-scale-legend",4)),2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("valueRange",t.legendOptions.domain)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)}}function TR(t,e){if(1&t){const t=No();ln(),cn(),Mo(0,"ngx-charts-legend",5),Vo("labelClick",function(e){return Ie(t),zo().legendLabelClick.emit(e)})("labelActivate",function(e){return Ie(t),zo().legendLabelActivate.emit(e)})("labelDeactivate",function(e){return Ie(t),zo().legendLabelDeactivate.emit(e)}),Io()}if(2&t){const t=zo();Fo("horizontal",t.legendOptions&&"below"===t.legendOptions.position)("data",t.legendOptions.domain)("title",t.legendOptions.title)("colors",t.legendOptions.colors)("height",t.view[1])("width",t.legendWidth)("activeEntries",t.activeEntries)}}const RR=["*"],FR=["ngx-charts-axis-label",""],LR=["ticksel"],MR=["ngx-charts-x-axis-ticks",""];function IR(t,e){if(1&t&&(ln(),Mo(0,"g",3),Mo(1,"title"),va(2),Io(),Mo(3,"text",4),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("text-anchor",n.textAnchor)("transform",n.textTransform),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function $R(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",6),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),ko("y1",-t.gridLineHeight)}}function OR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,$R,2,2,"g",5),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.tickTransform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}const PR=["ngx-charts-x-axis",""];function NR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksHeight(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("rotateTicks",t.rotateTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickStroke",t.tickStroke)("scale",t.xScale)("orient",t.xOrient)("showGridLines",t.showGridLines)("gridLineHeight",t.dims.height)("width",t.dims.width)("tickValues",t.ticks)}}function BR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient","bottom")("height",t.dims.height)("width",t.dims.width)}}const UR=["ngx-charts-y-axis-ticks",""];function VR(t,e){if(1&t&&(ln(),Mo(0,"g",4),Mo(1,"title"),va(2),Io(),Mo(3,"text",5),va(4),Io(),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(2),ya(n.tickFormat(t)),Qr(1),ia("font-size","12px"),ko("dy",n.dy)("x",n.x1)("y",n.y1)("text-anchor",n.textAnchor),Qr(1),ba(" ",n.tickTrim(n.tickFormat(t))," ")}}function HR(t,e){if(1&t&&(ln(),$o(0,"path",6)),2&t){const t=zo();ko("d",t.referenceAreaPath)("transform",t.gridLineTransform())}}function jR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",zo(3).gridLineWidth)}function zR(t,e){1&t&&(ln(),$o(0,"line",9)),2&t&&ko("x2",-zo(3).gridLineWidth)}function WR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,jR,1,1,"line",8),Do(2,zR,1,1,"line",8),Io()),2&t){const t=zo(2);ko("transform",t.gridLineTransform()),Qr(1),Fo("ngIf","left"===t.orient),Qr(1),Fo("ngIf","right"===t.orient)}}function GR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,WR,3,3,"g",7),Io()),2&t){const t=e.$implicit,n=zo();ko("transform",n.transform(t)),Qr(1),Fo("ngIf",n.showGridLines)}}function qR(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"title"),va(2),Io(),Mo(3,"text",11),va(4),Io(),Io()),2&t){const t=zo(2).$implicit,e=zo();Qr(2),ya(e.tickTrim(e.tickFormat(t.value))),Qr(1),ko("dy",e.dy)("y",-6)("x",e.gridLineWidth)("text-anchor",e.textAnchor),Qr(1),ba(" ",t.name," ")}}function KR(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"line",10),Do(2,qR,5,6,"g",7),Io()),2&t){const t=zo().$implicit,e=zo();ko("transform",e.transform(t.value)),Qr(1),ko("x2",e.gridLineWidth)("transform",e.gridLineTransform()),Qr(1),Fo("ngIf",e.showRefLabels)}}function XR(t,e){if(1&t&&(ln(),Mo(0,"g"),Do(1,KR,3,4,"g",7),Io()),2&t){const t=zo();Qr(1),Fo("ngIf",t.showRefLines)}}const YR=["ngx-charts-y-axis",""];function JR(t,e){if(1&t){const t=No();ln(),Mo(0,"g",2),Vo("dimensionsChanged",function(e){return Ie(t),zo().emitTicksWidth(e)}),Io()}if(2&t){const t=zo();Fo("trimTicks",t.trimTicks)("maxTickLength",t.maxTickLength)("tickFormatting",t.tickFormatting)("tickArguments",t.tickArguments)("tickValues",t.ticks)("tickStroke",t.tickStroke)("scale",t.yScale)("orient",t.yOrient)("showGridLines",t.showGridLines)("gridLineWidth",t.dims.width)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)("height",t.dims.height)}}function QR(t,e){if(1&t&&(ln(),$o(0,"g",3)),2&t){const t=zo();Fo("label",t.labelText)("offset",t.labelOffset)("orient",t.yOrient)("height",t.dims.height)("width",t.dims.width)}}const ZR=["ngx-charts-circle-series",""];function tF(t,e){if(1&t&&(ln(),$o(0,"rect",4)),2&t){const t=zo(2);Fo("@animationState","active"),ko("x",t.circle.cx-t.circle.radius)("y",t.circle.cy)("width",2*t.circle.radius)("height",t.circle.height)("fill",t.gradientFill)}}const eF=function(t){return{name:t}};function nF(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"defs"),$o(2,"g",1),Io(),Do(3,tF,1,6,"rect",2),Mo(4,"g",3),Vo("select",function(){Ie(t);const e=zo();return e.onClick(e.circle.data)})("activate",function(){return Ie(t),zo().activateCircle()})("deactivate",function(){return Ie(t),zo().deactivateCircle()}),Io(),Io()}if(2&t){const t=zo();Qr(2),Fo("name",t.gradientId)("stops",t.circle.gradientStops),Qr(1),Fo("ngIf",t.barVisible&&"standard"===t.type),Qr(1),ra("active",t.isActive(Vl(18,eF,t.circle.seriesName))),Fo("cx",t.circle.cx)("cy",t.circle.cy)("r",t.circle.radius)("fill",t.circle.color)("pointerEvents",0===t.circle.value?"none":"all")("data",t.circle.value)("classNames",t.circle.classNames)("tooltipDisabled",t.tooltipDisabled)("tooltipPlacement","top")("tooltipType","tooltip")("tooltipTitle",t.tooltipTemplate?void 0:t.getTooltipText(t.circle))("tooltipTemplate",t.tooltipTemplate)("tooltipContext",t.circle.data)}}const iF=["ngx-charts-circle",""],rF=["ngx-charts-svg-linear-gradient",""];function sF(t,e){if(1&t&&(ln(),$o(0,"stop")),2&t){const t=e.$implicit;ia("stop-color",t.color)("stop-opacity",t.opacity),ko("offset",t.offset+"%")}}const oF=["ngx-charts-area",""];function aF(t,e){if(1&t&&(ln(),Mo(0,"defs"),$o(1,"g",2),Io()),2&t){const t=zo();Qr(1),Fo("name",t.gradientId)("stops",t.gradientStops)}}const lF=["tooltipAnchor"],cF=["ngx-charts-tooltip-area",""];function hF(t,e){if(1&t&&(Mo(0,"div",6),$o(1,"span",7),va(2),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),ia("background-color",t.color),Qr(1),ba(" ",n.getToolTipText(t)," ")}}function uF(t,e){if(1&t&&(ln(),cn(),Mo(0,"div",4),Do(1,hF,3,3,"div",5),Io()),2&t){const t=e.model;Qr(1),Fo("ngForOf",t)}}const dF=["ngx-charts-timeline",""];function pF(t,e){if(1&t&&(Mo(0,"header",4),Mo(1,"span",5),va(2),Io(),Io()),2&t){const t=zo();Qr(2),ya(t.title)}}function fF(t,e){if(1&t){const t=No();Mo(0,"li",6),Mo(1,"ngx-charts-legend-entry",7),Vo("select",function(e){return Ie(t),zo().labelClick.emit(e)})("activate",function(e){return Ie(t),zo().activate(e)})("deactivate",function(e){return Ie(t),zo().deactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(1),Fo("label",t.label)("formattedLabel",t.formattedLabel)("color",t.color)("isActive",n.isActive(t))}}const gF=["tooltipTemplate"],mF=["seriesTooltipTemplate"],vF=function(t,e){return[t,e]},yF=["ngx-charts-line",""];function bF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",7),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateXAxisHeight(e)}),Io()}if(2&t){const t=zo();Fo("xScale",t.xScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showXAxisLabel)("labelText",t.xAxisLabel)("trimTicks",t.trimXAxisTicks)("rotateTicks",t.rotateXAxisTicks)("maxTickLength",t.maxXAxisTickLength)("tickFormatting",t.xAxisTickFormatting)("ticks",t.xAxisTicks)}}function wF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",8),Vo("dimensionsChanged",function(e){return Ie(t),zo().updateYAxisWidth(e)}),Io()}if(2&t){const t=zo();Fo("yScale",t.yScale)("dims",t.dims)("showGridLines",t.showGridLines)("showLabel",t.showYAxisLabel)("labelText",t.yAxisLabel)("trimTicks",t.trimYAxisTicks)("maxTickLength",t.maxYAxisTickLength)("tickFormatting",t.yAxisTickFormatting)("ticks",t.yAxisTicks)("referenceLines",t.referenceLines)("showRefLines",t.showRefLines)("showRefLabels",t.showRefLabels)}}function xF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",9),Io()),2&t){const t=e.$implicit,n=zo();Fo("@animationState","active"),Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("activeEntries",n.activeEntries)("scaleType",n.scaleType)("curve",n.curve)("rangeFillOpacity",n.rangeFillOpacity)("hasRange",n.hasRange)("animations",n.animations)}}function _F(t,e){if(1&t){const t=No();ln(),Mo(0,"g"),Mo(1,"g",13),Vo("select",function(e){return Ie(t),zo(2).onClick(e)})("activate",function(e){return Ie(t),zo(2).onActivate(e)})("deactivate",function(e){return Ie(t),zo(2).onDeactivate(e)}),Io(),Io()}if(2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.xScale)("yScale",n.yScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("visibleValue",n.hoveredVertical)("activeEntries",n.activeEntries)("tooltipDisabled",n.tooltipDisabled)("tooltipTemplate",n.tooltipTemplate)}}function CF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",10),Vo("mouseleave",function(){return Ie(t),zo().hideCircles()}),Mo(1,"g",11),Vo("hover",function(e){return Ie(t),zo().updateHoveredVertical(e)}),Io(),Do(2,_F,2,9,"g",12),Io()}if(2&t){const t=zo();Qr(1),Fo("dims",t.dims)("xSet",t.xSet)("xScale",t.xScale)("yScale",t.yScale)("results",t.results)("colors",t.colors)("tooltipDisabled",t.tooltipDisabled)("tooltipTemplate",t.seriesTooltipTemplate),Qr(1),Fo("ngForOf",t.results)}}function SF(t,e){if(1&t&&(ln(),Mo(0,"g"),$o(1,"g",15),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(1),Fo("xScale",n.timelineXScale)("yScale",n.timelineYScale)("colors",n.colors)("data",t)("scaleType",n.scaleType)("curve",n.curve)("hasRange",n.hasRange)("animations",n.animations)}}function EF(t,e){if(1&t){const t=No();ln(),Mo(0,"g",14),Vo("onDomainChange",function(e){return Ie(t),zo().updateDomain(e)}),Do(1,SF,2,8,"g",4),Io()}if(2&t){const t=zo();Fo("results",t.results)("view",Hl(10,vF,t.timelineWidth,t.height))("height",t.timelineHeight)("scheme",t.scheme)("customColors",t.customColors)("scaleType",t.scaleType)("legend",t.legend),ko("transform",t.timelineTransform),Qr(1),Fo("ngForOf",t.results)("ngForTrackBy",t.trackBy)}}const kF=["ngx-charts-line-series",""];function AF(t,e){if(1&t&&(ln(),$o(0,"g",4)),2&t){const t=zo();Fo("name",t.gradientId)("stops",t.gradientStops)}}function DF(t,e){if(1&t&&(ln(),$o(0,"g",5)),2&t){const t=zo();ra("active",t.isActive(t.data))("inactive",t.isInactive(t.data)),Fo("data",t.data)("path",t.outerPath)("fill",t.hasGradient?t.gradientUrl:t.colors.getColor(t.data.name))("opacity",t.rangeFillOpacity)("animations",t.animations)}}let TF=(()=>{class t{constructor(t,e,n){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n}static setGlobalRootViewContainer(e){t.globalRootViewContainer=e}getRootViewContainer(){if(this._container)return this._container;if(t.globalRootViewContainer)return t.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(t){this._container=t}getComponentRootNode(t){return t.element?t.element.nativeElement:t.hostView&&t.hostView.rootNodes.length>0?t.hostView.rootNodes[0]:t.location.nativeElement}getRootViewContainerNode(t){return this.getComponentRootNode(t)}projectComponentBindings(t,e){if(e){if(void 0!==e.inputs){const n=Object.getOwnPropertyNames(e.inputs);for(const i of n)t.instance[i]=e.inputs[i]}if(void 0!==e.outputs){const n=Object.getOwnPropertyNames(e.outputs);for(const i of n)t.instance[i]=e.outputs[i]}}return t}appendComponent(t,e={},n){n||(n=this.getRootViewContainer());const i=this.getComponentRootNode(n),r=new X_(i,this.componentFactoryResolver,this.applicationRef,this.injector),s=new G_(t),o=r.attach(s);return this.projectComponentBindings(o,e),o}}return t.\u0275fac=function(e){return new(e||t)(bi(eh),bi(Ua),bi(ho))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t.globalRootViewContainer=null,t})();function RF(t,e,n){let i,r,s;n=n||{};let o=null,a=0;function l(){a=!1===n.leading?0:+new Date,o=null,s=t.apply(i,r)}return function(){const c=+new Date;a||!1!==n.leading||(a=c);const h=e-(c-a);return i=this,r=arguments,h<=0?(clearTimeout(o),o=null,a=c,s=t.apply(i,r)):o||!1===n.trailing||(o=setTimeout(l,h)),s}}var FF=function(t){return t[t.top="top"]="top",t[t.bottom="bottom"]="bottom",t[t.left="left"]="left",t[t.right="right"]="right",t}({});function LF(t,e,n){return"top"===n?t.top-7:"bottom"===n?t.top+t.height-e.height+7:"center"===n?t.top+t.height/2-e.height/2:void 0}function MF(t,e,n){return"left"===n?t.left-7:"right"===n?t.left+t.width-e.width+7:"center"===n?t.left+t.width/2-e.width/2:void 0}class IF{static calculateVerticalAlignment(t,e,n){let i=LF(t,e,n);return i+e.height>window.innerHeight&&(i=window.innerHeight-e.height),i}static calculateVerticalCaret(t,e,n,i){let r;"top"===i&&(r=t.height/2-n.height/2+7),"bottom"===i&&(r=e.height-t.height/2-n.height/2-7),"center"===i&&(r=e.height/2-n.height/2);const s=LF(t,e,i);return s+e.height>window.innerHeight&&(r+=s+e.height-window.innerHeight),r}static calculateHorizontalAlignment(t,e,n){let i=MF(t,e,n);return i+e.width>window.innerWidth&&(i=window.innerWidth-e.width),i}static calculateHorizontalCaret(t,e,n,i){let r;"left"===i&&(r=t.width/2-n.width/2+7),"right"===i&&(r=e.width-t.width/2-n.width/2-7),"center"===i&&(r=e.width/2-n.width/2);const s=MF(t,e,i);return s+e.width>window.innerWidth&&(r+=s+e.width-window.innerWidth),r}static shouldFlip(t,e,n,i){let r=!1;return"right"===n&&t.left+t.width+e.width+i>window.innerWidth&&(r=!0),"left"===n&&t.left-e.width-i<0&&(r=!0),"top"===n&&t.top-e.height-i<0&&(r=!0),"bottom"===n&&t.top+t.height+e.height+i>window.innerHeight&&(r=!0),r}static positionCaret(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=-7,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.left?(o=e.width,s=IF.calculateVerticalCaret(n,e,i,r)):t===FF.top?(s=e.height,o=IF.calculateHorizontalCaret(n,e,i,r)):t===FF.bottom&&(s=-7,o=IF.calculateHorizontalCaret(n,e,i,r)),{top:s,left:o}}static positionContent(t,e,n,i,r){let s=0,o=0;return t===FF.right?(o=n.left+n.width+i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.left?(o=n.left-e.width-i,s=IF.calculateVerticalAlignment(n,e,r)):t===FF.top?(s=n.top-e.height-i,o=IF.calculateHorizontalAlignment(n,e,r)):t===FF.bottom&&(s=n.top+n.height+i,o=IF.calculateHorizontalAlignment(n,e,r)),{top:s,left:o}}static determinePlacement(t,e,n,i){if(IF.shouldFlip(n,e,t,i)){if(t===FF.right)return FF.left;if(t===FF.left)return FF.right;if(t===FF.top)return FF.bottom;if(t===FF.bottom)return FF.top}return t}}let $F=(()=>{class t{constructor(t,e){this.element=t,this.renderer=e}get cssClasses(){let t="ngx-charts-tooltip-content";return t+=" position-"+this.placement,t+=" type-"+this.type,t+=" "+this.cssClass,t}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){const t=this.element.nativeElement,e=this.host.nativeElement.getBoundingClientRect();if(!e.height&&!e.width)return;const n=t.getBoundingClientRect();this.checkFlip(e,n),this.positionContent(t,e,n),this.showCaret&&this.positionCaret(e,n),setTimeout(()=>this.renderer.addClass(t,"animate"),1)}positionContent(t,e,n){const{top:i,left:r}=IF.positionContent(this.placement,n,e,this.spacing,this.alignment);this.renderer.setStyle(t,"top",i+"px"),this.renderer.setStyle(t,"left",r+"px")}positionCaret(t,e){const n=this.caretElm.nativeElement,i=n.getBoundingClientRect(),{top:r,left:s}=IF.positionCaret(this.placement,e,t,i,this.alignment);this.renderer.setStyle(n,"top",r+"px"),this.renderer.setStyle(n,"left",s+"px")}checkFlip(t,e){this.placement=IF.determinePlacement(this.placement,e,t,this.spacing)}onWindowResize(){this.position()}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-tooltip-content"]],viewQuery:function(t,e){if(1&t&&sc(CR,!0),2&t){let t;ic(t=lc())&&(e.caretElm=t.first)}},hostVars:2,hostBindings:function(t,e){1&t&&Vo("resize",function(){return e.onWindowResize()},!1,hr),2&t&&sa(e.cssClasses)},inputs:{placement:"placement",host:"host",showCaret:"showCaret",type:"type",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},decls:6,vars:6,consts:[[3,"hidden"],["caretElm",""],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(t,e){var n;1&t&&(Mo(0,"div"),$o(1,"span",0,1),Mo(3,"div",2),Do(4,kR,2,4,"span",3),Do(5,AR,1,1,"span",4),Io(),Io()),2&t&&(Qr(1),"tooltip-caret position-",n=e.placement,"",la(ri,oa,Ao(Le(),"tooltip-caret position-",n,""),!0),Fo("hidden",!e.showCaret),Qr(3),Fo("ngIf",!e.title),Qr(1),Fo("ngIf",e.title))},directives:[Bh,Gh],styles:[".ngx-charts-tooltip-content{border-radius:3px;display:block;font-weight:400;opacity:0;pointer-events:none!important;position:fixed;z-index:5000}.ngx-charts-tooltip-content.type-popover{background:#fff;border:1px solid #72809b;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);color:#060709;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid #fff;border-top:7px solid transparent}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-bottom:7px solid #fff;border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip{background:rgba(0,0,0,.75);color:#fff;font-size:12px;padding:0 10px;pointer-events:auto;text-align:center}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75);border-top:7px solid transparent}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-bottom:7px solid rgba(0,0,0,.75);border-left:7px solid transparent;border-right:7px solid transparent}.ngx-charts-tooltip-content .tooltip-label{display:block;font-size:1em;line-height:1em;padding:8px 5px 5px}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{height:0;position:absolute;width:0;z-index:5001}.ngx-charts-tooltip-content.position-right{transform:translate3d(10px,0,0)}.ngx-charts-tooltip-content.position-left{transform:translate3d(-10px,0,0)}.ngx-charts-tooltip-content.position-top{transform:translate3d(0,-10px,0)}.ngx-charts-tooltip-content.position-bottom{transform:translate3d(0,10px,0)}.ngx-charts-tooltip-content.animate{opacity:1;pointer-events:auto;transform:translateZ(0);transition:opacity .3s,transform .3s}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{line-height:1.2em;padding:5px 0;text-align:left}.tooltip-item .tooltip-item-color{border-radius:3px;color:#5b646b;display:inline-block;height:12px;margin-right:5px;width:12px}"],encapsulation:2}),function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);s>3&&o&&Object.defineProperty(e,n,o)}([function(t,e,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,e,{configurable:!0,enumerable:n.enumerable,value:RF(n.value,100,void 0)}),this[e]}}}],t.prototype,"onWindowResize",null),t})(),OF=(()=>{class t extends class{constructor(t){this.injectionService=t,this.defaults={},this.components=new Map}getByType(t=this.type){return this.components.get(t)}create(t){return this.createByType(this.type,t)}createByType(t,e){e=this.assignDefaults(e);const n=this.injectComponent(t,e);return this.register(t,n),n}destroy(t){const e=this.components.get(t.componentType);if(e&&e.length){const n=e.indexOf(t);n>-1&&(e[n].destroy(),e.splice(n,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(t){const e=this.components.get(t);if(e&&e.length){let t=e.length-1;for(;t>=0;)this.destroy(e[t--])}}injectComponent(t,e){return this.injectionService.appendComponent(t,e)}assignDefaults(t){const e=Object.assign({},this.defaults.inputs),n=Object.assign({},this.defaults.outputs);return t.inputs||t.outputs||(t={inputs:t}),e&&(t.inputs=Object.assign(Object.assign({},e),t.inputs)),n&&(t.outputs=Object.assign(Object.assign({},n),t.outputs)),t}register(t,e){this.components.has(t)||this.components.set(t,[]),this.components.get(t).push(e)}}{constructor(t){super(t),this.type=$F}}return t.\u0275fac=function(e){return new(e||t)(bi(TF))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),PF=(()=>{class t{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new Wl,this.legendLabelActivate=new Wl,this.legendLabelDeactivate=new Wl}ngOnChanges(t){this.update()}update(){let t=0;this.showLegend&&(this.legendType=this.getLegendType(),this.legendOptions&&"right"!==this.legendOptions.position||(t="scaleLegend"===this.legendType?1:2)),this.chartWidth=Math.floor(this.view[0]*(12-t)/12),this.legendWidth=this.legendOptions&&"right"!==this.legendOptions.position?this.chartWidth:Math.floor(this.view[0]*t/12)}getLegendType(){return"linear"===this.legendOptions.scaleType?"scaleLegend":"legend"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-chart"]],inputs:{showLegend:"showLegend",animations:"animations",legendType:"legendType",view:"view",legendOptions:"legendOptions",data:"data",legendData:"legendData",colors:"colors",activeEntries:"activeEntries"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},features:[Pa([OF]),le],ngContentSelectors:RR,decls:5,vars:8,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"horizontal","valueRange","colors","height","width",4,"ngIf"],["class","chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"horizontal","data","title","colors","height","width","activeEntries","labelClick","labelActivate","labelDeactivate"]],template:function(t,e){1&t&&(Go(),Mo(0,"div",0),ln(),Mo(1,"svg",1),qo(2),Io(),Do(3,DR,1,5,"ngx-charts-scale-legend",2),Do(4,TR,1,7,"ngx-charts-legend",3),Io()),2&t&&(ia("width",e.view[0],"px"),Fo("@animationState","active")("@.disabled",!e.animations),Qr(1),ko("width",e.chartWidth)("height",e.view[1]),Qr(2),Fo("ngIf",e.showLegend&&"scaleLegend"===e.legendType),Qr(1),Fo("ngIf",e.showLegend&&"legend"===e.legendType))},directives:function(){return[Bh,fL,dL]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru("500ms 100ms",Lu({opacity:1}))])])]},changeDetection:0}),t})(),NF=(()=>{class t{constructor(t,e){this.element=t,this.zone=e,this.visible=new Wl,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const t=()=>{if(!this.element)return;const{offsetHeight:e,offsetWidth:n}=this.element.nativeElement;e&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>t())})}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic))},t.\u0275dir=Wt({type:t,selectors:[["visibility-observer"]],outputs:{visible:"visible"}}),t})(),BF=(()=>{class t{constructor(t,e,n){this.chartElement=t,this.zone=e,this.cd=n,this.scheme="cool",this.schemeType="ordinal",this.animations=!0,this.select=new Wl}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new NF(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(t){this.update()}update(){if(this.results=this.results?this.cloneData(this.results):[],this.view)this.width=this.view[0],this.height=this.view[1];else{const t=this.getContainerDims();t&&(this.width=t.width,this.height=t.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let t,e;const n=this.chartElement.nativeElement;if(null!==n.parentNode){const i=n.parentNode.getBoundingClientRect();t=i.width,e=i.height}return t&&e?{width:t,height:e}:null}formatDates(){for(let t=0;tn.lift(new Y_(t,e))}(200)).subscribe(t=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=t}cloneData(t){const e=[];for(const n of t){const t={name:n.name};if(void 0!==n.value&&(t.value=n.value),void 0!==n.series){t.series=[];for(const e of n.series){const n=Object.assign({},e);t.series.push(n)}}void 0!==n.extra&&(t.extra=JSON.parse(JSON.stringify(n.extra))),e.push(t)}return e}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(Ic),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["base-chart"]],inputs:{scheme:"scheme",schemeType:"schemeType",animations:"animations",results:"results",view:"view",customColors:"customColors"},outputs:{select:"select"},features:[le],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"div")},encapsulation:2}),t})(),UF=(()=>{class t{constructor(t){this.textHeight=25,this.margin=5,this.element=t.nativeElement}ngOnChanges(t){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case"top":case"bottom":this.y=this.offset,this.x=this.width/2;break;case"left":this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case"right":this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)"}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},features:[le],attrs:FR,decls:2,vars:6,template:function(t,e){1&t&&(ln(),Mo(0,"text"),va(1),Io()),2&t&&(ko("stroke-width",e.strokeWidth)("x",e.x)("y",e.y)("text-anchor",e.textAnchor)("transform",e.transform),Qr(1),ba(" ",e.label," "))},encapsulation:2,changeDetection:0}),t})();function VF(t,e=16){return"string"!=typeof t?"number"==typeof t?t+"":"":(t=t.trim()).length<=e?t:t.slice(0,e)+"..."}function HF(t,e){if(t.length>e){const n=[],i=Math.floor(t.length/e);for(let e=0;e{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.dimensionsChanged=new Wl,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor="middle",this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);t!==this.height&&(this.height=t,this.dimensionsChanged.emit({height:t}),setTimeout(()=>this.updateDims()))}update(){const t=this.scale;this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()};const e=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.adjustedScale=this.scale.bandwidth?function(t){return this.scale(t)+.5*this.scale.bandwidth()}:this.scale,this.textTransform="",e&&0!==e?(this.textTransform=`rotate(${e})`,this.textAnchor="end",this.verticalSpacing=10):this.textAnchor="middle",setTimeout(()=>this.updateDims())}getRotationAngle(t){let e=0;this.maxTicksLength=0;for(let s=0;sthis.maxTicksLength&&(this.maxTicksLength=n)}const n=8*Math.min(this.maxTicksLength,this.maxAllowedLength);let i=n;const r=Math.floor(this.width/t.length);for(;i>r&&e>-90;)e-=30,i=Math.cos(e*(Math.PI/180))*n;return e}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(100);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.width/t)}tickTransform(t){return"translate("+this.adjustedScale(t)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",rotateTicks:"rotateTicks",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineHeight:"gridLineHeight",width:"width"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:MR,decls:4,vars:2,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[4,"ngIf"],["y2","0",1,"gridline-path","gridline-path-vertical"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,IR,5,7,"g",1),Io(),Do(3,OR,2,2,"g",2)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.ticks))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),zF=(()=>{class t{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient="bottom",this.xAxisOffset=0,this.dimensionsChanged=new Wl,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5}ngOnChanges(t){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,void 0!==this.xAxisTickCount&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:t}){const e=t+25+5;e!==this.labelOffset&&(this.labelOffset=e,setTimeout(()=>{this.dimensionsChanged.emit({height:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(t,e){if(1&t&&sc(jF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{rotateTicks:"rotateTicks",showGridLines:"showGridLines",xOrient:"xOrient",xAxisOffset:"xAxisOffset",xScale:"xScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickInterval:"xAxisTickInterval",xAxisTickCount:"xAxisTickCount"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:PR,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","width","tickValues","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,NR,1,12,"g",0),Do(2,BR,1,5,"g",1),Io()),2&t&&(ko("class",e.xAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.xScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,jF,UF],encapsulation:2,changeDetection:0}),t})(),WF=(()=>{class t{constructor(){this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.dimensionsChanged=new Wl,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor="middle",this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0}ngOnChanges(t){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){const t=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);t!==this.width&&(this.width=t,this.dimensionsChanged.emit({width:t}),setTimeout(()=>this.updateDims()))}update(){let t;const e="top"===this.orient||"right"===this.orient?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,t=this.scale,this.ticks=this.getTicks(),this.tickFormat=this.tickFormatting?this.tickFormatting:t.tickFormat?t.tickFormat.apply(t,this.tickArguments):function(t){return"Date"===t.constructor.name?t.toLocaleDateString():t.toLocaleString()},this.adjustedScale=t.bandwidth?function(e){return t(e)+.5*t.bandwidth()}:t,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case"top":case"bottom":this.transform=function(t){return"translate("+this.adjustedScale(t)+",0)"},this.textAnchor="middle",this.y2=this.innerTickSize*e,this.y1=this.tickSpacing*e,this.dy=e<0?"0em":".71em";break;case"left":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="end",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em";break;case"right":this.transform=function(t){return"translate(0,"+this.adjustedScale(t)+")"},this.textAnchor="start",this.x2=this.innerTickSize*-e,this.x1=this.tickSpacing*-e,this.dy=".32em"}setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(t=>t.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(t=>t.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=function(t,e,n,i,r,[s,o,a,l]){let c="";return c="M"+[t+r,e],c+="h"+((n=0===(n=Math.floor(n))?1:n)-2*r),c+=o?`a${[r,r]} 0 0 1 ${[r,r]}`:`h${r}v${r}`,c+="v"+((i=0===(i=Math.floor(i))?1:i)-2*r),c+=l?`a${[r,r]} 0 0 1 ${[-r,r]}`:`v${r}h${-r}`,c+="h"+(2*r-n),c+=a?`a${[r,r]} 0 0 1 ${[-r,-r]}`:`h${-r}v${-r}`,c+="v"+(2*r-i),c+=s?`a${[r,r]} 0 0 1 ${[r,-r]}`:`v${-r}h${r}`,c+="z",c}(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let t;const e=this.getMaxTicks(20),n=this.getMaxTicks(50);return this.tickValues?t=this.tickValues:this.scale.ticks?t=this.scale.ticks.apply(this.scale,[n]):(t=this.scale.domain(),t=HF(t,e)),t}getMaxTicks(t){return Math.floor(this.height/t)}tickTransform(t){return`translate(${this.adjustedScale(t)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(t){return this.trimTicks?VF(t,this.maxTickLength):t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(t,e){if(1&t&&sc(LR,!0),2&t){let t;ic(t=lc())&&(e.ticksElement=t.first)}},inputs:{tickArguments:"tickArguments",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",showGridLines:"showGridLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",scale:"scale",orient:"orient",tickValues:"tickValues",tickFormatting:"tickFormatting",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:UR,decls:6,vars:4,consts:[["ticksel",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tick"],["stroke-width","0.01"],[1,"reference-area"],[4,"ngIf"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(t,e){1&t&&(ln(),Mo(0,"g",null,0),Do(2,VR,5,9,"g",1),Io(),Do(3,HR,1,2,"path",2),Do(4,GR,2,2,"g",3),Do(5,XR,2,1,"g",3)),2&t&&(Qr(2),Fo("ngForOf",e.ticks),Qr(1),Fo("ngIf",e.referenceLineLength>1&&e.refMax&&e.refMin&&e.showRefLines),Qr(1),Fo("ngForOf",e.ticks),Qr(1),Fo("ngForOf",e.referenceLines))},directives:[Ph,Bh],encapsulation:2,changeDetection:0}),t})(),GF=(()=>{class t{constructor(){this.showGridLines=!1,this.yOrient="left",this.yAxisOffset=0,this.dimensionsChanged=new Wl,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5}ngOnChanges(t){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),"right"===this.yOrient?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):(this.offset=this.offset,this.transform=`translate(${this.offset} , 0)`),void 0!==this.yAxisTickCount&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:t}){t!==this.labelOffset&&"right"===this.yOrient?(this.labelOffset=t+this.labelOffset,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0)):t!==this.labelOffset&&(this.labelOffset=t,setTimeout(()=>{this.dimensionsChanged.emit({width:t})},0))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(t,e){if(1&t&&sc(WF,!0),2&t){let t;ic(t=lc())&&(e.ticksComponent=t.first)}},inputs:{showGridLines:"showGridLines",yOrient:"yOrient",yAxisOffset:"yAxisOffset",yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showLabel:"showLabel",labelText:"labelText",yAxisTickInterval:"yAxisTickInterval",yAxisTickCount:"yAxisTickCount",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels"},outputs:{dimensionsChanged:"dimensionsChanged"},features:[le],attrs:YR,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","dimensionsChanged"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Do(1,JR,1,14,"g",0),Do(2,QR,1,5,"g",1),Io()),2&t&&(ko("class",e.yAxisClassName)("transform",e.transform),Qr(1),Fo("ngIf",e.yScale),Qr(1),Fo("ngIf",e.showLabel))},directives:[Bh,WF,UF],encapsulation:2,changeDetection:0}),t})(),qF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh]]}),t})();var KF=function(t){return t[t.popover="popover"]="popover",t[t.tooltip="tooltip"]="tooltip",t}({}),XF=function(t){return t[t.left="left"]="left",t[t.center="center"]="center",t[t.right="right"]="right",t}({}),YF=function(t){return t[t.all="all"]="all",t[t.focus="focus"]="focus",t[t.mouseover="mouseover"]="mouseover",t}({});let JF=(()=>{class t{constructor(t,e,n){this.tooltipService=t,this.viewContainerRef=e,this.renderer=n,this.tooltipCssClass="",this.tooltipTitle="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=FF.top,this.tooltipAlignment=XF.center,this.tooltipType=KF.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=YF.all,this.tooltipImmediateExit=!1,this.show=new Wl,this.hide=new Wl}get listensForFocus(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.focus}get listensForHover(){return this.tooltipShowEvent===YF.all||this.tooltipShowEvent===YF.mouseover}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(t){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(t))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(t){if(this.component||this.tooltipDisabled)return;const e=t?0:this.tooltipShowTimeout;clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();const t=this.createBoundOptions();this.component=this.tooltipService.create(t),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},e)}addHideListeners(t){this.mouseEnterContentEvent=this.renderer.listen(t,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(t,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen(document,"click",e=>{t.contains(e.target)||this.hideTooltip()}))}hideTooltip(t=!1){if(!this.component)return;const e=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),t?e():this.timeout=setTimeout(e,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}}return t.\u0275fac=function(e){return new(e||t)(Ro(OF),Ro(El),Ro(Ga))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-tooltip",""]],hostBindings:function(t,e){1&t&&Vo("focusin",function(){return e.onFocus()})("blur",function(){return e.onBlur()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(t){return e.onMouseLeave(t.target)})("click",function(){return e.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipTitle:"tooltipTitle",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipShowEvent:"tooltipShowEvent",tooltipImmediateExit:"tooltipImmediateExit",tooltipTemplate:"tooltipTemplate",tooltipContext:"tooltipContext"},outputs:{show:"show",hide:"hide"}}),t})(),QF=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[TF,OF],imports:[[qh]]}),t})();function ZF(t){return t instanceof Date?t.toLocaleDateString():t.toLocaleString()}function tL(t){return t.toLocaleString().replace(/[&'`"<>]/g,t=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"}[t]))}const eL={};function nL(){let t=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return t="a"+t,eL[t]?nL():(eL[t]=!0,t)}let iL,rL=(()=>{class t{constructor(){this.type="standard",this.tooltipDisabled=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.barVisible=!1}ngOnInit(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`}ngOnChanges(t){this.update()}update(){this.circle=this.getActiveCircle()}getActiveCircle(){const t=this.data.series.findIndex(t=>{const e=t.name;return e&&this.visibleValue&&e.toString()===this.visibleValue.toString()&&void 0!==t.value});if(-1!==t)return this.mapDataPointToCircle(this.data.series[t],t)}mapDataPointToCircle(t,e){const n=this.data.name,i=t.value,r=t.name,s=ZF(r);let o;o=this.xScale("time"===this.scaleType?r:"linear"===this.scaleType?Number(r):r);const a=this.yScale("standard"===this.type?i:t.d1),l=this.yScale.range()[0]-a;let c;return c=this.colors.getColor("linear"===this.colors.scaleType?"standard"===this.type?i:t.d1:n),{classNames:["circle-data-"+e],value:i,label:r,data:Object.assign({},t,{series:n,value:i,name:r}),cx:o,cy:a,radius:5,height:l,tooltipLabel:s,color:c,opacity:1,seriesName:n,gradientStops:this.getGradientStops(c),min:t.min,max:t.max}}getTooltipText({tooltipLabel:t,value:e,seriesName:n,min:i,max:r}){return`\n ${tL(n)} \u2022 ${tL(t)}\n ${e.toLocaleString()}${this.getTooltipMinMaxText(i,r)}\n `}getTooltipMinMaxText(t,e){if(void 0!==t||void 0!==e){let n=" (";return void 0!==t?(void 0===e&&(n+="\u2265"),n+=t.toLocaleString(),void 0!==e&&(n+=" - ")):void 0!==e&&(n+="\u2264"),void 0!==e&&(n+=e.toLocaleString()),n+=")",n}return""}getGradientStops(t){return[{offset:0,color:t,opacity:.2},{offset:100,color:t,opacity:1}]}onClick(t){this.select.emit(t)}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}activateCircle(){this.barVisible=!0,this.activate.emit({name:this.data.name})}deactivateCircle(){this.barVisible=!1,this.circle.opacity=0,this.deactivate.emit({name:this.data.name})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle-series",""]],inputs:{type:"type",tooltipDisabled:"tooltipDisabled",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",visibleValue:"visibleValue",activeEntries:"activeEntries",tooltipTemplate:"tooltipTemplate"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:ZR,decls:1,vars:1,consts:[[4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["class","tooltip-bar",4,"ngIf"],["ngx-charts-circle","","ngx-tooltip","",1,"circle",3,"cx","cy","r","fill","pointerEvents","data","classNames","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","select","activate","deactivate"],[1,"tooltip-bar"]],template:function(t,e){1&t&&Do(0,nF,5,20,"g",0),2&t&&Fo("ngIf",e.circle)},directives:function(){return[Bh,oL,sL,JF]},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({opacity:0}),Ru(250,Lu({opacity:1}))])])]},changeDetection:0}),t})(),sL=(()=>{class t{constructor(){this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl}onClick(){this.select.emit(this.data)}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}ngOnChanges(t){this.classNames=Array.isArray(this.classNames)?this.classNames.join(" "):"",this.classNames+="circle"}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-circle",""]],hostBindings:function(t,e){1&t&&Vo("click",function(){return e.onClick()})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{classNames:"classNames",cx:"cx",cy:"cy",r:"r",fill:"fill",stroke:"stroke",data:"data",circleOpacity:"circleOpacity",pointerEvents:"pointerEvents"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},features:[le],attrs:iF,decls:1,vars:8,template:function(t,e){1&t&&(ln(),$o(0,"circle")),2&t&&ko("cx",e.cx)("cy",e.cy)("r",e.r)("fill",e.fill)("stroke",e.stroke)("opacity",e.circleOpacity)("class",e.classNames)("pointer-events",e.pointerEvents)},encapsulation:2,changeDetection:0}),t})(),oL=(()=>{class t{constructor(){this.orientation="vertical"}ngOnChanges(t){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%","horizontal"===this.orientation?this.x2="100%":"vertical"===this.orientation&&(this.y1="100%")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},features:[le],attrs:rF,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(t,e){1&t&&(ln(),Mo(0,"linearGradient",0),Do(1,sF,1,5,"stop",1),Io()),2&t&&(Fo("id",e.name),ko("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2),Qr(1),Fo("ngForOf",e.stops))},directives:[Ph],encapsulation:2,changeDetection:0}),t})(),aL=(()=>{class t{constructor(t){this.opacity=1,this.startOpacity=.5,this.endOpacity=1,this.gradient=!1,this.animations=!0,this.select=new Wl,this.initialized=!1,this.hasGradient=!1,this.element=t.nativeElement}ngOnChanges(t){this.initialized?this.update():(this.loadAnimation(),this.initialized=!0)}update(){this.gradientId="grad"+nL().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl()}loadAnimation(){this.areaPath=this.startingPath,setTimeout(this.update.bind(this),100)}updatePathEl(){const t=cS(this.element).select(".area");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.startOpacity},{offset:100,color:this.fill,opacity:this.endOpacity}]}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-area",""]],inputs:{opacity:"opacity",startOpacity:"startOpacity",endOpacity:"endOpacity",gradient:"gradient",animations:"animations",data:"data",path:"path",startingPath:"startingPath",fill:"fill",activeLabel:"activeLabel",stops:"stops"},outputs:{select:"select"},features:[le],attrs:oF,decls:2,vars:5,consts:[[4,"ngIf"],[1,"area"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"]],template:function(t,e){1&t&&(Do(0,aF,2,2,"defs",0),ln(),$o(1,"path",1)),2&t&&(Fo("ngIf",e.gradient),Qr(1),ia("opacity",e.opacity),ko("d",e.areaPath)("fill",e.gradient?e.gradientFill:e.fill))},directives:[Bh,oL],encapsulation:2,changeDetection:0}),t})();"undefined"!=typeof window?iL=window:"undefined"!=typeof global&&(iL=global);const lL=iL.MouseEvent;function cL(t,e=!1,n=!0){if("function"==typeof lL)return new lL(t,{bubbles:e,cancelable:n});{const i=document.createEvent("MouseEvent");return i.initEvent(t,e,n),i}}let hL=(()=>{class t{constructor(){this.anchorOpacity=0,this.anchorPos=-1,this.anchorValues=[],this.showPercentage=!1,this.tooltipDisabled=!1,this.hover=new Wl}getValues(t){const e=[];for(const n of this.results){const i=n.series.find(e=>e.name.toString()===t.toString());let r=n.name;if(r instanceof Date&&(r=r.toLocaleDateString()),i){const t=i.name;let s,o=i.value;if(this.showPercentage&&(o=(i.d1-i.d0).toFixed(2)+"%"),"linear"===this.colors.scaleType){let t=o;i.d1&&(t=i.d1),s=this.colors.getColor(t)}else s=this.colors.getColor(n.name);const a=Object.assign({},i,{value:o,name:t,series:r,min:i.min,max:i.max,color:s});e.push(a)}}return e}mouseMove(t){const e=t.pageX-t.target.getBoundingClientRect().left,n=this.findClosestPointIndex(e),i=this.xSet[n];if(this.anchorPos=this.xScale(i),this.anchorPos=Math.max(0,this.anchorPos),this.anchorPos=Math.min(this.dims.width,this.anchorPos),this.anchorValues=this.getValues(i),this.anchorPos!==this.lastAnchorPos){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=.7,this.hover.emit({value:i}),this.showTooltip(),this.lastAnchorPos=this.anchorPos}}findClosestPointIndex(t){let e=0,n=this.xSet.length-1,i=Number.MAX_VALUE,r=0;for(;e<=n;){const s=(e+n)/2|0,o=this.xScale(this.xSet[s]),a=Math.abs(o-t);if(at)){i=0,r=s;break}n=s-1}}return r}showTooltip(){const t=cL("mouseenter");this.tooltipAnchor.nativeElement.dispatchEvent(t)}hideTooltip(){const t=cL("mouseleave");this.tooltipAnchor.nativeElement.dispatchEvent(t),this.anchorOpacity=0,this.lastAnchorPos=-1}getToolTipText(t){let e="";return e+=void 0!==t.series?t.series:"???",e+=": ",void 0!==t.value&&(e+=t.value.toLocaleString()),void 0===t.min&&void 0===t.max||(e+=" (",void 0!==t.min?(void 0===t.max&&(e+="\u2265"),e+=t.min.toLocaleString(),void 0!==t.max&&(e+=" - ")):void 0!==t.max&&(e+="\u2264"),void 0!==t.max&&(e+=t.max.toLocaleString()),e+=")"),e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-tooltip-area",""]],viewQuery:function(t,e){if(1&t&&sc(lF,!0),2&t){let t;ic(t=lc())&&(e.tooltipAnchor=t.first)}},inputs:{showPercentage:"showPercentage",tooltipDisabled:"tooltipDisabled",dims:"dims",xSet:"xSet",xScale:"xScale",yScale:"yScale",results:"results",colors:"colors",tooltipTemplate:"tooltipTemplate"},outputs:{hover:"hover"},attrs:cF,decls:6,vars:18,consts:[["y","0",1,"tooltip-area",2,"opacity","0","cursor","auto",3,"mousemove","mouseleave"],["defaultTooltipTemplate",""],["y","0","ngx-tooltip","",1,"tooltip-anchor",3,"tooltipDisabled","tooltipPlacement","tooltipType","tooltipSpacing","tooltipTemplate","tooltipContext","tooltipImmediateExit"],["tooltipAnchor",""],[1,"area-tooltip-container"],["class","tooltip-item",4,"ngFor","ngForOf"],[1,"tooltip-item"],[1,"tooltip-item-color"]],template:function(t,e){if(1&t&&(ln(),Mo(0,"g"),Mo(1,"rect",0),Vo("mousemove",function(t){return e.mouseMove(t)})("mouseleave",function(){return e.hideTooltip()}),Io(),Do(2,uF,2,1,"ng-template",null,1,dc),$o(4,"rect",2,3),Io()),2&t){const t=To(3);Qr(1),ko("x",0)("width",e.dims.width)("height",e.dims.height),Qr(3),ia("opacity",e.anchorOpacity)("pointer-events","none"),Fo("@animationState",0!==e.anchorOpacity?"active":"inactive")("tooltipDisabled",e.tooltipDisabled)("tooltipPlacement","right")("tooltipType","tooltip")("tooltipSpacing",15)("tooltipTemplate",e.tooltipTemplate?e.tooltipTemplate:t)("tooltipContext",e.anchorValues)("tooltipImmediateExit",!0),ko("x",e.anchorPos)("width",1)("height",e.dims.height)}},directives:[JF,Ph],encapsulation:2,data:{animation:[Tu("animationState",[Mu("inactive => active",[Lu({opacity:0}),Ru(250,Lu({opacity:.7}))]),Mu("active => inactive",[Lu({opacity:.7}),Ru(250,Lu({opacity:0}))])])]},changeDetection:0}),t})(),uL=(()=>{class t{constructor(t,e){this.cd=e,this.height=50,this.select=new Wl,this.onDomainChange=new Wl,this.initialized=!1,this.element=t.nativeElement}ngOnChanges(t){this.update(),this.initialized||(this.addBrush(),this.initialized=!0)}update(){this.dims=this.getDims(),this.height=this.dims.height;const t=this.view[1]-this.height;this.xDomain=this.getXDomain(),this.xScale=this.getXScale(),this.brush&&this.updateBrush(),this.transform=`translate(0 , ${t})`,this.filterId="filter"+nL().toString(),this.filter=`url(#${this.filterId})`,this.cd.markForCheck()}getXDomain(){let t=[];for(const n of this.results)for(const e of n.series)t.includes(e.name)||t.push(e.name);let e=[];return"time"===this.scaleType?e=[Math.min(...t),Math.max(...t)]:"linear"===this.scaleType?(t=t.map(t=>Number(t)),e=[Math.min(...t),Math.max(...t)]):e=t,e}getXScale(){let t;return"time"===this.scaleType?t=ET().range([0,this.dims.width]).domain(this.xDomain):"linear"===this.scaleType?t=VT().range([0,this.dims.width]).domain(this.xDomain):"ordinal"===this.scaleType&&(t=qT().range([0,this.dims.width]).padding(.1).domain(this.xDomain)),t}addBrush(){if(this.brush)return;const t=this.height,e=this.view[0];this.brush=function(t){var e,n=qk,i=Gk,r=Kk,s=!0,o=mS("start","brush","end"),a=6;function l(e){var n=e.property("__brush",g).selectAll(".overlay").data([Wk("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Uk.overlay).merge(n).each(function(){var t=Xk(this).extent;cS(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Wk("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Uk.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Uk[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",f).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=cS(this),e=Xk(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function h(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new u(t,e,n):i}function u(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function d(){if((!e||YC.touches)&&i.apply(this,arguments)){var n,r,o,a,l,u,d,p,f,g,m,v=this,y=YC.target.__data__.type,b="selection"===(s&&YC.metaKey?y="overlay":y)?Fk:s&&YC.altKey?Ik:Mk,w=t===Bk?null:jk[y],x=t===Nk?null:zk[y],_=Xk(v),C=_.extent,S=_.selection,E=C[0][0],k=C[0][1],A=C[1][0],D=C[1][1],T=0,R=0,F=w&&x&&s&&YC.shiftKey,L=YC.touches?Pk(YC.changedTouches[0].identifier):gE,M=L(v),I=M,$=h(v,arguments,!0).beforestart();"overlay"===y?(S&&(f=!0),_.selection=S=[[n=t===Bk?E:M[0],o=t===Nk?k:M[1]],[l=t===Bk?A:n,d=t===Nk?D:o]]):(n=S[0][0],o=S[0][1],l=S[1][0],d=S[1][1]),r=n,a=o,u=l,p=d;var O=cS(v).attr("pointer-events","none"),P=O.selectAll(".overlay").attr("cursor",Uk[y]);if(YC.touches)$.moved=B,$.ended=V;else{var N=cS(YC.view).on("mousemove.brush",B,!0).on("mouseup.brush",V,!0);s&&N.on("keydown.brush",H,!0).on("keyup.brush",j,!0),yS(YC.view)}Tk(),HE(v),c.call(v),$.start()}function B(){var t=L(v);!F||g||m||(Math.abs(t[0]-I[0])>Math.abs(t[1]-I[1])?m=!0:g=!0),I=t,f=!0,Rk(),U()}function U(){var t;switch(T=I[0]-M[0],R=I[1]-M[1],b){case Lk:case Fk:w&&(T=Math.max(E-n,Math.min(A-l,T)),r=n+T,u=l+T),x&&(R=Math.max(k-o,Math.min(D-d,R)),a=o+R,p=d+R);break;case Mk:w<0?(T=Math.max(E-n,Math.min(A-n,T)),r=n+T,u=l):w>0&&(T=Math.max(E-l,Math.min(A-l,T)),r=n,u=l+T),x<0?(R=Math.max(k-o,Math.min(D-o,R)),a=o+R,p=d):x>0&&(R=Math.max(k-d,Math.min(D-d,R)),a=o,p=d+R);break;case Ik:w&&(r=Math.max(E,Math.min(A,n-T*w)),u=Math.max(E,Math.min(A,l+T*w))),x&&(a=Math.max(k,Math.min(D,o-R*x)),p=Math.max(k,Math.min(D,d+R*x)))}u0&&(n=r-T),x<0?d=p-R:x>0&&(o=a-R),b=Lk,P.attr("cursor",Uk.selection),U());break;default:return}Rk()}function j(){switch(YC.keyCode){case 16:F&&(g=m=F=!1,U());break;case 18:b===Ik&&(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk,U());break;case 32:b===Lk&&(YC.altKey?(w&&(l=u-T*w,n=r+T*w),x&&(d=p-R*x,o=a+R*x),b=Ik):(w<0?l=u:w>0&&(n=r),x<0?d=p:x>0&&(o=a),b=Mk),P.attr("cursor",Uk[y]),U());break;default:return}Rk()}}function p(){h(this,arguments).moved()}function f(){h(this,arguments).ended()}function g(){var e=this.__brush||{selection:null};return e.extent=Ok(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n){e.selection?e.on("start.brush",function(){h(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){h(this,arguments).end()}).tween("brush",function(){var e=this,i=e.__brush,r=h(e,arguments),s=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=dE(s,o);function l(t){i.selection=1===t&&null===o?null:a(t),c.call(e),r.brush()}return null!==s&&null!==o?l:l(1)}):e.each(function(){var e=this,i=arguments,r=e.__brush,s=t.input("function"==typeof n?n.apply(e,i):n,r.extent),o=h(e,i).beforestart();HE(e),r.selection=null===s?null:s,c.call(e),o.start().brush().end()})},l.clear=function(t){l.move(t,null)},u.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){!function(t,e,n,i){var r=YC;t.sourceEvent=YC,YC=t;try{e.apply(n,i)}finally{YC=r}}(new Dk(l,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Ak(Ok(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ak(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Ak(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(s=!!t,l):s},l.on=function(){var t=o.on.apply(o,arguments);return t===o?l:t},l}(Nk).extent([[0,0],[e,t]]).on("brush end",()=>{const t=(YC.selection||this.xScale.range()).map(this.xScale.invert);this.onDomainChange.emit(t),this.cd.markForCheck()}),cS(this.element).select(".brush").call(this.brush)}updateBrush(){this.brush&&(this.brush.extent([[0,0],[this.view[0],this.height]]),cS(this.element).select(".brush").call(this.brush),cS(this.element).select(".selection").attr("fill",void 0).attr("stroke",void 0).attr("fill-opacity",void 0),this.cd.markForCheck())}getDims(){return{width:this.view[0],height:this.height}}}return t.\u0275fac=function(e){return new(e||t)(Ro(za),Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-timeline",""]],inputs:{height:"height",view:"view",state:"state",results:"results",scheme:"scheme",customColors:"customColors",legend:"legend",miniChart:"miniChart",autoScale:"autoScale",scaleType:"scaleType"},outputs:{select:"select",onDomainChange:"onDomainChange"},features:[le],attrs:dF,ngContentSelectors:RR,decls:7,vars:4,consts:[[1,"timeline"],["in","SourceGraphic","type","matrix","values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"],[1,"embedded-chart"],["x","0","y","0",1,"brush-background"],[1,"brush"]],template:function(t,e){1&t&&(Go(),ln(),Mo(0,"g",0),Mo(1,"filter"),$o(2,"feColorMatrix",1),Io(),Mo(3,"g",2),qo(4),Io(),$o(5,"rect",3),$o(6,"g",4),Io()),2&t&&(ko("transform",e.transform),Qr(1),ko("id",e.filterId),Qr(4),ko("width",e.view[0])("height",e.height))},styles:[".timeline .brush-background{fill:rgba(0,0,0,.05)}.timeline .brush .selection{fill:rgba(0,0,0,.1);stroke:#888;stroke-width:1px}.timeline .brush .handle{fill-opacity:0}.timeline .embedded-chart{opacity:.6}"],encapsulation:2,changeDetection:0}),t})(),dL=(()=>{class t{constructor(t){this.cd=t,this.horizontal=!1,this.labelClick=new Wl,this.labelActivate=new Wl,this.labelDeactivate=new Wl,this.legendEntries=[]}ngOnChanges(t){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){const t=[];for(const e of this.data){const n=ZF(e);-1===t.findIndex(t=>t.label===n)&&t.push({label:e,formattedLabel:n,color:this.colors.getColor(e)})}return t}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.label===e.name)}activate(t){this.labelActivate.emit(t)}deactivate(t){this.labelDeactivate.emit(t)}trackBy(t,e){return e.label}}return t.\u0275fac=function(e){return new(e||t)(Ro(pl))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend"]],inputs:{horizontal:"horizontal",data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},features:[le],decls:5,vars:9,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"label","formattedLabel","color","isActive","select","activate","deactivate"]],template:function(t,e){1&t&&(Mo(0,"div"),Do(1,pF,3,1,"header",0),Mo(2,"div",1),Mo(3,"ul",2),Do(4,fF,2,4,"li",3),Io(),Io(),Io()),2&t&&(ia("width",e.width,"px"),Qr(1),Fo("ngIf",(null==e.title?null:e.title.length)>0),Qr(2),ia("max-height",e.height-45,"px"),ra("horizontal-legend",e.horizontal),Qr(1),Fo("ngForOf",e.legendEntries)("ngForTrackBy",e.trackBy))},directives:function(){return[Bh,Ph,pL]},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{font-size:14px;font-weight:700;margin-bottom:5px;margin-left:10px;overflow:hidden;white-space:nowrap}.chart-legend li,.chart-legend ul{list-style:none;margin:0;padding:0}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{background:rgba(0,0,0,.05);border-radius:3px;float:left;line-height:85%;list-style:none;overflow-x:hidden;overflow-y:auto;text-align:left;white-space:nowrap;width:100%}.chart-legend .legend-label{color:#afb7c8;cursor:pointer;font-size:90%;margin:8px}.chart-legend .legend-label:hover{color:#000;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{border-radius:3px;color:#5b646b;display:inline-block;height:15px;margin-right:5px;width:15px}.chart-legend .legend-label-text{font-size:12px;line-height:15px;vertical-align:top;width:calc(100% - 20px)}.chart-legend .legend-label-text,.chart-legend .legend-title-text{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-legend .legend-title-text{line-height:16px;vertical-align:bottom}"],encapsulation:2,changeDetection:0}),t})(),pL=(()=>{class t{constructor(){this.isActive=!1,this.select=new Wl,this.activate=new Wl,this.deactivate=new Wl,this.toggle=new Wl}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(t,e){1&t&&Vo("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()})},inputs:{isActive:"isActive",color:"color",label:"label",formattedLabel:"formattedLabel"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},decls:4,vars:6,consts:[["tabindex","-1",3,"title","click"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(t,e){1&t&&(Mo(0,"span",0),Vo("click",function(){return e.select.emit(e.formattedLabel)}),Mo(1,"span",1),Vo("click",function(){return e.toggle.emit(e.formattedLabel)}),Io(),Mo(2,"span",2),va(3),Io(),Io()),2&t&&(ra("active",e.isActive),Fo("title",e.formattedLabel),Qr(1),ia("background-color",e.color),Qr(2),ba(" ",e.trimmedLabel," "))},encapsulation:2,changeDetection:0}),t})(),fL=(()=>{class t{constructor(t){this.sanitizer=t,this.horizontal=!1}ngOnChanges(t){const e=this.gradientString(this.colors.range(),this.colors.domain());this.gradient=this.sanitizer.bypassSecurityTrustStyle(`linear-gradient(to ${this.horizontal?"right":"bottom"}, ${e})`)}gradientString(t,e){e.push(1);const n=[];return t.reverse().forEach((t,i)=>{n.push(`${t} ${Math.round(100*e[i])}%`)}),n.join(", ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(_u))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-scale-legend"]],inputs:{horizontal:"horizontal",valueRange:"valueRange",colors:"colors",height:"height",width:"width"},features:[le],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(t,e){1&t&&(Mo(0,"div",0),Mo(1,"div",1),Mo(2,"span"),va(3),Io(),Io(),$o(4,"div",2),Mo(5,"div",1),Mo(6,"span"),va(7),Io(),Io(),Io()),2&t&&(ia("height",e.horizontal?void 0:e.height,"px")("width",e.width,"px"),ra("horizontal-legend",e.horizontal),Qr(3),ya(e.valueRange[1].toLocaleString()),Qr(1),ia("background",e.gradient),Qr(3),ya(e.valueRange[0].toLocaleString()))},styles:[".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{display:flex;flex-direction:column;text-align:center}.chart-legend .scale-legend-wrap{border-radius:5px;display:inline-block;flex:1;margin:0 auto;width:30px}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{height:30px;margin:0 16px;width:auto}"],encapsulation:2,changeDetection:0}),t})(),gL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[qh,qF,QF],qh,qF,QF]}),t})(),mL=[{name:"vivid",selectable:!0,group:"Ordinal",domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:"Ordinal",domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:"Ordinal",domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:"Ordinal",domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:"Continuous",domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:"Continuous",domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:"Continuous",domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:"Ordinal",domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:"Ordinal",domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:"Ordinal",domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:"Ordinal",domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:"Ordinal",domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:"Ordinal",domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:"Ordinal",domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:"Ordinal",domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}];class vL{constructor(t,e,n,i){"string"==typeof t&&(t=mL.find(e=>e.name===t)),this.colorDomain=t.domain,this.scaleType=e,this.domain=n,this.customColors=i,this.scale=this.generateColorScheme(t,e,this.domain)}generateColorScheme(t,e,n){let i;if("string"==typeof t&&(t=mL.find(e=>e.name===t)),"quantile"===e)i=XT().range(t.domain).domain(n);else if("ordinal"===e)i=zT().range(t.domain).domain(n);else if("linear"===e){const e=[...t.domain];1===e.length&&(e.push(e[0]),this.colorDomain=e);const n=HT(0,1,1/e.length);i=VT().domain(n).range(e)}return i}getColor(t){if(null==t)throw new Error("Value can not be null");if("linear"===this.scaleType){const e=VT().domain(this.domain).range([0,1]);return this.scale(e(t))}{if("function"==typeof this.customColors)return this.customColors(t);const e=t.toString();let n;return this.customColors&&this.customColors.length>0&&(n=this.customColors.find(t=>t.name.toLowerCase()===e.toLowerCase())),n?n.value:this.scale(t)}}getLinearGradientStops(t,e){void 0===e&&(e=this.domain[0]);const n=VT().domain(this.domain).range([0,1]),i=WT().domain(this.colorDomain).range([0,1]),r=this.getColor(t),s=n(e),o=this.getColor(e),a=n(t);let l=1,c=s;const h=[];for(h.push({color:o,offset:s,originalOffset:s,opacity:1});c=(a-i.bandwidth()).toFixed(4))break;h.push({color:t,offset:e,opacity:1}),c=e,l++}}if(h[h.length-1].offset<100&&h.push({color:r,offset:a,opacity:1}),a===s)h[0].offset=0,h[1].offset=100;else if(100!==h[h.length-1].offset)for(const u of h)u.offset=(u.offset-s)/(a-s)*100;return h}}let yL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),bL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),wL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),xL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),_L=(()=>{class t{constructor(t){this.element=t,this.fill="none",this.animations=!0,this.select=new Wl,this.initialized=!1}ngOnChanges(t){this.initialized?this.updatePathEl():(this.initialized=!0,this.initialPath=this.path)}updatePathEl(){const t=cS(this.element.nativeElement).select(".line");this.animations?t.transition().duration(750).attr("d",this.path):t.attr("d",this.path)}}return t.\u0275fac=function(e){return new(e||t)(Ro(za))},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line",""]],inputs:{fill:"fill",animations:"animations",path:"path",stroke:"stroke",data:"data"},outputs:{select:"select"},features:[le],attrs:yF,decls:1,vars:4,consts:[["stroke-width","1.5px",1,"line"]],template:function(t,e){1&t&&(ln(),$o(0,"path",0)),2&t&&(Fo("@animationState","active"),ko("d",e.initialPath)("fill",e.fill)("stroke",e.stroke))},encapsulation:2,data:{animation:[Tu("animationState",[Mu(":enter",[Lu({strokeDasharray:2e3,strokeDashoffset:2e3}),Ru(1e3,Lu({strokeDashoffset:0}))])])]},changeDetection:0}),t})(),CL=(()=>{class t extends BF{constructor(){super(...arguments),this.legendTitle="Legend",this.legendPosition="right",this.showGridLines=!0,this.curve=JT,this.activeEntries=[],this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.roundDomains=!1,this.tooltipDisabled=!1,this.showRefLines=!1,this.showRefLabels=!0,this.activate=new Wl,this.deactivate=new Wl,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.timelineHeight=50,this.timelinePadding=10}update(){super.update(),this.dims=function({width:t,height:e,margins:n,showXAxis:i=!1,showYAxis:r=!1,xAxisHeight:s=0,yAxisWidth:o=0,showXLabel:a=!1,showYLabel:l=!1,showLegend:c=!1,legendType:h="ordinal",legendPosition:u="right",columns:d=12}){let p=n[3],f=t,g=e-n[0]-n[2];if(c&&"right"===u&&(d-="ordinal"===h?2:1),f=f*d/12,f=f-n[1]-n[3],i&&(g-=5,g-=s,a)&&(g-=30),r&&(f-=5,f-=o,p+=o,p+=10,l)){const t=30;f-=t,p+=t}return f=Math.max(0,f),g=Math.max(0,g),{width:Math.floor(f),height:Math.floor(g),xOffset:Math.floor(p)}}({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.timeline&&(this.dims.height-=this.timelineHeight+this.margin[2]+this.timelinePadding),this.xDomain=this.getXDomain(),this.filteredDomain&&(this.xDomain=this.filteredDomain),this.yDomain=this.getYDomain(),this.seriesDomain=this.getSeriesDomain(),this.xScale=this.getXScale(this.xDomain,this.dims.width),this.yScale=this.getYScale(this.yDomain,this.dims.height),this.updateTimeline(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]})`,this.clipPathId="clip"+nL().toString(),this.clipPath=`url(#${this.clipPathId})`}updateTimeline(){this.timeline&&(this.timelineWidth=this.dims.width,this.timelineXDomain=this.getXDomain(),this.timelineXScale=this.getXScale(this.timelineXDomain,this.timelineWidth),this.timelineYScale=this.getYScale(this.yDomain,this.timelineHeight),this.timelineTransform=`translate(${this.dims.xOffset}, ${-this.margin[2]})`)}getXDomain(){let t=function(t){const e=new Set;for(const n of t)for(const t of n.series)e.add(t.name);return Array.from(e)}(this.results);this.scaleType=function(t,e=!0){return e&&t.every(t=>t instanceof Date)?"time":t.every(t=>"number"==typeof t)?"linear":"ordinal"}(t);let e,n,i=[];return"linear"===this.scaleType&&(t=t.map(t=>Number(t))),"time"!==this.scaleType&&"linear"!==this.scaleType||(e=this.xScaleMin?this.xScaleMin:Math.min(...t),n=this.xScaleMax?this.xScaleMax:Math.max(...t)),"time"===this.scaleType?(i=[new Date(e),new Date(n)],this.xSet=[...t].sort((t,e)=>{const n=t.getTime(),i=e.getTime();return n>i?1:i>n?-1:0})):"linear"===this.scaleType?(i=[e,n],this.xSet=[...t].sort((t,e)=>t-e)):(i=t,this.xSet=t),i}getYDomain(){const t=[];for(const n of this.results)for(const e of n.series)t.indexOf(e.value)<0&&t.push(e.value),void 0!==e.min&&(this.hasRange=!0,t.indexOf(e.min)<0&&t.push(e.min)),void 0!==e.max&&(this.hasRange=!0,t.indexOf(e.max)<0&&t.push(e.max));const e=[...t];return this.autoScale||e.push(0),[this.yScaleMin?this.yScaleMin:Math.min(...e),this.yScaleMax?this.yScaleMax:Math.max(...e)]}getSeriesDomain(){return this.results.map(t=>t.name)}getXScale(t,e){let n;return"time"===this.scaleType?n=ET().range([0,e]).domain(t):"linear"===this.scaleType?(n=VT().range([0,e]).domain(t),this.roundDomains&&(n=n.nice())):"ordinal"===this.scaleType&&(n=qT().range([0,e]).padding(.1).domain(t)),n}getYScale(t,e){const n=VT().range([e,0]).domain(t);return this.roundDomains?n.nice():n}updateDomain(t){this.filteredDomain=t,this.xDomain=this.filteredDomain,this.xScale=this.getXScale(this.xDomain,this.dims.width)}updateHoveredVertical(t){this.hoveredVertical=t.value,this.deactivateAll()}hideCircles(){this.hoveredVertical=null,this.deactivateAll()}onClick(t){this.select.emit(t)}trackBy(t,e){return e.name}setColors(){let t;t="ordinal"===this.schemeType?this.seriesDomain:this.yDomain,this.colors=new vL(this.scheme,this.schemeType,t,this.customColors)}getLegendOptions(){const t={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return"ordinal"===t.scaleType?(t.domain=this.seriesDomain,t.colors=this.colors,t.title=this.legendTitle):(t.domain=this.yDomain,t.colors=this.colors.scale),t}updateYAxisWidth({width:t}){this.yAxisWidth=t,this.update()}updateXAxisHeight({height:t}){this.xAxisHeight=t,this.update()}onActivate(t){this.deactivateAll(),this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value)>-1||(this.activeEntries=[t],this.activate.emit({value:t,entries:this.activeEntries}))}onDeactivate(t){const e=this.activeEntries.findIndex(e=>e.name===t.name&&e.value===t.value);this.activeEntries.splice(e,1),this.activeEntries=[...this.activeEntries],this.deactivate.emit({value:t,entries:this.activeEntries})}deactivateAll(){this.activeEntries=[...this.activeEntries];for(const t of this.activeEntries)this.deactivate.emit({value:t,entries:[]});this.activeEntries=[]}}return t.\u0275fac=function(e){return SL(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["ngx-charts-line-chart"]],contentQueries:function(t,e,n){if(1&t&&(ac(n,gF,!0),ac(n,mF,!0)),2&t){let t;ic(t=lc())&&(e.tooltipTemplate=t.first),ic(t=lc())&&(e.seriesTooltipTemplate=t.first)}},hostBindings:function(t,e){1&t&&Vo("mouseleave",function(){return e.hideCircles()})},inputs:{legendTitle:"legendTitle",legendPosition:"legendPosition",showGridLines:"showGridLines",curve:"curve",activeEntries:"activeEntries",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",roundDomains:"roundDomains",tooltipDisabled:"tooltipDisabled",showRefLines:"showRefLines",showRefLabels:"showRefLabels",legend:"legend",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",autoScale:"autoScale",timeline:"timeline",gradient:"gradient",schemeType:"schemeType",rangeFillOpacity:"rangeFillOpacity",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",referenceLines:"referenceLines",xScaleMin:"xScaleMin",xScaleMax:"xScaleMax",yScaleMin:"yScaleMin",yScaleMax:"yScaleMax"},outputs:{activate:"activate",deactivate:"deactivate"},features:[po],decls:11,vars:20,consts:[[3,"view","showLegend","legendOptions","activeEntries","animations","legendLabelClick","legendLabelActivate","legendLabelDeactivate"],[1,"line-chart","chart"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"mouseleave",4,"ngIf"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange",4,"ngIf"],["ngx-charts-x-axis","",3,"xScale","dims","showGridLines","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","dimensionsChanged"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","referenceLines","showRefLines","showRefLabels","dimensionsChanged"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","activeEntries","scaleType","curve","rangeFillOpacity","hasRange","animations"],[3,"mouseleave"],["ngx-charts-tooltip-area","",3,"dims","xSet","xScale","yScale","results","colors","tooltipDisabled","tooltipTemplate","hover"],[4,"ngFor","ngForOf"],["ngx-charts-circle-series","",3,"xScale","yScale","colors","data","scaleType","visibleValue","activeEntries","tooltipDisabled","tooltipTemplate","select","activate","deactivate"],["ngx-charts-timeline","",3,"results","view","height","scheme","customColors","scaleType","legend","onDomainChange"],["ngx-charts-line-series","",3,"xScale","yScale","colors","data","scaleType","curve","hasRange","animations"]],template:function(t,e){1&t&&(Mo(0,"ngx-charts-chart",0),Vo("legendLabelClick",function(t){return e.onClick(t)})("legendLabelActivate",function(t){return e.onActivate(t)})("legendLabelDeactivate",function(t){return e.onDeactivate(t)}),ln(),Mo(1,"defs"),Mo(2,"clipPath"),$o(3,"rect"),Io(),Io(),Mo(4,"g",1),Do(5,bF,1,10,"g",2),Do(6,wF,1,12,"g",3),Mo(7,"g"),Do(8,xF,2,11,"g",4),Do(9,CF,3,9,"g",5),Io(),Io(),Do(10,EF,2,13,"g",6),Io()),2&t&&(Fo("view",Hl(17,vF,e.width,e.height))("showLegend",e.legend)("legendOptions",e.legendOptions)("activeEntries",e.activeEntries)("animations",e.animations),Qr(2),ko("id",e.clipPathId),Qr(1),ko("width",e.dims.width+10)("height",e.dims.height+10)("transform","translate(-5, -5)"),Qr(1),ko("transform",e.transform),Qr(1),Fo("ngIf",e.xAxis),Qr(1),Fo("ngIf",e.yAxis),Qr(1),ko("clip-path",e.clipPath),Qr(1),Fo("ngForOf",e.results)("ngForTrackBy",e.trackBy),Qr(1),Fo("ngIf",!e.tooltipDisabled),Qr(1),Fo("ngIf",e.timeline&&"ordinal"!=e.scaleType))},directives:function(){return[PF,Bh,Ph,zF,GF,EL,hL,rL,uL]},styles:[".ngx-charts{float:left;overflow:visible}.ngx-charts .arc,.ngx-charts .bar,.ngx-charts .circle{cursor:pointer}.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .card.active,.ngx-charts .card:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .arc:focus,.ngx-charts .bar:focus,.ngx-charts .card:focus,.ngx-charts .cell:focus{outline:none}.ngx-charts .arc.hidden,.ngx-charts .bar.hidden,.ngx-charts .card.hidden,.ngx-charts .cell.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .area-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .line-series.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .polar-series-path.inactive{opacity:.2;transition:opacity .1s ease-in-out}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:400}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{fill:none;stroke:#ddd;stroke-width:1}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-dasharray:5;stroke-dashoffset:5;stroke-width:1}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill:#000;fill-opacity:.05}.ngx-charts .gridline-path-dotted{fill:none;stroke:#ddd;stroke-dasharray:1,20;stroke-dashoffset:3;stroke-width:1}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:rgba(0,0,0,.05)}"],encapsulation:2,data:{animation:[Tu("animationState",[Mu(":leave",[Lu({opacity:1}),Ru(500,Lu({opacity:0}))])])]},changeDetection:0}),t})();const SL=Gn(CL);let EL=(()=>{class t{constructor(){this.animations=!0}ngOnChanges(t){this.update()}update(){this.updateGradients();const t=this.sortData(this.data.series),e=this.getLineGenerator();this.path=e(t)||"";const n=this.getAreaGenerator();if(this.areaPath=n(t)||"",this.hasRange){const e=this.getRangeGenerator();this.outerPath=e(t)||""}if(this.hasGradient){this.stroke=this.gradientUrl;const t=this.data.series.map(t=>t.value),e=Math.max(...t);e===Math.min(...t)&&(this.stroke=this.colors.getColor(e))}else this.stroke=this.colors.getColor(this.data.name)}getLineGenerator(){return lR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y(t=>this.yScale(t.value)).curve(this.curve)}getRangeGenerator(){return cR().x(t=>{const e=t.name;let n;return n=this.xScale("time"===this.scaleType?e:"linear"===this.scaleType?Number(e):e),n}).y0(t=>this.yScale("number"==typeof t.min?t.min:t.value)).y1(t=>this.yScale("number"==typeof t.max?t.max:t.value)).curve(this.curve)}getAreaGenerator(){return cR().x(t=>this.xScale(t.name)).y0(()=>this.yScale.range()[0]).y1(t=>this.yScale(t.value)).curve(this.curve)}sortData(t){return"linear"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>"asc"===n?t[e]-i[e]:i[e]-t[e])}(t,"name"):"time"===this.scaleType?function(t,e,n="asc"){return t.sort((t,i)=>{const r=t[e].getTime(),s=i[e].getTime();return"asc"===n?r>s?1:s>r?-1:0:r>s?-1:s>r?1:0})}(t,"name"):function(t,e,n="asc",i){return t.sort((t,r)=>{const s=r[e],o=i.indexOf(t[e]),a=i.indexOf(s);return"asc"===n?o-a:a-o})}(t,"name","asc",this.xScale.domain())}updateGradients(){if("linear"===this.colors.scaleType){this.hasGradient=!0,this.gradientId="grad"+nL().toString(),this.gradientUrl=`url(#${this.gradientId})`;const t=this.data.series.map(t=>t.value),e=Math.max(...t),n=Math.min(...t);this.gradientStops=this.colors.getLinearGradientStops(e,n),this.areaGradientStops=this.colors.getLinearGradientStops(e)}else this.hasGradient=!1,this.gradientStops=void 0,this.areaGradientStops=void 0}isActive(t){return!!this.activeEntries&&void 0!==this.activeEntries.find(e=>t.name===e.name)}isInactive(t){return!(!this.activeEntries||0===this.activeEntries.length)&&void 0===this.activeEntries.find(e=>t.name===e.name)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["g","ngx-charts-line-series",""]],inputs:{animations:"animations",data:"data",xScale:"xScale",yScale:"yScale",colors:"colors",scaleType:"scaleType",curve:"curve",activeEntries:"activeEntries",rangeFillOpacity:"rangeFillOpacity",hasRange:"hasRange"},features:[le],attrs:kF,decls:6,vars:22,consts:[["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops",4,"ngIf"],["ngx-charts-area","",1,"line-highlight",3,"data","path","fill","opacity","startOpacity","gradient","stops","animations"],["ngx-charts-line","",1,"line-series",3,"data","path","stroke","animations"],["ngx-charts-area","","class","line-series-range",3,"data","path","fill","active","inactive","opacity","animations",4,"ngIf"],["ngx-charts-svg-linear-gradient","","orientation","vertical",3,"name","stops"],["ngx-charts-area","",1,"line-series-range",3,"data","path","fill","opacity","animations"]],template:function(t,e){1&t&&(ln(),Mo(0,"g"),Mo(1,"defs"),Do(2,AF,1,2,"g",0),Io(),$o(3,"g",1),$o(4,"g",2),Do(5,DF,1,9,"g",3),Io()),2&t&&(Qr(2),Fo("ngIf",e.hasGradient),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.areaPath)("fill",e.hasGradient?e.gradientUrl:e.colors.getColor(e.data.name))("opacity",.25)("startOpacity",0)("gradient",!0)("stops",e.areaGradientStops)("animations",e.animations),Qr(1),ra("active",e.isActive(e.data))("inactive",e.isInactive(e.data)),Fo("data",e.data)("path",e.path)("stroke",e.stroke)("animations",e.animations),Qr(1),Fo("ngIf",e.hasRange))},directives:[Bh,aL,_L,oL],encapsulation:2,changeDetection:0}),t})(),kL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})();Math;let AL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),DL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,kL]]}),t})(),TL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),RL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL]]}),t})(),FL=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[gL,AL,bL]]}),t})(),LL=(()=>{class t{constructor(){"undefined"!=typeof SVGElement&&void 0===SVGElement.prototype.contains&&(SVGElement.prototype.contains=HTMLDivElement.prototype.contains)}}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[gL,yL,bL,wL,xL,kL,DL,TL,AL,RL,FL]}),t})();function ML(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function IL(t,e){1&t&&$o(0,"img",31)}function $L(t,e){1&t&&$o(0,"img",32)}function OL(t,e){1&t&&$o(0,"img",33)}function PL(t,e){1&t&&$o(0,"img",34)}function NL(t,e){if(1&t&&(Mo(0,"tr",24),Mo(1,"td"),Oo(2,25),Do(3,IL,1,0,"img",26),Do(4,$L,1,0,"img",27),Do(5,OL,1,0,"img",28),Do(6,PL,1,0,"img",29),Po(),Mo(7,"span"),va(8),Io(),Io(),Mo(9,"td"),va(10),Mo(11,"span",30),va(12),Io(),Io(),Mo(13,"td"),va(14),Mo(15,"span",30),va(16),Io(),Io(),Mo(17,"td"),va(18),Mo(19,"span",30),va(20),Io(),Io(),Mo(21,"td"),va(22),Mo(23,"span",30),va(24),Io(),Io(),Io()),2&t){const t=e.$implicit,n=zo(2);Qr(2),Fo("ngSwitch",t.health),Qr(1),Fo("ngSwitchCase",0),Qr(1),Fo("ngSwitchCase",1),Qr(1),Fo("ngSwitchCase",2),Qr(1),Fo("ngSwitchCase",3),Qr(2),ya(t.name),Qr(2),ba("",t.session_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxSessionCount()-t.session_count," delta)"),Qr(2),ba("",t.presence_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxPresenceCount()-t.presence_count," delta)"),Qr(2),ba("",t.match_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxMatchCount()-t.match_count," delta)"),Qr(2),ba("",t.goroutine_count," "),Qr(1),Fo("hidden",!n.showDelta),Qr(1),ba("(",n.getMaxGoroutineCount()-t.goroutine_count," delta)")}}function BL(t,e){if(1&t&&(Mo(0,"tbody"),Do(1,NL,25,18,"tr",22),Mo(2,"tr",3),$o(3,"td",23),Mo(4,"th",3),va(5),Io(),Mo(6,"th",3),va(7),Io(),Mo(8,"th",3),va(9),Io(),Mo(10,"th",3),va(11),Io(),Io(),Io()),2&t){const t=zo();Qr(1),Fo("ngForOf",t.statusData.nodes),Qr(4),ya(t.getTotalSessionCount()),Qr(2),ya(t.getMaxPresenceCount()),Qr(2),ya(t.getTotalMatchCount()),Qr(2),ya(t.getTotalGorountineCount())}}function UL(t,e){if(1&t&&(Mo(0,"option",35),va(1),Io()),2&t){const t=e.$implicit,n=zo();Ko("value",t),Qr(1),ya(n.ranges[t])}}const VL=function(t){return{"background-color":t}};function HL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function jL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,HL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function zL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",37),Do(2,jL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.latencyGraphData)}}function WL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function GL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,WL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function qL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",43),Do(2,GL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.rateGraphData)}}function KL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function XL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,KL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function YL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",44),Do(2,XL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.inputGraphData)}}function JL(t,e){if(1&t&&(Mo(0,"span"),$o(1,"br"),$o(2,"span",41),Mo(3,"span",42),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),Fo("ngStyle",Vl(3,VL,t.color)),Qr(2),wa("",t.series,": ",t.value,"")}}function QL(t,e){if(1&t&&(Mo(0,"div",39),va(1),Do(2,JL,5,5,"span",40),Io()),2&t){const t=e.model;Qr(1),ba(" ",t[0].name.toLocaleString()," "),Qr(1),Fo("ngForOf",t)}}function ZL(t,e){if(1&t&&(Mo(0,"div",36),Mo(1,"ngx-charts-line-chart",45),Do(2,QL,3,2,"ng-template",null,38,dc),Io(),Io()),2&t){const t=zo();Qr(1),Fo("scheme",t.colorScheme)("legend",!1)("showXAxisLabel",!1)("showYAxisLabel",!1)("animations",!1)("timeline",!1)("autoScale",!1)("xAxis",!0)("yAxis",!0)("yScaleMin",0)("roundDomains",!0)("results",t.outputGraphData)}}let tM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.showDelta=!1,this.rateGraphData=[],this.latencyGraphData=[],this.inputGraphData=[],this.outputGraphData=[],this.ranges={1:"last 1 minute",10:"last 10 minutes",30:"last 30 minutes",60:"last 1 hour",1440:"last 24 hours"},this.rangesKeys=Object.keys(this.ranges).map(t=>+t),this.colorScheme={domain:["#5AA454","#E44D25","#1e59cf","#7aa3e5","#a8385d","#d0bd00"]},this.samples=60}ngOnInit(){this.rangeForm=this.formBuilder.group({rangeMinutes:[10]}),this.route.data.subscribe(t=>{this.initData(t[0]),this.refresh(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}refresh(){this.consoleService.getStatus("").subscribe(t=>{this.statusData=t,this.rateGraphData=this.updateData(this.rateGraphData,"avg_rate_sec",t),this.latencyGraphData=this.updateData(this.latencyGraphData,"avg_latency_ms",t),this.inputGraphData=this.updateData(this.inputGraphData,"avg_input_kbs",t),this.outputGraphData=this.updateData(this.outputGraphData,"avg_output_kbs",t)})}generateSeries(){let t=new Date;t.setMilliseconds(0);const e=[];for(let n=0;n({name:t,value:0}))}initData(t){const e=this.generateSeries();this.latencyGraphData=t.map(t=>({name:t,series:e})),this.rateGraphData=t.map(t=>({name:t,series:e})),this.inputGraphData=t.map(t=>({name:t,series:e})),this.outputGraphData=t.map(t=>({name:t,series:e}))}updateData(t,e,n){var i;const r=n.nodes,s=[],o=n.timestamp,a=t.map(t=>t.name),l=r.map(t=>t.name),c=this.diff(a,l);for(const h of t)c.includes(h.name)&&s.push({name:h.name,series:this.shiftData(h.series,0,o)});for(const h of r){let n=[],r={};const a=null===(i=t.find(t=>t.name===h.name))||void 0===i?void 0:i.series;n=this.shiftData(a||this.generateSeries(),h[e],o),r={name:h.name,series:n},s.push(r)}return s}shiftData(t,e,n){const i=t.slice(1);return i.push({name:new Date(n),value:e}),i}getPeriod(){return Math.floor(60*this.f.rangeMinutes.value/this.samples)}setRange(t){this.rangeForm.reset({rangeMinutes:+t.target.value}),this.reset()}reset(){this.consoleService.getStatus("").subscribe(t=>{var e;this.initData(t.nodes.map(t=>t.name)),null===(e=this.$refreshTimer)||void 0===e||e.unsubscribe(),this.refreshTimer=Bw(0,1e3*this.getPeriod()),this.$refreshTimer=this.refreshTimer.subscribe(t=>this.refresh())},t=>{this.error=t})}diff(t,e){const n=new Set(t);for(const i of e)n.delete(i);return Array.from(n)}get f(){return this.rangeForm.controls}ngOnDestroy(){this.$refreshTimer.unsubscribe()}getTotalSessionCount(){return this.statusData.nodes.reduce((t,e)=>t+e.session_count,0)}getMaxSessionCount(){return Math.max(...this.statusData.nodes.map(t=>t.session_count))}getMaxPresenceCount(){return Math.max(...this.statusData.nodes.map(t=>t.presence_count))}getMaxMatchCount(){return Math.max(...this.statusData.nodes.map(t=>t.match_count))}getTotalMatchCount(){return this.statusData.nodes.reduce((t,e)=>t+e.match_count,0)}getMaxGoroutineCount(){return Math.max(...this.statusData.nodes.map(t=>t.goroutine_count))}getTotalGorountineCount(){return this.statusData.nodes.reduce((t,e)=>t+e.goroutine_count,0)}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-status"]],decls:62,vars:10,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"status-table","table","table-sm","table-striped","mb-4",3,"mouseover","mouseout"],[1,"thead-light"],["scope","col"],[4,"ngIf"],[3,"formGroup"],[1,"row","no-gutters","justify-content-end"],[1,"col-12","text-right"],["ngbDropdown","","role","group",1,"btn-group"],["formControlName","rangeMinutes",1,"custom-select","custom-select-sm","ml-3",3,"change"],[3,"value",4,"ngFor","ngForOf"],[1,"row"],[1,"col-6","d-inline-flex","justify-content-between","align-items-center"],[1,"graph-title"],[1,"d-inline"],[1,"col-6"],["class","graph",4,"ngIf"],[1,"row","mt-4"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","clickable",4,"ngFor","ngForOf"],[1,"border-0"],[1,"clickable"],[3,"ngSwitch"],["class","mr-2","src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",4,"ngSwitchCase"],["class","mr-2","src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",4,"ngSwitchCase"],["class","mr-2","src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",4,"ngSwitchCase"],["class","mr-2","src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",4,"ngSwitchCase"],[1,"text-muted","small",3,"hidden"],["src","/static/svg/green-tick.svg","alt","","width","15","height","","ngbTooltip","OK",1,"mr-2"],["src","/static/svg/red-triangle.svg","alt","","width","15","height","","ngbTooltip","Error",1,"mr-2"],["src","/static/blue-spinner.svg","alt","","width","15","height","","ngbTooltip","Connecting",1,"mr-2"],["src","/static/red-spinner.svg","alt","","width","15","height","","ngbTooltip","Disconnecting",1,"mr-2"],[3,"value"],[1,"graph"],["xAxisLabel","Time","yAxisLabel","Latency (ms)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["seriesTooltipTemplate",""],[1,"chart-legend"],[4,"ngFor","ngForOf"],[1,"legend-label-color",3,"ngStyle"],[1,"legend-label-text"],["xAxisLabel","Time","yAxisLabel","Request Count",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Input (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"],["xAxisLabel","Time","yAxisLabel","Output (kb/s)",3,"scheme","legend","showXAxisLabel","showYAxisLabel","animations","timeline","autoScale","xAxis","yAxis","yScaleMin","roundDomains","results"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Status"),Io(),Do(2,ML,4,2,"ngb-alert",1),Mo(3,"table",2),Vo("mouseover",function(){return e.showDelta=!0})("mouseout",function(){return e.showDelta=!1}),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Node name"),Io(),Mo(8,"th",4),va(9,"Sessions"),Io(),Mo(10,"th",4),va(11,"Presences"),Io(),Mo(12,"th",4),va(13,"Authoritative Matches"),Io(),Mo(14,"th",4),va(15,"Goroutines"),Io(),Io(),Io(),Do(16,BL,12,5,"tbody",5),Io(),Mo(17,"form",6),Mo(18,"div",7),Mo(19,"div",8),Mo(20,"span"),va(21,"View:"),Io(),Mo(22,"div",9),Mo(23,"select",10),Vo("change",function(t){return e.setRange(t)}),Do(24,UL,2,2,"option",11),function(t,e){const n=Me();let i;n.firstCreatePass?(i=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const i=e[n];if(t===i.name)return i}throw new ie("302",`The pipe '${t}' could not be found!`)}("sortNumbers",n.pipeRegistry),n.data[45]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(45,i.onDestroy)):i=n.data[45];const r=i.factory||(i.factory=ne(i.type)),s=bt(Ro);try{const t=An(!1),e=r();An(t),function(t,e,n,i){45>=t.data.length&&(t.data[45]=null,t.blueprint[45]=null),e[45]=i}(n,Le(),0,e)}finally{bt(s)}}(),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",12),Mo(27,"div",13),Mo(28,"div",14),Mo(29,"h5",15),va(30,"Processing Latency"),Io(),Mo(31,"small"),va(32," (ms)"),Io(),Io(),Io(),Mo(33,"div",13),Mo(34,"div",14),Mo(35,"h5",15),va(36,"Rate"),Io(),Mo(37,"small"),va(38," (rpc/s)"),Io(),Io(),Io(),Io(),Mo(39,"div",12),Mo(40,"div",16),Do(41,zL,4,12,"div",17),Io(),Mo(42,"div",16),Do(43,qL,4,12,"div",17),Io(),Io(),Mo(44,"div",18),Mo(45,"div",13),Mo(46,"div",14),Mo(47,"h5",15),va(48,"Input"),Io(),Mo(49,"small"),va(50," (kb/s)"),Io(),Io(),Io(),Mo(51,"div",13),Mo(52,"div",14),Mo(53,"h5",15),va(54,"Output"),Io(),Mo(55,"small"),va(56," (kb/s)"),Io(),Io(),Io(),Io(),Mo(57,"div",12),Mo(58,"div",16),Do(59,YL,4,12,"div",17),Io(),Mo(60,"div",16),Do(61,ZL,4,12,"div",17),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(14),Fo("ngIf",e.statusData),Qr(1),Fo("formGroup",e.rangeForm),Qr(7),Fo("ngForOf",function(t,e,n){const i=t+Kt,r=Le(),s=_e(r,i);return function(t,e){return wo.isWrapped(e)&&(e=wo.unwrap(e),t[je()]=Jr),e}(r,function(t,e){return t[1].data[e].pure}(r,i)?zl(r,He(),e,s.transform,n,s):s.transform(n))}(25,8,e.rangesKeys)),Qr(17),Fo("ngIf",e.latencyGraphData.length>0),Qr(2),Fo("ngIf",e.rateGraphData.length>0),Qr(16),Fo("ngIf",e.inputGraphData.length>0),Qr(2),Fo("ngIf",e.outputGraphData.length>0))},directives:function(){return[Bh,pb,Ry,mb,Kx,Uy,Ty,yb,Ph,_x,jh,zh,T_,Vy,Wy,CL,Wh]},pipes:function(){return[nM]},styles:[".graph[_ngcontent-%COMP%]{height:450px;border-radius:5px;border:1px solid #dadae9}.graph-title[_ngcontent-%COMP%]{padding:.5rem .5rem .5rem 0}.table[_ngcontent-%COMP%]{table-layout:fixed}h4[_ngcontent-%COMP%]{margin-bottom:0}.status-table[_ngcontent-%COMP%]{empty-cells:hide}.status-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:500}.status-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%], .status-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border:1px solid #dadae9;padding:.6em 1em}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%]{border:2px solid #dadae9;background-color:#f5f5f5}.status-table[_ngcontent-%COMP%] .total-row[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:2px solid #dadae9}"]}),t})(),eM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),nM=(()=>{class t{transform(t){return t.sort((t,e)=>t-e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe={type:(e={name:"sortNumbers",type:t,pure:!1}).type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null},t;var e})();var iM=n("ZR4k"),rM=n("Iab2");const sM=["fileSelector"];function oM(t,e){if(1&t&&(Mo(0,"div",8),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.dropZoneLabel)}}function aM(t,e){if(1&t){const t=No();Mo(0,"div"),Mo(1,"input",9),Vo("click",function(e){return Ie(t),zo(2).openFileSelector(e)}),Io(),Io()}if(2&t){const t=zo(2);Qr(1),Ko("value",t.browseBtnLabel),Fo("className",t.browseBtnClassName)}}function lM(t,e){if(1&t&&(Do(0,oM,2,1,"div",6),Do(1,aM,2,2,"div",7)),2&t){const t=zo();Fo("ngIf",t.dropZoneLabel),Qr(1),Fo("ngIf",t.showBrowseBtn)}}function cM(t,e){}const hM=function(t){return{openFileSelector:t}};class uM{constructor(t,e){this.relativePath=t,this.fileEntry=e}}let dM=(()=>{class t{constructor(t){this.template=t}}return t.\u0275fac=function(e){return new(e||t)(Ro(yl))},t.\u0275dir=Wt({type:t,selectors:[["","ngx-file-drop-content-tmp",""]]}),t})(),pM=(()=>{class t{constructor(t,e){this.zone=t,this.renderer=e,this.accept="*",this.directory=!1,this.multiple=!0,this.dropZoneLabel="",this.dropZoneClassName="ngx-file-drop__drop-zone",this.useDragEnter=!1,this.contentClassName="ngx-file-drop__content",this.showBrowseBtn=!1,this.browseBtnClassName="btn btn-primary btn-xs ngx-file-drop__browse-btn",this.browseBtnLabel="Browse files",this.onFileDrop=new Wl,this.onFileOver=new Wl,this.onFileLeave=new Wl,this.isDraggingOverDropZone=!1,this.globalDraggingInProgress=!1,this.files=[],this.numOfActiveReadEntries=0,this.helperFormEl=null,this.fileInputPlaceholderEl=null,this.dropEventTimerSubscription=null,this._disabled=!1,this.openFileSelector=t=>{this.fileSelector&&this.fileSelector.nativeElement&&this.fileSelector.nativeElement.click()},this.globalDragStartListener=this.renderer.listen("document","dragstart",t=>{this.globalDraggingInProgress=!0}),this.globalDragEndListener=this.renderer.listen("document","dragend",t=>{this.globalDraggingInProgress=!1})}get disabled(){return this._disabled}set disabled(t){this._disabled=null!=t&&""+t!="false"}ngOnDestroy(){this.dropEventTimerSubscription&&(this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=null),this.globalDragStartListener(),this.globalDragEndListener(),this.files=[],this.helperFormEl=null,this.fileInputPlaceholderEl=null}onDragOver(t){this.useDragEnter?this.preventAndStop(t):this.isDropzoneDisabled()||this.useDragEnter||(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragEnter(t){!this.isDropzoneDisabled()&&this.useDragEnter&&(this.isDraggingOverDropZone||(this.isDraggingOverDropZone=!0,this.onFileOver.emit(t)),this.preventAndStop(t))}onDragLeave(t){this.isDropzoneDisabled()||(this.isDraggingOverDropZone&&(this.isDraggingOverDropZone=!1,this.onFileLeave.emit(t)),this.preventAndStop(t))}dropFiles(t){if(!this.isDropzoneDisabled()&&(this.isDraggingOverDropZone=!1,t.dataTransfer)){let e;t.dataTransfer.dropEffect="copy",e=t.dataTransfer.items?t.dataTransfer.items:t.dataTransfer.files,this.preventAndStop(t),this.checkFiles(e)}}uploadFiles(t){!this.isDropzoneDisabled()&&t.target&&(this.checkFiles(t.target.files||[]),this.resetFileInput())}checkFiles(t){for(let e=0;e{t(n)}},e=new uM(t.name,t);this.addToQueue(e)}}this.dropEventTimerSubscription&&this.dropEventTimerSubscription.unsubscribe(),this.dropEventTimerSubscription=Bw(200,200).subscribe(()=>{if(this.files.length>0&&0===this.numOfActiveReadEntries){const t=this.files;this.files=[],this.onFileDrop.emit(t)}})}traverseFileTree(t,e){if(t.isFile){const n=new uM(e,t);this.files.push(n)}else{e+="/";const n=t.createReader();let i=[];const r=()=>{this.numOfActiveReadEntries++,n.readEntries(n=>{if(n.length)i=i.concat(n),r();else if(0===i.length){const n=new uM(e,t);this.zone.run(()=>{this.addToQueue(n)})}else for(let t=0;t{this.traverseFileTree(i[t],e+i[t].name)});this.numOfActiveReadEntries--})};r()}}resetFileInput(){if(this.fileSelector&&this.fileSelector.nativeElement){const t=this.fileSelector.nativeElement,e=t.parentElement,n=this.getHelperFormElement(),i=this.getFileInputPlaceholderElement();e!==n&&(this.renderer.insertBefore(e,i,t),this.renderer.appendChild(n,t),n.reset(),this.renderer.insertBefore(e,t,i),this.renderer.removeChild(e,i))}}getHelperFormElement(){return this.helperFormEl||(this.helperFormEl=this.renderer.createElement("form")),this.helperFormEl}getFileInputPlaceholderElement(){return this.fileInputPlaceholderEl||(this.fileInputPlaceholderEl=this.renderer.createElement("div")),this.fileInputPlaceholderEl}canGetAsEntry(t){return!!t.webkitGetAsEntry}isDropzoneDisabled(){return this.globalDraggingInProgress||this.disabled}addToQueue(t){this.files.push(t)}preventAndStop(t){t.stopPropagation(),t.preventDefault()}}return t.\u0275fac=function(e){return new(e||t)(Ro(Ic),Ro(Ga))},t.\u0275cmp=Bt({type:t,selectors:[["ngx-file-drop"]],contentQueries:function(t,e,n){if(1&t&&ac(n,dM,!0,yl),2&t){let t;ic(t=lc())&&(e.contentTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&rc(sM,!0),2&t){let t;ic(t=lc())&&(e.fileSelector=t.first)}},inputs:{accept:"accept",directory:"directory",multiple:"multiple",dropZoneLabel:"dropZoneLabel",dropZoneClassName:"dropZoneClassName",useDragEnter:"useDragEnter",contentClassName:"contentClassName",showBrowseBtn:"showBrowseBtn",browseBtnClassName:"browseBtnClassName",browseBtnLabel:"browseBtnLabel",disabled:"disabled"},outputs:{onFileDrop:"onFileDrop",onFileOver:"onFileOver",onFileLeave:"onFileLeave"},decls:7,vars:15,consts:[[3,"className","drop","dragover","dragenter","dragleave"],[3,"className"],["type","file",1,"ngx-file-drop__file-input",3,"accept","multiple","change"],["fileSelector",""],["defaultContentTemplate",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","ngx-file-drop__drop-zone-label",4,"ngIf"],[4,"ngIf"],[1,"ngx-file-drop__drop-zone-label"],["type","button",3,"className","value","click"]],template:function(t,e){if(1&t&&(Mo(0,"div",0),Vo("drop",function(t){return e.dropFiles(t)})("dragover",function(t){return e.onDragOver(t)})("dragenter",function(t){return e.onDragEnter(t)})("dragleave",function(t){return e.onDragLeave(t)}),Mo(1,"div",1),Mo(2,"input",2,3),Vo("change",function(t){return e.uploadFiles(t)}),Io(),Do(4,lM,2,2,"ng-template",null,4,dc),Do(6,cM,0,0,"ng-template",5),Io(),Io()),2&t){const t=To(5);ra("ngx-file-drop__drop-zone--over",e.isDraggingOverDropZone),Fo("className",e.dropZoneClassName),Qr(1),Fo("className",e.contentClassName),Qr(1),Fo("accept",e.accept)("multiple",e.multiple),ko("directory",e.directory||void 0)("webkitdirectory",e.directory||void 0)("mozdirectory",e.directory||void 0)("msdirectory",e.directory||void 0)("odirectory",e.directory||void 0),Qr(4),Fo("ngTemplateOutlet",e.contentTemplate||t)("ngTemplateOutletContext",Vl(13,hM,e.openFileSelector))}},directives:[Gh,Bh],styles:[".ngx-file-drop__drop-zone[_ngcontent-%COMP%]{border:2px dotted #0782d0;border-radius:30px;height:100px;margin:auto}.ngx-file-drop__drop-zone--over[_ngcontent-%COMP%]{background-color:hsla(0,0%,57.6%,.5)}.ngx-file-drop__content[_ngcontent-%COMP%]{align-items:center;color:#0782d0;display:flex;height:100px;justify-content:center}.ngx-file-drop__drop-zone-label[_ngcontent-%COMP%]{text-align:center}.ngx-file-drop__file-input[_ngcontent-%COMP%]{display:none}"]}),t})(),fM=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:function(){return[pM]}}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[],imports:[[qh]]}),t})();function gM(t,e){1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3,"Failed to retrieve configuration."),Io(),Io()),2&t&&Fo("dismissible",!1)}function mM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(2).$implicit;Fo("id",t.name),Qr(1),ya(t.value)}}function vM(t,e){1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t&&Fo("id",zo(2).$implicit.name)}function yM(t,e){if(1&t&&(Mo(0,"div",35),Mo(1,"b"),va(2),Io(),Mo(3,"label",27),Mo(4,"a",28),$o(5,"img",10),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.flatConfig[t+1].name),Qr(1),Fo("for",e.flatConfig[t+1].name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",e.flatConfig[t+1].name,"",nr)}}function bM(t,e){if(1&t&&(Mo(0,"span",33),va(1),Io()),2&t){const t=zo(3).index,e=zo();Fo("id",e.flatConfig[t+1].name),Qr(1),ya(e.flatConfig[t+1].value)}}function wM(t,e){if(1&t&&(Mo(0,"span",34),va(1,"(empty)"),Io()),2&t){const t=zo(3).index;Fo("id",zo().flatConfig[t+1].name)}}function xM(t,e){if(1&t&&(Mo(0,"div",36),Do(1,bM,2,2,"span",29),Do(2,wM,2,1,"span",30),Io()),2&t){const t=zo(2).index,e=zo();Qr(1),Fo("ngIf",!e.isEmpty(e.flatConfig[t+1].value)),Qr(1),Fo("ngIf",e.isEmpty(e.flatConfig[t+1].value))}}function _M(t,e){if(1&t&&(Mo(0,"div",26),Mo(1,"div",7),Mo(2,"b"),va(3),Io(),Mo(4,"label",27),Mo(5,"a",28),$o(6,"img",10),Io(),Io(),Io(),Mo(7,"div",7),Do(8,mM,2,2,"span",29),Do(9,vM,2,1,"span",30),Io(),Do(10,yM,6,3,"div",31),Do(11,xM,3,2,"div",32),Io()),2&t){const t=zo(),e=t.index,n=t.$implicit,i=zo();ra("border-top-0",e>0),Qr(3),ya(n.name),Qr(1),Fo("for",n.name),Qr(1),Xo("href","https://heroiclabs.com/docs/install-configuration/#",n.value.name,"",nr),Qr(3),Fo("ngIf",!i.isEmpty(n.value)),Qr(1),Fo("ngIf",i.isEmpty(n.value)),Qr(1),Fo("ngIf",e{class t{constructor(t,e,n,i,r,s){this.config=t,this.route=e,this.httpClient=n,this.modalService=i,this.consoleService=r,this.formBuilder=s,this.configError="",this.uploadError="",this.deleteError="",this.uploading=!1,this.uploadSuccess=!1,this.deleteSuccess=!1,this.deleting=!1,this.apiConfig=t}ngOnInit(){this.route.data.subscribe(t=>{this.nakamaVersion=t[0].server_version;const e=JSON.parse(t[0].config);this.jsonConfig=e,this.flatConfig=this.flattenConfig(e)},t=>{this.configError=t}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])]})}flattenConfig(t){const e=[];return this.traverseConfig("",t,e),e.sort((t,e)=>t.name.localeCompare(e.name))}traverseConfig(t,e,n){for(const i in e)"env"!==i&&(Array.isArray(e[i])?n.push({name:t+i,value:e[i].join(", ")}):"object"==typeof e[i]?this.traverseConfig(i+".",e[i],n):n.push({name:t+i,value:e[i]}))}isEmpty(t){return""===t||0===t}exportYaml(){const t=new Blob([Object(iM.safeDump)(this.jsonConfig)],{type:"text/yaml;charset=utf-8"});rM.saveAs(t,"config.yaml")}dropped(t){this.uploadError="",this.uploadSuccess=!1;for(const e of t)if(e.fileEntry.isFile){const t=e.fileEntry.name.split("."),n=["json","csv"];t.length>1&&n.includes(t[t.length-1].toLowerCase())?e.fileEntry.file(t=>{this.uploadFile(t)}):this.uploadError="Invalid file: must have extension .json or .csv"}}uploadFile(t){const e=new FormData;e.append(t.name,t),this.uploading=!0,this.httpClient.post(this.apiConfig.host+"/v2/console/storage/import",e,{headers:{Authorization:"Bearer "}}).subscribe(()=>{this.uploading=!1,this.uploadSuccess=!0},t=>{this.uploading=!1,this.uploadError=t})}deleteData(){this.deleteError="",this.deleting=!0,this.consoleService.deleteAllData("").pipe(sx(2e3)).subscribe(()=>{this.deleting=!1,this.deleteError="",this.deleteSuccess=!0},t=>{this.deleting=!1,this.deleteError=t})}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}get f(){return this.confirmDeleteForm.controls}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(uw),Ro(pm),Ro(qb),Ro(a_),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:43,vars:11,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"pb-4"],[1,"d-flex","justify-content-between","mb-4","align-items-baseline"],[1,"btn","btn-primary","btn-sm",3,"click"],[1,"config-table"],[4,"ngFor","ngForOf"],[1,"row","py-2","border","border-top-0","add-border-larger","mb-5"],[1,"col-lg-3"],[1,"pl-1"],["target","_blank","href","https://heroiclabs.com/docs/install-configuration/#runtime.env",1,"d-inline"],["src","/static/svg/hint.svg","alt","","width","16","height",""],[1,"col-lg-9"],[4,"ngIf"],[1,"section-divider","d-flex","mb-4"],["type","success",3,"dismissible","close",4,"ngIf"],["accept",".json,.csv","dropZoneClassName","drop-zone","contentClassName","drop-zone-content","dropZoneLabel","Drop CSV or JSON file here",3,"disabled","onFileDrop"],["ngx-file-drop-content-tmp",""],["role","alert",1,"alert","alert-danger","d-flex","justify-content-between","align-items-center"],["src","/static/svg/red-triangle.svg","alt","","width","16","height",""],[1,"pl-2"],["confirmDelete",""],["type","button",1,"btn","btn-danger",3,"disabled","click"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["class","row py-2 border",3,"border-top-0",4,"ngIf"],[1,"row","py-2","border"],[1,"pl-1",3,"for"],["target","_blank",1,"d-inline",3,"href"],["class","text-break-all",3,"id",4,"ngIf"],["class","text-muted",3,"id",4,"ngIf"],["class","col-md-3 left-line",4,"ngIf"],["class","col-md-3",4,"ngIf"],[1,"text-break-all",3,"id"],[1,"text-muted",3,"id"],[1,"col-md-3","left-line"],[1,"col-md-3"],["class","mb-0 text-break-all",4,"ngFor","ngForOf"],[1,"mb-0","text-break-all"],[1,"mb-0","text-muted"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"click"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],[1,"mt-2"],["autocomplete","off",3,"formGroup"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,e){if(1&t){const t=No();Do(0,gM,4,1,"ngb-alert",0),Mo(1,"h2",1),va(2,"Server Configuration"),Io(),Mo(3,"div",2),Mo(4,"h5"),Mo(5,"b"),va(6,"Server version:"),Io(),va(7),Io(),Mo(8,"button",3),Vo("click",function(){return e.exportYaml()}),va(9,"Export Configuration"),Io(),Io(),Mo(10,"div",4),Do(11,CM,2,1,"ng-container",5),Mo(12,"div",6),Mo(13,"div",7),Mo(14,"b"),va(15,"runtime.env"),Io(),Mo(16,"label",8),Mo(17,"a",9),$o(18,"img",10),Io(),Io(),Io(),Mo(19,"div",11),Do(20,EM,2,1,"div",12),Do(21,kM,3,0,"div",12),Io(),Io(),Io(),Mo(22,"h5",13),va(23,"Import storage data"),Io(),Mo(24,"p"),va(25,"Import storage objects from a CSV or JSON file by dragging and dropping it below."),Io(),Do(26,AM,6,2,"ngb-alert",0),Do(27,DM,4,1,"ngb-alert",14),Mo(28,"ngx-file-drop",15),Vo("onFileDrop",function(t){return e.dropped(t)}),Do(29,TM,2,0,"ng-template",16),Io(),Mo(30,"h5",13),va(31,"Delete all data"),Io(),Do(32,RM,6,2,"ngb-alert",0),Do(33,FM,4,1,"ngb-alert",14),Mo(34,"div",17),Mo(35,"div"),$o(36,"img",18),Mo(37,"small",19),va(38,"Warning - this operation is not reversible!"),Io(),Io(),Do(39,MM,19,5,"ng-template",null,20,dc),Mo(41,"button",21),Vo("click",function(){Ie(t);const n=To(40);return e.openDeleteDataModal(n)}),va(42,"Delete all"),Io(),Io()}2&t&&(Fo("ngIf",e.configError),Qr(7),ba(" ",e.nakamaVersion,""),Qr(4),Fo("ngForOf",e.flatConfig),Qr(9),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&e.jsonConfig.runtime.env.length>0),Qr(1),Fo("ngIf",e.jsonConfig.runtime&&e.jsonConfig.runtime.env&&0===e.jsonConfig.runtime.env.length),Qr(5),Fo("ngIf",e.uploadError),Qr(1),Fo("ngIf",e.uploadSuccess),Qr(1),Fo("disabled",e.uploading),Qr(4),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(8),Fo("disabled",e.deleting))},directives:[Bh,Ph,pM,dM,_x,pb,Ry,mb,ay,Ty,yb,$h],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.text-break-all[_ngcontent-%COMP%]{word-break:break-all;word-wrap:anywhere}.config-table[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]:nth-child(2n){background-color:#fafafc}.config-table[_ngcontent-%COMP%] .left-line[_ngcontent-%COMP%]{border-left:1px solid #dadae9}"]}),t})(),$M=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getConfig("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function OM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function PM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",51),va(2,"No additional users are setup. Create a new user below."),Io(),Io()),2&t&&(Qr(1),Fo("colSpan",4))}function NM(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Mo(6,"span",36),va(7,"Administrator"),Io(),Mo(8,"span",36),va(9,"Developer"),Io(),Mo(10,"span",36),va(11,"Maintainer"),Io(),Mo(12,"span",36),va(13,"View Only"),Io(),Io(),Mo(14,"td"),Mo(15,"button",52),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().deleteUser(n.username)}),va(16,"Delete"),Io(),Io(),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.username),Qr(2),ya(t.email),Qr(2),Fo("hidden",t.role!==n.adminRole),Qr(2),Fo("hidden",t.role!==n.developerRole),Qr(2),Fo("hidden",t.role!==n.maintainerRole),Qr(2),Fo("hidden",t.role!==n.readonlyRole)}}function BM(t,e){if(1&t&&(Mo(0,"ngb-alert",48),$o(1,"img",49),Mo(2,"h6",50),va(3,"An error occurred:"),Io(),Mo(4,"p",53),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.userCreateError)}}const UM=function(t){return{"is-invalid":t}};let VM=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.formBuilder=n,this.error="",this.userCreateError="",this.users=[],this.adminRole=cw.USER_ROLE_ADMIN,this.developerRole=cw.USER_ROLE_DEVELOPER,this.maintainerRole=cw.USER_ROLE_MAINTAINER,this.readonlyRole=cw.USER_ROLE_READONLY}ngOnInit(){this.createUserForm=this.formBuilder.group({username:["",py.required],email:["",[py.required,py.email]],password:["",py.compose([py.required,py.minLength(8)])],role:[+this.readonlyRole,py.required],newsletter:[!1]}),this.route.data.subscribe(t=>{const e=t[0];this.users.length=0,this.users.push(...e.users)},t=>{this.error=t})}deleteUser(t){this.error="",this.consoleService.deleteUser("",t).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(t=>{this.error="",this.users.length=0,this.users.push(...t.users)},t=>{this.error=t})}addUser(){this.userCreateError="",this.createUserForm.disable();let t=cw.USER_ROLE_READONLY;switch(this.f.role.value){case 1:t=cw.USER_ROLE_ADMIN;break;case 2:t=cw.USER_ROLE_DEVELOPER;break;case 3:t=cw.USER_ROLE_MAINTAINER;break;case 4:t=cw.USER_ROLE_READONLY}this.consoleService.addUser("",{username:this.f.username.value,email:this.f.email.value,password:this.f.password.value,role:t,newsletter_subscription:this.f.newsletter.value}).pipe(U(()=>this.consoleService.listUsers(""))).subscribe(e=>{this.userCreateError="",this.createUserForm.reset({role:+t}),this.createUserForm.enable(),this.users.length=0,this.users.push(...e.users)},t=>{this.userCreateError=t,this.createUserForm.enable()})}get f(){return this.createUserForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["app-users"]],decls:121,vars:24,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"user-details","mb-5","table","table-bordered","table-sm","table-striped"],[1,"thead-light"],[2,"width","400px"],[2,"width","300px"],[2,"width","90px"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"section-divider","d-flex","mb-4"],[1,"mb-4","alert-permissions",3,"type"],[1,"alert-title","font-weight-bold"],[1,"d-flex","flex-wrap","flex-row"],[1,"col","col-md-3","p-4","flex-fill","flex-grow-1"],[1,"d-flex","align-items-center","mb-3"],["src","/static/svg/role-admin.svg","alt","","width","30","height","",1,"mr-2"],[1,"m-0","font-weight-bold"],["src","/static/svg/role-developer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-maintainer.svg","alt","","width","30","height","",1,"mr-2"],["src","/static/svg/role-viewonly.svg","alt","","width","30","height","",1,"mr-2"],[1,"add-border","rounded"],[3,"formGroup","ngSubmit"],[1,"row","no-gutters"],[1,"col","d-flex","justify-content-between","align-items-center"],[1,"col-md-3"],["for","email",1,"d-inline"],[1,"col-md-9","ml-0","p-0"],["type","email","id","email","placeholder","email@example.com","required","","formControlName","email",1,"form-control",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control",3,"ngClass"],["for","password",1,"d-inline"],["type","password","id","password","placeholder","Password","required","","formControlName","password",1,"form-control",3,"ngClass"],[1,"d-inline"],[1,"btn-group"],["disabled","",1,"btn","btn-outline-dark","disabled"],[3,"hidden"],["ngbDropdown","","role","group",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","add-border-single-row-bottom","mb-4"],[1,"col","d-flex","align-items-center"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","newsletter","formControlName","newsletter",1,"custom-control-input","mr-2","my-2"],["for","newsletter",1,"form-check-label","custom-control-label"],[1,""],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"text-muted",3,"colSpan"],["type","button",1,"btn","btn-danger","btn-outline-dark",3,"click"],[1,"mb-0","pl-4"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Management"),Io(),Do(2,OM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th",4),va(7,"Username"),Io(),Mo(8,"th"),va(9,"Email"),Io(),Mo(10,"th",5),va(11,"Role"),Io(),Mo(12,"th",6),va(13,"Action"),Io(),Io(),Io(),Mo(14,"tbody"),Do(15,PM,3,1,"tr",7),Do(16,NM,17,6,"tr",8),Io(),Io(),Mo(17,"h5",9),va(18,"Add new user"),Io(),Mo(19,"ngb-alert",10),Mo(20,"h6",11),va(21,"User roles"),Io(),Mo(22,"div",12),Mo(23,"div",13),Mo(24,"div",14),$o(25,"img",15),Mo(26,"h6",16),va(27,"Administrator"),Io(),Io(),Mo(28,"small"),va(29," Owners have complete control over the server, its users and resources. "),Io(),Io(),Mo(30,"div",13),Mo(31,"div",14),$o(32,"img",17),Mo(33,"h6",16),va(34,"Developer"),Io(),Io(),Mo(35,"small"),va(36," Like Administrators, Developers have complete control over the server, resources and data. However they cannot add, change or delete console users. "),Io(),Io(),Mo(37,"div",13),Mo(38,"div",14),$o(39,"img",18),Mo(40,"h6",16),va(41,"Maintainer"),Io(),Io(),Mo(42,"small"),va(43," Maintainers have access to adding, changing and delete client resources such as accounts, storage and leaderboard records. They don't have access to the API Explorer or the console users. "),Io(),Io(),Mo(44,"div",13),Mo(45,"div",14),$o(46,"img",19),Mo(47,"h6",16),va(48,"View Only"),Io(),Io(),Mo(49,"small"),va(50," View Only users can only view client resources but cannot make any changes to the data whatsoever. "),Io(),Io(),Io(),Io(),Do(51,BM,6,2,"ngb-alert",1),Mo(52,"div",20),Mo(53,"form",21),Vo("ngSubmit",function(){return e.addUser()}),Mo(54,"div",22),Mo(55,"div",23),Mo(56,"div",24),Mo(57,"label",25),va(58,"Email"),Io(),Io(),Mo(59,"div",26),$o(60,"input",27),Mo(61,"div",28),va(62,"Email is required"),Io(),Io(),Io(),Io(),Mo(63,"div",22),Mo(64,"div",23),Mo(65,"div",24),Mo(66,"label",29),va(67,"Username"),Io(),Io(),Mo(68,"div",26),$o(69,"input",30),Mo(70,"div",28),va(71,"Username is required"),Io(),Io(),Io(),Io(),Mo(72,"div",22),Mo(73,"div",23),Mo(74,"div",24),Mo(75,"label",31),va(76,"Password"),Io(),Io(),Mo(77,"div",26),$o(78,"input",32),Mo(79,"div",28),va(80,"Password is required, must be 8 chars or longer and consist of at least a capital letter, a small letter and a number."),Io(),Io(),Io(),Io(),Mo(81,"div",22),Mo(82,"div",23),Mo(83,"div",24),Mo(84,"label",33),va(85,"Role"),Io(),Io(),Mo(86,"div",26),Mo(87,"div",34),Mo(88,"button",35),Mo(89,"span",36),va(90,"Administrator"),Io(),Mo(91,"span",36),va(92,"Developer"),Io(),Mo(93,"span",36),va(94,"Maintainer"),Io(),Mo(95,"span",36),va(96,"View Only"),Io(),Io(),Mo(97,"div",37),$o(98,"button",38),Mo(99,"div",39),Mo(100,"button",40),Vo("click",function(){return e.f.role.setValue(+e.adminRole)}),va(101,"Administrator"),Io(),Mo(102,"button",40),Vo("click",function(){return e.f.role.setValue(+e.developerRole)}),va(103,"Developer"),Io(),Mo(104,"button",40),Vo("click",function(){return e.f.role.setValue(+e.maintainerRole)}),va(105,"Maintainer"),Io(),Mo(106,"button",40),Vo("click",function(){return e.f.role.setValue(+e.readonlyRole)}),va(107,"View Only"),Io(),Io(),Io(),Io(),Mo(108,"div",28),va(109,"Role is required"),Io(),Io(),Io(),Io(),Mo(110,"div",41),Mo(111,"div",42),$o(112,"div",24),Mo(113,"div",26),Mo(114,"div",43),$o(115,"input",44),Mo(116,"label",45),va(117,"Subscribe to Heroic Labs' newsletters to receive latest updates to Nakama and other news."),Io(),Io(),Io(),Io(),Io(),Mo(118,"div",46),Mo(119,"button",47),va(120,"Save"),Io(),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",0===e.users.length),Qr(1),Fo("ngForOf",e.users),Qr(3),Fo("type","secondary"),Qr(32),Fo("ngIf",e.userCreateError),Qr(2),Fo("formGroup",e.createUserForm),Qr(7),Fo("ngClass",Vl(18,UM,e.f.email.dirty&&e.f.email.errors)),Qr(1),Fo("hidden",e.f.email.disabled||e.f.email.valid||e.f.email.pristine),Qr(8),Fo("ngClass",Vl(20,UM,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(8),Fo("ngClass",Vl(22,UM,e.f.password.dirty&&e.f.password.errors)),Qr(1),Fo("hidden",e.f.password.disabled||e.f.password.valid||e.f.password.pristine),Qr(10),Fo("hidden",e.f.role.value!==+e.adminRole),Qr(2),Fo("hidden",e.f.role.value!==+e.developerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.maintainerRole),Qr(2),Fo("hidden",e.f.role.value!==+e.readonlyRole),Qr(13),Fo("hidden",e.f.role.disabled||e.f.role.valid||e.f.role.pristine),Qr(11),Fo("disabled",e.createUserForm.invalid))},directives:[Bh,Ph,_x,pb,Ry,mb,ay,wb,Ty,yb,$h,Kx,qx,Wx,zx,ry],styles:[".user-details[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.user-details[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.user-details[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.6em 1em}.alert-permissions[_ngcontent-%COMP%]{padding:0}.alert-permissions[_ngcontent-%COMP%] .alert-title[_ngcontent-%COMP%]{padding:1rem}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%]{border-top:1px solid #dadae9;margin:0}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]{border-right:1px solid #dadae9}.alert-permissions[_ngcontent-%COMP%] .flex-row[_ngcontent-%COMP%] .col[_ngcontent-%COMP%]:last-child{border-right:none}"]}),t})(),HM=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listUsers("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jM(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Failed to retrieve runtime information: ",t.error,"")}}function zM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function WM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Go modules were found."),Io(),$o(3,"td"),Io())}function GM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function qM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No Lua modules were found."),Io(),$o(3,"td"),Io())}function KM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",13),va(4),Io(),Io()),2&t){const t=e.$implicit;Qr(2),ya(t.path),Qr(2),ya(t.mod_time)}}function XM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No JavaScript modules were found."),Io(),$o(3,"td"),Io())}const YM=function(){return["/apiexplorer"]},JM=function(t){return{endpoint:t}};function QM(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function ZM(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Go RPC functions were found."),Io(),Io())}function tI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function eI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No Lua RPC functions were found."),Io(),Io())}function nI(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Mo(2,"code"),va(3),Io(),Io(),Mo(4,"td",15),Mo(5,"a",16),va(6,"API Explorer"),Io(),Io(),Io()),2&t){const t=e.$implicit;Qr(3),ya(t),Qr(2),Fo("routerLink",Ul(3,YM))("queryParams",Vl(4,JM,t))}}function iI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",17),va(2,"No JavaScript RPC functions were found."),Io(),Io())}let rI=(()=>{class t{constructor(t,e){this.route=t,this.consoleService=e,this.error=""}ngOnInit(){this.route.data.subscribe(t=>{this.runtimeInfo=t[0]},t=>{this.error=t})}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:51,vars:13,consts:[[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"runtime-table","mb-4","table","table-sm","table-bordered","mb-5"],[1,"thead-light"],[2,"width","180px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["colspan","2"],[1,"mb-4","section-divider","d-flex"],[1,"runtime-table","table","table-sm","table-bordered"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","200px"],[1,"text-muted"],[2,"width","180px","text-align","center"],[1,"btn","btn-sm","btn-secondary",3,"routerLink","queryParams"],["colspan","2",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Runtime Modules"),Io(),Do(2,jM,4,2,"ngb-alert",1),Mo(3,"table",2),Mo(4,"thead",3),Mo(5,"tr"),Mo(6,"th"),va(7,"Go Modules"),Io(),Mo(8,"th",4),va(9,"Last Modified"),Io(),Io(),Io(),Mo(10,"tbody"),Do(11,zM,5,2,"tr",5),Do(12,WM,4,0,"tr",6),Io(),Mo(13,"thead",3),Mo(14,"tr"),Mo(15,"th",7),va(16,"Lua Modules"),Io(),Io(),Io(),Mo(17,"tbody"),Do(18,GM,5,2,"tr",5),Do(19,qM,4,0,"tr",6),Io(),Mo(20,"thead",3),Mo(21,"tr"),Mo(22,"th",7),va(23,"JavaScript Modules"),Io(),Io(),Io(),Mo(24,"tbody"),Do(25,KM,5,2,"tr",5),Do(26,XM,4,0,"tr",6),Io(),Io(),Mo(27,"h4",8),va(28,"Registered RPC Functions"),Io(),Mo(29,"table",9),Mo(30,"thead",3),Mo(31,"tr"),Mo(32,"th",7),va(33,"Go RPC Functions"),Io(),Io(),Io(),Mo(34,"tbody"),Do(35,QM,7,6,"tr",5),Do(36,ZM,3,0,"tr",6),Io(),Mo(37,"thead",3),Mo(38,"tr"),Mo(39,"th",7),va(40,"Lua RPC Functions"),Io(),Io(),Io(),Mo(41,"tbody"),Do(42,tI,7,6,"tr",5),Do(43,eI,3,0,"tr",6),Io(),Mo(44,"thead",3),Mo(45,"tr"),Mo(46,"th",7),va(47,"JavaScript RPC Functions"),Io(),Io(),Io(),Mo(48,"tbody"),Do(49,nI,7,6,"tr",5),Do(50,iI,3,0,"tr",6),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(9),Fo("ngForOf",e.runtimeInfo.go_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_modules.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_modules),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_modules.length),Qr(9),Fo("ngForOf",e.runtimeInfo.go_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.go_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.lua_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.lua_rpc_functions.length),Qr(6),Fo("ngForOf",e.runtimeInfo.js_rpc_functions),Qr(1),Fo("ngIf",0===e.runtimeInfo.js_rpc_functions.length))},directives:[Bh,Ph,_x,Mv],styles:["label[_ngcontent-%COMP%]{margin-bottom:0}.opaque[_ngcontent-%COMP%]{opacity:1%}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.runtime-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#fff}.runtime-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:.6em 1em;font-weight:500}.runtime-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-left:1em;padding-right:1em;vertical-align:middle}"]}),t})(),sI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getRuntime("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function oI(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by collection"),Io())}function aI(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.f.collection.value)}}function lI(t,e){if(1&t){const t=No();Mo(0,"button",34),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().f.collection.setValue(n)}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function cI(t,e){if(1&t&&(Mo(0,"ngb-alert",35),$o(1,"img",36),Mo(2,"h6",37),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying storage objects: ",t.error,"")}}function hI(t,e){1&t&&(Mo(0,"th",38),va(1,"Remove"),Io())}function uI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",39),va(2,"No storage objects found - change the filter criteria or add new objects."),Io(),Io())}function dI(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteObject(e,i,r)}),va(2,"Delete"),Io(),Io()}}function pI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(2),Io(),Mo(3,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(4),Io(),Mo(5,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(6),Io(),Mo(7,"td",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewObject(n)}),va(8),Io(),Do(9,dI,3,0,"td",41),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.collection),Qr(2),ya(t.key),Qr(2),ya(t.user_id),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let fI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.collections=[],this.objects=[],this.objectCount=0,this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({collection:[""],key:[""],user_id:[""]});const t=this.route.snapshot.queryParamMap;this.f.collection.setValue(t.get("collection")),this.f.key.setValue(t.get("key")),this.f.user_id.setValue(t.get("user_id")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.collection.value||this.f.user_id.value)&&this.search(0),this.route.data.subscribe(t=>{this.collections.length=0,this.collections.push(...t[0].collections),this.objectCount=t[1].total_count,this.nextCursor=t[1].next_cursor,this.prevCursor=t[1].prev_cursor,this.objects.length=0,this.objects.push(...t[1].objects)},t=>{this.error=t})}disableSearch(){return!(!this.f.key.value||""===this.f.key.value||this.f.collection.value&&""!==this.f.collection.value)}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listStorage("",this.f.user_id.value,this.f.key.value,this.f.collection.value,e).subscribe(t=>{this.error="",this.objectCount=t.total_count,this.nextCursor=t.next_cursor,this.objects.length=0,this.objects.push(...t.objects),this.router.navigate([],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteObject(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteStorageObject("",n.collection,n.key,n.user_id,n.version).subscribe(()=>{this.error="",this.objectCount--,this.objects.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}viewObject(t){this.router.navigate(["/storage",t.collection,t.key,t.user_id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:50,vars:15,consts:[[1,"pb-1"],[1,"pb-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius",3,"disabled"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",1,"btn","btn-secondary","text-secondary",3,"hidden","click"],[1,"dropdown-divider",3,"hidden"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","text","formControlName","key","placeholder","Filter by key",1,"form-control"],["type","text","formControlName","user_id","placeholder","Filter by user ID",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","submit",1,"btn","btn-primary",3,"disabled","click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Storage Objects"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"button",9),Do(12,oI,2,0,"span",10),Do(13,aI,2,1,"span",10),Io(),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.collection.reset()}),va(16,"\u2718 Deselect collection"),Io(),$o(17,"div",13),Do(18,lI,2,1,"button",14),Io(),Io(),Io(),$o(19,"input",15),$o(20,"input",16),Mo(21,"div",17),Mo(22,"span",18),Vo("click",function(){return e.f.user_id.setValue(e.systemUserId)}),$o(23,"img",19),Io(),Io(),Mo(24,"div",17),Mo(25,"button",20),Vo("click",function(){return e.search(0)}),va(26,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(27,"div",21),Mo(28,"div",22),Mo(29,"button",23),Vo("click",function(){return e.search(0)}),$o(30,"img",24),Io(),Mo(31,"button",23),Vo("click",function(){return e.search(1)}),$o(32,"img",25),Io(),Io(),Io(),Io(),Io(),Do(33,cI,4,2,"ngb-alert",26),Mo(34,"div",27),Mo(35,"table",28),Mo(36,"thead",29),Mo(37,"tr"),Mo(38,"th"),va(39,"Collection Name"),Io(),Mo(40,"th"),va(41,"Key Name"),Io(),Mo(42,"th",30),va(43,"User ID"),Io(),Mo(44,"th",31),va(45,"Last Update"),Io(),Do(46,hI,2,0,"th",32),Io(),Io(),Mo(47,"tbody"),Do(48,uI,3,0,"tr",10),Do(49,pI,10,5,"tr",33),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.objectCount," objects found."),Qr(4),Fo("formGroup",e.searchForm),Qr(4),Fo("disabled",0===e.collections.length),Qr(1),Fo("ngIf",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngIf",e.f.collection.value&&""!==e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(2),Fo("hidden",!e.f.collection.value||""===e.f.collection.value),Qr(1),Fo("ngForOf",e.collections),Qr(7),Fo("disabled",e.disableSearch()),Qr(4),Fo("disabled",0===e.objects.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.objects.length),Qr(1),Fo("ngForOf",e.objects))},directives:[pb,Ry,mb,Kx,qx,Bh,Wx,zx,Ph,ay,Ty,yb,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),gI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listStorageCollections("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})(),mI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("collection"),i=t.queryParamMap.get("key"),r=t.queryParamMap.get("user_id");return this.consoleService.listStorage("",r,i,n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var vI=n("bU/s");const yI=["editor"];function bI(t,e){if(1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",39),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while modifying storage object: ",t.error,"")}}function wI(t,e){1&t&&(Mo(0,"ngb-alert",40),$o(1,"img",41),Mo(2,"h6",39),va(3,"Storage object was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function xI(t,e){1&t&&(Mo(0,"span"),va(1,"Save as a copy"),Io())}function _I(t,e){1&t&&va(0,"Save")}function CI(t,e){if(1&t&&(Mo(0,"button",42),Do(1,xI,2,0,"span",43),Do(2,_I,1,0,"ng-template",null,44,dc),Io()),2&t){const t=To(3),e=zo();Fo("disabled",e.updating),Qr(1),Fo("ngIf",e.object.collection!==e.f.collection.value||e.object.key!==e.f.keyname.value||e.object.user_id!==e.f.user_id.value)("ngIfElse",t)}}const SI=function(){return["/storage"]},EI=function(t){return{collection:t}},kI=function(t,e){return{collection:t,key:e}},AI=function(t,e,n){return{collection:t,key:e,user_id:n}},DI=function(t){return{"is-invalid":t}};let TI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.objectForm=this.formBuilder.group({collection:["",py.required],keyname:["",py.required],user_id:["",py.required],permission_read:[0,py.required],permission_write:[0,py.required]}),this.route.data.subscribe(t=>{this.object=t[0],this.f.collection.setValue(this.object.collection),this.f.keyname.setValue(this.object.key),this.f.user_id.setValue(this.object.user_id),this.f.permission_read.setValue(this.object.permission_read),this.f.permission_write.setValue(this.object.permission_write),this.updateAllowed()||this.objectForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.object.value),null,2);this.aceEditor.session.setValue(t)}updateObject(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(n){return this.error=n,void(this.updating=!1)}let e=this.object.version;this.object.collection===this.f.collection.value&&this.object.key===this.f.keyname.value&&this.object.user_id===this.f.user_id.value||(e=""),this.consoleService.writeStorageObject("",this.f.collection.value,this.f.keyname.value,this.f.user_id.value,{version:e,value:t,permission_read:this.f.permission_read.value,permission_write:this.f.permission_write.value}).subscribe(t=>{this.updated=!0,this.updating=!1,this.object.version=t.version,""===e&&(this.object.collection=this.f.collection.value,this.object.key=this.f.keyname.value,this.object.user_id=this.f.user_id.value,this.object.permission_read=this.f.permission_read.value,this.object.permission_write=this.f.permission_write.value)},t=>{this.error=t,this.updating=!1})}deleteObject(){this.error="",this.updated=!1,this.updating=!1;const t=this.object;this.consoleService.deleteStorageObject("",t.collection,t.key,t.user_id,t.version).subscribe(()=>{this.router.navigate(["/storage"],{relativeTo:this.route,queryParams:{collection:this.f.collection.value,key:this.f.key.value,user_id:this.f.user_id.value}})},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.objectForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(yI,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:88,vars:50,consts:[[1,"pb-1"],[1,"storage-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink","queryParams"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","collection",1,"d-inline"],["type","text","id","collection","placeholder","Collection","required","","formControlName","collection",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","key",1,"d-inline"],["type","text","id","key","placeholder","Key","required","","formControlName","keyname",1,"form-control","form-control-sm","my-2",3,"ngClass"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","required","","formControlName","user_id",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","permission_read",1,"d-inline"],["ngbRadioGroup","","id","permission_read","name","permission_read","formControlName","permission_read",1,"btn-group","btn-group-toggle"],["ngbButtonLabel","",1,"btn-outline-secondary"],["ngbButton","","type","radio",3,"disabled","value"],["for","version",1,"d-inline"],["type","text","id","version","placeholder","Version","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","permission_write",1,"d-inline"],["ngbRadioGroup","","id","permission_write","name","permission_write","formControlName","permission_write",1,"btn-group","btn-group-toggle"],[1,"row","add-border-single-row-bottom","mb-3"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mt-3","mb-3",2,"height","500px"],[2,"height","500px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"],[4,"ngIf","ngIfElse"],["elseBlock",""]],template:function(t,e){var n,i,r,s,o,a;1&t&&(Mo(0,"h2",0),va(1,"Storage Object"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),va(6,"Storage"),Io(),Mo(7,"li",4),Mo(8,"a",5),va(9),Io(),Io(),Mo(10,"li",4),Mo(11,"a",5),va(12),Io(),Io(),Mo(13,"li",4),Mo(14,"a",5),va(15),Io(),Io(),Io(),Io(),Io(),Do(16,bI,4,2,"ngb-alert",6),Do(17,wI,4,1,"ngb-alert",7),Mo(18,"form",8),Vo("ngSubmit",function(){return e.updateObject()}),Mo(19,"div",9),Mo(20,"div",10),Mo(21,"div",11),Mo(22,"label",12),va(23,"Collection"),Io(),Io(),$o(24,"input",13),Mo(25,"div",14),va(26,"Collection is required"),Io(),Io(),Mo(27,"div",10),Mo(28,"div",11),Mo(29,"label",15),va(30,"Key"),Io(),Io(),$o(31,"input",16),Mo(32,"div",14),va(33,"Key is required"),Io(),Io(),Io(),Mo(34,"div",9),Mo(35,"div",10),Mo(36,"div",11),Mo(37,"label",17),va(38,"User ID"),Io(),Io(),$o(39,"input",18),Mo(40,"div",14),va(41,"User ID is required"),Io(),Io(),Mo(42,"div",19),Mo(43,"div",11),Mo(44,"label",20),va(45,"Read Permission"),Io(),Io(),Mo(46,"div",21),Mo(47,"label",22),$o(48,"input",23),va(49," No Read "),Io(),Mo(50,"label",22),$o(51,"input",23),va(52," Owner Read "),Io(),Mo(53,"label",22),$o(54,"input",23),va(55," Public Read "),Io(),Io(),Io(),Io(),Mo(56,"div",9),Mo(57,"div",10),Mo(58,"div",11),Mo(59,"label",24),va(60,"Version"),Io(),Io(),$o(61,"input",25),Io(),Mo(62,"div",19),Mo(63,"div",11),Mo(64,"label",26),va(65,"Write Permission"),Io(),Io(),Mo(66,"div",27),Mo(67,"label",22),$o(68,"input",23),va(69," No Write "),Io(),Mo(70,"label",22),$o(71,"input",23),va(72," Owner Write "),Io(),Io(),Io(),Io(),Mo(73,"div",28),Mo(74,"div",10),Mo(75,"div",11),Mo(76,"label",29),va(77,"Create Time"),Io(),Io(),$o(78,"input",30),Io(),Mo(79,"div",10),Mo(80,"div",11),Mo(81,"label",31),va(82,"Update Time"),Io(),Io(),$o(83,"input",32),Io(),Io(),Mo(84,"div",33),$o(85,"div",34,35),Io(),Do(87,CI,4,3,"button",36),Io()),2&t&&(Qr(8),Fo("routerLink",Ul(32,SI))("queryParams",Vl(33,EI,e.object.collection)),Qr(1),ya(e.object.collection),Qr(2),Fo("routerLink",Ul(35,SI))("queryParams",Hl(36,kI,e.object.collection,e.object.key)),Qr(1),ya(e.object.key),Qr(2),Fo("routerLink",Ul(39,SI))("queryParams",(n=40,i=AI,r=e.object.collection,s=e.object.key,o=e.object.user_id,function(t,e,n,i,r,s,o,a){const l=e+n;return function(t,e,n,i,r){const s=Eo(t,e,n,i);return So(t,e+2,r)||s}(t,l,r,s,o)?Co(t,l+3,a?i.call(a,r,s,o):i(r,s,o)):jl(t,l+3)}(Le(),He(),n,i,r,s,o,a))),Qr(1),ya(e.object.user_id),Qr(1),Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.objectForm),Qr(6),Fo("ngClass",Vl(44,DI,e.f.collection.dirty&&e.f.collection.errors)),Qr(1),Fo("hidden",e.f.collection.disabled||e.f.collection.valid||e.f.collection.pristine),Qr(6),Fo("ngClass",Vl(46,DI,e.f.keyname.dirty&&e.f.keyname.errors)),Qr(1),Fo("hidden",e.f.keyname.disabled||e.f.keyname.valid||e.f.keyname.pristine),Qr(7),Fo("ngClass",Vl(48,DI,e.f.user_id.dirty&&e.f.user_id.errors)),Qr(1),Fo("hidden",e.f.user_id.disabled||e.f.user_id.valid||e.f.user_id.pristine),Qr(8),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(3),Fo("disabled",!e.updateAllowed())("value",2),Qr(7),Fo("value",e.object.version),Qr(7),Fo("disabled",!e.updateAllowed())("value",0),Qr(3),Fo("disabled",!e.updateAllowed())("value",1),Qr(7),Fo("value",e.object.create_time),Qr(5),Fo("value",e.object.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Mv,Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,kx,Sx,Ax,_x],styles:[".storage-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})(),RI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("collection"),i=t.paramMap.get("key"),r=t.paramMap.get("user_id");return this.consoleService.getStorage("",n,i,r)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FI(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function LI(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function MI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function II(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function $I(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"Yes"),Io()}}function OI(t,e){if(1&t){const t=No();Mo(0,"td",17),Vo("click",function(){Ie(t);const e=zo().$implicit;return zo().viewLeaderboardEntries(e)}),va(1,"No"),Io()}}function PI(t,e){if(1&t){const t=No();Mo(0,"td",18),Mo(1,"button",19),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLeaderboard(e,i,r)}),va(2,"Delete"),Io(),Io()}}function NI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(2),Io(),Mo(3,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(4),Io(),Mo(5,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(6),Io(),Mo(7,"td",14),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewLeaderboardEntries(n)}),va(8),Io(),Do(9,MI,2,0,"td",15),Do(10,II,2,0,"td",15),Do(11,$I,2,0,"td",15),Do(12,OI,2,0,"td",15),Do(13,PI,3,0,"td",16),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(n.orderString[t.sort_order]),Qr(2),ya(n.operatorString[t.operator]),Qr(2),ya(""===t.reset_schedule?"-":t.reset_schedule),Qr(1),Fo("ngIf",t.authoritative),Qr(1),Fo("ngIf",!t.authoritative),Qr(1),Fo("ngIf",t.tournament),Qr(1),Fo("ngIf",!t.tournament),Qr(1),Fo("ngIf",n.deleteAllowed())}}function BI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",20),va(2,"No leaderboards were found."),Io(),Io())}let UI=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.authService=n,this.consoleService=i,this.error="",this.leaderboards=[],this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"}}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboards.length=0,this.leaderboards.push(...t[0].leaderboards)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}deleteLeaderboard(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboard("",n.id).subscribe(()=>{this.error="",this.leaderboards.splice(e,1)},t=>{this.error=t})}viewLeaderboardEntries(t){this.router.navigate(["/leaderboards",t.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(mw),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:5,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger",3,"dismissible",4,"ngIf"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","130px"],[2,"width","100px"],["style","width: 90px",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[3,"click"],["class","text-center",3,"click",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"text-center",3,"click"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"text-muted"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboards"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FI,4,2,"ngb-alert",2),Mo(5,"table",3),Mo(6,"thead",4),Mo(7,"tr"),Mo(8,"th"),va(9,"Leaderboard ID"),Io(),Mo(10,"th",5),va(11,"Sort Order"),Io(),Mo(12,"th",5),va(13,"Operator"),Io(),Mo(14,"th",5),va(15,"Reset Schedule"),Io(),Mo(16,"th",6),va(17,"Authoritative"),Io(),Mo(18,"th",6),va(19,"Tournament"),Io(),Do(20,LI,2,0,"th",7),Io(),Io(),Mo(21,"tbody"),Do(22,NI,14,9,"tr",8),Do(23,BI,3,0,"tr",9),Io(),Io()),2&t&&(Qr(3),ba("",e.leaderboards.length," leaderboards found."),Qr(1),Fo("ngIf",e.error),Qr(16),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngForOf",e.leaderboards),Qr(1),Fo("ngIf",0===e.leaderboards.length))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),VI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listLeaderboards("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function HI(t,e){if(1&t&&(Mo(0,"ngb-alert",31),$o(1,"img",32),Mo(2,"h6",33),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying accounts: ",t.error,"")}}function jI(t,e){1&t&&(Mo(0,"th",34),va(1,"Remove"),Io())}function zI(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",35),va(2,"No users found - change the filter criteria or add new user accounts."),Io(),Io())}function WI(t,e){1&t&&$o(0,"td")}function GI(t,e){if(1&t){const t=No();Mo(0,"td",38),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteAccount(e,i,r)}),va(2,"Delete"),Io(),Io()}}function qI(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",36),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(8),Io(),Do(9,WI,1,0,"td",29),Do(10,GI,3,0,"td",37),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.username),Qr(2),ya(t.display_name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let KI=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.accountsCount=0,this.accounts=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""],filter_type:[0]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.f.filter_type.setValue(+t.get("filter_type")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):(this.f.filter.value||this.f.filter_type.value)&&this.search(0),this.route.data.subscribe(t=>{this.accounts.length=0,t&&(this.accounts.push(...t[0].users),this.accountsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listAccounts("",this.f.filter.value,this.f.filter_type.value&&1===this.f.filter_type.value,e).subscribe(t=>{this.error="",this.accounts.length=0,this.accounts.push(...t.users),this.accountsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,filter_type:this.f.filter_type.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteAccount(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteAccount("",n.id,!1).subscribe(()=>{this.error="",this.accounts.splice(e,1),this.accountsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewAccount(t){this.router.navigate(["/accounts",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:45,vars:9,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by user ID, social provider ID, device ID, or username (use '%' for prefix or suffix wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],["ngbDropdown","","role","group","aria-label","Button group with nested dropdown",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-primary","dropdown-toggle-split",3,"disabled"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Accounts"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"span",9),Vo("click",function(){return e.f.filter.setValue(e.systemUserId)}),$o(12,"img",10),Io(),Io(),Mo(13,"div",8),Mo(14,"div",11),Mo(15,"button",12),Vo("click",function(){return e.f.filter_type.setValue(0),e.search(0)}),va(16,"Search"),Io(),Mo(17,"div",13),$o(18,"button",14),Mo(19,"div",15),Mo(20,"button",16),Vo("click",function(){return e.f.filter_type.setValue(1),e.search(0)}),va(21,"Tombstones"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(22,"div",17),Mo(23,"div",18),Mo(24,"button",19),Vo("click",function(){return e.search(0)}),$o(25,"img",20),Io(),Mo(26,"button",19),Vo("click",function(){return e.search(1)}),$o(27,"img",21),Io(),Io(),Io(),Io(),Io(),Do(28,HI,4,2,"ngb-alert",22),Mo(29,"div",23),Mo(30,"table",24),Mo(31,"thead",25),Mo(32,"tr"),Mo(33,"th",26),va(34,"User ID"),Io(),Mo(35,"th"),va(36,"Username"),Io(),Mo(37,"th"),va(38,"Display Name"),Io(),Mo(39,"th",27),va(40,"Last Update"),Io(),Do(41,jI,2,0,"th",28),Io(),Io(),Mo(42,"tbody"),Do(43,zI,3,0,"tr",29),Do(44,qI,11,6,"tr",30),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.accountsCount," accounts found."),Qr(4),Fo("formGroup",e.searchForm),Qr(11),Fo("disabled",!e.f.filter.value||""===e.f.filter.value),Qr(6),Fo("disabled",0===e.accounts.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.accounts.length),Qr(1),Fo("ngForOf",e.accounts))},directives:[pb,Ry,mb,ay,Ty,yb,Kx,qx,Wx,zx,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),XI=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter"),i=t.queryParamMap.get("tombstones");return this.consoleService.listAccounts("",n,"true"===i,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function YI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().exportAccount(e)}),$o(1,"img",16),va(2,"Export"),Io()}}function JI(t,e){1&t&&(Mo(0,"span"),va(1,"Unban"),Io())}function QI(t,e){1&t&&(Mo(0,"span"),va(1,"Ban"),Io())}function ZI(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().banUnbanAccount(e)}),$o(1,"img",17),Do(2,JI,2,0,"span",18),Do(3,QI,2,0,"span",18),Io()}if(2&t){const t=zo();Qr(2),Fo("ngIf",t.account.disable_time),Qr(1),Fo("ngIf",!t.account.disable_time)}}function t$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!1)}),$o(1,"img",20),va(2,"Delete"),Io()}}function e$(t,e){if(1&t){const t=No();Mo(0,"button",19),Vo("click",function(e){return Ie(t),zo().deleteAccount(e,!0)}),$o(1,"img",21),va(2,"Recorded delete"),Io()}}function n$(t,e){if(1&t&&(Mo(0,"ngb-alert",22),$o(1,"img",23),Mo(2,"h6",24),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const i$=function(t,e){return["/accounts",t,e]};function r$(t,e){if(1&t&&(Mo(0,"div"),Oo(1,25),Mo(2,"a",26),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,i$,n.account.user.id,t.path)),Qr(1),ya(t.label)}}const s$=function(){return["/accounts"]},o$=function(){return["/storage"]},a$=function(t){return{user_id:t}};let l$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Profile",path:"profile"},{label:"Authentication",path:"authentication"},{label:"Friends",path:"friends"},{label:"Groups",path:"groups"},{label:"Wallet",path:"wallet"},{label:"Purchases",path:"purchases"},{label:"Subscriptions",path:"subscriptions"}]}ngOnInit(){this.route.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAccount(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteAccount("",this.account.user.id,e).subscribe(()=>{this.error="",this.router.navigate(["/accounts"])},t=>{this.error=t})}banUnbanAccount(t){t.target.disabled=!0,this.error="",this.account.disable_time?this.consoleService.unbanAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=null,t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1}):this.consoleService.banAccount("",this.account.user.id).subscribe(()=>{this.error="",this.account.disable_time=Date.now().toString(),t.target.disabled=!1},e=>{this.error=e,t.target.disabled=!1})}exportAccount(t){t.target.disabled=!0,this.error="",this.consoleService.exportAccount("",this.account.user.id).subscribe(e=>{this.error="";const n=this.account.user.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:24,vars:14,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["ngbNavItem","storage"],["ngbNavLink","",3,"routerLink","queryParams"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["src","/static/svg/ban.svg","alt","","width","13","height","13",1,"mr-2"],[4,"ngIf"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["src","/static/svg/bin-recorded.svg","alt","","width","15","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Account"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Account"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,YI,3,0,"button",7),Do(12,ZI,4,2,"button",7),Do(13,t$,3,0,"button",8),Do(14,e$,3,0,"button",8),Io(),Io(),Do(15,n$,4,2,"ngb-alert",9),Mo(16,"nav",10,11),Do(18,r$,4,6,"div",12),Mo(19,"div"),Oo(20,13),Mo(21,"a",14),va(22," Storage "),Io(),Po(),Io(),Io(),$o(23,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(10,s$)),Qr(3),ya(e.account.user.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.banAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views),Qr(3),Fo("routerLink",Ul(11,o$))("queryParams",Vl(12,a$,e.account.user.id)))},directives:[Mv,Bh,f_,Ph,p_,g_,Ov,_x,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),c$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getAccount("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const h$=["editor"];function u$(t,e){if(1&t&&(Mo(0,"ngb-alert",29),$o(1,"img",30),Mo(2,"h6",31),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function d$(t,e){1&t&&(Mo(0,"ngb-alert",32),$o(1,"img",33),Mo(2,"h6",31),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function p$(t,e){1&t&&(Mo(0,"button",34),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const f$=function(t){return{"is-invalid":t}};let g$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({username:["",py.required],display_name:[""],avatar_url:[""],location:[""],timezone:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.username.setValue(this.account.user.username),this.f.display_name.setValue(this.account.user.display_name),this.f.avatar_url.setValue(this.account.user.avatar_url),this.f.location.setValue(this.account.user.location),this.f.timezone.setValue(this.account.user.timezone),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.user.metadata),null,2);this.aceEditor.session.setValue(t)}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{username:this.f.username.value,display_name:this.f.display_name.value,avatar_url:this.f.avatar_url.value,location:this.f.location.value,timezone:this.f.timezone.value,metadata:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(h$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:53,vars:11,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","user_id",1,"d-inline"],["type","text","id","user_id","placeholder","User ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","username",1,"d-inline"],["type","text","id","username","placeholder","Username","required","","formControlName","username",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","display_name",1,"d-inline"],["type","text","id","display_name","placeholder","Display Name","formControlName","display_name",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","location",1,"d-inline"],["type","text","id","location","placeholder","Location","formControlName","location",1,"form-control","form-control-sm","my-2"],["for","timezone",1,"d-inline"],["type","text","id","timezone","placeholder","Timezone","formControlName","timezone",1,"form-control","form-control-sm","my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,u$,4,2,"ngb-alert",0),Do(1,d$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"User ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Username"),Io(),Io(),$o(13,"input",9),Mo(14,"div",10),va(15,"Username is required"),Io(),Io(),Io(),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",11),va(20,"Display Name"),Io(),Io(),$o(21,"input",12),Io(),Mo(22,"div",13),Mo(23,"div",5),Mo(24,"label",14),va(25,"Avatar URL"),Io(),Io(),$o(26,"input",15),Io(),Io(),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"div",5),Mo(30,"label",16),va(31,"Location"),Io(),Io(),$o(32,"input",17),Io(),Mo(33,"div",13),Mo(34,"div",5),Mo(35,"label",18),va(36,"Timezone"),Io(),Io(),$o(37,"input",19),Io(),Io(),Mo(38,"div",20),Mo(39,"div",4),Mo(40,"div",5),Mo(41,"label",21),va(42,"Create Time"),Io(),Io(),$o(43,"input",22),Io(),Mo(44,"div",4),Mo(45,"div",5),Mo(46,"label",23),va(47,"Update Time"),Io(),Io(),$o(48,"input",24),Io(),Io(),Mo(49,"div",25),$o(50,"div",26,27),Io(),Do(52,p$,2,1,"button",28),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(6),Fo("value",e.account.user.id),Qr(5),Fo("ngClass",Vl(9,f$,e.f.username.dirty&&e.f.username.errors)),Qr(1),Fo("hidden",e.f.username.disabled||e.f.username.valid||e.f.username.pristine),Qr(29),Fo("value",e.account.user.create_time),Qr(5),Fo("value",e.account.user.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,ay,wb,Ty,yb,$h,_x],styles:[""]}),t})();function m$(t,e){if(1&t&&(Mo(0,"ngb-alert",36),$o(1,"img",37),Mo(2,"h6",38),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function v$(t,e){1&t&&(Mo(0,"ngb-alert",39),$o(1,"img",40),Mo(2,"h6",38),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function y$(t,e){if(1&t&&(Mo(0,"option",41),va(1),Io()),2&t){const t=e.$implicit,n=e.index;Ko("value",n),Fo("selected",0===n),Qr(1),ya(t.id)}}function b$(t,e){1&t&&(Mo(0,"button",42),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}let w$=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.accountForm=this.formBuilder.group({email:[""],password:[""],selected_device_id_index:[""]}),this.route.parent.data.subscribe(t=>{this.account=t[0].account,this.f.email.setValue(this.account.email),this.f.password.setValue(""),this.f.selected_device_id_index.setValue(0),0===this.account.devices.length&&this.f.selected_device_id_index.disable(),this.updateAllowed()||this.accountForm.disable()},t=>{this.error=t})}updateAccount(){this.error="",this.updated=!1,this.updating=!0;let t={email:this.f.email.value};this.f.password.dirty&&(t.password=this.f.password.value),this.consoleService.updateAccount("",this.account.user.id,t).subscribe(t=>{this.updated=!0,this.updating=!1,this.f.password.reset()},t=>{this.error=t,this.updating=!1})}unlinkDeviceId(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkDevice("",this.account.user.id,{device_id:this.account.devices[this.f.selected_device_id_index.value].id}).subscribe(()=>{this.error="",this.account.devices.splice(this.f.selected_device_id_index.value,1),this.f.selected_device_id_index.setValue(0)},t=>{this.error=t})}unlinkCustomID(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkCustom("",this.account.user.id).subscribe(()=>{this.error="",this.account.custom_id=null},t=>{this.error=t})}unlinkFacebook(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebook("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_id=null},t=>{this.error=t})}unlinkFacebookInstantGames(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkFacebookInstantGame("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.facebook_instant_game_id=null},t=>{this.error=t})}unlinkApple(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkApple("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.apple_id=null},t=>{this.error=t})}unlinkGameCenter(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGameCenter("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.gamecenter_id=null},t=>{this.error=t})}unlinkGoogle(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkGoogle("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.google_id=null},t=>{this.error=t})}unlinkSteam(t){t.target.disabled=!0,this.error="",this.consoleService.unlinkSteam("",this.account.user.id).subscribe(()=>{this.error="",this.account.user.steam_id=null},t=>{this.error=t})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}copyDeviceIdToClipboard(t){const e=document.createElement("textarea");e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.opacity="0",e.value=this.account.devices[t].id,document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)}get f(){return this.accountForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:102,vars:21,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","selected_device_id_index",1,"d-inline"],[1,"input-group"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["src","/static/svg/copy.svg","alt","","width","16","height","",1,""],["id","selected_device_id_index","formControlName","selected_device_id_index",1,"form-control","custom-select","custom-select-sm"],[3,"value","selected",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","button",1,"btn","btn-sm","btn-outline-danger",3,"disabled","click"],["for","custom_id",1,"d-inline"],["type","text","id","custom_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","facebook_id",1,"d-inline"],["type","text","id","facebook_id","disabled","",1,"form-control","form-control-sm",3,"value"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","facebook_instant_game_id",1,"d-inline"],["type","text","id","facebook_instant_game_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","apple_id",1,"d-inline"],["type","text","id","apple_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","gamecenter_id",1,"d-inline"],["type","text","id","gamecenter_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","google_id",1,"d-inline"],["type","text","id","google_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","steam_id",1,"d-inline"],["type","text","id","steam_id","disabled","",1,"form-control","form-control-sm",3,"value"],["for","email",1,"d-inline"],["type","text","id","email","placeholder","Email","formControlName","email",1,"form-control","form-control-sm"],["for","password",1,"d-inline"],["type","text","id","password","placeholder","Password","formControlName","password",1,"form-control","form-control-sm"],[1,"row","remove-sides"],[1,"small"],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[3,"value","selected"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,m$,4,2,"ngb-alert",0),Do(1,v$,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateAccount()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Device IDs"),Io(),Io(),Mo(8,"div",7),Mo(9,"button",8),Vo("click",function(){return e.copyDeviceIdToClipboard(e.f.selected_device_id_index.value)}),$o(10,"img",9),va(11," Copy "),Io(),Mo(12,"select",10),Do(13,y$,2,3,"option",11),Io(),Mo(14,"div",12),Mo(15,"button",13),Vo("click",function(t){return e.unlinkDeviceId(t)}),va(16,"Unlink"),Io(),Io(),Io(),Io(),Mo(17,"div",4),Mo(18,"div",5),Mo(19,"label",14),va(20,"Custom ID"),Io(),Io(),Mo(21,"div",7),$o(22,"input",15),Mo(23,"div",12),Mo(24,"button",13),Vo("click",function(t){return e.unlinkCustomID(t)}),va(25,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(26,"div",3),Mo(27,"div",4),Mo(28,"div",5),Mo(29,"label",16),va(30,"Facebook ID"),Io(),Io(),Mo(31,"div",7),$o(32,"input",17),Mo(33,"div",12),Mo(34,"button",13),Vo("click",function(t){return e.unlinkFacebook(t)}),va(35,"Unlink"),Io(),Io(),Io(),Io(),Mo(36,"div",18),Mo(37,"div",5),Mo(38,"label",19),va(39,"FB Instant Game ID"),Io(),Io(),Mo(40,"div",7),$o(41,"input",20),Mo(42,"div",12),Mo(43,"button",13),Vo("click",function(t){return e.unlinkFacebookInstantGames(t)}),va(44,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(45,"div",3),Mo(46,"div",4),Mo(47,"div",5),Mo(48,"label",21),va(49,"Apple ID"),Io(),Io(),Mo(50,"div",7),$o(51,"input",22),Mo(52,"div",12),Mo(53,"button",13),Vo("click",function(t){return e.unlinkApple(t)}),va(54,"Unlink"),Io(),Io(),Io(),Io(),Mo(55,"div",18),Mo(56,"div",5),Mo(57,"label",23),va(58,"GameCenter ID"),Io(),Io(),Mo(59,"div",7),$o(60,"input",24),Mo(61,"div",12),Mo(62,"button",13),Vo("click",function(t){return e.unlinkGameCenter(t)}),va(63,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(64,"div",3),Mo(65,"div",4),Mo(66,"div",5),Mo(67,"label",25),va(68,"Google ID"),Io(),Io(),Mo(69,"div",7),$o(70,"input",26),Mo(71,"div",12),Mo(72,"button",13),Vo("click",function(t){return e.unlinkGoogle(t)}),va(73,"Unlink"),Io(),Io(),Io(),Io(),Mo(74,"div",4),Mo(75,"div",5),Mo(76,"label",27),va(77,"Steam ID"),Io(),Io(),Mo(78,"div",7),$o(79,"input",28),Mo(80,"div",12),Mo(81,"button",13),Vo("click",function(t){return e.unlinkSteam(t)}),va(82,"Unlink"),Io(),Io(),Io(),Io(),Io(),Mo(83,"div",3),Mo(84,"div",4),Mo(85,"div",5),Mo(86,"label",29),va(87,"Email"),Io(),$o(88,"br"),Io(),$o(89,"input",30),Io(),Mo(90,"div",4),Mo(91,"div",5),Mo(92,"label",31),va(93,"Password"),Io(),Io(),$o(94,"input",32),Io(),Io(),Mo(95,"div",33),Mo(96,"div",4),$o(97,"div",5),Mo(98,"span",34),va(99),Io(),Io(),$o(100,"div",4),Io(),Do(101,b$,2,1,"button",35),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.accountForm),Qr(11),Fo("ngForOf",e.account.devices),Qr(2),Fo("disabled",!e.updateAllowed()||0===e.account.devices.length),Qr(7),Fo("value",e.account.custom_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.custom_id||""===e.account.custom_id),Qr(8),Fo("value",e.account.user.facebook_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_id||""===e.account.user.facebook_id),Qr(7),Fo("value",e.account.user.facebook_instant_game_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.facebook_instant_game_id||""===e.account.user.facebook_instant_game_id),Qr(8),Fo("value",e.account.user.apple_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.apple_id||""===e.account.user.apple_id),Qr(7),Fo("value",e.account.user.gamecenter_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.gamecenter_id||""===e.account.user.gamecenter_id),Qr(8),Fo("value",e.account.user.google_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.google_id||""===e.account.user.google_id),Qr(7),Fo("value",e.account.user.steam_id),Qr(2),Fo("disabled",!e.updateAllowed()||!e.account.user.steam_id||""===e.account.user.steam_id),Qr(18),ba("Verification Status: ",null===e.account.verify_time?"Not Verified":"Verified",""),Qr(2),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Ph,ay,_x,Vy,Wy],styles:[".custom-select[_ngcontent-%COMP%]{height:auto}"]}),t})();const x$=["editor"];function _$(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function C$(t,e){1&t&&(Mo(0,"ngb-alert",27),$o(1,"img",28),Mo(2,"h6",26),va(3,"Account was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function S$(t,e){if(1&t){const t=No();Mo(0,"button",29),Vo("click",function(){return Ie(t),zo().updateWallet()}),va(1,"Save"),Io()}2&t&&Fo("disabled",zo().updating)}function E$(t,e){1&t&&(Mo(0,"th",30),va(1,"Remove"),Io())}function k$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",31),va(2,"No wallet ledger items found."),Io(),Io())}function A$(t,e){1&t&&$o(0,"div",37)}function D$(t,e){1&t&&$o(0,"div",38)}function T$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",39),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteLedgerItem(e,i,r)}),va(2,"Delete"),Io(),Io()}}function R$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",40),Mo(2,"pre",41),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function F$(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",32),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.walletLedgerMetadataOpen[n]=!i.walletLedgerMetadataOpen[n]}),Do(3,A$,1,0,"div",33),Do(4,D$,1,0,"div",34),Io(),va(5),Io(),Mo(6,"td",35),Mo(7,"pre",36),va(8),Io(),Io(),Mo(9,"td"),va(10),Io(),Do(11,T$,3,0,"td",22),Io(),Do(12,R$,5,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.walletLedgerMetadataOpen[t]),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t]),Qr(1),ba(" ",n.id," "),Qr(3),ya(n.changeset),Qr(2),ya(n.update_time),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.walletLedgerMetadataOpen[t])}}let L$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.walletLedger=[],this.walletLedgerMetadataOpen=[],this.updating=!1,this.updated=!1,this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.walletLedger.length=0,this.walletLedger.push(...t[0].items),this.walletLedgerMetadataOpen.length=this.walletLedger.length,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}loadData(t){this.consoleService.getWalletLedger("",this.userID,this.limit,t).subscribe(t=>{this.walletLedger=t.items,this.walletLedgerMetadataOpen=[],this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.account.wallet),null,2);this.aceEditor.session.setValue(t)}updateWallet(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}this.consoleService.updateAccount("",this.account.user.id,{wallet:t}).subscribe(t=>{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteLedgerItem(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteWalletLedger("",this.account.user.id,n.id).subscribe(()=>{this.error="",this.walletLedger.splice(e,1),this.walletLedgerMetadataOpen.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(x$,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:32,vars:9,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","button","class","btn btn-primary",3,"disabled","click",4,"ngIf"],[1,"my-4"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","315px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","button",1,"btn","btn-primary",3,"disabled","click"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"align-middle"],[1,"m-0","p-0"],[1,"arrow-right"],[1,"arrow-down"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","5",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,_$,4,2,"ngb-alert",0),Do(1,C$,4,1,"ngb-alert",1),Mo(2,"div",2),$o(3,"div",3,4),Io(),Do(5,S$,2,1,"button",5),$o(6,"hr",6),Mo(7,"div",7),Mo(8,"div",8),$o(9,"div",9),Mo(10,"div",10),Mo(11,"div",11),Mo(12,"button",12),Vo("click",function(){return e.loadData("")}),$o(13,"img",13),Io(),Mo(14,"button",12),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(15,"img",14),Io(),Mo(16,"button",12),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(17,"img",15),Io(),Io(),Io(),Io(),Io(),Mo(18,"div",16),Mo(19,"table",17),Mo(20,"thead",18),Mo(21,"tr"),Mo(22,"th",19),va(23,"ID"),Io(),Mo(24,"th"),va(25,"Changeset"),Io(),Mo(26,"th",20),va(27,"Update Time"),Io(),Do(28,E$,2,0,"th",21),Io(),Io(),Mo(29,"tbody"),Do(30,k$,3,0,"tr",22),Do(31,F$,13,7,"ng-template",23),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(4),Fo("ngIf",e.updateAllowed()),Qr(7),Fo("disabled",0===e.walletLedger.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(12),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.walletLedger.length),Qr(1),Fo("ngForOf",e.walletLedger))},directives:[Bh,Ph,_x],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}"]}),t})(),M$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getWalletLedger("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function I$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function $$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function O$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No friends found."),Io(),Io())}function P$(t,e){1&t&&(Mo(0,"span"),va(1,"Friend (0)"),Io())}function N$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Sent (1)"),Io())}function B$(t,e){1&t&&(Mo(0,"span"),va(1,"Invite Received (2)"),Io())}function U$(t,e){1&t&&(Mo(0,"span"),va(1,"Blocked (3)"),Io())}function V$(t,e){if(1&t){const t=No();Mo(0,"td",16),Mo(1,"button",17),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteFriend(e,i,r)}),va(2,"Delete"),Io(),Io()}}function H$(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td"),va(4),Io(),Mo(5,"td"),Do(6,P$,2,0,"span",8),Do(7,N$,2,0,"span",8),Do(8,B$,2,0,"span",8),Do(9,U$,2,0,"span",8),Io(),Mo(10,"td"),va(11),Io(),Do(12,V$,3,0,"td",15),Io()),2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let j$=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.friends=[]}ngOnInit(){this.route.data.subscribe(t=>{this.friends.length=0,this.friends.push(...t[0].friends)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteFriend(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteFriend("",this.account.user.id,n.user.id).subscribe(()=>{this.error="",this.friends.splice(e,1)},t=>{this.error=t})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,I$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"User ID"),Io(),Mo(7,"th"),va(8,"Username"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,$$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,O$,3,0,"tr",8),Do(16,H$,13,8,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.friends.length),Qr(1),Fo("ngForOf",e.friends))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),z$=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getFriends("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function W$(t,e){if(1&t&&(Mo(0,"ngb-alert",10),$o(1,"img",11),Mo(2,"h6",12),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function G$(t,e){1&t&&(Mo(0,"th",13),va(1,"Remove"),Io())}function q$(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",14),va(2,"No group membership found."),Io(),Io())}function K$(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function X$(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function Y$(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function J$(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function Q$(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function Z$(t,e){if(1&t){const t=No();Mo(0,"td"),Mo(1,"button",16),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function tO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,K$,2,0,"span",8),Do(7,X$,2,0,"span",8),Do(8,Y$,2,0,"span",8),Do(9,J$,2,0,"span",8),Do(10,Q$,2,0,"span",8),Io(),Mo(11,"td",15),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,Z$,3,0,"td",8),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.group.id),Qr(2),ya(t.group.name),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.group.update_time),Qr(1),Fo("ngIf",n.deleteAllowed())}}let eO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.groups=[]}ngOnInit(){this.route.data.subscribe(t=>{this.groups.length=0,this.groups.push(...t[0].user_groups)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.account=t[0].account},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",this.account.user.id,n.group.id).subscribe(()=>{this.error="",this.groups.splice(e,1)},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/groups",t.group.id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:4,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,W$,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"table",2),Mo(3,"thead",3),Mo(4,"tr"),Mo(5,"th",4),va(6,"Group ID"),Io(),Mo(7,"th"),va(8,"Name"),Io(),Mo(9,"th",5),va(10,"State"),Io(),Mo(11,"th",6),va(12,"Update Time"),Io(),Do(13,G$,2,0,"th",7),Io(),Io(),Mo(14,"tbody"),Do(15,q$,3,0,"tr",8),Do(16,tO,14,9,"tr",9),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(13),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[Bh,Ph,_x],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),nO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getGroups("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const iO=["editor"];function rO(t,e){if(1&t&&(Mo(0,"ngb-alert",34),$o(1,"img",35),Mo(2,"h6",36),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function sO(t,e){1&t&&(Mo(0,"ngb-alert",37),$o(1,"img",38),Mo(2,"h6",36),va(3,"Group was modified successfully."),Io(),Io()),2&t&&Fo("dismissible",!1)}function oO(t,e){1&t&&(Mo(0,"button",39),va(1,"Save"),Io()),2&t&&Fo("disabled",zo().updating)}const aO=function(t){return["/accounts",t]},lO=function(t){return{"is-invalid":t}};let cO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.error="",this.updating=!1,this.updated=!1}ngOnInit(){this.groupForm=this.formBuilder.group({name:["",py.required],description:[""],avatar_url:[""],lang_tag:[""],open:[""],max_count:[""]}),this.route.parent.data.subscribe(t=>{this.group=t[0],this.f.name.setValue(this.group.name),this.f.description.setValue(this.group.description),this.f.avatar_url.setValue(this.group.avatar_url),this.f.lang_tag.setValue(this.group.lang_tag),this.f.open.setValue(this.group.open),this.f.max_count.setValue(this.group.max_count),this.updateAllowed()||this.groupForm.disable()},t=>{this.error=t})}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!this.updateAllowed());const t=JSON.stringify(JSON.parse(this.group.metadata),null,2);this.aceEditor.session.setValue(t)}updateGroup(){this.error="",this.updated=!1,this.updating=!0;let t="";try{t=JSON.stringify(JSON.parse(this.aceEditor.session.getValue()))}catch(e){return this.error=e,void(this.updating=!1)}if(this.f.max_count.value{this.updated=!0,this.updating=!1},t=>{this.error=t,this.updating=!1})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f(){return this.groupForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(iO,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:71,vars:16,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["type","success","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border",3,"formGroup","ngSubmit"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","group_id",1,"d-inline"],["type","text","id","group_id","placeholder","Group ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","creator_id",1,"d-inline"],[2,"width","100%",3,"routerLink"],["type","text","id","creator_id","placeholder","Creator ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","name",1,"d-inline"],["type","text","id","name","placeholder","Name","required","","formControlName","name",1,"form-control","form-control-sm","my-2",3,"ngClass"],[1,"invalid-tooltip",3,"hidden"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","formControlName","description",1,"form-control","form-control-sm","my-2"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline","align-self-center"],["for","avatar_url",1,"d-inline"],["type","text","id","avatar_url","placeholder","Avatar URL","formControlName","avatar_url",1,"form-control","form-control-sm","my-2"],["for","lang_tag",1,"d-inline"],["type","text","id","lang_tag","placeholder","Language","formControlName","lang_tag",1,"form-control","form-control-sm","my-2"],["type","text","id","edge_count","placeholder","Members","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_count",1,"d-inline"],["type","text","id","max_count","placeholder","Max Count","formControlName","max_count",1,"form-control","form-control-sm","my-2"],["type","checkbox","id","open","formControlName","open",1,"my-2"],[1,"row","mb-3","add-border-single-row-bottom"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","update_time",1,"d-inline"],["type","text","id","update_time","placeholder","Update Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","success",1,"mb-3",3,"dismissible"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(t,e){1&t&&(Do(0,rO,4,2,"ngb-alert",0),Do(1,sO,4,1,"ngb-alert",1),Mo(2,"form",2),Vo("ngSubmit",function(){return e.updateGroup()}),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"label",6),va(7,"Group ID"),Io(),Io(),$o(8,"input",7),Io(),Mo(9,"div",4),Mo(10,"div",5),Mo(11,"label",8),va(12,"Creator ID"),Io(),Io(),Mo(13,"a",9),$o(14,"input",10),Io(),Io(),Io(),Mo(15,"div",3),Mo(16,"div",4),Mo(17,"div",5),Mo(18,"label",11),va(19,"Name"),Io(),Io(),$o(20,"input",12),Mo(21,"div",13),va(22,"Name is required"),Io(),Io(),Mo(23,"div",4),Mo(24,"div",5),Mo(25,"label",14),va(26,"Description"),Io(),Io(),$o(27,"input",15),Io(),Io(),Mo(28,"div",3),Mo(29,"div",16),Mo(30,"div",5),Mo(31,"label",17),va(32,"Avatar URL"),Io(),Io(),$o(33,"input",18),Io(),Mo(34,"div",4),Mo(35,"div",5),Mo(36,"label",19),va(37,"Language"),Io(),Io(),$o(38,"input",20),Io(),Io(),Mo(39,"div",3),Mo(40,"div",4),Mo(41,"div",5),Mo(42,"label",8),va(43,"Members"),Io(),Io(),$o(44,"input",21),Io(),Mo(45,"div",16),Mo(46,"div",5),Mo(47,"label",22),va(48,"Max Count"),Io(),Io(),$o(49,"input",23),Io(),Io(),Mo(50,"div",3),Mo(51,"div",16),Mo(52,"div",5),Mo(53,"label",22),va(54,"Open"),Io(),Io(),$o(55,"input",24),Io(),Io(),Mo(56,"div",25),Mo(57,"div",4),Mo(58,"div",5),Mo(59,"label",26),va(60,"Create Time"),Io(),Io(),$o(61,"input",27),Io(),Mo(62,"div",4),Mo(63,"div",5),Mo(64,"label",28),va(65,"Update Time"),Io(),Io(),$o(66,"input",29),Io(),Io(),Mo(67,"div",30),$o(68,"div",31,32),Io(),Do(70,oO,2,1,"button",33),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",e.updated),Qr(1),Fo("formGroup",e.groupForm),Qr(6),Fo("value",e.group.id),Qr(5),Fo("routerLink",Vl(12,aO,e.group.creator_id)),Qr(1),Fo("value",e.group.creator_id),Qr(6),Fo("ngClass",Vl(14,lO,e.f.name.dirty&&e.f.name.errors)),Qr(1),Fo("hidden",e.f.name.disabled||e.f.name.valid||e.f.name.pristine),Qr(23),Fo("value",e.group.edge_count),Qr(17),Fo("value",e.group.create_time),Qr(5),Fo("value",e.group.update_time),Qr(4),Fo("ngIf",e.updateAllowed()))},directives:[Bh,pb,Ry,mb,Mv,ay,wb,Ty,yb,$h,ry,_x],styles:[""]}),t})();function hO(t,e){if(1&t&&(Mo(0,"ngb-alert",13),$o(1,"img",14),Mo(2,"h6",15),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function uO(t,e){1&t&&(Mo(0,"span"),va(1,"Add by membership state"),Io())}function dO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo(2);Qr(1),ya(t.activeState)}}function pO(t,e){if(1&t){const t=No();Mo(0,"button",20),Vo("click",function(){Ie(t);const n=e.$implicit;return zo(2).activeState=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function fO(t,e){if(1&t&&(Mo(0,"div",16),Mo(1,"button",17),Do(2,uO,2,0,"span",11),Do(3,dO,2,1,"span",11),Io(),Mo(4,"div",18),Do(5,pO,2,1,"button",19),Io(),Io()),2&t){const t=zo();Qr(2),Fo("ngIf",!t.activeState||""===t.activeState),Qr(1),Fo("ngIf",t.activeState&&""!==t.activeState),Qr(2),Fo("ngForOf",t.states)}}function gO(t,e){if(1&t){const t=No();Mo(0,"div",21),Mo(1,"div",22),Mo(2,"div",23),Mo(3,"form",24),Mo(4,"div",25),$o(5,"input",26),Mo(6,"div",27),Mo(7,"div",28),Mo(8,"button",29),Vo("click",function(){return Ie(t),zo().add()}),va(9,"Add"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io()}if(2&t){const t=zo();Qr(3),Fo("formGroup",t.addForm)}}function mO(t,e){1&t&&(Mo(0,"th",30),va(1,"Demote"),Io())}function vO(t,e){1&t&&(Mo(0,"th",30),va(1,"Promote"),Io())}function yO(t,e){1&t&&(Mo(0,"th",31),va(1,"Remove"),Io())}function bO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No group membership found."),Io(),Io())}function wO(t,e){1&t&&(Mo(0,"span"),va(1,"Superadmin (0)"),Io())}function xO(t,e){1&t&&(Mo(0,"span"),va(1,"Admin (1)"),Io())}function _O(t,e){1&t&&(Mo(0,"span"),va(1,"Member (2)"),Io())}function CO(t,e){1&t&&(Mo(0,"span"),va(1,"Join Request (3)"),Io())}function SO(t,e){1&t&&(Mo(0,"span"),va(1,"Banned (4)"),Io())}function EO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().demoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",38),$o(3,"path",39),Io(),Io(),Io()}}function kO(t,e){if(1&t){const t=No();Mo(0,"td",36),Mo(1,"button",37),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().promoteGroupUser(e,i,r)}),ln(),Mo(2,"svg",40),$o(3,"path",41),Io(),Io(),Io()}}function AO(t,e){if(1&t){const t=No();Mo(0,"td",42),Mo(1,"button",43),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroupUser(e,i,r)}),va(2,"Delete"),Io(),Io()}}function DO(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(2),Io(),Mo(3,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),Do(6,wO,2,0,"span",11),Do(7,xO,2,0,"span",11),Do(8,_O,2,0,"span",11),Do(9,CO,2,0,"span",11),Do(10,SO,2,0,"span",11),Io(),Mo(11,"td",33),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(12),Io(),Do(13,EO,4,0,"td",34),Do(14,kO,4,0,"td",34),Do(15,AO,3,0,"td",35),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.user.id),Qr(2),ya(t.user.username),Qr(2),Fo("ngIf",0===t.state),Qr(1),Fo("ngIf",1===t.state),Qr(1),Fo("ngIf",2===t.state),Qr(1),Fo("ngIf",3===t.state),Qr(1),Fo("ngIf",4===t.state),Qr(2),ya(t.user.update_time),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed()),Qr(1),Fo("ngIf",n.editionAllowed())}}let TO=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.authService=r,this.error="",this.members=[],this.activeState="Add Member",this.states=["Add Member","Join"],this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.onSameUrlNavigation="reload",this.addForm=this.formBuilder.group({ids:[""]})}ngOnInit(){this.route.data.subscribe(t=>{this.members.length=0,this.members.push(...t[0].group_users)},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}editionAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteGroupUser(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroupUser("",n.user.id,this.group.id).subscribe(()=>{this.members.splice(e,1)},t=>{this.error=t})}demoteGroupUser(t,e,n){this.error="",this.consoleService.demoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state++},t=>{this.error=t})}promoteGroupUser(t,e,n){this.error="",this.consoleService.promoteGroupMember("",this.group.id,n.user.id).subscribe(()=>{this.members[e].state--},t=>{this.error=t})}viewAccount(t){this.router.navigate(["/accounts",t.user.id],{relativeTo:this.route})}add(){this.consoleService.addGroupUsers("",this.group.id,{ids:this.f.ids.value,join_request:"Join"===this.activeState}).subscribe(()=>{this.error="",this.router.navigate([this.router.url])},t=>{this.error=t})}get f(){return this.addForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:21,vars:8,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["class","btn-group mb-1","ngbDropdown","",4,"ngIf"],["class","row no-gutters mb-4",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","300px"],[2,"width","180px"],["style","width: 70px",4,"ngIf"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],["type","button","ngbDropdownItem","",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup"],[1,"input-group"],["id","ids","type","text","formControlName","ids","placeholder","Add user IDs as members, comma-separated",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],[2,"width","70px"],[2,"width","90px"],["colSpan","7",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],["class","text-center align-middle",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-outline-secondary",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-down"],["fill-rule","evenodd","d","M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-arrow-up"],["fill-rule","evenodd","d","M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"],[1,"text-center","align-middle"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Do(0,hO,4,2,"ngb-alert",0),Do(1,fO,6,3,"div",1),Do(2,gO,10,1,"div",2),Mo(3,"div",3),Mo(4,"table",4),Mo(5,"thead",5),Mo(6,"tr"),Mo(7,"th",6),va(8,"User ID"),Io(),Mo(9,"th"),va(10,"Name"),Io(),Mo(11,"th",7),va(12,"State"),Io(),Mo(13,"th",8),va(14,"Update Time"),Io(),Do(15,mO,2,0,"th",9),Do(16,vO,2,0,"th",9),Do(17,yO,2,0,"th",10),Io(),Io(),Mo(18,"tbody"),Do(19,bO,3,0,"tr",11),Do(20,DO,16,11,"tr",12),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(1),Fo("ngIf",!e.group.open&&e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(13),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(1),Fo("ngIf",e.editionAllowed()),Qr(2),Fo("ngIf",0===e.members.length),Qr(1),Fo("ngForOf",e.members))},directives:[Bh,Ph,_x,Kx,qx,Wx,zx,pb,Ry,mb,ay,Ty,yb],styles:[".table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),RO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.getMembers("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function FO(t,e){if(1&t&&(Mo(0,"ngb-alert",28),$o(1,"img",29),Mo(2,"h6",30),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function LO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeType)}}function MO(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeType=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function IO(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeNode)}}function $O(t,e){if(1&t){const t=No();Mo(0,"button",31),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeNode=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function OO(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",32),va(2,"No realtime matches were found."),Io(),Io())}function PO(t,e){1&t&&$o(0,"div",40)}function NO(t,e){1&t&&$o(0,"div",41)}function BO(t,e){if(1&t){const t=No();Mo(0,"div",37),Vo("click",function(){Ie(t);const e=zo(),n=e.index,i=e.$implicit,r=zo();return r.getMatchState(n,i),r.matchStatesOpen[n]=!r.matchStatesOpen[n]}),Do(1,PO,1,0,"div",38),Do(2,NO,1,0,"div",39),Io()}if(2&t){const t=zo().index,e=zo();Qr(1),Fo("ngIf",!e.matchStatesOpen[t]),Qr(1),Fo("ngIf",e.matchStatesOpen[t])}}function UO(t,e){1&t&&$o(0,"div",42)}function VO(t,e){1&t&&(Mo(0,"span"),va(1,"Yes"),Io())}function HO(t,e){1&t&&(Mo(0,"span"),va(1,"No"),Io())}function jO(t,e){1&t&&$o(0,"img",51)}function zO(t,e){if(1&t&&(Mo(0,"div"),Mo(1,"small"),Mo(2,"b"),va(3,"Current Tick"),Io(),Io(),Mo(4,"pre",47),Mo(5,"small"),va(6),Io(),Io(),Mo(7,"small"),Mo(8,"b"),va(9,"Match State"),Io(),Io(),Mo(10,"pre",47),Mo(11,"small"),va(12),Io(),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(6),ya(e.matchStates[t].tick),Qr(6),ya(e.matchStates[t].state)}}function WO(t,e){1&t&&$o(0,"img",51)}function GO(t,e){if(1&t&&(Mo(0,"pre",47),Mo(1,"small"),va(2),Io(),Io()),2&t){const t=zo(2).index,e=zo();Qr(2),ya(e.getMatchPresencesString(e.matchStates[t].presences))}}function qO(t,e){if(1&t&&(Mo(0,"tr",43),Mo(1,"td",44),Mo(2,"div",45),Mo(3,"div",46),Mo(4,"small"),Mo(5,"b"),va(6,"Match Label"),Io(),Io(),Mo(7,"pre",47),Mo(8,"small"),va(9),Io(),Io(),Io(),Mo(10,"div",48),Do(11,jO,1,0,"img",49),Do(12,zO,13,2,"div",7),Io(),Mo(13,"div",48),Mo(14,"small"),Mo(15,"b"),va(16,"Match Presences"),Io(),Io(),Do(17,WO,1,0,"img",49),Do(18,GO,3,1,"pre",50),Io(),Io(),Io(),Io()),2&t){const t=zo(),e=t.$implicit,n=t.index,i=zo();Qr(9),ya(e.api_match.label),Qr(2),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n]),Qr(5),Fo("ngIf",!i.matchStates[n]||null===i.matchStates[n]),Qr(1),Fo("ngIf",null!==i.matchStates[n])}}function KO(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td"),Do(2,BO,3,2,"div",33),Do(3,UO,1,0,"div",34),va(4),Io(),Mo(5,"td"),va(6),Io(),Mo(7,"td",35),Do(8,VO,2,0,"span",7),Do(9,HO,2,0,"span",7),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Io(),Do(16,qO,19,5,"tr",36)),2&t){const t=e.index,n=e.$implicit,i=zo();Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(1),ba(" ",n.api_match.match_id," "),Qr(2),ya(n.api_match.size),Qr(2),Fo("ngIf",n.api_match.authoritative),Qr(1),Fo("ngIf",!n.api_match.authoritative),Qr(2),ya(n.node),Qr(2),ya(n.api_match.handler_name),Qr(2),ya(n.api_match.authoritative?n.api_match.tick_rate:"-"),Qr(1),Fo("ngIf",i.matchStatesOpen[t])}}let XO=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.formBuilder=n,this.consoleService=i,this.error="",this.matches=[],this.matchStates=[],this.matchStatesOpen=[],this.updated=!1,this.activeType="All",this.types=["All","Authoritative","Relayed"],this.activeNode="All Nodes",this.nodes=["All Nodes"],this.searchForm1=this.formBuilder.group({match_id:""}),this.searchForm2=this.formBuilder.group({match_id:""}),this.searchForm3=this.formBuilder.group({query:""})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.match_id.setValue(t.get("match_id")),this.f2.match_id.setValue(t.get("match_id")),this.f3.query.setValue(t.get("query"));let e=t.get("type");this.type=Number(e);let n=t.get("node");if(this.route.data.subscribe(t=>{console.log(t),t&&(t[0]&&(this.error="",this.matches.length=0,this.matches.push(...t[0].matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length),t[1]&&this.nodes.push(...t[1]),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=0,this.activeType=this.types[0]):0==this.type||1==this.type||2==this.type?this.activeType=this.types[this.type]:this.error="Invalid type",null!==n){let t=!1;this.nodes.forEach(e=>{n===e&&(this.activeNode=n,t=!0)}),t||(this.error="Invalid node.")}}search(){const t=this.getType();this.type=t,JO(this.consoleService,t,0==t?this.f1.match_id.value:this.f2.match_id.value,this.f3.query.value,this.activeNode===this.nodes[0]?"":this.activeNode).subscribe(t=>this.postData(t),t=>{this.error=t})}postData(t){let e;switch(this.error="",this.matches.length=0,this.matches.push(...t.matches),this.matchStates.length=this.matches.length,this.matchStatesOpen.length=this.matches.length,this.type){case 0:e={type:this.type,match_id:this.f1.match_id.value};break;case 1:e={type:this.type,query:this.f3.query.value},this.activeNode!==this.nodes[0]&&(e.node=this.activeNode);break;case 2:e={type:this.type,match_id:this.f2.match_id.value}}this.router.navigate([],{relativeTo:this.route,queryParams:e})}getType(){let t=0;return this.types.forEach((e,n)=>{this.activeType===e&&(t=n)}),t}getMatchState(t,e){this.matchStatesOpen[t]||(this.matchStates[t]=null,this.error="",this.consoleService.getMatchState("",e.api_match.match_id).subscribe(e=>{this.matchStatesOpen[t]=!0,this.matchStates[t]=e},e=>{this.matchStatesOpen[t]=!1,this.matchStates[t]=null,this.error=e}))}getMatchPresencesString(t){return JSON.stringify(t)}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(_b),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:53,vars:16,consts:[[1,"pb-1"],[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"input-group","mb-1"],[1,"input-group-prepend"],["ngbDropdown","",1,"btn-group"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-right"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"click"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","match_id","placeholder","Filter by match ID",1,"form-control"],["type","text","formControlName","query","placeholder","Filter by query or match ID",1,"form-control","border-right-0"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-radius-left"],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","140px"],[2,"width","100px"],[2,"width","130px"],[2,"width","90px"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],["type","button","ngbDropdownItem","",3,"click"],["colSpan","8",1,"text-muted"],["class","arrow",3,"click",4,"ngIf"],["class","d-inline-block mr-3",4,"ngIf"],[1,"text-center"],["class","open-row",4,"ngIf"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"d-inline-block","mr-3"],[1,"open-row"],["colspan","6",1,"align-middle"],[1,"d-flex","p-0"],[1,"p-3","w-33","border"],[1,"pre-wrap","m-0","p-0"],[1,"p-3","w-33","border","border-left-0"],["src","/static/spinner.svg","class","d-block","width","16",4,"ngIf"],["class","pre-wrap m-0 p-0",4,"ngIf"],["src","/static/spinner.svg","width","16",1,"d-block"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Active Matches"),Io(),Mo(2,"h6",1),va(3),Io(),Do(4,FO,4,2,"ngb-alert",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"div",5),Mo(8,"button",6),Do(9,LO,2,1,"span",7),Io(),Mo(10,"div",8),Do(11,MO,2,1,"button",9),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"button",11),Vo("click",function(){return e.search()}),va(14,"Search"),Io(),Io(),Io(),Mo(15,"div",12),Mo(16,"div",13),Mo(17,"div",14),Mo(18,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(19,"div",16),$o(20,"input",17),Io(),Io(),Mo(21,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(22,"div",16),$o(23,"input",17),Io(),Io(),Mo(24,"form",15),Vo("ngSubmit",function(){return e.search()}),Mo(25,"div",16),$o(26,"input",18),Mo(27,"div",10),Mo(28,"div",5),Mo(29,"button",19),Do(30,IO,2,1,"span",7),Io(),Mo(31,"div",8),Do(32,$O,2,1,"button",9),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(33,"div",20),Mo(34,"table",21),Mo(35,"thead",22),Mo(36,"tr"),Mo(37,"th"),Mo(38,"span"),va(39,"Match ID"),Io(),Io(),Mo(40,"th",23),va(41,"Presence Count"),Io(),Mo(42,"th",24),va(43,"Authoritative"),Io(),Mo(44,"th",24),va(45,"Node"),Io(),Mo(46,"th",25),va(47,"Handler Name"),Io(),Mo(48,"th",26),va(49,"Tick Rate"),Io(),Io(),Io(),Mo(50,"tbody"),Do(51,OO,3,0,"tr",7),Do(52,KO,17,10,"ng-template",27),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.matches.length," running matches found."),Qr(1),Fo("ngIf",e.error),Qr(5),Fo("ngIf",e.activeType&&""!==e.activeType),Qr(2),Fo("ngForOf",e.types),Qr(7),Fo("hidden","All"!==e.activeType)("formGroup",e.searchForm1),Qr(3),Fo("hidden","Relayed"!==e.activeType)("formGroup",e.searchForm2),Qr(3),Fo("hidden","Authoritative"!==e.activeType)("formGroup",e.searchForm3),Qr(6),Fo("ngIf",e.activeNode&&""!==e.activeNode),Qr(2),Fo("ngForOf",e.nodes),Qr(6),ra("pl-3",e.matches.length>0),Qr(13),Fo("ngIf",0===e.matches.length),Qr(1),Fo("ngForOf",e.matches))},directives:[Bh,Kx,qx,Wx,Ph,pb,Ry,mb,ay,Ty,yb,_x,zx],styles:[".pre-wrap[_ngcontent-%COMP%]{word-wrap:anywhere;word-break:break-all;white-space:pre-wrap}.open-row[_ngcontent-%COMP%]{background:#fafafc}.w-33[_ngcontent-%COMP%]{width:33.3333%!important}.dropdown-radius-right[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}"]}),t})(),YO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));return JO(this.consoleService,n,t.queryParamMap.get("match_id"),t.queryParamMap.get("query"),t.queryParamMap.get("node")).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JO(t,e,n,i,r){switch(e){case 0:return t.listMatches("",null,null,null,null,null,n);case 1:return t.listMatches("",null,!0,null,null,null,null,i,r);case 2:return t.listMatches("",null,!1,null,null,null,n)}return ff(null)}let QO=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.getStatus("").pipe(U(t=>ff(t.nodes.map(t=>t.name)))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff([]))))}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function ZO(t,e){if(1&t&&(Mo(0,"ngb-alert",25),$o(1,"img",26),Mo(2,"h6",27),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying groups: ",t.error,"")}}function tP(t,e){1&t&&(Mo(0,"th",28),va(1,"Remove"),Io())}function eP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No groups found - change the filter criteria or add new user groups."),Io(),Io())}function nP(t,e){1&t&&$o(0,"td")}function iP(t,e){if(1&t){const t=No();Mo(0,"td",32),Mo(1,"button",33),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteGroup(e,i,r)}),va(2,"Delete"),Io(),Io()}}function rP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(2),Io(),Mo(3,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(4),Io(),Mo(5,"td",30),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewGroup(n)}),va(6),Io(),Do(7,nP,1,0,"td",23),Do(8,iP,3,0,"td",31),Io()}if(2&t){const t=e.$implicit,n=zo();Qr(2),ya(t.id),Qr(2),ya(t.name),Qr(2),ya(t.update_time),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id===n.systemUserId),Qr(1),Fo("ngIf",n.deleteAllowed()&&t.id!==n.systemUserId)}}let sP=(()=>{class t{constructor(t,e,n,i,r){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.groupsCount=0,this.groups=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.searchForm=this.formBuilder.group({filter:[""]});const t=this.route.snapshot.queryParamMap;this.f.filter.setValue(t.get("filter")),this.nextCursor=t.get("cursor"),this.nextCursor&&""!==this.nextCursor?this.search(1):this.f.filter.value&&this.search(0),this.route.data.subscribe(t=>{this.groups.length=0,t&&(this.groups.push(...t[0].groups),this.groupsCount=t[0].total_count,this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor)},t=>{this.error=t})}search(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listGroups("",this.f.filter.value,e).subscribe(t=>{this.error="",this.groups.length=0,this.groups.push(...t.groups),this.groupsCount=t.total_count,this.nextCursor=t.next_cursor,this.router.navigate([],{relativeTo:this.route,queryParams:{filter:this.f.filter.value,cursor:e},queryParamsHandling:"merge"})},t=>{this.error=t})}deleteGroup(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteGroup("",n.id).subscribe(()=>{this.error="",this.groups.splice(e,1),this.groupsCount--},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}viewGroup(t){this.router.navigate(["/groups",t.id],{relativeTo:this.route})}get f(){return this.searchForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:35,vars:8,consts:[[1,"pb-1"],[1,"pb-3"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],["type","text","formControlName","filter","placeholder","Filter by group ID or name (use '%' for wildcard search)",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","button",1,"btn","btn-primary","dropdown-radius",3,"click"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered"],[1,"thead-light"],[2,"width","320px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","5",1,"text-muted"],[3,"click"],["class","text-center",4,"ngIf"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Groups"),Io(),Mo(2,"h6",1),va(3),Io(),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"form",5),Vo("ngSubmit",function(){return e.search(0)}),Mo(8,"div",6),$o(9,"input",7),Mo(10,"div",8),Mo(11,"div",9),Mo(12,"button",10),Vo("click",function(){return e.search(0)}),va(13,"Search"),Io(),Io(),Io(),Io(),Io(),Io(),Mo(14,"div",11),Mo(15,"div",12),Mo(16,"button",13),Vo("click",function(){return e.search(0)}),$o(17,"img",14),Io(),Mo(18,"button",13),Vo("click",function(){return e.search(1)}),$o(19,"img",15),Io(),Io(),Io(),Io(),Io(),Do(20,ZO,4,2,"ngb-alert",16),Mo(21,"div",17),Mo(22,"table",18),Mo(23,"thead",19),Mo(24,"tr"),Mo(25,"th",20),va(26,"Group ID"),Io(),Mo(27,"th"),va(28,"Name"),Io(),Mo(29,"th",21),va(30,"Last Update"),Io(),Do(31,tP,2,0,"th",22),Io(),Io(),Mo(32,"tbody"),Do(33,eP,3,0,"tr",23),Do(34,rP,9,5,"tr",24),Io(),Io(),Io()),2&t&&(Qr(3),ba("",e.groupsCount," groups found."),Qr(4),Fo("formGroup",e.searchForm),Qr(9),Fo("disabled",0===e.groups.length),Qr(2),Fo("disabled",""===e.nextCursor),Qr(2),Fo("ngIf",e.error),Qr(11),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.groups.length),Qr(1),Fo("ngForOf",e.groups))},directives:[pb,Ry,mb,ay,Ty,yb,Bh,Ph,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}"]}),t})(),oP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.queryParamMap.get("filter");return this.consoleService.listGroups("",n,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function aP(t,e){if(1&t){const t=No();Mo(0,"button",13),Vo("click",function(e){return Ie(t),zo().exportGroup(e)}),$o(1,"img",14),va(2,"Export"),Io()}}function lP(t,e){if(1&t){const t=No();Mo(0,"button",15),Vo("click",function(e){return Ie(t),zo().deleteGroup(e,!1)}),$o(1,"img",16),va(2,"Delete"),Io()}}function cP(t,e){if(1&t&&(Mo(0,"ngb-alert",17),$o(1,"img",18),Mo(2,"h6",19),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const hP=function(t,e){return["/groups",t,e]};function uP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,20),Mo(2,"a",21),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,hP,n.group.id,t.path)),Qr(1),ya(t.label)}}const dP=function(){return["/groups"]};let pP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Members",path:"members"}]}ngOnInit(){this.route.data.subscribe(t=>{this.group=t[0]},t=>{this.error=t})}deleteGroup(t,e){t.target.disabled=!0,this.error="",this.consoleService.deleteGroup("",this.group.id).subscribe(()=>{this.error="",this.router.navigate(["/groups"])},t=>{this.error=t})}exportGroup(t){t.target.disabled=!0,this.error="",this.consoleService.exportGroup("",this.group.id).subscribe(e=>{this.error="";const n=this.group.id+"-export.json",i=JSON.stringify(e,null,2),r=(new TextEncoder).encode(i),s=new Blob([r],{type:"application/json;charset=utf-8"});Object(rM.saveAs)(s,n),t.target.disabled=!1},e=>{t.target.disabled=!1,this.error=e})}updateAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}exportAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}banAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:18,vars:7,consts:[[1,"pb-1"],[1,"account-top-nav","d-flex","justify-content-between","align-items-baseline","mb-4"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-outline-secondary mr-2",3,"click",4,"ngIf"],["type","button","class","btn btn-danger btn-danger-icon mr-2",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["accountNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"click"],["src","/static/svg/export.svg","alt","","width","13","height","13",1,"mr-2"],["type","button",1,"btn","btn-danger","btn-danger-icon","mr-2",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","14","height","",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"User Group"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Group"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,aP,3,0,"button",7),Do(12,lP,3,0,"button",8),Io(),Io(),Do(13,cP,4,2,"ngb-alert",9),Mo(14,"nav",10,11),Do(16,uP,4,6,"div",12),Io(),$o(17,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(6,dP)),Qr(3),ya(e.group.id),Qr(2),Fo("ngIf",e.exportAllowed()),Qr(1),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.account-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.account-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),fP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getGroup("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function gP(t,e){if(1&t){const t=No();Mo(0,"button",12),Vo("click",function(e){return Ie(t),zo().deleteLeaderboard(e)}),$o(1,"img",13),va(2,"Delete Leaderboard"),Io()}}function mP(t,e){if(1&t&&(Mo(0,"ngb-alert",14),$o(1,"img",15),Mo(2,"h6",16),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}const vP=function(t,e){return["/leaderboards",t,e]};function yP(t,e){if(1&t&&(Mo(0,"div"),Oo(1,17),Mo(2,"a",18),va(3),Io(),Po(),Io()),2&t){const t=e.$implicit,n=zo();Qr(1),Fo("ngbNavItem",t.path),Qr(1),Fo("routerLink",Hl(3,vP,n.leaderboard.id,t.path)),Qr(1),ya(t.label)}}const bP=function(){return["/leaderboards"]};let wP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.error="",this.views=[{label:"Details",path:"details"},{label:"Records",path:"records"}]}ngOnInit(){this.route.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}deleteLeaderboard(t){t.target.disabled=!0,this.error="",this.consoleService.deleteLeaderboard("",this.leaderboard.id).subscribe(()=>{this.error="",this.router.navigate(["/leaderboards"])},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_DEVELOPER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:17,vars:6,consts:[[1,"pb-1"],[1,"leaderboard-top-nav","d-flex","justify-content-between","align-items-baseline","mb-3"],["aria-label","breadcrumb"],[1,"breadcrumb"],[1,"breadcrumb-item"],[3,"routerLink"],[1,"breadcrumb-item","active"],["type","button","class","btn btn-danger btn-danger-icon",3,"click",4,"ngIf"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],["ngbNav","",1,"navbar-expand-sm","p-0","mb-3"],["leaderboardNav","ngbNav"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-danger","btn-danger-icon",3,"click"],["src","/static/svg/bin-red.svg","alt","","width","13","height","13",1,"mr-2"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"ngbNavItem"],["ngbNavLink","","routerLinkActive","account-link-active",3,"routerLink"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Leaderboard"),Io(),Mo(2,"div",1),Mo(3,"nav",2),Mo(4,"ol",3),Mo(5,"li",4),Mo(6,"a",5),va(7,"Leaderboards"),Io(),Io(),Mo(8,"li",6),va(9),Io(),Io(),Io(),Mo(10,"div"),Do(11,gP,3,0,"button",7),Io(),Io(),Do(12,mP,4,2,"ngb-alert",8),Mo(13,"nav",9,10),Do(15,yP,4,6,"div",11),Io(),$o(16,"router-outlet")),2&t&&(Qr(6),Fo("routerLink",Ul(5,bP)),Qr(3),ya(e.leaderboard.id),Qr(2),Fo("ngIf",e.deleteAllowed()),Qr(1),Fo("ngIf",e.error),Qr(3),Fo("ngForOf",e.views))},directives:[Mv,Bh,f_,Ph,Ov,_x,p_,g_,$v],styles:[".nav-link[_ngcontent-%COMP%]{font-size:12px;font-family:Montserrat,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:#000;opacity:.5;padding:0 0 1.6em;margin-right:3em;margin-bottom:-2px;font-weight:600}.nav-link[_ngcontent-%COMP%]:hover{opacity:1}.nav-link.account-link-active[_ngcontent-%COMP%]{opacity:1;border-bottom:2px solid #7668ed}.leaderboard-top-nav[_ngcontent-%COMP%], .navbar-expand-sm[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9}.leaderboard-top-nav[_ngcontent-%COMP%]{padding-bottom:1.5em}"]}),t})(),xP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.paramMap.get("id");return this.consoleService.getLeaderboard("",n)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const _P=["editor"];function CP(t,e){if(1&t&&(Mo(0,"ngb-alert",24),$o(1,"img",25),Mo(2,"h6",26),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function SP(t,e){if(1&t&&(Mo(0,"div",27),Mo(1,"h6"),va(2,"Tournament"),Io(),$o(3,"hr",28),Mo(4,"div",2),Mo(5,"div",3),Mo(6,"div",4),Mo(7,"label",29),va(8,"Title"),Io(),Io(),$o(9,"input",30),Io(),Mo(10,"div",3),Mo(11,"div",4),Mo(12,"label",31),va(13,"Description"),Io(),Io(),$o(14,"input",32),Io(),Io(),Mo(15,"div",2),Mo(16,"div",3),Mo(17,"div",4),Mo(18,"label",33),va(19,"Category"),Io(),Io(),$o(20,"input",34),Io(),Mo(21,"div",3),Mo(22,"div",4),Mo(23,"label",35),va(24,"Max Num Score"),Io(),Io(),$o(25,"input",36),Io(),Io(),Mo(26,"div",2),Mo(27,"div",3),Mo(28,"div",4),Mo(29,"label",37),va(30,"Size"),Io(),Io(),$o(31,"input",38),Io(),Mo(32,"div",3),Mo(33,"div",4),Mo(34,"label",39),va(35,"Max Size"),Io(),Io(),$o(36,"input",40),Io(),Io(),Mo(37,"div",2),Mo(38,"div",3),Mo(39,"div",4),Mo(40,"label",41),va(41,"Duration"),Io(),Io(),$o(42,"input",42),Io(),Mo(43,"div",3),Mo(44,"div",4),Mo(45,"label",43),va(46,"Join Required"),Io(),Io(),$o(47,"input",44),Io(),Io(),Mo(48,"div",2),Mo(49,"div",3),Mo(50,"div",4),Mo(51,"label",45),va(52,"Start Time"),Io(),Io(),$o(53,"input",46),Io(),Mo(54,"div",3),Mo(55,"div",4),Mo(56,"label",47),va(57,"End Time"),Io(),Io(),$o(58,"input",48),Io(),Io(),Mo(59,"div",2),Mo(60,"div",3),Mo(61,"div",4),Mo(62,"label",49),va(63,"Start Active"),Io(),Io(),$o(64,"input",50),Io(),Mo(65,"div",3),Mo(66,"div",4),Mo(67,"label",51),va(68,"End Active"),Io(),Io(),$o(69,"input",52),Io(),Io(),Io()),2&t){const t=zo();Qr(9),Fo("value",t.leaderboard.title),Qr(5),Fo("value",t.leaderboard.description),Qr(6),Fo("value",t.leaderboard.category),Qr(5),Fo("value",t.leaderboard.max_num_score),Qr(6),Fo("value",t.leaderboard.size),Qr(5),Fo("value",t.leaderboard.max_size),Qr(6),Fo("value",t.leaderboard.duration),Qr(5),Fo("value",t.leaderboard.join_required),Qr(6),Fo("value",t.leaderboard.start_time),Qr(5),Fo("value",t.leaderboard.end_time),Qr(6),Fo("value",t.leaderboard.start_active),Qr(5),Fo("value",t.leaderboard.end_active)}}let EP=(()=>{class t{constructor(t){this.route=t,this.orderString={0:"Ascending",1:"Descending"},this.operatorString={0:"Best",1:"Set",2:"Increment",3:"Decrement"},this.error=""}ngOnInit(){this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}ngAfterViewInit(){if(vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.leaderboard.metadata){const t=JSON.stringify(JSON.parse(this.leaderboard.metadata),null,2);this.aceEditor.session.setValue(t)}}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&sc(_P,!0),2&t){let t;ic(t=lc())&&(e.editor=t.first)}},decls:50,vars:10,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"add-border","mb-3"],[1,"row"],[1,"col-md-6","d-flex","justify-content-start","align-items-baseline"],[1,"col-3","pl-0"],["for","id",1,"d-inline"],["type","text","id","id","placeholder","ID","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","authoritative",1,"d-inline"],["type","text","id","authoritative","placeholder","Authoritative","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","sortorder",1,"d-inline"],["type","text","id","sortorder","placeholder","Sort Order","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","operator",1,"d-inline"],["type","text","id","operator","placeholder","Operator","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","reset",1,"d-inline"],["type","text","id","reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","create_time",1,"d-inline"],["type","text","id","create_time","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],[1,"row","add-border-single-row-bottom"],["type","text","id","prev_reset","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["type","text","id","next_reset","placeholder","Create Time","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["class","mt-4",4,"ngIf"],[1,"card","p-2","mb-3",2,"height","400px"],[2,"height","400px"],["editor",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"mt-4"],[1,"mb-4"],["for","title",1,"d-inline"],["type","text","id","title","placeholder","Title","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","description",1,"d-inline"],["type","text","id","description","placeholder","Description","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","category",1,"d-inline"],["type","text","id","category","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_num_score",1,"d-inline"],["type","text","id","max_num_score","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","size",1,"d-inline"],["type","text","id","size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","max_size",1,"d-inline"],["type","text","id","max_size","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","duration",1,"d-inline"],["type","text","id","duration","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","join_required",1,"d-inline"],["type","text","id","join_required","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_time",1,"d-inline"],["type","text","id","start_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_time",1,"d-inline"],["type","text","id","end_time","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","start_active",1,"d-inline"],["type","text","id","start_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"],["for","end_active",1,"d-inline"],["type","text","id","end_active","placeholder","Not Set","disabled","","readonly","",1,"form-control-plaintext","form-control-sm","my-2",3,"value"]],template:function(t,e){1&t&&(Do(0,CP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),Mo(3,"div",3),Mo(4,"div",4),Mo(5,"label",5),va(6,"ID"),Io(),Io(),$o(7,"input",6),Io(),Mo(8,"div",3),Mo(9,"div",4),Mo(10,"label",7),va(11,"Authoritative"),Io(),Io(),$o(12,"input",8),Io(),Io(),Mo(13,"div",2),Mo(14,"div",3),Mo(15,"div",4),Mo(16,"label",9),va(17,"Sort Order"),Io(),Io(),$o(18,"input",10),Io(),Mo(19,"div",3),Mo(20,"div",4),Mo(21,"label",11),va(22,"Operator"),Io(),Io(),$o(23,"input",12),Io(),Io(),Mo(24,"div",2),Mo(25,"div",3),Mo(26,"div",4),Mo(27,"label",13),va(28,"Reset Schedule"),Io(),Io(),$o(29,"input",14),Io(),Mo(30,"div",3),Mo(31,"div",4),Mo(32,"label",15),va(33,"Create Time"),Io(),Io(),$o(34,"input",16),Io(),Io(),Mo(35,"div",17),Mo(36,"div",3),Mo(37,"div",4),Mo(38,"label",13),va(39,"Prev Reset"),Io(),Io(),$o(40,"input",18),Io(),Mo(41,"div",3),Mo(42,"div",4),Mo(43,"label",15),va(44,"Next Reset"),Io(),Io(),$o(45,"input",19),Io(),Io(),Io(),Do(46,SP,70,12,"div",20),Mo(47,"div",21),$o(48,"div",22,23),Io()),2&t&&(Fo("ngIf",e.error),Qr(7),Fo("value",e.leaderboard.id),Qr(5),Fo("value",e.leaderboard.authoritative),Qr(6),Fo("value",e.orderString[e.leaderboard.sort_order]),Qr(5),Fo("value",e.operatorString[e.leaderboard.operator]),Qr(6),Fo("value",e.leaderboard.reset_schedule),Qr(5),Fo("value",e.leaderboard.create_time),Qr(6),Fo("value",e.leaderboard.prev_reset),Qr(5),Fo("value",e.leaderboard.next_reset),Qr(1),Fo("ngIf",e.leaderboard.tournament))},directives:[Bh,_x],styles:[".leaderboard-top-nav[_ngcontent-%COMP%]{border-bottom:1px solid #dadae9;padding-bottom:1.5em}"]}),t})();function kP(t,e){if(1&t&&(Mo(0,"ngb-alert",19),$o(1,"img",20),Mo(2,"h6",21),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("An error occurred: ",t.error,"")}}function AP(t,e){1&t&&(Mo(0,"th",22),va(1,"Remove"),Io())}function DP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",23),va(2,"No records found."),Io(),Io())}function TP(t,e){1&t&&$o(0,"div",28)}function RP(t,e){1&t&&$o(0,"div",29)}function FP(t,e){if(1&t){const t=No();Mo(0,"td",30),Mo(1,"button",31),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteRecord(e,i,r)}),va(2,"Delete"),Io(),Io()}}function LP(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",32),Mo(2,"pre",33),Mo(3,"small"),va(4),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(4),ya(t.metadata)}}function MP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",24),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.recordsMetadataOpen[n]=!i.recordsMetadataOpen[n]}),Do(3,TP,1,0,"div",25),Do(4,RP,1,0,"div",26),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Mo(16,"td"),va(17),Io(),Do(18,FP,3,0,"td",27),Io(),Do(19,LP,5,1,"tr",17)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.recordsMetadataOpen[t]),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t]),Qr(1),ba(" ",n.owner_id," "),Qr(2),ya(n.username),Qr(2),ya(n.score),Qr(2),ya(n.subscore),Qr(2),ya(n.rank),Qr(2),ya(n.num_score),Qr(2),ya(n.expiry_time?n.expiry_time:"-"),Qr(1),Fo("ngIf",i.deleteAllowed()),Qr(1),Fo("ngIf",i.recordsMetadataOpen[t])}}let IP=(()=>{class t{constructor(t,e,n){this.route=t,this.consoleService=e,this.authService=n,this.error="",this.records=[],this.recordsMetadataOpen=[],this.nextCursor="",this.prevCursor=""}ngOnInit(){this.route.data.subscribe(t=>{this.records.length=0,this.records.push(...t[0].records),this.nextCursor=t[0].next_cursor,this.prevCursor=t[0].prev_cursor,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t}),this.route.parent.data.subscribe(t=>{this.leaderboard=t[0]},t=>{this.error=t})}loadRecords(t){let e="";switch(t){case-1:e=this.prevCursor;break;case 0:e="";break;case 1:e=this.nextCursor}this.consoleService.listLeaderboardRecords("",this.leaderboard.id,null,100,e,null).subscribe(t=>{this.error="",this.nextCursor=t.next_cursor,this.prevCursor=t.prev_cursor,this.records.length=0,this.records.push(...t.records),this.recordsMetadataOpen.length=0,this.recordsMetadataOpen.length=this.records.length},t=>{this.error=t})}deleteRecord(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteLeaderboardRecord("",n.leaderboard_id,n.owner_id).subscribe(()=>{this.error="",this.records.splice(e,1),this.recordsMetadataOpen.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(dw),Ro(mw))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:34,vars:7,consts:[["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered"],[1,"thead-light"],[2,"width","380px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],[4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],["colSpan","8",1,"text-muted"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],["colspan","7",1,"align-middle"],[1,"pre-wrap","m-0","p-0"]],template:function(t,e){1&t&&(Do(0,kP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadRecords(0)}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadRecords(-1)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadRecords(1)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th",13),va(17,"Owner ID"),Io(),Mo(18,"th"),va(19,"Username"),Io(),Mo(20,"th",14),va(21,"Score"),Io(),Mo(22,"th",14),va(23,"Subscore"),Io(),Mo(24,"th",14),va(25,"Rank"),Io(),Mo(26,"th",14),va(27,"No. of scores"),Io(),Mo(28,"th",15),va(29,"Expiry Time"),Io(),Do(30,AP,2,0,"th",16),Io(),Io(),Mo(31,"tbody"),Do(32,DP,3,0,"tr",17),Do(33,MP,20,11,"ng-template",18),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.records.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(20),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.records.length),Qr(1),Fo("ngForOf",e.records))},directives:[Bh,Ph,_x],styles:[""]}),t})(),$P=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listLeaderboardRecords("",n,null,100,null,null)}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const OP=["editor"],PP=["editorResponse"];function NP(t,e){if(1&t&&(Mo(0,"ngb-alert",23),$o(1,"img",24),Mo(2,"h6",25),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error whilst making RPC call: ",t.error,"")}}function BP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}function UP(t,e){if(1&t&&(Mo(0,"option",26),va(1),Io()),2&t){const t=e.$implicit;Ko("value",t.method),Qr(1),ya(t.method)}}let VP=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.consoleService=n,this.formBuilder=i,this.error="",this.rpcEndpoints=[],this.endpoints=[]}ngOnInit(){this.endpointCallForm=this.formBuilder.group({method:["",py.required],user_id:[""]}),this.f.method.valueChanges.subscribe(t=>{const e=this.endpoints.concat(this.rpcEndpoints).find(e=>e.method===t?e:null);this.updateQueryParam(e.method),this.setupRequestBody(e.body_template)}),this.route.data.subscribe(t=>{const e=t[0];this.endpoints.length=0,this.endpoints.push(...e.endpoints),this.rpcEndpoints.length=0,this.rpcEndpoints.push(...e.rpc_endpoints)},t=>{this.error=t});const t=this.endpoints.concat(this.rpcEndpoints).find(t=>t.method===this.route.snapshot.queryParamMap.get("endpoint")?t:null);null!=t&&this.f.method.setValue(t.method)}ngAfterViewInit(){vI.config.set("fontSize","14px"),vI.config.set("printMarginColumn",0),vI.config.set("useWorker",!0),vI.config.set("highlightSelectedWord",!0),vI.config.set("fontFamily",'"Courier New", Courier, monospace'),this.aceEditor=vI.edit(this.editor.nativeElement),this.aceEditor.setReadOnly(!0),this.aceEditorResponse=vI.edit(this.editorResponse.nativeElement),this.aceEditorResponse.setReadOnly(!0)}sendRequest(){this.error="";let t=this.aceEditor.session.getValue();if(""!==t)try{t=JSON.stringify(JSON.parse(t))}catch(i){return void(this.error=i)}const e={user_id:this.f.user_id.value,body:t};let n=null;n=this.isRpcEndpoint(this.f.method.value)?this.consoleService.callRpcEndpoint("",this.f.method.value,e):this.consoleService.callApiEndpoint("",this.f.method.value,e),n.subscribe(e=>{if(e.error_message&&""!==e.error_message)this.aceEditorResponse.session.setValue(e.error_message);else{t="";try{t=JSON.stringify(JSON.parse(e.body),null,2)}catch(i){return void(this.error=i)}this.aceEditorResponse.session.setValue(t)}},t=>{this.aceEditorResponse.session.setValue(""),this.error=t})}isRpcEndpoint(t){return null!=this.rpcEndpoints.find(e=>e.method===t?e:null)}setupRequestBody(t){if(null!=this.aceEditor){if(!t||""===t)return this.aceEditor.session.setValue(""),void this.aceEditor.setReadOnly(!this.isRpcEndpoint(this.f.method.value));try{const e=JSON.stringify(JSON.parse(t),null,2);this.aceEditor.session.setValue(e),this.aceEditor.setReadOnly(!1)}catch(e){return void(this.error=e)}}else console.log("problem?")}updateQueryParam(t){this.router.navigate([],{relativeTo:this.route,queryParams:{endpoint:t},queryParamsHandling:"merge"})}get f(){return this.endpointCallForm.controls}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(_b))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],viewQuery:function(t,e){if(1&t&&(sc(OP,!0),sc(PP,!0)),2&t){let t;ic(t=lc())&&(e.editor=t.first),ic(t=lc())&&(e.editorResponse=t.first)}},decls:35,vars:6,consts:[[1,"pb-4"],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[3,"formGroup","ngSubmit"],[1,"input-group"],[1,"input-group-prepend"],["id","method","formControlName","method",1,"form-control","custom-select","dropdown-radius"],["disabled","",3,"value"],[3,"value",4,"ngFor","ngForOf"],["disabled","",1,"text-muted"],["type","text","formControlName","user_id","placeholder","set user ID as request context",1,"form-control","border-right-0"],[1,"input-group-append"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"d-flex"],[1,"w-50","py-3"],[1,"mb-4"],[1,"card","p-2","mb-3"],[2,"height","500px"],["editor",""],[1,"w-50","pl-3","py-3"],["editorResponse",""],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[3,"value"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"API Explorer"),Io(),Do(2,NP,4,2,"ngb-alert",1),Mo(3,"div",2),Mo(4,"div",3),Mo(5,"div",4),Mo(6,"form",5),Vo("ngSubmit",function(){return e.sendRequest()}),Mo(7,"div",6),Mo(8,"div",7),Mo(9,"select",8),Mo(10,"option",9),va(11,"Select Endpoint"),Io(),Do(12,BP,2,2,"option",10),Mo(13,"option",11),va(14,"----"),Io(),Do(15,UP,2,2,"option",10),Io(),Io(),$o(16,"input",12),Mo(17,"div",13),Mo(18,"button",14),va(19,"Send Request"),Io(),Io(),Io(),Io(),Io(),Io(),Io(),Mo(20,"div",15),Mo(21,"div",16),Mo(22,"h5"),va(23,"Request Body"),Io(),$o(24,"hr",17),Mo(25,"div",18),$o(26,"div",19,20),Io(),Io(),Mo(28,"div",21),Mo(29,"h5"),va(30,"Response"),Io(),$o(31,"hr",17),Mo(32,"div",18),$o(33,"div",19,22),Io(),Io(),Io()),2&t&&(Qr(2),Fo("ngIf",e.error),Qr(4),Fo("formGroup",e.endpointCallForm),Qr(4),Fo("value",""),Qr(2),Fo("ngForOf",e.rpcEndpoints),Qr(3),Fo("ngForOf",e.endpoints),Qr(3),Fo("disabled",e.f.method.invalid))},directives:[Bh,pb,Ry,mb,Uy,Ty,yb,Vy,Wy,Ph,ay,_x],styles:[".dropdown-radius[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}"]}),t})(),HP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){return this.consoleService.listApiEndpoints("")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function jP(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function zP(t,e){1&t&&$o(0,"div",23)}function WP(t,e){1&t&&$o(0,"div",24)}function GP(t,e){if(1&t&&(Mo(0,"tr",25),Mo(1,"td",26),Mo(2,"div",27),Mo(3,"div"),Mo(4,"small"),Mo(5,"b"),va(6,"Provider Response"),Io(),Io(),Io(),Mo(7,"div"),Mo(8,"pre",28),Mo(9,"small"),va(10),Io(),Io(),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(10),ya(t.provider_response)}}function qP(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",19),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.purchasesRowsOpen[n]=!i.purchasesRowsOpen[n]}),Do(3,zP,1,0,"div",20),Do(4,WP,1,0,"div",21),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Io(),Do(16,GP,11,1,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.purchasesRowsOpen[t]),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t]),Qr(1),ba(" ",n.product_id," "),Qr(2),ya(n.transaction_id),Qr(2),ya(i.getStoreText(n.store)),Qr(2),ya(n.purchase_time),Qr(2),ya(n.create_time),Qr(2),ya(i.getRefundText(n.refund_time)),Qr(1),Fo("ngIf",i.purchasesRowsOpen[t])}}function KP(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",29),va(2,"No purchases were found."),Io(),Io())}let XP=(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.purchases=[],this.purchasesRowsOpen=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.purchases=t[0].validated_purchases,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listPurchases("",this.userID,this.limit,t).subscribe(t=>{this.purchases=t.validated_purchases,this.purchasesRowsOpen=[],this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}getRefundText(t){return"1970-01-01T00:00:00Z"===t?"":t}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-purchases"]],decls:31,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"open-row"],["colspan","6"],[1,"p-2"],[1,"pre-wrap","m-0","p-0"],["colspan","6",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,jP,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Create Time"),Io(),Mo(26,"th",13),va(27,"Refund Time"),Io(),Io(),Io(),Mo(28,"tbody"),Do(29,qP,17,9,"ng-template",14),Do(30,KP,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.purchases.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(19),Fo("ngForOf",e.purchases),Qr(1),Fo("ngIf",0===e.purchases.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),YP=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listPurchases("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function JP(t,e){1&t&&(Mo(0,"span"),va(1,"Filter by type"),Io())}function QP(t,e){if(1&t&&(Mo(0,"span"),va(1),Io()),2&t){const t=zo();Qr(1),ya(t.activeFilter)}}function ZP(t,e){if(1&t){const t=No();Mo(0,"button",40),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().activeFilter=n}),va(1),Io()}if(2&t){const t=e.$implicit;Qr(1),ya(t)}}function tN(t,e){if(1&t&&(Mo(0,"h6"),va(1),Io()),2&t){const t=zo();Qr(1),ba("Showing results for chat room label: ",t.f1.label.value,"")}}const eN=function(t){return["/groups",t]};function nN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for group ID: "),Mo(2,"a",41),va(3),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(2,eN,t.route.snapshot.queryParamMap.get("group_id"))),Qr(1),ya(t.f2.group_id.value)}}const iN=function(t){return["/accounts",t]};function rN(t,e){if(1&t&&(Mo(0,"h6"),va(1,"Showing results for user IDs: "),Mo(2,"a",41),va(3),Io(),va(4,", "),Mo(5,"a",41),va(6),Io(),Io()),2&t){const t=zo();Qr(2),Fo("routerLink",Vl(4,iN,t.route.snapshot.queryParamMap.get("user_id_one"))),Qr(1),ya(t.f3.user_id_one.value),Qr(2),Fo("routerLink",Vl(6,iN,t.route.snapshot.queryParamMap.get("user_id_two"))),Qr(1),ya(t.f3.user_id_two.value)}}function sN(t,e){if(1&t&&(Mo(0,"ngb-alert",42),$o(1,"img",43),Mo(2,"h6",44),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error when querying messages: ",t.error,"")}}function oN(t,e){1&t&&(Mo(0,"th",45),va(1,"Remove"),Io())}function aN(t,e){if(1&t&&(Mo(0,"tr"),Mo(1,"td",46),va(2,"No messages found."),Io(),Io()),2&t){const t=zo();Qr(1),ko("colspan",t.deleteAllowed()?6:5)}}function lN(t,e){1&t&&$o(0,"div",55)}function cN(t,e){1&t&&$o(0,"div",56)}function hN(t,e){1&t&&$o(0,"td")}function uN(t,e){if(1&t){const t=No();Mo(0,"td",57),Mo(1,"button",58),Vo("click",function(e){Ie(t);const n=zo(),i=n.index,r=n.$implicit;return zo().deleteMessage(e,i,r)}),va(2,"Delete"),Io(),Io()}}function dN(t,e){if(1&t&&(Mo(0,"tr",59),Mo(1,"td"),va(2),Io(),Io()),2&t){const t=zo().$implicit,e=zo();Qr(1),ko("colspan",e.deleteAllowed()?6:5),Qr(1),ba(" ",t.content," ")}}function pN(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),va(2),Io(),Mo(3,"td",47),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(4),Io(),Mo(5,"td",48),Vo("click",function(){Ie(t);const n=e.$implicit;return zo().viewAccount(n)}),va(6),Io(),Mo(7,"td",49),Mo(8,"div",50),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.messageStatesOpen[n]=!i.messageStatesOpen[n]}),Do(9,lN,1,0,"div",51),Do(10,cN,1,0,"div",52),Io(),va(11),Io(),Mo(12,"td"),va(13),Io(),Do(14,hN,1,0,"td",3),Do(15,uN,3,0,"td",53),Io(),Do(16,dN,3,2,"tr",54)}if(2&t){const t=e.$implicit,n=e.index,i=zo();Qr(2),ya(t.code),Qr(2),ya(t.sender_id),Qr(2),ya(t.username),Qr(3),Fo("ngIf",!i.messageStatesOpen[n]),Qr(1),Fo("ngIf",i.messageStatesOpen[n]),Qr(1),ba(" ",t.content," "),Qr(2),ya(t.create_time),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id===i.systemUserId),Qr(1),Fo("ngIf",i.deleteAllowed()&&t.sender_id!==i.systemUserId),Qr(1),Fo("ngIf",i.messageStatesOpen[n])}}function fN(t,e){if(1&t&&(Mo(0,"ngb-alert",60),$o(1,"img",43),Mo(2,"h6",44),va(3,"Failed to delete data."),Io(),Mo(4,"p",61),va(5),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(5),ya(t.deleteError)}}function gN(t,e){if(1&t){const t=No();Mo(0,"ngb-alert",62),Vo("close",function(){return Ie(t),zo().deleteSuccess=!1}),$o(1,"img",63),Mo(2,"h6",44),va(3),Io(),Io()}if(2&t){const t=zo();Fo("dismissible",!0),Qr(3),wa("",t.total_deleted," messages ",t.total_deleted>0?"successfully":""," deleted.")}}const mN=function(t){return{"is-invalid":t}};function vN(t,e){if(1&t&&(Mo(0,"div",64),Mo(1,"h5",65),va(2,"Delete messages"),Io(),Mo(3,"button",66),Vo("click",function(){return e.$implicit.dismiss()}),Mo(4,"span",67),va(5,"\xd7"),Io(),Io(),Io(),Mo(6,"div",68),Mo(7,"div",69),Mo(8,"form",70),Mo(9,"div",71),Mo(10,"p"),Mo(11,"b"),va(12,"Choose how many days to retain: "),Io(),$o(13,"input",72),Io(),Io(),$o(14,"input",73),Io(),Io(),Io(),Mo(15,"div",74),Mo(16,"button",75),Vo("click",function(){return e.$implicit.dismiss()}),va(17,"Cancel"),Io(),Mo(18,"button",76),Vo("click",function(){return e.$implicit.close()}),va(19,"DELETE"),Io(),Io()),2&t){const t=zo();Qr(8),Fo("formGroup",t.confirmDeleteForm),Qr(6),Fo("ngClass",Vl(3,mN,t.f.delete.touched&&t.f.delete.invalid)),Qr(4),Fo("disabled",t.f.delete.invalid)}}function yN(t,e){if(1&t){const t=No();Mo(0,"button",76),Vo("click",function(){Ie(t);const e=zo(),n=To(68);return e.openDeleteDataModal(n)}),va(1,"Delete messages"),Io()}2&t&&Fo("disabled",zo().deleting)}let bN=(()=>{class t{constructor(t,e,n,i,r,s){this.route=t,this.router=e,this.consoleService=n,this.authService=i,this.formBuilder=r,this.modalService=s,this.systemUserId="00000000-0000-0000-0000-000000000000",this.error="",this.messages=[],this.nextCursor="",this.deleteError="",this.deleteSuccess=!1,this.deleting=!1,this.total_deleted=0,this.activeFilter="",this.filters=["Chat Room","Group Chat","Direct Chat"],this.messageStatesOpen=[],this.searchForm1=this.formBuilder.group({label:""}),this.searchForm2=this.formBuilder.group({group_id:""}),this.searchForm3=this.formBuilder.group({user_id_one:"",user_id_two:""}),this.confirmDeleteForm=this.formBuilder.group({delete:["",py.compose([py.required,py.pattern("DELETE")])],days:30})}ngOnInit(){const t=this.route.snapshot.queryParamMap;this.f1.label.setValue(t.get("label")),this.f2.group_id.setValue(t.get("group_id")),this.f3.user_id_one.setValue(t.get("user_id_one")),this.f3.user_id_two.setValue(t.get("user_id_two")),this.nextCursor=t.get("cursor");let e=t.get("type");this.type=Number(e),this.route.data.subscribe(t=>{t&&(t[0]&&(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t[0].messages),this.nextCursor=t[0].next_cursor),t.error&&(this.error=t.error))},t=>{this.error=t}),null===e?(this.type=2,this.activeFilter=this.filters[0]):2==this.type||3==this.type||4==this.type?this.activeFilter=this.filters[this.type-2]:this.error="Invalid type."}search(t){let e="";switch(t){case 0:e="";break;case 1:e=this.nextCursor}this.updateMessages(this.type,this.f1.label.value,this.f2.group_id.value,this.f3.user_id_one.value,this.f3.user_id_two.value,e)}updateMessages(t,e,n,i,r,s){switch(t){case 2:this.consoleService.listChannelMessages("",t.toString(),e,null,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 3:this.consoleService.listChannelMessages("",t.toString(),null,n,null,null,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t});break;case 4:this.consoleService.listChannelMessages("",t.toString(),null,null,i,r,encodeURIComponent(s)).subscribe(t=>this.postData(t,s),t=>{this.error=t})}}postData(t,e){let n;switch(this.error="",this.messageStatesOpen=[],this.messages.length=0,this.messages.push(...t.messages),this.nextCursor=t.next_cursor,this.type){case 2:n={type:this.type,label:this.f1.label.value,cursor:e};break;case 3:n={type:this.type,group_id:this.f2.group_id.value,cursor:e};break;case 4:n={type:this.type,user_id_one:this.f3.user_id_one.value,user_id_two:this.f3.user_id_two.value,cursor:e}}this.router.navigate([],{relativeTo:this.route,queryParams:n})}deleteMessage(t,e,n){t.target.disabled=!0,t.preventDefault(),this.error="",this.consoleService.deleteChannelMessages("",null,[n.message_id]).subscribe(()=>{this.error="",this.messageStatesOpen.splice(e,1),this.messages.splice(e,1)},t=>{this.error=t})}deleteAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}deleteMessagesAllowed(){return this.authService.sessionRole<=cw.USER_ROLE_MAINTAINER}get f1(){return this.searchForm1.controls}get f2(){return this.searchForm2.controls}get f3(){return this.searchForm3.controls}get f(){return this.confirmDeleteForm.controls}openDeleteDataModal(t){this.modalService.open(t,{centered:!0}).result.then(()=>{this.deleteData(),this.confirmDeleteForm.controls.delete.setValue("")},()=>{this.confirmDeleteForm.controls.delete.setValue("")})}deleteData(){this.deleteError="",this.deleting=!0;let t=new Date;t.setDate(t.getDate()-this.f.days.value),this.consoleService.deleteChannelMessages("",t.toISOString(),null).subscribe(t=>{this.total_deleted=Number(t.total),this.deleting=!1,this.deleteError="",this.deleteSuccess=!0;const e=this.route.snapshot.queryParamMap;let n=e.get("type"),i=e.get("label");i||(i="0");let r=e.get("group_id"),s=e.get("user_id_one"),o=e.get("user_id_two"),a=e.get("cursor");a||(a=""),n&&this.updateMessages(Number(n),i,r,s,o,a)},t=>{this.deleting=!1,this.deleteError=t})}viewAccount(t){this.router.navigate(["/accounts",t.sender_id],{relativeTo:this.route})}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw),Ro(mw),Ro(_b),Ro(a_))},t.\u0275cmp=Bt({type:t,selectors:[["ng-component"]],decls:70,vars:21,consts:[[1,"pb-1"],["ngbDropdown","",1,"btn-group","mb-1"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary"],[4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],["type","button","ngbDropdownItem","",3,"click",4,"ngFor","ngForOf"],[1,"row","no-gutters","mb-4"],[1,"col","d-flex","justify-content-between","no-gutters","align-items-center"],[1,"col-md-9"],[3,"hidden","formGroup"],[1,"input-group"],["type","text","formControlName","label","placeholder","Search by chat room label",1,"form-control","border-right-0"],[1,"input-group-append"],[1,"btn-group"],["type","submit",1,"btn","btn-primary","dropdown-radius-left",3,"click"],["type","text","formControlName","group_id","placeholder","Search by group ID",1,"form-control","border-right-0"],["type","text","formControlName","user_id_one","placeholder","Search by user ID 1",1,"form-control","border-right-0"],[1,"input-group-text",3,"click"],["src","/static/svg/purple-cog-1.svg","alt","","width","20","height","",1,"mr-1"],["type","text","formControlName","user_id_two","placeholder","Search by user ID 2",1,"form-control","border-right-0"],[1,"col-md-3","justify-content-end","text-right"],["role","group","aria-label","Basic example",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],["type","danger","class","mb-3",3,"dismissible",4,"ngIf"],[1,"row","no-gutters"],[1,"table","table-sm","table-hover","table-bordered",2,"table-layout","fixed"],[1,"thead-light"],[2,"width","60px"],[2,"width","320px"],[2,"width","150px"],[2,"width","180px"],["style","width: 90px",4,"ngIf"],["ngFor","",3,"ngForOf"],["type","danger",3,"dismissible",4,"ngIf"],["type","success",3,"dismissible","close",4,"ngIf"],["role","alert",1,"d-flex","justify-content-between","align-items-center"],["confirmDelete",""],["type","button","class","btn btn-danger",3,"disabled","click",4,"ngIf"],["type","button","ngbDropdownItem","",3,"click"],[2,"width","100%",3,"routerLink"],["type","danger",1,"mb-3",3,"dismissible"],["src","/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[2,"width","90px"],[1,"text-muted"],[3,"click"],[2,"text-overflow","ellipsis","overflow","hidden",3,"click"],[2,"white-space","nowrap","text-overflow","ellipsis","overflow","hidden"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","text-center",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"text-center"],["type","button",1,"btn","btn-sm","btn-danger",3,"click"],[1,"open-row"],["type","danger",3,"dismissible"],[1,"mb-0","pl-4"],["type","success",3,"dismissible","close"],["src","/static/svg/green-tick.svg","alt","","width","16","height","",1,"mr-2"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-describedby","modal-title",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"d-flex","flex-column","justify-content-center"],["autocomplete","off",3,"formGroup"],[1,"mt-2"],["type","number","value","30","min","0","formControlName","days",2,"width","80px"],["type","text","id","delete-confirm","placeholder","Type 'DELETE' to confirm","formControlName","delete",1,"form-control",3,"ngClass"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-danger",3,"disabled","click"]],template:function(t,e){1&t&&(Mo(0,"h2",0),va(1,"Chat Messages"),Io(),Mo(2,"div",1),Mo(3,"button",2),Do(4,JP,2,0,"span",3),Do(5,QP,2,1,"span",3),Io(),Mo(6,"div",4),Do(7,ZP,2,1,"button",5),Io(),Io(),Mo(8,"div",6),Mo(9,"div",7),Mo(10,"div",8),Mo(11,"form",9),Mo(12,"div",10),$o(13,"input",11),Mo(14,"div",12),Mo(15,"div",13),Mo(16,"button",14),Vo("click",function(){return e.type=2,e.search(0)}),va(17,"Search"),Io(),Io(),Io(),Io(),Io(),Mo(18,"form",9),Mo(19,"div",10),$o(20,"input",15),Mo(21,"div",12),Mo(22,"div",13),Mo(23,"button",14),Vo("click",function(){return e.type=3,e.search(0)}),va(24,"Search "),Io(),Io(),Io(),Io(),Io(),Mo(25,"form",9),Mo(26,"div",10),$o(27,"input",16),Mo(28,"div",12),Mo(29,"span",17),Vo("click",function(){return e.f3.user_id_one.setValue(e.systemUserId)}),$o(30,"img",18),Io(),Io(),$o(31,"input",19),Mo(32,"div",12),Mo(33,"div",13),Mo(34,"button",14),Vo("click",function(){return e.type=4,e.search(0)}),va(35,"Search "),Io(),Io(),Io(),Io(),Io(),Io(),Mo(36,"div",20),Mo(37,"div",21),Mo(38,"button",22),Vo("click",function(){return e.search(0)}),$o(39,"img",23),Io(),Mo(40,"button",22),Vo("click",function(){return e.search(1)}),$o(41,"img",24),Io(),Io(),Io(),Io(),Io(),Do(42,tN,2,1,"h6",3),Do(43,nN,4,4,"h6",3),Do(44,rN,7,8,"h6",3),Do(45,sN,4,2,"ngb-alert",25),Mo(46,"div",26),Mo(47,"table",27),Mo(48,"thead",28),Mo(49,"tr"),Mo(50,"th",29),va(51,"Code"),Io(),Mo(52,"th",30),va(53,"Sender ID"),Io(),Mo(54,"th",31),va(55,"Username"),Io(),Mo(56,"th"),va(57,"Content"),Io(),Mo(58,"th",32),va(59,"Create Time"),Io(),Do(60,oN,2,0,"th",33),Io(),Io(),Mo(61,"tbody"),Do(62,aN,3,1,"tr",3),Do(63,pN,17,10,"ng-template",34),Io(),Io(),Io(),Do(64,fN,6,2,"ngb-alert",35),Do(65,gN,4,3,"ngb-alert",36),Mo(66,"div",37),Do(67,vN,20,5,"ng-template",null,38,dc),Do(69,yN,2,1,"button",39),Io()),2&t&&(Qr(4),Fo("ngIf",!e.activeFilter||""===e.activeFilter),Qr(1),Fo("ngIf",e.activeFilter&&""!==e.activeFilter),Qr(2),Fo("ngForOf",e.filters),Qr(4),Fo("hidden","Chat Room"!==e.activeFilter)("formGroup",e.searchForm1),Qr(7),Fo("hidden","Group Chat"!==e.activeFilter)("formGroup",e.searchForm2),Qr(7),Fo("hidden","Direct Chat"!==e.activeFilter)("formGroup",e.searchForm3),Qr(13),Fo("disabled",0===e.messages.length),Qr(2),Fo("disabled",""===e.nextCursor||null===e.nextCursor),Qr(2),Fo("ngIf",0!=e.messages.length&&""===e.error&&2==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&3==e.type),Qr(1),Fo("ngIf",0!=e.messages.length&&""===e.error&&4==e.type),Qr(1),Fo("ngIf",e.error),Qr(15),Fo("ngIf",e.deleteAllowed()),Qr(2),Fo("ngIf",0===e.messages.length),Qr(1),Fo("ngForOf",e.messages),Qr(1),Fo("ngIf",e.deleteError),Qr(1),Fo("ngIf",e.deleteSuccess),Qr(4),Fo("ngIf",e.deleteMessagesAllowed()))},directives:[Kx,qx,Bh,Wx,Ph,pb,Ry,mb,ay,Ty,yb,zx,Mv,_x,Ly,$h],styles:[".input-group-text[_ngcontent-%COMP%]{background-color:initial;cursor:pointer}.table-hover[_ngcontent-%COMP%]{cursor:pointer}.dropdown-radius-left[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.open-row[_ngcontent-%COMP%]{background:#fafafc}"]}),t})(),wN=(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){let n=Number(t.queryParamMap.get("type"));switch(n){case 2:return this.consoleService.listChannelMessages("",n.toString(),t.queryParamMap.get("label"),null,null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 3:return this.consoleService.listChannelMessages("",n.toString(),null,t.queryParamMap.get("group_id"),null,null,encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));case 4:return this.consoleService.listChannelMessages("",n.toString(),null,null,t.queryParamMap.get("user_id_one"),t.queryParamMap.get("user_id_two"),encodeURIComponent(t.queryParamMap.get("cursor"))).pipe(Yf(e=>(t.data=Object.assign(Object.assign({},t.data),{error:e}),ff(null))));default:return ff(null)}}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function xN(t,e){if(1&t&&(Mo(0,"ngb-alert",16),$o(1,"img",17),Mo(2,"h6",18),va(3),Io(),Io()),2&t){const t=zo();Fo("dismissible",!1),Qr(3),ba("Error while processing request: ",t.error,"")}}function _N(t,e){1&t&&$o(0,"div",23)}function CN(t,e){1&t&&$o(0,"div",24)}function SN(t,e){if(1&t&&(Mo(0,"tr",25),Mo(1,"td",26),Mo(2,"div",27),Mo(3,"div"),Mo(4,"small"),Mo(5,"b"),va(6,"Provider Response"),Io(),Io(),Io(),Mo(7,"div"),Mo(8,"pre",28),Mo(9,"small"),va(10),Io(),Io(),Io(),Mo(11,"div",29),Mo(12,"small"),Mo(13,"b"),va(14,"Provider Notification"),Io(),Io(),Io(),Mo(15,"div"),Mo(16,"pre",28),Mo(17,"small"),va(18),Io(),Io(),Io(),Io(),Io(),Io()),2&t){const t=zo().$implicit;Qr(10),ya(t.provider_response),Qr(8),ya(t.provider_notification)}}function EN(t,e){if(1&t){const t=No();Mo(0,"tr"),Mo(1,"td"),Mo(2,"div",19),Vo("click",function(){Ie(t);const n=e.index,i=zo();return i.subscriptionsRowOpen[n]=!i.subscriptionsRowOpen[n]}),Do(3,_N,1,0,"div",20),Do(4,CN,1,0,"div",21),Io(),va(5),Io(),Mo(6,"td"),va(7),Io(),Mo(8,"td"),va(9),Io(),Mo(10,"td"),va(11),Io(),Mo(12,"td"),va(13),Io(),Mo(14,"td"),va(15),Io(),Mo(16,"td"),va(17),Io(),Io(),Do(18,SN,19,2,"tr",22)}if(2&t){const t=e.index,n=e.$implicit,i=zo();Qr(3),Fo("ngIf",!i.subscriptionsRowOpen[t]),Qr(1),Fo("ngIf",i.subscriptionsRowOpen[t]),Qr(1),ba(" ",n.product_id," "),Qr(2),ya(n.original_transaction_id),Qr(2),ya(i.getStoreText(n.store)),Qr(2),ya(n.purchase_time),Qr(2),ya(n.expiry_time),Qr(2),ya(n.create_time),Qr(2),ya(i.getRefundText(n.refund_time)),Qr(1),Fo("ngIf",i.subscriptionsRowOpen[t])}}function kN(t,e){1&t&&(Mo(0,"tr"),Mo(1,"td",30),va(2,"No subscriptions were found."),Io(),Io())}const AN=[{path:"",component:j_,canActivate:[_w],canActivateChild:[z_],children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",component:tM,resolve:[eM]},{path:"config",component:IM,resolve:[$M]},{path:"users",component:VM,resolve:[HM]},{path:"modules",component:rI,resolve:[sI]},{path:"storage",component:fI,resolve:[gI,mI],pathMatch:"full"},{path:"storage/:collection/:key/:user_id",component:TI,resolve:[RI],pathMatch:"full"},{path:"leaderboards",component:UI,resolve:[VI]},{path:"leaderboards/:id",component:wP,resolve:[xP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:EP,resolve:[]},{path:"records",component:IP,resolve:[$P]}]},{path:"matches",component:XO,resolve:[YO,QO]},{path:"groups",component:sP,resolve:[oP]},{path:"groups/:id",component:pP,resolve:[fP],children:[{path:"",redirectTo:"details",pathMatch:"full"},{path:"details",component:cO,resolve:[]},{path:"members",component:TO,resolve:[RO],runGuardsAndResolvers:"always"}]},{path:"accounts",component:KI,resolve:[XI]},{path:"accounts/:id",component:l$,resolve:[c$],children:[{path:"",redirectTo:"profile",pathMatch:"full"},{path:"profile",component:g$,resolve:[]},{path:"authentication",component:w$,resolve:[]},{path:"wallet",component:L$,resolve:[M$]},{path:"friends",component:j$,resolve:[z$]},{path:"groups",component:eO,resolve:[nO]},{path:"purchases",component:XP,resolve:[YP]},{path:"subscriptions",component:(()=>{class t{constructor(t,e,n){this.route=t,this.router=e,this.consoleService=n,this.subscriptions=[],this.subscriptionsRowOpen=[],this.error="",this.nextCursor="",this.prevCursor="",this.limit=100}ngOnInit(){this.userID=this.route.parent.snapshot.paramMap.get("id"),this.route.data.subscribe(t=>{this.subscriptions=t[0].validated_subscriptions,this.nextCursor=t[0].cursor,this.prevCursor=t[0].prev_cursor})}loadData(t){this.consoleService.listSubscriptions("",this.userID,this.limit,t).subscribe(t=>{this.subscriptions=t.validated_subscriptions,this.subscriptionsRowOpen=[],this.nextCursor=t.cursor,this.prevCursor=t.prev_cursor},t=>{this.error=t})}getStoreText(t){return this.formatStoreText(hw[t])}getRefundText(t){return"1970-01-01T00:00:00Z"===t?"":t}formatStoreText(t){return t.split("_").map(t=>t[0]+t.slice(1).toLowerCase()).join(" ")}}return t.\u0275fac=function(e){return new(e||t)(Ro(pm),Ro(Fv),Ro(dw))},t.\u0275cmp=Bt({type:t,selectors:[["app-subscriptions"]],decls:33,vars:6,consts:[["type","danger",3,"dismissible",4,"ngIf"],[1,"row","no-gutters","mb-3"],[1,"col","d-flex","justify-content-between","no-gutters"],[1,"col-md-9"],[1,"col-md-3","justify-content-end","text-right"],["role","group",1,"btn-group","page-btns"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","click"],["src","/static/svg/page-first.svg","alt","","width","20","height",""],["src","/static/svg/page-prev.svg","alt","","width","20","height",""],["src","/static/svg/page-next.svg","alt","","width","20","height",""],[1,"row","no-gutters"],[1,"table","table-sm","table-bordered","table-hover"],[1,"thead-light"],[2,"width","180px"],["ngFor","",3,"ngForOf"],[4,"ngIf"],["type","danger",3,"dismissible"],["src","/src/static/svg/red-triangle.svg","alt","","width","16","height","",1,"mr-2"],[1,"mr-2","d-inline","font-weight-bold"],[1,"arrow",3,"click"],["class","arrow-right",4,"ngIf"],["class","arrow-down",4,"ngIf"],["class","open-row",4,"ngIf"],[1,"arrow-right"],[1,"arrow-down"],[1,"open-row"],["colspan","7"],[1,"p-2"],[1,"pre-wrap","m-0","p-0"],[1,"pt-2"],["colspan","7",1,"text-muted"]],template:function(t,e){1&t&&(Do(0,xN,4,2,"ngb-alert",0),Mo(1,"div",1),Mo(2,"div",2),$o(3,"div",3),Mo(4,"div",4),Mo(5,"div",5),Mo(6,"button",6),Vo("click",function(){return e.loadData("")}),$o(7,"img",7),Io(),Mo(8,"button",6),Vo("click",function(){return e.loadData(e.prevCursor)}),$o(9,"img",8),Io(),Mo(10,"button",6),Vo("click",function(){return e.loadData(e.nextCursor)}),$o(11,"img",9),Io(),Io(),Io(),Io(),Io(),Mo(12,"div",10),Mo(13,"table",11),Mo(14,"thead",12),Mo(15,"tr"),Mo(16,"th"),va(17,"Product ID"),Io(),Mo(18,"th"),va(19,"Original Transaction ID"),Io(),Mo(20,"th"),va(21,"Store"),Io(),Mo(22,"th",13),va(23,"Purchase Time"),Io(),Mo(24,"th",13),va(25,"Expiry Time"),Io(),Mo(26,"th",13),va(27,"Create Time"),Io(),Mo(28,"th",13),va(29,"Refund Time"),Io(),Io(),Io(),Mo(30,"tbody"),Do(31,EN,19,10,"ng-template",14),Do(32,kN,3,0,"tr",15),Io(),Io(),Io()),2&t&&(Fo("ngIf",e.error),Qr(6),Fo("disabled",0===e.subscriptions.length),Qr(2),Fo("disabled",""===e.prevCursor),Qr(2),Fo("disabled",""===e.nextCursor),Qr(21),Fo("ngForOf",e.subscriptions),Qr(1),Fo("ngIf",0===e.subscriptions.length))},directives:[Bh,Ph,_x],styles:[""]}),t})(),resolve:[(()=>{class t{constructor(t){this.consoleService=t}resolve(t,e){const n=t.parent.paramMap.get("id");return this.consoleService.listSubscriptions("",n,100,"")}}return t.\u0275fac=function(e){return new(e||t)(bi(dw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()]}]},{path:"apiexplorer",component:VP,resolve:[HP]},{path:"chat",component:bN,resolve:[wN]}]},{path:"login",component:ww,canActivate:[xw]},{path:"**",redirectTo:""}];let DN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},imports:[[Gv.forRoot(AN,{useHash:!0})],Gv]}),t})(),TN=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Bt({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(t,e){1&t&&$o(0,"router-outlet")},directives:[Ov],styles:[""]}),t})();RegExp(/[&<>"']/g.source);const RN={Tab:9,Enter:13,Esc:27,Space:32,ArrowUp:38,ArrowDown:40,Backspace:8};RN[RN.Tab]="Tab",RN[RN.Enter]="Enter",RN[RN.Esc]="Esc",RN[RN.Space]="Space",RN[RN.ArrowUp]="ArrowUp",RN[RN.ArrowDown]="ArrowDown",RN[RN.Backspace]="Backspace";const FN=new Yn("ng-select-selection-model");class LN{constructor(){this._selected=[]}get value(){return this._selected}select(t,e,n){if(t.selected=!0,(!t.children||!e&&n)&&this._selected.push(t),e)if(t.parent){const e=t.parent.children.length,n=t.parent.children.filter(t=>t.selected).length;t.parent.selected=e===n}else t.children&&(this._setChildrenSelectedState(t.children,!0),this._removeChildren(t),this._selected=n&&this._activeChildren(t)?[...this._selected.filter(e=>e.parent!==t),t]:[...this._selected,...t.children.filter(t=>!t.disabled)])}unselect(t,e){if(this._selected=this._selected.filter(e=>e!==t),t.selected=!1,e)if(t.parent&&t.parent.selected){const e=t.parent.children;this._removeParent(t.parent),this._removeChildren(t.parent),this._selected.push(...e.filter(e=>e!==t&&!e.disabled)),t.parent.selected=!1}else t.children&&(this._setChildrenSelectedState(t.children,!1),this._removeChildren(t))}clear(t){this._selected=t?this._selected.filter(t=>t.disabled):[]}_setChildrenSelectedState(t,e){for(const n of t)n.disabled||(n.selected=e)}_removeChildren(t){this._selected=[...this._selected.filter(e=>e.parent!==t),...t.children.filter(e=>e.parent===t&&e.disabled&&e.selected)]}_removeParent(t){this._selected=this._selected.filter(e=>e!==t)}_activeChildren(t){return t.children.every(t=>!t.disabled||t.selected)}}const MN=function(){return new LN};let IN=(()=>{class t{}return t.\u0275mod=jt({type:t}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[{provide:FN,useValue:MN}],imports:[[qh]]}),t})(),$N=(()=>{class t{constructor(t){this.authenticationService=t}intercept(t,e){const n=this.authenticationService.currentSessionValue;return n&&n.token&&(t=t.clone({setHeaders:{Authorization:"Bearer "+n.token}})),e.handle(t)}}return t.\u0275fac=function(e){return new(e||t)(bi(mw))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),ON=(()=>{class t{constructor(t,e){this.authenticationService=t,this.router=e}intercept(t,e){return e.handle(t).pipe(Yf(e=>(401===e.status?this.authenticationService.logout().subscribe({next:()=>{t.url.includes("/v3/auth")||this.router.navigate(["/login"],{queryParams:{next:this.router.routerState.snapshot.url}})}}):e.status>=500&&console.log(`${e.status}: + ${e.error.message||e.statusText}`),nx(e.error.message||e.statusText))))}}return t.\u0275fac=function(e){return new(e||t)(bi(mw),bi(Fv))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),PN=(()=>{class t{}return t.\u0275mod=jt({type:t,bootstrap:[TN]}),t.\u0275inj=ct({factory:function(e){return new(e||t)},providers:[fw,I_,{provide:uw,useValue:{host:document.location.origin,timeout:15e3}},{provide:Xb,useClass:$N,multi:!0},{provide:Xb,useClass:ON,multi:!0}],imports:[[fM,DN,ku,df,lw,M_,LL,Rb.forRoot({apiKey:"dHl7FTjJ9icepBjEdOCcyMFQYL1BBiQO",debug:!1,loadOnInitialization:!0}),pf,Sb,Cb,IN]]}),t})();(function(){if(qc)throw new Error("Cannot enable prod mode after platform setup.");Gc=!1})(),Su().bootstrapModule(PN).then(t=>{window.ngRef&&window.ngRef.destroy(),window.ngRef=t}).catch(t=>console.error(t))},zn8P:function(t,e){function n(t){return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,0]]]); \ No newline at end of file diff --git a/console/ui/src/app/account/purchases/purchases.component.html b/console/ui/src/app/account/purchases/purchases.component.html index 4187c86e01..d1f3056810 100644 --- a/console/ui/src/app/account/purchases/purchases.component.html +++ b/console/ui/src/app/account/purchases/purchases.component.html @@ -25,10 +25,11 @@
Error while processing request: {{err Store Purchase Time Create Time + Refund Time - +
@@ -41,9 +42,10 @@
Error while processing request: {{err {{getStoreText(p.store)}} {{p.purchase_time}} {{p.create_time}} + {{getRefundText(p.refund_time)}} - +
Provider Response
@@ -53,7 +55,7 @@
Error while processing request: {{err - No purchases were found. + No purchases were found.
diff --git a/console/ui/src/app/account/purchases/purchases.component.ts b/console/ui/src/app/account/purchases/purchases.component.ts index a4159e55ea..5998db74ff 100644 --- a/console/ui/src/app/account/purchases/purchases.component.ts +++ b/console/ui/src/app/account/purchases/purchases.component.ts @@ -66,6 +66,13 @@ export class PurchasesComponent implements OnInit { return this.formatStoreText(ApiStoreProvider[store]); } + getRefundText(time: string): string { + if (time === '1970-01-01T00:00:00Z') { + return ''; + } + return time; + } + formatStoreText(label: string): string { return label.split('_').map(s => s[0] + s.slice(1).toLowerCase()).join(' '); } diff --git a/console/ui/src/app/account/subscriptions/subscriptions.component.html b/console/ui/src/app/account/subscriptions/subscriptions.component.html index cb7b193109..d9bfb17aad 100644 --- a/console/ui/src/app/account/subscriptions/subscriptions.component.html +++ b/console/ui/src/app/account/subscriptions/subscriptions.component.html @@ -26,20 +26,41 @@
Error while processing request: {{err Purchase Time Expiry Time Create Time + Refund Time - + - {{p.product_id}} + +
+
+
+
+ {{p.product_id}} + {{p.original_transaction_id}} {{getStoreText(p.store)}} {{p.purchase_time}} {{p.expiry_time}} {{p.create_time}} + {{getRefundText(p.refund_time)}} + + + +
+
Provider Response
+
+
{{p.provider_response}}
+
+
Provider Notification
+
+
{{p.provider_notification}}
+
+
- No purchases were found. + No subscriptions were found.
diff --git a/console/ui/src/app/account/subscriptions/subscriptions.component.ts b/console/ui/src/app/account/subscriptions/subscriptions.component.ts index 758435679f..c3f88f2baf 100644 --- a/console/ui/src/app/account/subscriptions/subscriptions.component.ts +++ b/console/ui/src/app/account/subscriptions/subscriptions.component.ts @@ -29,6 +29,7 @@ import {Observable} from 'rxjs'; }) export class SubscriptionsComponent implements OnInit { public subscriptions: ApiValidatedSubscription[] = []; + public subscriptionsRowOpen: boolean[] = []; public error = ''; public nextCursor = ''; public prevCursor = ''; @@ -58,6 +59,7 @@ export class SubscriptionsComponent implements OnInit { cursor, ).subscribe(res => { this.subscriptions = res.validated_subscriptions; + this.subscriptionsRowOpen = []; this.nextCursor = res.cursor; this.prevCursor = res.prev_cursor; }, error => { @@ -69,6 +71,13 @@ export class SubscriptionsComponent implements OnInit { return this.formatStoreText(ApiStoreProvider[store]); } + getRefundText(time: string): string { + if (time === '1970-01-01T00:00:00Z') { + return ''; + } + return time; + } + formatStoreText(label: string): string { return label.split('_').map(s => s[0] + s.slice(1).toLowerCase()).join(' '); } @@ -76,7 +85,8 @@ export class SubscriptionsComponent implements OnInit { @Injectable({providedIn: 'root'}) export class SubscriptionsResolver implements Resolve { - constructor(private readonly consoleService: ConsoleService) {} + constructor(private readonly consoleService: ConsoleService) { + } resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { const userId = route.parent.paramMap.get('id'); diff --git a/data/modules/index.js b/data/modules/index.js new file mode 100644 index 0000000000..19ef820e93 --- /dev/null +++ b/data/modules/index.js @@ -0,0 +1,556 @@ +"use strict"; +// Copyright 2020 The Nakama Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var rpcIdRewards = 'rewards_js'; +var rpcIdFindMatch = 'find_match_js'; +function InitModule(ctx, logger, nk, initializer) { + initializer.registerRpc(rpcIdRewards, rpcReward); + initializer.registerRpc(rpcIdFindMatch, rpcFindMatch); + initializer.registerMatch(moduleName, { + matchInit: matchInit, + matchJoinAttempt: matchJoinAttempt, + matchJoin: matchJoin, + matchLeave: matchLeave, + matchLoop: matchLoop, + matchTerminate: matchTerminate, + matchSignal: matchSignal, + }); + initializer.registerPurchaseNotificationApple(purchaseNotificationAppleFn); + initializer.registerSubscriptionNotificationApple(subscriptionNotificationAppleFn); + initializer.registerPurchaseNotificationGoogle(purchaseNotificationGoogleFn); + initializer.registerSubscriptionNotificationGoogle(subscriptionNotificationGoogleFn); + logger.info('JavaScript logic loaded.'); +} +function purchaseNotificationAppleFn(ctx, logger, nk, purchase, providerPayload) { + logger.debug('Apple Purchase Notification Invoked: purchase: %s, payload: %s', JSON.stringify(purchase), providerPayload); +} +function subscriptionNotificationAppleFn(ctx, logger, nk, subscription, providerPayload) { + logger.debug('Apple Subscription Notification Invoked: purchase: %s, payload: %s', JSON.stringify(subscription), providerPayload); +} +function purchaseNotificationGoogleFn(ctx, logger, nk, purchase, providerPayload) { + logger.debug('Google Purchase Notification Invoked: purchase: %s, payload: %s', JSON.stringify(purchase), providerPayload); +} +function subscriptionNotificationGoogleFn(ctx, logger, nk, subscription, providerPayload) { + logger.debug('Google Subscription Notification Invoked: purchase: %s, payload: %s', JSON.stringify(subscription), providerPayload); +} +// Copyright 2020 The Nakama Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +function rpcReward(context, logger, nk, payload) { + if (!context.userId) { + throw Error('No user ID in context'); + } + if (payload) { + throw Error('no input allowed'); + } + var objectId = { + collection: 'reward', + key: 'daily', + userId: context.userId, + }; + var objects; + try { + objects = nk.storageRead([objectId]); + } + catch (error) { + logger.error('storageRead error: %s', error); + throw error; + } + var dailyReward = { + lastClaimUnix: 0, + }; + objects.forEach(function (object) { + if (object.key == 'daily') { + dailyReward = object.value; + } + }); + var resp = { + coinsReceived: 0, + }; + var d = new Date(); + d.setHours(0, 0, 0, 0); + // If last claimed is before the new day grant a new reward! + if (dailyReward.lastClaimUnix < msecToSec(d.getTime())) { + resp.coinsReceived = 500; + // Update player wallet. + var changeset = { + coins: resp.coinsReceived, + }; + try { + nk.walletUpdate(context.userId, changeset, {}, false); + } + catch (error) { + logger.error('walletUpdate error: %q', error); + throw error; + } + var notification = { + code: 1001, + content: changeset, + persistent: true, + subject: "You've received your daily reward!", + userId: context.userId, + }; + try { + nk.notificationsSend([notification]); + } + catch (error) { + logger.error('notificationsSend error: %q', error); + throw error; + } + dailyReward.lastClaimUnix = msecToSec(Date.now()); + var write = { + collection: 'reward', + key: 'daily', + permissionRead: 1, + permissionWrite: 0, + value: dailyReward, + userId: context.userId, + }; + if (objects.length > 0) { + write.version = objects[0].version; + } + try { + nk.storageWrite([write]); + } + catch (error) { + logger.error('storageWrite error: %q', error); + throw error; + } + } + var result = JSON.stringify(resp); + logger.debug('rpcReward resp: %q', result); + return result; +} +function msecToSec(n) { + return Math.floor(n / 1000); +} +var Mark; +(function (Mark) { + Mark[Mark["X"] = 0] = "X"; + Mark[Mark["O"] = 1] = "O"; + Mark[Mark["UNDEFINED"] = 2] = "UNDEFINED"; +})(Mark || (Mark = {})); +// The complete set of opcodes used for communication between clients and server. +var OpCode; +(function (OpCode) { + // New game round starting. + OpCode[OpCode["START"] = 1] = "START"; + // Update to the state of an ongoing round. + OpCode[OpCode["UPDATE"] = 2] = "UPDATE"; + // A game round has just completed. + OpCode[OpCode["DONE"] = 3] = "DONE"; + // A move the player wishes to make and sends to the server. + OpCode[OpCode["MOVE"] = 4] = "MOVE"; + // Move was rejected. + OpCode[OpCode["REJECTED"] = 5] = "REJECTED"; +})(OpCode || (OpCode = {})); +// Copyright 2020 The Nakama Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var moduleName = "tic-tac-toe_js"; +var tickRate = 5; +var maxEmptySec = 30; +var delaybetweenGamesSec = 5; +var turnTimeFastSec = 10; +var turnTimeNormalSec = 20; +var winningPositions = [ + [0, 1, 2], + [3, 4, 5], + [6, 7, 8], + [0, 3, 6], + [1, 4, 7], + [2, 5, 8], + [0, 4, 8], + [2, 4, 6], +]; +var matchInit = function (ctx, logger, nk, params) { + var fast = !!params['fast']; + var label = { + open: 1, + fast: 0, + }; + if (fast) { + label.fast = 1; + } + var state = { + label: label, + emptyTicks: 0, + presences: {}, + joinsInProgress: 0, + playing: false, + board: [], + marks: {}, + mark: Mark.UNDEFINED, + deadlineRemainingTicks: 0, + winner: null, + winnerPositions: null, + nextGameRemainingTicks: 0, + }; + return { + state: state, + tickRate: tickRate, + label: JSON.stringify(label), + }; +}; +var matchJoinAttempt = function (ctx, logger, nk, dispatcher, tick, state, presence, metadata) { + // Check if it's a user attempting to rejoin after a disconnect. + if (presence.userId in state.presences) { + if (state.presences[presence.userId] === null) { + // User rejoining after a disconnect. + state.joinsInProgress++; + return { + state: state, + accept: false, + }; + } + else { + // User attempting to join from 2 different devices at the same time. + return { + state: state, + accept: false, + rejectMessage: 'already joined', + }; + } + } + // Check if match is full. + if (connectedPlayers(state) + state.joinsInProgress >= 2) { + return { + state: state, + accept: false, + rejectMessage: 'match full', + }; + } + // New player attempting to connect. + state.joinsInProgress++; + return { + state: state, + accept: true, + }; +}; +var matchJoin = function (ctx, logger, nk, dispatcher, tick, state, presences) { + var t = msecToSec(Date.now()); + for (var _i = 0, presences_1 = presences; _i < presences_1.length; _i++) { + var presence = presences_1[_i]; + state.emptyTicks = 0; + state.presences[presence.userId] = presence; + state.joinsInProgress--; + // Check if we must send a message to this user to update them on the current game state. + if (state.playing) { + // There's a game still currently in progress, the player is re-joining after a disconnect. Give them a state update. + var update = { + board: state.board, + mark: state.mark, + deadline: t + Math.floor(state.deadlineRemainingTicks / tickRate), + }; + // Send a message to the user that just joined. + dispatcher.broadcastMessage(OpCode.UPDATE, JSON.stringify(update)); + } + else if (state.board.length !== 0 && Object.keys(state.marks).length !== 0 && state.marks[presence.userId]) { + logger.debug('player %s rejoined game', presence.userId); + // There's no game in progress but we still have a completed game that the user was part of. + // They likely disconnected before the game ended, and have since forfeited because they took too long to return. + var done = { + board: state.board, + winner: state.winner, + winnerPositions: state.winnerPositions, + nextGameStart: t + Math.floor(state.nextGameRemainingTicks / tickRate) + }; + // Send a message to the user that just joined. + dispatcher.broadcastMessage(OpCode.DONE, JSON.stringify(done)); + } + } + // Check if match was open to new players, but should now be closed. + if (Object.keys(state.presences).length >= 2 && state.label.open != 0) { + state.label.open = 0; + var labelJSON = JSON.stringify(state.label); + dispatcher.matchLabelUpdate(labelJSON); + } + return { state: state }; +}; +var matchLeave = function (ctx, logger, nk, dispatcher, tick, state, presences) { + for (var _i = 0, presences_2 = presences; _i < presences_2.length; _i++) { + var presence = presences_2[_i]; + logger.info("Player: %s left match: %s.", presence.userId, ctx.matchId); + state.presences[presence.userId] = null; + } + return { state: state }; +}; +var matchLoop = function (ctx, logger, nk, dispatcher, tick, state, messages) { + // logger.debug('Running match loop. Tick: %d', tick); + var _a; + if (connectedPlayers(state) + state.joinsInProgress === 0) { + state.emptyTicks++; + if (state.emptyTicks >= maxEmptySec * tickRate) { + // Match has been empty for too long, close it. + logger.info('closing idle match'); + return null; + } + } + var t = msecToSec(Date.now()); + // If there's no game in progress check if we can (and should) start one! + if (!state.playing) { + // Between games any disconnected users are purged, there's no in-progress game for them to return to anyway. + for (var userID in state.presences) { + if (state.presences[userID] === null) { + delete state.presences[userID]; + } + } + // Check if we need to update the label so the match now advertises itself as open to join. + if (Object.keys(state.presences).length < 2 && state.label.open != 1) { + state.label.open = 1; + var labelJSON = JSON.stringify(state.label); + dispatcher.matchLabelUpdate(labelJSON); + } + // Check if we have enough players to start a game. + if (Object.keys(state.presences).length < 2) { + return { state: state }; + } + // Check if enough time has passed since the last game. + if (state.nextGameRemainingTicks > 0) { + state.nextGameRemainingTicks--; + return { state: state }; + } + // We can start a game! Set up the game state and assign the marks to each player. + state.playing = true; + state.board = new Array(9); + state.marks = {}; + var marks_1 = [Mark.X, Mark.O]; + Object.keys(state.presences).forEach(function (userId) { + var _a; + state.marks[userId] = (_a = marks_1.shift(), (_a !== null && _a !== void 0 ? _a : null)); + }); + state.mark = Mark.X; + state.winner = null; + state.winnerPositions = null; + state.deadlineRemainingTicks = calculateDeadlineTicks(state.label); + state.nextGameRemainingTicks = 0; + // Notify the players a new game has started. + var msg = { + board: state.board, + marks: state.marks, + mark: state.mark, + deadline: t + Math.floor(state.deadlineRemainingTicks / tickRate), + }; + dispatcher.broadcastMessage(OpCode.START, JSON.stringify(msg)); + return { state: state }; + } + // There's a game in progresstate. Check for input, update match state, and send messages to clientstate. + for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { + var message = messages_1[_i]; + logger.debug("------ MESSAGE ------"); + logger.debug(JSON.stringify(message)); + switch (message.opCode) { + case OpCode.MOVE: + logger.debug('Received move message from user: %v', state.marks); + var mark = (_a = state.marks[message.sender.userId], (_a !== null && _a !== void 0 ? _a : null)); + if (mark === null || state.mark != mark) { + // It is not this player's turn. + dispatcher.broadcastMessage(OpCode.REJECTED, null, [message.sender]); + continue; + } + var msg = {}; + try { + msg = JSON.parse(nk.binaryToString(message.data)); + } + catch (error) { + // Client sent bad data. + dispatcher.broadcastMessage(OpCode.REJECTED, null, [message.sender]); + logger.debug('Bad data received: %v', error); + continue; + } + if (state.board[msg.position]) { + // Client sent a position outside the board, or one that has already been played. + dispatcher.broadcastMessage(OpCode.REJECTED, null, [message.sender]); + continue; + } + // Update the game state. + state.board[msg.position] = mark; + state.mark = mark === Mark.O ? Mark.X : Mark.O; + state.deadlineRemainingTicks = calculateDeadlineTicks(state.label); + // Check if game is over through a winning move. + var _b = winCheck(state.board, mark), winner = _b[0], winningPos = _b[1]; + if (winner) { + state.winner = mark; + state.winnerPositions = winningPos; + state.playing = false; + state.deadlineRemainingTicks = 0; + state.nextGameRemainingTicks = delaybetweenGamesSec * tickRate; + } + // Check if game is over because no more moves are possible. + var tie = state.board.every(function (v) { return v !== null; }); + if (tie) { + // Update state to reflect the tie, and schedule the next game. + state.playing = false; + state.deadlineRemainingTicks = 0; + state.nextGameRemainingTicks = delaybetweenGamesSec * tickRate; + } + var opCode = void 0; + var outgoingMsg = void 0; + if (state.playing) { + opCode = OpCode.UPDATE; + var msg_1 = { + board: state.board, + mark: state.mark, + deadline: t + Math.floor(state.deadlineRemainingTicks / tickRate), + }; + outgoingMsg = msg_1; + } + else { + opCode = OpCode.DONE; + var msg_2 = { + board: state.board, + winner: state.winner, + winnerPositions: state.winnerPositions, + nextGameStart: t + Math.floor(state.nextGameRemainingTicks / tickRate), + }; + outgoingMsg = msg_2; + } + dispatcher.broadcastMessage(opCode, JSON.stringify(outgoingMsg)); + break; + default: + // No other opcodes are expected from the client, so automatically treat it as an error. + dispatcher.broadcastMessage(OpCode.REJECTED, null, [message.sender]); + logger.error('Unexpected opcode received: %d', message.opCode); + } + } + // Keep track of the time remaining for the player to submit their move. Idle players forfeit. + if (state.playing) { + state.deadlineRemainingTicks--; + if (state.deadlineRemainingTicks <= 0) { + // The player has run out of time to submit their move. + state.playing = false; + state.winner = state.mark === Mark.O ? Mark.X : Mark.O; + state.deadlineRemainingTicks = 0; + state.nextGameRemainingTicks = delaybetweenGamesSec * tickRate; + var msg = { + board: state.board, + winner: state.winner, + nextGameStart: t + Math.floor(state.nextGameRemainingTicks / tickRate), + winnerPositions: null, + }; + dispatcher.broadcastMessage(OpCode.DONE, JSON.stringify(msg)); + } + } + return { state: state }; +}; +var matchTerminate = function (ctx, logger, nk, dispatcher, tick, state, graceSeconds) { + return { state: state }; +}; +var matchSignal = function (ctx, logger, nk, dispatcher, tick, state) { + return { state: state }; +}; +function calculateDeadlineTicks(l) { + if (l.fast === 1) { + return turnTimeFastSec * tickRate; + } + else { + return turnTimeNormalSec * tickRate; + } +} +function winCheck(board, mark) { + for (var _i = 0, winningPositions_1 = winningPositions; _i < winningPositions_1.length; _i++) { + var wp = winningPositions_1[_i]; + if (board[wp[0]] === mark && + board[wp[1]] === mark && + board[wp[2]] === mark) { + return [true, wp]; + } + } + return [false, null]; +} +function connectedPlayers(s) { + var count = 0; + for (var _i = 0, _a = Object.keys(s.presences); _i < _a.length; _i++) { + var p = _a[_i]; + if (p !== null) { + count++; + } + } + return count; +} +// Copyright 2020 The Nakama Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +var rpcFindMatch = function (ctx, logger, nk, payload) { + if (!ctx.userId) { + throw Error('No user ID in context'); + } + if (!payload) { + throw Error('Expects payload.'); + } + var request = {}; + try { + request = JSON.parse(payload); + } + catch (error) { + logger.error('Error parsing json message: %q', error); + throw error; + } + var matches; + try { + var query = "+label.open:1 +label.fast:" + (request.fast ? 1 : 0); + matches = nk.matchList(10, true, null, null, 1, query); + } + catch (error) { + logger.error('Error listing matches: %v', error); + throw error; + } + var matchIds = []; + if (matches.length > 0) { + // There are one or more ongoing matches the user could join. + matchIds = matches.map(function (m) { return m.matchId; }); + } + else { + // No available matches found, create a new one. + try { + matchIds.push(nk.matchCreate(moduleName, { fast: request.fast })); + } + catch (error) { + logger.error('Error creating match: %v', error); + throw error; + } + } + var res = { matchIds: matchIds }; + return JSON.stringify(res); +}; diff --git a/go.sum b/go.sum index 7d9097ad02..c673580644 100644 --- a/go.sum +++ b/go.sum @@ -285,8 +285,6 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/heroiclabs/nakama-common v1.26.0 h1:YcZwKjmxT6YvEhKuZ/bPnt0BV6PbrfapFis1ZiFzOOk= -github.com/heroiclabs/nakama-common v1.26.0/go.mod h1:zdYggBBPmykSfz4zYFJmBDX5wyURSPAGANtJPEDdbx8= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= diff --git a/server/config.go b/server/config.go index 8fb4f7d489..9701682f96 100644 --- a/server/config.go +++ b/server/config.go @@ -783,8 +783,8 @@ type RuntimeConfig struct { LuaMinCount int `yaml:"lua_min_count" json:"lua_min_count" usage:"Minimum number of Lua runtime instances to allocate. Default 16."` MaxCount int `yaml:"max_count" json:"max_count" usage:"Maximum number of Lua runtime instances to allocate. Default 0."` // Kept for backwards compatibility LuaMaxCount int `yaml:"lua_max_count" json:"lua_max_count" usage:"Maximum number of Lua runtime instances to allocate. Default 48."` - JsMinCount int `yaml:"js_min_count" json:"js_min_count" usage:"Maximum number of Javascript runtime instances to allocate. Default 48."` - JsMaxCount int `yaml:"js_max_count" json:"js_max_count" usage:"Maximum number of Javascript runtime instances to allocate. Default 48."` + JsMinCount int `yaml:"js_min_count" json:"js_min_count" usage:"Maximum number of Javascript runtime instances to allocate. Default 16."` + JsMaxCount int `yaml:"js_max_count" json:"js_max_count" usage:"Maximum number of Javascript runtime instances to allocate. Default 32."` CallStackSize int `yaml:"call_stack_size" json:"call_stack_size" usage:"Size of each runtime instance's call stack. Default 0."` // Kept for backwards compatibility LuaCallStackSize int `yaml:"lua_call_stack_size" json:"lua_call_stack_size" usage:"Size of each runtime instance's call stack. Default 128."` RegistrySize int `yaml:"registry_size" json:"registry_size" usage:"Size of each Lua runtime instance's registry. Default 0."` // Kept for backwards compatibility diff --git a/server/core_purchase.go b/server/core_purchase.go index cfd72f8fd3..c3477cdb45 100644 --- a/server/core_purchase.go +++ b/server/core_purchase.go @@ -408,10 +408,10 @@ func ListPurchases(ctx context.Context, logger *zap.Logger, db *sql.DB, userID s } } - comparationOp := "<=" + comparisonOp := "<=" sortConf := "DESC" if incomingCursor != nil && !incomingCursor.IsNext { - comparationOp = ">" + comparisonOp = ">" sortConf = "ASC" } @@ -419,9 +419,9 @@ func ListPurchases(ctx context.Context, logger *zap.Logger, db *sql.DB, userID s predicateConf := "" if incomingCursor != nil { if userID == "" { - predicateConf = fmt.Sprintf(" WHERE (user_id, purchase_time, transaction_id) %s ($1, $2, $3)", comparationOp) + predicateConf = fmt.Sprintf(" WHERE (user_id, purchase_time, transaction_id) %s ($1, $2, $3)", comparisonOp) } else { - predicateConf = fmt.Sprintf(" WHERE user_id = $1 AND (purchase_time, transaction_id) %s ($2, $3)", comparationOp) + predicateConf = fmt.Sprintf(" WHERE user_id = $1 AND (purchase_time, transaction_id) %s ($2, $3)", comparisonOp) } params = append(params, incomingCursor.UserId, incomingCursor.PurchaseTime.AsTime(), incomingCursor.TransactionId) } else { @@ -502,9 +502,7 @@ func ListPurchases(ctx context.Context, logger *zap.Logger, db *sql.DB, userID s UpdateTime: timestamppb.New(updateTime.Time), ProviderResponse: rawResponse, Environment: environment, - } - if refundTime.Time.Unix() != 0 { - purchase.RefundTime = timestamppb.New(purchase.RefundTime.AsTime()) + RefundTime: timestamppb.New(refundTime.Time), } purchases = append(purchases, purchase) diff --git a/vendor/github.com/heroiclabs/nakama-common/runtime/runtime.go b/vendor/github.com/heroiclabs/nakama-common/runtime/runtime.go index ec3e906e5f..58c5ce8b35 100644 --- a/vendor/github.com/heroiclabs/nakama-common/runtime/runtime.go +++ b/vendor/github.com/heroiclabs/nakama-common/runtime/runtime.go @@ -572,6 +572,12 @@ type Initializer interface { // RegisterAfterDeleteLeaderboardRecord can be used to perform additional logic after deleting record from a leaderboard. RegisterAfterDeleteLeaderboardRecord(fn func(ctx context.Context, logger Logger, db *sql.DB, nk NakamaModule, in *api.DeleteLeaderboardRecordRequest) error) error + // RegisterBeforeDeleteTournamentRecord can be used to perform additional logic before deleting record from a leaderboard. + RegisterBeforeDeleteTournamentRecord(fn func(ctx context.Context, logger Logger, db *sql.DB, nk NakamaModule, in *api.DeleteTournamentRecordRequest) (*api.DeleteTournamentRecordRequest, error)) error + + // RegisterAfterDeleteTournamentRecord can be used to perform additional logic after deleting record from a leaderboard. + RegisterAfterDeleteTournamentRecord(fn func(ctx context.Context, logger Logger, db *sql.DB, nk NakamaModule, in *api.DeleteTournamentRecordRequest) error) error + // RegisterBeforeListLeaderboardRecords can be used to perform additional logic before listing records from a leaderboard. RegisterBeforeListLeaderboardRecords(fn func(ctx context.Context, logger Logger, db *sql.DB, nk NakamaModule, in *api.ListLeaderboardRecordsRequest) (*api.ListLeaderboardRecordsRequest, error)) error @@ -1075,6 +1081,14 @@ type NakamaModule interface { PurchasesList(ctx context.Context, userID string, limit int, cursor string) (*api.PurchaseList, error) PurchaseGetByTransactionId(ctx context.Context, transactionID string) (string, *api.ValidatedPurchase, error) + SubscriptionValidateApple(ctx context.Context, userID, receipt string, persist bool, passwordOverride ...string) (*api.ValidateSubscriptionResponse, error) + SubscriptionValidateGoogle(ctx context.Context, userID, receipt string, persist bool, overrides ...struct { + ClientEmail string + PrivateKey string + }) (*api.ValidateSubscriptionResponse, error) + SubscriptionsList(ctx context.Context, userID string, limit int, cursor string) (*api.SubscriptionList, error) + SubscriptionGetByProductId(ctx context.Context, userID, productID string) (string, *api.ValidatedSubscription, error) + TournamentCreate(ctx context.Context, id string, authoritative bool, sortOrder, operator, resetSchedule string, metadata map[string]interface{}, title, description string, category, startTime, endTime, duration, maxSize, maxNumScore int, joinRequired bool) error TournamentDelete(ctx context.Context, id string) error TournamentAddAttempt(ctx context.Context, id, ownerID string, count int) error