From 13b0caef4f4b925c259b7fe0767c97398fb1c3fc Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 30 Dec 2024 10:49:35 +0700 Subject: [PATCH 01/28] Upgrade dependencies --- gns3server/controller/compute.py | 9 +++++++-- requirements.txt | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 5d61027c..4a5cbd1c 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -18,14 +18,19 @@ import ipaddress import aiohttp import asyncio -import async_timeout import socket import json import uuid import sys import io + from operator import itemgetter +if sys.version_info >= (3, 11): + from asyncio import timeout as asynctimeout +else: + from async_timeout import timeout as asynctimeout + from ..utils import parse_version from ..utils.asyncio import locking from ..controller.controller_error import ControllerError @@ -484,7 +489,7 @@ class Compute: return self._getUrl(path) async def _run_http_query(self, method, path, data=None, timeout=20, raw=False): - async with async_timeout.timeout(delay=timeout): + async with asynctimeout(delay=timeout): url = self._getUrl(path) headers = {} headers['content-type'] = 'application/json' diff --git a/requirements.txt b/requirements.txt index 398250ca..bb30eedd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,10 +2,10 @@ jsonschema>=4.23,<4.24 aiohttp>=3.10.10,<3.11 aiohttp-cors>=0.7.0,<0.8 aiofiles>=24.1.0,<25.0 -Jinja2>=3.1.4,<3.2 -sentry-sdk>=2.17,<2.18 # optional dependency -psutil>=6.1.0 -async-timeout>=4.0.3,<4.1 +Jinja2>=3.1.5,<3.2 +sentry-sdk>=2.19.2,<2.20 # optional dependency +psutil>=6.1.1 +async-timeout>=5.0.1,<5.1 distro>=1.9.0 py-cpuinfo>=9.0.0,<10.0 platformdirs>=2.4.0,<3 # platformdirs >=3 conflicts when building Debian packages From 2c727c6bd2c748a17981c451a79e558364d12b14 Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 30 Dec 2024 11:06:19 +0700 Subject: [PATCH 02/28] Use 'allow_methods="*"' in aiohttp_cors.ResourceOptions(). Fixes #2459 --- gns3server/web/web_server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index 3a37ed60..51fad283 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -311,7 +311,13 @@ class WebServer: # Background task started with the server self._app.on_startup.append(self._on_startup) - resource_options = aiohttp_cors.ResourceOptions(allow_credentials=True, expose_headers="*", allow_headers="*", max_age=0) + resource_options = aiohttp_cors.ResourceOptions( + allow_credentials=True, + expose_headers="*", + allow_headers="*", + allow_methods="*", + max_age=0 + ) # Allow CORS for this domains cors = aiohttp_cors.setup(self._app, defaults={ From 0090ff3722bfcc947f50b7935206921c9b5b7779 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 22 Dec 2024 22:29:56 +0700 Subject: [PATCH 03/28] Increase timeout to run compute HTTP queries. Fixes #2461 --- gns3server/controller/compute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 4a5cbd1c..85247e94 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -488,7 +488,7 @@ class Compute: """ Returns URL for specific path at Compute""" return self._getUrl(path) - async def _run_http_query(self, method, path, data=None, timeout=20, raw=False): + async def _run_http_query(self, method, path, data=None, timeout=120, raw=False): async with asynctimeout(delay=timeout): url = self._getUrl(path) headers = {} From ccc8974d922aa1a8917a3ceffba6224fb639cfaf Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 30 Dec 2024 16:14:33 +0700 Subject: [PATCH 04/28] Fix tests --- tests/controller/test_compute.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/controller/test_compute.py b/tests/controller/test_compute.py index b9b911b3..ada4caba 100644 --- a/tests/controller/test_compute.py +++ b/tests/controller/test_compute.py @@ -85,7 +85,7 @@ async def test_compute_httpQuery(compute): response.status = 200 await compute.post("/projects", {"a": "b"}) await compute.close() - mock.assert_called_with("POST", "https://example.com:84/v2/compute/projects", data=b'{"a": "b"}', headers={'content-type': 'application/json'}, auth=None, chunked=None, timeout=20) + mock.assert_called_with("POST", "https://example.com:84/v2/compute/projects", data=b'{"a": "b"}', headers={'content-type': 'application/json'}, auth=None, chunked=None, timeout=120) assert compute._auth is None @@ -99,7 +99,7 @@ async def test_compute_httpQueryAuth(compute): compute.password = "toor" await compute.post("/projects", {"a": "b"}) await compute.close() - mock.assert_called_with("POST", "https://example.com:84/v2/compute/projects", data=b'{"a": "b"}', headers={'content-type': 'application/json'}, auth=compute._auth, chunked=None, timeout=20) + mock.assert_called_with("POST", "https://example.com:84/v2/compute/projects", data=b'{"a": "b"}', headers={'content-type': 'application/json'}, auth=compute._auth, chunked=None, timeout=120) assert compute._auth.login == "root" assert compute._auth.password == "toor" @@ -156,7 +156,7 @@ async def test_compute_httpQueryNotConnectedInvalidVersion(compute): with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock: with pytest.raises(aiohttp.web.HTTPConflict): await compute.post("/projects", {"a": "b"}) - mock.assert_any_call("GET", "https://example.com:84/v2/compute/capabilities", headers={'content-type': 'application/json'}, data=None, auth=None, chunked=None, timeout=20) + mock.assert_any_call("GET", "https://example.com:84/v2/compute/capabilities", headers={'content-type': 'application/json'}, data=None, auth=None, chunked=None, timeout=120) await compute.close() @@ -169,7 +169,7 @@ async def test_compute_httpQueryNotConnectedNonGNS3Server(compute): with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock: with pytest.raises(aiohttp.web.HTTPConflict): await compute.post("/projects", {"a": "b"}) - mock.assert_any_call("GET", "https://example.com:84/v2/compute/capabilities", headers={'content-type': 'application/json'}, data=None, auth=None, chunked=None, timeout=20) + mock.assert_any_call("GET", "https://example.com:84/v2/compute/capabilities", headers={'content-type': 'application/json'}, data=None, auth=None, chunked=None, timeout=120) await compute.close() @@ -182,7 +182,7 @@ async def test_compute_httpQueryNotConnectedNonGNS3Server2(compute): with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock: with pytest.raises(aiohttp.web.HTTPConflict): await compute.post("/projects", {"a": "b"}) - mock.assert_any_call("GET", "https://example.com:84/v2/compute/capabilities", headers={'content-type': 'application/json'}, data=None, auth=None, chunked=None, timeout=20) + mock.assert_any_call("GET", "https://example.com:84/v2/compute/capabilities", headers={'content-type': 'application/json'}, data=None, auth=None, chunked=None, timeout=120) async def test_compute_httpQueryError(compute): @@ -217,7 +217,7 @@ async def test_compute_httpQuery_project(compute): project = Project(name="Test") mock_notification.assert_called() await compute.post("/projects", project) - mock.assert_called_with("POST", "https://example.com:84/v2/compute/projects", data=json.dumps(project.__json__()), headers={'content-type': 'application/json'}, auth=None, chunked=None, timeout=20) + mock.assert_called_with("POST", "https://example.com:84/v2/compute/projects", data=json.dumps(project.__json__()), headers={'content-type': 'application/json'}, auth=None, chunked=None, timeout=120) await compute.close() # FIXME: https://github.com/aio-libs/aiohttp/issues/2525 @@ -424,7 +424,7 @@ async def test_interfaces(compute): response.status = 200 with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock: assert await compute.interfaces() == res - mock.assert_any_call("GET", "https://example.com:84/v2/compute/network/interfaces", auth=None, chunked=None, data=None, headers={'content-type': 'application/json'}, timeout=20) + mock.assert_any_call("GET", "https://example.com:84/v2/compute/network/interfaces", auth=None, chunked=None, data=None, headers={'content-type': 'application/json'}, timeout=120) await compute.close() From 035a1049576a8623bed231929c75f056659b8920 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 11 Jan 2025 18:46:55 +0700 Subject: [PATCH 05/28] Fix capture on IOU/IOL links. Fixes #2477 --- gns3server/api/routes/compute/iou_nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/api/routes/compute/iou_nodes.py b/gns3server/api/routes/compute/iou_nodes.py index 1b456a97..f3b5b8fe 100644 --- a/gns3server/api/routes/compute/iou_nodes.py +++ b/gns3server/api/routes/compute/iou_nodes.py @@ -284,7 +284,7 @@ async def start_iou_node_capture( """ pcap_file_path = os.path.join(node.project.capture_working_directory(), node_capture_data.capture_file_name) - await node.start_capture(adapter_number, pcap_file_path) + await node.start_capture(adapter_number, port_number, pcap_file_path) return {"pcap_file_path": str(pcap_file_path)} From 8e96c4c2e881145eea37785aadeea1d64d2a433e Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 17 Jan 2025 07:57:42 +0700 Subject: [PATCH 06/28] Refactor command line arguments parsing --- gns3server/main.py | 42 +++++++++++++++++++++++++++-- gns3server/server.py | 61 ++++++++++++++++------------------------- tests/test_server.py | 64 +++++++++++++++++++++++++------------------- 3 files changed, 99 insertions(+), 68 deletions(-) diff --git a/gns3server/main.py b/gns3server/main.py index ebd8b112..bb30a2d8 100644 --- a/gns3server/main.py +++ b/gns3server/main.py @@ -30,6 +30,7 @@ import gns3server.utils.get_resource import os import sys import asyncio +import argparse def daemonize(): @@ -59,6 +60,42 @@ def daemonize(): print("Second fork failed: %d (%s)\n" % (e.errno, e.strerror), file=sys.stderr) sys.exit(1) +def parse_arguments(argv): + """ + Parse command line arguments + + :param argv: Array of command line arguments + """ + from gns3server.version import __version__ + parser = argparse.ArgumentParser(description=f"GNS3 server version {__version__}") + parser.add_argument("-v", "--version", help="show the version", action="version", version=__version__) + parser.add_argument("--host", help="run on the given host/IP address") + parser.add_argument("--port", help="run on the given port", type=int) + parser.add_argument("--ssl", action="store_true", help="run in SSL mode") + parser.add_argument("--config", help="Configuration file") + parser.add_argument("--certfile", help="SSL cert file") + parser.add_argument("--certkey", help="SSL key file") + parser.add_argument("-L", "--local", action="store_true", help="local mode (allows some insecure operations)") + parser.add_argument( + "-A", "--allow", action="store_true", help="allow remote connections to local console ports" + ) + parser.add_argument("-q", "--quiet", default=False, action="store_true", help="do not show logs on stdout") + parser.add_argument("-d", "--debug", default=False, action="store_true", help="show debug logs") + parser.add_argument("--logfile", "--log", help="send output to logfile instead of console") + parser.add_argument("--logmaxsize", default=10000000, help="maximum logfile size in bytes (default is 10MB)") + parser.add_argument( + "--logbackupcount", default=10, help="number of historical log files to keep (default is 10)" + ) + parser.add_argument( + "--logcompression", default=False, action="store_true", help="compress inactive (historical) logs" + ) + parser.add_argument("--daemon", action="store_true", help="start as a daemon") + parser.add_argument("--pid", help="store process pid") + parser.add_argument("--profile", help="Settings profile (blank will use default settings files)") + + args = parser.parse_args(argv) + return parser, args + def main(): """ @@ -69,10 +106,11 @@ def main(): raise SystemExit("Windows is not a supported platform to run the GNS3 server") if "--daemon" in sys.argv: daemonize() - from gns3server.server import Server try: - asyncio.run(Server().run()) + parser, args = parse_arguments(sys.argv[1:]) + from gns3server.server import Server + asyncio.run(Server().run(parser, args)) except KeyboardInterrupt: pass diff --git a/gns3server/server.py b/gns3server/server.py index 29f1a870..6ae18fdf 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -23,7 +23,6 @@ Start the program. Use main.py to load it. import os import datetime import locale -import argparse import psutil import sys import asyncio @@ -33,13 +32,10 @@ import uvicorn import secrets import string -from gns3server.controller import Controller -from gns3server.compute.port_manager import PortManager from gns3server.logger import init_logger from gns3server.version import __version__ from gns3server.config import Config from gns3server.crash_report import CrashReport -from gns3server.api.server import app from pydantic import ValidationError, SecretStr import logging @@ -90,40 +86,13 @@ class Server: else: log.info(f"Current locale is {language}.{encoding}") - def _parse_arguments(self, argv): + def _setup_logging(self, args): """ - Parse command line arguments and override local configuration + Setup logging. - :params args: Array of command line arguments + :param args: command line arguments """ - parser = argparse.ArgumentParser(description=f"GNS3 server version {__version__}") - parser.add_argument("-v", "--version", help="show the version", action="version", version=__version__) - parser.add_argument("--host", help="run on the given host/IP address") - parser.add_argument("--port", help="run on the given port", type=int) - parser.add_argument("--ssl", action="store_true", help="run in SSL mode") - parser.add_argument("--config", help="Configuration file") - parser.add_argument("--certfile", help="SSL cert file") - parser.add_argument("--certkey", help="SSL key file") - parser.add_argument("-L", "--local", action="store_true", help="local mode (allows some insecure operations)") - parser.add_argument( - "-A", "--allow", action="store_true", help="allow remote connections to local console ports" - ) - parser.add_argument("-q", "--quiet", default=False, action="store_true", help="do not show logs on stdout") - parser.add_argument("-d", "--debug", default=False, action="store_true", help="show debug logs") - parser.add_argument("--logfile", "--log", help="send output to logfile instead of console") - parser.add_argument("--logmaxsize", default=10000000, help="maximum logfile size in bytes (default is 10MB)") - parser.add_argument( - "--logbackupcount", default=10, help="number of historical log files to keep (default is 10)" - ) - parser.add_argument( - "--logcompression", default=False, action="store_true", help="compress inactive (historical) logs" - ) - parser.add_argument("--daemon", action="store_true", help="start as a daemon") - parser.add_argument("--pid", help="store process pid") - parser.add_argument("--profile", help="Settings profile (blank will use default settings files)") - - args = parser.parse_args(argv) level = logging.INFO if args.debug: level = logging.DEBUG @@ -137,6 +106,15 @@ class Server: quiet=args.quiet, ) + @staticmethod + def _load_config_and_set_defaults(parser, args, argv=None): + """ + Parse command line arguments and override local configuration + + :param parser: ArgumentParser instance + :param args: command line arguments + """ + try: if args.config: Config.instance(files=[args.config], profile=args.profile) @@ -157,7 +135,10 @@ class Server: } parser.set_defaults(**defaults) - return parser.parse_args(argv) + if argv is None: + argv = sys.argv[1:] + args = parser.parse_args(argv) + return args @staticmethod def _set_config_defaults_from_command_line(args): @@ -174,6 +155,8 @@ class Server: config.Server.enable_ssl = args.ssl def _signal_handling(self): + + from gns3server.controller import Controller def signal_handler(signame, *args): try: @@ -239,9 +222,10 @@ class Server: log.critical("Can't write pid file %s: %s", path, str(e)) sys.exit(1) - async def run(self): + async def run(self, parser, args): - args = self._parse_arguments(sys.argv[1:]) + self._setup_logging(args) + args = self._load_config_and_set_defaults(parser, args) if args.pid: self._pid_lock(args.pid) @@ -256,7 +240,6 @@ class Server: self._set_config_defaults_from_command_line(args) config = Config.instance().settings - if not config.Server.compute_password.get_secret_value(): alphabet = string.ascii_letters + string.digits + string.punctuation generated_password = ''.join(secrets.choice(alphabet) for _ in range(16)) @@ -297,11 +280,13 @@ class Server: host = config.Server.host port = config.Server.port + from gns3server.compute.port_manager import PortManager PortManager.instance().console_host = host self._signal_handling() try: log.info(f"Starting server on {host}:{port}") + from gns3server.api.server import app # only show uvicorn access logs in debug mode access_log = False diff --git a/tests/test_server.py b/tests/test_server.py index 96113a8c..14829349 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -21,6 +21,7 @@ import pytest import locale import tempfile +from gns3server.main import parse_arguments as parse from gns3server.server import Server from gns3server.config import Config @@ -35,12 +36,18 @@ def test_locale_check(): assert locale.getlocale() == ('fr_FR', 'UTF-8') +def parse_arguments(server, argv): + + parser, args= parse(argv) + return server._load_config_and_set_defaults(parser, args, argv) + + def test_parse_arguments(capsys, config, tmpdir): server = Server() server_config = config.settings.Server with pytest.raises(SystemExit): - server._parse_arguments(["--fail"]) + parse_arguments(server, ["--fail"]) out, err = capsys.readouterr() assert "usage" in err assert "fail" in err @@ -67,48 +74,49 @@ def test_parse_arguments(capsys, config, tmpdir): # assert __version__ in out # assert "optional arguments" in out - assert server._parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1" - assert server._parse_arguments([]).host == "0.0.0.0" + assert parse_arguments(server, ["--host", "192.168.1.1"]).host == "192.168.1.1" + assert parse_arguments(server, []).host == "0.0.0.0" server_config.host = "192.168.1.2" - assert server._parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1" - assert server._parse_arguments([]).host == "192.168.1.2" - assert server._parse_arguments(["--port", "8002"]).port == 8002 - assert server._parse_arguments([]).port == 3080 + assert parse_arguments(server, ["--host", "192.168.1.1"]).host == "192.168.1.1" + assert parse_arguments(server, []).host == "192.168.1.2" + + assert parse_arguments(server, ["--port", "8002"]).port == 8002 + assert parse_arguments(server, []).port == 3080 server_config.port = 8003 - assert server._parse_arguments([]).port == 8003 + assert parse_arguments(server, []).port == 8003 - assert server._parse_arguments(["--ssl"]).ssl - assert server._parse_arguments([]).ssl is False + assert parse_arguments(server, ["--ssl"]).ssl + assert parse_arguments(server,[]).ssl is False with tempfile.NamedTemporaryFile(dir=str(tmpdir)) as f: server_config.certfile = f.name server_config.certkey = f.name server_config.enable_ssl = True - assert server._parse_arguments([]).ssl + assert parse_arguments(server, []).ssl - assert server._parse_arguments(["--certfile", "bla"]).certfile == "bla" - assert server._parse_arguments(["--certkey", "blu"]).certkey == "blu" + assert parse_arguments(server, ["--certfile", "bla"]).certfile == "bla" + assert parse_arguments(server,["--certkey", "blu"]).certkey == "blu" - assert server._parse_arguments(["-L"]).local - assert server._parse_arguments(["--local"]).local + assert parse_arguments(server,["-L"]).local + assert parse_arguments(server,["--local"]).local server_config.local = False - assert server._parse_arguments([]).local is False + assert parse_arguments(server,[]).local is False server_config.local = True - assert server._parse_arguments([]).local + assert parse_arguments(server,[]).local - assert server._parse_arguments(["-A"]).allow - assert server._parse_arguments(["--allow"]).allow - assert server._parse_arguments([]).allow is False + assert parse_arguments(server,["-A"]).allow + assert parse_arguments(server,["--allow"]).allow + assert parse_arguments(server,[]).allow is False server_config.allow_remote_console = True - assert server._parse_arguments([]).allow + assert parse_arguments(server,[]).allow - assert server._parse_arguments(["-q"]).quiet - assert server._parse_arguments(["--quiet"]).quiet - assert server._parse_arguments([]).quiet is False + assert parse_arguments(server,["-q"]).quiet + assert parse_arguments(server,["--quiet"]).quiet + assert parse_arguments(server,[]).quiet is False - assert server._parse_arguments(["-d"]).debug - assert server._parse_arguments(["--debug"]).debug - assert server._parse_arguments([]).debug is False + assert parse_arguments(server,["-d"]).debug + assert parse_arguments(server,["--debug"]).debug + assert parse_arguments(server,[]).debug is False def test_set_config_with_args(tmpdir): @@ -118,7 +126,7 @@ def test_set_config_with_args(tmpdir): with tempfile.NamedTemporaryFile(dir=str(tmpdir)) as f: certfile = f.name certkey = f.name - args = server._parse_arguments(["--host", + args = parse_arguments(server, ["--host", "192.168.1.1", "--local", "--allow", From ba4e0c945d3dac7b0c1a887182037a04892fbb6d Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 17 Jan 2025 19:12:44 +1000 Subject: [PATCH 07/28] Refactor tests and upgrade dev package requirements --- dev-requirements.txt | 8 +- tests/api/routes/compute/test_capabilities.py | 42 +- tests/api/routes/compute/test_cloud_nodes.py | 313 ++-- tests/api/routes/compute/test_compute.py | 53 +- tests/api/routes/compute/test_docker_nodes.py | 528 +++--- .../api/routes/compute/test_dynamips_nodes.py | 330 ++-- .../compute/test_ethernet_switch_nodes.py | 805 +++++----- tests/api/routes/compute/test_iou_nodes.py | 764 ++++----- tests/api/routes/compute/test_nat_nodes.py | 319 ++-- tests/api/routes/compute/test_projects.py | 254 +-- tests/api/routes/compute/test_qemu_nodes.py | 1411 +++++++++-------- .../routes/compute/test_virtualbox_nodes.py | 428 ++--- tests/api/routes/compute/test_vmware_nodes.py | 452 +++--- tests/api/routes/compute/test_vpcs_nodes.py | 496 +++--- .../api/routes/controller/test_controller.py | 80 +- tests/api/routes/controller/test_drawings.py | 172 +- tests/api/routes/controller/test_gns3vm.py | 58 +- tests/api/routes/controller/test_links.py | 674 ++++---- tests/api/routes/controller/test_nodes.py | 945 ++++++----- tests/api/routes/controller/test_projects.py | 1005 ++++++------ tests/api/routes/controller/test_snapshots.py | 88 +- tests/api/routes/controller/test_symbols.py | 76 +- tests/api/routes/controller/test_users.py | 44 +- tests/api/routes/controller/test_version.py | 67 +- tests/api/routes/test_index.py | 96 +- tests/api/routes/test_routes.py | 77 +- tests/compute/builtin/nodes/test_cloud.py | 8 +- tests/conftest.py | 37 +- tests/pytest.ini | 2 + 29 files changed, 5074 insertions(+), 4558 deletions(-) create mode 100644 tests/pytest.ini diff --git a/dev-requirements.txt b/dev-requirements.txt index 3aa82cdd..04ca562b 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ -pytest==8.3.3 +pytest==8.3.4 flake8==7.1.1 pytest-timeout==2.3.1 -pytest-asyncio==0.21.2 +pytest-asyncio==0.25.2 requests==2.32.3 -httpx==0.27.2 # version 0.24.1 is required by httpx_ws -httpx_ws==0.6.2 +httpx==0.28.1 +httpx_ws==0.7.1 diff --git a/tests/api/routes/compute/test_capabilities.py b/tests/api/routes/compute/test_capabilities.py index e6ad64b3..071c629f 100644 --- a/tests/api/routes/compute/test_capabilities.py +++ b/tests/api/routes/compute/test_capabilities.py @@ -29,27 +29,29 @@ from gns3server.utils.path import get_default_project_directory pytestmark = pytest.mark.asyncio -async def test_get(app: FastAPI, compute_client: AsyncClient, windows_platform) -> None: +class TestCapabilitiesRoutes: - response = await compute_client.get(app.url_path_for("compute:get_capabilities")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'], - 'version': __version__, - 'platform': sys.platform, - 'cpus': psutil.cpu_count(logical=True), - 'memory': psutil.virtual_memory().total, - 'disk_size': psutil.disk_usage(get_default_project_directory()).total, - } + async def test_get(self, app: FastAPI, compute_client: AsyncClient, windows_platform) -> None: + + response = await compute_client.get(app.url_path_for("compute:get_capabilities")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'], + 'version': __version__, + 'platform': sys.platform, + 'cpus': psutil.cpu_count(logical=True), + 'memory': psutil.virtual_memory().total, + 'disk_size': psutil.disk_usage(get_default_project_directory()).total, + } -async def test_get_on_gns3vm(app: FastAPI, compute_client: AsyncClient, on_gns3vm) -> None: + async def test_get_on_gns3vm(self, app: FastAPI, compute_client: AsyncClient, on_gns3vm) -> None: - response = await compute_client.get(app.url_path_for("compute:get_capabilities")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'], - 'version': __version__, - 'platform': sys.platform, - 'cpus': psutil.cpu_count(logical=True), - 'memory': psutil.virtual_memory().total, - 'disk_size': psutil.disk_usage(get_default_project_directory()).total, - } + response = await compute_client.get(app.url_path_for("compute:get_capabilities")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == {'node_types': ['cloud', 'ethernet_hub', 'ethernet_switch', 'nat', 'vpcs', 'virtualbox', 'dynamips', 'frame_relay_switch', 'atm_switch', 'qemu', 'vmware', 'docker', 'iou'], + 'version': __version__, + 'platform': sys.platform, + 'cpus': psutil.cpu_count(logical=True), + 'memory': psutil.virtual_memory().total, + 'disk_size': psutil.disk_usage(get_default_project_directory()).total, + } diff --git a/tests/api/routes/compute/test_cloud_nodes.py b/tests/api/routes/compute/test_cloud_nodes.py index b29f8a2b..18014eb9 100644 --- a/tests/api/routes/compute/test_cloud_nodes.py +++ b/tests/api/routes/compute/test_cloud_nodes.py @@ -28,154 +28,193 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture(scope="function") -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project, on_gns3vm) -> dict: +class TestCloudNodesRoutes: - with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud._start_ubridge"): - response = await compute_client.post(app.url_path_for("compute:create_cloud", project_id=compute_project.id), - json={"name": "Cloud 1"}) - assert response.status_code == status.HTTP_201_CREATED - return response.json() + @pytest_asyncio.fixture + async def vm(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project, on_gns3vm) -> dict: + + with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud._start_ubridge"): + response = await compute_client.post(app.url_path_for("compute:create_cloud", project_id=compute_project.id), + json={"name": "Cloud 1"}) + assert response.status_code == status.HTTP_201_CREATED + return response.json() -async def test_cloud_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + async def test_cloud_create( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project + ) -> None: - with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud._start_ubridge"): - response = await compute_client.post(app.url_path_for("compute:create_cloud", project_id=compute_project.id), - json={"name": "Cloud 1"}) - assert response.status_code == 201 - assert response.json()["name"] == "Cloud 1" - assert response.json()["project_id"] == compute_project.id + with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud._start_ubridge"): + response = await compute_client.post(app.url_path_for("compute:create_cloud", project_id=compute_project.id), + json={"name": "Cloud 1"}) + assert response.status_code == 201 + assert response.json()["name"] == "Cloud 1" + assert response.json()["project_id"] == compute_project.id -async def test_get_cloud(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: + async def test_get_cloud( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: - response = await compute_client.get(app.url_path_for("compute:get_cloud", project_id=vm["project_id"], node_id=vm["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "Cloud 1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["status"] == "started" - - -async def test_cloud_nio_create_udp(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - params = {"type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1"} - - url = app.url_path_for("compute:create_cloud_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_cloud_nio_update_udp(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - params = {"type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1"} - - url = app.url_path_for("compute:create_cloud_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - await compute_client.post(url, json=params) - - params["filters"] = {} - url = app.url_path_for("compute:create_cloud_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - response = await compute_client.put(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_cloud_delete_nio(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - params = {"type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1"} - - url = app.url_path_for("compute:create_cloud_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - await compute_client.post(url, json=params) - - url = app.url_path_for("compute:delete_cloud_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud._start_ubridge"): - response = await compute_client.delete(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_cloud_delete(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - response = await compute_client.delete(app.url_path_for("compute:delete_cloud", project_id=vm["project_id"], node_id=vm["node_id"])) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_cloud_update(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - response = await compute_client.put(app.url_path_for("compute:update_cloud", project_id=vm["project_id"], node_id=vm["node_id"]), - json={"name": "test"}) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - - -async def test_cloud_start_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud.start_capture") as mock: - response = await compute_client.post(app.url_path_for("compute:start_cloud_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0"), - json=params) + response = await compute_client.get(app.url_path_for("compute:get_cloud", project_id=vm["project_id"], node_id=vm["node_id"])) assert response.status_code == status.HTTP_200_OK - assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] + assert response.json()["name"] == "Cloud 1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["status"] == "started" -async def test_cloud_stop_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_cloud_nio_create_udp( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: - with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud.stop_capture") as mock: - response = await compute_client.post(app.url_path_for("compute:stop_cloud_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0")) + params = {"type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1"} + + url = app.url_path_for("compute:create_cloud_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_cloud_nio_update_udp( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: + + params = {"type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1"} + + url = app.url_path_for("compute:create_cloud_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + await compute_client.post(url, json=params) + + params["filters"] = {} + url = app.url_path_for("compute:create_cloud_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.put(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_cloud_delete_nio( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: + + params = {"type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1"} + + url = app.url_path_for("compute:create_cloud_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + await compute_client.post(url, json=params) + + url = app.url_path_for("compute:delete_cloud_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud._start_ubridge"): + response = await compute_client.delete(url) assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called -# @pytest.mark.asyncio -# async def test_cloud_pcap(compute_api, vm, compute_project): -# -# from itertools import repeat -# stream = repeat(42, times=10) -# -# with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud.get_nio"): -# with asyncio_patch("gns3server.compute.builtin.Builtin.stream_pcap_file", return_value=stream): -# response = await compute_api.get("/projects/{project_id}/cloud/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"])) -# assert response.status_code == 200 -# + async def test_cloud_delete( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: + + response = await compute_client.delete(app.url_path_for("compute:delete_cloud", project_id=vm["project_id"], node_id=vm["node_id"])) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_cloud_update( + self, app: FastAPI, + compute_client: AsyncClient, + vm: dict + ) -> None: + + response = await compute_client.put(app.url_path_for("compute:update_cloud", project_id=vm["project_id"], node_id=vm["node_id"]), + json={"name": "test"}) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + + + async def test_cloud_start_capture( + self, app: FastAPI, + compute_client: AsyncClient, + vm: dict + ) -> None: + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud.start_capture") as mock: + response = await compute_client.post(app.url_path_for("compute:start_cloud_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0"), + json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + async def test_cloud_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud.stop_capture") as mock: + response = await compute_client.post(app.url_path_for("compute:stop_cloud_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0")) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + # @pytest.mark.asyncio + # async def test_cloud_pcap(self, compute_api, vm, compute_project): + # + # from itertools import repeat + # stream = repeat(42, times=10) + # + # with asyncio_patch("gns3server.compute.builtin.nodes.cloud.Cloud.get_nio"): + # with asyncio_patch("gns3server.compute.builtin.Builtin.stream_pcap_file", return_value=stream): + # response = await compute_api.get("/projects/{project_id}/cloud/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"])) + # assert response.status_code == 200 + # diff --git a/tests/api/routes/compute/test_compute.py b/tests/api/routes/compute/test_compute.py index 45325aad..aa70ff6b 100644 --- a/tests/api/routes/compute/test_compute.py +++ b/tests/api/routes/compute/test_compute.py @@ -26,41 +26,48 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -async def test_udp_allocation(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: +class TestComputeRoutes: - response = await compute_client.post(app.url_path_for("compute:allocate_udp_port", project_id=compute_project.id), json={}) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()['udp_port'] is not None + async def test_udp_allocation( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project + ) -> None: + + response = await compute_client.post(app.url_path_for("compute:allocate_udp_port", project_id=compute_project.id), json={}) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()['udp_port'] is not None -async def test_interfaces(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_interfaces(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.get(app.url_path_for("compute:network_interfaces")) - assert response.status_code == status.HTTP_200_OK - assert isinstance(response.json(), list) + response = await compute_client.get(app.url_path_for("compute:network_interfaces")) + assert response.status_code == status.HTTP_200_OK + assert isinstance(response.json(), list) -async def test_version_output(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_version_output(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.get(app.url_path_for("compute:compute_version")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == {'version': __version__} + response = await compute_client.get(app.url_path_for("compute:compute_version")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == {'version': __version__} -async def test_compute_authentication(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_compute_authentication(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.get(app.url_path_for("compute:compute_version"), auth=("admin", "invalid_password")) - assert response.status_code == status.HTTP_401_UNAUTHORIZED + response = await compute_client.get(app.url_path_for("compute:compute_version"), auth=("admin", "invalid_password")) + assert response.status_code == status.HTTP_401_UNAUTHORIZED -# @pytest.mark.asyncio -# async def test_debug_output(compute_api): -# -# response = await compute_api.get('/debug') -# assert response.status_code == 200 + # @pytest.mark.asyncio + # async def test_debug_output(compute_api): + # + # response = await compute_api.get('/debug') + # assert response.status_code == 200 -async def test_statistics_output(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_statistics_output(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.get(app.url_path_for("compute:compute_statistics")) - assert response.status_code == status.HTTP_200_OK + response = await compute_client.get(app.url_path_for("compute:compute_statistics")) + assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/compute/test_docker_nodes.py b/tests/api/routes/compute/test_docker_nodes.py index f8c7935e..b36c2965 100644 --- a/tests/api/routes/compute/test_docker_nodes.py +++ b/tests/api/routes/compute/test_docker_nodes.py @@ -25,285 +25,299 @@ from unittest.mock import patch from gns3server.compute.project import Project -pytestmark = [pytest.mark.asyncio] +pytestmark = pytest.mark.asyncio -@pytest.fixture -def base_params() -> dict: - """Return standard parameters""" +class TestDockerNodesRoutes: - params = { - "name": "DOCKER-TEST-1", - "image": "nginx", - "start_command": "nginx-daemon", - "adapters": 2, - "environment": "YES=1\nNO=0", - "console_type": "telnet", - "console_resolution": "1280x1024", - "extra_hosts": "test:127.0.0.1" - } - return params + @pytest.fixture + def base_params(self) -> dict: + """Return standard parameters""" + + params = { + "name": "DOCKER-TEST-1", + "image": "nginx", + "start_command": "nginx-daemon", + "adapters": 2, + "environment": "YES=1\nNO=0", + "console_type": "telnet", + "console_resolution": "1280x1024", + "extra_hosts": "test:127.0.0.1" + } + return params -# @pytest.yield_fixture(autouse=True) -# def mock_connection(): -# -# docker = Docker.instance() -# docker._connected = True -# docker._connector = MagicMock() -# yield -# Docker._instance = None + # @pytest.yield_fixture(autouse=True) + # def mock_connection(): + # + # docker = Docker.instance() + # docker._connected = True + # docker._connector = MagicMock() + # yield + # Docker._instance = None -@pytest_asyncio.fixture -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project, base_params: dict) -> dict: + @pytest_asyncio.fixture + async def vm( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict + ) -> dict: - with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): - with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): - with asyncio_patch("gns3server.compute.docker.DockerVM._get_container_state", return_value="exited"): - response = await compute_client.post(app.url_path_for("compute:create_docker_node", project_id=compute_project.id), - json=base_params) - assert response.status_code == status.HTTP_201_CREATED - return response.json() + with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): + with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): + with asyncio_patch("gns3server.compute.docker.DockerVM._get_container_state", return_value="exited"): + response = await compute_client.post(app.url_path_for("compute:create_docker_node", project_id=compute_project.id), + json=base_params) + assert response.status_code == status.HTTP_201_CREATED + return response.json() -async def test_docker_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project, base_params: dict) -> None: + async def test_docker_create( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict + ) -> None: - with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): - with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): - response = await compute_client.post( - app.url_path_for("compute:create_docker_node", project_id=compute_project.id), json=base_params - ) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "DOCKER-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["container_id"] == "8bd8153ea8f5" - assert response.json()["image"] == "nginx:latest" - assert response.json()["adapters"] == 2 - assert response.json()["environment"] == "YES=1\nNO=0" - assert response.json()["console_resolution"] == "1280x1024" - assert response.json()["extra_hosts"] == "test:127.0.0.1" + with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): + with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): + response = await compute_client.post( + app.url_path_for("compute:create_docker_node", project_id=compute_project.id), json=base_params + ) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "DOCKER-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["container_id"] == "8bd8153ea8f5" + assert response.json()["image"] == "nginx:latest" + assert response.json()["adapters"] == 2 + assert response.json()["environment"] == "YES=1\nNO=0" + assert response.json()["console_resolution"] == "1280x1024" + assert response.json()["extra_hosts"] == "test:127.0.0.1" -@pytest.mark.parametrize( - "name, status_code", - ( - ("valid-name.com", status.HTTP_201_CREATED), - ("42name", status.HTTP_201_CREATED), - ("424242", status.HTTP_409_CONFLICT), - ("name42", status.HTTP_201_CREATED), - ("name.424242", status.HTTP_409_CONFLICT), - ("-name", status.HTTP_409_CONFLICT), - ("name%-test", status.HTTP_409_CONFLICT), - ("x" * 63, status.HTTP_201_CREATED), - ("x" * 64, status.HTTP_409_CONFLICT), - (("x" * 62 + ".") * 4, status.HTTP_201_CREATED), - ("xx" + ("x" * 62 + ".") * 4, status.HTTP_409_CONFLICT), - ), -) -async def test_docker_create_with_invalid_name( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict, - name: str, - status_code: int -) -> None: + @pytest.mark.parametrize( + "name, status_code", + ( + ("valid-name.com", status.HTTP_201_CREATED), + ("42name", status.HTTP_201_CREATED), + ("424242", status.HTTP_409_CONFLICT), + ("name42", status.HTTP_201_CREATED), + ("name.424242", status.HTTP_409_CONFLICT), + ("-name", status.HTTP_409_CONFLICT), + ("name%-test", status.HTTP_409_CONFLICT), + ("x" * 63, status.HTTP_201_CREATED), + ("x" * 64, status.HTTP_409_CONFLICT), + (("x" * 62 + ".") * 4, status.HTTP_201_CREATED), + ("xx" + ("x" * 62 + ".") * 4, status.HTTP_409_CONFLICT), + ), + ) + async def test_docker_create_with_invalid_name( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict, + name: str, + status_code: int + ) -> None: - base_params["name"] = name - with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): - with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): - response = await compute_client.post( - app.url_path_for("compute:create_docker_node", project_id=compute_project.id), json=base_params - ) - assert response.status_code == status_code + base_params["name"] = name + with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): + with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): + response = await compute_client.post( + app.url_path_for("compute:create_docker_node", project_id=compute_project.id), json=base_params + ) + assert response.status_code == status_code -async def test_docker_start(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_docker_start(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.start", return_value=True) as mock: + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.start", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:start_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_stop(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.stop", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:stop_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_reload(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.restart", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:reload_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_delete(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.delete", return_value=True) as mock: - response = await compute_client.delete(app.url_path_for("compute:delete_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_pause(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.pause", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:pause_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_unpause(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.unpause", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:unpause_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_nio_create_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1"} - - url = app.url_path_for("compute:create_docker_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_docker_update_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_docker_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - - url = app.url_path_for("compute:update_docker_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.adapter_update_nio_binding"): - response = await compute_client.put(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - - -async def test_docker_delete_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:delete_docker_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.adapter_remove_nio_binding"): - response = await compute_client.delete(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_docker_update(app: FastAPI, compute_client: AsyncClient, vm: dict, free_console_port: int) -> None: - - params = { - "name": "test", - "console": free_console_port, - "start_command": "yes", - "environment": "GNS3=1\nGNS4=0", - "extra_hosts": "test:127.0.0.1" - } - - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.update") as mock: - response = await compute_client.put(app.url_path_for("compute:update_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - - assert response.status_code == 200 - assert mock.called - assert response.json()["name"] == "test" - assert response.json()["console"] == free_console_port - assert response.json()["start_command"] == "yes" - assert response.json()["environment"] == "GNS3=1\nGNS4=0" - assert response.json()["extra_hosts"] == "test:127.0.0.1" - - -async def test_docker_start_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:start_docker_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.docker.docker_vm.DockerVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.start_capture") as mock: - params = {"capture_file_name": "test.pcap", "data_link_type": "DLT_EN10MB"} - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK + response = await compute_client.post(app.url_path_for("compute:start_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] - - -async def test_docker_stop_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:stop_docker_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.docker.docker_vm.DockerVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.stop_capture") as mock: - response = await compute_client.post(url) assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_docker_stop(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.stop", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:stop_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_docker_duplicate(app: FastAPI, compute_client: AsyncClient, vm: dict, base_params: dict) -> None: + async def test_docker_reload(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - # create destination node first - with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): - with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): - response = await compute_client.post(app.url_path_for("compute:create_docker_node", - project_id=vm["project_id"]), json=base_params) - assert response.status_code == status.HTTP_201_CREATED + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.restart", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:reload_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT - params = {"destination_node_id": response.json()["node_id"]} - response = await compute_client.post(app.url_path_for("compute:duplicate_docker_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_201_CREATED + + async def test_docker_delete(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.delete", return_value=True) as mock: + response = await compute_client.delete(app.url_path_for("compute:delete_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_docker_pause(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.pause", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:pause_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_docker_unpause(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.unpause", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:unpause_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_docker_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1"} + + url = app.url_path_for("compute:create_docker_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_docker_update_nio(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + url = app.url_path_for("compute:create_docker_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + + url = app.url_path_for("compute:update_docker_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.adapter_update_nio_binding"): + response = await compute_client.put(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + + + async def test_docker_delete_nio(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:delete_docker_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.adapter_remove_nio_binding"): + response = await compute_client.delete(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_docker_update(self, app: FastAPI, compute_client: AsyncClient, vm: dict, free_console_port: int) -> None: + + params = { + "name": "test", + "console": free_console_port, + "start_command": "yes", + "environment": "GNS3=1\nGNS4=0", + "extra_hosts": "test:127.0.0.1" + } + + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.update") as mock: + response = await compute_client.put(app.url_path_for("compute:update_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + + assert response.status_code == 200 + assert mock.called + assert response.json()["name"] == "test" + assert response.json()["console"] == free_console_port + assert response.json()["start_command"] == "yes" + assert response.json()["environment"] == "GNS3=1\nGNS4=0" + assert response.json()["extra_hosts"] == "test:127.0.0.1" + + + async def test_docker_start_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:start_docker_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.docker.docker_vm.DockerVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.start_capture") as mock: + params = {"capture_file_name": "test.pcap", "data_link_type": "DLT_EN10MB"} + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + async def test_docker_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:stop_docker_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.docker.docker_vm.DockerVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.docker.docker_vm.DockerVM.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + async def test_docker_duplicate(self, app: FastAPI, compute_client: AsyncClient, vm: dict, base_params: dict) -> None: + + # create destination node first + with asyncio_patch("gns3server.compute.docker.Docker.list_images", return_value=[{"image": "nginx"}]): + with asyncio_patch("gns3server.compute.docker.Docker.query", return_value={"Id": "8bd8153ea8f5"}): + response = await compute_client.post(app.url_path_for("compute:create_docker_node", + project_id=vm["project_id"]), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + + params = {"destination_node_id": response.json()["node_id"]} + response = await compute_client.post(app.url_path_for("compute:duplicate_docker_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_201_CREATED diff --git a/tests/api/routes/compute/test_dynamips_nodes.py b/tests/api/routes/compute/test_dynamips_nodes.py index 19bc691c..840d2b3d 100644 --- a/tests/api/routes/compute/test_dynamips_nodes.py +++ b/tests/api/routes/compute/test_dynamips_nodes.py @@ -26,196 +26,208 @@ from httpx import AsyncClient pytestmark = pytest.mark.asyncio -# @pytest.yield_fixture(scope="module") -# async def vm(compute_api, compute_project, fake_image): -# -# dynamips_path = "/fake/dynamips" -# params = { -# "name": "My router", -# "platform": "c3745", -# "image": fake_image, -# "ram": 128 -# } -# with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.create", return_value=True) as mock: -# response = await compute_api.post("/projects/{project_id}/dynamips/nodes".format(project_id=compute_project.id), params) -# assert mock.called -# assert response.status == 201 -# -# #with asyncio_patch("gns3server.compute.dynamips.Dynamips.find_dynamips", return_value=dynamips_path): -# # yield response.json + +class TestDynamipsNodesRoutes: + + # @pytest.yield_fixture(scope="module") + # async def vm(compute_api, compute_project, fake_image): + # + # dynamips_path = "/fake/dynamips" + # params = { + # "name": "My router", + # "platform": "c3745", + # "image": fake_image, + # "ram": 128 + # } + # with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.create", return_value=True) as mock: + # response = await compute_api.post("/projects/{project_id}/dynamips/nodes".format(project_id=compute_project.id), params) + # assert mock.called + # assert response.status == 201 + # + # #with asyncio_patch("gns3server.compute.dynamips.Dynamips.find_dynamips", return_value=dynamips_path): + # # yield response.json -# async def test_dynamips_vm_create(compute_api, compute_project, fake_image): -# -# params = { -# "name": "My router", -# "platform": "c3745", -# "image": os.path.basename(fake_image), -# "ram": 128 -# } -# -# print(fake_image) -# -# with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.create", return_value=True): -# response = await compute_api.post("/projects/{project_id}/dynamips/nodes".format(project_id=compute_project.id), params) -# assert response.status == 201 -# assert response.json["name"] == "My router" -# assert response.json["project_id"] == compute_project.id -# assert response.json["dynamips_id"] + # async def test_dynamips_vm_create(compute_api, compute_project, fake_image): + # + # params = { + # "name": "My router", + # "platform": "c3745", + # "image": os.path.basename(fake_image), + # "ram": 128 + # } + # + # print(fake_image) + # + # with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.create", return_value=True): + # response = await compute_api.post("/projects/{project_id}/dynamips/nodes".format(project_id=compute_project.id), params) + # assert response.status == 201 + # assert response.json["name"] == "My router" + # assert response.json["project_id"] == compute_project.id + # assert response.json["dynamips_id"] -# def test_dynamips_vm_get(compute_api, project, vm): -# response = compute_api.get("/projects/{project_id}/dynamips/nodes/{node_id}".format(project_id=vm["project_id"], node_id=vm["node_id"]), example=True) -# assert response.status == 200 -# assert response.route == "/projects/{project_id}/dynamips/nodes/{node_id}" -# assert response.json["name"] == "My router" -# assert response.json["project_id"] == project.id -# -# -# def test_dynamips_vm_start(compute_api, vm): -# with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.start", return_value=True) as mock: -# response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/start".format(project_id=vm["project_id"], node_id=vm["node_id"])) -# assert mock.called -# assert response.status == 204 -# -# -# def test_dynamips_vm_stop(compute_api, vm): -# with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.stop", return_value=True) as mock: -# response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/stop".format(project_id=vm["project_id"], node_id=vm["node_id"])) -# assert mock.called -# assert response.status == 204 -# -# -# def test_dynamips_vm_suspend(compute_api, vm): -# with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.suspend", return_value=True) as mock: -# response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/suspend".format(project_id=vm["project_id"], node_id=vm["node_id"])) -# assert mock.called -# assert response.status == 204 -# -# -# def test_dynamips_vm_resume(compute_api, vm): -# with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.resume", return_value=True) as mock: -# response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/resume".format(project_id=vm["project_id"], node_id=vm["node_id"])) -# assert mock.called -# assert response.status == 204 + # def test_dynamips_vm_get(compute_api, project, vm): + # response = compute_api.get("/projects/{project_id}/dynamips/nodes/{node_id}".format(project_id=vm["project_id"], node_id=vm["node_id"]), example=True) + # assert response.status == 200 + # assert response.route == "/projects/{project_id}/dynamips/nodes/{node_id}" + # assert response.json["name"] == "My router" + # assert response.json["project_id"] == project.id + # + # + # def test_dynamips_vm_start(compute_api, vm): + # with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.start", return_value=True) as mock: + # response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/start".format(project_id=vm["project_id"], node_id=vm["node_id"])) + # assert mock.called + # assert response.status == 204 + # + # + # def test_dynamips_vm_stop(compute_api, vm): + # with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.stop", return_value=True) as mock: + # response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/stop".format(project_id=vm["project_id"], node_id=vm["node_id"])) + # assert mock.called + # assert response.status == 204 + # + # + # def test_dynamips_vm_suspend(compute_api, vm): + # with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.suspend", return_value=True) as mock: + # response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/suspend".format(project_id=vm["project_id"], node_id=vm["node_id"])) + # assert mock.called + # assert response.status == 204 + # + # + # def test_dynamips_vm_resume(compute_api, vm): + # with asyncio_patch("gns3server.compute.dynamips.nodes.router.Router.resume", return_value=True) as mock: + # response = compute_api.post("/projects/{project_id}/dynamips/nodes/{node_id}/resume".format(project_id=vm["project_id"], node_id=vm["node_id"])) + # assert mock.called + # assert response.status == 204 -# def test_vbox_nio_create_udp(compute_api, vm): -# -# with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_add_nio_binding') as mock: -# response = compute_api.post("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/nio".format(project_id=vm["project_id"], -# node_id=vm["node_id"]), {"type": "nio_udp", -# "lport": 4242, -# "rport": 4343, -# "rhost": "127.0.0.1"}, -# example=True) -# -# assert mock.called -# args, kwgars = mock.call_args -# assert args[0] == 0 -# -# assert response.status == 201 -# assert response.route == "/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/{adapter_id:\d+}/nio" -# assert response.json["type"] == "nio_udp" -# -# -# def test_vbox_delete_nio(compute_api, vm): -# -# with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_remove_nio_binding') as mock: -# response = compute_api.delete("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), example=True) -# -# assert mock.called -# args, kwgars = mock.call_args -# assert args[0] == 0 -# -# assert response.status == 204 -# assert response.route == "/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/{adapter_id:\d+}/nio" -# -# -# def test_vbox_update(compute_api, vm, free_console_port): -# response = compute_api.put("/projects/{project_id}/virtualbox/nodes/{node_id}".format(project_id=vm["project_id"], node_id=vm["node_id"]), {"name": "test", -# "console": free_console_port}) -# assert response.status == 200 -# assert response.json["name"] == "test" -# assert response.json["console"] == free_console_port + # def test_vbox_nio_create_udp(compute_api, vm): + # + # with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_add_nio_binding') as mock: + # response = compute_api.post("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/nio".format(project_id=vm["project_id"], + # node_id=vm["node_id"]), {"type": "nio_udp", + # "lport": 4242, + # "rport": 4343, + # "rhost": "127.0.0.1"}, + # example=True) + # + # assert mock.called + # args, kwgars = mock.call_args + # assert args[0] == 0 + # + # assert response.status == 201 + # assert response.route == "/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/{adapter_id:\d+}/nio" + # assert response.json["type"] == "nio_udp" + # + # + # def test_vbox_delete_nio(compute_api, vm): + # + # with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_remove_nio_binding') as mock: + # response = compute_api.delete("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), example=True) + # + # assert mock.called + # args, kwgars = mock.call_args + # assert args[0] == 0 + # + # assert response.status == 204 + # assert response.route == "/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/{adapter_id:\d+}/nio" + # + # + # def test_vbox_update(compute_api, vm, free_console_port): + # response = compute_api.put("/projects/{project_id}/virtualbox/nodes/{node_id}".format(project_id=vm["project_id"], node_id=vm["node_id"]), {"name": "test", + # "console": free_console_port}) + # assert response.status == 200 + # assert response.json["name"] == "test" + # assert response.json["console"] == free_console_port -@pytest.fixture -def fake_image(tmpdir) -> str: - """Create a fake Dynamips image on disk""" + @pytest.fixture + def fake_image(self, tmpdir) -> str: + """Create a fake Dynamips image on disk""" - path = str(tmpdir / "7200.bin") - with open(path, "wb+") as f: - f.write(b'\x7fELF\x01\x02\x01') - os.chmod(path, stat.S_IREAD) - return path + path = str(tmpdir / "7200.bin") + with open(path, "wb+") as f: + f.write(b'\x7fELF\x01\x02\x01') + os.chmod(path, stat.S_IREAD) + return path -@pytest.fixture -def fake_file(tmpdir) -> str: - """Create a fake file disk""" + @pytest.fixture + def fake_file(self, tmpdir) -> str: + """Create a fake file disk""" - path = str(tmpdir / "7200.txt") - with open(path, "w+") as f: - f.write('1') - os.chmod(path, stat.S_IREAD) - return path + path = str(tmpdir / "7200.txt") + with open(path, "w+") as f: + f.write('1') + os.chmod(path, stat.S_IREAD) + return path -async def test_images(app: FastAPI, compute_client: AsyncClient, tmpdir, fake_image: str, fake_file: str) -> None: + async def test_images( + self, app: FastAPI, + compute_client: AsyncClient, + tmpdir, fake_image: str, + fake_file: str + ) -> None: - with patch("gns3server.utils.images.default_images_directory", return_value=str(tmpdir)): - response = await compute_client.get(app.url_path_for("compute:get_dynamips_images")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == [{"filename": "7200.bin", - "path": "7200.bin", - "filesize": 7, - "md5sum": "b0d5aa897d937aced5a6b1046e8f7e2e"}] + with patch("gns3server.utils.images.default_images_directory", return_value=str(tmpdir)): + response = await compute_client.get(app.url_path_for("compute:get_dynamips_images")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == [{"filename": "7200.bin", + "path": "7200.bin", + "filesize": 7, + "md5sum": "b0d5aa897d937aced5a6b1046e8f7e2e"}] -async def test_upload_image(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: + async def test_upload_image(self, app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: - response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test2"), content=b"TEST") - assert response.status_code == status.HTTP_204_NO_CONTENT + response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test2"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT - with open(os.path.join(images_dir, "IOS", "test2")) as f: - assert f.read() == "TEST" + with open(os.path.join(images_dir, "IOS", "test2")) as f: + assert f.read() == "TEST" - with open(os.path.join(images_dir, "IOS", "test2.md5sum")) as f: - checksum = f.read() - assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" + with open(os.path.join(images_dir, "IOS", "test2.md5sum")) as f: + checksum = f.read() + assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" -async def test_upload_image_forbidden_location(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_upload_image_forbidden_location(self, app: FastAPI, compute_client: AsyncClient) -> None: - file_path = "%2e%2e/hello" - response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename=file_path), content=b"TEST") - assert response.status_code == status.HTTP_403_FORBIDDEN + file_path = "%2e%2e/hello" + response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename=file_path), content=b"TEST") + assert response.status_code == status.HTTP_403_FORBIDDEN -async def test_download_image(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: + async def test_download_image(self, app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: - response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test3"), content=b"TEST") - assert response.status_code == status.HTTP_204_NO_CONTENT + response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test3"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT - response = await compute_client.get(app.url_path_for("compute:download_dynamips_image", filename="test3")) - assert response.status_code == status.HTTP_200_OK + response = await compute_client.get(app.url_path_for("compute:download_dynamips_image", filename="test3")) + assert response.status_code == status.HTTP_200_OK -async def test_download_image_forbidden(app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: + async def test_download_image_forbidden(self, app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: - file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" - response = await compute_client.get(app.url_path_for("compute:download_dynamips_image", filename=file_path)) - assert response.status_code == status.HTTP_403_FORBIDDEN + file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" + response = await compute_client.get(app.url_path_for("compute:download_dynamips_image", filename=file_path)) + assert response.status_code == status.HTTP_403_FORBIDDEN -@pytest.mark.skipif(os.getuid() == 0, reason="Root can delete any image") -async def test_upload_image_permission_denied(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: + @pytest.mark.skipif(os.getuid() == 0, reason="Root can delete any image") + async def test_upload_image_permission_denied( + self, app: FastAPI, + compute_client: AsyncClient, + images_dir: str + ) -> None: - os.makedirs(os.path.join(images_dir, "IOS"), exist_ok=True) - with open(os.path.join(images_dir, "IOS", "test2.tmp"), "w+") as f: - f.write("") - os.chmod(os.path.join(images_dir, "IOS", "test2.tmp"), 0) + os.makedirs(os.path.join(images_dir, "IOS"), exist_ok=True) + with open(os.path.join(images_dir, "IOS", "test2.tmp"), "w+") as f: + f.write("") + os.chmod(os.path.join(images_dir, "IOS", "test2.tmp"), 0) - response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test2"), content=b"TEST") - assert response.status_code == status.HTTP_409_CONFLICT + response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test2"), content=b"TEST") + assert response.status_code == status.HTTP_409_CONFLICT diff --git a/tests/api/routes/compute/test_ethernet_switch_nodes.py b/tests/api/routes/compute/test_ethernet_switch_nodes.py index 67390685..f0dc400b 100644 --- a/tests/api/routes/compute/test_ethernet_switch_nodes.py +++ b/tests/api/routes/compute/test_ethernet_switch_nodes.py @@ -28,427 +28,474 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture -async def ethernet_switch(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> dict: +class TestEthernetSwitchNodesRoutes: - params = {"name": "Ethernet Switch"} - with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.create") as mock: - response = await compute_client.post( - app.url_path_for("compute:create_ethernet_switch", project_id=compute_project.id), - json=params + @pytest_asyncio.fixture + async def ethernet_switch(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> dict: + + params = {"name": "Ethernet Switch"} + with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.create") as mock: + response = await compute_client.post( + app.url_path_for("compute:create_ethernet_switch", project_id=compute_project.id), + json=params + ) + assert mock.called + assert response.status_code == status.HTTP_201_CREATED + + json_response = response.json() + node = compute_project.get_node(json_response["node_id"]) + node._hypervisor = AsyncioMagicMock() + node._hypervisor.send = AsyncioMagicMock() + node._hypervisor.version = "0.2.16" + return json_response + + + async def test_ethernet_switch_create( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project + ) -> None: + + params = {"name": "Ethernet Switch 1"} + with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.create") as mock: + response = await compute_client.post( + app.url_path_for("compute:create_ethernet_switch", project_id=compute_project.id), + json=params + ) + assert mock.called + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "Ethernet Switch 1" + assert response.json()["project_id"] == compute_project.id + + + async def test_ethernet_switch_get( + self, app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ethernet_switch: dict + ) -> None: + + response = await compute_client.get( + app.url_path_for( + "compute:get_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"] + ) ) - assert mock.called - assert response.status_code == status.HTTP_201_CREATED - - json_response = response.json() - node = compute_project.get_node(json_response["node_id"]) - node._hypervisor = AsyncioMagicMock() - node._hypervisor.send = AsyncioMagicMock() - node._hypervisor.version = "0.2.16" - return json_response - - -async def test_ethernet_switch_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - - params = {"name": "Ethernet Switch 1"} - with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.create") as mock: - response = await compute_client.post( - app.url_path_for("compute:create_ethernet_switch", project_id=compute_project.id), - json=params - ) - assert mock.called - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "Ethernet Switch 1" + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "Ethernet Switch" assert response.json()["project_id"] == compute_project.id + assert response.json()["status"] == "started" -async def test_ethernet_switch_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, ethernet_switch: dict) -> None: + async def test_ethernet_switch_duplicate( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ethernet_switch: dict + ) -> None: - response = await compute_client.get( - app.url_path_for( - "compute:get_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"] - ) - ) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "Ethernet Switch" - assert response.json()["project_id"] == compute_project.id - assert response.json()["status"] == "started" + # create destination switch first + params = {"name": "Ethernet Switch 2"} + with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.create") as mock: + response = await compute_client.post( + app.url_path_for( + "compute:create_ethernet_switch", + project_id=compute_project.id), + json=params + ) + assert mock.called + assert response.status_code == status.HTTP_201_CREATED - -async def test_ethernet_switch_duplicate( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - ethernet_switch: dict -) -> None: - - # create destination switch first - params = {"name": "Ethernet Switch 2"} - with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.create") as mock: + params = {"destination_node_id": response.json()["node_id"]} response = await compute_client.post( app.url_path_for( - "compute:create_ethernet_switch", - project_id=compute_project.id), - json=params + "compute:duplicate_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]), json=params ) - assert mock.called assert response.status_code == status.HTTP_201_CREATED - params = {"destination_node_id": response.json()["node_id"]} - response = await compute_client.post( - app.url_path_for( - "compute:duplicate_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]), json=params + + async def test_ethernet_switch_update( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ethernet_switch: dict + ) -> None: + + params = { + "name": "test", + "console_type": "telnet" + } + + response = await compute_client.put( + app.url_path_for( + "compute:update_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]), + json=params + ) + + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + node = compute_project.get_node(ethernet_switch["node_id"]) + node._hypervisor.send.assert_called_with("ethsw rename \"Ethernet Switch\" \"test\"") + + + async def test_ethernet_switch_update_ports( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ethernet_switch: dict + ) -> None: + + port_params = { + "ports_mapping": [ + { + "name": "Ethernet0", + "port_number": 0, + "type": "qinq", + "vlan": 1 + }, + { + "name": "Ethernet1", + "port_number": 1, + "type": "qinq", + "vlan": 2, + "ethertype": "0x88A8" + }, + { + "name": "Ethernet2", + "port_number": 2, + "type": "dot1q", + "vlan": 3, + }, + { + "name": "Ethernet3", + "port_number": 3, + "type": "access", + "vlan": 4, + } + ], + } + + response = await compute_client.put( + app.url_path_for( + "compute:update_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]), + json=port_params + ) + assert response.status_code == status.HTTP_200_OK + + nio_params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + for port_mapping in port_params["ports_mapping"]: + port_number = port_mapping["port_number"] + vlan = port_mapping["vlan"] + port_type = port_mapping["type"] + ethertype = port_mapping.get("ethertype", "") + url = app.url_path_for( + "compute:create_ethernet_switch_nio", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"], + adapter_number="0", + port_number=f"{port_number}" + ) + await compute_client.post(url, json=nio_params) + + node = compute_project.get_node(ethernet_switch["node_id"]) + nio = node.get_nio(port_number) + calls = [ + call.send(f'nio create_udp {nio.name} 4242 127.0.0.1 4343'), + call.send(f'ethsw add_nio "Ethernet Switch" {nio.name}'), + call.send(f'ethsw set_{port_type}_port "Ethernet Switch" {nio.name} {vlan} {ethertype}'.strip()) + ] + node._hypervisor.send.assert_has_calls(calls) + node._hypervisor.send.reset_mock() + + + @pytest.mark.parametrize( + "ports_settings", + ( + ( + { + "name": "Ethernet0", + "port_number": 0, + "type": "dot42q", # invalid port type + "vlan": 1, + } + ), + ( + { + "name": "Ethernet0", + "port_number": 0, + "type": "access", # missing vlan field + } + ), + ( + { + "name": "Ethernet0", + "port_number": 0, + "type": "dot1q", + "vlan": 1, + "ethertype": "0x88A8" # EtherType is only for QinQ + } + ), + ( + { + "name": "Ethernet0", + "port_number": 0, + "type": "qinq", + "vlan": 1, + "ethertype": "0x4242" # not a valid EtherType + } + ), + ( + { + "name": "Ethernet0", + "port_number": 0, + "type": "access", + "vlan": 0, # minimum vlan number is 1 + } + ), + ( + { + "name": "Ethernet0", + "port_number": 0, + "type": "access", + "vlan": 4242, # maximum vlan number is 4094 + } + ), + ) ) - assert response.status_code == status.HTTP_201_CREATED + async def test_ethernet_switch_update_ports_invalid( + self, + app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict, + ports_settings: dict, + ) -> None: + + port_params = { + "ports_mapping": [ports_settings] + } + + response = await compute_client.put( + app.url_path_for( + "compute:update_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]), + json=port_params + ) + assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY -async def test_ethernet_switch_update( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - ethernet_switch: dict -) -> None: + async def test_ethernet_switch_delete( + self, app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: - params = { - "name": "test", - "console_type": "telnet" - } - - response = await compute_client.put( - app.url_path_for( - "compute:update_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]), - json=params - ) - - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - node = compute_project.get_node(ethernet_switch["node_id"]) - node._hypervisor.send.assert_called_with("ethsw rename \"Ethernet Switch\" \"test\"") + response = await compute_client.delete( + app.url_path_for( + "compute:delete_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"] + ) + ) + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_ethernet_switch_update_ports( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - ethernet_switch: dict -) -> None: + async def test_ethernet_switch_start( + self, app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: - port_params = { - "ports_mapping": [ - { - "name": "Ethernet0", - "port_number": 0, - "type": "qinq", - "vlan": 1 - }, - { - "name": "Ethernet1", - "port_number": 1, - "type": "qinq", - "vlan": 2, - "ethertype": "0x88A8" - }, - { - "name": "Ethernet2", - "port_number": 2, - "type": "dot1q", - "vlan": 3, - }, - { - "name": "Ethernet3", - "port_number": 3, - "type": "access", - "vlan": 4, - } - ], - } + response = await compute_client.post( + app.url_path_for( + "compute:start_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]) + ) + assert response.status_code == status.HTTP_204_NO_CONTENT - response = await compute_client.put( - app.url_path_for( - "compute:update_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]), - json=port_params - ) - assert response.status_code == status.HTTP_200_OK - nio_params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } + async def test_ethernet_switch_stop( + self, app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: + + response = await compute_client.post( + app.url_path_for( + "compute:stop_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]) + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_ethernet_switch_suspend( + self, app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: + + response = await compute_client.post( + app.url_path_for( + "compute:suspend_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]) + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_ethernet_switch_reload( + self, app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: + + response = await compute_client.post( + app.url_path_for( + "compute:reload_ethernet_switch", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"]) + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_ethernet_switch_create_udp( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ethernet_switch: dict + ) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } - for port_mapping in port_params["ports_mapping"]: - port_number = port_mapping["port_number"] - vlan = port_mapping["vlan"] - port_type = port_mapping["type"] - ethertype = port_mapping.get("ethertype", "") url = app.url_path_for( "compute:create_ethernet_switch_nio", project_id=ethernet_switch["project_id"], node_id=ethernet_switch["node_id"], adapter_number="0", - port_number=f"{port_number}" + port_number="0" ) - await compute_client.post(url, json=nio_params) + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" node = compute_project.get_node(ethernet_switch["node_id"]) - nio = node.get_nio(port_number) + nio = node.get_nio(0) calls = [ call.send(f'nio create_udp {nio.name} 4242 127.0.0.1 4343'), call.send(f'ethsw add_nio "Ethernet Switch" {nio.name}'), - call.send(f'ethsw set_{port_type}_port "Ethernet Switch" {nio.name} {vlan} {ethertype}'.strip()) + call.send(f'ethsw set_access_port "Ethernet Switch" {nio.name} 1') ] node._hypervisor.send.assert_has_calls(calls) - node._hypervisor.send.reset_mock() -@pytest.mark.parametrize( - "ports_settings", - ( - ( - { - "name": "Ethernet0", - "port_number": 0, - "type": "dot42q", # invalid port type - "vlan": 1, - } - ), - ( - { - "name": "Ethernet0", - "port_number": 0, - "type": "access", # missing vlan field - } - ), - ( - { - "name": "Ethernet0", - "port_number": 0, - "type": "dot1q", - "vlan": 1, - "ethertype": "0x88A8" # EtherType is only for QinQ - } - ), - ( - { - "name": "Ethernet0", - "port_number": 0, - "type": "qinq", - "vlan": 1, - "ethertype": "0x4242" # not a valid EtherType - } - ), - ( - { - "name": "Ethernet0", - "port_number": 0, - "type": "access", - "vlan": 0, # minimum vlan number is 1 - } - ), - ( - { - "name": "Ethernet0", - "port_number": 0, - "type": "access", - "vlan": 4242, # maximum vlan number is 4094 - } - ), - ) -) -async def test_ethernet_switch_update_ports_invalid( - app: FastAPI, - compute_client: AsyncClient, - ethernet_switch: dict, - ports_settings: dict, -) -> None: + async def test_ethernet_switch_delete_nio( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ethernet_switch: dict + ) -> None: - port_params = { - "ports_mapping": [ports_settings] - } + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } - response = await compute_client.put( - app.url_path_for( - "compute:update_ethernet_switch", + url = app.url_path_for( + "compute:create_ethernet_switch_nio", project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]), - json=port_params - ) - assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY - - -async def test_ethernet_switch_delete(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - response = await compute_client.delete( - app.url_path_for( - "compute:delete_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"] + node_id=ethernet_switch["node_id"], + adapter_number="0", + port_number="0" ) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT + await compute_client.post(url, json=params) + node = compute_project.get_node(ethernet_switch["node_id"]) + node._hypervisor.send.reset_mock() + nio = node.get_nio(0) -async def test_ethernet_switch_start(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - response = await compute_client.post( - app.url_path_for( - "compute:start_ethernet_switch", + url = app.url_path_for( + "compute:delete_ethernet_switch_nio", project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_ethernet_switch_stop(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - response = await compute_client.post( - app.url_path_for( - "compute:stop_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_ethernet_switch_suspend(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - response = await compute_client.post( - app.url_path_for( - "compute:suspend_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_ethernet_switch_reload(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - response = await compute_client.post( - app.url_path_for( - "compute:reload_ethernet_switch", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"]) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_ethernet_switch_create_udp( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - ethernet_switch: dict -) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for( - "compute:create_ethernet_switch_nio", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"], - adapter_number="0", - port_number="0" - ) - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - node = compute_project.get_node(ethernet_switch["node_id"]) - nio = node.get_nio(0) - calls = [ - call.send(f'nio create_udp {nio.name} 4242 127.0.0.1 4343'), - call.send(f'ethsw add_nio "Ethernet Switch" {nio.name}'), - call.send(f'ethsw set_access_port "Ethernet Switch" {nio.name} 1') - ] - node._hypervisor.send.assert_has_calls(calls) - - -async def test_ethernet_switch_delete_nio( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - ethernet_switch: dict -) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for( - "compute:create_ethernet_switch_nio", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"], - adapter_number="0", - port_number="0" - ) - await compute_client.post(url, json=params) - - node = compute_project.get_node(ethernet_switch["node_id"]) - node._hypervisor.send.reset_mock() - nio = node.get_nio(0) - - url = app.url_path_for( - "compute:delete_ethernet_switch_nio", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"], - adapter_number="0", - port_number="0" - ) - response = await compute_client.delete(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - - calls = [ - call(f'ethsw remove_nio "Ethernet Switch" {nio.name}'), - call(f'nio delete {nio.name}') - ] - node._hypervisor.send.assert_has_calls(calls) - - -async def test_ethernet_switch_start_capture(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - url = app.url_path_for("compute:start_ethernet_switch_capture", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.start_capture") as mock: - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK - assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] - - -async def test_ethernet_switch_stop_capture(app: FastAPI, compute_client: AsyncClient, ethernet_switch: dict) -> None: - - url = app.url_path_for("compute:stop_ethernet_switch_capture", - project_id=ethernet_switch["project_id"], - node_id=ethernet_switch["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.stop_capture") as mock: - response = await compute_client.post(url) + node_id=ethernet_switch["node_id"], + adapter_number="0", + port_number="0" + ) + response = await compute_client.delete(url) assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called + + calls = [ + call(f'ethsw remove_nio "Ethernet Switch" {nio.name}'), + call(f'nio delete {nio.name}') + ] + node._hypervisor.send.assert_has_calls(calls) + + + async def test_ethernet_switch_start_capture( + self, + app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for("compute:start_ethernet_switch_capture", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + async def test_ethernet_switch_stop_capture( + self, + app: FastAPI, + compute_client: AsyncClient, + ethernet_switch: dict + ) -> None: + + url = app.url_path_for("compute:stop_ethernet_switch_capture", + project_id=ethernet_switch["project_id"], + node_id=ethernet_switch["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch("gns3server.compute.dynamips.nodes.ethernet_switch.EthernetSwitch.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called diff --git a/tests/api/routes/compute/test_iou_nodes.py b/tests/api/routes/compute/test_iou_nodes.py index d894ac30..8343ba33 100644 --- a/tests/api/routes/compute/test_iou_nodes.py +++ b/tests/api/routes/compute/test_iou_nodes.py @@ -28,452 +28,502 @@ from unittest.mock import patch from gns3server.compute.project import Project -pytestmark = [pytest.mark.asyncio] +pytestmark = pytest.mark.asyncio -@pytest.fixture -def fake_iou_bin(images_dir) -> str: - """Create a fake IOU image on disk""" +class TestIOUNodesRoutes: - path = os.path.join(images_dir, "IOU", "iou.bin") - with open(path, "w+") as f: - f.write('\x7fELF\x01\x01\x01') - os.chmod(path, stat.S_IREAD | stat.S_IEXEC) - return path + @pytest.fixture + def fake_iou_bin(self, images_dir) -> str: + """Create a fake IOU image on disk""" + + path = os.path.join(images_dir, "IOU", "iou.bin") + with open(path, "w+") as f: + f.write('\x7fELF\x01\x01\x01') + os.chmod(path, stat.S_IREAD | stat.S_IEXEC) + return path -@pytest.fixture -def base_params(tmpdir, fake_iou_bin) -> dict: - """Return standard parameters""" + @pytest.fixture + def base_params(self, tmpdir, fake_iou_bin) -> dict: + """Return standard parameters""" - return {"application_id": 42, "name": "IOU-TEST-1", "path": "iou.bin"} + return {"application_id": 42, "name": "IOU-TEST-1", "path": "iou.bin"} -@pytest_asyncio.fixture -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project, base_params: dict) -> dict: + @pytest_asyncio.fixture + async def vm( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict + ) -> dict: - response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=base_params) - assert response.status_code == status.HTTP_201_CREATED - return response.json() + response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + return response.json() -def startup_config_file(compute_project: Project, vm: dict) -> str: + def startup_config_file(self, compute_project: Project, vm: dict) -> str: - directory = os.path.join(compute_project.path, "project-files", "iou", vm["node_id"]) - os.makedirs(directory, exist_ok=True) - return os.path.join(directory, "startup-config.cfg") + directory = os.path.join(compute_project.path, "project-files", "iou", vm["node_id"]) + os.makedirs(directory, exist_ok=True) + return os.path.join(directory, "startup-config.cfg") -async def test_iou_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project, base_params: dict) -> None: + async def test_iou_create( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict + ) -> None: - response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=base_params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "IOU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["serial_adapters"] == 2 - assert response.json()["ethernet_adapters"] == 2 - assert response.json()["ram"] == 256 - assert response.json()["nvram"] == 128 - assert response.json()["l1_keepalives"] is False + response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "IOU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["serial_adapters"] == 2 + assert response.json()["ethernet_adapters"] == 2 + assert response.json()["ram"] == 256 + assert response.json()["nvram"] == 128 + assert response.json()["l1_keepalives"] is False -async def test_iou_create_with_params(app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict) -> None: + async def test_iou_create_with_params( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict + ) -> None: - params = base_params - params["ram"] = 1024 - params["nvram"] = 512 - params["serial_adapters"] = 4 - params["ethernet_adapters"] = 0 - params["l1_keepalives"] = True - params["startup_config_content"] = "hostname test" - params["use_default_iou_values"] = False + params = base_params + params["ram"] = 1024 + params["nvram"] = 512 + params["serial_adapters"] = 4 + params["ethernet_adapters"] = 0 + params["l1_keepalives"] = True + params["startup_config_content"] = "hostname test" + params["use_default_iou_values"] = False - response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "IOU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["serial_adapters"] == 4 - assert response.json()["ethernet_adapters"] == 0 - assert response.json()["ram"] == 1024 - assert response.json()["nvram"] == 512 - assert response.json()["l1_keepalives"] is True - assert response.json()["use_default_iou_values"] is False + response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "IOU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["serial_adapters"] == 4 + assert response.json()["ethernet_adapters"] == 0 + assert response.json()["ram"] == 1024 + assert response.json()["nvram"] == 512 + assert response.json()["l1_keepalives"] is True + assert response.json()["use_default_iou_values"] is False - with open(startup_config_file(compute_project, response.json())) as f: - assert f.read() == "hostname test" + with open(self.startup_config_file(compute_project, response.json())) as f: + assert f.read() == "hostname test" -@pytest.mark.parametrize( - "name, status_code", - ( - ("valid-name", status.HTTP_201_CREATED), - ("42name", status.HTTP_409_CONFLICT), - ("name42", status.HTTP_201_CREATED), - ("-name", status.HTTP_409_CONFLICT), - ("name%-test", status.HTTP_409_CONFLICT), - ("x" * 63, status.HTTP_201_CREATED), - ("x" * 64, status.HTTP_409_CONFLICT), - ), -) -async def test_iou_create_with_invalid_name( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict, - name: str, - status_code: int -) -> None: - - base_params["name"] = name - response = await compute_client.post( - app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=base_params + @pytest.mark.parametrize( + "name, status_code", + ( + ("valid-name", status.HTTP_201_CREATED), + ("42name", status.HTTP_409_CONFLICT), + ("name42", status.HTTP_201_CREATED), + ("-name", status.HTTP_409_CONFLICT), + ("name%-test", status.HTTP_409_CONFLICT), + ("x" * 63, status.HTTP_201_CREATED), + ("x" * 64, status.HTTP_409_CONFLICT), + ), ) - assert response.status_code == status_code + async def test_iou_create_with_invalid_name( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict, + name: str, + status_code: int + ) -> None: + + base_params["name"] = name + response = await compute_client.post( + app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=base_params + ) + assert response.status_code == status_code -async def test_iou_create_startup_config_already_exist( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict) -> None: - """We don't erase a startup-config if already exist at project creation""" + async def test_iou_create_startup_config_already_exist( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict) -> None: + """We don't erase a startup-config if already exist at project creation""" - node_id = str(uuid.uuid4()) - startup_config_file_path = startup_config_file(compute_project, {'node_id': node_id}) - with open(startup_config_file_path, 'w+') as f: - f.write("echo hello") + node_id = str(uuid.uuid4()) + startup_config_file_path = self.startup_config_file(compute_project, {'node_id': node_id}) + with open(startup_config_file_path, 'w+') as f: + f.write("echo hello") - params = base_params - params["node_id"] = node_id - params["startup_config_content"] = "hostname test" + params = base_params + params["node_id"] = node_id + params["startup_config_content"] = "hostname test" - response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED + response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED - with open(startup_config_file(compute_project, response.json())) as f: - assert f.read() == "echo hello" + with open(self.startup_config_file(compute_project, response.json())) as f: + assert f.read() == "echo hello" -async def test_iou_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: + async def test_iou_get( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: - response = await compute_client.get(app.url_path_for("compute:get_iou_node", project_id=vm["project_id"], node_id=vm["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "IOU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["serial_adapters"] == 2 - assert response.json()["ethernet_adapters"] == 2 - assert response.json()["ram"] == 256 - assert response.json()["nvram"] == 128 - assert response.json()["l1_keepalives"] is False + response = await compute_client.get(app.url_path_for("compute:get_iou_node", project_id=vm["project_id"], node_id=vm["node_id"])) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "IOU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["serial_adapters"] == 2 + assert response.json()["ethernet_adapters"] == 2 + assert response.json()["ram"] == 256 + assert response.json()["nvram"] == 128 + assert response.json()["l1_keepalives"] is False -async def test_iou_start(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_start(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.start", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:start_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json={}) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT + with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.start", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:start_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json={}) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_iou_start_with_iourc(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_start_with_iourc(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - params = {"iourc_content": "test"} - with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.start", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:start_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT + params = {"iourc_content": "test"} + with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.start", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:start_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_iou_stop(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_stop(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.stop", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:stop_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT + with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.stop", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:stop_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_iou_reload(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_reload(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.reload", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:reload_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT + with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.reload", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:reload_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_iou_delete(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_delete(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - with asyncio_patch("gns3server.compute.iou.IOU.delete_node", return_value=True) as mock: - response = await compute_client.delete(app.url_path_for("compute:delete_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT + with asyncio_patch("gns3server.compute.iou.IOU.delete_node", return_value=True) as mock: + response = await compute_client.delete(app.url_path_for("compute:delete_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT -async def test_iou_update(app: FastAPI, compute_client: AsyncClient, vm: dict, free_console_port: int) -> None: + async def test_iou_update( + self, app: FastAPI, + compute_client: AsyncClient, + vm: dict, + free_console_port: int + ) -> None: - params = { - "name": "test", - "console": free_console_port, - "ram": 512, - "nvram": 2048, - "ethernet_adapters": 4, - "serial_adapters": 0, - "l1_keepalives": True, - "use_default_iou_values": True, - } + params = { + "name": "test", + "console": free_console_port, + "ram": 512, + "nvram": 2048, + "ethernet_adapters": 4, + "serial_adapters": 0, + "l1_keepalives": True, + "use_default_iou_values": True, + } - response = await compute_client.put(app.url_path_for("compute:update_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - assert response.json()["console"] == free_console_port - assert response.json()["ethernet_adapters"] == 4 - assert response.json()["serial_adapters"] == 0 - assert response.json()["ram"] == 512 - assert response.json()["nvram"] == 2048 - assert response.json()["l1_keepalives"] is True - assert response.json()["use_default_iou_values"] is True + response = await compute_client.put(app.url_path_for("compute:update_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + assert response.json()["console"] == free_console_port + assert response.json()["ethernet_adapters"] == 4 + assert response.json()["serial_adapters"] == 0 + assert response.json()["ram"] == 512 + assert response.json()["nvram"] == 2048 + assert response.json()["l1_keepalives"] is True + assert response.json()["use_default_iou_values"] is True -async def test_iou_nio_create_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - params = {"type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1"} + params = {"type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1"} - url = app.url_path_for("compute:create_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_iou_nio_update_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = {"type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1"} - - url = app.url_path_for("compute:create_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") - - await compute_client.post(url, json=params) - params["filters"] = {} - - url = app.url_path_for("compute:update_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") - response = await compute_client.put(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_iou_nio_create_ethernet(app: FastAPI, compute_client: AsyncClient, vm: dict, ethernet_device: str) -> None: - - params = { - "type": "nio_ethernet", - "ethernet_device": ethernet_device - } - - url = app.url_path_for("compute:create_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") - - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_ethernet" - assert response.json()["ethernet_device"] == ethernet_device - - -async def test_iou_nio_create_ethernet_different_port(app: FastAPI, - compute_client: AsyncClient, - vm: dict, - ethernet_device: str) -> None: - - params = { - "type": "nio_ethernet", - "ethernet_device": ethernet_device - } - - url = app.url_path_for("compute:create_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="3") - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_ethernet" - assert response.json()["ethernet_device"] == ethernet_device - - -async def test_iou_nio_create_tap(app: FastAPI, compute_client: AsyncClient, vm: dict, ethernet_device: str) -> None: - - params = { - "type": "nio_tap", - "tap_device": ethernet_device - } - - url = app.url_path_for("compute:create_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") - with patch("gns3server.compute.base_manager.BaseManager.has_privileged_access", return_value=True): + url = app.url_path_for("compute:create_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") response = await compute_client.post(url, json=params) assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_tap" + assert response.json()["type"] == "nio_udp" -async def test_iou_delete_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_nio_update_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } + params = {"type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1"} - url = app.url_path_for("compute:create_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") + url = app.url_path_for("compute:create_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") - await compute_client.post(url, json=params) + await compute_client.post(url, json=params) + params["filters"] = {} - url = app.url_path_for("compute:delete_iou_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="1", - port_number="0") - - response = await compute_client.delete(url) - assert response.status_code == status.HTTP_204_NO_CONTENT + url = app.url_path_for("compute:update_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") + response = await compute_client.put(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" -async def test_iou_start_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_nio_create_ethernet( + self, + app: FastAPI, + compute_client: AsyncClient, + vm: dict, + ethernet_device: str + ) -> None: - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } + params = { + "type": "nio_ethernet", + "ethernet_device": ethernet_device + } - url = app.url_path_for("compute:start_iou_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") + url = app.url_path_for("compute:create_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") - with patch("gns3server.compute.iou.iou_vm.IOUVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_ethernet" + assert response.json()["ethernet_device"] == ethernet_device + + + async def test_iou_nio_create_ethernet_different_port( + self, + app: FastAPI, + compute_client: AsyncClient, + vm: dict, + ethernet_device: str + ) -> None: + + params = { + "type": "nio_ethernet", + "ethernet_device": ethernet_device + } + + url = app.url_path_for("compute:create_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="3") + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_ethernet" + assert response.json()["ethernet_device"] == ethernet_device + + + async def test_iou_nio_create_tap( + self, + app: FastAPI, + compute_client: AsyncClient, + vm: dict, + ethernet_device: str + ) -> None: + + params = { + "type": "nio_tap", + "tap_device": ethernet_device + } + + url = app.url_path_for("compute:create_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") + with patch("gns3server.compute.base_manager.BaseManager.has_privileged_access", return_value=True): response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK - assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_tap" -async def test_iou_stop_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_iou_delete_nio( + self, + app: FastAPI, + compute_client: AsyncClient, + vm: dict + ) -> None: - url = app.url_path_for("compute:stop_iou_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } - with patch("gns3server.compute.iou.iou_vm.IOUVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.stop_capture") as mock: - response = await compute_client.post(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called + url = app.url_path_for("compute:create_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") + await compute_client.post(url, json=params) -# @pytest.mark.asyncio -# async def test_iou_pcap(compute_api, vm, compute_project): -# -# with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.get_nio"): -# with asyncio_patch("gns3server.compute.iou.IOU.stream_pcap_file"): -# response = await compute_client.get("/projects/{project_id}/iou/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) -# assert response.status_code == status.HTTP_200_OK + url = app.url_path_for("compute:delete_iou_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="1", + port_number="0") - -async def test_images(app: FastAPI, compute_client: AsyncClient, fake_iou_bin: str) -> None: - - response = await compute_client.get(app.url_path_for("compute:get_iou_images")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == [{"filename": "iou.bin", "path": "iou.bin", "filesize": 7, "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c"}] - - -async def test_upload_image(app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: - - with patch("gns3server.compute.IOU.get_images_directory", return_value=str(tmpdir)): - response = await compute_client.post(app.url_path_for("compute:upload_iou_image", filename="test2"), content=b"TEST") + response = await compute_client.delete(url) assert response.status_code == status.HTTP_204_NO_CONTENT - with open(str(tmpdir / "test2")) as f: - assert f.read() == "TEST" - with open(str(tmpdir / "test2.md5sum")) as f: - checksum = f.read() - assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" + async def test_iou_start_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for("compute:start_iou_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.iou.iou_vm.IOUVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] -async def test_upload_image_forbidden_location(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_iou_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - file_path = "%2e%2e/hello" - response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename=file_path), content=b"TEST") - assert response.status_code == status.HTTP_403_FORBIDDEN + url = app.url_path_for("compute:stop_iou_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.iou.iou_vm.IOUVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called -async def test_download_image(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: - - response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test3"), content=b"TEST") - assert response.status_code == status.HTTP_204_NO_CONTENT - - response = await compute_client.get(app.url_path_for("compute:download_dynamips_image", filename="test3")) - assert response.status_code == status.HTTP_200_OK + # @pytest.mark.asyncio + # async def test_iou_pcap(compute_api, vm, compute_project): + # + # with asyncio_patch("gns3server.compute.iou.iou_vm.IOUVM.get_nio"): + # with asyncio_patch("gns3server.compute.iou.IOU.stream_pcap_file"): + # response = await compute_client.get("/projects/{project_id}/iou/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) + # assert response.status_code == status.HTTP_200_OK -async def test_download_image_forbidden(app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: + async def test_images(self, app: FastAPI, compute_client: AsyncClient, fake_iou_bin: str) -> None: - file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" - response = await compute_client.get(app.url_path_for("compute:download_iou_image", filename=file_path)) - assert response.status_code == status.HTTP_403_FORBIDDEN + response = await compute_client.get(app.url_path_for("compute:get_iou_images")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == [{"filename": "iou.bin", "path": "iou.bin", "filesize": 7, "md5sum": "e573e8f5c93c6c00783f20c7a170aa6c"}] -async def test_iou_duplicate(app: FastAPI, compute_client: AsyncClient, vm: dict, base_params: dict) -> None: + async def test_upload_image(self, app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: - # create destination node first - response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=vm["project_id"]), json=base_params) - assert response.status_code == status.HTTP_201_CREATED + with patch("gns3server.compute.IOU.get_images_directory", return_value=str(tmpdir)): + response = await compute_client.post(app.url_path_for("compute:upload_iou_image", filename="test2"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT - params = {"destination_node_id": response.json()["node_id"]} + with open(str(tmpdir / "test2")) as f: + assert f.read() == "TEST" - response = await compute_client.post(app.url_path_for("compute:duplicate_iou_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_201_CREATED + with open(str(tmpdir / "test2.md5sum")) as f: + checksum = f.read() + assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" + + + async def test_upload_image_forbidden_location(self, app: FastAPI, compute_client: AsyncClient) -> None: + + file_path = "%2e%2e/hello" + response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename=file_path), content=b"TEST") + assert response.status_code == status.HTTP_403_FORBIDDEN + + + async def test_download_image(self, app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: + + response = await compute_client.post(app.url_path_for("compute:upload_dynamips_image", filename="test3"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT + + response = await compute_client.get(app.url_path_for("compute:download_dynamips_image", filename="test3")) + assert response.status_code == status.HTTP_200_OK + + + async def test_download_image_forbidden(self, app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: + + file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" + response = await compute_client.get(app.url_path_for("compute:download_iou_image", filename=file_path)) + assert response.status_code == status.HTTP_403_FORBIDDEN + + + async def test_iou_duplicate(self, app: FastAPI, compute_client: AsyncClient, vm: dict, base_params: dict) -> None: + + # create destination node first + response = await compute_client.post(app.url_path_for("compute:create_iou_node", project_id=vm["project_id"]), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + + params = {"destination_node_id": response.json()["node_id"]} + + response = await compute_client.post(app.url_path_for("compute:duplicate_iou_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_201_CREATED diff --git a/tests/api/routes/compute/test_nat_nodes.py b/tests/api/routes/compute/test_nat_nodes.py index 0f8b0d69..636a538a 100644 --- a/tests/api/routes/compute/test_nat_nodes.py +++ b/tests/api/routes/compute/test_nat_nodes.py @@ -27,167 +27,188 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture(scope="function") -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project, ubridge_path: str, on_gns3vm) -> dict: +class TestNATNodesRoutes: - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat._start_ubridge"): - response = await compute_client.post(app.url_path_for("compute:create_nat_node", project_id=compute_project.id), - json={"name": "Nat 1"}) - assert response.status_code == status.HTTP_201_CREATED - return response.json() + @pytest_asyncio.fixture + async def vm( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + ubridge_path: str, + on_gns3vm + ) -> dict: + + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat._start_ubridge"): + response = await compute_client.post(app.url_path_for("compute:create_nat_node", project_id=compute_project.id), + json={"name": "Nat 1"}) + assert response.status_code == status.HTTP_201_CREATED + return response.json() -async def test_nat_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project, on_gns3vm) -> None: + async def test_nat_create( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + on_gns3vm + ) -> None: - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat._start_ubridge"): - response = await compute_client.post(app.url_path_for("compute:create_nat_node", project_id=compute_project.id), - json={"name": "Nat 1"}) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "Nat 1" - assert response.json()["project_id"] == compute_project.id + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat._start_ubridge"): + response = await compute_client.post(app.url_path_for("compute:create_nat_node", project_id=compute_project.id), + json={"name": "Nat 1"}) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "Nat 1" + assert response.json()["project_id"] == compute_project.id -async def test_nat_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: + async def test_nat_get( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: - response = await compute_client.get(app.url_path_for("compute:get_nat_node", project_id=vm["project_id"], node_id=vm["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "Nat 1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["status"] == "started" - - -async def test_nat_nio_create_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_nat_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.add_nio"): - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_nat_nio_update_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_nat_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - await compute_client.post(url, json=params) - params["filters"] = {} - - url = app.url_path_for("compute:update_nat_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - response = await compute_client.put(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_nat_delete_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_nat_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.add_nio"): - await compute_client.post(url, json=params) - - url = app.url_path_for("compute:delete_nat_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.remove_nio") as mock: - response = await compute_client.delete(url) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_nat_delete(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - response = await compute_client.delete(app.url_path_for("compute:delete_nat_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_nat_update(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - response = await compute_client.put(app.url_path_for("compute:update_nat_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json={"name": "test"}) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - - -async def test_nat_start_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - url = app.url_path_for("compute:start_nat_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.start_capture") as mock: - response = await compute_client.post(url, json=params) + response = await compute_client.get(app.url_path_for("compute:get_nat_node", project_id=vm["project_id"], node_id=vm["node_id"])) assert response.status_code == status.HTTP_200_OK - assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] + assert response.json()["name"] == "Nat 1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["status"] == "started" -async def test_nat_stop_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + async def test_nat_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - url = app.url_path_for("compute:stop_nat_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } - with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.stop_capture") as mock: - response = await compute_client.post(url) + url = app.url_path_for("compute:create_nat_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.add_nio"): + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_nat_nio_update_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + url = app.url_path_for("compute:create_nat_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + await compute_client.post(url, json=params) + params["filters"] = {} + + url = app.url_path_for("compute:update_nat_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.put(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_nat_delete_nio(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + url = app.url_path_for("compute:create_nat_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.add_nio"): + await compute_client.post(url, json=params) + + url = app.url_path_for("compute:delete_nat_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.remove_nio") as mock: + response = await compute_client.delete(url) + assert mock.called assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called -# @pytest.mark.asyncio -# async def test_nat_pcap(compute_api, vm, compute_project): -# -# with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.get_nio"): -# with asyncio_patch("gns3server.compute.builtin.Builtin.stream_pcap_file"): -# response = await compute_client.get("/projects/{project_id}/nat/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) -# assert response.status_code == status.HTTP_200_OK + async def test_nat_delete(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + response = await compute_client.delete(app.url_path_for("compute:delete_nat_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_nat_update(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + response = await compute_client.put(app.url_path_for("compute:update_nat_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json={"name": "test"}) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + + + async def test_nat_start_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for("compute:start_nat_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + async def test_nat_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:stop_nat_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + # @pytest.mark.asyncio + # async def test_nat_pcap(self, compute_api, vm, compute_project): + # + # with asyncio_patch("gns3server.compute.builtin.nodes.nat.Nat.get_nio"): + # with asyncio_patch("gns3server.compute.builtin.Builtin.stream_pcap_file"): + # response = await compute_client.get("/projects/{project_id}/nat/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) + # assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/compute/test_projects.py b/tests/api/routes/compute/test_projects.py index 669db760..27474044 100644 --- a/tests/api/routes/compute/test_projects.py +++ b/tests/api/routes/compute/test_projects.py @@ -30,173 +30,197 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest.fixture -def base_params(tmpdir) -> dict: - """Return standard parameters""" +class TestComputeProjectRoutes: - params = { - "name": "test", - "project_id": str(uuid.uuid4()) - } - return params + @pytest.fixture + def base_params(self, tmpdir) -> dict: + """Return standard parameters""" + + params = { + "name": "test", + "project_id": str(uuid.uuid4()) + } + return params -async def test_create_project_without_dir(app: FastAPI, compute_client: AsyncClient, base_params: dict) -> None: + async def test_create_project_without_dir( + self, + app: FastAPI, + compute_client: AsyncClient, + base_params: dict + ) -> None: - response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=base_params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["project_id"] == base_params["project_id"] - assert response.json()["name"] == base_params["name"] + response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["project_id"] == base_params["project_id"] + assert response.json()["name"] == base_params["name"] -async def test_show_project(app: FastAPI, compute_client: AsyncClient, base_params: dict) -> None: + async def test_show_project( + self, + app: FastAPI, + compute_client: AsyncClient, + base_params: dict + ) -> None: - response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=base_params) - assert response.status_code == status.HTTP_201_CREATED - response = await compute_client.get(app.url_path_for("compute:get_compute_project", project_id=base_params["project_id"])) + response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + response = await compute_client.get(app.url_path_for("compute:get_compute_project", project_id=base_params["project_id"])) - #print(response.json().keys()) - #assert len(response.json().keys()) == 3 - assert response.json()["project_id"] == base_params["project_id"] - assert response.json()["name"] == base_params["name"] - assert response.json()["variables"] is None + #print(response.json().keys()) + #assert len(response.json().keys()) == 3 + assert response.json()["project_id"] == base_params["project_id"] + assert response.json()["name"] == base_params["name"] + assert response.json()["variables"] is None -async def test_show_project_invalid_uuid(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_show_project_invalid_uuid(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.get(app.url_path_for("compute:get_compute_project", - project_id="50010203-0405-0607-0809-0a0b0c0d0e42")) - assert response.status_code == status.HTTP_404_NOT_FOUND + response = await compute_client.get(app.url_path_for("compute:get_compute_project", + project_id="50010203-0405-0607-0809-0a0b0c0d0e42")) + assert response.status_code == status.HTTP_404_NOT_FOUND -async def test_list_projects(app: FastAPI, compute_client: AsyncClient) -> dict: + async def test_list_projects(self, app: FastAPI, compute_client: AsyncClient) -> dict: - ProjectManager.instance()._projects = {} + ProjectManager.instance()._projects = {} - params = {"name": "test", "project_id": "51010203-0405-0607-0809-0a0b0c0d0e0f"} - response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED - params = {"name": "test", "project_id": "52010203-0405-0607-0809-0a0b0c0d0e0b"} - response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED + params = {"name": "test", "project_id": "51010203-0405-0607-0809-0a0b0c0d0e0f"} + response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=params) + assert response.status_code == status.HTTP_201_CREATED + params = {"name": "test", "project_id": "52010203-0405-0607-0809-0a0b0c0d0e0b"} + response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=params) + assert response.status_code == status.HTTP_201_CREATED - response = await compute_client.get(app.url_path_for("compute:get_compute_projects")) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) == 2 - assert "51010203-0405-0607-0809-0a0b0c0d0e0f" in [p["project_id"] for p in response.json()] + response = await compute_client.get(app.url_path_for("compute:get_compute_projects")) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) == 2 + assert "51010203-0405-0607-0809-0a0b0c0d0e0f" in [p["project_id"] for p in response.json()] -async def test_delete_project(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + async def test_delete_project(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - with asyncio_patch("gns3server.compute.project.Project.delete", return_value=True) as mock: - response = await compute_client.delete(app.url_path_for("compute:delete_compute_project", project_id=compute_project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called + with asyncio_patch("gns3server.compute.project.Project.delete", return_value=True) as mock: + response = await compute_client.delete(app.url_path_for("compute:delete_compute_project", project_id=compute_project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called -async def test_update_project(app: FastAPI, compute_client: AsyncClient, base_params: dict) -> None: + async def test_update_project(self, app: FastAPI, compute_client: AsyncClient, base_params: dict) -> None: - response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=base_params) - assert response.status_code == status.HTTP_201_CREATED + response = await compute_client.post(app.url_path_for("compute:create_compute_project"), json=base_params) + assert response.status_code == status.HTTP_201_CREATED - params = {"variables": [{"name": "TEST1", "value": "VAL1"}]} - response = await compute_client.put(app.url_path_for("compute:update_compute_project", project_id=base_params["project_id"]), - json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["variables"] == [{"name": "TEST1", "value": "VAL1"}] + params = {"variables": [{"name": "TEST1", "value": "VAL1"}]} + response = await compute_client.put(app.url_path_for("compute:update_compute_project", project_id=base_params["project_id"]), + json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["variables"] == [{"name": "TEST1", "value": "VAL1"}] -async def test_delete_project_invalid_uuid(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_delete_project_invalid_uuid(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.delete(app.url_path_for("compute:delete_compute_project", project_id=str(uuid.uuid4()))) - assert response.status_code == status.HTTP_404_NOT_FOUND + response = await compute_client.delete(app.url_path_for("compute:delete_compute_project", project_id=str(uuid.uuid4()))) + assert response.status_code == status.HTTP_404_NOT_FOUND -async def test_close_project(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + async def test_close_project(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - with asyncio_patch("gns3server.compute.project.Project.close", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:close_compute_project", project_id=compute_project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called + with asyncio_patch("gns3server.compute.project.Project.close", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:close_compute_project", project_id=compute_project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called -# @pytest.mark.asyncio -# async def test_close_project_two_client_connected(compute_api, compute_project): -# -# ProjectHandler._notifications_listening = {compute_project.id: 2} -# with asyncio_patch("gns3server.compute.project.Project.close", return_value=True) as mock: -# response = await compute_client.post("/projects/{project_id}/close".format(project_id=compute_project.id)) -# assert response.status_code == status.HTTP_204_NO_CONTENT -# assert not mock.called + # @pytest.mark.asyncio + # async def test_close_project_two_client_connected(compute_api, compute_project): + # + # ProjectHandler._notifications_listening = {compute_project.id: 2} + # with asyncio_patch("gns3server.compute.project.Project.close", return_value=True) as mock: + # response = await compute_client.post("/projects/{project_id}/close".format(project_id=compute_project.id)) + # assert response.status_code == status.HTTP_204_NO_CONTENT + # assert not mock.called -async def test_close_project_invalid_uuid(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_close_project_invalid_uuid(self, app: FastAPI, compute_client: AsyncClient) -> None: - response = await compute_client.post(app.url_path_for("compute:close_compute_project", project_id=str(uuid.uuid4()))) - assert response.status_code == status.HTTP_404_NOT_FOUND + response = await compute_client.post(app.url_path_for("compute:close_compute_project", project_id=str(uuid.uuid4()))) + assert response.status_code == status.HTTP_404_NOT_FOUND -async def test_get_file(app: FastAPI, compute_client: AsyncClient) -> None: + async def test_get_file(self, app: FastAPI, compute_client: AsyncClient) -> None: - project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") + project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") - with open(os.path.join(project.path, "hello"), "w+") as f: - f.write("world") + with open(os.path.join(project.path, "hello"), "w+") as f: + f.write("world") - response = await compute_client.get(app.url_path_for("compute:get_compute_project_file", project_id=project.id, file_path="hello")) - assert response.status_code == status.HTTP_200_OK - assert response.content == b"world" + response = await compute_client.get(app.url_path_for("compute:get_compute_project_file", project_id=project.id, file_path="hello")) + assert response.status_code == status.HTTP_200_OK + assert response.content == b"world" - response = await compute_client.get(app.url_path_for("compute:get_compute_project_file", project_id=project.id, file_path="false")) - assert response.status_code == status.HTTP_404_NOT_FOUND + response = await compute_client.get(app.url_path_for("compute:get_compute_project_file", project_id=project.id, file_path="false")) + assert response.status_code == status.HTTP_404_NOT_FOUND - response = await compute_client.get(app.url_path_for("compute:get_compute_project_file", - project_id=project.id, - file_path="../hello")) - assert response.status_code == status.HTTP_404_NOT_FOUND + response = await compute_client.get(app.url_path_for("compute:get_compute_project_file", + project_id=project.id, + file_path="../hello")) + assert response.status_code == status.HTTP_404_NOT_FOUND -async def test_get_file_forbidden_location(app: FastAPI, compute_client: AsyncClient, config, tmpdir) -> None: + async def test_get_file_forbidden_location( + self, + app: FastAPI, + compute_client: AsyncClient, + config, + tmpdir + ) -> None: - config.settings.Server.projects_path = str(tmpdir) - project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") - file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" - response = await compute_client.get( - app.url_path_for( - "compute:get_compute_project_file", - project_id=project.id, - file_path=file_path + config.settings.Server.projects_path = str(tmpdir) + project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") + file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" + response = await compute_client.get( + app.url_path_for( + "compute:get_compute_project_file", + project_id=project.id, + file_path=file_path + ) ) - ) - assert response.status_code == status.HTTP_403_FORBIDDEN + assert response.status_code == status.HTTP_403_FORBIDDEN -async def test_write_file(app: FastAPI, compute_client: AsyncClient, config, tmpdir) -> None: + async def test_write_file(self, app: FastAPI, compute_client: AsyncClient, config, tmpdir) -> None: - config.settings.Server.projects_path = str(tmpdir) - project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") + config.settings.Server.projects_path = str(tmpdir) + project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") - response = await compute_client.post(app.url_path_for("compute:write_compute_project_file", - project_id=project.id, - file_path="hello"), content=b"world") - assert response.status_code == status.HTTP_204_NO_CONTENT + response = await compute_client.post(app.url_path_for("compute:write_compute_project_file", + project_id=project.id, + file_path="hello"), content=b"world") + assert response.status_code == status.HTTP_204_NO_CONTENT - with open(os.path.join(project.path, "hello")) as f: - assert f.read() == "world" + with open(os.path.join(project.path, "hello")) as f: + assert f.read() == "world" - response = await compute_client.post(app.url_path_for("compute:write_compute_project_file", - project_id=project.id, - file_path="../hello")) - assert response.status_code == status.HTTP_404_NOT_FOUND + response = await compute_client.post(app.url_path_for("compute:write_compute_project_file", + project_id=project.id, + file_path="../hello")) + assert response.status_code == status.HTTP_404_NOT_FOUND -async def test_write_file_forbidden_location(app: FastAPI, compute_client: AsyncClient, config, tmpdir) -> None: + async def test_write_file_forbidden_location( + self, + app: FastAPI, + compute_client: AsyncClient, + config, + tmpdir + ) -> None: - config.settings.Server.projects_path = str(tmpdir) - project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") + config.settings.Server.projects_path = str(tmpdir) + project = ProjectManager.instance().create_project(project_id="01010203-0405-0607-0809-0a0b0c0d0e0b") - file_path = "%2e%2e/hello" - response = await compute_client.post(app.url_path_for("compute:write_compute_project_file", - project_id=project.id, - file_path=file_path), content=b"world") - assert response.status_code == status.HTTP_403_FORBIDDEN + file_path = "%2e%2e/hello" + response = await compute_client.post(app.url_path_for("compute:write_compute_project_file", + project_id=project.id, + file_path=file_path), content=b"world") + assert response.status_code == status.HTTP_403_FORBIDDEN diff --git a/tests/api/routes/compute/test_qemu_nodes.py b/tests/api/routes/compute/test_qemu_nodes.py index 61144fe2..464b5ddf 100644 --- a/tests/api/routes/compute/test_qemu_nodes.py +++ b/tests/api/routes/compute/test_qemu_nodes.py @@ -31,338 +31,327 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest.fixture -def fake_qemu_bin(monkeypatch, tmpdir) -> str: +class TestQemuNodesRoutes: - monkeypatch.setenv("PATH", str(tmpdir)) - bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64") - with open(bin_path, "w+") as f: - f.write("1") - os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) - return bin_path - - -@pytest.fixture -def fake_qemu_vm(images_dir) -> str: - - img_dir = os.path.join(images_dir, "QEMU") - bin_path = os.path.join(img_dir, "linuxè½½.img") - with open(bin_path, "w+") as f: - f.write("1234567") - os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) - return bin_path - - -@pytest.fixture -def fake_qemu_img_binary(tmpdir): - - bin_path = str(tmpdir / "qemu-img") - with open(bin_path, "w+") as f: - f.write("1") - os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) - return bin_path - - -@pytest.fixture -def base_params(tmpdir, fake_qemu_bin) -> dict: - """Return standard parameters""" - - return {"name": "QEMU-TEST-1", "qemu_path": fake_qemu_bin} - - -@pytest_asyncio.fixture -async def qemu_vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project, base_params: dict) -> None: - - response = await compute_client.post( - app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), - json=base_params - ) - assert response.status_code == status.HTTP_201_CREATED - return response.json() - - -async def test_qemu_create(app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict, - fake_qemu_bin: str) -> None: - - response = await compute_client.post(app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=base_params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "QEMU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["qemu_path"] == fake_qemu_bin - assert response.json()["platform"] == "x86_64" - - -async def test_qemu_create_platform(app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict, - fake_qemu_bin: str): - - base_params["qemu_path"] = None - base_params["platform"] = "x86_64" - response = await compute_client.post(app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=base_params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "QEMU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["qemu_path"] == fake_qemu_bin - assert response.json()["platform"] == "x86_64" - - -@pytest.mark.asyncio -async def test_qemu_create_with_params(app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict, - fake_qemu_vm: str): - - params = base_params - params["ram"] = 1024 - params["hda_disk_image"] = "linuxè½½.img" - response = await compute_client.post(app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "QEMU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["ram"] == 1024 - assert response.json()["hda_disk_image"] == "linuxè½½.img" - assert response.json()["hda_disk_image_md5sum"] == "fcea920f7412b5da7be0cf42b8c93759" - - -@pytest.mark.parametrize( - "name, status_code", - ( - ("valid-name.com", status.HTTP_201_CREATED), - ("42name", status.HTTP_201_CREATED), - ("424242", status.HTTP_409_CONFLICT), - ("name42", status.HTTP_201_CREATED), - ("name.424242", status.HTTP_409_CONFLICT), - ("-name", status.HTTP_409_CONFLICT), - ("name%-test", status.HTTP_409_CONFLICT), - ("x" * 63, status.HTTP_201_CREATED), - ("x" * 64, status.HTTP_409_CONFLICT), - (("x" * 62 + ".") * 4, status.HTTP_201_CREATED), - ("xx" + ("x" * 62 + ".") * 4, status.HTTP_409_CONFLICT), - ), -) -async def test_qemu_create_with_invalid_name( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - base_params: dict, - name: str, - status_code: int -) -> None: - - base_params["name"] = name - response = await compute_client.post( - app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=base_params - ) - assert response.status_code == status_code - -# async def test_qemu_create_with_project_file(app: FastAPI, -# compute_client: AsyncClient, -# compute_project: Project, -# base_params: dict, -# fake_qemu_vm: str) -> None: -# -# response = await compute_client.post( -# app.url_path_for("compute:write_compute_project_file", project_id=compute_project.id, file_path="hello.img"), -# content=b"world" -# ) -# assert response.status_code == status.HTTP_204_NO_CONTENT -# params = base_params -# params["hda_disk_image"] = "hello.img" -# response = await compute_client.post( -# app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), -# json=params -# ) -# assert response.status_code == status.HTTP_201_CREATED -# assert response.json()["hda_disk_image"] == "hello.img" -# assert response.json()["hda_disk_image_md5sum"] == "7d793037a0760186574b0282f2f435e7" - - -async def test_qemu_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, qemu_vm: dict): - - response = await compute_client.get( - app.url_path_for("compute:get_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) - ) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "QEMU-TEST-1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["node_directory"] == os.path.join( - compute_project.path, - "project-files", - "qemu", - qemu_vm["node_id"] - ) - - -async def test_qemu_start(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.start", return_value=True) as mock: + @pytest.fixture + def fake_qemu_bin(self, monkeypatch, tmpdir) -> str: + + monkeypatch.setenv("PATH", str(tmpdir)) + bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64") + with open(bin_path, "w+") as f: + f.write("1") + os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) + return bin_path + + + @pytest.fixture + def fake_qemu_vm(self, images_dir) -> str: + + img_dir = os.path.join(images_dir, "QEMU") + bin_path = os.path.join(img_dir, "linuxè½½.img") + with open(bin_path, "w+") as f: + f.write("1234567") + os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) + return bin_path + + + @pytest.fixture + def fake_qemu_img_binary(self, tmpdir): + + bin_path = str(tmpdir / "qemu-img") + with open(bin_path, "w+") as f: + f.write("1") + os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) + return bin_path + + + @pytest.fixture + def base_params(self, tmpdir, fake_qemu_bin) -> dict: + """Return standard parameters""" + + return {"name": "QEMU-TEST-1", "qemu_path": fake_qemu_bin} + + + @pytest_asyncio.fixture + async def qemu_vm( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict + ) -> None: + response = await compute_client.post( - app.url_path_for("compute:start_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), + json=base_params ) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_stop(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.stop", return_value=True) as mock: - response = await compute_client.post( - app.url_path_for("compute:stop_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) - ) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_reload(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.reload", return_value=True) as mock: - response = await compute_client.post( - app.url_path_for("compute:reload_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) - ) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_suspend(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.suspend", return_value=True) as mock: - response = await compute_client.post( - app.url_path_for("compute:suspend_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) - ) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_resume(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.resume", return_value=True) as mock: - response = await compute_client.post( - app.url_path_for("compute:resume_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) - ) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_delete(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - with asyncio_patch("gns3server.compute.qemu.Qemu.delete_node", return_value=True) as mock: - response = await compute_client.delete( - app.url_path_for("compute:delete_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) - ) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_update(app: FastAPI, - compute_client: AsyncClient, - qemu_vm: dict, - free_console_port: int, - fake_qemu_vm: str) -> None: - - params = { - "name": "test", - "console": free_console_port, - "ram": 1024, - "hdb_disk_image": "linuxè½½.img" - } - - response = await compute_client.put( - app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), - json=params + assert response.status_code == status.HTTP_201_CREATED + return response.json() + + + async def test_qemu_create( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict, + fake_qemu_bin: str + ) -> None: + + response = await compute_client.post(app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "QEMU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["qemu_path"] == fake_qemu_bin + assert response.json()["platform"] == "x86_64" + + + async def test_qemu_create_platform( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict, + fake_qemu_bin: str + ): + + base_params["qemu_path"] = None + base_params["platform"] = "x86_64" + response = await compute_client.post(app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=base_params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "QEMU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["qemu_path"] == fake_qemu_bin + assert response.json()["platform"] == "x86_64" + + + @pytest.mark.asyncio + async def test_qemu_create_with_params( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict, + fake_qemu_vm: str + ): + + params = base_params + params["ram"] = 1024 + params["hda_disk_image"] = "linuxè½½.img" + response = await compute_client.post(app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "QEMU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["ram"] == 1024 + assert response.json()["hda_disk_image"] == "linuxè½½.img" + assert response.json()["hda_disk_image_md5sum"] == "fcea920f7412b5da7be0cf42b8c93759" + + + @pytest.mark.parametrize( + "name, status_code", + ( + ("valid-name.com", status.HTTP_201_CREATED), + ("42name", status.HTTP_201_CREATED), + ("424242", status.HTTP_409_CONFLICT), + ("name42", status.HTTP_201_CREATED), + ("name.424242", status.HTTP_409_CONFLICT), + ("-name", status.HTTP_409_CONFLICT), + ("name%-test", status.HTTP_409_CONFLICT), + ("x" * 63, status.HTTP_201_CREATED), + ("x" * 64, status.HTTP_409_CONFLICT), + (("x" * 62 + ".") * 4, status.HTTP_201_CREATED), + ("xx" + ("x" * 62 + ".") * 4, status.HTTP_409_CONFLICT), + ), ) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - assert response.json()["console"] == free_console_port - assert response.json()["hdb_disk_image"] == "linuxè½½.img" - assert response.json()["ram"] == 1024 - - -async def test_qemu_nio_create_udp(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.add_ubridge_udp_connection"): + async def test_qemu_create_with_invalid_name( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + base_params: dict, + name: str, + status_code: int + ) -> None: + + base_params["name"] = name + response = await compute_client.post( + app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), json=base_params + ) + assert response.status_code == status_code + + # async def test_qemu_create_with_project_file(self, app: FastAPI, + # compute_client: AsyncClient, + # compute_project: Project, + # base_params: dict, + # fake_qemu_vm: str) -> None: + # + # response = await compute_client.post( + # app.url_path_for("compute:write_compute_project_file", project_id=compute_project.id, file_path="hello.img"), + # content=b"world" + # ) + # assert response.status_code == status.HTTP_204_NO_CONTENT + # params = base_params + # params["hda_disk_image"] = "hello.img" + # response = await compute_client.post( + # app.url_path_for("compute:create_qemu_node", project_id=compute_project.id), + # json=params + # ) + # assert response.status_code == status.HTTP_201_CREATED + # assert response.json()["hda_disk_image"] == "hello.img" + # assert response.json()["hda_disk_image_md5sum"] == "7d793037a0760186574b0282f2f435e7" + + + async def test_qemu_get( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + qemu_vm: dict + ): + + response = await compute_client.get( + app.url_path_for("compute:get_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "QEMU-TEST-1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["node_directory"] == os.path.join( + compute_project.path, + "project-files", + "qemu", + qemu_vm["node_id"] + ) + + + async def test_qemu_start(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.start", return_value=True) as mock: + response = await compute_client.post( + app.url_path_for("compute:start_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_stop(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.stop", return_value=True) as mock: + response = await compute_client.post( + app.url_path_for("compute:stop_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_reload(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.reload", return_value=True) as mock: + response = await compute_client.post( + app.url_path_for("compute:reload_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_suspend(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.suspend", return_value=True) as mock: + response = await compute_client.post( + app.url_path_for("compute:suspend_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_resume(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.resume", return_value=True) as mock: + response = await compute_client.post( + app.url_path_for("compute:resume_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_delete(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + with asyncio_patch("gns3server.compute.qemu.Qemu.delete_node", return_value=True) as mock: + response = await compute_client.delete( + app.url_path_for("compute:delete_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]) + ) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_update( + self, + app: FastAPI, + compute_client: AsyncClient, + qemu_vm: dict, + free_console_port: int, + fake_qemu_vm: str + ) -> None: + + params = { + "name": "test", + "console": free_console_port, + "ram": 1024, + "hdb_disk_image": "linuxè½½.img" + } + + response = await compute_client.put( + app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), + json=params + ) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + assert response.json()["console"] == free_console_port + assert response.json()["hdb_disk_image"] == "linuxè½½.img" + assert response.json()["ram"] == 1024 + + + async def test_qemu_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.add_ubridge_udp_connection"): + await compute_client.put( + app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), + json={"adapters": 2} + ) + + url = app.url_path_for( + "compute:create_qemu_node_nio", + project_id=qemu_vm["project_id"], + node_id=qemu_vm["node_id"], + adapter_number="1", + port_number="0" + ) + response = await compute_client.post(url, json=params) + + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_qemu_nio_update_udp(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + await compute_client.put( app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), json={"adapters": 2} ) - - url = app.url_path_for( - "compute:create_qemu_node_nio", - project_id=qemu_vm["project_id"], - node_id=qemu_vm["node_id"], - adapter_number="1", - port_number="0" - ) - response = await compute_client.post(url, json=params) - - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_qemu_nio_update_udp(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - await compute_client.put( - app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), - json={"adapters": 2} - ) - - url = app.url_path_for( - "compute:create_qemu_node_nio", - project_id=qemu_vm["project_id"], - node_id=qemu_vm["node_id"], - adapter_number="1", - port_number="0" - ) - - await compute_client.post(url, json=params) - params["filters"] = {} - - url = app.url_path_for( - "compute:update_qemu_node_nio", - project_id=qemu_vm["project_id"], - node_id=qemu_vm["node_id"], - adapter_number="1", - port_number="0" - ) - response = await compute_client.put(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_qemu_delete_nio(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM._ubridge_send"): - await compute_client.put( - app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), - json={"adapters": 2} - ) - + url = app.url_path_for( "compute:create_qemu_node_nio", project_id=qemu_vm["project_id"], @@ -370,192 +359,285 @@ async def test_qemu_delete_nio(app: FastAPI, compute_client: AsyncClient, qemu_v adapter_number="1", port_number="0" ) + await compute_client.post(url, json=params) - + params["filters"] = {} + url = app.url_path_for( - "compute:delete_qemu_node_nio", + "compute:update_qemu_node_nio", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"], adapter_number="1", port_number="0" ) - response = await compute_client.delete(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_images(app: FastAPI, compute_client: AsyncClient, fake_qemu_vm) -> None: - - response = await compute_client.get(app.url_path_for("compute:get_qemu_images")) - assert response.status_code == status.HTTP_200_OK - print(response.json()) - assert {"filename": "linuxè½½.img", "path": "linuxè½½.img", "md5sum": "fcea920f7412b5da7be0cf42b8c93759", "filesize": 7} in response.json() - - -async def test_upload_image(app: FastAPI, compute_client: AsyncClient, tmpdir: str) -> None: - - with patch("gns3server.compute.Qemu.get_images_directory", return_value=str(tmpdir)): - - response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", - filename="test2使"), content=b"TEST") + response = await compute_client.put(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_qemu_delete_nio(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM._ubridge_send"): + await compute_client.put( + app.url_path_for("compute:update_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), + json={"adapters": 2} + ) + + url = app.url_path_for( + "compute:create_qemu_node_nio", + project_id=qemu_vm["project_id"], + node_id=qemu_vm["node_id"], + adapter_number="1", + port_number="0" + ) + await compute_client.post(url, json=params) + + url = app.url_path_for( + "compute:delete_qemu_node_nio", + project_id=qemu_vm["project_id"], + node_id=qemu_vm["node_id"], + adapter_number="1", + port_number="0" + ) + response = await compute_client.delete(url) assert response.status_code == status.HTTP_204_NO_CONTENT - - with open(str(tmpdir / "test2使")) as f: - assert f.read() == "TEST" - - with open(str(tmpdir / "test2使.md5sum")) as f: - checksum = f.read() - assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" - - -async def test_upload_image_ova(app: FastAPI, compute_client: AsyncClient, tmpdir:str) -> None: - - with patch("gns3server.compute.Qemu.get_images_directory", return_value=str(tmpdir)): - + + + async def test_images(self, app: FastAPI, compute_client: AsyncClient, fake_qemu_vm) -> None: + + response = await compute_client.get(app.url_path_for("compute:get_qemu_images")) + assert response.status_code == status.HTTP_200_OK + print(response.json()) + assert {"filename": "linuxè½½.img", "path": "linuxè½½.img", "md5sum": "fcea920f7412b5da7be0cf42b8c93759", "filesize": 7} in response.json() + + + async def test_upload_image(self, app: FastAPI, compute_client: AsyncClient, tmpdir: str) -> None: + + with patch("gns3server.compute.Qemu.get_images_directory", return_value=str(tmpdir)): + + response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", + filename="test2使"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT + + with open(str(tmpdir / "test2使")) as f: + assert f.read() == "TEST" + + with open(str(tmpdir / "test2使.md5sum")) as f: + checksum = f.read() + assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" + + + async def test_upload_image_ova(self, app: FastAPI, compute_client: AsyncClient, tmpdir:str) -> None: + + with patch("gns3server.compute.Qemu.get_images_directory", return_value=str(tmpdir)): + + response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", + filename="test2.ova/test2.vmdk"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT + + with open(str(tmpdir / "test2.ova" / "test2.vmdk")) as f: + assert f.read() == "TEST" + + with open(str(tmpdir / "test2.ova" / "test2.vmdk.md5sum")) as f: + checksum = f.read() + assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" + + + async def test_upload_image_forbidden_location( + self, app: FastAPI, + compute_client: AsyncClient, + tmpdir: str + ) -> None: + response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", - filename="test2.ova/test2.vmdk"), content=b"TEST") + filename="/qemu/images/../../test2"), content=b"TEST") + assert response.status_code == status.HTTP_403_FORBIDDEN + + + async def test_download_image(self, app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: + + response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", filename="test3"), content=b"TEST") assert response.status_code == status.HTTP_204_NO_CONTENT - - with open(str(tmpdir / "test2.ova" / "test2.vmdk")) as f: - assert f.read() == "TEST" - - with open(str(tmpdir / "test2.ova" / "test2.vmdk.md5sum")) as f: - checksum = f.read() - assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf" - - -async def test_upload_image_forbidden_location(app: FastAPI, compute_client: AsyncClient, tmpdir: str) -> None: - - response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", - filename="/qemu/images/../../test2"), content=b"TEST") - assert response.status_code == status.HTTP_403_FORBIDDEN - - -async def test_download_image(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: - - response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", filename="test3"), content=b"TEST") - assert response.status_code == status.HTTP_204_NO_CONTENT - - response = await compute_client.get(app.url_path_for("compute:download_qemu_image", filename="test3")) - assert response.status_code == status.HTTP_200_OK - - -async def test_download_image_forbidden_location(app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: - - file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" - response = await compute_client.get(app.url_path_for("compute:download_qemu_image", filename=file_path)) - assert response.status_code == status.HTTP_403_FORBIDDEN - - -@pytest.mark.skipif(os.getuid() == 0, reason="Root can delete any image") -async def test_upload_image_permission_denied(app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: - - with open(os.path.join(images_dir, "QEMU", "test2.tmp"), "w+") as f: - f.write("") - os.chmod(os.path.join(images_dir, "QEMU", "test2.tmp"), 0) - - response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", filename="test2"), content=b"TEST") - assert response.status_code == status.HTTP_409_CONFLICT - - -# @pytest.mark.asyncio -# async def test_create_img_relative(app: FastAPI, compute_client: AsyncClient): -# -# params = { -# "qemu_img": "/tmp/qemu-img", -# "path": "hda.qcow2", -# "format": "qcow2", -# "preallocation": "metadata", -# "cluster_size": 64, -# "refcount_bits": 12, -# "lazy_refcounts": "off", -# "size": 100 -# } -# with asyncio_patch("gns3server.compute.Qemu.create_disk"): -# response = await compute_client.post(app.url_path_for("compute:create_qemu_image"), json=params) -# assert response.status_code == status.HTTP_204_NO_CONTENT -# -# -# async def test_create_img_absolute_non_local(app: FastAPI, compute_client: AsyncClient, config) -> None: -# -# config.settings.Server.local = False -# params = { -# "qemu_img": "/tmp/qemu-img", -# "path": "/tmp/hda.qcow2", -# "format": "qcow2", -# "preallocation": "metadata", -# "cluster_size": 64, -# "refcount_bits": 12, -# "lazy_refcounts": "off", -# "size": 100 -# } -# with asyncio_patch("gns3server.compute.Qemu.create_disk"): -# response = await compute_client.post(app.url_path_for("compute:create_qemu_image"), json=params) -# assert response.status_code == 403 -# -# -# async def test_create_img_absolute_local(app: FastAPI, compute_client: AsyncClient, config) -> None: -# -# params = { -# "qemu_img": "/tmp/qemu-img", -# "path": "/tmp/hda.qcow2", -# "format": "qcow2", -# "preallocation": "metadata", -# "cluster_size": 64, -# "refcount_bits": 12, -# "lazy_refcounts": "off", -# "size": 100 -# } -# with asyncio_patch("gns3server.compute.Qemu.create_disk"): -# response = await compute_client.post(app.url_path_for("compute:create_qemu_image"), json=params) -# assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_capabilities(app: FastAPI, compute_client: AsyncClient) -> None: - - with asyncio_patch("gns3server.compute.Qemu.get_kvm_archs", return_value=["x86_64"]): - response = await compute_client.get(app.url_path_for("compute:get_qemu_capabilities")) - assert response.json()["kvm"] == ["x86_64"] - - -async def test_qemu_duplicate(app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - qemu_vm: dict, - base_params: dict) -> None: - - # create destination node first - response = await compute_client.post( - app.url_path_for("compute:create_qemu_node", project_id=qemu_vm["project_id"]), - json=base_params - ) - - assert response.status_code == status.HTTP_201_CREATED - params = {"destination_node_id": response.json()["node_id"]} - response = await compute_client.post( - app.url_path_for("compute:duplicate_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), - json=params - ) - assert response.status_code == status.HTTP_201_CREATED - - -async def test_qemu_create_disk_image( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - fake_qemu_img_binary: str, - qemu_vm: dict, -): - - options = { - "format": "qcow2", - "preallocation": "metadata", - "cluster_size": 64, - "refcount_bits": 12, - "lazy_refcounts": "off", - "size": 30 - } - - with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as qemu_img: + + response = await compute_client.get(app.url_path_for("compute:download_qemu_image", filename="test3")) + assert response.status_code == status.HTTP_200_OK + + + async def test_download_image_forbidden_location(self, app: FastAPI, compute_client: AsyncClient, tmpdir) -> None: + + file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" + response = await compute_client.get(app.url_path_for("compute:download_qemu_image", filename=file_path)) + assert response.status_code == status.HTTP_403_FORBIDDEN + + + @pytest.mark.skipif(os.getuid() == 0, reason="Root can delete any image") + async def test_upload_image_permission_denied(self, app: FastAPI, compute_client: AsyncClient, images_dir: str) -> None: + + with open(os.path.join(images_dir, "QEMU", "test2.tmp"), "w+") as f: + f.write("") + os.chmod(os.path.join(images_dir, "QEMU", "test2.tmp"), 0) + + response = await compute_client.post(app.url_path_for("compute:upload_qemu_image", filename="test2"), content=b"TEST") + assert response.status_code == status.HTTP_409_CONFLICT + + + # @pytest.mark.asyncio + # async def test_create_img_relative(self, app: FastAPI, compute_client: AsyncClient): + # + # params = { + # "qemu_img": "/tmp/qemu-img", + # "path": "hda.qcow2", + # "format": "qcow2", + # "preallocation": "metadata", + # "cluster_size": 64, + # "refcount_bits": 12, + # "lazy_refcounts": "off", + # "size": 100 + # } + # with asyncio_patch("gns3server.compute.Qemu.create_disk"): + # response = await compute_client.post(app.url_path_for("compute:create_qemu_image"), json=params) + # assert response.status_code == status.HTTP_204_NO_CONTENT + # + # + # async def test_create_img_absolute_non_local(self, app: FastAPI, compute_client: AsyncClient, config) -> None: + # + # config.settings.Server.local = False + # params = { + # "qemu_img": "/tmp/qemu-img", + # "path": "/tmp/hda.qcow2", + # "format": "qcow2", + # "preallocation": "metadata", + # "cluster_size": 64, + # "refcount_bits": 12, + # "lazy_refcounts": "off", + # "size": 100 + # } + # with asyncio_patch("gns3server.compute.Qemu.create_disk"): + # response = await compute_client.post(app.url_path_for("compute:create_qemu_image"), json=params) + # assert response.status_code == 403 + # + # + # async def test_create_img_absolute_local(self, app: FastAPI, compute_client: AsyncClient, config) -> None: + # + # params = { + # "qemu_img": "/tmp/qemu-img", + # "path": "/tmp/hda.qcow2", + # "format": "qcow2", + # "preallocation": "metadata", + # "cluster_size": 64, + # "refcount_bits": 12, + # "lazy_refcounts": "off", + # "size": 100 + # } + # with asyncio_patch("gns3server.compute.Qemu.create_disk"): + # response = await compute_client.post(app.url_path_for("compute:create_qemu_image"), json=params) + # assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_capabilities(self, app: FastAPI, compute_client: AsyncClient) -> None: + + with asyncio_patch("gns3server.compute.Qemu.get_kvm_archs", return_value=["x86_64"]): + response = await compute_client.get(app.url_path_for("compute:get_qemu_capabilities")) + assert response.json()["kvm"] == ["x86_64"] + + + async def test_qemu_duplicate( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + qemu_vm: dict, + base_params: dict + ) -> None: + + # create destination node first + response = await compute_client.post( + app.url_path_for("compute:create_qemu_node", project_id=qemu_vm["project_id"]), + json=base_params + ) + + assert response.status_code == status.HTTP_201_CREATED + params = {"destination_node_id": response.json()["node_id"]} + response = await compute_client.post( + app.url_path_for("compute:duplicate_qemu_node", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"]), + json=params + ) + assert response.status_code == status.HTTP_201_CREATED + + + async def test_qemu_create_disk_image( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + fake_qemu_img_binary: str, + qemu_vm: dict, + ): + + options = { + "format": "qcow2", + "preallocation": "metadata", + "cluster_size": 64, + "refcount_bits": 12, + "lazy_refcounts": "off", + "size": 30 + } + + with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as qemu_img: + response = await compute_client.post( + app.url_path_for( + "compute:create_qemu_disk_image", + project_id=qemu_vm["project_id"], + node_id=qemu_vm["node_id"], + disk_name="disk.qcow2" + ), + json=options + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + args, kwargs = qemu_img.call_args + assert args == ( + fake_qemu_img_binary, + "create", + "-f", + "qcow2", + "-o", + "cluster_size=64", + "-o", + "lazy_refcounts=off", + "-o", + "preallocation=metadata", + "-o", + "refcount_bits=12", + os.path.join(qemu_vm["node_directory"], "disk.qcow2"), + "30M" + ) + + + async def test_qemu_create_disk_image_already_exists( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + fake_qemu_img_binary: str, + qemu_vm: dict, + ): + + node = compute_project.get_node(qemu_vm["node_id"]) + shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) + + options = { + "format": "qcow2", + "size": 100 + } + response = await compute_client.post( app.url_path_for( "compute:create_qemu_disk_image", @@ -565,202 +647,159 @@ async def test_qemu_create_disk_image( ), json=options ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - args, kwargs = qemu_img.call_args - assert args == ( - fake_qemu_img_binary, - "create", - "-f", - "qcow2", - "-o", - "cluster_size=64", - "-o", - "lazy_refcounts=off", - "-o", - "preallocation=metadata", - "-o", - "refcount_bits=12", - os.path.join(qemu_vm["node_directory"], "disk.qcow2"), - "30M" - ) - - -async def test_qemu_create_disk_image_already_exists( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - fake_qemu_img_binary: str, - qemu_vm: dict, -): - - node = compute_project.get_node(qemu_vm["node_id"]) - shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) - - options = { - "format": "qcow2", - "size": 100 - } - - response = await compute_client.post( - app.url_path_for( - "compute:create_qemu_disk_image", - project_id=qemu_vm["project_id"], - node_id=qemu_vm["node_id"], - disk_name="disk.qcow2" - ), - json=options - ) - assert response.status_code == status.HTTP_409_CONFLICT - - -# async def test_qemu_create_disk_image_with_not_supported_characters_by_filesystem( -# app: FastAPI, -# compute_client: AsyncClient, -# compute_project: Project, -# fake_qemu_img_binary: str, -# qemu_vm: dict, -# ): -# -# node = compute_project.get_node(qemu_vm["node_id"]) -# shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) -# -# options = { -# "format": "qcow2", -# "size": 100 -# } -# -# with patch("os.path.exists", side_effect=UnicodeEncodeError('error', u"", 1, 2, 'Emulated Unicode Err')): -# response = await compute_client.post( -# app.url_path_for( -# "compute:create_qemu_disk_image", -# project_id=qemu_vm["project_id"], -# node_id=qemu_vm["node_id"], -# disk_name=u"\u2019" -# ), -# json=options -# ) -# assert response.status_code == status.HTTP_409_CONFLICT - - -async def test_qemu_update_disk_image( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - fake_qemu_img_binary: str, - qemu_vm: dict, -) -> None: - - node = compute_project.get_node(qemu_vm["node_id"]) - shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) - - with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as qemu_img: - response = await compute_client.put( + assert response.status_code == status.HTTP_409_CONFLICT + + + # async def test_qemu_create_disk_image_with_not_supported_characters_by_filesystem( + # app: FastAPI, + # compute_client: AsyncClient, + # compute_project: Project, + # fake_qemu_img_binary: str, + # qemu_vm: dict, + # ): + # + # node = compute_project.get_node(qemu_vm["node_id"]) + # shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) + # + # options = { + # "format": "qcow2", + # "size": 100 + # } + # + # with patch("os.path.exists", side_effect=UnicodeEncodeError('error', u"", 1, 2, 'Emulated Unicode Err')): + # response = await compute_client.post( + # app.url_path_for( + # "compute:create_qemu_disk_image", + # project_id=qemu_vm["project_id"], + # node_id=qemu_vm["node_id"], + # disk_name=u"\u2019" + # ), + # json=options + # ) + # assert response.status_code == status.HTTP_409_CONFLICT + + + async def test_qemu_update_disk_image( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + fake_qemu_img_binary: str, + qemu_vm: dict, + ) -> None: + + node = compute_project.get_node(qemu_vm["node_id"]) + shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) + + with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as qemu_img: + response = await compute_client.put( + app.url_path_for( + "compute:update_qemu_disk_image", + project_id=qemu_vm["project_id"], + node_id=qemu_vm["node_id"], + disk_name="disk.qcow2" + ), + json={"extend": 10} + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + assert qemu_img.called + args, kwargs = qemu_img.call_args + assert args == ( + fake_qemu_img_binary, + "resize", + os.path.join(qemu_vm["node_directory"], "disk.qcow2"), + "+10M" + ) + + + async def test_qemu_delete_disk_image( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + qemu_vm: dict, + ) -> None: + + node = compute_project.get_node(qemu_vm["node_id"]) + shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) + + response = await compute_client.delete( app.url_path_for( - "compute:update_qemu_disk_image", + "compute:delete_qemu_disk_image", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"], disk_name="disk.qcow2" - ), - json={"extend": 10} + ) ) assert response.status_code == status.HTTP_204_NO_CONTENT - - assert qemu_img.called - args, kwargs = qemu_img.call_args - assert args == ( - fake_qemu_img_binary, - "resize", - os.path.join(qemu_vm["node_directory"], "disk.qcow2"), - "+10M" + + + async def test_qemu_delete_disk_image_missing_image( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + qemu_vm: dict, + ) -> None: + + response = await compute_client.delete( + app.url_path_for( + "compute:delete_qemu_disk_image", + project_id=qemu_vm["project_id"], + node_id=qemu_vm["node_id"], + disk_name="unknown_image.qcow2" + ) ) - - -async def test_qemu_delete_disk_image( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - qemu_vm: dict, -) -> None: - - node = compute_project.get_node(qemu_vm["node_id"]) - shutil.copy("tests/resources/empty8G.qcow2", os.path.join(node.working_dir, "disk.qcow2")) - - response = await compute_client.delete( - app.url_path_for( - "compute:delete_qemu_disk_image", + assert response.status_code == status.HTTP_409_CONFLICT + + + @pytest.mark.asyncio + async def test_qemu_start_capture(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict): + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for( + "compute:start_qemu_node_capture", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"], - disk_name="disk.qcow2" + adapter_number="0", + port_number="0" ) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_delete_disk_image_missing_image( - app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - qemu_vm: dict, -) -> None: - - response = await compute_client.delete( - app.url_path_for( - "compute:delete_qemu_disk_image", + + with patch("gns3server.compute.qemu.qemu_vm.QemuVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + @pytest.mark.asyncio + async def test_qemu_stop_capture(self, app: FastAPI, compute_client: AsyncClient, qemu_vm: dict): + + url = app.url_path_for( + "compute:stop_qemu_node_capture", project_id=qemu_vm["project_id"], node_id=qemu_vm["node_id"], - disk_name="unknown_image.qcow2" + adapter_number="0", + port_number="0" ) - ) - assert response.status_code == status.HTTP_409_CONFLICT - - -@pytest.mark.asyncio -async def test_qemu_start_capture(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict): - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - url = app.url_path_for( - "compute:start_qemu_node_capture", - project_id=qemu_vm["project_id"], - node_id=qemu_vm["node_id"], - adapter_number="0", - port_number="0" - ) - - with patch("gns3server.compute.qemu.qemu_vm.QemuVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.start_capture") as mock: - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK - assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] - - -@pytest.mark.asyncio -async def test_qemu_stop_capture(app: FastAPI, compute_client: AsyncClient, qemu_vm: dict): - - url = app.url_path_for( - "compute:stop_qemu_node_capture", - project_id=qemu_vm["project_id"], - node_id=qemu_vm["node_id"], - adapter_number="0", - port_number="0" - ) - - with patch("gns3server.compute.qemu.qemu_vm.QemuVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.stop_capture") as mock: - response = await compute_client.post(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called - - -# @pytest.mark.asyncio -# async def test_qemu_pcap(app: FastAPI, compute_client: AsyncClient, vm, compute_project): -# -# with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.get_nio"): -# with asyncio_patch("gns3server.compute.qemu.Qemu.stream_pcap_file"): -# response = await compute_client.get("/projects/{project_id}/qemu/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) -# assert response.status_code == status.HTTP_200_OK + + with patch("gns3server.compute.qemu.qemu_vm.QemuVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + # @pytest.mark.asyncio + # async def test_qemu_pcap(self, app: FastAPI, compute_client: AsyncClient, vm, compute_project): + # + # with asyncio_patch("gns3server.compute.qemu.qemu_vm.QemuVM.get_nio"): + # with asyncio_patch("gns3server.compute.qemu.Qemu.stream_pcap_file"): + # response = await compute_client.get("/projects/{project_id}/qemu/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) + # assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/compute/test_virtualbox_nodes.py b/tests/api/routes/compute/test_virtualbox_nodes.py index 5a88b6d7..e29f104d 100644 --- a/tests/api/routes/compute/test_virtualbox_nodes.py +++ b/tests/api/routes/compute/test_virtualbox_nodes.py @@ -28,221 +28,223 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture(scope="function") -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - - vboxmanage_path = "/fake/VboxManage" - params = { - "name": "VMTEST", - "vmname": "VMTEST", - "linked_clone": False - } - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.create", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:create_virtualbox_node", project_id=compute_project.id), - json=params) - assert mock.called - assert response.status_code == status.HTTP_201_CREATED - - with patch("gns3server.compute.virtualbox.VirtualBox.find_vboxmanage", return_value=vboxmanage_path): - return response.json() - - -async def test_vbox_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - - params = { - "name": "VM1", - "vmname": "VM1", - "linked_clone": False - } - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.create", return_value=True): - response = await compute_client.post(app.url_path_for("compute:create_virtualbox_node", project_id=compute_project.id), - json=params) +class TestVirtualBoxNodesRoutes: + + @pytest_asyncio.fixture + async def vm(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + + vboxmanage_path = "/fake/VboxManage" + params = { + "name": "VMTEST", + "vmname": "VMTEST", + "linked_clone": False + } + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.create", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:create_virtualbox_node", project_id=compute_project.id), + json=params) + assert mock.called assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "VM1" + + with patch("gns3server.compute.virtualbox.VirtualBox.find_vboxmanage", return_value=vboxmanage_path): + return response.json() + + + async def test_vbox_create(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + + params = { + "name": "VM1", + "vmname": "VM1", + "linked_clone": False + } + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.create", return_value=True): + response = await compute_client.post(app.url_path_for("compute:create_virtualbox_node", project_id=compute_project.id), + json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "VM1" + assert response.json()["project_id"] == compute_project.id + + + async def test_vbox_get(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: + + response = await compute_client.get(app.url_path_for("compute:get_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "VMTEST" assert response.json()["project_id"] == compute_project.id - - -async def test_vbox_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - response = await compute_client.get(app.url_path_for("compute:get_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "VMTEST" - assert response.json()["project_id"] == compute_project.id - - -async def test_vbox_start(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.start", return_value=True) as mock: - - response = await compute_client.post(app.url_path_for("compute:start_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vbox_stop(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.stop", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:stop_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vbox_suspend(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.suspend", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:suspend_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vbox_resume(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.resume", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:resume_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vbox_reload(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.reload", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:reload_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vbox_nio_create_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_virtualbox_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_add_nio_binding') as mock: - response = await compute_client.post(url, json=params) - assert mock.called - args, kwgars = mock.call_args - assert args[0] == 0 - - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -# @pytest.mark.asyncio -# async def test_vbox_nio_update_udp(app: FastAPI, compute_client: AsyncClient, vm): -# -# params = { -# "type": "nio_udp", -# "lport": 4242, -# "rport": 4343, -# "rhost": "127.0.0.1", -# "filters": {} -# } -# -# with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.ethernet_adapters'): -# with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_remove_nio_binding'): -# response = await compute_client.put("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params) -# -# assert response.status_code == status.HTTP_201_CREATED -# assert response.json()["type"] == "nio_udp" - - -async def test_vbox_delete_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:delete_virtualbox_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_remove_nio_binding') as mock: - response = await compute_client.delete(url) - assert mock.called - args, kwgars = mock.call_args - assert args[0] == 0 - assert response.status_code == status.HTTP_204_NO_CONTENT - - -@pytest.mark.asyncio -async def test_vbox_update(app: FastAPI, compute_client: AsyncClient, vm, free_console_port): - - params = { - "name": "test", - "console": free_console_port - } - - response = await compute_client.put(app.url_path_for("compute:update_virtualbox_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - assert response.json()["console"] == free_console_port - - -@pytest.mark.asyncio -async def test_virtualbox_start_capture(app: FastAPI, compute_client: AsyncClient, vm): - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - url = app.url_path_for("compute:start_virtualbox_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.start_capture") as mock: - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK + + + async def test_vbox_start(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.start", return_value=True) as mock: + + response = await compute_client.post(app.url_path_for("compute:start_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] - - -@pytest.mark.asyncio -async def test_virtualbox_stop_capture(app: FastAPI, compute_client: AsyncClient, vm): - - url = app.url_path_for("compute:stop_virtualbox_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.stop_capture") as mock: - response = await compute_client.post(url) assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vbox_stop(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.stop", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:stop_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - - -# @pytest.mark.asyncio -# async def test_virtualbox_pcap(app: FastAPI, compute_client: AsyncClient, vm, compute_project): -# -# with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.get_nio"): -# with asyncio_patch("gns3server.compute.virtualbox.VirtualBox.stream_pcap_file"): -# response = await compute_client.get("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) -# assert response.status_code == status.HTTP_200_OK + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vbox_suspend(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.suspend", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:suspend_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vbox_resume(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.resume", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:resume_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vbox_reload(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.reload", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:reload_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vbox_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + url = app.url_path_for("compute:create_virtualbox_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_add_nio_binding') as mock: + response = await compute_client.post(url, json=params) + assert mock.called + args, kwgars = mock.call_args + assert args[0] == 0 + + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + # @pytest.mark.asyncio + # async def test_vbox_nio_update_udp(self, app: FastAPI, compute_client: AsyncClient, vm): + # + # params = { + # "type": "nio_udp", + # "lport": 4242, + # "rport": 4343, + # "rhost": "127.0.0.1", + # "filters": {} + # } + # + # with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.ethernet_adapters'): + # with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_remove_nio_binding'): + # response = await compute_client.put("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params) + # + # assert response.status_code == status.HTTP_201_CREATED + # assert response.json()["type"] == "nio_udp" + + + async def test_vbox_delete_nio(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:delete_virtualbox_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch('gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.adapter_remove_nio_binding') as mock: + response = await compute_client.delete(url) + assert mock.called + args, kwgars = mock.call_args + assert args[0] == 0 + assert response.status_code == status.HTTP_204_NO_CONTENT + + + @pytest.mark.asyncio + async def test_vbox_update(self, app: FastAPI, compute_client: AsyncClient, vm, free_console_port): + + params = { + "name": "test", + "console": free_console_port + } + + response = await compute_client.put(app.url_path_for("compute:update_virtualbox_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + assert response.json()["console"] == free_console_port + + + @pytest.mark.asyncio + async def test_virtualbox_start_capture(self, app: FastAPI, compute_client: AsyncClient, vm): + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for("compute:start_virtualbox_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + @pytest.mark.asyncio + async def test_virtualbox_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm): + + url = app.url_path_for("compute:stop_virtualbox_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + # @pytest.mark.asyncio + # async def test_virtualbox_pcap(self, app: FastAPI, compute_client: AsyncClient, vm, compute_project): + # + # with asyncio_patch("gns3server.compute.virtualbox.virtualbox_vm.VirtualBoxVM.get_nio"): + # with asyncio_patch("gns3server.compute.virtualbox.VirtualBox.stream_pcap_file"): + # response = await compute_client.get("/projects/{project_id}/virtualbox/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) + # assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/compute/test_vmware_nodes.py b/tests/api/routes/compute/test_vmware_nodes.py index 088b4db2..ff875ab2 100644 --- a/tests/api/routes/compute/test_vmware_nodes.py +++ b/tests/api/routes/compute/test_vmware_nodes.py @@ -28,226 +28,246 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture(scope="function") -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vmx_path: str) -> dict: +class TestVMwareNodesRoutes: - params = { - "name": "VMTEST", - "vmx_path": vmx_path, - "linked_clone": False - } - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.create", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:create_vmware_node", project_id=compute_project.id), - json=params) - assert mock.called - assert response.status_code == status.HTTP_201_CREATED - return response.json() + @pytest_asyncio.fixture + async def vm(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project, vmx_path: str) -> dict: + + params = { + "name": "VMTEST", + "vmx_path": vmx_path, + "linked_clone": False + } + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.create", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:create_vmware_node", project_id=compute_project.id), + json=params) + assert mock.called + assert response.status_code == status.HTTP_201_CREATED + return response.json() -@pytest.fixture -def vmx_path(tmpdir: str) -> str: - """ - Return a fake VMX file - """ - - path = str(tmpdir / "test.vmx") - with open(path, 'w+') as f: - f.write("1") - return path - - -async def test_vmware_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vmx_path: str) -> None: - - params = { - "name": "VM1", - "vmx_path": vmx_path, - "linked_clone": False - } - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.create", return_value=True): - response = await compute_client.post(app.url_path_for("compute:create_vmware_node", project_id=compute_project.id), - json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "VM1" + @pytest.fixture + def vmx_path(self, tmpdir: str) -> str: + """ + Return a fake VMX file + """ + + path = str(tmpdir / "test.vmx") + with open(path, 'w+') as f: + f.write("1") + return path + + + async def test_vmware_create( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vmx_path: str + ) -> None: + + params = { + "name": "VM1", + "vmx_path": vmx_path, + "linked_clone": False + } + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.create", return_value=True): + response = await compute_client.post(app.url_path_for("compute:create_vmware_node", project_id=compute_project.id), + json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "VM1" + assert response.json()["project_id"] == compute_project.id + + + async def test_vmware_get( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: + + response = await compute_client.get(app.url_path_for("compute:get_vmware_node", project_id=vm["project_id"], node_id=vm["node_id"])) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "VMTEST" assert response.json()["project_id"] == compute_project.id - - -async def test_vmware_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - response = await compute_client.get(app.url_path_for("compute:get_vmware_node", project_id=vm["project_id"], node_id=vm["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "VMTEST" - assert response.json()["project_id"] == compute_project.id - - -async def test_vmware_start(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.start", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:start_vmware_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vmware_stop(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.stop", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:stop_vmware_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vmware_suspend(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.suspend", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:suspend_vmware_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vmware_resume(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.resume", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:resume_vmware_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vmware_reload(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.reload", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:reload_vmware_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vmware_nio_create_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_vmware_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM.adapter_add_nio_binding') as mock: - response = await compute_client.post(url, json=params) - assert mock.called - args, kwgars = mock.call_args - assert args[0] == 0 - - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -# @pytest.mark.asyncio -# async def test_vmware_nio_update_udp(app: FastAPI, compute_client: AsyncClient, vm): -# -# params = { -# "type": "nio_udp", -# "lport": 4242, -# "rport": 4343, -# "rhost": "127.0.0.1", -# "filters": {} -# } -# -# with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM._ubridge_send'): -# with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM.ethernet_adapters'): -# with patch('gns3server.compute.vmware.vmware_vm.VMwareVM._get_vnet') as mock: -# response = await compute_client.put("/projects/{project_id}/vmware/nodes/{node_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params) -# assert response.status_code == status.HTTP_201_CREATED -# assert response.json()["type"] == "nio_udp" - - -async def test_vmware_delete_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:delete_vmware_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM.adapter_remove_nio_binding') as mock: - response = await compute_client.delete(url) - assert mock.called - args, kwgars = mock.call_args - assert args[0] == 0 - - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vmware_update(app: FastAPI, compute_client: AsyncClient, vm: dict, free_console_port: int) -> None: - - params = { - "name": "test", - "console": free_console_port - } - - response = await compute_client.put(app.url_path_for("compute:update_vmware_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - assert response.json()["console"] == free_console_port - - -async def test_vmware_start_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - url = app.url_path_for("compute:start_vmware_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.vmware.vmware_vm.VMwareVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.start_capture") as mock: - - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK + + + async def test_vmware_start(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.start", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:start_vmware_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] - - -async def test_vmware_stop_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:stop_vmware_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.vmware.vmware_vm.VMwareVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.stop_capture") as mock: - response = await compute_client.post(url) assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vmware_stop(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.stop", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:stop_vmware_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - - -# @pytest.mark.asyncio -# async def test_vmware_pcap(app: FastAPI, compute_client: AsyncClient, vm, compute_project): -# -# with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.get_nio"): -# with asyncio_patch("gns3server.compute.vmware.VMware.stream_pcap_file"): -# response = await compute_client.get("/projects/{project_id}/vmware/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) -# assert response.status_code == status.HTTP_200_OK + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vmware_suspend(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.suspend", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:suspend_vmware_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vmware_resume(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.resume", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:resume_vmware_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vmware_reload(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.reload", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:reload_vmware_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vmware_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + url = app.url_path_for("compute:create_vmware_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM.adapter_add_nio_binding') as mock: + response = await compute_client.post(url, json=params) + assert mock.called + args, kwgars = mock.call_args + assert args[0] == 0 + + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + # @pytest.mark.asyncio + # async def test_vmware_nio_update_udp(self, app: FastAPI, compute_client: AsyncClient, vm): + # + # params = { + # "type": "nio_udp", + # "lport": 4242, + # "rport": 4343, + # "rhost": "127.0.0.1", + # "filters": {} + # } + # + # with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM._ubridge_send'): + # with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM.ethernet_adapters'): + # with patch('gns3server.compute.vmware.vmware_vm.VMwareVM._get_vnet') as mock: + # response = await compute_client.put("/projects/{project_id}/vmware/nodes/{node_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], node_id=vm["node_id"]), params) + # assert response.status_code == status.HTTP_201_CREATED + # assert response.json()["type"] == "nio_udp" + + + async def test_vmware_delete_nio(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:delete_vmware_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with asyncio_patch('gns3server.compute.vmware.vmware_vm.VMwareVM.adapter_remove_nio_binding') as mock: + response = await compute_client.delete(url) + assert mock.called + args, kwgars = mock.call_args + assert args[0] == 0 + + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vmware_update( + self, + app: FastAPI, + compute_client: AsyncClient, + vm: dict, + free_console_port: int + ) -> None: + + params = { + "name": "test", + "console": free_console_port + } + + response = await compute_client.put(app.url_path_for("compute:update_vmware_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + assert response.json()["console"] == free_console_port + + + async def test_vmware_start_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for("compute:start_vmware_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.vmware.vmware_vm.VMwareVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.start_capture") as mock: + + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + async def test_vmware_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:stop_vmware_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.vmware.vmware_vm.VMwareVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + # @pytest.mark.asyncio + # async def test_vmware_pcap(self, app: FastAPI, compute_client: AsyncClient, vm, compute_project): + # + # with asyncio_patch("gns3server.compute.vmware.vmware_vm.VMwareVM.get_nio"): + # with asyncio_patch("gns3server.compute.vmware.VMware.stream_pcap_file"): + # response = await compute_client.get("/projects/{project_id}/vmware/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) + # assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/compute/test_vpcs_nodes.py b/tests/api/routes/compute/test_vpcs_nodes.py index f0b69366..0bf98781 100644 --- a/tests/api/routes/compute/test_vpcs_nodes.py +++ b/tests/api/routes/compute/test_vpcs_nodes.py @@ -28,251 +28,279 @@ from gns3server.compute.project import Project pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture -async def vm(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: +class TestVPCSNodesRoutes: - params = {"name": "PC TEST 1"} - response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - return response.json() - - -async def test_vpcs_create(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - - params = {"name": "PC TEST 1"} - response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "PC TEST 1" - assert response.json()["project_id"] == compute_project.id - - -async def test_vpcs_get(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - response = await compute_client.get(app.url_path_for("compute:get_vpcs_node", project_id=vm["project_id"], node_id=vm["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "PC TEST 1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["status"] == "stopped" - - -async def test_vpcs_create_startup_script(app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: - - params = { - "name": "PC TEST 1", - "startup_script": "ip 192.168.1.2\necho TEST" - } - - response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "PC TEST 1" - assert response.json()["project_id"] == compute_project.id - - -async def test_vpcs_create_port(app: FastAPI, - compute_client: AsyncClient, - compute_project: Project, - free_console_port: int) -> None: - - params = { - "name": "PC TEST 1", - "console": free_console_port - } - - response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "PC TEST 1" - assert response.json()["project_id"] == compute_project.id - assert response.json()["console"] == free_console_port - - -async def test_vpcs_nio_create_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_vpcs_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.add_ubridge_udp_connection"): - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_vpcs_nio_update_udp(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - url = app.url_path_for("compute:create_vpcs_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.add_ubridge_udp_connection"): - response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - - params["filters"] = {} - url = app.url_path_for("compute:update_vpcs_node_nio", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - response = await compute_client.put(url, json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["type"] == "nio_udp" - - -async def test_vpcs_delete_nio(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "type": "nio_udp", - "lport": 4242, - "rport": 4343, - "rhost": "127.0.0.1" - } - - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM._ubridge_send"): + @pytest_asyncio.fixture + async def vm(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + + params = {"name": "PC TEST 1"} + response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + return response.json() + + + async def test_vpcs_create(self, app: FastAPI, compute_client: AsyncClient, compute_project: Project) -> None: + + params = {"name": "PC TEST 1"} + response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "PC TEST 1" + assert response.json()["project_id"] == compute_project.id + + + async def test_vpcs_get( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: + + response = await compute_client.get(app.url_path_for("compute:get_vpcs_node", project_id=vm["project_id"], node_id=vm["node_id"])) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "PC TEST 1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["status"] == "stopped" + + + async def test_vpcs_create_startup_script( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project + ) -> None: + + params = { + "name": "PC TEST 1", + "startup_script": "ip 192.168.1.2\necho TEST" + } + + response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "PC TEST 1" + assert response.json()["project_id"] == compute_project.id + + + async def test_vpcs_create_port( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + free_console_port: int + ) -> None: + + params = { + "name": "PC TEST 1", + "console": free_console_port + } + + response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "PC TEST 1" + assert response.json()["project_id"] == compute_project.id + assert response.json()["console"] == free_console_port + + + async def test_vpcs_nio_create_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + url = app.url_path_for("compute:create_vpcs_node_nio", project_id=vm["project_id"], node_id=vm["node_id"], adapter_number="0", port_number="0") - await compute_client.post(url, json=params) - - url = app.url_path_for("compute:delete_vpcs_node_nio", + + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.add_ubridge_udp_connection"): + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_vpcs_nio_update_udp(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + url = app.url_path_for("compute:create_vpcs_node_nio", project_id=vm["project_id"], node_id=vm["node_id"], adapter_number="0", port_number="0") - response = await compute_client.delete(url) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vpcs_start(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.start", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:start_vpcs_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vpcs_stop(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.stop", return_value=True) as mock: - - response = await compute_client.post(app.url_path_for("compute:stop_vpcs_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vpcs_reload(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.reload", return_value=True) as mock: - response = await compute_client.post(app.url_path_for("compute:reload_vpcs_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vpcs_delete(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - with asyncio_patch("gns3server.compute.vpcs.VPCS.delete_node", return_value=True) as mock: - response = await compute_client.delete(app.url_path_for("compute:delete_vpcs_node", - project_id=vm["project_id"], - node_id=vm["node_id"])) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_vpcs_duplicate(app: FastAPI, compute_client: AsyncClient, compute_project: Project, vm: dict) -> None: - - # create destination node first - params = {"name": "PC TEST 1"} - response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - - params = {"destination_node_id": response.json()["node_id"]} - response = await compute_client.post(app.url_path_for("compute:duplicate_vpcs_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_201_CREATED - - -async def test_vpcs_update(app: FastAPI, compute_client: AsyncClient, vm: dict, free_console_port: int) -> None: - - console_port = free_console_port - params = { - "name": "test", - "console": console_port - } - - response = await compute_client.put(app.url_path_for("compute:update_vpcs_node", - project_id=vm["project_id"], - node_id=vm["node_id"]), json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - assert response.json()["console"] == console_port - - -async def test_vpcs_start_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - params = { - "capture_file_name": "test.pcap", - "data_link_type": "DLT_EN10MB" - } - - url = app.url_path_for("compute:start_vpcs_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.start_capture") as mock: + + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.add_ubridge_udp_connection"): response = await compute_client.post(url, json=params) - assert response.status_code == status.HTTP_200_OK + assert response.status_code == status.HTTP_201_CREATED + + params["filters"] = {} + url = app.url_path_for("compute:update_vpcs_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.put(url, json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["type"] == "nio_udp" + + + async def test_vpcs_delete_nio(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "type": "nio_udp", + "lport": 4242, + "rport": 4343, + "rhost": "127.0.0.1" + } + + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM._ubridge_send"): + url = app.url_path_for("compute:create_vpcs_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + await compute_client.post(url, json=params) + + url = app.url_path_for("compute:delete_vpcs_node_nio", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + response = await compute_client.delete(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vpcs_start(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.start", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:start_vpcs_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - assert "test.pcap" in response.json()["pcap_file_path"] - - -async def test_vpcs_stop_capture(app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: - - url = app.url_path_for("compute:stop_vpcs_node_capture", - project_id=vm["project_id"], - node_id=vm["node_id"], - adapter_number="0", - port_number="0") - - with patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.is_running", return_value=True): - with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.stop_capture") as mock: - response = await compute_client.post(url) assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vpcs_stop(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.stop", return_value=True) as mock: + + response = await compute_client.post(app.url_path_for("compute:stop_vpcs_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) assert mock.called - - -# @pytest.mark.asyncio -# async def test_vpcs_pcap(app: FastAPI, compute_client: AsyncClient, vm, compute_project: Project): -# -# with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.get_nio"): -# with asyncio_patch("gns3server.compute.vpcs.VPCS.stream_pcap_file"): -# response = await compute_client.get("/projects/{project_id}/vpcs/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) -# assert response.status_code == status.HTTP_200_OK + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vpcs_reload(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.reload", return_value=True) as mock: + response = await compute_client.post(app.url_path_for("compute:reload_vpcs_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vpcs_delete(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + with asyncio_patch("gns3server.compute.vpcs.VPCS.delete_node", return_value=True) as mock: + response = await compute_client.delete(app.url_path_for("compute:delete_vpcs_node", + project_id=vm["project_id"], + node_id=vm["node_id"])) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_vpcs_duplicate( + self, + app: FastAPI, + compute_client: AsyncClient, + compute_project: Project, + vm: dict + ) -> None: + + # create destination node first + params = {"name": "PC TEST 1"} + response = await compute_client.post(app.url_path_for("compute:create_vpcs_node", project_id=compute_project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + + params = {"destination_node_id": response.json()["node_id"]} + response = await compute_client.post(app.url_path_for("compute:duplicate_vpcs_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_201_CREATED + + + async def test_vpcs_update( + self, + app: FastAPI, + compute_client: AsyncClient, + vm: dict, + free_console_port: int + ) -> None: + + console_port = free_console_port + params = { + "name": "test", + "console": console_port + } + + response = await compute_client.put(app.url_path_for("compute:update_vpcs_node", + project_id=vm["project_id"], + node_id=vm["node_id"]), json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + assert response.json()["console"] == console_port + + + async def test_vpcs_start_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + params = { + "capture_file_name": "test.pcap", + "data_link_type": "DLT_EN10MB" + } + + url = app.url_path_for("compute:start_vpcs_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.start_capture") as mock: + response = await compute_client.post(url, json=params) + assert response.status_code == status.HTTP_200_OK + assert mock.called + assert "test.pcap" in response.json()["pcap_file_path"] + + + async def test_vpcs_stop_capture(self, app: FastAPI, compute_client: AsyncClient, vm: dict) -> None: + + url = app.url_path_for("compute:stop_vpcs_node_capture", + project_id=vm["project_id"], + node_id=vm["node_id"], + adapter_number="0", + port_number="0") + + with patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.is_running", return_value=True): + with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.stop_capture") as mock: + response = await compute_client.post(url) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + # @pytest.mark.asyncio + # async def test_vpcs_pcap(self, app: FastAPI, compute_client: AsyncClient, vm, compute_project: Project): + # + # with asyncio_patch("gns3server.compute.vpcs.vpcs_vm.VPCSVM.get_nio"): + # with asyncio_patch("gns3server.compute.vpcs.VPCS.stream_pcap_file"): + # response = await compute_client.get("/projects/{project_id}/vpcs/nodes/{node_id}/adapters/0/ports/0/pcap".format(project_id=compute_project.id, node_id=vm["node_id"]), raw=True) + # assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/controller/test_controller.py b/tests/api/routes/controller/test_controller.py index 50c64c73..ddd33aa8 100644 --- a/tests/api/routes/controller/test_controller.py +++ b/tests/api/routes/controller/test_controller.py @@ -27,43 +27,45 @@ from gns3server.config import Config pytestmark = pytest.mark.asyncio -async def test_shutdown_local(app: FastAPI, client: AsyncClient, config: Config) -> None: +class TestControllerRoutes: - os.kill = MagicMock() - config.settings.Server.local = True - response = await client.post(app.url_path_for("shutdown")) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert os.kill.called - - -async def test_shutdown_non_local(app: FastAPI, client: AsyncClient, config: Config) -> None: - - response = await client.post(app.url_path_for("shutdown")) - assert response.status_code == status.HTTP_403_FORBIDDEN - - -# @pytest.mark.asyncio -# async def test_debug(controller_api, config, tmpdir): -# -# config._main_config_file = str(tmpdir / "test.conf") -# config.set("Server", "local", True) -# response = await controller_api.post('/debug') -# assert response.status_code == 201 -# debug_dir = os.path.join(config.config_dir, "debug") -# assert os.path.exists(debug_dir) -# assert os.path.exists(os.path.join(debug_dir, "controller.txt")) -# -# -# @pytest.mark.asyncio -# async def test_debug_non_local(controller_api, config, tmpdir): -# -# config._main_config_file = str(tmpdir / "test.conf") -# config.set("Server", "local", False) -# response = await controller_api.post('/debug') -# assert response.status_code == 403 - - -async def test_statistics_output(app: FastAPI, client: AsyncClient) -> None: - - response = await client.get(app.url_path_for("statistics")) - assert response.status_code == status.HTTP_200_OK + async def test_shutdown_local(self, app: FastAPI, client: AsyncClient, config: Config) -> None: + + os.kill = MagicMock() + config.settings.Server.local = True + response = await client.post(app.url_path_for("shutdown")) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert os.kill.called + + + async def test_shutdown_non_local(self, app: FastAPI, client: AsyncClient, config: Config) -> None: + + response = await client.post(app.url_path_for("shutdown")) + assert response.status_code == status.HTTP_403_FORBIDDEN + + + # @pytest.mark.asyncio + # async def test_debug(controller_api, config, tmpdir): + # + # config._main_config_file = str(tmpdir / "test.conf") + # config.set("Server", "local", True) + # response = await controller_api.post('/debug') + # assert response.status_code == 201 + # debug_dir = os.path.join(config.config_dir, "debug") + # assert os.path.exists(debug_dir) + # assert os.path.exists(os.path.join(debug_dir, "controller.txt")) + # + # + # @pytest.mark.asyncio + # async def test_debug_non_local(controller_api, config, tmpdir): + # + # config._main_config_file = str(tmpdir / "test.conf") + # config.set("Server", "local", False) + # response = await controller_api.post('/debug') + # assert response.status_code == 403 + + + async def test_statistics_output(self, app: FastAPI, client: AsyncClient) -> None: + + response = await client.get(app.url_path_for("statistics")) + assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/controller/test_drawings.py b/tests/api/routes/controller/test_drawings.py index c5fcec38..62f00d5f 100644 --- a/tests/api/routes/controller/test_drawings.py +++ b/tests/api/routes/controller/test_drawings.py @@ -26,89 +26,91 @@ from gns3server.controller.project import Project pytestmark = pytest.mark.asyncio -async def test_create_drawing(app: FastAPI, client: AsyncClient, project: Project) -> None: +class TestDrawingsRoutes: - params = { - "svg": '', - "x": 10, - "y": 20, - "z": 0 - } - - response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["drawing_id"] is not None - - -async def test_get_drawing(app: FastAPI, client: AsyncClient, project: Project) -> None: - - params = { - "svg": '', - "x": 10, - "y": 20, - "z": 0 - } - - response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) - response = await client.get(app.url_path_for( - "get_drawing", - project_id=project.id, - drawing_id=response.json()["drawing_id"]) - ) - assert response.status_code == 200 - assert response.json()["x"] == 10 - - -async def test_update_drawing(app: FastAPI, client: AsyncClient, project: Project) -> None: - - params = { - "svg": '', - "x": 10, - "y": 20, - "z": 0 - } - - response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) - response = await client.put(app.url_path_for( - "update_drawing", - project_id=project.id, - drawing_id=response.json()["drawing_id"]), - json={"x": 42} - ) - - assert response.status_code == status.HTTP_200_OK - assert response.json()["x"] == 42 - - -async def test_all_drawings(app: FastAPI, client: AsyncClient, project: Project) -> None: - - params = { - "svg": '', - "x": 10, - "y": 20, - "z": 0 - } - - await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) - response = await client.get(app.url_path_for("get_drawings", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) == 1 - - # test listing links from a closed project - await project.close(ignore_notification=True) - response = await client.get(app.url_path_for("get_drawings", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) == 1 - - -async def test_delete_drawing(app: FastAPI, client: AsyncClient, project: Project) -> None: - - drawing = Drawing(project) - project._drawings = {drawing.id: drawing} - response = await client.delete(app.url_path_for( - "delete_drawing", - project_id=project.id, - drawing_id=drawing.id) - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert drawing.id not in project.drawings + async def test_create_drawing(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + params = { + "svg": '', + "x": 10, + "y": 20, + "z": 0 + } + + response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["drawing_id"] is not None + + + async def test_get_drawing(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + params = { + "svg": '', + "x": 10, + "y": 20, + "z": 0 + } + + response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) + response = await client.get(app.url_path_for( + "get_drawing", + project_id=project.id, + drawing_id=response.json()["drawing_id"]) + ) + assert response.status_code == 200 + assert response.json()["x"] == 10 + + + async def test_update_drawing(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + params = { + "svg": '', + "x": 10, + "y": 20, + "z": 0 + } + + response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) + response = await client.put(app.url_path_for( + "update_drawing", + project_id=project.id, + drawing_id=response.json()["drawing_id"]), + json={"x": 42} + ) + + assert response.status_code == status.HTTP_200_OK + assert response.json()["x"] == 42 + + + async def test_all_drawings(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + params = { + "svg": '', + "x": 10, + "y": 20, + "z": 0 + } + + await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) + response = await client.get(app.url_path_for("get_drawings", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) == 1 + + # test listing links from a closed project + await project.close(ignore_notification=True) + response = await client.get(app.url_path_for("get_drawings", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) == 1 + + + async def test_delete_drawing(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + drawing = Drawing(project) + project._drawings = {drawing.id: drawing} + response = await client.delete(app.url_path_for( + "delete_drawing", + project_id=project.id, + drawing_id=drawing.id) + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert drawing.id not in project.drawings diff --git a/tests/api/routes/controller/test_gns3vm.py b/tests/api/routes/controller/test_gns3vm.py index bb41f1ce..ce10bfb8 100644 --- a/tests/api/routes/controller/test_gns3vm.py +++ b/tests/api/routes/controller/test_gns3vm.py @@ -24,32 +24,34 @@ from tests.utils import asyncio_patch pytestmark = pytest.mark.asyncio -async def test_list_vms(app: FastAPI, client: AsyncClient) -> None: +class TestGNS3VMRoutes: - with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.list", return_value=[{"vmname": "test"}]): - response = await client.get(app.url_path_for("get_vms", engine="vmware")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == [ - { - "vmname": "test" - } - ] - - -async def test_engines(app: FastAPI, client: AsyncClient) -> None: - - response = await client.get(app.url_path_for("get_engines")) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) > 0 - - -async def test_put_gns3vm(app: FastAPI, client: AsyncClient) -> None: - - response = await client.put(app.url_path_for("update_gns3vm_settings"), json={"vmname": "TEST VM"}) - assert response.status_code == status.HTTP_200_OK - assert response.json()["vmname"] == "TEST VM" - - -async def test_get_gns3vm(app: FastAPI, client: AsyncClient) -> None: - response = await client.get(app.url_path_for("get_gns3vm_settings")) - assert response.status_code == status.HTTP_200_OK + async def test_list_vms(self, app: FastAPI, client: AsyncClient) -> None: + + with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.list", return_value=[{"vmname": "test"}]): + response = await client.get(app.url_path_for("get_vms", engine="vmware")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == [ + { + "vmname": "test" + } + ] + + + async def test_engines(self, app: FastAPI, client: AsyncClient) -> None: + + response = await client.get(app.url_path_for("get_engines")) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) > 0 + + + async def test_put_gns3vm(self, app: FastAPI, client: AsyncClient) -> None: + + response = await client.put(app.url_path_for("update_gns3vm_settings"), json={"vmname": "TEST VM"}) + assert response.status_code == status.HTTP_200_OK + assert response.json()["vmname"] == "TEST VM" + + + async def test_get_gns3vm(self, app: FastAPI, client: AsyncClient) -> None: + response = await client.get(app.url_path_for("get_gns3vm_settings")) + assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/controller/test_links.py b/tests/api/routes/controller/test_links.py index ab6bf476..2103ddaa 100644 --- a/tests/api/routes/controller/test_links.py +++ b/tests/api/routes/controller/test_links.py @@ -35,30 +35,88 @@ from gns3server.controller.udp_link import UDPLink pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture -async def nodes(compute: Compute, project: Project) -> Tuple[Node, Node]: +class TestLinkRoutes: - response = MagicMock() - response.json = {"console": 2048} - compute.post = AsyncioMagicMock(return_value=response) - - node1 = await project.add_node(compute, "node1", None, node_type="qemu") - node1._ports = [EthernetPort("E0", 0, 0, 3)] - node2 = await project.add_node(compute, "node2", None, node_type="qemu") - node2._ports = [EthernetPort("E0", 0, 2, 4)] - return node1, node2 - - -async def test_create_link(app: FastAPI, client: AsyncClient, project: Project, nodes: Tuple[Node, Node]) -> None: - - node1, node2 = nodes - - filters = { - "latency": [10], - "frequency_drop": [50] - } - - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + @pytest_asyncio.fixture + async def nodes(self, compute: Compute, project: Project) -> Tuple[Node, Node]: + + response = MagicMock() + response.json = {"console": 2048} + compute.post = AsyncioMagicMock(return_value=response) + + node1 = await project.add_node(compute, "node1", None, node_type="qemu") + node1._ports = [EthernetPort("E0", 0, 0, 3)] + node2 = await project.add_node(compute, "node2", None, node_type="qemu") + node2._ports = [EthernetPort("E0", 0, 2, 4)] + return node1, node2 + + + async def test_create_link( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + nodes: Tuple[Node, Node] + ) -> None: + + node1, node2 = nodes + + filters = { + "latency": [10], + "frequency_drop": [50] + } + + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ + "nodes": [ + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 3, + "label": { + "text": "Text", + "x": 42, + "y": 0 + } + }, + { + "node_id": node2.id, + "adapter_number": 2, + "port_number": 4 + } + ], + "filters": filters + }) + + assert mock.called + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["link_id"] is not None + assert len(response.json()["nodes"]) == 2 + assert response.json()["nodes"][0]["label"]["x"] == 42 + assert len(project.links) == 1 + assert list(project.links.values())[0].filters == filters + + + async def test_create_link_failure( + self, + app: FastAPI, + client: AsyncClient, + compute: Compute, + project: Project + ) -> None: + """ + Make sure the link is deleted if we failed to create it. + + The failure is triggered by connecting the link to itself + """ + + response = MagicMock() + response.json = {"console": 2048} + compute.post = AsyncioMagicMock(return_value=response) + + node1 = await project.add_node(compute, "node1", None, node_type="qemu") + node1._ports = [EthernetPort("E0", 0, 0, 3), EthernetPort("E0", 0, 0, 4)] + response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ "nodes": [ { @@ -71,6 +129,168 @@ async def test_create_link(app: FastAPI, client: AsyncClient, project: Project, "y": 0 } }, + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 4 + } + ] + }) + + assert response.status_code == status.HTTP_409_CONFLICT + assert len(project.links) == 0 + + + async def test_get_link( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + nodes: Tuple[Node, Node] + ) -> None: + + node1, node2 = nodes + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ + "nodes": [ + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 3, + "label": { + "text": "Text", + "x": 42, + "y": 0 + } + }, + { + "node_id": node2.id, + "adapter_number": 2, + "port_number": 4 + } + ] + }) + + assert mock.called + link_id = response.json()["link_id"] + assert response.json()["nodes"][0]["label"]["x"] == 42 + response = await client.get(app.url_path_for("get_link", project_id=project.id, link_id=link_id)) + assert response.status_code == status.HTTP_200_OK + assert response.json()["nodes"][0]["label"]["x"] == 42 + + + async def test_update_link_suspend( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + nodes: Tuple[Node, Node] + ) -> None: + + node1, node2 = nodes + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ + "nodes": [ + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 3, + "label": { + "text": "Text", + "x": 42, + "y": 0 + } + }, + { + "node_id": node2.id, + "adapter_number": 2, + "port_number": 4 + } + ] + }) + + assert mock.called + link_id = response.json()["link_id"] + assert response.json()["nodes"][0]["label"]["x"] == 42 + + response = await client.put(app.url_path_for("update_link", project_id=project.id, link_id=link_id), json={ + "nodes": [ + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 3, + "label": { + "text": "Hello", + "x": 64, + "y": 0 + } + }, + { + "node_id": node2.id, + "adapter_number": 2, + "port_number": 4 + } + ], + "suspend": True + }) + + assert response.status_code == status.HTTP_200_OK + assert response.json()["nodes"][0]["label"]["x"] == 64 + assert response.json()["suspend"] + assert response.json()["filters"] == {} + + + async def test_update_link( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + nodes: Tuple[Node, Node] + ) -> None: + + filters = { + "latency": [10], + "frequency_drop": [50] + } + + node1, node2 = nodes + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ + "nodes": [ + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 3, + "label": { + "text": "Text", + "x": 42, + "y": 0 + } + }, + { + "node_id": node2.id, + "adapter_number": 2, + "port_number": 4 + } + ] + }) + + assert mock.called + link_id = response.json()["link_id"] + assert response.json()["nodes"][0]["label"]["x"] == 42 + + response = await client.put(app.url_path_for("update_link", project_id=project.id, link_id=link_id), json={ + "nodes": [ + { + "node_id": node1.id, + "adapter_number": 0, + "port_number": 3, + "label": { + "text": "Hello", + "x": 64, + "y": 0 + } + }, { "node_id": node2.id, "adapter_number": 2, @@ -79,309 +299,127 @@ async def test_create_link(app: FastAPI, client: AsyncClient, project: Project, ], "filters": filters }) - - assert mock.called - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["link_id"] is not None - assert len(response.json()["nodes"]) == 2 - assert response.json()["nodes"][0]["label"]["x"] == 42 - assert len(project.links) == 1 - assert list(project.links.values())[0].filters == filters - - -async def test_create_link_failure(app: FastAPI, client: AsyncClient, compute: Compute, project: Project) -> None: - """ - Make sure the link is deleted if we failed to create it. - - The failure is triggered by connecting the link to itself - """ - - response = MagicMock() - response.json = {"console": 2048} - compute.post = AsyncioMagicMock(return_value=response) - - node1 = await project.add_node(compute, "node1", None, node_type="qemu") - node1._ports = [EthernetPort("E0", 0, 0, 3), EthernetPort("E0", 0, 0, 4)] - - response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ - "nodes": [ + + assert response.status_code == status.HTTP_200_OK + assert response.json()["nodes"][0]["label"]["x"] == 64 + assert list(project.links.values())[0].filters == filters + + + async def test_list_link( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + nodes: Tuple[Node, Node] + ) -> None: + + filters = { + "latency": [10], + "frequency_drop": [50] + } + + node1, node2 = nodes + nodes = [ { "node_id": node1.id, "adapter_number": 0, - "port_number": 3, - "label": { - "text": "Text", - "x": 42, - "y": 0 - } + "port_number": 3 }, { - "node_id": node1.id, - "adapter_number": 0, + "node_id": node2.id, + "adapter_number": 2, "port_number": 4 } ] - }) - - assert response.status_code == status.HTTP_409_CONFLICT - assert len(project.links) == 0 - - -async def test_get_link(app: FastAPI, client: AsyncClient, project: Project, nodes: Tuple[Node, Node]) -> None: - - node1, node2 = nodes - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: - response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ - "nodes": [ - { - "node_id": node1.id, - "adapter_number": 0, - "port_number": 3, - "label": { - "text": "Text", - "x": 42, - "y": 0 - } - }, - { - "node_id": node2.id, - "adapter_number": 2, - "port_number": 4 - } - ] - }) - - assert mock.called - link_id = response.json()["link_id"] - assert response.json()["nodes"][0]["label"]["x"] == 42 - response = await client.get(app.url_path_for("get_link", project_id=project.id, link_id=link_id)) - assert response.status_code == status.HTTP_200_OK - assert response.json()["nodes"][0]["label"]["x"] == 42 - - -async def test_update_link_suspend(app: FastAPI, client: AsyncClient, project: Project, nodes: Tuple[Node, Node]) -> None: - - node1, node2 = nodes - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: - response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ - "nodes": [ - { - "node_id": node1.id, - "adapter_number": 0, - "port_number": 3, - "label": { - "text": "Text", - "x": 42, - "y": 0 - } - }, - { - "node_id": node2.id, - "adapter_number": 2, - "port_number": 4 - } - ] - }) - - assert mock.called - link_id = response.json()["link_id"] - assert response.json()["nodes"][0]["label"]["x"] == 42 - - response = await client.put(app.url_path_for("update_link", project_id=project.id, link_id=link_id), json={ - "nodes": [ - { - "node_id": node1.id, - "adapter_number": 0, - "port_number": 3, - "label": { - "text": "Hello", - "x": 64, - "y": 0 - } - }, - { - "node_id": node2.id, - "adapter_number": 2, - "port_number": 4 - } - ], - "suspend": True - }) - - assert response.status_code == status.HTTP_200_OK - assert response.json()["nodes"][0]["label"]["x"] == 64 - assert response.json()["suspend"] - assert response.json()["filters"] == {} - - -async def test_update_link(app: FastAPI, client: AsyncClient, project: Project, nodes: Tuple[Node, Node]) -> None: - - filters = { - "latency": [10], - "frequency_drop": [50] - } - - node1, node2 = nodes - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: - response = await client.post(app.url_path_for("create_link", project_id=project.id), json={ - "nodes": [ - { - "node_id": node1.id, - "adapter_number": 0, - "port_number": 3, - "label": { - "text": "Text", - "x": 42, - "y": 0 - } - }, - { - "node_id": node2.id, - "adapter_number": 2, - "port_number": 4 - } - ] - }) - - assert mock.called - link_id = response.json()["link_id"] - assert response.json()["nodes"][0]["label"]["x"] == 42 - - response = await client.put(app.url_path_for("update_link", project_id=project.id, link_id=link_id), json={ - "nodes": [ - { - "node_id": node1.id, - "adapter_number": 0, - "port_number": 3, - "label": { - "text": "Hello", - "x": 64, - "y": 0 - } - }, - { - "node_id": node2.id, - "adapter_number": 2, - "port_number": 4 - } - ], - "filters": filters - }) - - assert response.status_code == status.HTTP_200_OK - assert response.json()["nodes"][0]["label"]["x"] == 64 - assert list(project.links.values())[0].filters == filters - - -async def test_list_link(app: FastAPI, client: AsyncClient, project: Project, nodes: Tuple[Node, Node]) -> None: - - filters = { - "latency": [10], - "frequency_drop": [50] - } - - node1, node2 = nodes - nodes = [ - { - "node_id": node1.id, - "adapter_number": 0, - "port_number": 3 - }, - { - "node_id": node2.id, - "adapter_number": 2, - "port_number": 4 - } - ] - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: - await client.post(app.url_path_for("create_link", project_id=project.id), json={ - "nodes": nodes, - "filters": filters - }) - - assert mock.called - response = await client.get(app.url_path_for("get_links", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) == 1 - assert response.json()[0]["filters"] == filters - - # test listing links from a closed project - await project.close(ignore_notification=True) - response = await client.get(app.url_path_for("get_links", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) == 1 - assert response.json()[0]["filters"] == filters - - -async def test_reset_link(app: FastAPI, client: AsyncClient, project: Project) -> None: - - link = UDPLink(project) - project._links = {link.id: link} - with asyncio_patch("gns3server.controller.udp_link.UDPLink.delete") as delete_mock: - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as create_mock: - response = await client.post(app.url_path_for("reset_link", project_id=project.id, link_id=link.id)) - assert delete_mock.called - assert create_mock.called - assert response.status_code == status.HTTP_200_OK - - -async def test_start_capture(app: FastAPI, client: AsyncClient, project: Project) -> None: - - link = Link(project) - project._links = {link.id: link} - with asyncio_patch("gns3server.controller.link.Link.start_capture") as mock: - response = await client.post(app.url_path_for("start_capture", project_id=project.id, link_id=link.id), json={}) + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + await client.post(app.url_path_for("create_link", project_id=project.id), json={ + "nodes": nodes, + "filters": filters + }) + assert mock.called - assert response.status_code == status.HTTP_201_CREATED - - -async def test_stop_capture(app: FastAPI, client: AsyncClient, project: Project) -> None: - - link = Link(project) - project._links = {link.id: link} - with asyncio_patch("gns3server.controller.link.Link.stop_capture") as mock: - response = await client.post(app.url_path_for("stop_capture", project_id=project.id, link_id=link.id)) + response = await client.get(app.url_path_for("get_links", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) == 1 + assert response.json()[0]["filters"] == filters + + # test listing links from a closed project + await project.close(ignore_notification=True) + response = await client.get(app.url_path_for("get_links", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) == 1 + assert response.json()[0]["filters"] == filters + + + async def test_reset_link(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + link = UDPLink(project) + project._links = {link.id: link} + with asyncio_patch("gns3server.controller.udp_link.UDPLink.delete") as delete_mock: + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as create_mock: + response = await client.post(app.url_path_for("reset_link", project_id=project.id, link_id=link.id)) + assert delete_mock.called + assert create_mock.called + assert response.status_code == status.HTTP_200_OK + + + async def test_start_capture(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + link = Link(project) + project._links = {link.id: link} + with asyncio_patch("gns3server.controller.link.Link.start_capture") as mock: + response = await client.post(app.url_path_for("start_capture", project_id=project.id, link_id=link.id), json={}) + assert mock.called + assert response.status_code == status.HTTP_201_CREATED + + + async def test_stop_capture(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + link = Link(project) + project._links = {link.id: link} + with asyncio_patch("gns3server.controller.link.Link.stop_capture") as mock: + response = await client.post(app.url_path_for("stop_capture", project_id=project.id, link_id=link.id)) + assert mock.called + assert response.status_code == status.HTTP_204_NO_CONTENT + + + # async def test_pcap(controller_api, http_client, project): + # + # async def pcap_capture(): + # async with http_client.get(controller_api.get_url("/projects/{}/links/{}/pcap".format(project.id, link.id))) as response: + # response.body = await response.content.read(5) + # print("READ", response.body) + # return response + # + # with asyncio_patch("gns3server.controller.link.Link.capture_node") as mock: + # link = Link(project) + # link._capture_file_name = "test" + # link._capturing = True + # with open(link.capture_file_path, "w+") as f: + # f.write("hello") + # project._links = {link.id: link} + # response = await pcap_capture() + # assert mock.called + # assert response.status_code == 200 + # assert b'hello' == response.body + + + async def test_delete_link(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + link = Link(project) + project._links = {link.id: link} + with asyncio_patch("gns3server.controller.link.Link.delete") as mock: + response = await client.delete(app.url_path_for("delete_link", project_id=project.id, link_id=link.id)) assert mock.called assert response.status_code == status.HTTP_204_NO_CONTENT - - -# async def test_pcap(controller_api, http_client, project): -# -# async def pcap_capture(): -# async with http_client.get(controller_api.get_url("/projects/{}/links/{}/pcap".format(project.id, link.id))) as response: -# response.body = await response.content.read(5) -# print("READ", response.body) -# return response -# -# with asyncio_patch("gns3server.controller.link.Link.capture_node") as mock: -# link = Link(project) -# link._capture_file_name = "test" -# link._capturing = True -# with open(link.capture_file_path, "w+") as f: -# f.write("hello") -# project._links = {link.id: link} -# response = await pcap_capture() -# assert mock.called -# assert response.status_code == 200 -# assert b'hello' == response.body - - -async def test_delete_link(app: FastAPI, client: AsyncClient, project: Project) -> None: - - link = Link(project) - project._links = {link.id: link} - with asyncio_patch("gns3server.controller.link.Link.delete") as mock: - response = await client.delete(app.url_path_for("delete_link", project_id=project.id, link_id=link.id)) - assert mock.called - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_list_filters(app: FastAPI, client: AsyncClient, project: Project) -> None: - - link = Link(project) - project._links = {link.id: link} - with patch("gns3server.controller.link.Link.available_filters", return_value=FILTERS) as mock: - response = await client.get(app.url_path_for("get_filters", project_id=project.id, link_id=link.id)) - assert mock.called - assert response.status_code == status.HTTP_200_OK - assert response.json() == FILTERS + + + async def test_list_filters(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + link = Link(project) + project._links = {link.id: link} + with patch("gns3server.controller.link.Link.available_filters", return_value=FILTERS) as mock: + response = await client.get(app.url_path_for("get_filters", project_id=project.id, link_id=link.id)) + assert mock.called + assert response.status_code == status.HTTP_200_OK + assert response.json() == FILTERS diff --git a/tests/api/routes/controller/test_nodes.py b/tests/api/routes/controller/test_nodes.py index 534fe136..46f42e4a 100644 --- a/tests/api/routes/controller/test_nodes.py +++ b/tests/api/routes/controller/test_nodes.py @@ -31,416 +31,537 @@ from gns3server.controller.compute import Compute pytestmark = pytest.mark.asyncio -@pytest.fixture -def node(project: Project, compute: Compute) -> Node: - - node = Node(project, compute, "test", node_type="vpcs") - project._nodes[node.id] = node - return node - - -async def test_create_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - response = MagicMock() - response.json = {"console": 2048} - compute.post = AsyncioMagicMock(return_value=response) - - response = await client.post(app.url_path_for("create_node", project_id=project.id), json={ - "name": "test", - "node_type": "vpcs", - "compute_id": "example.com", - "properties": { - "startup_script": "echo test" - } - }) - - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "test" - assert "name" not in response.json()["properties"] - - -async def test_list_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - response = MagicMock() - response.json = {"console": 2048} - compute.post = AsyncioMagicMock(return_value=response) - - await client.post(app.url_path_for("create_node", project_id=project.id), json={ - "name": "test", - "node_type": "vpcs", - "compute_id": "example.com", - "properties": { - "startup_script": "echo test" - } - }) - - response = await client.get(app.url_path_for("get_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert response.json()[0]["name"] == "test" - - # test listing nodes from a closed project - await project.close(ignore_notification=True) - response = await client.get(app.url_path_for("get_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert response.json()[0]["name"] == "test" - - -async def test_get_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - response = MagicMock() - response.json = {"console": 2048} - compute.post = AsyncioMagicMock(return_value=response) - - response = await client.post(app.url_path_for("create_node", project_id=project.id), json={ - "name": "test", - "node_type": "vpcs", - "compute_id": "example.com", - "properties": { - "startup_script": "echo test" - } - }) - - response = await client.get(app.url_path_for("get_node", project_id=project.id, node_id=response.json()["node_id"])) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - - -async def test_update_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - response = MagicMock() - response.json = {"console": 2048} - compute.put = AsyncioMagicMock(return_value=response) - - response = await client.put(app.url_path_for("update_node", project_id=project.id, node_id=node.id), json={ - "name": "test", - "node_type": "vpcs", - "compute_id": "example.com", - "properties": { - "startup_script": "echo test" - } - }) - - assert response.status_code == 200 - assert response.json()["name"] == "test" - assert "name" not in response.json()["properties"] - - -async def test_start_all_nodes(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("start_all_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_stop_all_nodes(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("stop_all_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_suspend_all_nodes(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("suspend_all_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_reload_all_nodes(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("reload_all_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_reset_console_all_nodes(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("reset_console_all_nodes", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_start_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("start_node", project_id=project.id, node_id=node.id), json={}) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_stop_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("stop_node", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - -async def test_suspend_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("suspend_node", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_reload_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node): - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("reload_node", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_isolate_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node): - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("isolate_node", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_unisolate_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node): - - compute.post = AsyncioMagicMock() - response = await client.post(app.url_path_for("unisolate_node", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_duplicate_node( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node) -> None: - - response = MagicMock() - response.json({"console": 2035}) - compute.post = AsyncioMagicMock(return_value=response) - - response = await client.post(app.url_path_for("duplicate_node", project_id=project.id, node_id=node.id), - json={"x": 10, "y": 5, "z": 0}) - assert response.status_code == status.HTTP_201_CREATED - - -async def test_delete_node(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - compute.post = AsyncioMagicMock() - response = await client.delete(app.url_path_for("delete_node", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_dynamips_idle_pc( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = MagicMock() - response.json = {"idlepc": "0x60606f54"} - compute.get = AsyncioMagicMock(return_value=response) - - node._node_type = "dynamips" # force Dynamips node type - response = await client.get(app.url_path_for("auto_idlepc", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_200_OK - assert response.json()["idlepc"] == "0x60606f54" - - -async def test_dynamips_idle_pc_wrong_node_type( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = await client.get(app.url_path_for("auto_idlepc", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_400_BAD_REQUEST - - -async def test_dynamips_idlepc_proposals( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = MagicMock() - response.json = ["0x60606f54", "0x33805a22"] - compute.get = AsyncioMagicMock(return_value=response) - - node._node_type = "dynamips" # force Dynamips node type - response = await client.get(app.url_path_for("idlepc_proposals", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_200_OK - assert response.json() == ["0x60606f54", "0x33805a22"] - - -async def test_dynamips_idlepc_proposals_wrong_node_type( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = await client.get(app.url_path_for("idlepc_proposals", project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_400_BAD_REQUEST - - -async def test_qemu_disk_image_create( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = MagicMock() - compute.post = AsyncioMagicMock(return_value=response) - - node._node_type = "qemu" # force Qemu node type - response = await client.post( - app.url_path_for("create_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), - json={"format": "qcow2", "size": 30} - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_disk_image_create_wrong_node_type( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = await client.post( - app.url_path_for("create_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), - json={"format": "qcow2", "size": 30} - ) - assert response.status_code == status.HTTP_400_BAD_REQUEST - - -async def test_qemu_disk_image_update( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = MagicMock() - compute.put = AsyncioMagicMock(return_value=response) - - node._node_type = "qemu" # force Qemu node type - response = await client.put( - app.url_path_for("update_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), - json={"extend": 10} - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_disk_image_update_wrong_node_type( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = await client.put( - app.url_path_for("update_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), - json={"extend": 10} - ) - assert response.status_code == status.HTTP_400_BAD_REQUEST - - -async def test_qemu_disk_image_delete( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = MagicMock() - compute.delete = AsyncioMagicMock(return_value=response) - - node._node_type = "qemu" # force Qemu node type - response = await client.delete( - app.url_path_for("delete_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2") - ) - assert response.status_code == status.HTTP_204_NO_CONTENT - - -async def test_qemu_disk_image_delete_wrong_node_type( - app: FastAPI, - client: AsyncClient, - project: Project, - compute: Compute, - node: Node -) -> None: - - response = await client.delete( - app.url_path_for("delete_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2") - ) - assert response.status_code == status.HTTP_400_BAD_REQUEST - - -async def test_get_file(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - response = MagicMock() - response.body = b"world" - response.status = status.HTTP_200_OK - compute.http_query = AsyncioMagicMock(return_value=response) - - response = await client.get(app.url_path_for("get_file", project_id=project.id, node_id=node.id, file_path="hello")) - assert response.status_code == status.HTTP_200_OK - assert response.content == b'world' - - compute.http_query.assert_called_with( - "GET", - "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format( +class TestNodeRoutes: + + + @pytest.fixture + def node(self, project: Project, compute: Compute) -> Node: + + node = Node(project, compute, "test", node_type="vpcs") + project._nodes[node.id] = node + return node + + + async def test_create_node(self, app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: + + response = MagicMock() + response.json = {"console": 2048} + compute.post = AsyncioMagicMock(return_value=response) + + response = await client.post(app.url_path_for("create_node", project_id=project.id), json={ + "name": "test", + "node_type": "vpcs", + "compute_id": "example.com", + "properties": { + "startup_script": "echo test" + } + }) + + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "test" + assert "name" not in response.json()["properties"] + + + async def test_list_node(self, app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: + + response = MagicMock() + response.json = {"console": 2048} + compute.post = AsyncioMagicMock(return_value=response) + + await client.post(app.url_path_for("create_node", project_id=project.id), json={ + "name": "test", + "node_type": "vpcs", + "compute_id": "example.com", + "properties": { + "startup_script": "echo test" + } + }) + + response = await client.get(app.url_path_for("get_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert response.json()[0]["name"] == "test" + + # test listing nodes from a closed project + await project.close(ignore_notification=True) + response = await client.get(app.url_path_for("get_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert response.json()[0]["name"] == "test" + + + async def test_get_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute + ) -> None: + + response = MagicMock() + response.json = {"console": 2048} + compute.post = AsyncioMagicMock(return_value=response) + + response = await client.post(app.url_path_for("create_node", project_id=project.id), json={ + "name": "test", + "node_type": "vpcs", + "compute_id": "example.com", + "properties": { + "startup_script": "echo test" + } + }) + + response = await client.get(app.url_path_for("get_node", project_id=project.id, node_id=response.json()["node_id"])) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + + + async def test_update_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + response.json = {"console": 2048} + compute.put = AsyncioMagicMock(return_value=response) + + response = await client.put(app.url_path_for("update_node", project_id=project.id, node_id=node.id), json={ + "name": "test", + "node_type": "vpcs", + "compute_id": "example.com", + "properties": { + "startup_script": "echo test" + } + }) + + assert response.status_code == 200 + assert response.json()["name"] == "test" + assert "name" not in response.json()["properties"] + + + async def test_start_all_nodes( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("start_all_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_stop_all_nodes( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("stop_all_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_suspend_all_nodes( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("suspend_all_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_reload_all_nodes( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("reload_all_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_reset_console_all_nodes( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("reset_console_all_nodes", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_start_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("start_node", project_id=project.id, node_id=node.id), json={}) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_stop_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("stop_node", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + async def test_suspend_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("suspend_node", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_reload_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ): + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("reload_node", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_isolate_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ): + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("isolate_node", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_unisolate_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.post(app.url_path_for("unisolate_node", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_duplicate_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + response.json({"console": 2035}) + compute.post = AsyncioMagicMock(return_value=response) + + response = await client.post(app.url_path_for("duplicate_node", project_id=project.id, node_id=node.id), + json={"x": 10, "y": 5, "z": 0}) + assert response.status_code == status.HTTP_201_CREATED + + + async def test_delete_node( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + compute.post = AsyncioMagicMock() + response = await client.delete(app.url_path_for("delete_node", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_dynamips_idle_pc( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + response.json = {"idlepc": "0x60606f54"} + compute.get = AsyncioMagicMock(return_value=response) + + node._node_type = "dynamips" # force Dynamips node type + response = await client.get(app.url_path_for("auto_idlepc", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_200_OK + assert response.json()["idlepc"] == "0x60606f54" + + + async def test_dynamips_idle_pc_wrong_node_type( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = await client.get(app.url_path_for("auto_idlepc", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_400_BAD_REQUEST + + + async def test_dynamips_idlepc_proposals( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + response.json = ["0x60606f54", "0x33805a22"] + compute.get = AsyncioMagicMock(return_value=response) + + node._node_type = "dynamips" # force Dynamips node type + response = await client.get(app.url_path_for("idlepc_proposals", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_200_OK + assert response.json() == ["0x60606f54", "0x33805a22"] + + + async def test_dynamips_idlepc_proposals_wrong_node_type( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = await client.get(app.url_path_for("idlepc_proposals", project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_400_BAD_REQUEST + + + async def test_qemu_disk_image_create( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + compute.post = AsyncioMagicMock(return_value=response) + + node._node_type = "qemu" # force Qemu node type + response = await client.post( + app.url_path_for("create_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), + json={"format": "qcow2", "size": 30} + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_disk_image_create_wrong_node_type( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = await client.post( + app.url_path_for("create_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), + json={"format": "qcow2", "size": 30} + ) + assert response.status_code == status.HTTP_400_BAD_REQUEST + + + async def test_qemu_disk_image_update( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + compute.put = AsyncioMagicMock(return_value=response) + + node._node_type = "qemu" # force Qemu node type + response = await client.put( + app.url_path_for("update_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), + json={"extend": 10} + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_disk_image_update_wrong_node_type( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = await client.put( + app.url_path_for("update_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2"), + json={"extend": 10} + ) + assert response.status_code == status.HTTP_400_BAD_REQUEST + + + async def test_qemu_disk_image_delete( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + compute.delete = AsyncioMagicMock(return_value=response) + + node._node_type = "qemu" # force Qemu node type + response = await client.delete( + app.url_path_for("delete_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2") + ) + assert response.status_code == status.HTTP_204_NO_CONTENT + + + async def test_qemu_disk_image_delete_wrong_node_type( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = await client.delete( + app.url_path_for("delete_disk_image", project_id=project.id, node_id=node.id, disk_name="hda_disk.qcow2") + ) + assert response.status_code == status.HTTP_400_BAD_REQUEST + + + async def test_get_file( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + response = MagicMock() + response.body = b"world" + response.status = status.HTTP_200_OK + compute.http_query = AsyncioMagicMock(return_value=response) + + response = await client.get(app.url_path_for("get_file", project_id=project.id, node_id=node.id, file_path="hello")) + assert response.status_code == status.HTTP_200_OK + assert response.content == b'world' + + compute.http_query.assert_called_with( + "GET", + "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format( + project_id=project.id, + node_id=node.id), + timeout=None, + raw=True) + + response = await client.get(app.url_path_for( + "get_file", project_id=project.id, - node_id=node.id), - timeout=None, - raw=True) - - response = await client.get(app.url_path_for( - "get_file", - project_id=project.id, - node_id=node.id, - file_path="../hello")) - assert response.status_code == status.HTTP_404_NOT_FOUND - - -async def test_post_file(app: FastAPI, client: AsyncClient, project: Project, compute: Compute, node: Node) -> None: - - compute.http_query = AsyncioMagicMock() - response = await client.post(app.url_path_for( - "post_file", - project_id=project.id, - node_id=node.id, - file_path="hello"), content=b"hello") - assert response.status_code == status.HTTP_201_CREATED - - compute.http_query.assert_called_with("POST", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format(project_id=project.id, node_id=node.id), data=b'hello', timeout=None, raw=True) - - response = await client.get("/projects/{project_id}/nodes/{node_id}/files/../hello".format(project_id=project.id, node_id=node.id)) - assert response.status_code == status.HTTP_404_NOT_FOUND - - -# @pytest.mark.asyncio -# async def test_get_and_post_with_nested_paths_normalization(controller_api, project, node, compute): -# -# response = MagicMock() -# response.body = b"world" -# compute.http_query = AsyncioMagicMock(return_value=response) -# response = await controller_api.get("/projects/{project_id}/nodes/{node_id}/files/hello\\nested".format(project_id=project.id, node_id=node.id)) -# assert response.status_code == 200 -# assert response.content == b'world' -# -# compute.http_query.assert_called_with("GET", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello/nested".format(project_id=project.id, node_id=node.id), timeout=None, raw=True) -# -# compute.http_query = AsyncioMagicMock() -# response = await controller_api.post("/projects/{project_id}/nodes/{node_id}/files/hello\\nested".format(project_id=project.id, node_id=node.id), body=b"hello", raw=True) -# assert response.status_code == 201 -# -# compute.http_query.assert_called_with("POST", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello/nested".format(project_id=project.id, node_id=node.id), data=b'hello', timeout=None, raw=True) + node_id=node.id, + file_path="../hello")) + assert response.status_code == status.HTTP_404_NOT_FOUND + + + async def test_post_file( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + compute: Compute, + node: Node + ) -> None: + + compute.http_query = AsyncioMagicMock() + response = await client.post(app.url_path_for( + "post_file", + project_id=project.id, + node_id=node.id, + file_path="hello"), content=b"hello") + assert response.status_code == status.HTTP_201_CREATED + + compute.http_query.assert_called_with("POST", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format(project_id=project.id, node_id=node.id), data=b'hello', timeout=None, raw=True) + + response = await client.get("/projects/{project_id}/nodes/{node_id}/files/../hello".format(project_id=project.id, node_id=node.id)) + assert response.status_code == status.HTTP_404_NOT_FOUND + + + # @pytest.mark.asyncio + # async def test_get_and_post_with_nested_paths_normalization(controller_api, project, node, compute): + # + # response = MagicMock() + # response.body = b"world" + # compute.http_query = AsyncioMagicMock(return_value=response) + # response = await controller_api.get("/projects/{project_id}/nodes/{node_id}/files/hello\\nested".format(project_id=project.id, node_id=node.id)) + # assert response.status_code == 200 + # assert response.content == b'world' + # + # compute.http_query.assert_called_with("GET", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello/nested".format(project_id=project.id, node_id=node.id), timeout=None, raw=True) + # + # compute.http_query = AsyncioMagicMock() + # response = await controller_api.post("/projects/{project_id}/nodes/{node_id}/files/hello\\nested".format(project_id=project.id, node_id=node.id), body=b"hello", raw=True) + # assert response.status_code == 201 + # + # compute.http_query.assert_called_with("POST", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello/nested".format(project_id=project.id, node_id=node.id), data=b'hello', timeout=None, raw=True) diff --git a/tests/api/routes/controller/test_projects.py b/tests/api/routes/controller/test_projects.py index e1eac28b..cd3439c0 100644 --- a/tests/api/routes/controller/test_projects.py +++ b/tests/api/routes/controller/test_projects.py @@ -34,491 +34,544 @@ from gns3server.controller.compute import Compute pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture -async def project(app: FastAPI, client: AsyncClient, controller: Controller) -> Project: +class TestControllerProjectRoutes: - project_id = str(uuid.uuid4()) - params = {"name": "test", "project_id": project_id} - await client.post(app.url_path_for("create_project"), json=params) - return controller.get_project(project_id) - - -async def test_create_project_with_path(app: FastAPI, client: AsyncClient, controller: Controller, config) -> None: - - params = {"name": "test", "path": str(config.settings.Server.projects_path), "project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f"} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "test" - assert response.json()["project_id"] == "00010203-0405-0607-0809-0a0b0c0d0e0f" - assert response.json()["status"] == "opened" - - -async def test_create_project_without_dir(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - params = {"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f"} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["project_id"] == "10010203-0405-0607-0809-0a0b0c0d0e0f" - assert response.json()["name"] == "test" - - -async def test_create_project_with_uuid(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - params = {"name": "test", "project_id": "30010203-0405-0607-0809-0a0b0c0d0e0f"} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == 201 - assert response.json()["project_id"] == "30010203-0405-0607-0809-0a0b0c0d0e0f" - assert response.json()["name"] == "test" - - -async def test_create_project_with_variables(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - variables = [ - {"name": "TEST1"}, - {"name": "TEST2", "value": "value1"} - ] - params = {"name": "test", "project_id": "30010203-0405-0607-0809-0a0b0c0d0e0f", "variables": variables} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == 201 - assert response.json()["variables"] == [ - {"name": "TEST1"}, - {"name": "TEST2", "value": "value1"} - ] - - -async def test_create_project_with_supplier(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - supplier = { - 'logo': 'logo.png', - 'url': 'http://example.com/' - } - params = {"name": "test", "project_id": "30010203-0405-0607-0809-0a0b0c0d0e0f", "supplier": supplier} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["supplier"] == supplier - - -async def test_update_project(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - params = {"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f"} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["project_id"] == "10010203-0405-0607-0809-0a0b0c0d0e0f" - assert response.json()["name"] == "test" - - params = {"name": "test2"} - response = await client.put(app.url_path_for("update_project", project_id="10010203-0405-0607-0809-0a0b0c0d0e0f"), - json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test2" - - -async def test_update_project_with_variables(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - variables = [ - {"name": "TEST1"}, - {"name": "TEST2", "value": "value1"} - ] - params = {"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f", "variables": variables} - response = await client.post(app.url_path_for("create_project"), json=params) - assert response.status_code == status.HTTP_201_CREATED - - params = {"name": "test2"} - response = await client.put(app.url_path_for("update_project", project_id="10010203-0405-0607-0809-0a0b0c0d0e0f"), - json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json()["variables"] == variables - - -async def test_list_projects(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - params = {"name": "test", "project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f"} - await client.post(app.url_path_for("create_project"), json=params) - response = await client.get(app.url_path_for("get_projects")) - assert response.status_code == status.HTTP_200_OK - projects = response.json() - assert projects[0]["name"] == "test" - - -async def test_get_project(app: FastAPI, client: AsyncClient, project: Project) -> None: - - response = await client.get(app.url_path_for("get_project", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert response.json()["name"] == "test" - - -async def test_delete_project(app: FastAPI, client: AsyncClient, project: Project, controller: Controller) -> None: - - with asyncio_patch("gns3server.controller.project.Project.delete", return_value=True) as mock: - response = await client.delete(app.url_path_for("delete_project", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called - assert project not in controller.projects - - -async def test_delete_project_invalid_uuid(app: FastAPI, client: AsyncClient) -> None: - - response = await client.delete(app.url_path_for("delete_project", project_id=str(uuid.uuid4()))) - assert response.status_code == status.HTTP_404_NOT_FOUND - - -async def test_close_project(app: FastAPI, client: AsyncClient, project: Project) -> None: - - with asyncio_patch("gns3server.controller.project.Project.close", return_value=True) as mock: - response = await client.post(app.url_path_for("close_project", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert mock.called - - -async def test_open_project(app: FastAPI, client: AsyncClient, project: Project) -> None: - - with asyncio_patch("gns3server.controller.project.Project.open", return_value=True) as mock: - response = await client.post(app.url_path_for("open_project", project_id=project.id)) + @pytest_asyncio.fixture + async def project(self, app: FastAPI, client: AsyncClient, controller: Controller) -> Project: + + project_id = str(uuid.uuid4()) + params = {"name": "test", "project_id": project_id} + await client.post(app.url_path_for("create_project"), json=params) + return controller.get_project(project_id) + + + async def test_create_project_with_path( + self, + app: FastAPI, + client: AsyncClient, + controller: Controller, + config + ) -> None: + + params = {"name": "test", "path": str(config.settings.Server.projects_path), "project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f"} + response = await client.post(app.url_path_for("create_project"), json=params) assert response.status_code == status.HTTP_201_CREATED - assert mock.called - - -async def test_load_project(app: FastAPI, client: AsyncClient, project: Project, config) -> None: - - with asyncio_patch("gns3server.controller.Controller.load_project", return_value=project) as mock: - response = await client.post(app.url_path_for("load_project"), json={"path": "/tmp/test.gns3"}) + assert response.json()["name"] == "test" + assert response.json()["project_id"] == "00010203-0405-0607-0809-0a0b0c0d0e0f" + assert response.json()["status"] == "opened" + + + async def test_create_project_without_dir( + self, + app: FastAPI, + client: AsyncClient, + controller: Controller + ) -> None: + + params = {"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f"} + response = await client.post(app.url_path_for("create_project"), json=params) assert response.status_code == status.HTTP_201_CREATED - mock.assert_called_with("/tmp/test.gns3") - assert response.json()["project_id"] == project.id + assert response.json()["project_id"] == "10010203-0405-0607-0809-0a0b0c0d0e0f" + assert response.json()["name"] == "test" + + + async def test_create_project_with_uuid( + self, + app: FastAPI, + client: AsyncClient, + controller: Controller + ) -> None: + + params = {"name": "test", "project_id": "30010203-0405-0607-0809-0a0b0c0d0e0f"} + response = await client.post(app.url_path_for("create_project"), json=params) + assert response.status_code == 201 + assert response.json()["project_id"] == "30010203-0405-0607-0809-0a0b0c0d0e0f" + assert response.json()["name"] == "test" + + + async def test_create_project_with_variables( + self, + app: FastAPI, + client: AsyncClient, + controller: Controller + ) -> None: + + variables = [ + {"name": "TEST1"}, + {"name": "TEST2", "value": "value1"} + ] + params = {"name": "test", "project_id": "30010203-0405-0607-0809-0a0b0c0d0e0f", "variables": variables} + response = await client.post(app.url_path_for("create_project"), json=params) + assert response.status_code == 201 + assert response.json()["variables"] == [ + {"name": "TEST1"}, + {"name": "TEST2", "value": "value1"} + ] + - -# @pytest.mark.asyncio -# async def test_notification(controller_api, http_client, project, controller): -# -# async with http_client.get(controller_api.get_url("/projects/{project_id}/notifications".format(project_id=project.id))) as response: -# response.body = await response.content.read(200) -# controller.notification.project_emit("node.created", {"a": "b"}) -# response.body += await response.content.readany() -# assert response.status_code == 200 -# assert b'"action": "ping"' in response.body -# assert b'"cpu_usage_percent"' in response.body -# assert b'{"action": "node.created", "event": {"a": "b"}}\n' in response.body -# assert project.status_code == "opened" -# -# -# @pytest.mark.asyncio -# async def test_notification_invalid_id(controller_api): -# -# response = await controller_api.get("/projects/{project_id}/notifications".format(project_id=uuid.uuid4())) -# assert response.status_code == 404 - - -# @pytest.mark.asyncio -# async def test_notification_ws(controller_api, http_client, controller, project): -# -# ws = await http_client.ws_connect(controller_api.get_url("/projects/{project_id}/notifications/ws".format(project_id=project.id))) -# answer = await ws.receive() -# answer = json.loads(answer.data) -# assert answer["action"] == "ping" -# -# controller.notification.project_emit("test", {}) -# answer = await ws.receive() -# answer = json.loads(answer.data) -# assert answer["action"] == "test" -# -# if not ws.closed: -# await ws.close() -# -# assert project.status_code == "opened" - - -async def test_export_with_images(app: FastAPI, client: AsyncClient, tmpdir, project: Project) -> None: - - project.dump = MagicMock() - os.makedirs(project.path, exist_ok=True) - with open(os.path.join(project.path, 'a'), 'w+') as f: - f.write('hello') - - os.makedirs(str(tmpdir / "IOS")) - with open(str(tmpdir / "IOS" / "test.image"), "w+") as f: - f.write("AAA") - - topology = { - "topology": { - "nodes": [ - { - "properties": { - "image": "test.image" - }, - "node_type": "dynamips" - } - ] + async def test_create_project_with_supplier( + self, + app: FastAPI, + client: AsyncClient, + controller: Controller + ) -> None: + + supplier = { + 'logo': 'logo.png', + 'url': 'http://example.com/' } - } - with open(os.path.join(project.path, "test.gns3"), 'w+') as f: - json.dump(topology, f) - - with patch("gns3server.compute.Dynamips.get_images_directory", return_value=str(tmpdir / "IOS")): - response = await client.get(app.url_path_for("export_project", project_id=project.id), - params={"include_images": "yes"}) - assert response.status_code == status.HTTP_200_OK - assert response.headers['CONTENT-TYPE'] == 'application/gns3project' - assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) - - with open(str(tmpdir / 'project.zip'), 'wb+') as f: - f.write(response.content) - - with zipfile_zstd.ZipFile(str(tmpdir / 'project.zip')) as myzip: - with myzip.open("a") as myfile: - content = myfile.read() - assert content == b"hello" - myzip.getinfo("images/IOS/test.image") - - -async def test_export_without_images(app: FastAPI, client: AsyncClient, tmpdir, project: Project) -> None: - - project.dump = MagicMock() - os.makedirs(project.path, exist_ok=True) - with open(os.path.join(project.path, 'a'), 'w+') as f: - f.write('hello') - - os.makedirs(str(tmpdir / "IOS")) - with open(str(tmpdir / "IOS" / "test.image"), "w+") as f: - f.write("AAA") - - topology = { - "topology": { - "nodes": [ - { - "properties": { - "image": "test.image" - }, - "node_type": "dynamips" - } - ] + params = {"name": "test", "project_id": "30010203-0405-0607-0809-0a0b0c0d0e0f", "supplier": supplier} + response = await client.post(app.url_path_for("create_project"), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["supplier"] == supplier + + + async def test_update_project(self, app: FastAPI, client: AsyncClient, controller: Controller) -> None: + + params = {"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f"} + response = await client.post(app.url_path_for("create_project"), json=params) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["project_id"] == "10010203-0405-0607-0809-0a0b0c0d0e0f" + assert response.json()["name"] == "test" + + params = {"name": "test2"} + response = await client.put(app.url_path_for("update_project", project_id="10010203-0405-0607-0809-0a0b0c0d0e0f"), + json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test2" + + + async def test_update_project_with_variables( + self, + app: FastAPI, + client: AsyncClient, + controller: Controller + ) -> None: + + variables = [ + {"name": "TEST1"}, + {"name": "TEST2", "value": "value1"} + ] + params = {"name": "test", "project_id": "10010203-0405-0607-0809-0a0b0c0d0e0f", "variables": variables} + response = await client.post(app.url_path_for("create_project"), json=params) + assert response.status_code == status.HTTP_201_CREATED + + params = {"name": "test2"} + response = await client.put(app.url_path_for("update_project", project_id="10010203-0405-0607-0809-0a0b0c0d0e0f"), + json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json()["variables"] == variables + + + async def test_list_projects(self, app: FastAPI, client: AsyncClient, controller: Controller) -> None: + + params = {"name": "test", "project_id": "00010203-0405-0607-0809-0a0b0c0d0e0f"} + await client.post(app.url_path_for("create_project"), json=params) + response = await client.get(app.url_path_for("get_projects")) + assert response.status_code == status.HTTP_200_OK + projects = response.json() + assert projects[0]["name"] == "test" + + + async def test_get_project(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + response = await client.get(app.url_path_for("get_project", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert response.json()["name"] == "test" + + + async def test_delete_project( + self, + app: FastAPI, + client: AsyncClient, + project: Project, + controller: Controller + ) -> None: + + with asyncio_patch("gns3server.controller.project.Project.delete", return_value=True) as mock: + response = await client.delete(app.url_path_for("delete_project", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + assert project not in controller.projects + + + async def test_delete_project_invalid_uuid(self, app: FastAPI, client: AsyncClient) -> None: + + response = await client.delete(app.url_path_for("delete_project", project_id=str(uuid.uuid4()))) + assert response.status_code == status.HTTP_404_NOT_FOUND + + + async def test_close_project(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + with asyncio_patch("gns3server.controller.project.Project.close", return_value=True) as mock: + response = await client.post(app.url_path_for("close_project", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert mock.called + + + async def test_open_project(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + with asyncio_patch("gns3server.controller.project.Project.open", return_value=True) as mock: + response = await client.post(app.url_path_for("open_project", project_id=project.id)) + assert response.status_code == status.HTTP_201_CREATED + assert mock.called + + + async def test_load_project(self, app: FastAPI, client: AsyncClient, project: Project, config) -> None: + + with asyncio_patch("gns3server.controller.Controller.load_project", return_value=project) as mock: + response = await client.post(app.url_path_for("load_project"), json={"path": "/tmp/test.gns3"}) + assert response.status_code == status.HTTP_201_CREATED + mock.assert_called_with("/tmp/test.gns3") + assert response.json()["project_id"] == project.id + + + # @pytest.mark.asyncio + # async def test_notification(controller_api, http_client, project, controller): + # + # async with http_client.get(controller_api.get_url("/projects/{project_id}/notifications".format(project_id=project.id))) as response: + # response.body = await response.content.read(200) + # controller.notification.project_emit("node.created", {"a": "b"}) + # response.body += await response.content.readany() + # assert response.status_code == 200 + # assert b'"action": "ping"' in response.body + # assert b'"cpu_usage_percent"' in response.body + # assert b'{"action": "node.created", "event": {"a": "b"}}\n' in response.body + # assert project.status_code == "opened" + # + # + # @pytest.mark.asyncio + # async def test_notification_invalid_id(controller_api): + # + # response = await controller_api.get("/projects/{project_id}/notifications".format(project_id=uuid.uuid4())) + # assert response.status_code == 404 + + + # @pytest.mark.asyncio + # async def test_notification_ws(controller_api, http_client, controller, project): + # + # ws = await http_client.ws_connect(controller_api.get_url("/projects/{project_id}/notifications/ws".format(project_id=project.id))) + # answer = await ws.receive() + # answer = json.loads(answer.data) + # assert answer["action"] == "ping" + # + # controller.notification.project_emit("test", {}) + # answer = await ws.receive() + # answer = json.loads(answer.data) + # assert answer["action"] == "test" + # + # if not ws.closed: + # await ws.close() + # + # assert project.status_code == "opened" + + + async def test_export_with_images( + self, + app: FastAPI, + client: AsyncClient, + tmpdir, + project: Project + ) -> None: + + project.dump = MagicMock() + os.makedirs(project.path, exist_ok=True) + with open(os.path.join(project.path, 'a'), 'w+') as f: + f.write('hello') + + os.makedirs(str(tmpdir / "IOS")) + with open(str(tmpdir / "IOS" / "test.image"), "w+") as f: + f.write("AAA") + + topology = { + "topology": { + "nodes": [ + { + "properties": { + "image": "test.image" + }, + "node_type": "dynamips" + } + ] + } } - } - with open(os.path.join(project.path, "test.gns3"), 'w+') as f: - json.dump(topology, f) - - with patch("gns3server.compute.Dynamips.get_images_directory", return_value=str(tmpdir / "IOS"),): - response = await client.get(app.url_path_for("export_project", project_id=project.id), - params={"include_images": "0"}) - assert response.status_code == status.HTTP_200_OK - assert response.headers['CONTENT-TYPE'] == 'application/gns3project' - assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) - - with open(str(tmpdir / 'project.zip'), 'wb+') as f: - f.write(response.content) - - with zipfile_zstd.ZipFile(str(tmpdir / 'project.zip')) as myzip: - with myzip.open("a") as myfile: - content = myfile.read() - assert content == b"hello" - # Image should not exported - with pytest.raises(KeyError): - myzip.getinfo("images/IOS/test.image") - - -@pytest.mark.parametrize( - "compression, compression_level, status_code", - ( - ("none", None, status.HTTP_200_OK), - ("none", 4, status.HTTP_400_BAD_REQUEST), - ("zip", None, status.HTTP_200_OK), - ("zip", 1, status.HTTP_200_OK), - ("zip", 12, status.HTTP_400_BAD_REQUEST), - ("bzip2", None, status.HTTP_200_OK), - ("bzip2", 1, status.HTTP_200_OK), - ("bzip2", 13, status.HTTP_400_BAD_REQUEST), - ("lzma", None, status.HTTP_200_OK), - ("lzma", 1, status.HTTP_400_BAD_REQUEST), - ("zstd", None, status.HTTP_200_OK), - ("zstd", 12, status.HTTP_200_OK), - ("zstd", 23, status.HTTP_400_BAD_REQUEST), - ) -) -async def test_export_compression( - app: FastAPI, - client: AsyncClient, - tmpdir, - project: Project, - compression: str, - compression_level: int, - status_code: int -) -> None: - - project.dump = MagicMock() - os.makedirs(project.path, exist_ok=True) - - topology = { - "topology": { - "nodes": [ - { - "node_type": "qemu" - } - ] - } - } - with open(os.path.join(project.path, "test.gns3"), 'w+') as f: - json.dump(topology, f) - - params = {"compression": compression} - if compression_level: - params["compression_level"] = compression_level - response = await client.get(app.url_path_for("export_project", project_id=project.id), params=params) - assert response.status_code == status_code - - if response.status_code == status.HTTP_200_OK: + with open(os.path.join(project.path, "test.gns3"), 'w+') as f: + json.dump(topology, f) + + with patch("gns3server.compute.Dynamips.get_images_directory", return_value=str(tmpdir / "IOS")): + response = await client.get(app.url_path_for("export_project", project_id=project.id), + params={"include_images": "yes"}) + assert response.status_code == status.HTTP_200_OK assert response.headers['CONTENT-TYPE'] == 'application/gns3project' assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) - + with open(str(tmpdir / 'project.zip'), 'wb+') as f: f.write(response.content) - + with zipfile_zstd.ZipFile(str(tmpdir / 'project.zip')) as myzip: - with myzip.open("project.gns3") as myfile: - myfile.read() - - -async def test_get_file(app: FastAPI, client: AsyncClient, project: Project) -> None: - - os.makedirs(project.path, exist_ok=True) - with open(os.path.join(project.path, 'hello'), 'w+') as f: - f.write('world') - - response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="hello")) - assert response.status_code == status.HTTP_200_OK - assert response.content == b"world" - - response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="false")) - assert response.status_code == status.HTTP_404_NOT_FOUND - - response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="../hello")) - assert response.status_code == status.HTTP_404_NOT_FOUND - - -async def test_get_file_forbidden_location(app: FastAPI, client: AsyncClient, project: Project) -> None: - - file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" - response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path=file_path)) - assert response.status_code == status.HTTP_403_FORBIDDEN - - -async def test_write_file(app: FastAPI, client: AsyncClient, project: Project) -> None: - - response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path="hello"), - content=b"world") - assert response.status_code == status.HTTP_204_NO_CONTENT - - with open(os.path.join(project.path, "hello")) as f: - assert f.read() == "world" - - response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path="../hello")) - assert response.status_code == status.HTTP_404_NOT_FOUND - - -async def test_write_file_forbidden_location(app: FastAPI, client: AsyncClient, project: Project) -> None: - - file_path = "%2e%2e/hello" - response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path=file_path), - content=b"world") - assert response.status_code == status.HTTP_403_FORBIDDEN - - -async def test_write_and_get_file_with_leading_slashes_in_filename( - app: FastAPI, - client: AsyncClient, - project: Project) -> None: - - response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path="//hello"), - content=b"world") - assert response.status_code == status.HTTP_403_FORBIDDEN - - response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="//hello")) - assert response.status_code == status.HTTP_403_FORBIDDEN - - -async def test_import(app: FastAPI, client: AsyncClient, tmpdir, controller: Controller) -> None: - - with zipfile_zstd.ZipFile(str(tmpdir / "test.zip"), 'w') as myzip: - myzip.writestr("project.gns3", b'{"project_id": "c6992992-ac72-47dc-833b-54aa334bcd05", "version": "2.0.0", "name": "test"}') - myzip.writestr("demo", b"hello") - - project_id = str(uuid.uuid4()) - with open(str(tmpdir / "test.zip"), "rb") as f: - response = await client.post(app.url_path_for("import_project", project_id=project_id), content=f.read()) - assert response.status_code == status.HTTP_201_CREATED - - project = controller.get_project(project_id) - with open(os.path.join(project.path, "demo")) as f: - content = f.read() - assert content == "hello" - - -async def test_import_with_project_name(app: FastAPI, client: AsyncClient, tmpdir, controller: Controller) -> None: - - with zipfile_zstd.ZipFile(str(tmpdir / "test.zip"), 'w') as myzip: - myzip.writestr("project.gns3", b'{"project_id": "c6992992-ac72-47dc-833b-54aa334bcd05", "version": "2.0.0", "name": "test"}') - myzip.writestr("demo", b"hello") - - project_id = str(uuid.uuid4()) - with open(str(tmpdir / "test.zip"), "rb") as f: - response = await client.post( - app.url_path_for("import_project", project_id=project_id), - content=f.read(), - params={"name": "my-imported-project-name"} - ) - assert response.status_code == status.HTTP_201_CREATED - project = controller.get_project(project_id) - assert project.name == "my-imported-project-name" - - -async def test_duplicate(app: FastAPI, client: AsyncClient, project: Project) -> None: - - response = await client.post(app.url_path_for("duplicate_project", project_id=project.id), json={"name": "hello"}) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == "hello" - - -async def test_lock_unlock(app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: - - # add a drawing and node to the project - params = { - "svg": '', - "x": 10, - "y": 20, - "z": 0 - } - - response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) - assert response.status_code == status.HTTP_201_CREATED - - response = MagicMock() - response.json = {"console": 2048} - compute.post = AsyncioMagicMock(return_value=response) - - response = await client.post(app.url_path_for("create_node", project_id=project.id), json={ - "name": "test", - "node_type": "vpcs", - "compute_id": "example.com", - "properties": { - "startup_script": "echo test" + with myzip.open("a") as myfile: + content = myfile.read() + assert content == b"hello" + myzip.getinfo("images/IOS/test.image") + + + async def test_export_without_images(self, app: FastAPI, client: AsyncClient, tmpdir, project: Project) -> None: + + project.dump = MagicMock() + os.makedirs(project.path, exist_ok=True) + with open(os.path.join(project.path, 'a'), 'w+') as f: + f.write('hello') + + os.makedirs(str(tmpdir / "IOS")) + with open(str(tmpdir / "IOS" / "test.image"), "w+") as f: + f.write("AAA") + + topology = { + "topology": { + "nodes": [ + { + "properties": { + "image": "test.image" + }, + "node_type": "dynamips" + } + ] + } } - }) - assert response.status_code == status.HTTP_201_CREATED - - response = await client.post(app.url_path_for("lock_project", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - for drawing in project.drawings.values(): - assert drawing.locked is True - for node in project.nodes.values(): - assert node.locked is True - - response = await client.get(app.url_path_for("locked_project", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert response.json() is True - - response = await client.post(app.url_path_for("unlock_project", project_id=project.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - - for drawing in project.drawings.values(): - assert drawing.locked is False - for node in project.nodes.values(): - assert node.locked is False + with open(os.path.join(project.path, "test.gns3"), 'w+') as f: + json.dump(topology, f) + + with patch("gns3server.compute.Dynamips.get_images_directory", return_value=str(tmpdir / "IOS"),): + response = await client.get(app.url_path_for("export_project", project_id=project.id), + params={"include_images": "0"}) + assert response.status_code == status.HTTP_200_OK + assert response.headers['CONTENT-TYPE'] == 'application/gns3project' + assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) + + with open(str(tmpdir / 'project.zip'), 'wb+') as f: + f.write(response.content) + + with zipfile_zstd.ZipFile(str(tmpdir / 'project.zip')) as myzip: + with myzip.open("a") as myfile: + content = myfile.read() + assert content == b"hello" + # Image should not exported + with pytest.raises(KeyError): + myzip.getinfo("images/IOS/test.image") + + + @pytest.mark.parametrize( + "compression, compression_level, status_code", + ( + ("none", None, status.HTTP_200_OK), + ("none", 4, status.HTTP_400_BAD_REQUEST), + ("zip", None, status.HTTP_200_OK), + ("zip", 1, status.HTTP_200_OK), + ("zip", 12, status.HTTP_400_BAD_REQUEST), + ("bzip2", None, status.HTTP_200_OK), + ("bzip2", 1, status.HTTP_200_OK), + ("bzip2", 13, status.HTTP_400_BAD_REQUEST), + ("lzma", None, status.HTTP_200_OK), + ("lzma", 1, status.HTTP_400_BAD_REQUEST), + ("zstd", None, status.HTTP_200_OK), + ("zstd", 12, status.HTTP_200_OK), + ("zstd", 23, status.HTTP_400_BAD_REQUEST), + ) + ) + async def test_export_compression( + self, + app: FastAPI, + client: AsyncClient, + tmpdir, + project: Project, + compression: str, + compression_level: int, + status_code: int + ) -> None: + + project.dump = MagicMock() + os.makedirs(project.path, exist_ok=True) + + topology = { + "topology": { + "nodes": [ + { + "node_type": "qemu" + } + ] + } + } + with open(os.path.join(project.path, "test.gns3"), 'w+') as f: + json.dump(topology, f) + + params = {"compression": compression} + if compression_level: + params["compression_level"] = compression_level + response = await client.get(app.url_path_for("export_project", project_id=project.id), params=params) + assert response.status_code == status_code + + if response.status_code == status.HTTP_200_OK: + assert response.headers['CONTENT-TYPE'] == 'application/gns3project' + assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) + + with open(str(tmpdir / 'project.zip'), 'wb+') as f: + f.write(response.content) + + with zipfile_zstd.ZipFile(str(tmpdir / 'project.zip')) as myzip: + with myzip.open("project.gns3") as myfile: + myfile.read() + + + async def test_get_file(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + os.makedirs(project.path, exist_ok=True) + with open(os.path.join(project.path, 'hello'), 'w+') as f: + f.write('world') + + response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="hello")) + assert response.status_code == status.HTTP_200_OK + assert response.content == b"world" + + response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="false")) + assert response.status_code == status.HTTP_404_NOT_FOUND + + response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="../hello")) + assert response.status_code == status.HTTP_404_NOT_FOUND + + + async def test_get_file_forbidden_location(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + file_path = "foo/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd" + response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path=file_path)) + assert response.status_code == status.HTTP_403_FORBIDDEN + + + async def test_write_file(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path="hello"), + content=b"world") + assert response.status_code == status.HTTP_204_NO_CONTENT + + with open(os.path.join(project.path, "hello")) as f: + assert f.read() == "world" + + response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path="../hello")) + assert response.status_code == status.HTTP_404_NOT_FOUND + + + async def test_write_file_forbidden_location(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + file_path = "%2e%2e/hello" + response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path=file_path), + content=b"world") + assert response.status_code == status.HTTP_403_FORBIDDEN + + + async def test_write_and_get_file_with_leading_slashes_in_filename( + self, + app: FastAPI, + client: AsyncClient, + project: Project) -> None: + + response = await client.post(app.url_path_for("write_file", project_id=project.id, file_path="//hello"), + content=b"world") + assert response.status_code == status.HTTP_403_FORBIDDEN + + response = await client.get(app.url_path_for("get_file", project_id=project.id, file_path="//hello")) + assert response.status_code == status.HTTP_403_FORBIDDEN + + + async def test_import(self, app: FastAPI, client: AsyncClient, tmpdir, controller: Controller) -> None: + + with zipfile_zstd.ZipFile(str(tmpdir / "test.zip"), 'w') as myzip: + myzip.writestr("project.gns3", b'{"project_id": "c6992992-ac72-47dc-833b-54aa334bcd05", "version": "2.0.0", "name": "test"}') + myzip.writestr("demo", b"hello") + + project_id = str(uuid.uuid4()) + with open(str(tmpdir / "test.zip"), "rb") as f: + response = await client.post(app.url_path_for("import_project", project_id=project_id), content=f.read()) + assert response.status_code == status.HTTP_201_CREATED + + project = controller.get_project(project_id) + with open(os.path.join(project.path, "demo")) as f: + content = f.read() + assert content == "hello" + + + async def test_import_with_project_name( + self, + app: FastAPI, + client: AsyncClient, + tmpdir, + controller: Controller + ) -> None: + + with zipfile_zstd.ZipFile(str(tmpdir / "test.zip"), 'w') as myzip: + myzip.writestr("project.gns3", b'{"project_id": "c6992992-ac72-47dc-833b-54aa334bcd05", "version": "2.0.0", "name": "test"}') + myzip.writestr("demo", b"hello") + + project_id = str(uuid.uuid4()) + with open(str(tmpdir / "test.zip"), "rb") as f: + response = await client.post( + app.url_path_for("import_project", project_id=project_id), + content=f.read(), + params={"name": "my-imported-project-name"} + ) + assert response.status_code == status.HTTP_201_CREATED + project = controller.get_project(project_id) + assert project.name == "my-imported-project-name" + + + async def test_duplicate(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + response = await client.post(app.url_path_for("duplicate_project", project_id=project.id), json={"name": "hello"}) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == "hello" + + + async def test_lock_unlock(self, app: FastAPI, client: AsyncClient, project: Project, compute: Compute) -> None: + + # add a drawing and node to the project + params = { + "svg": '', + "x": 10, + "y": 20, + "z": 0 + } + + response = await client.post(app.url_path_for("create_drawing", project_id=project.id), json=params) + assert response.status_code == status.HTTP_201_CREATED + + response = MagicMock() + response.json = {"console": 2048} + compute.post = AsyncioMagicMock(return_value=response) + + response = await client.post(app.url_path_for("create_node", project_id=project.id), json={ + "name": "test", + "node_type": "vpcs", + "compute_id": "example.com", + "properties": { + "startup_script": "echo test" + } + }) + assert response.status_code == status.HTTP_201_CREATED + + response = await client.post(app.url_path_for("lock_project", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + for drawing in project.drawings.values(): + assert drawing.locked is True + for node in project.nodes.values(): + assert node.locked is True + + response = await client.get(app.url_path_for("locked_project", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert response.json() is True + + response = await client.post(app.url_path_for("unlock_project", project_id=project.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + + for drawing in project.drawings.values(): + assert drawing.locked is False + for node in project.nodes.values(): + assert node.locked is False diff --git a/tests/api/routes/controller/test_snapshots.py b/tests/api/routes/controller/test_snapshots.py index 3058cdad..531c3fe2 100644 --- a/tests/api/routes/controller/test_snapshots.py +++ b/tests/api/routes/controller/test_snapshots.py @@ -30,47 +30,49 @@ from gns3server.controller.snapshot import Snapshot pytestmark = pytest.mark.asyncio -@pytest_asyncio.fixture -async def project(app: FastAPI, client: AsyncClient, controller: Controller) -> Project: +class TestSnapshotRoutes: - u = str(uuid.uuid4()) - params = {"name": "test", "project_id": u} - await client.post(app.url_path_for("create_project"), json=params) - project = controller.get_project(u) - return project - - -@pytest_asyncio.fixture -async def snapshot(project: Project): - - snapshot = await project.snapshot("test") - return snapshot - - -async def test_list_snapshots(app: FastAPI, client: AsyncClient, project: Project, snapshot: Snapshot) -> None: - - assert snapshot.name == "test" - response = await client.get(app.url_path_for("get_snapshots", project_id=project.id)) - assert response.status_code == status.HTTP_200_OK - assert len(response.json()) == 1 - - -async def test_delete_snapshot(app: FastAPI, client: AsyncClient, project: Project, snapshot: Snapshot) -> None: - - response = await client.delete(app.url_path_for("delete_snapshot", project_id=project.id, snapshot_id=snapshot.id)) - assert response.status_code == status.HTTP_204_NO_CONTENT - assert not os.path.exists(snapshot.path) - - -async def test_restore_snapshot(app: FastAPI, client: AsyncClient, project: Project, snapshot: Snapshot) -> None: - - response = await client.post(app.url_path_for("restore_snapshot", project_id=project.id, snapshot_id=snapshot.id)) - assert response.status_code == status.HTTP_201_CREATED - assert response.json()["name"] == project.name - - -async def test_create_snapshot(app: FastAPI, client: AsyncClient, project: Project) -> None: - - response = await client.post(app.url_path_for("create_snapshot", project_id=project.id), json={"name": "snap1"}) - assert response.status_code == status.HTTP_201_CREATED - assert len(os.listdir(os.path.join(project.path, "snapshots"))) == 1 + @pytest_asyncio.fixture + async def project(self, app: FastAPI, client: AsyncClient, controller: Controller) -> Project: + + u = str(uuid.uuid4()) + params = {"name": "test", "project_id": u} + await client.post(app.url_path_for("create_project"), json=params) + controller_project = controller.get_project(u) + return controller_project + + + @pytest_asyncio.fixture + async def snapshot(self, project: Project): + + controller_snapshot = await project.snapshot("test") + return controller_snapshot + + + async def test_list_snapshots(self, app: FastAPI, client: AsyncClient, project: Project, snapshot: Snapshot) -> None: + + assert snapshot.name == "test" + response = await client.get(app.url_path_for("get_snapshots", project_id=project.id)) + assert response.status_code == status.HTTP_200_OK + assert len(response.json()) == 1 + + + async def test_delete_snapshot(self, app: FastAPI, client: AsyncClient, project: Project, snapshot: Snapshot) -> None: + + response = await client.delete(app.url_path_for("delete_snapshot", project_id=project.id, snapshot_id=snapshot.id)) + assert response.status_code == status.HTTP_204_NO_CONTENT + assert not os.path.exists(snapshot.path) + + + async def test_restore_snapshot(self, app: FastAPI, client: AsyncClient, project: Project, snapshot: Snapshot) -> None: + + response = await client.post(app.url_path_for("restore_snapshot", project_id=project.id, snapshot_id=snapshot.id)) + assert response.status_code == status.HTTP_201_CREATED + assert response.json()["name"] == project.name + + + async def test_create_snapshot(self, app: FastAPI, client: AsyncClient, project: Project) -> None: + + response = await client.post(app.url_path_for("create_snapshot", project_id=project.id), json={"name": "snap1"}) + assert response.status_code == status.HTTP_201_CREATED + assert len(os.listdir(os.path.join(project.path, "snapshots"))) == 1 diff --git a/tests/api/routes/controller/test_symbols.py b/tests/api/routes/controller/test_symbols.py index c6941bdb..24e60720 100644 --- a/tests/api/routes/controller/test_symbols.py +++ b/tests/api/routes/controller/test_symbols.py @@ -28,41 +28,43 @@ from gns3server.controller import Controller pytestmark = pytest.mark.asyncio -async def test_symbols(app: FastAPI, client: AsyncClient) -> None: +class TestSymbolRoutes: - response = await client.get(app.url_path_for("get_symbols")) - - assert response.status_code == status.HTTP_200_OK - assert { - 'symbol_id': ':/symbols/classic/firewall.svg', - 'filename': 'firewall.svg', - 'builtin': True, - 'theme': 'Classic' - } in response.json() - - -async def test_get(app: FastAPI, client: AsyncClient, controller: Controller) -> None: - - controller.symbols.theme = "Classic" - url = app.url_path_for("get_symbol", symbol_id=urllib.parse.quote(':/symbols/classic/firewall.svg')) - response = await client.get(url) - assert response.status_code == status.HTTP_200_OK - assert response.headers['CONTENT-TYPE'] == 'image/svg+xml' - assert response.headers['CONTENT-LENGTH'] == '9381' - assert '' in response.text - - # Reply with the default symbol - response = await client.get(app.url_path_for("get_symbol", symbol_id="404.png")) - assert response.status_code == status.HTTP_200_OK - - -async def test_upload(app: FastAPI, client: AsyncClient, symbols_dir: str) -> None: - - response = await client.post(app.url_path_for("upload_symbol", symbol_id="test2"), content=b"TEST") - assert response.status_code == status.HTTP_204_NO_CONTENT - - with open(os.path.join(symbols_dir, "test2")) as f: - assert f.read() == "TEST" - - response = await client.get(app.url_path_for("get_symbol", symbol_id="test2")) - assert response.status_code == status.HTTP_200_OK + async def test_symbols(self, app: FastAPI, client: AsyncClient) -> None: + + response = await client.get(app.url_path_for("get_symbols")) + + assert response.status_code == status.HTTP_200_OK + assert { + 'symbol_id': ':/symbols/classic/firewall.svg', + 'filename': 'firewall.svg', + 'builtin': True, + 'theme': 'Classic' + } in response.json() + + + async def test_get(self, app: FastAPI, client: AsyncClient, controller: Controller) -> None: + + controller.symbols.theme = "Classic" + url = app.url_path_for("get_symbol", symbol_id=urllib.parse.quote(':/symbols/classic/firewall.svg')) + response = await client.get(url) + assert response.status_code == status.HTTP_200_OK + assert response.headers['CONTENT-TYPE'] == 'image/svg+xml' + assert response.headers['CONTENT-LENGTH'] == '9381' + assert '' in response.text + + # Reply with the default symbol + response = await client.get(app.url_path_for("get_symbol", symbol_id="404.png")) + assert response.status_code == status.HTTP_200_OK + + + async def test_upload(self, app: FastAPI, client: AsyncClient, symbols_dir: str) -> None: + + response = await client.post(app.url_path_for("upload_symbol", symbol_id="test2"), content=b"TEST") + assert response.status_code == status.HTTP_204_NO_CONTENT + + with open(os.path.join(symbols_dir, "test2")) as f: + assert f.read() == "TEST" + + response = await client.get(app.url_path_for("get_symbol", symbol_id="test2")) + assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/controller/test_users.py b/tests/api/routes/controller/test_users.py index 416fe45b..87ea7470 100644 --- a/tests/api/routes/controller/test_users.py +++ b/tests/api/routes/controller/test_users.py @@ -254,22 +254,6 @@ class TestUserLogin: assert "token_type" in response.json() assert response.json().get("token_type") == "bearer" - async def test_user_can_authenticate_using_json( - self, - app: FastAPI, - unauthorized_client: AsyncClient, - test_user: User, - config: Config - ) -> None: - - credentials = { - "username": test_user.username, - "password": "user1_password", - } - response = await unauthorized_client.post(app.url_path_for("authenticate"), json=credentials) - assert response.status_code == status.HTTP_200_OK - assert response.json().get("access_token") - @pytest.mark.parametrize( "username, password, status_code", ( @@ -299,7 +283,19 @@ class TestUserLogin: assert response.status_code == status_code assert "access_token" not in response.json() - async def test_user_can_use_token_as_url_param( + +class TestUnauthorizedUser: + + async def test_user_cannot_access_own_data_if_not_authenticated( + self, app: FastAPI, + unauthorized_client: AsyncClient, + test_user: User, + ) -> None: + + response = await unauthorized_client.get(app.url_path_for("get_logged_in_user")) + assert response.status_code == status.HTTP_401_UNAUTHORIZED + + async def test_user_can_authenticate_using_json( self, app: FastAPI, unauthorized_client: AsyncClient, @@ -311,15 +307,14 @@ class TestUserLogin: "username": test_user.username, "password": "user1_password", } - response = await unauthorized_client.post(app.url_path_for("authenticate"), json=credentials) assert response.status_code == status.HTTP_200_OK - token = response.json().get("access_token") + assert response.json().get("access_token") + token = response.json().get("access_token") response = await unauthorized_client.get(app.url_path_for("statistics"), params={"token": token}) assert response.status_code == status.HTTP_200_OK - class TestUserMe: async def test_authenticated_user_can_retrieve_own_data( @@ -336,15 +331,6 @@ class TestUserMe: assert user.email == test_user.email assert user.user_id == test_user.user_id - async def test_user_cannot_access_own_data_if_not_authenticated( - self, app: FastAPI, - unauthorized_client: AsyncClient, - test_user: User, - ) -> None: - - response = await unauthorized_client.get(app.url_path_for("get_logged_in_user")) - assert response.status_code == status.HTTP_401_UNAUTHORIZED - async def test_authenticated_user_can_update_own_data( self, app: FastAPI, diff --git a/tests/api/routes/controller/test_version.py b/tests/api/routes/controller/test_version.py index 27ca7cb3..1e229ddd 100644 --- a/tests/api/routes/controller/test_version.py +++ b/tests/api/routes/controller/test_version.py @@ -25,38 +25,41 @@ from gns3server.version import __version__ pytestmark = pytest.mark.asyncio -async def test_version_output(app: FastAPI, client: AsyncClient) -> None: - - response = await client.get(app.url_path_for("get_version")) - assert response.status_code == status.HTTP_200_OK - assert response.json() == {'controller_host': '127.0.0.1', 'local': False, 'version': __version__} +class TestVersionRoutes: -async def test_version_input(app: FastAPI, client: AsyncClient) -> None: + async def test_version_output(self, app: FastAPI, client: AsyncClient) -> None: - params = {'version': __version__} - response = await client.post(app.url_path_for("check_version"), json=params) - assert response.status_code == status.HTTP_200_OK - assert response.json() == {'version': __version__} - - -async def test_version_invalid_input(app: FastAPI, client: AsyncClient) -> None: - - params = {'version': "0.4.2"} - response = await client.post(app.url_path_for("check_version"), json=params) - assert response.status_code == status.HTTP_409_CONFLICT - assert response.json() == {'message': 'Client version 0.4.2 is not the same as server version {}'.format(__version__)} - - -async def test_version_invalid_input_schema(app: FastAPI, client: AsyncClient) -> None: - - params = {'version': "0.4.2", "bla": "blu"} - response = await client.post(app.url_path_for("check_version"), json=params) - assert response.status_code == status.HTTP_409_CONFLICT - - -async def test_version_invalid_json(app: FastAPI, client: AsyncClient) -> None: - - params = "BOUM" - response = await client.post(app.url_path_for("check_version"), json=params) - assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY + response = await client.get(app.url_path_for("get_version")) + assert response.status_code == status.HTTP_200_OK + assert response.json() == {'controller_host': '127.0.0.1', 'local': False, 'version': __version__} + + + async def test_version_input(self, app: FastAPI, client: AsyncClient) -> None: + + params = {'version': __version__} + response = await client.post(app.url_path_for("check_version"), json=params) + assert response.status_code == status.HTTP_200_OK + assert response.json() == {'version': __version__} + + + async def test_version_invalid_input(self, app: FastAPI, client: AsyncClient) -> None: + + params = {'version': "0.4.2"} + response = await client.post(app.url_path_for("check_version"), json=params) + assert response.status_code == status.HTTP_409_CONFLICT + assert response.json() == {'message': 'Client version 0.4.2 is not the same as server version {}'.format(__version__)} + + + async def test_version_invalid_input_schema(self, app: FastAPI, client: AsyncClient) -> None: + + params = {'version': "0.4.2", "bla": "blu"} + response = await client.post(app.url_path_for("check_version"), json=params) + assert response.status_code == status.HTTP_409_CONFLICT + + + async def test_version_invalid_json(self, app: FastAPI, client: AsyncClient) -> None: + + params = "BOUM" + response = await client.post(app.url_path_for("check_version"), json=params) + assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY diff --git a/tests/api/routes/test_index.py b/tests/api/routes/test_index.py index 08dcc090..93cef6dd 100644 --- a/tests/api/routes/test_index.py +++ b/tests/api/routes/test_index.py @@ -29,55 +29,57 @@ from gns3server.utils.get_resource import get_resource pytestmark = pytest.mark.asyncio -def get_static(filename): +class TestIndexRoutes: - current_dir = os.path.dirname(os.path.abspath(__file__)) - return os.path.join(os.path.abspath(os.path.join(current_dir, '../..', '..', 'gns3server', 'static')), filename) + def get_static(self, filename): + + current_dir = os.path.dirname(os.path.abspath(__file__)) + return os.path.join(os.path.abspath(os.path.join(current_dir, '../..', '..', 'gns3server', 'static')), filename) -async def test_debug(app: FastAPI, client: AsyncClient) -> None: + async def test_debug(self, app: FastAPI, client: AsyncClient) -> None: - response = await client.get(app.url_path_for("debug")) - assert response.status_code == status.HTTP_200_OK - html = response.read().decode() - assert "Website" in html - assert __version__ in html - - -# @pytest.mark.asyncio -# async def test_controller(http_client, controller): -# -# await controller.add_project(name="test") -# response = await http_client.get('/controller') -# assert "test" in await response.text() -# assert response.status_code == 200 -# -# -# @pytest.mark.asyncio -# async def test_compute(http_client): -# -# response = await http_client.get('/compute') -# assert response.status_code == 200 - - -# @pytest.mark.asyncio -# async def test_project(http_client, controller): -# -# project = await controller.add_project(name="test") -# response = await http_client.get('/projects/{}'.format(project.id)) -# assert response.status_code == 200 - - -async def test_web_ui(app: FastAPI, client: AsyncClient) -> None: - - response = await client.get(app.url_path_for("web_ui", file_path="index.html")) - assert response.status_code == status.HTTP_200_OK - - -async def test_web_ui_not_found(app: FastAPI, client: AsyncClient, tmpdir: str) -> None: - - with patch('gns3server.utils.get_resource.get_resource') as mock: - mock.return_value = str(tmpdir) - response = await client.get(app.url_path_for("web_ui", file_path="not-found.txt")) - # should serve web-ui/index.html + response = await client.get(app.url_path_for("debug")) assert response.status_code == status.HTTP_200_OK + html = response.read().decode() + assert "Website" in html + assert __version__ in html + + + # @pytest.mark.asyncio + # async def test_controller(http_client, controller): + # + # await controller.add_project(name="test") + # response = await http_client.get('/controller') + # assert "test" in await response.text() + # assert response.status_code == 200 + # + # + # @pytest.mark.asyncio + # async def test_compute(http_client): + # + # response = await http_client.get('/compute') + # assert response.status_code == 200 + + + # @pytest.mark.asyncio + # async def test_project(http_client, controller): + # + # project = await controller.add_project(name="test") + # response = await http_client.get('/projects/{}'.format(project.id)) + # assert response.status_code == 200 + + + async def test_web_ui(self, app: FastAPI, client: AsyncClient) -> None: + + response = await client.get(app.url_path_for("web_ui", file_path="index.html")) + assert response.status_code == status.HTTP_200_OK + + + async def test_web_ui_not_found(self, app: FastAPI, client: AsyncClient, tmpdir: str) -> None: + + with patch('gns3server.utils.get_resource.get_resource') as mock: + mock.return_value = str(tmpdir) + response = await client.get(app.url_path_for("web_ui", file_path="not-found.txt")) + # should serve web-ui/index.html + assert response.status_code == status.HTTP_200_OK diff --git a/tests/api/routes/test_routes.py b/tests/api/routes/test_routes.py index 40870ee1..dc69cfca 100644 --- a/tests/api/routes/test_routes.py +++ b/tests/api/routes/test_routes.py @@ -44,40 +44,49 @@ ALLOWED_CONTROLLER_ENDPOINTS = [ ("/v3/symbols/default_symbols", "GET") ] +class TestRoutes: -# Controller endpoints have a OAuth2 bearer token authentication -async def test_controller_endpoints_require_authentication(app: FastAPI, unauthorized_client: AsyncClient) -> None: + # Controller endpoints have a OAuth2 bearer token authentication + async def test_controller_endpoints_require_authentication( + self, + app: FastAPI, + unauthorized_client: AsyncClient + ) -> None: - for route in app.routes: - if isinstance(route, APIRoute): - for method in list(route.methods): - if (route.path, method) not in ALLOWED_CONTROLLER_ENDPOINTS: - response = await getattr(unauthorized_client, method.lower())(route.path) - assert response.status_code == status.HTTP_401_UNAUTHORIZED - elif isinstance(route, APIWebSocketRoute): - params = {"token": "wrong_token"} - async with AsyncClient(base_url="http://test-api", transport=ASGIWebSocketTransport(app)) as client: - async with aconnect_ws(route.path, client, params=params) as ws: - json_notification = await ws.receive_json() - assert json_notification['event'] == { - 'message': 'Could not authenticate while connecting to controller WebSocket: Could not validate credentials' - } - - -# Compute endpoints have a basic HTTP authentication -async def test_compute_endpoints_require_authentication(app: FastAPI, unauthorized_client: AsyncClient) -> None: - - for route in app.routes: - if isinstance(route, Mount): - for compute_route in route.routes: - if isinstance(compute_route, APIRoute): - for method in list(compute_route.methods): - response = await getattr(unauthorized_client, method.lower())(route.path + compute_route.path) + for route in app.routes: + if isinstance(route, APIRoute): + for method in list(route.methods): + if (route.path, method) not in ALLOWED_CONTROLLER_ENDPOINTS: + response = await getattr(unauthorized_client, method.lower())(route.path) assert response.status_code == status.HTTP_401_UNAUTHORIZED - elif isinstance(compute_route, APIWebSocketRoute): - async with AsyncClient(base_url="http://test-api", transport=ASGIWebSocketTransport(app)) as client: - async with aconnect_ws(route.path + compute_route.path, client, auth=("wrong_user", "password123")) as ws: - json_notification = await ws.receive_json() - assert json_notification['event'] == { - 'message': 'Could not authenticate while connecting to compute WebSocket: Could not validate credentials' - } + elif isinstance(route, APIWebSocketRoute): + params = {"token": "wrong_token"} + async with AsyncClient(base_url="http://test-api", transport=ASGIWebSocketTransport(app=app)) as client: + async with aconnect_ws(route.path, client, params=params) as ws: + json_notification = await ws.receive_json() + assert json_notification['event'] == { + 'message': 'Could not authenticate while connecting to controller WebSocket: Could not validate credentials' + } + + + # Compute endpoints have a basic HTTP authentication + async def test_compute_endpoints_require_authentication( + self, + app: FastAPI, + unauthorized_client: AsyncClient + ) -> None: + + for route in app.routes: + if isinstance(route, Mount): + for compute_route in route.routes: + if isinstance(compute_route, APIRoute): + for method in list(compute_route.methods): + response = await getattr(unauthorized_client, method.lower())(route.path + compute_route.path) + assert response.status_code == status.HTTP_401_UNAUTHORIZED + elif isinstance(compute_route, APIWebSocketRoute): + async with AsyncClient(base_url="http://test-api", transport=ASGIWebSocketTransport(app=app)) as client: + async with aconnect_ws(route.path + compute_route.path, client, auth=("wrong_user", "password123")) as ws: + json_notification = await ws.receive_json() + assert json_notification['event'] == { + 'message': 'Could not authenticate while connecting to compute WebSocket: Could not validate credentials' + } diff --git a/tests/compute/builtin/nodes/test_cloud.py b/tests/compute/builtin/nodes/test_cloud.py index 7a482260..0f7d3401 100644 --- a/tests/compute/builtin/nodes/test_cloud.py +++ b/tests/compute/builtin/nodes/test_cloud.py @@ -25,6 +25,8 @@ from gns3server.compute.nios.nio_udp import NIOUDP from tests.utils import asyncio_patch +pytestmark = pytest.mark.asyncio + @pytest.fixture def nio(): @@ -39,7 +41,6 @@ async def manager(): return m -@pytest.mark.asyncio async def test_json_with_ports(on_gns3vm, compute_project, manager): ports = [ @@ -78,7 +79,7 @@ async def test_json_with_ports(on_gns3vm, compute_project, manager): } -def test_json_without_ports(on_gns3vm, compute_project, manager): +async def test_json_without_ports(on_gns3vm, compute_project, manager): """ If no interface is provide the cloud is pre-fill with non special interfaces """ @@ -117,7 +118,6 @@ def test_json_without_ports(on_gns3vm, compute_project, manager): } -@pytest.mark.asyncio async def test_update_port_mappings(on_gns3vm, compute_project): """ We don't allow an empty interface in the middle of port list @@ -158,7 +158,6 @@ async def test_update_port_mappings(on_gns3vm, compute_project): assert cloud.ports_mapping == ports1 -@pytest.mark.asyncio async def test_linux_ethernet_raw_add_nio(linux_platform, compute_project, nio): ports = [ { @@ -186,7 +185,6 @@ async def test_linux_ethernet_raw_add_nio(linux_platform, compute_project, nio): ]) -@pytest.mark.asyncio async def test_linux_ethernet_raw_add_nio_bridge(linux_platform, compute_project, nio): """ Bridge can't be connected directly to a cloud we use a tap in the middle diff --git a/tests/conftest.py b/tests/conftest.py index 30b3a6b0..0cf8be86 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,4 @@ import pytest -import asyncio import pytest_asyncio import tempfile import shutil @@ -13,6 +12,7 @@ import stat from fastapi import FastAPI from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine from httpx import AsyncClient +from httpx_ws.transport import ASGIWebSocketTransport from unittest.mock import MagicMock, patch from pathlib import Path @@ -34,25 +34,14 @@ sys._called_from_test = True sys.original_platform = sys.platform -# https://github.com/pytest-dev/pytest-asyncio/issues/68 -# this event_loop is used by pytest-asyncio, and redefining it -# is currently the only way of changing the scope of this fixture -@pytest.fixture(scope="class") -def event_loop(request): - - loop = asyncio.get_event_loop_policy().new_event_loop() - yield loop - loop.close() - - -@pytest_asyncio.fixture(scope="class") +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def app() -> FastAPI: from gns3server.api.server import app as gns3app yield gns3app -@pytest_asyncio.fixture(scope="class") +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def db_engine(): db_url = os.getenv("GNS3_TEST_DATABASE_URI", "sqlite+aiosqlite:///:memory:") # "sqlite:///./sql_test_app.db" @@ -61,7 +50,7 @@ async def db_engine(): #await engine.sync_engine.dispose() -@pytest_asyncio.fixture(scope="class") +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def db_session(db_engine): # recreate database tables for each class @@ -82,7 +71,7 @@ async def db_session(db_engine): await session.close() -@pytest_asyncio.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def base_client(app: FastAPI, db_session: AsyncSession) -> AsyncClient: async def _get_test_db(): @@ -94,14 +83,14 @@ async def base_client(app: FastAPI, db_session: AsyncSession) -> AsyncClient: app.dependency_overrides[get_db_session] = _get_test_db async with AsyncClient( - app=app, base_url="http://test-api", - headers={"Content-Type": "application/json"} + headers={"Content-Type": "application/json"}, + transport=ASGIWebSocketTransport(app=app) ) as async_client: yield async_client -@pytest_asyncio.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def test_user(db_session: AsyncSession) -> User: new_user = schemas.UserCreate( @@ -121,7 +110,7 @@ async def test_user(db_session: AsyncSession) -> User: return user -@pytest_asyncio.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def test_compute(db_session: AsyncSession) -> Compute: new_compute = schemas.ComputeCreate( @@ -140,12 +129,12 @@ async def test_compute(db_session: AsyncSession) -> Compute: return await compute_repo.create_compute(new_compute) -@pytest.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") def unauthorized_client(base_client: AsyncClient, test_user: User) -> AsyncClient: return base_client -@pytest.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") def authorized_client(base_client: AsyncClient, test_user: User) -> AsyncClient: access_token = auth_service.create_access_token(test_user.username) @@ -156,7 +145,7 @@ def authorized_client(base_client: AsyncClient, test_user: User) -> AsyncClient: return base_client -@pytest_asyncio.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def client(base_client: AsyncClient) -> AsyncClient: # The super admin is automatically created when the users table is created @@ -169,7 +158,7 @@ async def client(base_client: AsyncClient) -> AsyncClient: return base_client -@pytest_asyncio.fixture +@pytest_asyncio.fixture(loop_scope="class", scope="class") async def compute_client(base_client: AsyncClient) -> AsyncClient: # default compute username is 'gns3' diff --git a/tests/pytest.ini b/tests/pytest.ini new file mode 100644 index 00000000..88c111a5 --- /dev/null +++ b/tests/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +asyncio_default_fixture_loop_scope=function From bd58196817e31b5fe6331228812a992023ed6179 Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 20 Jan 2025 13:22:22 +1000 Subject: [PATCH 08/28] Add more information when patching .vbox file. Ref https://github.com/GNS3/gns3-gui/issues/3542 --- .../compute/virtualbox/virtualbox_vm.py | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index 79a7bc7d..5273bfe1 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -218,28 +218,45 @@ class VirtualBoxVM(BaseNode): """ Fix the VM uuid in the case of linked clone """ - if os.path.exists(self._linked_vbox_file()): - try: - tree = ET.parse(self._linked_vbox_file()) - except ET.ParseError: - raise VirtualBoxError("Cannot modify VirtualBox linked nodes file. " - "File {} is corrupted.".format(self._linked_vbox_file())) - except OSError as e: - raise VirtualBoxError("Cannot modify VirtualBox linked nodes file '{}': {}".format(self._linked_vbox_file(), e)) - machine = tree.getroot().find("{http://www.virtualbox.org/}Machine") - if machine is not None and machine.get("uuid") != "{" + self.id + "}": + linked_vbox_file = self._linked_vbox_file() + if not os.path.exists(linked_vbox_file): + raise VirtualBoxError("Cannot find VirtualBox linked node file: {}".format(linked_vbox_file)) - for image in tree.getroot().findall("{http://www.virtualbox.org/}Image"): - currentSnapshot = machine.get("currentSnapshot") - if currentSnapshot: - newSnapshot = re.sub(r"\{.*\}", "{" + str(uuid.uuid4()) + "}", currentSnapshot) - shutil.move(os.path.join(self.working_dir, self._vmname, "Snapshots", currentSnapshot) + ".vdi", - os.path.join(self.working_dir, self._vmname, "Snapshots", newSnapshot) + ".vdi") - image.set("uuid", newSnapshot) + try: + tree = ET.parse(linked_vbox_file) + except ET.ParseError: + raise VirtualBoxError("Cannot modify VirtualBox linked node file. " + "File {} is corrupted.".format(linked_vbox_file)) + except OSError as e: + raise VirtualBoxError("Cannot modify VirtualBox linked node file '{}': {}".format(linked_vbox_file, e)) - machine.set("uuid", "{" + self.id + "}") - tree.write(self._linked_vbox_file()) + machine = tree.getroot().find("{http://www.virtualbox.org/}Machine") + if machine is not None and machine.get("uuid") != "{" + self.id + "}": + + for image in tree.getroot().findall("{http://www.virtualbox.org/}Image"): + currentSnapshot = machine.get("currentSnapshot") + if currentSnapshot: + newSnapshot = re.sub(r"\{.*\}", "{" + str(uuid.uuid4()) + "}", currentSnapshot) + shutil.move( + os.path.join(self.working_dir, self._vmname, "Snapshots", currentSnapshot) + ".vdi", + os.path.join(self.working_dir, self._vmname, "Snapshots", newSnapshot) + ".vdi" + ) + log.info("VirtualBox VM '{name}' [{id}] snapshot file moved from '{current}' to '{new}'".format( + name=self.name, + id=self.id, + current=currentSnapshot, + new=newSnapshot, + )) + image.set("uuid", newSnapshot) + + log.info("VirtualBox VM '{name}' [{id}] '{vbox_file}' has been patched".format( + name=self.name, + id=self.id, + vbox_file=linked_vbox_file, + )) + machine.set("uuid", "{" + self.id + "}") + tree.write(linked_vbox_file) async def check_hw_virtualization(self): """ @@ -458,7 +475,7 @@ class VirtualBoxVM(BaseNode): async def save_linked_hdds_info(self): """ - Save linked cloned hard disks information. + Save linked cloned hard disk information. :returns: disk table information """ From d1186b2acc71990dd5049ecc7009070b3542f900 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 21 Jan 2025 11:29:28 +1000 Subject: [PATCH 09/28] Sync appliances --- gns3server/appliances/alpine-cloud.gns3a | 56 ++ gns3server/appliances/arista-veos.gns3a | 534 +------------------ gns3server/appliances/cisco-iou-l2.gns3a | 4 +- gns3server/appliances/cisco-iou-l3.gns3a | 4 +- gns3server/appliances/innovaphone-app.gns3a | 50 ++ gns3server/appliances/innovaphone-ipva.gns3a | 78 +++ gns3server/appliances/pfsense.gns3a | 14 + gns3server/appliances/stormshield-eva.gns3a | 50 ++ 8 files changed, 272 insertions(+), 518 deletions(-) create mode 100644 gns3server/appliances/alpine-cloud.gns3a create mode 100644 gns3server/appliances/innovaphone-app.gns3a create mode 100644 gns3server/appliances/innovaphone-ipva.gns3a create mode 100644 gns3server/appliances/stormshield-eva.gns3a diff --git a/gns3server/appliances/alpine-cloud.gns3a b/gns3server/appliances/alpine-cloud.gns3a new file mode 100644 index 00000000..00157093 --- /dev/null +++ b/gns3server/appliances/alpine-cloud.gns3a @@ -0,0 +1,56 @@ +{ + "appliance_id": "edbaa01e-2032-4ee2-bb9f-dd5c4d84c270", + "name": "Alpine Cloud Guest", + "category": "guest", + "description": "Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.", + "vendor_name": "Alpine Linux Development Team", + "vendor_url": "http://alpinelinux.org", + "vendor_logo_url": "https://raw.githubusercontent.com/GNS3/gns3-registry/master/vendor-logos/Alpine Linux.png", + "documentation_url": "http://wiki.alpinelinux.org", + "product_name": "Alpine Linux", + "product_url": "https://www.alpinelinux.org/cloud/", + "registry_version": 4, + "status": "stable", + "maintainer": "GNS3 Team", + "maintainer_email": "developers@gns3.net", + "usage": "\nUsername: alpine\nPassword: alpine", + "port_name_format": "Ethernet{0}", + "qemu": { + "adapter_type": "virtio-net-pci", + "adapters": 1, + "ram": 1024, + "hda_disk_interface": "virtio", + "arch": "x86_64", + "console_type": "telnet", + "boot_priority": "c", + "kvm": "require", + "options": "-nographic" + }, + "images": [ + { + "filename": "generic_alpine-3.21.2-x86_64-bios-cloudinit-r0.qcow2", + "version": "3.21.2", + "md5sum": "b40825dff2867e0ffaffbc4c87674462", + "filesize": 189726720, + "download_url": "https://www.alpinelinux.org/cloud/", + "direct_download_url": "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/cloud/generic_alpine-3.21.2-x86_64-bios-cloudinit-r0.qcow2" + }, + { + "filename": "alpine-cloud-init-data.iso", + "version": "1.0", + "md5sum": "b1b4b16cc3bf0250c0fa377c19c97683", + "filesize": 374784, + "download_url": "https://github.com/GNS3/gns3-registry/tree/master/cloud-init/alpine-cloud", + "direct_download_url": "https://github.com/GNS3/gns3-registry/raw/master/cloud-init/alpine-cloud/alpine-cloud-init-data.iso" + } + ], + "versions": [ + { + "name": "3.21.2", + "images": { + "hda_disk_image": "generic_alpine-3.21.2-x86_64-bios-cloudinit-r0.qcow2", + "cdrom_image": "alpine-cloud-init-data.iso" + } + } + ] +} diff --git a/gns3server/appliances/arista-veos.gns3a b/gns3server/appliances/arista-veos.gns3a index 29596d98..9a01ce25 100644 --- a/gns3server/appliances/arista-veos.gns3a +++ b/gns3server/appliances/arista-veos.gns3a @@ -2,14 +2,14 @@ "appliance_id": "c90f3ff3-4ed2-4437-9afb-21232fa92015", "name": "Arista vEOS", "category": "multilayer_switch", - "description": "Arista EOS\u00ae is the core of Arista cloud networking solutions for next-generation data centers and cloud networks. Cloud architectures built with Arista EOS scale to tens of thousands of compute and storage nodes with management and provisioning capabilities that work at scale. Through its programmability, EOS enables a set of software applications that deliver workflow automation, high availability, unprecedented network visibility and analytics and rapid integration with a wide range of third-party applications for virtualization, management, automation and orchestration services.\n\nArista Extensible Operating System (EOS) is a fully programmable and highly modular, Linux-based network operation system, using familiar industry standard CLI and runs a single binary software image across the Arista switching family. Architected for resiliency and programmability, EOS has a unique multi-process state sharing architecture that separates state information and packet forwarding from protocol processing and application logic.", + "description": "Arista EOS is the core of Arista cloud networking solutions for next-generation data centers and cloud networks. Cloud architectures built with Arista EOS scale to tens of thousands of compute and storage nodes with management and provisioning capabilities that work at scale. Through its programmability, EOS enables a set of software applications that deliver workflow automation, high availability, unprecedented network visibility and analytics and rapid integration with a wide range of third-party applications for virtualization, management, automation and orchestration services.\n\nArista Extensible Operating System (EOS) is a fully programmable and highly modular, Linux-based network operation system, using familiar industry standard CLI and runs a single binary software image across the Arista switching family. Architected for resiliency and programmability, EOS has a unique multi-process state sharing architecture that separates state information and packet forwarding from protocol processing and application logic.", "vendor_name": "Arista", "vendor_url": "http://www.arista.com/", "documentation_url": "https://www.arista.com/assets/data/docs/Manuals/EOS-4.17.2F-Manual.pdf", "product_name": "vEOS", "product_url": "https://eos.arista.com/", "registry_version": 4, - "status": "experimental", + "status": "stable", "maintainer": "GNS3 Team", "maintainer_email": "developers@gns3.net", "usage": "The login is admin, with no password by default", @@ -29,87 +29,24 @@ }, "images": [ { - "filename": "vEOS64-lab-4.32.0F.vmdk", - "version": "4.32.0F", - "md5sum": "851771260bb18ad3e90fa6956f0c6161", - "filesize": 591724544, + "filename": "vEOS-lab-4.33.1F.qcow2", + "version": "4.33.1F", + "md5sum": "8f662409c0732ed9f682edce63601e8a", + "filesize": 611909632, "download_url": "https://www.arista.com/en/support/software-download" }, { - "filename": "vEOS64-lab-4.31.3M.vmdk", - "version": "4.31.3M", - "md5sum": "7df107da137f4a4e752014d4f0e94cd3", - "filesize": 577961984, + "filename": "vEOS-lab-4.32.3M.qcow2", + "version": "4.32.3M", + "md5sum": "46fc46f5ed1da8752eed8396f08862f8", + "filesize": 605683712, "download_url": "https://www.arista.com/en/support/software-download" }, { - "filename": "vEOS64-lab-4.30.6M.vmdk", - "version": "4.30.6M", - "md5sum": "19721aace820b9ebf6d7ae6524803cf5", - "filesize": 553123840, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS64-lab-4.29.8M.vmdk", - "version": "4.29.8M", - "md5sum": "131888f74cd63a93894521d40eb4d0b6", - "filesize": 548405248, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS64-lab-4.28.11M.vmdk", - "version": "4.28.11M", - "md5sum": "6cac0e7b04a74ee0dc358327a00accfd", - "filesize": 513343488, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS64-lab-4.27.12M.vmdk", - "version": "4.27.12M", - "md5sum": "34c4f785c7fc054cda8754dd13c0d7c7", - "filesize": 496697344, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.32.0F.vmdk", - "version": "4.32.0F", - "md5sum": "584b901a1249717504050e48f74fb8dd", - "filesize": 591396864, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.31.3M.vmdk", - "version": "4.31.3M", - "md5sum": "a2e130697cdf8547006eebebde6eefca", - "filesize": 590086144, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.30.6M.vmdk", - "version": "4.30.6M", - "md5sum": "a4467648bcfa7b19640af8a4ad3153c6", - "filesize": 565968896, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.29.8M.vmdk", - "version": "4.29.8M", - "md5sum": "1952f6114a4376212c525db9ec8efd5f", - "filesize": 558039040, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.28.11M.vmdk", - "version": "4.28.11M", - "md5sum": "5502df24dfc231c45afb33d6018c16d0", - "filesize": 521338880, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.27.12M.vmdk", - "version": "4.27.12M", - "md5sum": "e08a97e7c1977993f947fedeb4c6ddd5", - "filesize": 504299520, + "filename": "vEOS-lab-4.31.6M.qcow2", + "version": "4.31.6M", + "md5sum": "7410110b77472f058322ec4681f8a356", + "filesize": 590479360, "download_url": "https://www.arista.com/en/support/software-download" }, { @@ -118,459 +55,28 @@ "md5sum": "8d7e754efebca1930a93a2587ff7606c", "filesize": 6291456, "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.26.2F.vmdk", - "version": "4.26.2F", - "md5sum": "de8ce9750fddb63bd3f71bccfcd7651e", - "filesize": 475332608, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.25.3M.vmdk", - "version": "4.25.3M", - "md5sum": "2f196969036b4d283e86f15118d59c26", - "filesize": 451543040, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.24.3M.vmdk", - "version": "4.24.3M", - "md5sum": "0a28e44c7ce4a8965f24a4a463a89b7d", - "filesize": 455213056, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.24.2.1F.vmdk", - "version": "4.24.2.1F", - "md5sum": "6bab8b59ce5230e243e56f4127448fc8", - "filesize": 455213056, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.23.4.2M.vmdk", - "version": "4.23.4.2M", - "md5sum": "d21cbef4e39f1e783b13a926cb54a242", - "filesize": 454295552, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.23.0.1F.vmdk", - "version": "4.23.0.1F", - "md5sum": "08d52154aa11a834aef9f42bbf29f977", - "filesize": 439484416, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.22.2.1F.vmdk", - "version": "4.22.2.1F", - "md5sum": "2a425bf8efe569a2bdf0e328f240cd16", - "filesize": 426377216, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.22.0F.vmdk", - "version": "4.22.0F", - "md5sum": "cfcc75c2b8176cfd819afcfd6799b74c", - "filesize": 414121984, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.21.1.1F.vmdk", - "version": "4.21.1F", - "md5sum": "02bfb7e53781fd44ff02357f201586d9", - "filesize": 358809600, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.20.10M-combined.vmdk", - "version": "4.20.10M-combined", - "md5sum": "d1f2d650f93dbf24e04fdd2c9d62bd62", - "filesize": 334626816, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.20.1F.vmdk", - "version": "4.20.1F", - "md5sum": "aadb6f3dbff28317f68cb4c4502d0db8", - "filesize": 662044672, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.19.10M-combined.vmdk", - "version": "4.19.10M-combined", - "md5sum": "103daa45c33be4584cbe6adc60de46a3", - "filesize": 324141056, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.19.10M.vmdk", - "version": "4.19.10M", - "md5sum": "665ed14389411ae5f16ba0a2ff84240a", - "filesize": 637337600, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.18.10M-combined.vmdk", - "version": "4.18.10M-combined", - "md5sum": "e33e0ef5b8cecc84c5bb57569b36b9c6", - "filesize": 317652992, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.18.10M.vmdk", - "version": "4.18.10M", - "md5sum": "1d87e9ace37fe3706dbf3e49c8d4d231", - "filesize": 624427008, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.18.5M.vmdk", - "version": "4.18.5M", - "md5sum": "b1ee6268dbaf2b2276fd7a5286c7ce2b", - "filesize": 623116288, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.18.1F.vmdk", - "version": "4.18.1F", - "md5sum": "9648c63185f3b793b47528a858ca4364", - "filesize": 620625920, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.17.8M.vmdk", - "version": "4.17.8M", - "md5sum": "afc79a06f930ea2cc0ae3e03cbfd3f23", - "filesize": 608829440, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.17.2F.vmdk", - "version": "4.17.2F", - "md5sum": "3b4845edfa77cf9aaeb9c0a005d3e277", - "filesize": 609615872, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.16.13M.vmdk", - "version": "4.16.13M", - "md5sum": "4d0facf90140fc3aab031f0f8f88a32f", - "filesize": 521404416, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.16.6M.vmdk", - "version": "4.16.6M", - "md5sum": "b3f7b7cee17f2e66bb38b453a4939fef", - "filesize": 519962624, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.15.10M.vmdk", - "version": "4.15.10M", - "md5sum": "98e08281a9c48ddf6f3c5d62a124a20f", - "filesize": 517079040, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.15.5M.vmdk", - "version": "4.15.5M", - "md5sum": "cd74bb69c7ee905ac3d33c4d109f3ab7", - "filesize": 516030464, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.14.14M.vmdk", - "version": "4.14.14M", - "md5sum": "d81ba0522f4d7838d96f7985e41cdc47", - "filesize": 422641664, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.13.16M.vmdk", - "version": "4.13.16M", - "md5sum": "5763b2c043830c341c8b1009f4ea9a49", - "filesize": 404684800, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "vEOS-lab-4.13.8M.vmdk", - "version": "4.13.8M", - "md5sum": "a47145b9e6e7a24171c0850f8755535e", - "filesize": 409010176, - "download_url": "https://www.arista.com/en/support/software-download" - }, - { - "filename": "Aboot-veos-serial-8.0.0.iso", - "version": "8.0.0", - "md5sum": "488ad1c435d18c69bb8d69c7806457c9", - "filesize": 5242880, - "download_url": "https://www.arista.com/en/support/software-download" } ], "versions": [ { - "name": "4.32.0F", + "name": "4.33.1F", "images": { "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS64-lab-4.32.0F.vmdk" + "hdb_disk_image": "vEOS-lab-4.33.1F.qcow2" } }, { - "name": "4.31.3M", + "name": "4.32.3M", "images": { "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS64-lab-4.31.3M.vmdk" + "hdb_disk_image": "vEOS-lab-4.32.3M.qcow2" } }, { - "name": "4.30.6M", + "name": "4.31.6M", "images": { "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS64-lab-4.30.6M.vmdk" - } - }, - { - "name": "4.29.8M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS64-lab-4.29.8M.vmdk" - } - }, - { - "name": "4.28.11M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS64-lab-4.28.11M.vmdk" - } - }, - { - "name": "4.27.12M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS64-lab-4.27.12M.vmdk" - } - }, - { - "name": "4.32.0F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS-lab-4.32.0F.vmdk" - } - }, - { - "name": "4.31.3M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS-lab-4.31.3M.vmdk" - } - }, - { - "name": "4.30.6M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS-lab-4.30.6M.vmdk" - } - }, - { - "name": "4.29.8M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS-lab-4.29.8M.vmdk" - } - }, - { - "name": "4.28.11M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS-lab-4.28.11M.vmdk" - } - }, - { - "name": "4.27.12M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.2.iso", - "hdb_disk_image": "vEOS-lab-4.27.12M.vmdk" - } - }, - { - "name": "4.26.2F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.26.2F.vmdk" - } - }, - { - "name": "4.25.3M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.25.3M.vmdk" - } - }, - { - "name": "4.24.3M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.24.3M.vmdk" - } - }, - { - "name": "4.24.2.1F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.24.2.1F.vmdk" - } - }, - { - "name": "4.23.4.2M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.23.4.2M.vmdk" - } - }, - { - "name": "4.23.0.1F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.23.0.1F.vmdk" - } - }, - { - "name": "4.22.2.1F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.22.2.1F.vmdk" - } - }, - { - "name": "4.22.0F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.22.0F.vmdk" - } - }, - { - "name": "4.21.1F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.21.1.1F.vmdk" - } - }, - { - "name": "4.20.10M-combined", - "images": { - "hda_disk_image": "vEOS-lab-4.20.10M-combined.vmdk" - } - }, - { - "name": "4.20.1F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.20.1F.vmdk" - } - }, - { - "name": "4.19.10M-combined", - "images": { - "hda_disk_image": "vEOS-lab-4.19.10M-combined.vmdk" - } - }, - { - "name": "4.19.10M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.19.10M.vmdk" - } - }, - { - "name": "4.18.10M-combined", - "images": { - "hda_disk_image": "vEOS-lab-4.18.10M-combined.vmdk" - } - }, - { - "name": "4.18.10M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.18.10M.vmdk" - } - }, - { - "name": "4.18.5M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.18.5M.vmdk" - } - }, - { - "name": "4.18.1F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.18.1F.vmdk" - } - }, - { - "name": "4.17.8M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.17.8M.vmdk" - } - }, - { - "name": "4.17.2F", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.17.2F.vmdk" - } - }, - { - "name": "4.16.13M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.16.13M.vmdk" - } - }, - { - "name": "4.16.6M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.16.6M.vmdk" - } - }, - { - "name": "4.15.10M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.15.10M.vmdk" - } - }, - { - "name": "4.15.5M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.15.5M.vmdk" - } - }, - { - "name": "4.14.14M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.14.14M.vmdk" - } - }, - { - "name": "4.13.16M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.13.16M.vmdk" - } - }, - { - "name": "4.13.8M", - "images": { - "hda_disk_image": "Aboot-veos-serial-8.0.0.iso", - "hdb_disk_image": "vEOS-lab-4.13.8M.vmdk" + "hdb_disk_image": "vEOS-lab-4.31.6M.qcow2" } } ] diff --git a/gns3server/appliances/cisco-iou-l2.gns3a b/gns3server/appliances/cisco-iou-l2.gns3a index 031a608a..4978d275 100644 --- a/gns3server/appliances/cisco-iou-l2.gns3a +++ b/gns3server/appliances/cisco-iou-l2.gns3a @@ -25,7 +25,7 @@ "filesize": 243251976 }, { - "filename": "x86_64_crb_linux_l2-adventerprisek9-ms.bin", + "filename": "x86_64_crb_linux_l2-adventerprisek9-ms", "version": "17.12.1", "md5sum": "2b5055e4cef8fd257416d74a94adb626", "filesize": 240355720 @@ -59,7 +59,7 @@ { "name": "17.12.1", "images": { - "image": "x86_64_crb_linux_l2-adventerprisek9-ms.bin" + "image": "x86_64_crb_linux_l2-adventerprisek9-ms" } }, { diff --git a/gns3server/appliances/cisco-iou-l3.gns3a b/gns3server/appliances/cisco-iou-l3.gns3a index 296fd05d..fe686a9c 100644 --- a/gns3server/appliances/cisco-iou-l3.gns3a +++ b/gns3server/appliances/cisco-iou-l3.gns3a @@ -25,7 +25,7 @@ "filesize": 292001512 }, { - "filename": "x86_64_crb_linux-adventerprisek9-ms.bin", + "filename": "x86_64_crb_linux-adventerprisek9-ms", "version": "17.12.1", "md5sum": "4a2fce8de21d1831fbceffd155e41ae7", "filesize": 288947184 @@ -59,7 +59,7 @@ { "name": "17.12.1", "images": { - "image": "x86_64_crb_linux-adventerprisek9-ms.bin" + "image": "x86_64_crb_linux-adventerprisek9-ms" } }, { diff --git a/gns3server/appliances/innovaphone-app.gns3a b/gns3server/appliances/innovaphone-app.gns3a new file mode 100644 index 00000000..e7b274dd --- /dev/null +++ b/gns3server/appliances/innovaphone-app.gns3a @@ -0,0 +1,50 @@ +{ + "appliance_id": "92dbd0e9-144e-4c59-a4a8-97b6a1661818", + "name": "Innovaphone App-Platform", + "category": "guest", + "description": "In addition to telephony, apps for Video Telephony, Chat, Conferencing, Application Sharing and many other functions have become indispensable UCC tools in the area of business communication. Based on the myApps platform and its various components, innovaphone provides a collaborative work and communication platform for enhanced corporate communications \u2013 regardless of the location and the device being used. The innovaphone platform myApps consists of many independent components that work well individually, yet unfold their remarkable performance when combined.", + "vendor_name": "Innovaphone", + "vendor_url": "https://www.innovaphone.com", + "vendor_logo_url": "https://www.innovaphone.com/content/downloads/innovaphone-myapps-logo-short-without-background-screen.png", + "documentation_url": "https://wiki.innovaphone.com/index.php?title=Reference14r2:Concept_App_Platform", + "product_name": "App-Platform", + "product_url": "https://www.innovaphone.com/en/products/myapps/myapps-platform.html", + "registry_version": 4, + "status": "experimental", + "availability": "free-to-try", + "maintainer": "Thomas Marchsteiner", + "maintainer_email": "thomas.marchsteiner@acp.at", + "usage": "Default users console:root/iplinux , ssh:admin/ipapps , Webinterface:pwd \nAfter first boot wait for automatic reboot.\nA static ip can be set via the setip utility. \nLoading another keymap can be done via the loadkeys command. \nThe app-platform-disk1.vmdk file is contained within an ova file. \nIt can be extraced with the tar utility, 7Zip or any other tool which can handle tar files.", + "symbol": "innovaphone-ap-icon.jpg", + "first_port_name": "eth0", + "qemu": { + "adapter_type": "vmxnet3", + "adapters": 1, + "ram": 512, + "cpus": 1, + "hda_disk_interface": "scsi", + "arch": "x86_64", + "console_type": "vnc", + "boot_priority": "d", + "kvm": "allow", + "on_close": "power_off", + "process_priority": "normal" + }, + "images": [ + { + "filename": "app-platform-disk1_120010.vmdk", + "version": "12.0010", + "md5sum": "d5a5a77f682c2c988b0810935d79a787", + "filesize": 129474560, + "download_url": "https://store.innovaphone.com/" + } + ], + "versions": [ + { + "images": { + "hda_disk_image": "app-platform-disk1_120010.vmdk" + }, + "name": "12.0010" + } + ] +} diff --git a/gns3server/appliances/innovaphone-ipva.gns3a b/gns3server/appliances/innovaphone-ipva.gns3a new file mode 100644 index 00000000..ce05eb44 --- /dev/null +++ b/gns3server/appliances/innovaphone-ipva.gns3a @@ -0,0 +1,78 @@ +{ + "appliance_id": "ddf8f7a4-60c0-4c9d-849c-ffc3c9d1d082", + "name": "Innovaphone IPVA", + "category": "guest", + "description": "The innovaphone PBX is a professional IP telephone system. The IPVA is a software-only solution. It appears as and performs as an innovaphone 'hard-box' excluding DSP-, ISDN-/AB-resources.", + "vendor_name": "Innovaphone", + "vendor_url": "https://www.innovaphone.com/", + "vendor_logo_url": "https://www.innovaphone.com/content/downloads/innovaphone-myapps-logo-short-without-background-screen.png", + "documentation_url": "https://wiki.innovaphone.com/index.php?title=Reference15r1:Concept_Innovaphone_Virtual_Appliance_(IPVA)", + "product_name": "IPVA", + "product_url": "https://www.innovaphone.com/en/products/innovaphone-pbx.html", + "registry_version": 4, + "status": "experimental", + "availability": "free-to-try", + "maintainer": "Thomas Marchsteiner", + "maintainer_email": "thomas.marchsteiner@acp.at", + "usage": "Default user admin/ipva \nDefault network configuration: DHCP client on eth0 with fallback to static address 192.168.0.1/24 after timeout. Static address 192.168.1.1/24 on eth1\n The ova in the zip file contains the disk images to run this appliance. Disableing the dhcp client and setting a static IP is possible with the following commands:\n> config change IP0 ETH0 /addr 192.168.0.1 /mask 255.255.255.0 \n> config change DHCP0 /mode off \n> config write \n> config activate \n> reset", + "symbol": "innovaphone-pbx-green.png", + "first_port_name": "eth0", + "port_name_format": "eth{port1}", + "qemu": { + "adapter_type": "vmxnet3", + "adapters": 2, + "ram": 256, + "cpus": 1, + "hda_disk_interface": "ide", + "hdb_disk_interface": "ide", + "hdc_disk_interface": "ide", + "hdd_disk_interface": "ide", + "arch": "x86_64", + "console_type": "vnc", + "boot_priority": "d", + "kvm": "allow", + "on_close": "power_off", + "process_priority": "normal" + }, + "images": [ + { + "filename": "ipva-qemu-disk1-14r2.vmdk", + "version": "14r2", + "md5sum": "aaa1c3885eee30ca6ffa3827619e8643", + "filesize": 6269952, + "download_url": "https://store.innovaphone.com/" + }, + { + "filename": "ipva-qemu-disk2-14r2.vmdk", + "version": "14r2", + "md5sum": "008a8fc6b0b1e5f11a3e7fd6f22ba349", + "filesize": 72192, + "download_url": "https://store.innovaphone.com/" + }, + { + "filename": "ipva-qemu-disk3-14r2.vmdk", + "version": "14r2", + "md5sum": "20516731c480e2112b3fb4a4d7f514f2", + "filesize": 68096, + "download_url": "https://store.innovaphone.com/" + }, + { + "filename": "ipva-qemu-disk4-14r2.vmdk", + "version": "14r2", + "md5sum": "15d7d79ef8c28bd29b2eceac8405f964", + "filesize": 68096, + "download_url": "https://store.innovaphone.com/" + } + ], + "versions": [ + { + "images": { + "hda_disk_image": "ipva-qemu-disk1-14r2.vmdk", + "hdb_disk_image": "ipva-qemu-disk2-14r2.vmdk", + "hdc_disk_image": "ipva-qemu-disk3-14r2.vmdk", + "hdd_disk_image": "ipva-qemu-disk4-14r2.vmdk" + }, + "name": "14r2" + } + ] +} diff --git a/gns3server/appliances/pfsense.gns3a b/gns3server/appliances/pfsense.gns3a index c0f0ebfa..691026ca 100644 --- a/gns3server/appliances/pfsense.gns3a +++ b/gns3server/appliances/pfsense.gns3a @@ -24,6 +24,13 @@ "process_priority": "normal" }, "images": [ + { + "filename": "pfSense-CE-2.7.2-RELEASE-amd64.iso", + "version": "2.7.2", + "md5sum": "50c3e723d68ec74d038041a34fa846f8", + "filesize": 874672128, + "download_url": "https://www.pfsense.org/download/mirror.php?section=downloads" + }, { "filename": "pfSense-CE-2.7.0-RELEASE-amd64.iso", "version": "2.7.0", @@ -76,6 +83,13 @@ } ], "versions": [ + { + "name": "2.7.2", + "images": { + "hda_disk_image": "empty100G.qcow2", + "cdrom_image": "pfSense-CE-2.7.2-RELEASE-amd64.iso" + } + }, { "name": "2.7.0", "images": { diff --git a/gns3server/appliances/stormshield-eva.gns3a b/gns3server/appliances/stormshield-eva.gns3a new file mode 100644 index 00000000..20f71cf1 --- /dev/null +++ b/gns3server/appliances/stormshield-eva.gns3a @@ -0,0 +1,50 @@ +{ + "appliance_id": "60801097-332e-4f40-a63e-8ad62047c01f", + "name": "Stormshield EVA", + "category": "firewall", + "description": "Stormshield EVA (Elastic Virtual Appliance) is a french virtual firewall designed to protect network infrastructures. It offers advanced features such as filtering, intrusion prevention (IPS), VPN management (IPSec/SSL), and access control.", + "vendor_name": "Stormshield", + "vendor_url": "https://www.stormshield.com/", + "vendor_logo_url": "https://www.stormshield.com/wp-content/uploads/stormshield-logo.png", + "documentation_url": "https://www.stormshield.com/fr/ressourcescenter/network-security-elastic-virtual-appliances/", + "product_name": "Stormshield EVA", + "product_url": "https://www.stormshield.com/fr/produits-et-services/produits/protection-des-reseaux/nos-produits/appliances-virtuelles/", + "registry_version": 4, + "status": "stable", + "availability": "service-contract", + "maintainer": "Samy SCANNA", + "maintainer_email": "samy.scanna@outlook.com", + "usage": "After the first boot, the appliance automatically runs the configuration script to set up the password, and network interfaces.", + "symbol": "stormshield.png", + "port_name_format": "port{port1}", + "qemu": { + "adapter_type": "vmxnet3", + "adapters": 8, + "ram": 2048, + "cpus": 1, + "hda_disk_interface": "scsi", + "arch": "x86_64", + "console_type": "telnet", + "kvm": "allow", + "options": "-serial stdio", + "on_close": "shutdown_signal", + "process_priority": "normal" + }, + "images": [ + { + "filename": "utm-SNS-EVA-4.3.33-kvm.qcow2", + "version": "4.3.33", + "md5sum": "21d94d0e20f2e270f06c5853fd750d5b", + "filesize": 284360704, + "download_url": "https://mystormshield.eu/product/download/" + } + ], + "versions": [ + { + "images": { + "hda_disk_image": "utm-SNS-EVA-4.3.33-kvm.qcow2" + }, + "name": "4.3.33" + } + ] +} From 7b7d3d676fc6db3ebe7e72195dfea50e0688fb36 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 21 Jan 2025 11:43:11 +1000 Subject: [PATCH 10/28] Bundle web-ui v2.2.53 --- gns3server/static/web-ui/index.html | 2 +- gns3server/static/web-ui/main.c83939cdfe3af0ec27df.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 gns3server/static/web-ui/main.c83939cdfe3af0ec27df.js diff --git a/gns3server/static/web-ui/index.html b/gns3server/static/web-ui/index.html index 4ecb05cb..40ccd469 100644 --- a/gns3server/static/web-ui/index.html +++ b/gns3server/static/web-ui/index.html @@ -46,6 +46,6 @@ gtag('config', 'G-0BT7QQV1W1'); - + \ No newline at end of file diff --git a/gns3server/static/web-ui/main.c83939cdfe3af0ec27df.js b/gns3server/static/web-ui/main.c83939cdfe3af0ec27df.js new file mode 100644 index 00000000..4134f591 --- /dev/null +++ b/gns3server/static/web-ui/main.c83939cdfe3af0ec27df.js @@ -0,0 +1 @@ +(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[179],{98255:function(ue){function q(f){return Promise.resolve().then(function(){var B=new Error("Cannot find module '"+f+"'");throw B.code="MODULE_NOT_FOUND",B})}q.keys=function(){return[]},q.resolve=q,q.id=98255,ue.exports=q},82908:function(ue){ue.exports=function(f,B){(null==B||B>f.length)&&(B=f.length);for(var U=0,V=new Array(B);U0&&oe[oe.length-1])&&(6===qe[0]||2===qe[0])){se=0;continue}if(3===qe[0]&&(!oe||qe[1]>oe[0]&&qe[1]1&&void 0!==arguments[1]?arguments[1]:null;return{type:4,styles:j,timings:K}}function I(K){var j=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:2,steps:K,options:j}}function D(K){return{type:6,styles:K,offset:null}}function A(K,j,J){return{type:0,name:K,styles:j,options:J}}function S(K){return{type:5,steps:K}}function v(K,j){var J=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:1,expr:K,animation:j,options:J}}function T(){var K=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:9,options:K}}function k(K,j){var J=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:11,selector:K,animation:j,options:J}}function x(K){Promise.resolve(null).then(K)}var O=function(){function K(){var j=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,J=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,U.Z)(this,K),this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=j+J}return(0,B.Z)(K,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(J){return J()}),this._onDoneFns=[])}},{key:"onStart",value:function(J){this._onStartFns.push(J)}},{key:"onDone",value:function(J){this._onDoneFns.push(J)}},{key:"onDestroy",value:function(J){this._onDestroyFns.push(J)}},{key:"hasStarted",value:function(){return this._started}},{key:"init",value:function(){}},{key:"play",value:function(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}},{key:"triggerMicrotask",value:function(){var J=this;x(function(){return J._onFinish()})}},{key:"_onStart",value:function(){this._onStartFns.forEach(function(J){return J()}),this._onStartFns=[]}},{key:"pause",value:function(){}},{key:"restart",value:function(){}},{key:"finish",value:function(){this._onFinish()}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(function(J){return J()}),this._onDestroyFns=[])}},{key:"reset",value:function(){this._started=!1}},{key:"setPosition",value:function(J){this._position=this.totalTime?J*this.totalTime:1}},{key:"getPosition",value:function(){return this.totalTime?this._position/this.totalTime:1}},{key:"triggerCallback",value:function(J){var ee="start"==J?this._onStartFns:this._onDoneFns;ee.forEach(function($){return $()}),ee.length=0}}]),K}(),F=function(){function K(j){var J=this;(0,U.Z)(this,K),this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=j;var ee=0,$=0,ae=0,se=this.players.length;0==se?x(function(){return J._onFinish()}):this.players.forEach(function(ce){ce.onDone(function(){++ee==se&&J._onFinish()}),ce.onDestroy(function(){++$==se&&J._onDestroy()}),ce.onStart(function(){++ae==se&&J._onStart()})}),this.totalTime=this.players.reduce(function(ce,le){return Math.max(ce,le.totalTime)},0)}return(0,B.Z)(K,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(J){return J()}),this._onDoneFns=[])}},{key:"init",value:function(){this.players.forEach(function(J){return J.init()})}},{key:"onStart",value:function(J){this._onStartFns.push(J)}},{key:"_onStart",value:function(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(function(J){return J()}),this._onStartFns=[])}},{key:"onDone",value:function(J){this._onDoneFns.push(J)}},{key:"onDestroy",value:function(J){this._onDestroyFns.push(J)}},{key:"hasStarted",value:function(){return this._started}},{key:"play",value:function(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(function(J){return J.play()})}},{key:"pause",value:function(){this.players.forEach(function(J){return J.pause()})}},{key:"restart",value:function(){this.players.forEach(function(J){return J.restart()})}},{key:"finish",value:function(){this._onFinish(),this.players.forEach(function(J){return J.finish()})}},{key:"destroy",value:function(){this._onDestroy()}},{key:"_onDestroy",value:function(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(function(J){return J.destroy()}),this._onDestroyFns.forEach(function(J){return J()}),this._onDestroyFns=[])}},{key:"reset",value:function(){this.players.forEach(function(J){return J.reset()}),this._destroyed=!1,this._finished=!1,this._started=!1}},{key:"setPosition",value:function(J){var ee=J*this.totalTime;this.players.forEach(function($){var ae=$.totalTime?Math.min(1,ee/$.totalTime):1;$.setPosition(ae)})}},{key:"getPosition",value:function(){var J=this.players.reduce(function(ee,$){return null===ee||$.totalTime>ee.totalTime?$:ee},null);return null!=J?J.getPosition():0}},{key:"beforeDestroy",value:function(){this.players.forEach(function(J){J.beforeDestroy&&J.beforeDestroy()})}},{key:"triggerCallback",value:function(J){var ee="start"==J?this._onStartFns:this._onDoneFns;ee.forEach(function($){return $()}),ee.length=0}}]),K}(),z="!"},6517:function(ue,q,f){"use strict";f.d(q,{rt:function(){return rt},s1:function(){return xe},$s:function(){return qe},kH:function(){return ur},Em:function(){return De},tE:function(){return tr},qV:function(){return Ln},qm:function(){return Oe},Kd:function(){return In},X6:function(){return we},yG:function(){return ct}});var B=f(71955),U=f(13920),V=f(89200),Z=f(10509),w=f(97154),N=f(18967),b=f(14105),_=f(40098),I=f(38999),D=f(68707),A=f(5051),S=f(90838),v=f(43161),g=f(32819),T=f(59371),R=f(57263),k=f(58780),E=f(85639),x=f(48359),O=f(18756),F=f(76161),z=f(44213),K=f(78081),j=f(15427),J=f(96798);function se(he,Ie){return(he.getAttribute(Ie)||"").match(/\S+/g)||[]}var ce="cdk-describedby-message-container",le="cdk-describedby-message",oe="cdk-describedby-host",Ae=0,be=new Map,it=null,qe=function(){var he=function(){function Ie(Ne){(0,N.Z)(this,Ie),this._document=Ne}return(0,b.Z)(Ie,[{key:"describe",value:function(Le,ze,At){if(this._canBeDescribed(Le,ze)){var an=_t(ze,At);"string"!=typeof ze?(yt(ze),be.set(an,{messageElement:ze,referenceCount:0})):be.has(an)||this._createMessageElement(ze,At),this._isElementDescribedByMessage(Le,an)||this._addMessageReference(Le,an)}}},{key:"removeDescription",value:function(Le,ze,At){if(ze&&this._isElementNode(Le)){var an=_t(ze,At);if(this._isElementDescribedByMessage(Le,an)&&this._removeMessageReference(Le,an),"string"==typeof ze){var jn=be.get(an);jn&&0===jn.referenceCount&&this._deleteMessageElement(an)}it&&0===it.childNodes.length&&this._deleteMessagesContainer()}}},{key:"ngOnDestroy",value:function(){for(var Le=this._document.querySelectorAll("[".concat(oe,"]")),ze=0;ze-1&&At!==Ne._activeItemIndex&&(Ne._activeItemIndex=At)}})}return(0,b.Z)(he,[{key:"skipPredicate",value:function(Ne){return this._skipPredicateFn=Ne,this}},{key:"withWrap",value:function(){var Ne=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._wrap=Ne,this}},{key:"withVerticalOrientation",value:function(){var Ne=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._vertical=Ne,this}},{key:"withHorizontalOrientation",value:function(Ne){return this._horizontal=Ne,this}},{key:"withAllowedModifierKeys",value:function(Ne){return this._allowedModifierKeys=Ne,this}},{key:"withTypeAhead",value:function(){var Ne=this,Le=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe((0,T.b)(function(ze){return Ne._pressedLetters.push(ze)}),(0,R.b)(Le),(0,k.h)(function(){return Ne._pressedLetters.length>0}),(0,E.U)(function(){return Ne._pressedLetters.join("")})).subscribe(function(ze){for(var At=Ne._getItemsArray(),an=1;an0&&void 0!==arguments[0])||arguments[0];return this._homeAndEnd=Ne,this}},{key:"setActiveItem",value:function(Ne){var Le=this._activeItem;this.updateActiveItem(Ne),this._activeItem!==Le&&this.change.next(this._activeItemIndex)}},{key:"onKeydown",value:function(Ne){var Le=this,ze=Ne.keyCode,an=["altKey","ctrlKey","metaKey","shiftKey"].every(function(jn){return!Ne[jn]||Le._allowedModifierKeys.indexOf(jn)>-1});switch(ze){case g.Mf:return void this.tabOut.next();case g.JH:if(this._vertical&&an){this.setNextItemActive();break}return;case g.LH:if(this._vertical&&an){this.setPreviousItemActive();break}return;case g.SV:if(this._horizontal&&an){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case g.oh:if(this._horizontal&&an){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case g.Sd:if(this._homeAndEnd&&an){this.setFirstItemActive();break}return;case g.uR:if(this._homeAndEnd&&an){this.setLastItemActive();break}return;default:return void((an||(0,g.Vb)(Ne,"shiftKey"))&&(Ne.key&&1===Ne.key.length?this._letterKeyStream.next(Ne.key.toLocaleUpperCase()):(ze>=g.A&&ze<=g.Z||ze>=g.xE&&ze<=g.aO)&&this._letterKeyStream.next(String.fromCharCode(ze))))}this._pressedLetters=[],Ne.preventDefault()}},{key:"activeItemIndex",get:function(){return this._activeItemIndex}},{key:"activeItem",get:function(){return this._activeItem}},{key:"isTyping",value:function(){return this._pressedLetters.length>0}},{key:"setFirstItemActive",value:function(){this._setActiveItemByIndex(0,1)}},{key:"setLastItemActive",value:function(){this._setActiveItemByIndex(this._items.length-1,-1)}},{key:"setNextItemActive",value:function(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}},{key:"setPreviousItemActive",value:function(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}},{key:"updateActiveItem",value:function(Ne){var Le=this._getItemsArray(),ze="number"==typeof Ne?Ne:Le.indexOf(Ne),At=Le[ze];this._activeItem=null==At?null:At,this._activeItemIndex=ze}},{key:"_setActiveItemByDelta",value:function(Ne){this._wrap?this._setActiveInWrapMode(Ne):this._setActiveInDefaultMode(Ne)}},{key:"_setActiveInWrapMode",value:function(Ne){for(var Le=this._getItemsArray(),ze=1;ze<=Le.length;ze++){var At=(this._activeItemIndex+Ne*ze+Le.length)%Le.length;if(!this._skipPredicateFn(Le[At]))return void this.setActiveItem(At)}}},{key:"_setActiveInDefaultMode",value:function(Ne){this._setActiveItemByIndex(this._activeItemIndex+Ne,Ne)}},{key:"_setActiveItemByIndex",value:function(Ne,Le){var ze=this._getItemsArray();if(ze[Ne]){for(;this._skipPredicateFn(ze[Ne]);)if(!ze[Ne+=Le])return;this.setActiveItem(Ne)}}},{key:"_getItemsArray",value:function(){return this._items instanceof I.n_E?this._items.toArray():this._items}}]),he}(),xe=function(he){(0,Z.Z)(Ne,he);var Ie=(0,w.Z)(Ne);function Ne(){return(0,N.Z)(this,Ne),Ie.apply(this,arguments)}return(0,b.Z)(Ne,[{key:"setActiveItem",value:function(ze){this.activeItem&&this.activeItem.setInactiveStyles(),(0,U.Z)((0,V.Z)(Ne.prototype),"setActiveItem",this).call(this,ze),this.activeItem&&this.activeItem.setActiveStyles()}}]),Ne}(Ft),De=function(he){(0,Z.Z)(Ne,he);var Ie=(0,w.Z)(Ne);function Ne(){var Le;return(0,N.Z)(this,Ne),(Le=Ie.apply(this,arguments))._origin="program",Le}return(0,b.Z)(Ne,[{key:"setFocusOrigin",value:function(ze){return this._origin=ze,this}},{key:"setActiveItem",value:function(ze){(0,U.Z)((0,V.Z)(Ne.prototype),"setActiveItem",this).call(this,ze),this.activeItem&&this.activeItem.focus(this._origin)}}]),Ne}(Ft),dt=function(){var he=function(){function Ie(Ne){(0,N.Z)(this,Ie),this._platform=Ne}return(0,b.Z)(Ie,[{key:"isDisabled",value:function(Le){return Le.hasAttribute("disabled")}},{key:"isVisible",value:function(Le){return function(he){return!!(he.offsetWidth||he.offsetHeight||"function"==typeof he.getClientRects&&he.getClientRects().length)}(Le)&&"visible"===getComputedStyle(Le).visibility}},{key:"isTabbable",value:function(Le){if(!this._platform.isBrowser)return!1;var ze=function(he){try{return he.frameElement}catch(Ie){return null}}(function(he){return he.ownerDocument&&he.ownerDocument.defaultView||window}(Le));if(ze&&(-1===bt(ze)||!this.isVisible(ze)))return!1;var At=Le.nodeName.toLowerCase(),an=bt(Le);return Le.hasAttribute("contenteditable")?-1!==an:!("iframe"===At||"object"===At||this._platform.WEBKIT&&this._platform.IOS&&!function(he){var Ie=he.nodeName.toLowerCase(),Ne="input"===Ie&&he.type;return"text"===Ne||"password"===Ne||"select"===Ie||"textarea"===Ie}(Le))&&("audio"===At?!!Le.hasAttribute("controls")&&-1!==an:"video"===At?-1!==an&&(null!==an||this._platform.FIREFOX||Le.hasAttribute("controls")):Le.tabIndex>=0)}},{key:"isFocusable",value:function(Le,ze){return function(he){return!function(he){return function(he){return"input"==he.nodeName.toLowerCase()}(he)&&"hidden"==he.type}(he)&&(function(he){var Ie=he.nodeName.toLowerCase();return"input"===Ie||"select"===Ie||"button"===Ie||"textarea"===Ie}(he)||function(he){return function(he){return"a"==he.nodeName.toLowerCase()}(he)&&he.hasAttribute("href")}(he)||he.hasAttribute("contenteditable")||qt(he))}(Le)&&!this.isDisabled(Le)&&((null==ze?void 0:ze.ignoreVisibility)||this.isVisible(Le))}}]),Ie}();return he.\u0275fac=function(Ne){return new(Ne||he)(I.LFG(j.t4))},he.\u0275prov=I.Yz7({factory:function(){return new he(I.LFG(j.t4))},token:he,providedIn:"root"}),he}();function qt(he){if(!he.hasAttribute("tabindex")||void 0===he.tabIndex)return!1;var Ie=he.getAttribute("tabindex");return"-32768"!=Ie&&!(!Ie||isNaN(parseInt(Ie,10)))}function bt(he){if(!qt(he))return null;var Ie=parseInt(he.getAttribute("tabindex")||"",10);return isNaN(Ie)?-1:Ie}var kn=function(){function he(Ie,Ne,Le,ze){var At=this,an=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,N.Z)(this,he),this._element=Ie,this._checker=Ne,this._ngZone=Le,this._document=ze,this._hasAttached=!1,this.startAnchorListener=function(){return At.focusLastTabbableElement()},this.endAnchorListener=function(){return At.focusFirstTabbableElement()},this._enabled=!0,an||this.attachAnchors()}return(0,b.Z)(he,[{key:"enabled",get:function(){return this._enabled},set:function(Ne){this._enabled=Ne,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(Ne,this._startAnchor),this._toggleAnchorTabIndex(Ne,this._endAnchor))}},{key:"destroy",value:function(){var Ne=this._startAnchor,Le=this._endAnchor;Ne&&(Ne.removeEventListener("focus",this.startAnchorListener),Ne.parentNode&&Ne.parentNode.removeChild(Ne)),Le&&(Le.removeEventListener("focus",this.endAnchorListener),Le.parentNode&&Le.parentNode.removeChild(Le)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}},{key:"attachAnchors",value:function(){var Ne=this;return!!this._hasAttached||(this._ngZone.runOutsideAngular(function(){Ne._startAnchor||(Ne._startAnchor=Ne._createAnchor(),Ne._startAnchor.addEventListener("focus",Ne.startAnchorListener)),Ne._endAnchor||(Ne._endAnchor=Ne._createAnchor(),Ne._endAnchor.addEventListener("focus",Ne.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}},{key:"focusInitialElementWhenReady",value:function(Ne){var Le=this;return new Promise(function(ze){Le._executeOnStable(function(){return ze(Le.focusInitialElement(Ne))})})}},{key:"focusFirstTabbableElementWhenReady",value:function(Ne){var Le=this;return new Promise(function(ze){Le._executeOnStable(function(){return ze(Le.focusFirstTabbableElement(Ne))})})}},{key:"focusLastTabbableElementWhenReady",value:function(Ne){var Le=this;return new Promise(function(ze){Le._executeOnStable(function(){return ze(Le.focusLastTabbableElement(Ne))})})}},{key:"_getRegionBoundary",value:function(Ne){for(var Le=this._element.querySelectorAll("[cdk-focus-region-".concat(Ne,"], ")+"[cdkFocusRegion".concat(Ne,"], ")+"[cdk-focus-".concat(Ne,"]")),ze=0;ze=0;ze--){var At=Le[ze].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(Le[ze]):null;if(At)return At}return null}},{key:"_createAnchor",value:function(){var Ne=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,Ne),Ne.classList.add("cdk-visually-hidden"),Ne.classList.add("cdk-focus-trap-anchor"),Ne.setAttribute("aria-hidden","true"),Ne}},{key:"_toggleAnchorTabIndex",value:function(Ne,Le){Ne?Le.setAttribute("tabindex","0"):Le.removeAttribute("tabindex")}},{key:"toggleAnchors",value:function(Ne){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(Ne,this._startAnchor),this._toggleAnchorTabIndex(Ne,this._endAnchor))}},{key:"_executeOnStable",value:function(Ne){this._ngZone.isStable?Ne():this._ngZone.onStable.pipe((0,x.q)(1)).subscribe(Ne)}}]),he}(),Ln=function(){var he=function(){function Ie(Ne,Le,ze){(0,N.Z)(this,Ie),this._checker=Ne,this._ngZone=Le,this._document=ze}return(0,b.Z)(Ie,[{key:"create",value:function(Le){var ze=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new kn(Le,this._checker,this._ngZone,this._document,ze)}}]),Ie}();return he.\u0275fac=function(Ne){return new(Ne||he)(I.LFG(dt),I.LFG(I.R0b),I.LFG(_.K0))},he.\u0275prov=I.Yz7({factory:function(){return new he(I.LFG(dt),I.LFG(I.R0b),I.LFG(_.K0))},token:he,providedIn:"root"}),he}();function we(he){return 0===he.offsetX&&0===he.offsetY}function ct(he){var Ie=he.touches&&he.touches[0]||he.changedTouches&&he.changedTouches[0];return!(!Ie||-1!==Ie.identifier||null!=Ie.radiusX&&1!==Ie.radiusX||null!=Ie.radiusY&&1!==Ie.radiusY)}"undefined"!=typeof Element&∈var ft=new I.OlP("cdk-input-modality-detector-options"),Yt={ignoreKeys:[g.zL,g.jx,g.b2,g.MW,g.JU]},Jt=(0,j.i$)({passive:!0,capture:!0}),nn=function(){var he=function(){function Ie(Ne,Le,ze,At){var an=this;(0,N.Z)(this,Ie),this._platform=Ne,this._mostRecentTarget=null,this._modality=new S.X(null),this._lastTouchMs=0,this._onKeydown=function(jn){var Rr,Hr;(null===(Hr=null===(Rr=an._options)||void 0===Rr?void 0:Rr.ignoreKeys)||void 0===Hr?void 0:Hr.some(function(yr){return yr===jn.keyCode}))||(an._modality.next("keyboard"),an._mostRecentTarget=(0,j.sA)(jn))},this._onMousedown=function(jn){Date.now()-an._lastTouchMs<650||(an._modality.next(we(jn)?"keyboard":"mouse"),an._mostRecentTarget=(0,j.sA)(jn))},this._onTouchstart=function(jn){ct(jn)?an._modality.next("keyboard"):(an._lastTouchMs=Date.now(),an._modality.next("touch"),an._mostRecentTarget=(0,j.sA)(jn))},this._options=Object.assign(Object.assign({},Yt),At),this.modalityDetected=this._modality.pipe((0,O.T)(1)),this.modalityChanged=this.modalityDetected.pipe((0,F.x)()),Ne.isBrowser&&Le.runOutsideAngular(function(){ze.addEventListener("keydown",an._onKeydown,Jt),ze.addEventListener("mousedown",an._onMousedown,Jt),ze.addEventListener("touchstart",an._onTouchstart,Jt)})}return(0,b.Z)(Ie,[{key:"mostRecentModality",get:function(){return this._modality.value}},{key:"ngOnDestroy",value:function(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,Jt),document.removeEventListener("mousedown",this._onMousedown,Jt),document.removeEventListener("touchstart",this._onTouchstart,Jt))}}]),Ie}();return he.\u0275fac=function(Ne){return new(Ne||he)(I.LFG(j.t4),I.LFG(I.R0b),I.LFG(_.K0),I.LFG(ft,8))},he.\u0275prov=I.Yz7({factory:function(){return new he(I.LFG(j.t4),I.LFG(I.R0b),I.LFG(_.K0),I.LFG(ft,8))},token:he,providedIn:"root"}),he}(),ln=new I.OlP("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),Tn=new I.OlP("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),In=function(){var he=function(){function Ie(Ne,Le,ze,At){(0,N.Z)(this,Ie),this._ngZone=Le,this._defaultOptions=At,this._document=ze,this._liveElement=Ne||this._createLiveElement()}return(0,b.Z)(Ie,[{key:"announce",value:function(Le){for(var an,jn,ze=this,At=this._defaultOptions,Rr=arguments.length,Hr=new Array(Rr>1?Rr-1:0),yr=1;yr1&&void 0!==arguments[1]&&arguments[1],At=(0,K.fI)(Le);if(!this._platform.isBrowser||1!==At.nodeType)return(0,v.of)(null);var an=(0,j.kV)(At)||this._getDocument(),jn=this._elementInfo.get(At);if(jn)return ze&&(jn.checkChildren=!0),jn.subject;var Rr={checkChildren:ze,subject:new D.xQ,rootNode:an};return this._elementInfo.set(At,Rr),this._registerGlobalListeners(Rr),Rr.subject}},{key:"stopMonitoring",value:function(Le){var ze=(0,K.fI)(Le),At=this._elementInfo.get(ze);At&&(At.subject.complete(),this._setClasses(ze),this._elementInfo.delete(ze),this._removeGlobalListeners(At))}},{key:"focusVia",value:function(Le,ze,At){var an=this,jn=(0,K.fI)(Le);jn===this._getDocument().activeElement?this._getClosestElementsInfo(jn).forEach(function(Hr){var yr=(0,B.Z)(Hr,2);return an._originChanged(yr[0],ze,yr[1])}):(this._setOrigin(ze),"function"==typeof jn.focus&&jn.focus(At))}},{key:"ngOnDestroy",value:function(){var Le=this;this._elementInfo.forEach(function(ze,At){return Le.stopMonitoring(At)})}},{key:"_getDocument",value:function(){return this._document||document}},{key:"_getWindow",value:function(){return this._getDocument().defaultView||window}},{key:"_toggleClass",value:function(Le,ze,At){At?Le.classList.add(ze):Le.classList.remove(ze)}},{key:"_getFocusOrigin",value:function(Le){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(Le)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}},{key:"_shouldBeAttributedToTouch",value:function(Le){return 1===this._detectionMode||!!(null==Le?void 0:Le.contains(this._inputModalityDetector._mostRecentTarget))}},{key:"_setClasses",value:function(Le,ze){this._toggleClass(Le,"cdk-focused",!!ze),this._toggleClass(Le,"cdk-touch-focused","touch"===ze),this._toggleClass(Le,"cdk-keyboard-focused","keyboard"===ze),this._toggleClass(Le,"cdk-mouse-focused","mouse"===ze),this._toggleClass(Le,"cdk-program-focused","program"===ze)}},{key:"_setOrigin",value:function(Le){var ze=this,At=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ngZone.runOutsideAngular(function(){ze._origin=Le,ze._originFromTouchInteraction="touch"===Le&&At,0===ze._detectionMode&&(clearTimeout(ze._originTimeoutId),ze._originTimeoutId=setTimeout(function(){return ze._origin=null},ze._originFromTouchInteraction?650:1))})}},{key:"_onFocus",value:function(Le,ze){var At=this._elementInfo.get(ze),an=(0,j.sA)(Le);!At||!At.checkChildren&&ze!==an||this._originChanged(ze,this._getFocusOrigin(an),At)}},{key:"_onBlur",value:function(Le,ze){var At=this._elementInfo.get(ze);!At||At.checkChildren&&Le.relatedTarget instanceof Node&&ze.contains(Le.relatedTarget)||(this._setClasses(ze),this._emitOrigin(At.subject,null))}},{key:"_emitOrigin",value:function(Le,ze){this._ngZone.run(function(){return Le.next(ze)})}},{key:"_registerGlobalListeners",value:function(Le){var ze=this;if(this._platform.isBrowser){var At=Le.rootNode,an=this._rootNodeFocusListenerCount.get(At)||0;an||this._ngZone.runOutsideAngular(function(){At.addEventListener("focus",ze._rootNodeFocusAndBlurListener,Sn),At.addEventListener("blur",ze._rootNodeFocusAndBlurListener,Sn)}),this._rootNodeFocusListenerCount.set(At,an+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(function(){ze._getWindow().addEventListener("focus",ze._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe((0,z.R)(this._stopInputModalityDetector)).subscribe(function(jn){ze._setOrigin(jn,!0)}))}}},{key:"_removeGlobalListeners",value:function(Le){var ze=Le.rootNode;if(this._rootNodeFocusListenerCount.has(ze)){var At=this._rootNodeFocusListenerCount.get(ze);At>1?this._rootNodeFocusListenerCount.set(ze,At-1):(ze.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Sn),ze.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Sn),this._rootNodeFocusListenerCount.delete(ze))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}},{key:"_originChanged",value:function(Le,ze,At){this._setClasses(Le,ze),this._emitOrigin(At.subject,ze),this._lastFocusOrigin=ze}},{key:"_getClosestElementsInfo",value:function(Le){var ze=[];return this._elementInfo.forEach(function(At,an){(an===Le||At.checkChildren&&an.contains(Le))&&ze.push([an,At])}),ze}}]),Ie}();return he.\u0275fac=function(Ne){return new(Ne||he)(I.LFG(I.R0b),I.LFG(j.t4),I.LFG(nn),I.LFG(_.K0,8),I.LFG(Cn,8))},he.\u0275prov=I.Yz7({factory:function(){return new he(I.LFG(I.R0b),I.LFG(j.t4),I.LFG(nn),I.LFG(_.K0,8),I.LFG(Cn,8))},token:he,providedIn:"root"}),he}(),ur=function(){var he=function(){function Ie(Ne,Le){(0,N.Z)(this,Ie),this._elementRef=Ne,this._focusMonitor=Le,this.cdkFocusChange=new I.vpe}return(0,b.Z)(Ie,[{key:"ngAfterViewInit",value:function(){var Le=this,ze=this._elementRef.nativeElement;this._monitorSubscription=this._focusMonitor.monitor(ze,1===ze.nodeType&&ze.hasAttribute("cdkMonitorSubtreeFocus")).subscribe(function(At){return Le.cdkFocusChange.emit(At)})}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription&&this._monitorSubscription.unsubscribe()}}]),Ie}();return he.\u0275fac=function(Ne){return new(Ne||he)(I.Y36(I.SBq),I.Y36(tr))},he.\u0275dir=I.lG2({type:he,selectors:[["","cdkMonitorElementFocus",""],["","cdkMonitorSubtreeFocus",""]],outputs:{cdkFocusChange:"cdkFocusChange"}}),he}(),Ut="cdk-high-contrast-black-on-white",Rt="cdk-high-contrast-white-on-black",Lt="cdk-high-contrast-active",Oe=function(){var he=function(){function Ie(Ne,Le){(0,N.Z)(this,Ie),this._platform=Ne,this._document=Le}return(0,b.Z)(Ie,[{key:"getHighContrastMode",value:function(){if(!this._platform.isBrowser)return 0;var Le=this._document.createElement("div");Le.style.backgroundColor="rgb(1,2,3)",Le.style.position="absolute",this._document.body.appendChild(Le);var ze=this._document.defaultView||window,At=ze&&ze.getComputedStyle?ze.getComputedStyle(Le):null,an=(At&&At.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(Le),an){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}},{key:"_applyBodyHighContrastModeCssClasses",value:function(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){var Le=this._document.body.classList;Le.remove(Lt),Le.remove(Ut),Le.remove(Rt),this._hasCheckedHighContrastMode=!0;var ze=this.getHighContrastMode();1===ze?(Le.add(Lt),Le.add(Ut)):2===ze&&(Le.add(Lt),Le.add(Rt))}}}]),Ie}();return he.\u0275fac=function(Ne){return new(Ne||he)(I.LFG(j.t4),I.LFG(_.K0))},he.\u0275prov=I.Yz7({factory:function(){return new he(I.LFG(j.t4),I.LFG(_.K0))},token:he,providedIn:"root"}),he}(),rt=function(){var he=function Ie(Ne){(0,N.Z)(this,Ie),Ne._applyBodyHighContrastModeCssClasses()};return he.\u0275fac=function(Ne){return new(Ne||he)(I.LFG(Oe))},he.\u0275mod=I.oAB({type:he}),he.\u0275inj=I.cJS({imports:[[j.ud,J.Q8]]}),he}()},8392:function(ue,q,f){"use strict";f.d(q,{vT:function(){return I},Is:function(){return b}});var B=f(18967),U=f(14105),V=f(38999),Z=f(40098),w=new V.OlP("cdk-dir-doc",{providedIn:"root",factory:function(){return(0,V.f3M)(Z.K0)}}),b=function(){var D=function(){function A(S){if((0,B.Z)(this,A),this.value="ltr",this.change=new V.vpe,S){var T=(S.body?S.body.dir:null)||(S.documentElement?S.documentElement.dir:null);this.value="ltr"===T||"rtl"===T?T:"ltr"}}return(0,U.Z)(A,[{key:"ngOnDestroy",value:function(){this.change.complete()}}]),A}();return D.\u0275fac=function(S){return new(S||D)(V.LFG(w,8))},D.\u0275prov=V.Yz7({factory:function(){return new D(V.LFG(w,8))},token:D,providedIn:"root"}),D}(),I=function(){var D=function A(){(0,B.Z)(this,A)};return D.\u0275fac=function(S){return new(S||D)},D.\u0275mod=V.oAB({type:D}),D.\u0275inj=V.cJS({}),D}()},37429:function(ue,q,f){"use strict";f.d(q,{P3:function(){return S},o2:function(){return D},Ov:function(){return T},A8:function(){return k},yy:function(){return v},eX:function(){return g},k:function(){return E},Z9:function(){return A}});var B=f(36683),U=f(14105),V=f(10509),Z=f(97154),w=f(18967),N=f(17504),b=f(43161),_=f(68707),I=f(38999),D=function x(){(0,w.Z)(this,x)};function A(x){return x&&"function"==typeof x.connect}var S=function(x){(0,V.Z)(F,x);var O=(0,Z.Z)(F);function F(z){var K;return(0,w.Z)(this,F),(K=O.call(this))._data=z,K}return(0,U.Z)(F,[{key:"connect",value:function(){return(0,N.b)(this._data)?this._data:(0,b.of)(this._data)}},{key:"disconnect",value:function(){}}]),F}(D),v=function(){function x(){(0,w.Z)(this,x)}return(0,U.Z)(x,[{key:"applyChanges",value:function(F,z,K,j,J){F.forEachOperation(function(ee,$,ae){var se,ce;if(null==ee.previousIndex){var le=K(ee,$,ae);se=z.createEmbeddedView(le.templateRef,le.context,le.index),ce=1}else null==ae?(z.remove($),ce=3):(se=z.get($),z.move(se,ae),ce=2);J&&J({context:null==se?void 0:se.context,operation:ce,record:ee})})}},{key:"detach",value:function(){}}]),x}(),g=function(){function x(){(0,w.Z)(this,x),this.viewCacheSize=20,this._viewCache=[]}return(0,U.Z)(x,[{key:"applyChanges",value:function(F,z,K,j,J){var ee=this;F.forEachOperation(function($,ae,se){var ce,le;null==$.previousIndex?le=(ce=ee._insertView(function(){return K($,ae,se)},se,z,j($)))?1:0:null==se?(ee._detachAndCacheView(ae,z),le=3):(ce=ee._moveView(ae,se,z,j($)),le=2),J&&J({context:null==ce?void 0:ce.context,operation:le,record:$})})}},{key:"detach",value:function(){var z,F=(0,B.Z)(this._viewCache);try{for(F.s();!(z=F.n()).done;)z.value.destroy()}catch(j){F.e(j)}finally{F.f()}this._viewCache=[]}},{key:"_insertView",value:function(F,z,K,j){var J=this._insertViewFromCache(z,K);if(!J){var ee=F();return K.createEmbeddedView(ee.templateRef,ee.context,ee.index)}J.context.$implicit=j}},{key:"_detachAndCacheView",value:function(F,z){var K=z.detach(F);this._maybeCacheView(K,z)}},{key:"_moveView",value:function(F,z,K,j){var J=K.get(F);return K.move(J,z),J.context.$implicit=j,J}},{key:"_maybeCacheView",value:function(F,z){if(this._viewCache.length0&&void 0!==arguments[0]&&arguments[0],z=arguments.length>1?arguments[1]:void 0,K=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(0,w.Z)(this,x),this._multiple=F,this._emitChanges=K,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new _.xQ,z&&z.length&&(F?z.forEach(function(j){return O._markSelected(j)}):this._markSelected(z[0]),this._selectedToEmit.length=0)}return(0,U.Z)(x,[{key:"selected",get:function(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}},{key:"select",value:function(){for(var F=this,z=arguments.length,K=new Array(z),j=0;j1?Gn-1:0),Vn=1;VnTe.height||ye.scrollWidth>Te.width}}]),ut}(),ee=function(){function ut(He,ve,ye,Te){var we=this;(0,b.Z)(this,ut),this._scrollDispatcher=He,this._ngZone=ve,this._viewportRuler=ye,this._config=Te,this._scrollSubscription=null,this._detach=function(){we.disable(),we._overlayRef.hasAttached()&&we._ngZone.run(function(){return we._overlayRef.detach()})}}return(0,_.Z)(ut,[{key:"attach",value:function(ve){this._overlayRef=ve}},{key:"enable",value:function(){var ve=this;if(!this._scrollSubscription){var ye=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=ye.subscribe(function(){var Te=ve._viewportRuler.getViewportScrollPosition().top;Math.abs(Te-ve._initialScrollPosition)>ve._config.threshold?ve._detach():ve._overlayRef.updatePosition()})):this._scrollSubscription=ye.subscribe(this._detach)}}},{key:"disable",value:function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}},{key:"detach",value:function(){this.disable(),this._overlayRef=null}}]),ut}(),$=function(){function ut(){(0,b.Z)(this,ut)}return(0,_.Z)(ut,[{key:"enable",value:function(){}},{key:"disable",value:function(){}},{key:"attach",value:function(){}}]),ut}();function ae(ut,He){return He.some(function(ve){return ut.bottomve.bottom||ut.rightve.right})}function se(ut,He){return He.some(function(ve){return ut.topve.bottom||ut.leftve.right})}var ce=function(){function ut(He,ve,ye,Te){(0,b.Z)(this,ut),this._scrollDispatcher=He,this._viewportRuler=ve,this._ngZone=ye,this._config=Te,this._scrollSubscription=null}return(0,_.Z)(ut,[{key:"attach",value:function(ve){this._overlayRef=ve}},{key:"enable",value:function(){var ve=this;this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(function(){if(ve._overlayRef.updatePosition(),ve._config&&ve._config.autoClose){var Te=ve._overlayRef.overlayElement.getBoundingClientRect(),we=ve._viewportRuler.getViewportSize(),ct=we.width,ft=we.height;ae(Te,[{width:ct,height:ft,bottom:ft,right:ct,top:0,left:0}])&&(ve.disable(),ve._ngZone.run(function(){return ve._overlayRef.detach()}))}}))}},{key:"disable",value:function(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}},{key:"detach",value:function(){this.disable(),this._overlayRef=null}}]),ut}(),le=function(){var ut=function He(ve,ye,Te,we){var ct=this;(0,b.Z)(this,He),this._scrollDispatcher=ve,this._viewportRuler=ye,this._ngZone=Te,this.noop=function(){return new $},this.close=function(ft){return new ee(ct._scrollDispatcher,ct._ngZone,ct._viewportRuler,ft)},this.block=function(){return new j(ct._viewportRuler,ct._document)},this.reposition=function(ft){return new ce(ct._scrollDispatcher,ct._viewportRuler,ct._ngZone,ft)},this._document=we};return ut.\u0275fac=function(ve){return new(ve||ut)(D.LFG(I.mF),D.LFG(I.rL),D.LFG(D.R0b),D.LFG(v.K0))},ut.\u0275prov=D.Yz7({factory:function(){return new ut(D.LFG(I.mF),D.LFG(I.rL),D.LFG(D.R0b),D.LFG(v.K0))},token:ut,providedIn:"root"}),ut}(),oe=function ut(He){if((0,b.Z)(this,ut),this.scrollStrategy=new $,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,He)for(var ye=0,Te=Object.keys(He);ye-1&&this._attachedOverlays.splice(Te,1),0===this._attachedOverlays.length&&this.detach()}}]),He}();return ut.\u0275fac=function(ve){return new(ve||ut)(D.LFG(v.K0))},ut.\u0275prov=D.Yz7({factory:function(){return new ut(D.LFG(v.K0))},token:ut,providedIn:"root"}),ut}(),Ft=function(){var ut=function(He){(0,w.Z)(ye,He);var ve=(0,N.Z)(ye);function ye(Te){var we;return(0,b.Z)(this,ye),(we=ve.call(this,Te))._keydownListener=function(ct){for(var ft=we._attachedOverlays,Yt=ft.length-1;Yt>-1;Yt--)if(ft[Yt]._keydownEvents.observers.length>0){ft[Yt]._keydownEvents.next(ct);break}},we}return(0,_.Z)(ye,[{key:"add",value:function(we){(0,V.Z)((0,Z.Z)(ye.prototype),"add",this).call(this,we),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}},{key:"detach",value:function(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}]),ye}(yt);return ut.\u0275fac=function(ve){return new(ve||ut)(D.LFG(v.K0))},ut.\u0275prov=D.Yz7({factory:function(){return new ut(D.LFG(v.K0))},token:ut,providedIn:"root"}),ut}(),xe=function(){var ut=function(He){(0,w.Z)(ye,He);var ve=(0,N.Z)(ye);function ye(Te,we){var ct;return(0,b.Z)(this,ye),(ct=ve.call(this,Te))._platform=we,ct._cursorStyleIsSet=!1,ct._pointerDownListener=function(ft){ct._pointerDownEventTarget=(0,A.sA)(ft)},ct._clickListener=function(ft){var Yt=(0,A.sA)(ft),Kt="click"===ft.type&&ct._pointerDownEventTarget?ct._pointerDownEventTarget:Yt;ct._pointerDownEventTarget=null;for(var Jt=ct._attachedOverlays.slice(),nn=Jt.length-1;nn>-1;nn--){var ln=Jt[nn];if(!(ln._outsidePointerEvents.observers.length<1)&&ln.hasAttached()){if(ln.overlayElement.contains(Yt)||ln.overlayElement.contains(Kt))break;ln._outsidePointerEvents.next(ft)}}},ct}return(0,_.Z)(ye,[{key:"add",value:function(we){if((0,V.Z)((0,Z.Z)(ye.prototype),"add",this).call(this,we),!this._isAttached){var ct=this._document.body;ct.addEventListener("pointerdown",this._pointerDownListener,!0),ct.addEventListener("click",this._clickListener,!0),ct.addEventListener("auxclick",this._clickListener,!0),ct.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=ct.style.cursor,ct.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}},{key:"detach",value:function(){if(this._isAttached){var we=this._document.body;we.removeEventListener("pointerdown",this._pointerDownListener,!0),we.removeEventListener("click",this._clickListener,!0),we.removeEventListener("auxclick",this._clickListener,!0),we.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(we.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}]),ye}(yt);return ut.\u0275fac=function(ve){return new(ve||ut)(D.LFG(v.K0),D.LFG(A.t4))},ut.\u0275prov=D.Yz7({factory:function(){return new ut(D.LFG(v.K0),D.LFG(A.t4))},token:ut,providedIn:"root"}),ut}(),De=function(){var ut=function(){function He(ve,ye){(0,b.Z)(this,He),this._platform=ye,this._document=ve}return(0,_.Z)(He,[{key:"ngOnDestroy",value:function(){var ye=this._containerElement;ye&&ye.parentNode&&ye.parentNode.removeChild(ye)}},{key:"getContainerElement",value:function(){return this._containerElement||this._createContainer(),this._containerElement}},{key:"_createContainer",value:function(){var ye="cdk-overlay-container";if(this._platform.isBrowser||(0,A.Oy)())for(var Te=this._document.querySelectorAll(".".concat(ye,'[platform="server"], ')+".".concat(ye,'[platform="test"]')),we=0;weTn&&(Tn=Sn,yn=Cn)}}catch(tr){In.e(tr)}finally{In.f()}return this._isPushed=!1,void this._applyPosition(yn.position,yn.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(ct.position,ct.originPoint);this._applyPosition(ct.position,ct.originPoint)}}},{key:"detach",value:function(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}},{key:"dispose",value:function(){this._isDisposed||(this._boundingBox&&xt(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(dt),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}},{key:"reapplyLastPosition",value:function(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();var ve=this._lastPosition||this._preferredPositions[0],ye=this._getOriginPoint(this._originRect,ve);this._applyPosition(ve,ye)}}},{key:"withScrollableContainers",value:function(ve){return this._scrollables=ve,this}},{key:"withPositions",value:function(ve){return this._preferredPositions=ve,-1===ve.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}},{key:"withViewportMargin",value:function(ve){return this._viewportMargin=ve,this}},{key:"withFlexibleDimensions",value:function(){var ve=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._hasFlexibleDimensions=ve,this}},{key:"withGrowAfterOpen",value:function(){var ve=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._growAfterOpen=ve,this}},{key:"withPush",value:function(){var ve=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._canPush=ve,this}},{key:"withLockedPosition",value:function(){var ve=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._positionLocked=ve,this}},{key:"setOrigin",value:function(ve){return this._origin=ve,this}},{key:"withDefaultOffsetX",value:function(ve){return this._offsetX=ve,this}},{key:"withDefaultOffsetY",value:function(ve){return this._offsetY=ve,this}},{key:"withTransformOriginOn",value:function(ve){return this._transformOriginSelector=ve,this}},{key:"_getOriginPoint",value:function(ve,ye){var Te;if("center"==ye.originX)Te=ve.left+ve.width/2;else{var we=this._isRtl()?ve.right:ve.left,ct=this._isRtl()?ve.left:ve.right;Te="start"==ye.originX?we:ct}return{x:Te,y:"center"==ye.originY?ve.top+ve.height/2:"top"==ye.originY?ve.top:ve.bottom}}},{key:"_getOverlayPoint",value:function(ve,ye,Te){var we;return we="center"==Te.overlayX?-ye.width/2:"start"===Te.overlayX?this._isRtl()?-ye.width:0:this._isRtl()?0:-ye.width,{x:ve.x+we,y:ve.y+("center"==Te.overlayY?-ye.height/2:"top"==Te.overlayY?0:-ye.height)}}},{key:"_getOverlayFit",value:function(ve,ye,Te,we){var ct=Qt(ye),ft=ve.x,Yt=ve.y,Kt=this._getOffset(we,"x"),Jt=this._getOffset(we,"y");Kt&&(ft+=Kt),Jt&&(Yt+=Jt);var yn=0-Yt,Tn=Yt+ct.height-Te.height,In=this._subtractOverflows(ct.width,0-ft,ft+ct.width-Te.width),Yn=this._subtractOverflows(ct.height,yn,Tn),Cn=In*Yn;return{visibleArea:Cn,isCompletelyWithinViewport:ct.width*ct.height===Cn,fitsInViewportVertically:Yn===ct.height,fitsInViewportHorizontally:In==ct.width}}},{key:"_canFitWithFlexibleDimensions",value:function(ve,ye,Te){if(this._hasFlexibleDimensions){var we=Te.bottom-ye.y,ct=Te.right-ye.x,ft=vt(this._overlayRef.getConfig().minHeight),Yt=vt(this._overlayRef.getConfig().minWidth);return(ve.fitsInViewportVertically||null!=ft&&ft<=we)&&(ve.fitsInViewportHorizontally||null!=Yt&&Yt<=ct)}return!1}},{key:"_pushOverlayOnScreen",value:function(ve,ye,Te){if(this._previousPushAmount&&this._positionLocked)return{x:ve.x+this._previousPushAmount.x,y:ve.y+this._previousPushAmount.y};var nn,ln,we=Qt(ye),ct=this._viewportRect,ft=Math.max(ve.x+we.width-ct.width,0),Yt=Math.max(ve.y+we.height-ct.height,0),Kt=Math.max(ct.top-Te.top-ve.y,0),Jt=Math.max(ct.left-Te.left-ve.x,0);return this._previousPushAmount={x:nn=we.width<=ct.width?Jt||-ft:ve.xJt&&!this._isInitialRender&&!this._growAfterOpen&&(ft=ve.y-Jt/2)}if("end"===ye.overlayX&&!we||"start"===ye.overlayX&&we)In=Te.width-ve.x+this._viewportMargin,yn=ve.x-this._viewportMargin;else if("start"===ye.overlayX&&!we||"end"===ye.overlayX&&we)Tn=ve.x,yn=Te.right-ve.x;else{var Yn=Math.min(Te.right-ve.x+Te.left,ve.x),Cn=this._lastBoundingBoxSize.width;Tn=ve.x-Yn,(yn=2*Yn)>Cn&&!this._isInitialRender&&!this._growAfterOpen&&(Tn=ve.x-Cn/2)}return{top:ft,left:Tn,bottom:Yt,right:In,width:yn,height:ct}}},{key:"_setBoundingBoxStyles",value:function(ve,ye){var Te=this._calculateBoundingBoxRect(ve,ye);!this._isInitialRender&&!this._growAfterOpen&&(Te.height=Math.min(Te.height,this._lastBoundingBoxSize.height),Te.width=Math.min(Te.width,this._lastBoundingBoxSize.width));var we={};if(this._hasExactPosition())we.top=we.left="0",we.bottom=we.right=we.maxHeight=we.maxWidth="",we.width=we.height="100%";else{var ct=this._overlayRef.getConfig().maxHeight,ft=this._overlayRef.getConfig().maxWidth;we.height=(0,g.HM)(Te.height),we.top=(0,g.HM)(Te.top),we.bottom=(0,g.HM)(Te.bottom),we.width=(0,g.HM)(Te.width),we.left=(0,g.HM)(Te.left),we.right=(0,g.HM)(Te.right),we.alignItems="center"===ye.overlayX?"center":"end"===ye.overlayX?"flex-end":"flex-start",we.justifyContent="center"===ye.overlayY?"center":"bottom"===ye.overlayY?"flex-end":"flex-start",ct&&(we.maxHeight=(0,g.HM)(ct)),ft&&(we.maxWidth=(0,g.HM)(ft))}this._lastBoundingBoxSize=Te,xt(this._boundingBox.style,we)}},{key:"_resetBoundingBoxStyles",value:function(){xt(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}},{key:"_resetOverlayElementStyles",value:function(){xt(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}},{key:"_setOverlayElementStyles",value:function(ve,ye){var Te={},we=this._hasExactPosition(),ct=this._hasFlexibleDimensions,ft=this._overlayRef.getConfig();if(we){var Yt=this._viewportRuler.getViewportScrollPosition();xt(Te,this._getExactOverlayY(ye,ve,Yt)),xt(Te,this._getExactOverlayX(ye,ve,Yt))}else Te.position="static";var Kt="",Jt=this._getOffset(ye,"x"),nn=this._getOffset(ye,"y");Jt&&(Kt+="translateX(".concat(Jt,"px) ")),nn&&(Kt+="translateY(".concat(nn,"px)")),Te.transform=Kt.trim(),ft.maxHeight&&(we?Te.maxHeight=(0,g.HM)(ft.maxHeight):ct&&(Te.maxHeight="")),ft.maxWidth&&(we?Te.maxWidth=(0,g.HM)(ft.maxWidth):ct&&(Te.maxWidth="")),xt(this._pane.style,Te)}},{key:"_getExactOverlayY",value:function(ve,ye,Te){var we={top:"",bottom:""},ct=this._getOverlayPoint(ye,this._overlayRect,ve);this._isPushed&&(ct=this._pushOverlayOnScreen(ct,this._overlayRect,Te));var ft=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return ct.y-=ft,"bottom"===ve.overlayY?we.bottom="".concat(this._document.documentElement.clientHeight-(ct.y+this._overlayRect.height),"px"):we.top=(0,g.HM)(ct.y),we}},{key:"_getExactOverlayX",value:function(ve,ye,Te){var we={left:"",right:""},ct=this._getOverlayPoint(ye,this._overlayRect,ve);return this._isPushed&&(ct=this._pushOverlayOnScreen(ct,this._overlayRect,Te)),"right"==(this._isRtl()?"end"===ve.overlayX?"left":"right":"end"===ve.overlayX?"right":"left")?we.right="".concat(this._document.documentElement.clientWidth-(ct.x+this._overlayRect.width),"px"):we.left=(0,g.HM)(ct.x),we}},{key:"_getScrollVisibility",value:function(){var ve=this._getOriginRect(),ye=this._pane.getBoundingClientRect(),Te=this._scrollables.map(function(we){return we.getElementRef().nativeElement.getBoundingClientRect()});return{isOriginClipped:se(ve,Te),isOriginOutsideView:ae(ve,Te),isOverlayClipped:se(ye,Te),isOverlayOutsideView:ae(ye,Te)}}},{key:"_subtractOverflows",value:function(ve){for(var ye=arguments.length,Te=new Array(ye>1?ye-1:0),we=1;we0&&void 0!==arguments[0]?arguments[0]:"";return this._bottomOffset="",this._topOffset=ve,this._alignItems="flex-start",this}},{key:"left",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._rightOffset="",this._leftOffset=ve,this._justifyContent="flex-start",this}},{key:"bottom",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._topOffset="",this._bottomOffset=ve,this._alignItems="flex-end",this}},{key:"right",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._leftOffset="",this._rightOffset=ve,this._justifyContent="flex-end",this}},{key:"width",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._overlayRef?this._overlayRef.updateSize({width:ve}):this._width=ve,this}},{key:"height",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this._overlayRef?this._overlayRef.updateSize({height:ve}):this._height=ve,this}},{key:"centerHorizontally",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.left(ve),this._justifyContent="center",this}},{key:"centerVertically",value:function(){var ve=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.top(ve),this._alignItems="center",this}},{key:"apply",value:function(){if(this._overlayRef&&this._overlayRef.hasAttached()){var ve=this._overlayRef.overlayElement.style,ye=this._overlayRef.hostElement.style,Te=this._overlayRef.getConfig(),we=Te.width,ct=Te.height,ft=Te.maxWidth,Yt=Te.maxHeight,Kt=!("100%"!==we&&"100vw"!==we||ft&&"100%"!==ft&&"100vw"!==ft),Jt=!("100%"!==ct&&"100vh"!==ct||Yt&&"100%"!==Yt&&"100vh"!==Yt);ve.position=this._cssPosition,ve.marginLeft=Kt?"0":this._leftOffset,ve.marginTop=Jt?"0":this._topOffset,ve.marginBottom=this._bottomOffset,ve.marginRight=this._rightOffset,Kt?ye.justifyContent="flex-start":"center"===this._justifyContent?ye.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?ye.justifyContent="flex-end":"flex-end"===this._justifyContent&&(ye.justifyContent="flex-start"):ye.justifyContent=this._justifyContent,ye.alignItems=Jt?"flex-start":this._alignItems}}},{key:"dispose",value:function(){if(!this._isDisposed&&this._overlayRef){var ve=this._overlayRef.overlayElement.style,ye=this._overlayRef.hostElement,Te=ye.style;ye.classList.remove(Ct),Te.justifyContent=Te.alignItems=ve.marginTop=ve.marginBottom=ve.marginLeft=ve.marginRight=ve.position="",this._overlayRef=null,this._isDisposed=!0}}}]),ut}(),bt=function(){var ut=function(){function He(ve,ye,Te,we){(0,b.Z)(this,He),this._viewportRuler=ve,this._document=ye,this._platform=Te,this._overlayContainer=we}return(0,_.Z)(He,[{key:"global",value:function(){return new qt}},{key:"connectedTo",value:function(ye,Te,we){return new Ht(Te,we,ye,this._viewportRuler,this._document,this._platform,this._overlayContainer)}},{key:"flexibleConnectedTo",value:function(ye){return new Bt(ye,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}]),He}();return ut.\u0275fac=function(ve){return new(ve||ut)(D.LFG(I.rL),D.LFG(v.K0),D.LFG(A.t4),D.LFG(De))},ut.\u0275prov=D.Yz7({factory:function(){return new ut(D.LFG(I.rL),D.LFG(v.K0),D.LFG(A.t4),D.LFG(De))},token:ut,providedIn:"root"}),ut}(),en=0,Nt=function(){var ut=function(){function He(ve,ye,Te,we,ct,ft,Yt,Kt,Jt,nn,ln){(0,b.Z)(this,He),this.scrollStrategies=ve,this._overlayContainer=ye,this._componentFactoryResolver=Te,this._positionBuilder=we,this._keyboardDispatcher=ct,this._injector=ft,this._ngZone=Yt,this._document=Kt,this._directionality=Jt,this._location=nn,this._outsideClickDispatcher=ln}return(0,_.Z)(He,[{key:"create",value:function(ye){var Te=this._createHostElement(),we=this._createPaneElement(Te),ct=this._createPortalOutlet(we),ft=new oe(ye);return ft.direction=ft.direction||this._directionality.value,new je(ct,Te,we,ft,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}},{key:"position",value:function(){return this._positionBuilder}},{key:"_createPaneElement",value:function(ye){var Te=this._document.createElement("div");return Te.id="cdk-overlay-".concat(en++),Te.classList.add("cdk-overlay-pane"),ye.appendChild(Te),Te}},{key:"_createHostElement",value:function(){var ye=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(ye),ye}},{key:"_createPortalOutlet",value:function(ye){return this._appRef||(this._appRef=this._injector.get(D.z2F)),new T.u0(ye,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}]),He}();return ut.\u0275fac=function(ve){return new(ve||ut)(D.LFG(le),D.LFG(De),D.LFG(D._Vd),D.LFG(bt),D.LFG(Ft),D.LFG(D.zs3),D.LFG(D.R0b),D.LFG(v.K0),D.LFG(S.Is),D.LFG(v.Ye),D.LFG(xe))},ut.\u0275prov=D.Yz7({token:ut,factory:ut.\u0275fac}),ut}(),rn=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],kn=new D.OlP("cdk-connected-overlay-scroll-strategy"),Ln=function(){var ut=function He(ve){(0,b.Z)(this,He),this.elementRef=ve};return ut.\u0275fac=function(ve){return new(ve||ut)(D.Y36(D.SBq))},ut.\u0275dir=D.lG2({type:ut,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),ut}(),Rn=function(){var ut=function(){function He(ve,ye,Te,we,ct){(0,b.Z)(this,He),this._overlay=ve,this._dir=ct,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=k.w.EMPTY,this._attachSubscription=k.w.EMPTY,this._detachSubscription=k.w.EMPTY,this._positionSubscription=k.w.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new D.vpe,this.positionChange=new D.vpe,this.attach=new D.vpe,this.detach=new D.vpe,this.overlayKeydown=new D.vpe,this.overlayOutsideClick=new D.vpe,this._templatePortal=new T.UE(ye,Te),this._scrollStrategyFactory=we,this.scrollStrategy=this._scrollStrategyFactory()}return(0,_.Z)(He,[{key:"offsetX",get:function(){return this._offsetX},set:function(ye){this._offsetX=ye,this._position&&this._updatePositionStrategy(this._position)}},{key:"offsetY",get:function(){return this._offsetY},set:function(ye){this._offsetY=ye,this._position&&this._updatePositionStrategy(this._position)}},{key:"hasBackdrop",get:function(){return this._hasBackdrop},set:function(ye){this._hasBackdrop=(0,g.Ig)(ye)}},{key:"lockPosition",get:function(){return this._lockPosition},set:function(ye){this._lockPosition=(0,g.Ig)(ye)}},{key:"flexibleDimensions",get:function(){return this._flexibleDimensions},set:function(ye){this._flexibleDimensions=(0,g.Ig)(ye)}},{key:"growAfterOpen",get:function(){return this._growAfterOpen},set:function(ye){this._growAfterOpen=(0,g.Ig)(ye)}},{key:"push",get:function(){return this._push},set:function(ye){this._push=(0,g.Ig)(ye)}},{key:"overlayRef",get:function(){return this._overlayRef}},{key:"dir",get:function(){return this._dir?this._dir.value:"ltr"}},{key:"ngOnDestroy",value:function(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}},{key:"ngOnChanges",value:function(ye){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),ye.origin&&this.open&&this._position.apply()),ye.open&&(this.open?this._attachOverlay():this._detachOverlay())}},{key:"_createOverlay",value:function(){var ye=this;(!this.positions||!this.positions.length)&&(this.positions=rn);var Te=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=Te.attachments().subscribe(function(){return ye.attach.emit()}),this._detachSubscription=Te.detachments().subscribe(function(){return ye.detach.emit()}),Te.keydownEvents().subscribe(function(we){ye.overlayKeydown.next(we),we.keyCode===z.hY&&!ye.disableClose&&!(0,z.Vb)(we)&&(we.preventDefault(),ye._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(function(we){ye.overlayOutsideClick.next(we)})}},{key:"_buildConfig",value:function(){var ye=this._position=this.positionStrategy||this._createPositionStrategy(),Te=new oe({direction:this._dir,positionStrategy:ye,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(Te.width=this.width),(this.height||0===this.height)&&(Te.height=this.height),(this.minWidth||0===this.minWidth)&&(Te.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(Te.minHeight=this.minHeight),this.backdropClass&&(Te.backdropClass=this.backdropClass),this.panelClass&&(Te.panelClass=this.panelClass),Te}},{key:"_updatePositionStrategy",value:function(ye){var Te=this,we=this.positions.map(function(ct){return{originX:ct.originX,originY:ct.originY,overlayX:ct.overlayX,overlayY:ct.overlayY,offsetX:ct.offsetX||Te.offsetX,offsetY:ct.offsetY||Te.offsetY,panelClass:ct.panelClass||void 0}});return ye.setOrigin(this.origin.elementRef).withPositions(we).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}},{key:"_createPositionStrategy",value:function(){var ye=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(ye),ye}},{key:"_attachOverlay",value:function(){var ye=this;this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(function(Te){ye.backdropClick.emit(Te)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe((0,F.o)(function(){return ye.positionChange.observers.length>0})).subscribe(function(Te){ye.positionChange.emit(Te),0===ye.positionChange.observers.length&&ye._positionSubscription.unsubscribe()}))}},{key:"_detachOverlay",value:function(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}]),He}();return ut.\u0275fac=function(ve){return new(ve||ut)(D.Y36(Nt),D.Y36(D.Rgc),D.Y36(D.s_b),D.Y36(kn),D.Y36(S.Is,8))},ut.\u0275dir=D.lG2({type:ut,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[D.TTD]}),ut}(),Nn={provide:kn,deps:[Nt],useFactory:function(ut){return function(){return ut.scrollStrategies.reposition()}}},wn=function(){var ut=function He(){(0,b.Z)(this,He)};return ut.\u0275fac=function(ve){return new(ve||ut)},ut.\u0275mod=D.oAB({type:ut}),ut.\u0275inj=D.cJS({providers:[Nt,Nn],imports:[[S.vT,T.eL,I.Cl],I.Cl]}),ut}()},15427:function(ue,q,f){"use strict";f.d(q,{t4:function(){return w},ud:function(){return N},sA:function(){return F},ht:function(){return O},kV:function(){return x},Oy:function(){return K},_i:function(){return R},qK:function(){return I},i$:function(){return S},Mq:function(){return T}});var Z,B=f(18967),U=f(38999),V=f(40098);try{Z="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(j){Z=!1}var b,D,v,g,k,z,w=function(){var j=function J(ee){(0,B.Z)(this,J),this._platformId=ee,this.isBrowser=this._platformId?(0,V.NF)(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!Z)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT};return j.\u0275fac=function(ee){return new(ee||j)(U.LFG(U.Lbi))},j.\u0275prov=U.Yz7({factory:function(){return new j(U.LFG(U.Lbi))},token:j,providedIn:"root"}),j}(),N=function(){var j=function J(){(0,B.Z)(this,J)};return j.\u0275fac=function(ee){return new(ee||j)},j.\u0275mod=U.oAB({type:j}),j.\u0275inj=U.cJS({}),j}(),_=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function I(){if(b)return b;if("object"!=typeof document||!document)return b=new Set(_);var j=document.createElement("input");return b=new Set(_.filter(function(J){return j.setAttribute("type",J),j.type===J}))}function S(j){return function(){if(null==D&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return D=!0}}))}finally{D=D||!1}return D}()?j:!!j.capture}function T(){if(null==g){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return g=!1;if("scrollBehavior"in document.documentElement.style)g=!0;else{var j=Element.prototype.scrollTo;g=!!j&&!/\{\s*\[native code\]\s*\}/.test(j.toString())}}return g}function R(){if("object"!=typeof document||!document)return 0;if(null==v){var j=document.createElement("div"),J=j.style;j.dir="rtl",J.width="1px",J.overflow="auto",J.visibility="hidden",J.pointerEvents="none",J.position="absolute";var ee=document.createElement("div"),$=ee.style;$.width="2px",$.height="1px",j.appendChild(ee),document.body.appendChild(j),v=0,0===j.scrollLeft&&(j.scrollLeft=1,v=0===j.scrollLeft?1:2),j.parentNode.removeChild(j)}return v}function x(j){if(function(){if(null==k){var j="undefined"!=typeof document?document.head:null;k=!(!j||!j.createShadowRoot&&!j.attachShadow)}return k}()){var J=j.getRootNode?j.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&J instanceof ShadowRoot)return J}return null}function O(){for(var j="undefined"!=typeof document&&document?document.activeElement:null;j&&j.shadowRoot;){var J=j.shadowRoot.activeElement;if(J===j)break;j=J}return j}function F(j){return j.composedPath?j.composedPath()[0]:j.target}function K(){return void 0!==z.__karma__&&!!z.__karma__||void 0!==z.jasmine&&!!z.jasmine||void 0!==z.jest&&!!z.jest||void 0!==z.Mocha&&!!z.Mocha}z="undefined"!=typeof global?global:"undefined"!=typeof window?window:{}},80785:function(ue,q,f){"use strict";f.d(q,{en:function(){return O},ig:function(){return j},Pl:function(){return ee},C5:function(){return k},u0:function(){return z},eL:function(){return ae},UE:function(){return E}});var B=f(88009),U=f(13920),V=f(89200),Z=f(10509),w=f(97154),N=f(18967),b=f(14105),_=f(38999),I=f(40098),R=function(){function ce(){(0,N.Z)(this,ce)}return(0,b.Z)(ce,[{key:"attach",value:function(oe){return this._attachedHost=oe,oe.attach(this)}},{key:"detach",value:function(){var oe=this._attachedHost;null!=oe&&(this._attachedHost=null,oe.detach())}},{key:"isAttached",get:function(){return null!=this._attachedHost}},{key:"setAttachedHost",value:function(oe){this._attachedHost=oe}}]),ce}(),k=function(ce){(0,Z.Z)(oe,ce);var le=(0,w.Z)(oe);function oe(Ae,be,it,qe){var _t;return(0,N.Z)(this,oe),(_t=le.call(this)).component=Ae,_t.viewContainerRef=be,_t.injector=it,_t.componentFactoryResolver=qe,_t}return oe}(R),E=function(ce){(0,Z.Z)(oe,ce);var le=(0,w.Z)(oe);function oe(Ae,be,it){var qe;return(0,N.Z)(this,oe),(qe=le.call(this)).templateRef=Ae,qe.viewContainerRef=be,qe.context=it,qe}return(0,b.Z)(oe,[{key:"origin",get:function(){return this.templateRef.elementRef}},{key:"attach",value:function(be){var it=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.context;return this.context=it,(0,U.Z)((0,V.Z)(oe.prototype),"attach",this).call(this,be)}},{key:"detach",value:function(){return this.context=void 0,(0,U.Z)((0,V.Z)(oe.prototype),"detach",this).call(this)}}]),oe}(R),x=function(ce){(0,Z.Z)(oe,ce);var le=(0,w.Z)(oe);function oe(Ae){var be;return(0,N.Z)(this,oe),(be=le.call(this)).element=Ae instanceof _.SBq?Ae.nativeElement:Ae,be}return oe}(R),O=function(){function ce(){(0,N.Z)(this,ce),this._isDisposed=!1,this.attachDomPortal=null}return(0,b.Z)(ce,[{key:"hasAttached",value:function(){return!!this._attachedPortal}},{key:"attach",value:function(oe){return oe instanceof k?(this._attachedPortal=oe,this.attachComponentPortal(oe)):oe instanceof E?(this._attachedPortal=oe,this.attachTemplatePortal(oe)):this.attachDomPortal&&oe instanceof x?(this._attachedPortal=oe,this.attachDomPortal(oe)):void 0}},{key:"detach",value:function(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}},{key:"dispose",value:function(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}},{key:"setDisposeFn",value:function(oe){this._disposeFn=oe}},{key:"_invokeDisposeFn",value:function(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}]),ce}(),z=function(ce){(0,Z.Z)(oe,ce);var le=(0,w.Z)(oe);function oe(Ae,be,it,qe,_t){var yt,Ft;return(0,N.Z)(this,oe),(Ft=le.call(this)).outletElement=Ae,Ft._componentFactoryResolver=be,Ft._appRef=it,Ft._defaultInjector=qe,Ft.attachDomPortal=function(xe){var De=xe.element,je=Ft._document.createComment("dom-portal");De.parentNode.insertBefore(je,De),Ft.outletElement.appendChild(De),Ft._attachedPortal=xe,(0,U.Z)((yt=(0,B.Z)(Ft),(0,V.Z)(oe.prototype)),"setDisposeFn",yt).call(yt,function(){je.parentNode&&je.parentNode.replaceChild(De,je)})},Ft._document=_t,Ft}return(0,b.Z)(oe,[{key:"attachComponentPortal",value:function(be){var yt,it=this,_t=(be.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(be.component);return be.viewContainerRef?(yt=be.viewContainerRef.createComponent(_t,be.viewContainerRef.length,be.injector||be.viewContainerRef.injector),this.setDisposeFn(function(){return yt.destroy()})):(yt=_t.create(be.injector||this._defaultInjector),this._appRef.attachView(yt.hostView),this.setDisposeFn(function(){it._appRef.detachView(yt.hostView),yt.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(yt)),this._attachedPortal=be,yt}},{key:"attachTemplatePortal",value:function(be){var it=this,qe=be.viewContainerRef,_t=qe.createEmbeddedView(be.templateRef,be.context);return _t.rootNodes.forEach(function(yt){return it.outletElement.appendChild(yt)}),_t.detectChanges(),this.setDisposeFn(function(){var yt=qe.indexOf(_t);-1!==yt&&qe.remove(yt)}),this._attachedPortal=be,_t}},{key:"dispose",value:function(){(0,U.Z)((0,V.Z)(oe.prototype),"dispose",this).call(this),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}},{key:"_getComponentRootNode",value:function(be){return be.hostView.rootNodes[0]}}]),oe}(O),j=function(){var ce=function(le){(0,Z.Z)(Ae,le);var oe=(0,w.Z)(Ae);function Ae(be,it){return(0,N.Z)(this,Ae),oe.call(this,be,it)}return Ae}(E);return ce.\u0275fac=function(oe){return new(oe||ce)(_.Y36(_.Rgc),_.Y36(_.s_b))},ce.\u0275dir=_.lG2({type:ce,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[_.qOj]}),ce}(),ee=function(){var ce=function(le){(0,Z.Z)(Ae,le);var oe=(0,w.Z)(Ae);function Ae(be,it,qe){var _t,yt;return(0,N.Z)(this,Ae),(yt=oe.call(this))._componentFactoryResolver=be,yt._viewContainerRef=it,yt._isInitialized=!1,yt.attached=new _.vpe,yt.attachDomPortal=function(Ft){var xe=Ft.element,De=yt._document.createComment("dom-portal");Ft.setAttachedHost((0,B.Z)(yt)),xe.parentNode.insertBefore(De,xe),yt._getRootNode().appendChild(xe),yt._attachedPortal=Ft,(0,U.Z)((_t=(0,B.Z)(yt),(0,V.Z)(Ae.prototype)),"setDisposeFn",_t).call(_t,function(){De.parentNode&&De.parentNode.replaceChild(xe,De)})},yt._document=qe,yt}return(0,b.Z)(Ae,[{key:"portal",get:function(){return this._attachedPortal},set:function(it){this.hasAttached()&&!it&&!this._isInitialized||(this.hasAttached()&&(0,U.Z)((0,V.Z)(Ae.prototype),"detach",this).call(this),it&&(0,U.Z)((0,V.Z)(Ae.prototype),"attach",this).call(this,it),this._attachedPortal=it)}},{key:"attachedRef",get:function(){return this._attachedRef}},{key:"ngOnInit",value:function(){this._isInitialized=!0}},{key:"ngOnDestroy",value:function(){(0,U.Z)((0,V.Z)(Ae.prototype),"dispose",this).call(this),this._attachedPortal=null,this._attachedRef=null}},{key:"attachComponentPortal",value:function(it){it.setAttachedHost(this);var qe=null!=it.viewContainerRef?it.viewContainerRef:this._viewContainerRef,yt=(it.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(it.component),Ft=qe.createComponent(yt,qe.length,it.injector||qe.injector);return qe!==this._viewContainerRef&&this._getRootNode().appendChild(Ft.hostView.rootNodes[0]),(0,U.Z)((0,V.Z)(Ae.prototype),"setDisposeFn",this).call(this,function(){return Ft.destroy()}),this._attachedPortal=it,this._attachedRef=Ft,this.attached.emit(Ft),Ft}},{key:"attachTemplatePortal",value:function(it){var qe=this;it.setAttachedHost(this);var _t=this._viewContainerRef.createEmbeddedView(it.templateRef,it.context);return(0,U.Z)((0,V.Z)(Ae.prototype),"setDisposeFn",this).call(this,function(){return qe._viewContainerRef.clear()}),this._attachedPortal=it,this._attachedRef=_t,this.attached.emit(_t),_t}},{key:"_getRootNode",value:function(){var it=this._viewContainerRef.element.nativeElement;return it.nodeType===it.ELEMENT_NODE?it:it.parentNode}}]),Ae}(O);return ce.\u0275fac=function(oe){return new(oe||ce)(_.Y36(_._Vd),_.Y36(_.s_b),_.Y36(I.K0))},ce.\u0275dir=_.lG2({type:ce,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[_.qOj]}),ce}(),ae=function(){var ce=function le(){(0,N.Z)(this,le)};return ce.\u0275fac=function(oe){return new(oe||ce)},ce.\u0275mod=_.oAB({type:ce}),ce.\u0275inj=_.cJS({}),ce}()},28722:function(ue,q,f){"use strict";f.d(q,{PQ:function(){return Ft},ZD:function(){return vt},mF:function(){return yt},Cl:function(){return Qt},rL:function(){return De}}),f(71955),f(36683),f(13920),f(89200),f(10509),f(97154);var b=f(18967),_=f(14105),I=f(78081),D=f(38999),A=f(68707),S=f(43161),v=f(89797),g=f(33090),O=(f(58172),f(8285),f(5051),f(17504),f(76161),f(54562)),F=f(58780),z=f(44213),$=(f(57682),f(4363),f(34487),f(61106),f(15427)),ae=f(40098),se=f(8392);f(37429);var yt=function(){var Ht=function(){function Ct(qt,bt,en){(0,b.Z)(this,Ct),this._ngZone=qt,this._platform=bt,this._scrolled=new A.xQ,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=en}return(0,_.Z)(Ct,[{key:"register",value:function(bt){var en=this;this.scrollContainers.has(bt)||this.scrollContainers.set(bt,bt.elementScrolled().subscribe(function(){return en._scrolled.next(bt)}))}},{key:"deregister",value:function(bt){var en=this.scrollContainers.get(bt);en&&(en.unsubscribe(),this.scrollContainers.delete(bt))}},{key:"scrolled",value:function(){var bt=this,en=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this._platform.isBrowser?new v.y(function(Nt){bt._globalSubscription||bt._addGlobalListener();var rn=en>0?bt._scrolled.pipe((0,O.e)(en)).subscribe(Nt):bt._scrolled.subscribe(Nt);return bt._scrolledCount++,function(){rn.unsubscribe(),bt._scrolledCount--,bt._scrolledCount||bt._removeGlobalListener()}}):(0,S.of)()}},{key:"ngOnDestroy",value:function(){var bt=this;this._removeGlobalListener(),this.scrollContainers.forEach(function(en,Nt){return bt.deregister(Nt)}),this._scrolled.complete()}},{key:"ancestorScrolled",value:function(bt,en){var Nt=this.getAncestorScrollContainers(bt);return this.scrolled(en).pipe((0,F.h)(function(rn){return!rn||Nt.indexOf(rn)>-1}))}},{key:"getAncestorScrollContainers",value:function(bt){var en=this,Nt=[];return this.scrollContainers.forEach(function(rn,kn){en._scrollableContainsElement(kn,bt)&&Nt.push(kn)}),Nt}},{key:"_getWindow",value:function(){return this._document.defaultView||window}},{key:"_scrollableContainsElement",value:function(bt,en){var Nt=(0,I.fI)(en),rn=bt.getElementRef().nativeElement;do{if(Nt==rn)return!0}while(Nt=Nt.parentElement);return!1}},{key:"_addGlobalListener",value:function(){var bt=this;this._globalSubscription=this._ngZone.runOutsideAngular(function(){var en=bt._getWindow();return(0,g.R)(en.document,"scroll").subscribe(function(){return bt._scrolled.next()})})}},{key:"_removeGlobalListener",value:function(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}]),Ct}();return Ht.\u0275fac=function(qt){return new(qt||Ht)(D.LFG(D.R0b),D.LFG($.t4),D.LFG(ae.K0,8))},Ht.\u0275prov=D.Yz7({factory:function(){return new Ht(D.LFG(D.R0b),D.LFG($.t4),D.LFG(ae.K0,8))},token:Ht,providedIn:"root"}),Ht}(),Ft=function(){var Ht=function(){function Ct(qt,bt,en,Nt){var rn=this;(0,b.Z)(this,Ct),this.elementRef=qt,this.scrollDispatcher=bt,this.ngZone=en,this.dir=Nt,this._destroyed=new A.xQ,this._elementScrolled=new v.y(function(kn){return rn.ngZone.runOutsideAngular(function(){return(0,g.R)(rn.elementRef.nativeElement,"scroll").pipe((0,z.R)(rn._destroyed)).subscribe(kn)})})}return(0,_.Z)(Ct,[{key:"ngOnInit",value:function(){this.scrollDispatcher.register(this)}},{key:"ngOnDestroy",value:function(){this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}},{key:"elementScrolled",value:function(){return this._elementScrolled}},{key:"getElementRef",value:function(){return this.elementRef}},{key:"scrollTo",value:function(bt){var en=this.elementRef.nativeElement,Nt=this.dir&&"rtl"==this.dir.value;null==bt.left&&(bt.left=Nt?bt.end:bt.start),null==bt.right&&(bt.right=Nt?bt.start:bt.end),null!=bt.bottom&&(bt.top=en.scrollHeight-en.clientHeight-bt.bottom),Nt&&0!=(0,$._i)()?(null!=bt.left&&(bt.right=en.scrollWidth-en.clientWidth-bt.left),2==(0,$._i)()?bt.left=bt.right:1==(0,$._i)()&&(bt.left=bt.right?-bt.right:bt.right)):null!=bt.right&&(bt.left=en.scrollWidth-en.clientWidth-bt.right),this._applyScrollToOptions(bt)}},{key:"_applyScrollToOptions",value:function(bt){var en=this.elementRef.nativeElement;(0,$.Mq)()?en.scrollTo(bt):(null!=bt.top&&(en.scrollTop=bt.top),null!=bt.left&&(en.scrollLeft=bt.left))}},{key:"measureScrollOffset",value:function(bt){var en="left",rn=this.elementRef.nativeElement;if("top"==bt)return rn.scrollTop;if("bottom"==bt)return rn.scrollHeight-rn.clientHeight-rn.scrollTop;var kn=this.dir&&"rtl"==this.dir.value;return"start"==bt?bt=kn?"right":en:"end"==bt&&(bt=kn?en:"right"),kn&&2==(0,$._i)()?bt==en?rn.scrollWidth-rn.clientWidth-rn.scrollLeft:rn.scrollLeft:kn&&1==(0,$._i)()?bt==en?rn.scrollLeft+rn.scrollWidth-rn.clientWidth:-rn.scrollLeft:bt==en?rn.scrollLeft:rn.scrollWidth-rn.clientWidth-rn.scrollLeft}}]),Ct}();return Ht.\u0275fac=function(qt){return new(qt||Ht)(D.Y36(D.SBq),D.Y36(yt),D.Y36(D.R0b),D.Y36(se.Is,8))},Ht.\u0275dir=D.lG2({type:Ht,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]}),Ht}(),De=function(){var Ht=function(){function Ct(qt,bt,en){var Nt=this;(0,b.Z)(this,Ct),this._platform=qt,this._change=new A.xQ,this._changeListener=function(rn){Nt._change.next(rn)},this._document=en,bt.runOutsideAngular(function(){if(qt.isBrowser){var rn=Nt._getWindow();rn.addEventListener("resize",Nt._changeListener),rn.addEventListener("orientationchange",Nt._changeListener)}Nt.change().subscribe(function(){return Nt._viewportSize=null})})}return(0,_.Z)(Ct,[{key:"ngOnDestroy",value:function(){if(this._platform.isBrowser){var bt=this._getWindow();bt.removeEventListener("resize",this._changeListener),bt.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}},{key:"getViewportSize",value:function(){this._viewportSize||this._updateViewportSize();var bt={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),bt}},{key:"getViewportRect",value:function(){var bt=this.getViewportScrollPosition(),en=this.getViewportSize(),Nt=en.width,rn=en.height;return{top:bt.top,left:bt.left,bottom:bt.top+rn,right:bt.left+Nt,height:rn,width:Nt}}},{key:"getViewportScrollPosition",value:function(){if(!this._platform.isBrowser)return{top:0,left:0};var bt=this._document,en=this._getWindow(),Nt=bt.documentElement,rn=Nt.getBoundingClientRect();return{top:-rn.top||bt.body.scrollTop||en.scrollY||Nt.scrollTop||0,left:-rn.left||bt.body.scrollLeft||en.scrollX||Nt.scrollLeft||0}}},{key:"change",value:function(){var bt=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return bt>0?this._change.pipe((0,O.e)(bt)):this._change}},{key:"_getWindow",value:function(){return this._document.defaultView||window}},{key:"_updateViewportSize",value:function(){var bt=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:bt.innerWidth,height:bt.innerHeight}:{width:0,height:0}}}]),Ct}();return Ht.\u0275fac=function(qt){return new(qt||Ht)(D.LFG($.t4),D.LFG(D.R0b),D.LFG(ae.K0,8))},Ht.\u0275prov=D.Yz7({factory:function(){return new Ht(D.LFG($.t4),D.LFG(D.R0b),D.LFG(ae.K0,8))},token:Ht,providedIn:"root"}),Ht}(),vt=function(){var Ht=function Ct(){(0,b.Z)(this,Ct)};return Ht.\u0275fac=function(qt){return new(qt||Ht)},Ht.\u0275mod=D.oAB({type:Ht}),Ht.\u0275inj=D.cJS({}),Ht}(),Qt=function(){var Ht=function Ct(){(0,b.Z)(this,Ct)};return Ht.\u0275fac=function(qt){return new(qt||Ht)},Ht.\u0275mod=D.oAB({type:Ht}),Ht.\u0275inj=D.cJS({imports:[[se.vT,$.ud,vt],se.vT,vt]}),Ht}()},78081:function(ue,q,f){"use strict";f.d(q,{t6:function(){return Z},Eq:function(){return w},Ig:function(){return U},HM:function(){return N},fI:function(){return b},su:function(){return V}});var B=f(38999);function U(I){return null!=I&&"false"!=="".concat(I)}function V(I){var D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Z(I)?Number(I):D}function Z(I){return!isNaN(parseFloat(I))&&!isNaN(Number(I))}function w(I){return Array.isArray(I)?I:[I]}function N(I){return null==I?"":"string"==typeof I?I:"".concat(I,"px")}function b(I){return I instanceof B.SBq?I.nativeElement:I}},40098:function(ue,q,f){"use strict";f.d(q,{mr:function(){return J},Ov:function(){return ho},ez:function(){return Bn},K0:function(){return v},Do:function(){return $},V_:function(){return R},Ye:function(){return ae},S$:function(){return K},mk:function(){return Xt},sg:function(){return zn},O5:function(){return Si},PC:function(){return ji},RF:function(){return Io},n9:function(){return $o},ED:function(){return ko},tP:function(){return Ji},b0:function(){return ee},lw:function(){return g},EM:function(){return Va},JF:function(){return Cl},NF:function(){return Wi},w_:function(){return S},bD:function(){return Ma},q:function(){return I},Mx:function(){return Gt},HT:function(){return A}});var B=f(36683),U=f(71955),V=f(10509),Z=f(97154),w=f(14105),N=f(18967),b=f(38999),_=null;function I(){return _}function A(pe){_||(_=pe)}var S=function pe(){(0,N.Z)(this,pe)},v=new b.OlP("DocumentToken"),g=function(){var pe=function(){function Fe(){(0,N.Z)(this,Fe)}return(0,w.Z)(Fe,[{key:"historyGo",value:function(We){throw new Error("Not implemented")}}]),Fe}();return pe.\u0275fac=function($e){return new($e||pe)},pe.\u0275prov=(0,b.Yz7)({factory:T,token:pe,providedIn:"platform"}),pe}();function T(){return(0,b.LFG)(k)}var R=new b.OlP("Location Initialized"),k=function(){var pe=function(Fe){(0,V.Z)(We,Fe);var $e=(0,Z.Z)(We);function We(ie){var fe;return(0,N.Z)(this,We),(fe=$e.call(this))._doc=ie,fe._init(),fe}return(0,w.Z)(We,[{key:"_init",value:function(){this.location=window.location,this._history=window.history}},{key:"getBaseHrefFromDOM",value:function(){return I().getBaseHref(this._doc)}},{key:"onPopState",value:function(fe){var _e=I().getGlobalEventTarget(this._doc,"window");return _e.addEventListener("popstate",fe,!1),function(){return _e.removeEventListener("popstate",fe)}}},{key:"onHashChange",value:function(fe){var _e=I().getGlobalEventTarget(this._doc,"window");return _e.addEventListener("hashchange",fe,!1),function(){return _e.removeEventListener("hashchange",fe)}}},{key:"href",get:function(){return this.location.href}},{key:"protocol",get:function(){return this.location.protocol}},{key:"hostname",get:function(){return this.location.hostname}},{key:"port",get:function(){return this.location.port}},{key:"pathname",get:function(){return this.location.pathname},set:function(fe){this.location.pathname=fe}},{key:"search",get:function(){return this.location.search}},{key:"hash",get:function(){return this.location.hash}},{key:"pushState",value:function(fe,_e,Ce){E()?this._history.pushState(fe,_e,Ce):this.location.hash=Ce}},{key:"replaceState",value:function(fe,_e,Ce){E()?this._history.replaceState(fe,_e,Ce):this.location.hash=Ce}},{key:"forward",value:function(){this._history.forward()}},{key:"back",value:function(){this._history.back()}},{key:"historyGo",value:function(){var fe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._history.go(fe)}},{key:"getState",value:function(){return this._history.state}}]),We}(g);return pe.\u0275fac=function($e){return new($e||pe)(b.LFG(v))},pe.\u0275prov=(0,b.Yz7)({factory:x,token:pe,providedIn:"platform"}),pe}();function E(){return!!window.history.pushState}function x(){return new k((0,b.LFG)(v))}function O(pe,Fe){if(0==pe.length)return Fe;if(0==Fe.length)return pe;var $e=0;return pe.endsWith("/")&&$e++,Fe.startsWith("/")&&$e++,2==$e?pe+Fe.substring(1):1==$e?pe+Fe:pe+"/"+Fe}function F(pe){var Fe=pe.match(/#|\?|$/),$e=Fe&&Fe.index||pe.length;return pe.slice(0,$e-("/"===pe[$e-1]?1:0))+pe.slice($e)}function z(pe){return pe&&"?"!==pe[0]?"?"+pe:pe}var K=function(){var pe=function(){function Fe(){(0,N.Z)(this,Fe)}return(0,w.Z)(Fe,[{key:"historyGo",value:function(We){throw new Error("Not implemented")}}]),Fe}();return pe.\u0275fac=function($e){return new($e||pe)},pe.\u0275prov=(0,b.Yz7)({factory:j,token:pe,providedIn:"root"}),pe}();function j(pe){var Fe=(0,b.LFG)(v).location;return new ee((0,b.LFG)(g),Fe&&Fe.origin||"")}var J=new b.OlP("appBaseHref"),ee=function(){var pe=function(Fe){(0,V.Z)(We,Fe);var $e=(0,Z.Z)(We);function We(ie,fe){var _e;if((0,N.Z)(this,We),(_e=$e.call(this))._platformLocation=ie,_e._removeListenerFns=[],null==fe&&(fe=_e._platformLocation.getBaseHrefFromDOM()),null==fe)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return _e._baseHref=fe,_e}return(0,w.Z)(We,[{key:"ngOnDestroy",value:function(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}},{key:"onPopState",value:function(fe){this._removeListenerFns.push(this._platformLocation.onPopState(fe),this._platformLocation.onHashChange(fe))}},{key:"getBaseHref",value:function(){return this._baseHref}},{key:"prepareExternalUrl",value:function(fe){return O(this._baseHref,fe)}},{key:"path",value:function(){var fe=arguments.length>0&&void 0!==arguments[0]&&arguments[0],_e=this._platformLocation.pathname+z(this._platformLocation.search),Ce=this._platformLocation.hash;return Ce&&fe?"".concat(_e).concat(Ce):_e}},{key:"pushState",value:function(fe,_e,Ce,Re){var Ge=this.prepareExternalUrl(Ce+z(Re));this._platformLocation.pushState(fe,_e,Ge)}},{key:"replaceState",value:function(fe,_e,Ce,Re){var Ge=this.prepareExternalUrl(Ce+z(Re));this._platformLocation.replaceState(fe,_e,Ge)}},{key:"forward",value:function(){this._platformLocation.forward()}},{key:"back",value:function(){this._platformLocation.back()}},{key:"historyGo",value:function(){var _e,Ce,fe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(Ce=(_e=this._platformLocation).historyGo)||void 0===Ce||Ce.call(_e,fe)}}]),We}(K);return pe.\u0275fac=function($e){return new($e||pe)(b.LFG(g),b.LFG(J,8))},pe.\u0275prov=b.Yz7({token:pe,factory:pe.\u0275fac}),pe}(),$=function(){var pe=function(Fe){(0,V.Z)(We,Fe);var $e=(0,Z.Z)(We);function We(ie,fe){var _e;return(0,N.Z)(this,We),(_e=$e.call(this))._platformLocation=ie,_e._baseHref="",_e._removeListenerFns=[],null!=fe&&(_e._baseHref=fe),_e}return(0,w.Z)(We,[{key:"ngOnDestroy",value:function(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}},{key:"onPopState",value:function(fe){this._removeListenerFns.push(this._platformLocation.onPopState(fe),this._platformLocation.onHashChange(fe))}},{key:"getBaseHref",value:function(){return this._baseHref}},{key:"path",value:function(){var _e=this._platformLocation.hash;return null==_e&&(_e="#"),_e.length>0?_e.substring(1):_e}},{key:"prepareExternalUrl",value:function(fe){var _e=O(this._baseHref,fe);return _e.length>0?"#"+_e:_e}},{key:"pushState",value:function(fe,_e,Ce,Re){var Ge=this.prepareExternalUrl(Ce+z(Re));0==Ge.length&&(Ge=this._platformLocation.pathname),this._platformLocation.pushState(fe,_e,Ge)}},{key:"replaceState",value:function(fe,_e,Ce,Re){var Ge=this.prepareExternalUrl(Ce+z(Re));0==Ge.length&&(Ge=this._platformLocation.pathname),this._platformLocation.replaceState(fe,_e,Ge)}},{key:"forward",value:function(){this._platformLocation.forward()}},{key:"back",value:function(){this._platformLocation.back()}},{key:"historyGo",value:function(){var _e,Ce,fe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(Ce=(_e=this._platformLocation).historyGo)||void 0===Ce||Ce.call(_e,fe)}}]),We}(K);return pe.\u0275fac=function($e){return new($e||pe)(b.LFG(g),b.LFG(J,8))},pe.\u0275prov=b.Yz7({token:pe,factory:pe.\u0275fac}),pe}(),ae=function(){var pe=function(){function Fe($e,We){var ie=this;(0,N.Z)(this,Fe),this._subject=new b.vpe,this._urlChangeListeners=[],this._platformStrategy=$e;var fe=this._platformStrategy.getBaseHref();this._platformLocation=We,this._baseHref=F(le(fe)),this._platformStrategy.onPopState(function(_e){ie._subject.emit({url:ie.path(!0),pop:!0,state:_e.state,type:_e.type})})}return(0,w.Z)(Fe,[{key:"path",value:function(){var We=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.normalize(this._platformStrategy.path(We))}},{key:"getState",value:function(){return this._platformLocation.getState()}},{key:"isCurrentPathEqualTo",value:function(We){var ie=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.path()==this.normalize(We+z(ie))}},{key:"normalize",value:function(We){return Fe.stripTrailingSlash(function(pe,Fe){return pe&&Fe.startsWith(pe)?Fe.substring(pe.length):Fe}(this._baseHref,le(We)))}},{key:"prepareExternalUrl",value:function(We){return We&&"/"!==We[0]&&(We="/"+We),this._platformStrategy.prepareExternalUrl(We)}},{key:"go",value:function(We){var ie=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",fe=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._platformStrategy.pushState(fe,"",We,ie),this._notifyUrlChangeListeners(this.prepareExternalUrl(We+z(ie)),fe)}},{key:"replaceState",value:function(We){var ie=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",fe=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._platformStrategy.replaceState(fe,"",We,ie),this._notifyUrlChangeListeners(this.prepareExternalUrl(We+z(ie)),fe)}},{key:"forward",value:function(){this._platformStrategy.forward()}},{key:"back",value:function(){this._platformStrategy.back()}},{key:"historyGo",value:function(){var ie,fe,We=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null===(fe=(ie=this._platformStrategy).historyGo)||void 0===fe||fe.call(ie,We)}},{key:"onUrlChange",value:function(We){var ie=this;this._urlChangeListeners.push(We),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(function(fe){ie._notifyUrlChangeListeners(fe.url,fe.state)}))}},{key:"_notifyUrlChangeListeners",value:function(){var We=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",ie=arguments.length>1?arguments[1]:void 0;this._urlChangeListeners.forEach(function(fe){return fe(We,ie)})}},{key:"subscribe",value:function(We,ie,fe){return this._subject.subscribe({next:We,error:ie,complete:fe})}}]),Fe}();return pe.\u0275fac=function($e){return new($e||pe)(b.LFG(K),b.LFG(g))},pe.normalizeQueryParams=z,pe.joinWithSlash=O,pe.stripTrailingSlash=F,pe.\u0275prov=(0,b.Yz7)({factory:se,token:pe,providedIn:"root"}),pe}();function se(){return new ae((0,b.LFG)(K),(0,b.LFG)(g))}function le(pe){return pe.replace(/\/index.html$/,"")}var be=function(pe){return pe[pe.Zero=0]="Zero",pe[pe.One=1]="One",pe[pe.Two=2]="Two",pe[pe.Few=3]="Few",pe[pe.Many=4]="Many",pe[pe.Other=5]="Other",pe}({}),kn=b.kL8,Ot=function pe(){(0,N.Z)(this,pe)},Pt=function(){var pe=function(Fe){(0,V.Z)(We,Fe);var $e=(0,Z.Z)(We);function We(ie){var fe;return(0,N.Z)(this,We),(fe=$e.call(this)).locale=ie,fe}return(0,w.Z)(We,[{key:"getPluralCategory",value:function(fe,_e){switch(kn(_e||this.locale)(fe)){case be.Zero:return"zero";case be.One:return"one";case be.Two:return"two";case be.Few:return"few";case be.Many:return"many";default:return"other"}}}]),We}(Ot);return pe.\u0275fac=function($e){return new($e||pe)(b.LFG(b.soG))},pe.\u0275prov=b.Yz7({token:pe,factory:pe.\u0275fac}),pe}();function Gt(pe,Fe){Fe=encodeURIComponent(Fe);var We,$e=(0,B.Z)(pe.split(";"));try{for($e.s();!(We=$e.n()).done;){var ie=We.value,fe=ie.indexOf("="),_e=-1==fe?[ie,""]:[ie.slice(0,fe),ie.slice(fe+1)],Ce=(0,U.Z)(_e,2),Ge=Ce[1];if(Ce[0].trim()===Fe)return decodeURIComponent(Ge)}}catch(St){$e.e(St)}finally{$e.f()}return null}var Xt=function(){var pe=function(){function Fe($e,We,ie,fe){(0,N.Z)(this,Fe),this._iterableDiffers=$e,this._keyValueDiffers=We,this._ngEl=ie,this._renderer=fe,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}return(0,w.Z)(Fe,[{key:"klass",set:function(We){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof We?We.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}},{key:"ngClass",set:function(We){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof We?We.split(/\s+/):We,this._rawClass&&((0,b.sIi)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}},{key:"ngDoCheck",value:function(){if(this._iterableDiffer){var We=this._iterableDiffer.diff(this._rawClass);We&&this._applyIterableChanges(We)}else if(this._keyValueDiffer){var ie=this._keyValueDiffer.diff(this._rawClass);ie&&this._applyKeyValueChanges(ie)}}},{key:"_applyKeyValueChanges",value:function(We){var ie=this;We.forEachAddedItem(function(fe){return ie._toggleClass(fe.key,fe.currentValue)}),We.forEachChangedItem(function(fe){return ie._toggleClass(fe.key,fe.currentValue)}),We.forEachRemovedItem(function(fe){fe.previousValue&&ie._toggleClass(fe.key,!1)})}},{key:"_applyIterableChanges",value:function(We){var ie=this;We.forEachAddedItem(function(fe){if("string"!=typeof fe.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got ".concat((0,b.AaK)(fe.item)));ie._toggleClass(fe.item,!0)}),We.forEachRemovedItem(function(fe){return ie._toggleClass(fe.item,!1)})}},{key:"_applyClasses",value:function(We){var ie=this;We&&(Array.isArray(We)||We instanceof Set?We.forEach(function(fe){return ie._toggleClass(fe,!0)}):Object.keys(We).forEach(function(fe){return ie._toggleClass(fe,!!We[fe])}))}},{key:"_removeClasses",value:function(We){var ie=this;We&&(Array.isArray(We)||We instanceof Set?We.forEach(function(fe){return ie._toggleClass(fe,!1)}):Object.keys(We).forEach(function(fe){return ie._toggleClass(fe,!1)}))}},{key:"_toggleClass",value:function(We,ie){var fe=this;(We=We.trim())&&We.split(/\s+/g).forEach(function(_e){ie?fe._renderer.addClass(fe._ngEl.nativeElement,_e):fe._renderer.removeClass(fe._ngEl.nativeElement,_e)})}}]),Fe}();return pe.\u0275fac=function($e){return new($e||pe)(b.Y36(b.ZZ4),b.Y36(b.aQg),b.Y36(b.SBq),b.Y36(b.Qsj))},pe.\u0275dir=b.lG2({type:pe,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),pe}(),Gn=function(){function pe(Fe,$e,We,ie){(0,N.Z)(this,pe),this.$implicit=Fe,this.ngForOf=$e,this.index=We,this.count=ie}return(0,w.Z)(pe,[{key:"first",get:function(){return 0===this.index}},{key:"last",get:function(){return this.index===this.count-1}},{key:"even",get:function(){return this.index%2==0}},{key:"odd",get:function(){return!this.even}}]),pe}(),zn=function(){var pe=function(){function Fe($e,We,ie){(0,N.Z)(this,Fe),this._viewContainer=$e,this._template=We,this._differs=ie,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}return(0,w.Z)(Fe,[{key:"ngForOf",set:function(We){this._ngForOf=We,this._ngForOfDirty=!0}},{key:"ngForTrackBy",get:function(){return this._trackByFn},set:function(We){this._trackByFn=We}},{key:"ngForTemplate",set:function(We){We&&(this._template=We)}},{key:"ngDoCheck",value:function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var We=this._ngForOf;if(!this._differ&&We)try{this._differ=this._differs.find(We).create(this.ngForTrackBy)}catch(fe){throw new Error("Cannot find a differ supporting object '".concat(We,"' of type '").concat(function(pe){return pe.name||typeof pe}(We),"'. NgFor only supports binding to Iterables such as Arrays."))}}if(this._differ){var ie=this._differ.diff(this._ngForOf);ie&&this._applyChanges(ie)}}},{key:"_applyChanges",value:function(We){var ie=this,fe=[];We.forEachOperation(function(St,ht,gt){if(null==St.previousIndex){var Jr=ie._viewContainer.createEmbeddedView(ie._template,new Gn(null,ie._ngForOf,-1,-1),null===gt?void 0:gt),Vr=new Vn(St,Jr);fe.push(Vr)}else if(null==gt)ie._viewContainer.remove(null===ht?void 0:ht);else if(null!==ht){var Pi=ie._viewContainer.get(ht);ie._viewContainer.move(Pi,gt);var _a=new Vn(St,Pi);fe.push(_a)}});for(var _e=0;_e0){var ct=Te.slice(0,we),ft=ct.toLowerCase(),Yt=Te.slice(we+1).trim();ye.maybeSetNormalizedName(ct,ft),ye.headers.has(ft)?ye.headers.get(ft).push(Yt):ye.headers.set(ft,[Yt])}})}:function(){ye.headers=new Map,Object.keys(ve).forEach(function(Te){var we=ve[Te],ct=Te.toLowerCase();"string"==typeof we&&(we=[we]),we.length>0&&(ye.headers.set(ct,we),ye.maybeSetNormalizedName(Te,ct))})}:this.headers=new Map}return(0,w.Z)(He,[{key:"has",value:function(ye){return this.init(),this.headers.has(ye.toLowerCase())}},{key:"get",value:function(ye){this.init();var Te=this.headers.get(ye.toLowerCase());return Te&&Te.length>0?Te[0]:null}},{key:"keys",value:function(){return this.init(),Array.from(this.normalizedNames.values())}},{key:"getAll",value:function(ye){return this.init(),this.headers.get(ye.toLowerCase())||null}},{key:"append",value:function(ye,Te){return this.clone({name:ye,value:Te,op:"a"})}},{key:"set",value:function(ye,Te){return this.clone({name:ye,value:Te,op:"s"})}},{key:"delete",value:function(ye,Te){return this.clone({name:ye,value:Te,op:"d"})}},{key:"maybeSetNormalizedName",value:function(ye,Te){this.normalizedNames.has(Te)||this.normalizedNames.set(Te,ye)}},{key:"init",value:function(){var ye=this;this.lazyInit&&(this.lazyInit instanceof He?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(function(Te){return ye.applyUpdate(Te)}),this.lazyUpdate=null))}},{key:"copyFrom",value:function(ye){var Te=this;ye.init(),Array.from(ye.headers.keys()).forEach(function(we){Te.headers.set(we,ye.headers.get(we)),Te.normalizedNames.set(we,ye.normalizedNames.get(we))})}},{key:"clone",value:function(ye){var Te=new He;return Te.lazyInit=this.lazyInit&&this.lazyInit instanceof He?this.lazyInit:this,Te.lazyUpdate=(this.lazyUpdate||[]).concat([ye]),Te}},{key:"applyUpdate",value:function(ye){var Te=ye.name.toLowerCase();switch(ye.op){case"a":case"s":var we=ye.value;if("string"==typeof we&&(we=[we]),0===we.length)return;this.maybeSetNormalizedName(ye.name,Te);var ct=("a"===ye.op?this.headers.get(Te):void 0)||[];ct.push.apply(ct,(0,Z.Z)(we)),this.headers.set(Te,ct);break;case"d":var ft=ye.value;if(ft){var Yt=this.headers.get(Te);if(!Yt)return;0===(Yt=Yt.filter(function(Kt){return-1===ft.indexOf(Kt)})).length?(this.headers.delete(Te),this.normalizedNames.delete(Te)):this.headers.set(Te,Yt)}else this.headers.delete(Te),this.normalizedNames.delete(Te)}}},{key:"forEach",value:function(ye){var Te=this;this.init(),Array.from(this.normalizedNames.keys()).forEach(function(we){return ye(Te.normalizedNames.get(we),Te.headers.get(we))})}}]),He}(),k=function(){function He(){(0,N.Z)(this,He)}return(0,w.Z)(He,[{key:"encodeKey",value:function(ye){return F(ye)}},{key:"encodeValue",value:function(ye){return F(ye)}},{key:"decodeKey",value:function(ye){return decodeURIComponent(ye)}},{key:"decodeValue",value:function(ye){return decodeURIComponent(ye)}}]),He}();function E(He,ve){var ye=new Map;return He.length>0&&He.replace(/^\?/,"").split("&").forEach(function(we){var ct=we.indexOf("="),ft=-1==ct?[ve.decodeKey(we),""]:[ve.decodeKey(we.slice(0,ct)),ve.decodeValue(we.slice(ct+1))],Yt=(0,V.Z)(ft,2),Kt=Yt[0],Jt=Yt[1],nn=ye.get(Kt)||[];nn.push(Jt),ye.set(Kt,nn)}),ye}var x=/%(\d[a-f0-9])/gi,O={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function F(He){return encodeURIComponent(He).replace(x,function(ve,ye){var Te;return null!==(Te=O[ye])&&void 0!==Te?Te:ve})}function z(He){return"".concat(He)}var K=function(){function He(){var ve=this,ye=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,N.Z)(this,He),this.updates=null,this.cloneFrom=null,this.encoder=ye.encoder||new k,ye.fromString){if(ye.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=E(ye.fromString,this.encoder)}else ye.fromObject?(this.map=new Map,Object.keys(ye.fromObject).forEach(function(Te){var we=ye.fromObject[Te];ve.map.set(Te,Array.isArray(we)?we:[we])})):this.map=null}return(0,w.Z)(He,[{key:"has",value:function(ye){return this.init(),this.map.has(ye)}},{key:"get",value:function(ye){this.init();var Te=this.map.get(ye);return Te?Te[0]:null}},{key:"getAll",value:function(ye){return this.init(),this.map.get(ye)||null}},{key:"keys",value:function(){return this.init(),Array.from(this.map.keys())}},{key:"append",value:function(ye,Te){return this.clone({param:ye,value:Te,op:"a"})}},{key:"appendAll",value:function(ye){var Te=[];return Object.keys(ye).forEach(function(we){var ct=ye[we];Array.isArray(ct)?ct.forEach(function(ft){Te.push({param:we,value:ft,op:"a"})}):Te.push({param:we,value:ct,op:"a"})}),this.clone(Te)}},{key:"set",value:function(ye,Te){return this.clone({param:ye,value:Te,op:"s"})}},{key:"delete",value:function(ye,Te){return this.clone({param:ye,value:Te,op:"d"})}},{key:"toString",value:function(){var ye=this;return this.init(),this.keys().map(function(Te){var we=ye.encoder.encodeKey(Te);return ye.map.get(Te).map(function(ct){return we+"="+ye.encoder.encodeValue(ct)}).join("&")}).filter(function(Te){return""!==Te}).join("&")}},{key:"clone",value:function(ye){var Te=new He({encoder:this.encoder});return Te.cloneFrom=this.cloneFrom||this,Te.updates=(this.updates||[]).concat(ye),Te}},{key:"init",value:function(){var ye=this;null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(function(Te){return ye.map.set(Te,ye.cloneFrom.map.get(Te))}),this.updates.forEach(function(Te){switch(Te.op){case"a":case"s":var we=("a"===Te.op?ye.map.get(Te.param):void 0)||[];we.push(z(Te.value)),ye.map.set(Te.param,we);break;case"d":if(void 0===Te.value){ye.map.delete(Te.param);break}var ct=ye.map.get(Te.param)||[],ft=ct.indexOf(z(Te.value));-1!==ft&&ct.splice(ft,1),ct.length>0?ye.map.set(Te.param,ct):ye.map.delete(Te.param)}}),this.cloneFrom=this.updates=null)}}]),He}(),J=function(){function He(){(0,N.Z)(this,He),this.map=new Map}return(0,w.Z)(He,[{key:"set",value:function(ye,Te){return this.map.set(ye,Te),this}},{key:"get",value:function(ye){return this.map.has(ye)||this.map.set(ye,ye.defaultValue()),this.map.get(ye)}},{key:"delete",value:function(ye){return this.map.delete(ye),this}},{key:"keys",value:function(){return this.map.keys()}}]),He}();function $(He){return"undefined"!=typeof ArrayBuffer&&He instanceof ArrayBuffer}function ae(He){return"undefined"!=typeof Blob&&He instanceof Blob}function se(He){return"undefined"!=typeof FormData&&He instanceof FormData}var le=function(){function He(ve,ye,Te,we){var ct;if((0,N.Z)(this,He),this.url=ye,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=ve.toUpperCase(),function(He){switch(He){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||we?(this.body=void 0!==Te?Te:null,ct=we):ct=Te,ct&&(this.reportProgress=!!ct.reportProgress,this.withCredentials=!!ct.withCredentials,ct.responseType&&(this.responseType=ct.responseType),ct.headers&&(this.headers=ct.headers),ct.context&&(this.context=ct.context),ct.params&&(this.params=ct.params)),this.headers||(this.headers=new R),this.context||(this.context=new J),this.params){var ft=this.params.toString();if(0===ft.length)this.urlWithParams=ye;else{var Yt=ye.indexOf("?");this.urlWithParams=ye+(-1===Yt?"?":Yt0&&void 0!==arguments[0]?arguments[0]:{},we=ye.method||this.method,ct=ye.url||this.url,ft=ye.responseType||this.responseType,Yt=void 0!==ye.body?ye.body:this.body,Kt=void 0!==ye.withCredentials?ye.withCredentials:this.withCredentials,Jt=void 0!==ye.reportProgress?ye.reportProgress:this.reportProgress,nn=ye.headers||this.headers,ln=ye.params||this.params,yn=null!==(Te=ye.context)&&void 0!==Te?Te:this.context;return void 0!==ye.setHeaders&&(nn=Object.keys(ye.setHeaders).reduce(function(Tn,In){return Tn.set(In,ye.setHeaders[In])},nn)),ye.setParams&&(ln=Object.keys(ye.setParams).reduce(function(Tn,In){return Tn.set(In,ye.setParams[In])},ln)),new He(we,ct,Yt,{params:ln,headers:nn,context:yn,reportProgress:Jt,responseType:ft,withCredentials:Kt})}}]),He}(),oe=function(He){return He[He.Sent=0]="Sent",He[He.UploadProgress=1]="UploadProgress",He[He.ResponseHeader=2]="ResponseHeader",He[He.DownloadProgress=3]="DownloadProgress",He[He.Response=4]="Response",He[He.User=5]="User",He}({}),Ae=function He(ve){var ye=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,Te=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"OK";(0,N.Z)(this,He),this.headers=ve.headers||new R,this.status=void 0!==ve.status?ve.status:ye,this.statusText=ve.statusText||Te,this.url=ve.url||null,this.ok=this.status>=200&&this.status<300},be=function(He){(0,B.Z)(ye,He);var ve=(0,U.Z)(ye);function ye(){var Te,we=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,N.Z)(this,ye),(Te=ve.call(this,we)).type=oe.ResponseHeader,Te}return(0,w.Z)(ye,[{key:"clone",value:function(){var we=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ye({headers:we.headers||this.headers,status:void 0!==we.status?we.status:this.status,statusText:we.statusText||this.statusText,url:we.url||this.url||void 0})}}]),ye}(Ae),it=function(He){(0,B.Z)(ye,He);var ve=(0,U.Z)(ye);function ye(){var Te,we=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,N.Z)(this,ye),(Te=ve.call(this,we)).type=oe.Response,Te.body=void 0!==we.body?we.body:null,Te}return(0,w.Z)(ye,[{key:"clone",value:function(){var we=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ye({body:void 0!==we.body?we.body:this.body,headers:we.headers||this.headers,status:void 0!==we.status?we.status:this.status,statusText:we.statusText||this.statusText,url:we.url||this.url||void 0})}}]),ye}(Ae),qe=function(He){(0,B.Z)(ye,He);var ve=(0,U.Z)(ye);function ye(Te){var we;return(0,N.Z)(this,ye),(we=ve.call(this,Te,0,"Unknown Error")).name="HttpErrorResponse",we.ok=!1,we.message=we.status>=200&&we.status<300?"Http failure during parsing for ".concat(Te.url||"(unknown url)"):"Http failure response for ".concat(Te.url||"(unknown url)",": ").concat(Te.status," ").concat(Te.statusText),we.error=Te.error||null,we}return ye}(Ae);function _t(He,ve){return{body:ve,headers:He.headers,context:He.context,observe:He.observe,params:He.params,reportProgress:He.reportProgress,responseType:He.responseType,withCredentials:He.withCredentials}}var yt=function(){var He=function(){function ve(ye){(0,N.Z)(this,ve),this.handler=ye}return(0,w.Z)(ve,[{key:"request",value:function(Te,we){var Yt,ct=this,ft=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Te instanceof le)Yt=Te;else{var Kt=void 0;Kt=ft.headers instanceof R?ft.headers:new R(ft.headers);var Jt=void 0;ft.params&&(Jt=ft.params instanceof K?ft.params:new K({fromObject:ft.params})),Yt=new le(Te,we,void 0!==ft.body?ft.body:null,{headers:Kt,context:ft.context,params:Jt,reportProgress:ft.reportProgress,responseType:ft.responseType||"json",withCredentials:ft.withCredentials})}var nn=(0,I.of)(Yt).pipe((0,A.b)(function(yn){return ct.handler.handle(yn)}));if(Te instanceof le||"events"===ft.observe)return nn;var ln=nn.pipe((0,S.h)(function(yn){return yn instanceof it}));switch(ft.observe||"body"){case"body":switch(Yt.responseType){case"arraybuffer":return ln.pipe((0,v.U)(function(yn){if(null!==yn.body&&!(yn.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return yn.body}));case"blob":return ln.pipe((0,v.U)(function(yn){if(null!==yn.body&&!(yn.body instanceof Blob))throw new Error("Response is not a Blob.");return yn.body}));case"text":return ln.pipe((0,v.U)(function(yn){if(null!==yn.body&&"string"!=typeof yn.body)throw new Error("Response is not a string.");return yn.body}));case"json":default:return ln.pipe((0,v.U)(function(yn){return yn.body}))}case"response":return ln;default:throw new Error("Unreachable: unhandled observe type ".concat(ft.observe,"}"))}}},{key:"delete",value:function(Te){var we=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",Te,we)}},{key:"get",value:function(Te){var we=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("GET",Te,we)}},{key:"head",value:function(Te){var we=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("HEAD",Te,we)}},{key:"jsonp",value:function(Te,we){return this.request("JSONP",Te,{params:(new K).append(we,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}},{key:"options",value:function(Te){var we=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("OPTIONS",Te,we)}},{key:"patch",value:function(Te,we){var ct=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",Te,_t(ct,we))}},{key:"post",value:function(Te,we){var ct=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",Te,_t(ct,we))}},{key:"put",value:function(Te,we){var ct=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",Te,_t(ct,we))}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)(_.LFG(g))},He.\u0275prov=_.Yz7({token:He,factory:He.\u0275fac}),He}(),Ft=function(){function He(ve,ye){(0,N.Z)(this,He),this.next=ve,this.interceptor=ye}return(0,w.Z)(He,[{key:"handle",value:function(ye){return this.interceptor.intercept(ye,this.next)}}]),He}(),xe=new _.OlP("HTTP_INTERCEPTORS"),De=function(){var He=function(){function ve(){(0,N.Z)(this,ve)}return(0,w.Z)(ve,[{key:"intercept",value:function(Te,we){return we.handle(Te)}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)},He.\u0275prov=_.Yz7({token:He,factory:He.\u0275fac}),He}(),Ht=/^\)\]\}',?\n/,qt=function(){var He=function(){function ve(ye){(0,N.Z)(this,ve),this.xhrFactory=ye}return(0,w.Z)(ve,[{key:"handle",value:function(Te){var we=this;if("JSONP"===Te.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new D.y(function(ct){var ft=we.xhrFactory.build();if(ft.open(Te.method,Te.urlWithParams),Te.withCredentials&&(ft.withCredentials=!0),Te.headers.forEach(function(Sn,tr){return ft.setRequestHeader(Sn,tr.join(","))}),Te.headers.has("Accept")||ft.setRequestHeader("Accept","application/json, text/plain, */*"),!Te.headers.has("Content-Type")){var Yt=Te.detectContentTypeHeader();null!==Yt&&ft.setRequestHeader("Content-Type",Yt)}if(Te.responseType){var Kt=Te.responseType.toLowerCase();ft.responseType="json"!==Kt?Kt:"text"}var Jt=Te.serializeBody(),nn=null,ln=function(){if(null!==nn)return nn;var tr=1223===ft.status?204:ft.status,ur=ft.statusText||"OK",Ut=new R(ft.getAllResponseHeaders()),Rt=function(He){return"responseURL"in He&&He.responseURL?He.responseURL:/^X-Request-URL:/m.test(He.getAllResponseHeaders())?He.getResponseHeader("X-Request-URL"):null}(ft)||Te.url;return nn=new be({headers:Ut,status:tr,statusText:ur,url:Rt})},yn=function(){var tr=ln(),ur=tr.headers,Ut=tr.status,Rt=tr.statusText,Lt=tr.url,Oe=null;204!==Ut&&(Oe=void 0===ft.response?ft.responseText:ft.response),0===Ut&&(Ut=Oe?200:0);var rt=Ut>=200&&Ut<300;if("json"===Te.responseType&&"string"==typeof Oe){var he=Oe;Oe=Oe.replace(Ht,"");try{Oe=""!==Oe?JSON.parse(Oe):null}catch(Ie){Oe=he,rt&&(rt=!1,Oe={error:Ie,text:Oe})}}rt?(ct.next(new it({body:Oe,headers:ur,status:Ut,statusText:Rt,url:Lt||void 0})),ct.complete()):ct.error(new qe({error:Oe,headers:ur,status:Ut,statusText:Rt,url:Lt||void 0}))},Tn=function(tr){var ur=ln(),Rt=new qe({error:tr,status:ft.status||0,statusText:ft.statusText||"Unknown Error",url:ur.url||void 0});ct.error(Rt)},In=!1,Yn=function(tr){In||(ct.next(ln()),In=!0);var ur={type:oe.DownloadProgress,loaded:tr.loaded};tr.lengthComputable&&(ur.total=tr.total),"text"===Te.responseType&&!!ft.responseText&&(ur.partialText=ft.responseText),ct.next(ur)},Cn=function(tr){var ur={type:oe.UploadProgress,loaded:tr.loaded};tr.lengthComputable&&(ur.total=tr.total),ct.next(ur)};return ft.addEventListener("load",yn),ft.addEventListener("error",Tn),ft.addEventListener("timeout",Tn),ft.addEventListener("abort",Tn),Te.reportProgress&&(ft.addEventListener("progress",Yn),null!==Jt&&ft.upload&&ft.upload.addEventListener("progress",Cn)),ft.send(Jt),ct.next({type:oe.Sent}),function(){ft.removeEventListener("error",Tn),ft.removeEventListener("abort",Tn),ft.removeEventListener("load",yn),ft.removeEventListener("timeout",Tn),Te.reportProgress&&(ft.removeEventListener("progress",Yn),null!==Jt&&ft.upload&&ft.upload.removeEventListener("progress",Cn)),ft.readyState!==ft.DONE&&ft.abort()}})}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)(_.LFG(b.JF))},He.\u0275prov=_.Yz7({token:He,factory:He.\u0275fac}),He}(),bt=new _.OlP("XSRF_COOKIE_NAME"),en=new _.OlP("XSRF_HEADER_NAME"),Nt=function He(){(0,N.Z)(this,He)},rn=function(){var He=function(){function ve(ye,Te,we){(0,N.Z)(this,ve),this.doc=ye,this.platform=Te,this.cookieName=we,this.lastCookieString="",this.lastToken=null,this.parseCount=0}return(0,w.Z)(ve,[{key:"getToken",value:function(){if("server"===this.platform)return null;var Te=this.doc.cookie||"";return Te!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,b.Mx)(Te,this.cookieName),this.lastCookieString=Te),this.lastToken}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)(_.LFG(b.K0),_.LFG(_.Lbi),_.LFG(bt))},He.\u0275prov=_.Yz7({token:He,factory:He.\u0275fac}),He}(),kn=function(){var He=function(){function ve(ye,Te){(0,N.Z)(this,ve),this.tokenService=ye,this.headerName=Te}return(0,w.Z)(ve,[{key:"intercept",value:function(Te,we){var ct=Te.url.toLowerCase();if("GET"===Te.method||"HEAD"===Te.method||ct.startsWith("http://")||ct.startsWith("https://"))return we.handle(Te);var ft=this.tokenService.getToken();return null!==ft&&!Te.headers.has(this.headerName)&&(Te=Te.clone({headers:Te.headers.set(this.headerName,ft)})),we.handle(Te)}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)(_.LFG(Nt),_.LFG(en))},He.\u0275prov=_.Yz7({token:He,factory:He.\u0275fac}),He}(),Ln=function(){var He=function(){function ve(ye,Te){(0,N.Z)(this,ve),this.backend=ye,this.injector=Te,this.chain=null}return(0,w.Z)(ve,[{key:"handle",value:function(Te){if(null===this.chain){var we=this.injector.get(xe,[]);this.chain=we.reduceRight(function(ct,ft){return new Ft(ct,ft)},this.backend)}return this.chain.handle(Te)}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)(_.LFG(T),_.LFG(_.zs3))},He.\u0275prov=_.Yz7({token:He,factory:He.\u0275fac}),He}(),Nn=function(){var He=function(){function ve(){(0,N.Z)(this,ve)}return(0,w.Z)(ve,null,[{key:"disable",value:function(){return{ngModule:ve,providers:[{provide:kn,useClass:De}]}}},{key:"withOptions",value:function(){var Te=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{ngModule:ve,providers:[Te.cookieName?{provide:bt,useValue:Te.cookieName}:[],Te.headerName?{provide:en,useValue:Te.headerName}:[]]}}}]),ve}();return He.\u0275fac=function(ye){return new(ye||He)},He.\u0275mod=_.oAB({type:He}),He.\u0275inj=_.cJS({providers:[kn,{provide:xe,useExisting:kn,multi:!0},{provide:Nt,useClass:rn},{provide:bt,useValue:"XSRF-TOKEN"},{provide:en,useValue:"X-XSRF-TOKEN"}]}),He}(),wn=function(){var He=function ve(){(0,N.Z)(this,ve)};return He.\u0275fac=function(ye){return new(ye||He)},He.\u0275mod=_.oAB({type:He}),He.\u0275inj=_.cJS({providers:[yt,{provide:g,useClass:Ln},qt,{provide:T,useExisting:qt}],imports:[[Nn.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),He}()},38999:function(ue,q,f){"use strict";f.d(q,{deG:function(){return mD},tb:function(){return JC},AFp:function(){return kf},ip1:function(){return dm},CZH:function(){return Cu},hGG:function(){return op},z2F:function(){return ym},sBO:function(){return pE},Sil:function(){return pm},_Vd:function(){return Ng},EJc:function(){return mk},SBq:function(){return vf},a5r:function(){return SR},qLn:function(){return Jp},vpe:function(){return Ls},gxx:function(){return tf},tBr:function(){return Ch},XFs:function(){return ft},OlP:function(){return No},zs3:function(){return Ia},ZZ4:function(){return Lg},aQg:function(){return Xh},soG:function(){return rp},YKP:function(){return dC},v3s:function(){return vR},h0i:function(){return Yd},PXZ:function(){return cR},R0b:function(){return il},FiY:function(){return Lu},Lbi:function(){return hk},g9A:function(){return YC},n_E:function(){return OC},Qsj:function(){return sE},FYo:function(){return sC},JOm:function(){return Ec},Tiy:function(){return lC},q3G:function(){return Fd},tp0:function(){return Fu},EAV:function(){return bR},Rgc:function(){return Fg},dDg:function(){return Ck},DyG:function(){return iu},GfV:function(){return lE},s_b:function(){return Bg},ifc:function(){return Cn},eFA:function(){return Ek},G48:function(){return sR},Gpc:function(){return $},f3M:function(){return TD},X6Q:function(){return n1},_c5:function(){return AR},VLi:function(){return aR},c2e:function(){return p_},zSh:function(){return Ks},wAp:function(){return Dg},vHH:function(){return le},EiD:function(){return Tb},mCW:function(){return ms},qzn:function(){return Oc},JVY:function(){return mb},pB0:function(){return Jv},eBb:function(){return vb},L6k:function(){return Nd},LAX:function(){return gb},cg1:function(){return Bw},Tjo:function(){return kR},kL8:function(){return YP},yhl:function(){return Yv},dqk:function(){return Rt},sIi:function(){return zh},CqO:function(){return D0},QGY:function(){return M0},F4k:function(){return A0},RDi:function(){return Ce},AaK:function(){return j},z3N:function(){return Ps},qOj:function(){return c0},TTD:function(){return Va},_Bn:function(){return MI},xp6:function(){return tO},uIk:function(){return m0},Q2q:function(){return _g},zWS:function(){return yg},Tol:function(){return z0},Gre:function(){return ZP},ekj:function(){return Eg},Suo:function(){return om},Xpm:function(){return Hr},lG2:function(){return Ei},Yz7:function(){return Rn},cJS:function(){return Nn},oAB:function(){return bo},Yjl:function(){return no},Y36:function(){return Wh},_UZ:function(){return pf},GkF:function(){return lw},BQk:function(){return Vc},ynx:function(){return Tg},qZA:function(){return k0},TgZ:function(){return E0},EpF:function(){return uw},n5z:function(){return gh},Ikx:function(){return Lw},LFG:function(){return Wo},$8M:function(){return Fy},NdJ:function(){return O0},CRH:function(){return bu},kcU:function(){return Iu},O4$:function(){return ph},oxw:function(){return dw},ALo:function(){return n_},lcZ:function(){return qE},xi3:function(){return jE},Hsn:function(){return N0},F$t:function(){return xg},Q6J:function(){return Sg},s9C:function(){return Z0},MGl:function(){return wg},hYB:function(){return L0},DdM:function(){return BE},VKq:function(){return w3},WLB:function(){return t_},iGM:function(){return YE},MAs:function(){return y0},evT:function(){return Ic},Jf7:function(){return tx},CHM:function(){return Q},oJD:function(){return YT},Ckj:function(){return eg},LSH:function(){return Gp},B6R:function(){return yr},kYT:function(){return po},Akn:function(){return $s},Udp:function(){return j0},WFA:function(){return P0},d8E:function(){return Fw},YNc:function(){return Gx},W1O:function(){return JE},_uU:function(){return Mw},Oqu:function(){return Q0},hij:function(){return Mg},AsE:function(){return Ag},lnq:function(){return K0},Gf:function(){return xf}});var B=f(13920),U=f(89200),V=f(88009),Z=f(71955),b=(f(42515),f(99890),f(36683)),_=f(62467),I=f(99740),D=f(14105),A=f(18967),S=f(10509),v=f(97154),g=f(35470);function R(l){var c="function"==typeof Map?new Map:void 0;return(R=function(h){if(null===h||!function(l){return-1!==Function.toString.call(l).indexOf("[native code]")}(h))return h;if("function"!=typeof h)throw new TypeError("Super expression must either be null or a function");if(void 0!==c){if(c.has(h))return c.get(h);c.set(h,y)}function y(){return(0,I.Z)(h,arguments,(0,U.Z)(this).constructor)}return y.prototype=Object.create(h.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),(0,g.Z)(y,h)})(l)}var k=f(5051),E=f(68707),x=f(89797),O=f(55371),F=f(16338);function z(l){for(var c in l)if(l[c]===z)return c;throw Error("Could not find renamed property on target object.")}function K(l,c){for(var d in c)c.hasOwnProperty(d)&&!l.hasOwnProperty(d)&&(l[d]=c[d])}function j(l){if("string"==typeof l)return l;if(Array.isArray(l))return"["+l.map(j).join(", ")+"]";if(null==l)return""+l;if(l.overriddenName)return"".concat(l.overriddenName);if(l.name)return"".concat(l.name);var c=l.toString();if(null==c)return""+c;var d=c.indexOf("\n");return-1===d?c:c.substring(0,d)}function J(l,c){return null==l||""===l?null===c?"":c:null==c||""===c?l:l+" "+c}var ee=z({__forward_ref__:z});function $(l){return l.__forward_ref__=$,l.toString=function(){return j(this())},l}function ae(l){return se(l)?l():l}function se(l){return"function"==typeof l&&l.hasOwnProperty(ee)&&l.__forward_ref__===$}var le=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h,y){var M;return(0,A.Z)(this,d),(M=c.call(this,function(l,c){var d=l?"NG0".concat(l,": "):"";return"".concat(d).concat(c)}(h,y))).code=h,M}return d}(R(Error));function be(l){return"string"==typeof l?l:null==l?"":String(l)}function it(l){return"function"==typeof l?l.name||l.toString():"object"==typeof l&&null!=l&&"function"==typeof l.type?l.type.name||l.type.toString():be(l)}function Ft(l,c){var d=c?" in ".concat(c):"";throw new le("201","No provider for ".concat(it(l)," found").concat(d))}function en(l,c){null==l&&function(l,c,d,h){throw new Error("ASSERTION ERROR: ".concat(l)+(null==h?"":" [Expected=> ".concat(d," ").concat(h," ").concat(c," <=Actual]")))}(c,l,null,"!=")}function Rn(l){return{token:l.token,providedIn:l.providedIn||null,factory:l.factory,value:void 0}}function Nn(l){return{providers:l.providers||[],imports:l.imports||[]}}function wn(l){return _r(l,ye)||_r(l,we)}function _r(l,c){return l.hasOwnProperty(c)?l[c]:null}function ve(l){return l&&(l.hasOwnProperty(Te)||l.hasOwnProperty(ct))?l[Te]:null}var Yt,ye=z({"\u0275prov":z}),Te=z({"\u0275inj":z}),we=z({ngInjectableDef:z}),ct=z({ngInjectorDef:z}),ft=function(l){return l[l.Default=0]="Default",l[l.Host=1]="Host",l[l.Self=2]="Self",l[l.SkipSelf=4]="SkipSelf",l[l.Optional=8]="Optional",l}({});function Kt(){return Yt}function Jt(l){var c=Yt;return Yt=l,c}function nn(l,c,d){var h=wn(l);return h&&"root"==h.providedIn?void 0===h.value?h.value=h.factory():h.value:d&ft.Optional?null:void 0!==c?c:void Ft(j(l),"Injector")}function yn(l){return{toString:l}.toString()}var Tn=function(l){return l[l.OnPush=0]="OnPush",l[l.Default=1]="Default",l}({}),Cn=function(l){return l[l.Emulated=0]="Emulated",l[l.None=2]="None",l[l.ShadowDom=3]="ShadowDom",l}({}),Sn="undefined"!=typeof globalThis&&globalThis,tr="undefined"!=typeof window&&window,ur="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Ut="undefined"!=typeof global&&global,Rt=Sn||Ut||tr||ur,rt={},he=[],Ie=z({"\u0275cmp":z}),Ne=z({"\u0275dir":z}),Le=z({"\u0275pipe":z}),ze=z({"\u0275mod":z}),At=z({"\u0275loc":z}),an=z({"\u0275fac":z}),jn=z({__NG_ELEMENT_ID__:z}),Rr=0;function Hr(l){return yn(function(){var d={},h={type:l.type,providersResolver:null,decls:l.decls,vars:l.vars,factory:null,template:l.template||null,consts:l.consts||null,ngContentSelectors:l.ngContentSelectors,hostBindings:l.hostBindings||null,hostVars:l.hostVars||0,hostAttrs:l.hostAttrs||null,contentQueries:l.contentQueries||null,declaredInputs:d,inputs:null,outputs:null,exportAs:l.exportAs||null,onPush:l.changeDetection===Tn.OnPush,directiveDefs:null,pipeDefs:null,selectors:l.selectors||he,viewQuery:l.viewQuery||null,features:l.features||null,data:l.data||{},encapsulation:l.encapsulation||Cn.Emulated,id:"c",styles:l.styles||he,_:null,setInput:null,schemas:l.schemas||null,tView:null},y=l.directives,M=l.features,H=l.pipes;return h.id+=Rr++,h.inputs=Xo(l.inputs,d),h.outputs=Xo(l.outputs),M&&M.forEach(function(W){return W(h)}),h.directiveDefs=y?function(){return("function"==typeof y?y():y).map(Yr)}:null,h.pipeDefs=H?function(){return("function"==typeof H?H():H).map(co)}:null,h})}function yr(l,c,d){var h=l.\u0275cmp;h.directiveDefs=function(){return c.map(Yr)},h.pipeDefs=function(){return d.map(co)}}function Yr(l){return vi(l)||function(l){return l[Ne]||null}(l)}function co(l){return function(l){return l[Le]||null}(l)}var Zi={};function bo(l){return yn(function(){var c={type:l.type,bootstrap:l.bootstrap||he,declarations:l.declarations||he,imports:l.imports||he,exports:l.exports||he,transitiveCompileScopes:null,schemas:l.schemas||null,id:l.id||null};return null!=l.id&&(Zi[l.id]=l.type),c})}function po(l,c){return yn(function(){var d=fi(l,!0);d.declarations=c.declarations||he,d.imports=c.imports||he,d.exports=c.exports||he})}function Xo(l,c){if(null==l)return rt;var d={};for(var h in l)if(l.hasOwnProperty(h)){var y=l[h],M=y;Array.isArray(y)&&(M=y[1],y=y[0]),d[y]=h,c&&(c[y]=M)}return d}var Ei=Hr;function no(l){return{type:l.type,name:l.name,factory:null,pure:!1!==l.pure,onDestroy:l.type.prototype.ngOnDestroy||null}}function vi(l){return l[Ie]||null}function fi(l,c){var d=l[ze]||null;if(!d&&!0===c)throw new Error("Type ".concat(j(l)," does not have '\u0275mod' property."));return d}function pr(l){return Array.isArray(l)&&"object"==typeof l[1]}function ho(l){return Array.isArray(l)&&!0===l[1]}function pa(l){return 0!=(8&l.flags)}function xi(l){return 2==(2&l.flags)}function So(l){return 1==(1&l.flags)}function Fi(l){return null!==l.template}function fa(l){return 0!=(512&l[2])}function Ka(l,c){return l.hasOwnProperty(an)?l[an]:null}var Ki=function(){function l(c,d,h){(0,A.Z)(this,l),this.previousValue=c,this.currentValue=d,this.firstChange=h}return(0,D.Z)(l,[{key:"isFirstChange",value:function(){return this.firstChange}}]),l}();function Va(){return yl}function yl(l){return l.type.prototype.ngOnChanges&&(l.setInput=tu),tn}function tn(){var l=Cl(this),c=null==l?void 0:l.current;if(c){var d=l.previous;if(d===rt)l.previous=c;else for(var h in c)d[h]=c[h];l.current=null,this.ngOnChanges(c)}}function tu(l,c,d,h){var y=Cl(l)||function(l,c){return l[bl]=c}(l,{previous:rt,current:null}),M=y.current||(y.current={}),H=y.previous,W=this.declaredInputs[d],X=H[W];M[W]=new Ki(X&&X.currentValue,c,H===rt),l[h]=c}Va.ngInherit=!0;var bl="__ngSimpleChanges__";function Cl(l){return l[bl]||null}var ie="http://www.w3.org/2000/svg",_e=void 0;function Ce(l){_e=l}function Re(){return void 0!==_e?_e:"undefined"!=typeof document?document:void 0}function St(l){return!!l.listen}var gt={createRenderer:function(c,d){return Re()}};function Vr(l){for(;Array.isArray(l);)l=l[0];return l}function li(l,c){return Vr(c[l])}function Mi(l,c){return Vr(c[l.index])}function Aa(l,c){return l.data[c]}function Xa(l,c){return l[c]}function ya(l,c){var d=c[l];return pr(d)?d:d[0]}function Ms(l){return 4==(4&l[2])}function kp(l){return 128==(128&l[2])}function Ws(l,c){return null==c?null:l[c]}function yc(l){l[18]=0}function Tl(l,c){l[5]+=c;for(var d=l,h=l[3];null!==h&&(1===c&&1===d[5]||-1===c&&0===d[5]);)h[5]+=c,d=h,h=h[3]}var Mr={lFrame:bn(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function md(){return Mr.bindingsEnabled}function Se(){return Mr.lFrame.lView}function ge(){return Mr.lFrame.tView}function Q(l){return Mr.lFrame.contextLView=l,l[8]}function ne(){for(var l=ke();null!==l&&64===l.type;)l=l.parent;return l}function ke(){return Mr.lFrame.currentTNode}function lt(l,c){var d=Mr.lFrame;d.currentTNode=l,d.isParent=c}function wt(){return Mr.lFrame.isParent}function Zt(){Mr.lFrame.isParent=!1}function Dn(){return Mr.isInCheckNoChangesMode}function Un(l){Mr.isInCheckNoChangesMode=l}function Qn(){var l=Mr.lFrame,c=l.bindingRootIndex;return-1===c&&(c=l.bindingRootIndex=l.tView.bindingStartIndex),c}function fr(){return Mr.lFrame.bindingIndex}function br(){return Mr.lFrame.bindingIndex++}function wr(l){var c=Mr.lFrame,d=c.bindingIndex;return c.bindingIndex=c.bindingIndex+l,d}function oi(l,c){var d=Mr.lFrame;d.bindingIndex=d.bindingRootIndex=l,Be(c)}function Be(l){Mr.lFrame.currentDirectiveIndex=l}function Ye(l){var c=Mr.lFrame.currentDirectiveIndex;return-1===c?null:l[c]}function Ee(){return Mr.lFrame.currentQueryIndex}function Ue(l){Mr.lFrame.currentQueryIndex=l}function Ze(l){var c=l[1];return 2===c.type?c.declTNode:1===c.type?l[6]:null}function nt(l,c,d){if(d&ft.SkipSelf){for(var h=c,y=l;!(null!==(h=h.parent)||d&ft.Host||null===(h=Ze(y))||(y=y[15],10&h.type)););if(null===h)return!1;c=h,l=y}var M=Mr.lFrame=sn();return M.currentTNode=c,M.lView=l,!0}function Tt(l){var c=sn(),d=l[1];Mr.lFrame=c,c.currentTNode=d.firstChild,c.lView=l,c.tView=d,c.contextLView=l,c.bindingIndex=d.bindingStartIndex,c.inI18n=!1}function sn(){var l=Mr.lFrame,c=null===l?null:l.child;return null===c?bn(l):c}function bn(l){var c={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:l,child:null,inI18n:!1};return null!==l&&(l.child=c),c}function Tr(){var l=Mr.lFrame;return Mr.lFrame=l.parent,l.currentTNode=null,l.lView=null,l}var Ii=Tr;function ea(){var l=Tr();l.isParent=!0,l.tView=null,l.selectedIndex=-1,l.contextLView=null,l.elementDepthCount=0,l.currentDirectiveIndex=-1,l.currentNamespace=null,l.bindingRootIndex=-1,l.bindingIndex=-1,l.currentQueryIndex=0}function Da(l){return(Mr.lFrame.contextLView=function(l,c){for(;l>0;)c=c[15],l--;return c}(l,Mr.lFrame.contextLView))[8]}function Do(){return Mr.lFrame.selectedIndex}function hs(l){Mr.lFrame.selectedIndex=l}function oo(){var l=Mr.lFrame;return Aa(l.tView,l.selectedIndex)}function ph(){Mr.lFrame.currentNamespace=ie}function Iu(){Mr.lFrame.currentNamespace=null}function jo(l,c){for(var d=c.directiveStart,h=c.directiveEnd;d=h)break}else c[X]<0&&(l[18]+=65536),(W>11>16&&(3&l[2])===c){l[2]+=2048;try{M.call(W)}finally{}}}else try{M.call(W)}finally{}}var Xi=function l(c,d,h){(0,A.Z)(this,l),this.factory=c,this.resolving=!1,this.canSeeViewProviders=d,this.injectImpl=h};function Ys(l,c,d){for(var h=St(l),y=0;yc){H=M-1;break}}}for(;M>16}(l),h=c;d>0;)h=h[15],d--;return h}var cT=!0;function Ry(l){var c=cT;return cT=l,c}var M5=0;function mh(l,c){var d=pT(l,c);if(-1!==d)return d;var h=c[1];h.firstCreatePass&&(l.injectorIndex=c.length,dT(h.data,l),dT(c,null),dT(h.blueprint,null));var y=Ny(l,c),M=l.injectorIndex;if(cD(y))for(var H=hh(y),W=Np(y,c),X=W[1].data,me=0;me<8;me++)c[M+me]=W[H+me]|X[H+me];return c[M+8]=y,M}function dT(l,c){l.push(0,0,0,0,0,0,0,0,c)}function pT(l,c){return-1===l.injectorIndex||l.parent&&l.parent.injectorIndex===l.injectorIndex||null===c[l.injectorIndex+8]?-1:l.injectorIndex}function Ny(l,c){if(l.parent&&-1!==l.parent.injectorIndex)return l.parent.injectorIndex;for(var d=0,h=null,y=c;null!==y;){var M=y[1],H=M.type;if(null===(h=2===H?M.declTNode:1===H?y[6]:null))return-1;if(d++,y=y[15],-1!==h.injectorIndex)return h.injectorIndex|d<<16}return-1}function Mv(l,c,d){!function(l,c,d){var h;"string"==typeof d?h=d.charCodeAt(0)||0:d.hasOwnProperty(jn)&&(h=d[jn]),null==h&&(h=d[jn]=M5++);var y=255&h;c.data[l+(y>>5)]|=1<3&&void 0!==arguments[3]?arguments[3]:ft.Default,y=arguments.length>4?arguments[4]:void 0;if(null!==l){var M=Dv(d);if("function"==typeof M){if(!nt(c,l,h))return h&ft.Host?fT(y,d,h):Zy(c,d,h,y);try{var H=M(h);if(null!=H||h&ft.Optional)return H;Ft(d)}finally{Ii()}}else if("number"==typeof M){var W=null,X=pT(l,c),me=-1,Pe=h&ft.Host?c[16][6]:null;for((-1===X||h&ft.SkipSelf)&&(-1!==(me=-1===X?Ny(l,c):c[X+8])&&gT(h,!1)?(W=c[1],X=hh(me),c=Np(me,c)):X=-1);-1!==X;){var Xe=c[1];if(vT(M,X,Xe.data)){var Qe=mT(X,c,d,W,h,Pe);if(Qe!==hT)return Qe}-1!==(me=c[X+8])&&gT(h,c[1].data[X+8]===Pe)&&vT(M,X,c)?(W=Xe,X=hh(me),c=Np(me,c)):X=-1}}}return Zy(c,d,h,y)}var hT={};function hD(){return new _d(ne(),Se())}function mT(l,c,d,h,y,M){var H=c[1],W=H.data[l+8],Pe=vh(W,H,d,null==h?xi(W)&&cT:h!=H&&0!=(3&W.type),y&ft.Host&&M===W);return null!==Pe?Nu(c,H,Pe,W):hT}function vh(l,c,d,h,y){for(var M=l.providerIndexes,H=c.data,W=1048575&M,X=l.directiveStart,Pe=M>>20,Qe=y?W+Pe:l.directiveEnd,mt=h?W:W+Pe;mt=X&&Mt.type===d)return mt}if(y){var zt=H[X];if(zt&&Fi(zt)&&zt.type===d)return X}return null}function Nu(l,c,d,h){var y=l[d],M=c.data;if(function(l){return l instanceof Xi}(y)){var H=y;H.resolving&&function(l,c){throw new le("200","Circular dependency in DI detected for ".concat(l).concat(""))}(it(M[d]));var W=Ry(H.canSeeViewProviders);H.resolving=!0;var X=H.injectImpl?Jt(H.injectImpl):null;nt(l,h,ft.Default);try{y=l[d]=H.factory(void 0,M,l,h),c.firstCreatePass&&d>=h.directiveStart&&function(l,c,d){var h=c.type.prototype,M=h.ngOnInit,H=h.ngDoCheck;if(h.ngOnChanges){var W=yl(c);(d.preOrderHooks||(d.preOrderHooks=[])).push(l,W),(d.preOrderCheckHooks||(d.preOrderCheckHooks=[])).push(l,W)}M&&(d.preOrderHooks||(d.preOrderHooks=[])).push(0-l,M),H&&((d.preOrderHooks||(d.preOrderHooks=[])).push(l,H),(d.preOrderCheckHooks||(d.preOrderCheckHooks=[])).push(l,H))}(d,M[d],c)}finally{null!==X&&Jt(X),Ry(W),H.resolving=!1,Ii()}}return y}function Dv(l){if("string"==typeof l)return l.charCodeAt(0)||0;var c=l.hasOwnProperty(jn)?l[jn]:void 0;return"number"==typeof c?c>=0?255&c:hD:c}function vT(l,c,d){return!!(d[c+(l>>5)]&1<=l.length?l.push(d):l.splice(c,0,d)}function Sd(l,c){return c>=l.length-1?l.pop():l.splice(c,1)[0]}function wc(l,c){for(var d=[],h=0;h=0?l[1|h]=d:function(l,c,d,h){var y=l.length;if(y==c)l.push(d,h);else if(1===y)l.push(h,l[0]),l[0]=d;else{for(y--,l.push(l[y-1],l[y]);y>c;)l[y]=l[y-2],y--;l[c]=d,l[c+1]=h}}(l,h=~h,c,d),h}function yh(l,c){var d=Td(l,c);if(d>=0)return l[1|d]}function Td(l,c){return function(l,c,d){for(var h=0,y=l.length>>d;y!==h;){var M=h+(y-h>>1),H=l[M<c?y=M:h=M+1}return~(y<1&&void 0!==arguments[1]?arguments[1]:ft.Default;if(void 0===Fp)throw new Error("inject() must be called from an injection context");return null===Fp?nn(l,void 0,c):Fp.get(l,c&ft.Optional?null:void 0,c)}function Wo(l){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft.Default;return(Kt()||SD)(ae(l),c)}var TD=Wo;function kd(l){for(var c=[],d=0;d3&&void 0!==arguments[3]?arguments[3]:null;l=l&&"\n"===l.charAt(0)&&"\u0275"==l.charAt(1)?l.substr(2):l;var y=j(c);if(Array.isArray(c))y=c.map(j).join(" -> ");else if("object"==typeof c){var M=[];for(var H in c)if(c.hasOwnProperty(H)){var W=c[H];M.push(H+":"+("string"==typeof W?JSON.stringify(W):j(W)))}y="{".concat(M.join(", "),"}")}return"".concat(d).concat(h?"("+h+")":"","[").concat(y,"]: ").concat(l.replace(El,"\n "))}("\n"+l.message,y,d,h),l.ngTokenPath=y,l[wd]=null,l}var Ch=Bp(Tc("Inject",function(c){return{token:c}}),-1),Lu=Bp(Tc("Optional"),8),Fu=Bp(Tc("SkipSelf"),4),Ec=function(l){return l[l.Important=1]="Important",l[l.DashCase=2]="DashCase",l}({}),au="__ngContext__";function Go(l,c){l[au]=c}function lu(l){var c=function(l){return l[au]||null}(l);return c?Array.isArray(c)?c:c.lView:null}function xh(l,c){return undefined(l,c)}function Pd(l){var c=l[3];return ho(c)?c[3]:c}function Xy(l){return $y(l[13])}function Eh(l){return $y(l[4])}function $y(l){for(;null!==l&&!ho(l);)l=l[4];return l}function Id(l,c,d,h,y){if(null!=h){var M,H=!1;ho(h)?M=h:pr(h)&&(H=!0,h=h[0]);var W=Vr(h);0===l&&null!==d?null==y?Ac(c,d,W):Hu(c,d,W,y||null,!0):1===l&&null!==d?Hu(c,d,W,y||null,!0):2===l?function(l,c,d){var h=du(l,c);h&&function(l,c,d,h){St(l)?l.removeChild(c,d,h):c.removeChild(d)}(l,h,c,d)}(c,W,H):3===l&&c.destroyNode(W),null!=M&&function(l,c,d,h,y){var M=d[7];M!==Vr(d)&&Id(c,l,h,M,y);for(var W=10;W0&&(l[d-1][4]=h[4]);var M=Sd(l,10+c);!function(l,c){Vp(l,c,c[11],2,null,null),c[0]=null,c[6]=null}(h[1],h);var H=M[19];null!==H&&H.detachView(M[1]),h[3]=null,h[4]=null,h[2]&=-129}return h}}function jv(l,c){if(!(256&c[2])){var d=c[11];St(d)&&d.destroyNode&&Vp(l,c,d,3,null,null),function(l){var c=l[13];if(!c)return cu(l[1],l);for(;c;){var d=null;if(pr(c))d=c[13];else{var h=c[10];h&&(d=h)}if(!d){for(;c&&!c[4]&&c!==l;)pr(c)&&cu(c[1],c),c=c[3];null===c&&(c=l),pr(c)&&cu(c[1],c),d=c&&c[4]}c=d}}(c)}}function cu(l,c){if(!(256&c[2])){c[2]&=-129,c[2]|=256,function(l,c){var d;if(null!=l&&null!=(d=l.destroyHooks))for(var h=0;h=0?h[y=me]():h[y=-me].unsubscribe(),M+=2}else{var Pe=h[y=d[M+1]];d[M].call(Pe)}if(null!==h){for(var Xe=y+1;Xe"+d;try{var h=(new window.DOMParser).parseFromString(Dc(d),"text/html").body;return null===h?this.inertDocumentHelper.getInertBodyElement(d):(h.removeChild(h.firstChild),h)}catch(y){return null}}}]),l}(),Qv=function(){function l(c){if((0,A.Z)(this,l),this.defaultDoc=c,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){var d=this.inertDocument.createElement("html");this.inertDocument.appendChild(d);var h=this.inertDocument.createElement("body");d.appendChild(h)}}return(0,D.Z)(l,[{key:"getInertBodyElement",value:function(d){var h=this.inertDocument.createElement("template");if("content"in h)return h.innerHTML=Dc(d),h;var y=this.inertDocument.createElement("body");return y.innerHTML=Dc(d),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(y),y}},{key:"stripCustomNsAttrs",value:function(d){for(var h=d.attributes,y=h.length-1;0"),!0}},{key:"endElement",value:function(d){var h=d.nodeName.toLowerCase();bb.hasOwnProperty(h)&&!Ih.hasOwnProperty(h)&&(this.buf.push(""))}},{key:"chars",value:function(d){this.buf.push(Pc(d))}},{key:"checkClobberedElement",value:function(d,h){if(h&&(d.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: ".concat(d.outerHTML));return h}}]),l}(),GT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ir=/([^\#-~ |!])/g;function Pc(l){return l.replace(/&/g,"&").replace(GT,function(c){return"&#"+(1024*(c.charCodeAt(0)-55296)+(c.charCodeAt(1)-56320)+65536)+";"}).replace(Ir,function(c){return"&#"+c.charCodeAt(0)+";"}).replace(//g,">")}function Tb(l,c){var d=null;try{$v=$v||function(l){var c=new Qv(l);return function(){try{return!!(new window.DOMParser).parseFromString(Dc(""),"text/html")}catch(l){return!1}}()?new _b(c):c}(l);var h=c?String(c):"";d=$v.getInertBodyElement(h);var y=5,M=h;do{if(0===y)throw new Error("Failed to sanitize html because the input is unstable");y--,h=M,M=d.innerHTML,d=$v.getInertBodyElement(h)}while(h!==M);return Dc((new UD).sanitizeChildren(Nh(d)||d))}finally{if(d)for(var X=Nh(d)||d;X.firstChild;)X.removeChild(X.firstChild)}}function Nh(l){return"content"in l&&function(l){return l.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===l.nodeName}(l)?l.content:null}var Fd=function(l){return l[l.NONE=0]="NONE",l[l.HTML=1]="HTML",l[l.STYLE=2]="STYLE",l[l.SCRIPT=3]="SCRIPT",l[l.URL=4]="URL",l[l.RESOURCE_URL=5]="RESOURCE_URL",l}({});function YT(l){var c=Zh();return c?Gv(c.sanitize(Fd.HTML,l)||""):Oc(l,"HTML")?Gv(Ps(l)):Tb(Re(),be(l))}function eg(l){var c=Zh();return c?c.sanitize(Fd.STYLE,l)||"":Oc(l,"Style")?Ps(l):be(l)}function Gp(l){var c=Zh();return c?c.sanitize(Fd.URL,l)||"":Oc(l,"URL")?Ps(l):ms(be(l))}function Zh(){var l=Se();return l&&l[12]}function ng(l){return l.ngOriginalError}function Yp(l){for(var c=arguments.length,d=new Array(c>1?c-1:0),h=1;hM?"":y[Xe+1].toLowerCase();var mt=8&h?Qe:null;if(mt&&-1!==ix(mt,me,0)||2&h&&me!==Qe){if(Il(h))return!1;H=!0}}}}else{if(!H&&!Il(h)&&!Il(X))return!1;if(H&&Il(X))continue;H=!1,h=X|1&h}}return Il(h)||H}function Il(l){return 0==(1&l)}function XD(l,c,d,h){if(null===c)return-1;var y=0;if(h||!d){for(var M=!1;y-1)for(d++;d2&&void 0!==arguments[2]&&arguments[2],h=0;h0?'="'+W+'"':"")+"]"}else 8&h?y+="."+H:4&h&&(y+=" "+H);else""!==y&&!Il(H)&&(c+=ux(M,y),y=""),h=H,M=M||!Il(h);d++}return""!==y&&(c+=ux(M,y)),c}var qr={};function tO(l){nO(ge(),Se(),Do()+l,Dn())}function nO(l,c,d,h){if(!h)if(3==(3&c[2])){var M=l.preOrderCheckHooks;null!==M&&Ru(c,M,d)}else{var H=l.preOrderHooks;null!==H&&Cc(c,H,0,d)}hs(d)}function Db(l,c){return l<<17|c<<2}function Rl(l){return l>>17&32767}function cx(l){return 2|l}function Nc(l){return(131068&l)>>2}function dx(l,c){return-131069&l|c<<2}function px(l){return 1|l}function yx(l,c){var d=l.contentQueries;if(null!==d)for(var h=0;h20&&nO(l,c,20,Dn()),d(h,y)}finally{hs(M)}}function cg(l,c,d){if(pa(c))for(var y=c.directiveEnd,M=c.directiveStart;M2&&void 0!==arguments[2]?arguments[2]:Mi,h=c.localNames;if(null!==h)for(var y=c.index+1,M=0;M0;){var d=l[--c];if("number"==typeof d&&d<0)return d}return 0})(W)!=X&&W.push(X),W.push(h,y,H)}}function wx(l,c){null!==l.hostBindings&&l.hostBindings(1,c)}function mO(l,c){c.flags|=2,(l.components||(l.components=[])).push(c.index)}function aF(l,c,d){if(d){if(c.exportAs)for(var h=0;h0&&Mx(d)}}function Mx(l){for(var c=Xy(l);null!==c;c=Eh(c))for(var d=10;d0&&Mx(h)}var H=l[1].components;if(null!==H)for(var W=0;W0&&Mx(X)}}function cF(l,c){var d=ya(c,l),h=d[1];(function(l,c){for(var d=c.length;d1&&void 0!==arguments[1]?arguments[1]:bh;if(h===bh){var y=new Error("NullInjectorError: No provider for ".concat(j(d),"!"));throw y.name="NullInjectorError",y}return h}}]),l}(),Ks=new No("Set Injector scope."),Vh={},xO={},t0=void 0;function Nx(){return void 0===t0&&(t0=new fg),t0}function Zx(l){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,h=arguments.length>3?arguments[3]:void 0;return new EO(l,d,c||Nx(),h)}var EO=function(){function l(c,d,h){var y=this,M=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;(0,A.Z)(this,l),this.parent=h,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;var H=[];d&&Os(d,function(X){return y.processProvider(X,c,d)}),Os([c],function(X){return y.processInjectorType(X,[],H)}),this.records.set(tf,nf(void 0,this));var W=this.records.get(Ks);this.scope=null!=W?W.value:null,this.source=M||("object"==typeof c?null:j(c))}return(0,D.Z)(l,[{key:"destroyed",get:function(){return this._destroyed}},{key:"destroy",value:function(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(function(d){return d.ngOnDestroy()})}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}},{key:"get",value:function(d){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bh,y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ft.Default;this.assertNotDestroyed();var M=Fv(this),H=Jt(void 0);try{if(!(y&ft.SkipSelf)){var W=this.records.get(d);if(void 0===W){var X=yF(d)&&wn(d);W=X&&this.injectableDefInScope(X)?nf(n0(d),Vh):null,this.records.set(d,W)}if(null!=W)return this.hydrate(d,W)}var me=y&ft.Self?Nx():this.parent;return me.get(d,h=y&ft.Optional&&h===bh?null:h)}catch(Xe){if("NullInjectorError"===Xe.name){var Pe=Xe[wd]=Xe[wd]||[];if(Pe.unshift(j(d)),M)throw Xe;return kT(Xe,d,"R3InjectorError",this.source)}throw Xe}finally{Jt(H),Fv(M)}}},{key:"_resolveInjectorDefTypes",value:function(){var d=this;this.injectorDefTypes.forEach(function(h){return d.get(h)})}},{key:"toString",value:function(){var d=[];return this.records.forEach(function(y,M){return d.push(j(M))}),"R3Injector[".concat(d.join(", "),"]")}},{key:"assertNotDestroyed",value:function(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}},{key:"processInjectorType",value:function(d,h,y){var M=this;if(!(d=ae(d)))return!1;var H=ve(d),W=null==H&&d.ngModule||void 0,X=void 0===W?d:W,Xe=-1!==y.indexOf(X);if(void 0!==W&&(H=ve(W)),null==H)return!1;if(null!=H.imports&&!Xe){var Qe;y.push(X);try{Os(H.imports,function(_n){M.processInjectorType(_n,h,y)&&(void 0===Qe&&(Qe=[]),Qe.push(_n))})}finally{}if(void 0!==Qe)for(var mt=function(Kn){var Lr=Qe[Kn],ei=Lr.ngModule,Di=Lr.providers;Os(Di,function(_o){return M.processProvider(_o,ei,Di||he)})},Mt=0;Mt0){var d=wc(c,"?");throw new Error("Can't resolve all parameters for ".concat(j(l),": (").concat(d.join(", "),")."))}var h=function(l){var c=l&&(l[ye]||l[we]);if(c){var d=function(l){if(l.hasOwnProperty("name"))return l.name;var c=(""+l).match(/^function\s*([^\s(]+)/);return null===c?"":c[1]}(l);return console.warn('DEPRECATED: DI is instantiating a token "'.concat(d,'" that inherits its @Injectable decorator but does not provide one itself.\n')+'This will become an error in a future version of Angular. Please add @Injectable() to the "'.concat(d,'" class.')),c}return null}(l);return null!==h?function(){return h.factory(l)}:function(){return new l}}(l);throw new Error("unreachable")}function za(l,c,d){var h=void 0;if(qh(l)){var y=ae(l);return Ka(y)||n0(y)}if(Lx(l))h=function(){return ae(l.useValue)};else if(function(l){return!(!l||!l.useFactory)}(l))h=function(){return l.useFactory.apply(l,(0,_.Z)(kd(l.deps||[])))};else if(function(l){return!(!l||!l.useExisting)}(l))h=function(){return Wo(ae(l.useExisting))};else{var M=ae(l&&(l.useClass||l.provide));if(!function(l){return!!l.deps}(l))return Ka(M)||n0(M);h=function(){return(0,I.Z)(M,(0,_.Z)(kd(l.deps)))}}return h}function nf(l,c){var d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{factory:l,value:c,multi:d?[]:void 0}}function Lx(l){return null!==l&&"object"==typeof l&&Lv in l}function qh(l){return"function"==typeof l}function yF(l){return"function"==typeof l||"object"==typeof l&&l instanceof No}var MO=function(l,c,d){return function(l){var y=Zx(l,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0);return y._resolveInjectorDefTypes(),y}({name:d},c,l,d)},Ia=function(){var l=function(){function c(){(0,A.Z)(this,c)}return(0,D.Z)(c,null,[{key:"create",value:function(h,y){return Array.isArray(h)?MO(h,y,""):MO(h.providers,h.parent,h.name||"")}}]),c}();return l.THROW_IF_NOT_FOUND=bh,l.NULL=new fg,l.\u0275prov=Rn({token:l,providedIn:"any",factory:function(){return Wo(tf)}}),l.__NG_ELEMENT_ID__=-1,l}();function u0(l,c){jo(lu(l)[1],ne())}function c0(l){for(var c=function(l){return Object.getPrototypeOf(l.prototype).constructor}(l.type),d=!0,h=[l];c;){var y=void 0;if(Fi(l))y=c.\u0275cmp||c.\u0275dir;else{if(c.\u0275cmp)throw new Error("Directives cannot inherit Components");y=c.\u0275dir}if(y){if(d){h.push(y);var M=l;M.inputs=p0(l.inputs),M.declaredInputs=p0(l.declaredInputs),M.outputs=p0(l.outputs);var H=y.hostBindings;H&&GO(l,H);var W=y.viewQuery,X=y.contentQueries;if(W&&zO(l,W),X&&WO(l,X),K(l.inputs,y.inputs),K(l.declaredInputs,y.declaredInputs),K(l.outputs,y.outputs),Fi(y)&&y.data.animation){var me=l.data;me.animation=(me.animation||[]).concat(y.data.animation)}}var Pe=y.features;if(Pe)for(var Xe=0;Xe=0;h--){var y=l[h];y.hostVars=c+=y.hostVars,y.hostAttrs=Iy(y.hostAttrs,d=Iy(d,y.hostAttrs))}}(h)}function p0(l){return l===rt?{}:l===he?[]:l}function zO(l,c){var d=l.viewQuery;l.viewQuery=d?function(h,y){c(h,y),d(h,y)}:c}function WO(l,c){var d=l.contentQueries;l.contentQueries=d?function(h,y,M){c(h,y,M),d(h,y,M)}:c}function GO(l,c){var d=l.hostBindings;l.hostBindings=d?function(h,y){c(h,y),d(h,y)}:c}var vg=null;function Gu(){if(!vg){var l=Rt.Symbol;if(l&&l.iterator)vg=l.iterator;else for(var c=Object.getOwnPropertyNames(Map.prototype),d=0;d1&&void 0!==arguments[1]?arguments[1]:ft.Default,d=Se();if(null===d)return Wo(l,c);var h=ne();return Av(h,d,ae(l),c)}function Sg(l,c,d){var h=Se();return Wa(h,br(),c)&&Rs(ge(),oo(),h,l,c,h[11],d,!1),Sg}function w0(l,c,d,h,y){var H=y?"class":"style";Rx(l,d,c.inputs[H],H,h)}function E0(l,c,d,h){var y=Se(),M=ge(),H=20+l,W=y[11],X=y[H]=Rd(W,c,Mr.lFrame.currentNamespace),me=M.firstCreatePass?function(l,c,d,h,y,M,H){var W=c.consts,me=Kp(c,l,2,y,Ws(W,M));return Jb(c,d,me,Ws(W,H)),null!==me.attrs&&pg(me,me.attrs,!1),null!==me.mergedAttrs&&pg(me,me.mergedAttrs,!0),null!==c.queries&&c.queries.elementStart(c,me),me}(H,M,y,0,c,d,h):M.data[H];lt(me,!0);var Pe=me.mergedAttrs;null!==Pe&&Ys(W,X,Pe);var Xe=me.classes;null!==Xe&&cb(W,X,Xe);var Qe=me.styles;null!==Qe&&ub(W,X,Qe),64!=(64&me.flags)&&ab(M,y,X,me),0===Mr.lFrame.elementDepthCount&&Go(X,y),Mr.lFrame.elementDepthCount++,So(me)&&(Vb(M,y,me),cg(M,me,y)),null!==h&&qb(y,me)}function k0(){var l=ne();wt()?Zt():lt(l=l.parent,!1);var c=l;Mr.lFrame.elementDepthCount--;var d=ge();d.firstCreatePass&&(jo(d,l),pa(l)&&d.queries.elementEnd(l)),null!=c.classesWithoutHost&&function(l){return 0!=(16&l.flags)}(c)&&w0(d,c,Se(),c.classesWithoutHost,!0),null!=c.stylesWithoutHost&&function(l){return 0!=(32&l.flags)}(c)&&w0(d,c,Se(),c.stylesWithoutHost,!1)}function pf(l,c,d,h){E0(l,c,d,h),k0()}function Tg(l,c,d){var h=Se(),y=ge(),M=l+20,H=y.firstCreatePass?function(l,c,d,h,y){var M=c.consts,H=Ws(M,h),W=Kp(c,l,8,"ng-container",H);return null!==H&&pg(W,H,!0),Jb(c,d,W,Ws(M,y)),null!==c.queries&&c.queries.elementStart(c,W),W}(M,y,h,c,d):y.data[M];lt(H,!0);var W=h[M]=h[11].createComment("");ab(y,h,W,H),Go(W,h),So(H)&&(Vb(y,h,H),cg(y,H,h)),null!=d&&qb(h,H)}function Vc(){var l=ne(),c=ge();wt()?Zt():lt(l=l.parent,!1),c.firstCreatePass&&(jo(c,l),pa(l)&&c.queries.elementEnd(l))}function lw(l,c,d){Tg(l,c,d),Vc()}function uw(){return Se()}function M0(l){return!!l&&"function"==typeof l.then}function A0(l){return!!l&&"function"==typeof l.subscribe}var D0=A0;function O0(l,c,d,h){var y=Se(),M=ge(),H=ne();return Gh(M,y,y[11],H,l,c,!!d,h),O0}function P0(l,c){var d=ne(),h=Se(),y=ge();return Gh(y,h,$b(Ye(y.data),d,h),d,l,c,!1),P0}function Gh(l,c,d,h,y,M,H,W){var X=So(h),Pe=l.firstCreatePass&&Px(l),Xe=c[8],Qe=Ox(c),mt=!0;if(3&h.type||W){var Mt=Mi(h,c),zt=W?W(Mt):Mt,hn=Qe.length,En=W?function(sl){return W(Vr(sl[h.index]))}:h.index;if(St(d)){var _n=null;if(!W&&X&&(_n=function(l,c,d,h){var y=l.cleanup;if(null!=y)for(var M=0;MX?W[X]:null}"string"==typeof H&&(M+=2)}return null}(l,c,y,h.index)),null!==_n)(_n.__ngLastListenerFn__||_n).__ngNextListenerFn__=M,_n.__ngLastListenerFn__=M,mt=!1;else{M=R0(h,c,Xe,M,!1);var Lr=d.listen(zt,y,M);Qe.push(M,Lr),Pe&&Pe.push(y,En,hn,hn+1)}}else M=R0(h,c,Xe,M,!0),zt.addEventListener(y,M,H),Qe.push(M),Pe&&Pe.push(y,En,hn,H)}else M=R0(h,c,Xe,M,!1);var Di,ei=h.outputs;if(mt&&null!==ei&&(Di=ei[y])){var _o=Di.length;if(_o)for(var Ni=0;Ni<_o;Ni+=2){var Jc=c[Di[Ni]][Di[Ni+1]].subscribe(M),jl=Qe.length;Qe.push(M,Jc),Pe&&Pe.push(y,h.index,jl,-(jl+1))}}}function I0(l,c,d,h){try{return!1!==d(h)}catch(y){return Ix(l,y),!1}}function R0(l,c,d,h,y){return function M(H){if(H===Function)return h;var W=2&l.flags?ya(l.index,c):c;0==(32&c[2])&&Ax(W);for(var X=I0(c,0,h,H),me=M.__ngNextListenerFn__;me;)X=I0(c,0,me,H)&&X,me=me.__ngNextListenerFn__;return y&&!1===X&&(H.preventDefault(),H.returnValue=!1),X}}function dw(){var l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Da(l)}function TP(l,c){for(var d=null,h=function(l){var c=l.attrs;if(null!=c){var d=c.indexOf(5);if(0==(1&d))return c[d+1]}return null}(l),y=0;y1&&void 0!==arguments[1]?arguments[1]:0,d=arguments.length>2?arguments[2]:void 0,h=Se(),y=ge(),M=Kp(y,20+l,16,null,d||null);null===M.projection&&(M.projection=c),Zt(),64!=(64&M.flags)&&RD(y,h,M)}function Z0(l,c,d){return wg(l,"",c,"",d),Z0}function wg(l,c,d,h,y){var M=Se(),H=Uc(M,c,d,h);return H!==qr&&Rs(ge(),oo(),M,l,H,M[11],y,!1),wg}function L0(l,c,d,h,y,M,H){var W=Se(),X=sf(W,c,d,h,y,M);return X!==qr&&Rs(ge(),oo(),W,l,X,W[11],H,!1),L0}function hw(l,c,d,h,y){for(var M=l[d+1],H=null===c,W=h?Rl(M):Nc(M),X=!1;0!==W&&(!1===X||H);){var Pe=l[W+1];mw(l[W],c)&&(X=!0,l[W+1]=h?px(Pe):cx(Pe)),W=h?Rl(Pe):Nc(Pe)}X&&(l[d+1]=h?cx(M):px(M))}function mw(l,c){return null===l||null==c||(Array.isArray(l)?l[1]:l)===c||!(!Array.isArray(l)||"string"!=typeof c)&&Td(l,c)>=0}var Yo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function q0(l){return l.substring(Yo.key,Yo.keyEnd)}function vw(l){return l.substring(Yo.value,Yo.valueEnd)}function gw(l,c){var d=Yo.textEnd;return d===c?-1:(c=Yo.keyEnd=function(l,c,d){for(;c32;)c++;return c}(l,Yo.key=c,d),ff(l,c,d))}function yw(l,c){var d=Yo.textEnd,h=Yo.key=ff(l,c,d);return d===h?-1:(h=Yo.keyEnd=function(l,c,d){for(var h;c=65&&(-33&h)<=90||h>=48&&h<=57);)c++;return c}(l,h,d),h=Sw(l,h,d),h=Yo.value=ff(l,h,d),h=Yo.valueEnd=function(l,c,d){for(var h=-1,y=-1,M=-1,H=c,W=H;H32&&(W=H),M=y,y=h,h=-33&X}return W}(l,h,d),Sw(l,h,d))}function bw(l){Yo.key=0,Yo.keyEnd=0,Yo.value=0,Yo.valueEnd=0,Yo.textEnd=l.length}function ff(l,c,d){for(;c=0;d=yw(c,d))G0(l,q0(c),vw(c))}function z0(l){tl(es,Fl,l,!0)}function Fl(l,c){for(var d=function(l){return bw(l),gw(l,ff(l,0,Yo.textEnd))}(c);d>=0;d=gw(c,d))es(l,q0(c),!0)}function el(l,c,d,h){var y=Se(),M=ge(),H=wr(2);M.firstUpdatePass&&ww(M,l,H,h),c!==qr&&Wa(y,H,c)&&Y0(M,M.data[Do()],y,y[11],l,y[H+1]=function(l,c){return null==l||("string"==typeof c?l+=c:"object"==typeof l&&(l=j(Ps(l)))),l}(c,d),h,H)}function tl(l,c,d,h){var y=ge(),M=wr(2);y.firstUpdatePass&&ww(y,null,M,h);var H=Se();if(d!==qr&&Wa(H,M,d)){var W=y.data[Do()];if(kw(W,h)&&!W0(y,M)){var me=h?W.classesWithoutHost:W.stylesWithoutHost;null!==me&&(d=J(me,d||"")),w0(y,W,H,d,h)}else!function(l,c,d,h,y,M,H,W){y===qr&&(y=he);for(var X=0,me=0,Pe=0=l.expandoStartIndex}function ww(l,c,d,h){var y=l.data;if(null===y[d+1]){var M=y[Do()],H=W0(l,d);kw(M,h)&&null===c&&!H&&(c=!1),c=function(l,c,d,h){var y=Ye(l),M=h?c.residualClasses:c.residualStyles;if(null===y)0===(h?c.classBindings:c.styleBindings)&&(d=vu(d=kg(null,l,c,d,h),c.attrs,h),M=null);else{var W=c.directiveStylingLast;if(-1===W||l[W]!==y)if(d=kg(y,l,c,d,h),null===M){var me=function(l,c,d){var h=d?c.classBindings:c.styleBindings;if(0!==Nc(h))return l[Rl(h)]}(l,c,h);void 0!==me&&Array.isArray(me)&&function(l,c,d,h){l[Rl(d?c.classBindings:c.styleBindings)]=h}(l,c,h,me=vu(me=kg(null,l,c,me[1],h),c.attrs,h))}else M=function(l,c,d){for(var h=void 0,y=c.directiveEnd,M=1+c.directiveStylingLast;M0)&&(me=!0):Pe=d,y)if(0!==X){var mt=Rl(l[W+1]);l[h+1]=Db(mt,W),0!==mt&&(l[mt+1]=dx(l[mt+1],h)),l[W+1]=function(l,c){return 131071&l|c<<17}(l[W+1],h)}else l[h+1]=Db(W,0),0!==W&&(l[W+1]=dx(l[W+1],h)),W=h;else l[h+1]=Db(X,0),0===W?W=h:l[X+1]=dx(l[X+1],h),X=h;me&&(l[h+1]=cx(l[h+1])),hw(l,Pe,h,!0),hw(l,Pe,h,!1),function(l,c,d,h,y){var M=y?l.residualClasses:l.residualStyles;null!=M&&"string"==typeof c&&Td(M,c)>=0&&(d[h+1]=px(d[h+1]))}(c,Pe,l,h,M),H=Db(W,X),M?c.classBindings=H:c.styleBindings=H}(y,M,c,d,H,h)}}function kg(l,c,d,h,y){var M=null,H=d.directiveEnd,W=d.directiveStylingLast;for(-1===W?W=d.directiveStart:W++;W0;){var X=l[y],me=Array.isArray(X),Pe=me?X[1]:X,Xe=null===Pe,Qe=d[y+1];Qe===qr&&(Qe=Xe?he:void 0);var mt=Xe?yh(Qe,h):Pe===h?Qe:void 0;if(me&&!Yh(mt)&&(mt=yh(X,h)),Yh(mt)&&(W=mt,H))return W;var Mt=l[y+1];y=H?Rl(Mt):Nc(Mt)}if(null!==c){var zt=M?c.residualClasses:c.residualStyles;null!=zt&&(W=yh(zt,h))}return W}function Yh(l){return void 0!==l}function kw(l,c){return 0!=(l.flags&(c?16:32))}function Mw(l){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d=Se(),h=ge(),y=l+20,M=h.firstCreatePass?Kp(h,y,1,c,null):h.data[y],H=d[y]=qv(d[11],c);ab(h,d,H,M),lt(M,!1)}function Q0(l){return Mg("",l,""),Q0}function Mg(l,c,d){var h=Se(),y=Uc(h,l,c,d);return y!==qr&&Wu(h,Do(),y),Mg}function Ag(l,c,d,h,y){var M=Se(),H=sf(M,l,c,d,h,y);return H!==qr&&Wu(M,Do(),H),Ag}function K0(l,c,d,h,y,M,H){var W=Se(),X=Hc(W,l,c,d,h,y,M,H);return X!==qr&&Wu(W,Do(),X),K0}function ZP(l,c,d){tl(es,Fl,Uc(Se(),l,c,d),!0)}function Lw(l,c,d){var h=Se();return Wa(h,br(),c)&&Rs(ge(),oo(),h,l,c,h[11],d,!0),Lw}function Fw(l,c,d){var h=Se();if(Wa(h,br(),c)){var M=ge(),H=oo();Rs(M,H,h,l,c,$b(Ye(M.data),H,h),d,!0)}return Fw}var hf=void 0,$F=["en",[["a","p"],["AM","PM"],hf],[["AM","PM"],hf,hf],[["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"]],hf,[["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"]],hf,[["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}",hf,"{1} 'at' {0}",hf],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(l){var c=Math.floor(Math.abs(l)),d=l.toString().replace(/^[^.]*\.?/,"").length;return 1===c&&0===d?1:5}],Jh={};function Bw(l){var c=function(l){return l.toLowerCase().replace(/_/g,"-")}(l),d=Uw(c);if(d)return d;var h=c.split("-")[0];if(d=Uw(h))return d;if("en"===h)return $F;throw new Error('Missing locale data for the locale "'.concat(l,'".'))}function YP(l){return Bw(l)[Dg.PluralCase]}function Uw(l){return l in Jh||(Jh[l]=Rt.ng&&Rt.ng.common&&Rt.ng.common.locales&&Rt.ng.common.locales[l]),Jh[l]}var Dg=function(l){return l[l.LocaleId=0]="LocaleId",l[l.DayPeriodsFormat=1]="DayPeriodsFormat",l[l.DayPeriodsStandalone=2]="DayPeriodsStandalone",l[l.DaysFormat=3]="DaysFormat",l[l.DaysStandalone=4]="DaysStandalone",l[l.MonthsFormat=5]="MonthsFormat",l[l.MonthsStandalone=6]="MonthsStandalone",l[l.Eras=7]="Eras",l[l.FirstDayOfWeek=8]="FirstDayOfWeek",l[l.WeekendRange=9]="WeekendRange",l[l.DateFormat=10]="DateFormat",l[l.TimeFormat=11]="TimeFormat",l[l.DateTimeFormat=12]="DateTimeFormat",l[l.NumberSymbols=13]="NumberSymbols",l[l.NumberFormats=14]="NumberFormats",l[l.CurrencyCode=15]="CurrencyCode",l[l.CurrencySymbol=16]="CurrencySymbol",l[l.CurrencyName=17]="CurrencyName",l[l.Currencies=18]="Currencies",l[l.Directionality=19]="Directionality",l[l.PluralCase=20]="PluralCase",l[l.ExtraData=21]="ExtraData",l}({}),X0="en-US";function Hw(l){en(l,"Expected localeId to be defined"),"string"==typeof l&&l.toLowerCase().replace(/_/g,"-")}function EI(l,c,d){var h=ge();if(h.firstCreatePass){var y=Fi(l);rE(d,h.data,h.blueprint,y,!0),rE(c,h.data,h.blueprint,y,!1)}}function rE(l,c,d,h,y){if(l=ae(l),Array.isArray(l))for(var M=0;M>20;if(qh(l)||!l.multi){var Mt=new Xi(me,y,Wh),zt=iE(X,c,y?Xe:Xe+mt,Qe);-1===zt?(Mv(mh(Pe,W),H,X),Qh(H,l,c.length),c.push(X),Pe.directiveStart++,Pe.directiveEnd++,y&&(Pe.providerIndexes+=1048576),d.push(Mt),W.push(Mt)):(d[zt]=Mt,W[zt]=Mt)}else{var hn=iE(X,c,Xe+mt,Qe),En=iE(X,c,Xe,Xe+mt),Kn=En>=0&&d[En];if(y&&!Kn||!y&&!(hn>=0&&d[hn])){Mv(mh(Pe,W),H,X);var Lr=function(l,c,d,h,y){var M=new Xi(l,d,Wh);return M.multi=[],M.index=c,M.componentProviders=0,oC(M,y,h&&!d),M}(y?kB:EB,d.length,y,h,me);!y&&Kn&&(d[En].providerFactory=Lr),Qh(H,l,c.length,0),c.push(X),Pe.directiveStart++,Pe.directiveEnd++,y&&(Pe.providerIndexes+=1048576),d.push(Lr),W.push(Lr)}else Qh(H,l,hn>-1?hn:En,oC(d[y?En:hn],me,!y&&h));!y&&h&&Kn&&d[En].componentProviders++}}}function Qh(l,c,d,h){var y=qh(c);if(y||function(l){return!!l.useClass}(c)){var H=(c.useClass||c).prototype.ngOnDestroy;if(H){var W=l.destroyHooks||(l.destroyHooks=[]);if(!y&&c.multi){var X=W.indexOf(d);-1===X?W.push(d,[h,H]):W[X+1].push(h,H)}else W.push(d,H)}}}function oC(l,c,d){return d&&l.componentProviders++,l.multi.push(c)-1}function iE(l,c,d,h){for(var y=d;y1&&void 0!==arguments[1]?arguments[1]:[];return function(d){d.providersResolver=function(h,y){return EI(h,y?y(l):l,c)}}}var MB=function l(){(0,A.Z)(this,l)},aE=function l(){(0,A.Z)(this,l)},DB=function(){function l(){(0,A.Z)(this,l)}return(0,D.Z)(l,[{key:"resolveComponentFactory",value:function(d){throw function(l){var c=Error("No component factory found for ".concat(j(l),". Did you add it to @NgModule.entryComponents?"));return c.ngComponent=l,c}(d)}}]),l}(),Ng=function(){var l=function c(){(0,A.Z)(this,c)};return l.NULL=new DB,l}();function aC(){}function Kh(l,c){return new vf(Mi(l,c))}var RB=function(){return Kh(ne(),Se())},vf=function(){var l=function c(d){(0,A.Z)(this,c),this.nativeElement=d};return l.__NG_ELEMENT_ID__=RB,l}();function DI(l){return l instanceof vf?l.nativeElement:l}var sC=function l(){(0,A.Z)(this,l)},sE=function(){var l=function c(){(0,A.Z)(this,c)};return l.__NG_ELEMENT_ID__=function(){return LB()},l}(),LB=function(){var l=Se(),d=ya(ne().index,l);return function(l){return l[11]}(pr(d)?d:l)},lC=function(){var l=function c(){(0,A.Z)(this,c)};return l.\u0275prov=Rn({token:l,providedIn:"root",factory:function(){return null}}),l}(),lE=function l(c){(0,A.Z)(this,l),this.full=c,this.major=c.split(".")[0],this.minor=c.split(".")[1],this.patch=c.split(".").slice(2).join(".")},uE=new lE("12.2.17"),II=function(){function l(){(0,A.Z)(this,l)}return(0,D.Z)(l,[{key:"supports",value:function(d){return zh(d)}},{key:"create",value:function(d){return new UB(d)}}]),l}(),FB=function(c,d){return d},UB=function(){function l(c){(0,A.Z)(this,l),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=c||FB}return(0,D.Z)(l,[{key:"forEachItem",value:function(d){var h;for(h=this._itHead;null!==h;h=h._next)d(h)}},{key:"forEachOperation",value:function(d){for(var h=this._itHead,y=this._removalsHead,M=0,H=null;h||y;){var W=!y||h&&h.currentIndex4&&void 0!==arguments[4]&&arguments[4];null!==d;){var M=c[d.index];if(null!==M&&h.push(Vr(M)),ho(M))for(var H=10;H-1&&(tb(d,y),Sd(h,y))}this._attachedToViewContainer=!1}jv(this._lView[1],this._lView)}},{key:"onDestroy",value:function(d){bx(this._lView[1],this._lView,null,d)}},{key:"markForCheck",value:function(){Ax(this._cdRefInjectingView||this._lView)}},{key:"detach",value:function(){this._lView[2]&=-129}},{key:"reattach",value:function(){this._lView[2]|=128}},{key:"detectChanges",value:function(){Xb(this._lView[1],this._lView,this.context)}},{key:"checkNoChanges",value:function(){!function(l,c,d){Un(!0);try{Xb(l,c,d)}finally{Un(!1)}}(this._lView[1],this._lView,this.context)}},{key:"attachToViewContainerRef",value:function(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}},{key:"detachFromAppRef",value:function(){this._appRef=null,function(l,c){Vp(l,c,c[11],2,null,null)}(this._lView[1],this._lView)}},{key:"attachToAppRef",value:function(d){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=d}}]),l}(),UI=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h){var y;return(0,A.Z)(this,d),(y=c.call(this,h))._view=h,y}return(0,D.Z)(d,[{key:"detectChanges",value:function(){bO(this._view)}},{key:"checkNoChanges",value:function(){!function(l){Un(!0);try{bO(l)}finally{Un(!1)}}(this._view)}},{key:"context",get:function(){return null}}]),d}(gf),qB=function(l){return function(l,c,d){if(xi(l)&&!d){var h=ya(l.index,c);return new gf(h,h)}return 47&l.type?new gf(c[16],c):null}(ne(),Se(),16==(16&l))},pE=function(){var l=function c(){(0,A.Z)(this,c)};return l.__NG_ELEMENT_ID__=qB,l}(),zB=[new uC],GB=new Lg([new II]),YB=new Xh(zB),fE=function(){return _f(ne(),Se())},Fg=function(){var l=function c(){(0,A.Z)(this,c)};return l.__NG_ELEMENT_ID__=fE,l}(),cC=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h,y,M){var H;return(0,A.Z)(this,d),(H=c.call(this))._declarationLView=h,H._declarationTContainer=y,H.elementRef=M,H}return(0,D.Z)(d,[{key:"createEmbeddedView",value:function(y){var M=this._declarationTContainer.tViews,H=Bh(this._declarationLView,M,y,16,null,M.declTNode,null,null,null,null);H[17]=this._declarationLView[this._declarationTContainer.index];var X=this._declarationLView[19];return null!==X&&(H[19]=X.createEmbeddedView(M)),$p(M,H,y),new gf(H)}}]),d}(Fg);function _f(l,c){return 4&l.type?new cC(c,l,Kh(l,c)):null}var Yd=function l(){(0,A.Z)(this,l)},dC=function l(){(0,A.Z)(this,l)},zI=function(){return fC(ne(),Se())},Bg=function(){var l=function c(){(0,A.Z)(this,c)};return l.__NG_ELEMENT_ID__=zI,l}(),WI=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h,y,M){var H;return(0,A.Z)(this,d),(H=c.call(this))._lContainer=h,H._hostTNode=y,H._hostLView=M,H}return(0,D.Z)(d,[{key:"element",get:function(){return Kh(this._hostTNode,this._hostLView)}},{key:"injector",get:function(){return new _d(this._hostTNode,this._hostLView)}},{key:"parentInjector",get:function(){var y=Ny(this._hostTNode,this._hostLView);if(cD(y)){var M=Np(y,this._hostLView),H=hh(y);return new _d(M[1].data[H+8],M)}return new _d(null,this._hostLView)}},{key:"clear",value:function(){for(;this.length>0;)this.remove(this.length-1)}},{key:"get",value:function(y){var M=GI(this._lContainer);return null!==M&&M[y]||null}},{key:"length",get:function(){return this._lContainer.length-10}},{key:"createEmbeddedView",value:function(y,M,H){var W=y.createEmbeddedView(M||{});return this.insert(W,H),W}},{key:"createComponent",value:function(y,M,H,W,X){var me=H||this.parentInjector;if(!X&&null==y.ngModule&&me){var Pe=me.get(Yd,null);Pe&&(X=Pe)}var Xe=y.create(me,W,void 0,X);return this.insert(Xe.hostView,M),Xe}},{key:"insert",value:function(y,M){var H=y._lView,W=H[1];if(function(l){return ho(l[3])}(H)){var X=this.indexOf(y);if(-1!==X)this.detach(X);else{var me=H[3],Pe=new WI(me,me[6],me[3]);Pe.detach(Pe.indexOf(y))}}var Xe=this._adjustIndex(M),Qe=this._lContainer;!function(l,c,d,h){var y=10+h,M=d.length;h>0&&(d[y-1][4]=c),h1&&void 0!==arguments[1]?arguments[1]:0;return null==y?this.length+M:y}}]),d}(Bg);function GI(l){return l[8]}function mE(l){return l[8]||(l[8]=[])}function fC(l,c){var d,h=c[l.index];if(ho(h))d=h;else{var y;if(8&l.type)y=Vr(h);else{var M=c[11];y=M.createComment("");var H=Mi(l,c);Hu(M,du(M,H),y,function(l,c){return St(l)?l.nextSibling(c):c.nextSibling}(M,H),!1)}c[l.index]=d=_O(h,c,y,l),Kb(c,d)}return new WI(d,l,c)}var Xd={},IE=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h){var y;return(0,A.Z)(this,d),(y=c.call(this)).ngModule=h,y}return(0,D.Z)(d,[{key:"resolveComponentFactory",value:function(y){var M=vi(y);return new MC(M,this.ngModule)}}]),d}(Ng);function Xg(l){var c=[];for(var d in l)l.hasOwnProperty(d)&&c.push({propName:l[d],templateName:d});return c}var NE=new No("SCHEDULER_TOKEN",{providedIn:"root",factory:function(){return ex}}),MC=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h,y){var M;return(0,A.Z)(this,d),(M=c.call(this)).componentDef=h,M.ngModule=y,M.componentType=h.type,M.selector=function(l){return l.map(eO).join(",")}(h.selectors),M.ngContentSelectors=h.ngContentSelectors?h.ngContentSelectors:[],M.isBoundToModule=!!y,M}return(0,D.Z)(d,[{key:"inputs",get:function(){return Xg(this.componentDef.inputs)}},{key:"outputs",get:function(){return Xg(this.componentDef.outputs)}},{key:"create",value:function(y,M,H,W){var _n,Kn,X=(W=W||this.ngModule)?function(l,c){return{get:function(h,y,M){var H=l.get(h,Xd,M);return H!==Xd||y===Xd?H:c.get(h,y,M)}}}(y,W.injector):y,me=X.get(sC,gt),Pe=X.get(lC,null),Xe=me.createRenderer(null,this.componentDef),Qe=this.componentDef.selectors[0][0]||"div",mt=H?function(l,c,d){if(St(l))return l.selectRootElement(c,d===Cn.ShadowDom);var y="string"==typeof c?l.querySelector(c):c;return y.textContent="",y}(Xe,H,this.componentDef.encapsulation):Rd(me.createRenderer(null,this.componentDef),Qe,function(l){var c=l.toLowerCase();return"svg"===c?ie:"math"===c?"http://www.w3.org/1998/MathML/":null}(Qe)),Mt=this.componentDef.onPush?576:528,zt=function(l,c){return{components:[],scheduler:l||ex,clean:SO,playerHandler:c||null,flags:0}}(),hn=Uh(0,null,null,1,0,null,null,null,null,null),En=Bh(null,hn,zt,Mt,null,null,me,Xe,Pe,X);Tt(En);try{var Lr=function(l,c,d,h,y,M){var H=d[1];d[20]=l;var X=Kp(H,20,2,"#host",null),me=X.mergedAttrs=c.hostAttrs;null!==me&&(pg(X,me,!0),null!==l&&(Ys(y,l,me),null!==X.classes&&cb(y,l,X.classes),null!==X.styles&&ub(y,l,X.styles)));var Pe=h.createRenderer(l,c),Xe=Bh(d,jb(c),null,c.onPush?64:16,d[20],X,h,Pe,M||null,null);return H.firstCreatePass&&(Mv(mh(X,d),H,c.type),mO(H,X),vO(X,d.length,1)),Kb(d,Xe),d[20]=Xe}(mt,this.componentDef,En,me,Xe);if(mt)if(H)Ys(Xe,mt,["ng-version",uE.full]);else{var ei=function(l){for(var c=[],d=[],h=1,y=2;h0&&cb(Xe,mt,_o.join(" "))}if(Kn=Aa(hn,20),void 0!==M)for(var Ni=Kn.projection=[],la=0;la1&&void 0!==arguments[1]?arguments[1]:Ia.THROW_IF_NOT_FOUND,H=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ft.Default;return y===Ia||y===Yd||y===tf?this:this._r3Injector.get(y,M,H)}},{key:"destroy",value:function(){var y=this._r3Injector;!y.destroyed&&y.destroy(),this.destroyCbs.forEach(function(M){return M()}),this.destroyCbs=null}},{key:"onDestroy",value:function(y){this.destroyCbs.push(y)}}]),d}(Yd),e_=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(h){var y;return(0,A.Z)(this,d),(y=c.call(this)).moduleType=h,null!==fi(h)&&function(l){var c=new Set;!function d(h){var y=fi(h,!0),M=y.id;null!==M&&(function(l,c,d){if(c&&c!==d)throw new Error("Duplicate module registered for ".concat(l," - ").concat(j(c)," vs ").concat(j(c.name)))}(M,qc.get(M),h),qc.set(M,h));var me,W=Pl(y.imports),X=(0,b.Z)(W);try{for(X.s();!(me=X.n()).done;){var Pe=me.value;c.has(Pe)||(c.add(Pe),d(Pe))}}catch(Xe){X.e(Xe)}finally{X.f()}}(l)}(h),y}return(0,D.Z)(d,[{key:"create",value:function(y){return new x3(this.moduleType,y)}}]),d}(dC);function BE(l,c,d){var h=Qn()+l,y=Se();return y[h]===qr?Ll(y,h,d?c.call(d):c()):function(l,c){return l[c]}(y,h)}function w3(l,c,d,h){return VE(Se(),Qn(),l,c,d,h)}function t_(l,c,d,h,y){return so(Se(),Qn(),l,c,d,h,y)}function Cf(l,c){var d=l[c];return d===qr?void 0:d}function VE(l,c,d,h,y,M){var H=c+d;return Wa(l,H,y)?Ll(l,H+1,M?h.call(M,y):h(y)):Cf(l,H+1)}function so(l,c,d,h,y,M,H){var W=c+d;return Vd(l,W,y,M)?Ll(l,W+2,H?h.call(H,y,M):h(y,M)):Cf(l,W+2)}function n_(l,c){var h,d=ge(),y=l+20;d.firstCreatePass?(h=function(l,c){if(c)for(var d=c.length-1;d>=0;d--){var h=c[d];if(l===h.name)return h}throw new le("302","The pipe '".concat(l,"' could not be found!"))}(c,d.pipeRegistry),d.data[y]=h,h.onDestroy&&(d.destroyHooks||(d.destroyHooks=[])).push(y,h.onDestroy)):h=d.data[y];var M=h.factory||(h.factory=Ka(h.type)),H=Jt(Wh);try{var W=Ry(!1),X=M();return Ry(W),function(l,c,d,h){d>=l.data.length&&(l.data[d]=null,l.blueprint[d]=null),c[d]=h}(d,Se(),y,X),X}finally{Jt(H)}}function qE(l,c,d){var h=l+20,y=Se(),M=Xa(y,h);return im(y,yu(y,h)?VE(y,Qn(),c,M.transform,d,M):M.transform(d))}function jE(l,c,d,h){var y=l+20,M=Se(),H=Xa(M,y);return im(M,yu(M,y)?so(M,Qn(),c,H.transform,d,h,H):H.transform(d,h))}function yu(l,c){return l[1].data[c].pure}function im(l,c){return Hd.isWrapped(c)&&(c=Hd.unwrap(c),l[fr()]=qr),c}function jc(l){return function(c){setTimeout(l,void 0,c)}}var Ls=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(){var h,y=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,A.Z)(this,d),(h=c.call(this)).__isAsync=y,h}return(0,D.Z)(d,[{key:"emit",value:function(y){(0,B.Z)((0,U.Z)(d.prototype),"next",this).call(this,y)}},{key:"subscribe",value:function(y,M,H){var W,X,me,Pe=y,Xe=M||function(){return null},Qe=H;if(y&&"object"==typeof y){var mt=y;Pe=null===(W=mt.next)||void 0===W?void 0:W.bind(mt),Xe=null===(X=mt.error)||void 0===X?void 0:X.bind(mt),Qe=null===(me=mt.complete)||void 0===me?void 0:me.bind(mt)}this.__isAsync&&(Xe=jc(Xe),Pe&&(Pe=jc(Pe)),Qe&&(Qe=jc(Qe)));var Mt=(0,B.Z)((0,U.Z)(d.prototype),"subscribe",this).call(this,{next:Pe,error:Xe,complete:Qe});return y instanceof k.w&&y.add(Mt),Mt}}]),d}(E.xQ);function A3(){return this._results[Gu()]()}var OC=function(){function l(){var c=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,A.Z)(this,l),this._emitDistinctChangesOnly=c,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;var d=Gu(),h=l.prototype;h[d]||(h[d]=A3)}return(0,D.Z)(l,[{key:"changes",get:function(){return this._changes||(this._changes=new Ls)}},{key:"get",value:function(d){return this._results[d]}},{key:"map",value:function(d){return this._results.map(d)}},{key:"filter",value:function(d){return this._results.filter(d)}},{key:"find",value:function(d){return this._results.find(d)}},{key:"reduce",value:function(d,h){return this._results.reduce(d,h)}},{key:"forEach",value:function(d){this._results.forEach(d)}},{key:"some",value:function(d){return this._results.some(d)}},{key:"toArray",value:function(){return this._results.slice()}},{key:"toString",value:function(){return this._results.toString()}},{key:"reset",value:function(d,h){var y=this;y.dirty=!1;var M=Ds(d);(this._changesDetected=!function(l,c,d){if(l.length!==c.length)return!1;for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:[];(0,A.Z)(this,l),this.queries=c}return(0,D.Z)(l,[{key:"createEmbeddedView",value:function(d){var h=d.queries;if(null!==h){for(var y=null!==d.contentQueries?d.contentQueries[0]:h.length,M=[],H=0;H2&&void 0!==arguments[2]?arguments[2]:null;(0,A.Z)(this,l),this.predicate=c,this.flags=d,this.read=h},NC=function(){function l(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,A.Z)(this,l),this.queries=c}return(0,D.Z)(l,[{key:"elementStart",value:function(d,h){for(var y=0;y1&&void 0!==arguments[1]?arguments[1]:-1;(0,A.Z)(this,l),this.metadata=c,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=d}return(0,D.Z)(l,[{key:"elementStart",value:function(d,h){this.isApplyingToNode(h)&&this.matchTNode(d,h)}},{key:"elementEnd",value:function(d){this._declarationNodeIndex===d.index&&(this._appliesToNextNode=!1)}},{key:"template",value:function(d,h){this.elementStart(d,h)}},{key:"embeddedTView",value:function(d,h){return this.isApplyingToNode(d)?(this.crossesNgTemplate=!0,this.addMatch(-d.index,h),new l(this.metadata)):null}},{key:"isApplyingToNode",value:function(d){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){for(var h=this._declarationNodeIndex,y=d.parent;null!==y&&8&y.type&&y.index!==h;)y=y.parent;return h===(null!==y?y.index:-1)}return this._appliesToNextNode}},{key:"matchTNode",value:function(d,h){var y=this.metadata.predicate;if(Array.isArray(y))for(var M=0;M0)h.push(H[W/2]);else{for(var me=M[W+1],Pe=c[-X],Xe=10;Xe0&&(W=setTimeout(function(){H._callbacks=H._callbacks.filter(function(X){return X.timeoutId!==W}),h(H._didWork,H.getPendingTasks())},y)),this._callbacks.push({doneCb:h,timeoutId:W,updateCb:M})}},{key:"whenStable",value:function(h,y,M){if(M&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(h,y,M),this._runCallbacksIfReady()}},{key:"getPendingRequestCount",value:function(){return this._pendingCount}},{key:"findProviders",value:function(h,y,M){return[]}}]),c}();return l.\u0275fac=function(d){return new(d||l)(Wo(il))},l.\u0275prov=Rn({token:l,factory:l.\u0275fac}),l}(),e1=function(){var l=function(){function c(){(0,A.Z)(this,c),this._applications=new Map,vm.addToWindow(this)}return(0,D.Z)(c,[{key:"registerApplication",value:function(h,y){this._applications.set(h,y)}},{key:"unregisterApplication",value:function(h){this._applications.delete(h)}},{key:"unregisterAllApplications",value:function(){this._applications.clear()}},{key:"getTestability",value:function(h){return this._applications.get(h)||null}},{key:"getAllTestabilities",value:function(){return Array.from(this._applications.values())}},{key:"getAllRootElements",value:function(){return Array.from(this._applications.keys())}},{key:"findTestabilityInTree",value:function(h){var y=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return vm.findTestabilityInTree(this,h,y)}}]),c}();return l.\u0275fac=function(d){return new(d||l)},l.\u0275prov=Rn({token:l,factory:l.\u0275fac}),l}();function aR(l){vm=l}var vm=new(function(){function l(){(0,A.Z)(this,l)}return(0,D.Z)(l,[{key:"addToWindow",value:function(d){}},{key:"findTestabilityInTree",value:function(d,h,y){return null}}]),l}()),t1=!0,Sk=!1;function n1(){return Sk=!0,t1}function sR(){if(Sk)throw new Error("Cannot enable prod mode after platform setup.");t1=!1}var Bl,Tk=function(l,c,d){var h=new e_(d);return Promise.resolve(h)},r1=new No("AllowMultipleToken"),cR=function l(c,d){(0,A.Z)(this,l),this.name=c,this.token=d};function dR(l){if(Bl&&!Bl.destroyed&&!Bl.injector.get(r1,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Bl=l.get(kk);var c=l.get(YC,null);return c&&c.forEach(function(d){return d()}),Bl}function Ek(l,c){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],h="Platform: ".concat(c),y=new No(h);return function(){var M=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],H=_m();if(!H||H.injector.get(r1,!1))if(l)l(d.concat(M).concat({provide:y,useValue:!0}));else{var W=d.concat(M).concat({provide:y,useValue:!0},{provide:Ks,useValue:"platform"});dR(Ia.create({providers:W,name:h}))}return pR(y)}}function pR(l){var c=_m();if(!c)throw new Error("No platform exists!");if(!c.injector.get(l,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return c}function _m(){return Bl&&!Bl.destroyed?Bl:null}var kk=function(){var l=function(){function c(d){(0,A.Z)(this,c),this._injector=d,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return(0,D.Z)(c,[{key:"bootstrapModuleFactory",value:function(h,y){var M=this,me=function(l,c){return"noop"===l?new iR:("zone.js"===l?void 0:l)||new il({enableLongStackTrace:n1(),shouldCoalesceEventChangeDetection:!!(null==c?void 0:c.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==c?void 0:c.ngZoneRunCoalescing)})}(y?y.ngZone:void 0,{ngZoneEventCoalescing:y&&y.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:y&&y.ngZoneRunCoalescing||!1}),Pe=[{provide:il,useValue:me}];return me.run(function(){var Xe=Ia.create({providers:Pe,parent:M.injector,name:h.moduleType.name}),Qe=h.create(Xe),mt=Qe.injector.get(Jp,null);if(!mt)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return me.runOutsideAngular(function(){var Mt=me.onError.subscribe({next:function(hn){mt.handleError(hn)}});Qe.onDestroy(function(){v_(M._modules,Qe),Mt.unsubscribe()})}),function(l,c,d){try{var h=((Mt=Qe.injector.get(Cu)).runInitializers(),Mt.donePromise.then(function(){return Hw(Qe.injector.get(rp,X0)||X0),M._moduleDoBootstrap(Qe),Qe}));return M0(h)?h.catch(function(y){throw c.runOutsideAngular(function(){return l.handleError(y)}),y}):h}catch(y){throw c.runOutsideAngular(function(){return l.handleError(y)}),y}var Mt}(mt,me)})}},{key:"bootstrapModule",value:function(h){var y=this,M=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],H=Mk({},M);return Tk(0,0,h).then(function(W){return y.bootstrapModuleFactory(W,H)})}},{key:"_moduleDoBootstrap",value:function(h){var y=h.injector.get(ym);if(h._bootstrapComponents.length>0)h._bootstrapComponents.forEach(function(M){return y.bootstrap(M)});else{if(!h.instance.ngDoBootstrap)throw new Error("The module ".concat(j(h.instance.constructor),' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ')+"Please define one of these.");h.instance.ngDoBootstrap(y)}this._modules.push(h)}},{key:"onDestroy",value:function(h){this._destroyListeners.push(h)}},{key:"injector",get:function(){return this._injector}},{key:"destroy",value:function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(h){return h.destroy()}),this._destroyListeners.forEach(function(h){return h()}),this._destroyed=!0}},{key:"destroyed",get:function(){return this._destroyed}}]),c}();return l.\u0275fac=function(d){return new(d||l)(Wo(Ia))},l.\u0275prov=Rn({token:l,factory:l.\u0275fac}),l}();function Mk(l,c){return Array.isArray(c)?c.reduce(Mk,l):Object.assign(Object.assign({},l),c)}var ym=function(){var l=function(){function c(d,h,y,M,H){var W=this;(0,A.Z)(this,c),this._zone=d,this._injector=h,this._exceptionHandler=y,this._componentFactoryResolver=M,this._initStatus=H,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:function(){W._zone.run(function(){W.tick()})}});var X=new x.y(function(Pe){W._stable=W._zone.isStable&&!W._zone.hasPendingMacrotasks&&!W._zone.hasPendingMicrotasks,W._zone.runOutsideAngular(function(){Pe.next(W._stable),Pe.complete()})}),me=new x.y(function(Pe){var Xe;W._zone.runOutsideAngular(function(){Xe=W._zone.onStable.subscribe(function(){il.assertNotInAngularZone(),is(function(){!W._stable&&!W._zone.hasPendingMacrotasks&&!W._zone.hasPendingMicrotasks&&(W._stable=!0,Pe.next(!0))})})});var Qe=W._zone.onUnstable.subscribe(function(){il.assertInAngularZone(),W._stable&&(W._stable=!1,W._zone.runOutsideAngular(function(){Pe.next(!1)}))});return function(){Xe.unsubscribe(),Qe.unsubscribe()}});this.isStable=(0,O.T)(X,me.pipe((0,F.B)()))}return(0,D.Z)(c,[{key:"bootstrap",value:function(h,y){var H,M=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");H=h instanceof aE?h:this._componentFactoryResolver.resolveComponentFactory(h),this.componentTypes.push(H.componentType);var W=function(l){return l.isBoundToModule}(H)?void 0:this._injector.get(Yd),me=H.create(Ia.NULL,[],y||H.selector,W),Pe=me.location.nativeElement,Xe=me.injector.get(Ck,null),Qe=Xe&&me.injector.get(e1);return Xe&&Qe&&Qe.registerApplication(Pe,Xe),me.onDestroy(function(){M.detachView(me.hostView),v_(M.components,me),Qe&&Qe.unregisterApplication(Pe)}),this._loadComponent(me),me}},{key:"tick",value:function(){var h=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;var M,y=(0,b.Z)(this._views);try{for(y.s();!(M=y.n()).done;)M.value.detectChanges()}catch(Pe){y.e(Pe)}finally{y.f()}}catch(Pe){this._zone.runOutsideAngular(function(){return h._exceptionHandler.handleError(Pe)})}finally{this._runningTick=!1}}},{key:"attachView",value:function(h){var y=h;this._views.push(y),y.attachToAppRef(this)}},{key:"detachView",value:function(h){var y=h;v_(this._views,y),y.detachFromAppRef()}},{key:"_loadComponent",value:function(h){this.attachView(h.hostView),this.tick(),this.components.push(h),this._injector.get(JC,[]).concat(this._bootstrapListeners).forEach(function(M){return M(h)})}},{key:"ngOnDestroy",value:function(){this._views.slice().forEach(function(h){return h.destroy()}),this._onMicrotaskEmptySubscription.unsubscribe()}},{key:"viewCount",get:function(){return this._views.length}}]),c}();return l.\u0275fac=function(d){return new(d||l)(Wo(il),Wo(Ia),Wo(Jp),Wo(Ng),Wo(Cu))},l.\u0275prov=Rn({token:l,factory:l.\u0275fac}),l}();function v_(l,c){var d=l.indexOf(c);d>-1&&l.splice(d,1)}var vR=function l(){(0,A.Z)(this,l)},yR=function l(){(0,A.Z)(this,l)},__={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},bR=function(){var l=function(){function c(d,h){(0,A.Z)(this,c),this._compiler=d,this._config=h||__}return(0,D.Z)(c,[{key:"load",value:function(h){return this.loadAndCompile(h)}},{key:"loadAndCompile",value:function(h){var y=this,M=h.split("#"),H=(0,Z.Z)(M,2),W=H[0],X=H[1];return void 0===X&&(X="default"),f(98255)(W).then(function(me){return me[X]}).then(function(me){return Sm(me,W,X)}).then(function(me){return y._compiler.compileModuleAsync(me)})}},{key:"loadFactory",value:function(h){var y=h.split("#"),M=(0,Z.Z)(y,2),H=M[0],W=M[1],X="NgFactory";return void 0===W&&(W="default",X=""),f(98255)(this._config.factoryPathPrefix+H+this._config.factoryPathSuffix).then(function(me){return me[W+X]}).then(function(me){return Sm(me,H,W)})}}]),c}();return l.\u0275fac=function(d){return new(d||l)(Wo(pm),Wo(yR,8))},l.\u0275prov=Rn({token:l,factory:l.\u0275fac}),l}();function Sm(l,c,d){if(!l)throw new Error("Cannot find '".concat(d,"' in '").concat(c,"'"));return l}var SR=function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(){return(0,A.Z)(this,d),c.apply(this,arguments)}return d}(function(l){(0,S.Z)(d,l);var c=(0,v.Z)(d);function d(){return(0,A.Z)(this,d),c.apply(this,arguments)}return d}(pE)),kR=function(l){return null},AR=Ek(null,"core",[{provide:hk,useValue:"unknown"},{provide:kk,deps:[Ia]},{provide:e1,deps:[]},{provide:p_,deps:[]}]),RR=[{provide:ym,useClass:ym,deps:[il,Ia,Jp,Ng,Cu]},{provide:NE,deps:[il],useFactory:function(l){var c=[];return l.onStable.subscribe(function(){for(;c.length;)c.pop()()}),function(d){c.push(d)}}},{provide:Cu,useClass:Cu,deps:[[new Lu,dm]]},{provide:pm,useClass:pm,deps:[]},Y3,{provide:Lg,useFactory:function(){return GB},deps:[]},{provide:Xh,useFactory:function(){return YB},deps:[]},{provide:rp,useFactory:function(l){return Hw(l=l||"undefined"!=typeof $localize&&$localize.locale||X0),l},deps:[[new Ch(rp),new Lu,new Fu]]},{provide:mk,useValue:"USD"}],op=function(){var l=function c(d){(0,A.Z)(this,c)};return l.\u0275fac=function(d){return new(d||l)(Wo(ym))},l.\u0275mod=bo({type:l}),l.\u0275inj=Nn({providers:RR}),l}()},19061:function(ue,q,f){"use strict";f.d(q,{Zs:function(){return Hi},Fj:function(){return F},qu:function(){return $e},NI:function(){return Ei},u:function(){return pa},cw:function(){return no},sg:function(){return Vo},u5:function(){return Cl},Fd:function(){return zi},qQ:function(){return ga},Cf:function(){return j},JU:function(){return T},a5:function(){return kn},JJ:function(){return Nn},JL:function(){return wn},F:function(){return Uo},On:function(){return zn},wV:function(){return Si},UX:function(){return pe},kI:function(){return $},_Y:function(){return Vn}});var B=f(88009),U=f(36683),V=f(62467),Z=f(10509),w=f(97154),N=f(18967),b=f(14105),_=f(38999),I=f(40098),D=f(61493),A=f(91925),S=f(85639),v=function(){var ie=function(){function fe(_e,Ce){(0,N.Z)(this,fe),this._renderer=_e,this._elementRef=Ce,this.onChange=function(Re){},this.onTouched=function(){}}return(0,b.Z)(fe,[{key:"setProperty",value:function(Ce,Re){this._renderer.setProperty(this._elementRef.nativeElement,Ce,Re)}},{key:"registerOnTouched",value:function(Ce){this.onTouched=Ce}},{key:"registerOnChange",value:function(Ce){this.onChange=Ce}},{key:"setDisabledState",value:function(Ce){this.setProperty("disabled",Ce)}}]),fe}();return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(_.Qsj),_.Y36(_.SBq))},ie.\u0275dir=_.lG2({type:ie}),ie}(),g=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(){return(0,N.Z)(this,Ce),_e.apply(this,arguments)}return Ce}(v);return ie.\u0275fac=function(){var fe;return function(Ce){return(fe||(fe=_.n5z(ie)))(Ce||ie)}}(),ie.\u0275dir=_.lG2({type:ie,features:[_.qOj]}),ie}(),T=new _.OlP("NgValueAccessor"),E={provide:T,useExisting:(0,_.Gpc)(function(){return F}),multi:!0},O=new _.OlP("CompositionEventMode"),F=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re,Ge,St){var ht;return(0,N.Z)(this,Ce),(ht=_e.call(this,Re,Ge))._compositionMode=St,ht._composing=!1,null==ht._compositionMode&&(ht._compositionMode=!function(){var ie=(0,I.q)()?(0,I.q)().getUserAgent():"";return/android (\d+)/.test(ie.toLowerCase())}()),ht}return(0,b.Z)(Ce,[{key:"writeValue",value:function(Ge){this.setProperty("value",null==Ge?"":Ge)}},{key:"_handleInput",value:function(Ge){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(Ge)}},{key:"_compositionStart",value:function(){this._composing=!0}},{key:"_compositionEnd",value:function(Ge){this._composing=!1,this._compositionMode&&this.onChange(Ge)}}]),Ce}(v);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(_.Qsj),_.Y36(_.SBq),_.Y36(O,8))},ie.\u0275dir=_.lG2({type:ie,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(_e,Ce){1&_e&&_.NdJ("input",function(Ge){return Ce._handleInput(Ge.target.value)})("blur",function(){return Ce.onTouched()})("compositionstart",function(){return Ce._compositionStart()})("compositionend",function(Ge){return Ce._compositionEnd(Ge.target.value)})},features:[_._Bn([E]),_.qOj]}),ie}();function z(ie){return null==ie||0===ie.length}function K(ie){return null!=ie&&"number"==typeof ie.length}var j=new _.OlP("NgValidators"),J=new _.OlP("NgAsyncValidators"),ee=/^(?=.{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])?)*$/,$=function(){function ie(){(0,N.Z)(this,ie)}return(0,b.Z)(ie,null,[{key:"min",value:function(_e){return ae(_e)}},{key:"max",value:function(_e){return se(_e)}},{key:"required",value:function(_e){return ce(_e)}},{key:"requiredTrue",value:function(_e){return le(_e)}},{key:"email",value:function(_e){return function(ie){return z(ie.value)||ee.test(ie.value)?null:{email:!0}}(_e)}},{key:"minLength",value:function(_e){return function(ie){return function(fe){return z(fe.value)||!K(fe.value)?null:fe.value.lengthie?{maxlength:{requiredLength:ie,actualLength:fe.value.length}}:null}}(_e)}},{key:"pattern",value:function(_e){return function(ie){return ie?("string"==typeof ie?(_e="","^"!==ie.charAt(0)&&(_e+="^"),_e+=ie,"$"!==ie.charAt(ie.length-1)&&(_e+="$"),fe=new RegExp(_e)):(_e=ie.toString(),fe=ie),function(Ce){if(z(Ce.value))return null;var Re=Ce.value;return fe.test(Re)?null:{pattern:{requiredPattern:_e,actualValue:Re}}}):qe;var fe,_e}(_e)}},{key:"nullValidator",value:function(_e){return null}},{key:"compose",value:function(_e){return dt(_e)}},{key:"composeAsync",value:function(_e){return Bt(_e)}}]),ie}();function ae(ie){return function(fe){if(z(fe.value)||z(ie))return null;var _e=parseFloat(fe.value);return!isNaN(_e)&&_eie?{max:{max:ie,actual:fe.value}}:null}}function ce(ie){return z(ie.value)?{required:!0}:null}function le(ie){return!0===ie.value?null:{required:!0}}function qe(ie){return null}function _t(ie){return null!=ie}function yt(ie){var fe=(0,_.QGY)(ie)?(0,D.D)(ie):ie;return(0,_.CqO)(fe),fe}function Ft(ie){var fe={};return ie.forEach(function(_e){fe=null!=_e?Object.assign(Object.assign({},fe),_e):fe}),0===Object.keys(fe).length?null:fe}function xe(ie,fe){return fe.map(function(_e){return _e(ie)})}function je(ie){return ie.map(function(fe){return function(ie){return!ie.validate}(fe)?fe:function(_e){return fe.validate(_e)}})}function dt(ie){if(!ie)return null;var fe=ie.filter(_t);return 0==fe.length?null:function(_e){return Ft(xe(_e,fe))}}function Ke(ie){return null!=ie?dt(je(ie)):null}function Bt(ie){if(!ie)return null;var fe=ie.filter(_t);return 0==fe.length?null:function(_e){var Ce=xe(_e,fe).map(yt);return(0,A.D)(Ce).pipe((0,S.U)(Ft))}}function xt(ie){return null!=ie?Bt(je(ie)):null}function vt(ie,fe){return null===ie?[fe]:Array.isArray(ie)?[].concat((0,V.Z)(ie),[fe]):[ie,fe]}function Qt(ie){return ie._rawValidators}function Ht(ie){return ie._rawAsyncValidators}function Ct(ie){return ie?Array.isArray(ie)?ie:[ie]:[]}function qt(ie,fe){return Array.isArray(ie)?ie.includes(fe):ie===fe}function bt(ie,fe){var _e=Ct(fe);return Ct(ie).forEach(function(Re){qt(_e,Re)||_e.push(Re)}),_e}function en(ie,fe){return Ct(fe).filter(function(_e){return!qt(ie,_e)})}var Nt=function(){var ie=function(){function fe(){(0,N.Z)(this,fe),this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}return(0,b.Z)(fe,[{key:"value",get:function(){return this.control?this.control.value:null}},{key:"valid",get:function(){return this.control?this.control.valid:null}},{key:"invalid",get:function(){return this.control?this.control.invalid:null}},{key:"pending",get:function(){return this.control?this.control.pending:null}},{key:"disabled",get:function(){return this.control?this.control.disabled:null}},{key:"enabled",get:function(){return this.control?this.control.enabled:null}},{key:"errors",get:function(){return this.control?this.control.errors:null}},{key:"pristine",get:function(){return this.control?this.control.pristine:null}},{key:"dirty",get:function(){return this.control?this.control.dirty:null}},{key:"touched",get:function(){return this.control?this.control.touched:null}},{key:"status",get:function(){return this.control?this.control.status:null}},{key:"untouched",get:function(){return this.control?this.control.untouched:null}},{key:"statusChanges",get:function(){return this.control?this.control.statusChanges:null}},{key:"valueChanges",get:function(){return this.control?this.control.valueChanges:null}},{key:"path",get:function(){return null}},{key:"_setValidators",value:function(Ce){this._rawValidators=Ce||[],this._composedValidatorFn=Ke(this._rawValidators)}},{key:"_setAsyncValidators",value:function(Ce){this._rawAsyncValidators=Ce||[],this._composedAsyncValidatorFn=xt(this._rawAsyncValidators)}},{key:"validator",get:function(){return this._composedValidatorFn||null}},{key:"asyncValidator",get:function(){return this._composedAsyncValidatorFn||null}},{key:"_registerOnDestroy",value:function(Ce){this._onDestroyCallbacks.push(Ce)}},{key:"_invokeOnDestroyCallbacks",value:function(){this._onDestroyCallbacks.forEach(function(Ce){return Ce()}),this._onDestroyCallbacks=[]}},{key:"reset",value:function(){var Ce=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.control&&this.control.reset(Ce)}},{key:"hasError",value:function(Ce,Re){return!!this.control&&this.control.hasError(Ce,Re)}},{key:"getError",value:function(Ce,Re){return this.control?this.control.getError(Ce,Re):null}}]),fe}();return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275dir=_.lG2({type:ie}),ie}(),rn=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(){return(0,N.Z)(this,Ce),_e.apply(this,arguments)}return(0,b.Z)(Ce,[{key:"formDirective",get:function(){return null}},{key:"path",get:function(){return null}}]),Ce}(Nt);return ie.\u0275fac=function(){var fe;return function(Ce){return(fe||(fe=_.n5z(ie)))(Ce||ie)}}(),ie.\u0275dir=_.lG2({type:ie,features:[_.qOj]}),ie}(),kn=function(ie){(0,Z.Z)(_e,ie);var fe=(0,w.Z)(_e);function _e(){var Ce;return(0,N.Z)(this,_e),(Ce=fe.apply(this,arguments))._parent=null,Ce.name=null,Ce.valueAccessor=null,Ce}return _e}(Nt),Ln=function(){function ie(fe){(0,N.Z)(this,ie),this._cd=fe}return(0,b.Z)(ie,[{key:"is",value:function(_e){var Ce,Re,Ge;return"submitted"===_e?!!(null===(Ce=this._cd)||void 0===Ce?void 0:Ce.submitted):!!(null===(Ge=null===(Re=this._cd)||void 0===Re?void 0:Re.control)||void 0===Ge?void 0:Ge[_e])}}]),ie}(),Nn=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re){return(0,N.Z)(this,Ce),_e.call(this,Re)}return Ce}(Ln);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(kn,2))},ie.\u0275dir=_.lG2({type:ie,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(_e,Ce){2&_e&&_.ekj("ng-untouched",Ce.is("untouched"))("ng-touched",Ce.is("touched"))("ng-pristine",Ce.is("pristine"))("ng-dirty",Ce.is("dirty"))("ng-valid",Ce.is("valid"))("ng-invalid",Ce.is("invalid"))("ng-pending",Ce.is("pending"))},features:[_.qOj]}),ie}(),wn=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re){return(0,N.Z)(this,Ce),_e.call(this,Re)}return Ce}(Ln);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(rn,10))},ie.\u0275dir=_.lG2({type:ie,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(_e,Ce){2&_e&&_.ekj("ng-untouched",Ce.is("untouched"))("ng-touched",Ce.is("touched"))("ng-pristine",Ce.is("pristine"))("ng-dirty",Ce.is("dirty"))("ng-valid",Ce.is("valid"))("ng-invalid",Ce.is("invalid"))("ng-pending",Ce.is("pending"))("ng-submitted",Ce.is("submitted"))},features:[_.qOj]}),ie}();function nn(ie,fe){return[].concat((0,V.Z)(fe.path),[ie])}function ln(ie,fe){Yn(ie,fe),fe.valueAccessor.writeValue(ie.value),function(ie,fe){fe.valueAccessor.registerOnChange(function(_e){ie._pendingValue=_e,ie._pendingChange=!0,ie._pendingDirty=!0,"change"===ie.updateOn&&ur(ie,fe)})}(ie,fe),function(ie,fe){var _e=function(Re,Ge){fe.valueAccessor.writeValue(Re),Ge&&fe.viewToModelUpdate(Re)};ie.registerOnChange(_e),fe._registerOnDestroy(function(){ie._unregisterOnChange(_e)})}(ie,fe),function(ie,fe){fe.valueAccessor.registerOnTouched(function(){ie._pendingTouched=!0,"blur"===ie.updateOn&&ie._pendingChange&&ur(ie,fe),"submit"!==ie.updateOn&&ie.markAsTouched()})}(ie,fe),function(ie,fe){if(fe.valueAccessor.setDisabledState){var _e=function(Re){fe.valueAccessor.setDisabledState(Re)};ie.registerOnDisabledChange(_e),fe._registerOnDestroy(function(){ie._unregisterOnDisabledChange(_e)})}}(ie,fe)}function yn(ie,fe){var Ce=function(){};fe.valueAccessor&&(fe.valueAccessor.registerOnChange(Ce),fe.valueAccessor.registerOnTouched(Ce)),Cn(ie,fe),ie&&(fe._invokeOnDestroyCallbacks(),ie._registerOnCollectionChange(function(){}))}function Tn(ie,fe){ie.forEach(function(_e){_e.registerOnValidatorChange&&_e.registerOnValidatorChange(fe)})}function Yn(ie,fe){var _e=Qt(ie);null!==fe.validator?ie.setValidators(vt(_e,fe.validator)):"function"==typeof _e&&ie.setValidators([_e]);var Ce=Ht(ie);null!==fe.asyncValidator?ie.setAsyncValidators(vt(Ce,fe.asyncValidator)):"function"==typeof Ce&&ie.setAsyncValidators([Ce]);var Re=function(){return ie.updateValueAndValidity()};Tn(fe._rawValidators,Re),Tn(fe._rawAsyncValidators,Re)}function Cn(ie,fe){var _e=!1;if(null!==ie){if(null!==fe.validator){var Ce=Qt(ie);if(Array.isArray(Ce)&&Ce.length>0){var Re=Ce.filter(function(gt){return gt!==fe.validator});Re.length!==Ce.length&&(_e=!0,ie.setValidators(Re))}}if(null!==fe.asyncValidator){var Ge=Ht(ie);if(Array.isArray(Ge)&&Ge.length>0){var St=Ge.filter(function(gt){return gt!==fe.asyncValidator});St.length!==Ge.length&&(_e=!0,ie.setAsyncValidators(St))}}}var ht=function(){};return Tn(fe._rawValidators,ht),Tn(fe._rawAsyncValidators,ht),_e}function ur(ie,fe){ie._pendingDirty&&ie.markAsDirty(),ie.setValue(ie._pendingValue,{emitModelToViewChange:!1}),fe.viewToModelUpdate(ie._pendingValue),ie._pendingChange=!1}function Rt(ie,fe){Yn(ie,fe)}function he(ie,fe){if(!ie.hasOwnProperty("model"))return!1;var _e=ie.model;return!!_e.isFirstChange()||!Object.is(fe,_e.currentValue)}function Ne(ie,fe){ie._syncPendingControls(),fe.forEach(function(_e){var Ce=_e.control;"submit"===Ce.updateOn&&Ce._pendingChange&&(_e.viewToModelUpdate(Ce._pendingValue),Ce._pendingChange=!1)})}function Le(ie,fe){if(!fe)return null;Array.isArray(fe);var _e=void 0,Ce=void 0,Re=void 0;return fe.forEach(function(Ge){Ge.constructor===F?_e=Ge:function(ie){return Object.getPrototypeOf(ie.constructor)===g}(Ge)?Ce=Ge:Re=Ge}),Re||Ce||_e||null}function ze(ie,fe){var _e=ie.indexOf(fe);_e>-1&&ie.splice(_e,1)}var an="VALID",jn="INVALID",Rr="PENDING",Hr="DISABLED";function Yr(ie){return(po(ie)?ie.validators:ie)||null}function co(ie){return Array.isArray(ie)?Ke(ie):ie||null}function Zi(ie,fe){return(po(fe)?fe.asyncValidators:ie)||null}function bo(ie){return Array.isArray(ie)?xt(ie):ie||null}function po(ie){return null!=ie&&!Array.isArray(ie)&&"object"==typeof ie}var Xo=function(){function ie(fe,_e){(0,N.Z)(this,ie),this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=function(){},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=fe,this._rawAsyncValidators=_e,this._composedValidatorFn=co(this._rawValidators),this._composedAsyncValidatorFn=bo(this._rawAsyncValidators)}return(0,b.Z)(ie,[{key:"validator",get:function(){return this._composedValidatorFn},set:function(_e){this._rawValidators=this._composedValidatorFn=_e}},{key:"asyncValidator",get:function(){return this._composedAsyncValidatorFn},set:function(_e){this._rawAsyncValidators=this._composedAsyncValidatorFn=_e}},{key:"parent",get:function(){return this._parent}},{key:"valid",get:function(){return this.status===an}},{key:"invalid",get:function(){return this.status===jn}},{key:"pending",get:function(){return this.status==Rr}},{key:"disabled",get:function(){return this.status===Hr}},{key:"enabled",get:function(){return this.status!==Hr}},{key:"dirty",get:function(){return!this.pristine}},{key:"untouched",get:function(){return!this.touched}},{key:"updateOn",get:function(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}},{key:"setValidators",value:function(_e){this._rawValidators=_e,this._composedValidatorFn=co(_e)}},{key:"setAsyncValidators",value:function(_e){this._rawAsyncValidators=_e,this._composedAsyncValidatorFn=bo(_e)}},{key:"addValidators",value:function(_e){this.setValidators(bt(_e,this._rawValidators))}},{key:"addAsyncValidators",value:function(_e){this.setAsyncValidators(bt(_e,this._rawAsyncValidators))}},{key:"removeValidators",value:function(_e){this.setValidators(en(_e,this._rawValidators))}},{key:"removeAsyncValidators",value:function(_e){this.setAsyncValidators(en(_e,this._rawAsyncValidators))}},{key:"hasValidator",value:function(_e){return qt(this._rawValidators,_e)}},{key:"hasAsyncValidator",value:function(_e){return qt(this._rawAsyncValidators,_e)}},{key:"clearValidators",value:function(){this.validator=null}},{key:"clearAsyncValidators",value:function(){this.asyncValidator=null}},{key:"markAsTouched",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=!0,this._parent&&!_e.onlySelf&&this._parent.markAsTouched(_e)}},{key:"markAllAsTouched",value:function(){this.markAsTouched({onlySelf:!0}),this._forEachChild(function(_e){return _e.markAllAsTouched()})}},{key:"markAsUntouched",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=!1,this._pendingTouched=!1,this._forEachChild(function(Ce){Ce.markAsUntouched({onlySelf:!0})}),this._parent&&!_e.onlySelf&&this._parent._updateTouched(_e)}},{key:"markAsDirty",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!1,this._parent&&!_e.onlySelf&&this._parent.markAsDirty(_e)}},{key:"markAsPristine",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!0,this._pendingDirty=!1,this._forEachChild(function(Ce){Ce.markAsPristine({onlySelf:!0})}),this._parent&&!_e.onlySelf&&this._parent._updatePristine(_e)}},{key:"markAsPending",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.status=Rr,!1!==_e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!_e.onlySelf&&this._parent.markAsPending(_e)}},{key:"disable",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Ce=this._parentMarkedDirty(_e.onlySelf);this.status=Hr,this.errors=null,this._forEachChild(function(Re){Re.disable(Object.assign(Object.assign({},_e),{onlySelf:!0}))}),this._updateValue(),!1!==_e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},_e),{skipPristineCheck:Ce})),this._onDisabledChange.forEach(function(Re){return Re(!0)})}},{key:"enable",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Ce=this._parentMarkedDirty(_e.onlySelf);this.status=an,this._forEachChild(function(Re){Re.enable(Object.assign(Object.assign({},_e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:_e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},_e),{skipPristineCheck:Ce})),this._onDisabledChange.forEach(function(Re){return Re(!1)})}},{key:"_updateAncestors",value:function(_e){this._parent&&!_e.onlySelf&&(this._parent.updateValueAndValidity(_e),_e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}},{key:"setParent",value:function(_e){this._parent=_e}},{key:"updateValueAndValidity",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===an||this.status===Rr)&&this._runAsyncValidator(_e.emitEvent)),!1!==_e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!_e.onlySelf&&this._parent.updateValueAndValidity(_e)}},{key:"_updateTreeValidity",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{emitEvent:!0};this._forEachChild(function(Ce){return Ce._updateTreeValidity(_e)}),this.updateValueAndValidity({onlySelf:!0,emitEvent:_e.emitEvent})}},{key:"_setInitialStatus",value:function(){this.status=this._allControlsDisabled()?Hr:an}},{key:"_runValidator",value:function(){return this.validator?this.validator(this):null}},{key:"_runAsyncValidator",value:function(_e){var Ce=this;if(this.asyncValidator){this.status=Rr,this._hasOwnPendingAsyncValidator=!0;var Re=yt(this.asyncValidator(this));this._asyncValidationSubscription=Re.subscribe(function(Ge){Ce._hasOwnPendingAsyncValidator=!1,Ce.setErrors(Ge,{emitEvent:_e})})}}},{key:"_cancelExistingSubscription",value:function(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}},{key:"setErrors",value:function(_e){var Ce=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.errors=_e,this._updateControlsErrors(!1!==Ce.emitEvent)}},{key:"get",value:function(_e){return function(ie,fe,_e){if(null==fe||(Array.isArray(fe)||(fe=fe.split(".")),Array.isArray(fe)&&0===fe.length))return null;var Ce=ie;return fe.forEach(function(Re){Ce=Ce instanceof no?Ce.controls.hasOwnProperty(Re)?Ce.controls[Re]:null:Ce instanceof vi&&Ce.at(Re)||null}),Ce}(this,_e)}},{key:"getError",value:function(_e,Ce){var Re=Ce?this.get(Ce):this;return Re&&Re.errors?Re.errors[_e]:null}},{key:"hasError",value:function(_e,Ce){return!!this.getError(_e,Ce)}},{key:"root",get:function(){for(var _e=this;_e._parent;)_e=_e._parent;return _e}},{key:"_updateControlsErrors",value:function(_e){this.status=this._calculateStatus(),_e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(_e)}},{key:"_initObservables",value:function(){this.valueChanges=new _.vpe,this.statusChanges=new _.vpe}},{key:"_calculateStatus",value:function(){return this._allControlsDisabled()?Hr:this.errors?jn:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Rr)?Rr:this._anyControlsHaveStatus(jn)?jn:an}},{key:"_anyControlsHaveStatus",value:function(_e){return this._anyControls(function(Ce){return Ce.status===_e})}},{key:"_anyControlsDirty",value:function(){return this._anyControls(function(_e){return _e.dirty})}},{key:"_anyControlsTouched",value:function(){return this._anyControls(function(_e){return _e.touched})}},{key:"_updatePristine",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pristine=!this._anyControlsDirty(),this._parent&&!_e.onlySelf&&this._parent._updatePristine(_e)}},{key:"_updateTouched",value:function(){var _e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.touched=this._anyControlsTouched(),this._parent&&!_e.onlySelf&&this._parent._updateTouched(_e)}},{key:"_isBoxedValue",value:function(_e){return"object"==typeof _e&&null!==_e&&2===Object.keys(_e).length&&"value"in _e&&"disabled"in _e}},{key:"_registerOnCollectionChange",value:function(_e){this._onCollectionChange=_e}},{key:"_setUpdateStrategy",value:function(_e){po(_e)&&null!=_e.updateOn&&(this._updateOn=_e.updateOn)}},{key:"_parentMarkedDirty",value:function(_e){return!_e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}]),ie}(),Ei=function(ie){(0,Z.Z)(_e,ie);var fe=(0,w.Z)(_e);function _e(){var Ce,Re=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Ge=arguments.length>1?arguments[1]:void 0,St=arguments.length>2?arguments[2]:void 0;return(0,N.Z)(this,_e),(Ce=fe.call(this,Yr(Ge),Zi(St,Ge)))._onChange=[],Ce._applyFormState(Re),Ce._setUpdateStrategy(Ge),Ce._initObservables(),Ce.updateValueAndValidity({onlySelf:!0,emitEvent:!!Ce.asyncValidator}),Ce}return(0,b.Z)(_e,[{key:"setValue",value:function(Re){var Ge=this,St=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.value=this._pendingValue=Re,this._onChange.length&&!1!==St.emitModelToViewChange&&this._onChange.forEach(function(ht){return ht(Ge.value,!1!==St.emitViewToModelChange)}),this.updateValueAndValidity(St)}},{key:"patchValue",value:function(Re){var Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.setValue(Re,Ge)}},{key:"reset",value:function(){var Re=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._applyFormState(Re),this.markAsPristine(Ge),this.markAsUntouched(Ge),this.setValue(this.value,Ge),this._pendingChange=!1}},{key:"_updateValue",value:function(){}},{key:"_anyControls",value:function(Re){return!1}},{key:"_allControlsDisabled",value:function(){return this.disabled}},{key:"registerOnChange",value:function(Re){this._onChange.push(Re)}},{key:"_unregisterOnChange",value:function(Re){ze(this._onChange,Re)}},{key:"registerOnDisabledChange",value:function(Re){this._onDisabledChange.push(Re)}},{key:"_unregisterOnDisabledChange",value:function(Re){ze(this._onDisabledChange,Re)}},{key:"_forEachChild",value:function(Re){}},{key:"_syncPendingControls",value:function(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}},{key:"_applyFormState",value:function(Re){this._isBoxedValue(Re)?(this.value=this._pendingValue=Re.value,Re.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=Re}}]),_e}(Xo),no=function(ie){(0,Z.Z)(_e,ie);var fe=(0,w.Z)(_e);function _e(Ce,Re,Ge){var St;return(0,N.Z)(this,_e),(St=fe.call(this,Yr(Re),Zi(Ge,Re))).controls=Ce,St._initObservables(),St._setUpdateStrategy(Re),St._setUpControls(),St.updateValueAndValidity({onlySelf:!0,emitEvent:!!St.asyncValidator}),St}return(0,b.Z)(_e,[{key:"registerControl",value:function(Re,Ge){return this.controls[Re]?this.controls[Re]:(this.controls[Re]=Ge,Ge.setParent(this),Ge._registerOnCollectionChange(this._onCollectionChange),Ge)}},{key:"addControl",value:function(Re,Ge){var St=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.registerControl(Re,Ge),this.updateValueAndValidity({emitEvent:St.emitEvent}),this._onCollectionChange()}},{key:"removeControl",value:function(Re){var Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls[Re]&&this.controls[Re]._registerOnCollectionChange(function(){}),delete this.controls[Re],this.updateValueAndValidity({emitEvent:Ge.emitEvent}),this._onCollectionChange()}},{key:"setControl",value:function(Re,Ge){var St=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls[Re]&&this.controls[Re]._registerOnCollectionChange(function(){}),delete this.controls[Re],Ge&&this.registerControl(Re,Ge),this.updateValueAndValidity({emitEvent:St.emitEvent}),this._onCollectionChange()}},{key:"contains",value:function(Re){return this.controls.hasOwnProperty(Re)&&this.controls[Re].enabled}},{key:"setValue",value:function(Re){var Ge=this,St=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkAllValuesPresent(Re),Object.keys(Re).forEach(function(ht){Ge._throwIfControlMissing(ht),Ge.controls[ht].setValue(Re[ht],{onlySelf:!0,emitEvent:St.emitEvent})}),this.updateValueAndValidity(St)}},{key:"patchValue",value:function(Re){var Ge=this,St=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=Re&&(Object.keys(Re).forEach(function(ht){Ge.controls[ht]&&Ge.controls[ht].patchValue(Re[ht],{onlySelf:!0,emitEvent:St.emitEvent})}),this.updateValueAndValidity(St))}},{key:"reset",value:function(){var Re=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._forEachChild(function(St,ht){St.reset(Re[ht],{onlySelf:!0,emitEvent:Ge.emitEvent})}),this._updatePristine(Ge),this._updateTouched(Ge),this.updateValueAndValidity(Ge)}},{key:"getRawValue",value:function(){return this._reduceChildren({},function(Re,Ge,St){return Re[St]=Ge instanceof Ei?Ge.value:Ge.getRawValue(),Re})}},{key:"_syncPendingControls",value:function(){var Re=this._reduceChildren(!1,function(Ge,St){return!!St._syncPendingControls()||Ge});return Re&&this.updateValueAndValidity({onlySelf:!0}),Re}},{key:"_throwIfControlMissing",value:function(Re){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[Re])throw new Error("Cannot find form control with name: ".concat(Re,"."))}},{key:"_forEachChild",value:function(Re){var Ge=this;Object.keys(this.controls).forEach(function(St){var ht=Ge.controls[St];ht&&Re(ht,St)})}},{key:"_setUpControls",value:function(){var Re=this;this._forEachChild(function(Ge){Ge.setParent(Re),Ge._registerOnCollectionChange(Re._onCollectionChange)})}},{key:"_updateValue",value:function(){this.value=this._reduceValue()}},{key:"_anyControls",value:function(Re){for(var Ge=0,St=Object.keys(this.controls);Ge0||this.disabled}},{key:"_checkAllValuesPresent",value:function(Re){this._forEachChild(function(Ge,St){if(void 0===Re[St])throw new Error("Must supply a value for form control with name: '".concat(St,"'."))})}}]),_e}(Xo),vi=function(ie){(0,Z.Z)(_e,ie);var fe=(0,w.Z)(_e);function _e(Ce,Re,Ge){var St;return(0,N.Z)(this,_e),(St=fe.call(this,Yr(Re),Zi(Ge,Re))).controls=Ce,St._initObservables(),St._setUpdateStrategy(Re),St._setUpControls(),St.updateValueAndValidity({onlySelf:!0,emitEvent:!!St.asyncValidator}),St}return(0,b.Z)(_e,[{key:"at",value:function(Re){return this.controls[Re]}},{key:"push",value:function(Re){var Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls.push(Re),this._registerControl(Re),this.updateValueAndValidity({emitEvent:Ge.emitEvent}),this._onCollectionChange()}},{key:"insert",value:function(Re,Ge){var St=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls.splice(Re,0,Ge),this._registerControl(Ge),this.updateValueAndValidity({emitEvent:St.emitEvent})}},{key:"removeAt",value:function(Re){var Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.controls[Re]&&this.controls[Re]._registerOnCollectionChange(function(){}),this.controls.splice(Re,1),this.updateValueAndValidity({emitEvent:Ge.emitEvent})}},{key:"setControl",value:function(Re,Ge){var St=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.controls[Re]&&this.controls[Re]._registerOnCollectionChange(function(){}),this.controls.splice(Re,1),Ge&&(this.controls.splice(Re,0,Ge),this._registerControl(Ge)),this.updateValueAndValidity({emitEvent:St.emitEvent}),this._onCollectionChange()}},{key:"length",get:function(){return this.controls.length}},{key:"setValue",value:function(Re){var Ge=this,St=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkAllValuesPresent(Re),Re.forEach(function(ht,gt){Ge._throwIfControlMissing(gt),Ge.at(gt).setValue(ht,{onlySelf:!0,emitEvent:St.emitEvent})}),this.updateValueAndValidity(St)}},{key:"patchValue",value:function(Re){var Ge=this,St=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null!=Re&&(Re.forEach(function(ht,gt){Ge.at(gt)&&Ge.at(gt).patchValue(ht,{onlySelf:!0,emitEvent:St.emitEvent})}),this.updateValueAndValidity(St))}},{key:"reset",value:function(){var Re=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],Ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._forEachChild(function(St,ht){St.reset(Re[ht],{onlySelf:!0,emitEvent:Ge.emitEvent})}),this._updatePristine(Ge),this._updateTouched(Ge),this.updateValueAndValidity(Ge)}},{key:"getRawValue",value:function(){return this.controls.map(function(Re){return Re instanceof Ei?Re.value:Re.getRawValue()})}},{key:"clear",value:function(){var Re=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.controls.length<1||(this._forEachChild(function(Ge){return Ge._registerOnCollectionChange(function(){})}),this.controls.splice(0),this.updateValueAndValidity({emitEvent:Re.emitEvent}))}},{key:"_syncPendingControls",value:function(){var Re=this.controls.reduce(function(Ge,St){return!!St._syncPendingControls()||Ge},!1);return Re&&this.updateValueAndValidity({onlySelf:!0}),Re}},{key:"_throwIfControlMissing",value:function(Re){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(Re))throw new Error("Cannot find form control at index ".concat(Re))}},{key:"_forEachChild",value:function(Re){this.controls.forEach(function(Ge,St){Re(Ge,St)})}},{key:"_updateValue",value:function(){var Re=this;this.value=this.controls.filter(function(Ge){return Ge.enabled||Re.disabled}).map(function(Ge){return Ge.value})}},{key:"_anyControls",value:function(Re){return this.controls.some(function(Ge){return Ge.enabled&&Re(Ge)})}},{key:"_setUpControls",value:function(){var Re=this;this._forEachChild(function(Ge){return Re._registerControl(Ge)})}},{key:"_checkAllValuesPresent",value:function(Re){this._forEachChild(function(Ge,St){if(void 0===Re[St])throw new Error("Must supply a value for form control at index: ".concat(St,"."))})}},{key:"_allControlsDisabled",value:function(){var Ge,Re=(0,U.Z)(this.controls);try{for(Re.s();!(Ge=Re.n()).done;)if(Ge.value.enabled)return!1}catch(ht){Re.e(ht)}finally{Re.f()}return this.controls.length>0||this.disabled}},{key:"_registerControl",value:function(Re){Re.setParent(this),Re._registerOnCollectionChange(this._onCollectionChange)}}]),_e}(Xo),Yi={provide:rn,useExisting:(0,_.Gpc)(function(){return Uo})},fi=function(){return Promise.resolve(null)}(),Uo=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re,Ge){var St;return(0,N.Z)(this,Ce),(St=_e.call(this)).submitted=!1,St._directives=[],St.ngSubmit=new _.vpe,St.form=new no({},Ke(Re),xt(Ge)),St}return(0,b.Z)(Ce,[{key:"ngAfterViewInit",value:function(){this._setUpdateStrategy()}},{key:"formDirective",get:function(){return this}},{key:"control",get:function(){return this.form}},{key:"path",get:function(){return[]}},{key:"controls",get:function(){return this.form.controls}},{key:"addControl",value:function(Ge){var St=this;fi.then(function(){var ht=St._findContainer(Ge.path);Ge.control=ht.registerControl(Ge.name,Ge.control),ln(Ge.control,Ge),Ge.control.updateValueAndValidity({emitEvent:!1}),St._directives.push(Ge)})}},{key:"getControl",value:function(Ge){return this.form.get(Ge.path)}},{key:"removeControl",value:function(Ge){var St=this;fi.then(function(){var ht=St._findContainer(Ge.path);ht&&ht.removeControl(Ge.name),ze(St._directives,Ge)})}},{key:"addFormGroup",value:function(Ge){var St=this;fi.then(function(){var ht=St._findContainer(Ge.path),gt=new no({});Rt(gt,Ge),ht.registerControl(Ge.name,gt),gt.updateValueAndValidity({emitEvent:!1})})}},{key:"removeFormGroup",value:function(Ge){var St=this;fi.then(function(){var ht=St._findContainer(Ge.path);ht&&ht.removeControl(Ge.name)})}},{key:"getFormGroup",value:function(Ge){return this.form.get(Ge.path)}},{key:"updateModel",value:function(Ge,St){var ht=this;fi.then(function(){ht.form.get(Ge.path).setValue(St)})}},{key:"setValue",value:function(Ge){this.control.setValue(Ge)}},{key:"onSubmit",value:function(Ge){return this.submitted=!0,Ne(this.form,this._directives),this.ngSubmit.emit(Ge),!1}},{key:"onReset",value:function(){this.resetForm()}},{key:"resetForm",value:function(){var Ge=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.form.reset(Ge),this.submitted=!1}},{key:"_setUpdateStrategy",value:function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}},{key:"_findContainer",value:function(Ge){return Ge.pop(),Ge.length?this.form.get(Ge):this.form}}]),Ce}(rn);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(j,10),_.Y36(J,10))},ie.\u0275dir=_.lG2({type:ie,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(_e,Ce){1&_e&&_.NdJ("submit",function(Ge){return Ce.onSubmit(Ge)})("reset",function(){return Ce.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_._Bn([Yi]),_.qOj]}),ie}(),Xt={provide:kn,useExisting:(0,_.Gpc)(function(){return zn})},Gn=function(){return Promise.resolve(null)}(),zn=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re,Ge,St,ht){var gt;return(0,N.Z)(this,Ce),(gt=_e.call(this)).control=new Ei,gt._registered=!1,gt.update=new _.vpe,gt._parent=Re,gt._setValidators(Ge),gt._setAsyncValidators(St),gt.valueAccessor=Le((0,B.Z)(gt),ht),gt}return(0,b.Z)(Ce,[{key:"ngOnChanges",value:function(Ge){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in Ge&&this._updateDisabled(Ge),he(Ge,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}},{key:"ngOnDestroy",value:function(){this.formDirective&&this.formDirective.removeControl(this)}},{key:"path",get:function(){return this._parent?nn(this.name,this._parent):[this.name]}},{key:"formDirective",get:function(){return this._parent?this._parent.formDirective:null}},{key:"viewToModelUpdate",value:function(Ge){this.viewModel=Ge,this.update.emit(Ge)}},{key:"_setUpControl",value:function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}},{key:"_setUpdateStrategy",value:function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}},{key:"_isStandalone",value:function(){return!this._parent||!(!this.options||!this.options.standalone)}},{key:"_setUpStandalone",value:function(){ln(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}},{key:"_checkForErrors",value:function(){this._isStandalone()||this._checkParentType(),this._checkName()}},{key:"_checkParentType",value:function(){}},{key:"_checkName",value:function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}},{key:"_updateValue",value:function(Ge){var St=this;Gn.then(function(){St.control.setValue(Ge,{emitViewToModelChange:!1})})}},{key:"_updateDisabled",value:function(Ge){var St=this,ht=Ge.isDisabled.currentValue,gt=""===ht||ht&&"false"!==ht;Gn.then(function(){gt&&!St.control.disabled?St.control.disable():!gt&&St.control.disabled&&St.control.enable()})}}]),Ce}(kn);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(rn,9),_.Y36(j,10),_.Y36(J,10),_.Y36(T,10))},ie.\u0275dir=_.lG2({type:ie,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[_._Bn([Xt]),_.qOj,_.TTD]}),ie}(),Vn=function(){var ie=function fe(){(0,N.Z)(this,fe)};return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275dir=_.lG2({type:ie,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),ie}(),si={provide:T,useExisting:(0,_.Gpc)(function(){return Si}),multi:!0},Si=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(){return(0,N.Z)(this,Ce),_e.apply(this,arguments)}return(0,b.Z)(Ce,[{key:"writeValue",value:function(Ge){this.setProperty("value",null==Ge?"":Ge)}},{key:"registerOnChange",value:function(Ge){this.onChange=function(St){Ge(""==St?null:parseFloat(St))}}}]),Ce}(g);return ie.\u0275fac=function(){var fe;return function(Ce){return(fe||(fe=_.n5z(ie)))(Ce||ie)}}(),ie.\u0275dir=_.lG2({type:ie,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(_e,Ce){1&_e&&_.NdJ("input",function(Ge){return Ce.onChange(Ge.target.value)})("blur",function(){return Ce.onTouched()})},features:[_._Bn([si]),_.qOj]}),ie}(),Li=function(){var ie=function fe(){(0,N.Z)(this,fe)};return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275mod=_.oAB({type:ie}),ie.\u0275inj=_.cJS({}),ie}(),Ho=new _.OlP("NgModelWithFormControlWarning"),Ji={provide:rn,useExisting:(0,_.Gpc)(function(){return Vo})},Vo=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re,Ge){var St;return(0,N.Z)(this,Ce),(St=_e.call(this)).validators=Re,St.asyncValidators=Ge,St.submitted=!1,St._onCollectionChange=function(){return St._updateDomValue()},St.directives=[],St.form=null,St.ngSubmit=new _.vpe,St._setValidators(Re),St._setAsyncValidators(Ge),St}return(0,b.Z)(Ce,[{key:"ngOnChanges",value:function(Ge){this._checkFormPresent(),Ge.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}},{key:"ngOnDestroy",value:function(){this.form&&(Cn(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(function(){}))}},{key:"formDirective",get:function(){return this}},{key:"control",get:function(){return this.form}},{key:"path",get:function(){return[]}},{key:"addControl",value:function(Ge){var St=this.form.get(Ge.path);return ln(St,Ge),St.updateValueAndValidity({emitEvent:!1}),this.directives.push(Ge),St}},{key:"getControl",value:function(Ge){return this.form.get(Ge.path)}},{key:"removeControl",value:function(Ge){yn(Ge.control||null,Ge),ze(this.directives,Ge)}},{key:"addFormGroup",value:function(Ge){this._setUpFormContainer(Ge)}},{key:"removeFormGroup",value:function(Ge){this._cleanUpFormContainer(Ge)}},{key:"getFormGroup",value:function(Ge){return this.form.get(Ge.path)}},{key:"addFormArray",value:function(Ge){this._setUpFormContainer(Ge)}},{key:"removeFormArray",value:function(Ge){this._cleanUpFormContainer(Ge)}},{key:"getFormArray",value:function(Ge){return this.form.get(Ge.path)}},{key:"updateModel",value:function(Ge,St){this.form.get(Ge.path).setValue(St)}},{key:"onSubmit",value:function(Ge){return this.submitted=!0,Ne(this.form,this.directives),this.ngSubmit.emit(Ge),!1}},{key:"onReset",value:function(){this.resetForm()}},{key:"resetForm",value:function(){var Ge=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.form.reset(Ge),this.submitted=!1}},{key:"_updateDomValue",value:function(){var Ge=this;this.directives.forEach(function(St){var ht=St.control,gt=Ge.form.get(St.path);ht!==gt&&(yn(ht||null,St),gt instanceof Ei&&(ln(gt,St),St.control=gt))}),this.form._updateTreeValidity({emitEvent:!1})}},{key:"_setUpFormContainer",value:function(Ge){var St=this.form.get(Ge.path);Rt(St,Ge),St.updateValueAndValidity({emitEvent:!1})}},{key:"_cleanUpFormContainer",value:function(Ge){if(this.form){var St=this.form.get(Ge.path);St&&function(ie,fe){return Cn(ie,fe)}(St,Ge)&&St.updateValueAndValidity({emitEvent:!1})}}},{key:"_updateRegistrations",value:function(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){})}},{key:"_updateValidators",value:function(){Yn(this.form,this),this._oldForm&&Cn(this._oldForm,this)}},{key:"_checkFormPresent",value:function(){}}]),Ce}(rn);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(j,10),_.Y36(J,10))},ie.\u0275dir=_.lG2({type:ie,selectors:[["","formGroup",""]],hostBindings:function(_e,Ce){1&_e&&_.NdJ("submit",function(Ge){return Ce.onSubmit(Ge)})("reset",function(){return Ce.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[_._Bn([Ji]),_.qOj,_.TTD]}),ie}(),ho={provide:kn,useExisting:(0,_.Gpc)(function(){return pa})},pa=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(Re,Ge,St,ht,gt){var Jr;return(0,N.Z)(this,Ce),(Jr=_e.call(this))._ngModelWarningConfig=gt,Jr._added=!1,Jr.update=new _.vpe,Jr._ngModelWarningSent=!1,Jr._parent=Re,Jr._setValidators(Ge),Jr._setAsyncValidators(St),Jr.valueAccessor=Le((0,B.Z)(Jr),ht),Jr}return(0,b.Z)(Ce,[{key:"isDisabled",set:function(Ge){}},{key:"ngOnChanges",value:function(Ge){this._added||this._setUpControl(),he(Ge,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}},{key:"ngOnDestroy",value:function(){this.formDirective&&this.formDirective.removeControl(this)}},{key:"viewToModelUpdate",value:function(Ge){this.viewModel=Ge,this.update.emit(Ge)}},{key:"path",get:function(){return nn(null==this.name?this.name:this.name.toString(),this._parent)}},{key:"formDirective",get:function(){return this._parent?this._parent.formDirective:null}},{key:"_checkParentType",value:function(){}},{key:"_setUpControl",value:function(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}]),Ce}(kn);return ie.\u0275fac=function(_e){return new(_e||ie)(_.Y36(rn,13),_.Y36(j,10),_.Y36(J,10),_.Y36(T,10),_.Y36(Ho,8))},ie.\u0275dir=_.lG2({type:ie,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[_._Bn([ho]),_.qOj,_.TTD]}),ie._ngModelWarningSentOnce=!1,ie}(),Ui=function(){var ie=function(){function fe(){(0,N.Z)(this,fe),this._validator=qe}return(0,b.Z)(fe,[{key:"handleChanges",value:function(Ce){if(this.inputName in Ce){var Re=this.normalizeInput(Ce[this.inputName].currentValue);this._validator=this.createValidator(Re),this._onChange&&this._onChange()}}},{key:"validate",value:function(Ce){return this._validator(Ce)}},{key:"registerOnValidatorChange",value:function(Ce){this._onChange=Ce}}]),fe}();return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275dir=_.lG2({type:ie}),ie}(),ma={provide:j,useExisting:(0,_.Gpc)(function(){return zi}),multi:!0},zi=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(){var Re;return(0,N.Z)(this,Ce),(Re=_e.apply(this,arguments)).inputName="max",Re.normalizeInput=function(Ge){return parseFloat(Ge)},Re.createValidator=function(Ge){return se(Ge)},Re}return(0,b.Z)(Ce,[{key:"ngOnChanges",value:function(Ge){this.handleChanges(Ge)}}]),Ce}(Ui);return ie.\u0275fac=function(){var fe;return function(Ce){return(fe||(fe=_.n5z(ie)))(Ce||ie)}}(),ie.\u0275dir=_.lG2({type:ie,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(_e,Ce){var Re;2&_e&&_.uIk("max",null!==(Re=Ce.max)&&void 0!==Re?Re:null)},inputs:{max:"max"},features:[_._Bn([ma]),_.qOj,_.TTD]}),ie}(),va={provide:j,useExisting:(0,_.Gpc)(function(){return ga}),multi:!0},ga=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(){var Re;return(0,N.Z)(this,Ce),(Re=_e.apply(this,arguments)).inputName="min",Re.normalizeInput=function(Ge){return parseFloat(Ge)},Re.createValidator=function(Ge){return ae(Ge)},Re}return(0,b.Z)(Ce,[{key:"ngOnChanges",value:function(Ge){this.handleChanges(Ge)}}]),Ce}(Ui);return ie.\u0275fac=function(){var fe;return function(Ce){return(fe||(fe=_.n5z(ie)))(Ce||ie)}}(),ie.\u0275dir=_.lG2({type:ie,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(_e,Ce){var Re;2&_e&&_.uIk("min",null!==(Re=Ce.min)&&void 0!==Re?Re:null)},inputs:{min:"min"},features:[_._Bn([va]),_.qOj,_.TTD]}),ie}(),gr={provide:j,useExisting:(0,_.Gpc)(function(){return Ma}),multi:!0},Bn={provide:j,useExisting:(0,_.Gpc)(function(){return Hi}),multi:!0},Ma=function(){var ie=function(){function fe(){(0,N.Z)(this,fe),this._required=!1}return(0,b.Z)(fe,[{key:"required",get:function(){return this._required},set:function(Ce){this._required=null!=Ce&&!1!==Ce&&"false"!=="".concat(Ce),this._onChange&&this._onChange()}},{key:"validate",value:function(Ce){return this.required?ce(Ce):null}},{key:"registerOnValidatorChange",value:function(Ce){this._onChange=Ce}}]),fe}();return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275dir=_.lG2({type:ie,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(_e,Ce){2&_e&&_.uIk("required",Ce.required?"":null)},inputs:{required:"required"},features:[_._Bn([gr])]}),ie}(),Hi=function(){var ie=function(fe){(0,Z.Z)(Ce,fe);var _e=(0,w.Z)(Ce);function Ce(){return(0,N.Z)(this,Ce),_e.apply(this,arguments)}return(0,b.Z)(Ce,[{key:"validate",value:function(Ge){return this.required?le(Ge):null}}]),Ce}(Ma);return ie.\u0275fac=function(){var fe;return function(Ce){return(fe||(fe=_.n5z(ie)))(Ce||ie)}}(),ie.\u0275dir=_.lG2({type:ie,selectors:[["input","type","checkbox","required","","formControlName",""],["input","type","checkbox","required","","formControl",""],["input","type","checkbox","required","","ngModel",""]],hostVars:1,hostBindings:function(_e,Ce){2&_e&&_.uIk("required",Ce.required?"":null)},features:[_._Bn([Bn]),_.qOj]}),ie}(),bl=function(){var ie=function fe(){(0,N.Z)(this,fe)};return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275mod=_.oAB({type:ie}),ie.\u0275inj=_.cJS({imports:[[Li]]}),ie}(),Cl=function(){var ie=function fe(){(0,N.Z)(this,fe)};return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275mod=_.oAB({type:ie}),ie.\u0275inj=_.cJS({imports:[bl]}),ie}(),pe=function(){var ie=function(){function fe(){(0,N.Z)(this,fe)}return(0,b.Z)(fe,null,[{key:"withConfig",value:function(Ce){return{ngModule:fe,providers:[{provide:Ho,useValue:Ce.warnOnNgModelWithFormControl}]}}}]),fe}();return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275mod=_.oAB({type:ie}),ie.\u0275inj=_.cJS({imports:[bl]}),ie}();function Fe(ie){return void 0!==ie.asyncValidators||void 0!==ie.validators||void 0!==ie.updateOn}var $e=function(){var ie=function(){function fe(){(0,N.Z)(this,fe)}return(0,b.Z)(fe,[{key:"group",value:function(Ce){var Re=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Ge=this._reduceControls(Ce),St=null,ht=null,gt=void 0;return null!=Re&&(Fe(Re)?(St=null!=Re.validators?Re.validators:null,ht=null!=Re.asyncValidators?Re.asyncValidators:null,gt=null!=Re.updateOn?Re.updateOn:void 0):(St=null!=Re.validator?Re.validator:null,ht=null!=Re.asyncValidator?Re.asyncValidator:null)),new no(Ge,{asyncValidators:ht,updateOn:gt,validators:St})}},{key:"control",value:function(Ce,Re,Ge){return new Ei(Ce,Re,Ge)}},{key:"array",value:function(Ce,Re,Ge){var St=this,ht=Ce.map(function(gt){return St._createControl(gt)});return new vi(ht,Re,Ge)}},{key:"_reduceControls",value:function(Ce){var Re=this,Ge={};return Object.keys(Ce).forEach(function(St){Ge[St]=Re._createControl(Ce[St])}),Ge}},{key:"_createControl",value:function(Ce){return Ce instanceof Ei||Ce instanceof no||Ce instanceof vi?Ce:Array.isArray(Ce)?this.control(Ce[0],Ce.length>1?Ce[1]:null,Ce.length>2?Ce[2]:null):this.control(Ce)}}]),fe}();return ie.\u0275fac=function(_e){return new(_e||ie)},ie.\u0275prov=(0,_.Yz7)({factory:function(){return new ie},token:ie,providedIn:pe}),ie}()},59412:function(ue,q,f){"use strict";f.d(q,{yN:function(){return ee},mZ:function(){return $},rD:function(){return rn},K7:function(){return In},HF:function(){return nn},Y2:function(){return ct},BQ:function(){return le},X2:function(){return kn},uc:function(){return $n},Nv:function(){return Yn},ey:function(){return ur},Ng:function(){return Lt},nP:function(){return Kt},us:function(){return Jt},wG:function(){return ft},si:function(){return Yt},IR:function(){return ye},CB:function(){return Ut},jH:function(){return Rt},pj:function(){return Ae},Kr:function(){return be},Id:function(){return oe},FD:function(){return qe},dB:function(){return _t},sb:function(){return it},E0:function(){return Ln}}),f(88009),f(13920),f(89200);var Z=f(10509),w=f(97154),N=f(14105),b=f(18967),_=f(38999),I=f(6517),D=f(8392),A=new _.GfV("12.2.12"),S=f(40098),v=f(15427),g=f(78081),T=f(68707),R=f(89797),k=f(57682),E=f(38480),x=f(32819),O=["*",[["mat-option"],["ng-container"]]],F=["*","mat-option, ng-container"];function z(Oe,rt){if(1&Oe&&_._UZ(0,"mat-pseudo-checkbox",4),2&Oe){var he=_.oxw();_.Q6J("state",he.selected?"checked":"unchecked")("disabled",he.disabled)}}function K(Oe,rt){if(1&Oe&&(_.TgZ(0,"span",5),_._uU(1),_.qZA()),2&Oe){var he=_.oxw();_.xp6(1),_.hij("(",he.group.label,")")}}var j=["*"],ee=function(){var Oe=function rt(){(0,b.Z)(this,rt)};return Oe.STANDARD_CURVE="cubic-bezier(0.4,0.0,0.2,1)",Oe.DECELERATION_CURVE="cubic-bezier(0.0,0.0,0.2,1)",Oe.ACCELERATION_CURVE="cubic-bezier(0.4,0.0,1,1)",Oe.SHARP_CURVE="cubic-bezier(0.4,0.0,0.6,1)",Oe}(),$=function(){var Oe=function rt(){(0,b.Z)(this,rt)};return Oe.COMPLEX="375ms",Oe.ENTERING="225ms",Oe.EXITING="195ms",Oe}(),ae=new _.GfV("12.2.12"),ce=new _.OlP("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}}),le=function(){var Oe=function(){function rt(he,Ie,Ne){(0,b.Z)(this,rt),this._hasDoneGlobalChecks=!1,this._document=Ne,he._applyBodyHighContrastModeCssClasses(),this._sanityChecks=Ie,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}return(0,N.Z)(rt,[{key:"_checkIsEnabled",value:function(Ie){return!(!(0,_.X6Q)()||(0,v.Oy)())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[Ie])}},{key:"_checkDoctypeIsDefined",value:function(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}},{key:"_checkThemeIsPresent",value:function(){if(this._checkIsEnabled("theme")&&this._document.body&&"function"==typeof getComputedStyle){var Ie=this._document.createElement("div");Ie.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(Ie);var Ne=getComputedStyle(Ie);Ne&&"none"!==Ne.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(Ie)}}},{key:"_checkCdkVersionMatch",value:function(){this._checkIsEnabled("version")&&ae.full!==A.full&&console.warn("The Angular Material version ("+ae.full+") does not match the Angular CDK version ("+A.full+").\nPlease ensure the versions of these two packages exactly match.")}}]),rt}();return Oe.\u0275fac=function(he){return new(he||Oe)(_.LFG(I.qm),_.LFG(ce,8),_.LFG(S.K0))},Oe.\u0275mod=_.oAB({type:Oe}),Oe.\u0275inj=_.cJS({imports:[[D.vT],D.vT]}),Oe}();function oe(Oe){return function(rt){(0,Z.Z)(Ie,rt);var he=(0,w.Z)(Ie);function Ie(){var Ne;(0,b.Z)(this,Ie);for(var Le=arguments.length,ze=new Array(Le),At=0;At1&&void 0!==arguments[1]?arguments[1]:0;return function(he){(0,Z.Z)(Ne,he);var Ie=(0,w.Z)(Ne);function Ne(){var Le;(0,b.Z)(this,Ne);for(var ze=arguments.length,At=new Array(ze),an=0;an2&&void 0!==arguments[2]?arguments[2]:"mat";Oe.changes.pipe((0,k.O)(Oe)).subscribe(function(Ie){var Ne=Ie.length;Rn(rt,"".concat(he,"-2-line"),!1),Rn(rt,"".concat(he,"-3-line"),!1),Rn(rt,"".concat(he,"-multi-line"),!1),2===Ne||3===Ne?Rn(rt,"".concat(he,"-").concat(Ne,"-line"),!0):Ne>3&&Rn(rt,"".concat(he,"-multi-line"),!0)})}function Rn(Oe,rt,he){var Ie=Oe.nativeElement.classList;he?Ie.add(rt):Ie.remove(rt)}var $n=function(){var Oe=function rt(){(0,b.Z)(this,rt)};return Oe.\u0275fac=function(he){return new(he||Oe)},Oe.\u0275mod=_.oAB({type:Oe}),Oe.\u0275inj=_.cJS({imports:[[le],le]}),Oe}(),Nn=function(){function Oe(rt,he,Ie){(0,b.Z)(this,Oe),this._renderer=rt,this.element=he,this.config=Ie,this.state=3}return(0,N.Z)(Oe,[{key:"fadeOut",value:function(){this._renderer.fadeOutRipple(this)}}]),Oe}(),wn={enterDuration:225,exitDuration:150},ut=(0,v.i$)({passive:!0}),He=["mousedown","touchstart"],ve=["mouseup","mouseleave","touchend","touchcancel"],ye=function(){function Oe(rt,he,Ie,Ne){(0,b.Z)(this,Oe),this._target=rt,this._ngZone=he,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,Ne.isBrowser&&(this._containerElement=(0,g.fI)(Ie))}return(0,N.Z)(Oe,[{key:"fadeInRipple",value:function(he,Ie){var Ne=this,Le=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},ze=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),At=Object.assign(Object.assign({},wn),Le.animation);Le.centered&&(he=ze.left+ze.width/2,Ie=ze.top+ze.height/2);var an=Le.radius||we(he,Ie,ze),jn=he-ze.left,Rr=Ie-ze.top,Hr=At.enterDuration,yr=document.createElement("div");yr.classList.add("mat-ripple-element"),yr.style.left="".concat(jn-an,"px"),yr.style.top="".concat(Rr-an,"px"),yr.style.height="".concat(2*an,"px"),yr.style.width="".concat(2*an,"px"),null!=Le.color&&(yr.style.backgroundColor=Le.color),yr.style.transitionDuration="".concat(Hr,"ms"),this._containerElement.appendChild(yr),Te(yr),yr.style.transform="scale(1)";var Yr=new Nn(this,yr,Le);return Yr.state=0,this._activeRipples.add(Yr),Le.persistent||(this._mostRecentTransientRipple=Yr),this._runTimeoutOutsideZone(function(){var co=Yr===Ne._mostRecentTransientRipple;Yr.state=1,!Le.persistent&&(!co||!Ne._isPointerDown)&&Yr.fadeOut()},Hr),Yr}},{key:"fadeOutRipple",value:function(he){var Ie=this._activeRipples.delete(he);if(he===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),Ie){var Ne=he.element,Le=Object.assign(Object.assign({},wn),he.config.animation);Ne.style.transitionDuration="".concat(Le.exitDuration,"ms"),Ne.style.opacity="0",he.state=2,this._runTimeoutOutsideZone(function(){he.state=3,Ne.parentNode.removeChild(Ne)},Le.exitDuration)}}},{key:"fadeOutAll",value:function(){this._activeRipples.forEach(function(he){return he.fadeOut()})}},{key:"fadeOutAllNonPersistent",value:function(){this._activeRipples.forEach(function(he){he.config.persistent||he.fadeOut()})}},{key:"setupTriggerEvents",value:function(he){var Ie=(0,g.fI)(he);!Ie||Ie===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=Ie,this._registerEvents(He))}},{key:"handleEvent",value:function(he){"mousedown"===he.type?this._onMousedown(he):"touchstart"===he.type?this._onTouchStart(he):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(ve),this._pointerUpEventsRegistered=!0)}},{key:"_onMousedown",value:function(he){var Ie=(0,I.X6)(he),Ne=this._lastTouchStartEvent&&Date.now()1&&void 0!==arguments[1]?arguments[1]:0;this._ngZone.runOutsideAngular(function(){return setTimeout(he,Ie)})}},{key:"_registerEvents",value:function(he){var Ie=this;this._ngZone.runOutsideAngular(function(){he.forEach(function(Ne){Ie._triggerElement.addEventListener(Ne,Ie,ut)})})}},{key:"_removeTriggerEvents",value:function(){var he=this;this._triggerElement&&(He.forEach(function(Ie){he._triggerElement.removeEventListener(Ie,he,ut)}),this._pointerUpEventsRegistered&&ve.forEach(function(Ie){he._triggerElement.removeEventListener(Ie,he,ut)}))}}]),Oe}();function Te(Oe){window.getComputedStyle(Oe).getPropertyValue("opacity")}function we(Oe,rt,he){var Ie=Math.max(Math.abs(Oe-he.left),Math.abs(Oe-he.right)),Ne=Math.max(Math.abs(rt-he.top),Math.abs(rt-he.bottom));return Math.sqrt(Ie*Ie+Ne*Ne)}var ct=new _.OlP("mat-ripple-global-options"),ft=function(){var Oe=function(){function rt(he,Ie,Ne,Le,ze){(0,b.Z)(this,rt),this._elementRef=he,this._animationMode=ze,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=Le||{},this._rippleRenderer=new ye(this,Ie,he,Ne)}return(0,N.Z)(rt,[{key:"disabled",get:function(){return this._disabled},set:function(Ie){Ie&&this.fadeOutAllNonPersistent(),this._disabled=Ie,this._setupTriggerEventsIfEnabled()}},{key:"trigger",get:function(){return this._trigger||this._elementRef.nativeElement},set:function(Ie){this._trigger=Ie,this._setupTriggerEventsIfEnabled()}},{key:"ngOnInit",value:function(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}},{key:"ngOnDestroy",value:function(){this._rippleRenderer._removeTriggerEvents()}},{key:"fadeOutAll",value:function(){this._rippleRenderer.fadeOutAll()}},{key:"fadeOutAllNonPersistent",value:function(){this._rippleRenderer.fadeOutAllNonPersistent()}},{key:"rippleConfig",get:function(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}},{key:"rippleDisabled",get:function(){return this.disabled||!!this._globalOptions.disabled}},{key:"_setupTriggerEventsIfEnabled",value:function(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}},{key:"launch",value:function(Ie){var Ne=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,Le=arguments.length>2?arguments[2]:void 0;return"number"==typeof Ie?this._rippleRenderer.fadeInRipple(Ie,Ne,Object.assign(Object.assign({},this.rippleConfig),Le)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),Ie))}}]),rt}();return Oe.\u0275fac=function(he){return new(he||Oe)(_.Y36(_.SBq),_.Y36(_.R0b),_.Y36(v.t4),_.Y36(ct,8),_.Y36(E.Qb,8))},Oe.\u0275dir=_.lG2({type:Oe,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(he,Ie){2&he&&_.ekj("mat-ripple-unbounded",Ie.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),Oe}(),Yt=function(){var Oe=function rt(){(0,b.Z)(this,rt)};return Oe.\u0275fac=function(he){return new(he||Oe)},Oe.\u0275mod=_.oAB({type:Oe}),Oe.\u0275inj=_.cJS({imports:[[le,v.ud],le]}),Oe}(),Kt=function(){var Oe=function rt(he){(0,b.Z)(this,rt),this._animationMode=he,this.state="unchecked",this.disabled=!1};return Oe.\u0275fac=function(he){return new(he||Oe)(_.Y36(E.Qb,8))},Oe.\u0275cmp=_.Xpm({type:Oe,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(he,Ie){2&he&&_.ekj("mat-pseudo-checkbox-indeterminate","indeterminate"===Ie.state)("mat-pseudo-checkbox-checked","checked"===Ie.state)("mat-pseudo-checkbox-disabled",Ie.disabled)("_mat-animation-noopable","NoopAnimations"===Ie._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(he,Ie){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),Oe}(),Jt=function(){var Oe=function rt(){(0,b.Z)(this,rt)};return Oe.\u0275fac=function(he){return new(he||Oe)},Oe.\u0275mod=_.oAB({type:Oe}),Oe.\u0275inj=_.cJS({imports:[[le]]}),Oe}(),nn=new _.OlP("MAT_OPTION_PARENT_COMPONENT"),ln=oe(function(){return function Oe(){(0,b.Z)(this,Oe)}}()),yn=0,Tn=function(){var Oe=function(rt){(0,Z.Z)(Ie,rt);var he=(0,w.Z)(Ie);function Ie(Ne){var Le,ze;return(0,b.Z)(this,Ie),(Le=he.call(this))._labelId="mat-optgroup-label-".concat(yn++),Le._inert=null!==(ze=null==Ne?void 0:Ne.inertGroups)&&void 0!==ze&&ze,Le}return Ie}(ln);return Oe.\u0275fac=function(he){return new(he||Oe)(_.Y36(nn,8))},Oe.\u0275dir=_.lG2({type:Oe,inputs:{label:"label"},features:[_.qOj]}),Oe}(),In=new _.OlP("MatOptgroup"),Yn=function(){var Oe=function(rt){(0,Z.Z)(Ie,rt);var he=(0,w.Z)(Ie);function Ie(){return(0,b.Z)(this,Ie),he.apply(this,arguments)}return Ie}(Tn);return Oe.\u0275fac=function(){var rt;return function(Ie){return(rt||(rt=_.n5z(Oe)))(Ie||Oe)}}(),Oe.\u0275cmp=_.Xpm({type:Oe,selectors:[["mat-optgroup"]],hostAttrs:[1,"mat-optgroup"],hostVars:5,hostBindings:function(he,Ie){2&he&&(_.uIk("role",Ie._inert?null:"group")("aria-disabled",Ie._inert?null:Ie.disabled.toString())("aria-labelledby",Ie._inert?null:Ie._labelId),_.ekj("mat-optgroup-disabled",Ie.disabled))},inputs:{disabled:"disabled"},exportAs:["matOptgroup"],features:[_._Bn([{provide:In,useExisting:Oe}]),_.qOj],ngContentSelectors:F,decls:4,vars:2,consts:[["aria-hidden","true",1,"mat-optgroup-label",3,"id"]],template:function(he,Ie){1&he&&(_.F$t(O),_.TgZ(0,"span",0),_._uU(1),_.Hsn(2),_.qZA(),_.Hsn(3,1)),2&he&&(_.Q6J("id",Ie._labelId),_.xp6(1),_.hij("",Ie.label," "))},styles:[".mat-optgroup-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup-label[disabled]{cursor:default}[dir=rtl] .mat-optgroup-label{text-align:right}.mat-optgroup-label .mat-icon{margin-right:16px;vertical-align:middle}.mat-optgroup-label .mat-icon svg{vertical-align:top}[dir=rtl] .mat-optgroup-label .mat-icon{margin-left:16px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),Oe}(),Cn=0,Sn=function Oe(rt){var he=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,b.Z)(this,Oe),this.source=rt,this.isUserInput=he},tr=function(){var Oe=function(){function rt(he,Ie,Ne,Le){(0,b.Z)(this,rt),this._element=he,this._changeDetectorRef=Ie,this._parent=Ne,this.group=Le,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-".concat(Cn++),this.onSelectionChange=new _.vpe,this._stateChanges=new T.xQ}return(0,N.Z)(rt,[{key:"multiple",get:function(){return this._parent&&this._parent.multiple}},{key:"selected",get:function(){return this._selected}},{key:"disabled",get:function(){return this.group&&this.group.disabled||this._disabled},set:function(Ie){this._disabled=(0,g.Ig)(Ie)}},{key:"disableRipple",get:function(){return this._parent&&this._parent.disableRipple}},{key:"active",get:function(){return this._active}},{key:"viewValue",get:function(){return(this._getHostElement().textContent||"").trim()}},{key:"select",value:function(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}},{key:"deselect",value:function(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}},{key:"focus",value:function(Ie,Ne){var Le=this._getHostElement();"function"==typeof Le.focus&&Le.focus(Ne)}},{key:"setActiveStyles",value:function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}},{key:"setInactiveStyles",value:function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}},{key:"getLabel",value:function(){return this.viewValue}},{key:"_handleKeydown",value:function(Ie){(Ie.keyCode===x.K5||Ie.keyCode===x.L_)&&!(0,x.Vb)(Ie)&&(this._selectViaInteraction(),Ie.preventDefault())}},{key:"_selectViaInteraction",value:function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}},{key:"_getAriaSelected",value:function(){return this.selected||!this.multiple&&null}},{key:"_getTabIndex",value:function(){return this.disabled?"-1":"0"}},{key:"_getHostElement",value:function(){return this._element.nativeElement}},{key:"ngAfterViewChecked",value:function(){if(this._selected){var Ie=this.viewValue;Ie!==this._mostRecentViewValue&&(this._mostRecentViewValue=Ie,this._stateChanges.next())}}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}},{key:"_emitSelectionChangeEvent",value:function(){var Ie=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.onSelectionChange.emit(new Sn(this,Ie))}}]),rt}();return Oe.\u0275fac=function(he){return new(he||Oe)(_.Y36(_.SBq),_.Y36(_.sBO),_.Y36(void 0),_.Y36(Tn))},Oe.\u0275dir=_.lG2({type:Oe,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),Oe}(),ur=function(){var Oe=function(rt){(0,Z.Z)(Ie,rt);var he=(0,w.Z)(Ie);function Ie(Ne,Le,ze,At){return(0,b.Z)(this,Ie),he.call(this,Ne,Le,ze,At)}return Ie}(tr);return Oe.\u0275fac=function(he){return new(he||Oe)(_.Y36(_.SBq),_.Y36(_.sBO),_.Y36(nn,8),_.Y36(In,8))},Oe.\u0275cmp=_.Xpm({type:Oe,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(he,Ie){1&he&&_.NdJ("click",function(){return Ie._selectViaInteraction()})("keydown",function(Le){return Ie._handleKeydown(Le)}),2&he&&(_.Ikx("id",Ie.id),_.uIk("tabindex",Ie._getTabIndex())("aria-selected",Ie._getAriaSelected())("aria-disabled",Ie.disabled.toString()),_.ekj("mat-selected",Ie.selected)("mat-option-multiple",Ie.multiple)("mat-active",Ie.active)("mat-option-disabled",Ie.disabled))},exportAs:["matOption"],features:[_.qOj],ngContentSelectors:j,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(he,Ie){1&he&&(_.F$t(),_.YNc(0,z,1,2,"mat-pseudo-checkbox",0),_.TgZ(1,"span",1),_.Hsn(2),_.qZA(),_.YNc(3,K,2,1,"span",2),_._UZ(4,"div",3)),2&he&&(_.Q6J("ngIf",Ie.multiple),_.xp6(3),_.Q6J("ngIf",Ie.group&&Ie.group._inert),_.xp6(1),_.Q6J("matRippleTrigger",Ie._getHostElement())("matRippleDisabled",Ie.disabled||Ie.disableRipple))},directives:[S.O5,ft,Kt],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),Oe}();function Ut(Oe,rt,he){if(he.length){for(var Ie=rt.toArray(),Ne=he.toArray(),Le=0,ze=0;zehe+Ie?Math.max(0,Oe-Ie+rt):he}var Lt=function(){var Oe=function rt(){(0,b.Z)(this,rt)};return Oe.\u0275fac=function(he){return new(he||Oe)},Oe.\u0275mod=_.oAB({type:Oe}),Oe.\u0275inj=_.cJS({imports:[[Yt,S.ez,le,Jt]]}),Oe}()},93386:function(ue,q,f){"use strict";f.d(q,{d:function(){return N},t:function(){return b}});var B=f(18967),U=f(14105),V=f(78081),Z=f(59412),w=f(38999),N=function(){var _=function(){function I(){(0,B.Z)(this,I),this._vertical=!1,this._inset=!1}return(0,U.Z)(I,[{key:"vertical",get:function(){return this._vertical},set:function(A){this._vertical=(0,V.Ig)(A)}},{key:"inset",get:function(){return this._inset},set:function(A){this._inset=(0,V.Ig)(A)}}]),I}();return _.\u0275fac=function(D){return new(D||_)},_.\u0275cmp=w.Xpm({type:_,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(D,A){2&D&&(w.uIk("aria-orientation",A.vertical?"vertical":"horizontal"),w.ekj("mat-divider-vertical",A.vertical)("mat-divider-horizontal",!A.vertical)("mat-divider-inset",A.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(D,A){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),_}(),b=function(){var _=function I(){(0,B.Z)(this,I)};return _.\u0275fac=function(D){return new(D||_)},_.\u0275mod=w.oAB({type:_}),_.\u0275inj=w.cJS({imports:[[Z.BQ],Z.BQ]}),_}()},36410:function(ue,q,f){"use strict";f.d(q,{G_:function(){return Nn},TO:function(){return xe},KE:function(){return wn},Eo:function(){return je},lN:function(){return _r},hX:function(){return Ht},R9:function(){return Nt}});var B=f(62467),U=f(14105),V=f(10509),Z=f(97154),w=f(18967),N=f(96798),b=f(40098),_=f(38999),I=f(59412),D=f(78081),A=f(68707),S=f(55371),v=f(33090),g=f(57682),T=f(44213),R=f(48359),k=f(739),E=f(38480),x=f(8392),O=f(15427),F=["underline"],z=["connectionContainer"],K=["inputContainer"],j=["label"];function J(ut,He){1&ut&&(_.ynx(0),_.TgZ(1,"div",14),_._UZ(2,"div",15),_._UZ(3,"div",16),_._UZ(4,"div",17),_.qZA(),_.TgZ(5,"div",18),_._UZ(6,"div",15),_._UZ(7,"div",16),_._UZ(8,"div",17),_.qZA(),_.BQk())}function ee(ut,He){1&ut&&(_.TgZ(0,"div",19),_.Hsn(1,1),_.qZA())}function $(ut,He){if(1&ut&&(_.ynx(0),_.Hsn(1,2),_.TgZ(2,"span"),_._uU(3),_.qZA(),_.BQk()),2&ut){var ve=_.oxw(2);_.xp6(3),_.Oqu(ve._control.placeholder)}}function ae(ut,He){1&ut&&_.Hsn(0,3,["*ngSwitchCase","true"])}function se(ut,He){1&ut&&(_.TgZ(0,"span",23),_._uU(1," *"),_.qZA())}function ce(ut,He){if(1&ut){var ve=_.EpF();_.TgZ(0,"label",20,21),_.NdJ("cdkObserveContent",function(){return _.CHM(ve),_.oxw().updateOutlineGap()}),_.YNc(2,$,4,1,"ng-container",12),_.YNc(3,ae,1,0,"ng-content",12),_.YNc(4,se,2,0,"span",22),_.qZA()}if(2&ut){var ye=_.oxw();_.ekj("mat-empty",ye._control.empty&&!ye._shouldAlwaysFloat())("mat-form-field-empty",ye._control.empty&&!ye._shouldAlwaysFloat())("mat-accent","accent"==ye.color)("mat-warn","warn"==ye.color),_.Q6J("cdkObserveContentDisabled","outline"!=ye.appearance)("id",ye._labelId)("ngSwitch",ye._hasLabel()),_.uIk("for",ye._control.id)("aria-owns",ye._control.id),_.xp6(2),_.Q6J("ngSwitchCase",!1),_.xp6(1),_.Q6J("ngSwitchCase",!0),_.xp6(1),_.Q6J("ngIf",!ye.hideRequiredMarker&&ye._control.required&&!ye._control.disabled)}}function le(ut,He){1&ut&&(_.TgZ(0,"div",24),_.Hsn(1,4),_.qZA())}function oe(ut,He){if(1&ut&&(_.TgZ(0,"div",25,26),_._UZ(2,"span",27),_.qZA()),2&ut){var ve=_.oxw();_.xp6(2),_.ekj("mat-accent","accent"==ve.color)("mat-warn","warn"==ve.color)}}function Ae(ut,He){if(1&ut&&(_.TgZ(0,"div"),_.Hsn(1,5),_.qZA()),2&ut){var ve=_.oxw();_.Q6J("@transitionMessages",ve._subscriptAnimationState)}}function be(ut,He){if(1&ut&&(_.TgZ(0,"div",31),_._uU(1),_.qZA()),2&ut){var ve=_.oxw(2);_.Q6J("id",ve._hintLabelId),_.xp6(1),_.Oqu(ve.hintLabel)}}function it(ut,He){if(1&ut&&(_.TgZ(0,"div",28),_.YNc(1,be,2,2,"div",29),_.Hsn(2,6),_._UZ(3,"div",30),_.Hsn(4,7),_.qZA()),2&ut){var ve=_.oxw();_.Q6J("@transitionMessages",ve._subscriptAnimationState),_.xp6(1),_.Q6J("ngIf",ve.hintLabel)}}var qe=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],_t=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],yt=0,Ft=new _.OlP("MatError"),xe=function(){var ut=function He(ve,ye){(0,w.Z)(this,He),this.id="mat-error-".concat(yt++),ve||ye.nativeElement.setAttribute("aria-live","polite")};return ut.\u0275fac=function(ve){return new(ve||ut)(_.$8M("aria-live"),_.Y36(_.SBq))},ut.\u0275dir=_.lG2({type:ut,selectors:[["mat-error"]],hostAttrs:["aria-atomic","true",1,"mat-error"],hostVars:1,hostBindings:function(ve,ye){2&ve&&_.uIk("id",ye.id)},inputs:{id:"id"},features:[_._Bn([{provide:Ft,useExisting:ut}])]}),ut}(),De={transitionMessages:(0,k.X$)("transitionMessages",[(0,k.SB)("enter",(0,k.oB)({opacity:1,transform:"translateY(0%)"})),(0,k.eR)("void => enter",[(0,k.oB)({opacity:0,transform:"translateY(-5px)"}),(0,k.jt)("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},je=function(){var ut=function He(){(0,w.Z)(this,He)};return ut.\u0275fac=function(ve){return new(ve||ut)},ut.\u0275dir=_.lG2({type:ut}),ut}(),vt=new _.OlP("MatHint"),Ht=function(){var ut=function He(){(0,w.Z)(this,He)};return ut.\u0275fac=function(ve){return new(ve||ut)},ut.\u0275dir=_.lG2({type:ut,selectors:[["mat-label"]]}),ut}(),Ct=function(){var ut=function He(){(0,w.Z)(this,He)};return ut.\u0275fac=function(ve){return new(ve||ut)},ut.\u0275dir=_.lG2({type:ut,selectors:[["mat-placeholder"]]}),ut}(),qt=new _.OlP("MatPrefix"),en=new _.OlP("MatSuffix"),Nt=function(){var ut=function He(){(0,w.Z)(this,He)};return ut.\u0275fac=function(ve){return new(ve||ut)},ut.\u0275dir=_.lG2({type:ut,selectors:[["","matSuffix",""]],features:[_._Bn([{provide:en,useExisting:ut}])]}),ut}(),rn=0,Rn=(0,I.pj)(function(){return function ut(He){(0,w.Z)(this,ut),this._elementRef=He}}(),"primary"),$n=new _.OlP("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Nn=new _.OlP("MatFormField"),wn=function(){var ut=function(He){(0,V.Z)(ye,He);var ve=(0,Z.Z)(ye);function ye(Te,we,ct,ft,Yt,Kt,Jt,nn){var ln;return(0,w.Z)(this,ye),(ln=ve.call(this,Te))._changeDetectorRef=we,ln._dir=ft,ln._defaults=Yt,ln._platform=Kt,ln._ngZone=Jt,ln._outlineGapCalculationNeededImmediately=!1,ln._outlineGapCalculationNeededOnStable=!1,ln._destroyed=new A.xQ,ln._showAlwaysAnimate=!1,ln._subscriptAnimationState="",ln._hintLabel="",ln._hintLabelId="mat-hint-".concat(rn++),ln._labelId="mat-form-field-label-".concat(rn++),ln.floatLabel=ln._getDefaultFloatLabelState(),ln._animationsEnabled="NoopAnimations"!==nn,ln.appearance=Yt&&Yt.appearance?Yt.appearance:"legacy",ln._hideRequiredMarker=!(!Yt||null==Yt.hideRequiredMarker)&&Yt.hideRequiredMarker,ln}return(0,U.Z)(ye,[{key:"appearance",get:function(){return this._appearance},set:function(we){var ct=this._appearance;this._appearance=we||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&ct!==we&&(this._outlineGapCalculationNeededOnStable=!0)}},{key:"hideRequiredMarker",get:function(){return this._hideRequiredMarker},set:function(we){this._hideRequiredMarker=(0,D.Ig)(we)}},{key:"_shouldAlwaysFloat",value:function(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}},{key:"_canLabelFloat",value:function(){return"never"!==this.floatLabel}},{key:"hintLabel",get:function(){return this._hintLabel},set:function(we){this._hintLabel=we,this._processHints()}},{key:"floatLabel",get:function(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel},set:function(we){we!==this._floatLabel&&(this._floatLabel=we||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}},{key:"_control",get:function(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic},set:function(we){this._explicitFormFieldControl=we}},{key:"getLabelId",value:function(){return this._hasFloatingLabel()?this._labelId:null}},{key:"getConnectedOverlayOrigin",value:function(){return this._connectionContainerRef||this._elementRef}},{key:"ngAfterContentInit",value:function(){var we=this;this._validateControlChild();var ct=this._control;ct.controlType&&this._elementRef.nativeElement.classList.add("mat-form-field-type-".concat(ct.controlType)),ct.stateChanges.pipe((0,g.O)(null)).subscribe(function(){we._validatePlaceholders(),we._syncDescribedByIds(),we._changeDetectorRef.markForCheck()}),ct.ngControl&&ct.ngControl.valueChanges&&ct.ngControl.valueChanges.pipe((0,T.R)(this._destroyed)).subscribe(function(){return we._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(function(){we._ngZone.onStable.pipe((0,T.R)(we._destroyed)).subscribe(function(){we._outlineGapCalculationNeededOnStable&&we.updateOutlineGap()})}),(0,S.T)(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(function(){we._outlineGapCalculationNeededOnStable=!0,we._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe((0,g.O)(null)).subscribe(function(){we._processHints(),we._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe((0,g.O)(null)).subscribe(function(){we._syncDescribedByIds(),we._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe((0,T.R)(this._destroyed)).subscribe(function(){"function"==typeof requestAnimationFrame?we._ngZone.runOutsideAngular(function(){requestAnimationFrame(function(){return we.updateOutlineGap()})}):we.updateOutlineGap()})}},{key:"ngAfterContentChecked",value:function(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}},{key:"ngAfterViewInit",value:function(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_shouldForward",value:function(we){var ct=this._control?this._control.ngControl:null;return ct&&ct[we]}},{key:"_hasPlaceholder",value:function(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}},{key:"_hasLabel",value:function(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}},{key:"_shouldLabelFloat",value:function(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}},{key:"_hideControlPlaceholder",value:function(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}},{key:"_hasFloatingLabel",value:function(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}},{key:"_getDisplayedMessages",value:function(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}},{key:"_animateAndLockLabel",value:function(){var we=this;this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,(0,v.R)(this._label.nativeElement,"transitionend").pipe((0,R.q)(1)).subscribe(function(){we._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}},{key:"_validatePlaceholders",value:function(){}},{key:"_processHints",value:function(){this._validateHints(),this._syncDescribedByIds()}},{key:"_validateHints",value:function(){}},{key:"_getDefaultFloatLabelState",value:function(){return this._defaults&&this._defaults.floatLabel||"auto"}},{key:"_syncDescribedByIds",value:function(){if(this._control){var we=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&we.push.apply(we,(0,B.Z)(this._control.userAriaDescribedBy.split(" "))),"hint"===this._getDisplayedMessages()){var ct=this._hintChildren?this._hintChildren.find(function(Yt){return"start"===Yt.align}):null,ft=this._hintChildren?this._hintChildren.find(function(Yt){return"end"===Yt.align}):null;ct?we.push(ct.id):this._hintLabel&&we.push(this._hintLabelId),ft&&we.push(ft.id)}else this._errorChildren&&we.push.apply(we,(0,B.Z)(this._errorChildren.map(function(Yt){return Yt.id})));this._control.setDescribedByIds(we)}}},{key:"_validateControlChild",value:function(){}},{key:"updateOutlineGap",value:function(){var we=this._label?this._label.nativeElement:null;if("outline"===this.appearance&&we&&we.children.length&&we.textContent.trim()&&this._platform.isBrowser){if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);var ct=0,ft=0,Yt=this._connectionContainerRef.nativeElement,Kt=Yt.querySelectorAll(".mat-form-field-outline-start"),Jt=Yt.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){var nn=Yt.getBoundingClientRect();if(0===nn.width&&0===nn.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);for(var ln=this._getStartEnd(nn),yn=we.children,Tn=this._getStartEnd(yn[0].getBoundingClientRect()),In=0,Yn=0;Yn0?.75*In+10:0}for(var Cn=0;Cn void",(0,se.IO)("@transformPanel",[(0,se.pV)()],{optional:!0}))]),transformPanel:(0,se.X$)("transformPanel",[(0,se.SB)("void",(0,se.oB)({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),(0,se.SB)("showing",(0,se.oB)({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),(0,se.SB)("showing-multiple",(0,se.oB)({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),(0,se.eR)("void => *",(0,se.jt)("120ms cubic-bezier(0, 0, 0.2, 1)")),(0,se.eR)("* => void",(0,se.jt)("100ms 25ms linear",(0,se.oB)({opacity:0})))])},Bt=0,bt=new A.OlP("mat-select-scroll-strategy"),Nt=new A.OlP("MAT_SELECT_CONFIG"),rn={provide:bt,deps:[I.aV],useFactory:function(ut){return function(){return ut.scrollStrategies.reposition()}}},kn=function ut(He,ve){(0,_.Z)(this,ut),this.source=He,this.value=ve},Ln=(0,S.Kr)((0,S.sb)((0,S.Id)((0,S.FD)(function(){return function ut(He,ve,ye,Te,we){(0,_.Z)(this,ut),this._elementRef=He,this._defaultErrorStateMatcher=ve,this._parentForm=ye,this._parentFormGroup=Te,this.ngControl=we}}())))),Rn=new A.OlP("MatSelectTrigger"),Nn=function(){var ut=function(He){(0,N.Z)(ye,He);var ve=(0,b.Z)(ye);function ye(Te,we,ct,ft,Yt,Kt,Jt,nn,ln,yn,Tn,In,Yn,Cn){var Sn,tr,ur,Ut;return(0,_.Z)(this,ye),(Sn=ve.call(this,Yt,ft,Jt,nn,yn))._viewportRuler=Te,Sn._changeDetectorRef=we,Sn._ngZone=ct,Sn._dir=Kt,Sn._parentFormField=ln,Sn._liveAnnouncer=Yn,Sn._defaultOptions=Cn,Sn._panelOpen=!1,Sn._compareWith=function(Rt,Lt){return Rt===Lt},Sn._uid="mat-select-".concat(Bt++),Sn._triggerAriaLabelledBy=null,Sn._destroy=new x.xQ,Sn._onChange=function(){},Sn._onTouched=function(){},Sn._valueId="mat-select-value-".concat(Bt++),Sn._panelDoneAnimatingStream=new x.xQ,Sn._overlayPanelClass=(null===(tr=Sn._defaultOptions)||void 0===tr?void 0:tr.overlayPanelClass)||"",Sn._focused=!1,Sn.controlType="mat-select",Sn._required=!1,Sn._multiple=!1,Sn._disableOptionCentering=null!==(Ut=null===(ur=Sn._defaultOptions)||void 0===ur?void 0:ur.disableOptionCentering)&&void 0!==Ut&&Ut,Sn.ariaLabel="",Sn.optionSelectionChanges=(0,O.P)(function(){var Rt=Sn.options;return Rt?Rt.changes.pipe((0,z.O)(Rt),(0,K.w)(function(){return F.T.apply(void 0,(0,V.Z)(Rt.map(function(Lt){return Lt.onSelectionChange})))})):Sn._ngZone.onStable.pipe((0,j.q)(1),(0,K.w)(function(){return Sn.optionSelectionChanges}))}),Sn.openedChange=new A.vpe,Sn._openedStream=Sn.openedChange.pipe((0,J.h)(function(Rt){return Rt}),(0,ee.U)(function(){})),Sn._closedStream=Sn.openedChange.pipe((0,J.h)(function(Rt){return!Rt}),(0,ee.U)(function(){})),Sn.selectionChange=new A.vpe,Sn.valueChange=new A.vpe,Sn.ngControl&&(Sn.ngControl.valueAccessor=(0,w.Z)(Sn)),null!=(null==Cn?void 0:Cn.typeaheadDebounceInterval)&&(Sn._typeaheadDebounceInterval=Cn.typeaheadDebounceInterval),Sn._scrollStrategyFactory=In,Sn._scrollStrategy=Sn._scrollStrategyFactory(),Sn.tabIndex=parseInt(Tn)||0,Sn.id=Sn.id,Sn}return(0,Z.Z)(ye,[{key:"focused",get:function(){return this._focused||this._panelOpen}},{key:"placeholder",get:function(){return this._placeholder},set:function(we){this._placeholder=we,this.stateChanges.next()}},{key:"required",get:function(){return this._required},set:function(we){this._required=(0,R.Ig)(we),this.stateChanges.next()}},{key:"multiple",get:function(){return this._multiple},set:function(we){this._multiple=(0,R.Ig)(we)}},{key:"disableOptionCentering",get:function(){return this._disableOptionCentering},set:function(we){this._disableOptionCentering=(0,R.Ig)(we)}},{key:"compareWith",get:function(){return this._compareWith},set:function(we){this._compareWith=we,this._selectionModel&&this._initializeSelection()}},{key:"value",get:function(){return this._value},set:function(we){(we!==this._value||this._multiple&&Array.isArray(we))&&(this.options&&this._setSelectionByValue(we),this._value=we)}},{key:"typeaheadDebounceInterval",get:function(){return this._typeaheadDebounceInterval},set:function(we){this._typeaheadDebounceInterval=(0,R.su)(we)}},{key:"id",get:function(){return this._id},set:function(we){this._id=we||this._uid,this.stateChanges.next()}},{key:"ngOnInit",value:function(){var we=this;this._selectionModel=new k.Ov(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe((0,$.x)(),(0,ae.R)(this._destroy)).subscribe(function(){return we._panelDoneAnimating(we.panelOpen)})}},{key:"ngAfterContentInit",value:function(){var we=this;this._initKeyManager(),this._selectionModel.changed.pipe((0,ae.R)(this._destroy)).subscribe(function(ct){ct.added.forEach(function(ft){return ft.select()}),ct.removed.forEach(function(ft){return ft.deselect()})}),this.options.changes.pipe((0,z.O)(null),(0,ae.R)(this._destroy)).subscribe(function(){we._resetOptions(),we._initializeSelection()})}},{key:"ngDoCheck",value:function(){var we=this._getTriggerAriaLabelledby();if(we!==this._triggerAriaLabelledBy){var ct=this._elementRef.nativeElement;this._triggerAriaLabelledBy=we,we?ct.setAttribute("aria-labelledby",we):ct.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}},{key:"ngOnChanges",value:function(we){we.disabled&&this.stateChanges.next(),we.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}},{key:"ngOnDestroy",value:function(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}},{key:"toggle",value:function(){this.panelOpen?this.close():this.open()}},{key:"open",value:function(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}},{key:"close",value:function(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}},{key:"writeValue",value:function(we){this.value=we}},{key:"registerOnChange",value:function(we){this._onChange=we}},{key:"registerOnTouched",value:function(we){this._onTouched=we}},{key:"setDisabledState",value:function(we){this.disabled=we,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}},{key:"panelOpen",get:function(){return this._panelOpen}},{key:"selected",get:function(){var we,ct;return this.multiple?(null===(we=this._selectionModel)||void 0===we?void 0:we.selected)||[]:null===(ct=this._selectionModel)||void 0===ct?void 0:ct.selected[0]}},{key:"triggerValue",get:function(){if(this.empty)return"";if(this._multiple){var we=this._selectionModel.selected.map(function(ct){return ct.viewValue});return this._isRtl()&&we.reverse(),we.join(", ")}return this._selectionModel.selected[0].viewValue}},{key:"_isRtl",value:function(){return!!this._dir&&"rtl"===this._dir.value}},{key:"_handleKeydown",value:function(we){this.disabled||(this.panelOpen?this._handleOpenKeydown(we):this._handleClosedKeydown(we))}},{key:"_handleClosedKeydown",value:function(we){var ct=we.keyCode,ft=ct===E.JH||ct===E.LH||ct===E.oh||ct===E.SV,Yt=ct===E.K5||ct===E.L_,Kt=this._keyManager;if(!Kt.isTyping()&&Yt&&!(0,E.Vb)(we)||(this.multiple||we.altKey)&&ft)we.preventDefault(),this.open();else if(!this.multiple){var Jt=this.selected;Kt.onKeydown(we);var nn=this.selected;nn&&Jt!==nn&&this._liveAnnouncer.announce(nn.viewValue,1e4)}}},{key:"_handleOpenKeydown",value:function(we){var ct=this._keyManager,ft=we.keyCode,Yt=ft===E.JH||ft===E.LH,Kt=ct.isTyping();if(Yt&&we.altKey)we.preventDefault(),this.close();else if(Kt||ft!==E.K5&&ft!==E.L_||!ct.activeItem||(0,E.Vb)(we))if(!Kt&&this._multiple&&ft===E.A&&we.ctrlKey){we.preventDefault();var Jt=this.options.some(function(ln){return!ln.disabled&&!ln.selected});this.options.forEach(function(ln){ln.disabled||(Jt?ln.select():ln.deselect())})}else{var nn=ct.activeItemIndex;ct.onKeydown(we),this._multiple&&Yt&&we.shiftKey&&ct.activeItem&&ct.activeItemIndex!==nn&&ct.activeItem._selectViaInteraction()}else we.preventDefault(),ct.activeItem._selectViaInteraction()}},{key:"_onFocus",value:function(){this.disabled||(this._focused=!0,this.stateChanges.next())}},{key:"_onBlur",value:function(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}},{key:"_onAttached",value:function(){var we=this;this._overlayDir.positionChange.pipe((0,j.q)(1)).subscribe(function(){we._changeDetectorRef.detectChanges(),we._positioningSettled()})}},{key:"_getPanelTheme",value:function(){return this._parentFormField?"mat-".concat(this._parentFormField.color):""}},{key:"empty",get:function(){return!this._selectionModel||this._selectionModel.isEmpty()}},{key:"_initializeSelection",value:function(){var we=this;Promise.resolve().then(function(){we._setSelectionByValue(we.ngControl?we.ngControl.value:we._value),we.stateChanges.next()})}},{key:"_setSelectionByValue",value:function(we){var ct=this;if(this._selectionModel.selected.forEach(function(Yt){return Yt.setInactiveStyles()}),this._selectionModel.clear(),this.multiple&&we)Array.isArray(we),we.forEach(function(Yt){return ct._selectValue(Yt)}),this._sortValues();else{var ft=this._selectValue(we);ft?this._keyManager.updateActiveItem(ft):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}},{key:"_selectValue",value:function(we){var ct=this,ft=this.options.find(function(Yt){if(ct._selectionModel.isSelected(Yt))return!1;try{return null!=Yt.value&&ct._compareWith(Yt.value,we)}catch(Kt){return!1}});return ft&&this._selectionModel.select(ft),ft}},{key:"_initKeyManager",value:function(){var we=this;this._keyManager=new T.s1(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe((0,ae.R)(this._destroy)).subscribe(function(){we.panelOpen&&(!we.multiple&&we._keyManager.activeItem&&we._keyManager.activeItem._selectViaInteraction(),we.focus(),we.close())}),this._keyManager.change.pipe((0,ae.R)(this._destroy)).subscribe(function(){we._panelOpen&&we.panel?we._scrollOptionIntoView(we._keyManager.activeItemIndex||0):!we._panelOpen&&!we.multiple&&we._keyManager.activeItem&&we._keyManager.activeItem._selectViaInteraction()})}},{key:"_resetOptions",value:function(){var we=this,ct=(0,F.T)(this.options.changes,this._destroy);this.optionSelectionChanges.pipe((0,ae.R)(ct)).subscribe(function(ft){we._onSelect(ft.source,ft.isUserInput),ft.isUserInput&&!we.multiple&&we._panelOpen&&(we.close(),we.focus())}),F.T.apply(void 0,(0,V.Z)(this.options.map(function(ft){return ft._stateChanges}))).pipe((0,ae.R)(ct)).subscribe(function(){we._changeDetectorRef.markForCheck(),we.stateChanges.next()})}},{key:"_onSelect",value:function(we,ct){var ft=this._selectionModel.isSelected(we);null!=we.value||this._multiple?(ft!==we.selected&&(we.selected?this._selectionModel.select(we):this._selectionModel.deselect(we)),ct&&this._keyManager.setActiveItem(we),this.multiple&&(this._sortValues(),ct&&this.focus())):(we.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(we.value)),ft!==this._selectionModel.isSelected(we)&&this._propagateChanges(),this.stateChanges.next()}},{key:"_sortValues",value:function(){var we=this;if(this.multiple){var ct=this.options.toArray();this._selectionModel.sort(function(ft,Yt){return we.sortComparator?we.sortComparator(ft,Yt,ct):ct.indexOf(ft)-ct.indexOf(Yt)}),this.stateChanges.next()}}},{key:"_propagateChanges",value:function(we){var ct;ct=this.multiple?this.selected.map(function(ft){return ft.value}):this.selected?this.selected.value:we,this._value=ct,this.valueChange.emit(ct),this._onChange(ct),this.selectionChange.emit(this._getChangeEvent(ct)),this._changeDetectorRef.markForCheck()}},{key:"_highlightCorrectOption",value:function(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}},{key:"_canOpen",value:function(){var we;return!this._panelOpen&&!this.disabled&&(null===(we=this.options)||void 0===we?void 0:we.length)>0}},{key:"focus",value:function(we){this._elementRef.nativeElement.focus(we)}},{key:"_getPanelAriaLabelledby",value:function(){var we;if(this.ariaLabel)return null;var ct=null===(we=this._parentFormField)||void 0===we?void 0:we.getLabelId();return this.ariaLabelledby?(ct?ct+" ":"")+this.ariaLabelledby:ct}},{key:"_getAriaActiveDescendant",value:function(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}},{key:"_getTriggerAriaLabelledby",value:function(){var we;if(this.ariaLabel)return null;var ct=null===(we=this._parentFormField)||void 0===we?void 0:we.getLabelId(),ft=(ct?ct+" ":"")+this._valueId;return this.ariaLabelledby&&(ft+=" "+this.ariaLabelledby),ft}},{key:"_panelDoneAnimating",value:function(we){this.openedChange.emit(we)}},{key:"setDescribedByIds",value:function(we){this._ariaDescribedby=we.join(" ")}},{key:"onContainerClick",value:function(){this.focus(),this.open()}},{key:"shouldLabelFloat",get:function(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}]),ye}(Ln);return ut.\u0275fac=function(ve){return new(ve||ut)(A.Y36(g.rL),A.Y36(A.sBO),A.Y36(A.R0b),A.Y36(S.rD),A.Y36(A.SBq),A.Y36(ce.Is,8),A.Y36(le.F,8),A.Y36(le.sg,8),A.Y36(v.G_,8),A.Y36(le.a5,10),A.$8M("tabindex"),A.Y36(bt),A.Y36(T.Kd),A.Y36(Nt,8))},ut.\u0275dir=A.lG2({type:ut,viewQuery:function(ve,ye){var Te;1&ve&&(A.Gf(oe,5),A.Gf(Ae,5),A.Gf(I.pI,5)),2&ve&&(A.iGM(Te=A.CRH())&&(ye.trigger=Te.first),A.iGM(Te=A.CRH())&&(ye.panel=Te.first),A.iGM(Te=A.CRH())&&(ye._overlayDir=Te.first))},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[A.qOj,A.TTD]}),ut}(),wn=function(){var ut=function(He){(0,N.Z)(ye,He);var ve=(0,b.Z)(ye);function ye(){var Te;return(0,_.Z)(this,ye),(Te=ve.apply(this,arguments))._scrollTop=0,Te._triggerFontSize=0,Te._transformOrigin="top",Te._offsetY=0,Te._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}],Te}return(0,Z.Z)(ye,[{key:"_calculateOverlayScroll",value:function(we,ct,ft){var Yt=this._getItemHeight();return Math.min(Math.max(0,Yt*we-ct+Yt/2),ft)}},{key:"ngOnInit",value:function(){var we=this;(0,B.Z)((0,U.Z)(ye.prototype),"ngOnInit",this).call(this),this._viewportRuler.change().pipe((0,ae.R)(this._destroy)).subscribe(function(){we.panelOpen&&(we._triggerRect=we.trigger.nativeElement.getBoundingClientRect(),we._changeDetectorRef.markForCheck())})}},{key:"open",value:function(){var we=this;(0,B.Z)((0,U.Z)(ye.prototype),"_canOpen",this).call(this)&&((0,B.Z)((0,U.Z)(ye.prototype),"open",this).call(this),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe((0,j.q)(1)).subscribe(function(){we._triggerFontSize&&we._overlayDir.overlayRef&&we._overlayDir.overlayRef.overlayElement&&(we._overlayDir.overlayRef.overlayElement.style.fontSize="".concat(we._triggerFontSize,"px"))}))}},{key:"_scrollOptionIntoView",value:function(we){var ct=(0,S.CB)(we,this.options,this.optionGroups),ft=this._getItemHeight();this.panel.nativeElement.scrollTop=0===we&&1===ct?0:(0,S.jH)((we+ct)*ft,ft,this.panel.nativeElement.scrollTop,256)}},{key:"_positioningSettled",value:function(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}},{key:"_panelDoneAnimating",value:function(we){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),(0,B.Z)((0,U.Z)(ye.prototype),"_panelDoneAnimating",this).call(this,we)}},{key:"_getChangeEvent",value:function(we){return new kn(this,we)}},{key:"_calculateOverlayOffsetX",value:function(){var Kt,we=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),ct=this._viewportRuler.getViewportSize(),ft=this._isRtl(),Yt=this.multiple?56:32;if(this.multiple)Kt=40;else if(this.disableOptionCentering)Kt=16;else{var Jt=this._selectionModel.selected[0]||this.options.first;Kt=Jt&&Jt.group?32:16}ft||(Kt*=-1);var nn=0-(we.left+Kt-(ft?Yt:0)),ln=we.right+Kt-ct.width+(ft?0:Yt);nn>0?Kt+=nn+8:ln>0&&(Kt-=ln+8),this._overlayDir.offsetX=Math.round(Kt),this._overlayDir.overlayRef.updatePosition()}},{key:"_calculateOverlayOffsetY",value:function(we,ct,ft){var nn,Yt=this._getItemHeight(),Kt=(Yt-this._triggerRect.height)/2,Jt=Math.floor(256/Yt);return this.disableOptionCentering?0:(nn=0===this._scrollTop?we*Yt:this._scrollTop===ft?(we-(this._getItemCount()-Jt))*Yt+(Yt-(this._getItemCount()*Yt-256)%Yt):ct-Yt/2,Math.round(-1*nn-Kt))}},{key:"_checkOverlayWithinViewport",value:function(we){var ct=this._getItemHeight(),ft=this._viewportRuler.getViewportSize(),Yt=this._triggerRect.top-8,Kt=ft.height-this._triggerRect.bottom-8,Jt=Math.abs(this._offsetY),ln=Math.min(this._getItemCount()*ct,256)-Jt-this._triggerRect.height;ln>Kt?this._adjustPanelUp(ln,Kt):Jt>Yt?this._adjustPanelDown(Jt,Yt,we):this._transformOrigin=this._getOriginBasedOnOption()}},{key:"_adjustPanelUp",value:function(we,ct){var ft=Math.round(we-ct);this._scrollTop-=ft,this._offsetY-=ft,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}},{key:"_adjustPanelDown",value:function(we,ct,ft){var Yt=Math.round(we-ct);if(this._scrollTop+=Yt,this._offsetY+=Yt,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=ft)return this._scrollTop=ft,this._offsetY=0,void(this._transformOrigin="50% top 0px")}},{key:"_calculateOverlayPosition",value:function(){var Jt,we=this._getItemHeight(),ct=this._getItemCount(),ft=Math.min(ct*we,256),Kt=ct*we-ft;Jt=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),Jt+=(0,S.CB)(Jt,this.options,this.optionGroups);var nn=ft/2;this._scrollTop=this._calculateOverlayScroll(Jt,nn,Kt),this._offsetY=this._calculateOverlayOffsetY(Jt,nn,Kt),this._checkOverlayWithinViewport(Kt)}},{key:"_getOriginBasedOnOption",value:function(){var we=this._getItemHeight(),ct=(we-this._triggerRect.height)/2,ft=Math.abs(this._offsetY)-ct+we/2;return"50% ".concat(ft,"px 0px")}},{key:"_getItemHeight",value:function(){return 3*this._triggerFontSize}},{key:"_getItemCount",value:function(){return this.options.length+this.optionGroups.length}}]),ye}(Nn);return ut.\u0275fac=function(){var He;return function(ye){return(He||(He=A.n5z(ut)))(ye||ut)}}(),ut.\u0275cmp=A.Xpm({type:ut,selectors:[["mat-select"]],contentQueries:function(ve,ye,Te){var we;1&ve&&(A.Suo(Te,Rn,5),A.Suo(Te,S.ey,5),A.Suo(Te,S.K7,5)),2&ve&&(A.iGM(we=A.CRH())&&(ye.customTrigger=we.first),A.iGM(we=A.CRH())&&(ye.options=we),A.iGM(we=A.CRH())&&(ye.optionGroups=we))},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(ve,ye){1&ve&&A.NdJ("keydown",function(we){return ye._handleKeydown(we)})("focus",function(){return ye._onFocus()})("blur",function(){return ye._onBlur()}),2&ve&&(A.uIk("id",ye.id)("tabindex",ye.tabIndex)("aria-controls",ye.panelOpen?ye.id+"-panel":null)("aria-expanded",ye.panelOpen)("aria-label",ye.ariaLabel||null)("aria-required",ye.required.toString())("aria-disabled",ye.disabled.toString())("aria-invalid",ye.errorState)("aria-describedby",ye._ariaDescribedby||null)("aria-activedescendant",ye._getAriaActiveDescendant()),A.ekj("mat-select-disabled",ye.disabled)("mat-select-invalid",ye.errorState)("mat-select-required",ye.required)("mat-select-empty",ye.empty)("mat-select-multiple",ye.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[A._Bn([{provide:v.Eo,useExisting:ut},{provide:S.HF,useExisting:ut}]),A.qOj],ngContentSelectors:xe,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(ve,ye){if(1&ve&&(A.F$t(Ft),A.TgZ(0,"div",0,1),A.NdJ("click",function(){return ye.toggle()}),A.TgZ(3,"div",2),A.YNc(4,be,2,1,"span",3),A.YNc(5,_t,3,2,"span",4),A.qZA(),A.TgZ(6,"div",5),A._UZ(7,"div",6),A.qZA(),A.qZA(),A.YNc(8,yt,4,14,"ng-template",7),A.NdJ("backdropClick",function(){return ye.close()})("attach",function(){return ye._onAttached()})("detach",function(){return ye.close()})),2&ve){var Te=A.MAs(1);A.uIk("aria-owns",ye.panelOpen?ye.id+"-panel":null),A.xp6(3),A.Q6J("ngSwitch",ye.empty),A.uIk("id",ye._valueId),A.xp6(1),A.Q6J("ngSwitchCase",!0),A.xp6(1),A.Q6J("ngSwitchCase",!1),A.xp6(3),A.Q6J("cdkConnectedOverlayPanelClass",ye._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",ye._scrollStrategy)("cdkConnectedOverlayOrigin",Te)("cdkConnectedOverlayOpen",ye.panelOpen)("cdkConnectedOverlayPositions",ye._positions)("cdkConnectedOverlayMinWidth",null==ye._triggerRect?null:ye._triggerRect.width)("cdkConnectedOverlayOffsetY",ye._offsetY)}},directives:[I.xu,D.RF,D.n9,I.pI,D.ED,D.mk],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[De.transformPanelWrap,De.transformPanel]},changeDetection:0}),ut}(),_r=function(){var ut=function He(){(0,_.Z)(this,He)};return ut.\u0275fac=function(ve){return new(ve||ut)},ut.\u0275mod=A.oAB({type:ut}),ut.\u0275inj=A.cJS({providers:[rn],imports:[[D.ez,I.U8,S.Ng,S.BQ],g.ZD,v.lN,S.Ng,S.BQ]}),ut}()},88802:function(ue,q,f){"use strict";f.d(q,{uX:function(){return Rn},SP:function(){return we},uD:function(){return rn},Nh:function(){return ur}}),f(88009);var U=f(62467),V=f(13920),Z=f(89200),w=f(10509),N=f(97154),b=f(18967),_=f(14105),I=f(6517),D=f(96798),A=f(80785),S=f(40098),v=f(38999),g=f(59412),T=f(38480),R=f(68707),k=f(5051),E=f(55371),x=f(33090),O=f(43161),F=f(5041),z=f(739),K=f(57682),j=f(76161),J=f(44213),ee=f(78081),$=f(15427),ae=f(32819),se=f(8392),ce=f(28722);function le(Ut,Rt){1&Ut&&v.Hsn(0)}var oe=["*"];function Ae(Ut,Rt){}var be=function(Rt){return{animationDuration:Rt}},it=function(Rt,Lt){return{value:Rt,params:Lt}},qe=["tabBodyWrapper"],_t=["tabHeader"];function yt(Ut,Rt){}function Ft(Ut,Rt){if(1&Ut&&v.YNc(0,yt,0,0,"ng-template",9),2&Ut){var Lt=v.oxw().$implicit;v.Q6J("cdkPortalOutlet",Lt.templateLabel)}}function xe(Ut,Rt){if(1&Ut&&v._uU(0),2&Ut){var Lt=v.oxw().$implicit;v.Oqu(Lt.textLabel)}}function De(Ut,Rt){if(1&Ut){var Lt=v.EpF();v.TgZ(0,"div",6),v.NdJ("click",function(){var Ne=v.CHM(Lt),Le=Ne.$implicit,ze=Ne.index,At=v.oxw(),an=v.MAs(1);return At._handleClick(Le,an,ze)})("cdkFocusChange",function(Ne){var ze=v.CHM(Lt).index;return v.oxw()._tabFocusChanged(Ne,ze)}),v.TgZ(1,"div",7),v.YNc(2,Ft,1,1,"ng-template",8),v.YNc(3,xe,1,1,"ng-template",8),v.qZA(),v.qZA()}if(2&Ut){var Oe=Rt.$implicit,rt=Rt.index,he=v.oxw();v.ekj("mat-tab-label-active",he.selectedIndex==rt),v.Q6J("id",he._getTabLabelId(rt))("disabled",Oe.disabled)("matRippleDisabled",Oe.disabled||he.disableRipple),v.uIk("tabIndex",he._getTabIndex(Oe,rt))("aria-posinset",rt+1)("aria-setsize",he._tabs.length)("aria-controls",he._getTabContentId(rt))("aria-selected",he.selectedIndex==rt)("aria-label",Oe.ariaLabel||null)("aria-labelledby",!Oe.ariaLabel&&Oe.ariaLabelledby?Oe.ariaLabelledby:null),v.xp6(2),v.Q6J("ngIf",Oe.templateLabel),v.xp6(1),v.Q6J("ngIf",!Oe.templateLabel)}}function je(Ut,Rt){if(1&Ut){var Lt=v.EpF();v.TgZ(0,"mat-tab-body",10),v.NdJ("_onCentered",function(){return v.CHM(Lt),v.oxw()._removeTabBodyWrapperHeight()})("_onCentering",function(Ne){return v.CHM(Lt),v.oxw()._setTabBodyWrapperHeight(Ne)}),v.qZA()}if(2&Ut){var Oe=Rt.$implicit,rt=Rt.index,he=v.oxw();v.ekj("mat-tab-body-active",he.selectedIndex===rt),v.Q6J("id",he._getTabContentId(rt))("content",Oe.content)("position",Oe.position)("origin",Oe.origin)("animationDuration",he.animationDuration),v.uIk("tabindex",null!=he.contentTabIndex&&he.selectedIndex===rt?he.contentTabIndex:null)("aria-labelledby",he._getTabLabelId(rt))}}var dt=["tabListContainer"],Ke=["tabList"],Bt=["nextPaginator"],xt=["previousPaginator"],Qt=new v.OlP("MatInkBarPositioner",{providedIn:"root",factory:function(){return function(Lt){return{left:Lt?(Lt.offsetLeft||0)+"px":"0",width:Lt?(Lt.offsetWidth||0)+"px":"0"}}}}),Ct=function(){var Ut=function(){function Rt(Lt,Oe,rt,he){(0,b.Z)(this,Rt),this._elementRef=Lt,this._ngZone=Oe,this._inkBarPositioner=rt,this._animationMode=he}return(0,_.Z)(Rt,[{key:"alignToElement",value:function(Oe){var rt=this;this.show(),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(function(){requestAnimationFrame(function(){return rt._setStyles(Oe)})}):this._setStyles(Oe)}},{key:"show",value:function(){this._elementRef.nativeElement.style.visibility="visible"}},{key:"hide",value:function(){this._elementRef.nativeElement.style.visibility="hidden"}},{key:"_setStyles",value:function(Oe){var rt=this._inkBarPositioner(Oe),he=this._elementRef.nativeElement;he.style.left=rt.left,he.style.width=rt.width}}]),Rt}();return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq),v.Y36(v.R0b),v.Y36(Qt),v.Y36(T.Qb,8))},Ut.\u0275dir=v.lG2({type:Ut,selectors:[["mat-ink-bar"]],hostAttrs:[1,"mat-ink-bar"],hostVars:2,hostBindings:function(Lt,Oe){2&Lt&&v.ekj("_mat-animation-noopable","NoopAnimations"===Oe._animationMode)}}),Ut}(),qt=new v.OlP("MatTabContent"),en=new v.OlP("MatTabLabel"),Nt=new v.OlP("MAT_TAB"),rn=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he,Ie){var Ne;return(0,b.Z)(this,Oe),(Ne=Lt.call(this,rt,he))._closestTab=Ie,Ne}return Oe}(A.ig);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.Rgc),v.Y36(v.s_b),v.Y36(Nt,8))},Ut.\u0275dir=v.lG2({type:Ut,selectors:[["","mat-tab-label",""],["","matTabLabel",""]],features:[v._Bn([{provide:en,useExisting:Ut}]),v.qOj]}),Ut}(),kn=(0,g.Id)(function(){return function Ut(){(0,b.Z)(this,Ut)}}()),Ln=new v.OlP("MAT_TAB_GROUP"),Rn=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he){var Ie;return(0,b.Z)(this,Oe),(Ie=Lt.call(this))._viewContainerRef=rt,Ie._closestTabGroup=he,Ie.textLabel="",Ie._contentPortal=null,Ie._stateChanges=new R.xQ,Ie.position=null,Ie.origin=null,Ie.isActive=!1,Ie}return(0,_.Z)(Oe,[{key:"templateLabel",get:function(){return this._templateLabel},set:function(he){this._setTemplateLabelInput(he)}},{key:"content",get:function(){return this._contentPortal}},{key:"ngOnChanges",value:function(he){(he.hasOwnProperty("textLabel")||he.hasOwnProperty("disabled"))&&this._stateChanges.next()}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}},{key:"ngOnInit",value:function(){this._contentPortal=new A.UE(this._explicitContent||this._implicitContent,this._viewContainerRef)}},{key:"_setTemplateLabelInput",value:function(he){he&&he._closestTab===this&&(this._templateLabel=he)}}]),Oe}(kn);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.s_b),v.Y36(Ln,8))},Ut.\u0275cmp=v.Xpm({type:Ut,selectors:[["mat-tab"]],contentQueries:function(Lt,Oe,rt){var he;1&Lt&&(v.Suo(rt,en,5),v.Suo(rt,qt,7,v.Rgc)),2&Lt&&(v.iGM(he=v.CRH())&&(Oe.templateLabel=he.first),v.iGM(he=v.CRH())&&(Oe._explicitContent=he.first))},viewQuery:function(Lt,Oe){var rt;1&Lt&&v.Gf(v.Rgc,7),2&Lt&&v.iGM(rt=v.CRH())&&(Oe._implicitContent=rt.first)},inputs:{disabled:"disabled",textLabel:["label","textLabel"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"]},exportAs:["matTab"],features:[v._Bn([{provide:Nt,useExisting:Ut}]),v.qOj,v.TTD],ngContentSelectors:oe,decls:1,vars:0,template:function(Lt,Oe){1&Lt&&(v.F$t(),v.YNc(0,le,1,0,"ng-template"))},encapsulation:2}),Ut}(),$n={translateTab:(0,z.X$)("translateTab",[(0,z.SB)("center, void, left-origin-center, right-origin-center",(0,z.oB)({transform:"none"})),(0,z.SB)("left",(0,z.oB)({transform:"translate3d(-100%, 0, 0)",minHeight:"1px"})),(0,z.SB)("right",(0,z.oB)({transform:"translate3d(100%, 0, 0)",minHeight:"1px"})),(0,z.eR)("* => left, * => right, left => center, right => center",(0,z.jt)("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)")),(0,z.eR)("void => left-origin-center",[(0,z.oB)({transform:"translate3d(-100%, 0, 0)"}),(0,z.jt)("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)")]),(0,z.eR)("void => right-origin-center",[(0,z.oB)({transform:"translate3d(100%, 0, 0)"}),(0,z.jt)("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)")])])},Nn=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he,Ie,Ne){var Le;return(0,b.Z)(this,Oe),(Le=Lt.call(this,rt,he,Ne))._host=Ie,Le._centeringSub=k.w.EMPTY,Le._leavingSub=k.w.EMPTY,Le}return(0,_.Z)(Oe,[{key:"ngOnInit",value:function(){var he=this;(0,V.Z)((0,Z.Z)(Oe.prototype),"ngOnInit",this).call(this),this._centeringSub=this._host._beforeCentering.pipe((0,K.O)(this._host._isCenterPosition(this._host._position))).subscribe(function(Ie){Ie&&!he.hasAttached()&&he.attach(he._host._content)}),this._leavingSub=this._host._afterLeavingCenter.subscribe(function(){he.detach()})}},{key:"ngOnDestroy",value:function(){(0,V.Z)((0,Z.Z)(Oe.prototype),"ngOnDestroy",this).call(this),this._centeringSub.unsubscribe(),this._leavingSub.unsubscribe()}}]),Oe}(A.Pl);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v._Vd),v.Y36(v.s_b),v.Y36((0,v.Gpc)(function(){return _r})),v.Y36(S.K0))},Ut.\u0275dir=v.lG2({type:Ut,selectors:[["","matTabBodyHost",""]],features:[v.qOj]}),Ut}(),wn=function(){var Ut=function(){function Rt(Lt,Oe,rt){var he=this;(0,b.Z)(this,Rt),this._elementRef=Lt,this._dir=Oe,this._dirChangeSubscription=k.w.EMPTY,this._translateTabComplete=new R.xQ,this._onCentering=new v.vpe,this._beforeCentering=new v.vpe,this._afterLeavingCenter=new v.vpe,this._onCentered=new v.vpe(!0),this.animationDuration="500ms",Oe&&(this._dirChangeSubscription=Oe.change.subscribe(function(Ie){he._computePositionAnimationState(Ie),rt.markForCheck()})),this._translateTabComplete.pipe((0,j.x)(function(Ie,Ne){return Ie.fromState===Ne.fromState&&Ie.toState===Ne.toState})).subscribe(function(Ie){he._isCenterPosition(Ie.toState)&&he._isCenterPosition(he._position)&&he._onCentered.emit(),he._isCenterPosition(Ie.fromState)&&!he._isCenterPosition(he._position)&&he._afterLeavingCenter.emit()})}return(0,_.Z)(Rt,[{key:"position",set:function(Oe){this._positionIndex=Oe,this._computePositionAnimationState()}},{key:"ngOnInit",value:function(){"center"==this._position&&null!=this.origin&&(this._position=this._computePositionFromOrigin(this.origin))}},{key:"ngOnDestroy",value:function(){this._dirChangeSubscription.unsubscribe(),this._translateTabComplete.complete()}},{key:"_onTranslateTabStarted",value:function(Oe){var rt=this._isCenterPosition(Oe.toState);this._beforeCentering.emit(rt),rt&&this._onCentering.emit(this._elementRef.nativeElement.clientHeight)}},{key:"_getLayoutDirection",value:function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}},{key:"_isCenterPosition",value:function(Oe){return"center"==Oe||"left-origin-center"==Oe||"right-origin-center"==Oe}},{key:"_computePositionAnimationState",value:function(){var Oe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._getLayoutDirection();this._position=this._positionIndex<0?"ltr"==Oe?"left":"right":this._positionIndex>0?"ltr"==Oe?"right":"left":"center"}},{key:"_computePositionFromOrigin",value:function(Oe){var rt=this._getLayoutDirection();return"ltr"==rt&&Oe<=0||"rtl"==rt&&Oe>0?"left-origin-center":"right-origin-center"}}]),Rt}();return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq),v.Y36(se.Is,8),v.Y36(v.sBO))},Ut.\u0275dir=v.lG2({type:Ut,inputs:{animationDuration:"animationDuration",position:"position",_content:["content","_content"],origin:"origin"},outputs:{_onCentering:"_onCentering",_beforeCentering:"_beforeCentering",_afterLeavingCenter:"_afterLeavingCenter",_onCentered:"_onCentered"}}),Ut}(),_r=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he,Ie){return(0,b.Z)(this,Oe),Lt.call(this,rt,he,Ie)}return Oe}(wn);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq),v.Y36(se.Is,8),v.Y36(v.sBO))},Ut.\u0275cmp=v.Xpm({type:Ut,selectors:[["mat-tab-body"]],viewQuery:function(Lt,Oe){var rt;1&Lt&&v.Gf(A.Pl,5),2&Lt&&v.iGM(rt=v.CRH())&&(Oe._portalHost=rt.first)},hostAttrs:[1,"mat-tab-body"],features:[v.qOj],decls:3,vars:6,consts:[["cdkScrollable","",1,"mat-tab-body-content"],["content",""],["matTabBodyHost",""]],template:function(Lt,Oe){1&Lt&&(v.TgZ(0,"div",0,1),v.NdJ("@translateTab.start",function(he){return Oe._onTranslateTabStarted(he)})("@translateTab.done",function(he){return Oe._translateTabComplete.next(he)}),v.YNc(2,Ae,0,0,"ng-template",2),v.qZA()),2&Lt&&v.Q6J("@translateTab",v.WLB(3,it,Oe._position,v.VKq(1,be,Oe.animationDuration)))},directives:[Nn],styles:[".mat-tab-body-content{height:100%;overflow:auto}.mat-tab-group-dynamic-height .mat-tab-body-content{overflow:hidden}\n"],encapsulation:2,data:{animation:[$n.translateTab]}}),Ut}(),ut=new v.OlP("MAT_TABS_CONFIG"),He=0,ve=function Ut(){(0,b.Z)(this,Ut)},ye=(0,g.pj)((0,g.Kr)(function(){return function Ut(Rt){(0,b.Z)(this,Ut),this._elementRef=Rt}}()),"primary"),Te=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he,Ie,Ne){var Le,ze;return(0,b.Z)(this,Oe),(Le=Lt.call(this,rt))._changeDetectorRef=he,Le._animationMode=Ne,Le._tabs=new v.n_E,Le._indexToSelect=0,Le._tabBodyWrapperHeight=0,Le._tabsSubscription=k.w.EMPTY,Le._tabLabelSubscription=k.w.EMPTY,Le._selectedIndex=null,Le.headerPosition="above",Le.selectedIndexChange=new v.vpe,Le.focusChange=new v.vpe,Le.animationDone=new v.vpe,Le.selectedTabChange=new v.vpe(!0),Le._groupId=He++,Le.animationDuration=Ie&&Ie.animationDuration?Ie.animationDuration:"500ms",Le.disablePagination=!(!Ie||null==Ie.disablePagination)&&Ie.disablePagination,Le.dynamicHeight=!(!Ie||null==Ie.dynamicHeight)&&Ie.dynamicHeight,Le.contentTabIndex=null!==(ze=null==Ie?void 0:Ie.contentTabIndex)&&void 0!==ze?ze:null,Le}return(0,_.Z)(Oe,[{key:"dynamicHeight",get:function(){return this._dynamicHeight},set:function(he){this._dynamicHeight=(0,ee.Ig)(he)}},{key:"selectedIndex",get:function(){return this._selectedIndex},set:function(he){this._indexToSelect=(0,ee.su)(he,null)}},{key:"animationDuration",get:function(){return this._animationDuration},set:function(he){this._animationDuration=/^\d+$/.test(he)?he+"ms":he}},{key:"contentTabIndex",get:function(){return this._contentTabIndex},set:function(he){this._contentTabIndex=(0,ee.su)(he,null)}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(he){var Ie=this._elementRef.nativeElement;Ie.classList.remove("mat-background-".concat(this.backgroundColor)),he&&Ie.classList.add("mat-background-".concat(he)),this._backgroundColor=he}},{key:"ngAfterContentChecked",value:function(){var he=this,Ie=this._indexToSelect=this._clampTabIndex(this._indexToSelect);if(this._selectedIndex!=Ie){var Ne=null==this._selectedIndex;if(!Ne){this.selectedTabChange.emit(this._createChangeEvent(Ie));var Le=this._tabBodyWrapper.nativeElement;Le.style.minHeight=Le.clientHeight+"px"}Promise.resolve().then(function(){he._tabs.forEach(function(ze,At){return ze.isActive=At===Ie}),Ne||(he.selectedIndexChange.emit(Ie),he._tabBodyWrapper.nativeElement.style.minHeight="")})}this._tabs.forEach(function(ze,At){ze.position=At-Ie,null!=he._selectedIndex&&0==ze.position&&!ze.origin&&(ze.origin=Ie-he._selectedIndex)}),this._selectedIndex!==Ie&&(this._selectedIndex=Ie,this._changeDetectorRef.markForCheck())}},{key:"ngAfterContentInit",value:function(){var he=this;this._subscribeToAllTabChanges(),this._subscribeToTabLabels(),this._tabsSubscription=this._tabs.changes.subscribe(function(){if(he._clampTabIndex(he._indexToSelect)===he._selectedIndex)for(var Ne=he._tabs.toArray(),Le=0;Le.mat-tab-header .mat-tab-label{flex-basis:0;flex-grow:1}.mat-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height 500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-tab-body-wrapper{transition:none;animation:none}.mat-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;outline:0;flex-basis:100%}.mat-tab-body.mat-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-tab-group.mat-tab-group-dynamic-height .mat-tab-body.mat-tab-body-active{overflow-y:hidden}\n"],encapsulation:2}),Ut}(),ct=(0,g.Id)(function(){return function Ut(){(0,b.Z)(this,Ut)}}()),ft=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt){var he;return(0,b.Z)(this,Oe),(he=Lt.call(this)).elementRef=rt,he}return(0,_.Z)(Oe,[{key:"focus",value:function(){this.elementRef.nativeElement.focus()}},{key:"getOffsetLeft",value:function(){return this.elementRef.nativeElement.offsetLeft}},{key:"getOffsetWidth",value:function(){return this.elementRef.nativeElement.offsetWidth}}]),Oe}(ct);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq))},Ut.\u0275dir=v.lG2({type:Ut,selectors:[["","matTabLabelWrapper",""]],hostVars:3,hostBindings:function(Lt,Oe){2&Lt&&(v.uIk("aria-disabled",!!Oe.disabled),v.ekj("mat-tab-disabled",Oe.disabled))},inputs:{disabled:"disabled"},features:[v.qOj]}),Ut}(),Yt=(0,$.i$)({passive:!0}),ln=function(){var Ut=function(){function Rt(Lt,Oe,rt,he,Ie,Ne,Le){var ze=this;(0,b.Z)(this,Rt),this._elementRef=Lt,this._changeDetectorRef=Oe,this._viewportRuler=rt,this._dir=he,this._ngZone=Ie,this._platform=Ne,this._animationMode=Le,this._scrollDistance=0,this._selectedIndexChanged=!1,this._destroyed=new R.xQ,this._showPaginationControls=!1,this._disableScrollAfter=!0,this._disableScrollBefore=!0,this._stopScrolling=new R.xQ,this.disablePagination=!1,this._selectedIndex=0,this.selectFocusedIndex=new v.vpe,this.indexFocused=new v.vpe,Ie.runOutsideAngular(function(){(0,x.R)(Lt.nativeElement,"mouseleave").pipe((0,J.R)(ze._destroyed)).subscribe(function(){ze._stopInterval()})})}return(0,_.Z)(Rt,[{key:"selectedIndex",get:function(){return this._selectedIndex},set:function(Oe){Oe=(0,ee.su)(Oe),this._selectedIndex!=Oe&&(this._selectedIndexChanged=!0,this._selectedIndex=Oe,this._keyManager&&this._keyManager.updateActiveItem(Oe))}},{key:"ngAfterViewInit",value:function(){var Oe=this;(0,x.R)(this._previousPaginator.nativeElement,"touchstart",Yt).pipe((0,J.R)(this._destroyed)).subscribe(function(){Oe._handlePaginatorPress("before")}),(0,x.R)(this._nextPaginator.nativeElement,"touchstart",Yt).pipe((0,J.R)(this._destroyed)).subscribe(function(){Oe._handlePaginatorPress("after")})}},{key:"ngAfterContentInit",value:function(){var Oe=this,rt=this._dir?this._dir.change:(0,O.of)("ltr"),he=this._viewportRuler.change(150),Ie=function(){Oe.updatePagination(),Oe._alignInkBarToSelectedTab()};this._keyManager=new I.Em(this._items).withHorizontalOrientation(this._getLayoutDirection()).withHomeAndEnd().withWrap(),this._keyManager.updateActiveItem(this._selectedIndex),"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(Ie):Ie(),(0,E.T)(rt,he,this._items.changes).pipe((0,J.R)(this._destroyed)).subscribe(function(){Oe._ngZone.run(function(){return Promise.resolve().then(Ie)}),Oe._keyManager.withHorizontalOrientation(Oe._getLayoutDirection())}),this._keyManager.change.pipe((0,J.R)(this._destroyed)).subscribe(function(Ne){Oe.indexFocused.emit(Ne),Oe._setTabFocus(Ne)})}},{key:"ngAfterContentChecked",value:function(){this._tabLabelCount!=this._items.length&&(this.updatePagination(),this._tabLabelCount=this._items.length,this._changeDetectorRef.markForCheck()),this._selectedIndexChanged&&(this._scrollToLabel(this._selectedIndex),this._checkScrollingControls(),this._alignInkBarToSelectedTab(),this._selectedIndexChanged=!1,this._changeDetectorRef.markForCheck()),this._scrollDistanceChanged&&(this._updateTabScrollPosition(),this._scrollDistanceChanged=!1,this._changeDetectorRef.markForCheck())}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete(),this._stopScrolling.complete()}},{key:"_handleKeydown",value:function(Oe){if(!(0,ae.Vb)(Oe))switch(Oe.keyCode){case ae.K5:case ae.L_:this.focusIndex!==this.selectedIndex&&(this.selectFocusedIndex.emit(this.focusIndex),this._itemSelected(Oe));break;default:this._keyManager.onKeydown(Oe)}}},{key:"_onContentChanges",value:function(){var Oe=this,rt=this._elementRef.nativeElement.textContent;rt!==this._currentTextContent&&(this._currentTextContent=rt||"",this._ngZone.run(function(){Oe.updatePagination(),Oe._alignInkBarToSelectedTab(),Oe._changeDetectorRef.markForCheck()}))}},{key:"updatePagination",value:function(){this._checkPaginationEnabled(),this._checkScrollingControls(),this._updateTabScrollPosition()}},{key:"focusIndex",get:function(){return this._keyManager?this._keyManager.activeItemIndex:0},set:function(Oe){!this._isValidIndex(Oe)||this.focusIndex===Oe||!this._keyManager||this._keyManager.setActiveItem(Oe)}},{key:"_isValidIndex",value:function(Oe){if(!this._items)return!0;var rt=this._items?this._items.toArray()[Oe]:null;return!!rt&&!rt.disabled}},{key:"_setTabFocus",value:function(Oe){if(this._showPaginationControls&&this._scrollToLabel(Oe),this._items&&this._items.length){this._items.toArray()[Oe].focus();var rt=this._tabListContainer.nativeElement,he=this._getLayoutDirection();rt.scrollLeft="ltr"==he?0:rt.scrollWidth-rt.offsetWidth}}},{key:"_getLayoutDirection",value:function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}},{key:"_updateTabScrollPosition",value:function(){if(!this.disablePagination){var Oe=this.scrollDistance,rt="ltr"===this._getLayoutDirection()?-Oe:Oe;this._tabList.nativeElement.style.transform="translateX(".concat(Math.round(rt),"px)"),(this._platform.TRIDENT||this._platform.EDGE)&&(this._tabListContainer.nativeElement.scrollLeft=0)}}},{key:"scrollDistance",get:function(){return this._scrollDistance},set:function(Oe){this._scrollTo(Oe)}},{key:"_scrollHeader",value:function(Oe){return this._scrollTo(this._scrollDistance+("before"==Oe?-1:1)*this._tabListContainer.nativeElement.offsetWidth/3)}},{key:"_handlePaginatorClick",value:function(Oe){this._stopInterval(),this._scrollHeader(Oe)}},{key:"_scrollToLabel",value:function(Oe){if(!this.disablePagination){var rt=this._items?this._items.toArray()[Oe]:null;if(rt){var ze,At,he=this._tabListContainer.nativeElement.offsetWidth,Ie=rt.elementRef.nativeElement,Ne=Ie.offsetLeft,Le=Ie.offsetWidth;"ltr"==this._getLayoutDirection()?At=(ze=Ne)+Le:ze=(At=this._tabList.nativeElement.offsetWidth-Ne)-Le;var an=this.scrollDistance,jn=this.scrollDistance+he;zejn&&(this.scrollDistance+=At-jn+60)}}}},{key:"_checkPaginationEnabled",value:function(){if(this.disablePagination)this._showPaginationControls=!1;else{var Oe=this._tabList.nativeElement.scrollWidth>this._elementRef.nativeElement.offsetWidth;Oe||(this.scrollDistance=0),Oe!==this._showPaginationControls&&this._changeDetectorRef.markForCheck(),this._showPaginationControls=Oe}}},{key:"_checkScrollingControls",value:function(){this.disablePagination?this._disableScrollAfter=this._disableScrollBefore=!0:(this._disableScrollBefore=0==this.scrollDistance,this._disableScrollAfter=this.scrollDistance==this._getMaxScrollDistance(),this._changeDetectorRef.markForCheck())}},{key:"_getMaxScrollDistance",value:function(){return this._tabList.nativeElement.scrollWidth-this._tabListContainer.nativeElement.offsetWidth||0}},{key:"_alignInkBarToSelectedTab",value:function(){var Oe=this._items&&this._items.length?this._items.toArray()[this.selectedIndex]:null,rt=Oe?Oe.elementRef.nativeElement:null;rt?this._inkBar.alignToElement(rt):this._inkBar.hide()}},{key:"_stopInterval",value:function(){this._stopScrolling.next()}},{key:"_handlePaginatorPress",value:function(Oe,rt){var he=this;rt&&null!=rt.button&&0!==rt.button||(this._stopInterval(),(0,F.H)(650,100).pipe((0,J.R)((0,E.T)(this._stopScrolling,this._destroyed))).subscribe(function(){var Ie=he._scrollHeader(Oe),Le=Ie.distance;(0===Le||Le>=Ie.maxScrollDistance)&&he._stopInterval()}))}},{key:"_scrollTo",value:function(Oe){if(this.disablePagination)return{maxScrollDistance:0,distance:0};var rt=this._getMaxScrollDistance();return this._scrollDistance=Math.max(0,Math.min(rt,Oe)),this._scrollDistanceChanged=!0,this._checkScrollingControls(),{maxScrollDistance:rt,distance:this._scrollDistance}}}]),Rt}();return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq),v.Y36(v.sBO),v.Y36(ce.rL),v.Y36(se.Is,8),v.Y36(v.R0b),v.Y36($.t4),v.Y36(T.Qb,8))},Ut.\u0275dir=v.lG2({type:Ut,inputs:{disablePagination:"disablePagination"}}),Ut}(),yn=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he,Ie,Ne,Le,ze,At){var an;return(0,b.Z)(this,Oe),(an=Lt.call(this,rt,he,Ie,Ne,Le,ze,At))._disableRipple=!1,an}return(0,_.Z)(Oe,[{key:"disableRipple",get:function(){return this._disableRipple},set:function(he){this._disableRipple=(0,ee.Ig)(he)}},{key:"_itemSelected",value:function(he){he.preventDefault()}}]),Oe}(ln);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq),v.Y36(v.sBO),v.Y36(ce.rL),v.Y36(se.Is,8),v.Y36(v.R0b),v.Y36($.t4),v.Y36(T.Qb,8))},Ut.\u0275dir=v.lG2({type:Ut,inputs:{disableRipple:"disableRipple"},features:[v.qOj]}),Ut}(),Tn=function(){var Ut=function(Rt){(0,w.Z)(Oe,Rt);var Lt=(0,N.Z)(Oe);function Oe(rt,he,Ie,Ne,Le,ze,At){return(0,b.Z)(this,Oe),Lt.call(this,rt,he,Ie,Ne,Le,ze,At)}return Oe}(yn);return Ut.\u0275fac=function(Lt){return new(Lt||Ut)(v.Y36(v.SBq),v.Y36(v.sBO),v.Y36(ce.rL),v.Y36(se.Is,8),v.Y36(v.R0b),v.Y36($.t4),v.Y36(T.Qb,8))},Ut.\u0275cmp=v.Xpm({type:Ut,selectors:[["mat-tab-header"]],contentQueries:function(Lt,Oe,rt){var he;1&Lt&&v.Suo(rt,ft,4),2&Lt&&v.iGM(he=v.CRH())&&(Oe._items=he)},viewQuery:function(Lt,Oe){var rt;1&Lt&&(v.Gf(Ct,7),v.Gf(dt,7),v.Gf(Ke,7),v.Gf(Bt,5),v.Gf(xt,5)),2&Lt&&(v.iGM(rt=v.CRH())&&(Oe._inkBar=rt.first),v.iGM(rt=v.CRH())&&(Oe._tabListContainer=rt.first),v.iGM(rt=v.CRH())&&(Oe._tabList=rt.first),v.iGM(rt=v.CRH())&&(Oe._nextPaginator=rt.first),v.iGM(rt=v.CRH())&&(Oe._previousPaginator=rt.first))},hostAttrs:[1,"mat-tab-header"],hostVars:4,hostBindings:function(Lt,Oe){2&Lt&&v.ekj("mat-tab-header-pagination-controls-enabled",Oe._showPaginationControls)("mat-tab-header-rtl","rtl"==Oe._getLayoutDirection())},inputs:{selectedIndex:"selectedIndex"},outputs:{selectFocusedIndex:"selectFocusedIndex",indexFocused:"indexFocused"},features:[v.qOj],ngContentSelectors:oe,decls:13,vars:8,consts:[["aria-hidden","true","mat-ripple","",1,"mat-tab-header-pagination","mat-tab-header-pagination-before","mat-elevation-z4",3,"matRippleDisabled","click","mousedown","touchend"],["previousPaginator",""],[1,"mat-tab-header-pagination-chevron"],[1,"mat-tab-label-container",3,"keydown"],["tabListContainer",""],["role","tablist",1,"mat-tab-list",3,"cdkObserveContent"],["tabList",""],[1,"mat-tab-labels"],["aria-hidden","true","mat-ripple","",1,"mat-tab-header-pagination","mat-tab-header-pagination-after","mat-elevation-z4",3,"matRippleDisabled","mousedown","click","touchend"],["nextPaginator",""]],template:function(Lt,Oe){1&Lt&&(v.F$t(),v.TgZ(0,"div",0,1),v.NdJ("click",function(){return Oe._handlePaginatorClick("before")})("mousedown",function(he){return Oe._handlePaginatorPress("before",he)})("touchend",function(){return Oe._stopInterval()}),v._UZ(2,"div",2),v.qZA(),v.TgZ(3,"div",3,4),v.NdJ("keydown",function(he){return Oe._handleKeydown(he)}),v.TgZ(5,"div",5,6),v.NdJ("cdkObserveContent",function(){return Oe._onContentChanges()}),v.TgZ(7,"div",7),v.Hsn(8),v.qZA(),v._UZ(9,"mat-ink-bar"),v.qZA(),v.qZA(),v.TgZ(10,"div",8,9),v.NdJ("mousedown",function(he){return Oe._handlePaginatorPress("after",he)})("click",function(){return Oe._handlePaginatorClick("after")})("touchend",function(){return Oe._stopInterval()}),v._UZ(12,"div",2),v.qZA()),2&Lt&&(v.ekj("mat-tab-header-pagination-disabled",Oe._disableScrollBefore),v.Q6J("matRippleDisabled",Oe._disableScrollBefore||Oe.disableRipple),v.xp6(5),v.ekj("_mat-animation-noopable","NoopAnimations"===Oe._animationMode),v.xp6(5),v.ekj("mat-tab-header-pagination-disabled",Oe._disableScrollAfter),v.Q6J("matRippleDisabled",Oe._disableScrollAfter||Oe.disableRipple))},directives:[g.wG,D.wD,Ct],styles:['.mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;content:"";height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-labels{display:flex}[mat-align-tabs=center]>.mat-tab-header .mat-tab-labels{justify-content:center}[mat-align-tabs=end]>.mat-tab-header .mat-tab-labels{justify-content:flex-end}.mat-tab-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}._mat-animation-noopable.mat-tab-list{transition:none;animation:none}.mat-tab-label{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;position:relative}.mat-tab-label:focus{outline:none}.mat-tab-label:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-label:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-label.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-label.mat-tab-disabled{opacity:.5}.mat-tab-label .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-label{opacity:1}@media(max-width: 599px){.mat-tab-label{min-width:72px}}\n'],encapsulation:2}),Ut}(),ur=function(){var Ut=function Rt(){(0,b.Z)(this,Rt)};return Ut.\u0275fac=function(Lt){return new(Lt||Ut)},Ut.\u0275mod=v.oAB({type:Ut}),Ut.\u0275inj=v.cJS({imports:[[S.ez,g.BQ,A.eL,g.si,D.Q8,I.rt],g.BQ]}),Ut}()},38480:function(ue,q,f){"use strict";f.d(q,{Qb:function(){return hd},PW:function(){return nu}});var B=f(71955),U=f(18967),V=f(14105),Z=f(10509),w=f(97154),N=f(38999),b=f(29176),_=f(739),I=f(13920),D=f(89200),A=f(36683),S=f(62467);function v(){return"undefined"!=typeof window&&void 0!==window.document}function g(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function T(Se){switch(Se.length){case 0:return new _.ZN;case 1:return Se[0];default:return new _.ZE(Se)}}function R(Se,ge,Q,ne){var ke=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},Ve=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},lt=[],wt=[],Zt=-1,$t=null;if(ne.forEach(function(Dn){var Un=Dn.offset,Qn=Un==Zt,fr=Qn&&$t||{};Object.keys(Dn).forEach(function(Or){var br=Or,wr=Dn[Or];if("offset"!==Or)switch(br=ge.normalizePropertyName(br,lt),wr){case _.k1:wr=ke[Or];break;case _.l3:wr=Ve[Or];break;default:wr=ge.normalizeStyleValue(Or,br,wr,lt)}fr[br]=wr}),Qn||wt.push(fr),$t=fr,Zt=Un}),lt.length){var cn="\n - ";throw new Error("Unable to animate due to the following errors:".concat(cn).concat(lt.join(cn)))}return wt}function k(Se,ge,Q,ne){switch(ge){case"start":Se.onStart(function(){return ne(Q&&E(Q,"start",Se))});break;case"done":Se.onDone(function(){return ne(Q&&E(Q,"done",Se))});break;case"destroy":Se.onDestroy(function(){return ne(Q&&E(Q,"destroy",Se))})}}function E(Se,ge,Q){var ne=Q.totalTime,Ve=x(Se.element,Se.triggerName,Se.fromState,Se.toState,ge||Se.phaseName,null==ne?Se.totalTime:ne,!!Q.disabled),lt=Se._data;return null!=lt&&(Ve._data=lt),Ve}function x(Se,ge,Q,ne){var ke=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",Ve=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,lt=arguments.length>6?arguments[6]:void 0;return{element:Se,triggerName:ge,fromState:Q,toState:ne,phaseName:ke,totalTime:Ve,disabled:!!lt}}function O(Se,ge,Q){var ne;return Se instanceof Map?(ne=Se.get(ge))||Se.set(ge,ne=Q):(ne=Se[ge])||(ne=Se[ge]=Q),ne}function F(Se){var ge=Se.indexOf(":");return[Se.substring(1,ge),Se.substr(ge+1)]}var z=function(ge,Q){return!1},j=function(ge,Q){return!1},ee=function(ge,Q,ne){return[]},ae=g();(ae||"undefined"!=typeof Element)&&(z=v()?function(ge,Q){for(;Q&&Q!==document.documentElement;){if(Q===ge)return!0;Q=Q.parentNode||Q.host}return!1}:function(ge,Q){return ge.contains(Q)},j=function(){if(ae||Element.prototype.matches)return function(Q,ne){return Q.matches(ne)};var Se=Element.prototype,ge=Se.matchesSelector||Se.mozMatchesSelector||Se.msMatchesSelector||Se.oMatchesSelector||Se.webkitMatchesSelector;return ge?function(Q,ne){return ge.apply(Q,[ne])}:j}(),ee=function(ge,Q,ne){var ke=[];if(ne)for(var Ve=ge.querySelectorAll(Q),lt=0;lt1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(Se).forEach(function(Q){ge[Q]=Se[Q]}),ge}function Ln(Se,ge){var Q=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(ge)for(var ne in Se)Q[ne]=Se[ne];else rn(Se,Q);return Q}function Rn(Se,ge,Q){return Q?ge+":"+Q+";":""}function $n(Se){for(var ge="",Q=0;Q *";case":leave":return"* => void";case":increment":return function(Q,ne){return parseFloat(ne)>parseFloat(Q)};case":decrement":return function(Q,ne){return parseFloat(ne) *"}}(Se,Q);if("function"==typeof ne)return void ge.push(ne);Se=ne}var ke=Se.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==ke||ke.length<4)return Q.push('The provided transition expression "'.concat(Se,'" is not supported')),ge;var Ve=ke[1],lt=ke[2],wt=ke[3];ge.push(Sn(Ve,wt)),"<"==lt[0]&&!("*"==Ve&&"*"==wt)&&ge.push(Sn(wt,Ve))}(ne,Q,ge)}):Q.push(Se),Q}var Yn=new Set(["true","1"]),Cn=new Set(["false","0"]);function Sn(Se,ge){var Q=Yn.has(Se)||Cn.has(Se),ne=Yn.has(ge)||Cn.has(ge);return function(ke,Ve){var lt="*"==Se||Se==ke,wt="*"==ge||ge==Ve;return!lt&&Q&&"boolean"==typeof ke&&(lt=ke?Yn.has(Se):Cn.has(Se)),!wt&&ne&&"boolean"==typeof Ve&&(wt=Ve?Yn.has(ge):Cn.has(ge)),lt&&wt}}var ur=new RegExp("s*".concat(":self","s*,?"),"g");function Ut(Se,ge,Q){return new Lt(Se).build(ge,Q)}var Lt=function(){function Se(ge){(0,U.Z)(this,Se),this._driver=ge}return(0,V.Z)(Se,[{key:"build",value:function(Q,ne){var ke=new he(ne);return this._resetContextStyleTimingState(ke),Jt(this,_r(Q),ke)}},{key:"_resetContextStyleTimingState",value:function(Q){Q.currentQuerySelector="",Q.collectedStyles={},Q.collectedStyles[""]={},Q.currentTime=0}},{key:"visitTrigger",value:function(Q,ne){var ke=this,Ve=ne.queryCount=0,lt=ne.depCount=0,wt=[],Zt=[];return"@"==Q.name.charAt(0)&&ne.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),Q.definitions.forEach(function($t){if(ke._resetContextStyleTimingState(ne),0==$t.type){var cn=$t,Dn=cn.name;Dn.toString().split(/\s*,\s*/).forEach(function(Qn){cn.name=Qn,wt.push(ke.visitState(cn,ne))}),cn.name=Dn}else if(1==$t.type){var Un=ke.visitTransition($t,ne);Ve+=Un.queryCount,lt+=Un.depCount,Zt.push(Un)}else ne.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:Q.name,states:wt,transitions:Zt,queryCount:Ve,depCount:lt,options:null}}},{key:"visitState",value:function(Q,ne){var ke=this.visitStyle(Q.styles,ne),Ve=Q.options&&Q.options.params||null;if(ke.containsDynamicStyles){var lt=new Set,wt=Ve||{};if(ke.styles.forEach(function($t){if(Ne($t)){var cn=$t;Object.keys(cn).forEach(function(Dn){ve(cn[Dn]).forEach(function(Un){wt.hasOwnProperty(Un)||lt.add(Un)})})}}),lt.size){var Zt=Te(lt.values());ne.errors.push('state("'.concat(Q.name,'", ...) must define default values for all the following style substitutions: ').concat(Zt.join(", ")))}}return{type:0,name:Q.name,style:ke,options:Ve?{params:Ve}:null}}},{key:"visitTransition",value:function(Q,ne){ne.queryCount=0,ne.depCount=0;var ke=Jt(this,_r(Q.animation),ne);return{type:1,matchers:yn(Q.expr,ne.errors),animation:ke,queryCount:ne.queryCount,depCount:ne.depCount,options:ze(Q.options)}}},{key:"visitSequence",value:function(Q,ne){var ke=this;return{type:2,steps:Q.steps.map(function(Ve){return Jt(ke,Ve,ne)}),options:ze(Q.options)}}},{key:"visitGroup",value:function(Q,ne){var ke=this,Ve=ne.currentTime,lt=0,wt=Q.steps.map(function(Zt){ne.currentTime=Ve;var $t=Jt(ke,Zt,ne);return lt=Math.max(lt,ne.currentTime),$t});return ne.currentTime=lt,{type:3,steps:wt,options:ze(Q.options)}}},{key:"visitAnimate",value:function(Q,ne){var ke=function(Se,ge){var Q=null;if(Se.hasOwnProperty("duration"))Q=Se;else if("number"==typeof Se)return At(en(Se,ge).duration,0,"");var ke=Se;if(ke.split(/\s+/).some(function(wt){return"{"==wt.charAt(0)&&"{"==wt.charAt(1)})){var lt=At(0,0,"");return lt.dynamic=!0,lt.strValue=ke,lt}return At((Q=Q||en(ke,ge)).duration,Q.delay,Q.easing)}(Q.timings,ne.errors);ne.currentAnimateTimings=ke;var Ve,lt=Q.styles?Q.styles:(0,_.oB)({});if(5==lt.type)Ve=this.visitKeyframes(lt,ne);else{var wt=Q.styles,Zt=!1;if(!wt){Zt=!0;var $t={};ke.easing&&($t.easing=ke.easing),wt=(0,_.oB)($t)}ne.currentTime+=ke.duration+ke.delay;var cn=this.visitStyle(wt,ne);cn.isEmptyStep=Zt,Ve=cn}return ne.currentAnimateTimings=null,{type:4,timings:ke,style:Ve,options:null}}},{key:"visitStyle",value:function(Q,ne){var ke=this._makeStyleAst(Q,ne);return this._validateStyleAst(ke,ne),ke}},{key:"_makeStyleAst",value:function(Q,ne){var ke=[];Array.isArray(Q.styles)?Q.styles.forEach(function(wt){"string"==typeof wt?wt==_.l3?ke.push(wt):ne.errors.push("The provided style string value ".concat(wt," is not allowed.")):ke.push(wt)}):ke.push(Q.styles);var Ve=!1,lt=null;return ke.forEach(function(wt){if(Ne(wt)){var Zt=wt,$t=Zt.easing;if($t&&(lt=$t,delete Zt.easing),!Ve)for(var cn in Zt)if(Zt[cn].toString().indexOf("{{")>=0){Ve=!0;break}}}),{type:6,styles:ke,easing:lt,offset:Q.offset,containsDynamicStyles:Ve,options:null}}},{key:"_validateStyleAst",value:function(Q,ne){var ke=this,Ve=ne.currentAnimateTimings,lt=ne.currentTime,wt=ne.currentTime;Ve&&wt>0&&(wt-=Ve.duration+Ve.delay),Q.styles.forEach(function(Zt){"string"!=typeof Zt&&Object.keys(Zt).forEach(function($t){if(ke._driver.validateStyleProperty($t)){var cn=ne.collectedStyles[ne.currentQuerySelector],Dn=cn[$t],Un=!0;Dn&&(wt!=lt&&wt>=Dn.startTime&<<=Dn.endTime&&(ne.errors.push('The CSS property "'.concat($t,'" that exists between the times of "').concat(Dn.startTime,'ms" and "').concat(Dn.endTime,'ms" is also being animated in a parallel animation between the times of "').concat(wt,'ms" and "').concat(lt,'ms"')),Un=!1),wt=Dn.startTime),Un&&(cn[$t]={startTime:wt,endTime:lt}),ne.options&&function(Se,ge,Q){var ne=ge.params||{},ke=ve(Se);ke.length&&ke.forEach(function(Ve){ne.hasOwnProperty(Ve)||Q.push("Unable to resolve the local animation param ".concat(Ve," in the given list of values"))})}(Zt[$t],ne.options,ne.errors)}else ne.errors.push('The provided animation property "'.concat($t,'" is not a supported CSS property for animations'))})})}},{key:"visitKeyframes",value:function(Q,ne){var ke=this,Ve={type:5,styles:[],options:null};if(!ne.currentAnimateTimings)return ne.errors.push("keyframes() must be placed inside of a call to animate()"),Ve;var wt=0,Zt=[],$t=!1,cn=!1,Dn=0,Un=Q.steps.map(function(hi){var oi=ke._makeStyleAst(hi,ne),Ao=null!=oi.offset?oi.offset:function(Se){if("string"==typeof Se)return null;var ge=null;if(Array.isArray(Se))Se.forEach(function(ne){if(Ne(ne)&&ne.hasOwnProperty("offset")){var ke=ne;ge=parseFloat(ke.offset),delete ke.offset}});else if(Ne(Se)&&Se.hasOwnProperty("offset")){var Q=Se;ge=parseFloat(Q.offset),delete Q.offset}return ge}(oi.styles),Be=0;return null!=Ao&&(wt++,Be=oi.offset=Ao),cn=cn||Be<0||Be>1,$t=$t||Be0&&wt0?oi==Or?1:fr*oi:Zt[oi],Be=Ao*ui;ne.currentTime=br+wr.delay+Be,wr.duration=Be,ke._validateStyleAst(hi,ne),hi.offset=Ao,Ve.styles.push(hi)}),Ve}},{key:"visitReference",value:function(Q,ne){return{type:8,animation:Jt(this,_r(Q.animation),ne),options:ze(Q.options)}}},{key:"visitAnimateChild",value:function(Q,ne){return ne.depCount++,{type:9,options:ze(Q.options)}}},{key:"visitAnimateRef",value:function(Q,ne){return{type:10,animation:this.visitReference(Q.animation,ne),options:ze(Q.options)}}},{key:"visitQuery",value:function(Q,ne){var ke=ne.currentQuerySelector,Ve=Q.options||{};ne.queryCount++,ne.currentQuery=Q;var lt=function(Se){var ge=!!Se.split(/\s*,\s*/).find(function(Q){return":self"==Q});return ge&&(Se=Se.replace(ur,"")),[Se=Se.replace(/@\*/g,Qt).replace(/@\w+/g,function(Q){return Qt+"-"+Q.substr(1)}).replace(/:animating/g,Ct),ge]}(Q.selector),wt=(0,B.Z)(lt,2),Zt=wt[0],$t=wt[1];ne.currentQuerySelector=ke.length?ke+" "+Zt:Zt,O(ne.collectedStyles,ne.currentQuerySelector,{});var cn=Jt(this,_r(Q.animation),ne);return ne.currentQuery=null,ne.currentQuerySelector=ke,{type:11,selector:Zt,limit:Ve.limit||0,optional:!!Ve.optional,includeSelf:$t,animation:cn,originalSelector:Q.selector,options:ze(Q.options)}}},{key:"visitStagger",value:function(Q,ne){ne.currentQuery||ne.errors.push("stagger() can only be used inside of query()");var ke="full"===Q.timings?{duration:0,delay:0,easing:"full"}:en(Q.timings,ne.errors,!0);return{type:12,animation:Jt(this,_r(Q.animation),ne),timings:ke,options:null}}}]),Se}(),he=function Se(ge){(0,U.Z)(this,Se),this.errors=ge,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 Ne(Se){return!Array.isArray(Se)&&"object"==typeof Se}function ze(Se){return Se?(Se=rn(Se)).params&&(Se.params=function(Se){return Se?rn(Se):null}(Se.params)):Se={},Se}function At(Se,ge,Q){return{duration:Se,delay:ge,easing:Q}}function an(Se,ge,Q,ne,ke,Ve){var lt=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,wt=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return{type:1,element:Se,keyframes:ge,preStyleProps:Q,postStyleProps:ne,duration:ke,delay:Ve,totalTime:ke+Ve,easing:lt,subTimeline:wt}}var jn=function(){function Se(){(0,U.Z)(this,Se),this._map=new Map}return(0,V.Z)(Se,[{key:"consume",value:function(Q){var ne=this._map.get(Q);return ne?this._map.delete(Q):ne=[],ne}},{key:"append",value:function(Q,ne){var ke,Ve=this._map.get(Q);Ve||this._map.set(Q,Ve=[]),(ke=Ve).push.apply(ke,(0,S.Z)(ne))}},{key:"has",value:function(Q){return this._map.has(Q)}},{key:"clear",value:function(){this._map.clear()}}]),Se}(),yr=new RegExp(":enter","g"),co=new RegExp(":leave","g");function Zi(Se,ge,Q,ne,ke){var Ve=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},lt=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},wt=arguments.length>7?arguments[7]:void 0,Zt=arguments.length>8?arguments[8]:void 0,$t=arguments.length>9&&void 0!==arguments[9]?arguments[9]:[];return(new bo).buildKeyframes(Se,ge,Q,ne,ke,Ve,lt,wt,Zt,$t)}var bo=function(){function Se(){(0,U.Z)(this,Se)}return(0,V.Z)(Se,[{key:"buildKeyframes",value:function(Q,ne,ke,Ve,lt,wt,Zt,$t,cn){var Dn=arguments.length>9&&void 0!==arguments[9]?arguments[9]:[];cn=cn||new jn;var Un=new Xo(Q,ne,cn,Ve,lt,Dn,[]);Un.options=$t,Un.currentTimeline.setStyles([wt],null,Un.errors,$t),Jt(this,ke,Un);var Qn=Un.timelines.filter(function(Or){return Or.containsAnimation()});if(Qn.length&&Object.keys(Zt).length){var fr=Qn[Qn.length-1];fr.allowOnlyTimelineStyles()||fr.setStyles([Zt],null,Un.errors,$t)}return Qn.length?Qn.map(function(Or){return Or.buildKeyframes()}):[an(ne,[],[],[],0,0,"",!1)]}},{key:"visitTrigger",value:function(Q,ne){}},{key:"visitState",value:function(Q,ne){}},{key:"visitTransition",value:function(Q,ne){}},{key:"visitAnimateChild",value:function(Q,ne){var ke=ne.subInstructions.consume(ne.element);if(ke){var Ve=ne.createSubContext(Q.options),lt=ne.currentTimeline.currentTime,wt=this._visitSubInstructions(ke,Ve,Ve.options);lt!=wt&&ne.transformIntoNewTimeline(wt)}ne.previousNode=Q}},{key:"visitAnimateRef",value:function(Q,ne){var ke=ne.createSubContext(Q.options);ke.transformIntoNewTimeline(),this.visitReference(Q.animation,ke),ne.transformIntoNewTimeline(ke.currentTimeline.currentTime),ne.previousNode=Q}},{key:"_visitSubInstructions",value:function(Q,ne,ke){var lt=ne.currentTimeline.currentTime,wt=null!=ke.duration?qt(ke.duration):null,Zt=null!=ke.delay?qt(ke.delay):null;return 0!==wt&&Q.forEach(function($t){var cn=ne.appendInstructionToTimeline($t,wt,Zt);lt=Math.max(lt,cn.duration+cn.delay)}),lt}},{key:"visitReference",value:function(Q,ne){ne.updateOptions(Q.options,!0),Jt(this,Q.animation,ne),ne.previousNode=Q}},{key:"visitSequence",value:function(Q,ne){var ke=this,Ve=ne.subContextCount,lt=ne,wt=Q.options;if(wt&&(wt.params||wt.delay)&&((lt=ne.createSubContext(wt)).transformIntoNewTimeline(),null!=wt.delay)){6==lt.previousNode.type&&(lt.currentTimeline.snapshotCurrentStyles(),lt.previousNode=po);var Zt=qt(wt.delay);lt.delayNextStep(Zt)}Q.steps.length&&(Q.steps.forEach(function($t){return Jt(ke,$t,lt)}),lt.currentTimeline.applyStylesToKeyframe(),lt.subContextCount>Ve&<.transformIntoNewTimeline()),ne.previousNode=Q}},{key:"visitGroup",value:function(Q,ne){var ke=this,Ve=[],lt=ne.currentTimeline.currentTime,wt=Q.options&&Q.options.delay?qt(Q.options.delay):0;Q.steps.forEach(function(Zt){var $t=ne.createSubContext(Q.options);wt&&$t.delayNextStep(wt),Jt(ke,Zt,$t),lt=Math.max(lt,$t.currentTimeline.currentTime),Ve.push($t.currentTimeline)}),Ve.forEach(function(Zt){return ne.currentTimeline.mergeTimelineCollectedStyles(Zt)}),ne.transformIntoNewTimeline(lt),ne.previousNode=Q}},{key:"_visitTiming",value:function(Q,ne){if(Q.dynamic){var ke=Q.strValue;return en(ne.params?ye(ke,ne.params,ne.errors):ke,ne.errors)}return{duration:Q.duration,delay:Q.delay,easing:Q.easing}}},{key:"visitAnimate",value:function(Q,ne){var ke=ne.currentAnimateTimings=this._visitTiming(Q.timings,ne),Ve=ne.currentTimeline;ke.delay&&(ne.incrementTime(ke.delay),Ve.snapshotCurrentStyles());var lt=Q.style;5==lt.type?this.visitKeyframes(lt,ne):(ne.incrementTime(ke.duration),this.visitStyle(lt,ne),Ve.applyStylesToKeyframe()),ne.currentAnimateTimings=null,ne.previousNode=Q}},{key:"visitStyle",value:function(Q,ne){var ke=ne.currentTimeline,Ve=ne.currentAnimateTimings;!Ve&&ke.getCurrentStyleProperties().length&&ke.forwardFrame();var lt=Ve&&Ve.easing||Q.easing;Q.isEmptyStep?ke.applyEmptyStep(lt):ke.setStyles(Q.styles,lt,ne.errors,ne.options),ne.previousNode=Q}},{key:"visitKeyframes",value:function(Q,ne){var ke=ne.currentAnimateTimings,Ve=ne.currentTimeline.duration,lt=ke.duration,Zt=ne.createSubContext().currentTimeline;Zt.easing=ke.easing,Q.styles.forEach(function($t){Zt.forwardTime(($t.offset||0)*lt),Zt.setStyles($t.styles,$t.easing,ne.errors,ne.options),Zt.applyStylesToKeyframe()}),ne.currentTimeline.mergeTimelineCollectedStyles(Zt),ne.transformIntoNewTimeline(Ve+lt),ne.previousNode=Q}},{key:"visitQuery",value:function(Q,ne){var ke=this,Ve=ne.currentTimeline.currentTime,lt=Q.options||{},wt=lt.delay?qt(lt.delay):0;wt&&(6===ne.previousNode.type||0==Ve&&ne.currentTimeline.getCurrentStyleProperties().length)&&(ne.currentTimeline.snapshotCurrentStyles(),ne.previousNode=po);var Zt=Ve,$t=ne.invokeQuery(Q.selector,Q.originalSelector,Q.limit,Q.includeSelf,!!lt.optional,ne.errors);ne.currentQueryTotal=$t.length;var cn=null;$t.forEach(function(Dn,Un){ne.currentQueryIndex=Un;var Qn=ne.createSubContext(Q.options,Dn);wt&&Qn.delayNextStep(wt),Dn===ne.element&&(cn=Qn.currentTimeline),Jt(ke,Q.animation,Qn),Qn.currentTimeline.applyStylesToKeyframe(),Zt=Math.max(Zt,Qn.currentTimeline.currentTime)}),ne.currentQueryIndex=0,ne.currentQueryTotal=0,ne.transformIntoNewTimeline(Zt),cn&&(ne.currentTimeline.mergeTimelineCollectedStyles(cn),ne.currentTimeline.snapshotCurrentStyles()),ne.previousNode=Q}},{key:"visitStagger",value:function(Q,ne){var ke=ne.parentContext,Ve=ne.currentTimeline,lt=Q.timings,wt=Math.abs(lt.duration),Zt=wt*(ne.currentQueryTotal-1),$t=wt*ne.currentQueryIndex;switch(lt.duration<0?"reverse":lt.easing){case"reverse":$t=Zt-$t;break;case"full":$t=ke.currentStaggerTime}var Dn=ne.currentTimeline;$t&&Dn.delayNextStep($t);var Un=Dn.currentTime;Jt(this,Q.animation,ne),ne.previousNode=Q,ke.currentStaggerTime=Ve.currentTime-Un+(Ve.startTime-ke.currentTimeline.startTime)}}]),Se}(),po={},Xo=function(){function Se(ge,Q,ne,ke,Ve,lt,wt,Zt){(0,U.Z)(this,Se),this._driver=ge,this.element=Q,this.subInstructions=ne,this._enterClassName=ke,this._leaveClassName=Ve,this.errors=lt,this.timelines=wt,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=po,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=Zt||new Ei(this._driver,Q,0),wt.push(this.currentTimeline)}return(0,V.Z)(Se,[{key:"params",get:function(){return this.options.params}},{key:"updateOptions",value:function(Q,ne){var ke=this;if(Q){var Ve=Q,lt=this.options;null!=Ve.duration&&(lt.duration=qt(Ve.duration)),null!=Ve.delay&&(lt.delay=qt(Ve.delay));var wt=Ve.params;if(wt){var Zt=lt.params;Zt||(Zt=this.options.params={}),Object.keys(wt).forEach(function($t){(!ne||!Zt.hasOwnProperty($t))&&(Zt[$t]=ye(wt[$t],Zt,ke.errors))})}}}},{key:"_copyOptions",value:function(){var Q={};if(this.options){var ne=this.options.params;if(ne){var ke=Q.params={};Object.keys(ne).forEach(function(Ve){ke[Ve]=ne[Ve]})}}return Q}},{key:"createSubContext",value:function(){var Q=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,ne=arguments.length>1?arguments[1]:void 0,ke=arguments.length>2?arguments[2]:void 0,Ve=ne||this.element,lt=new Se(this._driver,Ve,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(Ve,ke||0));return lt.previousNode=this.previousNode,lt.currentAnimateTimings=this.currentAnimateTimings,lt.options=this._copyOptions(),lt.updateOptions(Q),lt.currentQueryIndex=this.currentQueryIndex,lt.currentQueryTotal=this.currentQueryTotal,lt.parentContext=this,this.subContextCount++,lt}},{key:"transformIntoNewTimeline",value:function(Q){return this.previousNode=po,this.currentTimeline=this.currentTimeline.fork(this.element,Q),this.timelines.push(this.currentTimeline),this.currentTimeline}},{key:"appendInstructionToTimeline",value:function(Q,ne,ke){var Ve={duration:null!=ne?ne:Q.duration,delay:this.currentTimeline.currentTime+(null!=ke?ke:0)+Q.delay,easing:""},lt=new no(this._driver,Q.element,Q.keyframes,Q.preStyleProps,Q.postStyleProps,Ve,Q.stretchStartingKeyframe);return this.timelines.push(lt),Ve}},{key:"incrementTime",value:function(Q){this.currentTimeline.forwardTime(this.currentTimeline.duration+Q)}},{key:"delayNextStep",value:function(Q){Q>0&&this.currentTimeline.delayNextStep(Q)}},{key:"invokeQuery",value:function(Q,ne,ke,Ve,lt,wt){var Zt=[];if(Ve&&Zt.push(this.element),Q.length>0){Q=(Q=Q.replace(yr,"."+this._enterClassName)).replace(co,"."+this._leaveClassName);var cn=this._driver.query(this.element,Q,1!=ke);0!==ke&&(cn=ke<0?cn.slice(cn.length+ke,cn.length):cn.slice(0,ke)),Zt.push.apply(Zt,(0,S.Z)(cn))}return!lt&&0==Zt.length&&wt.push('`query("'.concat(ne,'")` returned zero elements. (Use `query("').concat(ne,'", { optional: true })` if you wish to allow this.)')),Zt}}]),Se}(),Ei=function(){function Se(ge,Q,ne,ke){(0,U.Z)(this,Se),this._driver=ge,this.element=Q,this.startTime=ne,this._elementTimelineStylesLookup=ke,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(Q),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(Q,this._localTimelineStyles)),this._loadKeyframe()}return(0,V.Z)(Se,[{key:"containsAnimation",value:function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}},{key:"getCurrentStyleProperties",value:function(){return Object.keys(this._currentKeyframe)}},{key:"currentTime",get:function(){return this.startTime+this.duration}},{key:"delayNextStep",value:function(Q){var ne=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||ne?(this.forwardTime(this.currentTime+Q),ne&&this.snapshotCurrentStyles()):this.startTime+=Q}},{key:"fork",value:function(Q,ne){return this.applyStylesToKeyframe(),new Se(this._driver,Q,ne||this.currentTime,this._elementTimelineStylesLookup)}},{key:"_loadKeyframe",value:function(){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))}},{key:"forwardFrame",value:function(){this.duration+=1,this._loadKeyframe()}},{key:"forwardTime",value:function(Q){this.applyStylesToKeyframe(),this.duration=Q,this._loadKeyframe()}},{key:"_updateStyle",value:function(Q,ne){this._localTimelineStyles[Q]=ne,this._globalTimelineStyles[Q]=ne,this._styleSummary[Q]={time:this.currentTime,value:ne}}},{key:"allowOnlyTimelineStyles",value:function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}},{key:"applyEmptyStep",value:function(Q){var ne=this;Q&&(this._previousKeyframe.easing=Q),Object.keys(this._globalTimelineStyles).forEach(function(ke){ne._backFill[ke]=ne._globalTimelineStyles[ke]||_.l3,ne._currentKeyframe[ke]=_.l3}),this._currentEmptyStepKeyframe=this._currentKeyframe}},{key:"setStyles",value:function(Q,ne,ke,Ve){var lt=this;ne&&(this._previousKeyframe.easing=ne);var wt=Ve&&Ve.params||{},Zt=function(Se,ge){var ne,Q={};return Se.forEach(function(ke){"*"===ke?(ne=ne||Object.keys(ge)).forEach(function(Ve){Q[Ve]=_.l3}):Ln(ke,!1,Q)}),Q}(Q,this._globalTimelineStyles);Object.keys(Zt).forEach(function($t){var cn=ye(Zt[$t],wt,ke);lt._pendingStyles[$t]=cn,lt._localTimelineStyles.hasOwnProperty($t)||(lt._backFill[$t]=lt._globalTimelineStyles.hasOwnProperty($t)?lt._globalTimelineStyles[$t]:_.l3),lt._updateStyle($t,cn)})}},{key:"applyStylesToKeyframe",value:function(){var Q=this,ne=this._pendingStyles,ke=Object.keys(ne);0!=ke.length&&(this._pendingStyles={},ke.forEach(function(Ve){Q._currentKeyframe[Ve]=ne[Ve]}),Object.keys(this._localTimelineStyles).forEach(function(Ve){Q._currentKeyframe.hasOwnProperty(Ve)||(Q._currentKeyframe[Ve]=Q._localTimelineStyles[Ve])}))}},{key:"snapshotCurrentStyles",value:function(){var Q=this;Object.keys(this._localTimelineStyles).forEach(function(ne){var ke=Q._localTimelineStyles[ne];Q._pendingStyles[ne]=ke,Q._updateStyle(ne,ke)})}},{key:"getFinalKeyframe",value:function(){return this._keyframes.get(this.duration)}},{key:"properties",get:function(){var Q=[];for(var ne in this._currentKeyframe)Q.push(ne);return Q}},{key:"mergeTimelineCollectedStyles",value:function(Q){var ne=this;Object.keys(Q._styleSummary).forEach(function(ke){var Ve=ne._styleSummary[ke],lt=Q._styleSummary[ke];(!Ve||lt.time>Ve.time)&&ne._updateStyle(ke,lt.value)})}},{key:"buildKeyframes",value:function(){var Q=this;this.applyStylesToKeyframe();var ne=new Set,ke=new Set,Ve=1===this._keyframes.size&&0===this.duration,lt=[];this._keyframes.forEach(function(Dn,Un){var Qn=Ln(Dn,!0);Object.keys(Qn).forEach(function(fr){var Or=Qn[fr];Or==_.k1?ne.add(fr):Or==_.l3&&ke.add(fr)}),Ve||(Qn.offset=Un/Q.duration),lt.push(Qn)});var wt=ne.size?Te(ne.values()):[],Zt=ke.size?Te(ke.values()):[];if(Ve){var $t=lt[0],cn=rn($t);$t.offset=0,cn.offset=1,lt=[$t,cn]}return an(this.element,lt,wt,Zt,this.duration,this.startTime,this.easing,!1)}}]),Se}(),no=function(Se){(0,Z.Z)(Q,Se);var ge=(0,w.Z)(Q);function Q(ne,ke,Ve,lt,wt,Zt){var $t,cn=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return(0,U.Z)(this,Q),($t=ge.call(this,ne,ke,Zt.delay)).keyframes=Ve,$t.preStyleProps=lt,$t.postStyleProps=wt,$t._stretchStartingKeyframe=cn,$t.timings={duration:Zt.duration,delay:Zt.delay,easing:Zt.easing},$t}return(0,V.Z)(Q,[{key:"containsAnimation",value:function(){return this.keyframes.length>1}},{key:"buildKeyframes",value:function(){var ke=this.keyframes,Ve=this.timings,lt=Ve.delay,wt=Ve.duration,Zt=Ve.easing;if(this._stretchStartingKeyframe&<){var $t=[],cn=wt+lt,Dn=lt/cn,Un=Ln(ke[0],!1);Un.offset=0,$t.push(Un);var Qn=Ln(ke[0],!1);Qn.offset=vi(Dn),$t.push(Qn);for(var fr=ke.length-1,Or=1;Or<=fr;Or++){var br=Ln(ke[Or],!1);br.offset=vi((lt+br.offset*wt)/cn),$t.push(br)}wt=cn,lt=0,Zt="",ke=$t}return an(this.element,ke,this.preStyleProps,this.postStyleProps,wt,lt,Zt,!0)}}]),Q}(Ei);function vi(Se){var ge=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,Q=Math.pow(10,ge-1);return Math.round(Se*Q)/Q}var fi=function Se(){(0,U.Z)(this,Se)},ki=function(Se){(0,Z.Z)(Q,Se);var ge=(0,w.Z)(Q);function Q(){return(0,U.Z)(this,Q),ge.apply(this,arguments)}return(0,V.Z)(Q,[{key:"normalizePropertyName",value:function(ke,Ve){return ct(ke)}},{key:"normalizeStyleValue",value:function(ke,Ve,lt,wt){var Zt="",$t=lt.toString().trim();if(Ot[Ve]&&0!==lt&&"0"!==lt)if("number"==typeof lt)Zt="px";else{var cn=lt.match(/^[+-]?[\d\.]+([a-z]*)$/);cn&&0==cn[1].length&&wt.push("Please provide a CSS unit value for ".concat(ke,":").concat(lt))}return $t+Zt}}]),Q}(fi),Ot=function(){return Se="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(","),ge={},Se.forEach(function(Q){return ge[Q]=!0}),ge;var Se,ge}();function Pt(Se,ge,Q,ne,ke,Ve,lt,wt,Zt,$t,cn,Dn,Un){return{type:0,element:Se,triggerName:ge,isRemovalTransition:ke,fromState:Q,fromStyles:Ve,toState:ne,toStyles:lt,timelines:wt,queriedElements:Zt,preStyleProps:$t,postStyleProps:cn,totalTime:Dn,errors:Un}}var Vt={},Gt=function(){function Se(ge,Q,ne){(0,U.Z)(this,Se),this._triggerName=ge,this.ast=Q,this._stateStyles=ne}return(0,V.Z)(Se,[{key:"match",value:function(Q,ne,ke,Ve){return function(Se,ge,Q,ne,ke){return Se.some(function(Ve){return Ve(ge,Q,ne,ke)})}(this.ast.matchers,Q,ne,ke,Ve)}},{key:"buildStyles",value:function(Q,ne,ke){var Ve=this._stateStyles["*"],lt=this._stateStyles[Q],wt=Ve?Ve.buildStyles(ne,ke):{};return lt?lt.buildStyles(ne,ke):wt}},{key:"build",value:function(Q,ne,ke,Ve,lt,wt,Zt,$t,cn,Dn){var Un=[],Qn=this.ast.options&&this.ast.options.params||Vt,Or=this.buildStyles(ke,Zt&&Zt.params||Vt,Un),br=$t&&$t.params||Vt,wr=this.buildStyles(Ve,br,Un),ui=new Set,hi=new Map,oi=new Map,Ao="void"===Ve,Be={params:Object.assign(Object.assign({},Qn),br)},Ye=Dn?[]:Zi(Q,ne,this.ast.animation,lt,wt,Or,wr,Be,cn,Un),Ee=0;if(Ye.forEach(function(Ze){Ee=Math.max(Ze.duration+Ze.delay,Ee)}),Un.length)return Pt(ne,this._triggerName,ke,Ve,Ao,Or,wr,[],[],hi,oi,Ee,Un);Ye.forEach(function(Ze){var nt=Ze.element,Tt=O(hi,nt,{});Ze.preStyleProps.forEach(function(bn){return Tt[bn]=!0});var sn=O(oi,nt,{});Ze.postStyleProps.forEach(function(bn){return sn[bn]=!0}),nt!==ne&&ui.add(nt)});var Ue=Te(ui.values());return Pt(ne,this._triggerName,ke,Ve,Ao,Or,wr,Ye,Ue,hi,oi,Ee)}}]),Se}(),gn=function(){function Se(ge,Q,ne){(0,U.Z)(this,Se),this.styles=ge,this.defaultParams=Q,this.normalizer=ne}return(0,V.Z)(Se,[{key:"buildStyles",value:function(Q,ne){var ke=this,Ve={},lt=rn(this.defaultParams);return Object.keys(Q).forEach(function(wt){var Zt=Q[wt];null!=Zt&&(lt[wt]=Zt)}),this.styles.styles.forEach(function(wt){if("string"!=typeof wt){var Zt=wt;Object.keys(Zt).forEach(function($t){var cn=Zt[$t];cn.length>1&&(cn=ye(cn,lt,ne));var Dn=ke.normalizer.normalizePropertyName($t,ne);cn=ke.normalizer.normalizeStyleValue($t,Dn,cn,ne),Ve[Dn]=cn})}}),Ve}}]),Se}(),zn=function(){function Se(ge,Q,ne){var ke=this;(0,U.Z)(this,Se),this.name=ge,this.ast=Q,this._normalizer=ne,this.transitionFactories=[],this.states={},Q.states.forEach(function(Ve){ke.states[Ve.name]=new gn(Ve.style,Ve.options&&Ve.options.params||{},ne)}),si(this.states,"true","1"),si(this.states,"false","0"),Q.transitions.forEach(function(Ve){ke.transitionFactories.push(new Gt(ge,Ve,ke.states))}),this.fallbackTransition=function(Se,ge,Q){return new Gt(Se,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(lt,wt){return!0}],options:null,queryCount:0,depCount:0},ge)}(ge,this.states)}return(0,V.Z)(Se,[{key:"containsQueries",get:function(){return this.ast.queryCount>0}},{key:"matchTransition",value:function(Q,ne,ke,Ve){return this.transitionFactories.find(function(wt){return wt.match(Q,ne,ke,Ve)})||null}},{key:"matchStyles",value:function(Q,ne,ke){return this.fallbackTransition.buildStyles(Q,ne,ke)}}]),Se}();function si(Se,ge,Q){Se.hasOwnProperty(ge)?Se.hasOwnProperty(Q)||(Se[Q]=Se[ge]):Se.hasOwnProperty(Q)&&(Se[ge]=Se[Q])}var Si=new jn,ro=function(){function Se(ge,Q,ne){(0,U.Z)(this,Se),this.bodyNode=ge,this._driver=Q,this._normalizer=ne,this._animations={},this._playersById={},this.players=[]}return(0,V.Z)(Se,[{key:"register",value:function(Q,ne){var ke=[],Ve=Ut(this._driver,ne,ke);if(ke.length)throw new Error("Unable to build the animation due to the following errors: ".concat(ke.join("\n")));this._animations[Q]=Ve}},{key:"_buildPlayer",value:function(Q,ne,ke){var Ve=Q.element,lt=R(this._driver,this._normalizer,Ve,Q.keyframes,ne,ke);return this._driver.animate(Ve,lt,Q.duration,Q.delay,Q.easing,[],!0)}},{key:"create",value:function(Q,ne){var Zt,ke=this,Ve=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},lt=[],wt=this._animations[Q],$t=new Map;if(wt?(Zt=Zi(this._driver,ne,wt,dt,Ke,{},{},Ve,Si,lt)).forEach(function(Un){var Qn=O($t,Un.element,{});Un.postStyleProps.forEach(function(fr){return Qn[fr]=null})}):(lt.push("The requested animation doesn't exist or has already been destroyed"),Zt=[]),lt.length)throw new Error("Unable to create the animation due to the following errors: ".concat(lt.join("\n")));$t.forEach(function(Un,Qn){Object.keys(Un).forEach(function(fr){Un[fr]=ke._driver.computeStyle(Qn,fr,_.l3)})});var cn=Zt.map(function(Un){var Qn=$t.get(Un.element);return ke._buildPlayer(Un,{},Qn)}),Dn=T(cn);return this._playersById[Q]=Dn,Dn.onDestroy(function(){return ke.destroy(Q)}),this.players.push(Dn),Dn}},{key:"destroy",value:function(Q){var ne=this._getPlayer(Q);ne.destroy(),delete this._playersById[Q];var ke=this.players.indexOf(ne);ke>=0&&this.players.splice(ke,1)}},{key:"_getPlayer",value:function(Q){var ne=this._playersById[Q];if(!ne)throw new Error("Unable to find the timeline player referenced by ".concat(Q));return ne}},{key:"listen",value:function(Q,ne,ke,Ve){var lt=x(ne,"","","");return k(this._getPlayer(Q),ke,lt,Ve),function(){}}},{key:"command",value:function(Q,ne,ke,Ve){if("register"!=ke)if("create"!=ke){var wt=this._getPlayer(Q);switch(ke){case"play":wt.play();break;case"pause":wt.pause();break;case"reset":wt.reset();break;case"restart":wt.restart();break;case"finish":wt.finish();break;case"init":wt.init();break;case"setPosition":wt.setPosition(parseFloat(Ve[0]));break;case"destroy":this.destroy(Q)}}else this.create(Q,ne,Ve[0]||{});else this.register(Q,Ve[0])}}]),Se}(),Co="ng-animate-queued",Io="ng-animate-disabled",$o=".ng-animate-disabled",ko="ng-star-inserted",Ho=[],io={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},ji={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Ji="__ng_removed",Vo=function(){function Se(ge){var Q=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,U.Z)(this,Se),this.namespaceId=Q;var ne=ge&&ge.hasOwnProperty("value"),ke=ne?ge.value:ge;if(this.value=pa(ke),ne){var Ve=rn(ge);delete Ve.value,this.options=Ve}else this.options={};this.options.params||(this.options.params={})}return(0,V.Z)(Se,[{key:"params",get:function(){return this.options.params}},{key:"absorbOptions",value:function(Q){var ne=Q.params;if(ne){var ke=this.options.params;Object.keys(ne).forEach(function(Ve){null==ke[Ve]&&(ke[Ve]=ne[Ve])})}}}]),Se}(),Ti="void",Qi=new Vo(Ti),fn=function(){function Se(ge,Q,ne){(0,U.Z)(this,Se),this.id=ge,this.hostElement=Q,this._engine=ne,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+ge,To(Q,this._hostClassName)}return(0,V.Z)(Se,[{key:"listen",value:function(Q,ne,ke,Ve){var lt=this;if(!this._triggers.hasOwnProperty(ne))throw new Error('Unable to listen on the animation trigger event "'.concat(ke,'" because the animation trigger "').concat(ne,"\" doesn't exist!"));if(null==ke||0==ke.length)throw new Error('Unable to listen on the animation trigger "'.concat(ne,'" because the provided event is undefined!'));if(!function(Se){return"start"==Se||"done"==Se}(ke))throw new Error('The provided animation trigger event "'.concat(ke,'" for the animation trigger "').concat(ne,'" is not supported!'));var wt=O(this._elementListeners,Q,[]),Zt={name:ne,phase:ke,callback:Ve};wt.push(Zt);var $t=O(this._engine.statesByElement,Q,{});return $t.hasOwnProperty(ne)||(To(Q,vt),To(Q,vt+"-"+ne),$t[ne]=Qi),function(){lt._engine.afterFlush(function(){var cn=wt.indexOf(Zt);cn>=0&&wt.splice(cn,1),lt._triggers[ne]||delete $t[ne]})}}},{key:"register",value:function(Q,ne){return!this._triggers[Q]&&(this._triggers[Q]=ne,!0)}},{key:"_getTrigger",value:function(Q){var ne=this._triggers[Q];if(!ne)throw new Error('The provided animation trigger "'.concat(Q,'" has not been registered!'));return ne}},{key:"trigger",value:function(Q,ne,ke){var Ve=this,lt=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],wt=this._getTrigger(ne),Zt=new pr(this.id,ne,Q),$t=this._engine.statesByElement.get(Q);$t||(To(Q,vt),To(Q,vt+"-"+ne),this._engine.statesByElement.set(Q,$t={}));var cn=$t[ne],Dn=new Vo(ke,this.id),Un=ke&&ke.hasOwnProperty("value");!Un&&cn&&Dn.absorbOptions(cn.options),$t[ne]=Dn,cn||(cn=Qi);var Qn=Dn.value===Ti;if(Qn||cn.value!==Dn.value){var wr=O(this._engine.playersByElement,Q,[]);wr.forEach(function(oi){oi.namespaceId==Ve.id&&oi.triggerName==ne&&oi.queued&&oi.destroy()});var ui=wt.matchTransition(cn.value,Dn.value,Q,Dn.params),hi=!1;if(!ui){if(!lt)return;ui=wt.fallbackTransition,hi=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:Q,triggerName:ne,transition:ui,fromState:cn,toState:Dn,player:Zt,isFallbackTransition:hi}),hi||(To(Q,Co),Zt.onStart(function(){ha(Q,Co)})),Zt.onDone(function(){var oi=Ve.players.indexOf(Zt);oi>=0&&Ve.players.splice(oi,1);var Ao=Ve._engine.playersByElement.get(Q);if(Ao){var Be=Ao.indexOf(Zt);Be>=0&&Ao.splice(Be,1)}}),this.players.push(Zt),wr.push(Zt),Zt}if(!Ui(cn.params,Dn.params)){var fr=[],Or=wt.matchStyles(cn.value,cn.params,fr),br=wt.matchStyles(Dn.value,Dn.params,fr);fr.length?this._engine.reportError(fr):this._engine.afterFlush(function(){wn(Q,Or),Nn(Q,br)})}}},{key:"deregister",value:function(Q){var ne=this;delete this._triggers[Q],this._engine.statesByElement.forEach(function(ke,Ve){delete ke[Q]}),this._elementListeners.forEach(function(ke,Ve){ne._elementListeners.set(Ve,ke.filter(function(lt){return lt.name!=Q}))})}},{key:"clearElementCache",value:function(Q){this._engine.statesByElement.delete(Q),this._elementListeners.delete(Q);var ne=this._engine.playersByElement.get(Q);ne&&(ne.forEach(function(ke){return ke.destroy()}),this._engine.playersByElement.delete(Q))}},{key:"_signalRemovalForInnerTriggers",value:function(Q,ne){var ke=this,Ve=this._engine.driver.query(Q,Qt,!0);Ve.forEach(function(lt){if(!lt[Ji]){var wt=ke._engine.fetchNamespacesByElement(lt);wt.size?wt.forEach(function(Zt){return Zt.triggerLeaveAnimation(lt,ne,!1,!0)}):ke.clearElementCache(lt)}}),this._engine.afterFlushAnimationsDone(function(){return Ve.forEach(function(lt){return ke.clearElementCache(lt)})})}},{key:"triggerLeaveAnimation",value:function(Q,ne,ke,Ve){var lt=this,wt=this._engine.statesByElement.get(Q);if(wt){var Zt=[];if(Object.keys(wt).forEach(function($t){if(lt._triggers[$t]){var cn=lt.trigger(Q,$t,Ti,Ve);cn&&Zt.push(cn)}}),Zt.length)return this._engine.markElementAsRemoved(this.id,Q,!0,ne),ke&&T(Zt).onDone(function(){return lt._engine.processLeaveNode(Q)}),!0}return!1}},{key:"prepareLeaveAnimationListeners",value:function(Q){var ne=this,ke=this._elementListeners.get(Q),Ve=this._engine.statesByElement.get(Q);if(ke&&Ve){var lt=new Set;ke.forEach(function(wt){var Zt=wt.name;if(!lt.has(Zt)){lt.add(Zt);var cn=ne._triggers[Zt].fallbackTransition,Dn=Ve[Zt]||Qi,Un=new Vo(Ti),Qn=new pr(ne.id,Zt,Q);ne._engine.totalQueuedPlayers++,ne._queue.push({element:Q,triggerName:Zt,transition:cn,fromState:Dn,toState:Un,player:Qn,isFallbackTransition:!0})}})}}},{key:"removeNode",value:function(Q,ne){var ke=this,Ve=this._engine;if(Q.childElementCount&&this._signalRemovalForInnerTriggers(Q,ne),!this.triggerLeaveAnimation(Q,ne,!0)){var lt=!1;if(Ve.totalAnimations){var wt=Ve.players.length?Ve.playersByQueriedElement.get(Q):[];if(wt&&wt.length)lt=!0;else for(var Zt=Q;Zt=Zt.parentNode;)if(Ve.statesByElement.get(Zt)){lt=!0;break}}if(this.prepareLeaveAnimationListeners(Q),lt)Ve.markElementAsRemoved(this.id,Q,!1,ne);else{var cn=Q[Ji];(!cn||cn===io)&&(Ve.afterFlush(function(){return ke.clearElementCache(Q)}),Ve.destroyInnerAnimations(Q),Ve._onRemovalComplete(Q,ne))}}}},{key:"insertNode",value:function(Q,ne){To(Q,this._hostClassName)}},{key:"drainQueuedTransitions",value:function(Q){var ne=this,ke=[];return this._queue.forEach(function(Ve){var lt=Ve.player;if(!lt.destroyed){var wt=Ve.element,Zt=ne._elementListeners.get(wt);Zt&&Zt.forEach(function($t){if($t.name==Ve.triggerName){var cn=x(wt,Ve.triggerName,Ve.fromState.value,Ve.toState.value);cn._data=Q,k(Ve.player,$t.phase,cn,$t.callback)}}),lt.markedForDestroy?ne._engine.afterFlush(function(){lt.destroy()}):ke.push(Ve)}}),this._queue=[],ke.sort(function(Ve,lt){var wt=Ve.transition.ast.depCount,Zt=lt.transition.ast.depCount;return 0==wt||0==Zt?wt-Zt:ne._engine.driver.containsElement(Ve.element,lt.element)?1:-1})}},{key:"destroy",value:function(Q){this.players.forEach(function(ne){return ne.destroy()}),this._signalRemovalForInnerTriggers(this.hostElement,Q)}},{key:"elementContainsData",value:function(Q){var ne=!1;return this._elementListeners.has(Q)&&(ne=!0),!!this._queue.find(function(ke){return ke.element===Q})||ne}}]),Se}(),vn=function(){function Se(ge,Q,ne){(0,U.Z)(this,Se),this.bodyNode=ge,this.driver=Q,this._normalizer=ne,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=function(ke,Ve){}}return(0,V.Z)(Se,[{key:"_onRemovalComplete",value:function(Q,ne){this.onRemovalComplete(Q,ne)}},{key:"queuedPlayers",get:function(){var Q=[];return this._namespaceList.forEach(function(ne){ne.players.forEach(function(ke){ke.queued&&Q.push(ke)})}),Q}},{key:"createNamespace",value:function(Q,ne){var ke=new fn(Q,ne,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,ne)?this._balanceNamespaceList(ke,ne):(this.newHostElements.set(ne,ke),this.collectEnterElement(ne)),this._namespaceLookup[Q]=ke}},{key:"_balanceNamespaceList",value:function(Q,ne){var ke=this._namespaceList.length-1;if(ke>=0){for(var Ve=!1,lt=ke;lt>=0;lt--)if(this.driver.containsElement(this._namespaceList[lt].hostElement,ne)){this._namespaceList.splice(lt+1,0,Q),Ve=!0;break}Ve||this._namespaceList.splice(0,0,Q)}else this._namespaceList.push(Q);return this.namespacesByHostElement.set(ne,Q),Q}},{key:"register",value:function(Q,ne){var ke=this._namespaceLookup[Q];return ke||(ke=this.createNamespace(Q,ne)),ke}},{key:"registerTrigger",value:function(Q,ne,ke){var Ve=this._namespaceLookup[Q];Ve&&Ve.register(ne,ke)&&this.totalAnimations++}},{key:"destroy",value:function(Q,ne){var ke=this;if(Q){var Ve=this._fetchNamespace(Q);this.afterFlush(function(){ke.namespacesByHostElement.delete(Ve.hostElement),delete ke._namespaceLookup[Q];var lt=ke._namespaceList.indexOf(Ve);lt>=0&&ke._namespaceList.splice(lt,1)}),this.afterFlushAnimationsDone(function(){return Ve.destroy(ne)})}}},{key:"_fetchNamespace",value:function(Q){return this._namespaceLookup[Q]}},{key:"fetchNamespacesByElement",value:function(Q){var ne=new Set,ke=this.statesByElement.get(Q);if(ke)for(var Ve=Object.keys(ke),lt=0;lt=0&&this.collectedLeaveElements.splice(wt,1)}if(Q){var Zt=this._fetchNamespace(Q);Zt&&Zt.insertNode(ne,ke)}Ve&&this.collectEnterElement(ne)}}},{key:"collectEnterElement",value:function(Q){this.collectedEnterElements.push(Q)}},{key:"markElementAsDisabled",value:function(Q,ne){ne?this.disabledNodes.has(Q)||(this.disabledNodes.add(Q),To(Q,Io)):this.disabledNodes.has(Q)&&(this.disabledNodes.delete(Q),ha(Q,Io))}},{key:"removeNode",value:function(Q,ne,ke,Ve){if(xi(ne)){var lt=Q?this._fetchNamespace(Q):null;if(lt?lt.removeNode(ne,Ve):this.markElementAsRemoved(Q,ne,!1,Ve),ke){var wt=this.namespacesByHostElement.get(ne);wt&&wt.id!==Q&&wt.removeNode(ne,Ve)}}else this._onRemovalComplete(ne,Ve)}},{key:"markElementAsRemoved",value:function(Q,ne,ke,Ve){this.collectedLeaveElements.push(ne),ne[Ji]={namespaceId:Q,setForRemoval:Ve,hasAnimation:ke,removedBeforeQueried:!1}}},{key:"listen",value:function(Q,ne,ke,Ve,lt){return xi(ne)?this._fetchNamespace(Q).listen(ne,ke,Ve,lt):function(){}}},{key:"_buildInstruction",value:function(Q,ne,ke,Ve,lt){return Q.transition.build(this.driver,Q.element,Q.fromState.value,Q.toState.value,ke,Ve,Q.fromState.options,Q.toState.options,ne,lt)}},{key:"destroyInnerAnimations",value:function(Q){var ne=this,ke=this.driver.query(Q,Qt,!0);ke.forEach(function(Ve){return ne.destroyActiveAnimationsForElement(Ve)}),0!=this.playersByQueriedElement.size&&(ke=this.driver.query(Q,Ct,!0)).forEach(function(Ve){return ne.finishActiveQueriedAnimationOnElement(Ve)})}},{key:"destroyActiveAnimationsForElement",value:function(Q){var ne=this.playersByElement.get(Q);ne&&ne.forEach(function(ke){ke.queued?ke.markedForDestroy=!0:ke.destroy()})}},{key:"finishActiveQueriedAnimationOnElement",value:function(Q){var ne=this.playersByQueriedElement.get(Q);ne&&ne.forEach(function(ke){return ke.finish()})}},{key:"whenRenderingDone",value:function(){var Q=this;return new Promise(function(ne){if(Q.players.length)return T(Q.players).onDone(function(){return ne()});ne()})}},{key:"processLeaveNode",value:function(Q){var ne=this,ke=Q[Ji];if(ke&&ke.setForRemoval){if(Q[Ji]=io,ke.namespaceId){this.destroyInnerAnimations(Q);var Ve=this._fetchNamespace(ke.namespaceId);Ve&&Ve.clearElementCache(Q)}this._onRemovalComplete(Q,ke.setForRemoval)}this.driver.matchesElement(Q,$o)&&this.markElementAsDisabled(Q,!1),this.driver.query(Q,$o,!0).forEach(function(lt){ne.markElementAsDisabled(lt,!1)})}},{key:"flush",value:function(){var Q=this,ne=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,ke=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(Un,Qn){return Q._balanceNamespaceList(Un,Qn)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var Ve=0;Ve=0;Tt--)this._namespaceList[Tt].drainQueuedTransitions(ne).forEach(function(nr){var Pr=nr.player,kr=nr.element;if(Ze.push(Pr),ke.collectedEnterElements.length){var Xi=kr[Ji];if(Xi&&Xi.setForMove)return void Pr.destroy()}var $a=!Qn||!ke.driver.containsElement(Qn,kr),Sc=Ee.get(kr),ru=br.get(kr),ta=ke._buildInstruction(nr,Ve,ru,Sc,$a);if(ta.errors&&ta.errors.length)nt.push(ta);else{if($a)return Pr.onStart(function(){return wn(kr,ta.fromStyles)}),Pr.onDestroy(function(){return Nn(kr,ta.toStyles)}),void lt.push(Pr);if(nr.isFallbackTransition)return Pr.onStart(function(){return wn(kr,ta.fromStyles)}),Pr.onDestroy(function(){return Nn(kr,ta.toStyles)}),void lt.push(Pr);ta.timelines.forEach(function(As){return As.stretchStartingKeyframe=!0}),Ve.append(kr,ta.timelines),Zt.push({instruction:ta,player:Pr,element:kr}),ta.queriedElements.forEach(function(As){return O($t,As,[]).push(Pr)}),ta.preStyleProps.forEach(function(As,gd){var kv=Object.keys(As);if(kv.length){var Ys=cn.get(gd);Ys||cn.set(gd,Ys=new Set),kv.forEach(function(Rp){return Ys.add(Rp)})}}),ta.postStyleProps.forEach(function(As,gd){var kv=Object.keys(As),Ys=Dn.get(gd);Ys||Dn.set(gd,Ys=new Set),kv.forEach(function(Rp){return Ys.add(Rp)})})}});if(nt.length){var bn=[];nt.forEach(function(nr){bn.push("@".concat(nr.triggerName," has failed due to:\n")),nr.errors.forEach(function(Pr){return bn.push("- ".concat(Pr,"\n"))})}),Ze.forEach(function(nr){return nr.destroy()}),this.reportError(bn)}var Tr=new Map,Ii=new Map;Zt.forEach(function(nr){var Pr=nr.element;Ve.has(Pr)&&(Ii.set(Pr,Pr),ke._beforeAnimationBuild(nr.player.namespaceId,nr.instruction,Tr))}),lt.forEach(function(nr){var Pr=nr.element;ke._getPreviousPlayers(Pr,!1,nr.namespaceId,nr.triggerName,null).forEach(function(Xi){O(Tr,Pr,[]).push(Xi),Xi.destroy()})});var ea=ui.filter(function(nr){return ma(nr,cn,Dn)}),Da=new Map;fa(Da,this.driver,oi,Dn,_.l3).forEach(function(nr){ma(nr,cn,Dn)&&ea.push(nr)});var Do=new Map;Or.forEach(function(nr,Pr){fa(Do,ke.driver,new Set(nr),cn,_.k1)}),ea.forEach(function(nr){var Pr=Da.get(nr),kr=Do.get(nr);Da.set(nr,Object.assign(Object.assign({},Pr),kr))});var hs=[],oo=[],ph={};Zt.forEach(function(nr){var Pr=nr.element,kr=nr.player,Xi=nr.instruction;if(Ve.has(Pr)){if(Un.has(Pr))return kr.onDestroy(function(){return Nn(Pr,Xi.toStyles)}),kr.disabled=!0,kr.overrideTotalTime(Xi.totalTime),void lt.push(kr);var $a=ph;if(Ii.size>1){for(var Sc=Pr,ru=[];Sc=Sc.parentNode;){var ta=Ii.get(Sc);if(ta){$a=ta;break}ru.push(Sc)}ru.forEach(function(gd){return Ii.set(gd,$a)})}var Ip=ke._buildAnimation(kr.namespaceId,Xi,Tr,wt,Do,Da);if(kr.setRealPlayer(Ip),$a===ph)hs.push(kr);else{var As=ke.playersByElement.get($a);As&&As.length&&(kr.parentPlayer=T(As)),lt.push(kr)}}else wn(Pr,Xi.fromStyles),kr.onDestroy(function(){return Nn(Pr,Xi.toStyles)}),oo.push(kr),Un.has(Pr)&<.push(kr)}),oo.forEach(function(nr){var Pr=wt.get(nr.element);if(Pr&&Pr.length){var kr=T(Pr);nr.setRealPlayer(kr)}}),lt.forEach(function(nr){nr.parentPlayer?nr.syncPlayerEvents(nr.parentPlayer):nr.destroy()});for(var Pp=0;Pp0?this.driver.animate(Q.element,ne,Q.duration,Q.delay,Q.easing,ke):new _.ZN(Q.duration,Q.delay)}}]),Se}(),pr=function(){function Se(ge,Q,ne){(0,U.Z)(this,Se),this.namespaceId=ge,this.triggerName=Q,this.element=ne,this._player=new _.ZN,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return(0,V.Z)(Se,[{key:"setRealPlayer",value:function(Q){var ne=this;this._containsRealPlayer||(this._player=Q,Object.keys(this._queuedCallbacks).forEach(function(ke){ne._queuedCallbacks[ke].forEach(function(Ve){return k(Q,ke,void 0,Ve)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(Q.totalTime),this.queued=!1)}},{key:"getRealPlayer",value:function(){return this._player}},{key:"overrideTotalTime",value:function(Q){this.totalTime=Q}},{key:"syncPlayerEvents",value:function(Q){var ne=this,ke=this._player;ke.triggerCallback&&Q.onStart(function(){return ke.triggerCallback("start")}),Q.onDone(function(){return ne.finish()}),Q.onDestroy(function(){return ne.destroy()})}},{key:"_queueEvent",value:function(Q,ne){O(this._queuedCallbacks,Q,[]).push(ne)}},{key:"onDone",value:function(Q){this.queued&&this._queueEvent("done",Q),this._player.onDone(Q)}},{key:"onStart",value:function(Q){this.queued&&this._queueEvent("start",Q),this._player.onStart(Q)}},{key:"onDestroy",value:function(Q){this.queued&&this._queueEvent("destroy",Q),this._player.onDestroy(Q)}},{key:"init",value:function(){this._player.init()}},{key:"hasStarted",value:function(){return!this.queued&&this._player.hasStarted()}},{key:"play",value:function(){!this.queued&&this._player.play()}},{key:"pause",value:function(){!this.queued&&this._player.pause()}},{key:"restart",value:function(){!this.queued&&this._player.restart()}},{key:"finish",value:function(){this._player.finish()}},{key:"destroy",value:function(){this.destroyed=!0,this._player.destroy()}},{key:"reset",value:function(){!this.queued&&this._player.reset()}},{key:"setPosition",value:function(Q){this.queued||this._player.setPosition(Q)}},{key:"getPosition",value:function(){return this.queued?0:this._player.getPosition()}},{key:"triggerCallback",value:function(Q){var ne=this._player;ne.triggerCallback&&ne.triggerCallback(Q)}}]),Se}();function pa(Se){return null!=Se?Se:null}function xi(Se){return Se&&1===Se.nodeType}function Fi(Se,ge){var Q=Se.style.display;return Se.style.display=null!=ge?ge:"none",Q}function fa(Se,ge,Q,ne,ke){var Ve=[];Q.forEach(function(Zt){return Ve.push(Fi(Zt))});var lt=[];ne.forEach(function(Zt,$t){var cn={};Zt.forEach(function(Dn){var Un=cn[Dn]=ge.computeStyle($t,Dn,ke);(!Un||0==Un.length)&&($t[Ji]=ji,lt.push($t))}),Se.set($t,cn)});var wt=0;return Q.forEach(function(Zt){return Fi(Zt,Ve[wt++])}),lt}function Mo(Se,ge){var Q=new Map;if(Se.forEach(function(wt){return Q.set(wt,[])}),0==ge.length)return Q;var ke=new Set(ge),Ve=new Map;function lt(wt){if(!wt)return 1;var Zt=Ve.get(wt);if(Zt)return Zt;var $t=wt.parentNode;return Zt=Q.has($t)?$t:ke.has($t)?1:lt($t),Ve.set(wt,Zt),Zt}return ge.forEach(function(wt){var Zt=lt(wt);1!==Zt&&Q.get(Zt).push(wt)}),Q}var Ro="$$classes";function To(Se,ge){if(Se.classList)Se.classList.add(ge);else{var Q=Se[Ro];Q||(Q=Se[Ro]={}),Q[ge]=!0}}function ha(Se,ge){if(Se.classList)Se.classList.remove(ge);else{var Q=Se[Ro];Q&&delete Q[ge]}}function ka(Se,ge,Q){T(Q).onDone(function(){return Se.processLeaveNode(ge)})}function xo(Se,ge){for(var Q=0;Q0&&void 0!==arguments[0]?arguments[0]:-1;this._transitionEngine.flush(Q)}},{key:"players",get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)}},{key:"whenRenderingDone",value:function(){return this._transitionEngine.whenRenderingDone()}}]),Se}();function va(Se,ge){var Q=null,ne=null;return Array.isArray(ge)&&ge.length?(Q=gr(ge[0]),ge.length>1&&(ne=gr(ge[ge.length-1]))):ge&&(Q=gr(ge)),Q||ne?new ga(Se,Q,ne):null}var ga=function(){var Se=function(){function ge(Q,ne,ke){(0,U.Z)(this,ge),this._element=Q,this._startStyles=ne,this._endStyles=ke,this._state=0;var Ve=ge.initialStylesByElement.get(Q);Ve||ge.initialStylesByElement.set(Q,Ve={}),this._initialStyles=Ve}return(0,V.Z)(ge,[{key:"start",value:function(){this._state<1&&(this._startStyles&&Nn(this._element,this._startStyles,this._initialStyles),this._state=1)}},{key:"finish",value:function(){this.start(),this._state<2&&(Nn(this._element,this._initialStyles),this._endStyles&&(Nn(this._element,this._endStyles),this._endStyles=null),this._state=1)}},{key:"destroy",value:function(){this.finish(),this._state<3&&(ge.initialStylesByElement.delete(this._element),this._startStyles&&(wn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(wn(this._element,this._endStyles),this._endStyles=null),Nn(this._element,this._initialStyles),this._state=3)}}]),ge}();return Se.initialStylesByElement=new WeakMap,Se}();function gr(Se){for(var ge=null,Q=Object.keys(Se),ne=0;ne=this._delay&&ke>=this._duration&&this.finish()}},{key:"finish",value:function(){this._finished||(this._finished=!0,this._onDoneFn(),yl(this._element,this._eventFn,!0))}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this.finish(),function(Se,ge){var ne=tu(Se,"").split(","),ke=Va(ne,ge);ke>=0&&(ne.splice(ke,1),tn(Se,"",ne.join(",")))}(this._element,this._name))}}]),Se}();function Ha(Se,ge,Q){tn(Se,"PlayState",Q,Ki(Se,ge))}function Ki(Se,ge){var Q=tu(Se,"");return Q.indexOf(",")>0?Va(Q.split(","),ge):Va([Q],ge)}function Va(Se,ge){for(var Q=0;Q=0)return Q;return-1}function yl(Se,ge,Q){Q?Se.removeEventListener(Ua,ge):Se.addEventListener(Ua,ge)}function tn(Se,ge,Q,ne){var ke=Hi+ge;if(null!=ne){var Ve=Se.style[ke];if(Ve.length){var lt=Ve.split(",");lt[ne]=Q,Q=lt.join(",")}}Se.style[ke]=Q}function tu(Se,ge){return Se.style[Hi+ge]||""}var Fe=function(){function Se(ge,Q,ne,ke,Ve,lt,wt,Zt){(0,U.Z)(this,Se),this.element=ge,this.keyframes=Q,this.animationName=ne,this._duration=ke,this._delay=Ve,this._finalStyles=wt,this._specialStyles=Zt,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=lt||"linear",this.totalTime=ke+Ve,this._buildStyler()}return(0,V.Z)(Se,[{key:"onStart",value:function(Q){this._onStartFns.push(Q)}},{key:"onDone",value:function(Q){this._onDoneFns.push(Q)}},{key:"onDestroy",value:function(Q){this._onDestroyFns.push(Q)}},{key:"destroy",value:function(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(function(Q){return Q()}),this._onDestroyFns=[])}},{key:"_flushDoneFns",value:function(){this._onDoneFns.forEach(function(Q){return Q()}),this._onDoneFns=[]}},{key:"_flushStartFns",value:function(){this._onStartFns.forEach(function(Q){return Q()}),this._onStartFns=[]}},{key:"finish",value:function(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}},{key:"setPosition",value:function(Q){this._styler.setPosition(Q)}},{key:"getPosition",value:function(){return this._styler.getPosition()}},{key:"hasStarted",value:function(){return this._state>=2}},{key:"init",value:function(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}},{key:"play",value:function(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}},{key:"pause",value:function(){this.init(),this._styler.pause()}},{key:"restart",value:function(){this.reset(),this.play()}},{key:"reset",value:function(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}},{key:"_buildStyler",value:function(){var Q=this;this._styler=new Wi(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",function(){return Q.finish()})}},{key:"triggerCallback",value:function(Q){var ne="start"==Q?this._onStartFns:this._onDoneFns;ne.forEach(function(ke){return ke()}),ne.length=0}},{key:"beforeDestroy",value:function(){var Q=this;this.init();var ne={};if(this.hasStarted()){var ke=this._state>=3;Object.keys(this._finalStyles).forEach(function(Ve){"offset"!=Ve&&(ne[Ve]=ke?Q._finalStyles[Ve]:nn(Q.element,Ve))})}this.currentSnapshot=ne}}]),Se}(),$e=function(Se){(0,Z.Z)(Q,Se);var ge=(0,w.Z)(Q);function Q(ne,ke){var Ve;return(0,U.Z)(this,Q),(Ve=ge.call(this)).element=ne,Ve._startingStyles={},Ve.__initialized=!1,Ve._styles=_t(ke),Ve}return(0,V.Z)(Q,[{key:"init",value:function(){var ke=this;this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(function(Ve){ke._startingStyles[Ve]=ke.element.style[Ve]}),(0,I.Z)((0,D.Z)(Q.prototype),"init",this).call(this))}},{key:"play",value:function(){var ke=this;!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(function(Ve){return ke.element.style.setProperty(Ve,ke._styles[Ve])}),(0,I.Z)((0,D.Z)(Q.prototype),"play",this).call(this))}},{key:"destroy",value:function(){var ke=this;!this._startingStyles||(Object.keys(this._startingStyles).forEach(function(Ve){var lt=ke._startingStyles[Ve];lt?ke.element.style.setProperty(Ve,lt):ke.element.style.removeProperty(Ve)}),this._startingStyles=null,(0,I.Z)((0,D.Z)(Q.prototype),"destroy",this).call(this))}}]),Q}(_.ZN),We="gen_css_kf_",fe=function(){function Se(){(0,U.Z)(this,Se),this._count=0}return(0,V.Z)(Se,[{key:"validateStyleProperty",value:function(Q){return oe(Q)}},{key:"matchesElement",value:function(Q,ne){return be(Q,ne)}},{key:"containsElement",value:function(Q,ne){return it(Q,ne)}},{key:"query",value:function(Q,ne,ke){return qe(Q,ne,ke)}},{key:"computeStyle",value:function(Q,ne,ke){return window.getComputedStyle(Q)[ne]}},{key:"buildKeyframeElement",value:function(Q,ne,ke){ke=ke.map(function(Zt){return _t(Zt)});var Ve="@keyframes ".concat(ne," {\n"),lt="";ke.forEach(function(Zt){lt=" ";var $t=parseFloat(Zt.offset);Ve+="".concat(lt).concat(100*$t,"% {\n"),lt+=" ",Object.keys(Zt).forEach(function(cn){var Dn=Zt[cn];switch(cn){case"offset":return;case"easing":return void(Dn&&(Ve+="".concat(lt,"animation-timing-function: ").concat(Dn,";\n")));default:return void(Ve+="".concat(lt).concat(cn,": ").concat(Dn,";\n"))}}),Ve+="".concat(lt,"}\n")}),Ve+="}\n";var wt=document.createElement("style");return wt.textContent=Ve,wt}},{key:"animate",value:function(Q,ne,ke,Ve,lt){var wt=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],$t=wt.filter(function(wr){return wr instanceof Fe}),cn={};Yt(ke,Ve)&&$t.forEach(function(wr){var ui=wr.currentSnapshot;Object.keys(ui).forEach(function(hi){return cn[hi]=ui[hi]})});var Dn=Ce(ne=Kt(Q,ne,cn));if(0==ke)return new $e(Q,Dn);var Un="".concat(We).concat(this._count++),Qn=this.buildKeyframeElement(Q,Un,ne),fr=_e(Q);fr.appendChild(Qn);var Or=va(Q,ne),br=new Fe(Q,ne,Un,ke,Ve,lt,Dn,Or);return br.onDestroy(function(){return Re(Qn)}),br}}]),Se}();function _e(Se){var ge,Q=null===(ge=Se.getRootNode)||void 0===ge?void 0:ge.call(Se);return"undefined"!=typeof ShadowRoot&&Q instanceof ShadowRoot?Q:document.head}function Ce(Se){var ge={};return Se&&(Array.isArray(Se)?Se:[Se]).forEach(function(ne){Object.keys(ne).forEach(function(ke){"offset"==ke||"easing"==ke||(ge[ke]=ne[ke])})}),ge}function Re(Se){Se.parentNode.removeChild(Se)}var ht=function(){function Se(ge,Q,ne,ke){(0,U.Z)(this,Se),this.element=ge,this.keyframes=Q,this.options=ne,this._specialStyles=ke,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=ne.duration,this._delay=ne.delay||0,this.time=this._duration+this._delay}return(0,V.Z)(Se,[{key:"_onFinish",value:function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(Q){return Q()}),this._onDoneFns=[])}},{key:"init",value:function(){this._buildPlayer(),this._preparePlayerBeforeStart()}},{key:"_buildPlayer",value:function(){var Q=this;if(!this._initialized){this._initialized=!0;var ne=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,ne,this.options),this._finalKeyframe=ne.length?ne[ne.length-1]:{},this.domPlayer.addEventListener("finish",function(){return Q._onFinish()})}}},{key:"_preparePlayerBeforeStart",value:function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}},{key:"_triggerWebAnimation",value:function(Q,ne,ke){return Q.animate(ne,ke)}},{key:"onStart",value:function(Q){this._onStartFns.push(Q)}},{key:"onDone",value:function(Q){this._onDoneFns.push(Q)}},{key:"onDestroy",value:function(Q){this._onDestroyFns.push(Q)}},{key:"play",value:function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(Q){return Q()}),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}},{key:"pause",value:function(){this.init(),this.domPlayer.pause()}},{key:"finish",value:function(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}},{key:"reset",value:function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}},{key:"_resetDomPlayerState",value:function(){this.domPlayer&&this.domPlayer.cancel()}},{key:"restart",value:function(){this.reset(),this.play()}},{key:"hasStarted",value:function(){return this._started}},{key:"destroy",value:function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(function(Q){return Q()}),this._onDestroyFns=[])}},{key:"setPosition",value:function(Q){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=Q*this.time}},{key:"getPosition",value:function(){return this.domPlayer.currentTime/this.time}},{key:"totalTime",get:function(){return this._delay+this._duration}},{key:"beforeDestroy",value:function(){var Q=this,ne={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(ke){"offset"!=ke&&(ne[ke]=Q._finished?Q._finalKeyframe[ke]:nn(Q.element,ke))}),this.currentSnapshot=ne}},{key:"triggerCallback",value:function(Q){var ne="start"==Q?this._onStartFns:this._onDoneFns;ne.forEach(function(ke){return ke()}),ne.length=0}}]),Se}(),gt=function(){function Se(){(0,U.Z)(this,Se),this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(Vr().toString()),this._cssKeyframesDriver=new fe}return(0,V.Z)(Se,[{key:"validateStyleProperty",value:function(Q){return oe(Q)}},{key:"matchesElement",value:function(Q,ne){return be(Q,ne)}},{key:"containsElement",value:function(Q,ne){return it(Q,ne)}},{key:"query",value:function(Q,ne,ke){return qe(Q,ne,ke)}},{key:"computeStyle",value:function(Q,ne,ke){return window.getComputedStyle(Q)[ne]}},{key:"overrideWebAnimationsSupport",value:function(Q){this._isNativeImpl=Q}},{key:"animate",value:function(Q,ne,ke,Ve,lt){var wt=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],Zt=arguments.length>6?arguments[6]:void 0,$t=!Zt&&!this._isNativeImpl;if($t)return this._cssKeyframesDriver.animate(Q,ne,ke,Ve,lt,wt);var cn=0==Ve?"both":"forwards",Dn={duration:ke,delay:Ve,fill:cn};lt&&(Dn.easing=lt);var Un={},Qn=wt.filter(function(Or){return Or instanceof ht});Yt(ke,Ve)&&Qn.forEach(function(Or){var br=Or.currentSnapshot;Object.keys(br).forEach(function(wr){return Un[wr]=br[wr]})});var fr=va(Q,ne=Kt(Q,ne=ne.map(function(Or){return Ln(Or,!1)}),Un));return new ht(Q,ne,Dn,fr)}}]),Se}();function Vr(){return v()&&Element.prototype.animate||{}}var Pi=f(40098),_a=function(){var Se=function(ge){(0,Z.Z)(ne,ge);var Q=(0,w.Z)(ne);function ne(ke,Ve){var lt;return(0,U.Z)(this,ne),(lt=Q.call(this))._nextAnimationId=0,lt._renderer=ke.createRenderer(Ve.body,{id:"0",encapsulation:N.ifc.None,styles:[],data:{animation:[]}}),lt}return(0,V.Z)(ne,[{key:"build",value:function(Ve){var lt=this._nextAnimationId.toString();this._nextAnimationId++;var wt=Array.isArray(Ve)?(0,_.vP)(Ve):Ve;return Sl(this._renderer,null,lt,"register",[wt]),new li(lt,this._renderer)}}]),ne}(_._j);return Se.\u0275fac=function(Q){return new(Q||Se)(N.LFG(N.FYo),N.LFG(Pi.K0))},Se.\u0275prov=N.Yz7({token:Se,factory:Se.\u0275fac}),Se}(),li=function(Se){(0,Z.Z)(Q,Se);var ge=(0,w.Z)(Q);function Q(ne,ke){var Ve;return(0,U.Z)(this,Q),(Ve=ge.call(this))._id=ne,Ve._renderer=ke,Ve}return(0,V.Z)(Q,[{key:"create",value:function(ke,Ve){return new Mi(this._id,ke,Ve||{},this._renderer)}}]),Q}(_.LC),Mi=function(){function Se(ge,Q,ne,ke){(0,U.Z)(this,Se),this.id=ge,this.element=Q,this._renderer=ke,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",ne)}return(0,V.Z)(Se,[{key:"_listen",value:function(Q,ne){return this._renderer.listen(this.element,"@@".concat(this.id,":").concat(Q),ne)}},{key:"_command",value:function(Q){for(var ne=arguments.length,ke=new Array(ne>1?ne-1:0),Ve=1;Ve=0&&ne3&&void 0!==arguments[3])||arguments[3];this.delegate.insertBefore(Q,ne,ke),this.engine.onInsert(this.namespaceId,ne,Q,Ve)}},{key:"removeChild",value:function(Q,ne,ke){this.engine.onRemove(this.namespaceId,ne,this.delegate,ke)}},{key:"selectRootElement",value:function(Q,ne){return this.delegate.selectRootElement(Q,ne)}},{key:"parentNode",value:function(Q){return this.delegate.parentNode(Q)}},{key:"nextSibling",value:function(Q){return this.delegate.nextSibling(Q)}},{key:"setAttribute",value:function(Q,ne,ke,Ve){this.delegate.setAttribute(Q,ne,ke,Ve)}},{key:"removeAttribute",value:function(Q,ne,ke){this.delegate.removeAttribute(Q,ne,ke)}},{key:"addClass",value:function(Q,ne){this.delegate.addClass(Q,ne)}},{key:"removeClass",value:function(Q,ne){this.delegate.removeClass(Q,ne)}},{key:"setStyle",value:function(Q,ne,ke,Ve){this.delegate.setStyle(Q,ne,ke,Ve)}},{key:"removeStyle",value:function(Q,ne,ke){this.delegate.removeStyle(Q,ne,ke)}},{key:"setProperty",value:function(Q,ne,ke){"@"==ne.charAt(0)&&ne==Xa?this.disableAnimations(Q,!!ke):this.delegate.setProperty(Q,ne,ke)}},{key:"setValue",value:function(Q,ne){this.delegate.setValue(Q,ne)}},{key:"listen",value:function(Q,ne,ke){return this.delegate.listen(Q,ne,ke)}},{key:"disableAnimations",value:function(Q,ne){this.engine.disableAnimations(Q,ne)}}]),Se}(),kp=function(Se){(0,Z.Z)(Q,Se);var ge=(0,w.Z)(Q);function Q(ne,ke,Ve,lt){var wt;return(0,U.Z)(this,Q),(wt=ge.call(this,ke,Ve,lt)).factory=ne,wt.namespaceId=ke,wt}return(0,V.Z)(Q,[{key:"setProperty",value:function(ke,Ve,lt){"@"==Ve.charAt(0)?"."==Ve.charAt(1)&&Ve==Xa?this.disableAnimations(ke,lt=void 0===lt||!!lt):this.engine.process(this.namespaceId,ke,Ve.substr(1),lt):this.delegate.setProperty(ke,Ve,lt)}},{key:"listen",value:function(ke,Ve,lt){var wt=this;if("@"==Ve.charAt(0)){var Zt=function(Se){switch(Se){case"body":return document.body;case"document":return document;case"window":return window;default:return Se}}(ke),$t=Ve.substr(1),cn="";if("@"!=$t.charAt(0)){var Dn=function(Se){var ge=Se.indexOf(".");return[Se.substring(0,ge),Se.substr(ge+1)]}($t),Un=(0,B.Z)(Dn,2);$t=Un[0],cn=Un[1]}return this.engine.listen(this.namespaceId,Zt,$t,cn,function(Qn){wt.factory.scheduleListenerCallback(Qn._data||-1,lt,Qn)})}return this.delegate.listen(ke,Ve,lt)}}]),Q}(Ms),yc=function(){var Se=function(ge){(0,Z.Z)(ne,ge);var Q=(0,w.Z)(ne);function ne(ke,Ve,lt){return(0,U.Z)(this,ne),Q.call(this,ke.body,Ve,lt)}return(0,V.Z)(ne,[{key:"ngOnDestroy",value:function(){this.flush()}}]),ne}(zi);return Se.\u0275fac=function(Q){return new(Q||Se)(N.LFG(Pi.K0),N.LFG(Ft),N.LFG(fi))},Se.\u0275prov=N.Yz7({token:Se,factory:Se.\u0275fac}),Se}(),hd=new N.OlP("AnimationModuleType"),Dp=[{provide:_._j,useClass:_a},{provide:fi,useFactory:function(){return new ki}},{provide:zi,useClass:yc},{provide:N.FYo,useFactory:function(Se,ge,Q){return new ya(Se,ge,Q)},deps:[b.se,zi,N.R0b]}],Op=[{provide:Ft,useFactory:function(){return"function"==typeof Vr()?new gt:new fe}},{provide:hd,useValue:"BrowserAnimations"}].concat(Dp),md=[{provide:Ft,useClass:yt},{provide:hd,useValue:"NoopAnimations"}].concat(Dp),nu=function(){var Se=function(){function ge(){(0,U.Z)(this,ge)}return(0,V.Z)(ge,null,[{key:"withConfig",value:function(ne){return{ngModule:ge,providers:ne.disableAnimations?md:Op}}}]),ge}();return Se.\u0275fac=function(Q){return new(Q||Se)},Se.\u0275mod=N.oAB({type:Se}),Se.\u0275inj=N.cJS({providers:Op,imports:[b.b2]}),Se}()},29176:function(ue,q,f){"use strict";f.d(q,{b2:function(){return ze},H7:function(){return Cn},Dx:function(){return Hr},HJ:function(){return po},q6:function(){return Ne},se:function(){return bt}});var v,B=f(13920),U=f(89200),V=f(14105),Z=f(18967),w=f(10509),N=f(97154),b=f(40098),_=f(38999),D=function(Ot){(0,w.Z)(Pt,Ot);var jt=(0,N.Z)(Pt);function Pt(){return(0,Z.Z)(this,Pt),jt.apply(this,arguments)}return(0,V.Z)(Pt,[{key:"onAndCancel",value:function(Gt,Xt,gn){return Gt.addEventListener(Xt,gn,!1),function(){Gt.removeEventListener(Xt,gn,!1)}}},{key:"dispatchEvent",value:function(Gt,Xt){Gt.dispatchEvent(Xt)}},{key:"remove",value:function(Gt){Gt.parentNode&&Gt.parentNode.removeChild(Gt)}},{key:"createElement",value:function(Gt,Xt){return(Xt=Xt||this.getDefaultDocument()).createElement(Gt)}},{key:"createHtmlDocument",value:function(){return document.implementation.createHTMLDocument("fakeTitle")}},{key:"getDefaultDocument",value:function(){return document}},{key:"isElementNode",value:function(Gt){return Gt.nodeType===Node.ELEMENT_NODE}},{key:"isShadowRoot",value:function(Gt){return Gt instanceof DocumentFragment}},{key:"getGlobalEventTarget",value:function(Gt,Xt){return"window"===Xt?window:"document"===Xt?Gt:"body"===Xt?Gt.body:null}},{key:"getBaseHref",value:function(Gt){var Xt=(A=A||document.querySelector("base"))?A.getAttribute("href"):null;return null==Xt?null:function(Ot){(v=v||document.createElement("a")).setAttribute("href",Ot);var jt=v.pathname;return"/"===jt.charAt(0)?jt:"/".concat(jt)}(Xt)}},{key:"resetBaseElement",value:function(){A=null}},{key:"getUserAgent",value:function(){return window.navigator.userAgent}},{key:"getCookie",value:function(Gt){return(0,b.Mx)(document.cookie,Gt)}}],[{key:"makeCurrent",value:function(){(0,b.HT)(new Pt)}}]),Pt}(function(Ot){(0,w.Z)(Pt,Ot);var jt=(0,N.Z)(Pt);function Pt(){var Vt;return(0,Z.Z)(this,Pt),(Vt=jt.apply(this,arguments)).supportsDOMEvents=!0,Vt}return Pt}(b.w_)),A=null,T=new _.OlP("TRANSITION_ID"),k=[{provide:_.ip1,useFactory:function(Ot,jt,Pt){return function(){Pt.get(_.CZH).donePromise.then(function(){for(var Vt=(0,b.q)(),Gt=jt.querySelectorAll('style[ng-transition="'.concat(Ot,'"]')),Xt=0;Xt1&&void 0!==arguments[1])||arguments[1],gn=Pt.findTestabilityInTree(Gt,Xt);if(null==gn)throw new Error("Could not find testability for element.");return gn},_.dqk.getAllAngularTestabilities=function(){return Pt.getAllTestabilities()},_.dqk.getAllAngularRootElements=function(){return Pt.getAllRootElements()},_.dqk.frameworkStabilizers||(_.dqk.frameworkStabilizers=[]),_.dqk.frameworkStabilizers.push(function(Xt){var gn=_.dqk.getAllAngularTestabilities(),Gn=gn.length,zn=!1,Vn=function(Si){zn=zn||Si,0==--Gn&&Xt(zn)};gn.forEach(function(si){si.whenStable(Vn)})})}},{key:"findTestabilityInTree",value:function(Pt,Vt,Gt){if(null==Vt)return null;var Xt=Pt.getTestability(Vt);return null!=Xt?Xt:Gt?(0,b.q)().isShadowRoot(Vt)?this.findTestabilityInTree(Pt,Vt.host,!0):this.findTestabilityInTree(Pt,Vt.parentElement,!0):null}}],[{key:"init",value:function(){(0,_.VLi)(new Ot)}}]),Ot}(),x=function(){var Ot=function(){function jt(){(0,Z.Z)(this,jt)}return(0,V.Z)(jt,[{key:"build",value:function(){return new XMLHttpRequest}}]),jt}();return Ot.\u0275fac=function(Pt){return new(Pt||Ot)},Ot.\u0275prov=_.Yz7({token:Ot,factory:Ot.\u0275fac}),Ot}();var it=new _.OlP("EventManagerPlugins"),qe=function(){var Ot=function(){function jt(Pt,Vt){var Gt=this;(0,Z.Z)(this,jt),this._zone=Vt,this._eventNameToPlugin=new Map,Pt.forEach(function(Xt){return Xt.manager=Gt}),this._plugins=Pt.slice().reverse()}return(0,V.Z)(jt,[{key:"addEventListener",value:function(Vt,Gt,Xt){return this._findPluginFor(Gt).addEventListener(Vt,Gt,Xt)}},{key:"addGlobalEventListener",value:function(Vt,Gt,Xt){return this._findPluginFor(Gt).addGlobalEventListener(Vt,Gt,Xt)}},{key:"getZone",value:function(){return this._zone}},{key:"_findPluginFor",value:function(Vt){var Gt=this._eventNameToPlugin.get(Vt);if(Gt)return Gt;for(var Xt=this._plugins,gn=0;gn-1&&(gn.splice(ro,1),Vn+=Si+".")}),Vn+=zn,0!=gn.length||0===zn.length)return null;var si={};return si.domEventName=Gn,si.fullKey=Vn,si}},{key:"getEventFullKey",value:function(Xt){var gn="",Gn=function(Ot){var jt=Ot.key;if(null==jt){if(null==(jt=Ot.keyIdentifier))return"Unidentified";jt.startsWith("U+")&&(jt=String.fromCharCode(parseInt(jt.substring(2),16)),3===Ot.location&&Kt.hasOwnProperty(jt)&&(jt=Kt[jt]))}return Yt[jt]||jt}(Xt);return" "===(Gn=Gn.toLowerCase())?Gn="space":"."===Gn&&(Gn="dot"),ct.forEach(function(zn){zn!=Gn&&(0,Tn[zn])(Xt)&&(gn+=zn+".")}),gn+=Gn}},{key:"eventCallback",value:function(Xt,gn,Gn){return function(zn){Vt.getEventFullKey(zn)===Xt&&Gn.runGuarded(function(){return gn(zn)})}}},{key:"_normalizeKey",value:function(Xt){switch(Xt){case"esc":return"escape";default:return Xt}}}]),Vt}(_t);return Ot.\u0275fac=function(Pt){return new(Pt||Ot)(_.LFG(b.K0))},Ot.\u0275prov=_.Yz7({token:Ot,factory:Ot.\u0275fac}),Ot}(),Cn=function(){var Ot=function jt(){(0,Z.Z)(this,jt)};return Ot.\u0275fac=function(Pt){return new(Pt||Ot)},Ot.\u0275prov=(0,_.Yz7)({factory:function(){return(0,_.LFG)(tr)},token:Ot,providedIn:"root"}),Ot}(),tr=function(){var Ot=function(jt){(0,w.Z)(Vt,jt);var Pt=(0,N.Z)(Vt);function Vt(Gt){var Xt;return(0,Z.Z)(this,Vt),(Xt=Pt.call(this))._doc=Gt,Xt}return(0,V.Z)(Vt,[{key:"sanitize",value:function(Xt,gn){if(null==gn)return null;switch(Xt){case _.q3G.NONE:return gn;case _.q3G.HTML:return(0,_.qzn)(gn,"HTML")?(0,_.z3N)(gn):(0,_.EiD)(this._doc,String(gn)).toString();case _.q3G.STYLE:return(0,_.qzn)(gn,"Style")?(0,_.z3N)(gn):gn;case _.q3G.SCRIPT:if((0,_.qzn)(gn,"Script"))return(0,_.z3N)(gn);throw new Error("unsafe value used in a script context");case _.q3G.URL:return(0,_.yhl)(gn),(0,_.qzn)(gn,"URL")?(0,_.z3N)(gn):(0,_.mCW)(String(gn));case _.q3G.RESOURCE_URL:if((0,_.qzn)(gn,"ResourceURL"))return(0,_.z3N)(gn);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext ".concat(Xt," (see https://g.co/ng/security#xss)"))}}},{key:"bypassSecurityTrustHtml",value:function(Xt){return(0,_.JVY)(Xt)}},{key:"bypassSecurityTrustStyle",value:function(Xt){return(0,_.L6k)(Xt)}},{key:"bypassSecurityTrustScript",value:function(Xt){return(0,_.eBb)(Xt)}},{key:"bypassSecurityTrustUrl",value:function(Xt){return(0,_.LAX)(Xt)}},{key:"bypassSecurityTrustResourceUrl",value:function(Xt){return(0,_.pB0)(Xt)}}]),Vt}(Cn);return Ot.\u0275fac=function(Pt){return new(Pt||Ot)(_.LFG(b.K0))},Ot.\u0275prov=(0,_.Yz7)({factory:function(){return function(Ot){return new tr(Ot.get(b.K0))}((0,_.LFG)(_.gxx))},token:Ot,providedIn:"root"}),Ot}(),Ne=(0,_.eFA)(_._c5,"browser",[{provide:_.Lbi,useValue:b.bD},{provide:_.g9A,useValue:function(){D.makeCurrent(),E.init()},multi:!0},{provide:b.K0,useFactory:function(){return(0,_.RDi)(document),document},deps:[]}]),Le=[[],{provide:_.zSh,useValue:"root"},{provide:_.qLn,useFactory:function(){return new _.qLn},deps:[]},{provide:it,useClass:$n,multi:!0,deps:[b.K0,_.R0b,_.Lbi]},{provide:it,useClass:In,multi:!0,deps:[b.K0]},[],{provide:bt,useClass:bt,deps:[qe,Ft,_.AFp]},{provide:_.FYo,useExisting:bt},{provide:yt,useExisting:Ft},{provide:Ft,useClass:Ft,deps:[b.K0]},{provide:_.dDg,useClass:_.dDg,deps:[_.R0b]},{provide:qe,useClass:qe,deps:[it,_.R0b]},{provide:b.JF,useClass:x,deps:[]},[]],ze=function(){var Ot=function(){function jt(Pt){if((0,Z.Z)(this,jt),Pt)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.")}return(0,V.Z)(jt,null,[{key:"withServerTransition",value:function(Vt){return{ngModule:jt,providers:[{provide:_.AFp,useValue:Vt.appId},{provide:T,useExisting:_.AFp},k]}}}]),jt}();return Ot.\u0275fac=function(Pt){return new(Pt||Ot)(_.LFG(Ot,12))},Ot.\u0275mod=_.oAB({type:Ot}),Ot.\u0275inj=_.cJS({providers:Le,imports:[b.ez,_.hGG]}),Ot}();function Rr(){return new Hr((0,_.LFG)(b.K0))}var Hr=function(){var Ot=function(){function jt(Pt){(0,Z.Z)(this,jt),this._doc=Pt}return(0,V.Z)(jt,[{key:"getTitle",value:function(){return this._doc.title}},{key:"setTitle",value:function(Vt){this._doc.title=Vt||""}}]),jt}();return Ot.\u0275fac=function(Pt){return new(Pt||Ot)(_.LFG(b.K0))},Ot.\u0275prov=(0,_.Yz7)({factory:Rr,token:Ot,providedIn:"root"}),Ot}(),yr="undefined"!=typeof window&&window||{},Yr=function Ot(jt,Pt){(0,Z.Z)(this,Ot),this.msPerTick=jt,this.numTicks=Pt},co=function(){function Ot(jt){(0,Z.Z)(this,Ot),this.appRef=jt.injector.get(_.z2F)}return(0,V.Z)(Ot,[{key:"timeChangeDetection",value:function(Pt){var Vt=Pt&&Pt.record,Gt="Change Detection",Xt=null!=yr.console.profile;Vt&&Xt&&yr.console.profile(Gt);for(var gn=Zi(),Gn=0;Gn<5||Zi()-gn<500;)this.appRef.tick(),Gn++;var zn=Zi();Vt&&Xt&&yr.console.profileEnd(Gt);var Vn=(zn-gn)/Gn;return yr.console.log("ran ".concat(Gn," change detection cycles")),yr.console.log("".concat(Vn.toFixed(2)," ms per check")),new Yr(Vn,Gn)}}]),Ot}();function Zi(){return yr.performance&&yr.performance.now?yr.performance.now():(new Date).getTime()}function po(Ot){return function(Ot,jt){"undefined"!=typeof COMPILED&&COMPILED||((_.dqk.ng=_.dqk.ng||{})[Ot]=jt)}("profiler",new co(Ot)),Ot}},95665:function(ue,q,f){"use strict";f.d(q,{R:function(){return V}});var B=f(4839),U={};function V(){return(0,B.KV)()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:U}},4839:function(ue,q,f){"use strict";function B(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function U(Z,w){return Z.require(w)}f.d(q,{KV:function(){return B},l$:function(){return U}}),ue=f.hmd(ue)},46354:function(ue,q,f){"use strict";f.d(q,{yW:function(){return _},ph:function(){return I}});var B=f(95665),U=f(4839);ue=f.hmd(ue);var V={nowSeconds:function(){return Date.now()/1e3}},N=(0,U.KV)()?function(){try{return(0,U.l$)(ue,"perf_hooks").performance}catch(T){return}}():function(){var g=(0,B.R)().performance;if(g&&g.now)return{now:function(){return g.now()},timeOrigin:Date.now()-g.now()}}(),b=void 0===N?V:{nowSeconds:function(){return(N.timeOrigin+N.now())/1e3}},_=V.nowSeconds.bind(V),I=b.nowSeconds.bind(b);!function(){var g=(0,B.R)().performance;if(g&&g.now){var T=36e5,R=g.now(),k=Date.now(),E=g.timeOrigin?Math.abs(g.timeOrigin+R-k):T,x=E0||navigator.msMaxTouchPoints>0);function K(dt,Ke){var Bt=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,xt=Math.abs(dt-Ke);return xt=Bt.top&&Ke<=Bt.bottom}function $(dt){var Ke=dt.clientX,Bt=dt.rect;return Ke>=Bt.left&&Ke<=Bt.right}function ae(dt){var Ke=dt.clientX,Bt=dt.clientY,vt=dt.allowedEdges,Qt=dt.cursorPrecision,Ht=dt.elm.nativeElement.getBoundingClientRect(),Ct={};return vt.left&&K(Ke,Ht.left,Qt)&&ee({clientY:Bt,rect:Ht})&&(Ct.left=!0),vt.right&&K(Ke,Ht.right,Qt)&&ee({clientY:Bt,rect:Ht})&&(Ct.right=!0),vt.top&&K(Bt,Ht.top,Qt)&&$({clientX:Ke,rect:Ht})&&(Ct.top=!0),vt.bottom&&K(Bt,Ht.bottom,Qt)&&$({clientX:Ke,rect:Ht})&&(Ct.bottom=!0),Ct}var se=Object.freeze({topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize",leftOrRight:"col-resize",topOrBottom:"row-resize"});function ce(dt,Ke){return dt.left&&dt.top?Ke.topLeft:dt.right&&dt.top?Ke.topRight:dt.left&&dt.bottom?Ke.bottomLeft:dt.right&&dt.bottom?Ke.bottomRight:dt.left||dt.right?Ke.leftOrRight:dt.top||dt.bottom?Ke.topOrBottom:""}function le(dt){var Bt=dt.initialRectangle,xt=dt.newRectangle,vt={};return Object.keys(dt.edges).forEach(function(Qt){vt[Qt]=(xt[Qt]||0)-(Bt[Qt]||0)}),vt}var oe="resize-active",Ft=function(){var dt=function(){function Ke(Bt,xt,vt,Qt){(0,U.Z)(this,Ke),this.platformId=Bt,this.renderer=xt,this.elm=vt,this.zone=Qt,this.resizeEdges={},this.enableGhostResize=!1,this.resizeSnapGrid={},this.resizeCursors=se,this.resizeCursorPrecision=3,this.ghostElementPositioning="fixed",this.allowNegativeResizes=!1,this.mouseMoveThrottleMS=50,this.resizeStart=new w.vpe,this.resizing=new w.vpe,this.resizeEnd=new w.vpe,this.mouseup=new N.xQ,this.mousedown=new N.xQ,this.mousemove=new N.xQ,this.destroy$=new N.xQ,this.resizeEdges$=new N.xQ,this.pointerEventListeners=xe.getInstance(xt,Qt)}return(0,V.Z)(Ke,[{key:"ngOnInit",value:function(){var Ct,xt=this,vt=(0,b.T)(this.pointerEventListeners.pointerDown,this.mousedown),Qt=(0,b.T)(this.pointerEventListeners.pointerMove,this.mousemove).pipe((0,A.b)(function(Nt){var rn=Nt.event;if(Ct)try{rn.preventDefault()}catch(kn){}}),(0,S.B)()),Ht=(0,b.T)(this.pointerEventListeners.pointerUp,this.mouseup),qt=function(){Ct&&Ct.clonedNode&&(xt.elm.nativeElement.parentElement.removeChild(Ct.clonedNode),xt.renderer.setStyle(xt.elm.nativeElement,"visibility","inherit"))},bt=function(){return Object.assign({},se,xt.resizeCursors)};this.resizeEdges$.pipe((0,v.O)(this.resizeEdges),(0,g.U)(function(){return xt.resizeEdges&&Object.keys(xt.resizeEdges).some(function(Nt){return!!xt.resizeEdges[Nt]})}),(0,T.w)(function(Nt){return Nt?Qt:_.E}),(0,R.e)(this.mouseMoveThrottleMS),(0,k.R)(this.destroy$)).subscribe(function(Nt){var Ln=ae({clientX:Nt.clientX,clientY:Nt.clientY,elm:xt.elm,allowedEdges:xt.resizeEdges,cursorPrecision:xt.resizeCursorPrecision}),Rn=bt();if(!Ct){var $n=ce(Ln,Rn);xt.renderer.setStyle(xt.elm.nativeElement,"cursor",$n)}xt.setElementClass(xt.elm,"resize-left-hover",!0===Ln.left),xt.setElementClass(xt.elm,"resize-right-hover",!0===Ln.right),xt.setElementClass(xt.elm,"resize-top-hover",!0===Ln.top),xt.setElementClass(xt.elm,"resize-bottom-hover",!0===Ln.bottom)}),vt.pipe((0,E.zg)(function(Nt){function rn(Rn){return{clientX:Rn.clientX-Nt.clientX,clientY:Rn.clientY-Nt.clientY}}var kn=function(){var $n={x:1,y:1};return Ct&&(xt.resizeSnapGrid.left&&Ct.edges.left?$n.x=+xt.resizeSnapGrid.left:xt.resizeSnapGrid.right&&Ct.edges.right&&($n.x=+xt.resizeSnapGrid.right),xt.resizeSnapGrid.top&&Ct.edges.top?$n.y=+xt.resizeSnapGrid.top:xt.resizeSnapGrid.bottom&&Ct.edges.bottom&&($n.y=+xt.resizeSnapGrid.bottom)),$n};function Ln(Rn,$n){return{x:Math.ceil(Rn.clientX/$n.x),y:Math.ceil(Rn.clientY/$n.y)}}return(0,b.T)(Qt.pipe((0,x.q)(1)).pipe((0,g.U)(function(Rn){return[,Rn]})),Qt.pipe((0,O.G)())).pipe((0,g.U)(function(Rn){var $n=(0,B.Z)(Rn,2),Nn=$n[0],wn=$n[1];return[Nn&&rn(Nn),rn(wn)]})).pipe((0,F.h)(function(Rn){var $n=(0,B.Z)(Rn,2),Nn=$n[0],wn=$n[1];if(!Nn)return!0;var _r=kn(),ut=Ln(Nn,_r),He=Ln(wn,_r);return ut.x!==He.x||ut.y!==He.y})).pipe((0,g.U)(function(Rn){var Nn=(0,B.Z)(Rn,2)[1],wn=kn();return{clientX:Math.round(Nn.clientX/wn.x)*wn.x,clientY:Math.round(Nn.clientY/wn.y)*wn.y}})).pipe((0,k.R)((0,b.T)(Ht,vt)))})).pipe((0,F.h)(function(){return!!Ct})).pipe((0,g.U)(function(Nt){return j(Ct.startingRect,Ct.edges,Nt.clientX,Nt.clientY)})).pipe((0,F.h)(function(Nt){return xt.allowNegativeResizes||!!(Nt.height&&Nt.width&&Nt.height>0&&Nt.width>0)})).pipe((0,F.h)(function(Nt){return!xt.validateResize||xt.validateResize({rectangle:Nt,edges:le({edges:Ct.edges,initialRectangle:Ct.startingRect,newRectangle:Nt})})}),(0,k.R)(this.destroy$)).subscribe(function(Nt){Ct&&Ct.clonedNode&&(xt.renderer.setStyle(Ct.clonedNode,"height","".concat(Nt.height,"px")),xt.renderer.setStyle(Ct.clonedNode,"width","".concat(Nt.width,"px")),xt.renderer.setStyle(Ct.clonedNode,"top","".concat(Nt.top,"px")),xt.renderer.setStyle(Ct.clonedNode,"left","".concat(Nt.left,"px"))),xt.resizing.observers.length>0&&xt.zone.run(function(){xt.resizing.emit({edges:le({edges:Ct.edges,initialRectangle:Ct.startingRect,newRectangle:Nt}),rectangle:Nt})}),Ct.currentRect=Nt}),vt.pipe((0,g.U)(function(Nt){return Nt.edges||ae({clientX:Nt.clientX,clientY:Nt.clientY,elm:xt.elm,allowedEdges:xt.resizeEdges,cursorPrecision:xt.resizeCursorPrecision})})).pipe((0,F.h)(function(Nt){return Object.keys(Nt).length>0}),(0,k.R)(this.destroy$)).subscribe(function(Nt){Ct&&qt();var rn=function(dt,Ke){var Bt=0,xt=0,vt=dt.nativeElement.style,Ht=["transform","-ms-transform","-moz-transform","-o-transform"].map(function(qt){return vt[qt]}).find(function(qt){return!!qt});if(Ht&&Ht.includes("translate")&&(Bt=Ht.replace(/.*translate3?d?\((-?[0-9]*)px, (-?[0-9]*)px.*/,"$1"),xt=Ht.replace(/.*translate3?d?\((-?[0-9]*)px, (-?[0-9]*)px.*/,"$2")),"absolute"===Ke)return{height:dt.nativeElement.offsetHeight,width:dt.nativeElement.offsetWidth,top:dt.nativeElement.offsetTop-xt,bottom:dt.nativeElement.offsetHeight+dt.nativeElement.offsetTop-xt,left:dt.nativeElement.offsetLeft-Bt,right:dt.nativeElement.offsetWidth+dt.nativeElement.offsetLeft-Bt};var Ct=dt.nativeElement.getBoundingClientRect();return{height:Ct.height,width:Ct.width,top:Ct.top-xt,bottom:Ct.bottom-xt,left:Ct.left-Bt,right:Ct.right-Bt,scrollTop:dt.nativeElement.scrollTop,scrollLeft:dt.nativeElement.scrollLeft}}(xt.elm,xt.ghostElementPositioning);Ct={edges:Nt,startingRect:rn,currentRect:rn};var kn=bt(),Ln=ce(Ct.edges,kn);xt.renderer.setStyle(document.body,"cursor",Ln),xt.setElementClass(xt.elm,oe,!0),xt.enableGhostResize&&(Ct.clonedNode=xt.elm.nativeElement.cloneNode(!0),xt.elm.nativeElement.parentElement.appendChild(Ct.clonedNode),xt.renderer.setStyle(xt.elm.nativeElement,"visibility","hidden"),xt.renderer.setStyle(Ct.clonedNode,"position",xt.ghostElementPositioning),xt.renderer.setStyle(Ct.clonedNode,"left","".concat(Ct.startingRect.left,"px")),xt.renderer.setStyle(Ct.clonedNode,"top","".concat(Ct.startingRect.top,"px")),xt.renderer.setStyle(Ct.clonedNode,"height","".concat(Ct.startingRect.height,"px")),xt.renderer.setStyle(Ct.clonedNode,"width","".concat(Ct.startingRect.width,"px")),xt.renderer.setStyle(Ct.clonedNode,"cursor",ce(Ct.edges,kn)),xt.renderer.addClass(Ct.clonedNode,"resize-ghost-element"),Ct.clonedNode.scrollTop=Ct.startingRect.scrollTop,Ct.clonedNode.scrollLeft=Ct.startingRect.scrollLeft),xt.resizeStart.observers.length>0&&xt.zone.run(function(){xt.resizeStart.emit({edges:le({edges:Nt,initialRectangle:rn,newRectangle:rn}),rectangle:j(rn,{},0,0)})})}),Ht.pipe((0,k.R)(this.destroy$)).subscribe(function(){Ct&&(xt.renderer.removeClass(xt.elm.nativeElement,oe),xt.renderer.setStyle(document.body,"cursor",""),xt.renderer.setStyle(xt.elm.nativeElement,"cursor",""),xt.resizeEnd.observers.length>0&&xt.zone.run(function(){xt.resizeEnd.emit({edges:le({edges:Ct.edges,initialRectangle:Ct.startingRect,newRectangle:Ct.currentRect}),rectangle:Ct.currentRect})}),qt(),Ct=null)})}},{key:"ngOnChanges",value:function(xt){xt.resizeEdges&&this.resizeEdges$.next(this.resizeEdges)}},{key:"ngOnDestroy",value:function(){(0,Z.NF)(this.platformId)&&this.renderer.setStyle(document.body,"cursor",""),this.mousedown.complete(),this.mouseup.complete(),this.mousemove.complete(),this.resizeEdges$.complete(),this.destroy$.next()}},{key:"setElementClass",value:function(xt,vt,Qt){Qt?this.renderer.addClass(xt.nativeElement,vt):this.renderer.removeClass(xt.nativeElement,vt)}}]),Ke}();return dt.\u0275fac=function(Bt){return new(Bt||dt)(w.Y36(w.Lbi),w.Y36(w.Qsj),w.Y36(w.SBq),w.Y36(w.R0b))},dt.\u0275dir=w.lG2({type:dt,selectors:[["","mwlResizable",""]],inputs:{resizeEdges:"resizeEdges",enableGhostResize:"enableGhostResize",resizeSnapGrid:"resizeSnapGrid",resizeCursors:"resizeCursors",resizeCursorPrecision:"resizeCursorPrecision",ghostElementPositioning:"ghostElementPositioning",allowNegativeResizes:"allowNegativeResizes",mouseMoveThrottleMS:"mouseMoveThrottleMS",validateResize:"validateResize"},outputs:{resizeStart:"resizeStart",resizing:"resizing",resizeEnd:"resizeEnd"},exportAs:["mwlResizable"],features:[w.TTD]}),dt}(),xe=function(){function dt(Ke,Bt){(0,U.Z)(this,dt),this.pointerDown=new I.y(function(xt){var vt,Qt;return Bt.runOutsideAngular(function(){vt=Ke.listen("document","mousedown",function(Ht){xt.next({clientX:Ht.clientX,clientY:Ht.clientY,event:Ht})}),z&&(Qt=Ke.listen("document","touchstart",function(Ht){xt.next({clientX:Ht.touches[0].clientX,clientY:Ht.touches[0].clientY,event:Ht})}))}),function(){vt(),z&&Qt()}}).pipe((0,S.B)()),this.pointerMove=new I.y(function(xt){var vt,Qt;return Bt.runOutsideAngular(function(){vt=Ke.listen("document","mousemove",function(Ht){xt.next({clientX:Ht.clientX,clientY:Ht.clientY,event:Ht})}),z&&(Qt=Ke.listen("document","touchmove",function(Ht){xt.next({clientX:Ht.targetTouches[0].clientX,clientY:Ht.targetTouches[0].clientY,event:Ht})}))}),function(){vt(),z&&Qt()}}).pipe((0,S.B)()),this.pointerUp=new I.y(function(xt){var vt,Qt,Ht;return Bt.runOutsideAngular(function(){vt=Ke.listen("document","mouseup",function(Ct){xt.next({clientX:Ct.clientX,clientY:Ct.clientY,event:Ct})}),z&&(Qt=Ke.listen("document","touchend",function(Ct){xt.next({clientX:Ct.changedTouches[0].clientX,clientY:Ct.changedTouches[0].clientY,event:Ct})}),Ht=Ke.listen("document","touchcancel",function(Ct){xt.next({clientX:Ct.changedTouches[0].clientX,clientY:Ct.changedTouches[0].clientY,event:Ct})}))}),function(){vt(),z&&(Qt(),Ht())}}).pipe((0,S.B)())}return(0,V.Z)(dt,null,[{key:"getInstance",value:function(Bt,xt){return dt.instance||(dt.instance=new dt(Bt,xt)),dt.instance}}]),dt}(),je=function(){var dt=function Ke(){(0,U.Z)(this,Ke)};return dt.\u0275fac=function(Bt){return new(Bt||dt)},dt.\u0275mod=w.oAB({type:dt}),dt.\u0275inj=w.cJS({}),dt}()},57695:function(ue,q,f){var B=f(94518),U=f(23050),V=f(99262),Z=f(44900),w=/^\s*\|\s*/;function b(D,A){var S={};for(var v in D)S[v]=D[v].syntax||D[v];for(var g in A)g in D?A[g].syntax?S[g]=w.test(A[g].syntax)?S[g]+" "+A[g].syntax.trim():A[g].syntax:delete S[g]:A[g].syntax&&(S[g]=A[g].syntax.replace(w,""));return S}function _(D){var A={};for(var S in D)A[S]=D[S].syntax;return A}ue.exports={types:b(V,Z.syntaxes),atrules:function(D,A){var S={};for(var v in D){var g=A[v]&&A[v].descriptors||null;S[v]={prelude:v in A&&"prelude"in A[v]?A[v].prelude:D[v].prelude||null,descriptors:D[v].descriptors?b(D[v].descriptors,g||{}):g&&_(g)}}for(var T in A)hasOwnProperty.call(D,T)||(S[T]={prelude:A[T].prelude||null,descriptors:A[T].descriptors&&_(A[T].descriptors)});return S}(function(D){var A=Object.create(null);for(var S in D){var v=D[S],g=null;if(v.descriptors)for(var T in g=Object.create(null),v.descriptors)g[T]=v.descriptors[T].syntax;A[S.substr(1)]={prelude:v.syntax.trim().match(/^@\S+\s+([^;\{]*)/)[1].trim()||null,descriptors:g}}return A}(B),Z.atrules),properties:b(U,Z.properties)}},63335:function(ue){function q(Z){return{prev:null,next:null,data:Z}}function f(Z,w,N){var b;return null!==U?(b=U,U=U.cursor,b.prev=w,b.next=N,b.cursor=Z.cursor):b={prev:w,next:N,cursor:Z.cursor},Z.cursor=b,b}function B(Z){var w=Z.cursor;Z.cursor=w.cursor,w.prev=null,w.next=null,w.cursor=U,U=w}var U=null,V=function(){this.cursor=null,this.head=null,this.tail=null};V.createItem=q,V.prototype.createItem=q,V.prototype.updateCursors=function(Z,w,N,b){for(var _=this.cursor;null!==_;)_.prev===Z&&(_.prev=w),_.next===N&&(_.next=b),_=_.cursor},V.prototype.getSize=function(){for(var Z=0,w=this.head;w;)Z++,w=w.next;return Z},V.prototype.fromArray=function(Z){var w=null;this.head=null;for(var N=0;N0?U(I.charCodeAt(0)):0;R100&&(R=S-60+3,S=58);for(var k=v;k<=g;k++)k>=0&&k0&&D[k].length>R?"\u2026":"")+D[k].substr(R,98)+(D[k].length>R+100-1?"\u2026":""));return[I(v,A),new Array(S+T+2).join("-")+"^",I(A,g)].filter(Boolean).join("\n")}ue.exports=function(_,I,D,A,S){var v=B("SyntaxError",_);return v.source=I,v.offset=D,v.line=A,v.column=S,v.sourceFragment=function(g){return w(v,isNaN(g)?0:g)},Object.defineProperty(v,"formattedMessage",{get:function(){return"Parse error: "+v.message+"\n"+w(v,2)}}),v.parseError={offset:D,line:A,column:S},v}},13146:function(ue,q,f){var B=f(97077),U=B.TYPE,V=B.NAME,w=f(74586).cmpStr,N=U.EOF,b=U.WhiteSpace,_=U.Comment,I=16777215,D=24,A=function(){this.offsetAndType=null,this.balance=null,this.reset()};A.prototype={reset:function(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset},lookupType:function(v){return(v+=this.tokenIndex)>D:N},lookupOffset:function(v){return(v+=this.tokenIndex)0?v>D,this.source,k)){case 1:break e;case 2:T++;break e;default:this.balance[R]===T&&(T=R),k=this.offsetAndType[T]&I}return T-this.tokenIndex},isBalanceEdge:function(v){return this.balance[this.tokenIndex]>D===b;v++,g++);g>0&&this.skip(g)},skipSC:function(){for(;this.tokenType===b||this.tokenType===_;)this.next()},skip:function(v){var g=this.tokenIndex+v;g>D,this.tokenEnd=g&I):(this.tokenIndex=this.tokenCount,this.next())},next:function(){var v=this.tokenIndex+1;v>D,this.tokenEnd=v&I):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=N,this.tokenStart=this.tokenEnd=this.source.length)},forEachToken:function(v){for(var g=0,T=this.firstCharOffset;g>D,R,E,g)}},dump:function(){var v=this,g=new Array(this.tokenCount);return this.forEachToken(function(T,R,k,E){g[E]={idx:E,type:V[T],chunk:v.source.substring(R,k),balance:v.balance[E]}}),g}},ue.exports=A},62146:function(ue){var f="undefined"!=typeof Uint32Array?Uint32Array:Array;ue.exports=function(U,V){return null===U||U.length";break;case"Property":_="<'"+Z.name+"'>";break;case"Keyword":_=Z.name;break;case"AtKeyword":_="@"+Z.name;break;case"Function":_=Z.name+"(";break;case"String":case"Token":_=Z.value;break;case"Comma":_=",";break;default:throw new Error("Unknown node type `"+Z.type+"`")}return w(_,Z)}ue.exports=function(Z,w){var N=q,b=!1,_=!1;return"function"==typeof w?N=w:w&&(b=Boolean(w.forceBraces),_=Boolean(w.compact),"function"==typeof w.decorate&&(N=w.decorate)),V(Z,N,b,_)}},37149:function(ue,q,f){ue.exports={SyntaxError:f(6063),parse:f(11261),generate:f(58298),walk:f(37363)}},11261:function(ue,q,f){var B=f(57674),K=123,$=function(vt){for(var Qt="function"==typeof Uint32Array?new Uint32Array(128):new Array(128),Ht=0;Ht<128;Ht++)Qt[Ht]=vt(String.fromCharCode(Ht))?1:0;return Qt}(function(vt){return/[a-zA-Z0-9\-]/.test(vt)}),ae={" ":1,"&&":2,"||":3,"|":4};function ce(vt){return vt.substringToPos(vt.findWsEnd(vt.pos))}function le(vt){for(var Qt=vt.pos;Qt=128||0===$[Ht])break}return vt.pos===Qt&&vt.error("Expect a keyword"),vt.substringToPos(Qt)}function oe(vt){for(var Qt=vt.pos;Qt57)break}return vt.pos===Qt&&vt.error("Expect a number"),vt.substringToPos(Qt)}function Ae(vt){var Qt=vt.str.indexOf("'",vt.pos+1);return-1===Qt&&(vt.pos=vt.str.length,vt.error("Expect an apostrophe")),vt.substringToPos(Qt+1)}function be(vt){var Qt,Ht=null;return vt.eat(K),Qt=oe(vt),44===vt.charCode()?(vt.pos++,125!==vt.charCode()&&(Ht=oe(vt))):Ht=Qt,vt.eat(125),{min:Number(Qt),max:Ht?Number(Ht):0}}function qe(vt,Qt){var Ht=function(vt){var Qt=null,Ht=!1;switch(vt.charCode()){case 42:vt.pos++,Qt={min:0,max:0};break;case 43:vt.pos++,Qt={min:1,max:0};break;case 63:vt.pos++,Qt={min:0,max:1};break;case 35:vt.pos++,Ht=!0,Qt=vt.charCode()===K?be(vt):{min:1,max:0};break;case K:Qt=be(vt);break;default:return null}return{type:"Multiplier",comma:Ht,min:Qt.min,max:Qt.max,term:null}}(vt);return null!==Ht?(Ht.term=Qt,Ht):Qt}function _t(vt){var Qt=vt.peek();return""===Qt?null:{type:"Token",value:Qt}}function je(vt,Qt){function Ht(Nt,rn){return{type:"Group",terms:Nt,combinator:rn,disallowEmpty:!1,explicit:!1}}for(Qt=Object.keys(Qt).sort(function(Nt,rn){return ae[Nt]-ae[rn]});Qt.length>0;){for(var Ct=Qt.shift(),qt=0,bt=0;qt1&&(vt.splice(bt,qt-bt,Ht(vt.slice(bt,qt),Ct)),qt=bt+1),bt=-1))}-1!==bt&&Qt.length&&vt.splice(bt,qt-bt,Ht(vt.slice(bt,qt),Ct))}return Ct}function dt(vt){for(var Ct,Qt=[],Ht={},qt=null,bt=vt.pos;Ct=Bt(vt);)"Spaces"!==Ct.type&&("Combinator"===Ct.type?((null===qt||"Combinator"===qt.type)&&(vt.pos=bt,vt.error("Unexpected combinator")),Ht[Ct.value]=!0):null!==qt&&"Combinator"!==qt.type&&(Ht[" "]=!0,Qt.push({type:"Combinator",value:" "})),Qt.push(Ct),qt=Ct,bt=vt.pos);return null!==qt&&"Combinator"===qt.type&&(vt.pos-=bt,vt.error("Unexpected combinator")),{type:"Group",terms:Qt,combinator:je(Qt,Ht)||" ",disallowEmpty:!1,explicit:!1}}function Bt(vt){var Qt=vt.charCode();if(Qt<128&&1===$[Qt])return function(vt){var Qt;return Qt=le(vt),40===vt.charCode()?(vt.pos++,{type:"Function",name:Qt}):qe(vt,{type:"Keyword",name:Qt})}(vt);switch(Qt){case 93:break;case 91:return qe(vt,function(vt){var Qt;return vt.eat(91),Qt=dt(vt),vt.eat(93),Qt.explicit=!0,33===vt.charCode()&&(vt.pos++,Qt.disallowEmpty=!0),Qt}(vt));case 60:return 39===vt.nextCharCode()?function(vt){var Qt;return vt.eat(60),vt.eat(39),Qt=le(vt),vt.eat(39),vt.eat(62),qe(vt,{type:"Property",name:Qt})}(vt):function(vt){var Qt,Ht=null;return vt.eat(60),Qt=le(vt),40===vt.charCode()&&41===vt.nextCharCode()&&(vt.pos+=2,Qt+="()"),91===vt.charCodeAt(vt.findWsEnd(vt.pos))&&(ce(vt),Ht=function(vt){var Qt=null,Ht=null,Ct=1;return vt.eat(91),45===vt.charCode()&&(vt.peek(),Ct=-1),-1==Ct&&8734===vt.charCode()?vt.peek():Qt=Ct*Number(oe(vt)),ce(vt),vt.eat(44),ce(vt),8734===vt.charCode()?vt.peek():(Ct=1,45===vt.charCode()&&(vt.peek(),Ct=-1),Ht=Ct*Number(oe(vt))),vt.eat(93),null===Qt&&null===Ht?null:{type:"Range",min:Qt,max:Ht}}(vt)),vt.eat(62),qe(vt,{type:"Type",name:Qt,opts:Ht})}(vt);case 124:return{type:"Combinator",value:vt.substringToPos(124===vt.nextCharCode()?vt.pos+2:vt.pos+1)};case 38:return vt.pos++,vt.eat(38),{type:"Combinator",value:"&&"};case 44:return vt.pos++,{type:"Comma"};case 39:return qe(vt,{type:"String",value:Ae(vt)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:ce(vt)};case 64:return(Qt=vt.nextCharCode())<128&&1===$[Qt]?(vt.pos++,{type:"AtKeyword",name:le(vt)}):_t(vt);case 42:case 43:case 63:case 35:case 33:break;case K:if((Qt=vt.nextCharCode())<48||Qt>57)return _t(vt);break;default:return _t(vt)}}function xt(vt){var Qt=new B(vt),Ht=dt(Qt);return Qt.pos!==vt.length&&Qt.error("Unexpected input"),1===Ht.terms.length&&"Group"===Ht.terms[0].type&&(Ht=Ht.terms[0]),Ht}xt("[a&&#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!"),ue.exports=xt},57674:function(ue,q,f){var B=f(6063),b=function(I){this.str=I,this.pos=0};b.prototype={charCodeAt:function(I){return I");function k(K,j,J){var ee={};for(var $ in K)K[$].syntax&&(ee[$]=J?K[$].syntax:b(K[$].syntax,{compact:j}));return ee}function E(K,j,J){for(var ee={},$=0,ae=Object.entries(K);$3&&void 0!==arguments[3]?arguments[3]:null,ae={type:J,name:ee},se={type:J,name:ee,parent:$,syntax:null,match:null};return"function"==typeof j?se.match=D(j,ae):("string"==typeof j?Object.defineProperty(se,"syntax",{get:function(){return Object.defineProperty(se,"syntax",{value:N(j)}),se.syntax}}):se.syntax=j,Object.defineProperty(se,"match",{get:function(){return Object.defineProperty(se,"match",{value:D(se.syntax,ae)}),se.match}})),se},addAtrule_:function(j,J){var ee=this;!J||(this.atrules[j]={type:"Atrule",name:j,prelude:J.prelude?this.createDescriptor(J.prelude,"AtrulePrelude",j):null,descriptors:J.descriptors?Object.keys(J.descriptors).reduce(function($,ae){return $[ae]=ee.createDescriptor(J.descriptors[ae],"AtruleDescriptor",ae,j),$},{}):null})},addProperty_:function(j,J){!J||(this.properties[j]=this.createDescriptor(J,"Property",j))},addType_:function(j,J){!J||(this.types[j]=this.createDescriptor(J,"Type",j),J===w["-ms-legacy-expression"]&&(this.valueCommonSyntax=R))},checkAtruleName:function(j){if(!this.getAtrule(j))return new U("Unknown at-rule","@"+j)},checkAtrulePrelude:function(j,J){var ee=this.checkAtruleName(j);if(ee)return ee;var $=this.getAtrule(j);return!$.prelude&&J?new SyntaxError("At-rule `@"+j+"` should not contain a prelude"):$.prelude&&!J?new SyntaxError("At-rule `@"+j+"` should contain a prelude"):void 0},checkAtruleDescriptorName:function(j,J){var ee=this.checkAtruleName(j);if(ee)return ee;var $=this.getAtrule(j),ae=Z.keyword(J);return $.descriptors?$.descriptors[ae.name]||$.descriptors[ae.basename]?void 0:new U("Unknown at-rule descriptor",J):new SyntaxError("At-rule `@"+j+"` has no known descriptors")},checkPropertyName:function(j){return Z.property(j).custom?new Error("Lexer matching doesn't applicable for custom properties"):this.getProperty(j)?void 0:new U("Unknown property",j)},matchAtrulePrelude:function(j,J){var ee=this.checkAtrulePrelude(j,J);return ee?O(null,ee):J?F(this,this.getAtrule(j).prelude,J,!1):O(null,null)},matchAtruleDescriptor:function(j,J,ee){var $=this.checkAtruleDescriptorName(j,J);if($)return O(null,$);var ae=this.getAtrule(j),se=Z.keyword(J);return F(this,ae.descriptors[se.name]||ae.descriptors[se.basename],ee,!1)},matchDeclaration:function(j){return"Declaration"!==j.type?O(null,new Error("Not a Declaration node")):this.matchProperty(j.property,j.value)},matchProperty:function(j,J){var ee=this.checkPropertyName(j);return ee?O(null,ee):F(this,this.getProperty(j),J,!0)},matchType:function(j,J){var ee=this.getType(j);return ee?F(this,ee,J,!1):O(null,new U("Unknown type",j))},match:function(j,J){return"string"==typeof j||j&&j.type?(("string"==typeof j||!j.match)&&(j=this.createDescriptor(j,"Type","anonymous")),F(this,j,J,!1)):O(null,new U("Bad syntax"))},findValueFragments:function(j,J,ee,$){return v.matchFragments(this,J,this.matchProperty(j,J),ee,$)},findDeclarationValueFragments:function(j,J,ee){return v.matchFragments(this,j.value,this.matchDeclaration(j),J,ee)},findAllFragments:function(j,J,ee){var $=[];return this.syntax.walk(j,{visit:"Declaration",enter:function(ae){$.push.apply($,this.findDeclarationValueFragments(ae,J,ee))}.bind(this)}),$},getAtrule:function(j){var J=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ee=Z.keyword(j),$=ee.vendor&&J?this.atrules[ee.name]||this.atrules[ee.basename]:this.atrules[ee.name];return $||null},getAtrulePrelude:function(j){var J=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ee=this.getAtrule(j,J);return ee&&ee.prelude||null},getAtruleDescriptor:function(j,J){return this.atrules.hasOwnProperty(j)&&this.atrules.declarators&&this.atrules[j].declarators[J]||null},getProperty:function(j){var J=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ee=Z.property(j),$=ee.vendor&&J?this.properties[ee.name]||this.properties[ee.basename]:this.properties[ee.name];return $||null},getType:function(j){return this.types.hasOwnProperty(j)?this.types[j]:null},validate:function(){function j(ae,se,ce,le){if(ce.hasOwnProperty(se))return ce[se];ce[se]=!1,null!==le.syntax&&_(le.syntax,function(oe){if("Type"===oe.type||"Property"===oe.type){var Ae="Type"===oe.type?ae.types:ae.properties,be="Type"===oe.type?J:ee;(!Ae.hasOwnProperty(oe.name)||j(ae,oe.name,be,Ae[oe.name]))&&(ce[se]=!0)}},this)}var J={},ee={};for(var $ in this.types)j(this,$,J,this.types[$]);for(var $ in this.properties)j(this,$,ee,this.properties[$]);return J=Object.keys(J).filter(function(ae){return J[ae]}),ee=Object.keys(ee).filter(function(ae){return ee[ae]}),J.length||ee.length?{types:J,properties:ee}:null},dump:function(j,J){return{generic:this.generic,types:k(this.types,!J,j),properties:k(this.properties,!J,j),atrules:E(this.atrules,!J,j)}},toString:function(){return JSON.stringify(this.dump())}},ue.exports=z},40533:function(ue,q,f){var B=f(92455),U=f(58298),V={offset:0,line:1,column:1};function w(I,D){var A=I&&I.loc&&I.loc[D];return A?"line"in A?N(A):A:null}function N(I,D){var g={offset:I.offset,line:I.line,column:I.column};if(D){var T=D.split(/\n|\r\n?|\f/);g.offset+=D.length,g.line+=T.length-1,g.column=1===T.length?g.column+D.length:T.pop().length+1}return g}ue.exports={SyntaxReferenceError:function(D,A){var S=B("SyntaxReferenceError",D+(A?" `"+A+"`":""));return S.reference=A,S},SyntaxMatchError:function(D,A,S,v){var g=B("SyntaxMatchError",D),T=function(I,D){for(var x,O,A=I.tokens,S=I.longestMatch,v=S1?(x=w(g||D,"end")||N(V,E),O=N(x)):(x=w(g,"start")||N(w(D,"start")||V,E.slice(0,T)),O=w(g,"end")||N(x,E.substr(T,R))),{css:E,mismatchOffset:T,mismatchLength:R,start:x,end:O}}(v,S),R=T.css,k=T.mismatchOffset,E=T.mismatchLength,x=T.start,O=T.end;return g.rawMessage=D,g.syntax=A?U(A):"",g.css=R,g.mismatchOffset=k,g.mismatchLength=E,g.message=D+"\n syntax: "+g.syntax+"\n value: "+(R||"")+"\n --------"+new Array(g.mismatchOffset+1).join("-")+"^",Object.assign(g,x),g.loc={source:S&&S.loc&&S.loc.source||"",start:x,end:O},g}}},25533:function(ue,q,f){var B=f(97555).isDigit,U=f(97555).cmpChar,V=f(97555).TYPE,Z=V.Delim,w=V.WhiteSpace,N=V.Comment,b=V.Ident,_=V.Number,I=V.Dimension,A=45,v=!0;function T(x,O){return null!==x&&x.type===Z&&x.value.charCodeAt(0)===O}function R(x,O,F){for(;null!==x&&(x.type===w||x.type===N);)x=F(++O);return O}function k(x,O,F,z){if(!x)return 0;var K=x.value.charCodeAt(O);if(43===K||K===A){if(F)return 0;O++}for(;O0?6:0;if(!B(F)||++O>6)return 0}return O}function T(R,k,E){if(!R)return 0;for(;S(E(k),63);){if(++R>6)return 0;k++}return k}ue.exports=function(k,E){var x=0;if(null===k||k.type!==Z||!U(k.value,0,117)||null===(k=E(++x)))return 0;if(S(k,43))return null===(k=E(++x))?0:k.type===Z?T(g(k,0,!0),++x,E):S(k,63)?T(1,++x,E):0;if(k.type===N){if(!v(k,43))return 0;var O=g(k,1,!0);return 0===O?0:null===(k=E(++x))?x:k.type===b||k.type===N?v(k,45)&&g(k,1,!1)?x+1:0:T(O,x,E)}return k.type===b&&v(k,43)?T(g(k,1,!0),++x,E):0}},71473:function(ue,q,f){var B=f(97555),U=B.isIdentifierStart,V=B.isHexDigit,Z=B.isDigit,w=B.cmpStr,N=B.consumeNumber,b=B.TYPE,_=f(25533),I=f(70156),D=["unset","initial","inherit"],A=["calc(","-moz-calc(","-webkit-calc("];function O(xe,De){return Dexe.max)return!0}return!1}function J(xe,De){var je=xe.index,dt=0;do{if(dt++,xe.balance<=je)break}while(xe=De(dt));return dt}function ee(xe){return function(De,je,dt){return null===De?0:De.type===b.Function&&z(De.value,A)?J(De,je):xe(De,je,dt)}}function $(xe){return function(De){return null===De||De.type!==xe?0:1}}function it(xe){return function(De,je,dt){if(null===De||De.type!==b.Dimension)return 0;var Ke=N(De.value,0);if(null!==xe){var Bt=De.value.indexOf("\\",Ke),xt=-1!==Bt&&K(De.value,Bt)?De.value.substring(Ke,Bt):De.value.substr(Ke);if(!1===xe.hasOwnProperty(xt.toLowerCase()))return 0}return j(dt,De.value,Ke)?0:1}}function _t(xe){return"function"!=typeof xe&&(xe=function(){return 0}),function(De,je,dt){return null!==De&&De.type===b.Number&&0===Number(De.value)?1:xe(De,je,dt)}}ue.exports={"ident-token":$(b.Ident),"function-token":$(b.Function),"at-keyword-token":$(b.AtKeyword),"hash-token":$(b.Hash),"string-token":$(b.String),"bad-string-token":$(b.BadString),"url-token":$(b.Url),"bad-url-token":$(b.BadUrl),"delim-token":$(b.Delim),"number-token":$(b.Number),"percentage-token":$(b.Percentage),"dimension-token":$(b.Dimension),"whitespace-token":$(b.WhiteSpace),"CDO-token":$(b.CDO),"CDC-token":$(b.CDC),"colon-token":$(b.Colon),"semicolon-token":$(b.Semicolon),"comma-token":$(b.Comma),"[-token":$(b.LeftSquareBracket),"]-token":$(b.RightSquareBracket),"(-token":$(b.LeftParenthesis),")-token":$(b.RightParenthesis),"{-token":$(b.LeftCurlyBracket),"}-token":$(b.RightCurlyBracket),string:$(b.String),ident:$(b.Ident),"custom-ident":function(xe){if(null===xe||xe.type!==b.Ident)return 0;var De=xe.value.toLowerCase();return z(De,D)||F(De,"default")?0:1},"custom-property-name":function(xe){return null===xe||xe.type!==b.Ident||45!==O(xe.value,0)||45!==O(xe.value,1)?0:1},"hex-color":function(xe){if(null===xe||xe.type!==b.Hash)return 0;var De=xe.value.length;if(4!==De&&5!==De&&7!==De&&9!==De)return 0;for(var je=1;jexe.index||xe.balancexe.index||xe.balance2&&40===v.charCodeAt(v.length-2)&&41===v.charCodeAt(v.length-1)}function I(v){return"Keyword"===v.type||"AtKeyword"===v.type||"Function"===v.type||"Type"===v.type&&_(v.name)}function D(v,g,T){switch(v){case" ":for(var R=U,k=g.length-1;k>=0;k--)R=b(E=g[k],R,V);return R;case"|":R=V;var x=null;for(k=g.length-1;k>=0;k--){if(I(E=g[k])&&(null===x&&k>0&&I(g[k-1])&&(R=b({type:"Enum",map:x=Object.create(null)},U,R)),null!==x)){var O=(_(E.name)?E.name.slice(0,-1):E.name).toLowerCase();if(!(O in x)){x[O]=E;continue}}x=null,R=b(E,U,R)}return R;case"&&":if(g.length>5)return{type:"MatchOnce",terms:g,all:!0};for(R=V,k=g.length-1;k>=0;k--){var E=g[k];F=g.length>1?D(v,g.filter(function(j){return j!==E}),!1):U,R=b(E,F,R)}return R;case"||":if(g.length>5)return{type:"MatchOnce",terms:g,all:!1};for(R=T?U:V,k=g.length-1;k>=0;k--){var F;E=g[k],F=g.length>1?D(v,g.filter(function(J){return J!==E}),!0):U,R=b(E,F,R)}return R}}function S(v){if("function"==typeof v)return{type:"Generic",fn:v};switch(v.type){case"Group":var g=D(v.combinator,v.terms.map(S),!1);return v.disallowEmpty&&(g=b(g,Z,V)),g;case"Multiplier":return function(v){var g=U,T=S(v.term);if(0===v.max)T=b(T,Z,V),(g=b(T,null,V)).then=b(U,U,g),v.comma&&(g.then.else=b({type:"Comma",syntax:v},g,V));else for(var R=v.min||1;R<=v.max;R++)v.comma&&g!==U&&(g=b({type:"Comma",syntax:v},g,V)),g=b(T,b(U,U,g),V);if(0===v.min)g=b(U,U,g);else for(R=0;R=65&&$<=90&&($|=32),$!==J.charCodeAt(ee))return!1}return!0}function x(j){return null===j||j.type===N.Comma||j.type===N.Function||j.type===N.LeftParenthesis||j.type===N.LeftSquareBracket||j.type===N.LeftCurlyBracket||function(j){return j.type===N.Delim&&"?"!==j.value}(j)}function O(j){return null===j||j.type===N.RightParenthesis||j.type===N.RightSquareBracket||j.type===N.RightCurlyBracket||j.type===N.Delim}function F(j,J,ee){function $(){do{je++,De=jedt&&(dt=je)}function be(){Ke=2===Ke.type?Ke.prev:{type:3,syntax:it.syntax,token:Ke.token,prev:Ke},it=it.prev}var it=null,qe=null,_t=null,yt=null,Ft=0,xe=null,De=null,je=-1,dt=0,Ke={type:0,syntax:null,token:null,prev:null};for($();null===xe&&++Ft<15e3;)switch(J.type){case"Match":if(null===qe){if(null!==De&&(je!==j.length-1||"\\0"!==De.value&&"\\9"!==De.value)){J=Z;break}xe=A;break}if((J=qe.nextState)===w){if(qe.matchStack===Ke){J=Z;break}J=V}for(;qe.syntaxStack!==it;)be();qe=qe.prev;break;case"Mismatch":if(null!==yt&&!1!==yt)(null===_t||je>_t.tokenIndex)&&(_t=yt,yt=!1);else if(null===_t){xe="Mismatch";break}J=_t.nextState,qe=_t.thenStack,it=_t.syntaxStack,Ke=_t.matchStack,De=(je=_t.tokenIndex)je){for(;je":"<'"+J.name+"'>"));if(!1!==yt&&null!==De&&"Type"===J.type&&("custom-ident"===J.name&&De.type===N.Ident||"length"===J.name&&"0"===De.value)){null===yt&&(yt=se(J,_t)),J=Z;break}it={syntax:J.syntax,opts:J.syntax.opts||null!==it&&it.opts||null,prev:it},Ke={type:2,syntax:J.syntax,token:Ke.token,prev:Ke},J=Ct.match;break;case"Keyword":var bt=J.name;if(null!==De){var en=De.value;if(-1!==en.indexOf("\\")&&(en=en.replace(/\\[09].*$/,"")),k(en,bt)){oe(),J=V;break}}J=Z;break;case"AtKeyword":case"Function":if(null!==De&&k(De.value,J.name)){oe(),J=V;break}J=Z;break;case"Token":if(null!==De&&De.value===J.value){oe(),J=V;break}J=Z;break;case"Comma":null!==De&&De.type===N.Comma?x(Ke.token)?J=Z:(oe(),J=O(De)?Z:V):J=x(Ke.token)||O(De)?V:Z;break;case"String":var Nt="";for(Qt=je;Qt=0}function Z(b){return Boolean(b)&&V(b.offset)&&V(b.line)&&V(b.column)}function w(b,_){return function(D,A){if(!D||D.constructor!==Object)return A(D,"Type of node should be an Object");for(var S in D){var v=!0;if(!1!==U.call(D,S)){if("type"===S)D.type!==b&&A(D,"Wrong node type `"+D.type+"`, expected `"+b+"`");else if("loc"===S){if(null===D.loc)continue;if(D.loc&&D.loc.constructor===Object)if("string"!=typeof D.loc.source)S+=".source";else if(Z(D.loc.start)){if(Z(D.loc.end))continue;S+=".end"}else S+=".start";v=!1}else if(_.hasOwnProperty(S)){var g=0;for(v=!1;!v&&g<_[S].length;g++){var T=_[S][g];switch(T){case String:v="string"==typeof D[S];break;case Boolean:v="boolean"==typeof D[S];break;case null:v=null===D[S];break;default:"string"==typeof T?v=D[S]&&D[S].type===T:Array.isArray(T)&&(v=D[S]instanceof B)}}}else A(D,"Unknown field `"+S+"` for "+b+" node type");v||A(D,"Bad value for `"+b+"."+S+"`")}}for(var S in _)U.call(_,S)&&!1===U.call(D,S)&&A(D,"Field `"+b+"."+S+"` is missed")}}function N(b,_){var I=_.structure,D={type:String,loc:!0},A={type:'"'+b+'"'};for(var S in I)if(!1!==U.call(I,S)){for(var v=[],g=D[S]=Array.isArray(I[S])?I[S].slice():[I[S]],T=0;T");else{if(!Array.isArray(R))throw new Error("Wrong value `"+R+"` in `"+b+"."+S+"` structure definition");v.push("List")}}A[S]=v.join(" | ")}return{docs:A,check:w(b,D)}}ue.exports={getStructureFromConfig:function(_){var I={};if(_.node)for(var D in _.node)if(U.call(_.node,D)){var A=_.node[D];if(!A.structure)throw new Error("Missed `structure` field in `"+D+"` node type definition");I[D]=N(D,A)}return I}}},24988:function(ue){function q(Z){function w(_){return null!==_&&("Type"===_.type||"Property"===_.type||"Keyword"===_.type)}var b=null;return null!==this.matched&&function N(_){if(Array.isArray(_.match)){for(var I=0;I<_.match.length;I++)if(N(_.match[I]))return w(_.syntax)&&b.unshift(_.syntax),!0}else if(_.node===Z)return b=w(_.syntax)?[_.syntax]:[],!0;return!1}(this.matched),b}function f(Z,w,N){var b=q.call(Z,w);return null!==b&&b.some(N)}ue.exports={getTrace:q,isType:function(Z,w){return f(this,Z,function(N){return"Type"===N.type&&N.name===w})},isProperty:function(Z,w){return f(this,Z,function(N){return"Property"===N.type&&N.name===w})},isKeyword:function(Z){return f(this,Z,function(w){return"Keyword"===w.type})}}},29365:function(ue,q,f){var B=f(88373),U=f(52556),V=f(13146),Z=f(63335),w=f(97555),N=f(97077),b=f(74586),_=b.findWhiteSpaceStart,I=b.cmpStr,D=f(15785),A=function(){},S=N.TYPE,v=N.NAME,g=S.WhiteSpace,T=S.Comment,R=S.Ident,k=S.Function,E=S.Url,x=S.Hash,O=S.Percentage,F=S.Number;function j(ee){return function(){return this[ee]()}}ue.exports=function($){var ae={scanner:new V,locationMap:new B,filename:"",needPositions:!1,onParseError:A,onParseErrorThrow:!1,parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:D,createList:function(){return new Z},createSingleNodeList:function(le){return(new Z).appendData(le)},getFirstListNode:function(le){return le&&le.first()},getLastListNode:function(le){return le.last()},parseWithFallback:function(le,oe){var Ae=this.scanner.tokenIndex;try{return le.call(this)}catch(it){if(this.onParseErrorThrow)throw it;var be=oe.call(this,Ae);return this.onParseErrorThrow=!0,this.onParseError(it,be),this.onParseErrorThrow=!1,be}},lookupNonWSType:function(le){do{var oe=this.scanner.lookupType(le++);if(oe!==g)return oe}while(0!==oe);return 0},eat:function(le){if(this.scanner.tokenType!==le){var oe=this.scanner.tokenStart,Ae=v[le]+" is expected";switch(le){case R:this.scanner.tokenType===k||this.scanner.tokenType===E?(oe=this.scanner.tokenEnd-1,Ae="Identifier is expected but function found"):Ae="Identifier is expected";break;case x:this.scanner.isDelim(35)&&(this.scanner.next(),oe++,Ae="Name is expected");break;case O:this.scanner.tokenType===F&&(oe=this.scanner.tokenEnd,Ae="Percent sign is expected");break;default:this.scanner.source.charCodeAt(this.scanner.tokenStart)===le&&(oe+=1)}this.error(Ae,oe)}this.scanner.next()},consume:function(le){var oe=this.scanner.getTokenValue();return this.eat(le),oe},consumeFunctionName:function(){var le=this.scanner.source.substring(this.scanner.tokenStart,this.scanner.tokenEnd-1);return this.eat(k),le},getLocation:function(le,oe){return this.needPositions?this.locationMap.getLocationRange(le,oe,this.filename):null},getLocationFromList:function(le){if(this.needPositions){var oe=this.getFirstListNode(le),Ae=this.getLastListNode(le);return this.locationMap.getLocationRange(null!==oe?oe.loc.start.offset-this.locationMap.startOffset:this.scanner.tokenStart,null!==Ae?Ae.loc.end.offset-this.locationMap.startOffset:this.scanner.tokenStart,this.filename)}return null},error:function(le,oe){var Ae=this.locationMap.getLocation(void 0!==oe&&oe",ae.needPositions=Boolean(le.positions),ae.onParseError="function"==typeof le.onParseError?le.onParseError:A,ae.onParseErrorThrow=!1,ae.parseAtrulePrelude=!("parseAtrulePrelude"in le)||Boolean(le.parseAtrulePrelude),ae.parseRulePrelude=!("parseRulePrelude"in le)||Boolean(le.parseRulePrelude),ae.parseValue=!("parseValue"in le)||Boolean(le.parseValue),ae.parseCustomProperty="parseCustomProperty"in le&&Boolean(le.parseCustomProperty),!ae.context.hasOwnProperty(oe))throw new Error("Unknown context `"+oe+"`");return"function"==typeof Ae&&ae.scanner.forEachToken(function(it,qe,_t){if(it===T){var yt=ae.getLocation(qe,_t),Ft=I(ce,_t-2,_t,"*/")?ce.slice(qe+2,_t-2):ce.slice(qe+2,_t);Ae(Ft,yt)}}),be=ae.context[oe].call(ae,le),ae.scanner.eof||ae.error(),be}}},15785:function(ue,q,f){var B=f(97555).TYPE,U=B.WhiteSpace,V=B.Comment;ue.exports=function(w){var N=this.createList(),b=null,_={recognizer:w,space:null,ignoreWS:!1,ignoreWSAfter:!1};for(this.scanner.skipSC();!this.scanner.eof;){switch(this.scanner.tokenType){case V:this.scanner.next();continue;case U:_.ignoreWS?this.scanner.next():_.space=this.WhiteSpace();continue}if(void 0===(b=w.getNode.call(this,_)))break;null!==_.space&&(N.push(_.space),_.space=null),N.push(b),_.ignoreWSAfter?(_.ignoreWSAfter=!1,_.ignoreWS=!0):_.ignoreWS=!1}return N}},71713:function(ue){ue.exports={parse:{prelude:null,block:function(){return this.Block(!0)}}}},88208:function(ue,q,f){var B=f(97555).TYPE,U=B.String,V=B.Ident,Z=B.Url,w=B.Function,N=B.LeftParenthesis;ue.exports={parse:{prelude:function(){var _=this.createList();switch(this.scanner.skipSC(),this.scanner.tokenType){case U:_.push(this.String());break;case Z:case w:_.push(this.Url());break;default:this.error("String or url() is expected")}return(this.lookupNonWSType(0)===V||this.lookupNonWSType(0)===N)&&(_.push(this.WhiteSpace()),_.push(this.MediaQueryList())),_},block:null}}},55682:function(ue,q,f){ue.exports={"font-face":f(71713),import:f(88208),media:f(81706),page:f(93949),supports:f(46928)}},81706:function(ue){ue.exports={parse:{prelude:function(){return this.createSingleNodeList(this.MediaQueryList())},block:function(){return this.Block(!1)}}}},93949:function(ue){ue.exports={parse:{prelude:function(){return this.createSingleNodeList(this.SelectorList())},block:function(){return this.Block(!0)}}}},46928:function(ue,q,f){var B=f(97555).TYPE,U=B.WhiteSpace,V=B.Comment,Z=B.Ident,w=B.Function,N=B.Colon,b=B.LeftParenthesis;function _(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))}function I(){return this.scanner.skipSC(),this.scanner.tokenType===Z&&this.lookupNonWSType(1)===N?this.createSingleNodeList(this.Declaration()):D.call(this)}function D(){var v,A=this.createList(),S=null;this.scanner.skipSC();e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case U:S=this.WhiteSpace();continue;case V:this.scanner.next();continue;case w:v=this.Function(_,this.scope.AtrulePrelude);break;case Z:v=this.Identifier();break;case b:v=this.Parentheses(I,this.scope.AtrulePrelude);break;default:break e}null!==S&&(A.push(S),S=null),A.push(v)}return A}ue.exports={parse:{prelude:function(){var S=D.call(this);return null===this.getFirstListNode(S)&&this.error("Condition is expected"),S},block:function(){return this.Block(!1)}}}},53901:function(ue,q,f){var B=f(57695);ue.exports={generic:!0,types:B.types,atrules:B.atrules,properties:B.properties,node:f(5678)}},15249:function(ue,q,f){var B=f(6326).default,U=Object.prototype.hasOwnProperty,V={generic:!0,types:I,atrules:{prelude:D,descriptors:D},properties:I,parseContext:function(S,v){return Object.assign(S,v)},scope:function b(S,v){for(var g in v)U.call(v,g)&&(Z(S[g])?b(S[g],w(v[g])):S[g]=w(v[g]));return S},atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Z(S){return S&&S.constructor===Object}function w(S){return Z(S)?Object.assign({},S):S}function _(S,v){return"string"==typeof v&&/^\s*\|/.test(v)?"string"==typeof S?S+v:v.replace(/^\s*\|\s*/,""):v||null}function I(S,v){if("string"==typeof v)return _(S,v);var g=Object.assign({},S);for(var T in v)U.call(v,T)&&(g[T]=_(U.call(S,T)?S[T]:void 0,v[T]));return g}function D(S,v){var g=I(S,v);return!Z(g)||Object.keys(g).length?g:null}function A(S,v,g){for(var T in g)if(!1!==U.call(g,T))if(!0===g[T])T in v&&U.call(v,T)&&(S[T]=w(v[T]));else if(g[T])if("function"==typeof g[T]){var R=g[T];S[T]=R({},S[T]),S[T]=R(S[T]||{},v[T])}else if(Z(g[T])){var k={};for(var E in S[T])k[E]=A({},S[T][E],g[T]);for(var x in v[T])k[x]=A(k[x]||{},v[T][x],g[T]);S[T]=k}else if(Array.isArray(g[T])){for(var O={},F=g[T].reduce(function(ae,se){return ae[se]=!0,ae},{}),z=0,K=Object.entries(S[T]||{});z0&&this.scanner.skip(E),0===x&&(O=this.scanner.source.charCodeAt(this.scanner.tokenStart))!==I&&O!==D&&this.error("Number sign is expected"),T.call(this,0!==x),x===D?"-"+this.consume(b):this.consume(b)}ue.exports={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var x=this.scanner.tokenStart,O=null,F=null;if(this.scanner.tokenType===b)T.call(this,!1),F=this.consume(b);else if(this.scanner.tokenType===N&&B(this.scanner.source,this.scanner.tokenStart,D))switch(O="-1",R.call(this,1,A),this.scanner.getTokenLength()){case 2:this.scanner.next(),F=k.call(this);break;case 3:R.call(this,2,D),this.scanner.next(),this.scanner.skipSC(),T.call(this,S),F="-"+this.consume(b);break;default:R.call(this,2,D),g.call(this,3,S),this.scanner.next(),F=this.scanner.substrToCursor(x+2)}else if(this.scanner.tokenType===N||this.scanner.isDelim(I)&&this.scanner.lookupType(1)===N){var z=0;switch(O="1",this.scanner.isDelim(I)&&(z=1,this.scanner.next()),R.call(this,0,A),this.scanner.getTokenLength()){case 1:this.scanner.next(),F=k.call(this);break;case 2:R.call(this,1,D),this.scanner.next(),this.scanner.skipSC(),T.call(this,S),F="-"+this.consume(b);break;default:R.call(this,1,D),g.call(this,2,S),this.scanner.next(),F=this.scanner.substrToCursor(x+z+1)}}else if(this.scanner.tokenType===_){for(var K=this.scanner.source.charCodeAt(this.scanner.tokenStart),j=this.scanner.tokenStart+(z=K===I||K===D);j=2&&42===this.scanner.source.charCodeAt(b-2)&&47===this.scanner.source.charCodeAt(b-1)&&(b-=2),{type:"Comment",loc:this.getLocation(N,this.scanner.tokenStart),value:this.scanner.source.substring(N+2,b)}},generate:function(N){this.chunk("/*"),this.chunk(N.value),this.chunk("*/")}}},7217:function(ue,q,f){var B=f(50643).isCustomProperty,U=f(97555).TYPE,V=f(89604).mode,Z=U.Ident,w=U.Hash,N=U.Colon,b=U.Semicolon,_=U.Delim,I=U.WhiteSpace;function k(z){return this.Raw(z,V.exclamationMarkOrSemicolon,!0)}function E(z){return this.Raw(z,V.exclamationMarkOrSemicolon,!1)}function x(){var z=this.scanner.tokenIndex,K=this.Value();return"Raw"!==K.type&&!1===this.scanner.eof&&this.scanner.tokenType!==b&&!1===this.scanner.isDelim(33)&&!1===this.scanner.isBalanceEdge(z)&&this.error(),K}function O(){var z=this.scanner.tokenStart;if(this.scanner.tokenType===_)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.isDelim(47)&&this.scanner.next()}return this.eat(this.scanner.tokenType===w?w:Z),this.scanner.substrToCursor(z)}function F(){this.eat(_),this.scanner.skipSC();var z=this.consume(Z);return"important"===z||z}ue.exports={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var ce,K=this.scanner.tokenStart,j=this.scanner.tokenIndex,J=O.call(this),ee=B(J),$=ee?this.parseCustomProperty:this.parseValue,ae=ee?E:k,se=!1;this.scanner.skipSC(),this.eat(N);var le=this.scanner.tokenIndex;if(ee||this.scanner.skipSC(),ce=$?this.parseWithFallback(x,ae):ae.call(this,this.scanner.tokenIndex),ee&&"Value"===ce.type&&ce.children.isEmpty())for(var oe=le-this.scanner.tokenIndex;oe<=0;oe++)if(this.scanner.lookupType(oe)===I){ce.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.scanner.isDelim(33)&&(se=F.call(this),this.scanner.skipSC()),!1===this.scanner.eof&&this.scanner.tokenType!==b&&!1===this.scanner.isBalanceEdge(j)&&this.error(),{type:"Declaration",loc:this.getLocation(K,this.scanner.tokenStart),important:se,property:J,value:ce}},generate:function(K){this.chunk(K.property),this.chunk(":"),this.node(K.value),K.important&&this.chunk(!0===K.important?"!important":"!"+K.important)},walkContext:"declaration"}},69013:function(ue,q,f){var B=f(97555).TYPE,U=f(89604).mode,V=B.WhiteSpace,Z=B.Comment,w=B.Semicolon;function N(b){return this.Raw(b,U.semicolonIncluded,!0)}ue.exports={name:"DeclarationList",structure:{children:[["Declaration"]]},parse:function(){for(var _=this.createList();!this.scanner.eof;)switch(this.scanner.tokenType){case V:case Z:case w:this.scanner.next();break;default:_.push(this.parseWithFallback(this.Declaration,N))}return{type:"DeclarationList",loc:this.getLocationFromList(_),children:_}},generate:function(_){this.children(_,function(I){"Declaration"===I.type&&this.chunk(";")})}}},68241:function(ue,q,f){var B=f(74586).consumeNumber,V=f(97555).TYPE.Dimension;ue.exports={name:"Dimension",structure:{value:String,unit:String},parse:function(){var w=this.scanner.tokenStart,N=B(this.scanner.source,w);return this.eat(V),{type:"Dimension",loc:this.getLocation(w,this.scanner.tokenStart),value:this.scanner.source.substring(w,N),unit:this.scanner.source.substring(N,this.scanner.tokenStart)}},generate:function(w){this.chunk(w.value),this.chunk(w.unit)}}},60298:function(ue,q,f){var U=f(97555).TYPE.RightParenthesis;ue.exports={name:"Function",structure:{name:String,children:[[]]},parse:function(Z,w){var I,N=this.scanner.tokenStart,b=this.consumeFunctionName(),_=b.toLowerCase();return I=w.hasOwnProperty(_)?w[_].call(this,w):Z.call(this,w),this.scanner.eof||this.eat(U),{type:"Function",loc:this.getLocation(N,this.scanner.tokenStart),name:b,children:I}},generate:function(Z){this.chunk(Z.name),this.chunk("("),this.children(Z),this.chunk(")")},walkContext:"function"}},50759:function(ue,q,f){var U=f(97555).TYPE.Hash;ue.exports={name:"Hash",structure:{value:String},parse:function(){var Z=this.scanner.tokenStart;return this.eat(U),{type:"Hash",loc:this.getLocation(Z,this.scanner.tokenStart),value:this.scanner.substrToCursor(Z+1)}},generate:function(Z){this.chunk("#"),this.chunk(Z.value)}}},37701:function(ue,q,f){var U=f(97555).TYPE.Hash;ue.exports={name:"IdSelector",structure:{name:String},parse:function(){var Z=this.scanner.tokenStart;return this.eat(U),{type:"IdSelector",loc:this.getLocation(Z,this.scanner.tokenStart),name:this.scanner.substrToCursor(Z+1)}},generate:function(Z){this.chunk("#"),this.chunk(Z.name)}}},71392:function(ue,q,f){var U=f(97555).TYPE.Ident;ue.exports={name:"Identifier",structure:{name:String},parse:function(){return{type:"Identifier",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),name:this.consume(U)}},generate:function(Z){this.chunk(Z.name)}}},94179:function(ue,q,f){var B=f(97555).TYPE,U=B.Ident,V=B.Number,Z=B.Dimension,w=B.LeftParenthesis,N=B.RightParenthesis,b=B.Colon,_=B.Delim;ue.exports={name:"MediaFeature",structure:{name:String,value:["Identifier","Number","Dimension","Ratio",null]},parse:function(){var A,D=this.scanner.tokenStart,S=null;if(this.eat(w),this.scanner.skipSC(),A=this.consume(U),this.scanner.skipSC(),this.scanner.tokenType!==N){switch(this.eat(b),this.scanner.skipSC(),this.scanner.tokenType){case V:S=this.lookupNonWSType(1)===_?this.Ratio():this.Number();break;case Z:S=this.Dimension();break;case U:S=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.scanner.skipSC()}return this.eat(N),{type:"MediaFeature",loc:this.getLocation(D,this.scanner.tokenStart),name:A,value:S}},generate:function(D){this.chunk("("),this.chunk(D.name),null!==D.value&&(this.chunk(":"),this.node(D.value)),this.chunk(")")}}},32107:function(ue,q,f){var B=f(97555).TYPE,U=B.WhiteSpace,V=B.Comment,Z=B.Ident,w=B.LeftParenthesis;ue.exports={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var b=this.createList(),_=null,I=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case V:this.scanner.next();continue;case U:I=this.WhiteSpace();continue;case Z:_=this.Identifier();break;case w:_=this.MediaFeature();break;default:break e}null!==I&&(b.push(I),I=null),b.push(_)}return null===_&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(b),children:b}},generate:function(b){this.children(b)}}},54459:function(ue,q,f){var B=f(97555).TYPE.Comma;ue.exports={name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:function(V){var Z=this.createList();for(this.scanner.skipSC();!this.scanner.eof&&(Z.push(this.MediaQuery(V)),this.scanner.tokenType===B);)this.scanner.next();return{type:"MediaQueryList",loc:this.getLocationFromList(Z),children:Z}},generate:function(V){this.children(V,function(){this.chunk(",")})}}},61123:function(ue){ue.exports={name:"Nth",structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]},parse:function(f){this.scanner.skipSC();var Z,B=this.scanner.tokenStart,U=B,V=null;return Z=this.scanner.lookupValue(0,"odd")||this.scanner.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),this.scanner.skipSC(),f&&this.scanner.lookupValue(0,"of")?(this.scanner.next(),V=this.SelectorList(),this.needPositions&&(U=this.getLastListNode(V.children).loc.end.offset)):this.needPositions&&(U=Z.loc.end.offset),{type:"Nth",loc:this.getLocation(B,U),nth:Z,selector:V}},generate:function(f){this.node(f.nth),null!==f.selector&&(this.chunk(" of "),this.node(f.selector))}}},63902:function(ue,q,f){var B=f(97555).TYPE.Number;ue.exports={name:"Number",structure:{value:String},parse:function(){return{type:"Number",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(B)}},generate:function(V){this.chunk(V.value)}}},7249:function(ue){ue.exports={name:"Operator",structure:{value:String},parse:function(){var f=this.scanner.tokenStart;return this.scanner.next(),{type:"Operator",loc:this.getLocation(f,this.scanner.tokenStart),value:this.scanner.substrToCursor(f)}},generate:function(f){this.chunk(f.value)}}},34875:function(ue,q,f){var B=f(97555).TYPE,U=B.LeftParenthesis,V=B.RightParenthesis;ue.exports={name:"Parentheses",structure:{children:[[]]},parse:function(w,N){var _,b=this.scanner.tokenStart;return this.eat(U),_=w.call(this,N),this.scanner.eof||this.eat(V),{type:"Parentheses",loc:this.getLocation(b,this.scanner.tokenStart),children:_}},generate:function(w){this.chunk("("),this.children(w),this.chunk(")")}}},62173:function(ue,q,f){var B=f(74586).consumeNumber,V=f(97555).TYPE.Percentage;ue.exports={name:"Percentage",structure:{value:String},parse:function(){var w=this.scanner.tokenStart,N=B(this.scanner.source,w);return this.eat(V),{type:"Percentage",loc:this.getLocation(w,this.scanner.tokenStart),value:this.scanner.source.substring(w,N)}},generate:function(w){this.chunk(w.value),this.chunk("%")}}},38887:function(ue,q,f){var B=f(97555).TYPE,U=B.Ident,V=B.Function,Z=B.Colon,w=B.RightParenthesis;ue.exports={name:"PseudoClassSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var I,D,b=this.scanner.tokenStart,_=null;return this.eat(Z),this.scanner.tokenType===V?(D=(I=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(D)?(this.scanner.skipSC(),_=this.pseudo[D].call(this),this.scanner.skipSC()):(_=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(w)):I=this.consume(U),{type:"PseudoClassSelector",loc:this.getLocation(b,this.scanner.tokenStart),name:I,children:_}},generate:function(b){this.chunk(":"),this.chunk(b.name),null!==b.children&&(this.chunk("("),this.children(b),this.chunk(")"))},walkContext:"function"}},78076:function(ue,q,f){var B=f(97555).TYPE,U=B.Ident,V=B.Function,Z=B.Colon,w=B.RightParenthesis;ue.exports={name:"PseudoElementSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var I,D,b=this.scanner.tokenStart,_=null;return this.eat(Z),this.eat(Z),this.scanner.tokenType===V?(D=(I=this.consumeFunctionName()).toLowerCase(),this.pseudo.hasOwnProperty(D)?(this.scanner.skipSC(),_=this.pseudo[D].call(this),this.scanner.skipSC()):(_=this.createList()).push(this.Raw(this.scanner.tokenIndex,null,!1)),this.eat(w)):I=this.consume(U),{type:"PseudoElementSelector",loc:this.getLocation(b,this.scanner.tokenStart),name:I,children:_}},generate:function(b){this.chunk("::"),this.chunk(b.name),null!==b.children&&(this.chunk("("),this.children(b),this.chunk(")"))},walkContext:"function"}},15482:function(ue,q,f){var B=f(97555).isDigit,U=f(97555).TYPE,V=U.Number,Z=U.Delim;function b(){this.scanner.skipWS();for(var _=this.consume(V),I=0;I<_.length;I++){var D=_.charCodeAt(I);!B(D)&&46!==D&&this.error("Unsigned number is expected",this.scanner.tokenStart-_.length+I)}return 0===Number(_)&&this.error("Zero number is not allowed",this.scanner.tokenStart-_.length),_}ue.exports={name:"Ratio",structure:{left:String,right:String},parse:function(){var A,I=this.scanner.tokenStart,D=b.call(this);return this.scanner.skipWS(),this.scanner.isDelim(47)||this.error("Solidus is expected"),this.eat(Z),A=b.call(this),{type:"Ratio",loc:this.getLocation(I,this.scanner.tokenStart),left:D,right:A}},generate:function(I){this.chunk(I.left),this.chunk("/"),this.chunk(I.right)}}},89604:function(ue,q,f){var U=f(97555).TYPE,V=U.WhiteSpace,Z=U.Semicolon,w=U.LeftCurlyBracket,N=U.Delim;function _(){return this.scanner.tokenIndex>0&&this.scanner.lookupType(-1)===V?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function I(){return 0}ue.exports={name:"Raw",structure:{value:String},parse:function(T,R,k){var x,E=this.scanner.getTokenStart(T);return this.scanner.skip(this.scanner.getRawLength(T,R||I)),x=k&&this.scanner.tokenStart>E?_.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(E,x),value:this.scanner.source.substring(E,x)}},generate:function(T){this.chunk(T.value)},mode:{default:I,leftCurlyBracket:function(g){return g===w?1:0},leftCurlyBracketOrSemicolon:function(g){return g===w||g===Z?1:0},exclamationMarkOrSemicolon:function(g,T,R){return g===N&&33===T.charCodeAt(R)||g===Z?1:0},semicolonIncluded:function(g){return g===Z?2:0}}}},56064:function(ue,q,f){var B=f(97555).TYPE,U=f(89604).mode,V=B.LeftCurlyBracket;function Z(N){return this.Raw(N,U.leftCurlyBracket,!0)}function w(){var N=this.SelectorList();return"Raw"!==N.type&&!1===this.scanner.eof&&this.scanner.tokenType!==V&&this.error(),N}ue.exports={name:"Rule",structure:{prelude:["SelectorList","Raw"],block:["Block"]},parse:function(){var I,D,b=this.scanner.tokenIndex,_=this.scanner.tokenStart;return I=this.parseRulePrelude?this.parseWithFallback(w,Z):Z.call(this,b),D=this.Block(!0),{type:"Rule",loc:this.getLocation(_,this.scanner.tokenStart),prelude:I,block:D}},generate:function(b){this.node(b.prelude),this.node(b.block)},walkContext:"rule"}},43042:function(ue){ue.exports={name:"Selector",structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]},parse:function(){var f=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(f)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(f),children:f}},generate:function(f){this.children(f)}}},38444:function(ue,q,f){var U=f(97555).TYPE.Comma;ue.exports={name:"SelectorList",structure:{children:[["Selector","Raw"]]},parse:function(){for(var Z=this.createList();!this.scanner.eof&&(Z.push(this.Selector()),this.scanner.tokenType===U);)this.scanner.next();return{type:"SelectorList",loc:this.getLocationFromList(Z),children:Z}},generate:function(Z){this.children(Z,function(){this.chunk(",")})},walkContext:"selector"}},12565:function(ue,q,f){var B=f(97555).TYPE.String;ue.exports={name:"String",structure:{value:String},parse:function(){return{type:"String",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(B)}},generate:function(V){this.chunk(V.value)}}},91348:function(ue,q,f){var B=f(97555).TYPE,U=B.WhiteSpace,V=B.Comment,Z=B.AtKeyword,w=B.CDO,N=B.CDC;function _(I){return this.Raw(I,null,!1)}ue.exports={name:"StyleSheet",structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},parse:function(){for(var S,D=this.scanner.tokenStart,A=this.createList();!this.scanner.eof;){switch(this.scanner.tokenType){case U:this.scanner.next();continue;case V:if(33!==this.scanner.source.charCodeAt(this.scanner.tokenStart+2)){this.scanner.next();continue}S=this.Comment();break;case w:S=this.CDO();break;case N:S=this.CDC();break;case Z:S=this.parseWithFallback(this.Atrule,_);break;default:S=this.parseWithFallback(this.Rule,_)}A.push(S)}return{type:"StyleSheet",loc:this.getLocation(D,this.scanner.tokenStart),children:A}},generate:function(D){this.children(D)},walkContext:"stylesheet"}},16983:function(ue,q,f){var U=f(97555).TYPE.Ident;function w(){this.scanner.tokenType!==U&&!1===this.scanner.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.scanner.next()}ue.exports={name:"TypeSelector",structure:{name:String},parse:function(){var b=this.scanner.tokenStart;return this.scanner.isDelim(124)?(this.scanner.next(),w.call(this)):(w.call(this),this.scanner.isDelim(124)&&(this.scanner.next(),w.call(this))),{type:"TypeSelector",loc:this.getLocation(b,this.scanner.tokenStart),name:this.scanner.substrToCursor(b)}},generate:function(b){this.chunk(b.name)}}},95616:function(ue,q,f){var B=f(97555).isHexDigit,U=f(97555).cmpChar,V=f(97555).TYPE,Z=f(97555).NAME,w=V.Ident,N=V.Number,b=V.Dimension;function S(R,k){for(var E=this.scanner.tokenStart+R,x=0;E6&&this.error("Too many hex digits",E)}return this.scanner.next(),x}function v(R){for(var k=0;this.scanner.isDelim(63);)++k>R&&this.error("Too many question marks"),this.scanner.next()}function g(R){this.scanner.source.charCodeAt(this.scanner.tokenStart)!==R&&this.error(Z[R]+" is expected")}function T(){var R=0;return this.scanner.isDelim(43)?(this.scanner.next(),this.scanner.tokenType===w?void((R=S.call(this,0,!0))>0&&v.call(this,6-R)):this.scanner.isDelim(63)?(this.scanner.next(),void v.call(this,5)):void this.error("Hex digit or question mark is expected")):this.scanner.tokenType===N?(g.call(this,43),R=S.call(this,1,!0),this.scanner.isDelim(63)?void v.call(this,6-R):this.scanner.tokenType===b||this.scanner.tokenType===N?(g.call(this,45),void S.call(this,1,!1)):void 0):this.scanner.tokenType===b?(g.call(this,43),void((R=S.call(this,1,!0))>0&&v.call(this,6-R))):void this.error()}ue.exports={name:"UnicodeRange",structure:{value:String},parse:function(){var k=this.scanner.tokenStart;return U(this.scanner.source,k,117)||this.error("U is expected"),U(this.scanner.source,k+1,43)||this.error("Plus sign is expected"),this.scanner.next(),T.call(this),{type:"UnicodeRange",loc:this.getLocation(k,this.scanner.tokenStart),value:this.scanner.substrToCursor(k)}},generate:function(k){this.chunk(k.value)}}},72796:function(ue,q,f){var B=f(97555).isWhiteSpace,U=f(97555).cmpStr,V=f(97555).TYPE,Z=V.Function,w=V.Url,N=V.RightParenthesis;ue.exports={name:"Url",structure:{value:["String","Raw"]},parse:function(){var I,_=this.scanner.tokenStart;switch(this.scanner.tokenType){case w:for(var D=_+4,A=this.scanner.tokenEnd-1;D=48&&E<=57}function U(E){return E>=65&&E<=90}function V(E){return E>=97&&E<=122}function Z(E){return U(E)||V(E)}function w(E){return E>=128}function N(E){return Z(E)||w(E)||95===E}function _(E){return E>=0&&E<=8||11===E||E>=14&&E<=31||127===E}function I(E){return 10===E||13===E||12===E}function D(E){return I(E)||32===E||9===E}function A(E,x){return!(92!==E||I(x)||0===x)}var T=new Array(128);k.Eof=128,k.WhiteSpace=130,k.Digit=131,k.NameStart=132,k.NonPrintable=133;for(var R=0;R=65&&E<=70||E>=97&&E<=102},isUppercaseLetter:U,isLowercaseLetter:V,isLetter:Z,isNonAscii:w,isNameStart:N,isName:function(E){return N(E)||f(E)||45===E},isNonPrintable:_,isNewline:I,isWhiteSpace:D,isValidEscape:A,isIdentifierStart:function(E,x,O){return 45===E?N(x)||45===x||A(x,O):!!N(E)||92===E&&A(E,x)},isNumberStart:function(E,x,O){return 43===E||45===E?f(x)?2:46===x&&f(O)?3:0:46===E?f(x)?2:0:f(E)?1:0},isBOM:function(E){return 65279===E||65534===E?1:0},charCodeCategory:k}},97077:function(ue){var q={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},f=Object.keys(q).reduce(function(B,U){return B[q[U]]=U,B},{});ue.exports={TYPE:q,NAME:f}},97555:function(ue,q,f){var B=f(13146),U=f(62146),V=f(97077),Z=V.TYPE,w=f(88312),N=w.isNewline,b=w.isName,_=w.isValidEscape,I=w.isNumberStart,D=w.isIdentifierStart,A=w.charCodeCategory,S=w.isBOM,v=f(74586),g=v.cmpStr,T=v.getNewlineLength,R=v.findWhiteSpaceEnd,k=v.consumeEscaped,E=v.consumeName,x=v.consumeNumber,O=v.consumeBadUrlRemnants,F=16777215,z=24;function K(j,J){function ee(je){return je=j.length?void(qe>z,Ae[be]=Ft,Ae[Ft++]=be;Ftx.length)return!1;for(var K=O;K=0&&N(x.charCodeAt(O));O--);return O+1},findWhiteSpaceEnd:function(x,O){for(;O=2&&45===b.charCodeAt(_)&&45===b.charCodeAt(_+1)}function Z(b,_){if(b.length-(_=_||0)>=3&&45===b.charCodeAt(_)&&45!==b.charCodeAt(_+1)){var I=b.indexOf("-",_+2);if(-1!==I)return b.substring(_,I+1)}return""}ue.exports={keyword:function(b){if(q.call(f,b))return f[b];var _=b.toLowerCase();if(q.call(f,_))return f[b]=f[_];var I=V(_,0),D=I?"":Z(_,0);return f[b]=Object.freeze({basename:_.substr(D.length),name:_,vendor:D,prefix:D,custom:I})},property:function(b){if(q.call(B,b))return B[b];var _=b,I=b[0];"/"===I?I="/"===b[1]?"//":"/":"_"!==I&&"*"!==I&&"$"!==I&&"#"!==I&&"+"!==I&&"&"!==I&&(I="");var D=V(_,I.length);if(!D&&(_=_.toLowerCase(),q.call(B,_)))return B[b]=B[_];var A=D?"":Z(_,I.length),S=_.substr(0,I.length+A.length);return B[b]=Object.freeze({basename:_.substr(S.length),name:_.substr(I.length),hack:I,vendor:A,prefix:S,custom:D})},isCustomProperty:V,vendorPrefix:Z}},24523:function(ue){var q=Object.prototype.hasOwnProperty,f=function(){};function B(b){return"function"==typeof b?b:f}function U(b,_){return function(I,D,A){I.type===_&&b.call(this,I,D,A)}}function V(b,_){var I=_.structure,D=[];for(var A in I)if(!1!==q.call(I,A)){var S=I[A],v={name:A,type:!1,nullable:!1};Array.isArray(I[A])||(S=[I[A]]);for(var g=0;g=0;)g++;if("::"===S.substr(0,2)&&g--,"::"===S.substr(-2,2)&&g--,g>v)return null;for(E=v-g,k=":";E--;)k+="0:";return":"===(S=S.replace("::",k))[0]&&(S=S.slice(1)),":"===S[S.length-1]&&(S=S.slice(0,-1)),{parts:v=function(){for(var x=S.split(":"),O=[],F=0;F0;){if((k=g-T)<0&&(k=0),S[R]>>k!=v[R]>>k)return!1;T-=g,R+=1}return!0}function I(S){if(V.test(S))return parseInt(S,16);if("0"===S[0]&&!isNaN(parseInt(S[1],10))){if(U.test(S))return parseInt(S,8);throw new Error("ipaddr: cannot parse ".concat(S," as octal"))}return parseInt(S,10)}function D(S,v){for(;S.length=0;R-=1){if(!((k=this.octets[R])in T))return null;if(E=T[k],g&&0!==E)return null;8!==E&&(g=!0),v+=E}return 32-v},S.prototype.range=function(){return A.subnetMatch(this,this.SpecialRanges)},S.prototype.toByteArray=function(){return this.octets.slice(0)},S.prototype.toIPv4MappedAddress=function(){return A.IPv6.parse("::ffff:".concat(this.toString()))},S.prototype.toNormalizedString=function(){return this.toString()},S.prototype.toString=function(){return this.octets.join(".")},S}(),A.IPv4.broadcastAddressFromCIDR=function(S){try{for(var v=this.parseCIDR(S),g=v[0].toByteArray(),T=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),R=[],k=0;k<4;)R.push(parseInt(g[k],10)|255^parseInt(T[k],10)),k++;return new this(R)}catch(E){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},A.IPv4.isIPv4=function(S){return null!==this.parser(S)},A.IPv4.isValid=function(S){try{return new this(this.parser(S)),!0}catch(v){return!1}},A.IPv4.isValidFourPartDecimal=function(S){return!(!A.IPv4.isValid(S)||!S.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},A.IPv4.networkAddressFromCIDR=function(S){var v,g,T,R,k;try{for(T=(v=this.parseCIDR(S))[0].toByteArray(),k=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),R=[],g=0;g<4;)R.push(parseInt(T[g],10)&parseInt(k[g],10)),g++;return new this(R)}catch(E){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},A.IPv4.parse=function(S){var v=this.parser(S);if(null===v)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(v)},A.IPv4.parseCIDR=function(S){var v;if(v=S.match(/^(.+)\/(\d+)$/)){var g=parseInt(v[2]);if(g>=0&&g<=32){var T=[this.parse(v[1]),g];return Object.defineProperty(T,"toString",{value:function(){return this.join("/")}}),T}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},A.IPv4.parser=function(S){var v,T;if(v=S.match(B.fourOctet))return function(){for(var R=v.slice(1,6),k=[],E=0;E4294967295||T<0)throw new Error("ipaddr: address outside defined range");return function(){var k,R=[];for(k=0;k<=24;k+=8)R.push(T>>k&255);return R}().reverse()}return(v=S.match(B.twoOctet))?function(){var R=v.slice(1,4),k=[];if((T=I(R[1]))>16777215||T<0)throw new Error("ipaddr: address outside defined range");return k.push(I(R[0])),k.push(T>>16&255),k.push(T>>8&255),k.push(255&T),k}():(v=S.match(B.threeOctet))?function(){var R=v.slice(1,5),k=[];if((T=I(R[2]))>65535||T<0)throw new Error("ipaddr: address outside defined range");return k.push(I(R[0])),k.push(I(R[1])),k.push(T>>8&255),k.push(255&T),k}():null},A.IPv4.subnetMaskFromPrefixLength=function(S){if((S=parseInt(S))<0||S>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(var v=[0,0,0,0],g=0,T=Math.floor(S/8);g=0;E-=1){if(!((R=this.parts[E])in T))return null;if(k=T[R],g&&0!==k)return null;16!==k&&(g=!0),v+=k}return 128-v},S.prototype.range=function(){return A.subnetMatch(this,this.SpecialRanges)},S.prototype.toByteArray=function(){for(var v,g=[],T=this.parts,R=0;R>8),g.push(255&v);return g},S.prototype.toFixedLengthString=function(){var v=function(){for(var T=[],R=0;R>8,255&g,T>>8,255&T])},S.prototype.toNormalizedString=function(){var v=function(){for(var T=[],R=0;RR&&(T=k.index,R=k[0].length);return R<0?g:"".concat(g.substring(0,T),"::").concat(g.substring(T+R))},S.prototype.toString=function(){return this.toRFC5952String()},S}(),A.IPv6.broadcastAddressFromCIDR=function(S){try{for(var v=this.parseCIDR(S),g=v[0].toByteArray(),T=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),R=[],k=0;k<16;)R.push(parseInt(g[k],10)|255^parseInt(T[k],10)),k++;return new this(R)}catch(E){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(E,")"))}},A.IPv6.isIPv6=function(S){return null!==this.parser(S)},A.IPv6.isValid=function(S){if("string"==typeof S&&-1===S.indexOf(":"))return!1;try{var v=this.parser(S);return new this(v.parts,v.zoneId),!0}catch(g){return!1}},A.IPv6.networkAddressFromCIDR=function(S){var v,g,T,R,k;try{for(T=(v=this.parseCIDR(S))[0].toByteArray(),k=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),R=[],g=0;g<16;)R.push(parseInt(T[g],10)&parseInt(k[g],10)),g++;return new this(R)}catch(E){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(E,")"))}},A.IPv6.parse=function(S){var v=this.parser(S);if(null===v.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(v.parts,v.zoneId)},A.IPv6.parseCIDR=function(S){var v,g,T;if((g=S.match(/^(.+)\/(\d+)$/))&&(v=parseInt(g[2]))>=0&&v<=128)return T=[this.parse(g[1]),v],Object.defineProperty(T,"toString",{value:function(){return this.join("/")}}),T;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},A.IPv6.parser=function(S){var v,g,T,R,k,E;if(T=S.match(N.deprecatedTransitional))return this.parser("::ffff:".concat(T[1]));if(N.native.test(S))return b(S,8);if((T=S.match(N.transitional))&&(E=T[6]||"",(v=b(T[1].slice(0,-1)+E,6)).parts)){for(k=[parseInt(T[2]),parseInt(T[3]),parseInt(T[4]),parseInt(T[5])],g=0;g128)throw new Error("ipaddr: invalid IPv6 prefix length");for(var v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,T=Math.floor(S/8);g":".","?":"/","|":"\\"},_={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},D=1;D<20;++D)w[111+D]="f"+D;for(D=0;D<=9;++D)w[D+96]=D.toString();K.prototype.bind=function(j,J,ee){var $=this;return $._bindMultiple.call($,j=j instanceof Array?j:[j],J,ee),$},K.prototype.unbind=function(j,J){return this.bind.call(this,j,function(){},J)},K.prototype.trigger=function(j,J){return this._directMap[j+":"+J]&&this._directMap[j+":"+J]({},j),this},K.prototype.reset=function(){var j=this;return j._callbacks={},j._directMap={},j},K.prototype.stopCallback=function(j,J){if((" "+J.className+" ").indexOf(" mousetrap ")>-1||z(J,this.target))return!1;if("composedPath"in j&&"function"==typeof j.composedPath){var $=j.composedPath()[0];$!==j.target&&(J=$)}return"INPUT"==J.tagName||"SELECT"==J.tagName||"TEXTAREA"==J.tagName||J.isContentEditable},K.prototype.handleKey=function(){var j=this;return j._handleKey.apply(j,arguments)},K.addKeycodes=function(j){for(var J in j)j.hasOwnProperty(J)&&(w[J]=j[J]);I=null},K.init=function(){var j=K(V);for(var J in j)"_"!==J.charAt(0)&&(K[J]=function(ee){return function(){return j[ee].apply(j,arguments)}}(J))},K.init(),U.Mousetrap=K,ue.exports&&(ue.exports=K),void 0!==(B=function(){return K}.call(q,f,q,ue))&&(ue.exports=B)}function A(j,J,ee){j.addEventListener?j.addEventListener(J,ee,!1):j.attachEvent("on"+J,ee)}function S(j){if("keypress"==j.type){var J=String.fromCharCode(j.which);return j.shiftKey||(J=J.toLowerCase()),J}return w[j.which]?w[j.which]:N[j.which]?N[j.which]:String.fromCharCode(j.which).toLowerCase()}function v(j,J){return j.sort().join(",")===J.sort().join(",")}function k(j){return"shift"==j||"ctrl"==j||"alt"==j||"meta"==j}function x(j,J,ee){return ee||(ee=function(){if(!I)for(var j in I={},w)j>95&&j<112||w.hasOwnProperty(j)&&(I[w[j]]=j);return I}()[j]?"keydown":"keypress"),"keypress"==ee&&J.length&&(ee="keydown"),ee}function F(j,J){var ee,$,ae,se=[];for(ee=function(j){return"+"===j?["+"]:(j=j.replace(/\+{2}/g,"+plus")).split("+")}(j),ae=0;ae1?function(yt,Ft,xe,De){function je(vt){return function(){ce=vt,++ee[yt],clearTimeout($),$=setTimeout(le,1e3)}}function dt(vt){Ae(xe,vt,yt),"keyup"!==De&&(ae=S(vt)),setTimeout(le,10)}ee[yt]=0;for(var Ke=0;Ke=0;--qe){var _t=this.tryEntries[qe],yt=_t.completion;if("root"===_t.tryLoc)return it("end");if(_t.tryLoc<=this.prev){var Ft=U.call(_t,"catchLoc"),xe=U.call(_t,"finallyLoc");if(Ft&&xe){if(this.prev<_t.catchLoc)return it(_t.catchLoc,!0);if(this.prev<_t.finallyLoc)return it(_t.finallyLoc)}else if(Ft){if(this.prev<_t.catchLoc)return it(_t.catchLoc,!0)}else{if(!xe)throw new Error("try statement without catch or finally");if(this.prev<_t.finallyLoc)return it(_t.finallyLoc)}}}},abrupt:function(Ae,be){for(var it=this.tryEntries.length-1;it>=0;--it){var qe=this.tryEntries[it];if(qe.tryLoc<=this.prev&&U.call(qe,"finallyLoc")&&this.prev=0;--be){var it=this.tryEntries[be];if(it.finallyLoc===Ae)return this.complete(it.completion,it.afterLoc),ae(it),T}},catch:function(Ae){for(var be=this.tryEntries.length-1;be>=0;--be){var it=this.tryEntries[be];if(it.tryLoc===Ae){var qe=it.completion;if("throw"===qe.type){var _t=qe.arg;ae(it)}return _t}}throw new Error("illegal catch attempt")},delegateYield:function(Ae,be,it){return this.delegate={iterator:ce(Ae),resultName:be,nextLoc:it},"next"===this.method&&(this.arg=V),T}},f}(ue.exports);try{regeneratorRuntime=q}catch(f){"object"==typeof globalThis?globalThis.regeneratorRuntime=q:Function("r","regeneratorRuntime = r")(q)}},56938:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);q.Observable=B.Observable,q.Subject=B.Subject;var U=f(37294);q.AnonymousSubject=U.AnonymousSubject;var V=f(37294);q.config=V.config,f(26598),f(87663),f(95351),f(66981),f(31881),f(36800),f(52413),f(86376),f(41029),f(30918),f(79817),f(29023),f(48668),f(61975),f(92442),f(42697),f(63990),f(86230),f(61201),f(32171),f(40439),f(69079),f(9222),f(52357),f(36294),f(12782),f(94618),f(93231),f(96547),f(62374),f(35595),f(57540),f(97010),f(56518),f(59982),f(70198),f(3943),f(95297),f(53842),f(46085),f(46753),f(12452),f(51341),f(41575),f(42657),f(17109),f(89716),f(71255),f(75197),f(70992),f(3106),f(54506),f(16161),f(11405),f(37132),f(45396),f(41154),f(96986),f(67259),f(89015),f(57301),f(4993),f(77490),f(4533),f(42215),f(95564),f(61431),f(68663),f(63566),f(62729),f(48483),f(32979),f(78104),f(64259),f(30336),f(46315),f(60771),f(92700),f(43545),f(89242),f(70177),f(43800),f(33434),f(37179),f(97810),f(27430),f(44633),f(37953),f(58435),f(14234),f(98741),f(43263),f(57180),f(87700),f(34860),f(67751),f(63733),f(38596),f(20038),f(58186),f(77538),f(33866),f(1676),f(3018),f(58003),f(77394),f(92947),f(27971),f(33934),f(43126),f(6320),f(96813),f(20425),f(70140),f(32035),f(49421),f(9693),f(87276),f(63934),f(17360),f(37222),f(55214),f(22854),f(65259),f(84715),f(27798),f(98441),f(56238),f(42145);var Z=f(94117);q.Subscription=Z.Subscription,q.ReplaySubject=Z.ReplaySubject,q.BehaviorSubject=Z.BehaviorSubject,q.Notification=Z.Notification,q.EmptyError=Z.EmptyError,q.ArgumentOutOfRangeError=Z.ArgumentOutOfRangeError,q.ObjectUnsubscribedError=Z.ObjectUnsubscribedError,q.UnsubscriptionError=Z.UnsubscriptionError,q.pipe=Z.pipe;var w=f(53520);q.TestScheduler=w.TestScheduler;var N=f(94117);q.Subscriber=N.Subscriber,q.AsyncSubject=N.AsyncSubject,q.ConnectableObservable=N.ConnectableObservable,q.TimeoutError=N.TimeoutError,q.VirtualTimeScheduler=N.VirtualTimeScheduler;var b=f(55905);q.AjaxResponse=b.AjaxResponse,q.AjaxError=b.AjaxError,q.AjaxTimeoutError=b.AjaxTimeoutError;var _=f(94117),I=f(37294),D=f(37294);q.TimeInterval=D.TimeInterval,q.Timestamp=D.Timestamp;var A=f(73033);q.operators=A,q.Scheduler={asap:_.asapScheduler,queue:_.queueScheduler,animationFrame:_.animationFrameScheduler,async:_.asyncScheduler},q.Symbol={rxSubscriber:I.rxSubscriber,observable:I.observable,iterator:I.iterator}},26598:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.bindCallback=B.bindCallback},87663:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.bindNodeCallback=B.bindNodeCallback},95351:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.combineLatest=B.combineLatest},66981:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.concat=B.concat},31881:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.defer=B.defer},12782:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(55905);B.Observable.ajax=U.ajax},94618:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(4194);B.Observable.webSocket=U.webSocket},36800:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.empty=B.empty},52413:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.forkJoin=B.forkJoin},86376:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.from=B.from},41029:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.fromEvent=B.fromEvent},30918:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.fromEventPattern=B.fromEventPattern},79817:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.fromPromise=B.from},29023:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.generate=B.generate},48668:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.if=B.iif},61975:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.interval=B.interval},92442:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.merge=B.merge},63990:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);function U(){return B.NEVER}q.staticNever=U,B.Observable.never=U},86230:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.of=B.of},61201:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.onErrorResumeNext=B.onErrorResumeNext},32171:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.pairs=B.pairs},42697:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.race=B.race},40439:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.range=B.range},9222:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.throw=B.throwError,B.Observable.throwError=B.throwError},52357:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.timer=B.timer},69079:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.using=B.using},36294:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117);B.Observable.zip=B.zip},77490:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(20325);B.Observable.prototype.audit=U.audit},4533:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(55702);B.Observable.prototype.auditTime=U.auditTime},93231:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(19931);B.Observable.prototype.buffer=U.buffer},96547:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(38173);B.Observable.prototype.bufferCount=U.bufferCount},62374:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(93690);B.Observable.prototype.bufferTime=U.bufferTime},35595:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(79681);B.Observable.prototype.bufferToggle=U.bufferToggle},57540:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(75311);B.Observable.prototype.bufferWhen=U.bufferWhen},97010:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(26306);B.Observable.prototype.catch=U._catch,B.Observable.prototype._catch=U._catch},56518:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(15869);B.Observable.prototype.combineAll=U.combineAll},59982:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(23265);B.Observable.prototype.combineLatest=U.combineLatest},70198:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(31179);B.Observable.prototype.concat=U.concat},3943:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(16148);B.Observable.prototype.concatAll=U.concatAll},95297:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(28552);B.Observable.prototype.concatMap=U.concatMap},53842:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(91798);B.Observable.prototype.concatMapTo=U.concatMapTo},46085:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(93653);B.Observable.prototype.count=U.count},12452:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(36477);B.Observable.prototype.debounce=U.debounce},51341:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(61529);B.Observable.prototype.debounceTime=U.debounceTime},41575:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(64502);B.Observable.prototype.defaultIfEmpty=U.defaultIfEmpty},42657:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(33674);B.Observable.prototype.delay=U.delay},17109:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(49477);B.Observable.prototype.delayWhen=U.delayWhen},46753:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(21941);B.Observable.prototype.dematerialize=U.dematerialize},89716:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(18053);B.Observable.prototype.distinct=U.distinct},71255:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(13598);B.Observable.prototype.distinctUntilChanged=U.distinctUntilChanged},75197:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(94936);B.Observable.prototype.distinctUntilKeyChanged=U.distinctUntilKeyChanged},70992:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(21790);B.Observable.prototype.do=U._do,B.Observable.prototype._do=U._do},11405:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(2538);B.Observable.prototype.elementAt=U.elementAt},61431:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(58136);B.Observable.prototype.every=U.every},3106:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(26734);B.Observable.prototype.exhaust=U.exhaust},54506:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(2084);B.Observable.prototype.exhaustMap=U.exhaustMap},16161:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(2945);B.Observable.prototype.expand=U.expand},37132:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(3704);B.Observable.prototype.filter=U.filter},45396:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(58870);B.Observable.prototype.finally=U._finally,B.Observable.prototype._finally=U._finally},41154:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(16201);B.Observable.prototype.find=U.find},96986:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(95148);B.Observable.prototype.findIndex=U.findIndex},67259:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(96050);B.Observable.prototype.first=U.first},89015:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(16309);B.Observable.prototype.groupBy=U.groupBy},57301:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(3640);B.Observable.prototype.ignoreElements=U.ignoreElements},4993:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(87486);B.Observable.prototype.isEmpty=U.isEmpty},42215:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(30274);B.Observable.prototype.last=U.last},95564:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(11668);B.Observable.prototype.let=U.letProto,B.Observable.prototype.letBind=U.letProto},68663:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(23307);B.Observable.prototype.map=U.map},63566:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(3498);B.Observable.prototype.mapTo=U.mapTo},62729:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(70845);B.Observable.prototype.materialize=U.materialize},48483:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(96415);B.Observable.prototype.max=U.max},32979:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(33836);B.Observable.prototype.merge=U.merge},78104:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(58610);B.Observable.prototype.mergeAll=U.mergeAll},64259:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(36098);B.Observable.prototype.mergeMap=U.mergeMap,B.Observable.prototype.flatMap=U.mergeMap},30336:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(53033);B.Observable.prototype.flatMapTo=U.mergeMapTo,B.Observable.prototype.mergeMapTo=U.mergeMapTo},46315:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(11444);B.Observable.prototype.mergeScan=U.mergeScan},60771:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(6626);B.Observable.prototype.min=U.min},92700:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(4291);B.Observable.prototype.multicast=U.multicast},43545:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(37675);B.Observable.prototype.observeOn=U.observeOn},89242:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(92878);B.Observable.prototype.onErrorResumeNext=U.onErrorResumeNext},70177:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(94401);B.Observable.prototype.pairwise=U.pairwise},43800:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(93110);B.Observable.prototype.partition=U.partition},33434:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(53937);B.Observable.prototype.pluck=U.pluck},37179:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(81e3);B.Observable.prototype.publish=U.publish},97810:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(78665);B.Observable.prototype.publishBehavior=U.publishBehavior},44633:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(34696);B.Observable.prototype.publishLast=U.publishLast},27430:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(35543);B.Observable.prototype.publishReplay=U.publishReplay},37953:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(33963);B.Observable.prototype.race=U.race},58435:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(99216);B.Observable.prototype.reduce=U.reduce},14234:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(19613);B.Observable.prototype.repeat=U.repeat},98741:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(72798);B.Observable.prototype.repeatWhen=U.repeatWhen},43263:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(59813);B.Observable.prototype.retry=U.retry},57180:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(5419);B.Observable.prototype.retryWhen=U.retryWhen},87700:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(58693);B.Observable.prototype.sample=U.sample},34860:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(86803);B.Observable.prototype.sampleTime=U.sampleTime},67751:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(65036);B.Observable.prototype.scan=U.scan},63733:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(12201);B.Observable.prototype.sequenceEqual=U.sequenceEqual},38596:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(86892);B.Observable.prototype.share=U.share},20038:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(9050);B.Observable.prototype.shareReplay=U.shareReplay},58186:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(13533);B.Observable.prototype.single=U.single},77538:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(65846);B.Observable.prototype.skip=U.skip},33866:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(90955);B.Observable.prototype.skipLast=U.skipLast},1676:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(75479);B.Observable.prototype.skipUntil=U.skipUntil},3018:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(76841);B.Observable.prototype.skipWhile=U.skipWhile},58003:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(66560);B.Observable.prototype.startWith=U.startWith},77394:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(92265);B.Observable.prototype.subscribeOn=U.subscribeOn},92947:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(41428);B.Observable.prototype.switch=U._switch,B.Observable.prototype._switch=U._switch},27971:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(5193);B.Observable.prototype.switchMap=U.switchMap},33934:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(34022);B.Observable.prototype.switchMapTo=U.switchMapTo},43126:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(204);B.Observable.prototype.take=U.take},6320:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(62299);B.Observable.prototype.takeLast=U.takeLast},96813:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(93542);B.Observable.prototype.takeUntil=U.takeUntil},20425:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(79214);B.Observable.prototype.takeWhile=U.takeWhile},70140:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(35922);B.Observable.prototype.throttle=U.throttle},32035:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(41941);B.Observable.prototype.throttleTime=U.throttleTime},49421:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(99194);B.Observable.prototype.timeInterval=U.timeInterval},9693:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(53358);B.Observable.prototype.timeout=U.timeout},87276:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(41237);B.Observable.prototype.timeoutWith=U.timeoutWith},63934:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(84485);B.Observable.prototype.timestamp=U.timestamp},17360:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(23552);B.Observable.prototype.toArray=U.toArray},37222:function(){},55214:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(13977);B.Observable.prototype.window=U.window},22854:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(54052);B.Observable.prototype.windowCount=U.windowCount},65259:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(17884);B.Observable.prototype.windowTime=U.windowTime},84715:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(18835);B.Observable.prototype.windowToggle=U.windowToggle},27798:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(84220);B.Observable.prototype.windowWhen=U.windowWhen},98441:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(41603);B.Observable.prototype.withLatestFrom=U.withLatestFrom},56238:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(83313);B.Observable.prototype.zip=U.zipProto},42145:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(80396);B.Observable.prototype.zipAll=U.zipAll},20325:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.audit=function(V){return B.audit(V)(this)}},55702:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(73033);q.auditTime=function(Z,w){return void 0===w&&(w=B.asyncScheduler),U.auditTime(Z,w)(this)}},19931:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.buffer=function(V){return B.buffer(V)(this)}},38173:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.bufferCount=function(V,Z){return void 0===Z&&(Z=null),B.bufferCount(V,Z)(this)}},93690:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(37294),V=f(73033);q.bufferTime=function(w){var N=arguments.length,b=B.asyncScheduler;U.isScheduler(arguments[arguments.length-1])&&(b=arguments[arguments.length-1],N--);var _=null;N>=2&&(_=arguments[1]);var I=Number.POSITIVE_INFINITY;return N>=3&&(I=arguments[2]),V.bufferTime(w,_,I,b)(this)}},79681:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.bufferToggle=function(V,Z){return B.bufferToggle(V,Z)(this)}},75311:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.bufferWhen=function(V){return B.bufferWhen(V)(this)}},26306:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q._catch=function(V){return B.catchError(V)(this)}},15869:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.combineAll=function(V){return B.combineAll(V)(this)}},23265:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(37294);q.combineLatest=function(){for(var Z=[],w=0;w=2?B.reduce(V,Z)(this):B.reduce(V)(this)}},19613:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.repeat=function(V){return void 0===V&&(V=-1),B.repeat(V)(this)}},72798:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.repeatWhen=function(V){return B.repeatWhen(V)(this)}},59813:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.retry=function(V){return void 0===V&&(V=-1),B.retry(V)(this)}},5419:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.retryWhen=function(V){return B.retryWhen(V)(this)}},58693:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.sample=function(V){return B.sample(V)(this)}},86803:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(94117),U=f(73033);q.sampleTime=function(Z,w){return void 0===w&&(w=B.asyncScheduler),U.sampleTime(Z,w)(this)}},65036:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.scan=function(V,Z){return arguments.length>=2?B.scan(V,Z)(this):B.scan(V)(this)}},12201:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.sequenceEqual=function(V,Z){return B.sequenceEqual(V,Z)(this)}},86892:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.share=function(){return B.share()(this)}},9050:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.shareReplay=function(V,Z,w){return V&&"object"==typeof V?B.shareReplay(V)(this):B.shareReplay(V,Z,w)(this)}},13533:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.single=function(V){return B.single(V)(this)}},65846:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.skip=function(V){return B.skip(V)(this)}},90955:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.skipLast=function(V){return B.skipLast(V)(this)}},75479:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.skipUntil=function(V){return B.skipUntil(V)(this)}},76841:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.skipWhile=function(V){return B.skipWhile(V)(this)}},66560:function(ue,q,f){"use strict";Object.defineProperty(q,"__esModule",{value:!0});var B=f(73033);q.startWith=function(){for(var V=[],Z=0;Z1&&void 0!==arguments[1]?arguments[1]:dt.E,nn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:dt.E;return(0,je.P)(function(){return Kt()?Jt:nn})}var bt=f(57434),en=f(55371),Nt=new B.y(x.Z);function rn(){return Nt}var kn=f(43161);function Ln(){for(var Kt=arguments.length,Jt=new Array(Kt),nn=0;nn0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,O=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY,F=arguments.length>2?arguments[2]:void 0;return(0,B.Z)(this,k),(E=R.call(this)).scheduler=F,E._events=[],E._infiniteTimeWindow=!1,E._bufferSize=x<1?1:x,E._windowTime=O<1?1:O,O===Number.POSITIVE_INFINITY?(E._infiniteTimeWindow=!0,E.next=E.nextInfiniteTimeWindow):E.next=E.nextTimeWindow,E}return(0,U.Z)(k,[{key:"nextInfiniteTimeWindow",value:function(x){if(!this.isStopped){var O=this._events;O.push(x),O.length>this._bufferSize&&O.shift()}(0,V.Z)((0,Z.Z)(k.prototype),"next",this).call(this,x)}},{key:"nextTimeWindow",value:function(x){this.isStopped||(this._events.push(new g(this._getNow(),x)),this._trimBufferThenGetEvents()),(0,V.Z)((0,Z.Z)(k.prototype),"next",this).call(this,x)}},{key:"_subscribe",value:function(x){var j,O=this._infiniteTimeWindow,F=O?this._events:this._trimBufferThenGetEvents(),z=this.scheduler,K=F.length;if(this.closed)throw new A.N;if(this.isStopped||this.hasError?j=I.w.EMPTY:(this.observers.push(x),j=new S.W(this,x)),z&&x.add(x=new D.ht(x,z)),O)for(var J=0;JO&&(j=Math.max(j,K-O)),j>0&&z.splice(0,j),z}}]),k}(b.xQ),g=function T(R,k){(0,B.Z)(this,T),this.time=R,this.value=k}},67801:function(ue,q,f){"use strict";f.d(q,{b:function(){return V}});var B=f(18967),U=f(14105),V=function(){var Z=function(){function w(N){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w.now;(0,B.Z)(this,w),this.SchedulerAction=N,this.now=b}return(0,U.Z)(w,[{key:"schedule",value:function(b){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,I=arguments.length>2?arguments[2]:void 0;return new this.SchedulerAction(this,b).schedule(I,_)}}]),w}();return Z.now=function(){return Date.now()},Z}()},68707:function(ue,q,f){"use strict";f.d(q,{Yc:function(){return v},xQ:function(){return g},ug:function(){return T}});var B=f(14105),U=f(13920),V=f(89200),Z=f(18967),w=f(10509),N=f(97154),b=f(89797),_=f(39874),I=f(5051),D=f(1696),A=f(18480),S=f(79542),v=function(R){(0,w.Z)(E,R);var k=(0,N.Z)(E);function E(x){var O;return(0,Z.Z)(this,E),(O=k.call(this,x)).destination=x,O}return E}(_.L),g=function(){var R=function(k){(0,w.Z)(x,k);var E=(0,N.Z)(x);function x(){var O;return(0,Z.Z)(this,x),(O=E.call(this)).observers=[],O.closed=!1,O.isStopped=!1,O.hasError=!1,O.thrownError=null,O}return(0,B.Z)(x,[{key:S.b,value:function(){return new v(this)}},{key:"lift",value:function(F){var z=new T(this,this);return z.operator=F,z}},{key:"next",value:function(F){if(this.closed)throw new D.N;if(!this.isStopped)for(var z=this.observers,K=z.length,j=z.slice(),J=0;J1&&void 0!==arguments[1]?arguments[1]:0,T=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.e;return(0,B.Z)(this,A),(v=D.call(this)).source=S,v.delayTime=g,v.scheduler=T,(!(0,b.k)(g)||g<0)&&(v.delayTime=0),(!T||"function"!=typeof T.schedule)&&(v.scheduler=N.e),v}return(0,U.Z)(A,[{key:"_subscribe",value:function(v){return this.scheduler.schedule(A.dispatch,this.delayTime,{source:this.source,subscriber:v})}}],[{key:"create",value:function(v){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,T=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.e;return new A(v,g,T)}},{key:"dispatch",value:function(v){return this.add(v.source.subscribe(v.subscriber))}}]),A}(w.y)},81370:function(ue,q,f){"use strict";f.d(q,{aj:function(){return A},Ms:function(){return S}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(91299),N=f(78985),b=f(7283),_=f(61454),I=f(80503),D={};function A(){for(var g=arguments.length,T=new Array(g),R=0;R1&&void 0!==arguments[1]?arguments[1]:null;return new O({method:"GET",url:se,headers:ce})}function g(se,ce,le){return new O({method:"POST",url:se,body:ce,headers:le})}function T(se,ce){return new O({method:"DELETE",url:se,headers:ce})}function R(se,ce,le){return new O({method:"PUT",url:se,body:ce,headers:le})}function k(se,ce,le){return new O({method:"PATCH",url:se,body:ce,headers:le})}var E=(0,f(85639).U)(function(se,ce){return se.response});function x(se,ce){return E(new O({method:"GET",url:se,responseType:"json",headers:ce}))}var O=function(){var se=function(ce){(0,w.Z)(oe,ce);var le=(0,N.Z)(oe);function oe(Ae){var be;(0,V.Z)(this,oe),be=le.call(this);var it={async:!0,createXHR:function(){return this.crossDomain?function(){if(b.J.XMLHttpRequest)return new b.J.XMLHttpRequest;if(b.J.XDomainRequest)return new b.J.XDomainRequest;throw new Error("CORS is not supported by your browser")}():function(){if(b.J.XMLHttpRequest)return new b.J.XMLHttpRequest;var se;try{for(var ce=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],le=0;le<3;le++)try{if(new b.J.ActiveXObject(se=ce[le]))break}catch(oe){}return new b.J.ActiveXObject(se)}catch(oe){throw new Error("XMLHttpRequest is not supported by your browser")}}()},crossDomain:!0,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof Ae)it.url=Ae;else for(var qe in Ae)Ae.hasOwnProperty(qe)&&(it[qe]=Ae[qe]);return be.request=it,be}return(0,Z.Z)(oe,[{key:"_subscribe",value:function(be){return new F(be,this.request)}}]),oe}(_.y);return se.create=function(){var ce=function(oe){return new se(oe)};return ce.get=v,ce.post=g,ce.delete=T,ce.put=R,ce.patch=k,ce.getJSON=x,ce}(),se}(),F=function(se){(0,w.Z)(le,se);var ce=(0,N.Z)(le);function le(oe,Ae){var be;(0,V.Z)(this,le),(be=ce.call(this,oe)).request=Ae,be.done=!1;var it=Ae.headers=Ae.headers||{};return!Ae.crossDomain&&!be.getHeader(it,"X-Requested-With")&&(it["X-Requested-With"]="XMLHttpRequest"),!be.getHeader(it,"Content-Type")&&!(b.J.FormData&&Ae.body instanceof b.J.FormData)&&void 0!==Ae.body&&(it["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),Ae.body=be.serializeBody(Ae.body,be.getHeader(Ae.headers,"Content-Type")),be.send(),be}return(0,Z.Z)(le,[{key:"next",value:function(Ae){this.done=!0;var _t,be=this.xhr,it=this.request,qe=this.destination;try{_t=new z(Ae,be,it)}catch(yt){return qe.error(yt)}qe.next(_t)}},{key:"send",value:function(){var Ae=this.request,be=this.request,it=be.user,qe=be.method,_t=be.url,yt=be.async,Ft=be.password,xe=be.headers,De=be.body;try{var je=this.xhr=Ae.createXHR();this.setupEvents(je,Ae),it?je.open(qe,_t,yt,it,Ft):je.open(qe,_t,yt),yt&&(je.timeout=Ae.timeout,je.responseType=Ae.responseType),"withCredentials"in je&&(je.withCredentials=!!Ae.withCredentials),this.setHeaders(je,xe),De?je.send(De):je.send()}catch(dt){this.error(dt)}}},{key:"serializeBody",value:function(Ae,be){if(!Ae||"string"==typeof Ae)return Ae;if(b.J.FormData&&Ae instanceof b.J.FormData)return Ae;if(be){var it=be.indexOf(";");-1!==it&&(be=be.substring(0,it))}switch(be){case"application/x-www-form-urlencoded":return Object.keys(Ae).map(function(qe){return"".concat(encodeURIComponent(qe),"=").concat(encodeURIComponent(Ae[qe]))}).join("&");case"application/json":return JSON.stringify(Ae);default:return Ae}}},{key:"setHeaders",value:function(Ae,be){for(var it in be)be.hasOwnProperty(it)&&Ae.setRequestHeader(it,be[it])}},{key:"getHeader",value:function(Ae,be){for(var it in Ae)if(it.toLowerCase()===be.toLowerCase())return Ae[it]}},{key:"setupEvents",value:function(Ae,be){var _t,yt,it=be.progressSubscriber;function qe(De){var Bt,je=qe.subscriber,dt=qe.progressSubscriber,Ke=qe.request;dt&&dt.error(De);try{Bt=new ae(this,Ke)}catch(xt){Bt=xt}je.error(Bt)}(Ae.ontimeout=qe,qe.request=be,qe.subscriber=this,qe.progressSubscriber=it,Ae.upload&&"withCredentials"in Ae)&&(it&&(_t=function(je){_t.progressSubscriber.next(je)},b.J.XDomainRequest?Ae.onprogress=_t:Ae.upload.onprogress=_t,_t.progressSubscriber=it),Ae.onerror=yt=function(je){var vt,Ke=yt.progressSubscriber,Bt=yt.subscriber,xt=yt.request;Ke&&Ke.error(je);try{vt=new j("ajax error",this,xt)}catch(Qt){vt=Qt}Bt.error(vt)},yt.request=be,yt.subscriber=this,yt.progressSubscriber=it);function Ft(De){}function xe(De){var je=xe.subscriber,dt=xe.progressSubscriber,Ke=xe.request;if(4===this.readyState){var Bt=1223===this.status?204:this.status;if(0===Bt&&(Bt=("text"===this.responseType?this.response||this.responseText:this.response)?200:0),Bt<400)dt&&dt.complete(),je.next(De),je.complete();else{var vt;dt&&dt.error(De);try{vt=new j("ajax error "+Bt,this,Ke)}catch(Qt){vt=Qt}je.error(vt)}}}Ae.onreadystatechange=Ft,Ft.subscriber=this,Ft.progressSubscriber=it,Ft.request=be,Ae.onload=xe,xe.subscriber=this,xe.progressSubscriber=it,xe.request=be}},{key:"unsubscribe",value:function(){var be=this.xhr;!this.done&&be&&4!==be.readyState&&"function"==typeof be.abort&&be.abort(),(0,B.Z)((0,U.Z)(le.prototype),"unsubscribe",this).call(this)}}]),le}(I.L),z=function se(ce,le,oe){(0,V.Z)(this,se),this.originalEvent=ce,this.xhr=le,this.request=oe,this.status=le.status,this.responseType=le.responseType||oe.responseType,this.response=ee(this.responseType,le)},j=function(){function se(ce,le,oe){return Error.call(this),this.message=ce,this.name="AjaxError",this.xhr=le,this.request=oe,this.status=le.status,this.responseType=le.responseType||oe.responseType,this.response=ee(this.responseType,le),this}return se.prototype=Object.create(Error.prototype),se}();function ee(se,ce){switch(se){case"json":return function(se){return"response"in se?se.responseType?se.response:JSON.parse(se.response||se.responseText||"null"):JSON.parse(se.responseText||"null")}(ce);case"xml":return ce.responseXML;case"text":default:return"response"in ce?ce.response:ce.responseText}}var ae=function(se,ce){return j.call(this,"ajax timeout",se,ce),this.name="AjaxTimeoutError",this}},46095:function(ue,q,f){"use strict";f.d(q,{p:function(){return g}});var B=f(18967),U=f(14105),V=f(13920),Z=f(89200),w=f(10509),N=f(97154),b=f(68707),_=f(39874),I=f(89797),D=f(5051),A=f(82667),S={url:"",deserializer:function(R){return JSON.parse(R.data)},serializer:function(R){return JSON.stringify(R)}},g=function(T){(0,w.Z)(k,T);var R=(0,N.Z)(k);function k(E,x){var O;if((0,B.Z)(this,k),O=R.call(this),E instanceof I.y)O.destination=x,O.source=E;else{var F=O._config=Object.assign({},S);if(O._output=new b.xQ,"string"==typeof E)F.url=E;else for(var z in E)E.hasOwnProperty(z)&&(F[z]=E[z]);if(!F.WebSocketCtor&&WebSocket)F.WebSocketCtor=WebSocket;else if(!F.WebSocketCtor)throw new Error("no WebSocket constructor can be found");O.destination=new A.t}return O}return(0,U.Z)(k,[{key:"lift",value:function(x){var O=new k(this._config,this.destination);return O.operator=x,O.source=this,O}},{key:"_resetState",value:function(){this._socket=null,this.source||(this.destination=new A.t),this._output=new b.xQ}},{key:"multiplex",value:function(x,O,F){var z=this;return new I.y(function(K){try{z.next(x())}catch(J){K.error(J)}var j=z.subscribe(function(J){try{F(J)&&K.next(J)}catch(ee){K.error(ee)}},function(J){return K.error(J)},function(){return K.complete()});return function(){try{z.next(O())}catch(J){K.error(J)}j.unsubscribe()}})}},{key:"_connectSocket",value:function(){var x=this,O=this._config,F=O.WebSocketCtor,z=O.protocol,K=O.url,j=O.binaryType,J=this._output,ee=null;try{ee=z?new F(K,z):new F(K),this._socket=ee,j&&(this._socket.binaryType=j)}catch(ae){return void J.error(ae)}var $=new D.w(function(){x._socket=null,ee&&1===ee.readyState&&ee.close()});ee.onopen=function(ae){if(!x._socket)return ee.close(),void x._resetState();var ce=x._config.openObserver;ce&&ce.next(ae);var le=x.destination;x.destination=_.L.create(function(oe){if(1===ee.readyState)try{ee.send((0,x._config.serializer)(oe))}catch(be){x.destination.error(be)}},function(oe){var Ae=x._config.closingObserver;Ae&&Ae.next(void 0),oe&&oe.code?ee.close(oe.code,oe.reason):J.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }")),x._resetState()},function(){var oe=x._config.closingObserver;oe&&oe.next(void 0),ee.close(),x._resetState()}),le&&le instanceof A.t&&$.add(le.subscribe(x.destination))},ee.onerror=function(ae){x._resetState(),J.error(ae)},ee.onclose=function(ae){x._resetState();var se=x._config.closeObserver;se&&se.next(ae),ae.wasClean?J.complete():J.error(ae)},ee.onmessage=function(ae){try{J.next((0,x._config.deserializer)(ae))}catch(ce){J.error(ce)}}}},{key:"_subscribe",value:function(x){var O=this,F=this.source;return F?F.subscribe(x):(this._socket||this._connectSocket(),this._output.subscribe(x),x.add(function(){var z=O._socket;0===O._output.observers.length&&(z&&1===z.readyState&&z.close(),O._resetState())}),x)}},{key:"unsubscribe",value:function(){var x=this._socket;x&&1===x.readyState&&x.close(),this._resetState(),(0,V.Z)((0,Z.Z)(k.prototype),"unsubscribe",this).call(this)}}]),k}(b.ug)},30437:function(ue,q,f){"use strict";f.d(q,{h:function(){return U}});var B=f(51361),U=function(){return B.i6.create}()},99298:function(ue,q,f){"use strict";f.d(q,{j:function(){return U}});var B=f(46095);function U(V){return new B.p(V)}},93487:function(ue,q,f){"use strict";f.d(q,{E:function(){return U},c:function(){return V}});var B=f(89797),U=new B.y(function(w){return w.complete()});function V(w){return w?function(w){return new B.y(function(N){return w.schedule(function(){return N.complete()})})}(w):U}},91925:function(ue,q,f){"use strict";f.d(q,{D:function(){return b}});var B=f(62467),U=f(89797),V=f(78985),Z=f(85639),w=f(64902),N=f(61493);function b(){for(var I=arguments.length,D=new Array(I),A=0;A1?Array.prototype.slice.call(arguments):E)},R,g)})}function _(S,v,g,T,R){var k;if(function(S){return S&&"function"==typeof S.addEventListener&&"function"==typeof S.removeEventListener}(S)){var E=S;S.addEventListener(v,g,R),k=function(){return E.removeEventListener(v,g,R)}}else if(function(S){return S&&"function"==typeof S.on&&"function"==typeof S.off}(S)){var x=S;S.on(v,g),k=function(){return x.off(v,g)}}else if(function(S){return S&&"function"==typeof S.addListener&&"function"==typeof S.removeListener}(S)){var O=S;S.addListener(v,g),k=function(){return O.removeListener(v,g)}}else{if(!S||!S.length)throw new TypeError("Invalid event target");for(var F=0,z=S.length;F0&&void 0!==arguments[0]?arguments[0]:0,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U.P;return(!(0,V.k)(N)||N<0)&&(N=0),(!b||"function"!=typeof b.schedule)&&(b=U.P),new B.y(function(_){return _.add(b.schedule(w,N,{subscriber:_,counter:0,period:N})),_})}function w(N){var b=N.subscriber,_=N.counter,I=N.period;b.next(_),this.schedule({subscriber:b,counter:_+1,period:I},I)}},55371:function(ue,q,f){"use strict";f.d(q,{T:function(){return w}});var B=f(89797),U=f(91299),V=f(65890),Z=f(80503);function w(){for(var N=Number.POSITIVE_INFINITY,b=null,_=arguments.length,I=new Array(_),D=0;D<_;D++)I[D]=arguments[D];var A=I[I.length-1];return(0,U.K)(A)?(b=I.pop(),I.length>1&&"number"==typeof I[I.length-1]&&(N=I.pop())):"number"==typeof A&&(N=I.pop()),null===b&&1===I.length&&I[0]instanceof B.y?I[0]:(0,V.J)(N)((0,Z.n)(I,b))}},43161:function(ue,q,f){"use strict";f.d(q,{of:function(){return Z}});var B=f(91299),U=f(80503),V=f(55835);function Z(){for(var w=arguments.length,N=new Array(w),b=0;b0&&void 0!==arguments[0]?arguments[0]:0,w=arguments.length>1?arguments[1]:void 0,N=arguments.length>2?arguments[2]:void 0;return new B.y(function(b){void 0===w&&(w=Z,Z=0);var _=0,I=Z;if(N)return N.schedule(V,0,{index:_,count:w,start:Z,subscriber:b});for(;;){if(_++>=w){b.complete();break}if(b.next(I++),b.closed)break}})}function V(Z){var w=Z.start,N=Z.index,_=Z.subscriber;N>=Z.count?_.complete():(_.next(w),!_.closed&&(Z.index=N+1,Z.start=w+1,this.schedule(Z)))}},11363:function(ue,q,f){"use strict";f.d(q,{_:function(){return U}});var B=f(89797);function U(Z,w){return new B.y(w?function(N){return w.schedule(V,0,{error:Z,subscriber:N})}:function(N){return N.error(Z)})}function V(Z){Z.subscriber.error(Z.error)}},5041:function(ue,q,f){"use strict";f.d(q,{H:function(){return w}});var B=f(89797),U=f(46813),V=f(11705),Z=f(91299);function w(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,_=arguments.length>1?arguments[1]:void 0,I=arguments.length>2?arguments[2]:void 0,D=-1;return(0,V.k)(_)?D=Number(_)<1?1:Number(_):(0,Z.K)(_)&&(I=_),(0,Z.K)(I)||(I=U.P),new B.y(function(A){var S=(0,V.k)(b)?b:+b-I.now();return I.schedule(N,S,{index:0,period:D,subscriber:A})})}function N(b){var _=b.index,I=b.period,D=b.subscriber;if(D.next(_),!D.closed){if(-1===I)return D.complete();b.index=_+1,this.schedule(b,I)}}},43008:function(ue,q,f){"use strict";f.d(q,{$R:function(){return D},mx:function(){return A}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(80503),N=f(78985),b=f(39874),_=f(81695),I=f(32124);function D(){for(var R=arguments.length,k=new Array(R),E=0;E2&&void 0!==arguments[2]||Object.create(null),(0,V.Z)(this,E),(F=k.call(this,x)).resultSelector=O,F.iterators=[],F.active=0,F.resultSelector="function"==typeof O?O:void 0,F}return(0,Z.Z)(E,[{key:"_next",value:function(O){var F=this.iterators;(0,N.k)(O)?F.push(new g(O)):F.push("function"==typeof O[_.hZ]?new v(O[_.hZ]()):new T(this.destination,this,O))}},{key:"_complete",value:function(){var O=this.iterators,F=O.length;if(this.unsubscribe(),0!==F){this.active=F;for(var z=0;zthis.index}},{key:"hasCompleted",value:function(){return this.array.length===this.index}}]),R}(),T=function(R){(0,B.Z)(E,R);var k=(0,U.Z)(E);function E(x,O,F){var z;return(0,V.Z)(this,E),(z=k.call(this,x)).parent=O,z.observable=F,z.stillUnsubscribed=!0,z.buffer=[],z.isComplete=!1,z}return(0,Z.Z)(E,[{key:_.hZ,value:function(){return this}},{key:"next",value:function(){var O=this.buffer;return 0===O.length&&this.isComplete?{value:null,done:!0}:{value:O.shift(),done:!1}}},{key:"hasValue",value:function(){return this.buffer.length>0}},{key:"hasCompleted",value:function(){return 0===this.buffer.length&&this.isComplete}},{key:"notifyComplete",value:function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}},{key:"notifyNext",value:function(O){this.buffer.push(O),this.parent.checkIterators()}},{key:"subscribe",value:function(){return(0,I.ft)(this.observable,new I.IY(this))}}]),E}(I.Ds)},67494:function(ue,q,f){"use strict";f.d(q,{U:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(32124);function N(I){return function(A){return A.lift(new b(I))}}var b=function(){function I(D){(0,V.Z)(this,I),this.durationSelector=D}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.durationSelector))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v){var g;return(0,V.Z)(this,A),(g=D.call(this,S)).durationSelector=v,g.hasValue=!1,g}return(0,Z.Z)(A,[{key:"_next",value:function(v){if(this.value=v,this.hasValue=!0,!this.throttled){var g;try{g=(0,this.durationSelector)(v)}catch(k){return this.destination.error(k)}var R=(0,w.ft)(g,new w.IY(this));!R||R.closed?this.clearThrottle():this.add(this.throttled=R)}}},{key:"clearThrottle",value:function(){var v=this.value,g=this.hasValue,T=this.throttled;T&&(this.remove(T),this.throttled=void 0,T.unsubscribe()),g&&(this.value=void 0,this.hasValue=!1,this.destination.next(v))}},{key:"notifyNext",value:function(){this.clearThrottle()}},{key:"notifyComplete",value:function(){this.clearThrottle()}}]),A}(w.Ds)},54562:function(ue,q,f){"use strict";f.d(q,{e:function(){return Z}});var B=f(46813),U=f(67494),V=f(5041);function Z(w){var N=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B.P;return(0,U.U)(function(){return(0,V.H)(w,N)})}},13426:function(ue,q,f){"use strict";f.d(q,{K:function(){return _}});var B=f(13920),U=f(89200),V=f(10509),Z=f(97154),w=f(18967),N=f(14105),b=f(32124);function _(A){return function(v){var g=new I(A),T=v.lift(g);return g.caught=T}}var I=function(){function A(S){(0,w.Z)(this,A),this.selector=S}return(0,N.Z)(A,[{key:"call",value:function(v,g){return g.subscribe(new D(v,this.selector,this.caught))}}]),A}(),D=function(A){(0,V.Z)(v,A);var S=(0,Z.Z)(v);function v(g,T,R){var k;return(0,w.Z)(this,v),(k=S.call(this,g)).selector=T,k.caught=R,k}return(0,N.Z)(v,[{key:"error",value:function(T){if(!this.isStopped){var R;try{R=this.selector(T,this.caught)}catch(x){return void(0,B.Z)((0,U.Z)(v.prototype),"error",this).call(this,x)}this._unsubscribeAndRecycle();var k=new b.IY(this);this.add(k);var E=(0,b.ft)(R,k);E!==k&&this.add(E)}}}]),v}(b.Ds)},95416:function(ue,q,f){"use strict";f.d(q,{u:function(){return U}});var B=f(65890);function U(){return(0,B.J)(1)}},38575:function(ue,q,f){"use strict";f.d(q,{b:function(){return U}});var B=f(35135);function U(V,Z){return(0,B.zg)(V,Z,1)}},75398:function(ue,q,f){"use strict";f.d(q,{Q:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(I){return function(D){return D.lift(new b(I,D))}}var b=function(){function I(D,A){(0,V.Z)(this,I),this.predicate=D,this.source=A}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.predicate,this.source))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v,g){var T;return(0,V.Z)(this,A),(T=D.call(this,S)).predicate=v,T.source=g,T.count=0,T.index=0,T}return(0,Z.Z)(A,[{key:"_next",value:function(v){this.predicate?this._tryPredicate(v):this.count++}},{key:"_tryPredicate",value:function(v){var g;try{g=this.predicate(v,this.index++,this.source)}catch(T){return void this.destination.error(T)}g&&this.count++}},{key:"_complete",value:function(){this.destination.next(this.count),this.destination.complete()}}]),A}(w.L)},57263:function(ue,q,f){"use strict";f.d(q,{b:function(){return b}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874),N=f(46813);function b(A){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.P;return function(v){return v.lift(new _(A,S))}}var _=function(){function A(S,v){(0,V.Z)(this,A),this.dueTime=S,this.scheduler=v}return(0,Z.Z)(A,[{key:"call",value:function(v,g){return g.subscribe(new I(v,this.dueTime,this.scheduler))}}]),A}(),I=function(A){(0,B.Z)(v,A);var S=(0,U.Z)(v);function v(g,T,R){var k;return(0,V.Z)(this,v),(k=S.call(this,g)).dueTime=T,k.scheduler=R,k.debouncedSubscription=null,k.lastValue=null,k.hasValue=!1,k}return(0,Z.Z)(v,[{key:"_next",value:function(T){this.clearDebounce(),this.lastValue=T,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(D,this.dueTime,this))}},{key:"_complete",value:function(){this.debouncedNext(),this.destination.complete()}},{key:"debouncedNext",value:function(){if(this.clearDebounce(),this.hasValue){var T=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(T)}}},{key:"clearDebounce",value:function(){var T=this.debouncedSubscription;null!==T&&(this.remove(T),T.unsubscribe(),this.debouncedSubscription=null)}}]),v}(w.L);function D(A){A.debouncedNext()}},34235:function(ue,q,f){"use strict";f.d(q,{d:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(D){return D.lift(new b(I))}}var b=function(){function I(D){(0,V.Z)(this,I),this.defaultValue=D}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.defaultValue))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v){var g;return(0,V.Z)(this,A),(g=D.call(this,S)).defaultValue=v,g.isEmpty=!0,g}return(0,Z.Z)(A,[{key:"_next",value:function(v){this.isEmpty=!1,this.destination.next(v)}},{key:"_complete",value:function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}]),A}(w.L)},86004:function(ue,q,f){"use strict";f.d(q,{g:function(){return I}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(46813),N=f(88972),b=f(39874),_=f(80286);function I(v){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w.P,T=(0,N.J)(v),R=T?+v-g.now():Math.abs(v);return function(k){return k.lift(new D(R,g))}}var D=function(){function v(g,T){(0,V.Z)(this,v),this.delay=g,this.scheduler=T}return(0,Z.Z)(v,[{key:"call",value:function(T,R){return R.subscribe(new A(T,this.delay,this.scheduler))}}]),v}(),A=function(v){(0,B.Z)(T,v);var g=(0,U.Z)(T);function T(R,k,E){var x;return(0,V.Z)(this,T),(x=g.call(this,R)).delay=k,x.scheduler=E,x.queue=[],x.active=!1,x.errored=!1,x}return(0,Z.Z)(T,[{key:"_schedule",value:function(k){this.active=!0,this.destination.add(k.schedule(T.dispatch,this.delay,{source:this,destination:this.destination,scheduler:k}))}},{key:"scheduleNotification",value:function(k){if(!0!==this.errored){var E=this.scheduler,x=new S(E.now()+this.delay,k);this.queue.push(x),!1===this.active&&this._schedule(E)}}},{key:"_next",value:function(k){this.scheduleNotification(_.P.createNext(k))}},{key:"_error",value:function(k){this.errored=!0,this.queue=[],this.destination.error(k),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleNotification(_.P.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(k){for(var E=k.source,x=E.queue,O=k.scheduler,F=k.destination;x.length>0&&x[0].time-O.now()<=0;)x.shift().notification.observe(F);if(x.length>0){var z=Math.max(0,x[0].time-O.now());this.schedule(k,z)}else this.unsubscribe(),E.active=!1}}]),T}(b.L),S=function v(g,T){(0,V.Z)(this,v),this.time=g,this.notification=T}},76161:function(ue,q,f){"use strict";f.d(q,{x:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(I,D){return function(A){return A.lift(new b(I,D))}}var b=function(){function I(D,A){(0,V.Z)(this,I),this.compare=D,this.keySelector=A}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.compare,this.keySelector))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v,g){var T;return(0,V.Z)(this,A),(T=D.call(this,S)).keySelector=g,T.hasKey=!1,"function"==typeof v&&(T.compare=v),T}return(0,Z.Z)(A,[{key:"compare",value:function(v,g){return v===g}},{key:"_next",value:function(v){var g;try{var T=this.keySelector;g=T?T(v):v}catch(E){return this.destination.error(E)}var R=!1;if(this.hasKey)try{R=(0,this.compare)(this.key,g)}catch(E){return this.destination.error(E)}else this.hasKey=!0;R||(this.key=g,this.destination.next(v))}}]),A}(w.L)},58780:function(ue,q,f){"use strict";f.d(q,{h:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(I,D){return function(S){return S.lift(new b(I,D))}}var b=function(){function I(D,A){(0,V.Z)(this,I),this.predicate=D,this.thisArg=A}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.predicate,this.thisArg))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v,g){var T;return(0,V.Z)(this,A),(T=D.call(this,S)).predicate=v,T.thisArg=g,T.count=0,T}return(0,Z.Z)(A,[{key:"_next",value:function(v){var g;try{g=this.predicate.call(this.thisArg,v,this.count++)}catch(T){return void this.destination.error(T)}g&&this.destination.next(v)}}]),A}(w.L)},59803:function(ue,q,f){"use strict";f.d(q,{x:function(){return b}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874),N=f(5051);function b(D){return function(A){return A.lift(new _(D))}}var _=function(){function D(A){(0,V.Z)(this,D),this.callback=A}return(0,Z.Z)(D,[{key:"call",value:function(S,v){return v.subscribe(new I(S,this.callback))}}]),D}(),I=function(D){(0,B.Z)(S,D);var A=(0,U.Z)(S);function S(v,g){var T;return(0,V.Z)(this,S),(T=A.call(this,v)).add(new N.w(g)),T}return S}(w.L)},64233:function(ue,q,f){"use strict";f.d(q,{P:function(){return b}});var B=f(64646),U=f(58780),V=f(48359),Z=f(34235),w=f(88942),N=f(57070);function b(_,I){var D=arguments.length>=2;return function(A){return A.pipe(_?(0,U.h)(function(S,v){return _(S,v,A)}):N.y,(0,V.q)(1),D?(0,Z.d)(I):(0,w.T)(function(){return new B.K}))}}},86072:function(ue,q,f){"use strict";f.d(q,{v:function(){return A},T:function(){return T}});var B=f(13920),U=f(89200),V=f(10509),Z=f(97154),w=f(18967),N=f(14105),b=f(39874),_=f(5051),I=f(89797),D=f(68707);function A(k,E,x,O){return function(F){return F.lift(new S(k,E,x,O))}}var S=function(){function k(E,x,O,F){(0,w.Z)(this,k),this.keySelector=E,this.elementSelector=x,this.durationSelector=O,this.subjectSelector=F}return(0,N.Z)(k,[{key:"call",value:function(x,O){return O.subscribe(new v(x,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))}}]),k}(),v=function(k){(0,V.Z)(x,k);var E=(0,Z.Z)(x);function x(O,F,z,K,j){var J;return(0,w.Z)(this,x),(J=E.call(this,O)).keySelector=F,J.elementSelector=z,J.durationSelector=K,J.subjectSelector=j,J.groups=null,J.attemptedToUnsubscribe=!1,J.count=0,J}return(0,N.Z)(x,[{key:"_next",value:function(F){var z;try{z=this.keySelector(F)}catch(K){return void this.error(K)}this._group(F,z)}},{key:"_group",value:function(F,z){var K=this.groups;K||(K=this.groups=new Map);var J,j=K.get(z);if(this.elementSelector)try{J=this.elementSelector(F)}catch(ae){this.error(ae)}else J=F;if(!j){j=this.subjectSelector?this.subjectSelector():new D.xQ,K.set(z,j);var ee=new T(z,j,this);if(this.destination.next(ee),this.durationSelector){var $;try{$=this.durationSelector(new T(z,j))}catch(ae){return void this.error(ae)}this.add($.subscribe(new g(z,j,this)))}}j.closed||j.next(J)}},{key:"_error",value:function(F){var z=this.groups;z&&(z.forEach(function(K,j){K.error(F)}),z.clear()),this.destination.error(F)}},{key:"_complete",value:function(){var F=this.groups;F&&(F.forEach(function(z,K){z.complete()}),F.clear()),this.destination.complete()}},{key:"removeGroup",value:function(F){this.groups.delete(F)}},{key:"unsubscribe",value:function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&(0,B.Z)((0,U.Z)(x.prototype),"unsubscribe",this).call(this))}}]),x}(b.L),g=function(k){(0,V.Z)(x,k);var E=(0,Z.Z)(x);function x(O,F,z){var K;return(0,w.Z)(this,x),(K=E.call(this,F)).key=O,K.group=F,K.parent=z,K}return(0,N.Z)(x,[{key:"_next",value:function(F){this.complete()}},{key:"_unsubscribe",value:function(){var F=this.parent,z=this.key;this.key=this.parent=null,F&&F.removeGroup(z)}}]),x}(b.L),T=function(k){(0,V.Z)(x,k);var E=(0,Z.Z)(x);function x(O,F,z){var K;return(0,w.Z)(this,x),(K=E.call(this)).key=O,K.groupSubject=F,K.refCountSubscription=z,K}return(0,N.Z)(x,[{key:"_subscribe",value:function(F){var z=new _.w,K=this.refCountSubscription,j=this.groupSubject;return K&&!K.closed&&z.add(new R(K)),z.add(j.subscribe(F)),z}}]),x}(I.y),R=function(k){(0,V.Z)(x,k);var E=(0,Z.Z)(x);function x(O){var F;return(0,w.Z)(this,x),(F=E.call(this)).parent=O,O.count++,F}return(0,N.Z)(x,[{key:"unsubscribe",value:function(){var F=this.parent;!F.closed&&!this.closed&&((0,B.Z)((0,U.Z)(x.prototype),"unsubscribe",this).call(this),F.count-=1,0===F.count&&F.attemptedToUnsubscribe&&F.unsubscribe())}}]),x}(_.w)},99583:function(ue,q,f){"use strict";f.d(q,{Z:function(){return b}});var B=f(64646),U=f(58780),V=f(64397),Z=f(88942),w=f(34235),N=f(57070);function b(_,I){var D=arguments.length>=2;return function(A){return A.pipe(_?(0,U.h)(function(S,v){return _(S,v,A)}):N.y,(0,V.h)(1),D?(0,w.d)(I):(0,Z.T)(function(){return new B.K}))}}},85639:function(ue,q,f){"use strict";f.d(q,{U:function(){return b}});var B=f(88009),U=f(10509),V=f(97154),Z=f(18967),w=f(14105),N=f(39874);function b(D,A){return function(v){if("function"!=typeof D)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return v.lift(new _(D,A))}}var _=function(){function D(A,S){(0,Z.Z)(this,D),this.project=A,this.thisArg=S}return(0,w.Z)(D,[{key:"call",value:function(S,v){return v.subscribe(new I(S,this.project,this.thisArg))}}]),D}(),I=function(D){(0,U.Z)(S,D);var A=(0,V.Z)(S);function S(v,g,T){var R;return(0,Z.Z)(this,S),(R=A.call(this,v)).project=g,R.count=0,R.thisArg=T||(0,B.Z)(R),R}return(0,w.Z)(S,[{key:"_next",value:function(g){var T;try{T=this.project.call(this.thisArg,g,this.count++)}catch(R){return void this.destination.error(R)}this.destination.next(T)}}]),S}(N.L)},12698:function(ue,q,f){"use strict";f.d(q,{h:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(I){return function(D){return D.lift(new b(I))}}var b=function(){function I(D){(0,V.Z)(this,I),this.value=D}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.value))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v){var g;return(0,V.Z)(this,A),(g=D.call(this,S)).value=v,g}return(0,Z.Z)(A,[{key:"_next",value:function(v){this.destination.next(this.value)}}]),A}(w.L)},65890:function(ue,q,f){"use strict";f.d(q,{J:function(){return V}});var B=f(35135),U=f(57070);function V(){var Z=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;return(0,B.zg)(U.y,Z)}},35135:function(ue,q,f){"use strict";f.d(q,{zg:function(){return _},VS:function(){return A}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(85639),N=f(61493),b=f(32124);function _(S,v){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return"function"==typeof v?function(T){return T.pipe(_(function(R,k){return(0,N.D)(S(R,k)).pipe((0,w.U)(function(E,x){return v(R,E,k,x)}))},g))}:("number"==typeof v&&(g=v),function(T){return T.lift(new I(S,g))})}var I=function(){function S(v){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY;(0,V.Z)(this,S),this.project=v,this.concurrent=g}return(0,Z.Z)(S,[{key:"call",value:function(g,T){return T.subscribe(new D(g,this.project,this.concurrent))}}]),S}(),D=function(S){(0,B.Z)(g,S);var v=(0,U.Z)(g);function g(T,R){var k,E=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return(0,V.Z)(this,g),(k=v.call(this,T)).project=R,k.concurrent=E,k.hasCompleted=!1,k.buffer=[],k.active=0,k.index=0,k}return(0,Z.Z)(g,[{key:"_next",value:function(R){this.active0?this._next(R.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}]),g}(b.Ds),A=_},4981:function(ue,q,f){"use strict";f.d(q,{O:function(){return Z}});var B=f(18967),U=f(14105),V=f(39887);function Z(N,b){return function(I){var D;if(D="function"==typeof N?N:function(){return N},"function"==typeof b)return I.lift(new w(D,b));var A=Object.create(I,V.N);return A.source=I,A.subjectFactory=D,A}}var w=function(){function N(b,_){(0,B.Z)(this,N),this.subjectFactory=b,this.selector=_}return(0,U.Z)(N,[{key:"call",value:function(_,I){var D=this.selector,A=this.subjectFactory(),S=D(A).subscribe(_);return S.add(I.subscribe(A)),S}}]),N}()},25110:function(ue,q,f){"use strict";f.d(q,{QV:function(){return b},ht:function(){return I}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874),N=f(80286);function b(A){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(g){return g.lift(new _(A,S))}}var _=function(){function A(S){var v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,V.Z)(this,A),this.scheduler=S,this.delay=v}return(0,Z.Z)(A,[{key:"call",value:function(v,g){return g.subscribe(new I(v,this.scheduler,this.delay))}}]),A}(),I=function(A){(0,B.Z)(v,A);var S=(0,U.Z)(v);function v(g,T){var R,k=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,V.Z)(this,v),(R=S.call(this,g)).scheduler=T,R.delay=k,R}return(0,Z.Z)(v,[{key:"scheduleMessage",value:function(T){this.destination.add(this.scheduler.schedule(v.dispatch,this.delay,new D(T,this.destination)))}},{key:"_next",value:function(T){this.scheduleMessage(N.P.createNext(T))}},{key:"_error",value:function(T){this.scheduleMessage(N.P.createError(T)),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleMessage(N.P.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(T){T.notification.observe(T.destination),this.unsubscribe()}}]),v}(w.L),D=function A(S,v){(0,V.Z)(this,A),this.notification=S,this.destination=v}},4363:function(ue,q,f){"use strict";f.d(q,{G:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(){return function(I){return I.lift(new b)}}var b=function(){function I(){(0,V.Z)(this,I)}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S){var v;return(0,V.Z)(this,A),(v=D.call(this,S)).hasPrev=!1,v}return(0,Z.Z)(A,[{key:"_next",value:function(v){var g;this.hasPrev?g=[this.prev,v]:this.hasPrev=!0,this.prev=v,g&&this.destination.next(g)}}]),A}(w.L)},26575:function(ue,q,f){"use strict";f.d(q,{x:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(){return function(D){return D.lift(new b(D))}}var b=function(){function I(D){(0,V.Z)(this,I),this.connectable=D}return(0,Z.Z)(I,[{key:"call",value:function(A,S){var v=this.connectable;v._refCount++;var g=new _(A,v),T=S.subscribe(g);return g.closed||(g.connection=v.connect()),T}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v){var g;return(0,V.Z)(this,A),(g=D.call(this,S)).connectable=v,g}return(0,Z.Z)(A,[{key:"_unsubscribe",value:function(){var v=this.connectable;if(v){this.connectable=null;var g=v._refCount;if(g<=0)this.connection=null;else if(v._refCount=g-1,g>1)this.connection=null;else{var T=this.connection,R=v._connection;this.connection=null,R&&(!T||R===T)&&R.unsubscribe()}}else this.connection=null}}]),A}(w.L)},31927:function(ue,q,f){"use strict";f.d(q,{R:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(I,D){var A=!1;return arguments.length>=2&&(A=!0),function(v){return v.lift(new b(I,D,A))}}var b=function(){function I(D,A){var S=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,V.Z)(this,I),this.accumulator=D,this.seed=A,this.hasSeed=S}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.accumulator,this.seed,this.hasSeed))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v,g,T){var R;return(0,V.Z)(this,A),(R=D.call(this,S)).accumulator=v,R._seed=g,R.hasSeed=T,R.index=0,R}return(0,Z.Z)(A,[{key:"seed",get:function(){return this._seed},set:function(v){this.hasSeed=!0,this._seed=v}},{key:"_next",value:function(v){if(this.hasSeed)return this._tryNext(v);this.seed=v,this.destination.next(v)}},{key:"_tryNext",value:function(v){var T,g=this.index++;try{T=this.accumulator(this.seed,v,g)}catch(R){this.destination.error(R)}this.seed=T,this.destination.next(T)}}]),A}(w.L)},16338:function(ue,q,f){"use strict";f.d(q,{B:function(){return w}});var B=f(4981),U=f(26575),V=f(68707);function Z(){return new V.xQ}function w(){return function(N){return(0,U.x)()((0,B.O)(Z)(N))}}},61106:function(ue,q,f){"use strict";f.d(q,{d:function(){return U}});var B=f(82667);function U(Z,w,N){var b;return b=Z&&"object"==typeof Z?Z:{bufferSize:Z,windowTime:w,refCount:!1,scheduler:N},function(_){return _.lift(function(Z){var A,v,w=Z.bufferSize,N=void 0===w?Number.POSITIVE_INFINITY:w,b=Z.windowTime,_=void 0===b?Number.POSITIVE_INFINITY:b,I=Z.refCount,D=Z.scheduler,S=0,g=!1,T=!1;return function(k){var E;S++,!A||g?(g=!1,A=new B.t(N,_,D),E=A.subscribe(this),v=k.subscribe({next:function(O){A.next(O)},error:function(O){g=!0,A.error(O)},complete:function(){T=!0,v=void 0,A.complete()}}),T&&(v=void 0)):E=A.subscribe(this),this.add(function(){S--,E.unsubscribe(),E=void 0,v&&!T&&I&&0===S&&(v.unsubscribe(),v=void 0,A=void 0)})}}(b))}}},18756:function(ue,q,f){"use strict";f.d(q,{T:function(){return N}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(39874);function N(I){return function(D){return D.lift(new b(I))}}var b=function(){function I(D){(0,V.Z)(this,I),this.total=D}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.total))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v){var g;return(0,V.Z)(this,A),(g=D.call(this,S)).total=v,g.count=0,g}return(0,Z.Z)(A,[{key:"_next",value:function(v){++this.count>this.total&&this.destination.next(v)}}]),A}(w.L)},57682:function(ue,q,f){"use strict";f.d(q,{O:function(){return V}});var B=f(60131),U=f(91299);function V(){for(var Z=arguments.length,w=new Array(Z),N=0;N0)for(var k=this.count>=this.total?this.total:this.count,E=this.ring,x=0;x1&&void 0!==arguments[1]&&arguments[1];return function(A){return A.lift(new b(I,D))}}var b=function(){function I(D,A){(0,V.Z)(this,I),this.predicate=D,this.inclusive=A}return(0,Z.Z)(I,[{key:"call",value:function(A,S){return S.subscribe(new _(A,this.predicate,this.inclusive))}}]),I}(),_=function(I){(0,B.Z)(A,I);var D=(0,U.Z)(A);function A(S,v,g){var T;return(0,V.Z)(this,A),(T=D.call(this,S)).predicate=v,T.inclusive=g,T.index=0,T}return(0,Z.Z)(A,[{key:"_next",value:function(v){var T,g=this.destination;try{T=this.predicate(v,this.index++)}catch(R){return void g.error(R)}this.nextOrComplete(v,T)}},{key:"nextOrComplete",value:function(v,g){var T=this.destination;Boolean(g)?T.next(v):(this.inclusive&&T.next(v),T.complete())}}]),A}(w.L)},59371:function(ue,q,f){"use strict";f.d(q,{b:function(){return I}});var B=f(88009),U=f(10509),V=f(97154),Z=f(18967),w=f(14105),N=f(39874),b=f(66029),_=f(20684);function I(S,v,g){return function(R){return R.lift(new D(S,v,g))}}var D=function(){function S(v,g,T){(0,Z.Z)(this,S),this.nextOrObserver=v,this.error=g,this.complete=T}return(0,w.Z)(S,[{key:"call",value:function(g,T){return T.subscribe(new A(g,this.nextOrObserver,this.error,this.complete))}}]),S}(),A=function(S){(0,U.Z)(g,S);var v=(0,V.Z)(g);function g(T,R,k,E){var x;return(0,Z.Z)(this,g),(x=v.call(this,T))._tapNext=b.Z,x._tapError=b.Z,x._tapComplete=b.Z,x._tapError=k||b.Z,x._tapComplete=E||b.Z,(0,_.m)(R)?(x._context=(0,B.Z)(x),x._tapNext=R):R&&(x._context=R,x._tapNext=R.next||b.Z,x._tapError=R.error||b.Z,x._tapComplete=R.complete||b.Z),x}return(0,w.Z)(g,[{key:"_next",value:function(R){try{this._tapNext.call(this._context,R)}catch(k){return void this.destination.error(k)}this.destination.next(R)}},{key:"_error",value:function(R){try{this._tapError.call(this._context,R)}catch(k){return void this.destination.error(k)}this.destination.error(R)}},{key:"_complete",value:function(){try{this._tapComplete.call(this._context)}catch(R){return void this.destination.error(R)}return this.destination.complete()}}]),g}(N.L)},243:function(ue,q,f){"use strict";f.d(q,{d:function(){return N},P:function(){return b}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(32124),N={leading:!0,trailing:!1};function b(D){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N;return function(S){return S.lift(new _(D,!!A.leading,!!A.trailing))}}var _=function(){function D(A,S,v){(0,V.Z)(this,D),this.durationSelector=A,this.leading=S,this.trailing=v}return(0,Z.Z)(D,[{key:"call",value:function(S,v){return v.subscribe(new I(S,this.durationSelector,this.leading,this.trailing))}}]),D}(),I=function(D){(0,B.Z)(S,D);var A=(0,U.Z)(S);function S(v,g,T,R){var k;return(0,V.Z)(this,S),(k=A.call(this,v)).destination=v,k.durationSelector=g,k._leading=T,k._trailing=R,k._hasValue=!1,k}return(0,Z.Z)(S,[{key:"_next",value:function(g){this._hasValue=!0,this._sendValue=g,this._throttled||(this._leading?this.send():this.throttle(g))}},{key:"send",value:function(){var T=this._sendValue;this._hasValue&&(this.destination.next(T),this.throttle(T)),this._hasValue=!1,this._sendValue=void 0}},{key:"throttle",value:function(g){var T=this.tryDurationSelector(g);T&&this.add(this._throttled=(0,w.ft)(T,new w.IY(this)))}},{key:"tryDurationSelector",value:function(g){try{return this.durationSelector(g)}catch(T){return this.destination.error(T),null}}},{key:"throttlingDone",value:function(){var g=this._throttled,T=this._trailing;g&&g.unsubscribe(),this._throttled=void 0,T&&this.send()}},{key:"notifyNext",value:function(){this.throttlingDone()}},{key:"notifyComplete",value:function(){this.throttlingDone()}}]),S}(w.Ds)},88942:function(ue,q,f){"use strict";f.d(q,{T:function(){return b}});var B=f(10509),U=f(97154),V=f(18967),Z=f(14105),w=f(64646),N=f(39874);function b(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;return function(S){return S.lift(new _(A))}}var _=function(){function A(S){(0,V.Z)(this,A),this.errorFactory=S}return(0,Z.Z)(A,[{key:"call",value:function(v,g){return g.subscribe(new I(v,this.errorFactory))}}]),A}(),I=function(A){(0,B.Z)(v,A);var S=(0,U.Z)(v);function v(g,T){var R;return(0,V.Z)(this,v),(R=S.call(this,g)).errorFactory=T,R.hasValue=!1,R}return(0,Z.Z)(v,[{key:"_next",value:function(T){this.hasValue=!0,this.destination.next(T)}},{key:"_complete",value:function(){if(this.hasValue)return this.destination.complete();var T;try{T=this.errorFactory()}catch(R){T=R}this.destination.error(T)}}]),v}(N.L);function D(){return new w.K}},73445:function(ue,q,f){"use strict";f.d(q,{J:function(){return N},R:function(){return b}});var B=f(18967),U=f(46813),V=f(31927),Z=f(4499),w=f(85639);function N(){var _=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U.P;return function(I){return(0,Z.P)(function(){return I.pipe((0,V.R)(function(D,A){var S=D.current;return{value:A,current:_.now(),last:S}},{current:_.now(),value:void 0,last:void 0}),(0,w.U)(function(D){return new b(D.value,D.current-D.last)}))})}}var b=function _(I,D){(0,B.Z)(this,_),this.value=I,this.interval=D}},63706:function(ue,q,f){"use strict";f.d(q,{A:function(){return Z},E:function(){return w}});var B=f(18967),U=f(46813),V=f(85639);function Z(){var N=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U.P;return(0,V.U)(function(b){return new w(b,N.now())})}var w=function N(b,_){(0,B.Z)(this,N),this.value=b,this.timestamp=_}},55835:function(ue,q,f){"use strict";f.d(q,{r:function(){return V}});var B=f(89797),U=f(5051);function V(Z,w){return new B.y(function(N){var b=new U.w,_=0;return b.add(w.schedule(function(){_!==Z.length?(N.next(Z[_++]),N.closed||b.add(this.schedule())):N.complete()})),b})}},60612:function(ue,q,f){"use strict";f.d(q,{Q:function(){return Z}});var B=f(89797),U=f(5051),V=f(81695);function Z(w,N){if(!w)throw new Error("Iterable cannot be null");return new B.y(function(b){var I,_=new U.w;return _.add(function(){I&&"function"==typeof I.return&&I.return()}),_.add(N.schedule(function(){I=w[V.hZ](),_.add(N.schedule(function(){if(!b.closed){var D,A;try{var S=I.next();D=S.value,A=S.done}catch(v){return void b.error(v)}A?b.complete():(b.next(D),this.schedule())}}))})),_})}},10498:function(ue,q,f){"use strict";f.d(q,{c:function(){return V}});var B=f(89797),U=f(5051);function V(Z,w){return new B.y(function(N){var b=new U.w;return b.add(w.schedule(function(){return Z.then(function(_){b.add(w.schedule(function(){N.next(_),b.add(w.schedule(function(){return N.complete()}))}))},function(_){b.add(w.schedule(function(){return N.error(_)}))})})),b})}},77493:function(ue,q,f){"use strict";f.d(q,{x:function(){return S}});var B=f(89797),U=f(5051),V=f(57694),w=f(10498),N=f(55835),b=f(60612),_=f(19104),I=f(36514),D=f(30621),A=f(2762);function S(v,g){if(null!=v){if((0,_.c)(v))return function(v,g){return new B.y(function(T){var R=new U.w;return R.add(g.schedule(function(){var k=v[V.L]();R.add(k.subscribe({next:function(x){R.add(g.schedule(function(){return T.next(x)}))},error:function(x){R.add(g.schedule(function(){return T.error(x)}))},complete:function(){R.add(g.schedule(function(){return T.complete()}))}}))})),R})}(v,g);if((0,I.t)(v))return(0,w.c)(v,g);if((0,D.z)(v))return(0,N.r)(v,g);if((0,A.T)(v)||"string"==typeof v)return(0,b.Q)(v,g)}throw new TypeError((null!==v&&typeof v||v)+" is not observable")}},4065:function(ue,q,f){"use strict";f.d(q,{o:function(){return b}});var B=f(18967),U=f(14105),V=f(10509),Z=f(97154),b=function(_){(0,V.Z)(D,_);var I=(0,Z.Z)(D);function D(A,S){var v;return(0,B.Z)(this,D),(v=I.call(this,A,S)).scheduler=A,v.work=S,v.pending=!1,v}return(0,U.Z)(D,[{key:"schedule",value:function(S){var v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this.closed)return this;this.state=S;var g=this.id,T=this.scheduler;return null!=g&&(this.id=this.recycleAsyncId(T,g,v)),this.pending=!0,this.delay=v,this.id=this.id||this.requestAsyncId(T,this.id,v),this}},{key:"requestAsyncId",value:function(S,v){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return setInterval(S.flush.bind(S,this),g)}},{key:"recycleAsyncId",value:function(S,v){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==g&&this.delay===g&&!1===this.pending)return v;clearInterval(v)}},{key:"execute",value:function(S,v){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var g=this._execute(S,v);if(g)return g;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}},{key:"_execute",value:function(S,v){var g=!1,T=void 0;try{this.work(S)}catch(R){g=!0,T=!!R&&R||new Error(R)}if(g)return this.unsubscribe(),T}},{key:"_unsubscribe",value:function(){var S=this.id,v=this.scheduler,g=v.actions,T=g.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==T&&g.splice(T,1),null!=S&&(this.id=this.recycleAsyncId(v,S,null)),this.delay=null}}]),D}(function(_){(0,V.Z)(D,_);var I=(0,Z.Z)(D);function D(A,S){return(0,B.Z)(this,D),I.call(this)}return(0,U.Z)(D,[{key:"schedule",value:function(S){return this}}]),D}(f(5051).w))},81572:function(ue,q,f){"use strict";f.d(q,{v:function(){return I}});var B=f(18967),U=f(14105),V=f(88009),Z=f(13920),w=f(89200),N=f(10509),b=f(97154),_=f(67801),I=function(D){(0,N.Z)(S,D);var A=(0,b.Z)(S);function S(v){var g,T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_.b.now;return(0,B.Z)(this,S),(g=A.call(this,v,function(){return S.delegate&&S.delegate!==(0,V.Z)(g)?S.delegate.now():T()})).actions=[],g.active=!1,g.scheduled=void 0,g}return(0,U.Z)(S,[{key:"schedule",value:function(g){var T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,R=arguments.length>2?arguments[2]:void 0;return S.delegate&&S.delegate!==this?S.delegate.schedule(g,T,R):(0,Z.Z)((0,w.Z)(S.prototype),"schedule",this).call(this,g,T,R)}},{key:"flush",value:function(g){var T=this.actions;if(this.active)T.push(g);else{var R;this.active=!0;do{if(R=g.execute(g.state,g.delay))break}while(g=T.shift());if(this.active=!1,R){for(;g=T.shift();)g.unsubscribe();throw R}}}}]),S}(_.b)},2296:function(ue,q,f){"use strict";f.d(q,{y:function(){return I},h:function(){return D}});var B=f(13920),U=f(89200),V=f(18967),Z=f(14105),w=f(10509),N=f(97154),b=f(4065),_=f(81572),I=function(){var A=function(S){(0,w.Z)(g,S);var v=(0,N.Z)(g);function g(){var T,R=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,k=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY;return(0,V.Z)(this,g),(T=v.call(this,R,function(){return T.frame})).maxFrames=k,T.frame=0,T.index=-1,T}return(0,Z.Z)(g,[{key:"flush",value:function(){for(var E,x,R=this.actions,k=this.maxFrames;(x=R[0])&&x.delay<=k&&(R.shift(),this.frame=x.delay,!(E=x.execute(x.state,x.delay))););if(E){for(;x=R.shift();)x.unsubscribe();throw E}}}]),g}(_.v);return A.frameTimeFactor=10,A}(),D=function(A){(0,w.Z)(v,A);var S=(0,N.Z)(v);function v(g,T){var R,k=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.index+=1;return(0,V.Z)(this,v),(R=S.call(this,g,T)).scheduler=g,R.work=T,R.index=k,R.active=!0,R.index=g.index=k,R}return(0,Z.Z)(v,[{key:"schedule",value:function(T){var R=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!this.id)return(0,B.Z)((0,U.Z)(v.prototype),"schedule",this).call(this,T,R);this.active=!1;var k=new v(this.scheduler,this.work);return this.add(k),k.schedule(T,R)}},{key:"requestAsyncId",value:function(T,R){var k=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.delay=T.frame+k;var E=T.actions;return E.push(this),E.sort(v.sortActions),!0}},{key:"recycleAsyncId",value:function(T,R){}},{key:"_execute",value:function(T,R){if(!0===this.active)return(0,B.Z)((0,U.Z)(v.prototype),"_execute",this).call(this,T,R)}}],[{key:"sortActions",value:function(T,R){return T.delay===R.delay?T.index===R.index?0:T.index>R.index?1:-1:T.delay>R.delay?1:-1}}]),v}(b.o)},58172:function(ue,q,f){"use strict";f.d(q,{r:function(){return S},Z:function(){return A}});var B=f(18967),U=f(14105),V=f(13920),Z=f(89200),w=f(10509),N=f(97154),_=function(v){(0,w.Z)(T,v);var g=(0,N.Z)(T);function T(R,k){var E;return(0,B.Z)(this,T),(E=g.call(this,R,k)).scheduler=R,E.work=k,E}return(0,U.Z)(T,[{key:"requestAsyncId",value:function(k,E){var x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null!==x&&x>0?(0,V.Z)((0,Z.Z)(T.prototype),"requestAsyncId",this).call(this,k,E,x):(k.actions.push(this),k.scheduled||(k.scheduled=requestAnimationFrame(function(){return k.flush(null)})))}},{key:"recycleAsyncId",value:function(k,E){var x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==x&&x>0||null===x&&this.delay>0)return(0,V.Z)((0,Z.Z)(T.prototype),"recycleAsyncId",this).call(this,k,E,x);0===k.actions.length&&(cancelAnimationFrame(E),k.scheduled=void 0)}}]),T}(f(4065).o),A=new(function(v){(0,w.Z)(T,v);var g=(0,N.Z)(T);function T(){return(0,B.Z)(this,T),g.apply(this,arguments)}return(0,U.Z)(T,[{key:"flush",value:function(k){this.active=!0,this.scheduled=void 0;var x,E=this.actions,O=-1,F=E.length;k=k||E.shift();do{if(x=k.execute(k.state,k.delay))break}while(++O2&&void 0!==arguments[2]?arguments[2]:0;return null!==O&&O>0?(0,V.Z)((0,Z.Z)(R.prototype),"requestAsyncId",this).call(this,E,x,O):(E.actions.push(this),E.scheduled||(E.scheduled=b.H.setImmediate(E.flush.bind(E,null))))}},{key:"recycleAsyncId",value:function(E,x){var O=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==O&&O>0||null===O&&this.delay>0)return(0,V.Z)((0,Z.Z)(R.prototype),"recycleAsyncId",this).call(this,E,x,O);0===E.actions.length&&(b.H.clearImmediate(x),E.scheduled=void 0)}}]),R}(f(4065).o),S=new(function(g){(0,w.Z)(R,g);var T=(0,N.Z)(R);function R(){return(0,B.Z)(this,R),T.apply(this,arguments)}return(0,U.Z)(R,[{key:"flush",value:function(E){this.active=!0,this.scheduled=void 0;var O,x=this.actions,F=-1,z=x.length;E=E||x.shift();do{if(O=E.execute(E.state,E.delay))break}while(++F1&&void 0!==arguments[1]?arguments[1]:0;return E>0?(0,V.Z)((0,Z.Z)(T.prototype),"schedule",this).call(this,k,E):(this.delay=E,this.state=k,this.scheduler.flush(this),this)}},{key:"execute",value:function(k,E){return E>0||this.closed?(0,V.Z)((0,Z.Z)(T.prototype),"execute",this).call(this,k,E):this._execute(k,E)}},{key:"requestAsyncId",value:function(k,E){var x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null!==x&&x>0||null===x&&this.delay>0?(0,V.Z)((0,Z.Z)(T.prototype),"requestAsyncId",this).call(this,k,E,x):k.flush(this)}}]),T}(f(4065).o),A=new(function(v){(0,w.Z)(T,v);var g=(0,N.Z)(T);function T(){return(0,B.Z)(this,T),g.apply(this,arguments)}return T}(f(81572).v))(_),S=A},81695:function(ue,q,f){"use strict";function B(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}f.d(q,{hZ:function(){return U}});var U=B()},57694:function(ue,q,f){"use strict";f.d(q,{L:function(){return B}});var B=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},79542:function(ue,q,f){"use strict";f.d(q,{b:function(){return B}});var B=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},9855:function(ue,q,f){"use strict";f.d(q,{W:function(){return U}});var U=function(){function V(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return V.prototype=Object.create(Error.prototype),V}()},64646:function(ue,q,f){"use strict";f.d(q,{K:function(){return U}});var U=function(){function V(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return V.prototype=Object.create(Error.prototype),V}()},96421:function(ue,q,f){"use strict";f.d(q,{H:function(){return w}});var B=1,U=function(){return Promise.resolve()}(),V={};function Z(b){return b in V&&(delete V[b],!0)}var w={setImmediate:function(_){var I=B++;return V[I]=!0,U.then(function(){return Z(I)&&_()}),I},clearImmediate:function(_){Z(_)}}},1696:function(ue,q,f){"use strict";f.d(q,{N:function(){return U}});var U=function(){function V(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return V.prototype=Object.create(Error.prototype),V}()},98691:function(ue,q,f){"use strict";f.d(q,{W:function(){return U}});var U=function(){function V(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return V.prototype=Object.create(Error.prototype),V}()},66351:function(ue,q,f){"use strict";f.d(q,{B:function(){return U}});var U=function(){function V(Z){return Error.call(this),this.message=Z?"".concat(Z.length," errors occurred during unsubscription:\n").concat(Z.map(function(w,N){return"".concat(N+1,") ").concat(w.toString())}).join("\n ")):"",this.name="UnsubscriptionError",this.errors=Z,this}return V.prototype=Object.create(Error.prototype),V}()},2808:function(ue,q,f){"use strict";function B(U,V){for(var Z=0,w=V.length;Z=0}},64902:function(ue,q,f){"use strict";function B(U){return null!==U&&"object"==typeof U}f.d(q,{K:function(){return B}})},17504:function(ue,q,f){"use strict";f.d(q,{b:function(){return U}});var B=f(89797);function U(V){return!!V&&(V instanceof B.y||"function"==typeof V.lift&&"function"==typeof V.subscribe)}},36514:function(ue,q,f){"use strict";function B(U){return!!U&&"function"!=typeof U.subscribe&&"function"==typeof U.then}f.d(q,{t:function(){return B}})},91299:function(ue,q,f){"use strict";function B(U){return U&&"function"==typeof U.schedule}f.d(q,{K:function(){return B}})},66029:function(ue,q,f){"use strict";function B(){}f.d(q,{Z:function(){return B}})},59849:function(ue,q,f){"use strict";function B(U,V){function Z(){return!Z.pred.apply(Z.thisArg,arguments)}return Z.pred=U,Z.thisArg=V,Z}f.d(q,{f:function(){return B}})},96194:function(ue,q,f){"use strict";f.d(q,{z:function(){return U},U:function(){return V}});var B=f(57070);function U(){for(var Z=arguments.length,w=new Array(Z),N=0;N4&&void 0!==arguments[4]?arguments[4]:new B.d(w,b,_);if(!I.closed)return N instanceof V.y?N.subscribe(I):(0,U.s)(N)(I)}},3410:function(ue,q,f){"use strict";f.d(q,{Y:function(){return Z}});var B=f(39874),U=f(79542),V=f(88944);function Z(w,N,b){if(w){if(w instanceof B.L)return w;if(w[U.b])return w[U.b]()}return w||N||b?new B.L(w,N,b):new B.L(V.c)}},73033:function(ue,q,f){"use strict";f.r(q),f.d(q,{audit:function(){return B.U},auditTime:function(){return U.e},buffer:function(){return I},bufferCount:function(){return T},bufferTime:function(){return F},bufferToggle:function(){return le},bufferWhen:function(){return be},catchError:function(){return _t.K},combineAll:function(){return Ft},combineLatest:function(){return Ke},concat:function(){return xt},concatAll:function(){return vt.u},concatMap:function(){return Qt.b},concatMapTo:function(){return Ht},count:function(){return Ct.Q},debounce:function(){return qt},debounceTime:function(){return Nt.b},defaultIfEmpty:function(){return rn.d},delay:function(){return kn.g},delayWhen:function(){return Rn},dematerialize:function(){return ut},distinct:function(){return ye},distinctUntilChanged:function(){return ct.x},distinctUntilKeyChanged:function(){return ft},elementAt:function(){return ln},endWith:function(){return Tn},every:function(){return In},exhaust:function(){return Sn},exhaustMap:function(){return Rt},expand:function(){return rt},filter:function(){return Kt.h},finalize:function(){return Ne.x},find:function(){return Le},findIndex:function(){return an},first:function(){return jn.P},flatMap:function(){return Vt.VS},groupBy:function(){return Rr.v},ignoreElements:function(){return Hr},isEmpty:function(){return co},last:function(){return po.Z},map:function(){return Ut.U},mapTo:function(){return Xo.h},materialize:function(){return no},max:function(){return Wn},merge:function(){return jt},mergeAll:function(){return Pt.J},mergeMap:function(){return Vt.zg},mergeMapTo:function(){return Gt},mergeScan:function(){return Xt},min:function(){return zn},multicast:function(){return Vn.O},observeOn:function(){return si.QV},onErrorResumeNext:function(){return Si},pairwise:function(){return Io.G},partition:function(){return ko},pluck:function(){return ii},publish:function(){return ji},publishBehavior:function(){return Vo},publishLast:function(){return Qi},publishReplay:function(){return vn},race:function(){return ho},reduce:function(){return ki},refCount:function(){return Ui.x},repeat:function(){return xi},repeatWhen:function(){return fa},retry:function(){return fs},retryWhen:function(){return ka},sample:function(){return ma},sampleTime:function(){return ga},scan:function(){return fo.R},sequenceEqual:function(){return Hi},share:function(){return Ha.B},shareReplay:function(){return Pu.d},single:function(){return Ki},skip:function(){return tn.T},skipLast:function(){return tu},skipUntil:function(){return pe},skipWhile:function(){return We},startWith:function(){return _e.O},subscribeOn:function(){return Re},switchAll:function(){return gt},switchMap:function(){return St.w},switchMapTo:function(){return Jr},take:function(){return nn.q},takeLast:function(){return fi.h},takeUntil:function(){return Vr.R},takeWhile:function(){return Pi.o},tap:function(){return _a.b},throttle:function(){return li.P},throttleTime:function(){return Mi},throwIfEmpty:function(){return Jt.T},timeInterval:function(){return ya.J},timeout:function(){return Mr},timeoutWith:function(){return Mp},timestamp:function(){return Ap.A},toArray:function(){return Dp},window:function(){return Op},windowCount:function(){return Ev},windowTime:function(){return ne},windowToggle:function(){return cn},windowWhen:function(){return Qn},withLatestFrom:function(){return br},zip:function(){return oi},zipAll:function(){return Ao}});var B=f(67494),U=f(54562),V=f(88009),Z=f(10509),w=f(97154),N=f(18967),b=f(14105),_=f(32124);function I(Be){return function(Ee){return Ee.lift(new D(Be))}}var D=function(){function Be(Ye){(0,N.Z)(this,Be),this.closingNotifier=Ye}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new A(Ee,this.closingNotifier))}}]),Be}(),A=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze){var nt;return(0,N.Z)(this,Ee),(nt=Ye.call(this,Ue)).buffer=[],nt.add((0,_.ft)(Ze,new _.IY((0,V.Z)(nt)))),nt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.buffer.push(Ze)}},{key:"notifyNext",value:function(){var Ze=this.buffer;this.buffer=[],this.destination.next(Ze)}}]),Ee}(_.Ds),S=f(13920),v=f(89200),g=f(39874);function T(Be){var Ye=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(Ue){return Ue.lift(new R(Be,Ye))}}var R=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.bufferSize=Ye,this.startBufferEvery=Ee,this.subscriberClass=Ee&&Ye!==Ee?E:k}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new this.subscriberClass(Ee,this.bufferSize,this.startBufferEvery))}}]),Be}(),k=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze){var nt;return(0,N.Z)(this,Ee),(nt=Ye.call(this,Ue)).bufferSize=Ze,nt.buffer=[],nt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){var nt=this.buffer;nt.push(Ze),nt.length==this.bufferSize&&(this.destination.next(nt),this.buffer=[])}},{key:"_complete",value:function(){var Ze=this.buffer;Ze.length>0&&this.destination.next(Ze),(0,S.Z)((0,v.Z)(Ee.prototype),"_complete",this).call(this)}}]),Ee}(g.L),E=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).bufferSize=Ze,Tt.startBufferEvery=nt,Tt.buffers=[],Tt.count=0,Tt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){var nt=this.bufferSize,Tt=this.startBufferEvery,sn=this.buffers,bn=this.count;this.count++,bn%Tt==0&&sn.push([]);for(var Tr=sn.length;Tr--;){var Ii=sn[Tr];Ii.push(Ze),Ii.length===nt&&(sn.splice(Tr,1),this.destination.next(Ii))}}},{key:"_complete",value:function(){for(var Ze=this.buffers,nt=this.destination;Ze.length>0;){var Tt=Ze.shift();Tt.length>0&&nt.next(Tt)}(0,S.Z)((0,v.Z)(Ee.prototype),"_complete",this).call(this)}}]),Ee}(g.L),x=f(46813),O=f(91299);function F(Be){var Ye=arguments.length,Ee=x.P;(0,O.K)(arguments[arguments.length-1])&&(Ee=arguments[arguments.length-1],Ye--);var Ue=null;Ye>=2&&(Ue=arguments[1]);var Ze=Number.POSITIVE_INFINITY;return Ye>=3&&(Ze=arguments[2]),function(Tt){return Tt.lift(new z(Be,Ue,Ze,Ee))}}var z=function(){function Be(Ye,Ee,Ue,Ze){(0,N.Z)(this,Be),this.bufferTimeSpan=Ye,this.bufferCreationInterval=Ee,this.maxBufferSize=Ue,this.scheduler=Ze}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new j(Ee,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))}}]),Be}(),K=function Be(){(0,N.Z)(this,Be),this.buffer=[]},j=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt,sn){var bn;(0,N.Z)(this,Ee),(bn=Ye.call(this,Ue)).bufferTimeSpan=Ze,bn.bufferCreationInterval=nt,bn.maxBufferSize=Tt,bn.scheduler=sn,bn.contexts=[];var Tr=bn.openContext();if(bn.timespanOnly=null==nt||nt<0,bn.timespanOnly){var Ii={subscriber:(0,V.Z)(bn),context:Tr,bufferTimeSpan:Ze};bn.add(Tr.closeAction=sn.schedule(J,Ze,Ii))}else{var ea={subscriber:(0,V.Z)(bn),context:Tr},Da={bufferTimeSpan:Ze,bufferCreationInterval:nt,subscriber:(0,V.Z)(bn),scheduler:sn};bn.add(Tr.closeAction=sn.schedule($,Ze,ea)),bn.add(sn.schedule(ee,nt,Da))}return bn}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){for(var sn,nt=this.contexts,Tt=nt.length,bn=0;bn0;){var Tt=Ze.shift();nt.next(Tt.buffer)}(0,S.Z)((0,v.Z)(Ee.prototype),"_complete",this).call(this)}},{key:"_unsubscribe",value:function(){this.contexts=null}},{key:"onBufferFull",value:function(Ze){this.closeContext(Ze);var nt=Ze.closeAction;if(nt.unsubscribe(),this.remove(nt),!this.closed&&this.timespanOnly){Ze=this.openContext();var Tt=this.bufferTimeSpan;this.add(Ze.closeAction=this.scheduler.schedule(J,Tt,{subscriber:this,context:Ze,bufferTimeSpan:Tt}))}}},{key:"openContext",value:function(){var Ze=new K;return this.contexts.push(Ze),Ze}},{key:"closeContext",value:function(Ze){this.destination.next(Ze.buffer);var nt=this.contexts;(nt?nt.indexOf(Ze):-1)>=0&&nt.splice(nt.indexOf(Ze),1)}}]),Ee}(g.L);function J(Be){var Ye=Be.subscriber,Ee=Be.context;Ee&&Ye.closeContext(Ee),Ye.closed||(Be.context=Ye.openContext(),Be.context.closeAction=this.schedule(Be,Be.bufferTimeSpan))}function ee(Be){var Ye=Be.bufferCreationInterval,Ee=Be.bufferTimeSpan,Ue=Be.subscriber,Ze=Be.scheduler,nt=Ue.openContext();Ue.closed||(Ue.add(nt.closeAction=Ze.schedule($,Ee,{subscriber:Ue,context:nt})),this.schedule(Be,Ye))}function $(Be){Be.subscriber.closeContext(Be.context)}var ae=f(5051),se=f(61454),ce=f(7283);function le(Be,Ye){return function(Ue){return Ue.lift(new oe(Be,Ye))}}var oe=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.openings=Ye,this.closingSelector=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Ae(Ee,this.openings,this.closingSelector))}}]),Be}(),Ae=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).closingSelector=nt,Tt.contexts=[],Tt.add((0,se.D)((0,V.Z)(Tt),Ze)),Tt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){for(var nt=this.contexts,Tt=nt.length,sn=0;sn0;){var Tt=nt.shift();Tt.subscription.unsubscribe(),Tt.buffer=null,Tt.subscription=null}this.contexts=null,(0,S.Z)((0,v.Z)(Ee.prototype),"_error",this).call(this,Ze)}},{key:"_complete",value:function(){for(var Ze=this.contexts;Ze.length>0;){var nt=Ze.shift();this.destination.next(nt.buffer),nt.subscription.unsubscribe(),nt.buffer=null,nt.subscription=null}this.contexts=null,(0,S.Z)((0,v.Z)(Ee.prototype),"_complete",this).call(this)}},{key:"notifyNext",value:function(Ze,nt){Ze?this.closeBuffer(Ze):this.openBuffer(nt)}},{key:"notifyComplete",value:function(Ze){this.closeBuffer(Ze.context)}},{key:"openBuffer",value:function(Ze){try{var Tt=this.closingSelector.call(this,Ze);Tt&&this.trySubscribe(Tt)}catch(sn){this._error(sn)}}},{key:"closeBuffer",value:function(Ze){var nt=this.contexts;if(nt&&Ze){var sn=Ze.subscription;this.destination.next(Ze.buffer),nt.splice(nt.indexOf(Ze),1),this.remove(sn),sn.unsubscribe()}}},{key:"trySubscribe",value:function(Ze){var nt=this.contexts,sn=new ae.w,bn={buffer:[],subscription:sn};nt.push(bn);var Tr=(0,se.D)(this,Ze,bn);!Tr||Tr.closed?this.closeBuffer(bn):(Tr.context=bn,this.add(Tr),sn.add(Tr))}}]),Ee}(ce.L);function be(Be){return function(Ye){return Ye.lift(new it(Be))}}var it=function(){function Be(Ye){(0,N.Z)(this,Be),this.closingSelector=Ye}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new qe(Ee,this.closingSelector))}}]),Be}(),qe=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze){var nt;return(0,N.Z)(this,Ee),(nt=Ye.call(this,Ue)).closingSelector=Ze,nt.subscribing=!1,nt.openBuffer(),nt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.buffer.push(Ze)}},{key:"_complete",value:function(){var Ze=this.buffer;Ze&&this.destination.next(Ze),(0,S.Z)((0,v.Z)(Ee.prototype),"_complete",this).call(this)}},{key:"_unsubscribe",value:function(){this.buffer=void 0,this.subscribing=!1}},{key:"notifyNext",value:function(){this.openBuffer()}},{key:"notifyComplete",value:function(){this.subscribing?this.complete():this.openBuffer()}},{key:"openBuffer",value:function(){var Tt,Ze=this.closingSubscription;Ze&&(this.remove(Ze),Ze.unsubscribe()),this.buffer&&this.destination.next(this.buffer),this.buffer=[];try{Tt=(0,this.closingSelector)()}catch(bn){return this.error(bn)}Ze=new ae.w,this.closingSubscription=Ze,this.add(Ze),this.subscribing=!0,Ze.add((0,_.ft)(Tt,new _.IY(this))),this.subscribing=!1}}]),Ee}(_.Ds),_t=f(13426),yt=f(81370);function Ft(Be){return function(Ye){return Ye.lift(new yt.Ms(Be))}}var xe=f(62467),De=f(78985),je=f(61493);function Ke(){for(var Be=arguments.length,Ye=new Array(Be),Ee=0;Ee=2;return function(Ue){return Ue.pipe((0,Kt.h)(function(Ze,nt){return nt===Be}),(0,nn.q)(1),Ee?(0,rn.d)(Ye):(0,Jt.T)(function(){return new Yt.W}))}}var yn=f(43161);function Tn(){for(var Be=arguments.length,Ye=new Array(Be),Ee=0;Ee1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY,Ee=arguments.length>2?arguments[2]:void 0;return Ye=(Ye||0)<1?Number.POSITIVE_INFINITY:Ye,function(Ue){return Ue.lift(new he(Be,Ye,Ee))}}var he=function(){function Be(Ye,Ee,Ue){(0,N.Z)(this,Be),this.project=Ye,this.concurrent=Ee,this.scheduler=Ue}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Ie(Ee,this.project,this.concurrent,this.scheduler))}}]),Be}(),Ie=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt){var sn;return(0,N.Z)(this,Ee),(sn=Ye.call(this,Ue)).project=Ze,sn.concurrent=nt,sn.scheduler=Tt,sn.index=0,sn.active=0,sn.hasCompleted=!1,nt0&&this._next(Ze.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()}}],[{key:"dispatch",value:function(Ze){Ze.subscriber.subscribeToProjection(Ze.result,Ze.value,Ze.index)}}]),Ee}(_.Ds),Ne=f(59803);function Le(Be,Ye){if("function"!=typeof Be)throw new TypeError("predicate is not a function");return function(Ee){return Ee.lift(new ze(Be,Ee,!1,Ye))}}var ze=function(){function Be(Ye,Ee,Ue,Ze){(0,N.Z)(this,Be),this.predicate=Ye,this.source=Ee,this.yieldIndex=Ue,this.thisArg=Ze}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new At(Ee,this.predicate,this.source,this.yieldIndex,this.thisArg))}}]),Be}(),At=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt,sn){var bn;return(0,N.Z)(this,Ee),(bn=Ye.call(this,Ue)).predicate=Ze,bn.source=nt,bn.yieldIndex=Tt,bn.thisArg=sn,bn.index=0,bn}return(0,b.Z)(Ee,[{key:"notifyComplete",value:function(Ze){var nt=this.destination;nt.next(Ze),nt.complete(),this.unsubscribe()}},{key:"_next",value:function(Ze){var nt=this.predicate,Tt=this.thisArg,sn=this.index++;try{nt.call(Tt||this,Ze,sn,this.source)&&this.notifyComplete(this.yieldIndex?sn:Ze)}catch(Tr){this.destination.error(Tr)}}},{key:"_complete",value:function(){this.notifyComplete(this.yieldIndex?-1:void 0)}}]),Ee}(g.L);function an(Be,Ye){return function(Ee){return Ee.lift(new ze(Be,Ee,!0,Ye))}}var jn=f(64233),Rr=f(86072);function Hr(){return function(Ye){return Ye.lift(new yr)}}var yr=function(){function Be(){(0,N.Z)(this,Be)}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Yr(Ee))}}]),Be}(),Yr=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(){return(0,N.Z)(this,Ee),Ye.apply(this,arguments)}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){}}]),Ee}(g.L);function co(){return function(Be){return Be.lift(new Zi)}}var Zi=function(){function Be(){(0,N.Z)(this,Be)}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new bo(Ee))}}]),Be}(),bo=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue){return(0,N.Z)(this,Ee),Ye.call(this,Ue)}return(0,b.Z)(Ee,[{key:"notifyComplete",value:function(Ze){var nt=this.destination;nt.next(Ze),nt.complete()}},{key:"_next",value:function(Ze){this.notifyComplete(!1)}},{key:"_complete",value:function(){this.notifyComplete(!0)}}]),Ee}(g.L),po=f(99583),Xo=f(12698),Ei=f(80286);function no(){return function(Ye){return Ye.lift(new vi)}}var vi=function(){function Be(){(0,N.Z)(this,Be)}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Yi(Ee))}}]),Be}(),Yi=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue){return(0,N.Z)(this,Ee),Ye.call(this,Ue)}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.destination.next(Ei.P.createNext(Ze))}},{key:"_error",value:function(Ze){var nt=this.destination;nt.next(Ei.P.createError(Ze)),nt.complete()}},{key:"_complete",value:function(){var Ze=this.destination;Ze.next(Ei.P.createComplete()),Ze.complete()}}]),Ee}(g.L),fo=f(31927),fi=f(64397),Uo=f(96194);function ki(Be,Ye){return arguments.length>=2?function(Ue){return(0,Uo.z)((0,fo.R)(Be,Ye),(0,fi.h)(1),(0,rn.d)(Ye))(Ue)}:function(Ue){return(0,Uo.z)((0,fo.R)(function(Ze,nt,Tt){return Be(Ze,nt,Tt+1)}),(0,fi.h)(1))(Ue)}}function Wn(Be){return ki("function"==typeof Be?function(Ee,Ue){return Be(Ee,Ue)>0?Ee:Ue}:function(Ee,Ue){return Ee>Ue?Ee:Ue})}var Ot=f(55371);function jt(){for(var Be=arguments.length,Ye=new Array(Be),Ee=0;Ee2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return"function"==typeof Ye?(0,Vt.zg)(function(){return Be},Ye,Ee):("number"==typeof Ye&&(Ee=Ye),(0,Vt.zg)(function(){return Be},Ee))}function Xt(Be,Ye){var Ee=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.POSITIVE_INFINITY;return function(Ue){return Ue.lift(new gn(Be,Ye,Ee))}}var gn=function(){function Be(Ye,Ee,Ue){(0,N.Z)(this,Be),this.accumulator=Ye,this.seed=Ee,this.concurrent=Ue}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Gn(Ee,this.accumulator,this.seed,this.concurrent))}}]),Be}(),Gn=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt){var sn;return(0,N.Z)(this,Ee),(sn=Ye.call(this,Ue)).accumulator=Ze,sn.acc=nt,sn.concurrent=Tt,sn.hasValue=!1,sn.hasCompleted=!1,sn.buffer=[],sn.active=0,sn.index=0,sn}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){if(this.active0?this._next(Ze.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())}}]),Ee}(_.Ds);function zn(Be){return ki("function"==typeof Be?function(Ee,Ue){return Be(Ee,Ue)<0?Ee:Ue}:function(Ee,Ue){return Ee0&&void 0!==arguments[0]?arguments[0]:-1;return function(Ye){return 0===Be?(0,pa.c)():Ye.lift(new So(Be<0?-1:Be-1,Ye))}}var So=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.count=Ye,this.source=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Fi(Ee,this.count,this.source))}}]),Be}(),Fi=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).count=Ze,Tt.source=nt,Tt}return(0,b.Z)(Ee,[{key:"complete",value:function(){if(!this.isStopped){var Ze=this.source,nt=this.count;if(0===nt)return(0,S.Z)((0,v.Z)(Ee.prototype),"complete",this).call(this);nt>-1&&(this.count=nt-1),Ze.subscribe(this._unsubscribeAndRecycle())}}}]),Ee}(g.L);function fa(Be){return function(Ye){return Ye.lift(new Mo(Be))}}var Mo=function(){function Be(Ye){(0,N.Z)(this,Be),this.notifier=Ye}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Ro(Ee,this.notifier,Ue))}}]),Be}(),Ro=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).notifier=Ze,Tt.source=nt,Tt.sourceIsBeingSubscribedTo=!0,Tt}return(0,b.Z)(Ee,[{key:"notifyNext",value:function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)}},{key:"notifyComplete",value:function(){if(!1===this.sourceIsBeingSubscribedTo)return(0,S.Z)((0,v.Z)(Ee.prototype),"complete",this).call(this)}},{key:"complete",value:function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return(0,S.Z)((0,v.Z)(Ee.prototype),"complete",this).call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}}},{key:"_unsubscribe",value:function(){var Ze=this.notifications,nt=this.retriesSubscription;Ze&&(Ze.unsubscribe(),this.notifications=void 0),nt&&(nt.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0}},{key:"_unsubscribeAndRecycle",value:function(){var Ze=this._unsubscribe;return this._unsubscribe=null,(0,S.Z)((0,v.Z)(Ee.prototype),"_unsubscribeAndRecycle",this).call(this),this._unsubscribe=Ze,this}},{key:"subscribeToRetries",value:function(){var Ze;this.notifications=new io.xQ;try{Ze=(0,this.notifier)(this.notifications)}catch(Tt){return(0,S.Z)((0,v.Z)(Ee.prototype),"complete",this).call(this)}this.retries=Ze,this.retriesSubscription=(0,_.ft)(Ze,new _.IY(this))}}]),Ee}(_.Ds);function fs(){var Be=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return function(Ye){return Ye.lift(new To(Be,Ye))}}var To=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.count=Ye,this.source=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new ha(Ee,this.count,this.source))}}]),Be}(),ha=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).count=Ze,Tt.source=nt,Tt}return(0,b.Z)(Ee,[{key:"error",value:function(Ze){if(!this.isStopped){var nt=this.source,Tt=this.count;if(0===Tt)return(0,S.Z)((0,v.Z)(Ee.prototype),"error",this).call(this,Ze);Tt>-1&&(this.count=Tt-1),nt.subscribe(this._unsubscribeAndRecycle())}}}]),Ee}(g.L);function ka(Be){return function(Ye){return Ye.lift(new qo(Be,Ye))}}var qo=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.notifier=Ye,this.source=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new xo(Ee,this.notifier,this.source))}}]),Be}(),xo=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).notifier=Ze,Tt.source=nt,Tt}return(0,b.Z)(Ee,[{key:"error",value:function(Ze){if(!this.isStopped){var nt=this.errors,Tt=this.retries,sn=this.retriesSubscription;if(Tt)this.errors=void 0,this.retriesSubscription=void 0;else{nt=new io.xQ;try{Tt=(0,this.notifier)(nt)}catch(Tr){return(0,S.Z)((0,v.Z)(Ee.prototype),"error",this).call(this,Tr)}sn=(0,_.ft)(Tt,new _.IY(this))}this._unsubscribeAndRecycle(),this.errors=nt,this.retries=Tt,this.retriesSubscription=sn,nt.next(Ze)}}},{key:"_unsubscribe",value:function(){var Ze=this.errors,nt=this.retriesSubscription;Ze&&(Ze.unsubscribe(),this.errors=void 0),nt&&(nt.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0}},{key:"notifyNext",value:function(){var Ze=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=Ze,this.source.subscribe(this)}}]),Ee}(_.Ds),Ui=f(26575);function ma(Be){return function(Ye){return Ye.lift(new zi(Be))}}var zi=function(){function Be(Ye){(0,N.Z)(this,Be),this.notifier=Ye}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){var Ze=new va(Ee),nt=Ue.subscribe(Ze);return nt.add((0,_.ft)(this.notifier,new _.IY(Ze))),nt}}]),Be}(),va=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(){var Ue;return(0,N.Z)(this,Ee),(Ue=Ye.apply(this,arguments)).hasValue=!1,Ue}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.value=Ze,this.hasValue=!0}},{key:"notifyNext",value:function(){this.emitValue()}},{key:"notifyComplete",value:function(){this.emitValue()}},{key:"emitValue",value:function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))}}]),Ee}(_.Ds);function ga(Be){var Ye=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x.P;return function(Ee){return Ee.lift(new gr(Be,Ye))}}var gr=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.period=Ye,this.scheduler=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Bn(Ee,this.period,this.scheduler))}}]),Be}(),Bn=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).period=Ze,Tt.scheduler=nt,Tt.hasValue=!1,Tt.add(nt.schedule(Ma,Ze,{subscriber:(0,V.Z)(Tt),period:Ze})),Tt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.lastValue=Ze,this.hasValue=!0}},{key:"notifyNext",value:function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))}}]),Ee}(g.L);function Ma(Be){var Ee=Be.period;Be.subscriber.notifyNext(),this.schedule(Be,Ee)}function Hi(Be,Ye){return function(Ee){return Ee.lift(new Ua(Be,Ye))}}var Ua=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.compareTo=Ye,this.comparator=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new ar(Ee,this.compareTo,this.comparator))}}]),Be}(),ar=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).compareTo=Ze,Tt.comparator=nt,Tt._a=[],Tt._b=[],Tt._oneComplete=!1,Tt.destination.add(Ze.subscribe(new Wi(Ue,(0,V.Z)(Tt)))),Tt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(Ze),this.checkValues())}},{key:"_complete",value:function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()}},{key:"checkValues",value:function(){for(var Ze=this._a,nt=this._b,Tt=this.comparator;Ze.length>0&&nt.length>0;){var sn=Ze.shift(),bn=nt.shift(),Tr=!1;try{Tr=Tt?Tt(sn,bn):sn===bn}catch(Ii){this.destination.error(Ii)}Tr||this.emit(!1)}}},{key:"emit",value:function(Ze){var nt=this.destination;nt.next(Ze),nt.complete()}},{key:"nextB",value:function(Ze){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(Ze),this.checkValues())}},{key:"completeB",value:function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0}}]),Ee}(g.L),Wi=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze){var nt;return(0,N.Z)(this,Ee),(nt=Ye.call(this,Ue)).parent=Ze,nt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.parent.nextB(Ze)}},{key:"_error",value:function(Ze){this.parent.error(Ze),this.unsubscribe()}},{key:"_complete",value:function(){this.parent.completeB(),this.unsubscribe()}}]),Ee}(g.L),Ha=f(16338),Pu=f(61106),Ka=f(64646);function Ki(Be){return function(Ye){return Ye.lift(new Va(Be,Ye))}}var Va=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.predicate=Ye,this.source=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new yl(Ee,this.predicate,this.source))}}]),Be}(),yl=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).predicate=Ze,Tt.source=nt,Tt.seenValue=!1,Tt.index=0,Tt}return(0,b.Z)(Ee,[{key:"applySingleValue",value:function(Ze){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=Ze)}},{key:"_next",value:function(Ze){var nt=this.index++;this.predicate?this.tryNext(Ze,nt):this.applySingleValue(Ze)}},{key:"tryNext",value:function(Ze,nt){try{this.predicate(Ze,nt,this.source)&&this.applySingleValue(Ze)}catch(Tt){this.destination.error(Tt)}}},{key:"_complete",value:function(){var Ze=this.destination;this.index>0?(Ze.next(this.seenValue?this.singleValue:void 0),Ze.complete()):Ze.error(new Ka.K)}}]),Ee}(g.L),tn=f(18756);function tu(Be){return function(Ye){return Ye.lift(new bl(Be))}}var bl=function(){function Be(Ye){if((0,N.Z)(this,Be),this._skipCount=Ye,this._skipCount<0)throw new Yt.W}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(0===this._skipCount?new g.L(Ee):new Cl(Ee,this._skipCount))}}]),Be}(),Cl=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze){var nt;return(0,N.Z)(this,Ee),(nt=Ye.call(this,Ue))._skipCount=Ze,nt._count=0,nt._ring=new Array(Ze),nt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){var nt=this._skipCount,Tt=this._count++;if(Tt1&&void 0!==arguments[1]?arguments[1]:0;return function(Ue){return Ue.lift(new Ge(Be,Ye))}}var Ge=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.scheduler=Ye,this.delay=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return new Ce.e(Ue,this.delay,this.scheduler).subscribe(Ee)}}]),Be}(),St=f(34487),ht=f(57070);function gt(){return(0,St.w)(ht.y)}function Jr(Be,Ye){return Ye?(0,St.w)(function(){return Be},Ye):(0,St.w)(function(){return Be})}var Vr=f(44213),Pi=f(49196),_a=f(59371),li=f(243);function Mi(Be){var Ye=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x.P,Ee=arguments.length>2&&void 0!==arguments[2]?arguments[2]:li.d;return function(Ue){return Ue.lift(new Sl(Be,Ye,Ee.leading,Ee.trailing))}}var Sl=function(){function Be(Ye,Ee,Ue,Ze){(0,N.Z)(this,Be),this.duration=Ye,this.scheduler=Ee,this.leading=Ue,this.trailing=Ze}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Aa(Ee,this.duration,this.scheduler,this.leading,this.trailing))}}]),Be}(),Aa=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt,sn){var bn;return(0,N.Z)(this,Ee),(bn=Ye.call(this,Ue)).duration=Ze,bn.scheduler=nt,bn.leading=Tt,bn.trailing=sn,bn._hasTrailingValue=!1,bn._trailingValue=null,bn}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){this.throttled?this.trailing&&(this._trailingValue=Ze,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Xa,this.duration,{subscriber:this})),this.leading?this.destination.next(Ze):this.trailing&&(this._trailingValue=Ze,this._hasTrailingValue=!0))}},{key:"_complete",value:function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}},{key:"clearThrottle",value:function(){var Ze=this.throttled;Ze&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),Ze.unsubscribe(),this.remove(Ze),this.throttled=null)}}]),Ee}(g.L);function Xa(Be){Be.subscriber.clearThrottle()}var ya=f(73445),Ms=f(98691),kp=f(88972);function Mp(Be,Ye){var Ee=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x.P;return function(Ue){var Ze=(0,kp.J)(Be),nt=Ze?+Be-Ee.now():Math.abs(Be);return Ue.lift(new Ws(nt,Ze,Ye,Ee))}}var Ws=function(){function Be(Ye,Ee,Ue,Ze){(0,N.Z)(this,Be),this.waitFor=Ye,this.absoluteTimeout=Ee,this.withObservable=Ue,this.scheduler=Ze}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new yc(Ee,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))}}]),Be}(),yc=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt,sn){var bn;return(0,N.Z)(this,Ee),(bn=Ye.call(this,Ue)).absoluteTimeout=Ze,bn.waitFor=nt,bn.withObservable=Tt,bn.scheduler=sn,bn.scheduleTimeout(),bn}return(0,b.Z)(Ee,[{key:"scheduleTimeout",value:function(){var Ze=this.action;Ze?this.action=Ze.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(Ee.dispatchTimeout,this.waitFor,this))}},{key:"_next",value:function(Ze){this.absoluteTimeout||this.scheduleTimeout(),(0,S.Z)((0,v.Z)(Ee.prototype),"_next",this).call(this,Ze)}},{key:"_unsubscribe",value:function(){this.action=void 0,this.scheduler=null,this.withObservable=null}}],[{key:"dispatchTimeout",value:function(Ze){var nt=Ze.withObservable;Ze._unsubscribeAndRecycle(),Ze.add((0,_.ft)(nt,new _.IY(Ze)))}}]),Ee}(_.Ds),Tl=f(11363);function Mr(Be){var Ye=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x.P;return Mp(Be,(0,Tl._)(new Ms.W),Ye)}var Ap=f(63706);function hd(Be,Ye,Ee){return 0===Ee?[Ye]:(Be.push(Ye),Be)}function Dp(){return ki(hd,[])}function Op(Be){return function(Ee){return Ee.lift(new md(Be))}}var md=function(){function Be(Ye){(0,N.Z)(this,Be),this.windowBoundaries=Ye}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){var Ze=new nu(Ee),nt=Ue.subscribe(Ze);return nt.closed||Ze.add((0,_.ft)(this.windowBoundaries,new _.IY(Ze))),nt}}]),Be}(),nu=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue){var Ze;return(0,N.Z)(this,Ee),(Ze=Ye.call(this,Ue)).window=new io.xQ,Ue.next(Ze.window),Ze}return(0,b.Z)(Ee,[{key:"notifyNext",value:function(){this.openWindow()}},{key:"notifyError",value:function(Ze){this._error(Ze)}},{key:"notifyComplete",value:function(){this._complete()}},{key:"_next",value:function(Ze){this.window.next(Ze)}},{key:"_error",value:function(Ze){this.window.error(Ze),this.destination.error(Ze)}},{key:"_complete",value:function(){this.window.complete(),this.destination.complete()}},{key:"_unsubscribe",value:function(){this.window=null}},{key:"openWindow",value:function(){var Ze=this.window;Ze&&Ze.complete();var nt=this.destination,Tt=this.window=new io.xQ;nt.next(Tt)}}]),Ee}(_.Ds);function Ev(Be){var Ye=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(Ue){return Ue.lift(new Se(Be,Ye))}}var Se=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.windowSize=Ye,this.startWindowEvery=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new ge(Ee,this.windowSize,this.startWindowEvery))}}]),Be}(),ge=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).destination=Ue,Tt.windowSize=Ze,Tt.startWindowEvery=nt,Tt.windows=[new io.xQ],Tt.count=0,Ue.next(Tt.windows[0]),Tt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){for(var nt=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,Tt=this.destination,sn=this.windowSize,bn=this.windows,Tr=bn.length,Ii=0;Ii=0&&ea%nt==0&&!this.closed&&bn.shift().complete(),++this.count%nt==0&&!this.closed){var Da=new io.xQ;bn.push(Da),Tt.next(Da)}}},{key:"_error",value:function(Ze){var nt=this.windows;if(nt)for(;nt.length>0&&!this.closed;)nt.shift().error(Ze);this.destination.error(Ze)}},{key:"_complete",value:function(){var Ze=this.windows;if(Ze)for(;Ze.length>0&&!this.closed;)Ze.shift().complete();this.destination.complete()}},{key:"_unsubscribe",value:function(){this.count=0,this.windows=null}}]),Ee}(g.L),Q=f(11705);function ne(Be){var Ye=x.P,Ee=null,Ue=Number.POSITIVE_INFINITY;return(0,O.K)(arguments[3])&&(Ye=arguments[3]),(0,O.K)(arguments[2])?Ye=arguments[2]:(0,Q.k)(arguments[2])&&(Ue=Number(arguments[2])),(0,O.K)(arguments[1])?Ye=arguments[1]:(0,Q.k)(arguments[1])&&(Ee=Number(arguments[1])),function(nt){return nt.lift(new ke(Be,Ee,Ue,Ye))}}var ke=function(){function Be(Ye,Ee,Ue,Ze){(0,N.Z)(this,Be),this.windowTimeSpan=Ye,this.windowCreationInterval=Ee,this.maxWindowSize=Ue,this.scheduler=Ze}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new lt(Ee,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))}}]),Be}(),Ve=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(){var Ue;return(0,N.Z)(this,Ee),(Ue=Ye.apply(this,arguments))._numberOfNextedValues=0,Ue}return(0,b.Z)(Ee,[{key:"next",value:function(Ze){this._numberOfNextedValues++,(0,S.Z)((0,v.Z)(Ee.prototype),"next",this).call(this,Ze)}},{key:"numberOfNextedValues",get:function(){return this._numberOfNextedValues}}]),Ee}(io.xQ),lt=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt,Tt,sn){var bn;(0,N.Z)(this,Ee),(bn=Ye.call(this,Ue)).destination=Ue,bn.windowTimeSpan=Ze,bn.windowCreationInterval=nt,bn.maxWindowSize=Tt,bn.scheduler=sn,bn.windows=[];var Tr=bn.openWindow();if(null!==nt&&nt>=0){var Ii={subscriber:(0,V.Z)(bn),window:Tr,context:null},ea={windowTimeSpan:Ze,windowCreationInterval:nt,subscriber:(0,V.Z)(bn),scheduler:sn};bn.add(sn.schedule($t,Ze,Ii)),bn.add(sn.schedule(Zt,nt,ea))}else{var Da={subscriber:(0,V.Z)(bn),window:Tr,windowTimeSpan:Ze};bn.add(sn.schedule(wt,Ze,Da))}return bn}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){for(var nt=this.windows,Tt=nt.length,sn=0;sn=this.maxWindowSize&&this.closeWindow(bn))}}},{key:"_error",value:function(Ze){for(var nt=this.windows;nt.length>0;)nt.shift().error(Ze);this.destination.error(Ze)}},{key:"_complete",value:function(){for(var Ze=this.windows;Ze.length>0;){var nt=Ze.shift();nt.closed||nt.complete()}this.destination.complete()}},{key:"openWindow",value:function(){var Ze=new Ve;return this.windows.push(Ze),this.destination.next(Ze),Ze}},{key:"closeWindow",value:function(Ze){Ze.complete();var nt=this.windows;nt.splice(nt.indexOf(Ze),1)}}]),Ee}(g.L);function wt(Be){var Ye=Be.subscriber,Ee=Be.windowTimeSpan,Ue=Be.window;Ue&&Ye.closeWindow(Ue),Be.window=Ye.openWindow(),this.schedule(Be,Ee)}function Zt(Be){var Ye=Be.windowTimeSpan,Ee=Be.subscriber,Ue=Be.scheduler,Ze=Be.windowCreationInterval,nt=Ee.openWindow(),sn={action:this,subscription:null};sn.subscription=Ue.schedule($t,Ye,{subscriber:Ee,window:nt,context:sn}),this.add(sn.subscription),this.schedule(Be,Ze)}function $t(Be){var Ye=Be.subscriber,Ee=Be.window,Ue=Be.context;Ue&&Ue.action&&Ue.subscription&&Ue.action.remove(Ue.subscription),Ye.closeWindow(Ee)}function cn(Be,Ye){return function(Ee){return Ee.lift(new Dn(Be,Ye))}}var Dn=function(){function Be(Ye,Ee){(0,N.Z)(this,Be),this.openings=Ye,this.closingSelector=Ee}return(0,b.Z)(Be,[{key:"call",value:function(Ee,Ue){return Ue.subscribe(new Un(Ee,this.openings,this.closingSelector))}}]),Be}(),Un=function(Be){(0,Z.Z)(Ee,Be);var Ye=(0,w.Z)(Ee);function Ee(Ue,Ze,nt){var Tt;return(0,N.Z)(this,Ee),(Tt=Ye.call(this,Ue)).openings=Ze,Tt.closingSelector=nt,Tt.contexts=[],Tt.add(Tt.openSubscription=(0,se.D)((0,V.Z)(Tt),Ze,Ze)),Tt}return(0,b.Z)(Ee,[{key:"_next",value:function(Ze){var nt=this.contexts;if(nt)for(var Tt=nt.length,sn=0;sn0&&void 0!==arguments[0]?arguments[0]:null;Ze&&(this.remove(Ze),Ze.unsubscribe());var nt=this.window;nt&&nt.complete();var sn,Tt=this.window=new io.xQ;this.destination.next(Tt);try{var bn=this.closingSelector;sn=bn()}catch(Tr){return this.destination.error(Tr),void this.window.error(Tr)}this.add(this.closingNotification=(0,se.D)(this,sn))}}]),Ee}(ce.L);function br(){for(var Be=arguments.length,Ye=new Array(Be),Ee=0;Ee0){var bn=sn.indexOf(Tt);-1!==bn&&sn.splice(bn,1)}}},{key:"notifyComplete",value:function(){}},{key:"_next",value:function(Ze){if(0===this.toRespond.length){var nt=[Ze].concat((0,xe.Z)(this.values));this.project?this._tryProject(nt):this.destination.next(nt)}}},{key:"_tryProject",value:function(Ze){var nt;try{nt=this.project.apply(this,Ze)}catch(Tt){return void this.destination.error(Tt)}this.destination.next(nt)}}]),Ee}(ce.L),hi=f(43008);function oi(){for(var Be=arguments.length,Ye=new Array(Be),Ee=0;Ee1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY;(0,B.Z)(this,O),this.subscribedFrame=F,this.unsubscribedFrame=z},v=(f(2808),function(O){(0,w.Z)(z,O);var F=(0,N.Z)(z);function z(K,j){var J;return(0,B.Z)(this,z),(J=F.call(this,function(ee){var $=this,ae=$.logSubscribedFrame(),se=new I.w;return se.add(new I.w(function(){$.logUnsubscribedFrame(ae)})),$.scheduleMessages(ee),se})).messages=K,J.subscriptions=[],J.scheduler=j,J}return(0,U.Z)(z,[{key:"scheduleMessages",value:function(j){for(var J=this.messages.length,ee=0;ee1&&void 0!==arguments[1]?arguments[1]:null,$=[],ae={actual:$,ready:!1},se=z.parseMarblesAsSubscriptions(ee,this.runMode),ce=se.subscribedFrame===Number.POSITIVE_INFINITY?0:se.subscribedFrame,le=se.unsubscribedFrame;this.schedule(function(){oe=j.subscribe(function(be){var it=be;be instanceof b.y&&(it=J.materializeInnerObservable(it,J.frame)),$.push({frame:J.frame,notification:_.P.createNext(it)})},function(be){$.push({frame:J.frame,notification:_.P.createError(be)})},function(){$.push({frame:J.frame,notification:_.P.createComplete()})})},ce),le!==Number.POSITIVE_INFINITY&&this.schedule(function(){return oe.unsubscribe()},le),this.flushTests.push(ae);var Ae=this.runMode;return{toBe:function(it,qe,_t){ae.ready=!0,ae.expected=z.parseMarbles(it,qe,_t,!0,Ae)}}}},{key:"expectSubscriptions",value:function(j){var J={actual:j,ready:!1};this.flushTests.push(J);var ee=this.runMode;return{toBe:function(ae){var se="string"==typeof ae?[ae]:ae;J.ready=!0,J.expected=se.map(function(ce){return z.parseMarblesAsSubscriptions(ce,ee)})}}}},{key:"flush",value:function(){for(var j=this,J=this.hotObservables;J.length>0;)J.shift().setup();(0,V.Z)((0,Z.Z)(z.prototype),"flush",this).call(this),this.flushTests=this.flushTests.filter(function(ee){return!ee.ready||(j.assertDeepEqual(ee.actual,ee.expected),!1)})}},{key:"run",value:function(j){var J=z.frameTimeFactor,ee=this.maxFrames;z.frameTimeFactor=1,this.maxFrames=Number.POSITIVE_INFINITY,this.runMode=!0,k.v.delegate=this;var $={cold:this.createColdObservable.bind(this),hot:this.createHotObservable.bind(this),flush:this.flush.bind(this),expectObservable:this.expectObservable.bind(this),expectSubscriptions:this.expectSubscriptions.bind(this)};try{var ae=j($);return this.flush(),ae}finally{z.frameTimeFactor=J,this.maxFrames=ee,this.runMode=!1,k.v.delegate=void 0}}}],[{key:"parseMarblesAsSubscriptions",value:function(j){var J=this,ee=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof j)return new D(Number.POSITIVE_INFINITY);for(var $=j.length,ae=-1,se=Number.POSITIVE_INFINITY,ce=Number.POSITIVE_INFINITY,le=0,oe=0;oe<$;oe++){var Ae=le,be=function(je){Ae+=je*J.frameTimeFactor},it=j[oe];switch(it){case" ":ee||be(1);break;case"-":be(1);break;case"(":ae=le,be(1);break;case")":ae=-1,be(1);break;case"^":if(se!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");se=ae>-1?ae:le,be(1);break;case"!":if(ce!==Number.POSITIVE_INFINITY)throw new Error("found a second subscription point '^' in a subscription marble diagram. There can only be one.");ce=ae>-1?ae:le;break;default:if(ee&&it.match(/^[0-9]$/)&&(0===oe||" "===j[oe-1])){var qe=j.slice(oe),_t=qe.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);if(_t){oe+=_t[0].length-1;var yt=parseFloat(_t[1]),Ft=_t[2],xe=void 0;switch(Ft){case"ms":xe=yt;break;case"s":xe=1e3*yt;break;case"m":xe=1e3*yt*60}be(xe/this.frameTimeFactor);break}}throw new Error("there can only be '^' and '!' markers in a subscription marble diagram. Found instead '"+it+"'.")}le=Ae}return ce<0?new D(se):new D(se,ce)}},{key:"parseMarbles",value:function(j,J,ee){var $=this,ae=arguments.length>3&&void 0!==arguments[3]&&arguments[3],se=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==j.indexOf("!"))throw new Error('conventional marble diagrams cannot have the unsubscription marker "!"');for(var ce=j.length,le=[],oe=se?j.replace(/^[ ]+/,"").indexOf("^"):j.indexOf("^"),Ae=-1===oe?0:oe*-this.frameTimeFactor,be="object"!=typeof J?function(xt){return xt}:function(xt){return ae&&J[xt]instanceof v?J[xt].messages:J[xt]},it=-1,qe=0;qe-1?it:Ae,notification:Ft}),Ae=_t}return le}}]),z}(R.y)},4194:function(ue,q,f){"use strict";f.r(q),f.d(q,{webSocket:function(){return B.j},WebSocketSubject:function(){return U.p}});var B=f(99298),U=f(46095)},26918:function(ue,q,f){"use strict";f(68663)},56205:function(ue,q){"use strict";var B;!function(){var U=q||{};void 0!==(B=function(){return U}.apply(q,[]))&&(ue.exports=B),U.default=U;var V="http://www.w3.org/2000/xmlns/",w="http://www.w3.org/2000/svg",b=/url\(["']?(.+?)["']?\)/,_={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},I=function(se){return se instanceof HTMLElement||se instanceof SVGElement},D=function(se){if(!I(se))throw new Error("an HTMLElement or SVGElement is required; got "+se)},A=function(se){return new Promise(function(ce,le){I(se)?ce(se):le(new Error("an HTMLElement or SVGElement is required; got "+se))})},v=function(se){var ce=Object.keys(_).filter(function(le){return se.indexOf("."+le)>0}).map(function(le){return _[le]});return ce?ce[0]:(console.error("Unknown font format for "+se+". Fonts may not be working correctly."),"application/octet-stream")},T=function(se,ce,le){var oe=se.viewBox&&se.viewBox.baseVal&&se.viewBox.baseVal[le]||null!==ce.getAttribute(le)&&!ce.getAttribute(le).match(/%$/)&&parseInt(ce.getAttribute(le))||se.getBoundingClientRect()[le]||parseInt(ce.style[le])||parseInt(window.getComputedStyle(se).getPropertyValue(le));return null==oe||isNaN(parseFloat(oe))?0:oe},E=function(se){for(var ce=window.atob(se.split(",")[1]),le=se.split(",")[0].split(":")[1].split(";")[0],oe=new ArrayBuffer(ce.length),Ae=new Uint8Array(oe),be=0;be *")).forEach(function(qt){qt.setAttributeNS(V,"xmlns","svg"===qt.tagName?w:"http://www.w3.org/1999/xhtml")}),!dt)return ee(ae,se).then(function(qt){var bt=document.createElement("style");bt.setAttribute("type","text/css"),bt.innerHTML="";var en=document.createElement("defs");en.appendChild(bt),Ke.insertBefore(en,Ke.firstChild);var Nt=document.createElement("div");Nt.appendChild(Ke);var rn=Nt.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if("function"!=typeof ce)return{src:rn,width:xt,height:vt};ce(rn,xt,vt)});var Ht=document.createElement("div");Ht.appendChild(Ke);var Ct=Ht.innerHTML;if("function"!=typeof ce)return{src:Ct,width:xt,height:vt};ce(Ct,xt,vt)})},U.svgAsDataUri=function(ae,se,ce){return D(ae),U.prepareSvg(ae,se).then(function(le){var Ae=le.width,be=le.height,it="data:image/svg+xml;base64,"+window.btoa(function(se){return decodeURIComponent(encodeURIComponent(se).replace(/%([0-9A-F]{2})/g,function(ce,le){var oe=String.fromCharCode("0x"+le);return"%"===oe?"%25":oe}))}(']>'+le.src));return"function"==typeof ce&&ce(it,Ae,be),it})},U.svgAsPngUri=function(ae,se,ce){D(ae);var le=se||{},oe=le.encoderType,Ae=void 0===oe?"image/png":oe,be=le.encoderOptions,it=void 0===be?.8:be,qe=le.canvg,_t=function(Ft){var xe=Ft.src,De=Ft.width,je=Ft.height,dt=document.createElement("canvas"),Ke=dt.getContext("2d"),Bt=window.devicePixelRatio||1;dt.width=De*Bt,dt.height=je*Bt,dt.style.width=dt.width+"px",dt.style.height=dt.height+"px",Ke.setTransform(Bt,0,0,Bt,0,0),qe?qe(dt,xe):Ke.drawImage(xe,0,0);var xt=void 0;try{xt=dt.toDataURL(Ae,it)}catch(vt){if("undefined"!=typeof SecurityError&&vt instanceof SecurityError||"SecurityError"===vt.name)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw vt}return"function"==typeof ce&&ce(xt,dt.width,dt.height),Promise.resolve(xt)};return qe?U.prepareSvg(ae,se).then(_t):U.svgAsDataUri(ae,se).then(function(yt){return new Promise(function(Ft,xe){var De=new Image;De.onload=function(){return Ft(_t({src:De,width:De.width,height:De.height}))},De.onerror=function(){xe("There was an error loading the data URI as an image on the following SVG\n"+window.atob(yt.slice(26))+"Open the following link to see browser's diagnosis\n"+yt)},De.src=yt})})},U.download=function(ae,se,ce){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(E(se),ae);else{var le=document.createElement("a");if("download"in le){le.download=ae,le.style.display="none",document.body.appendChild(le);try{var oe=E(se),Ae=URL.createObjectURL(oe);le.href=Ae,le.onclick=function(){return requestAnimationFrame(function(){return URL.revokeObjectURL(Ae)})}}catch(be){console.error(be),console.warn("Error while getting object URL. Falling back to string URL."),le.href=se}le.click(),document.body.removeChild(le)}else ce&&ce.popup&&(ce.popup.document.title=ae,ce.popup.location.replace(se))}},U.saveSvg=function(ae,se,ce){var le=$();return A(ae).then(function(oe){return U.svgAsDataUri(oe,ce||{})}).then(function(oe){return U.download(se,oe,le)})},U.saveSvgAsPng=function(ae,se,ce){var le=$();return A(ae).then(function(oe){return U.svgAsPngUri(oe,ce||{})}).then(function(oe){return U.download(se,oe,le)})}}()},5042:function(ue,q,f){var B=f(25523),U=Object.prototype.hasOwnProperty,V="undefined"!=typeof Map;function Z(){this._array=[],this._set=V?new Map:Object.create(null)}Z.fromArray=function(N,b){for(var _=new Z,I=0,D=N.length;I=0)return b}else{var _=B.toSetString(N);if(U.call(this._set,_))return this._set[_]}throw new Error('"'+N+'" is not in the set.')},Z.prototype.at=function(N){if(N>=0&&N>>=5)>0&&(A|=32),D+=B.encode(A)}while(S>0);return D},q.decode=function(I,D,A){var T,R,S=I.length,v=0,g=0;do{if(D>=S)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(R=B.decode(I.charCodeAt(D++))))throw new Error("Invalid base64 digit: "+I.charAt(D-1));T=!!(32&R),v+=(R&=31)<>1;return 1==(1&_)?-D:D}(v),A.rest=D}},7698:function(ue,q){var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");q.encode=function(B){if(0<=B&&BN||b==N&&w.generatedColumn>=Z.generatedColumn||B.compareByGeneratedPositionsInflated(Z,w)<=0}(this._last,w)?(this._sorted=!1,this._array.push(w)):(this._last=w,this._array.push(w))},V.prototype.toArray=function(){return this._sorted||(this._array.sort(B.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},q.H=V},30673:function(ue,q,f){var B=f(78619),U=f(25523),V=f(5042).I,Z=f(66306).H;function w(N){N||(N={}),this._file=U.getArg(N,"file",null),this._sourceRoot=U.getArg(N,"sourceRoot",null),this._skipValidation=U.getArg(N,"skipValidation",!1),this._sources=new V,this._names=new V,this._mappings=new Z,this._sourcesContents=null}w.prototype._version=3,w.fromSourceMap=function(b){var _=b.sourceRoot,I=new w({file:b.file,sourceRoot:_});return b.eachMapping(function(D){var A={generated:{line:D.generatedLine,column:D.generatedColumn}};null!=D.source&&(A.source=D.source,null!=_&&(A.source=U.relative(_,A.source)),A.original={line:D.originalLine,column:D.originalColumn},null!=D.name&&(A.name=D.name)),I.addMapping(A)}),b.sources.forEach(function(D){var A=D;null!==_&&(A=U.relative(_,D)),I._sources.has(A)||I._sources.add(A);var S=b.sourceContentFor(D);null!=S&&I.setSourceContent(D,S)}),I},w.prototype.addMapping=function(b){var _=U.getArg(b,"generated"),I=U.getArg(b,"original",null),D=U.getArg(b,"source",null),A=U.getArg(b,"name",null);this._skipValidation||this._validateMapping(_,I,D,A),null!=D&&(D=String(D),this._sources.has(D)||this._sources.add(D)),null!=A&&(A=String(A),this._names.has(A)||this._names.add(A)),this._mappings.add({generatedLine:_.line,generatedColumn:_.column,originalLine:null!=I&&I.line,originalColumn:null!=I&&I.column,source:D,name:A})},w.prototype.setSourceContent=function(b,_){var I=b;null!=this._sourceRoot&&(I=U.relative(this._sourceRoot,I)),null!=_?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[U.toSetString(I)]=_):this._sourcesContents&&(delete this._sourcesContents[U.toSetString(I)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},w.prototype.applySourceMap=function(b,_,I){var D=_;if(null==_){if(null==b.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');D=b.file}var A=this._sourceRoot;null!=A&&(D=U.relative(A,D));var S=new V,v=new V;this._mappings.unsortedForEach(function(g){if(g.source===D&&null!=g.originalLine){var T=b.originalPositionFor({line:g.originalLine,column:g.originalColumn});null!=T.source&&(g.source=T.source,null!=I&&(g.source=U.join(I,g.source)),null!=A&&(g.source=U.relative(A,g.source)),g.originalLine=T.line,g.originalColumn=T.column,null!=T.name&&(g.name=T.name))}var R=g.source;null!=R&&!S.has(R)&&S.add(R);var k=g.name;null!=k&&!v.has(k)&&v.add(k)},this),this._sources=S,this._names=v,b.sources.forEach(function(g){var T=b.sourceContentFor(g);null!=T&&(null!=I&&(g=U.join(I,g)),null!=A&&(g=U.relative(A,g)),this.setSourceContent(g,T))},this)},w.prototype._validateMapping=function(b,_,I,D){if(_&&"number"!=typeof _.line&&"number"!=typeof _.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(b&&"line"in b&&"column"in b&&b.line>0&&b.column>=0)||_||I||D){if(b&&"line"in b&&"column"in b&&_&&"line"in _&&"column"in _&&b.line>0&&b.column>=0&&_.line>0&&_.column>=0&&I)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:b,source:I,original:_,name:D}))}},w.prototype._serializeMappings=function(){for(var g,T,R,k,b=0,_=1,I=0,D=0,A=0,S=0,v="",E=this._mappings.toArray(),x=0,O=E.length;x0){if(!U.compareByGeneratedPositionsInflated(T,E[x-1]))continue;g+=","}g+=B.encode(T.generatedColumn-b),b=T.generatedColumn,null!=T.source&&(k=this._sources.indexOf(T.source),g+=B.encode(k-S),S=k,g+=B.encode(T.originalLine-1-D),D=T.originalLine-1,g+=B.encode(T.originalColumn-I),I=T.originalColumn,null!=T.name&&(R=this._names.indexOf(T.name),g+=B.encode(R-A),A=R)),v+=g}return v},w.prototype._generateSourcesContent=function(b,_){return b.map(function(I){if(!this._sourcesContents)return null;null!=_&&(I=U.relative(_,I));var D=U.toSetString(I);return Object.prototype.hasOwnProperty.call(this._sourcesContents,D)?this._sourcesContents[D]:null},this)},w.prototype.toJSON=function(){var b={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(b.file=this._file),null!=this._sourceRoot&&(b.sourceRoot=this._sourceRoot),this._sourcesContents&&(b.sourcesContent=this._generateSourcesContent(b.sources,b.sourceRoot)),b},w.prototype.toString=function(){return JSON.stringify(this.toJSON())},q.h=w},25523:function(ue,q){q.getArg=function(x,O,F){if(O in x)return x[O];if(3===arguments.length)return F;throw new Error('"'+O+'" is a required argument.')};var B=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,U=/^data:.+\,.+$/;function V(x){var O=x.match(B);return O?{scheme:O[1],auth:O[2],host:O[3],port:O[4],path:O[5]}:null}function Z(x){var O="";return x.scheme&&(O+=x.scheme+":"),O+="//",x.auth&&(O+=x.auth+"@"),x.host&&(O+=x.host),x.port&&(O+=":"+x.port),x.path&&(O+=x.path),O}function w(x){var O=x,F=V(x);if(F){if(!F.path)return x;O=F.path}for(var j,z=q.isAbsolute(O),K=O.split(/\/+/),J=0,ee=K.length-1;ee>=0;ee--)"."===(j=K[ee])?K.splice(ee,1):".."===j?J++:J>0&&(""===j?(K.splice(ee+1,J),J=0):(K.splice(ee,2),J--));return""===(O=K.join("/"))&&(O=z?"/":"."),F?(F.path=O,Z(F)):O}function N(x,O){""===x&&(x="."),""===O&&(O=".");var F=V(O),z=V(x);if(z&&(x=z.path||"/"),F&&!F.scheme)return z&&(F.scheme=z.scheme),Z(F);if(F||O.match(U))return O;if(z&&!z.host&&!z.path)return z.host=O,Z(z);var K="/"===O.charAt(0)?O:w(x.replace(/\/+$/,"")+"/"+O);return z?(z.path=K,Z(z)):K}q.urlParse=V,q.urlGenerate=Z,q.normalize=w,q.join=N,q.isAbsolute=function(x){return"/"===x.charAt(0)||B.test(x)},q.relative=function(x,O){""===x&&(x="."),x=x.replace(/\/$/,"");for(var F=0;0!==O.indexOf(x+"/");){var z=x.lastIndexOf("/");if(z<0||(x=x.slice(0,z)).match(/^([^\/]+:\/)?\/*$/))return O;++F}return Array(F+1).join("../")+O.substr(x.length+1)};var _=!("__proto__"in Object.create(null));function I(x){return x}function S(x){if(!x)return!1;var O=x.length;if(O<9||95!==x.charCodeAt(O-1)||95!==x.charCodeAt(O-2)||111!==x.charCodeAt(O-3)||116!==x.charCodeAt(O-4)||111!==x.charCodeAt(O-5)||114!==x.charCodeAt(O-6)||112!==x.charCodeAt(O-7)||95!==x.charCodeAt(O-8)||95!==x.charCodeAt(O-9))return!1;for(var F=O-10;F>=0;F--)if(36!==x.charCodeAt(F))return!1;return!0}function T(x,O){return x===O?0:null===x?1:null===O?-1:x>O?1:-1}q.toSetString=_?I:function(x){return S(x)?"$"+x:x},q.fromSetString=_?I:function(x){return S(x)?x.slice(1):x},q.compareByOriginalPositions=function(x,O,F){var z=T(x.source,O.source);return 0!==z||0!=(z=x.originalLine-O.originalLine)||0!=(z=x.originalColumn-O.originalColumn)||F||0!=(z=x.generatedColumn-O.generatedColumn)||0!=(z=x.generatedLine-O.generatedLine)?z:T(x.name,O.name)},q.compareByGeneratedPositionsDeflated=function(x,O,F){var z=x.generatedLine-O.generatedLine;return 0!==z||0!=(z=x.generatedColumn-O.generatedColumn)||F||0!==(z=T(x.source,O.source))||0!=(z=x.originalLine-O.originalLine)||0!=(z=x.originalColumn-O.originalColumn)?z:T(x.name,O.name)},q.compareByGeneratedPositionsInflated=function(x,O){var F=x.generatedLine-O.generatedLine;return 0!==F||0!=(F=x.generatedColumn-O.generatedColumn)||0!==(F=T(x.source,O.source))||0!=(F=x.originalLine-O.originalLine)||0!=(F=x.originalColumn-O.originalColumn)?F:T(x.name,O.name)},q.parseSourceMapInput=function(x){return JSON.parse(x.replace(/^\)]}'[^\n]*\n/,""))},q.computeSourceURL=function(x,O,F){if(O=O||"",x&&("/"!==x[x.length-1]&&"/"!==O[0]&&(x+="/"),O=x+O),F){var z=V(F);if(!z)throw new Error("sourceMapURL could not be parsed");if(z.path){var K=z.path.lastIndexOf("/");K>=0&&(z.path=z.path.substring(0,K+1))}O=N(Z(z),O)}return w(O)}},52402:function(ue){ue.exports=function(q){"use strict";var B=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function V(R,k){var E=R[0],x=R[1],O=R[2],F=R[3];x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&O|~x&F)+k[0]-680876936|0)<<7|E>>>25)+x|0)&x|~E&O)+k[1]-389564586|0)<<12|F>>>20)+E|0)&E|~F&x)+k[2]+606105819|0)<<17|O>>>15)+F|0)&F|~O&E)+k[3]-1044525330|0)<<22|x>>>10)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&O|~x&F)+k[4]-176418897|0)<<7|E>>>25)+x|0)&x|~E&O)+k[5]+1200080426|0)<<12|F>>>20)+E|0)&E|~F&x)+k[6]-1473231341|0)<<17|O>>>15)+F|0)&F|~O&E)+k[7]-45705983|0)<<22|x>>>10)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&O|~x&F)+k[8]+1770035416|0)<<7|E>>>25)+x|0)&x|~E&O)+k[9]-1958414417|0)<<12|F>>>20)+E|0)&E|~F&x)+k[10]-42063|0)<<17|O>>>15)+F|0)&F|~O&E)+k[11]-1990404162|0)<<22|x>>>10)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&O|~x&F)+k[12]+1804603682|0)<<7|E>>>25)+x|0)&x|~E&O)+k[13]-40341101|0)<<12|F>>>20)+E|0)&E|~F&x)+k[14]-1502002290|0)<<17|O>>>15)+F|0)&F|~O&E)+k[15]+1236535329|0)<<22|x>>>10)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&F|O&~F)+k[1]-165796510|0)<<5|E>>>27)+x|0)&O|x&~O)+k[6]-1069501632|0)<<9|F>>>23)+E|0)&x|E&~x)+k[11]+643717713|0)<<14|O>>>18)+F|0)&E|F&~E)+k[0]-373897302|0)<<20|x>>>12)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&F|O&~F)+k[5]-701558691|0)<<5|E>>>27)+x|0)&O|x&~O)+k[10]+38016083|0)<<9|F>>>23)+E|0)&x|E&~x)+k[15]-660478335|0)<<14|O>>>18)+F|0)&E|F&~E)+k[4]-405537848|0)<<20|x>>>12)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&F|O&~F)+k[9]+568446438|0)<<5|E>>>27)+x|0)&O|x&~O)+k[14]-1019803690|0)<<9|F>>>23)+E|0)&x|E&~x)+k[3]-187363961|0)<<14|O>>>18)+F|0)&E|F&~E)+k[8]+1163531501|0)<<20|x>>>12)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x&F|O&~F)+k[13]-1444681467|0)<<5|E>>>27)+x|0)&O|x&~O)+k[2]-51403784|0)<<9|F>>>23)+E|0)&x|E&~x)+k[7]+1735328473|0)<<14|O>>>18)+F|0)&E|F&~E)+k[12]-1926607734|0)<<20|x>>>12)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x^O^F)+k[5]-378558|0)<<4|E>>>28)+x|0)^x^O)+k[8]-2022574463|0)<<11|F>>>21)+E|0)^E^x)+k[11]+1839030562|0)<<16|O>>>16)+F|0)^F^E)+k[14]-35309556|0)<<23|x>>>9)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x^O^F)+k[1]-1530992060|0)<<4|E>>>28)+x|0)^x^O)+k[4]+1272893353|0)<<11|F>>>21)+E|0)^E^x)+k[7]-155497632|0)<<16|O>>>16)+F|0)^F^E)+k[10]-1094730640|0)<<23|x>>>9)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x^O^F)+k[13]+681279174|0)<<4|E>>>28)+x|0)^x^O)+k[0]-358537222|0)<<11|F>>>21)+E|0)^E^x)+k[3]-722521979|0)<<16|O>>>16)+F|0)^F^E)+k[6]+76029189|0)<<23|x>>>9)+O|0,x=((x+=((O=((O+=((F=((F+=((E=((E+=(x^O^F)+k[9]-640364487|0)<<4|E>>>28)+x|0)^x^O)+k[12]-421815835|0)<<11|F>>>21)+E|0)^E^x)+k[15]+530742520|0)<<16|O>>>16)+F|0)^F^E)+k[2]-995338651|0)<<23|x>>>9)+O|0,x=((x+=((F=((F+=(x^((E=((E+=(O^(x|~F))+k[0]-198630844|0)<<6|E>>>26)+x|0)|~O))+k[7]+1126891415|0)<<10|F>>>22)+E|0)^((O=((O+=(E^(F|~x))+k[14]-1416354905|0)<<15|O>>>17)+F|0)|~E))+k[5]-57434055|0)<<21|x>>>11)+O|0,x=((x+=((F=((F+=(x^((E=((E+=(O^(x|~F))+k[12]+1700485571|0)<<6|E>>>26)+x|0)|~O))+k[3]-1894986606|0)<<10|F>>>22)+E|0)^((O=((O+=(E^(F|~x))+k[10]-1051523|0)<<15|O>>>17)+F|0)|~E))+k[1]-2054922799|0)<<21|x>>>11)+O|0,x=((x+=((F=((F+=(x^((E=((E+=(O^(x|~F))+k[8]+1873313359|0)<<6|E>>>26)+x|0)|~O))+k[15]-30611744|0)<<10|F>>>22)+E|0)^((O=((O+=(E^(F|~x))+k[6]-1560198380|0)<<15|O>>>17)+F|0)|~E))+k[13]+1309151649|0)<<21|x>>>11)+O|0,x=((x+=((F=((F+=(x^((E=((E+=(O^(x|~F))+k[4]-145523070|0)<<6|E>>>26)+x|0)|~O))+k[11]-1120210379|0)<<10|F>>>22)+E|0)^((O=((O+=(E^(F|~x))+k[2]+718787259|0)<<15|O>>>17)+F|0)|~E))+k[9]-343485551|0)<<21|x>>>11)+O|0,R[0]=E+R[0]|0,R[1]=x+R[1]|0,R[2]=O+R[2]|0,R[3]=F+R[3]|0}function Z(R){var E,k=[];for(E=0;E<64;E+=4)k[E>>2]=R.charCodeAt(E)+(R.charCodeAt(E+1)<<8)+(R.charCodeAt(E+2)<<16)+(R.charCodeAt(E+3)<<24);return k}function w(R){var E,k=[];for(E=0;E<64;E+=4)k[E>>2]=R[E]+(R[E+1]<<8)+(R[E+2]<<16)+(R[E+3]<<24);return k}function N(R){var x,O,F,z,K,j,k=R.length,E=[1732584193,-271733879,-1732584194,271733878];for(x=64;x<=k;x+=64)V(E,Z(R.substring(x-64,x)));for(O=(R=R.substring(x-64)).length,F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x=0;x>2]|=R.charCodeAt(x)<<(x%4<<3);if(F[x>>2]|=128<<(x%4<<3),x>55)for(V(E,F),x=0;x<16;x+=1)F[x]=0;return z=(z=8*k).toString(16).match(/(.*?)(.{0,8})$/),K=parseInt(z[2],16),j=parseInt(z[1],16)||0,F[14]=K,F[15]=j,V(E,F),E}function _(R){var E,k="";for(E=0;E<4;E+=1)k+=B[R>>8*E+4&15]+B[R>>8*E&15];return k}function I(R){var k;for(k=0;kF?new ArrayBuffer(0):(z=F-O,K=new ArrayBuffer(z),j=new Uint8Array(K),J=new Uint8Array(this,O,z),j.set(J),K)}}(),T.prototype.append=function(R){return this.appendBinary(D(R)),this},T.prototype.appendBinary=function(R){this._buff+=R,this._length+=R.length;var E,k=this._buff.length;for(E=64;E<=k;E+=64)V(this._hash,Z(this._buff.substring(E-64,E)));return this._buff=this._buff.substring(E-64),this},T.prototype.end=function(R){var x,F,k=this._buff,E=k.length,O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(x=0;x>2]|=k.charCodeAt(x)<<(x%4<<3);return this._finish(O,E),F=I(this._hash),R&&(F=g(F)),this.reset(),F},T.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},T.prototype.setState=function(R){return this._buff=R.buff,this._length=R.length,this._hash=R.hash,this},T.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},T.prototype._finish=function(R,k){var x,O,F,E=k;if(R[E>>2]|=128<<(E%4<<3),E>55)for(V(this._hash,R),E=0;E<16;E+=1)R[E]=0;x=(x=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),O=parseInt(x[2],16),F=parseInt(x[1],16)||0,R[14]=O,R[15]=F,V(this._hash,R)},T.hash=function(R,k){return T.hashBinary(D(R),k)},T.hashBinary=function(R,k){var x=I(N(R));return k?g(x):x},(T.ArrayBuffer=function(){this.reset()}).prototype.append=function(R){var x,k=function(R,k,E){var x=new Uint8Array(R.byteLength+k.byteLength);return x.set(new Uint8Array(R)),x.set(new Uint8Array(k),R.byteLength),E?x:x.buffer}(this._buff.buffer,R,!0),E=k.length;for(this._length+=R.byteLength,x=64;x<=E;x+=64)V(this._hash,w(k.subarray(x-64,x)));return this._buff=x-64>2]|=k[O]<<(O%4<<3);return this._finish(x,E),F=I(this._hash),R&&(F=g(F)),this.reset(),F},T.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.ArrayBuffer.prototype.getState=function(){var R=T.prototype.getState.call(this);return R.buff=function(R){return String.fromCharCode.apply(null,new Uint8Array(R))}(R.buff),R},T.ArrayBuffer.prototype.setState=function(R){return R.buff=function(R,k){var F,E=R.length,x=new ArrayBuffer(E),O=new Uint8Array(x);for(F=0;F>2]|=R[x]<<(x%4<<3);if(F[x>>2]|=128<<(x%4<<3),x>55)for(V(E,F),x=0;x<16;x+=1)F[x]=0;return z=(z=8*k).toString(16).match(/(.*?)(.{0,8})$/),K=parseInt(z[2],16),j=parseInt(z[1],16)||0,F[14]=K,F[15]=j,V(E,F),E}(new Uint8Array(R)));return k?g(x):x},T}()},49940:function(ue,q,f){var B=f(33499),U=f(54968),V=U;V.v1=B,V.v4=U,ue.exports=V},83702:function(ue){for(var q=[],f=0;f<256;++f)q[f]=(f+256).toString(16).substr(1);ue.exports=function(U,V){var Z=V||0;return[q[U[Z++]],q[U[Z++]],q[U[Z++]],q[U[Z++]],"-",q[U[Z++]],q[U[Z++]],"-",q[U[Z++]],q[U[Z++]],"-",q[U[Z++]],q[U[Z++]],"-",q[U[Z++]],q[U[Z++]],q[U[Z++]],q[U[Z++]],q[U[Z++]],q[U[Z++]]].join("")}},1942:function(ue){var q="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(q){var f=new Uint8Array(16);ue.exports=function(){return q(f),f}}else{var B=new Array(16);ue.exports=function(){for(var Z,V=0;V<16;V++)0==(3&V)&&(Z=4294967296*Math.random()),B[V]=Z>>>((3&V)<<3)&255;return B}}},33499:function(ue,q,f){var V,Z,B=f(1942),U=f(83702),w=0,N=0;ue.exports=function(_,I,D){var A=I&&D||0,S=I||[],v=(_=_||{}).node||V,g=void 0!==_.clockseq?_.clockseq:Z;if(null==v||null==g){var T=B();null==v&&(v=V=[1|T[0],T[1],T[2],T[3],T[4],T[5]]),null==g&&(g=Z=16383&(T[6]<<8|T[7]))}var R=void 0!==_.msecs?_.msecs:(new Date).getTime(),k=void 0!==_.nsecs?_.nsecs:N+1,E=R-w+(k-N)/1e4;if(E<0&&void 0===_.clockseq&&(g=g+1&16383),(E<0||R>w)&&void 0===_.nsecs&&(k=0),k>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");w=R,N=k,Z=g;var x=(1e4*(268435455&(R+=122192928e5))+k)%4294967296;S[A++]=x>>>24&255,S[A++]=x>>>16&255,S[A++]=x>>>8&255,S[A++]=255&x;var O=R/4294967296*1e4&268435455;S[A++]=O>>>8&255,S[A++]=255&O,S[A++]=O>>>24&15|16,S[A++]=O>>>16&255,S[A++]=g>>>8|128,S[A++]=255&g;for(var F=0;F<6;++F)S[A+F]=v[F];return I||U(S)}},54968:function(ue,q,f){var B=f(1942),U=f(83702);ue.exports=function(Z,w,N){var b=w&&N||0;"string"==typeof Z&&(w="binary"===Z?new Array(16):null,Z=null);var _=(Z=Z||{}).random||(Z.rng||B)();if(_[6]=15&_[6]|64,_[8]=63&_[8]|128,w)for(var I=0;I<16;++I)w[b+I]=_[I];return w||U(_)}},3397:function(ue){window,ue.exports=function(q){var f={};function B(U){if(f[U])return f[U].exports;var V=f[U]={i:U,l:!1,exports:{}};return q[U].call(V.exports,V,V.exports,B),V.l=!0,V.exports}return B.m=q,B.c=f,B.d=function(U,V,Z){B.o(U,V)||Object.defineProperty(U,V,{enumerable:!0,get:Z})},B.r=function(U){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(U,"__esModule",{value:!0})},B.t=function(U,V){if(1&V&&(U=B(U)),8&V||4&V&&"object"==typeof U&&U&&U.__esModule)return U;var Z=Object.create(null);if(B.r(Z),Object.defineProperty(Z,"default",{enumerable:!0,value:U}),2&V&&"string"!=typeof U)for(var w in U)B.d(Z,w,function(N){return U[N]}.bind(null,w));return Z},B.n=function(U){var V=U&&U.__esModule?function(){return U.default}:function(){return U};return B.d(V,"a",V),V},B.o=function(U,V){return Object.prototype.hasOwnProperty.call(U,V)},B.p="",B(B.s=0)}([function(q,f,B){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.AttachAddon=void 0;var U=function(){function Z(w,N){this._disposables=[],this._socket=w,this._socket.binaryType="arraybuffer",this._bidirectional=!N||!1!==N.bidirectional}return Z.prototype.activate=function(w){var N=this;this._disposables.push(V(this._socket,"message",function(b){var _=b.data;w.write("string"==typeof _?_:new Uint8Array(_))})),this._bidirectional&&(this._disposables.push(w.onData(function(b){return N._sendData(b)})),this._disposables.push(w.onBinary(function(b){return N._sendBinary(b)}))),this._disposables.push(V(this._socket,"close",function(){return N.dispose()})),this._disposables.push(V(this._socket,"error",function(){return N.dispose()}))},Z.prototype.dispose=function(){this._disposables.forEach(function(w){return w.dispose()})},Z.prototype._sendData=function(w){1===this._socket.readyState&&this._socket.send(w)},Z.prototype._sendBinary=function(w){if(1===this._socket.readyState){for(var N=new Uint8Array(w.length),b=0;bx;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},E.prototype._createAccessibilityTreeNode=function(){var x=document.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x},E.prototype._onTab=function(x){for(var O=0;O0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,"\n"===x&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=I.tooMuchOutput)),D.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){O._accessibilityTreeRoot.appendChild(O._liveRegion)},0))},E.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,D.isMac&&(0,T.removeElementFromParent)(this._liveRegion)},E.prototype._onKey=function(x){this._clearLiveRegion(),this._charsToConsume.push(x)},E.prototype._refreshRows=function(x,O){this._renderRowsDebouncer.refresh(x,O,this._terminal.rows)},E.prototype._renderRows=function(x,O){for(var F=this._terminal.buffer,z=F.lines.length.toString(),K=x;K<=O;K++){var j=F.translateBufferLineToString(F.ydisp+K,!0),J=(F.ydisp+K+1).toString(),ee=this._rowElements[K];ee&&(0===j.length?ee.innerText="\xa0":ee.textContent=j,ee.setAttribute("aria-posinset",J),ee.setAttribute("aria-setsize",z))}this._announceCharacters()},E.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var x=0;x>>0},(b=w.color||(w.color={})).blend=function(S,v){var g=(255&v.rgba)/255;if(1===g)return{css:v.css,rgba:v.rgba};var R=v.rgba>>16&255,k=v.rgba>>8&255,E=S.rgba>>24&255,x=S.rgba>>16&255,O=S.rgba>>8&255,F=E+Math.round(((v.rgba>>24&255)-E)*g),z=x+Math.round((R-x)*g),K=O+Math.round((k-O)*g);return{css:N.toCss(F,z,K),rgba:N.toRgba(F,z,K)}},b.isOpaque=function(S){return 255==(255&S.rgba)},b.ensureContrastRatio=function(S,v,g){var T=I.ensureContrastRatio(S.rgba,v.rgba,g);if(T)return I.toColor(T>>24&255,T>>16&255,T>>8&255)},b.opaque=function(S){var v=(255|S.rgba)>>>0,g=I.toChannels(v);return{css:N.toCss(g[0],g[1],g[2]),rgba:v}},b.opacity=function(S,v){var g=Math.round(255*v),T=I.toChannels(S.rgba),R=T[0],k=T[1],E=T[2];return{css:N.toCss(R,k,E,g),rgba:N.toRgba(R,k,E,g)}},(w.css||(w.css={})).toColor=function(S){switch(S.length){case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(S){function v(g,T,R){var k=g/255,E=T/255,x=R/255;return.2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))}S.relativeLuminance=function(g){return v(g>>16&255,g>>8&255,255&g)},S.relativeLuminance2=v}(_=w.rgb||(w.rgb={})),function(S){function v(T,R,k){for(var E=T>>24&255,x=T>>16&255,O=T>>8&255,F=R>>24&255,z=R>>16&255,K=R>>8&255,j=A(_.relativeLuminance2(F,K,z),_.relativeLuminance2(E,x,O));j0||z>0||K>0);)F-=Math.max(0,Math.ceil(.1*F)),z-=Math.max(0,Math.ceil(.1*z)),K-=Math.max(0,Math.ceil(.1*K)),j=A(_.relativeLuminance2(F,K,z),_.relativeLuminance2(E,x,O));return(F<<24|z<<16|K<<8|255)>>>0}function g(T,R,k){for(var E=T>>24&255,x=T>>16&255,O=T>>8&255,F=R>>24&255,z=R>>16&255,K=R>>8&255,j=A(_.relativeLuminance2(F,K,z),_.relativeLuminance2(E,x,O));j>>0}S.ensureContrastRatio=function(T,R,k){var E=_.relativeLuminance(T>>8),x=_.relativeLuminance(R>>8);if(A(E,x)>24&255,T>>16&255,T>>8&255,255&T]},S.toColor=function(T,R,k){return{css:N.toCss(T,R,k),rgba:N.toRgba(T,R,k)}}}(I=w.rgba||(w.rgba={})),w.toPaddedHex=D,w.contrastRatio=A},7239:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.ColorContrastCache=void 0;var N=function(){function b(){this._color={},this._rgba={}}return b.prototype.clear=function(){this._color={},this._rgba={}},b.prototype.setCss=function(_,I,D){this._rgba[_]||(this._rgba[_]={}),this._rgba[_][I]=D},b.prototype.getCss=function(_,I){return this._rgba[_]?this._rgba[_][I]:void 0},b.prototype.setColor=function(_,I,D){this._color[_]||(this._color[_]={}),this._color[_][I]=D},b.prototype.getColor=function(_,I){return this._color[_]?this._color[_][I]:void 0},b}();w.ColorContrastCache=N},5680:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.ColorManager=w.DEFAULT_ANSI_COLORS=void 0;var b=N(4774),_=N(7239),I=b.css.toColor("#ffffff"),D=b.css.toColor("#000000"),A=b.css.toColor("#ffffff"),S=b.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};w.DEFAULT_ANSI_COLORS=Object.freeze(function(){for(var T=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],R=[0,95,135,175,215,255],k=0;k<216;k++){var E=R[k/36%6|0],x=R[k/6%6|0],O=R[k%6];T.push({css:b.channels.toCss(E,x,O),rgba:b.channels.toRgba(E,x,O)})}for(k=0;k<24;k++){var F=8+10*k;T.push({css:b.channels.toCss(F,F,F),rgba:b.channels.toRgba(F,F,F)})}return T}());var g=function(){function T(R,k){this.allowTransparency=k;var E=R.createElement("canvas");E.width=1,E.height=1;var x=E.getContext("2d");if(!x)throw new Error("Could not get rendering context");this._ctx=x,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new _.ColorContrastCache,this.colors={foreground:I,background:D,cursor:A,cursorAccent:S,selectionTransparent:v,selectionOpaque:b.color.blend(D,v),ansi:w.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return T.prototype.onOptionsChange=function(R){"minimumContrastRatio"===R&&this._contrastCache.clear()},T.prototype.setTheme=function(R){void 0===R&&(R={}),this.colors.foreground=this._parseColor(R.foreground,I),this.colors.background=this._parseColor(R.background,D),this.colors.cursor=this._parseColor(R.cursor,A,!0),this.colors.cursorAccent=this._parseColor(R.cursorAccent,S,!0),this.colors.selectionTransparent=this._parseColor(R.selection,v,!0),this.colors.selectionOpaque=b.color.blend(this.colors.background,this.colors.selectionTransparent),b.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=b.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(R.black,w.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(R.red,w.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(R.green,w.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(R.yellow,w.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(R.blue,w.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(R.magenta,w.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(R.cyan,w.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(R.white,w.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(R.brightBlack,w.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(R.brightRed,w.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(R.brightGreen,w.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(R.brightYellow,w.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(R.brightBlue,w.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(R.brightMagenta,w.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(R.brightCyan,w.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(R.brightWhite,w.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},T.prototype._parseColor=function(R,k,E){if(void 0===E&&(E=this.allowTransparency),void 0===R)return k;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=R,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+R+" is invalid using fallback "+k.css),k;this._ctx.fillRect(0,0,1,1);var x=this._ctx.getImageData(0,0,1,1).data;if(255!==x[3]){if(!E)return console.warn("Color: "+R+" is using transparency, but allowTransparency is false. Using fallback "+k.css+"."),k;var O=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(ee){return Number(ee)}),F=O[0],z=O[1],K=O[2],J=Math.round(255*O[3]);return{rgba:b.channels.toRgba(F,z,K,J),css:R}}return{css:this._ctx.fillStyle,rgba:b.channels.toRgba(x[0],x[1],x[2],x[3])}},T}();w.ColorManager=g},9631:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.removeElementFromParent=void 0,w.removeElementFromParent=function(){for(var N,b=[],_=0;_=0;O--)(k=v[O])&&(x=(E<3?k(x):E>3?k(g,T,x):k(g,T))||x);return E>3&&x&&Object.defineProperty(g,T,x),x},_=this&&this.__param||function(v,g){return function(T,R){g(T,R,v)}};Object.defineProperty(w,"__esModule",{value:!0}),w.MouseZone=w.Linkifier=void 0;var I=N(8460),D=N(2585),A=function(){function v(g,T,R){this._bufferService=g,this._logService=T,this._unicodeService=R,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new I.EventEmitter,this._onHideLinkUnderline=new I.EventEmitter,this._onLinkTooltip=new I.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(v.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),v.prototype.attachToDom=function(g,T){this._element=g,this._mouseZoneManager=T},v.prototype.linkifyRows=function(g,T){var R=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=g,this._rowsToLinkify.end=T):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,g),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,T)),this._mouseZoneManager.clearAll(g,T),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return R._linkifyRows()},v._timeBeforeLatency))},v.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var g=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var T=g.ydisp+this._rowsToLinkify.start;if(!(T>=g.lines.length)){for(var R=g.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,k=Math.ceil(2e3/this._bufferService.cols),E=this._bufferService.buffer.iterator(!1,T,R,k,k);E.hasNext();)for(var x=E.next(),O=0;O=0;T--)if(g.priority<=this._linkMatchers[T].priority)return void this._linkMatchers.splice(T+1,0,g);this._linkMatchers.splice(0,0,g)}else this._linkMatchers.push(g)},v.prototype.deregisterLinkMatcher=function(g){for(var T=0;T>9&511:void 0;R.validationCallback?R.validationCallback(j,function(se){E._rowsTimeoutId||se&&E._addLink(J[1],J[0]-E._bufferService.buffer.ydisp,j,R,ae)}):z._addLink(J[1],J[0]-z._bufferService.buffer.ydisp,j,R,ae)},z=this;null!==(k=x.exec(T))&&"break"!==F(););},v.prototype._addLink=function(g,T,R,k,E){var x=this;if(this._mouseZoneManager&&this._element){var O=this._unicodeService.getStringCellWidth(R),F=g%this._bufferService.cols,z=T+Math.floor(g/this._bufferService.cols),K=(F+O)%this._bufferService.cols,j=z+Math.floor((F+O)/this._bufferService.cols);0===K&&(K=this._bufferService.cols,j--),this._mouseZoneManager.add(new S(F+1,z+1,K+1,j+1,function(J){if(k.handler)return k.handler(J,R);var ee=window.open();ee?(ee.opener=null,ee.location.href=R):console.warn("Opening link blocked as opener could not be cleared")},function(){x._onShowLinkUnderline.fire(x._createLinkHoverEvent(F,z,K,j,E)),x._element.classList.add("xterm-cursor-pointer")},function(J){x._onLinkTooltip.fire(x._createLinkHoverEvent(F,z,K,j,E)),k.hoverTooltipCallback&&k.hoverTooltipCallback(J,R,{start:{x:F,y:z},end:{x:K,y:j}})},function(){x._onHideLinkUnderline.fire(x._createLinkHoverEvent(F,z,K,j,E)),x._element.classList.remove("xterm-cursor-pointer"),k.hoverLeaveCallback&&k.hoverLeaveCallback()},function(J){return!k.willLinkActivate||k.willLinkActivate(J,R)}))}},v.prototype._createLinkHoverEvent=function(g,T,R,k,E){return{x1:g,y1:T,x2:R,y2:k,cols:this._bufferService.cols,fg:E}},v._timeBeforeLatency=200,v=b([_(0,D.IBufferService),_(1,D.ILogService),_(2,D.IUnicodeService)],v)}();w.Linkifier=A;var S=function(g,T,R,k,E,x,O,F,z){this.x1=g,this.y1=T,this.x2=R,this.y2=k,this.clickCallback=E,this.hoverCallback=x,this.tooltipCallback=O,this.leaveCallback=F,this.willLinkActivate=z};w.MouseZone=S},6465:function(Z,w,N){var b,_=this&&this.__extends||(b=function(k,E){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,O){x.__proto__=O}||function(x,O){for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(x[F]=O[F])})(k,E)},function(R,k){if("function"!=typeof k&&null!==k)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function E(){this.constructor=R}b(R,k),R.prototype=null===k?Object.create(k):(E.prototype=k.prototype,new E)}),I=this&&this.__decorate||function(R,k,E,x){var O,F=arguments.length,z=F<3?k:null===x?x=Object.getOwnPropertyDescriptor(k,E):x;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)z=Reflect.decorate(R,k,E,x);else for(var K=R.length-1;K>=0;K--)(O=R[K])&&(z=(F<3?O(z):F>3?O(k,E,z):O(k,E))||z);return F>3&&z&&Object.defineProperty(k,E,z),z},D=this&&this.__param||function(R,k){return function(E,x){k(E,x,R)}};Object.defineProperty(w,"__esModule",{value:!0}),w.Linkifier2=void 0;var A=N(2585),S=N(8460),v=N(844),g=N(3656),T=function(R){function k(E){var x=R.call(this)||this;return x._bufferService=E,x._linkProviders=[],x._linkCacheDisposables=[],x._isMouseOut=!0,x._activeLine=-1,x._onShowLinkUnderline=x.register(new S.EventEmitter),x._onHideLinkUnderline=x.register(new S.EventEmitter),x.register((0,v.getDisposeArrayDisposable)(x._linkCacheDisposables)),x}return _(k,R),Object.defineProperty(k.prototype,"currentLink",{get:function(){return this._currentLink},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),k.prototype.registerLinkProvider=function(E){var x=this;return this._linkProviders.push(E),{dispose:function(){var F=x._linkProviders.indexOf(E);-1!==F&&x._linkProviders.splice(F,1)}}},k.prototype.attachToDom=function(E,x,O){var F=this;this._element=E,this._mouseService=x,this._renderService=O,this.register((0,g.addDisposableDomListener)(this._element,"mouseleave",function(){F._isMouseOut=!0,F._clearCurrentLink()})),this.register((0,g.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"click",this._onClick.bind(this)))},k.prototype._onMouseMove=function(E){if(this._lastMouseEvent=E,this._element&&this._mouseService){var x=this._positionFromMouseEvent(E,this._element,this._mouseService);if(x){this._isMouseOut=!1;for(var O=E.composedPath(),F=0;FE?this._bufferService.cols:j.link.range.end.x,$=j.link.range.start.y=E&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))},k.prototype._handleNewLink=function(E){var x=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var O=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);O&&this._linkAtPosition(E.link,O)&&(this._currentLink=E,this._currentLink.state={decorations:{underline:void 0===E.link.decorations||E.link.decorations.underline,pointerCursor:void 0===E.link.decorations||E.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,E.link,this._lastMouseEvent),E.link.decorations={},Object.defineProperties(E.link.decorations,{pointerCursor:{get:function(){var z,K;return null===(K=null===(z=x._currentLink)||void 0===z?void 0:z.state)||void 0===K?void 0:K.decorations.pointerCursor},set:function(z){var K,j;(null===(K=x._currentLink)||void 0===K?void 0:K.state)&&x._currentLink.state.decorations.pointerCursor!==z&&(x._currentLink.state.decorations.pointerCursor=z,x._currentLink.state.isHovered&&(null===(j=x._element)||void 0===j||j.classList.toggle("xterm-cursor-pointer",z)))}},underline:{get:function(){var z,K;return null===(K=null===(z=x._currentLink)||void 0===z?void 0:z.state)||void 0===K?void 0:K.decorations.underline},set:function(z){var K,j,J;(null===(K=x._currentLink)||void 0===K?void 0:K.state)&&(null===(J=null===(j=x._currentLink)||void 0===j?void 0:j.state)||void 0===J?void 0:J.decorations.underline)!==z&&(x._currentLink.state.decorations.underline=z,x._currentLink.state.isHovered&&x._fireUnderlineEvent(E.link,z))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(F){x._clearCurrentLink(0===F.start?0:F.start+1+x._bufferService.buffer.ydisp,F.end+1+x._bufferService.buffer.ydisp)})))}},k.prototype._linkHover=function(E,x,O){var F;(null===(F=this._currentLink)||void 0===F?void 0:F.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&E.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(O,x.text)},k.prototype._fireUnderlineEvent=function(E,x){var O=E.range,F=this._bufferService.buffer.ydisp,z=this._createLinkUnderlineEvent(O.start.x-1,O.start.y-F-1,O.end.x,O.end.y-F-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(z)},k.prototype._linkLeave=function(E,x,O){var F;(null===(F=this._currentLink)||void 0===F?void 0:F.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&E.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(O,x.text)},k.prototype._linkAtPosition=function(E,x){var F=E.range.start.yx.y;return(E.range.start.y===E.range.end.y&&E.range.start.x<=x.x&&E.range.end.x>=x.x||F&&E.range.end.x>=x.x||z&&E.range.start.x<=x.x||F&&z)&&E.range.start.y<=x.y&&E.range.end.y>=x.y},k.prototype._positionFromMouseEvent=function(E,x,O){var F=O.getCoords(E,x,this._bufferService.cols,this._bufferService.rows);if(F)return{x:F[0],y:F[1]+this._bufferService.buffer.ydisp}},k.prototype._createLinkUnderlineEvent=function(E,x,O,F,z){return{x1:E,y1:x,x2:O,y2:F,cols:this._bufferService.cols,fg:z}},I([D(0,A.IBufferService)],k)}(v.Disposable);w.Linkifier2=T},9042:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.tooMuchOutput=w.promptLabel=void 0,w.promptLabel="Terminal input",w.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},6954:function(Z,w,N){var b,_=this&&this.__extends||(b=function(k,E){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,O){x.__proto__=O}||function(x,O){for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(x[F]=O[F])})(k,E)},function(R,k){if("function"!=typeof k&&null!==k)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function E(){this.constructor=R}b(R,k),R.prototype=null===k?Object.create(k):(E.prototype=k.prototype,new E)}),I=this&&this.__decorate||function(R,k,E,x){var O,F=arguments.length,z=F<3?k:null===x?x=Object.getOwnPropertyDescriptor(k,E):x;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)z=Reflect.decorate(R,k,E,x);else for(var K=R.length-1;K>=0;K--)(O=R[K])&&(z=(F<3?O(z):F>3?O(k,E,z):O(k,E))||z);return F>3&&z&&Object.defineProperty(k,E,z),z},D=this&&this.__param||function(R,k){return function(E,x){k(E,x,R)}};Object.defineProperty(w,"__esModule",{value:!0}),w.MouseZoneManager=void 0;var A=N(844),S=N(3656),v=N(4725),g=N(2585),T=function(R){function k(E,x,O,F,z,K){var j=R.call(this)||this;return j._element=E,j._screenElement=x,j._bufferService=O,j._mouseService=F,j._selectionService=z,j._optionsService=K,j._zones=[],j._areZonesActive=!1,j._lastHoverCoords=[void 0,void 0],j._initialSelectionLength=0,j.register((0,S.addDisposableDomListener)(j._element,"mousedown",function(J){return j._onMouseDown(J)})),j._mouseMoveListener=function(J){return j._onMouseMove(J)},j._mouseLeaveListener=function(J){return j._onMouseLeave(J)},j._clickListener=function(J){return j._onClick(J)},j}return _(k,R),k.prototype.dispose=function(){R.prototype.dispose.call(this),this._deactivate()},k.prototype.add=function(E){this._zones.push(E),1===this._zones.length&&this._activate()},k.prototype.clearAll=function(E,x){if(0!==this._zones.length){E&&x||(E=0,x=this._bufferService.rows-1);for(var O=0;OE&&F.y1<=x+1||F.y2>E&&F.y2<=x+1||F.y1x+1)&&(this._currentZone&&this._currentZone===F&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(O--,1))}0===this._zones.length&&this._deactivate()}},k.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},k.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},k.prototype._onMouseMove=function(E){this._lastHoverCoords[0]===E.pageX&&this._lastHoverCoords[1]===E.pageY||(this._onHover(E),this._lastHoverCoords=[E.pageX,E.pageY])},k.prototype._onHover=function(E){var x=this,O=this._findZoneEventAt(E);O!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),O&&(this._currentZone=O,O.hoverCallback&&O.hoverCallback(E),this._tooltipTimeout=window.setTimeout(function(){return x._onTooltip(E)},this._optionsService.options.linkTooltipHoverDuration)))},k.prototype._onTooltip=function(E){this._tooltipTimeout=void 0;var x=this._findZoneEventAt(E);null==x||x.tooltipCallback(E)},k.prototype._onMouseDown=function(E){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var x=this._findZoneEventAt(E);(null==x?void 0:x.willLinkActivate(E))&&(E.preventDefault(),E.stopImmediatePropagation())}},k.prototype._onMouseLeave=function(E){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},k.prototype._onClick=function(E){var x=this._findZoneEventAt(E),O=this._getSelectionLength();x&&O===this._initialSelectionLength&&(x.clickCallback(E),E.preventDefault(),E.stopImmediatePropagation())},k.prototype._getSelectionLength=function(){var E=this._selectionService.selectionText;return E?E.length:0},k.prototype._findZoneEventAt=function(E){var x=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(x)for(var O=x[0],F=x[1],z=0;z=K.x1&&O=K.x1||F===K.y2&&OK.y1&&F4)&&je.coreMouseService.triggerMouseEvent({col:en.x-33,row:en.y-33,button:qt,action:bt,ctrl:Ct.ctrlKey,alt:Ct.altKey,shift:Ct.shiftKey})}var Bt={mouseup:null,wheel:null,mousedrag:null,mousemove:null},xt=function(qt){return Ke(qt),qt.buttons||(De._document.removeEventListener("mouseup",Bt.mouseup),Bt.mousedrag&&De._document.removeEventListener("mousemove",Bt.mousedrag)),De.cancel(qt)},vt=function(qt){return Ke(qt),De.cancel(qt,!0)},Qt=function(qt){qt.buttons&&Ke(qt)},Ht=function(qt){qt.buttons||Ke(qt)};this.register(this.coreMouseService.onProtocolChange(function(Ct){Ct?("debug"===De.optionsService.options.logLevel&&De._logService.debug("Binding to mouse events:",De.coreMouseService.explainEvents(Ct)),De.element.classList.add("enable-mouse-events"),De._selectionService.disable()):(De._logService.debug("Unbinding from mouse events."),De.element.classList.remove("enable-mouse-events"),De._selectionService.enable()),8&Ct?Bt.mousemove||(dt.addEventListener("mousemove",Ht),Bt.mousemove=Ht):(dt.removeEventListener("mousemove",Bt.mousemove),Bt.mousemove=null),16&Ct?Bt.wheel||(dt.addEventListener("wheel",vt,{passive:!1}),Bt.wheel=vt):(dt.removeEventListener("wheel",Bt.wheel),Bt.wheel=null),2&Ct?Bt.mouseup||(Bt.mouseup=xt):(De._document.removeEventListener("mouseup",Bt.mouseup),Bt.mouseup=null),4&Ct?Bt.mousedrag||(Bt.mousedrag=Qt):(De._document.removeEventListener("mousemove",Bt.mousedrag),Bt.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,E.addDisposableDomListener)(dt,"mousedown",function(Ct){if(Ct.preventDefault(),De.focus(),De.coreMouseService.areMouseEventsActive&&!De._selectionService.shouldForceSelection(Ct))return Ke(Ct),Bt.mouseup&&De._document.addEventListener("mouseup",Bt.mouseup),Bt.mousedrag&&De._document.addEventListener("mousemove",Bt.mousedrag),De.cancel(Ct)})),this.register((0,E.addDisposableDomListener)(dt,"wheel",function(Ct){if(!Bt.wheel){if(!De.buffer.hasScrollback){var qt=De.viewport.getLinesScrolled(Ct);if(0===qt)return;for(var bt=S.C0.ESC+(De.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ct.deltaY<0?"A":"B"),en="",Nt=0;Nt47)},xe.prototype._keyUp=function(De){var je;this._customKeyEventHandler&&!1===this._customKeyEventHandler(De)||(16===(je=De).keyCode||17===je.keyCode||18===je.keyCode||this.focus(),this.updateCursorStyle(De),this._keyPressHandled=!1)},xe.prototype._keyPress=function(De){var je;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(De))return!1;if(this.cancel(De),De.charCode)je=De.charCode;else if(null==De.which)je=De.keyCode;else{if(0===De.which||0===De.charCode)return!1;je=De.which}return!(!je||(De.altKey||De.ctrlKey||De.metaKey)&&!this._isThirdLevelShift(this.browser,De)||(je=String.fromCharCode(je),this._onKey.fire({key:je,domEvent:De}),this._showCursor(),this.coreService.triggerDataEvent(je,!0),this._keyPressHandled=!0,0))},xe.prototype._inputEvent=function(De){return!(!De.data||"insertText"!==De.inputType||this.optionsService.options.screenReaderMode||this._keyPressHandled||(this.coreService.triggerDataEvent(De.data,!0),this.cancel(De),0))},xe.prototype.bell=function(){var De;this._soundBell()&&(null===(De=this._soundService)||void 0===De||De.playBellSound()),this._onBell.fire()},xe.prototype.resize=function(De,je){De!==this.cols||je!==this.rows?Ft.prototype.resize.call(this,De,je):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},xe.prototype._afterResize=function(De,je){var dt,Ke;null===(dt=this._charSizeService)||void 0===dt||dt.measure(),null===(Ke=this.viewport)||void 0===Ke||Ke.syncScrollArea(!0)},xe.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var De=1;De=this._debounceThresholdMS)this._lastRefreshMs=S,this._innerRefresh();else if(!this._additionalRefreshRequested){var g=this._debounceThresholdMS-(S-this._lastRefreshMs);this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(function(){A._lastRefreshMs=Date.now(),A._innerRefresh(),A._additionalRefreshRequested=!1,A._refreshTimeoutID=void 0},g)}},b.prototype._innerRefresh=function(){if(void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount){var _=Math.max(this._rowStart,0),I=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(_,I)}},b}();w.TimeBasedDebouncer=N},1680:function(Z,w,N){var b,_=this&&this.__extends||(b=function(k,E){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,O){x.__proto__=O}||function(x,O){for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(x[F]=O[F])})(k,E)},function(R,k){if("function"!=typeof k&&null!==k)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function E(){this.constructor=R}b(R,k),R.prototype=null===k?Object.create(k):(E.prototype=k.prototype,new E)}),I=this&&this.__decorate||function(R,k,E,x){var O,F=arguments.length,z=F<3?k:null===x?x=Object.getOwnPropertyDescriptor(k,E):x;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)z=Reflect.decorate(R,k,E,x);else for(var K=R.length-1;K>=0;K--)(O=R[K])&&(z=(F<3?O(z):F>3?O(k,E,z):O(k,E))||z);return F>3&&z&&Object.defineProperty(k,E,z),z},D=this&&this.__param||function(R,k){return function(E,x){k(E,x,R)}};Object.defineProperty(w,"__esModule",{value:!0}),w.Viewport=void 0;var A=N(844),S=N(3656),v=N(4725),g=N(2585),T=function(R){function k(E,x,O,F,z,K,j,J){var ee=R.call(this)||this;return ee._scrollLines=E,ee._viewportElement=x,ee._scrollArea=O,ee._element=F,ee._bufferService=z,ee._optionsService=K,ee._charSizeService=j,ee._renderService=J,ee.scrollBarWidth=0,ee._currentRowHeight=0,ee._currentScaledCellHeight=0,ee._lastRecordedBufferLength=0,ee._lastRecordedViewportHeight=0,ee._lastRecordedBufferHeight=0,ee._lastTouchY=0,ee._lastScrollTop=0,ee._lastHadScrollBar=!1,ee._wheelPartialScroll=0,ee._refreshAnimationFrame=null,ee._ignoreNextScrollEvent=!1,ee.scrollBarWidth=ee._viewportElement.offsetWidth-ee._scrollArea.offsetWidth||15,ee._lastHadScrollBar=!0,ee.register((0,S.addDisposableDomListener)(ee._viewportElement,"scroll",ee._onScroll.bind(ee))),ee._activeBuffer=ee._bufferService.buffer,ee.register(ee._bufferService.buffers.onBufferActivate(function($){return ee._activeBuffer=$.activeBuffer})),ee._renderDimensions=ee._renderService.dimensions,ee.register(ee._renderService.onDimensionsChange(function($){return ee._renderDimensions=$})),setTimeout(function(){return ee.syncScrollArea()},0),ee}return _(k,R),k.prototype.onThemeChange=function(E){this._viewportElement.style.backgroundColor=E.background.css},k.prototype._refresh=function(E){var x=this;if(E)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return x._innerRefresh()}))},k.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var E=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==E&&(this._lastRecordedBufferHeight=E,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var x=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==x&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=x),this.scrollBarWidth=0===this._optionsService.options.scrollback?0:this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this._lastHadScrollBar=this.scrollBarWidth>0;var O=window.getComputedStyle(this._element),F=parseInt(O.paddingLeft)+parseInt(O.paddingRight);this._viewportElement.style.width=(this._renderService.dimensions.actualCellWidth*this._bufferService.cols+this.scrollBarWidth+(this._lastHadScrollBar?F:0)).toString()+"px",this._refreshAnimationFrame=null},k.prototype.syncScrollArea=function(E){if(void 0===E&&(E=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(E);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight?this._lastHadScrollBar!==this._optionsService.options.scrollback>0&&this._refresh(E):this._refresh(E)},k.prototype._onScroll=function(E){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent){if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);var x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(x)}},k.prototype._bubbleScroll=function(E,x){return!(x<0&&0!==this._viewportElement.scrollTop||x>0&&this._viewportElement.scrollTop+this._lastRecordedViewportHeight0?1:-1),this._wheelPartialScroll%=1):E.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x},k.prototype._applyScrollModifier=function(E,x){var O=this._optionsService.options.fastScrollModifier;return"alt"===O&&x.altKey||"ctrl"===O&&x.ctrlKey||"shift"===O&&x.shiftKey?E*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:E*this._optionsService.options.scrollSensitivity},k.prototype.onTouchStart=function(E){this._lastTouchY=E.touches[0].pageY},k.prototype.onTouchMove=function(E){var x=this._lastTouchY-E.touches[0].pageY;return this._lastTouchY=E.touches[0].pageY,0!==x&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(E,x))},I([D(4,g.IBufferService),D(5,g.IOptionsService),D(6,v.ICharSizeService),D(7,v.IRenderService)],k)}(A.Disposable);w.Viewport=T},2950:function(Z,w,N){var b=this&&this.__decorate||function(S,v,g,T){var R,k=arguments.length,E=k<3?v:null===T?T=Object.getOwnPropertyDescriptor(v,g):T;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)E=Reflect.decorate(S,v,g,T);else for(var x=S.length-1;x>=0;x--)(R=S[x])&&(E=(k<3?R(E):k>3?R(v,g,E):R(v,g))||E);return k>3&&E&&Object.defineProperty(v,g,E),E},_=this&&this.__param||function(S,v){return function(g,T){v(g,T,S)}};Object.defineProperty(w,"__esModule",{value:!0}),w.CompositionHelper=void 0;var I=N(4725),D=N(2585),A=function(){function S(v,g,T,R,k,E){this._textarea=v,this._compositionView=g,this._bufferService=T,this._optionsService=R,this._coreService=k,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}return Object.defineProperty(S.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),S.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")},S.prototype.compositionupdate=function(v){var g=this;this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(function(){g._compositionPosition.end=g._textarea.value.length},0)},S.prototype.compositionend=function(){this._finalizeComposition(!0)},S.prototype.keydown=function(v){if(this._isComposing||this._isSendingComposition){if(229===v.keyCode||16===v.keyCode||17===v.keyCode||18===v.keyCode)return!1;this._finalizeComposition(!1)}return 229!==v.keyCode||(this._handleAnyTextareaChanges(),!1)},S.prototype._finalizeComposition=function(v){var g=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){var T={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){var k;g._isSendingComposition&&(g._isSendingComposition=!1,T.start+=g._dataAlreadySent.length,(k=g._isComposing?g._textarea.value.substring(T.start,T.end):g._textarea.value.substring(T.start)).length>0&&g._coreService.triggerDataEvent(k,!0))},0)}else{this._isSendingComposition=!1;var R=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(R,!0)}},S.prototype._handleAnyTextareaChanges=function(){var v=this,g=this._textarea.value;setTimeout(function(){if(!v._isComposing){var T=v._textarea.value.replace(g,"");T.length>0&&(v._dataAlreadySent=T,v._coreService.triggerDataEvent(T,!0))}},0)},S.prototype.updateCompositionElements=function(v){var g=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var T=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),R=this._renderService.dimensions.actualCellHeight,k=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,E=T*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=E+"px",this._compositionView.style.top=k+"px",this._compositionView.style.height=R+"px",this._compositionView.style.lineHeight=R+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var x=this._compositionView.getBoundingClientRect();this._textarea.style.left=E+"px",this._textarea.style.top=k+"px",this._textarea.style.width=Math.max(x.width,1)+"px",this._textarea.style.height=Math.max(x.height,1)+"px",this._textarea.style.lineHeight=x.height+"px"}v||setTimeout(function(){return g.updateCompositionElements(!0)},0)}},b([_(2,D.IBufferService),_(3,D.IOptionsService),_(4,D.ICoreService),_(5,I.IRenderService)],S)}();w.CompositionHelper=A},9806:function(Z,w){function N(b,_){var I=_.getBoundingClientRect();return[b.clientX-I.left,b.clientY-I.top]}Object.defineProperty(w,"__esModule",{value:!0}),w.getRawByteCoords=w.getCoords=w.getCoordsRelativeToElement=void 0,w.getCoordsRelativeToElement=N,w.getCoords=function(b,_,I,D,A,S,v,g){if(A){var T=N(b,_);if(T)return T[0]=Math.ceil((T[0]+(g?S/2:0))/S),T[1]=Math.ceil(T[1]/v),T[0]=Math.min(Math.max(T[0],1),I+(g?1:0)),T[1]=Math.min(Math.max(T[1],1),D),T}},w.getRawByteCoords=function(b){if(b)return{x:b[0]+32,y:b[1]+32}}},9504:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.moveToCellSequence=void 0;var b=N(2584);function _(g,T,R,k){var E=g-I(R,g),x=T-I(R,T);return v(Math.abs(E-x)-function(F,z,K){for(var j=0,J=F-I(K,F),ee=z-I(K,z),$=0;$=0&&TT?"A":"B"}function A(g,T,R,k,E,x){for(var O=g,F=T,z="";O!==R||F!==k;)O+=E?1:-1,E&&O>x.cols-1?(z+=x.buffer.translateBufferLineToString(F,!1,g,O),O=0,g=0,F++):!E&&O<0&&(z+=x.buffer.translateBufferLineToString(F,!1,0,g+1),g=O=x.cols-1,F--);return z+x.buffer.translateBufferLineToString(F,!1,g,O)}function S(g,T){return b.C0.ESC+(T?"O":"[")+g}function v(g,T){g=Math.floor(g);for(var R="",k=0;k0?J-I(ee,J):K;var le,oe,Ae,be,it,_t,se=J,ce=(le=z,oe=K,_t=_(Ae=j,be=J,it=ee,$).length>0?be-I(it,be):oe,le=Ae&&_tg?"D":"C",v(Math.abs(x-g),S(E,k));E=O>T?"D":"C";var F=Math.abs(O-T);return v(function(z,K){return K.cols-z}(O>T?g:x,R)+(F-1)*R.cols+1+((O>T?x:g)-1),S(E,k))}},1546:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.BaseRenderLayer=void 0;var b=N(643),_=N(8803),I=N(1420),D=N(3734),A=N(1752),S=N(4774),v=N(9631),g=N(8978),T=function(){function R(k,E,x,O,F,z,K,j){this._container=k,this._alpha=O,this._colors=F,this._rendererId=z,this._bufferService=K,this._optionsService=j,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+E+"-layer"),this._canvas.style.zIndex=x.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return R.prototype.dispose=function(){var k;(0,v.removeElementFromParent)(this._canvas),null===(k=this._charAtlas)||void 0===k||k.dispose()},R.prototype._initCanvas=function(){this._ctx=(0,A.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},R.prototype.onOptionsChanged=function(){},R.prototype.onBlur=function(){},R.prototype.onFocus=function(){},R.prototype.onCursorMove=function(){},R.prototype.onGridChanged=function(k,E){},R.prototype.onSelectionChanged=function(k,E,x){void 0===x&&(x=!1)},R.prototype.setColors=function(k){this._refreshCharAtlas(k)},R.prototype._setTransparency=function(k){if(k!==this._alpha){var E=this._canvas;this._alpha=k,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,E),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},R.prototype._refreshCharAtlas=function(k){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=(0,I.acquireCharAtlas)(this._optionsService.options,this._rendererId,k,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},R.prototype.resize=function(k){this._scaledCellWidth=k.scaledCellWidth,this._scaledCellHeight=k.scaledCellHeight,this._scaledCharWidth=k.scaledCharWidth,this._scaledCharHeight=k.scaledCharHeight,this._scaledCharLeft=k.scaledCharLeft,this._scaledCharTop=k.scaledCharTop,this._canvas.width=k.scaledCanvasWidth,this._canvas.height=k.scaledCanvasHeight,this._canvas.style.width=k.canvasWidth+"px",this._canvas.style.height=k.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},R.prototype.clearTextureAtlas=function(){var k;null===(k=this._charAtlas)||void 0===k||k.clear()},R.prototype._fillCells=function(k,E,x,O){this._ctx.fillRect(k*this._scaledCellWidth,E*this._scaledCellHeight,x*this._scaledCellWidth,O*this._scaledCellHeight)},R.prototype._fillMiddleLineAtCells=function(k,E,x){void 0===x&&(x=1);var O=Math.ceil(.5*this._scaledCellHeight);this._ctx.fillRect(k*this._scaledCellWidth,(E+1)*this._scaledCellHeight-O-window.devicePixelRatio,x*this._scaledCellWidth,window.devicePixelRatio)},R.prototype._fillBottomLineAtCells=function(k,E,x){void 0===x&&(x=1),this._ctx.fillRect(k*this._scaledCellWidth,(E+1)*this._scaledCellHeight-window.devicePixelRatio-1,x*this._scaledCellWidth,window.devicePixelRatio)},R.prototype._fillLeftLineAtCell=function(k,E,x){this._ctx.fillRect(k*this._scaledCellWidth,E*this._scaledCellHeight,window.devicePixelRatio*x,this._scaledCellHeight)},R.prototype._strokeRectAtCell=function(k,E,x,O){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(k*this._scaledCellWidth+window.devicePixelRatio/2,E*this._scaledCellHeight+window.devicePixelRatio/2,x*this._scaledCellWidth-window.devicePixelRatio,O*this._scaledCellHeight-window.devicePixelRatio)},R.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},R.prototype._clearCells=function(k,E,x,O){this._alpha?this._ctx.clearRect(k*this._scaledCellWidth,E*this._scaledCellHeight,x*this._scaledCellWidth,O*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(k*this._scaledCellWidth,E*this._scaledCellHeight,x*this._scaledCellWidth,O*this._scaledCellHeight))},R.prototype._fillCharTrueColor=function(k,E,x){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipRow(x);var O=!1;!1!==this._optionsService.options.customGlyphs&&(O=(0,g.tryDrawCustomChar)(this._ctx,k.getChars(),E*this._scaledCellWidth,x*this._scaledCellHeight,this._scaledCellWidth,this._scaledCellHeight)),O||this._ctx.fillText(k.getChars(),E*this._scaledCellWidth+this._scaledCharLeft,x*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)},R.prototype._drawChars=function(k,E,x){var O,F,z=this._getContrastColor(k);z||k.isFgRGB()||k.isBgRGB()?this._drawUncachedChars(k,E,x,z):(k.isInverse()?(O=k.isBgDefault()?_.INVERTED_DEFAULT_COLOR:k.getBgColor(),F=k.isFgDefault()?_.INVERTED_DEFAULT_COLOR:k.getFgColor()):(F=k.isBgDefault()?b.DEFAULT_COLOR:k.getBgColor(),O=k.isFgDefault()?b.DEFAULT_COLOR:k.getFgColor()),O+=this._optionsService.options.drawBoldTextInBrightColors&&k.isBold()&&O<8?8:0,this._currentGlyphIdentifier.chars=k.getChars()||b.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=k.getCode()||b.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=F,this._currentGlyphIdentifier.fg=O,this._currentGlyphIdentifier.bold=!!k.isBold(),this._currentGlyphIdentifier.dim=!!k.isDim(),this._currentGlyphIdentifier.italic=!!k.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,E*this._scaledCellWidth+this._scaledCharLeft,x*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(k,E,x))},R.prototype._drawUncachedChars=function(k,E,x,O){if(this._ctx.save(),this._ctx.font=this._getFont(!!k.isBold(),!!k.isItalic()),this._ctx.textBaseline=_.TEXT_BASELINE,k.isInverse())if(O)this._ctx.fillStyle=O.css;else if(k.isBgDefault())this._ctx.fillStyle=S.color.opaque(this._colors.background).css;else if(k.isBgRGB())this._ctx.fillStyle="rgb("+D.AttributeData.toColorRGB(k.getBgColor()).join(",")+")";else{var F=k.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&k.isBold()&&F<8&&(F+=8),this._ctx.fillStyle=this._colors.ansi[F].css}else if(O)this._ctx.fillStyle=O.css;else if(k.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(k.isFgRGB())this._ctx.fillStyle="rgb("+D.AttributeData.toColorRGB(k.getFgColor()).join(",")+")";else{var z=k.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&k.isBold()&&z<8&&(z+=8),this._ctx.fillStyle=this._colors.ansi[z].css}this._clipRow(x),k.isDim()&&(this._ctx.globalAlpha=_.DIM_OPACITY);var K=!1;!1!==this._optionsService.options.customGlyphs&&(K=(0,g.tryDrawCustomChar)(this._ctx,k.getChars(),E*this._scaledCellWidth,x*this._scaledCellHeight,this._scaledCellWidth,this._scaledCellHeight)),K||this._ctx.fillText(k.getChars(),E*this._scaledCellWidth+this._scaledCharLeft,x*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight),this._ctx.restore()},R.prototype._clipRow=function(k){this._ctx.beginPath(),this._ctx.rect(0,k*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},R.prototype._getFont=function(k,E){return(E?"italic":"")+" "+(k?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},R.prototype._getContrastColor=function(k){if(1!==this._optionsService.options.minimumContrastRatio){var E=this._colors.contrastCache.getColor(k.bg,k.fg);if(void 0!==E)return E||void 0;var x=k.getFgColor(),O=k.getFgColorMode(),F=k.getBgColor(),z=k.getBgColorMode(),K=!!k.isInverse(),j=!!k.isInverse();if(K){var J=x;x=F,F=J;var ee=O;O=z,z=ee}var $=this._resolveBackgroundRgba(z,F,K),ae=this._resolveForegroundRgba(O,x,K,j),se=S.rgba.ensureContrastRatio($,ae,this._optionsService.options.minimumContrastRatio);if(se){var ce={css:S.channels.toCss(se>>24&255,se>>16&255,se>>8&255),rgba:se};return this._colors.contrastCache.setColor(k.bg,k.fg,ce),ce}this._colors.contrastCache.setColor(k.bg,k.fg,null)}},R.prototype._resolveBackgroundRgba=function(k,E,x){switch(k){case 16777216:case 33554432:return this._colors.ansi[E].rgba;case 50331648:return E<<8;default:return x?this._colors.foreground.rgba:this._colors.background.rgba}},R.prototype._resolveForegroundRgba=function(k,E,x,O){switch(k){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&O&&E<8&&(E+=8),this._colors.ansi[E].rgba;case 50331648:return E<<8;default:return x?this._colors.background.rgba:this._colors.foreground.rgba}},R}();w.BaseRenderLayer=T},2512:function(Z,w,N){var b,_=this&&this.__extends||(b=function(x,O){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,z){F.__proto__=z}||function(F,z){for(var K in z)Object.prototype.hasOwnProperty.call(z,K)&&(F[K]=z[K])})(x,O)},function(E,x){if("function"!=typeof x&&null!==x)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function O(){this.constructor=E}b(E,x),E.prototype=null===x?Object.create(x):(O.prototype=x.prototype,new O)}),I=this&&this.__decorate||function(E,x,O,F){var z,K=arguments.length,j=K<3?x:null===F?F=Object.getOwnPropertyDescriptor(x,O):F;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)j=Reflect.decorate(E,x,O,F);else for(var J=E.length-1;J>=0;J--)(z=E[J])&&(j=(K<3?z(j):K>3?z(x,O,j):z(x,O))||j);return K>3&&j&&Object.defineProperty(x,O,j),j},D=this&&this.__param||function(E,x){return function(O,F){x(O,F,E)}};Object.defineProperty(w,"__esModule",{value:!0}),w.CursorRenderLayer=void 0;var A=N(1546),S=N(511),v=N(2585),g=N(4725),T=600,R=function(E){function x(O,F,z,K,j,J,ee,$,ae){var se=E.call(this,O,"cursor",F,!0,z,K,J,ee)||this;return se._onRequestRedraw=j,se._coreService=$,se._coreBrowserService=ae,se._cell=new S.CellData,se._state={x:0,y:0,isFocused:!1,style:"",width:0},se._cursorRenderers={bar:se._renderBarCursor.bind(se),block:se._renderBlockCursor.bind(se),underline:se._renderUnderlineCursor.bind(se)},se}return _(x,E),x.prototype.dispose=function(){this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0),E.prototype.dispose.call(this)},x.prototype.resize=function(O){E.prototype.resize.call(this,O),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},x.prototype.reset=function(){var O;this._clearCursor(),null===(O=this._cursorBlinkStateManager)||void 0===O||O.restartBlinkAnimation(),this.onOptionsChanged()},x.prototype.onBlur=function(){var O;null===(O=this._cursorBlinkStateManager)||void 0===O||O.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},x.prototype.onFocus=function(){var O;null===(O=this._cursorBlinkStateManager)||void 0===O||O.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},x.prototype.onOptionsChanged=function(){var O,F=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new k(this._coreBrowserService.isFocused,function(){F._render(!0)})):(null===(O=this._cursorBlinkStateManager)||void 0===O||O.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},x.prototype.onCursorMove=function(){var O;null===(O=this._cursorBlinkStateManager)||void 0===O||O.restartBlinkAnimation()},x.prototype.onGridChanged=function(O,F){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},x.prototype._render=function(O){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var F=this._bufferService.buffer.ybase+this._bufferService.buffer.y,z=F-this._bufferService.buffer.ydisp;if(z<0||z>=this._bufferService.rows)this._clearCursor();else{var K=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(F).loadCell(K,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var j=this._optionsService.options.cursorStyle;return j&&"block"!==j?this._cursorRenderers[j](K,z,this._cell):this._renderBlurCursor(K,z,this._cell),this._ctx.restore(),this._state.x=K,this._state.y=z,this._state.isFocused=!1,this._state.style=j,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===K&&this._state.y===z&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](K,z,this._cell),this._ctx.restore(),this._state.x=K,this._state.y=z,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},x.prototype._clearCursor=function(){this._state&&(window.devicePixelRatio<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},x.prototype._renderBarCursor=function(O,F,z){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(O,F,this._optionsService.options.cursorWidth),this._ctx.restore()},x.prototype._renderBlockCursor=function(O,F,z){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(O,F,z.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(z,O,F),this._ctx.restore()},x.prototype._renderUnderlineCursor=function(O,F,z){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(O,F),this._ctx.restore()},x.prototype._renderBlurCursor=function(O,F,z){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(O,F,z.getWidth(),1),this._ctx.restore()},I([D(5,v.IBufferService),D(6,v.IOptionsService),D(7,v.ICoreService),D(8,g.ICoreBrowserService)],x)}(A.BaseRenderLayer);w.CursorRenderLayer=R;var k=function(){function E(x,O){this._renderCallback=O,this.isCursorVisible=!0,x&&this._restartInterval()}return Object.defineProperty(E.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),E.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},E.prototype.restartBlinkAnimation=function(){var x=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){x._renderCallback(),x._animationFrame=void 0})))},E.prototype._restartInterval=function(x){var O=this;void 0===x&&(x=T),this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=window.setTimeout(function(){if(O._animationTimeRestarted){var F=T-(Date.now()-O._animationTimeRestarted);if(O._animationTimeRestarted=void 0,F>0)return void O._restartInterval(F)}O.isCursorVisible=!1,O._animationFrame=window.requestAnimationFrame(function(){O._renderCallback(),O._animationFrame=void 0}),O._blinkInterval=window.setInterval(function(){if(O._animationTimeRestarted){var z=T-(Date.now()-O._animationTimeRestarted);return O._animationTimeRestarted=void 0,void O._restartInterval(z)}O.isCursorVisible=!O.isCursorVisible,O._animationFrame=window.requestAnimationFrame(function(){O._renderCallback(),O._animationFrame=void 0})},T)},x)},E.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},E.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},E}()},8978:function(Z,w,N){var b,_,I,D,A,S,v,g,T,R,k,E,x,O,F,z,K,j,J,ee,$,ae,se,ce,le,oe,Ae,be,it,qe,_t,yt,Ft,xe,De,je,dt,Ke,Bt,xt,vt,Qt,Ht,Ct,qt,bt,en,Nt,rn,kn,Ln,Rn,$n,Nn,wn,_r,ut,He,ve,ye,Te,we,ct,ft,Yt,Kt,Jt,nn,ln,yn,Tn,In,Yn,Cn,Sn,tr,ur,Ut,Rt,Lt,Oe,rt,he,Ie,Ne,Le,ze,At,an,jn,Rr,Hr,yr,Yr,co,Zi,bo,po,Xo,Ei,no,vi,Yi,fo,fi,Uo,ki,Wn,Ot,jt,Pt,Vt,Gt,Xt,gn,Gn,zn,Vn,si,Si,ro,Co,Li,Io,$o,ko,ii,Ho;Object.defineProperty(w,"__esModule",{value:!0}),w.tryDrawCustomChar=w.boxDrawingDefinitions=w.blockElementDefinitions=void 0;var io=N(1752);w.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258a":[{x:0,y:0,w:6,h:8}],"\u258b":[{x:0,y:0,w:5,h:8}],"\u258c":[{x:0,y:0,w:4,h:8}],"\u258d":[{x:0,y:0,w:3,h:8}],"\u258e":[{x:0,y:0,w:2,h:8}],"\u258f":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:9,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259a":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259b":[{x:0,y:0,w:4,h:8},{x:0,y:0,w:4,h:8}],"\u259c":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259d":[{x:4,y:0,w:4,h:4}],"\u259e":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259f":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\ud83e\udf70":[{x:1,y:0,w:1,h:8}],"\ud83e\udf71":[{x:2,y:0,w:1,h:8}],"\ud83e\udf72":[{x:3,y:0,w:1,h:8}],"\ud83e\udf73":[{x:4,y:0,w:1,h:8}],"\ud83e\udf74":[{x:5,y:0,w:1,h:8}],"\ud83e\udf75":[{x:6,y:0,w:1,h:8}],"\ud83e\udf76":[{x:0,y:1,w:8,h:1}],"\ud83e\udf77":[{x:0,y:2,w:8,h:1}],"\ud83e\udf78":[{x:0,y:3,w:8,h:1}],"\ud83e\udf79":[{x:0,y:4,w:8,h:1}],"\ud83e\udf7a":[{x:0,y:5,w:8,h:1}],"\ud83e\udf7b":[{x:0,y:6,w:8,h:1}],"\ud83e\udf7c":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\ud83e\udf7d":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\ud83e\udf7e":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\ud83e\udf7f":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\ud83e\udf80":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\ud83e\udf81":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\ud83e\udf82":[{x:0,y:0,w:8,h:2}],"\ud83e\udf83":[{x:0,y:0,w:8,h:3}],"\ud83e\udf84":[{x:0,y:0,w:8,h:5}],"\ud83e\udf85":[{x:0,y:0,w:8,h:6}],"\ud83e\udf86":[{x:0,y:0,w:8,h:7}],"\ud83e\udf87":[{x:6,y:0,w:2,h:8}],"\ud83e\udf88":[{x:5,y:0,w:3,h:8}],"\ud83e\udf89":[{x:3,y:0,w:5,h:8}],"\ud83e\udf8a":[{x:2,y:0,w:6,h:8}],"\ud83e\udf8b":[{x:1,y:0,w:7,h:8}],"\ud83e\udf95":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\ud83e\udf96":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\ud83e\udf97":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};var ji={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};w.boxDrawingDefinitions={"\u2500":(b={},b[1]="M0,.5 L1,.5",b),"\u2501":(_={},_[3]="M0,.5 L1,.5",_),"\u2502":(I={},I[1]="M.5,0 L.5,1",I),"\u2503":(D={},D[3]="M.5,0 L.5,1",D),"\u250c":(A={},A[1]="M0.5,1 L.5,.5 L1,.5",A),"\u250f":(S={},S[3]="M0.5,1 L.5,.5 L1,.5",S),"\u2510":(v={},v[1]="M0,.5 L.5,.5 L.5,1",v),"\u2513":(g={},g[3]="M0,.5 L.5,.5 L.5,1",g),"\u2514":(T={},T[1]="M.5,0 L.5,.5 L1,.5",T),"\u2517":(R={},R[3]="M.5,0 L.5,.5 L1,.5",R),"\u2518":(k={},k[1]="M.5,0 L.5,.5 L0,.5",k),"\u251b":(E={},E[3]="M.5,0 L.5,.5 L0,.5",E),"\u251c":(x={},x[1]="M.5,0 L.5,1 M.5,.5 L1,.5",x),"\u2523":(O={},O[3]="M.5,0 L.5,1 M.5,.5 L1,.5",O),"\u2524":(F={},F[1]="M.5,0 L.5,1 M.5,.5 L0,.5",F),"\u252b":(z={},z[3]="M.5,0 L.5,1 M.5,.5 L0,.5",z),"\u252c":(K={},K[1]="M0,.5 L1,.5 M.5,.5 L.5,1",K),"\u2533":(j={},j[3]="M0,.5 L1,.5 M.5,.5 L.5,1",j),"\u2534":(J={},J[1]="M0,.5 L1,.5 M.5,.5 L.5,0",J),"\u253b":(ee={},ee[3]="M0,.5 L1,.5 M.5,.5 L.5,0",ee),"\u253c":($={},$[1]="M0,.5 L1,.5 M.5,0 L.5,1",$),"\u254b":(ae={},ae[3]="M0,.5 L1,.5 M.5,0 L.5,1",ae),"\u2574":(se={},se[1]="M.5,.5 L0,.5",se),"\u2578":(ce={},ce[3]="M.5,.5 L0,.5",ce),"\u2575":(le={},le[1]="M.5,.5 L.5,0",le),"\u2579":(oe={},oe[3]="M.5,.5 L.5,0",oe),"\u2576":(Ae={},Ae[1]="M.5,.5 L1,.5",Ae),"\u257a":(be={},be[3]="M.5,.5 L1,.5",be),"\u2577":(it={},it[1]="M.5,.5 L.5,1",it),"\u257b":(qe={},qe[3]="M.5,.5 L.5,1",qe),"\u2550":(_t={},_t[1]=function(fn,vn){return"M0,"+(.5-vn)+" L1,"+(.5-vn)+" M0,"+(.5+vn)+" L1,"+(.5+vn)},_t),"\u2551":(yt={},yt[1]=function(fn,vn){return"M"+(.5-fn)+",0 L"+(.5-fn)+",1 M"+(.5+fn)+",0 L"+(.5+fn)+",1"},yt),"\u2552":(Ft={},Ft[1]=function(fn,vn){return"M.5,1 L.5,"+(.5-vn)+" L1,"+(.5-vn)+" M.5,"+(.5+vn)+" L1,"+(.5+vn)},Ft),"\u2553":(xe={},xe[1]=function(fn,vn){return"M"+(.5-fn)+",1 L"+(.5-fn)+",.5 L1,.5 M"+(.5+fn)+",.5 L"+(.5+fn)+",1"},xe),"\u2554":(De={},De[1]=function(fn,vn){return"M1,"+(.5-vn)+" L"+(.5-fn)+","+(.5-vn)+" L"+(.5-fn)+",1 M1,"+(.5+vn)+" L"+(.5+fn)+","+(.5+vn)+" L"+(.5+fn)+",1"},De),"\u2555":(je={},je[1]=function(fn,vn){return"M0,"+(.5-vn)+" L.5,"+(.5-vn)+" L.5,1 M0,"+(.5+vn)+" L.5,"+(.5+vn)},je),"\u2556":(dt={},dt[1]=function(fn,vn){return"M"+(.5+fn)+",1 L"+(.5+fn)+",.5 L0,.5 M"+(.5-fn)+",.5 L"+(.5-fn)+",1"},dt),"\u2557":(Ke={},Ke[1]=function(fn,vn){return"M0,"+(.5+vn)+" L"+(.5-fn)+","+(.5+vn)+" L"+(.5-fn)+",1 M0,"+(.5-vn)+" L"+(.5+fn)+","+(.5-vn)+" L"+(.5+fn)+",1"},Ke),"\u2558":(Bt={},Bt[1]=function(fn,vn){return"M.5,0 L.5,"+(.5+vn)+" L1,"+(.5+vn)+" M.5,"+(.5-vn)+" L1,"+(.5-vn)},Bt),"\u2559":(xt={},xt[1]=function(fn,vn){return"M1,.5 L"+(.5-fn)+",.5 L"+(.5-fn)+",0 M"+(.5+fn)+",.5 L"+(.5+fn)+",0"},xt),"\u255a":(vt={},vt[1]=function(fn,vn){return"M1,"+(.5-vn)+" L"+(.5+fn)+","+(.5-vn)+" L"+(.5+fn)+",0 M1,"+(.5+vn)+" L"+(.5-fn)+","+(.5+vn)+" L"+(.5-fn)+",0"},vt),"\u255b":(Qt={},Qt[1]=function(fn,vn){return"M0,"+(.5+vn)+" L.5,"+(.5+vn)+" L.5,0 M0,"+(.5-vn)+" L.5,"+(.5-vn)},Qt),"\u255c":(Ht={},Ht[1]=function(fn,vn){return"M0,.5 L"+(.5+fn)+",.5 L"+(.5+fn)+",0 M"+(.5-fn)+",.5 L"+(.5-fn)+",0"},Ht),"\u255d":(Ct={},Ct[1]=function(fn,vn){return"M0,"+(.5-vn)+" L"+(.5-fn)+","+(.5-vn)+" L"+(.5-fn)+",0 M0,"+(.5+vn)+" L"+(.5+fn)+","+(.5+vn)+" L"+(.5+fn)+",0"},Ct),"\u255e":(qt={},qt[1]=function(fn,vn){return"M.5,0 L.5,1 M.5,"+(.5-vn)+" L1,"+(.5-vn)+" M.5,"+(.5+vn)+" L1,"+(.5+vn)},qt),"\u255f":(bt={},bt[1]=function(fn,vn){return"M"+(.5-fn)+",0 L"+(.5-fn)+",1 M"+(.5+fn)+",0 L"+(.5+fn)+",1 M"+(.5+fn)+",.5 L1,.5"},bt),"\u2560":(en={},en[1]=function(fn,vn){return"M"+(.5-fn)+",0 L"+(.5-fn)+",1 M1,"+(.5+vn)+" L"+(.5+fn)+","+(.5+vn)+" L"+(.5+fn)+",1 M1,"+(.5-vn)+" L"+(.5+fn)+","+(.5-vn)+" L"+(.5+fn)+",0"},en),"\u2561":(Nt={},Nt[1]=function(fn,vn){return"M.5,0 L.5,1 M0,"+(.5-vn)+" L.5,"+(.5-vn)+" M0,"+(.5+vn)+" L.5,"+(.5+vn)},Nt),"\u2562":(rn={},rn[1]=function(fn,vn){return"M0,.5 L"+(.5-fn)+",.5 M"+(.5-fn)+",0 L"+(.5-fn)+",1 M"+(.5+fn)+",0 L"+(.5+fn)+",1"},rn),"\u2563":(kn={},kn[1]=function(fn,vn){return"M"+(.5+fn)+",0 L"+(.5+fn)+",1 M0,"+(.5+vn)+" L"+(.5-fn)+","+(.5+vn)+" L"+(.5-fn)+",1 M0,"+(.5-vn)+" L"+(.5-fn)+","+(.5-vn)+" L"+(.5-fn)+",0"},kn),"\u2564":(Ln={},Ln[1]=function(fn,vn){return"M0,"+(.5-vn)+" L1,"+(.5-vn)+" M0,"+(.5+vn)+" L1,"+(.5+vn)+" M.5,"+(.5+vn)+" L.5,1"},Ln),"\u2565":(Rn={},Rn[1]=function(fn,vn){return"M0,.5 L1,.5 M"+(.5-fn)+",.5 L"+(.5-fn)+",1 M"+(.5+fn)+",.5 L"+(.5+fn)+",1"},Rn),"\u2566":($n={},$n[1]=function(fn,vn){return"M0,"+(.5-vn)+" L1,"+(.5-vn)+" M0,"+(.5+vn)+" L"+(.5-fn)+","+(.5+vn)+" L"+(.5-fn)+",1 M1,"+(.5+vn)+" L"+(.5+fn)+","+(.5+vn)+" L"+(.5+fn)+",1"},$n),"\u2567":(Nn={},Nn[1]=function(fn,vn){return"M.5,0 L.5,"+(.5-vn)+" M0,"+(.5-vn)+" L1,"+(.5-vn)+" M0,"+(.5+vn)+" L1,"+(.5+vn)},Nn),"\u2568":(wn={},wn[1]=function(fn,vn){return"M0,.5 L1,.5 M"+(.5-fn)+",.5 L"+(.5-fn)+",0 M"+(.5+fn)+",.5 L"+(.5+fn)+",0"},wn),"\u2569":(_r={},_r[1]=function(fn,vn){return"M0,"+(.5+vn)+" L1,"+(.5+vn)+" M0,"+(.5-vn)+" L"+(.5-fn)+","+(.5-vn)+" L"+(.5-fn)+",0 M1,"+(.5-vn)+" L"+(.5+fn)+","+(.5-vn)+" L"+(.5+fn)+",0"},_r),"\u256a":(ut={},ut[1]=function(fn,vn){return"M.5,0 L.5,1 M0,"+(.5-vn)+" L1,"+(.5-vn)+" M0,"+(.5+vn)+" L1,"+(.5+vn)},ut),"\u256b":(He={},He[1]=function(fn,vn){return"M0,.5 L1,.5 M"+(.5-fn)+",0 L"+(.5-fn)+",1 M"+(.5+fn)+",0 L"+(.5+fn)+",1"},He),"\u256c":(ve={},ve[1]=function(fn,vn){return"M0,"+(.5+vn)+" L"+(.5-fn)+","+(.5+vn)+" L"+(.5-fn)+",1 M1,"+(.5+vn)+" L"+(.5+fn)+","+(.5+vn)+" L"+(.5+fn)+",1 M0,"+(.5-vn)+" L"+(.5-fn)+","+(.5-vn)+" L"+(.5-fn)+",0 M1,"+(.5-vn)+" L"+(.5+fn)+","+(.5-vn)+" L"+(.5+fn)+",0"},ve),"\u2571":(ye={},ye[1]="M1,0 L0,1",ye),"\u2572":(Te={},Te[1]="M0,0 L1,1",Te),"\u2573":(we={},we[1]="M1,0 L0,1 M0,0 L1,1",we),"\u257c":(ct={},ct[1]="M.5,.5 L0,.5",ct[3]="M.5,.5 L1,.5",ct),"\u257d":(ft={},ft[1]="M.5,.5 L.5,0",ft[3]="M.5,.5 L.5,1",ft),"\u257e":(Yt={},Yt[1]="M.5,.5 L1,.5",Yt[3]="M.5,.5 L0,.5",Yt),"\u257f":(Kt={},Kt[1]="M.5,.5 L.5,1",Kt[3]="M.5,.5 L.5,0",Kt),"\u250d":(Jt={},Jt[1]="M.5,.5 L.5,1",Jt[3]="M.5,.5 L1,.5",Jt),"\u250e":(nn={},nn[1]="M.5,.5 L1,.5",nn[3]="M.5,.5 L.5,1",nn),"\u2511":(ln={},ln[1]="M.5,.5 L.5,1",ln[3]="M.5,.5 L0,.5",ln),"\u2512":(yn={},yn[1]="M.5,.5 L0,.5",yn[3]="M.5,.5 L.5,1",yn),"\u2515":(Tn={},Tn[1]="M.5,.5 L.5,0",Tn[3]="M.5,.5 L1,.5",Tn),"\u2516":(In={},In[1]="M.5,.5 L1,.5",In[3]="M.5,.5 L.5,0",In),"\u2519":(Yn={},Yn[1]="M.5,.5 L.5,0",Yn[3]="M.5,.5 L0,.5",Yn),"\u251a":(Cn={},Cn[1]="M.5,.5 L0,.5",Cn[3]="M.5,.5 L.5,0",Cn),"\u251d":(Sn={},Sn[1]="M.5,0 L.5,1",Sn[3]="M.5,.5 L1,.5",Sn),"\u251e":(tr={},tr[1]="M0.5,1 L.5,.5 L1,.5",tr[3]="M.5,.5 L.5,0",tr),"\u251f":(ur={},ur[1]="M.5,0 L.5,.5 L1,.5",ur[3]="M.5,.5 L.5,1",ur),"\u2520":(Ut={},Ut[1]="M.5,.5 L1,.5",Ut[3]="M.5,0 L.5,1",Ut),"\u2521":(Rt={},Rt[1]="M.5,.5 L.5,1",Rt[3]="M.5,0 L.5,.5 L1,.5",Rt),"\u2522":(Lt={},Lt[1]="M.5,.5 L.5,0",Lt[3]="M0.5,1 L.5,.5 L1,.5",Lt),"\u2525":(Oe={},Oe[1]="M.5,0 L.5,1",Oe[3]="M.5,.5 L0,.5",Oe),"\u2526":(rt={},rt[1]="M0,.5 L.5,.5 L.5,1",rt[3]="M.5,.5 L.5,0",rt),"\u2527":(he={},he[1]="M.5,0 L.5,.5 L0,.5",he[3]="M.5,.5 L.5,1",he),"\u2528":(Ie={},Ie[1]="M.5,.5 L0,.5",Ie[3]="M.5,0 L.5,1",Ie),"\u2529":(Ne={},Ne[1]="M.5,.5 L.5,1",Ne[3]="M.5,0 L.5,.5 L0,.5",Ne),"\u252a":(Le={},Le[1]="M.5,.5 L.5,0",Le[3]="M0,.5 L.5,.5 L.5,1",Le),"\u252d":(ze={},ze[1]="M0.5,1 L.5,.5 L1,.5",ze[3]="M.5,.5 L0,.5",ze),"\u252e":(At={},At[1]="M0,.5 L.5,.5 L.5,1",At[3]="M.5,.5 L1,.5",At),"\u252f":(an={},an[1]="M.5,.5 L.5,1",an[3]="M0,.5 L1,.5",an),"\u2530":(jn={},jn[1]="M0,.5 L1,.5",jn[3]="M.5,.5 L.5,1",jn),"\u2531":(Rr={},Rr[1]="M.5,.5 L1,.5",Rr[3]="M0,.5 L.5,.5 L.5,1",Rr),"\u2532":(Hr={},Hr[1]="M.5,.5 L0,.5",Hr[3]="M0.5,1 L.5,.5 L1,.5",Hr),"\u2535":(yr={},yr[1]="M.5,0 L.5,.5 L1,.5",yr[3]="M.5,.5 L0,.5",yr),"\u2536":(Yr={},Yr[1]="M.5,0 L.5,.5 L0,.5",Yr[3]="M.5,.5 L1,.5",Yr),"\u2537":(co={},co[1]="M.5,.5 L.5,0",co[3]="M0,.5 L1,.5",co),"\u2538":(Zi={},Zi[1]="M0,.5 L1,.5",Zi[3]="M.5,.5 L.5,0",Zi),"\u2539":(bo={},bo[1]="M.5,.5 L1,.5",bo[3]="M.5,0 L.5,.5 L0,.5",bo),"\u253a":(po={},po[1]="M.5,.5 L0,.5",po[3]="M.5,0 L.5,.5 L1,.5",po),"\u253d":(Xo={},Xo[1]="M.5,0 L.5,1 M.5,.5 L1,.5",Xo[3]="M.5,.5 L0,.5",Xo),"\u253e":(Ei={},Ei[1]="M.5,0 L.5,1 M.5,.5 L0,.5",Ei[3]="M.5,.5 L1,.5",Ei),"\u253f":(no={},no[1]="M.5,0 L.5,1",no[3]="M0,.5 L1,.5",no),"\u2540":(vi={},vi[1]="M0,.5 L1,.5 M.5,.5 L.5,1",vi[3]="M.5,.5 L.5,0",vi),"\u2541":(Yi={},Yi[1]="M.5,.5 L.5,0 M0,.5 L1,.5",Yi[3]="M.5,.5 L.5,1",Yi),"\u2542":(fo={},fo[1]="M0,.5 L1,.5",fo[3]="M.5,0 L.5,1",fo),"\u2543":(fi={},fi[1]="M0.5,1 L.5,.5 L1,.5",fi[3]="M.5,0 L.5,.5 L0,.5",fi),"\u2544":(Uo={},Uo[1]="M0,.5 L.5,.5 L.5,1",Uo[3]="M.5,0 L.5,.5 L1,.5",Uo),"\u2545":(ki={},ki[1]="M.5,0 L.5,.5 L1,.5",ki[3]="M0,.5 L.5,.5 L.5,1",ki),"\u2546":(Wn={},Wn[1]="M.5,0 L.5,.5 L0,.5",Wn[3]="M0.5,1 L.5,.5 L1,.5",Wn),"\u2547":(Ot={},Ot[1]="M.5,.5 L.5,1",Ot[3]="M.5,.5 L.5,0 M0,.5 L1,.5",Ot),"\u2548":(jt={},jt[1]="M.5,.5 L.5,0",jt[3]="M0,.5 L1,.5 M.5,.5 L.5,1",jt),"\u2549":(Pt={},Pt[1]="M.5,.5 L1,.5",Pt[3]="M.5,0 L.5,1 M.5,.5 L0,.5",Pt),"\u254a":(Vt={},Vt[1]="M.5,.5 L0,.5",Vt[3]="M.5,0 L.5,1 M.5,.5 L1,.5",Vt),"\u254c":(Gt={},Gt[1]="M.1,.5 L.4,.5 M.6,.5 L.9,.5",Gt),"\u254d":(Xt={},Xt[3]="M.1,.5 L.4,.5 M.6,.5 L.9,.5",Xt),"\u2504":(gn={},gn[1]="M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5",gn),"\u2505":(Gn={},Gn[3]="M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5",Gn),"\u2508":(zn={},zn[1]="M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5",zn),"\u2509":(Vn={},Vn[3]="M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5",Vn),"\u254e":(si={},si[1]="M.5,.1 L.5,.4 M.5,.6 L.5,.9",si),"\u254f":(Si={},Si[3]="M.5,.1 L.5,.4 M.5,.6 L.5,.9",Si),"\u2506":(ro={},ro[1]="M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333",ro),"\u2507":(Co={},Co[3]="M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333",Co),"\u250a":(Li={},Li[1]="M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95",Li),"\u250b":(Io={},Io[3]="M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95",Io),"\u256d":($o={},$o[1]="C.5,1,.5,.5,1,.5",$o),"\u256e":(ko={},ko[1]="C.5,1,.5,.5,0,.5",ko),"\u256f":(ii={},ii[1]="C.5,0,.5,.5,0,.5",ii),"\u2570":(Ho={},Ho[1]="C.5,0,.5,.5,1,.5",Ho)},w.tryDrawCustomChar=function(fn,vn,pr,ho,pa,xi){var So=w.blockElementDefinitions[vn];if(So)return function(Mo,Ro,fs,To,ha,ka){for(var qo=0;qo7&&parseInt(Ui.substr(7,2),16)||1;else{if(!Ui.startsWith("rgba"))throw new Error('Unexpected fillStyle color format "'+Ui+'" when drawing pattern glyph');Ma=(qo=Ui.substring(5,Ui.length-1).split(",").map(function(Pu){return parseFloat(Pu)}))[0],Hi=qo[1],Ua=qo[2],ar=qo[3]}for(var Wi=0;Wi=0;K--)(O=R[K])&&(z=(F<3?O(z):F>3?O(k,E,z):O(k,E))||z);return F>3&&z&&Object.defineProperty(k,E,z),z},D=this&&this.__param||function(R,k){return function(E,x){k(E,x,R)}};Object.defineProperty(w,"__esModule",{value:!0}),w.LinkRenderLayer=void 0;var A=N(1546),S=N(8803),v=N(2040),g=N(2585),T=function(R){function k(E,x,O,F,z,K,j,J){var ee=R.call(this,E,"link",x,!0,O,F,j,J)||this;return z.onShowLinkUnderline(function($){return ee._onShowLinkUnderline($)}),z.onHideLinkUnderline(function($){return ee._onHideLinkUnderline($)}),K.onShowLinkUnderline(function($){return ee._onShowLinkUnderline($)}),K.onHideLinkUnderline(function($){return ee._onHideLinkUnderline($)}),ee}return _(k,R),k.prototype.resize=function(E){R.prototype.resize.call(this,E),this._state=void 0},k.prototype.reset=function(){this._clearCurrentLink()},k.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},k.prototype._onShowLinkUnderline=function(E){if(this._ctx.fillStyle=E.fg===S.INVERTED_DEFAULT_COLOR?this._colors.background.css:E.fg&&(0,v.is256Color)(E.fg)?this._colors.ansi[E.fg].css:this._colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(var x=E.y1+1;x=0;se--)(ee=z[se])&&(ae=($<3?ee(ae):$>3?ee(K,j,ae):ee(K,j))||ae);return $>3&&ae&&Object.defineProperty(K,j,ae),ae},D=this&&this.__param||function(z,K){return function(j,J){K(j,J,z)}};Object.defineProperty(w,"__esModule",{value:!0}),w.Renderer=void 0;var A=N(9596),S=N(4149),v=N(2512),g=N(5098),T=N(844),R=N(4725),k=N(2585),E=N(1420),x=N(8460),O=1,F=function(z){function K(j,J,ee,$,ae,se,ce,le){var oe=z.call(this)||this;return oe._colors=j,oe._screenElement=J,oe._bufferService=se,oe._charSizeService=ce,oe._optionsService=le,oe._id=O++,oe._onRequestRedraw=new x.EventEmitter,oe._renderLayers=[ae.createInstance(A.TextRenderLayer,oe._screenElement,0,oe._colors,oe._optionsService.options.allowTransparency,oe._id),ae.createInstance(S.SelectionRenderLayer,oe._screenElement,1,oe._colors,oe._id),ae.createInstance(g.LinkRenderLayer,oe._screenElement,2,oe._colors,oe._id,ee,$),ae.createInstance(v.CursorRenderLayer,oe._screenElement,3,oe._colors,oe._id,oe._onRequestRedraw)],oe.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},oe._devicePixelRatio=window.devicePixelRatio,oe._updateDimensions(),oe.onOptionsChanged(),oe}return _(K,z),Object.defineProperty(K.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),K.prototype.dispose=function(){for(var j=0,J=this._renderLayers;j=0;F--)(E=g[F])&&(O=(x<3?E(O):x>3?E(T,R,O):E(T,R))||O);return x>3&&O&&Object.defineProperty(T,R,O),O},D=this&&this.__param||function(g,T){return function(R,k){T(R,k,g)}};Object.defineProperty(w,"__esModule",{value:!0}),w.SelectionRenderLayer=void 0;var A=N(1546),S=N(2585),v=function(g){function T(R,k,E,x,O,F){var z=g.call(this,R,"selection",k,!0,E,x,O,F)||this;return z._clearState(),z}return _(T,g),T.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},T.prototype.resize=function(R){g.prototype.resize.call(this,R),this._clearState()},T.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},T.prototype.onSelectionChanged=function(R,k,E){if(this._didStateChange(R,k,E,this._bufferService.buffer.ydisp))if(this._clearAll(),R&&k){var x=R[1]-this._bufferService.buffer.ydisp,O=k[1]-this._bufferService.buffer.ydisp,F=Math.max(x,0),z=Math.min(O,this._bufferService.rows-1);if(F>=this._bufferService.rows||z<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=this._colors.selectionTransparent.css,E){var K=R[0];this._fillCells(K,F,k[0]-K,z-F+1)}else{this._fillCells(K=x===F?R[0]:0,F,(F===O?k[0]:this._bufferService.cols)-K,1);var $=Math.max(z-F-1,0);this._fillCells(0,F+1,this._bufferService.cols,$),F!==z&&this._fillCells(0,z,O===z?k[0]:this._bufferService.cols,1)}this._state.start=[R[0],R[1]],this._state.end=[k[0],k[1]],this._state.columnSelectMode=E,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},T.prototype._didStateChange=function(R,k,E,x){return!this._areCoordinatesEqual(R,this._state.start)||!this._areCoordinatesEqual(k,this._state.end)||E!==this._state.columnSelectMode||x!==this._state.ydisp},T.prototype._areCoordinatesEqual=function(R,k){return!(!R||!k)&&R[0]===k[0]&&R[1]===k[1]},I([D(4,S.IBufferService),D(5,S.IOptionsService)],T)}(A.BaseRenderLayer);w.SelectionRenderLayer=v},9596:function(Z,w,N){var b,_=this&&this.__extends||(b=function(F,z){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,j){K.__proto__=j}||function(K,j){for(var J in j)Object.prototype.hasOwnProperty.call(j,J)&&(K[J]=j[J])})(F,z)},function(O,F){if("function"!=typeof F&&null!==F)throw new TypeError("Class extends value "+String(F)+" is not a constructor or null");function z(){this.constructor=O}b(O,F),O.prototype=null===F?Object.create(F):(z.prototype=F.prototype,new z)}),I=this&&this.__decorate||function(O,F,z,K){var j,J=arguments.length,ee=J<3?F:null===K?K=Object.getOwnPropertyDescriptor(F,z):K;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)ee=Reflect.decorate(O,F,z,K);else for(var $=O.length-1;$>=0;$--)(j=O[$])&&(ee=(J<3?j(ee):J>3?j(F,z,ee):j(F,z))||ee);return J>3&&ee&&Object.defineProperty(F,z,ee),ee},D=this&&this.__param||function(O,F){return function(z,K){F(z,K,O)}};Object.defineProperty(w,"__esModule",{value:!0}),w.TextRenderLayer=void 0;var A=N(3700),S=N(1546),v=N(3734),g=N(643),T=N(511),R=N(2585),k=N(4725),E=N(4269),x=function(O){function F(z,K,j,J,ee,$,ae,se){var ce=O.call(this,z,"text",K,J,j,ee,$,ae)||this;return ce._characterJoinerService=se,ce._characterWidth=0,ce._characterFont="",ce._characterOverlapCache={},ce._workCell=new T.CellData,ce._state=new A.GridCache,ce}return _(F,O),F.prototype.resize=function(z){O.prototype.resize.call(this,z);var K=this._getFont(!1,!1);this._characterWidth===z.scaledCharWidth&&this._characterFont===K||(this._characterWidth=z.scaledCharWidth,this._characterFont=K,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},F.prototype.reset=function(){this._state.clear(),this._clearAll()},F.prototype._forEachCell=function(z,K,j){for(var J=z;J<=K;J++)for(var ee=J+this._bufferService.buffer.ydisp,$=this._bufferService.buffer.lines.get(ee),ae=this._characterJoinerService.getJoinedCharacters(ee),se=0;se0&&se===ae[0][0]){le=!0;var Ae=ae.shift();ce=new E.JoinedCellData(this._workCell,$.translateToString(!0,Ae[0],Ae[1]),Ae[1]-Ae[0]),oe=Ae[1]-1}!le&&this._isOverlapping(ce)&&oe<$.length-1&&$.getCodePoint(oe+1)===g.NULL_CELL_CODE&&(ce.content&=-12582913,ce.content|=2<<22),j(ce,se,J),se=oe}}},F.prototype._drawBackground=function(z,K){var j=this,J=this._ctx,ee=this._bufferService.cols,$=0,ae=0,se=null;J.save(),this._forEachCell(z,K,function(ce,le,oe){var Ae=null;ce.isInverse()?Ae=ce.isFgDefault()?j._colors.foreground.css:ce.isFgRGB()?"rgb("+v.AttributeData.toColorRGB(ce.getFgColor()).join(",")+")":j._colors.ansi[ce.getFgColor()].css:ce.isBgRGB()?Ae="rgb("+v.AttributeData.toColorRGB(ce.getBgColor()).join(",")+")":ce.isBgPalette()&&(Ae=j._colors.ansi[ce.getBgColor()].css),null===se&&($=le,ae=oe),oe!==ae?(J.fillStyle=se||"",j._fillCells($,ae,ee-$,1),$=le,ae=oe):se!==Ae&&(J.fillStyle=se||"",j._fillCells($,ae,le-$,1),$=le,ae=oe),se=Ae}),null!==se&&(J.fillStyle=se,this._fillCells($,ae,ee-$,1)),J.restore()},F.prototype._drawForeground=function(z,K){var j=this;this._forEachCell(z,K,function(J,ee,$){if(!J.isInvisible()&&(j._drawChars(J,ee,$),J.isUnderline()||J.isStrikethrough())){if(j._ctx.save(),J.isInverse())if(J.isBgDefault())j._ctx.fillStyle=j._colors.background.css;else if(J.isBgRGB())j._ctx.fillStyle="rgb("+v.AttributeData.toColorRGB(J.getBgColor()).join(",")+")";else{var ae=J.getBgColor();j._optionsService.options.drawBoldTextInBrightColors&&J.isBold()&&ae<8&&(ae+=8),j._ctx.fillStyle=j._colors.ansi[ae].css}else if(J.isFgDefault())j._ctx.fillStyle=j._colors.foreground.css;else if(J.isFgRGB())j._ctx.fillStyle="rgb("+v.AttributeData.toColorRGB(J.getFgColor()).join(",")+")";else{var se=J.getFgColor();j._optionsService.options.drawBoldTextInBrightColors&&J.isBold()&&se<8&&(se+=8),j._ctx.fillStyle=j._colors.ansi[se].css}J.isStrikethrough()&&j._fillMiddleLineAtCells(ee,$,J.getWidth()),J.isUnderline()&&j._fillBottomLineAtCells(ee,$,J.getWidth()),j._ctx.restore()}})},F.prototype.onGridChanged=function(z,K){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,z,this._bufferService.cols,K-z+1),this._drawBackground(z,K),this._drawForeground(z,K))},F.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},F.prototype._isOverlapping=function(z){if(1!==z.getWidth()||z.getCode()<256)return!1;var K=z.getChars();if(this._characterOverlapCache.hasOwnProperty(K))return this._characterOverlapCache[K];this._ctx.save(),this._ctx.font=this._characterFont;var j=Math.floor(this._ctx.measureText(K).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[K]=j,j},I([D(5,R.IBufferService),D(6,R.IOptionsService),D(7,k.ICharacterJoinerService)],F)}(S.BaseRenderLayer);w.TextRenderLayer=x},9616:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.BaseCharAtlas=void 0;var N=function(){function b(){this._didWarmUp=!1}return b.prototype.dispose=function(){},b.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},b.prototype._doWarmUp=function(){},b.prototype.clear=function(){},b.prototype.beginFrame=function(){},b}();w.BaseCharAtlas=N},1420:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.removeTerminalFromCache=w.acquireCharAtlas=void 0;var b=N(2040),_=N(1906),I=[];w.acquireCharAtlas=function(D,A,S,v,g){for(var T=(0,b.generateConfig)(v,g,D,S),R=0;R=0){if((0,b.configEquals)(E.config,T))return E.atlas;1===E.ownedBy.length?(E.atlas.dispose(),I.splice(R,1)):E.ownedBy.splice(k,1);break}}for(R=0;R0){var J=this._width*this._height;this._cacheMap=new S.LRUMap(J),this._cacheMap.prealloc(J)}this._cacheCtx.clearRect(0,0,R,k),this._tmpCtx.clearRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight)},j.prototype.draw=function(J,ee,$,ae){if(32===ee.code)return!0;if(!this._canCache(ee))return!1;var se=x(ee),ce=this._cacheMap.get(se);if(null!=ce)return this._drawFromCache(J,ce,$,ae),!0;if(this._drawToCacheCount<100){var le;le=this._cacheMap.size>>24,$=j.rgba>>>16&255,ae=j.rgba>>>8&255,se=0;se=this.capacity)this._unlinkNode(D=this._head),delete this._map[D.key],D.key=_,D.value=I,this._map[_]=D;else{var A=this._nodePool;A.length>0?((D=A.pop()).key=_,D.value=I):D={prev:null,next:null,key:_,value:I},this._map[_]=D,this.size++}this._appendNode(D)},b}();w.LRUMap=N},1296:function(Z,w,N){var b,_=this&&this.__extends||(b=function(ee,$){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ae,se){ae.__proto__=se}||function(ae,se){for(var ce in se)Object.prototype.hasOwnProperty.call(se,ce)&&(ae[ce]=se[ce])})(ee,$)},function(J,ee){if("function"!=typeof ee&&null!==ee)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function $(){this.constructor=J}b(J,ee),J.prototype=null===ee?Object.create(ee):($.prototype=ee.prototype,new $)}),I=this&&this.__decorate||function(J,ee,$,ae){var se,ce=arguments.length,le=ce<3?ee:null===ae?ae=Object.getOwnPropertyDescriptor(ee,$):ae;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)le=Reflect.decorate(J,ee,$,ae);else for(var oe=J.length-1;oe>=0;oe--)(se=J[oe])&&(le=(ce<3?se(le):ce>3?se(ee,$,le):se(ee,$))||le);return ce>3&&le&&Object.defineProperty(ee,$,le),le},D=this&&this.__param||function(J,ee){return function($,ae){ee($,ae,J)}};Object.defineProperty(w,"__esModule",{value:!0}),w.DomRenderer=void 0;var A=N(3787),S=N(8803),v=N(844),g=N(4725),T=N(2585),R=N(8460),k=N(4774),E=N(9631),x="xterm-dom-renderer-owner-",O="xterm-fg-",F="xterm-bg-",z="xterm-focus",K=1,j=function(J){function ee($,ae,se,ce,le,oe,Ae,be,it,qe){var _t=J.call(this)||this;return _t._colors=$,_t._element=ae,_t._screenElement=se,_t._viewportElement=ce,_t._linkifier=le,_t._linkifier2=oe,_t._charSizeService=be,_t._optionsService=it,_t._bufferService=qe,_t._terminalClass=K++,_t._rowElements=[],_t._rowContainer=document.createElement("div"),_t._rowContainer.classList.add("xterm-rows"),_t._rowContainer.style.lineHeight="normal",_t._rowContainer.setAttribute("aria-hidden","true"),_t._refreshRowElements(_t._bufferService.cols,_t._bufferService.rows),_t._selectionContainer=document.createElement("div"),_t._selectionContainer.classList.add("xterm-selection"),_t._selectionContainer.setAttribute("aria-hidden","true"),_t.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},_t._updateDimensions(),_t._injectCss(),_t._rowFactory=Ae.createInstance(A.DomRendererRowFactory,document,_t._colors),_t._element.classList.add(x+_t._terminalClass),_t._screenElement.appendChild(_t._rowContainer),_t._screenElement.appendChild(_t._selectionContainer),_t._linkifier.onShowLinkUnderline(function(yt){return _t._onLinkHover(yt)}),_t._linkifier.onHideLinkUnderline(function(yt){return _t._onLinkLeave(yt)}),_t._linkifier2.onShowLinkUnderline(function(yt){return _t._onLinkHover(yt)}),_t._linkifier2.onHideLinkUnderline(function(yt){return _t._onLinkLeave(yt)}),_t}return _(ee,J),Object.defineProperty(ee.prototype,"onRequestRedraw",{get:function(){return(new R.EventEmitter).event},enumerable:!1,configurable:!0}),ee.prototype.dispose=function(){this._element.classList.remove(x+this._terminalClass),(0,E.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),J.prototype.dispose.call(this)},ee.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var $=0,ae=this._rowElements;$ae;)this._rowContainer.removeChild(this._rowElements.pop())},ee.prototype.onResize=function($,ae){this._refreshRowElements($,ae),this._updateDimensions()},ee.prototype.onCharSizeChanged=function(){this._updateDimensions()},ee.prototype.onBlur=function(){this._rowContainer.classList.remove(z)},ee.prototype.onFocus=function(){this._rowContainer.classList.add(z)},ee.prototype.onSelectionChanged=function($,ae,se){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if($&&ae){var ce=$[1]-this._bufferService.buffer.ydisp,le=ae[1]-this._bufferService.buffer.ydisp,oe=Math.max(ce,0),Ae=Math.min(le,this._bufferService.rows-1);if(!(oe>=this._bufferService.rows||Ae<0)){var be=document.createDocumentFragment();se?be.appendChild(this._createSelectionElement(oe,$[0],ae[0],Ae-oe+1)):(be.appendChild(this._createSelectionElement(oe,ce===oe?$[0]:0,oe===le?ae[0]:this._bufferService.cols)),be.appendChild(this._createSelectionElement(oe+1,0,this._bufferService.cols,Ae-oe-1)),oe!==Ae&&be.appendChild(this._createSelectionElement(Ae,0,le===Ae?ae[0]:this._bufferService.cols))),this._selectionContainer.appendChild(be)}}},ee.prototype._createSelectionElement=function($,ae,se,ce){void 0===ce&&(ce=1);var le=document.createElement("div");return le.style.height=ce*this.dimensions.actualCellHeight+"px",le.style.top=$*this.dimensions.actualCellHeight+"px",le.style.left=ae*this.dimensions.actualCellWidth+"px",le.style.width=this.dimensions.actualCellWidth*(se-ae)+"px",le},ee.prototype.onCursorMove=function(){},ee.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},ee.prototype.clear=function(){for(var $=0,ae=this._rowElements;$=le&&($=0,se++)}},I([D(6,T.IInstantiationService),D(7,g.ICharSizeService),D(8,T.IOptionsService),D(9,T.IBufferService)],ee)}(v.Disposable);w.DomRenderer=j},3787:function(Z,w,N){var b=this&&this.__decorate||function(E,x,O,F){var z,K=arguments.length,j=K<3?x:null===F?F=Object.getOwnPropertyDescriptor(x,O):F;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)j=Reflect.decorate(E,x,O,F);else for(var J=E.length-1;J>=0;J--)(z=E[J])&&(j=(K<3?z(j):K>3?z(x,O,j):z(x,O))||j);return K>3&&j&&Object.defineProperty(x,O,j),j},_=this&&this.__param||function(E,x){return function(O,F){x(O,F,E)}};Object.defineProperty(w,"__esModule",{value:!0}),w.DomRendererRowFactory=w.CURSOR_STYLE_UNDERLINE_CLASS=w.CURSOR_STYLE_BAR_CLASS=w.CURSOR_STYLE_BLOCK_CLASS=w.CURSOR_BLINK_CLASS=w.CURSOR_CLASS=w.STRIKETHROUGH_CLASS=w.UNDERLINE_CLASS=w.ITALIC_CLASS=w.DIM_CLASS=w.BOLD_CLASS=void 0;var I=N(8803),D=N(643),A=N(511),S=N(2585),v=N(4774),g=N(4725),T=N(4269);w.BOLD_CLASS="xterm-bold",w.DIM_CLASS="xterm-dim",w.ITALIC_CLASS="xterm-italic",w.UNDERLINE_CLASS="xterm-underline",w.STRIKETHROUGH_CLASS="xterm-strikethrough",w.CURSOR_CLASS="xterm-cursor",w.CURSOR_BLINK_CLASS="xterm-cursor-blink",w.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",w.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",w.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var R=function(){function E(x,O,F,z,K){this._document=x,this._colors=O,this._characterJoinerService=F,this._optionsService=z,this._coreService=K,this._workCell=new A.CellData}return E.prototype.setColors=function(x){this._colors=x},E.prototype.createRow=function(x,O,F,z,K,j,J,ee){for(var $=this._document.createDocumentFragment(),ae=this._characterJoinerService.getJoinedCharacters(O),se=0,ce=Math.min(x.length,ee)-1;ce>=0;ce--)if(x.loadCell(ce,this._workCell).getCode()!==D.NULL_CELL_CODE||F&&ce===K){se=ce+1;break}for(ce=0;ce0&&ce===ae[0][0]){oe=!0;var it=ae.shift();be=new T.JoinedCellData(this._workCell,x.translateToString(!0,it[0],it[1]),it[1]-it[0]),Ae=it[1]-1,le=be.getWidth()}var qe=this._document.createElement("span");if(le>1&&(qe.style.width=J*le+"px"),oe&&(qe.style.display="inline",K>=ce&&K<=Ae&&(K=ce)),!this._coreService.isCursorHidden&&F&&ce===K)switch(qe.classList.add(w.CURSOR_CLASS),j&&qe.classList.add(w.CURSOR_BLINK_CLASS),z){case"bar":qe.classList.add(w.CURSOR_STYLE_BAR_CLASS);break;case"underline":qe.classList.add(w.CURSOR_STYLE_UNDERLINE_CLASS);break;default:qe.classList.add(w.CURSOR_STYLE_BLOCK_CLASS)}be.isBold()&&qe.classList.add(w.BOLD_CLASS),be.isItalic()&&qe.classList.add(w.ITALIC_CLASS),be.isDim()&&qe.classList.add(w.DIM_CLASS),be.isUnderline()&&qe.classList.add(w.UNDERLINE_CLASS),qe.textContent=be.isInvisible()?D.WHITESPACE_CELL_CHAR:be.getChars()||D.WHITESPACE_CELL_CHAR,be.isStrikethrough()&&qe.classList.add(w.STRIKETHROUGH_CLASS);var _t=be.getFgColor(),yt=be.getFgColorMode(),Ft=be.getBgColor(),xe=be.getBgColorMode(),De=!!be.isInverse();if(De){var je=_t;_t=Ft,Ft=je;var dt=yt;yt=xe,xe=dt}switch(yt){case 16777216:case 33554432:be.isBold()&&_t<8&&this._optionsService.options.drawBoldTextInBrightColors&&(_t+=8),this._applyMinimumContrast(qe,this._colors.background,this._colors.ansi[_t])||qe.classList.add("xterm-fg-"+_t);break;case 50331648:var Ke=v.rgba.toColor(_t>>16&255,_t>>8&255,255&_t);this._applyMinimumContrast(qe,this._colors.background,Ke)||this._addStyle(qe,"color:#"+k(_t.toString(16),"0",6));break;default:this._applyMinimumContrast(qe,this._colors.background,this._colors.foreground)||De&&qe.classList.add("xterm-fg-"+I.INVERTED_DEFAULT_COLOR)}switch(xe){case 16777216:case 33554432:qe.classList.add("xterm-bg-"+Ft);break;case 50331648:this._addStyle(qe,"background-color:#"+k(Ft.toString(16),"0",6));break;default:De&&qe.classList.add("xterm-bg-"+I.INVERTED_DEFAULT_COLOR)}$.appendChild(qe),ce=Ae}}return $},E.prototype._applyMinimumContrast=function(x,O,F){if(1===this._optionsService.options.minimumContrastRatio)return!1;var z=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===z&&(z=v.color.ensureContrastRatio(O,F,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=z?z:null)),!!z&&(this._addStyle(x,"color:"+z.css),!0)},E.prototype._addStyle=function(x,O){x.setAttribute("style",""+(x.getAttribute("style")||"")+O+";")},b([_(2,g.ICharacterJoinerService),_(3,S.IOptionsService),_(4,S.ICoreService)],E)}();function k(E,x,O){for(;E.lengththis._bufferService.cols?[I%this._bufferService.cols,this.selectionStart[1]+Math.floor(I/this._bufferService.cols)]:[I,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),b.prototype.areSelectionValuesReversed=function(){var _=this.selectionStart,I=this.selectionEnd;return!(!_||!I)&&(_[1]>I[1]||_[1]===I[1]&&_[0]>I[0])},b.prototype.onTrim=function(_){return this.selectionStart&&(this.selectionStart[1]-=_),this.selectionEnd&&(this.selectionEnd[1]-=_),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},b}();w.SelectionModel=N},428:function(Z,w,N){var b=this&&this.__decorate||function(v,g,T,R){var k,E=arguments.length,x=E<3?g:null===R?R=Object.getOwnPropertyDescriptor(g,T):R;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)x=Reflect.decorate(v,g,T,R);else for(var O=v.length-1;O>=0;O--)(k=v[O])&&(x=(E<3?k(x):E>3?k(g,T,x):k(g,T))||x);return E>3&&x&&Object.defineProperty(g,T,x),x},_=this&&this.__param||function(v,g){return function(T,R){g(T,R,v)}};Object.defineProperty(w,"__esModule",{value:!0}),w.CharSizeService=void 0;var I=N(2585),D=N(8460),A=function(){function v(g,T,R){this._optionsService=R,this.width=0,this.height=0,this._onCharSizeChange=new D.EventEmitter,this._measureStrategy=new S(g,T,this._optionsService)}return Object.defineProperty(v.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),v.prototype.measure=function(){var g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())},b([_(2,I.IOptionsService)],v)}();w.CharSizeService=A;var S=function(){function v(g,T,R){this._document=g,this._parentElement=T,this._optionsService=R,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return v.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var g=this._measureElement.getBoundingClientRect();return 0!==g.width&&0!==g.height&&(this._result.width=g.width,this._result.height=Math.ceil(g.height)),this._result},v}()},4269:function(Z,w,N){var b,_=this&&this.__extends||(b=function(E,x){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,F){O.__proto__=F}||function(O,F){for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&(O[z]=F[z])})(E,x)},function(k,E){if("function"!=typeof E&&null!==E)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function x(){this.constructor=k}b(k,E),k.prototype=null===E?Object.create(E):(x.prototype=E.prototype,new x)}),I=this&&this.__decorate||function(k,E,x,O){var F,z=arguments.length,K=z<3?E:null===O?O=Object.getOwnPropertyDescriptor(E,x):O;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)K=Reflect.decorate(k,E,x,O);else for(var j=k.length-1;j>=0;j--)(F=k[j])&&(K=(z<3?F(K):z>3?F(E,x,K):F(E,x))||K);return z>3&&K&&Object.defineProperty(E,x,K),K},D=this&&this.__param||function(k,E){return function(x,O){E(x,O,k)}};Object.defineProperty(w,"__esModule",{value:!0}),w.CharacterJoinerService=w.JoinedCellData=void 0;var A=N(3734),S=N(643),v=N(511),g=N(2585),T=function(k){function E(x,O,F){var z=k.call(this)||this;return z.content=0,z.combinedData="",z.fg=x.fg,z.bg=x.bg,z.combinedData=O,z._width=F,z}return _(E,k),E.prototype.isCombined=function(){return 2097152},E.prototype.getWidth=function(){return this._width},E.prototype.getChars=function(){return this.combinedData},E.prototype.getCode=function(){return 2097151},E.prototype.setFromCharData=function(x){throw new Error("not implemented")},E.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},E}(A.AttributeData);w.JoinedCellData=T;var R=function(){function k(E){this._bufferService=E,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}return k.prototype.register=function(E){var x={id:this._nextCharacterJoinerId++,handler:E};return this._characterJoiners.push(x),x.id},k.prototype.deregister=function(E){for(var x=0;x1)for(var ae=this._getJoinedRanges(F,j,K,x,z),se=0;se1)for(ae=this._getJoinedRanges(F,j,K,x,z),se=0;se=0;x--)(R=S[x])&&(E=(k<3?R(E):k>3?R(v,g,E):R(v,g))||E);return k>3&&E&&Object.defineProperty(v,g,E),E},_=this&&this.__param||function(S,v){return function(g,T){v(g,T,S)}};Object.defineProperty(w,"__esModule",{value:!0}),w.MouseService=void 0;var I=N(4725),D=N(9806),A=function(){function S(v,g){this._renderService=v,this._charSizeService=g}return S.prototype.getCoords=function(v,g,T,R,k){return(0,D.getCoords)(v,g,T,R,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,k)},S.prototype.getRawByteCoords=function(v,g,T,R){var k=this.getCoords(v,g,T,R);return(0,D.getRawByteCoords)(k)},b([_(0,I.IRenderService),_(1,I.ICharSizeService)],S)}();w.MouseService=A},3230:function(Z,w,N){var b,_=this&&this.__extends||(b=function(O,F){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(z,K){z.__proto__=K}||function(z,K){for(var j in K)Object.prototype.hasOwnProperty.call(K,j)&&(z[j]=K[j])})(O,F)},function(x,O){if("function"!=typeof O&&null!==O)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");function F(){this.constructor=x}b(x,O),x.prototype=null===O?Object.create(O):(F.prototype=O.prototype,new F)}),I=this&&this.__decorate||function(x,O,F,z){var K,j=arguments.length,J=j<3?O:null===z?z=Object.getOwnPropertyDescriptor(O,F):z;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)J=Reflect.decorate(x,O,F,z);else for(var ee=x.length-1;ee>=0;ee--)(K=x[ee])&&(J=(j<3?K(J):j>3?K(O,F,J):K(O,F))||J);return j>3&&J&&Object.defineProperty(O,F,J),J},D=this&&this.__param||function(x,O){return function(F,z){O(F,z,x)}};Object.defineProperty(w,"__esModule",{value:!0}),w.RenderService=void 0;var A=N(6193),S=N(8460),v=N(844),g=N(5596),T=N(3656),R=N(2585),k=N(4725),E=function(x){function O(F,z,K,j,J,ee){var $=x.call(this)||this;if($._renderer=F,$._rowCount=z,$._charSizeService=J,$._isPaused=!1,$._needsFullRefresh=!1,$._isNextRenderRedrawOnly=!0,$._needsSelectionRefresh=!1,$._canvasWidth=0,$._canvasHeight=0,$._selectionState={start:void 0,end:void 0,columnSelectMode:!1},$._onDimensionsChange=new S.EventEmitter,$._onRender=new S.EventEmitter,$._onRefreshRequest=new S.EventEmitter,$.register({dispose:function(){return $._renderer.dispose()}}),$._renderDebouncer=new A.RenderDebouncer(function(se,ce){return $._renderRows(se,ce)}),$.register($._renderDebouncer),$._screenDprMonitor=new g.ScreenDprMonitor,$._screenDprMonitor.setListener(function(){return $.onDevicePixelRatioChange()}),$.register($._screenDprMonitor),$.register(ee.onResize(function(se){return $._fullRefresh()})),$.register(j.onOptionChange(function(){return $._renderer.onOptionsChanged()})),$.register($._charSizeService.onCharSizeChange(function(){return $.onCharSizeChanged()})),$._renderer.onRequestRedraw(function(se){return $.refreshRows(se.start,se.end,!0)}),$.register((0,T.addDisposableDomListener)(window,"resize",function(){return $.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var ae=new IntersectionObserver(function(se){return $._onIntersectionChange(se[se.length-1])},{threshold:0});ae.observe(K),$.register({dispose:function(){return ae.disconnect()}})}return $}return _(O,x),Object.defineProperty(O.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),O.prototype._onIntersectionChange=function(F){this._isPaused=void 0===F.isIntersecting?0===F.intersectionRatio:!F.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},O.prototype.refreshRows=function(F,z,K){void 0===K&&(K=!1),this._isPaused?this._needsFullRefresh=!0:(K||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(F,z,this._rowCount))},O.prototype._renderRows=function(F,z){this._renderer.renderRows(F,z),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:F,end:z}),this._isNextRenderRedrawOnly=!0},O.prototype.resize=function(F,z){this._rowCount=z,this._fireOnCanvasResize()},O.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},O.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},O.prototype.dispose=function(){x.prototype.dispose.call(this)},O.prototype.setRenderer=function(F){var z=this;this._renderer.dispose(),this._renderer=F,this._renderer.onRequestRedraw(function(K){return z.refreshRows(K.start,K.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},O.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},O.prototype.clearTextureAtlas=function(){var F,z;null===(z=null===(F=this._renderer)||void 0===F?void 0:F.clearTextureAtlas)||void 0===z||z.call(F),this._fullRefresh()},O.prototype.setColors=function(F){this._renderer.setColors(F),this._fullRefresh()},O.prototype.onDevicePixelRatioChange=function(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},O.prototype.onResize=function(F,z){this._renderer.onResize(F,z),this._fullRefresh()},O.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},O.prototype.onBlur=function(){this._renderer.onBlur()},O.prototype.onFocus=function(){this._renderer.onFocus()},O.prototype.onSelectionChanged=function(F,z,K){this._selectionState.start=F,this._selectionState.end=z,this._selectionState.columnSelectMode=K,this._renderer.onSelectionChanged(F,z,K)},O.prototype.onCursorMove=function(){this._renderer.onCursorMove()},O.prototype.clear=function(){this._renderer.clear()},I([D(3,R.IOptionsService),D(4,k.ICharSizeService),D(5,R.IBufferService)],O)}(v.Disposable);w.RenderService=E},9312:function(Z,w,N){var b,_=this&&this.__extends||(b=function(J,ee){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,ae){$.__proto__=ae}||function($,ae){for(var se in ae)Object.prototype.hasOwnProperty.call(ae,se)&&($[se]=ae[se])})(J,ee)},function(j,J){if("function"!=typeof J&&null!==J)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");function ee(){this.constructor=j}b(j,J),j.prototype=null===J?Object.create(J):(ee.prototype=J.prototype,new ee)}),I=this&&this.__decorate||function(j,J,ee,$){var ae,se=arguments.length,ce=se<3?J:null===$?$=Object.getOwnPropertyDescriptor(J,ee):$;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)ce=Reflect.decorate(j,J,ee,$);else for(var le=j.length-1;le>=0;le--)(ae=j[le])&&(ce=(se<3?ae(ce):se>3?ae(J,ee,ce):ae(J,ee))||ce);return se>3&&ce&&Object.defineProperty(J,ee,ce),ce},D=this&&this.__param||function(j,J){return function(ee,$){J(ee,$,j)}};Object.defineProperty(w,"__esModule",{value:!0}),w.SelectionService=void 0;var A=N(6114),S=N(456),v=N(511),g=N(8460),T=N(4725),R=N(2585),k=N(9806),E=N(9504),x=N(844),O=N(4841),F=String.fromCharCode(160),z=new RegExp(F,"g"),K=function(j){function J(ee,$,ae,se,ce,le,oe,Ae){var be=j.call(this)||this;return be._element=ee,be._screenElement=$,be._linkifier=ae,be._bufferService=se,be._coreService=ce,be._mouseService=le,be._optionsService=oe,be._renderService=Ae,be._dragScrollAmount=0,be._enabled=!0,be._workCell=new v.CellData,be._mouseDownTimeStamp=0,be._oldHasSelection=!1,be._oldSelectionStart=void 0,be._oldSelectionEnd=void 0,be._onLinuxMouseSelection=be.register(new g.EventEmitter),be._onRedrawRequest=be.register(new g.EventEmitter),be._onSelectionChange=be.register(new g.EventEmitter),be._onRequestScrollLines=be.register(new g.EventEmitter),be._mouseMoveListener=function(it){return be._onMouseMove(it)},be._mouseUpListener=function(it){return be._onMouseUp(it)},be._coreService.onUserInput(function(){be.hasSelection&&be.clearSelection()}),be._trimListener=be._bufferService.buffer.lines.onTrim(function(it){return be._onTrim(it)}),be.register(be._bufferService.buffers.onBufferActivate(function(it){return be._onBufferActivate(it)})),be.enable(),be._model=new S.SelectionModel(be._bufferService),be._activeSelectionMode=0,be}return _(J,j),Object.defineProperty(J.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),J.prototype.dispose=function(){this._removeMouseDownListeners()},J.prototype.reset=function(){this.clearSelection()},J.prototype.disable=function(){this.clearSelection(),this._enabled=!1},J.prototype.enable=function(){this._enabled=!0},Object.defineProperty(J.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"hasSelection",{get:function(){var $=this._model.finalSelectionStart,ae=this._model.finalSelectionEnd;return!(!$||!ae||$[0]===ae[0]&&$[1]===ae[1])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"selectionText",{get:function(){var $=this._model.finalSelectionStart,ae=this._model.finalSelectionEnd;if(!$||!ae)return"";var se=this._bufferService.buffer,ce=[];if(3===this._activeSelectionMode){if($[0]===ae[0])return"";for(var le=$[1];le<=ae[1];le++){var oe=se.translateBufferLineToString(le,!0,$[0],ae[0]);ce.push(oe)}}else{for(ce.push(se.translateBufferLineToString($[1],!0,$[0],$[1]===ae[1]?ae[0]:void 0)),le=$[1]+1;le<=ae[1]-1;le++){var be=se.lines.get(le);oe=se.translateBufferLineToString(le,!0),be&&be.isWrapped?ce[ce.length-1]+=oe:ce.push(oe)}$[1]!==ae[1]&&(be=se.lines.get(ae[1]),oe=se.translateBufferLineToString(ae[1],!0,0,ae[0]),be&&be.isWrapped?ce[ce.length-1]+=oe:ce.push(oe))}return ce.map(function(it){return it.replace(z," ")}).join(A.isWindows?"\r\n":"\n")},enumerable:!1,configurable:!0}),J.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},J.prototype.refresh=function(ee){var $=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return $._refresh()})),A.isLinux&&ee&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},J.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},J.prototype._isClickInSelection=function(ee){var $=this._getMouseBufferCoords(ee),ae=this._model.finalSelectionStart,se=this._model.finalSelectionEnd;return!!(ae&&se&&$)&&this._areCoordsInSelection($,ae,se)},J.prototype._areCoordsInSelection=function(ee,$,ae){return ee[1]>$[1]&&ee[1]=$[0]&&ee[0]=$[0]},J.prototype._selectWordAtCursor=function(ee,$){var ae,se,ce=null===(se=null===(ae=this._linkifier.currentLink)||void 0===ae?void 0:ae.link)||void 0===se?void 0:se.range;if(ce)return this._model.selectionStart=[ce.start.x-1,ce.start.y-1],this._model.selectionStartLength=(0,O.getRangeLength)(ce,this._bufferService.cols),this._model.selectionEnd=void 0,!0;var le=this._getMouseBufferCoords(ee);return!!le&&(this._selectWordAt(le,$),this._model.selectionEnd=void 0,!0)},J.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},J.prototype.selectLines=function(ee,$){this._model.clearSelection(),ee=Math.max(ee,0),$=Math.min($,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,ee],this._model.selectionEnd=[this._bufferService.cols,$],this.refresh(),this._onSelectionChange.fire()},J.prototype._onTrim=function(ee){this._model.onTrim(ee)&&this.refresh()},J.prototype._getMouseBufferCoords=function(ee){var $=this._mouseService.getCoords(ee,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if($)return $[0]--,$[1]--,$[1]+=this._bufferService.buffer.ydisp,$},J.prototype._getMouseEventScrollAmount=function(ee){var $=(0,k.getCoordsRelativeToElement)(ee,this._screenElement)[1],ae=this._renderService.dimensions.canvasHeight;return $>=0&&$<=ae?0:($>ae&&($-=ae),$=Math.min(Math.max($,-50),50),($/=50)/Math.abs($)+Math.round(14*$))},J.prototype.shouldForceSelection=function(ee){return A.isMac?ee.altKey&&this._optionsService.options.macOptionClickForcesSelection:ee.shiftKey},J.prototype.onMouseDown=function(ee){if(this._mouseDownTimeStamp=ee.timeStamp,(2!==ee.button||!this.hasSelection)&&0===ee.button){if(!this._enabled){if(!this.shouldForceSelection(ee))return;ee.stopPropagation()}ee.preventDefault(),this._dragScrollAmount=0,this._enabled&&ee.shiftKey?this._onIncrementalClick(ee):1===ee.detail?this._onSingleClick(ee):2===ee.detail?this._onDoubleClick(ee):3===ee.detail&&this._onTripleClick(ee),this._addMouseDownListeners(),this.refresh(!0)}},J.prototype._addMouseDownListeners=function(){var ee=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return ee._dragScroll()},50)},J.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},J.prototype._onIncrementalClick=function(ee){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(ee))},J.prototype._onSingleClick=function(ee){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(ee)?3:0,this._model.selectionStart=this._getMouseBufferCoords(ee),this._model.selectionStart){this._model.selectionEnd=void 0;var $=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);$&&$.length!==this._model.selectionStart[0]&&0===$.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}},J.prototype._onDoubleClick=function(ee){this._selectWordAtCursor(ee,!0)&&(this._activeSelectionMode=1)},J.prototype._onTripleClick=function(ee){var $=this._getMouseBufferCoords(ee);$&&(this._activeSelectionMode=2,this._selectLineAt($[1]))},J.prototype.shouldColumnSelect=function(ee){return ee.altKey&&!(A.isMac&&this._optionsService.options.macOptionClickForcesSelection)},J.prototype._onMouseMove=function(ee){if(ee.stopImmediatePropagation(),this._model.selectionStart){var $=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(ee),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[0]=this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var ae=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(ee.ydisp+this._bufferService.rows,ee.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=ee.ydisp),this.refresh()}},J.prototype._onMouseUp=function(ee){var $=ee.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&$<500&&ee.altKey&&this._optionsService.getOption("altClickMovesCursor")){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var ae=this._mouseService.getCoords(ee,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(ae&&void 0!==ae[0]&&void 0!==ae[1]){var se=(0,E.moveToCellSequence)(ae[0]-1,ae[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(se,!0)}}}else this._fireEventIfSelectionChanged()},J.prototype._fireEventIfSelectionChanged=function(){var ee=this._model.finalSelectionStart,$=this._model.finalSelectionEnd,ae=!(!ee||!$||ee[0]===$[0]&&ee[1]===$[1]);ae?ee&&$&&(this._oldSelectionStart&&this._oldSelectionEnd&&ee[0]===this._oldSelectionStart[0]&&ee[1]===this._oldSelectionStart[1]&&$[0]===this._oldSelectionEnd[0]&&$[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(ee,$,ae)):this._oldHasSelection&&this._fireOnSelectionChange(ee,$,ae)},J.prototype._fireOnSelectionChange=function(ee,$,ae){this._oldSelectionStart=ee,this._oldSelectionEnd=$,this._oldHasSelection=ae,this._onSelectionChange.fire()},J.prototype._onBufferActivate=function(ee){var $=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=ee.activeBuffer.lines.onTrim(function(ae){return $._onTrim(ae)})},J.prototype._convertViewportColToCharacterIndex=function(ee,$){for(var ae=$[0],se=0;$[0]>=se;se++){var ce=ee.loadCell(se,this._workCell).getChars().length;0===this._workCell.getWidth()?ae--:ce>1&&$[0]!==se&&(ae+=ce-1)}return ae},J.prototype.setSelection=function(ee,$,ae){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[ee,$],this._model.selectionStartLength=ae,this.refresh()},J.prototype.rightClickSelect=function(ee){this._isClickInSelection(ee)||(this._selectWordAtCursor(ee,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())},J.prototype._getWordAt=function(ee,$,ae,se){if(void 0===ae&&(ae=!0),void 0===se&&(se=!0),!(ee[0]>=this._bufferService.cols)){var ce=this._bufferService.buffer,le=ce.lines.get(ee[1]);if(le){var oe=ce.translateBufferLineToString(ee[1],!1),Ae=this._convertViewportColToCharacterIndex(le,ee),be=Ae,it=ee[0]-Ae,qe=0,_t=0,yt=0,Ft=0;if(" "===oe.charAt(Ae)){for(;Ae>0&&" "===oe.charAt(Ae-1);)Ae--;for(;be1&&(Ft+=je-1,be+=je-1);xe>0&&Ae>0&&!this._isCharWordSeparator(le.loadCell(xe-1,this._workCell));){le.loadCell(xe-1,this._workCell);var dt=this._workCell.getChars().length;0===this._workCell.getWidth()?(qe++,xe--):dt>1&&(yt+=dt-1,Ae-=dt-1),Ae--,xe--}for(;De1&&(Ft+=Ke-1,be+=Ke-1),be++,De++}}be++;var Bt=Ae+it-qe+yt,xt=Math.min(this._bufferService.cols,be-Ae+qe+_t-yt-Ft);if($||""!==oe.slice(Ae,be).trim()){if(ae&&0===Bt&&32!==le.getCodePoint(0)){var vt=ce.lines.get(ee[1]-1);if(vt&&le.isWrapped&&32!==vt.getCodePoint(this._bufferService.cols-1)){var Qt=this._getWordAt([this._bufferService.cols-1,ee[1]-1],!1,!0,!1);if(Qt){var Ht=this._bufferService.cols-Qt.start;Bt-=Ht,xt+=Ht}}}if(se&&Bt+xt===this._bufferService.cols&&32!==le.getCodePoint(this._bufferService.cols-1)){var Ct=ce.lines.get(ee[1]+1);if(Ct&&Ct.isWrapped&&32!==Ct.getCodePoint(0)){var qt=this._getWordAt([0,ee[1]+1],!1,!1,!0);qt&&(xt+=qt.length)}}return{start:Bt,length:xt}}}}},J.prototype._selectWordAt=function(ee,$){var ae=this._getWordAt(ee,$);if(ae){for(;ae.start<0;)ae.start+=this._bufferService.cols,ee[1]--;this._model.selectionStart=[ae.start,ee[1]],this._model.selectionStartLength=ae.length}},J.prototype._selectToWordAt=function(ee){var $=this._getWordAt(ee,!0);if($){for(var ae=ee[1];$.start<0;)$.start+=this._bufferService.cols,ae--;if(!this._model.areSelectionValuesReversed())for(;$.start+$.length>this._bufferService.cols;)$.length-=this._bufferService.cols,ae++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?$.start:$.start+$.length,ae]}},J.prototype._isCharWordSeparator=function(ee){return 0!==ee.getWidth()&&this._optionsService.options.wordSeparator.indexOf(ee.getChars())>=0},J.prototype._selectLineAt=function(ee){var $=this._bufferService.buffer.getWrappedRangeForLine(ee);this._model.selectionStart=[0,$.first],this._model.selectionEnd=[this._bufferService.cols,$.last],this._model.selectionStartLength=0},I([D(3,R.IBufferService),D(4,R.ICoreService),D(5,T.IMouseService),D(6,R.IOptionsService),D(7,T.IRenderService)],J)}(x.Disposable);w.SelectionService=K},4725:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.ICharacterJoinerService=w.ISoundService=w.ISelectionService=w.IRenderService=w.IMouseService=w.ICoreBrowserService=w.ICharSizeService=void 0;var b=N(8343);w.ICharSizeService=(0,b.createDecorator)("CharSizeService"),w.ICoreBrowserService=(0,b.createDecorator)("CoreBrowserService"),w.IMouseService=(0,b.createDecorator)("MouseService"),w.IRenderService=(0,b.createDecorator)("RenderService"),w.ISelectionService=(0,b.createDecorator)("SelectionService"),w.ISoundService=(0,b.createDecorator)("SoundService"),w.ICharacterJoinerService=(0,b.createDecorator)("CharacterJoinerService")},357:function(Z,w,N){var b=this&&this.__decorate||function(A,S,v,g){var T,R=arguments.length,k=R<3?S:null===g?g=Object.getOwnPropertyDescriptor(S,v):g;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)k=Reflect.decorate(A,S,v,g);else for(var E=A.length-1;E>=0;E--)(T=A[E])&&(k=(R<3?T(k):R>3?T(S,v,k):T(S,v))||k);return R>3&&k&&Object.defineProperty(S,v,k),k},_=this&&this.__param||function(A,S){return function(v,g){S(v,g,A)}};Object.defineProperty(w,"__esModule",{value:!0}),w.SoundService=void 0;var I=N(2585),D=function(){function A(S){this._optionsService=S}return Object.defineProperty(A,"audioContext",{get:function(){if(!A._audioContext){var v=window.AudioContext||window.webkitAudioContext;if(!v)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;A._audioContext=new v}return A._audioContext},enumerable:!1,configurable:!0}),A.prototype.playBellSound=function(){var S=A.audioContext;if(S){var v=S.createBufferSource();S.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(g){v.buffer=g,v.connect(S.destination),v.start(0)})}},A.prototype._base64ToArrayBuffer=function(S){for(var v=window.atob(S),g=v.length,T=new Uint8Array(g),R=0;Rthis._length)for(var S=this._length;S=D;g--)this._array[this._getCyclicIndex(g+S.length)]=this._array[this._getCyclicIndex(g)];for(g=0;gthis._maxLength){var T=this._length+S.length-this._maxLength;this._startIndex+=T,this._length=this._maxLength,this.onTrimEmitter.fire(T)}else this._length+=S.length},I.prototype.trimStart=function(D){D>this._length&&(D=this._length),this._startIndex+=D,this._length-=D,this.onTrimEmitter.fire(D)},I.prototype.shiftElements=function(D,A,S){if(!(A<=0)){if(D<0||D>=this._length)throw new Error("start argument out of range");if(D+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(var v=A-1;v>=0;v--)this.set(D+v+S,this.get(D+v));var g=D+A+S-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(v=0;v24)return ce.setWinLines||!1;switch(se){case 1:return!!ce.restoreWin;case 2:return!!ce.minimizeWin;case 3:return!!ce.setWinPosition;case 4:return!!ce.setWinSizePixels;case 5:return!!ce.raiseWin;case 6:return!!ce.lowerWin;case 7:return!!ce.refreshWin;case 8:return!!ce.setWinSizeChars;case 9:return!!ce.maximizeWin;case 10:return!!ce.fullscreenWin;case 11:return!!ce.getWinState;case 13:return!!ce.getWinPosition;case 14:return!!ce.getWinSizePixels;case 15:return!!ce.getScreenSizePixels;case 16:return!!ce.getCellSizePixels;case 18:return!!ce.getWinSizeChars;case 19:return!!ce.getScreenSizeChars;case 20:return!!ce.getIconTitle;case 21:return!!ce.getWinTitle;case 22:return!!ce.pushTitle;case 23:return!!ce.popTitle;case 24:return!!ce.setWinLines}return!1}(se=I=w.WindowsOptionsReportType||(w.WindowsOptionsReportType={}))[se.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",se[se.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS";var $=function(){function se(ce,le,oe,Ae){this._bufferService=ce,this._coreService=le,this._logService=oe,this._optionsService=Ae,this._data=new Uint32Array(0)}return se.prototype.hook=function(ce){this._data=new Uint32Array(0)},se.prototype.put=function(ce,le,oe){this._data=(0,g.concat)(this._data,ce.subarray(le,oe))},se.prototype.unhook=function(ce){if(!ce)return this._data=new Uint32Array(0),!0;var le=(0,T.utf32ToString)(this._data);switch(this._data=new Uint32Array(0),le){case'"q':this._coreService.triggerDataEvent(D.C0.ESC+'P1$r0"q'+D.C0.ESC+"\\");break;case'"p':this._coreService.triggerDataEvent(D.C0.ESC+'P1$r61;1"p'+D.C0.ESC+"\\");break;case"r":this._coreService.triggerDataEvent(D.C0.ESC+"P1$r"+(this._bufferService.buffer.scrollTop+1)+";"+(this._bufferService.buffer.scrollBottom+1)+"r"+D.C0.ESC+"\\");break;case"m":this._coreService.triggerDataEvent(D.C0.ESC+"P1$r0m"+D.C0.ESC+"\\");break;case" q":var Ae={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];this._coreService.triggerDataEvent(D.C0.ESC+"P1$r"+(Ae-=this._optionsService.options.cursorBlink?1:0)+" q"+D.C0.ESC+"\\");break;default:this._logService.debug("Unknown DCS $q %s",le),this._coreService.triggerDataEvent(D.C0.ESC+"P0$r"+D.C0.ESC+"\\")}return!0},se}(),ae=function(se){function ce(le,oe,Ae,be,it,qe,_t,yt,Ft){void 0===Ft&&(Ft=new S.EscapeSequenceParser);var xe=se.call(this)||this;xe._bufferService=le,xe._charsetService=oe,xe._coreService=Ae,xe._dirtyRowService=be,xe._logService=it,xe._optionsService=qe,xe._coreMouseService=_t,xe._unicodeService=yt,xe._parser=Ft,xe._parseBuffer=new Uint32Array(4096),xe._stringDecoder=new T.StringToUtf32,xe._utf8Decoder=new T.Utf8ToUtf32,xe._workCell=new x.CellData,xe._windowTitle="",xe._iconName="",xe._windowTitleStack=[],xe._iconNameStack=[],xe._curAttrData=R.DEFAULT_ATTR_DATA.clone(),xe._eraseAttrDataInternal=R.DEFAULT_ATTR_DATA.clone(),xe._onRequestBell=new k.EventEmitter,xe._onRequestRefreshRows=new k.EventEmitter,xe._onRequestReset=new k.EventEmitter,xe._onRequestSendFocus=new k.EventEmitter,xe._onRequestSyncScrollBar=new k.EventEmitter,xe._onRequestWindowsOptionsReport=new k.EventEmitter,xe._onA11yChar=new k.EventEmitter,xe._onA11yTab=new k.EventEmitter,xe._onCursorMove=new k.EventEmitter,xe._onLineFeed=new k.EventEmitter,xe._onScroll=new k.EventEmitter,xe._onTitleChange=new k.EventEmitter,xe._onAnsiColorChange=new k.EventEmitter,xe._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},xe.register(xe._parser),xe._activeBuffer=xe._bufferService.buffer,xe.register(xe._bufferService.buffers.onBufferActivate(function(Ke){return xe._activeBuffer=Ke.activeBuffer})),xe._parser.setCsiHandlerFallback(function(Ke,Bt){xe._logService.debug("Unknown CSI code: ",{identifier:xe._parser.identToString(Ke),params:Bt.toArray()})}),xe._parser.setEscHandlerFallback(function(Ke){xe._logService.debug("Unknown ESC code: ",{identifier:xe._parser.identToString(Ke)})}),xe._parser.setExecuteHandlerFallback(function(Ke){xe._logService.debug("Unknown EXECUTE code: ",{code:Ke})}),xe._parser.setOscHandlerFallback(function(Ke,Bt,xt){xe._logService.debug("Unknown OSC code: ",{identifier:Ke,action:Bt,data:xt})}),xe._parser.setDcsHandlerFallback(function(Ke,Bt,xt){"HOOK"===Bt&&(xt=xt.toArray()),xe._logService.debug("Unknown DCS code: ",{identifier:xe._parser.identToString(Ke),action:Bt,payload:xt})}),xe._parser.setPrintHandler(function(Ke,Bt,xt){return xe.print(Ke,Bt,xt)}),xe._parser.registerCsiHandler({final:"@"},function(Ke){return xe.insertChars(Ke)}),xe._parser.registerCsiHandler({intermediates:" ",final:"@"},function(Ke){return xe.scrollLeft(Ke)}),xe._parser.registerCsiHandler({final:"A"},function(Ke){return xe.cursorUp(Ke)}),xe._parser.registerCsiHandler({intermediates:" ",final:"A"},function(Ke){return xe.scrollRight(Ke)}),xe._parser.registerCsiHandler({final:"B"},function(Ke){return xe.cursorDown(Ke)}),xe._parser.registerCsiHandler({final:"C"},function(Ke){return xe.cursorForward(Ke)}),xe._parser.registerCsiHandler({final:"D"},function(Ke){return xe.cursorBackward(Ke)}),xe._parser.registerCsiHandler({final:"E"},function(Ke){return xe.cursorNextLine(Ke)}),xe._parser.registerCsiHandler({final:"F"},function(Ke){return xe.cursorPrecedingLine(Ke)}),xe._parser.registerCsiHandler({final:"G"},function(Ke){return xe.cursorCharAbsolute(Ke)}),xe._parser.registerCsiHandler({final:"H"},function(Ke){return xe.cursorPosition(Ke)}),xe._parser.registerCsiHandler({final:"I"},function(Ke){return xe.cursorForwardTab(Ke)}),xe._parser.registerCsiHandler({final:"J"},function(Ke){return xe.eraseInDisplay(Ke)}),xe._parser.registerCsiHandler({prefix:"?",final:"J"},function(Ke){return xe.eraseInDisplay(Ke)}),xe._parser.registerCsiHandler({final:"K"},function(Ke){return xe.eraseInLine(Ke)}),xe._parser.registerCsiHandler({prefix:"?",final:"K"},function(Ke){return xe.eraseInLine(Ke)}),xe._parser.registerCsiHandler({final:"L"},function(Ke){return xe.insertLines(Ke)}),xe._parser.registerCsiHandler({final:"M"},function(Ke){return xe.deleteLines(Ke)}),xe._parser.registerCsiHandler({final:"P"},function(Ke){return xe.deleteChars(Ke)}),xe._parser.registerCsiHandler({final:"S"},function(Ke){return xe.scrollUp(Ke)}),xe._parser.registerCsiHandler({final:"T"},function(Ke){return xe.scrollDown(Ke)}),xe._parser.registerCsiHandler({final:"X"},function(Ke){return xe.eraseChars(Ke)}),xe._parser.registerCsiHandler({final:"Z"},function(Ke){return xe.cursorBackwardTab(Ke)}),xe._parser.registerCsiHandler({final:"`"},function(Ke){return xe.charPosAbsolute(Ke)}),xe._parser.registerCsiHandler({final:"a"},function(Ke){return xe.hPositionRelative(Ke)}),xe._parser.registerCsiHandler({final:"b"},function(Ke){return xe.repeatPrecedingCharacter(Ke)}),xe._parser.registerCsiHandler({final:"c"},function(Ke){return xe.sendDeviceAttributesPrimary(Ke)}),xe._parser.registerCsiHandler({prefix:">",final:"c"},function(Ke){return xe.sendDeviceAttributesSecondary(Ke)}),xe._parser.registerCsiHandler({final:"d"},function(Ke){return xe.linePosAbsolute(Ke)}),xe._parser.registerCsiHandler({final:"e"},function(Ke){return xe.vPositionRelative(Ke)}),xe._parser.registerCsiHandler({final:"f"},function(Ke){return xe.hVPosition(Ke)}),xe._parser.registerCsiHandler({final:"g"},function(Ke){return xe.tabClear(Ke)}),xe._parser.registerCsiHandler({final:"h"},function(Ke){return xe.setMode(Ke)}),xe._parser.registerCsiHandler({prefix:"?",final:"h"},function(Ke){return xe.setModePrivate(Ke)}),xe._parser.registerCsiHandler({final:"l"},function(Ke){return xe.resetMode(Ke)}),xe._parser.registerCsiHandler({prefix:"?",final:"l"},function(Ke){return xe.resetModePrivate(Ke)}),xe._parser.registerCsiHandler({final:"m"},function(Ke){return xe.charAttributes(Ke)}),xe._parser.registerCsiHandler({final:"n"},function(Ke){return xe.deviceStatus(Ke)}),xe._parser.registerCsiHandler({prefix:"?",final:"n"},function(Ke){return xe.deviceStatusPrivate(Ke)}),xe._parser.registerCsiHandler({intermediates:"!",final:"p"},function(Ke){return xe.softReset(Ke)}),xe._parser.registerCsiHandler({intermediates:" ",final:"q"},function(Ke){return xe.setCursorStyle(Ke)}),xe._parser.registerCsiHandler({final:"r"},function(Ke){return xe.setScrollRegion(Ke)}),xe._parser.registerCsiHandler({final:"s"},function(Ke){return xe.saveCursor(Ke)}),xe._parser.registerCsiHandler({final:"t"},function(Ke){return xe.windowOptions(Ke)}),xe._parser.registerCsiHandler({final:"u"},function(Ke){return xe.restoreCursor(Ke)}),xe._parser.registerCsiHandler({intermediates:"'",final:"}"},function(Ke){return xe.insertColumns(Ke)}),xe._parser.registerCsiHandler({intermediates:"'",final:"~"},function(Ke){return xe.deleteColumns(Ke)}),xe._parser.setExecuteHandler(D.C0.BEL,function(){return xe.bell()}),xe._parser.setExecuteHandler(D.C0.LF,function(){return xe.lineFeed()}),xe._parser.setExecuteHandler(D.C0.VT,function(){return xe.lineFeed()}),xe._parser.setExecuteHandler(D.C0.FF,function(){return xe.lineFeed()}),xe._parser.setExecuteHandler(D.C0.CR,function(){return xe.carriageReturn()}),xe._parser.setExecuteHandler(D.C0.BS,function(){return xe.backspace()}),xe._parser.setExecuteHandler(D.C0.HT,function(){return xe.tab()}),xe._parser.setExecuteHandler(D.C0.SO,function(){return xe.shiftOut()}),xe._parser.setExecuteHandler(D.C0.SI,function(){return xe.shiftIn()}),xe._parser.setExecuteHandler(D.C1.IND,function(){return xe.index()}),xe._parser.setExecuteHandler(D.C1.NEL,function(){return xe.nextLine()}),xe._parser.setExecuteHandler(D.C1.HTS,function(){return xe.tabSet()}),xe._parser.registerOscHandler(0,new z.OscHandler(function(Ke){return xe.setTitle(Ke),xe.setIconName(Ke),!0})),xe._parser.registerOscHandler(1,new z.OscHandler(function(Ke){return xe.setIconName(Ke)})),xe._parser.registerOscHandler(2,new z.OscHandler(function(Ke){return xe.setTitle(Ke)})),xe._parser.registerOscHandler(4,new z.OscHandler(function(Ke){return xe.setAnsiColor(Ke)})),xe._parser.registerEscHandler({final:"7"},function(){return xe.saveCursor()}),xe._parser.registerEscHandler({final:"8"},function(){return xe.restoreCursor()}),xe._parser.registerEscHandler({final:"D"},function(){return xe.index()}),xe._parser.registerEscHandler({final:"E"},function(){return xe.nextLine()}),xe._parser.registerEscHandler({final:"H"},function(){return xe.tabSet()}),xe._parser.registerEscHandler({final:"M"},function(){return xe.reverseIndex()}),xe._parser.registerEscHandler({final:"="},function(){return xe.keypadApplicationMode()}),xe._parser.registerEscHandler({final:">"},function(){return xe.keypadNumericMode()}),xe._parser.registerEscHandler({final:"c"},function(){return xe.fullReset()}),xe._parser.registerEscHandler({final:"n"},function(){return xe.setgLevel(2)}),xe._parser.registerEscHandler({final:"o"},function(){return xe.setgLevel(3)}),xe._parser.registerEscHandler({final:"|"},function(){return xe.setgLevel(3)}),xe._parser.registerEscHandler({final:"}"},function(){return xe.setgLevel(2)}),xe._parser.registerEscHandler({final:"~"},function(){return xe.setgLevel(1)}),xe._parser.registerEscHandler({intermediates:"%",final:"@"},function(){return xe.selectDefaultCharset()}),xe._parser.registerEscHandler({intermediates:"%",final:"G"},function(){return xe.selectDefaultCharset()});var De=function(Bt){je._parser.registerEscHandler({intermediates:"(",final:Bt},function(){return xe.selectCharset("("+Bt)}),je._parser.registerEscHandler({intermediates:")",final:Bt},function(){return xe.selectCharset(")"+Bt)}),je._parser.registerEscHandler({intermediates:"*",final:Bt},function(){return xe.selectCharset("*"+Bt)}),je._parser.registerEscHandler({intermediates:"+",final:Bt},function(){return xe.selectCharset("+"+Bt)}),je._parser.registerEscHandler({intermediates:"-",final:Bt},function(){return xe.selectCharset("-"+Bt)}),je._parser.registerEscHandler({intermediates:".",final:Bt},function(){return xe.selectCharset("."+Bt)}),je._parser.registerEscHandler({intermediates:"/",final:Bt},function(){return xe.selectCharset("/"+Bt)})},je=this;for(var dt in A.CHARSETS)De(dt);return xe._parser.registerEscHandler({intermediates:"#",final:"8"},function(){return xe.screenAlignmentPattern()}),xe._parser.setErrorHandler(function(Ke){return xe._logService.error("Parsing error: ",Ke),Ke}),xe._parser.registerDcsHandler({intermediates:"$",final:"q"},new $(xe._bufferService,xe._coreService,xe._logService,xe._optionsService)),xe}return _(ce,se),Object.defineProperty(ce.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onRequestSendFocus",{get:function(){return this._onRequestSendFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"onAnsiColorChange",{get:function(){return this._onAnsiColorChange.event},enumerable:!1,configurable:!0}),ce.prototype.dispose=function(){se.prototype.dispose.call(this)},ce.prototype._preserveStack=function(le,oe,Ae,be){this._parseStack.paused=!0,this._parseStack.cursorStartX=le,this._parseStack.cursorStartY=oe,this._parseStack.decodedLength=Ae,this._parseStack.position=be},ce.prototype._logSlowResolvingAsync=function(le){this._logService.logLevel<=F.LogLevelEnum.WARN&&Promise.race([le,new Promise(function(oe,Ae){return setTimeout(function(){return Ae("#SLOW_TIMEOUT")},5e3)})]).catch(function(oe){if("#SLOW_TIMEOUT"!==oe)throw oe;console.warn("async parser handler taking longer than 5000 ms")})},ce.prototype.parse=function(le,oe){var Ae,be=this._activeBuffer.x,it=this._activeBuffer.y,qe=0,_t=this._parseStack.paused;if(_t){if(Ae=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,oe))return this._logSlowResolvingAsync(Ae),Ae;be=this._parseStack.cursorStartX,it=this._parseStack.cursorStartY,this._parseStack.paused=!1,le.length>J&&(qe=this._parseStack.position+J)}if(this._logService.debug("parsing data",le),this._parseBuffer.lengthJ)for(var yt=qe;yt0&&2===je.getWidth(this._activeBuffer.x-1)&&je.setCellFromCodePoint(this._activeBuffer.x-1,0,1,De.fg,De.bg,De.extended);for(var dt=oe;dt=yt)if(Ft){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),je=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=yt-1,2===it)continue;if(xe&&(je.insertCells(this._activeBuffer.x,it,this._activeBuffer.getNullCell(De),De),2===je.getWidth(yt-1)&&je.setCellFromCodePoint(yt-1,E.NULL_CELL_CODE,E.NULL_CELL_WIDTH,De.fg,De.bg,De.extended)),je.setCellFromCodePoint(this._activeBuffer.x++,be,it,De.fg,De.bg,De.extended),it>0)for(;--it;)je.setCellFromCodePoint(this._activeBuffer.x++,0,0,De.fg,De.bg,De.extended)}else je.getWidth(this._activeBuffer.x-1)?je.addCodepointToCell(this._activeBuffer.x-1,be):je.addCodepointToCell(this._activeBuffer.x-2,be)}Ae-oe>0&&(je.loadCell(this._activeBuffer.x-1,this._workCell),this._parser.precedingCodepoint=2===this._workCell.getWidth()||this._workCell.getCode()>65535?0:this._workCell.isCombined()?this._workCell.getChars().charCodeAt(0):this._workCell.content),this._activeBuffer.x0&&0===je.getWidth(this._activeBuffer.x)&&!je.hasContent(this._activeBuffer.x)&&je.setCellFromCodePoint(this._activeBuffer.x,0,1,De.fg,De.bg,De.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)},ce.prototype.registerCsiHandler=function(le,oe){var Ae=this;return this._parser.registerCsiHandler(le,"t"!==le.final||le.prefix||le.intermediates?oe:function(be){return!ee(be.params[0],Ae._optionsService.options.windowOptions)||oe(be)})},ce.prototype.registerDcsHandler=function(le,oe){return this._parser.registerDcsHandler(le,new K.DcsHandler(oe))},ce.prototype.registerEscHandler=function(le,oe){return this._parser.registerEscHandler(le,oe)},ce.prototype.registerOscHandler=function(le,oe){return this._parser.registerOscHandler(le,new z.OscHandler(oe))},ce.prototype.bell=function(){return this._onRequestBell.fire(),!0},ce.prototype.lineFeed=function(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.options.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0},ce.prototype.carriageReturn=function(){return this._activeBuffer.x=0,!0},ce.prototype.backspace=function(){var le;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(null===(le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))||void 0===le?void 0:le.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;var oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);oe.hasWidth(this._activeBuffer.x)&&!oe.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0},ce.prototype.tab=function(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;var le=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-le),!0},ce.prototype.shiftOut=function(){return this._charsetService.setgLevel(1),!0},ce.prototype.shiftIn=function(){return this._charsetService.setgLevel(0),!0},ce.prototype._restrictCursor=function(le){void 0===le&&(le=this._bufferService.cols-1),this._activeBuffer.x=Math.min(le,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)},ce.prototype._setCursor=function(le,oe){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=le,this._activeBuffer.y=this._activeBuffer.scrollTop+oe):(this._activeBuffer.x=le,this._activeBuffer.y=oe),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)},ce.prototype._moveCursor=function(le,oe){this._restrictCursor(),this._setCursor(this._activeBuffer.x+le,this._activeBuffer.y+oe)},ce.prototype.cursorUp=function(le){var oe=this._activeBuffer.y-this._activeBuffer.scrollTop;return this._moveCursor(0,oe>=0?-Math.min(oe,le.params[0]||1):-(le.params[0]||1)),!0},ce.prototype.cursorDown=function(le){var oe=this._activeBuffer.scrollBottom-this._activeBuffer.y;return this._moveCursor(0,oe>=0?Math.min(oe,le.params[0]||1):le.params[0]||1),!0},ce.prototype.cursorForward=function(le){return this._moveCursor(le.params[0]||1,0),!0},ce.prototype.cursorBackward=function(le){return this._moveCursor(-(le.params[0]||1),0),!0},ce.prototype.cursorNextLine=function(le){return this.cursorDown(le),this._activeBuffer.x=0,!0},ce.prototype.cursorPrecedingLine=function(le){return this.cursorUp(le),this._activeBuffer.x=0,!0},ce.prototype.cursorCharAbsolute=function(le){return this._setCursor((le.params[0]||1)-1,this._activeBuffer.y),!0},ce.prototype.cursorPosition=function(le){return this._setCursor(le.length>=2?(le.params[1]||1)-1:0,(le.params[0]||1)-1),!0},ce.prototype.charPosAbsolute=function(le){return this._setCursor((le.params[0]||1)-1,this._activeBuffer.y),!0},ce.prototype.hPositionRelative=function(le){return this._moveCursor(le.params[0]||1,0),!0},ce.prototype.linePosAbsolute=function(le){return this._setCursor(this._activeBuffer.x,(le.params[0]||1)-1),!0},ce.prototype.vPositionRelative=function(le){return this._moveCursor(0,le.params[0]||1),!0},ce.prototype.hVPosition=function(le){return this.cursorPosition(le),!0},ce.prototype.tabClear=function(le){var oe=le.params[0];return 0===oe?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===oe&&(this._activeBuffer.tabs={}),!0},ce.prototype.cursorForwardTab=function(le){if(this._activeBuffer.x>=this._bufferService.cols)return!0;for(var oe=le.params[0]||1;oe--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0},ce.prototype.cursorBackwardTab=function(le){if(this._activeBuffer.x>=this._bufferService.cols)return!0;for(var oe=le.params[0]||1;oe--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0},ce.prototype._eraseInBufferLine=function(le,oe,Ae,be){void 0===be&&(be=!1);var it=this._activeBuffer.lines.get(this._activeBuffer.ybase+le);it.replaceCells(oe,Ae,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),be&&(it.isWrapped=!1)},ce.prototype._resetBufferLine=function(le){var oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+le);oe.fill(this._activeBuffer.getNullCell(this._eraseAttrData())),oe.isWrapped=!1},ce.prototype.eraseInDisplay=function(le){var oe;switch(this._restrictCursor(this._bufferService.cols),le.params[0]){case 0:for(this._dirtyRowService.markDirty(oe=this._activeBuffer.y),this._eraseInBufferLine(oe++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x);oe=this._bufferService.cols&&(this._activeBuffer.lines.get(oe+1).isWrapped=!1);oe--;)this._resetBufferLine(oe);this._dirtyRowService.markDirty(0);break;case 2:for(this._dirtyRowService.markDirty((oe=this._bufferService.rows)-1);oe--;)this._resetBufferLine(oe);this._dirtyRowService.markDirty(0);break;case 3:var Ae=this._activeBuffer.lines.length-this._bufferService.rows;Ae>0&&(this._activeBuffer.lines.trimStart(Ae),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Ae,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Ae,0),this._onScroll.fire(0))}return!0},ce.prototype.eraseInLine=function(le){switch(this._restrictCursor(this._bufferService.cols),le.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0},ce.prototype.insertLines=function(le){this._restrictCursor();var oe=le.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(D.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(D.C0.ESC+"[?6c")),!0},ce.prototype.sendDeviceAttributesSecondary=function(le){return le.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(D.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(D.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(le.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(D.C0.ESC+"[>83;40003;0c")),!0},ce.prototype._is=function(le){return 0===(this._optionsService.options.termName+"").indexOf(le)},ce.prototype.setMode=function(le){for(var oe=0;oe=2||2===be[1]&&qe+it>=5)break;be[1]&&(it=1)}while(++qe+oe5)&&(le=1),oe.extended.underlineStyle=le,oe.fg|=268435456,0===le&&(oe.fg&=-268435457),oe.updateExtended()},ce.prototype.charAttributes=function(le){if(1===le.length&&0===le.params[0])return this._curAttrData.fg=R.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=R.DEFAULT_ATTR_DATA.bg,!0;for(var oe,Ae=le.length,be=this._curAttrData,it=0;it=30&&oe<=37?(be.fg&=-50331904,be.fg|=16777216|oe-30):oe>=40&&oe<=47?(be.bg&=-50331904,be.bg|=16777216|oe-40):oe>=90&&oe<=97?(be.fg&=-50331904,be.fg|=16777224|oe-90):oe>=100&&oe<=107?(be.bg&=-50331904,be.bg|=16777224|oe-100):0===oe?(be.fg=R.DEFAULT_ATTR_DATA.fg,be.bg=R.DEFAULT_ATTR_DATA.bg):1===oe?be.fg|=134217728:3===oe?be.bg|=67108864:4===oe?(be.fg|=268435456,this._processUnderline(le.hasSubParams(it)?le.getSubParams(it)[0]:1,be)):5===oe?be.fg|=536870912:7===oe?be.fg|=67108864:8===oe?be.fg|=1073741824:9===oe?be.fg|=2147483648:2===oe?be.bg|=134217728:21===oe?this._processUnderline(2,be):22===oe?(be.fg&=-134217729,be.bg&=-134217729):23===oe?be.bg&=-67108865:24===oe?be.fg&=-268435457:25===oe?be.fg&=-536870913:27===oe?be.fg&=-67108865:28===oe?be.fg&=-1073741825:29===oe?be.fg&=2147483647:39===oe?(be.fg&=-67108864,be.fg|=16777215&R.DEFAULT_ATTR_DATA.fg):49===oe?(be.bg&=-67108864,be.bg|=16777215&R.DEFAULT_ATTR_DATA.bg):38===oe||48===oe||58===oe?it+=this._extractColor(le,it,be):59===oe?(be.extended=be.extended.clone(),be.extended.underlineColor=-1,be.updateExtended()):100===oe?(be.fg&=-67108864,be.fg|=16777215&R.DEFAULT_ATTR_DATA.fg,be.bg&=-67108864,be.bg|=16777215&R.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",oe);return!0},ce.prototype.deviceStatus=function(le){switch(le.params[0]){case 5:this._coreService.triggerDataEvent(D.C0.ESC+"[0n");break;case 6:this._coreService.triggerDataEvent(D.C0.ESC+"["+(this._activeBuffer.y+1)+";"+(this._activeBuffer.x+1)+"R")}return!0},ce.prototype.deviceStatusPrivate=function(le){return 6===le.params[0]&&this._coreService.triggerDataEvent(D.C0.ESC+"[?"+(this._activeBuffer.y+1)+";"+(this._activeBuffer.x+1)+"R"),!0},ce.prototype.softReset=function(le){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=R.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0},ce.prototype.setCursorStyle=function(le){var oe=le.params[0]||1;switch(oe){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}return this._optionsService.options.cursorBlink=oe%2==1,!0},ce.prototype.setScrollRegion=function(le){var oe,Ae=le.params[0]||1;return(le.length<2||(oe=le.params[1])>this._bufferService.rows||0===oe)&&(oe=this._bufferService.rows),oe>Ae&&(this._activeBuffer.scrollTop=Ae-1,this._activeBuffer.scrollBottom=oe-1,this._setCursor(0,0)),!0},ce.prototype.windowOptions=function(le){if(!ee(le.params[0],this._optionsService.options.windowOptions))return!0;var oe=le.length>1?le.params[1]:0;switch(le.params[0]){case 14:2!==oe&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(D.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==oe&&2!==oe||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==oe&&1!==oe||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==oe&&2!==oe||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==oe&&1!==oe||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0},ce.prototype.saveCursor=function(le){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0},ce.prototype.restoreCursor=function(le){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0},ce.prototype.setTitle=function(le){return this._windowTitle=le,this._onTitleChange.fire(le),!0},ce.prototype.setIconName=function(le){return this._iconName=le,!0},ce.prototype._parseAnsiColorChange=function(le){for(var oe,Ae={colors:[]},be=/(\d+);rgb:([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})/gi;null!==(oe=be.exec(le));)Ae.colors.push({colorIndex:parseInt(oe[1]),red:parseInt(oe[2],16),green:parseInt(oe[3],16),blue:parseInt(oe[4],16)});return 0===Ae.colors.length?null:Ae},ce.prototype.setAnsiColor=function(le){var oe=this._parseAnsiColorChange(le);return oe?this._onAnsiColorChange.fire(oe):this._logService.warn("Expected format ;rgb:// but got data: "+le),!0},ce.prototype.nextLine=function(){return this._activeBuffer.x=0,this.index(),!0},ce.prototype.keypadApplicationMode=function(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0},ce.prototype.keypadNumericMode=function(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0},ce.prototype.selectDefaultCharset=function(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,A.DEFAULT_CHARSET),!0},ce.prototype.selectCharset=function(le){return 2!==le.length?(this.selectDefaultCharset(),!0):("/"===le[0]||this._charsetService.setgCharset(j[le[0]],A.CHARSETS[le[1]]||A.DEFAULT_CHARSET),!0)},ce.prototype.index=function(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0},ce.prototype.tabSet=function(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0},ce.prototype.reverseIndex=function(){return this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop?(this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)):(this._activeBuffer.y--,this._restrictCursor()),!0},ce.prototype.fullReset=function(){return this._parser.reset(),this._onRequestReset.fire(),!0},ce.prototype.reset=function(){this._curAttrData=R.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=R.DEFAULT_ATTR_DATA.clone()},ce.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},ce.prototype.setgLevel=function(le){return this._charsetService.setgLevel(le),!0},ce.prototype.screenAlignmentPattern=function(){var le=new x.CellData;le.content=1<<22|"E".charCodeAt(0),le.fg=this._curAttrData.fg,le.bg=this._curAttrData.bg,this._setCursor(0,0);for(var oe=0;oe=0},8273:function(Z,w){function N(b,_,I,D){if(void 0===I&&(I=0),void 0===D&&(D=b.length),I>=b.length)return b;D=D>=b.length?b.length:(b.length+D)%b.length;for(var A=I=(b.length+I)%b.length;A>>16&255,I>>>8&255,255&I]},_.fromColorRGB=function(I){return(255&I[0])<<16|(255&I[1])<<8|255&I[2]},_.prototype.clone=function(){var I=new _;return I.fg=this.fg,I.bg=this.bg,I.extended=this.extended.clone(),I},_.prototype.isInverse=function(){return 67108864&this.fg},_.prototype.isBold=function(){return 134217728&this.fg},_.prototype.isUnderline=function(){return 268435456&this.fg},_.prototype.isBlink=function(){return 536870912&this.fg},_.prototype.isInvisible=function(){return 1073741824&this.fg},_.prototype.isItalic=function(){return 67108864&this.bg},_.prototype.isDim=function(){return 134217728&this.bg},_.prototype.isStrikethrough=function(){return 2147483648&this.fg},_.prototype.getFgColorMode=function(){return 50331648&this.fg},_.prototype.getBgColorMode=function(){return 50331648&this.bg},_.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},_.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},_.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},_.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},_.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},_.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},_.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},_.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},_.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},_.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},_.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},_.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},_.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},_.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},_.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},_.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},_.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},_}();w.AttributeData=N;var b=function(){function _(I,D){void 0===I&&(I=0),void 0===D&&(D=-1),this.underlineStyle=I,this.underlineColor=D}return _.prototype.clone=function(){return new _(this.underlineStyle,this.underlineColor)},_.prototype.isEmpty=function(){return 0===this.underlineStyle},_}();w.ExtendedAttrs=b},9092:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.BufferStringIterator=w.Buffer=w.MAX_BUFFER_SIZE=void 0;var b=N(6349),_=N(8437),I=N(511),D=N(643),A=N(4634),S=N(4863),v=N(7116),g=N(3734);w.MAX_BUFFER_SIZE=4294967295;var T=function(){function k(E,x,O){this._hasScrollback=E,this._optionsService=x,this._bufferService=O,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=I.CellData.fromCharData([0,D.NULL_CELL_CHAR,D.NULL_CELL_WIDTH,D.NULL_CELL_CODE]),this._whitespaceCell=I.CellData.fromCharData([0,D.WHITESPACE_CELL_CHAR,D.WHITESPACE_CELL_WIDTH,D.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new b.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return k.prototype.getNullCell=function(E){return E?(this._nullCell.fg=E.fg,this._nullCell.bg=E.bg,this._nullCell.extended=E.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new g.ExtendedAttrs),this._nullCell},k.prototype.getWhitespaceCell=function(E){return E?(this._whitespaceCell.fg=E.fg,this._whitespaceCell.bg=E.bg,this._whitespaceCell.extended=E.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new g.ExtendedAttrs),this._whitespaceCell},k.prototype.getBlankLine=function(E,x){return new _.BufferLine(this._bufferService.cols,this.getNullCell(E),x)},Object.defineProperty(k.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isCursorInViewport",{get:function(){var x=this.ybase+this.y-this.ydisp;return x>=0&&xw.MAX_BUFFER_SIZE?w.MAX_BUFFER_SIZE:x},k.prototype.fillViewportRows=function(E){if(0===this.lines.length){void 0===E&&(E=_.DEFAULT_ATTR_DATA);for(var x=this._rows;x--;)this.lines.push(this.getBlankLine(E))}},k.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new b.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},k.prototype.resize=function(E,x){var O=this.getNullCell(_.DEFAULT_ATTR_DATA),F=this._getCorrectBufferLength(x);if(F>this.lines.maxLength&&(this.lines.maxLength=F),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+K+1?(this.ybase--,K++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(E,O)));else for(j=this._rows;j>x;j--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(F0&&(this.lines.trimStart(J),this.ybase=Math.max(this.ybase-J,0),this.ydisp=Math.max(this.ydisp-J,0),this.savedY=Math.max(this.savedY-J,0)),this.lines.maxLength=F}this.x=Math.min(this.x,E-1),this.y=Math.min(this.y,x-1),K&&(this.y+=K),this.savedX=Math.min(this.savedX,E-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(E,x),this._cols>E))for(z=0;zthis._cols?this._reflowLarger(E,x):this._reflowSmaller(E,x))},k.prototype._reflowLarger=function(E,x){var O=(0,A.reflowLargerGetLinesToRemove)(this.lines,this._cols,E,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(O.length>0){var F=(0,A.reflowLargerCreateNewLayout)(this.lines,O);(0,A.reflowLargerApplyNewLayout)(this.lines,F.layout),this._reflowLargerAdjustViewport(E,x,F.countRemoved)}},k.prototype._reflowLargerAdjustViewport=function(E,x,O){for(var F=this.getNullCell(_.DEFAULT_ATTR_DATA),z=O;z-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length=0;K--){var j=this.lines.get(K);if(!(!j||!j.isWrapped&&j.getTrimmedLength()<=E)){for(var J=[j];j.isWrapped&&K>0;)j=this.lines.get(--K),J.unshift(j);var ee=this.ybase+this.y;if(!(ee>=K&&ee0&&(F.push({start:K+J.length+z,newLines:le}),z+=le.length),J.push.apply(J,le);var be=se.length-1,it=se[be];0===it&&(it=se[--be]);for(var qe=J.length-ce-1,_t=ae;qe>=0;){var yt=Math.min(_t,it);if(J[be].copyCellsFrom(J[qe],_t-yt,it-yt,yt,!0),0==(it-=yt)&&(it=se[--be]),0==(_t-=yt)){qe--;var Ft=Math.max(qe,0);_t=(0,A.getWrappedLineTrimmedLength)(J,Ft,this._cols)}}for(oe=0;oe0;)0===this.ybase?this.y0){var De=[],je=[];for(oe=0;oe=0;oe--)if(xt&&xt.start>Ke+vt){for(var Qt=xt.newLines.length-1;Qt>=0;Qt--)this.lines.set(oe--,xt.newLines[Qt]);oe++,De.push({index:Ke+1,amount:xt.newLines.length}),vt+=xt.newLines.length,xt=F[++Bt]}else this.lines.set(oe,je[Ke--]);var Ht=0;for(oe=De.length-1;oe>=0;oe--)De[oe].index+=Ht,this.lines.onInsertEmitter.fire(De[oe]),Ht+=De[oe].amount;var Ct=Math.max(0,dt+z-this.lines.maxLength);Ct>0&&this.lines.onTrimEmitter.fire(Ct)}},k.prototype.stringIndexToBufferIndex=function(E,x,O){for(void 0===O&&(O=!1);x;){var F=this.lines.get(E);if(!F)return[-1,-1];for(var z=O?F.getTrimmedLength():F.length,K=0;K0&&this.lines.get(x).isWrapped;)x--;for(;O+10;);return E>=this._cols?this._cols-1:E<0?0:E},k.prototype.nextStop=function(E){for(null==E&&(E=this.x);!this.tabs[++E]&&E=this._cols?this._cols-1:E<0?0:E},k.prototype.addMarker=function(E){var x=this,O=new S.Marker(E);return this.markers.push(O),O.register(this.lines.onTrim(function(F){O.line-=F,O.line<0&&O.dispose()})),O.register(this.lines.onInsert(function(F){O.line>=F.index&&(O.line+=F.amount)})),O.register(this.lines.onDelete(function(F){O.line>=F.index&&O.lineF.index&&(O.line-=F.amount)})),O.register(O.onDispose(function(){return x._removeMarker(O)})),O},k.prototype._removeMarker=function(E){this.markers.splice(this.markers.indexOf(E),1)},k.prototype.iterator=function(E,x,O,F,z){return new R(this,E,x,O,F,z)},k}();w.Buffer=T;var R=function(){function k(E,x,O,F,z,K){void 0===O&&(O=0),void 0===F&&(F=E.lines.length),void 0===z&&(z=0),void 0===K&&(K=0),this._buffer=E,this._trimRight=x,this._startIndex=O,this._endIndex=F,this._startOverscan=z,this._endOverscan=K,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return k.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(E.last=this._endIndex+this._endOverscan),E.first=Math.max(E.first,0),E.last=Math.min(E.last,this._buffer.lines.length);for(var x="",O=E.first;O<=E.last;++O)x+=this._buffer.translateBufferLineToString(O,this._trimRight);return this._current=E.last+1,{range:E,content:x}},k}();w.BufferStringIterator=R},8437:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.BufferLine=w.DEFAULT_ATTR_DATA=void 0;var b=N(482),_=N(643),I=N(511),D=N(3734);w.DEFAULT_ATTR_DATA=Object.freeze(new D.AttributeData);var A=function(){function S(v,g,T){void 0===T&&(T=!1),this.isWrapped=T,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);for(var R=g||I.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),k=0;k>22,2097152&g?this._combined[v].charCodeAt(this._combined[v].length-1):T]},S.prototype.set=function(v,g){this._data[3*v+1]=g[_.CHAR_DATA_ATTR_INDEX],g[_.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=g[1],this._data[3*v+0]=2097152|v|g[_.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=g[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[_.CHAR_DATA_WIDTH_INDEX]<<22},S.prototype.getWidth=function(v){return this._data[3*v+0]>>22},S.prototype.hasWidth=function(v){return 12582912&this._data[3*v+0]},S.prototype.getFg=function(v){return this._data[3*v+1]},S.prototype.getBg=function(v){return this._data[3*v+2]},S.prototype.hasContent=function(v){return 4194303&this._data[3*v+0]},S.prototype.getCodePoint=function(v){var g=this._data[3*v+0];return 2097152&g?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&g},S.prototype.isCombined=function(v){return 2097152&this._data[3*v+0]},S.prototype.getString=function(v){var g=this._data[3*v+0];return 2097152&g?this._combined[v]:2097151&g?(0,b.stringFromCodePoint)(2097151&g):""},S.prototype.loadCell=function(v,g){var T=3*v;return g.content=this._data[T+0],g.fg=this._data[T+1],g.bg=this._data[T+2],2097152&g.content&&(g.combinedData=this._combined[v]),268435456&g.bg&&(g.extended=this._extendedAttrs[v]),g},S.prototype.setCell=function(v,g){2097152&g.content&&(this._combined[v]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[v]=g.extended),this._data[3*v+0]=g.content,this._data[3*v+1]=g.fg,this._data[3*v+2]=g.bg},S.prototype.setCellFromCodePoint=function(v,g,T,R,k,E){268435456&k&&(this._extendedAttrs[v]=E),this._data[3*v+0]=g|T<<22,this._data[3*v+1]=R,this._data[3*v+2]=k},S.prototype.addCodepointToCell=function(v,g){var T=this._data[3*v+0];2097152&T?this._combined[v]+=(0,b.stringFromCodePoint)(g):(2097151&T?(this._combined[v]=(0,b.stringFromCodePoint)(2097151&T)+(0,b.stringFromCodePoint)(g),T&=-2097152,T|=2097152):T=g|1<<22,this._data[3*v+0]=T)},S.prototype.insertCells=function(v,g,T,R){if((v%=this.length)&&2===this.getWidth(v-1)&&this.setCellFromCodePoint(v-1,0,1,(null==R?void 0:R.fg)||0,(null==R?void 0:R.bg)||0,(null==R?void 0:R.extended)||new D.ExtendedAttrs),g=0;--E)this.setCell(v+g+E,this.loadCell(v+E,k));for(E=0;Ethis.length){var T=new Uint32Array(3*v);this.length&&T.set(3*v=v&&delete this._combined[E]}}else this._data=new Uint32Array(0),this._combined={};this.length=v}},S.prototype.fill=function(v){this._combined={},this._extendedAttrs={};for(var g=0;g=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0},S.prototype.copyCellsFrom=function(v,g,T,R,k){var E=v._data;if(k)for(var x=R-1;x>=0;x--)for(var O=0;O<3;O++)this._data[3*(T+x)+O]=E[3*(g+x)+O];else for(x=0;x=g&&(this._combined[z-g+T]=v._combined[z])}},S.prototype.translateToString=function(v,g,T){void 0===v&&(v=!1),void 0===g&&(g=0),void 0===T&&(T=this.length),v&&(T=Math.min(T,this.getTrimmedLength()));for(var R="";g>22||1}return R},S}();w.BufferLine=A},4841:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.getRangeLength=void 0,w.getRangeLength=function(N,b){if(N.start.y>N.end.y)throw new Error("Buffer range end ("+N.end.x+", "+N.end.y+") cannot be before start ("+N.start.x+", "+N.start.y+")");return b*(N.end.y-N.start.y)+(N.end.x-N.start.x+1)}},4634:function(Z,w){function N(b,_,I){if(_===b.length-1)return b[_].getTrimmedLength();var D=!b[_].hasContent(I-1)&&1===b[_].getWidth(I-1),A=2===b[_+1].getWidth(0);return D&&A?I-1:I}Object.defineProperty(w,"__esModule",{value:!0}),w.getWrappedLineTrimmedLength=w.reflowSmallerGetNewLineLengths=w.reflowLargerApplyNewLayout=w.reflowLargerCreateNewLayout=w.reflowLargerGetLinesToRemove=void 0,w.reflowLargerGetLinesToRemove=function(b,_,I,D,A){for(var S=[],v=0;v=v&&D0&&(ee>k||0===R[ee].getTrimmedLength());ee--)J++;J>0&&(S.push(v+R.length-J),S.push(J)),v+=R.length-1}}}return S},w.reflowLargerCreateNewLayout=function(b,_){for(var I=[],D=0,A=_[D],S=0,v=0;vT&&(S-=T,v++);var R=2===b[v].getWidth(S-1);R&&S--;var k=R?I-1:I;D.push(k),g+=k}return D},w.getWrappedLineTrimmedLength=N},5295:function(Z,w,N){var b,_=this&&this.__extends||(b=function(v,g){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,R){T.__proto__=R}||function(T,R){for(var k in R)Object.prototype.hasOwnProperty.call(R,k)&&(T[k]=R[k])})(v,g)},function(S,v){if("function"!=typeof v&&null!==v)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function g(){this.constructor=S}b(S,v),S.prototype=null===v?Object.create(v):(g.prototype=v.prototype,new g)});Object.defineProperty(w,"__esModule",{value:!0}),w.BufferSet=void 0;var I=N(9092),D=N(8460),A=function(S){function v(g,T){var R=S.call(this)||this;return R._optionsService=g,R._bufferService=T,R._onBufferActivate=R.register(new D.EventEmitter),R.reset(),R}return _(v,S),Object.defineProperty(v.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),v.prototype.reset=function(){this._normal=new I.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new I.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()},Object.defineProperty(v.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),v.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},v.prototype.activateAltBuffer=function(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},v.prototype.resize=function(g,T){this._normal.resize(g,T),this._alt.resize(g,T)},v.prototype.setupTabStops=function(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)},v}(N(844).Disposable);w.BufferSet=A},511:function(Z,w,N){var b,_=this&&this.__extends||(b=function(g,T){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,k){R.__proto__=k}||function(R,k){for(var E in k)Object.prototype.hasOwnProperty.call(k,E)&&(R[E]=k[E])})(g,T)},function(v,g){if("function"!=typeof g&&null!==g)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function T(){this.constructor=v}b(v,g),v.prototype=null===g?Object.create(g):(T.prototype=g.prototype,new T)});Object.defineProperty(w,"__esModule",{value:!0}),w.CellData=void 0;var I=N(482),D=N(643),A=N(3734),S=function(v){function g(){var T=null!==v&&v.apply(this,arguments)||this;return T.content=0,T.fg=0,T.bg=0,T.extended=new A.ExtendedAttrs,T.combinedData="",T}return _(g,v),g.fromCharData=function(T){var R=new g;return R.setFromCharData(T),R},g.prototype.isCombined=function(){return 2097152&this.content},g.prototype.getWidth=function(){return this.content>>22},g.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,I.stringFromCodePoint)(2097151&this.content):""},g.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},g.prototype.setFromCharData=function(T){this.fg=T[D.CHAR_DATA_ATTR_INDEX],this.bg=0;var R=!1;if(T[D.CHAR_DATA_CHAR_INDEX].length>2)R=!0;else if(2===T[D.CHAR_DATA_CHAR_INDEX].length){var k=T[D.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=k&&k<=56319){var E=T[D.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=E&&E<=57343?this.content=1024*(k-55296)+E-56320+65536|T[D.CHAR_DATA_WIDTH_INDEX]<<22:R=!0}else R=!0}else this.content=T[D.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[D.CHAR_DATA_WIDTH_INDEX]<<22;R&&(this.combinedData=T[D.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[D.CHAR_DATA_WIDTH_INDEX]<<22)},g.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},g}(A.AttributeData);w.CellData=S},643:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.WHITESPACE_CELL_CODE=w.WHITESPACE_CELL_WIDTH=w.WHITESPACE_CELL_CHAR=w.NULL_CELL_CODE=w.NULL_CELL_WIDTH=w.NULL_CELL_CHAR=w.CHAR_DATA_CODE_INDEX=w.CHAR_DATA_WIDTH_INDEX=w.CHAR_DATA_CHAR_INDEX=w.CHAR_DATA_ATTR_INDEX=w.DEFAULT_ATTR=w.DEFAULT_COLOR=void 0,w.DEFAULT_COLOR=256,w.DEFAULT_ATTR=256|w.DEFAULT_COLOR<<9,w.CHAR_DATA_ATTR_INDEX=0,w.CHAR_DATA_CHAR_INDEX=1,w.CHAR_DATA_WIDTH_INDEX=2,w.CHAR_DATA_CODE_INDEX=3,w.NULL_CELL_CHAR="",w.NULL_CELL_WIDTH=1,w.NULL_CELL_CODE=0,w.WHITESPACE_CELL_CHAR=" ",w.WHITESPACE_CELL_WIDTH=1,w.WHITESPACE_CELL_CODE=32},4863:function(Z,w,N){var b,_=this&&this.__extends||(b=function(S,v){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,T){g.__proto__=T}||function(g,T){for(var R in T)Object.prototype.hasOwnProperty.call(T,R)&&(g[R]=T[R])})(S,v)},function(A,S){if("function"!=typeof S&&null!==S)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function v(){this.constructor=A}b(A,S),A.prototype=null===S?Object.create(S):(v.prototype=S.prototype,new v)});Object.defineProperty(w,"__esModule",{value:!0}),w.Marker=void 0;var I=N(8460),D=function(A){function S(v){var g=A.call(this)||this;return g.line=v,g._id=S._nextId++,g.isDisposed=!1,g._onDispose=new I.EventEmitter,g}return _(S,A),Object.defineProperty(S.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),A.prototype.dispose.call(this))},S._nextId=1,S}(N(844).Disposable);w.Marker=D},7116:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.DEFAULT_CHARSET=w.CHARSETS=void 0,w.CHARSETS={},w.DEFAULT_CHARSET=w.CHARSETS.B,w.CHARSETS[0]={"`":"\u25c6",a:"\u2592",b:"\u2409",c:"\u240c",d:"\u240d",e:"\u240a",f:"\xb0",g:"\xb1",h:"\u2424",i:"\u240b",j:"\u2518",k:"\u2510",l:"\u250c",m:"\u2514",n:"\u253c",o:"\u23ba",p:"\u23bb",q:"\u2500",r:"\u23bc",s:"\u23bd",t:"\u251c",u:"\u2524",v:"\u2534",w:"\u252c",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03c0","|":"\u2260","}":"\xa3","~":"\xb7"},w.CHARSETS.A={"#":"\xa3"},w.CHARSETS.B=void 0,w.CHARSETS[4]={"#":"\xa3","@":"\xbe","[":"ij","\\":"\xbd","]":"|","{":"\xa8","|":"f","}":"\xbc","~":"\xb4"},w.CHARSETS.C=w.CHARSETS[5]={"[":"\xc4","\\":"\xd6","]":"\xc5","^":"\xdc","`":"\xe9","{":"\xe4","|":"\xf6","}":"\xe5","~":"\xfc"},w.CHARSETS.R={"#":"\xa3","@":"\xe0","[":"\xb0","\\":"\xe7","]":"\xa7","{":"\xe9","|":"\xf9","}":"\xe8","~":"\xa8"},w.CHARSETS.Q={"@":"\xe0","[":"\xe2","\\":"\xe7","]":"\xea","^":"\xee","`":"\xf4","{":"\xe9","|":"\xf9","}":"\xe8","~":"\xfb"},w.CHARSETS.K={"@":"\xa7","[":"\xc4","\\":"\xd6","]":"\xdc","{":"\xe4","|":"\xf6","}":"\xfc","~":"\xdf"},w.CHARSETS.Y={"#":"\xa3","@":"\xa7","[":"\xb0","\\":"\xe7","]":"\xe9","`":"\xf9","{":"\xe0","|":"\xf2","}":"\xe8","~":"\xec"},w.CHARSETS.E=w.CHARSETS[6]={"@":"\xc4","[":"\xc6","\\":"\xd8","]":"\xc5","^":"\xdc","`":"\xe4","{":"\xe6","|":"\xf8","}":"\xe5","~":"\xfc"},w.CHARSETS.Z={"#":"\xa3","@":"\xa7","[":"\xa1","\\":"\xd1","]":"\xbf","{":"\xb0","|":"\xf1","}":"\xe7"},w.CHARSETS.H=w.CHARSETS[7]={"@":"\xc9","[":"\xc4","\\":"\xd6","]":"\xc5","^":"\xdc","`":"\xe9","{":"\xe4","|":"\xf6","}":"\xe5","~":"\xfc"},w.CHARSETS["="]={"#":"\xf9","@":"\xe0","[":"\xe9","\\":"\xe7","]":"\xea","^":"\xee",_:"\xe8","`":"\xf4","{":"\xe4","|":"\xf6","}":"\xfc","~":"\xfb"}},2584:function(Z,w){var N,b;Object.defineProperty(w,"__esModule",{value:!0}),w.C1=w.C0=void 0,(b=w.C0||(w.C0={})).NUL="\0",b.SOH="\x01",b.STX="\x02",b.ETX="\x03",b.EOT="\x04",b.ENQ="\x05",b.ACK="\x06",b.BEL="\x07",b.BS="\b",b.HT="\t",b.LF="\n",b.VT="\v",b.FF="\f",b.CR="\r",b.SO="\x0e",b.SI="\x0f",b.DLE="\x10",b.DC1="\x11",b.DC2="\x12",b.DC3="\x13",b.DC4="\x14",b.NAK="\x15",b.SYN="\x16",b.ETB="\x17",b.CAN="\x18",b.EM="\x19",b.SUB="\x1a",b.ESC="\x1b",b.FS="\x1c",b.GS="\x1d",b.RS="\x1e",b.US="\x1f",b.SP=" ",b.DEL="\x7f",(N=w.C1||(w.C1={})).PAD="\x80",N.HOP="\x81",N.BPH="\x82",N.NBH="\x83",N.IND="\x84",N.NEL="\x85",N.SSA="\x86",N.ESA="\x87",N.HTS="\x88",N.HTJ="\x89",N.VTS="\x8a",N.PLD="\x8b",N.PLU="\x8c",N.RI="\x8d",N.SS2="\x8e",N.SS3="\x8f",N.DCS="\x90",N.PU1="\x91",N.PU2="\x92",N.STS="\x93",N.CCH="\x94",N.MW="\x95",N.SPA="\x96",N.EPA="\x97",N.SOS="\x98",N.SGCI="\x99",N.SCI="\x9a",N.CSI="\x9b",N.ST="\x9c",N.OSC="\x9d",N.PM="\x9e",N.APC="\x9f"},7399:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.evaluateKeyboardEvent=void 0;var b=N(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};w.evaluateKeyboardEvent=function(I,D,A,S){var v={type:0,cancel:!1,key:void 0},g=(I.shiftKey?1:0)|(I.altKey?2:0)|(I.ctrlKey?4:0)|(I.metaKey?8:0);switch(I.keyCode){case 0:"UIKeyInputUpArrow"===I.key?v.key=D?b.C0.ESC+"OA":b.C0.ESC+"[A":"UIKeyInputLeftArrow"===I.key?v.key=D?b.C0.ESC+"OD":b.C0.ESC+"[D":"UIKeyInputRightArrow"===I.key?v.key=D?b.C0.ESC+"OC":b.C0.ESC+"[C":"UIKeyInputDownArrow"===I.key&&(v.key=D?b.C0.ESC+"OB":b.C0.ESC+"[B");break;case 8:if(I.shiftKey){v.key=b.C0.BS;break}if(I.altKey){v.key=b.C0.ESC+b.C0.DEL;break}v.key=b.C0.DEL;break;case 9:if(I.shiftKey){v.key=b.C0.ESC+"[Z";break}v.key=b.C0.HT,v.cancel=!0;break;case 13:v.key=I.altKey?b.C0.ESC+b.C0.CR:b.C0.CR,v.cancel=!0;break;case 27:v.key=b.C0.ESC,I.altKey&&(v.key=b.C0.ESC+b.C0.ESC),v.cancel=!0;break;case 37:if(I.metaKey)break;g?(v.key=b.C0.ESC+"[1;"+(g+1)+"D",v.key===b.C0.ESC+"[1;3D"&&(v.key=b.C0.ESC+(A?"b":"[1;5D"))):v.key=D?b.C0.ESC+"OD":b.C0.ESC+"[D";break;case 39:if(I.metaKey)break;g?(v.key=b.C0.ESC+"[1;"+(g+1)+"C",v.key===b.C0.ESC+"[1;3C"&&(v.key=b.C0.ESC+(A?"f":"[1;5C"))):v.key=D?b.C0.ESC+"OC":b.C0.ESC+"[C";break;case 38:if(I.metaKey)break;g?(v.key=b.C0.ESC+"[1;"+(g+1)+"A",A||v.key!==b.C0.ESC+"[1;3A"||(v.key=b.C0.ESC+"[1;5A")):v.key=D?b.C0.ESC+"OA":b.C0.ESC+"[A";break;case 40:if(I.metaKey)break;g?(v.key=b.C0.ESC+"[1;"+(g+1)+"B",A||v.key!==b.C0.ESC+"[1;3B"||(v.key=b.C0.ESC+"[1;5B")):v.key=D?b.C0.ESC+"OB":b.C0.ESC+"[B";break;case 45:I.shiftKey||I.ctrlKey||(v.key=b.C0.ESC+"[2~");break;case 46:v.key=g?b.C0.ESC+"[3;"+(g+1)+"~":b.C0.ESC+"[3~";break;case 36:v.key=g?b.C0.ESC+"[1;"+(g+1)+"H":D?b.C0.ESC+"OH":b.C0.ESC+"[H";break;case 35:v.key=g?b.C0.ESC+"[1;"+(g+1)+"F":D?b.C0.ESC+"OF":b.C0.ESC+"[F";break;case 33:I.shiftKey?v.type=2:v.key=b.C0.ESC+"[5~";break;case 34:I.shiftKey?v.type=3:v.key=b.C0.ESC+"[6~";break;case 112:v.key=g?b.C0.ESC+"[1;"+(g+1)+"P":b.C0.ESC+"OP";break;case 113:v.key=g?b.C0.ESC+"[1;"+(g+1)+"Q":b.C0.ESC+"OQ";break;case 114:v.key=g?b.C0.ESC+"[1;"+(g+1)+"R":b.C0.ESC+"OR";break;case 115:v.key=g?b.C0.ESC+"[1;"+(g+1)+"S":b.C0.ESC+"OS";break;case 116:v.key=g?b.C0.ESC+"[15;"+(g+1)+"~":b.C0.ESC+"[15~";break;case 117:v.key=g?b.C0.ESC+"[17;"+(g+1)+"~":b.C0.ESC+"[17~";break;case 118:v.key=g?b.C0.ESC+"[18;"+(g+1)+"~":b.C0.ESC+"[18~";break;case 119:v.key=g?b.C0.ESC+"[19;"+(g+1)+"~":b.C0.ESC+"[19~";break;case 120:v.key=g?b.C0.ESC+"[20;"+(g+1)+"~":b.C0.ESC+"[20~";break;case 121:v.key=g?b.C0.ESC+"[21;"+(g+1)+"~":b.C0.ESC+"[21~";break;case 122:v.key=g?b.C0.ESC+"[23;"+(g+1)+"~":b.C0.ESC+"[23~";break;case 123:v.key=g?b.C0.ESC+"[24;"+(g+1)+"~":b.C0.ESC+"[24~";break;default:if(!I.ctrlKey||I.shiftKey||I.altKey||I.metaKey)if(A&&!S||!I.altKey||I.metaKey)!A||I.altKey||I.ctrlKey||I.shiftKey||!I.metaKey?I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.keyCode>=48&&1===I.key.length?v.key=I.key:I.key&&I.ctrlKey&&"_"===I.key&&(v.key=b.C0.US):65===I.keyCode&&(v.type=1);else{var T=_[I.keyCode],R=T&&T[I.shiftKey?1:0];R?v.key=b.C0.ESC+R:I.keyCode>=65&&I.keyCode<=90&&(v.key=b.C0.ESC+String.fromCharCode(I.ctrlKey?I.keyCode-64:I.keyCode+32))}else I.keyCode>=65&&I.keyCode<=90?v.key=String.fromCharCode(I.keyCode-64):32===I.keyCode?v.key=b.C0.NUL:I.keyCode>=51&&I.keyCode<=55?v.key=String.fromCharCode(I.keyCode-51+27):56===I.keyCode?v.key=b.C0.DEL:219===I.keyCode?v.key=b.C0.ESC:220===I.keyCode?v.key=b.C0.FS:221===I.keyCode&&(v.key=b.C0.GS)}return v}},482:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.Utf8ToUtf32=w.StringToUtf32=w.utf32ToString=w.stringFromCodePoint=void 0,w.stringFromCodePoint=function(_){return _>65535?(_-=65536,String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):String.fromCharCode(_)},w.utf32ToString=function(_,I,D){void 0===I&&(I=0),void 0===D&&(D=_.length);for(var A="",S=I;S65535?(v-=65536,A+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):A+=String.fromCharCode(v)}return A};var N=function(){function _(){this._interim=0}return _.prototype.clear=function(){this._interim=0},_.prototype.decode=function(I,D){var A=I.length;if(!A)return 0;var S=0,v=0;this._interim&&(56320<=(R=I.charCodeAt(v++))&&R<=57343?D[S++]=1024*(this._interim-55296)+R-56320+65536:(D[S++]=this._interim,D[S++]=R),this._interim=0);for(var g=v;g=A)return this._interim=T,S;var R;56320<=(R=I.charCodeAt(g))&&R<=57343?D[S++]=1024*(T-55296)+R-56320+65536:(D[S++]=T,D[S++]=R)}else 65279!==T&&(D[S++]=T)}return S},_}();w.StringToUtf32=N;var b=function(){function _(){this.interim=new Uint8Array(3)}return _.prototype.clear=function(){this.interim.fill(0)},_.prototype.decode=function(I,D){var A=I.length;if(!A)return 0;var S,v,g,T,R=0,k=0,E=0;if(this.interim[0]){var x=!1,O=this.interim[0];O&=192==(224&O)?31:224==(240&O)?15:7;for(var F=0,z=void 0;(z=63&this.interim[++F])&&F<4;)O<<=6,O|=z;for(var K=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,j=K-F;E=A)return 0;if(128!=(192&(z=I[E++]))){E--,x=!0;break}this.interim[F++]=z,O<<=6,O|=63&z}x||(2===K?O<128?E--:D[R++]=O:3===K?O<2048||O>=55296&&O<=57343||65279===O||(D[R++]=O):O<65536||O>1114111||(D[R++]=O)),this.interim.fill(0)}for(var J=A-4,ee=E;ee=A)return this.interim[0]=S,R;if(128!=(192&(v=I[ee++]))){ee--;continue}if((k=(31&S)<<6|63&v)<128){ee--;continue}D[R++]=k}else if(224==(240&S)){if(ee>=A)return this.interim[0]=S,R;if(128!=(192&(v=I[ee++]))){ee--;continue}if(ee>=A)return this.interim[0]=S,this.interim[1]=v,R;if(128!=(192&(g=I[ee++]))){ee--;continue}if((k=(15&S)<<12|(63&v)<<6|63&g)<2048||k>=55296&&k<=57343||65279===k)continue;D[R++]=k}else if(240==(248&S)){if(ee>=A)return this.interim[0]=S,R;if(128!=(192&(v=I[ee++]))){ee--;continue}if(ee>=A)return this.interim[0]=S,this.interim[1]=v,R;if(128!=(192&(g=I[ee++]))){ee--;continue}if(ee>=A)return this.interim[0]=S,this.interim[1]=v,this.interim[2]=g,R;if(128!=(192&(T=I[ee++]))){ee--;continue}if((k=(7&S)<<18|(63&v)<<12|(63&g)<<6|63&T)<65536||k>1114111)continue;D[R++]=k}}return R},_}();w.Utf8ToUtf32=b},225:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.UnicodeV6=void 0;var b,_=N(8273),I=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],D=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],A=function(){function S(){if(this.version="6",!b){b=new Uint8Array(65536),(0,_.fill)(b,1),b[0]=0,(0,_.fill)(b,0,1,32),(0,_.fill)(b,0,127,160),(0,_.fill)(b,2,4352,4448),b[9001]=2,b[9002]=2,(0,_.fill)(b,2,11904,42192),b[12351]=1,(0,_.fill)(b,2,44032,55204),(0,_.fill)(b,2,63744,64256),(0,_.fill)(b,2,65040,65050),(0,_.fill)(b,2,65072,65136),(0,_.fill)(b,2,65280,65377),(0,_.fill)(b,2,65504,65511);for(var v=0;vT[E][1])return!1;for(;E>=k;)if(g>T[R=k+E>>1][1])k=R+1;else{if(!(g=131072&&v<=196605||v>=196608&&v<=262141?2:1},S}();w.UnicodeV6=A},5981:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.WriteBuffer=void 0;var N="undefined"==typeof queueMicrotask?function(_){Promise.resolve().then(_)}:queueMicrotask,b=function(){function _(I){this._action=I,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0}return _.prototype.writeSync=function(I,D){if(void 0!==D&&this._syncCalls>D)this._syncCalls=0;else if(this._pendingData+=I.length,this._writeBuffer.push(I),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var A;for(this._isSyncWriting=!0;A=this._writeBuffer.shift();){this._action(A);var S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}},_.prototype.write=function(I,D){var A=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return A._innerWrite()})),this._pendingData+=I.length,this._writeBuffer.push(I),this._callbacks.push(D)},_.prototype._innerWrite=function(I,D){var A=this;void 0===I&&(I=0),void 0===D&&(D=!0);for(var S=I||Date.now();this._writeBuffer.length>this._bufferOffset;){var v=this._writeBuffer[this._bufferOffset],g=this._action(v,D);if(g)return void g.catch(function(R){return N(function(){throw R}),Promise.resolve(!1)}).then(function(R){return Date.now()-S>=12?setTimeout(function(){return A._innerWrite(0,R)}):A._innerWrite(S,R)});var T=this._callbacks[this._bufferOffset];if(T&&T(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return A._innerWrite()})):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0)},_}();w.WriteBuffer=b},5770:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.PAYLOAD_LIMIT=void 0,w.PAYLOAD_LIMIT=1e7},6351:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.DcsHandler=w.DcsParser=void 0;var b=N(482),_=N(8742),I=N(5770),D=[],A=function(){function g(){this._handlers=Object.create(null),this._active=D,this._ident=0,this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return g.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=D},g.prototype.registerHandler=function(T,R){void 0===this._handlers[T]&&(this._handlers[T]=[]);var k=this._handlers[T];return k.push(R),{dispose:function(){var x=k.indexOf(R);-1!==x&&k.splice(x,1)}}},g.prototype.clearHandler=function(T){this._handlers[T]&&delete this._handlers[T]},g.prototype.setHandlerFallback=function(T){this._handlerFb=T},g.prototype.reset=function(){if(this._active.length)for(var T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=D,this._ident=0},g.prototype.hook=function(T,R){if(this.reset(),this._ident=T,this._active=this._handlers[T]||D,this._active.length)for(var k=this._active.length-1;k>=0;k--)this._active[k].hook(R);else this._handlerFb(this._ident,"HOOK",R)},g.prototype.put=function(T,R,k){if(this._active.length)for(var E=this._active.length-1;E>=0;E--)this._active[E].put(T,R,k);else this._handlerFb(this._ident,"PUT",(0,b.utf32ToString)(T,R,k))},g.prototype.unhook=function(T,R){if(void 0===R&&(R=!0),this._active.length){var k=!1,E=this._active.length-1,x=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,k=R,x=this._stack.fallThrough,this._stack.paused=!1),!x&&!1===k){for(;E>=0&&!0!==(k=this._active[E].unhook(T));E--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,k;E--}for(;E>=0;E--)if((k=this._active[E].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,k}else this._handlerFb(this._ident,"UNHOOK",T);this._active=D,this._ident=0},g}();w.DcsParser=A;var S=new _.Params;S.addParam(0);var v=function(){function g(T){this._handler=T,this._data="",this._params=S,this._hitLimit=!1}return g.prototype.hook=function(T){this._params=T.length>1||T.params[0]?T.clone():S,this._data="",this._hitLimit=!1},g.prototype.put=function(T,R,k){this._hitLimit||(this._data+=(0,b.utf32ToString)(T,R,k),this._data.length>I.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},g.prototype.unhook=function(T){var R=this,k=!1;if(this._hitLimit)k=!1;else if(T&&(k=this._handler(this._data,this._params))instanceof Promise)return k.then(function(E){return R._params=S,R._data="",R._hitLimit=!1,E});return this._params=S,this._data="",this._hitLimit=!1,k},g}();w.DcsHandler=v},2015:function(Z,w,N){var b,_=this&&this.__extends||(b=function(E,x){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,F){O.__proto__=F}||function(O,F){for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&(O[z]=F[z])})(E,x)},function(k,E){if("function"!=typeof E&&null!==E)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function x(){this.constructor=k}b(k,E),k.prototype=null===E?Object.create(E):(x.prototype=E.prototype,new x)});Object.defineProperty(w,"__esModule",{value:!0}),w.EscapeSequenceParser=w.VT500_TRANSITION_TABLE=w.TransitionTable=void 0;var I=N(844),D=N(8273),A=N(8742),S=N(6242),v=N(6351),g=function(){function k(E){this.table=new Uint8Array(E)}return k.prototype.setDefault=function(E,x){(0,D.fill)(this.table,E<<4|x)},k.prototype.add=function(E,x,O,F){this.table[x<<8|E]=O<<4|F},k.prototype.addMany=function(E,x,O,F){for(var z=0;z1)throw new Error("only one byte as prefix supported");if((F=x.prefix.charCodeAt(0))&&60>F||F>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(x.intermediates){if(x.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var z=0;zK||K>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");F<<=8,F|=K}}if(1!==x.final.length)throw new Error("final must be a single byte");var j=x.final.charCodeAt(0);if(O[0]>j||j>O[1])throw new Error("final must be in range "+O[0]+" .. "+O[1]);return(F<<=8)|j},E.prototype.identToString=function(x){for(var O=[];x;)O.push(String.fromCharCode(255&x)),x>>=8;return O.reverse().join("")},E.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},E.prototype.setPrintHandler=function(x){this._printHandler=x},E.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},E.prototype.registerEscHandler=function(x,O){var F=this._identifier(x,[48,126]);void 0===this._escHandlers[F]&&(this._escHandlers[F]=[]);var z=this._escHandlers[F];return z.push(O),{dispose:function(){var j=z.indexOf(O);-1!==j&&z.splice(j,1)}}},E.prototype.clearEscHandler=function(x){this._escHandlers[this._identifier(x,[48,126])]&&delete this._escHandlers[this._identifier(x,[48,126])]},E.prototype.setEscHandlerFallback=function(x){this._escHandlerFb=x},E.prototype.setExecuteHandler=function(x,O){this._executeHandlers[x.charCodeAt(0)]=O},E.prototype.clearExecuteHandler=function(x){this._executeHandlers[x.charCodeAt(0)]&&delete this._executeHandlers[x.charCodeAt(0)]},E.prototype.setExecuteHandlerFallback=function(x){this._executeHandlerFb=x},E.prototype.registerCsiHandler=function(x,O){var F=this._identifier(x);void 0===this._csiHandlers[F]&&(this._csiHandlers[F]=[]);var z=this._csiHandlers[F];return z.push(O),{dispose:function(){var j=z.indexOf(O);-1!==j&&z.splice(j,1)}}},E.prototype.clearCsiHandler=function(x){this._csiHandlers[this._identifier(x)]&&delete this._csiHandlers[this._identifier(x)]},E.prototype.setCsiHandlerFallback=function(x){this._csiHandlerFb=x},E.prototype.registerDcsHandler=function(x,O){return this._dcsParser.registerHandler(this._identifier(x),O)},E.prototype.clearDcsHandler=function(x){this._dcsParser.clearHandler(this._identifier(x))},E.prototype.setDcsHandlerFallback=function(x){this._dcsParser.setHandlerFallback(x)},E.prototype.registerOscHandler=function(x,O){return this._oscParser.registerHandler(x,O)},E.prototype.clearOscHandler=function(x){this._oscParser.clearHandler(x)},E.prototype.setOscHandlerFallback=function(x){this._oscParser.setHandlerFallback(x)},E.prototype.setErrorHandler=function(x){this._errorHandler=x},E.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},E.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])},E.prototype._preserveStack=function(x,O,F,z,K){this._parseStack.state=x,this._parseStack.handlers=O,this._parseStack.handlerPos=F,this._parseStack.transition=z,this._parseStack.chunkPos=K},E.prototype.parse=function(x,O,F){var z,K=0,j=0,J=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,J=this._parseStack.chunkPos+1;else{if(void 0===F||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");var ee=this._parseStack.handlers,$=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===F&&$>-1)for(;$>=0&&!0!==(z=ee[$](this._params));$--)if(z instanceof Promise)return this._parseStack.handlerPos=$,z;this._parseStack.handlers=[];break;case 4:if(!1===F&&$>-1)for(;$>=0&&!0!==(z=ee[$]());$--)if(z instanceof Promise)return this._parseStack.handlerPos=$,z;this._parseStack.handlers=[];break;case 6:if(z=this._dcsParser.unhook(24!==(K=x[this._parseStack.chunkPos])&&26!==K,F))return z;27===K&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(z=this._oscParser.end(24!==(K=x[this._parseStack.chunkPos])&&26!==K,F))return z;27===K&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,J=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(var ae=J;ae>4){case 2:for(var se=ae+1;;++se){if(se>=O||(K=x[se])<32||K>126&&K=O||(K=x[se])<32||K>126&&K=O||(K=x[se])<32||K>126&&K=O||(K=x[se])<32||K>126&&K=0&&!0!==(z=ee[ce](this._params));ce--)if(z instanceof Promise)return this._preserveStack(3,ee,ce,j,ae),z;ce<0&&this._csiHandlerFb(this._collect<<8|K,this._params),this.precedingCodepoint=0;break;case 8:do{switch(K){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(K-48)}}while(++ae47&&K<60);ae--;break;case 9:this._collect<<=8,this._collect|=K;break;case 10:for(var le=this._escHandlers[this._collect<<8|K],oe=le?le.length-1:-1;oe>=0&&!0!==(z=le[oe]());oe--)if(z instanceof Promise)return this._preserveStack(4,le,oe,j,ae),z;oe<0&&this._escHandlerFb(this._collect<<8|K),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|K,this._params);break;case 13:for(var Ae=ae+1;;++Ae)if(Ae>=O||24===(K=x[Ae])||26===K||27===K||K>127&&K=O||(K=x[be])<32||K>127&&K=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=I,this._id=-1,this._state=0},S.prototype._start=function(){if(this._active=this._handlers[this._id]||I,this._active.length)for(var v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")},S.prototype._put=function(v,g,T){if(this._active.length)for(var R=this._active.length-1;R>=0;R--)this._active[R].put(v,g,T);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(v,g,T))},S.prototype.start=function(){this.reset(),this._state=1},S.prototype.put=function(v,g,T){if(3!==this._state){if(1===this._state)for(;g0&&this._put(v,g,T)}},S.prototype.end=function(v,g){if(void 0===g&&(g=!0),0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){var T=!1,R=this._active.length-1,k=!1;if(this._stack.paused&&(R=this._stack.loopPosition-1,T=g,k=this._stack.fallThrough,this._stack.paused=!1),!k&&!1===T){for(;R>=0&&!0!==(T=this._active[R].end(v));R--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=R,this._stack.fallThrough=!1,T;R--}for(;R>=0;R--)if((T=this._active[R].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=R,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",v);this._active=I,this._id=-1,this._state=0}},S}();w.OscParser=D;var A=function(){function S(v){this._handler=v,this._data="",this._hitLimit=!1}return S.prototype.start=function(){this._data="",this._hitLimit=!1},S.prototype.put=function(v,g,T){this._hitLimit||(this._data+=(0,_.utf32ToString)(v,g,T),this._data.length>b.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},S.prototype.end=function(v){var g=this,T=!1;if(this._hitLimit)T=!1;else if(v&&(T=this._handler(this._data))instanceof Promise)return T.then(function(R){return g._data="",g._hitLimit=!1,R});return this._data="",this._hitLimit=!1,T},S}();w.OscHandler=A},8742:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.Params=void 0;var N=2147483647,b=function(){function _(I,D){if(void 0===I&&(I=32),void 0===D&&(D=32),this.maxLength=I,this.maxSubParamsLength=D,D>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(I),this.length=0,this._subParams=new Int32Array(D),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(I),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return _.fromArray=function(I){var D=new _;if(!I.length)return D;for(var A=I[0]instanceof Array?1:0;A>8,S=255&this._subParamsIdx[D];S-A>0&&I.push(Array.prototype.slice.call(this._subParams,A,S))}return I},_.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},_.prototype.addParam=function(I){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(I<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=I>N?N:I}},_.prototype.addSubParam=function(I){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(I<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=I>N?N:I,this._subParamsIdx[this.length-1]++}},_.prototype.hasSubParams=function(I){return(255&this._subParamsIdx[I])-(this._subParamsIdx[I]>>8)>0},_.prototype.getSubParams=function(I){var D=this._subParamsIdx[I]>>8,A=255&this._subParamsIdx[I];return A-D>0?this._subParams.subarray(D,A):null},_.prototype.getSubParamsAll=function(){for(var I={},D=0;D>8,S=255&this._subParamsIdx[D];S-A>0&&(I[D]=this._subParams.slice(A,S))}return I},_.prototype.addDigit=function(I){var D;if(!(this._rejectDigits||!(D=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var A=this._digitIsSub?this._subParams:this.params,S=A[D-1];A[D-1]=~S?Math.min(10*S+I,N):I}},_}();w.Params=b},5741:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.AddonManager=void 0;var N=function(){function b(){this._addons=[]}return b.prototype.dispose=function(){for(var _=this._addons.length-1;_>=0;_--)this._addons[_].instance.dispose()},b.prototype.loadAddon=function(_,I){var D=this,A={instance:I,dispose:I.dispose,isDisposed:!1};this._addons.push(A),I.dispose=function(){return D._wrappedAddonDispose(A)},I.activate(_)},b.prototype._wrappedAddonDispose=function(_){if(!_.isDisposed){for(var I=-1,D=0;D=this._line.length))return A?(this._line.loadCell(D,A),A):this._line.loadCell(D,new b.CellData)},I.prototype.translateToString=function(D,A,S){return this._line.translateToString(D,A,S)},I}();w.BufferLineApiView=_},8285:function(Z,w,N){Object.defineProperty(w,"__esModule",{value:!0}),w.BufferNamespaceApi=void 0;var b=N(8771),_=N(8460),I=function(){function D(A){var S=this;this._core=A,this._onBufferChange=new _.EventEmitter,this._normal=new b.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new b.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(function(){return S._onBufferChange.fire(S.active)})}return Object.defineProperty(D.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"active",{get:function(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"normal",{get:function(){return this._normal.init(this._core.buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"alternate",{get:function(){return this._alternate.init(this._core.buffers.alt)},enumerable:!1,configurable:!0}),D}();w.BufferNamespaceApi=I},7975:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.ParserApi=void 0;var N=function(){function b(_){this._core=_}return b.prototype.registerCsiHandler=function(_,I){return this._core.registerCsiHandler(_,function(D){return I(D.toArray())})},b.prototype.addCsiHandler=function(_,I){return this.registerCsiHandler(_,I)},b.prototype.registerDcsHandler=function(_,I){return this._core.registerDcsHandler(_,function(D,A){return I(D,A.toArray())})},b.prototype.addDcsHandler=function(_,I){return this.registerDcsHandler(_,I)},b.prototype.registerEscHandler=function(_,I){return this._core.registerEscHandler(_,I)},b.prototype.addEscHandler=function(_,I){return this.registerEscHandler(_,I)},b.prototype.registerOscHandler=function(_,I){return this._core.registerOscHandler(_,I)},b.prototype.addOscHandler=function(_,I){return this.registerOscHandler(_,I)},b}();w.ParserApi=N},7090:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.UnicodeApi=void 0;var N=function(){function b(_){this._core=_}return b.prototype.register=function(_){this._core.unicodeService.register(_)},Object.defineProperty(b.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(I){this._core.unicodeService.activeVersion=I},enumerable:!1,configurable:!0}),b}();w.UnicodeApi=N},744:function(Z,w,N){var b,_=this&&this.__extends||(b=function(k,E){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,O){x.__proto__=O}||function(x,O){for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(x[F]=O[F])})(k,E)},function(R,k){if("function"!=typeof k&&null!==k)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function E(){this.constructor=R}b(R,k),R.prototype=null===k?Object.create(k):(E.prototype=k.prototype,new E)}),I=this&&this.__decorate||function(R,k,E,x){var O,F=arguments.length,z=F<3?k:null===x?x=Object.getOwnPropertyDescriptor(k,E):x;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)z=Reflect.decorate(R,k,E,x);else for(var K=R.length-1;K>=0;K--)(O=R[K])&&(z=(F<3?O(z):F>3?O(k,E,z):O(k,E))||z);return F>3&&z&&Object.defineProperty(k,E,z),z},D=this&&this.__param||function(R,k){return function(E,x){k(E,x,R)}};Object.defineProperty(w,"__esModule",{value:!0}),w.BufferService=w.MINIMUM_ROWS=w.MINIMUM_COLS=void 0;var A=N(2585),S=N(5295),v=N(8460),g=N(844);w.MINIMUM_COLS=2,w.MINIMUM_ROWS=1;var T=function(R){function k(E){var x=R.call(this)||this;return x._optionsService=E,x.isUserScrolling=!1,x._onResize=new v.EventEmitter,x._onScroll=new v.EventEmitter,x.cols=Math.max(E.options.cols||0,w.MINIMUM_COLS),x.rows=Math.max(E.options.rows||0,w.MINIMUM_ROWS),x.buffers=new S.BufferSet(E,x),x}return _(k,R),Object.defineProperty(k.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),k.prototype.dispose=function(){R.prototype.dispose.call(this),this.buffers.dispose()},k.prototype.resize=function(E,x){this.cols=E,this.rows=x,this.buffers.resize(E,x),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:E,rows:x})},k.prototype.reset=function(){this.buffers.reset(),this.isUserScrolling=!1},k.prototype.scroll=function(E,x){void 0===x&&(x=!1);var O,F=this.buffer;(O=this._cachedBlankLine)&&O.length===this.cols&&O.getFg(0)===E.fg&&O.getBg(0)===E.bg||(O=F.getBlankLine(E,x),this._cachedBlankLine=O),O.isWrapped=x;var z=F.ybase+F.scrollTop,K=F.ybase+F.scrollBottom;if(0===F.scrollTop){var j=F.lines.isFull;K===F.lines.length-1?j?F.lines.recycle().copyFrom(O):F.lines.push(O.clone()):F.lines.splice(K+1,0,O.clone()),j?this.isUserScrolling&&(F.ydisp=Math.max(F.ydisp-1,0)):(F.ybase++,this.isUserScrolling||F.ydisp++)}else F.lines.shiftElements(z+1,K-z+1-1,-1),F.lines.set(K,O.clone());this.isUserScrolling||(F.ydisp=F.ybase),this._onScroll.fire(F.ydisp)},k.prototype.scrollLines=function(E,x,O){var F=this.buffer;if(E<0){if(0===F.ydisp)return;this.isUserScrolling=!0}else E+F.ydisp>=F.ybase&&(this.isUserScrolling=!1);var z=F.ydisp;F.ydisp=Math.max(Math.min(F.ydisp+E,F.ybase),0),z!==F.ydisp&&(x||this._onScroll.fire(F.ydisp))},k.prototype.scrollPages=function(E){this.scrollLines(E*(this.rows-1))},k.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},k.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},k.prototype.scrollToLine=function(E){var x=E-this.buffer.ydisp;0!==x&&this.scrollLines(x)},I([D(0,A.IOptionsService)],k)}(g.Disposable);w.BufferService=T},7994:function(Z,w){Object.defineProperty(w,"__esModule",{value:!0}),w.CharsetService=void 0;var N=function(){function b(){this.glevel=0,this._charsets=[]}return b.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},b.prototype.setgLevel=function(_){this.glevel=_,this.charset=this._charsets[_]},b.prototype.setgCharset=function(_,I){this._charsets[_]=I,this.glevel===_&&(this.charset=I)},b}();w.CharsetService=N},1753:function(Z,w,N){var b=this&&this.__decorate||function(R,k,E,x){var O,F=arguments.length,z=F<3?k:null===x?x=Object.getOwnPropertyDescriptor(k,E):x;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)z=Reflect.decorate(R,k,E,x);else for(var K=R.length-1;K>=0;K--)(O=R[K])&&(z=(F<3?O(z):F>3?O(k,E,z):O(k,E))||z);return F>3&&z&&Object.defineProperty(k,E,z),z},_=this&&this.__param||function(R,k){return function(E,x){k(E,x,R)}};Object.defineProperty(w,"__esModule",{value:!0}),w.CoreMouseService=void 0;var I=N(2585),D=N(8460),A={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(k){return 4!==k.button&&1===k.action&&(k.ctrl=!1,k.alt=!1,k.shift=!1,!0)}},VT200:{events:19,restrict:function(k){return 32!==k.action}},DRAG:{events:23,restrict:function(k){return 32!==k.action||3!==k.button}},ANY:{events:31,restrict:function(k){return!0}}};function S(R,k){var E=(R.ctrl?16:0)|(R.shift?4:0)|(R.alt?8:0);return 4===R.button?(E|=64,E|=R.action):(E|=3&R.button,4&R.button&&(E|=64),8&R.button&&(E|=128),32===R.action?E|=32:0!==R.action||k||(E|=3)),E}var v=String.fromCharCode,g={DEFAULT:function(k){var E=[S(k,!1)+32,k.col+32,k.row+32];return E[0]>255||E[1]>255||E[2]>255?"":"\x1b[M"+v(E[0])+v(E[1])+v(E[2])},SGR:function(k){var E=0===k.action&&4!==k.button?"m":"M";return"\x1b[<"+S(k,!0)+";"+k.col+";"+k.row+E}},T=function(){function R(k,E){this._bufferService=k,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new D.EventEmitter,this._lastEvent=null;for(var x=0,O=Object.keys(A);x=this._bufferService.cols||k.row<0||k.row>=this._bufferService.rows||4===k.button&&32===k.action||3===k.button&&32!==k.action||4!==k.button&&(2===k.action||3===k.action)||(k.col++,k.row++,32===k.action&&this._lastEvent&&this._compareEvents(this._lastEvent,k))||!this._protocols[this._activeProtocol].restrict(k))return!1;var E=this._encodings[this._activeEncoding](k);return E&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=k,!0},R.prototype.explainEvents=function(k){return{down:!!(1&k),up:!!(2&k),drag:!!(4&k),move:!!(8&k),wheel:!!(16&k)}},R.prototype._compareEvents=function(k,E){return k.col===E.col&&k.row===E.row&&k.button===E.button&&k.action===E.action&&k.ctrl===E.ctrl&&k.alt===E.alt&&k.shift===E.shift},b([_(0,I.IBufferService),_(1,I.ICoreService)],R)}();w.CoreMouseService=T},6975:function(Z,w,N){var b,_=this&&this.__extends||(b=function(x,O){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,z){F.__proto__=z}||function(F,z){for(var K in z)Object.prototype.hasOwnProperty.call(z,K)&&(F[K]=z[K])})(x,O)},function(E,x){if("function"!=typeof x&&null!==x)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function O(){this.constructor=E}b(E,x),E.prototype=null===x?Object.create(x):(O.prototype=x.prototype,new O)}),I=this&&this.__decorate||function(E,x,O,F){var z,K=arguments.length,j=K<3?x:null===F?F=Object.getOwnPropertyDescriptor(x,O):F;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)j=Reflect.decorate(E,x,O,F);else for(var J=E.length-1;J>=0;J--)(z=E[J])&&(j=(K<3?z(j):K>3?z(x,O,j):z(x,O))||j);return K>3&&j&&Object.defineProperty(x,O,j),j},D=this&&this.__param||function(E,x){return function(O,F){x(O,F,E)}};Object.defineProperty(w,"__esModule",{value:!0}),w.CoreService=void 0;var A=N(2585),S=N(8460),v=N(1439),g=N(844),T=Object.freeze({insertMode:!1}),R=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),k=function(E){function x(O,F,z,K){var j=E.call(this)||this;return j._bufferService=F,j._logService=z,j._optionsService=K,j.isCursorInitialized=!1,j.isCursorHidden=!1,j._onData=j.register(new S.EventEmitter),j._onUserInput=j.register(new S.EventEmitter),j._onBinary=j.register(new S.EventEmitter),j._scrollToBottom=O,j.register({dispose:function(){return j._scrollToBottom=void 0}}),j.modes=(0,v.clone)(T),j.decPrivateModes=(0,v.clone)(R),j}return _(x,E),Object.defineProperty(x.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),x.prototype.reset=function(){this.modes=(0,v.clone)(T),this.decPrivateModes=(0,v.clone)(R)},x.prototype.triggerDataEvent=function(O,F){if(void 0===F&&(F=!1),!this._optionsService.options.disableStdin){var z=this._bufferService.buffer;z.ybase!==z.ydisp&&this._scrollToBottom(),F&&this._onUserInput.fire(),this._logService.debug('sending data "'+O+'"',function(){return O.split("").map(function(K){return K.charCodeAt(0)})}),this._onData.fire(O)}},x.prototype.triggerBinaryEvent=function(O){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+O+'"',function(){return O.split("").map(function(F){return F.charCodeAt(0)})}),this._onBinary.fire(O))},I([D(1,A.IBufferService),D(2,A.ILogService),D(3,A.IOptionsService)],x)}(g.Disposable);w.CoreService=k},3730:function(Z,w,N){var b=this&&this.__decorate||function(A,S,v,g){var T,R=arguments.length,k=R<3?S:null===g?g=Object.getOwnPropertyDescriptor(S,v):g;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)k=Reflect.decorate(A,S,v,g);else for(var E=A.length-1;E>=0;E--)(T=A[E])&&(k=(R<3?T(k):R>3?T(S,v,k):T(S,v))||k);return R>3&&k&&Object.defineProperty(S,v,k),k},_=this&&this.__param||function(A,S){return function(v,g){S(v,g,A)}};Object.defineProperty(w,"__esModule",{value:!0}),w.DirtyRowService=void 0;var I=N(2585),D=function(){function A(S){this._bufferService=S,this.clearRange()}return Object.defineProperty(A.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),A.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},A.prototype.markDirty=function(S){Sthis._end&&(this._end=S)},A.prototype.markRangeDirty=function(S,v){if(S>v){var g=S;S=v,v=g}Sthis._end&&(this._end=v)},A.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},b([_(0,I.IBufferService)],A)}();w.DirtyRowService=D},4348:function(Z,w,N){var b=this&&this.__spreadArray||function(S,v,g){if(g||2===arguments.length)for(var T,R=0,k=v.length;R0?R[0].index:g.length;if(g.length!==z)throw new Error("[createInstance] First service dependency of "+v.name+" at position "+(z+1)+" conflicts with "+g.length+" static arguments");return new(v.bind.apply(v,b([void 0],b(b([],g,!0),k,!0),!1)))},S}();w.InstantiationService=A},7866:function(Z,w,N){var b=this&&this.__decorate||function(v,g,T,R){var k,E=arguments.length,x=E<3?g:null===R?R=Object.getOwnPropertyDescriptor(g,T):R;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)x=Reflect.decorate(v,g,T,R);else for(var O=v.length-1;O>=0;O--)(k=v[O])&&(x=(E<3?k(x):E>3?k(g,T,x):k(g,T))||x);return E>3&&x&&Object.defineProperty(g,T,x),x},_=this&&this.__param||function(v,g){return function(T,R){g(T,R,v)}},I=this&&this.__spreadArray||function(v,g,T){if(T||2===arguments.length)for(var R,k=0,E=g.length;k=v)return S+this.wcwidth(T);var R=A.charCodeAt(g);56320<=R&&R<=57343?T=1024*(T-55296)+R-56320+65536:S+=this.wcwidth(R)}S+=this.wcwidth(T)}return S},D}();w.UnicodeService=I}},f={};function B(V){var Z=f[V];if(void 0!==Z)return Z.exports;var w=f[V]={exports:{}};return q[V].call(w.exports,w,w.exports,B),w.exports}var U={};return function(){var V=U;Object.defineProperty(V,"__esModule",{value:!0}),V.Terminal=void 0;var Z=B(3236),w=B(9042),N=B(7975),b=B(7090),_=B(5741),I=B(8285),D=function(){function A(S){this._core=new Z.Terminal(S),this._addonManager=new _.AddonManager}return A.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(A.prototype,"onBell",{get:function(){return this._core.onBell},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new N.ParserApi(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"unicode",{get:function(){return this._checkProposedApi(),new b.UnicodeApi(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"buffer",{get:function(){return this._checkProposedApi(),this._buffer||(this._buffer=new I.BufferNamespaceApi(this._core)),this._buffer},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"modes",{get:function(){var v=this._core.coreService.decPrivateModes,g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"options",{get:function(){return this._core.options},enumerable:!1,configurable:!0}),A.prototype.blur=function(){this._core.blur()},A.prototype.focus=function(){this._core.focus()},A.prototype.resize=function(S,v){this._verifyIntegers(S,v),this._core.resize(S,v)},A.prototype.open=function(S){this._core.open(S)},A.prototype.attachCustomKeyEventHandler=function(S){this._core.attachCustomKeyEventHandler(S)},A.prototype.registerLinkMatcher=function(S,v,g){return this._checkProposedApi(),this._core.registerLinkMatcher(S,v,g)},A.prototype.deregisterLinkMatcher=function(S){this._checkProposedApi(),this._core.deregisterLinkMatcher(S)},A.prototype.registerLinkProvider=function(S){return this._checkProposedApi(),this._core.registerLinkProvider(S)},A.prototype.registerCharacterJoiner=function(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)},A.prototype.deregisterCharacterJoiner=function(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)},A.prototype.registerMarker=function(S){return this._checkProposedApi(),this._verifyIntegers(S),this._core.addMarker(S)},A.prototype.addMarker=function(S){return this.registerMarker(S)},A.prototype.hasSelection=function(){return this._core.hasSelection()},A.prototype.select=function(S,v,g){this._verifyIntegers(S,v,g),this._core.select(S,v,g)},A.prototype.getSelection=function(){return this._core.getSelection()},A.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},A.prototype.clearSelection=function(){this._core.clearSelection()},A.prototype.selectAll=function(){this._core.selectAll()},A.prototype.selectLines=function(S,v){this._verifyIntegers(S,v),this._core.selectLines(S,v)},A.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},A.prototype.scrollLines=function(S){this._verifyIntegers(S),this._core.scrollLines(S)},A.prototype.scrollPages=function(S){this._verifyIntegers(S),this._core.scrollPages(S)},A.prototype.scrollToTop=function(){this._core.scrollToTop()},A.prototype.scrollToBottom=function(){this._core.scrollToBottom()},A.prototype.scrollToLine=function(S){this._verifyIntegers(S),this._core.scrollToLine(S)},A.prototype.clear=function(){this._core.clear()},A.prototype.write=function(S,v){this._core.write(S,v)},A.prototype.writeUtf8=function(S,v){this._core.write(S,v)},A.prototype.writeln=function(S,v){this._core.write(S),this._core.write("\r\n",v)},A.prototype.paste=function(S){this._core.paste(S)},A.prototype.getOption=function(S){return this._core.optionsService.getOption(S)},A.prototype.setOption=function(S,v){this._core.optionsService.setOption(S,v)},A.prototype.refresh=function(S,v){this._verifyIntegers(S,v),this._core.refresh(S,v)},A.prototype.reset=function(){this._core.reset()},A.prototype.clearTextureAtlas=function(){this._core.clearTextureAtlas()},A.prototype.loadAddon=function(S){return this._addonManager.loadAddon(this,S)},Object.defineProperty(A,"strings",{get:function(){return w},enumerable:!1,configurable:!0}),A.prototype._verifyIntegers=function(){for(var S=[],v=0;v=0?this.update(w):(this.data.push(w),this.dataChange.next(this.data))},Z.prototype.set=function(w){var N=this;w.forEach(function(_){var I=N.findIndex(_);if(I>=0){var D=Object.assign(N.data[I],_);N.data[I]=D}else N.data.push(_)}),this.data.filter(function(_){return 0===w.filter(function(I){return N.getItemKey(I)===N.getItemKey(_)}).length}).forEach(function(_){return N.remove(_)}),this.dataChange.next(this.data)},Z.prototype.get=function(w){var N=this,b=this.data.findIndex(function(_){return N.getItemKey(_)===w});if(b>=0)return this.data[b]},Z.prototype.update=function(w){var N=this.findIndex(w);if(N>=0){var b=Object.assign(this.data[N],w);this.data[N]=b,this.dataChange.next(this.data),this.itemUpdated.next(b)}},Z.prototype.remove=function(w){var N=this.findIndex(w);N>=0&&(this.data.splice(N,1),this.dataChange.next(this.data))},Object.defineProperty(Z.prototype,"changes",{get:function(){return this.dataChange},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"itemChanged",{get:function(){return this.itemUpdated},enumerable:!1,configurable:!0}),Z.prototype.clear=function(){this.data=[],this.dataChange.next(this.data)},Z.prototype.findIndex=function(w){var N=this;return this.data.findIndex(function(b){return N.getItemKey(b)===N.getItemKey(w)})},Z}()},3941:function(ue,q,f){"use strict";f.d(q,{F:function(){return Z}});var B=f(61855),U=f(18419),V=f(38999),Z=function(w){function N(){return null!==w&&w.apply(this,arguments)||this}return(0,B.ZT)(N,w),N.prototype.getItemKey=function(b){return b.link_id},N.\u0275fac=function(){var b;return function(I){return(b||(b=V.n5z(N)))(I||N)}}(),N.\u0275prov=V.Yz7({token:N,factory:N.\u0275fac}),N}(U.o)},96852:function(ue,q,f){"use strict";f.d(q,{G:function(){return Z}});var B=f(61855),U=f(18419),V=f(38999),Z=function(w){function N(){return null!==w&&w.apply(this,arguments)||this}return(0,B.ZT)(N,w),N.prototype.getItemKey=function(b){return b.node_id},N.\u0275fac=function(){var b;return function(I){return(b||(b=V.n5z(N)))(I||N)}}(),N.\u0275prov=V.Yz7({token:N,factory:N.\u0275fac}),N}(U.o)},36889:function(ue,q,f){"use strict";f.d(q,{X:function(){return V}});var B=f(38999),U=f(96153),V=function(){function Z(w){this.httpServer=w}return Z.prototype.getComputes=function(w){return this.httpServer.get(w,"/computes")},Z.prototype.getUploadPath=function(w,N,b){return w.protocol+"//"+w.host+":"+w.port+"/v2/"+N+"/images/"+b},Z.prototype.getStatistics=function(w){return this.httpServer.get(w,"/statistics")},Z.\u0275fac=function(N){return new(N||Z)(B.LFG(U.wh))},Z.\u0275prov=B.Yz7({token:Z,factory:Z.\u0275fac}),Z}()},96153:function(ue,q,f){"use strict";f.d(q,{gc:function(){return b},wh:function(){return _}});var B=f(61855),U=f(38999),V=f(11363),Z=f(13426),w=f(75472),N=function(I){function D(A){return I.call(this,A)||this}return(0,B.ZT)(D,I),D.fromError=function(A,S){var v=new D(A);return v.originalError=S,v},D}(Error),b=function(){function I(){}return I.prototype.handleError=function(D){var A=D;return"HttpErrorResponse"===D.name&&0===D.status&&(A=N.fromError("Server is unreachable",D)),(0,V._)(A)},I.\u0275prov=U.Yz7({token:I,factory:I.\u0275fac=function(A){return new(A||I)}}),I}(),_=function(){function I(D,A){this.http=D,this.errorHandler=A,this.requestsNotificationEmitter=new U.vpe}return I.prototype.get=function(D,A,S){S=this.getJsonOptions(S);var v=this.getOptionsForServer(D,A,S);return this.requestsNotificationEmitter.emit("GET "+v.url),this.http.get(v.url,v.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.getText=function(D,A,S){S=this.getTextOptions(S);var v=this.getOptionsForServer(D,A,S);return this.requestsNotificationEmitter.emit("GET "+v.url),this.http.get(v.url,v.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.post=function(D,A,S,v){v=this.getJsonOptions(v);var g=this.getOptionsForServer(D,A,v);return this.requestsNotificationEmitter.emit("POST "+g.url),this.http.post(g.url,S,g.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.put=function(D,A,S,v){v=this.getJsonOptions(v);var g=this.getOptionsForServer(D,A,v);return this.requestsNotificationEmitter.emit("PUT "+g.url),this.http.put(g.url,S,g.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.delete=function(D,A,S){S=this.getJsonOptions(S);var v=this.getOptionsForServer(D,A,S);return this.requestsNotificationEmitter.emit("DELETE "+v.url),this.http.delete(v.url,v.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.patch=function(D,A,S,v){v=this.getJsonOptions(v);var g=this.getOptionsForServer(D,A,v);return this.http.patch(g.url,S,g.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.head=function(D,A,S){S=this.getJsonOptions(S);var v=this.getOptionsForServer(D,A,S);return this.http.head(v.url,v.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.options=function(D,A,S){S=this.getJsonOptions(S);var v=this.getOptionsForServer(D,A,S);return this.http.options(v.url,v.options).pipe((0,Z.K)(this.errorHandler.handleError))},I.prototype.getJsonOptions=function(D){return D||{responseType:"json"}},I.prototype.getTextOptions=function(D){return D||{responseType:"text"}},I.prototype.getOptionsForServer=function(D,A,S){if(D.host&&D.port?(D.protocol||(D.protocol=location.protocol),A=D.protocol+"//"+D.host+":"+D.port+"/v2"+A):A="/v2"+A,S.headers||(S.headers={}),"basic"===D.authorization){var v=btoa(D.login+":"+D.password);S.headers.Authorization="Basic "+v}return{url:A,options:S}},I.\u0275fac=function(A){return new(A||I)(U.LFG(w.eN),U.LFG(b))},I.\u0275prov=U.Yz7({token:I,factory:I.\u0275fac}),I}()},14200:function(ue,q,f){"use strict";f.d(q,{Y:function(){return N}});var B=f(68707),U=f(38999),V=f(96153),Z=f(10503),w=f(2094),N=function(){function b(_,I,D){this.httpServer=_,this.settingsService=I,this.recentlyOpenedProjectService=D,this.projectListSubject=new B.xQ}return b.prototype.projectListUpdated=function(){this.projectListSubject.next(!0)},b.prototype.get=function(_,I){return this.httpServer.get(_,"/projects/"+I)},b.prototype.open=function(_,I){return this.httpServer.post(_,"/projects/"+I+"/open",{})},b.prototype.close=function(_,I){return this.recentlyOpenedProjectService.removeData(),this.httpServer.post(_,"/projects/"+I+"/close",{})},b.prototype.list=function(_){return this.httpServer.get(_,"/projects")},b.prototype.nodes=function(_,I){return this.httpServer.get(_,"/projects/"+I+"/nodes")},b.prototype.links=function(_,I){return this.httpServer.get(_,"/projects/"+I+"/links")},b.prototype.drawings=function(_,I){return this.httpServer.get(_,"/projects/"+I+"/drawings")},b.prototype.add=function(_,I,D){return this.httpServer.post(_,"/projects",{name:I,project_id:D})},b.prototype.update=function(_,I){return this.httpServer.put(_,"/projects/"+I.project_id,{auto_close:I.auto_close,auto_open:I.auto_open,auto_start:I.auto_start,drawing_grid_size:I.drawing_grid_size,grid_size:I.grid_size,name:I.name,scene_width:I.scene_width,scene_height:I.scene_height,show_interface_labels:I.show_interface_labels})},b.prototype.delete=function(_,I){return this.httpServer.delete(_,"/projects/"+I)},b.prototype.getUploadPath=function(_,I,D){return _.protocol+"//"+_.host+":"+_.port+"/v2/projects/"+I+"/import?name="+D},b.prototype.getExportPath=function(_,I){return _.protocol+"//"+_.host+":"+_.port+"/v2/projects/"+I.project_id+"/export"},b.prototype.export=function(_,I){return this.httpServer.get(_,"/projects/"+I+"/export")},b.prototype.getStatistics=function(_,I){return this.httpServer.get(_,"/projects/"+I+"/stats")},b.prototype.duplicate=function(_,I,D){return this.httpServer.post(_,"/projects/"+I+"/duplicate",{name:D})},b.prototype.isReadOnly=function(_){return!!_.readonly&&_.readonly},b.\u0275fac=function(I){return new(I||b)(U.LFG(V.wh),U.LFG(Z.g),U.LFG(w.p))},b.\u0275prov=U.Yz7({token:b,factory:b.\u0275fac}),b}()},2094:function(ue,q,f){"use strict";f.d(q,{p:function(){return U}});var B=f(38999),U=function(){function V(){}return V.prototype.setServerId=function(Z){this.serverId=Z},V.prototype.setProjectId=function(Z){this.projectId=Z},V.prototype.setServerIdProjectList=function(Z){this.serverIdProjectList=Z},V.prototype.getServerId=function(){return this.serverId},V.prototype.getProjectId=function(){return this.projectId},V.prototype.getServerIdProjectList=function(){return this.serverIdProjectList},V.prototype.removeData=function(){this.serverId="",this.projectId=""},V.\u0275prov=B.Yz7({token:V,factory:V.\u0275fac=function(w){return new(w||V)}}),V}()},10503:function(ue,q,f){"use strict";f.d(q,{g:function(){return U}});var B=f(38999),U=function(){function V(){this.settings={crash_reports:!0,console_command:void 0,anonymous_statistics:!0},this.reportsSettings="crash_reports",this.consoleSettings="console_command",this.statisticsSettings="statistics_command",this.getItem(this.reportsSettings)&&(this.settings.crash_reports="true"===this.getItem(this.reportsSettings)),this.getItem(this.consoleSettings)&&(this.settings.console_command=this.getItem(this.consoleSettings)),this.getItem(this.statisticsSettings)&&(this.settings.anonymous_statistics="true"===this.getItem(this.statisticsSettings))}return V.prototype.setReportsSettings=function(Z){this.settings.crash_reports=Z,this.removeItem(this.reportsSettings),this.setItem(this.reportsSettings,Z?"true":"false")},V.prototype.setStatisticsSettings=function(Z){this.settings.anonymous_statistics=Z,this.removeItem(this.statisticsSettings),this.setItem(this.statisticsSettings,Z?"true":"false")},V.prototype.getReportsSettings=function(){return"true"===this.getItem(this.reportsSettings)},V.prototype.getStatisticsSettings=function(){return"true"===this.getItem(this.statisticsSettings)},V.prototype.setConsoleSettings=function(Z){this.settings.console_command=Z,this.removeItem(this.consoleSettings),this.setItem(this.consoleSettings,Z)},V.prototype.getConsoleSettings=function(){return this.getItem(this.consoleSettings)},V.prototype.removeItem=function(Z){localStorage.removeItem(Z)},V.prototype.setItem=function(Z,w){localStorage.setItem(Z,w)},V.prototype.getItem=function(Z){return localStorage.getItem(Z)},V.prototype.getAll=function(){return this.settings},V.prototype.setAll=function(Z){this.settings=Z,this.setConsoleSettings(Z.console_command),this.setReportsSettings(Z.crash_reports),this.setStatisticsSettings(Z.anonymous_statistics)},V.\u0275prov=B.Yz7({token:V,factory:V.\u0275fac=function(w){return new(w||V)},providedIn:"root"}),V}()},15132:function(ue,q,f){"use strict";f.d(q,{f:function(){return V}});var B=f(38999),U=f(90838),V=function(){function Z(){this._darkMode$=new U.X(!1),this.darkMode$=this._darkMode$.asObservable(),this.themeChanged=new B.vpe,this.savedTheme="dark",localStorage.getItem("theme")||localStorage.setItem("theme","dark"),this.savedTheme=localStorage.getItem("theme")}return Z.prototype.getActualTheme=function(){return this.savedTheme},Z.prototype.setDarkMode=function(w){w?(this.savedTheme="dark",this.themeChanged.emit("dark-theme"),localStorage.setItem("theme","dark")):(this.savedTheme="light",this.themeChanged.emit("light-theme"),localStorage.setItem("theme","light"))},Z.\u0275prov=B.Yz7({token:Z,factory:Z.\u0275fac=function(N){return new(N||Z)},providedIn:"root"}),Z}()},79130:function(ue,q,f){"use strict";var B={};f.r(B),f.d(B,{active:function(){return SY},arc:function(){return jte},area:function(){return gH},areaRadial:function(){return CH},ascending:function(){return Af},axisBottom:function(){return hR},axisLeft:function(){return Mk},axisRight:function(){return fR},axisTop:function(){return kk},bisect:function(){return Of},bisectLeft:function(){return QC},bisectRight:function(){return $3},bisector:function(){return Df},brush:function(){return PY},brushSelection:function(){return AY},brushX:function(){return DY},brushY:function(){return OY},chord:function(){return RY},clientPoint:function(){return Zf},cluster:function(){return GK},color:function(){return Bs},contourDensity:function(){return sJ},contours:function(){return A8},create:function(){return as},creator:function(){return __},cross:function(){return eR},csvFormat:function(){return vJ},csvFormatRows:function(){return gJ},csvParse:function(){return hJ},csvParseRows:function(){return mJ},cubehelix:function(){return W},curveBasis:function(){return une},curveBasisClosed:function(){return cne},curveBasisOpen:function(){return dne},curveBundle:function(){return pne},curveCardinal:function(){return fne},curveCardinalClosed:function(){return hne},curveCardinalOpen:function(){return mne},curveCatmullRom:function(){return vne},curveCatmullRomClosed:function(){return gne},curveCatmullRomOpen:function(){return _ne},curveLinear:function(){return AA},curveLinearClosed:function(){return yne},curveMonotoneX:function(){return bne},curveMonotoneY:function(){return Cne},curveNatural:function(){return Sne},curveStep:function(){return Tne},curveStepAfter:function(){return wne},curveStepBefore:function(){return xne},customEvent:function(){return Rf},descending:function(){return A4},deviation:function(){return tR},dispatch:function(){return Cm},drag:function(){return Vf},dragDisable:function(){return Em},dragEnable:function(){return A_},dsvFormat:function(){return ZN},easeBack:function(){return B8},easeBackIn:function(){return qJ},easeBackInOut:function(){return B8},easeBackOut:function(){return jJ},easeBounce:function(){return P1},easeBounceIn:function(){return HJ},easeBounceInOut:function(){return VJ},easeBounceOut:function(){return P1},easeCircle:function(){return F8},easeCircleIn:function(){return OJ},easeCircleInOut:function(){return F8},easeCircleOut:function(){return PJ},easeCubic:function(){return bN},easeCubicIn:function(){return gY},easeCubicInOut:function(){return bN},easeCubicOut:function(){return _Y},easeElastic:function(){return U8},easeElasticIn:function(){return zJ},easeElasticInOut:function(){return WJ},easeElasticOut:function(){return U8},easeExp:function(){return L8},easeExpIn:function(){return AJ},easeExpInOut:function(){return L8},easeExpOut:function(){return DJ},easeLinear:function(){return SJ},easePoly:function(){return I8},easePolyIn:function(){return wJ},easePolyInOut:function(){return I8},easePolyOut:function(){return EJ},easeQuad:function(){return P8},easeQuadIn:function(){return TJ},easeQuadInOut:function(){return P8},easeQuadOut:function(){return xJ},easeSin:function(){return Z8},easeSinIn:function(){return kJ},easeSinInOut:function(){return Z8},easeSinOut:function(){return MJ},entries:function(){return JY},event:function(){return On},extent:function(){return KC},forceCenter:function(){return GJ},forceCollide:function(){return pQ},forceLink:function(){return hQ},forceManyBody:function(){return bQ},forceRadial:function(){return CQ},forceSimulation:function(){return yQ},forceX:function(){return SQ},forceY:function(){return TQ},format:function(){return EM},formatDefaultLocale:function(){return Q8},formatLocale:function(){return J8},formatPrefix:function(){return jN},formatSpecifier:function(){return I1},geoAlbers:function(){return p9},geoAlbersUsa:function(){return kK},geoArea:function(){return PQ},geoAzimuthalEqualArea:function(){return MK},geoAzimuthalEqualAreaRaw:function(){return M6},geoAzimuthalEquidistant:function(){return AK},geoAzimuthalEquidistantRaw:function(){return A6},geoBounds:function(){return ZQ},geoCentroid:function(){return VQ},geoCircle:function(){return qQ},geoClipAntimeridian:function(){return s6},geoClipCircle:function(){return R7},geoClipExtent:function(){return QQ},geoClipRectangle:function(){return JM},geoConicConformal:function(){return OK},geoConicConformalRaw:function(){return m9},geoConicEqualArea:function(){return aA},geoConicEqualAreaRaw:function(){return d9},geoConicEquidistant:function(){return IK},geoConicEquidistantRaw:function(){return v9},geoContains:function(){return rK},geoDistance:function(){return B1},geoEquirectangular:function(){return PK},geoEquirectangularRaw:function(){return Y1},geoGnomonic:function(){return RK},geoGnomonicRaw:function(){return D6},geoGraticule:function(){return j7},geoGraticule10:function(){return iK},geoIdentity:function(){return NK},geoInterpolate:function(){return oK},geoLength:function(){return N7},geoMercator:function(){return DK},geoMercatorRaw:function(){return G1},geoNaturalEarth1:function(){return ZK},geoNaturalEarth1Raw:function(){return O6},geoOrthographic:function(){return LK},geoOrthographicRaw:function(){return P6},geoPath:function(){return gK},geoProjection:function(){return fp},geoProjectionMutator:function(){return E6},geoRotation:function(){return E7},geoStereographic:function(){return FK},geoStereographicRaw:function(){return I6},geoStream:function(){return nc},geoTransform:function(){return _K},geoTransverseMercator:function(){return BK},geoTransverseMercatorRaw:function(){return R6},hcl:function(){return S1},hierarchy:function(){return N6},histogram:function(){return bk},hsl:function(){return Om},interpolate:function(){return sl},interpolateArray:function(){return Di},interpolateBasis:function(){return Pe},interpolateBasisClosed:function(){return Xe},interpolateBlues:function(){return ste},interpolateBrBG:function(){return Uee},interpolateBuGn:function(){return Jee},interpolateBuPu:function(){return Qee},interpolateCool:function(){return mte},interpolateCubehelix:function(){return _G},interpolateCubehelixDefault:function(){return fte},interpolateCubehelixLong:function(){return iM},interpolateDate:function(){return _o},interpolateGnBu:function(){return Kee},interpolateGreens:function(){return lte},interpolateGreys:function(){return ute},interpolateHcl:function(){return vG},interpolateHclLong:function(){return gG},interpolateHsl:function(){return fG},interpolateHslLong:function(){return hG},interpolateInferno:function(){return yte},interpolateLab:function(){return mG},interpolateMagma:function(){return _te},interpolateNumber:function(){return Ni},interpolateObject:function(){return la},interpolateOrRd:function(){return Xee},interpolateOranges:function(){return pte},interpolatePRGn:function(){return Hee},interpolatePiYG:function(){return Vee},interpolatePlasma:function(){return bte},interpolatePuBu:function(){return ete},interpolatePuBuGn:function(){return $ee},interpolatePuOr:function(){return qee},interpolatePuRd:function(){return tte},interpolatePurples:function(){return cte},interpolateRainbow:function(){return vte},interpolateRdBu:function(){return jee},interpolateRdGy:function(){return zee},interpolateRdPu:function(){return nte},interpolateRdYlBu:function(){return Wee},interpolateRdYlGn:function(){return Gee},interpolateReds:function(){return dte},interpolateRgb:function(){return _n},interpolateRgbBasis:function(){return Lr},interpolateRgbBasisClosed:function(){return ei},interpolateRound:function(){return lp},interpolateSpectral:function(){return Yee},interpolateString:function(){return jl},interpolateTransformCss:function(){return x1},interpolateTransformSvg:function(){return rM},interpolateViridis:function(){return gte},interpolateWarm:function(){return hte},interpolateYlGn:function(){return ite},interpolateYlGnBu:function(){return rte},interpolateYlOrBr:function(){return ote},interpolateYlOrRd:function(){return ate},interpolateZoom:function(){return t8},interrupt:function(){return Um},interval:function(){return Nne},isoFormat:function(){return See},isoParse:function(){return wee},keys:function(){return GY},lab:function(){return C1},line:function(){return DA},lineRadial:function(){return bH},linkHorizontal:function(){return $te},linkRadial:function(){return tne},linkVertical:function(){return ene},local:function(){return wm},map:function(){return Hf},matcher:function(){return i1},max:function(){return e1},mean:function(){return oR},median:function(){return aR},merge:function(){return vm},min:function(){return t1},mouse:function(){return Fs},namespace:function(){return If},namespaces:function(){return g_},nest:function(){return qY},now:function(){return P_},pack:function(){return _X},packEnclose:function(){return _9},packSiblings:function(){return mX},pairs:function(){return M4},partition:function(){return yX},path:function(){return tc},permute:function(){return Sk},pie:function(){return Gte},pointRadial:function(){return pS},polygonArea:function(){return RX},polygonCentroid:function(){return NX},polygonContains:function(){return BX},polygonHull:function(){return FX},polygonLength:function(){return UX},precisionFixed:function(){return K8},precisionPrefix:function(){return X8},precisionRound:function(){return $8},quadtree:function(){return TM},quantile:function(){return Pf},quantize:function(){return yG},radialArea:function(){return CH},radialLine:function(){return bH},randomBates:function(){return qX},randomExponential:function(){return jX},randomIrwinHall:function(){return N9},randomLogNormal:function(){return VX},randomNormal:function(){return R9},randomUniform:function(){return HX},range:function(){return is},rgb:function(){return Dm},ribbon:function(){return VY},scaleBand:function(){return q6},scaleIdentity:function(){return H9},scaleImplicit:function(){return H6},scaleLinear:function(){return U9},scaleLog:function(){return W9},scaleOrdinal:function(){return V6},scalePoint:function(){return zX},scalePow:function(){return W6},scaleQuantile:function(){return G9},scaleQuantize:function(){return Y9},scaleSequential:function(){return UU},scaleSqrt:function(){return e$},scaleThreshold:function(){return J9},scaleTime:function(){return Aee},scaleUtc:function(){return Dee},scan:function(){return n1},schemeAccent:function(){return Pee},schemeBlues:function(){return lH},schemeBrBG:function(){return HU},schemeBuGn:function(){return QU},schemeBuPu:function(){return KU},schemeCategory10:function(){return Oee},schemeDark2:function(){return Iee},schemeGnBu:function(){return XU},schemeGreens:function(){return uH},schemeGreys:function(){return cH},schemeOrRd:function(){return $U},schemeOranges:function(){return fH},schemePRGn:function(){return VU},schemePaired:function(){return Ree},schemePastel1:function(){return Nee},schemePastel2:function(){return Zee},schemePiYG:function(){return qU},schemePuBu:function(){return tH},schemePuBuGn:function(){return eH},schemePuOr:function(){return jU},schemePuRd:function(){return nH},schemePurples:function(){return dH},schemeRdBu:function(){return zU},schemeRdGy:function(){return WU},schemeRdPu:function(){return rH},schemeRdYlBu:function(){return GU},schemeRdYlGn:function(){return YU},schemeReds:function(){return pH},schemeSet1:function(){return Lee},schemeSet2:function(){return Fee},schemeSet3:function(){return Bee},schemeSpectral:function(){return JU},schemeYlGn:function(){return oH},schemeYlGnBu:function(){return iH},schemeYlOrBr:function(){return aH},schemeYlOrRd:function(){return sH},select:function(){return ni},selectAll:function(){return m1},selection:function(){return Hl},selector:function(){return Sm},selectorAll:function(){return Dk},set:function(){return WY},shuffle:function(){return sR},stack:function(){return kne},stackOffsetDiverging:function(){return Ane},stackOffsetExpand:function(){return Mne},stackOffsetNone:function(){return K_},stackOffsetSilhouette:function(){return Dne},stackOffsetWiggle:function(){return One},stackOrderAscending:function(){return jH},stackOrderDescending:function(){return Pne},stackOrderInsideOut:function(){return Ine},stackOrderNone:function(){return X_},stackOrderReverse:function(){return Rne},stratify:function(){return TX},style:function(){return op},sum:function(){return Bl},symbol:function(){return lne},symbolCircle:function(){return sZ},symbolCross:function(){return SH},symbolDiamond:function(){return xH},symbolSquare:function(){return kH},symbolStar:function(){return EH},symbolTriangle:function(){return MH},symbolWye:function(){return AH},symbols:function(){return sne},thresholdFreedmanDiaconis:function(){return iR},thresholdScott:function(){return Ck},thresholdSturges:function(){return mm},tickIncrement:function(){return hm},tickStep:function(){return ip},ticks:function(){return fm},timeDay:function(){return CA},timeDays:function(){return r$},timeFormat:function(){return K6},timeFormatDefaultLocale:function(){return LU},timeFormatLocale:function(){return wU},timeFriday:function(){return lU},timeFridays:function(){return l$},timeHour:function(){return iU},timeHours:function(){return n$},timeInterval:function(){return Ba},timeMillisecond:function(){return gA},timeMilliseconds:function(){return Q9},timeMinute:function(){return nU},timeMinutes:function(){return t$},timeMonday:function(){return $1},timeMondays:function(){return i$},timeMonth:function(){return pU},timeMonths:function(){return c$},timeParse:function(){return ZU},timeSaturday:function(){return uU},timeSaturdays:function(){return u$},timeSecond:function(){return bA},timeSeconds:function(){return eU},timeSunday:function(){return X1},timeSundays:function(){return cU},timeThursday:function(){return eS},timeThursdays:function(){return s$},timeTuesday:function(){return aU},timeTuesdays:function(){return o$},timeWednesday:function(){return sU},timeWednesdays:function(){return a$},timeWeek:function(){return X1},timeWeeks:function(){return cU},timeYear:function(){return Km},timeYears:function(){return d$},timeout:function(){return hN},timer:function(){return lM},timerFlush:function(){return s8},touch:function(){return M_},touches:function(){return $R},transition:function(){return pM},transpose:function(){return Tk},tree:function(){return AX},treemap:function(){return DX},treemapBinary:function(){return OX},treemapDice:function(){return Q1},treemapResquarify:function(){return IX},treemapSlice:function(){return fA},treemapSliceDice:function(){return PX},treemapSquarify:function(){return P9},tsvFormat:function(){return bJ},tsvFormatRows:function(){return CJ},tsvParse:function(){return _J},tsvParseRows:function(){return yJ},utcDay:function(){return SA},utcDays:function(){return h$},utcFormat:function(){return xA},utcFriday:function(){return bU},utcFridays:function(){return y$},utcHour:function(){return vU},utcHours:function(){return f$},utcMillisecond:function(){return gA},utcMilliseconds:function(){return Q9},utcMinute:function(){return hU},utcMinutes:function(){return p$},utcMonday:function(){return nS},utcMondays:function(){return m$},utcMonth:function(){return xU},utcMonths:function(){return C$},utcParse:function(){return X6},utcSaturday:function(){return CU},utcSaturdays:function(){return b$},utcSecond:function(){return bA},utcSeconds:function(){return eU},utcSunday:function(){return tS},utcSundays:function(){return SU},utcThursday:function(){return rS},utcThursdays:function(){return _$},utcTuesday:function(){return _U},utcTuesdays:function(){return v$},utcWednesday:function(){return yU},utcWednesdays:function(){return g$},utcWeek:function(){return tS},utcWeeks:function(){return SU},utcYear:function(){return $m},utcYears:function(){return S$},values:function(){return YY},variance:function(){return _k},voronoi:function(){return ere},window:function(){return l1},zip:function(){return lR},zoom:function(){return nV},zoomIdentity:function(){return BA},zoomTransform:function(){return eV}});var E,U=f(29176),V=f(42515),b=(f(28318),f(99890),f(99740),f(71955)),_=f(36683),I=f(13920),D=f(89200),A=f(10509),S=f(97154),v=f(62467),g=f(18967),T=f(14105);f(26552);"undefined"!=typeof window&&window,"undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self;"undefined"!=typeof global&&global,"_nghost-".concat("%COMP%"),"_ngcontent-".concat("%COMP%");var Gb=" \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff";"[^".concat(Gb,"]"),"[".concat(Gb,"]{2,}"),(0,V.Z)(E={},4,4),(0,V.Z)(E,1,1),(0,V.Z)(E,2,2),(0,V.Z)(E,0,0),(0,V.Z)(E,3,3),Object.keys({useClass:null}),Object.keys({useFactory:null}),Object.keys({useValue:null}),Object.keys({useExisting:null});var e=f(38999),kt=f(40098),Sa=f(28722),Xr=f(15427),Mn=f(78081),Ai=f(6517),Pn=f(68707),rs=f(5051),SE=f(57434),TE=f(58172),aa=f(89797),go=f(55371),Zr=f(44213),ra=f(57682),Er=f(85639),$i=f(48359),Ra=f(59371),Zs=f(34487),Na=f(8392);function CC(n,r,t){for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];o?n.setProperty(i,o,(null==t?void 0:t.has(i))?"important":""):n.removeProperty(i)}return n}function bf(n,r){var t=r?"":"none";CC(n.style,{"touch-action":r?"":"none","-webkit-user-drag":r?"":"none","-webkit-tap-highlight-color":r?"":"transparent","user-select":t,"-ms-user-select":t,"-webkit-user-select":t,"-moz-user-select":t})}function xE(n,r,t){CC(n.style,{position:r?"":"fixed",top:r?"":"0",opacity:r?"":"0",left:r?"":"-999em"},t)}function Jg(n,r){return r&&"none"!=r?n+" "+r:n}function h3(n){var r=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*r}function SC(n,r){return n.getPropertyValue(r).split(",").map(function(i){return i.trim()})}function TC(n){var r=n.getBoundingClientRect();return{top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}function xC(n,r,t){return t>=n.top&&t<=n.bottom&&r>=n.left&&r<=n.right}function nm(n,r,t){n.top+=r,n.bottom=n.top+n.height,n.left+=t,n.right=n.left+n.width}function EE(n,r,t,i){var C=n.width*r,P=n.height*r;return i>n.top-P&&in.left-C&&t=u._config.dragStartThreshold){var G=Date.now()>=u._dragStartTime+u._getDragStartDelay(p),Y=u._dropContainer;if(!G)return void u._endDragSequence(p);(!Y||!Y.isDragging()&&!Y.isReceiving())&&(p.preventDefault(),u._hasStartedDragging=!0,u._ngZone.run(function(){return u._startDragSequence(p)}))}},this._pointerUp=function(p){u._endDragSequence(p)},this.withRootElement(r).withParent(t.parentDragRef||null),this._parentPositions=new wC(i,a),s.registerDragItem(this)}return(0,T.Z)(n,[{key:"disabled",get:function(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)},set:function(t){var i=(0,Mn.Ig)(t);i!==this._disabled&&(this._disabled=i,this._toggleNativeDragInteractions(),this._handles.forEach(function(o){return bf(o,i)}))}},{key:"getPlaceholderElement",value:function(){return this._placeholder}},{key:"getRootElement",value:function(){return this._rootElement}},{key:"getVisibleElement",value:function(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}},{key:"withHandles",value:function(t){var i=this;this._handles=t.map(function(a){return(0,Mn.fI)(a)}),this._handles.forEach(function(a){return bf(a,i.disabled)}),this._toggleNativeDragInteractions();var o=new Set;return this._disabledHandles.forEach(function(a){i._handles.indexOf(a)>-1&&o.add(a)}),this._disabledHandles=o,this}},{key:"withPreviewTemplate",value:function(t){return this._previewTemplate=t,this}},{key:"withPlaceholderTemplate",value:function(t){return this._placeholderTemplate=t,this}},{key:"withRootElement",value:function(t){var i=this,o=(0,Mn.fI)(t);return o!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(function(){o.addEventListener("mousedown",i._pointerDown,AE),o.addEventListener("touchstart",i._pointerDown,Qg)}),this._initialTransform=void 0,this._rootElement=o),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}},{key:"withBoundaryElement",value:function(t){var i=this;return this._boundaryElement=t?(0,Mn.fI)(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(function(){return i._containInsideBoundaryOnResize()})),this}},{key:"withParent",value:function(t){return this._parentDragRef=t,this}},{key:"dispose",value:function(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&rm(this._rootElement),rm(this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}},{key:"isDragging",value:function(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}},{key:"reset",value:function(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}},{key:"disableHandle",value:function(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),bf(t,!0))}},{key:"enableHandle",value:function(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),bf(t,this.disabled))}},{key:"withDirection",value:function(t){return this._direction=t,this}},{key:"_withDropContainer",value:function(t){this._dropContainer=t}},{key:"getFreeDragPosition",value:function(){var t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}},{key:"setFreeDragPosition",value:function(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}},{key:"withPreviewContainer",value:function(t){return this._previewContainer=t,this}},{key:"_sortFromLastPointerPosition",value:function(){var t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}},{key:"_removeSubscriptions",value:function(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}},{key:"_destroyPreview",value:function(){this._preview&&rm(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}},{key:"_destroyPlaceholder",value:function(){this._placeholder&&rm(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}},{key:"_endDragSequence",value:function(t){var i=this;if(this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging))if(this.released.next({source:this}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(function(){i._cleanupDragArtifacts(t),i._cleanupCachedDimensions(),i._dragDropRegistry.stopDragging(i)});else{this._passiveTransform.x=this._activeTransform.x;var o=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(function(){i.ended.next({source:i,distance:i._getDragDistance(o),dropPoint:o})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}},{key:"_startDragSequence",value:function(t){Kd(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();var i=this._dropContainer;if(i){var o=this._rootElement,a=o.parentNode,s=this._placeholder=this._createPlaceholderElement(),u=this._anchor=this._anchor||this._document.createComment(""),p=this._getShadowRoot();a.insertBefore(u,o),this._initialTransform=o.style.transform||"",this._preview=this._createPreviewElement(),xE(o,!1,EC),this._document.body.appendChild(a.replaceChild(s,o)),this._getPreviewInsertionPoint(a,p).appendChild(this._preview),this.started.next({source:this}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}},{key:"_initializeDragSequence",value:function(t,i){var o=this;this._parentDragRef&&i.stopPropagation();var a=this.isDragging(),s=Kd(i),u=!s&&0!==i.button,p=this._rootElement,m=(0,Xr.sA)(i),C=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now(),P=s?(0,Ai.yG)(i):(0,Ai.X6)(i);if(m&&m.draggable&&"mousedown"===i.type&&i.preventDefault(),!(a||u||C||P)){this._handles.length&&(this._rootElementTapHighlight=p.style.webkitTapHighlightColor||"",p.style.webkitTapHighlightColor="transparent"),this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(function(Y){return o._updateOnScroll(Y)}),this._boundaryElement&&(this._boundaryRect=TC(this._boundaryElement));var L=this._previewTemplate;this._pickupPositionInElement=L&&L.template&&!L.matchSize?{x:0,y:0}:this._getPointerPositionInElement(t,i);var G=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(i);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:G.x,y:G.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,i)}}},{key:"_cleanupDragArtifacts",value:function(t){var i=this;xE(this._rootElement,!0,EC),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(function(){var o=i._dropContainer,a=o.getItemIndex(i),s=i._getPointerPositionOnPage(t),u=i._getDragDistance(s),p=o._isOverContainer(s.x,s.y);i.ended.next({source:i,distance:u,dropPoint:s}),i.dropped.next({item:i,currentIndex:a,previousIndex:i._initialIndex,container:o,previousContainer:i._initialContainer,isPointerOverContainer:p,distance:u,dropPoint:s}),o.drop(i,a,i._initialIndex,i._initialContainer,p,u,s),i._dropContainer=i._initialContainer})}},{key:"_updateActiveDropContainer",value:function(t,i){var o=this,a=t.x,s=t.y,u=i.x,p=i.y,m=this._initialContainer._getSiblingContainerFromPosition(this,a,s);!m&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(a,s)&&(m=this._initialContainer),m&&m!==this._dropContainer&&this._ngZone.run(function(){o.exited.next({item:o,container:o._dropContainer}),o._dropContainer.exit(o),o._dropContainer=m,o._dropContainer.enter(o,a,s,m===o._initialContainer&&m.sortingDisabled?o._initialIndex:void 0),o.entered.next({item:o,container:m,currentIndex:m.getItemIndex(o)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(u,p),this._dropContainer._sortItem(this,a,s,this._pointerDirectionDelta),this._applyPreviewTransform(a-this._pickupPositionInElement.x,s-this._pickupPositionInElement.y))}},{key:"_createPreviewElement",value:function(){var a,t=this._previewTemplate,i=this.previewClass,o=t?t.template:null;if(o&&t){var s=t.matchSize?this._rootElement.getBoundingClientRect():null,u=t.viewContainer.createEmbeddedView(o,t.context);u.detectChanges(),a=OE(u,this._document),this._previewRef=u,t.matchSize?Xd(a,s):a.style.transform=Kg(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{var p=this._rootElement;Xd(a=kE(p),p.getBoundingClientRect()),this._initialTransform&&(a.style.transform=this._initialTransform)}return CC(a.style,{"pointer-events":"none",margin:"0",position:"fixed",top:"0",left:"0","z-index":"".concat(this._config.zIndex||1e3)},EC),bf(a,!1),a.classList.add("cdk-drag-preview"),a.setAttribute("dir",this._direction),i&&(Array.isArray(i)?i.forEach(function(m){return a.classList.add(m)}):a.classList.add(i)),a}},{key:"_animatePreviewToPlaceholder",value:function(){var t=this;if(!this._hasMoved)return Promise.resolve();var i=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._applyPreviewTransform(i.left,i.top);var o=function(n){var r=getComputedStyle(n),t=SC(r,"transition-property"),i=t.find(function(u){return"transform"===u||"all"===u});if(!i)return 0;var o=t.indexOf(i),a=SC(r,"transition-duration"),s=SC(r,"transition-delay");return h3(a[o])+h3(s[o])}(this._preview);return 0===o?Promise.resolve():this._ngZone.runOutsideAngular(function(){return new Promise(function(a){var s=function p(m){var C;(!m||(0,Xr.sA)(m)===t._preview&&"transform"===m.propertyName)&&(null===(C=t._preview)||void 0===C||C.removeEventListener("transitionend",p),a(),clearTimeout(u))},u=setTimeout(s,1.5*o);t._preview.addEventListener("transitionend",s)})})}},{key:"_createPlaceholderElement",value:function(){var o,t=this._placeholderTemplate,i=t?t.template:null;return i?(this._placeholderRef=t.viewContainer.createEmbeddedView(i,t.context),this._placeholderRef.detectChanges(),o=OE(this._placeholderRef,this._document)):o=kE(this._rootElement),o.classList.add("cdk-drag-placeholder"),o}},{key:"_getPointerPositionInElement",value:function(t,i){var o=this._rootElement.getBoundingClientRect(),a=t===this._rootElement?null:t,s=a?a.getBoundingClientRect():o,u=Kd(i)?i.targetTouches[0]:i,p=this._getViewportScrollPosition();return{x:s.left-o.left+(u.pageX-s.left-p.left),y:s.top-o.top+(u.pageY-s.top-p.top)}}},{key:"_getPointerPositionOnPage",value:function(t){var i=this._getViewportScrollPosition(),o=Kd(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,a=o.pageX-i.left,s=o.pageY-i.top;if(this._ownerSVGElement){var u=this._ownerSVGElement.getScreenCTM();if(u){var p=this._ownerSVGElement.createSVGPoint();return p.x=a,p.y=s,p.matrixTransform(u.inverse())}}return{x:a,y:s}}},{key:"_getConstrainedPointerPosition",value:function(t){var i=this._dropContainer?this._dropContainer.lockAxis:null,o=this.constrainPosition?this.constrainPosition(t,this):t,a=o.x,s=o.y;if("x"===this.lockAxis||"x"===i?s=this._pickupPositionOnPage.y:("y"===this.lockAxis||"y"===i)&&(a=this._pickupPositionOnPage.x),this._boundaryRect){var u=this._pickupPositionInElement,p=u.x,m=u.y,C=this._boundaryRect,P=this._previewRect,L=C.top+m,G=C.bottom-(P.height-m);a=DE(a,C.left+p,C.right-(P.width-p)),s=DE(s,L,G)}return{x:a,y:s}}},{key:"_updatePointerDirectionDelta",value:function(t){var i=t.x,o=t.y,a=this._pointerDirectionDelta,s=this._pointerPositionAtLastDirectionChange,u=Math.abs(i-s.x),p=Math.abs(o-s.y);return u>this._config.pointerDirectionChangeThreshold&&(a.x=i>s.x?1:-1,s.x=i),p>this._config.pointerDirectionChangeThreshold&&(a.y=o>s.y?1:-1,s.y=o),a}},{key:"_toggleNativeDragInteractions",value:function(){if(this._rootElement&&this._handles){var t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,bf(this._rootElement,t))}}},{key:"_removeRootElementListeners",value:function(t){t.removeEventListener("mousedown",this._pointerDown,AE),t.removeEventListener("touchstart",this._pointerDown,Qg)}},{key:"_applyRootElementTransform",value:function(t,i){var o=Kg(t,i);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform&&"none"!=this._rootElement.style.transform?this._rootElement.style.transform:""),this._rootElement.style.transform=Jg(o,this._initialTransform)}},{key:"_applyPreviewTransform",value:function(t,i){var o,a=(null===(o=this._previewTemplate)||void 0===o?void 0:o.template)?void 0:this._initialTransform,s=Kg(t,i);this._preview.style.transform=Jg(s,a)}},{key:"_getDragDistance",value:function(t){var i=this._pickupPositionOnPage;return i?{x:t.x-i.x,y:t.y-i.y}:{x:0,y:0}}},{key:"_cleanupCachedDimensions",value:function(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}},{key:"_containInsideBoundaryOnResize",value:function(){var t=this._passiveTransform,i=t.x,o=t.y;if(!(0===i&&0===o||this.isDragging())&&this._boundaryElement){var a=this._boundaryElement.getBoundingClientRect(),s=this._rootElement.getBoundingClientRect();if(!(0===a.width&&0===a.height||0===s.width&&0===s.height)){var u=a.left-s.left,p=s.right-a.right,m=a.top-s.top,C=s.bottom-a.bottom;a.width>s.width?(u>0&&(i+=u),p>0&&(i-=p)):i=0,a.height>s.height?(m>0&&(o+=m),C>0&&(o-=C)):o=0,(i!==this._passiveTransform.x||o!==this._passiveTransform.y)&&this.setFreeDragPosition({y:o,x:i})}}}},{key:"_getDragStartDelay",value:function(t){var i=this.dragStartDelay;return"number"==typeof i?i:Kd(t)?i.touch:i?i.mouse:0}},{key:"_updateOnScroll",value:function(t){var i=this._parentPositions.handleScroll(t);if(i){var o=(0,Xr.sA)(t);this._boundaryRect&&(o===this._document||o!==this._boundaryElement&&o.contains(this._boundaryElement))&&nm(this._boundaryRect,i.top,i.left),this._pickupPositionOnPage.x+=i.left,this._pickupPositionOnPage.y+=i.top,this._dropContainer||(this._activeTransform.x-=i.left,this._activeTransform.y-=i.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}},{key:"_getViewportScrollPosition",value:function(){var t=this._parentPositions.positions.get(this._document);return t?t.scrollPosition:this._viewportRuler.getViewportScrollPosition()}},{key:"_getShadowRoot",value:function(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=(0,Xr.kV)(this._rootElement)),this._cachedShadowRoot}},{key:"_getPreviewInsertionPoint",value:function(t,i){var o=this._previewContainer||"global";if("parent"===o)return t;if("global"===o){var a=this._document;return i||a.fullscreenElement||a.webkitFullscreenElement||a.mozFullScreenElement||a.msFullscreenElement||a.body}return(0,Mn.fI)(o)}}]),n}();function Kg(n,r){return"translate3d(".concat(Math.round(n),"px, ").concat(Math.round(r),"px, 0)")}function DE(n,r,t){return Math.max(r,Math.min(t,n))}function rm(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function Kd(n){return"t"===n.type[0]}function OE(n,r){var t=n.rootNodes;if(1===t.length&&t[0].nodeType===r.ELEMENT_NODE)return t[0];var i=r.createElement("div");return t.forEach(function(o){return i.appendChild(o)}),i}function Xd(n,r){n.style.width="".concat(r.width,"px"),n.style.height="".concat(r.height,"px"),n.style.transform=Kg(r.left,r.top)}function $d(n,r){return Math.max(0,Math.min(r,n))}var IE=function(){function n(r,t,i,o,a){var s=this;(0,g.Z)(this,n),this._dragDropRegistry=t,this._ngZone=o,this._viewportRuler=a,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=function(){return!0},this.sortPredicate=function(){return!0},this.beforeStarted=new Pn.xQ,this.entered=new Pn.xQ,this.exited=new Pn.xQ,this.dropped=new Pn.xQ,this.sorted=new Pn.xQ,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._draggables=[],this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=rs.w.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new Pn.xQ,this._cachedShadowRoot=null,this._startScrollInterval=function(){s._stopScrolling(),(0,SE.F)(0,TE.Z).pipe((0,Zr.R)(s._stopScrollTimers)).subscribe(function(){var u=s._scrollNode,p=s.autoScrollStep;1===s._verticalScrollDirection?RE(u,-p):2===s._verticalScrollDirection&&RE(u,p),1===s._horizontalScrollDirection?NE(u,-p):2===s._horizontalScrollDirection&&NE(u,p)})},this.element=(0,Mn.fI)(r),this._document=i,this.withScrollableParents([this.element]),t.registerDropContainer(this),this._parentPositions=new wC(i,a)}return(0,T.Z)(n,[{key:"dispose",value:function(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}},{key:"isDragging",value:function(){return this._isDragging}},{key:"start",value:function(){this._draggingStarted(),this._notifyReceivingSiblings()}},{key:"enter",value:function(t,i,o,a){var s;this._draggingStarted(),null==a?-1===(s=this.sortingDisabled?this._draggables.indexOf(t):-1)&&(s=this._getItemIndexFromPointerPosition(t,i,o)):s=a;var u=this._activeDraggables,p=u.indexOf(t),m=t.getPlaceholderElement(),C=u[s];if(C===t&&(C=u[s+1]),p>-1&&u.splice(p,1),C&&!this._dragDropRegistry.isDragging(C)){var P=C.getRootElement();P.parentElement.insertBefore(m,P),u.splice(s,0,t)}else if(this._shouldEnterAsFirstChild(i,o)){var L=u[0].getRootElement();L.parentNode.insertBefore(m,L),u.unshift(t)}else(0,Mn.fI)(this.element).appendChild(m),u.push(t);m.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}},{key:"exit",value:function(t){this._reset(),this.exited.next({item:t,container:this})}},{key:"drop",value:function(t,i,o,a,s,u,p){this._reset(),this.dropped.next({item:t,currentIndex:i,previousIndex:o,container:this,previousContainer:a,isPointerOverContainer:s,distance:u,dropPoint:p})}},{key:"withItems",value:function(t){var i=this,o=this._draggables;return this._draggables=t,t.forEach(function(s){return s._withDropContainer(i)}),this.isDragging()&&(o.filter(function(s){return s.isDragging()}).every(function(s){return-1===t.indexOf(s)})?this._reset():this._cacheItems()),this}},{key:"withDirection",value:function(t){return this._direction=t,this}},{key:"connectedTo",value:function(t){return this._siblings=t.slice(),this}},{key:"withOrientation",value:function(t){return this._orientation=t,this}},{key:"withScrollableParents",value:function(t){var i=(0,Mn.fI)(this.element);return this._scrollableElements=-1===t.indexOf(i)?[i].concat((0,v.Z)(t)):t.slice(),this}},{key:"getScrollableParents",value:function(){return this._scrollableElements}},{key:"getItemIndex",value:function(t){return this._isDragging?Xg("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,function(o){return o.drag===t}):this._draggables.indexOf(t)}},{key:"isReceiving",value:function(){return this._activeSiblings.size>0}},{key:"_sortItem",value:function(t,i,o,a){if(!this.sortingDisabled&&this._clientRect&&EE(this._clientRect,.05,i,o)){var s=this._itemPositions,u=this._getItemIndexFromPointerPosition(t,i,o,a);if(!(-1===u&&s.length>0)){var p="horizontal"===this._orientation,m=Xg(s,function(Me){return Me.drag===t}),C=s[u],L=C.clientRect,G=m>u?1:-1,Y=this._getItemOffsetPx(s[m].clientRect,L,G),te=this._getSiblingOffsetPx(m,s,G),de=s.slice();(function(n,r,t){var i=$d(r,n.length-1),o=$d(t,n.length-1);if(i!==o){for(var a=n[i],s=o0&&(s=1):n.scrollHeight-p>n.clientHeight&&(s=2)}if(a){var m=n.scrollLeft;1===a?m>0&&(u=1):n.scrollWidth-m>n.clientWidth&&(u=2)}return[s,u]}(G,L.clientRect,t,i),te=(0,b.Z)(Y,2);u=te[1],((s=te[0])||u)&&(a=G)}}),!s&&!u){var p=this._viewportRuler.getViewportSize(),m=p.width,C=p.height,P={width:m,height:C,top:0,right:m,bottom:C,left:0};s=ZE(P,i),u=MC(P,t),a=window}a&&(s!==this._verticalScrollDirection||u!==this._horizontalScrollDirection||a!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=u,this._scrollNode=a,(s||u)&&a?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}}},{key:"_stopScrolling",value:function(){this._stopScrollTimers.next()}},{key:"_draggingStarted",value:function(){var t=(0,Mn.fI)(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}},{key:"_cacheParentPositions",value:function(){var t=(0,Mn.fI)(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(t).clientRect}},{key:"_cacheItemPositions",value:function(){var t="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(function(i){var o=i.getVisibleElement();return{drag:i,offset:0,initialTransform:o.style.transform||"",clientRect:TC(o)}}).sort(function(i,o){return t?i.clientRect.left-o.clientRect.left:i.clientRect.top-o.clientRect.top})}},{key:"_reset",value:function(){var t=this;this._isDragging=!1;var i=(0,Mn.fI)(this.element).style;i.scrollSnapType=i.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(function(o){var a,s=o.getRootElement();if(s){var u=null===(a=t._itemPositions.find(function(p){return p.drag===o}))||void 0===a?void 0:a.initialTransform;s.style.transform=u||""}}),this._siblings.forEach(function(o){return o._stopReceiving(t)}),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1,this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}},{key:"_getSiblingOffsetPx",value:function(t,i,o){var a="horizontal"===this._orientation,s=i[t].clientRect,u=i[t+-1*o],p=s[a?"width":"height"]*o;if(u){var m=a?"left":"top",C=a?"right":"bottom";-1===o?p-=u.clientRect[m]-s[C]:p+=s[m]-u.clientRect[C]}return p}},{key:"_getItemOffsetPx",value:function(t,i,o){var a="horizontal"===this._orientation,s=a?i.left-t.left:i.top-t.top;return-1===o&&(s+=a?i.width-t.width:i.height-t.height),s}},{key:"_shouldEnterAsFirstChild",value:function(t,i){if(!this._activeDraggables.length)return!1;var o=this._itemPositions,a="horizontal"===this._orientation;if(o[0].drag!==this._activeDraggables[0]){var u=o[o.length-1].clientRect;return a?t>=u.right:i>=u.bottom}var p=o[0].clientRect;return a?t<=p.left:i<=p.top}},{key:"_getItemIndexFromPointerPosition",value:function(t,i,o,a){var s=this,u="horizontal"===this._orientation,p=Xg(this._itemPositions,function(m,C,P){var L=m.drag,G=m.clientRect;return L===t?P.length<2:(!a||L!==s._previousSwap.drag||!s._previousSwap.overlaps||(u?a.x:a.y)!==s._previousSwap.delta)&&(u?i>=Math.floor(G.left)&&i=Math.floor(G.top)&&o-1})&&(a.add(t),this._cacheParentPositions(),this._listenToScrollEvents())}},{key:"_stopReceiving",value:function(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe()}},{key:"_listenToScrollEvents",value:function(){var t=this;this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(function(i){if(t.isDragging()){var o=t._parentPositions.handleScroll(i);o&&(t._itemPositions.forEach(function(a){nm(a.clientRect,o.top,o.left)}),t._itemPositions.forEach(function(a){var s=a.drag;t._dragDropRegistry.isDragging(s)&&s._sortFromLastPointerPosition()}))}else t.isReceiving()&&t._cacheParentPositions()})}},{key:"_getShadowRoot",value:function(){if(!this._cachedShadowRoot){var t=(0,Xr.kV)((0,Mn.fI)(this.element));this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}},{key:"_notifyReceivingSiblings",value:function(){var t=this,i=this._activeDraggables.filter(function(o){return o.isDragging()});this._siblings.forEach(function(o){return o._startReceiving(t,i)})}}]),n}();function Xg(n,r){for(var t=0;t=t-a&&r<=t+a?1:r>=i-a&&r<=i+a?2:0}function MC(n,r){var t=n.left,i=n.right,a=.05*n.width;return r>=t-a&&r<=t+a?1:r>=i-a&&r<=i+a?2:0}var AC=(0,Xr.i$)({passive:!1,capture:!0}),LE=function(){var n=function(){function r(t,i){var o=this;(0,g.Z)(this,r),this._ngZone=t,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=function(a){return a.isDragging()},this.pointerMove=new Pn.xQ,this.pointerUp=new Pn.xQ,this.scroll=new Pn.xQ,this._preventDefaultWhileDragging=function(a){o._activeDragInstances.length>0&&a.preventDefault()},this._persistentTouchmoveListener=function(a){o._activeDragInstances.length>0&&(o._activeDragInstances.some(o._draggingPredicate)&&a.preventDefault(),o.pointerMove.next(a))},this._document=i}return(0,T.Z)(r,[{key:"registerDropContainer",value:function(i){this._dropInstances.has(i)||this._dropInstances.add(i)}},{key:"registerDragItem",value:function(i){var o=this;this._dragInstances.add(i),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(function(){o._document.addEventListener("touchmove",o._persistentTouchmoveListener,AC)})}},{key:"removeDropContainer",value:function(i){this._dropInstances.delete(i)}},{key:"removeDragItem",value:function(i){this._dragInstances.delete(i),this.stopDragging(i),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,AC)}},{key:"startDragging",value:function(i,o){var a=this;if(!(this._activeDragInstances.indexOf(i)>-1)&&(this._activeDragInstances.push(i),1===this._activeDragInstances.length)){var s=o.type.startsWith("touch");this._globalListeners.set(s?"touchend":"mouseup",{handler:function(p){return a.pointerUp.next(p)},options:!0}).set("scroll",{handler:function(p){return a.scroll.next(p)},options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:AC}),s||this._globalListeners.set("mousemove",{handler:function(p){return a.pointerMove.next(p)},options:AC}),this._ngZone.runOutsideAngular(function(){a._globalListeners.forEach(function(u,p){a._document.addEventListener(p,u.handler,u.options)})})}}},{key:"stopDragging",value:function(i){var o=this._activeDragInstances.indexOf(i);o>-1&&(this._activeDragInstances.splice(o,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}},{key:"isDragging",value:function(i){return this._activeDragInstances.indexOf(i)>-1}},{key:"scrolled",value:function(i){var o=this,a=[this.scroll];return i&&i!==this._document&&a.push(new aa.y(function(s){return o._ngZone.runOutsideAngular(function(){var p=function(C){o._activeDragInstances.length&&s.next(C)};return i.addEventListener("scroll",p,!0),function(){i.removeEventListener("scroll",p,!0)}})})),go.T.apply(void 0,a)}},{key:"ngOnDestroy",value:function(){var i=this;this._dragInstances.forEach(function(o){return i.removeDragItem(o)}),this._dropInstances.forEach(function(o){return i.removeDropContainer(o)}),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}},{key:"_clearGlobalListeners",value:function(){var i=this;this._globalListeners.forEach(function(o,a){i._document.removeEventListener(a,o.handler,o.options)}),this._globalListeners.clear()}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(e.R0b),e.LFG(kt.K0))},n.\u0275prov=e.Yz7({factory:function(){return new n(e.LFG(e.R0b),e.LFG(kt.K0))},token:n,providedIn:"root"}),n}(),C3={dragStartThreshold:5,pointerDirectionChangeThreshold:5},qc=function(){var n=function(){function r(t,i,o,a){(0,g.Z)(this,r),this._document=t,this._ngZone=i,this._viewportRuler=o,this._dragDropRegistry=a}return(0,T.Z)(r,[{key:"createDrag",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C3;return new _3(i,o,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}},{key:"createDropList",value:function(i){return new IE(i,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(kt.K0),e.LFG(e.R0b),e.LFG(Sa.rL),e.LFG(LE))},n.\u0275prov=e.Yz7({factory:function(){return new n(e.LFG(kt.K0),e.LFG(e.R0b),e.LFG(Sa.rL),e.LFG(LE))},token:n,providedIn:"root"}),n}(),VE=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[qc],imports:[Sa.ZD]}),n}(),so=f(93889),Gi=f(37429),Ya=f(61493),eo=f(90838),n_=f(17504),rr=f(43161),qE=[[["caption"]],[["colgroup"],["col"]]],jE=["caption","colgroup, col"];function DC(n){return function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){var o;(0,g.Z)(this,i);for(var a=arguments.length,s=new Array(a),u=0;u4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],u=arguments.length>6?arguments[6]:void 0;(0,g.Z)(this,n),this._isNativeHtmlTable=r,this._stickCellCss=t,this.direction=i,this._coalescedStyleScheduler=o,this._isBrowser=a,this._needsPositionStickyOnElement=s,this._positionListener=u,this._cachedCellWidths=[],this._borderCellCss={top:"".concat(t,"-border-elem-top"),bottom:"".concat(t,"-border-elem-bottom"),left:"".concat(t,"-border-elem-left"),right:"".concat(t,"-border-elem-right")}}return(0,T.Z)(n,[{key:"clearStickyPositioning",value:function(t,i){var u,o=this,a=[],s=(0,_.Z)(t);try{for(s.s();!(u=s.n()).done;){var p=u.value;if(p.nodeType===p.ELEMENT_NODE){a.push(p);for(var m=0;m3&&void 0!==arguments[3])||arguments[3];if(t.length&&this._isBrowser&&(i.some(function(Y){return Y})||o.some(function(Y){return Y}))){var u=t[0],p=u.children.length,m=this._getCellWidths(u,s),C=this._getStickyStartColumnPositions(m,i),P=this._getStickyEndColumnPositions(m,o),L=i.lastIndexOf(!0),G=o.indexOf(!0);this._coalescedStyleScheduler.schedule(function(){var st,Y="rtl"===a.direction,te=Y?"right":"left",de=Y?"left":"right",Me=(0,_.Z)(t);try{for(Me.s();!(st=Me.n()).done;)for(var tt=st.value,at=0;at1&&void 0!==arguments[1])||arguments[1];if(!i&&this._cachedCellWidths.length)return this._cachedCellWidths;for(var o=[],a=t.children,s=0;s0;s--)i[s]&&(o[s]=a,a+=t[s]);return o}}]),n}(),sm=new e.OlP("CDK_SPL"),lm=function(){var n=function r(t,i){(0,g.Z)(this,r),this.viewContainer=t,this.elementRef=i};return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.s_b),e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","rowOutlet",""]]}),n}(),s_=function(){var n=function r(t,i){(0,g.Z)(this,r),this.viewContainer=t,this.elementRef=i};return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.s_b),e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","headerRowOutlet",""]]}),n}(),l_=function(){var n=function r(t,i){(0,g.Z)(this,r),this.viewContainer=t,this.elementRef=i};return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.s_b),e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","footerRowOutlet",""]]}),n}(),wf=function(){var n=function r(t,i){(0,g.Z)(this,r),this.viewContainer=t,this.elementRef=i};return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.s_b),e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","noDataRowOutlet",""]]}),n}(),ep=function(){var n=function(){function r(t,i,o,a,s,u,p,m,C,P,L){(0,g.Z)(this,r),this._differs=t,this._changeDetectorRef=i,this._elementRef=o,this._dir=s,this._platform=p,this._viewRepeater=m,this._coalescedStyleScheduler=C,this._viewportRuler=P,this._stickyPositioningListener=L,this._onDestroy=new Pn.xQ,this._columnDefsByName=new Map,this._customColumnDefs=new Set,this._customRowDefs=new Set,this._customHeaderRowDefs=new Set,this._customFooterRowDefs=new Set,this._headerRowDefChanged=!0,this._footerRowDefChanged=!0,this._stickyColumnStylesNeedReset=!0,this._forceRecalculateCellWidths=!0,this._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this.needsPositionStickyOnElement=!0,this._isShowingNoDataRow=!1,this._multiTemplateDataRows=!1,this._fixedLayout=!1,this.contentChanged=new e.vpe,this.viewChange=new eo.X({start:0,end:Number.MAX_VALUE}),a||this._elementRef.nativeElement.setAttribute("role","table"),this._document=u,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}return(0,T.Z)(r,[{key:"trackBy",get:function(){return this._trackByFn},set:function(i){this._trackByFn=i}},{key:"dataSource",get:function(){return this._dataSource},set:function(i){this._dataSource!==i&&this._switchDataSource(i)}},{key:"multiTemplateDataRows",get:function(){return this._multiTemplateDataRows},set:function(i){this._multiTemplateDataRows=(0,Mn.Ig)(i),this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles())}},{key:"fixedLayout",get:function(){return this._fixedLayout},set:function(i){this._fixedLayout=(0,Mn.Ig)(i),this._forceRecalculateCellWidths=!0,this._stickyColumnStylesNeedReset=!0}},{key:"ngOnInit",value:function(){var i=this;this._setupStickyStyler(),this._isNativeHtmlTable&&this._applyNativeTableSections(),this._dataDiffer=this._differs.find([]).create(function(o,a){return i.trackBy?i.trackBy(a.dataIndex,a.data):a}),this._viewportRuler.change().pipe((0,Zr.R)(this._onDestroy)).subscribe(function(){i._forceRecalculateCellWidths=!0})}},{key:"ngAfterContentChecked",value:function(){this._cacheRowDefs(),this._cacheColumnDefs();var o=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||o,this._forceRecalculateCellWidths=o,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates()}},{key:"ngOnDestroy",value:function(){this._rowOutlet.viewContainer.clear(),this._noDataRowOutlet.viewContainer.clear(),this._headerRowOutlet.viewContainer.clear(),this._footerRowOutlet.viewContainer.clear(),this._cachedRenderRowsMap.clear(),this._onDestroy.next(),this._onDestroy.complete(),(0,Gi.Z9)(this.dataSource)&&this.dataSource.disconnect(this)}},{key:"renderRows",value:function(){var i=this;this._renderRows=this._getAllRenderRows();var o=this._dataDiffer.diff(this._renderRows);if(!o)return this._updateNoDataRow(),void this.contentChanged.next();var a=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(o,a,function(s,u,p){return i._getEmbeddedViewArgs(s.item,p)},function(s){return s.item.data},function(s){1===s.operation&&s.context&&i._renderCellTemplateForItem(s.record.item.rowDef,s.context)}),this._updateRowIndexContext(),o.forEachIdentityChange(function(s){a.get(s.currentIndex).context.$implicit=s.item.data}),this._updateNoDataRow(),this.updateStickyColumnStyles(),this.contentChanged.next()}},{key:"addColumnDef",value:function(i){this._customColumnDefs.add(i)}},{key:"removeColumnDef",value:function(i){this._customColumnDefs.delete(i)}},{key:"addRowDef",value:function(i){this._customRowDefs.add(i)}},{key:"removeRowDef",value:function(i){this._customRowDefs.delete(i)}},{key:"addHeaderRowDef",value:function(i){this._customHeaderRowDefs.add(i),this._headerRowDefChanged=!0}},{key:"removeHeaderRowDef",value:function(i){this._customHeaderRowDefs.delete(i),this._headerRowDefChanged=!0}},{key:"addFooterRowDef",value:function(i){this._customFooterRowDefs.add(i),this._footerRowDefChanged=!0}},{key:"removeFooterRowDef",value:function(i){this._customFooterRowDefs.delete(i),this._footerRowDefChanged=!0}},{key:"setNoDataRow",value:function(i){this._customNoDataRow=i}},{key:"updateStickyHeaderRowStyles",value:function(){var i=this._getRenderedRows(this._headerRowOutlet),a=this._elementRef.nativeElement.querySelector("thead");a&&(a.style.display=i.length?"":"none");var s=this._headerRowDefs.map(function(u){return u.sticky});this._stickyStyler.clearStickyPositioning(i,["top"]),this._stickyStyler.stickRows(i,s,"top"),this._headerRowDefs.forEach(function(u){return u.resetStickyChanged()})}},{key:"updateStickyFooterRowStyles",value:function(){var i=this._getRenderedRows(this._footerRowOutlet),a=this._elementRef.nativeElement.querySelector("tfoot");a&&(a.style.display=i.length?"":"none");var s=this._footerRowDefs.map(function(u){return u.sticky});this._stickyStyler.clearStickyPositioning(i,["bottom"]),this._stickyStyler.stickRows(i,s,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,s),this._footerRowDefs.forEach(function(u){return u.resetStickyChanged()})}},{key:"updateStickyColumnStyles",value:function(){var i=this,o=this._getRenderedRows(this._headerRowOutlet),a=this._getRenderedRows(this._rowOutlet),s=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this._fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([].concat((0,v.Z)(o),(0,v.Z)(a),(0,v.Z)(s)),["left","right"]),this._stickyColumnStylesNeedReset=!1),o.forEach(function(u,p){i._addStickyColumnStyles([u],i._headerRowDefs[p])}),this._rowDefs.forEach(function(u){for(var p=[],m=0;m0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach(function(o,a){return i._renderRow(i._headerRowOutlet,o,a)}),this.updateStickyHeaderRowStyles()}},{key:"_forceRenderFooterRows",value:function(){var i=this;this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach(function(o,a){return i._renderRow(i._footerRowOutlet,o,a)}),this.updateStickyFooterRowStyles()}},{key:"_addStickyColumnStyles",value:function(i,o){var a=this,s=Array.from(o.columns||[]).map(function(m){return a._columnDefsByName.get(m)}),u=s.map(function(m){return m.sticky}),p=s.map(function(m){return m.stickyEnd});this._stickyStyler.updateStickyColumns(i,u,p,!this._fixedLayout||this._forceRecalculateCellWidths)}},{key:"_getRenderedRows",value:function(i){for(var o=[],a=0;a3&&void 0!==arguments[3]?arguments[3]:{},u=i.viewContainer.createEmbeddedView(o.template,s,a);return this._renderCellTemplateForItem(o,s),u}},{key:"_renderCellTemplateForItem",value:function(i,o){var s,a=(0,_.Z)(this._getCellTemplates(i));try{for(a.s();!(s=a.n()).done;)bu.mostRecentCellOutlet&&bu.mostRecentCellOutlet._viewContainer.createEmbeddedView(s.value,o)}catch(p){a.e(p)}finally{a.f()}this._changeDetectorRef.markForCheck()}},{key:"_updateRowIndexContext",value:function(){for(var i=this._rowOutlet.viewContainer,o=0,a=i.length;o0;)t[i]=r[i+1];return S4(n,t=t.map(zC))}function x4(n){for(var r=arguments,t=[],i=arguments.length-1;i-- >0;)t[i]=r[i+1];return t.map(zC).reduce(function(o,a){var s=dk(n,a);return-1!==s?o.concat(n.splice(s,1)):o},[])}function zC(n,r){if("string"==typeof n)try{return document.querySelector(n)}catch(t){throw t}if(!ck(n)&&!r)throw new TypeError(n+" is not a DOM element.");return n}function pk(n){if(n===window)return function(){var n={top:{value:0,enumerable:!0},left:{value:0,enumerable:!0},right:{value:window.innerWidth,enumerable:!0},bottom:{value:window.innerHeight,enumerable:!0},width:{value:window.innerWidth,enumerable:!0},height:{value:window.innerHeight,enumerable:!0},x:{value:0,enumerable:!0},y:{value:0,enumerable:!0}};if(Object.create)return Object.create({},n);var r={};return Object.defineProperties(r,n),r}();try{var r=n.getBoundingClientRect();return void 0===r.x&&(r.x=r.left,r.y=r.top),r}catch(t){throw new TypeError("Can't call getBoundingClientRect on "+n)}}var r,fk=void 0;"function"!=typeof Object.create?(r=function(){},fk=function(t,i){if(t!==Object(t)&&null!==t)throw TypeError("Argument must be an object, or null");r.prototype=t||{};var o=new r;return r.prototype=null,void 0!==i&&Object.defineProperties(o,i),null===t&&(o.__proto__=null),o}):fk=Object.create;var w4=fk,np=["altKey","button","buttons","clientX","clientY","ctrlKey","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","region","relatedTarget","screenX","screenY","shiftKey","which","x","y"];function WC(n,r){r=r||{};for(var t=w4(n),i=0;iot.right-t.margin.right?Math.ceil(Math.min(1,(s.x-ot.right)/t.margin.right+1)*t.maxSpeed.right):0,mn=s.yot.bottom-t.margin.bottom?Math.ceil(Math.min(1,(s.y-ot.bottom)/t.margin.bottom+1)*t.maxSpeed.bottom):0,t.syncMove()&&p.dispatch(Wt,{pageX:s.pageX+Dt,pageY:s.pageY+mn,clientX:s.x+Dt,clientY:s.y+mn}),setTimeout(function(){mn&&function(Wt,ot){Wt===window?window.scrollTo(Wt.pageXOffset,Wt.pageYOffset+ot):Wt.scrollTop+=ot}(Wt,mn),Dt&&function(Wt,ot){Wt===window?window.scrollTo(Wt.pageXOffset+ot,Wt.pageYOffset):Wt.scrollLeft+=ot}(Wt,Dt)})}window.addEventListener("mousedown",te,!1),window.addEventListener("touchstart",te,!1),window.addEventListener("mouseup",de,!1),window.addEventListener("touchend",de,!1),window.addEventListener("pointerup",de,!1),window.addEventListener("mousemove",pt,!1),window.addEventListener("touchmove",pt,!1),window.addEventListener("mouseleave",st,!1),window.addEventListener("scroll",Y,!0)}function YC(n,r,t){return t?n.y>t.top&&n.yt.left&&n.xt.top&&n.yt.left&&n.x0})}));return C.complete(),de})).subscribe(function(te){var de=te.x,Me=te.y,st=te.dragCancelled;i.scroller.destroy(),i.zone.run(function(){i.dragEnd.next({x:de,y:Me,dragCancelled:st})}),function(n,r,t){t&&t.split(" ").forEach(function(i){return n.removeClass(r.nativeElement,i)})}(i.renderer,i.element,i.dragActiveClass),m.complete()}),(0,go.T)(P,Y).pipe((0,$i.q)(1)).subscribe(function(){requestAnimationFrame(function(){i.document.head.removeChild(s)})}),L}),(0,cm.B)());(0,go.T)(o.pipe((0,$i.q)(1),(0,Er.U)(function(a){return[,a]})),o.pipe((0,j3.G)())).pipe((0,mi.h)(function(a){var s=(0,b.Z)(a,2),u=s[0],p=s[1];return!u||u.x!==p.x||u.y!==p.y}),(0,Er.U)(function(a){return(0,b.Z)(a,2)[1]})).subscribe(function(a){var s=a.x,u=a.y,p=a.currentDrag$,m=a.clientX,C=a.clientY,P=a.transformX,L=a.transformY,G=a.target;i.zone.run(function(){i.dragging.next({x:s,y:u})}),requestAnimationFrame(function(){if(i.ghostElement){var Y="translate3d(".concat(P,"px, ").concat(L,"px, 0px)");i.setElementStyles(i.ghostElement,{transform:Y,"-webkit-transform":Y,"-ms-transform":Y,"-moz-transform":Y,"-o-transform":Y})}}),p.next({clientX:m,clientY:C,dropData:i.dropData,target:G})})}},{key:"ngOnChanges",value:function(i){i.dragAxis&&this.checkEventListeners()}},{key:"ngOnDestroy",value:function(){this.unsubscribeEventListeners(),this.pointerDown$.complete(),this.pointerMove$.complete(),this.pointerUp$.complete(),this.destroy$.next()}},{key:"checkEventListeners",value:function(){var i=this,o=this.canDrag(),a=Object.keys(this.eventListenerSubscriptions).length>0;o&&!a?this.zone.runOutsideAngular(function(){i.eventListenerSubscriptions.mousedown=i.renderer.listen(i.element.nativeElement,"mousedown",function(s){i.onMouseDown(s)}),i.eventListenerSubscriptions.mouseup=i.renderer.listen("document","mouseup",function(s){i.onMouseUp(s)}),i.eventListenerSubscriptions.touchstart=i.renderer.listen(i.element.nativeElement,"touchstart",function(s){i.onTouchStart(s)}),i.eventListenerSubscriptions.touchend=i.renderer.listen("document","touchend",function(s){i.onTouchEnd(s)}),i.eventListenerSubscriptions.touchcancel=i.renderer.listen("document","touchcancel",function(s){i.onTouchEnd(s)}),i.eventListenerSubscriptions.mouseenter=i.renderer.listen(i.element.nativeElement,"mouseenter",function(){i.onMouseEnter()}),i.eventListenerSubscriptions.mouseleave=i.renderer.listen(i.element.nativeElement,"mouseleave",function(){i.onMouseLeave()})}):!o&&a&&this.unsubscribeEventListeners()}},{key:"onMouseDown",value:function(i){var o=this;0===i.button&&(this.eventListenerSubscriptions.mousemove||(this.eventListenerSubscriptions.mousemove=this.renderer.listen("document","mousemove",function(a){o.pointerMove$.next({event:a,clientX:a.clientX,clientY:a.clientY})})),this.pointerDown$.next({event:i,clientX:i.clientX,clientY:i.clientY}))}},{key:"onMouseUp",value:function(i){0===i.button&&(this.eventListenerSubscriptions.mousemove&&(this.eventListenerSubscriptions.mousemove(),delete this.eventListenerSubscriptions.mousemove),this.pointerUp$.next({event:i,clientX:i.clientX,clientY:i.clientY}))}},{key:"onTouchStart",value:function(i){var a,s,u,o=this;if(this.touchStartLongPress&&(this.timeLongPress.timerBegin=Date.now(),s=!1,u=this.hasScrollbar(),a=this.getScrollPosition()),!this.eventListenerSubscriptions.touchmove){var p=(0,tp.R)(this.document,"contextmenu").subscribe(function(C){C.preventDefault()}),m=(0,tp.R)(this.document,"touchmove",{passive:!1}).subscribe(function(C){o.touchStartLongPress&&!s&&u&&(s=o.shouldBeginDrag(i,C,a)),(!o.touchStartLongPress||!u||s)&&(C.preventDefault(),o.pointerMove$.next({event:C,clientX:C.targetTouches[0].clientX,clientY:C.targetTouches[0].clientY}))});this.eventListenerSubscriptions.touchmove=function(){p.unsubscribe(),m.unsubscribe()}}this.pointerDown$.next({event:i,clientX:i.touches[0].clientX,clientY:i.touches[0].clientY})}},{key:"onTouchEnd",value:function(i){this.eventListenerSubscriptions.touchmove&&(this.eventListenerSubscriptions.touchmove(),delete this.eventListenerSubscriptions.touchmove,this.touchStartLongPress&&this.enableScroll()),this.pointerUp$.next({event:i,clientX:i.changedTouches[0].clientX,clientY:i.changedTouches[0].clientY})}},{key:"onMouseEnter",value:function(){this.setCursor(this.dragCursor)}},{key:"onMouseLeave",value:function(){this.setCursor("")}},{key:"canDrag",value:function(){return this.dragAxis.x||this.dragAxis.y}},{key:"setCursor",value:function(i){this.eventListenerSubscriptions.mousemove||this.renderer.setStyle(this.element.nativeElement,"cursor",i)}},{key:"unsubscribeEventListeners",value:function(){var i=this;Object.keys(this.eventListenerSubscriptions).forEach(function(o){i.eventListenerSubscriptions[o](),delete i.eventListenerSubscriptions[o]})}},{key:"setElementStyles",value:function(i,o){var a=this;Object.keys(o).forEach(function(s){a.renderer.setStyle(i,s,o[s])})}},{key:"getScrollElement",value:function(){return this.scrollContainer?this.scrollContainer.elementRef.nativeElement:this.document.body}},{key:"getScrollPosition",value:function(){return this.scrollContainer?{top:this.scrollContainer.elementRef.nativeElement.scrollTop,left:this.scrollContainer.elementRef.nativeElement.scrollLeft}:{top:window.pageYOffset||this.document.documentElement.scrollTop,left:window.pageXOffset||this.document.documentElement.scrollLeft}}},{key:"shouldBeginDrag",value:function(i,o,a){var s=this.getScrollPosition(),u_top=Math.abs(s.top-a.top),u_left=Math.abs(s.left-a.left),p=Math.abs(o.targetTouches[0].clientX-i.touches[0].clientX)-u_left,m=Math.abs(o.targetTouches[0].clientY-i.touches[0].clientY)-u_top,P=this.touchStartLongPress;return(p+m>P.delta||u_top>0||u_left>0)&&(this.timeLongPress.timerBegin=Date.now()),this.timeLongPress.timerEnd=Date.now(),this.timeLongPress.timerEnd-this.timeLongPress.timerBegin>=P.delay&&(this.disableScroll(),!0)}},{key:"enableScroll",value:function(){this.scrollContainer&&this.renderer.setStyle(this.scrollContainer.elementRef.nativeElement,"overflow",""),this.renderer.setStyle(this.document.body,"overflow","")}},{key:"disableScroll",value:function(){this.scrollContainer&&this.renderer.setStyle(this.scrollContainer.elementRef.nativeElement,"overflow","hidden"),this.renderer.setStyle(this.document.body,"overflow","hidden")}},{key:"hasScrollbar",value:function(){var i=this.getScrollElement();return i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(e.Qsj),e.Y36(JC),e.Y36(e.R0b),e.Y36(e.s_b),e.Y36(J3,8),e.Y36(kt.K0))},n.\u0275dir=e.lG2({type:n,selectors:[["","mwlDraggable",""]],inputs:{dragAxis:"dragAxis",dragSnapGrid:"dragSnapGrid",ghostDragEnabled:"ghostDragEnabled",showOriginalElementWhileDragging:"showOriginalElementWhileDragging",dragCursor:"dragCursor",autoScroll:"autoScroll",dropData:"dropData",validateDrag:"validateDrag",dragActiveClass:"dragActiveClass",ghostElementAppendTo:"ghostElementAppendTo",ghostElementTemplate:"ghostElementTemplate",touchStartLongPress:"touchStartLongPress"},outputs:{dragPointerDown:"dragPointerDown",dragStart:"dragStart",ghostElementCreated:"ghostElementCreated",dragging:"dragging",dragEnd:"dragEnd"},features:[e.TTD]}),n}(),k4=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({}),n}(),vk=f(39095);function Af(n,r){return nr?1:n>=r?0:NaN}function Df(n){return 1===n.length&&(n=function(n){return function(r,t){return Af(n(r),t)}}(n)),{left:function(t,i,o,a){for(null==o&&(o=0),null==a&&(a=t.length);o>>1;n(t[s],i)<0?o=s+1:a=s}return o},right:function(t,i,o,a){for(null==o&&(o=0),null==a&&(a=t.length);o>>1;n(t[s],i)>0?a=s:o=s+1}return o}}}var X3=Df(Af),$3=X3.right,QC=X3.left,Of=$3;function M4(n,r){null==r&&(r=gk);for(var t=0,i=n.length-1,o=n[0],a=new Array(i<0?0:i);tn?1:r>=n?0:NaN}function Xu(n){return null===n?NaN:+n}function _k(n,r){var s,u,t=n.length,i=0,o=-1,a=0,p=0;if(null==r)for(;++o1)return p/(i-1)}function tR(n,r){var t=_k(n,r);return t&&Math.sqrt(t)}function KC(n,r){var o,a,s,t=n.length,i=-1;if(null==r){for(;++i=o)for(a=s=o;++io&&(a=o),s=o)for(a=s=o;++io&&(a=o),s0)return[n];if((i=r0)for(n=Math.ceil(n/u),r=Math.floor(r/u),s=new Array(a=Math.ceil(r-n+1));++o=0?(a>=XC?10:a>=il?5:a>=$C?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(a>=XC?10:a>=il?5:a>=$C?2:1)}function ip(n,r,t){var i=Math.abs(r-n)/Math.max(0,t),o=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),a=i/o;return a>=XC?o*=10:a>=il?o*=5:a>=$C&&(o*=2),rP;)L.pop(),--G;var te,Y=new Array(G+1);for(a=0;a<=G;++a)(te=Y[a]=[]).x0=a>0?L[a-1]:C,te.x1=a=1)return+t(n[i-1],i-1,n);var i,o=(i-1)*r,a=Math.floor(o),s=+t(n[a],a,n);return s+(+t(n[a+1],a+1,n)-s)*(o-a)}}function iR(n,r,t){return n=nR.call(n,Xu).sort(Af),Math.ceil((t-r)/(2*(Pf(n,.75)-Pf(n,.25))*Math.pow(n.length,-1/3)))}function Ck(n,r,t){return Math.ceil((t-r)/(3.5*tR(n)*Math.pow(n.length,-1/3)))}function e1(n,r){var o,a,t=n.length,i=-1;if(null==r){for(;++i=o)for(a=o;++ia&&(a=o)}else for(;++i=o)for(a=o;++ia&&(a=o);return a}function oR(n,r){var a,t=n.length,i=t,o=-1,s=0;if(null==r)for(;++o=0;)for(t=(s=n[r]).length;--t>=0;)a[--o]=s[t];return a}function t1(n,r){var o,a,t=n.length,i=-1;if(null==r){for(;++i=o)for(a=o;++io&&(a=o)}else for(;++i=o)for(a=o;++io&&(a=o);return a}function Sk(n,r){for(var t=r.length,i=new Array(t);t--;)i[t]=n[r[t]];return i}function n1(n,r){if(t=n.length){var t,a,i=0,o=0,s=n[o];for(null==r&&(r=Af);++i=0&&(i=t.slice(o+1),t=t.slice(0,o)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}function vR(n,r){for(var o,t=0,i=n.length;t0)for(var a,s,i=new Array(a),o=0;o=0&&"xmlns"!==(r=n.slice(0,t))&&(n=n.slice(t+1)),g_.hasOwnProperty(r)?{space:g_[r],local:n}:n}function _R(n){return function(){var r=this.ownerDocument,t=this.namespaceURI;return t===Ak&&r.documentElement.namespaceURI===Ak?r.createElement(n):r.createElementNS(t,n)}}function yR(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function __(n){var r=If(n);return(r.local?yR:_R)(r)}function bR(){}function Sm(n){return null==n?bR:function(){return this.querySelector(n)}}function SR(){return[]}function Dk(n){return null==n?SR:function(){return this.querySelectorAll(n)}}var y_=function(r){return function(){return this.matches(r)}};if("undefined"!=typeof document){var b_=document.documentElement;if(!b_.matches){var TR=b_.webkitMatchesSelector||b_.msMatchesSelector||b_.mozMatchesSelector||b_.oMatchesSelector;y_=function(r){return function(){return TR.call(this,r)}}}}var i1=y_;function C_(n){return new Array(n.length)}function S_(n,r){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=r}function Ok(n,r,t,i,o,a){for(var u,s=0,p=r.length,m=a.length;sr?1:n>=r?0:NaN}function U4(n){return function(){this.removeAttribute(n)}}function H4(n){return function(){this.removeAttributeNS(n.space,n.local)}}function V4(n,r){return function(){this.setAttribute(n,r)}}function MR(n,r){return function(){this.setAttributeNS(n.space,n.local,r)}}function AR(n,r){return function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function DR(n,r){return function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function l1(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function PR(n){return function(){this.style.removeProperty(n)}}function IR(n,r,t){return function(){this.style.setProperty(n,r,t)}}function RR(n,r,t){return function(){var i=r.apply(this,arguments);null==i?this.style.removeProperty(n):this.style.setProperty(n,i,t)}}function op(n,r){return n.style.getPropertyValue(r)||l1(n).getComputedStyle(n,null).getPropertyValue(r)}function q4(n){return function(){delete this[n]}}function j4(n,r){return function(){this[n]=r}}function ZR(n,r){return function(){var t=r.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function Ik(n){return n.trim().split(/^|\s+/)}function u1(n){return n.classList||new Rk(n)}function Rk(n){this._node=n,this._names=Ik(n.getAttribute("class")||"")}function ol(n,r){for(var t=u1(n),i=-1,o=r.length;++i=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(r){return this._names.indexOf(r)>=0}};var Fk={},On=null;function Uk(n,r,t){return n=x_(n,r,t),function(i){var o=i.relatedTarget;(!o||o!==this&&!(8&o.compareDocumentPosition(this)))&&n.call(this,i)}}function x_(n,r,t){return function(i){var o=On;On=i;try{n.call(this,this.__data__,r,t)}finally{On=o}}}function d1(n){return n.trim().split(/^|\s+/).map(function(r){var t="",i=r.indexOf(".");return i>=0&&(t=r.slice(i+1),r=r.slice(0,i)),{type:r,name:t}})}function p1(n){return function(){var r=this.__on;if(r){for(var a,t=0,i=-1,o=r.length;t=tt&&(tt=st+1);!(pt=de[tt])&&++tt=0;)(s=i[o])&&(a&&a!==s.nextSibling&&a.parentNode.insertBefore(s,a),a=s);return this},sort:function(n){function r(P,L){return P&&L?n(P.__data__,L.__data__):!P-!L}n||(n=Z4);for(var t=this._groups,i=t.length,o=new Array(i),a=0;a1?this.each((null==r?PR:"function"==typeof r?RR:IR)(n,r,null==t?"":t)):op(this.node(),n)},property:function(n,r){return arguments.length>1?this.each((null==r?q4:"function"==typeof r?ZR:j4)(n,r)):this.node()[n]},classed:function(n,r){var t=Ik(n+"");if(arguments.length<2){for(var i=u1(this.node()),o=-1,a=t.length;++o>8&15|r>>4&240,r>>4&15|240&r,(15&r)<<4|15&r,1):(r=eN.exec(n))?Am(parseInt(r[1],16)):(r=qk.exec(n))?new Za(r[1],r[2],r[3],1):(r=jk.exec(n))?new Za(255*r[1]/100,255*r[2]/100,255*r[3]/100,1):(r=tN.exec(n))?ap(r[1],r[2],r[3],r[4]):(r=nN.exec(n))?ap(255*r[1]/100,255*r[2]/100,255*r[3]/100,r[4]):(r=rN.exec(n))?y1(r[1],r[2]/100,r[3]/100,1):(r=$u.exec(n))?y1(r[1],r[2]/100,r[3]/100,r[4]):Uf.hasOwnProperty(n)?Am(Uf[n]):"transparent"===n?new Za(NaN,NaN,NaN,0):null}function Am(n){return new Za(n>>16&255,n>>8&255,255&n,1)}function ap(n,r,t,i){return i<=0&&(n=r=t=NaN),new Za(n,r,t,i)}function _1(n){return n instanceof ss||(n=Bs(n)),n?new Za((n=n.rgb()).r,n.g,n.b,n.opacity):new Za}function Dm(n,r,t,i){return 1===arguments.length?_1(n):new Za(n,r,t,null==i?1:i)}function Za(n,r,t,i){this.r=+n,this.g=+r,this.b=+t,this.opacity=+i}function y1(n,r,t,i){return i<=0?n=r=t=NaN:t<=0||t>=1?n=r=NaN:r<=0&&(n=NaN),new ql(n,r,t,i)}function zk(n){if(n instanceof ql)return new ql(n.h,n.s,n.l,n.opacity);if(n instanceof ss||(n=Bs(n)),!n)return new ql;if(n instanceof ql)return n;var r=(n=n.rgb()).r/255,t=n.g/255,i=n.b/255,o=Math.min(r,t,i),a=Math.max(r,t,i),s=NaN,u=a-o,p=(a+o)/2;return u?(s=r===a?(t-i)/u+6*(t0&&p<1?0:s,new ql(s,u,p,n.opacity)}function Om(n,r,t,i){return 1===arguments.length?zk(n):new ql(n,r,t,null==i?1:i)}function ql(n,r,t,i){this.h=+n,this.s=+r,this.l=+t,this.opacity=+i}function Pm(n,r,t){return 255*(n<60?r+(t-r)*n/60:n<180?t:n<240?r+(t-r)*(240-n)/60:r)}Ff(ss,Bs,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Ff(Za,Dm,km(ss,{brighter:function(r){return r=null==r?Wc:Math.pow(Wc,r),new Za(this.r*r,this.g*r,this.b*r,this.opacity)},darker:function(r){return r=null==r?.7:Math.pow(.7,r),new Za(this.r*r,this.g*r,this.b*r,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var r=this.opacity;return(1===(r=isNaN(r)?1:Math.max(0,Math.min(1,r)))?"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===r?")":", "+r+")")}})),Ff(ql,Om,km(ss,{brighter:function(r){return r=null==r?Wc:Math.pow(Wc,r),new ql(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=null==r?.7:Math.pow(.7,r),new ql(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=this.h%360+360*(this.h<0),t=isNaN(r)||isNaN(this.s)?0:this.s,i=this.l,o=i+(i<.5?i:1-i)*t,a=2*i-o;return new Za(Pm(r>=240?r-240:r+120,a,o),Pm(r,a,o),Pm(r<120?r+240:r-120,a,o),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}}));var iN=Math.PI/180,oN=180/Math.PI,aN=4/29,Im=6/29,sN=3*Im*Im;function Yk(n){if(n instanceof Tu)return new Tu(n.l,n.a,n.b,n.opacity);if(n instanceof Yc){if(isNaN(n.h))return new Tu(n.l,0,0,n.opacity);var r=n.h*iN;return new Tu(n.l,Math.cos(r)*n.c,Math.sin(r)*n.c,n.opacity)}n instanceof Za||(n=_1(n));var s,u,t=Xk(n.r),i=Xk(n.g),o=Xk(n.b),a=Jk((.2225045*t+.7168786*i+.0606169*o)/1);return t===i&&i===o?s=u=a:(s=Jk((.4360747*t+.3850649*i+.1430804*o)/.96422),u=Jk((.0139322*t+.0971045*i+.7141733*o)/.82521)),new Tu(116*a-16,500*(s-a),200*(a-u),n.opacity)}function C1(n,r,t,i){return 1===arguments.length?Yk(n):new Tu(n,r,t,null==i?1:i)}function Tu(n,r,t,i){this.l=+n,this.a=+r,this.b=+t,this.opacity=+i}function Jk(n){return n>.008856451679035631?Math.pow(n,1/3):n/sN+aN}function Qk(n){return n>Im?n*n*n:sN*(n-aN)}function Kk(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function Xk(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function lN(n){if(n instanceof Yc)return new Yc(n.h,n.c,n.l,n.opacity);if(n instanceof Tu||(n=Yk(n)),0===n.a&&0===n.b)return new Yc(NaN,0,n.l,n.opacity);var r=Math.atan2(n.b,n.a)*oN;return new Yc(r<0?r+360:r,Math.sqrt(n.a*n.a+n.b*n.b),n.l,n.opacity)}function S1(n,r,t,i){return 1===arguments.length?lN(n):new Yc(n,r,t,null==i?1:i)}function Yc(n,r,t,i){this.h=+n,this.c=+r,this.l=+t,this.opacity=+i}Ff(Tu,C1,km(ss,{brighter:function(r){return new Tu(this.l+18*(null==r?1:r),this.a,this.b,this.opacity)},darker:function(r){return new Tu(this.l-18*(null==r?1:r),this.a,this.b,this.opacity)},rgb:function(){var r=(this.l+16)/116,t=isNaN(this.a)?r:r+this.a/500,i=isNaN(this.b)?r:r-this.b/200;return new Za(Kk(3.1338561*(t=.96422*Qk(t))-1.6168667*(r=1*Qk(r))-.4906146*(i=.82521*Qk(i))),Kk(-.9787684*t+1.9161415*r+.033454*i),Kk(.0719453*t-.2289914*r+1.4052427*i),this.opacity)}})),Ff(Yc,S1,km(ss,{brighter:function(r){return new Yc(this.h,this.c,this.l+18*(null==r?1:r),this.opacity)},darker:function(r){return new Yc(this.h,this.c,this.l-18*(null==r?1:r),this.opacity)},rgb:function(){return Yk(this).rgb()}}));var $k=1.78277,l=-.29227,c=-.90649,d=1.97294,h=d*c,y=d*$k,M=$k*l- -.14861*c;function H(n){if(n instanceof X)return new X(n.h,n.s,n.l,n.opacity);n instanceof Za||(n=_1(n));var t=n.g/255,i=n.b/255,o=(M*i+h*(n.r/255)-y*t)/(M+h-y),a=i-o,s=(d*(t-o)-l*a)/c,u=Math.sqrt(s*s+a*a)/(d*o*(1-o)),p=u?Math.atan2(s,a)*oN-120:NaN;return new X(p<0?p+360:p,u,o,n.opacity)}function W(n,r,t,i){return 1===arguments.length?H(n):new X(n,r,t,null==i?1:i)}function X(n,r,t,i){this.h=+n,this.s=+r,this.l=+t,this.opacity=+i}function me(n,r,t,i,o){var a=n*n,s=a*n;return((1-3*n+3*a-s)*r+(4-6*a+3*s)*t+(1+3*n+3*a-3*s)*i+s*o)/6}function Pe(n){var r=n.length-1;return function(t){var i=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),o=n[i],a=n[i+1];return me((t-i/r)*r,i>0?n[i-1]:2*o-a,o,a,i180||t<-180?t-360*Math.round(t/360):t):Qe(isNaN(n)?r:n)}function En(n,r){var t=r-n;return t?mt(n,t):Qe(isNaN(n)?r:n)}Ff(X,W,km(ss,{brighter:function(r){return r=null==r?Wc:Math.pow(Wc,r),new X(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=null==r?.7:Math.pow(.7,r),new X(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=isNaN(this.h)?0:(this.h+120)*iN,t=+this.l,i=isNaN(this.s)?0:this.s*t*(1-t),o=Math.cos(r),a=Math.sin(r);return new Za(255*(t+i*(-.14861*o+$k*a)),255*(t+i*(l*o+c*a)),255*(t+i*(d*o)),this.opacity)}}));var _n=function n(r){var t=function(n){return 1==(n=+n)?En:function(r,t){return t-r?function(n,r,t){return n=Math.pow(n,t),r=Math.pow(r,t)-n,t=1/t,function(i){return Math.pow(n+i*r,t)}}(r,t,n):Qe(isNaN(r)?t:r)}}(r);function i(o,a){var s=t((o=Dm(o)).r,(a=Dm(a)).r),u=t(o.g,a.g),p=t(o.b,a.b),m=En(o.opacity,a.opacity);return function(C){return o.r=s(C),o.g=u(C),o.b=p(C),o.opacity=m(C),o+""}}return i.gamma=n,i}(1);function Kn(n){return function(r){var s,u,t=r.length,i=new Array(t),o=new Array(t),a=new Array(t);for(s=0;st&&(a=r.slice(t,a),u[s]?u[s]+=a:u[++s]=a),(i=i[0])===(o=o[0])?u[s]?u[s]+=o:u[++s]=o:(u[++s]=null,p.push({i:s,x:Ni(i,o)})),t=xu.lastIndex;return t180?C+=360:C-m>180&&(m+=360),L.push({i:P.push(o(P)+"rotate(",null,i)-2,x:Ni(m,C)})):C&&P.push(o(P)+"rotate("+C+i)}(m.rotate,C.rotate,P,L),function(m,C,P,L){m!==C?L.push({i:P.push(o(P)+"skewX(",null,i)-2,x:Ni(m,C)}):C&&P.push(o(P)+"skewX("+C+i)}(m.skewX,C.skewX,P,L),function(m,C,P,L,G,Y){if(m!==P||C!==L){var te=G.push(o(G)+"scale(",null,",",null,")");Y.push({i:te-4,x:Ni(m,P)},{i:te-2,x:Ni(C,L)})}else(1!==P||1!==L)&&G.push(o(G)+"scale("+P+","+L+")")}(m.scaleX,m.scaleY,C.scaleX,C.scaleY,P,L),m=C=null,function(G){for(var de,Y=-1,te=L.length;++Y=0&&n._call.call(null,r),n=n._next;--O_}function l8(){Fm=(aM=M1.now())+sM,O_=w1=0;try{s8()}finally{O_=0,function(){for(var n,t,r=oM,i=1/0;r;)r._call?(i>r._time&&(i=r._time),n=r,r=r._next):(t=r._next,r._next=null,r=n?n._next=t:oM=t);k1=n,fN(i)}(),Fm=0}}function CG(){var n=M1.now(),r=n-aM;r>1e3&&(sM-=r,aM=n)}function fN(n){O_||(w1&&(w1=clearTimeout(w1)),n-Fm>24?(n<1/0&&(w1=setTimeout(l8,n-M1.now()-sM)),E1&&(E1=clearInterval(E1))):(E1||(aM=M1.now(),E1=setInterval(CG,1e3)),O_=1,a8(l8)))}function hN(n,r,t){var i=new A1;return i.restart(function(o){i.stop(),n(o+r)},r=null==r?0:+r,t),i}A1.prototype=lM.prototype={constructor:A1,restart:function(r,t,i){if("function"!=typeof r)throw new TypeError("callback is not a function");i=(null==i?P_():+i)+(null==t?0:+t),!this._next&&k1!==this&&(k1?k1._next=this:oM=this,k1=this),this._call=r,this._time=i,fN()},stop:function(){this._call&&(this._call=null,this._time=1/0,fN())}};var TG=Cm("start","end","interrupt"),xG=[];function dM(n,r,t,i,o,a){var s=n.__transition;if(s){if(t in s)return}else n.__transition={};!function(n,r,t){var o,i=n.__transition;function s(m){var C,P,L,G;if(1!==t.state)return p();for(C in i)if((G=i[C]).name===t.name){if(3===G.state)return hN(s);4===G.state?(G.state=6,G.timer.stop(),G.on.call("interrupt",n,n.__data__,G.index,G.group),delete i[C]):+C0)throw new Error("too late; already scheduled");return t}function Bm(n,r){var t=ec(n,r);if(t.state>2)throw new Error("too late; already started");return t}function ec(n,r){var t=n.__transition;if(!t||!(t=t[r]))throw new Error("transition not found");return t}function Um(n,r){var i,o,s,t=n.__transition,a=!0;if(t){for(s in r=null==r?null:r+"",t)(i=t[s]).name===r?(o=i.state>2&&i.state<5,i.state=6,i.timer.stop(),o&&i.on.call("interrupt",n,n.__data__,i.index,i.group),delete t[s]):a=!1;a&&delete n.__transition}}function kG(n,r){var t,i;return function(){var o=Bm(this,n),a=o.tween;if(a!==t)for(var s=0,u=(i=t=a).length;s=0&&(r=r.slice(0,t)),!r||"start"===r})}(r)?_N:Bm;return function(){var s=a(this,n),u=s.on;u!==i&&(o=(i=u).copy()).on(r,t),s.on=o}}var rY=Hl.prototype.constructor;function cY(n,r,t){function i(){var o=this,a=r.apply(o,arguments);return a&&function(s){o.style.setProperty(n,a(s),t)}}return i._value=r,i}var vY=0;function Qc(n,r,t,i){this._groups=n,this._parents=r,this._name=t,this._id=i}function pM(n){return Hl().transition(n)}function p8(){return++vY}var I_=Hl.prototype;function gY(n){return n*n*n}function _Y(n){return--n*n*n+1}function bN(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}Qc.prototype=pM.prototype={constructor:Qc,select:function(n){var r=this._name,t=this._id;"function"!=typeof n&&(n=Sm(n));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s1&&i.name===r)return new Qc([[n]],CY,r,+o);return null}function f8(n){return function(){return n}}function TY(n,r,t){this.target=n,this.type=r,this.selection=t}function h8(){On.stopImmediatePropagation()}function fM(){On.preventDefault(),On.stopImmediatePropagation()}var m8={name:"drag"},SN={name:"space"},R_={name:"handle"},N_={name:"center"},hM={name:"x",handles:["e","w"].map(D1),input:function(r,t){return r&&[[r[0],t[0][1]],[r[1],t[1][1]]]},output:function(r){return r&&[r[0][0],r[1][0]]}},mM={name:"y",handles:["n","s"].map(D1),input:function(r,t){return r&&[[t[0][0],r[0]],[t[1][0],r[1]]]},output:function(r){return r&&[r[0][1],r[1][1]]}},xY={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(D1),input:function(r){return r},output:function(r){return r}},up={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},v8={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},g8={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},wY={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},EY={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function D1(n){return{type:n}}function kY(){return!On.button}function MY(){var n=this.ownerSVGElement||this;return[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]}function TN(n){for(;!n.__brush;)if(!(n=n.parentNode))return;return n.__brush}function xN(n){return n[0][0]===n[1][0]||n[0][1]===n[1][1]}function AY(n){var r=n.__brush;return r?r.dim.output(r.selection):null}function DY(){return wN(hM)}function OY(){return wN(mM)}function PY(){return wN(xY)}function wN(n){var a,r=MY,t=kY,i=Cm(s,"start","brush","end"),o=6;function s(L){var G=L.property("__brush",P).selectAll(".overlay").data([D1("overlay")]);G.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",up.overlay).merge(G).each(function(){var te=TN(this).extent;ni(this).attr("x",te[0][0]).attr("y",te[0][1]).attr("width",te[1][0]-te[0][0]).attr("height",te[1][1]-te[0][1])}),L.selectAll(".selection").data([D1("selection")]).enter().append("rect").attr("class","selection").attr("cursor",up.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var Y=L.selectAll(".handle").data(n.handles,function(te){return te.type});Y.exit().remove(),Y.enter().append("rect").attr("class",function(te){return"handle handle--"+te.type}).attr("cursor",function(te){return up[te.type]}),L.each(u).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",C)}function u(){var L=ni(this),G=TN(this).selection;G?(L.selectAll(".selection").style("display",null).attr("x",G[0][0]).attr("y",G[0][1]).attr("width",G[1][0]-G[0][0]).attr("height",G[1][1]-G[0][1]),L.selectAll(".handle").style("display",null).attr("x",function(Y){return"e"===Y.type[Y.type.length-1]?G[1][0]-o/2:G[0][0]-o/2}).attr("y",function(Y){return"s"===Y.type[0]?G[1][1]-o/2:G[0][1]-o/2}).attr("width",function(Y){return"n"===Y.type||"s"===Y.type?G[1][0]-G[0][0]+o:o}).attr("height",function(Y){return"e"===Y.type||"w"===Y.type?G[1][1]-G[0][1]+o:o})):L.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function p(L,G){return L.__brush.emitter||new m(L,G)}function m(L,G){this.that=L,this.args=G,this.state=L.__brush,this.active=0}function C(){if(On.touches){if(On.changedTouches.lengthMath.abs(Ci[1]-ai[1])?ir=!0:jr=!0),ai=Ci,er=!0,fM(),or()}function or(){var Ci;switch(xn=ai[0]-Gr[0],Fn=ai[1]-Gr[1],Y){case SN:case m8:te&&(xn=Math.max(at-pt,Math.min(pn-Wt,xn)),Je=pt+xn,ot=Wt+xn),de&&(Fn=Math.max(et-It,Math.min(Dt-mn,Fn)),Et=It+Fn,dn=mn+Fn);break;case R_:te<0?(xn=Math.max(at-pt,Math.min(pn-pt,xn)),Je=pt+xn,ot=Wt):te>0&&(xn=Math.max(at-Wt,Math.min(pn-Wt,xn)),Je=pt,ot=Wt+xn),de<0?(Fn=Math.max(et-It,Math.min(Dt-It,Fn)),Et=It+Fn,dn=mn):de>0&&(Fn=Math.max(et-mn,Math.min(Dt-mn,Fn)),Et=It,dn=mn+Fn);break;case N_:te&&(Je=Math.max(at,Math.min(pn,pt-xn*te)),ot=Math.max(at,Math.min(pn,Wt+xn*te))),de&&(Et=Math.max(et,Math.min(Dt,It-Fn*de)),dn=Math.max(et,Math.min(Dt,mn+Fn*de)))}ot0&&(pt=Je-xn),de<0?mn=dn-Fn:de>0&&(It=Et-Fn),Y=SN,Bo.attr("cursor",up.selection),or());break;default:return}fM()}function wi(){switch(On.keyCode){case 16:mr&&(jr=ir=mr=!1,or());break;case 18:Y===N_&&(te<0?Wt=ot:te>0&&(pt=Je),de<0?mn=dn:de>0&&(It=Et),Y=R_,or());break;case 32:Y===SN&&(On.altKey?(te&&(Wt=ot-xn*te,pt=Je+xn*te),de&&(mn=dn-Fn*de,It=Et+Fn*de),Y=N_):(te<0?Wt=ot:te>0&&(pt=Je),de<0?mn=dn:de>0&&(It=Et),Y=R_),Bo.attr("cursor",up[G]),or());break;default:return}fM()}}function P(){var L=this.__brush||{selection:null};return L.extent=r.apply(this,arguments),L.dim=n,L}return s.move=function(L,G){L.selection?L.on("start.brush",function(){p(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){p(this,arguments).end()}).tween("brush",function(){var Y=this,te=Y.__brush,de=p(Y,arguments),Me=te.selection,st=n.input("function"==typeof G?G.apply(this,arguments):G,te.extent),tt=sl(Me,st);function at(pt){te.selection=1===pt&&xN(st)?null:tt(pt),u.call(Y),de.brush()}return Me&&st?at:at(1)}):L.each(function(){var Y=this,te=arguments,de=Y.__brush,Me=n.input("function"==typeof G?G.apply(Y,te):G,de.extent),st=p(Y,te).beforestart();Um(Y),de.selection=null==Me||xN(Me)?null:Me,u.call(Y),st.start().brush().end()})},m.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},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(G){Rf(new TY(s,G,n.output(this.state.selection)),i.apply,i,[G,this.that,this.args])}},s.extent=function(L){return arguments.length?(r="function"==typeof L?L:f8([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),s):r},s.filter=function(L){return arguments.length?(t="function"==typeof L?L:f8(!!L),s):t},s.handleSize=function(L){return arguments.length?(o=+L,s):o},s.on=function(){var L=i.on.apply(i,arguments);return L===i?s:L},s}var _8=Math.cos,y8=Math.sin,b8=Math.PI,vM=b8/2,C8=2*b8,S8=Math.max;function IY(n){return function(r,t){return n(r.source.value+r.target.value,t.source.value+t.target.value)}}function RY(){var n=0,r=null,t=null,i=null;function o(a){var G,Y,te,de,Me,st,s=a.length,u=[],p=is(s),m=[],C=[],P=C.groups=new Array(s),L=new Array(s*s);for(G=0,Me=-1;++MeHm)if(Math.abs(P*p-m*C)>Hm&&a){var G=i-s,Y=o-u,te=p*p+m*m,de=G*G+Y*Y,Me=Math.sqrt(te),st=Math.sqrt(L),tt=a*Math.tan((kN-Math.acos((te+L-de)/(2*Me*st)))/2),at=tt/st,pt=tt/Me;Math.abs(at-1)>Hm&&(this._+="L"+(r+at*C)+","+(t+at*P)),this._+="A"+a+","+a+",0,0,"+ +(P*G>C*Y)+","+(this._x1=r+pt*p)+","+(this._y1=t+pt*m)}else this._+="L"+(this._x1=r)+","+(this._y1=t)},arc:function(r,t,i,o,a,s){r=+r,t=+t,s=!!s;var u=(i=+i)*Math.cos(o),p=i*Math.sin(o),m=r+u,C=t+p,P=1^s,L=s?o-a:a-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+m+","+C:(Math.abs(this._x1-m)>Hm||Math.abs(this._y1-C)>Hm)&&(this._+="L"+m+","+C),i&&(L<0&&(L=L%MN+MN),L>ZY?this._+="A"+i+","+i+",0,1,"+P+","+(r-u)+","+(t-p)+"A"+i+","+i+",0,1,"+P+","+(this._x1=m)+","+(this._y1=C):L>Hm&&(this._+="A"+i+","+i+",0,"+ +(L>=kN)+","+P+","+(this._x1=r+i*Math.cos(a))+","+(this._y1=t+i*Math.sin(a))))},rect:function(r,t,i,o){this._+="M"+(this._x0=this._x1=+r)+","+(this._y0=this._y1=+t)+"h"+ +i+"v"+ +o+"h"+-i+"Z"},toString:function(){return this._}};var tc=T8;function LY(n){return n.source}function FY(n){return n.target}function BY(n){return n.radius}function UY(n){return n.startAngle}function HY(n){return n.endAngle}function VY(){var n=LY,r=FY,t=BY,i=UY,o=HY,a=null;function s(){var u,p=NY.call(arguments),m=n.apply(this,p),C=r.apply(this,p),P=+t.apply(this,(p[0]=m,p)),L=i.apply(this,p)-vM,G=o.apply(this,p)-vM,Y=P*_8(L),te=P*y8(L),de=+t.apply(this,(p[0]=C,p)),Me=i.apply(this,p)-vM,st=o.apply(this,p)-vM;if(a||(a=u=tc()),a.moveTo(Y,te),a.arc(0,0,P,L,G),(L!==Me||G!==st)&&(a.quadraticCurveTo(0,0,de*_8(Me),de*y8(Me)),a.arc(0,0,de,Me,st)),a.quadraticCurveTo(0,0,Y,te),a.closePath(),u)return a=null,u+""||null}return s.radius=function(u){return arguments.length?(t="function"==typeof u?u:EN(+u),s):t},s.startAngle=function(u){return arguments.length?(i="function"==typeof u?u:EN(+u),s):i},s.endAngle=function(u){return arguments.length?(o="function"==typeof u?u:EN(+u),s):o},s.source=function(u){return arguments.length?(n=u,s):n},s.target=function(u){return arguments.length?(r=u,s):r},s.context=function(u){return arguments.length?(a=null==u?null:u,s):a},s}var wu="$";function gM(){}function x8(n,r){var t=new gM;if(n instanceof gM)n.each(function(u,p){t.set(p,u)});else if(Array.isArray(n)){var a,i=-1,o=n.length;if(null==r)for(;++i=n.length)return null!=t&&u.sort(t),null!=i?i(u):u;for(var Y,te,Me,P=-1,L=u.length,G=n[p++],de=Hf(),st=m();++Pn.length)return u;var m,C=r[p-1];return null!=i&&p>=n.length?m=u.entries():(m=[],u.each(function(P,L){m.push({key:L,values:s(P,p)})})),null!=C?m.sort(function(P,L){return C(P.key,L.key)}):m}return o={object:function(p){return a(p,0,jY,zY)},map:function(p){return a(p,0,w8,E8)},entries:function(p){return s(a(p,0,w8,E8),0)},key:function(p){return n.push(p),o},sortKeys:function(p){return r[n.length-1]=p,o},sortValues:function(p){return t=p,o},rollup:function(p){return i=p,o}}}function jY(){return{}}function zY(n,r,t){n[r]=t}function w8(){return Hf()}function E8(n,r,t){n.set(r,t)}function _M(){}var Vm=Hf.prototype;function k8(n,r){var t=new _M;if(n instanceof _M)n.each(function(a){t.add(a)});else if(n){var i=-1,o=n.length;if(null==r)for(;++ii!=G>i&&t<(L-m)*(i-C)/(G-C)+m&&(o=-o)}return o}function tJ(n,r,t){var i;return function(n,r,t){return(r[0]-n[0])*(t[1]-n[1])==(t[0]-n[0])*(r[1]-n[1])}(n,r,t)&&function(n,r,t){return n<=r&&r<=t||t<=r&&r<=n}(n[i=+(n[0]===r[0])],t[i],r[i])}function iJ(){}var cp=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function A8(){var n=1,r=1,t=mm,i=p;function o(m){var C=t(m);if(Array.isArray(C))C=C.slice().sort(KY);else{var P=KC(m),L=P[0],G=P[1];C=ip(L,G,C),C=is(Math.floor(L/C)*C,Math.floor(G/C)*C,C)}return C.map(function(Y){return a(m,Y)})}function a(m,C){var P=[],L=[];return function(m,C,P){var Y,te,Me,st,tt,L=new Array,G=new Array;for(Y=te=-1,cp[(Me=m[0]>=C)<<1].forEach(at);++Y=C)<<1].forEach(at);for(cp[Me<<0].forEach(at);++te=C)<<1|(st=m[te*n]>=C)<<2].forEach(at);++Y=C)<<1|(st=m[te*n+Y+1]>=C)<<2|tt<<3].forEach(at);cp[Me|st<<3].forEach(at)}for(Y=-1,cp[(st=m[te*n]>=C)<<2].forEach(at);++Y=C)<<2|tt<<3].forEach(at);function at(pt){var pn,Wt,Je=[pt[0][0]+Y,pt[0][1]+te],et=[pt[1][0]+Y,pt[1][1]+te],It=u(Je),Et=u(et);(pn=G[It])?(Wt=L[Et])?(delete G[pn.end],delete L[Wt.start],pn===Wt?(pn.ring.push(et),P(pn.ring)):L[pn.start]=G[Wt.end]={start:pn.start,end:Wt.end,ring:pn.ring.concat(Wt.ring)}):(delete G[pn.end],pn.ring.push(et),G[pn.end=Et]=pn):(pn=L[Et])?(Wt=G[It])?(delete L[pn.start],delete G[Wt.end],pn===Wt?(pn.ring.push(et),P(pn.ring)):L[Wt.start]=G[pn.end]={start:Wt.start,end:pn.end,ring:Wt.ring.concat(pn.ring)}):(delete L[pn.start],pn.ring.unshift(Je),L[pn.start=It]=pn):L[It]=G[Et]={start:It,end:Et,ring:[Je,et]}}cp[st<<3].forEach(at)}(m,C,function(G){i(G,m,C),function(n){for(var r=0,t=n.length,i=n[t-1][1]*n[0][0]-n[t-1][0]*n[0][1];++r0?P.push([G]):L.push(G)}),L.forEach(function(G){for(var de,Y=0,te=P.length;Y0&&G0&&Y0&&P>0))throw new Error("invalid size");return n=C,r=P,o},o.thresholds=function(m){return arguments.length?(t="function"==typeof m?m:Array.isArray(m)?qm(M8.call(m)):qm(m),o):t},o.smooth=function(m){return arguments.length?(i=m?p:iJ,o):i===p},o}function DN(n,r,t){for(var i=n.width,o=n.height,a=1+(t<<1),s=0;s=t&&(u>=a&&(p-=n.data[u-a+s*i]),r.data[u-t+s*i]=p/Math.min(u+1,i-1+a-u,a))}function ON(n,r,t){for(var i=n.width,o=n.height,a=1+(t<<1),s=0;s=t&&(u>=a&&(p-=n.data[s+(u-a)*i]),r.data[s+(u-t)*i]=p/Math.min(u+1,o-1+a-u,a))}function oJ(n){return n[0]}function aJ(n){return n[1]}function sJ(){var n=oJ,r=aJ,t=960,i=500,o=20,a=2,s=3*o,u=t+2*s>>a,p=i+2*s>>a,m=qm(20);function C(de){var Me=new Float32Array(u*p),st=new Float32Array(u*p);de.forEach(function(pt,Je,et){var It=n(pt,Je,et)+s>>a,Et=r(pt,Je,et)+s>>a;It>=0&&It=0&&Et>a),ON({width:u,height:p,data:st},{width:u,height:p,data:Me},o>>a),DN({width:u,height:p,data:Me},{width:u,height:p,data:st},o>>a),ON({width:u,height:p,data:st},{width:u,height:p,data:Me},o>>a),DN({width:u,height:p,data:Me},{width:u,height:p,data:st},o>>a),ON({width:u,height:p,data:st},{width:u,height:p,data:Me},o>>a);var tt=m(Me);if(!Array.isArray(tt)){var at=e1(Me);tt=ip(0,at,tt),(tt=is(0,Math.floor(at/tt)*tt,tt)).shift()}return A8().thresholds(tt).size([u,p])(Me).map(P)}function P(de){return de.value*=Math.pow(2,-2*a),de.coordinates.forEach(L),de}function L(de){de.forEach(G)}function G(de){de.forEach(Y)}function Y(de){de[0]=de[0]*Math.pow(2,a)-s,de[1]=de[1]*Math.pow(2,a)-s}function te(){return u=t+2*(s=3*o)>>a,p=i+2*s>>a,C}return C.x=function(de){return arguments.length?(n="function"==typeof de?de:qm(+de),C):n},C.y=function(de){return arguments.length?(r="function"==typeof de?de:qm(+de),C):r},C.size=function(de){if(!arguments.length)return[t,i];var Me=Math.ceil(de[0]),st=Math.ceil(de[1]);if(!(Me>=0||Me>=0))throw new Error("invalid size");return t=Me,i=st,te()},C.cellSize=function(de){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(de)/Math.LN2),te()},C.thresholds=function(de){return arguments.length?(m="function"==typeof de?de:Array.isArray(de)?qm(M8.call(de)):qm(de),C):m},C.bandwidth=function(de){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((de=+de)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*de*de+1)-1)/2),te()},C}function yM(n){return function(){return n}}function PN(n,r,t,i,o,a,s,u,p,m){this.target=n,this.type=r,this.subject=t,this.identifier=i,this.active=o,this.x=a,this.y=s,this.dx=u,this.dy=p,this._=m}function lJ(){return!On.ctrlKey&&!On.button}function uJ(){return this.parentNode}function cJ(n){return null==n?{x:On.x,y:On.y}:n}function dJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vf(){var u,p,m,C,n=lJ,r=uJ,t=cJ,i=dJ,o={},a=Cm("start","drag","end"),s=0,P=0;function L(at){at.on("mousedown.drag",G).filter(i).on("touchstart.drag",de).on("touchmove.drag",Me).on("touchend.drag touchcancel.drag",st).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function G(){if(!C&&n.apply(this,arguments)){var at=tt("mouse",r.apply(this,arguments),Fs,this,arguments);!at||(ni(On.view).on("mousemove.drag",Y,!0).on("mouseup.drag",te,!0),Em(On.view),v1(),m=!1,u=On.clientX,p=On.clientY,at("start"))}}function Y(){if(Lf(),!m){var at=On.clientX-u,pt=On.clientY-p;m=at*at+pt*pt>P}o.mouse("drag")}function te(){ni(On.view).on("mousemove.drag mouseup.drag",null),A_(On.view,m),Lf(),o.mouse("end")}function de(){if(n.apply(this,arguments)){var et,It,at=On.changedTouches,pt=r.apply(this,arguments),Je=at.length;for(et=0;et=L?de=!0:10===(Je=m.charCodeAt(G++))?Me=!0:13===Je&&(Me=!0,10===m.charCodeAt(G)&&++G),m.slice(pt+1,at-1).replace(/""/g,'"')}for(;G=(P=(u+m)/2))?u=P:m=P,(de=t>=(L=(p+C)/2))?p=L:C=L,o=a,!(a=a[Me=de<<1|te]))return o[Me]=s,n;if(G=+n._x.call(null,a.data),Y=+n._y.call(null,a.data),r===G&&t===Y)return s.next=a,o?o[Me]=s:n._root=s,n;do{o=o?o[Me]=new Array(4):n._root=new Array(4),(te=r>=(P=(u+m)/2))?u=P:m=P,(de=t>=(L=(p+C)/2))?p=L:C=L}while((Me=de<<1|te)==(st=(Y>=L)<<1|G>=P));return o[st]=a,o[Me]=s,n}function Us(n,r,t,i,o){this.node=n,this.x0=r,this.y0=t,this.x1=i,this.y1=o}function aQ(n){return n[0]}function lQ(n){return n[1]}function TM(n,r,t){var i=new VN(null==r?aQ:r,null==t?lQ:t,NaN,NaN,NaN,NaN);return null==n?i:i.addAll(n)}function VN(n,r,t,i,o,a){this._x=n,this._y=r,this._x0=t,this._y0=i,this._x1=o,this._y1=a,this._root=void 0}function V8(n){for(var r={data:n.data},t=r;n=n.next;)t=t.next={data:n.data};return r}var Hs=TM.prototype=VN.prototype;function cQ(n){return n.x+n.vx}function dQ(n){return n.y+n.vy}function pQ(n){var r,t,i=1,o=1;function a(){for(var p,C,P,L,G,Y,te,m=r.length,de=0;deL+Et||ptG+Et||JeP.index){var pn=L-et.x-et.vx,Wt=G-et.y-et.vy,ot=pn*pn+Wt*Wt;otp.r&&(p.r=p[m].r)}function u(){if(r){var p,C,m=r.length;for(t=new Array(m),p=0;pC&&(C=o),aP&&(P=a));if(p>C||m>P)return this;for(this.cover(p,m).cover(C,P),t=0;tn||n>=o||i>r||r>=a;)switch(m=(rC||(u=Y.y0)>P||(p=Y.x1)=Me)<<1|n>=de)&&(Y=L[L.length-1],L[L.length-1]=L[L.length-1-te],L[L.length-1-te]=Y)}else{var st=n-+this._x.call(null,G.data),tt=r-+this._y.call(null,G.data),at=st*st+tt*tt;if(at=(L=(s+p)/2))?s=L:p=L,(te=P>=(G=(u+m)/2))?u=G:m=G,r=t,!(t=t[de=te<<1|Y]))return this;if(!t.length)break;(r[de+1&3]||r[de+2&3]||r[de+3&3])&&(i=r,Me=de)}for(;t.data!==n;)if(o=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,o?(a?o.next=a:delete o.next,this):r?(a?r[de]=a:delete r[de],(t=r[0]||r[1]||r[2]||r[3])&&t===(r[3]||r[2]||r[1]||r[0])&&!t.length&&(i?i[Me]=t:this._root=t),this):(this._root=a,this)},Hs.removeAll=function(n){for(var r=0,t=n.length;r1?(null==de?u.remove(te):u.set(te,G(de)),r):u.get(te)},find:function(te,de,Me){var at,pt,Je,et,It,st=0,tt=n.length;for(null==Me?Me=1/0:Me*=Me,st=0;st1?(m.on(te,de),r):m.on(te)}}}function bQ(){var n,r,t,o,i=La(-30),a=1,s=1/0,u=.81;function p(L){var G,Y=n.length,te=TM(n,mQ,vQ).visitAfter(C);for(t=L,G=0;G=s)){(L.data!==r||L.next)&&(0===de&&(tt+=(de=jf())*de),0===Me&&(tt+=(Me=jf())*Me),tt1?i[0]+i.slice(2):i,+n.slice(t+1)]}function L_(n){return(n=xM(Math.abs(n)))?n[1]:NaN}function z8(n,r){var t=xM(n,r);if(!t)return n+"";var i=t[0],o=t[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}var W8={"":function(n,r){e:for(var a,t=(n=n.toPrecision(r)).length,i=1,o=-1;i0&&(o=0)}return o>0?n.slice(0,o)+n.slice(a+1):n},"%":function(r,t){return(100*r).toFixed(t)},b:function(r){return Math.round(r).toString(2)},c:function(r){return r+""},d:function(r){return Math.round(r).toString(10)},e:function(r,t){return r.toExponential(t)},f:function(r,t){return r.toFixed(t)},g:function(r,t){return r.toPrecision(t)},o:function(r){return Math.round(r).toString(8)},p:function(r,t){return z8(100*r,t)},r:z8,s:function(n,r){var t=xM(n,r);if(!t)return n+"";var i=t[0],o=t[1],a=o-(j8=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=i.length;return a===s?i:a>s?i+new Array(a-s+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+xM(n,Math.max(0,r+a-1))[0]},X:function(r){return Math.round(r).toString(16).toUpperCase()},x:function(r){return Math.round(r).toString(16)}},MQ=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function I1(n){return new qN(n)}function qN(n){if(!(r=MQ.exec(n)))throw new Error("invalid format: "+n);var r,t=r[1]||" ",i=r[2]||">",o=r[3]||"-",a=r[4]||"",s=!!r[5],u=r[6]&&+r[6],p=!!r[7],m=r[8]&&+r[8].slice(1),C=r[9]||"";"n"===C?(p=!0,C="g"):W8[C]||(C=""),(s||"0"===t&&"="===i)&&(s=!0,t="0",i="="),this.fill=t,this.align=i,this.sign=o,this.symbol=a,this.zero=s,this.width=u,this.comma=p,this.precision=m,this.type=C}function G8(n){return n}I1.prototype=qN.prototype,qN.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var wM,EM,jN,Y8=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function J8(n){var r=n.grouping&&n.thousands?function(n,r){return function(t,i){for(var o=t.length,a=[],s=0,u=n[0],p=0;o>0&&u>0&&(p+u+1>i&&(u=Math.max(1,i-p)),a.push(t.substring(o-=u,o+u)),!((p+=u+1)>i));)u=n[s=(s+1)%n.length];return a.reverse().join(r)}}(n.grouping,n.thousands):G8,t=n.currency,i=n.decimal,o=n.numerals?function(n){return function(r){return r.replace(/[0-9]/g,function(t){return n[+t]})}}(n.numerals):G8,a=n.percent||"%";function s(p){var m=(p=I1(p)).fill,C=p.align,P=p.sign,L=p.symbol,G=p.zero,Y=p.width,te=p.comma,de=p.precision,Me=p.type,st="$"===L?t[0]:"#"===L&&/[boxX]/.test(Me)?"0"+Me.toLowerCase():"",tt="$"===L?t[1]:/[%p]/.test(Me)?a:"",at=W8[Me],pt=!Me||/[defgprs%]/.test(Me);function Je(et){var pn,Wt,ot,It=st,Et=tt;if("c"===Me)Et=at(et)+Et,et="";else{var Dt=(et=+et)<0;if(et=at(Math.abs(et),de),Dt&&0==+et&&(Dt=!1),It=(Dt?"("===P?P:"-":"-"===P||"("===P?"":P)+It,Et=("s"===Me?Y8[8+j8/3]:"")+Et+(Dt&&"("===P?")":""),pt)for(pn=-1,Wt=et.length;++pn(ot=et.charCodeAt(pn))||ot>57){Et=(46===ot?i+et.slice(pn+1):et.slice(pn))+Et,et=et.slice(0,pn);break}}te&&!G&&(et=r(et,1/0));var mn=It.length+et.length+Et.length,dn=mn>1)+It+et+Et+dn.slice(mn);break;default:et=dn+It+et+Et}return o(et)}return de=null==de?Me?6:12:/[gprs]/.test(Me)?Math.max(1,Math.min(21,de)):Math.max(0,Math.min(20,de)),Je.toString=function(){return p+""},Je}return{format:s,formatPrefix:function(p,m){var C=s(((p=I1(p)).type="f",p)),P=3*Math.max(-8,Math.min(8,Math.floor(L_(m)/3))),L=Math.pow(10,-P),G=Y8[8+P/3];return function(Y){return C(L*Y)+G}}}}function Q8(n){return wM=J8(n),EM=wM.format,jN=wM.formatPrefix,wM}function K8(n){return Math.max(0,-L_(Math.abs(n)))}function X8(n,r){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(L_(r)/3)))-L_(Math.abs(n)))}function $8(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,L_(r)-L_(n))+1}function zf(){return new kM}function kM(){this.reset()}Q8({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),kM.prototype={constructor:kM,reset:function(){this.s=this.t=0},add:function(r){e7(MM,r,this.t),e7(this,MM.s,this.s),this.s?this.t+=MM.t:this.s=MM.t},valueOf:function(){return this.s}};var MM=new kM;function e7(n,r,t){var i=n.s=r+t,o=i-r;n.t=r-(i-o)+(t-o)}var Cr=1e-6,Oi=Math.PI,ia=Oi/2,AM=Oi/4,ll=2*Oi,wo=180/Oi,Ar=Oi/180,Vi=Math.abs,F_=Math.atan,Vs=Math.atan2,Sr=Math.cos,DM=Math.ceil,n7=Math.exp,OM=(Math,Math.log),zN=Math.pow,cr=Math.sin,R1=Math.sign||function(n){return n>0?1:n<0?-1:0},Fa=Math.sqrt,WN=Math.tan;function r7(n){return n>1?0:n<-1?Oi:Math.acos(n)}function zl(n){return n>1?ia:n<-1?-ia:Math.asin(n)}function i7(n){return(n=cr(n/2))*n}function Jo(){}function PM(n,r){n&&a7.hasOwnProperty(n.type)&&a7[n.type](n,r)}var o7={Feature:function(r,t){PM(r.geometry,t)},FeatureCollection:function(r,t){for(var i=r.features,o=-1,a=i.length;++o=0?1:-1,o=i*t,a=Sr(r=(r*=Ar)/2+AM),s=cr(r),u=QN*s,p=JN*a+u*Sr(o),m=u*i*cr(o);IM.add(Vs(m,p)),YN=n,JN=a,QN=s}function PQ(n){return RM.reset(),nc(n,Kc),2*RM}function NM(n){return[Vs(n[1],n[0]),zl(n[2])]}function jm(n){var r=n[0],t=n[1],i=Sr(t);return[i*Sr(r),i*cr(r),cr(t)]}function ZM(n,r){return n[0]*r[0]+n[1]*r[1]+n[2]*r[2]}function B_(n,r){return[n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]}function KN(n,r){n[0]+=r[0],n[1]+=r[1],n[2]+=r[2]}function LM(n,r){return[n[0]*r,n[1]*r,n[2]*r]}function FM(n){var r=Fa(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=r,n[1]/=r,n[2]/=r}var oa,Wl,ua,Eu,zm,d7,p7,U_,Wf,dp,N1=zf(),pp={point:XN,lineStart:h7,lineEnd:m7,polygonStart:function(){pp.point=v7,pp.lineStart=IQ,pp.lineEnd=RQ,N1.reset(),Kc.polygonStart()},polygonEnd:function(){Kc.polygonEnd(),pp.point=XN,pp.lineStart=h7,pp.lineEnd=m7,IM<0?(oa=-(ua=180),Wl=-(Eu=90)):N1>Cr?Eu=90:N1<-Cr&&(Wl=-90),dp[0]=oa,dp[1]=ua}};function XN(n,r){Wf.push(dp=[oa=n,ua=n]),rEu&&(Eu=r)}function f7(n,r){var t=jm([n*Ar,r*Ar]);if(U_){var i=B_(U_,t),a=B_([i[1],-i[0],0],i);FM(a),a=NM(a);var m,s=n-zm,u=s>0?1:-1,p=a[0]*wo*u,C=Vi(s)>180;C^(u*zmEu&&(Eu=m):C^(u*zm<(p=(p+360)%360-180)&&pEu&&(Eu=r)),C?nGl(oa,ua)&&(ua=n):Gl(n,ua)>Gl(oa,ua)&&(oa=n):ua>=oa?(nua&&(ua=n)):n>zm?Gl(oa,n)>Gl(oa,ua)&&(ua=n):Gl(n,ua)>Gl(oa,ua)&&(oa=n)}else Wf.push(dp=[oa=n,ua=n]);rEu&&(Eu=r),U_=t,zm=n}function h7(){pp.point=f7}function m7(){dp[0]=oa,dp[1]=ua,pp.point=XN,U_=null}function v7(n,r){if(U_){var t=n-zm;N1.add(Vi(t)>180?t+(t>0?360:-360):t)}else d7=n,p7=r;Kc.point(n,r),f7(n,r)}function IQ(){Kc.lineStart()}function RQ(){v7(d7,p7),Kc.lineEnd(),Vi(N1)>Cr&&(oa=-(ua=180)),dp[0]=oa,dp[1]=ua,U_=null}function Gl(n,r){return(r-=n)<0?r+360:r}function NQ(n,r){return n[0]-r[0]}function g7(n,r){return n[0]<=n[1]?n[0]<=r&&r<=n[1]:rGl(i[0],i[1])&&(i[1]=o[1]),Gl(o[0],i[1])>Gl(i[0],i[1])&&(i[0]=o[0])):a.push(i=o);for(s=-1/0,r=0,i=a[t=a.length-1];r<=t;i=o,++r)(u=Gl(i[1],(o=a[r])[0]))>s&&(s=u,oa=o[0],ua=i[1])}return Wf=dp=null,oa===1/0||Wl===1/0?[[NaN,NaN],[NaN,NaN]]:[[oa,Wl],[ua,Eu]]}var Z1,BM,UM,HM,VM,qM,jM,zM,$N,e6,t6,_7,y7,qs,js,zs,rc={sphere:Jo,point:n6,lineStart:b7,lineEnd:C7,polygonStart:function(){rc.lineStart=BQ,rc.lineEnd=UQ},polygonEnd:function(){rc.lineStart=b7,rc.lineEnd=C7}};function n6(n,r){n*=Ar;var t=Sr(r*=Ar);L1(t*Sr(n),t*cr(n),cr(r))}function L1(n,r,t){++Z1,UM+=(n-UM)/Z1,HM+=(r-HM)/Z1,VM+=(t-VM)/Z1}function b7(){rc.point=LQ}function LQ(n,r){n*=Ar;var t=Sr(r*=Ar);qs=t*Sr(n),js=t*cr(n),zs=cr(r),rc.point=FQ,L1(qs,js,zs)}function FQ(n,r){n*=Ar;var t=Sr(r*=Ar),i=t*Sr(n),o=t*cr(n),a=cr(r),s=Vs(Fa((s=js*a-zs*o)*s+(s=zs*i-qs*a)*s+(s=qs*o-js*i)*s),qs*i+js*o+zs*a);BM+=s,qM+=s*(qs+(qs=i)),jM+=s*(js+(js=o)),zM+=s*(zs+(zs=a)),L1(qs,js,zs)}function C7(){rc.point=n6}function BQ(){rc.point=HQ}function UQ(){S7(_7,y7),rc.point=n6}function HQ(n,r){_7=n,y7=r,n*=Ar,r*=Ar,rc.point=S7;var t=Sr(r);qs=t*Sr(n),js=t*cr(n),zs=cr(r),L1(qs,js,zs)}function S7(n,r){n*=Ar;var t=Sr(r*=Ar),i=t*Sr(n),o=t*cr(n),a=cr(r),s=js*a-zs*o,u=zs*i-qs*a,p=qs*o-js*i,m=Fa(s*s+u*u+p*p),C=zl(m),P=m&&-C/m;$N+=P*s,e6+=P*u,t6+=P*p,BM+=C,qM+=C*(qs+(qs=i)),jM+=C*(js+(js=o)),zM+=C*(zs+(zs=a)),L1(qs,js,zs)}function VQ(n){Z1=BM=UM=HM=VM=qM=jM=zM=$N=e6=t6=0,nc(n,rc);var r=$N,t=e6,i=t6,o=r*r+t*t+i*i;return o<1e-12&&(r=qM,t=jM,i=zM,BMOi?n-ll:n<-Oi?n+ll:n,r]}function o6(n,r,t){return(n%=ll)?r||t?r6(x7(n),w7(r,t)):x7(n):r||t?w7(r,t):i6}function T7(n){return function(r,t){return[(r+=n)>Oi?r-ll:r<-Oi?r+ll:r,t]}}function x7(n){var r=T7(n);return r.invert=T7(-n),r}function w7(n,r){var t=Sr(n),i=cr(n),o=Sr(r),a=cr(r);function s(u,p){var m=Sr(p),C=Sr(u)*m,P=cr(u)*m,L=cr(p),G=L*t+C*i;return[Vs(P*o-G*a,C*t-L*i),zl(G*o+P*a)]}return s.invert=function(u,p){var m=Sr(p),C=Sr(u)*m,P=cr(u)*m,L=cr(p),G=L*o-P*a;return[Vs(P*o+L*a,C*t+G*i),zl(G*t-C*i)]},s}function E7(n){function r(t){return(t=n(t[0]*Ar,t[1]*Ar))[0]*=wo,t[1]*=wo,t}return n=o6(n[0]*Ar,n[1]*Ar,n.length>2?n[2]*Ar:0),r.invert=function(t){return(t=n.invert(t[0]*Ar,t[1]*Ar))[0]*=wo,t[1]*=wo,t},r}function k7(n,r,t,i,o,a){if(t){var s=Sr(r),u=cr(r),p=i*t;null==o?(o=r+i*ll,a=r-p/2):(o=M7(s,o),a=M7(s,a),(i>0?oa)&&(o+=i*ll));for(var m,C=o;i>0?C>a:C1&&n.push(n.pop().concat(n.shift()))},result:function(){var i=n;return n=[],r=null,i}}}function WM(n,r){return Vi(n[0]-r[0])=0;--u)o.point((P=C[u])[0],P[1]);else i(L.x,L.p.x,-1,o);L=L.p}C=(L=L.o).z,G=!G}while(!L.v);o.lineEnd()}}}function O7(n){if(r=n.length){for(var r,o,t=0,i=n[0];++t=0?1:-1,Et=It*et,pn=Et>Oi,Wt=te*pt;if(a6.add(Vs(Wt*It*cr(Et),de*Je+Wt*Sr(Et))),s+=pn?et+It*ll:et,pn^G>=t^tt>=t){var ot=B_(jm(L),jm(st));FM(ot);var Dt=B_(a,ot);FM(Dt);var mn=(pn^et>=0?-1:1)*zl(Dt[2]);(i>mn||i===mn&&(ot[0]||ot[1]))&&(u+=pn^et>=0?1:-1)}}return(s<-Cr||s0){for(p||(o.polygonStart(),p=!0),o.lineStart(),Je=0;Je1&&2&at&&pt.push(pt.pop().concat(pt.shift())),C.push(pt.filter(jQ))}}return L}}function jQ(n){return n.length>1}function zQ(n,r){return((n=n.x)[0]<0?n[1]-ia-Cr:ia-n[1])-((r=r.x)[0]<0?r[1]-ia-Cr:ia-r[1])}var s6=I7(function(){return!0},function(n){var o,r=NaN,t=NaN,i=NaN;return{lineStart:function(){n.lineStart(),o=1},point:function(s,u){var p=s>0?Oi:-Oi,m=Vi(s-r);Vi(m-Oi)0?ia:-ia),n.point(i,t),n.lineEnd(),n.lineStart(),n.point(p,t),n.point(s,t),o=0):i!==p&&m>=Oi&&(Vi(r-i)Cr?F_((cr(r)*(a=Sr(i))*cr(t)-cr(i)*(o=Sr(r))*cr(n))/(o*a*s)):(r+i)/2}(r,t,s,u),n.point(i,t),n.lineEnd(),n.lineStart(),n.point(p,t),o=0),n.point(r=s,t=u),i=p},lineEnd:function(){n.lineEnd(),r=t=NaN},clean:function(){return 2-o}}},function(n,r,t,i){var o;if(null==n)i.point(-Oi,o=t*ia),i.point(0,o),i.point(Oi,o),i.point(Oi,0),i.point(Oi,-o),i.point(0,-o),i.point(-Oi,-o),i.point(-Oi,0),i.point(-Oi,o);else if(Vi(n[0]-r[0])>Cr){var a=n[0]0,o=Vi(r)>Cr;function s(C,P){return Sr(C)*Sr(P)>r}function p(C,P,L){var te=[1,0,0],de=B_(jm(C),jm(P)),Me=ZM(de,de),st=de[0],tt=Me-st*st;if(!tt)return!L&&C;var at=r*Me/tt,pt=-r*st/tt,Je=B_(te,de),et=LM(te,at);KN(et,LM(de,pt));var Et=Je,pn=ZM(et,Et),Wt=ZM(Et,Et),ot=pn*pn-Wt*(ZM(et,et)-1);if(!(ot<0)){var Dt=Fa(ot),mn=LM(Et,(-pn-Dt)/Wt);if(KN(mn,et),mn=NM(mn),!L)return mn;var mr,dn=C[0],xn=P[0],Fn=C[1],er=P[1];xn0^mn[1]<(Vi(mn[0]-dn)Oi^(dn<=mn[0]&&mn[0]<=xn)){var ai=LM(Et,(-pn+Dt)/Wt);return KN(ai,et),[mn,NM(ai)]}}}function m(C,P){var L=i?n:Oi-n,G=0;return C<-L?G|=1:C>L&&(G|=2),P<-L?G|=4:P>L&&(G|=8),G}return I7(s,function(C){var P,L,G,Y,te;return{lineStart:function(){Y=G=!1,te=1},point:function(Me,st){var at,tt=[Me,st],pt=s(Me,st),Je=i?pt?0:m(Me,st):pt?m(Me+(Me<0?Oi:-Oi),st):0;if(!P&&(Y=G=pt)&&C.lineStart(),pt!==G&&(!(at=p(P,tt))||WM(P,at)||WM(tt,at))&&(tt[0]+=Cr,tt[1]+=Cr,pt=s(tt[0],tt[1])),pt!==G)te=0,pt?(C.lineStart(),at=p(tt,P),C.point(at[0],at[1])):(at=p(P,tt),C.point(at[0],at[1]),C.lineEnd()),P=at;else if(o&&P&&i^pt){var et;!(Je&L)&&(et=p(tt,P,!0))&&(te=0,i?(C.lineStart(),C.point(et[0][0],et[0][1]),C.point(et[1][0],et[1][1]),C.lineEnd()):(C.point(et[1][0],et[1][1]),C.lineEnd(),C.lineStart(),C.point(et[0][0],et[0][1])))}pt&&(!P||!WM(P,tt))&&C.point(tt[0],tt[1]),P=tt,G=pt,L=Je},lineEnd:function(){G&&C.lineEnd(),P=null},clean:function(){return te|(Y&&G)<<1}}},function(C,P,L,G){k7(G,n,t,L,C,P)},i?[0,-n]:[-Oi,n-Oi])}var F1=1e9,YM=-F1;function JM(n,r,t,i){function o(m,C){return n<=m&&m<=t&&r<=C&&C<=i}function a(m,C,P,L){var G=0,Y=0;if(null==m||(G=s(m,P))!==(Y=s(C,P))||p(m,C)<0^P>0)do{L.point(0===G||3===G?n:t,G>1?i:r)}while((G=(G+P+4)%4)!==Y);else L.point(C[0],C[1])}function s(m,C){return Vi(m[0]-n)0?0:3:Vi(m[0]-t)0?2:1:Vi(m[1]-r)0?1:0:C>0?3:2}function u(m,C){return p(m.x,C.x)}function p(m,C){var P=s(m,1),L=s(C,1);return P!==L?P-L:0===P?C[1]-m[1]:1===P?m[0]-C[0]:2===P?m[1]-C[1]:C[0]-m[0]}return function(m){var L,G,Y,te,de,Me,st,tt,at,pt,Je,C=m,P=A7(),et={point:It,lineStart:function(){et.point=mn,G&&G.push(Y=[]),pt=!0,at=!1,st=tt=NaN},lineEnd:function(){L&&(mn(te,de),Me&&at&&P.rejoin(),L.push(P.result())),et.point=It,at&&C.lineEnd()},polygonStart:function(){C=P,L=[],G=[],Je=!0},polygonEnd:function(){var dn=function(){for(var dn=0,xn=0,Fn=G.length;xni&&(vr-Gr)*(i-ai)>(Bi-ai)*(n-Gr)&&++dn:Bi<=i&&(vr-Gr)*(i-ai)<(Bi-ai)*(n-Gr)&&--dn;return dn}(),xn=Je&&dn,Fn=(L=vm(L)).length;(xn||Fn)&&(m.polygonStart(),xn&&(m.lineStart(),a(null,null,1,m),m.lineEnd()),Fn&&D7(L,u,dn,a,m),m.polygonEnd()),C=m,L=G=Y=null}};function It(dn,xn){o(dn,xn)&&C.point(dn,xn)}function mn(dn,xn){var Fn=o(dn,xn);if(G&&Y.push([dn,xn]),pt)te=dn,de=xn,Me=Fn,pt=!1,Fn&&(C.lineStart(),C.point(dn,xn));else if(Fn&&at)C.point(dn,xn);else{var er=[st=Math.max(YM,Math.min(F1,st)),tt=Math.max(YM,Math.min(F1,tt))],mr=[dn=Math.max(YM,Math.min(F1,dn)),xn=Math.max(YM,Math.min(F1,xn))];!function(n,r,t,i,o,a){var Y,s=n[0],u=n[1],C=0,P=1,L=r[0]-s,G=r[1]-u;if(Y=t-s,L||!(Y>0)){if(Y/=L,L<0){if(Y0){if(Y>P)return;Y>C&&(C=Y)}if(Y=o-s,L||!(Y<0)){if(Y/=L,L<0){if(Y>P)return;Y>C&&(C=Y)}else if(L>0){if(Y0)){if(Y/=G,G<0){if(Y0){if(Y>P)return;Y>C&&(C=Y)}if(Y=a-u,G||!(Y<0)){if(Y/=G,G<0){if(Y>P)return;Y>C&&(C=Y)}else if(G>0){if(Y0&&(n[0]=s+C*L,n[1]=u+C*G),P<1&&(r[0]=s+P*L,r[1]=u+P*G),!0}}}}}(er,mr,n,r,t,i)?Fn&&(C.lineStart(),C.point(dn,xn),Je=!1):(at||(C.lineStart(),C.point(er[0],er[1])),C.point(mr[0],mr[1]),Fn||C.lineEnd(),Je=!1)}st=dn,tt=xn,at=Fn}return et}}function QQ(){var o,a,s,n=0,r=0,t=960,i=500;return s={stream:function(p){return o&&a===p?o:o=JM(n,r,t,i)(a=p)},extent:function(p){return arguments.length?(n=+p[0][0],r=+p[0][1],t=+p[1][0],i=+p[1][1],o=a=null,s):[[n,r],[t,i]]}}}var u6,QM,KM,l6=zf(),V_={sphere:Jo,point:Jo,lineStart:function(){V_.point=$Q,V_.lineEnd=XQ},lineEnd:Jo,polygonStart:Jo,polygonEnd:Jo};function XQ(){V_.point=V_.lineEnd=Jo}function $Q(n,r){u6=n*=Ar,QM=cr(r*=Ar),KM=Sr(r),V_.point=eK}function eK(n,r){n*=Ar;var t=cr(r*=Ar),i=Sr(r),o=Vi(n-u6),a=Sr(o),u=i*cr(o),p=KM*t-QM*i*a,m=QM*t+KM*i*a;l6.add(Vs(Fa(u*u+p*p),m)),u6=n,QM=t,KM=i}function N7(n){return l6.reset(),nc(n,V_),+l6}var c6=[null,null],tK={type:"LineString",coordinates:c6};function B1(n,r){return c6[0]=n,c6[1]=r,N7(tK)}var Z7={Feature:function(r,t){return XM(r.geometry,t)},FeatureCollection:function(r,t){for(var i=r.features,o=-1,a=i.length;++oCr}).map(L)).concat(is(DM(a/m)*m,o,m).filter(function(tt){return Vi(tt%P)>Cr}).map(G))}return Me.lines=function(){return st().map(function(tt){return{type:"LineString",coordinates:tt}})},Me.outline=function(){return{type:"Polygon",coordinates:[Y(i).concat(te(s).slice(1),Y(t).reverse().slice(1),te(u).reverse().slice(1))]}},Me.extent=function(tt){return arguments.length?Me.extentMajor(tt).extentMinor(tt):Me.extentMinor()},Me.extentMajor=function(tt){return arguments.length?(u=+tt[0][1],s=+tt[1][1],(i=+tt[0][0])>(t=+tt[1][0])&&(tt=i,i=t,t=tt),u>s&&(tt=u,u=s,s=tt),Me.precision(de)):[[i,u],[t,s]]},Me.extentMinor=function(tt){return arguments.length?(a=+tt[0][1],o=+tt[1][1],(r=+tt[0][0])>(n=+tt[1][0])&&(tt=r,r=n,n=tt),a>o&&(tt=a,a=o,o=tt),Me.precision(de)):[[r,a],[n,o]]},Me.step=function(tt){return arguments.length?Me.stepMajor(tt).stepMinor(tt):Me.stepMinor()},Me.stepMajor=function(tt){return arguments.length?(C=+tt[0],P=+tt[1],Me):[C,P]},Me.stepMinor=function(tt){return arguments.length?(p=+tt[0],m=+tt[1],Me):[p,m]},Me.precision=function(tt){return arguments.length?(de=+tt,L=V7(a,o,90),G=q7(r,n,de),Y=V7(u,s,90),te=q7(i,t,de),Me):de},Me.extentMajor([[-180,-90+Cr],[180,90-Cr]]).extentMinor([[-180,-80-Cr],[180,80+Cr]])}function iK(){return j7()()}function oK(n,r){var t=n[0]*Ar,i=n[1]*Ar,o=r[0]*Ar,a=r[1]*Ar,s=Sr(i),u=cr(i),p=Sr(a),m=cr(a),C=s*Sr(t),P=s*cr(t),L=p*Sr(o),G=p*cr(o),Y=2*zl(Fa(i7(a-i)+s*p*i7(o-t))),te=cr(Y),de=Y?function(Me){var st=cr(Me*=Y)/te,tt=cr(Y-Me)/te,at=tt*C+st*L,pt=tt*P+st*G,Je=tt*u+st*m;return[Vs(pt,at)*wo,Vs(Je,Fa(at*at+pt*pt))*wo]}:function(){return[t*wo,i*wo]};return de.distance=Y,de}function Wm(n){return n}var z7,W7,f6,h6,d6=zf(),p6=zf(),Gf={point:Jo,lineStart:Jo,lineEnd:Jo,polygonStart:function(){Gf.lineStart=aK,Gf.lineEnd=lK},polygonEnd:function(){Gf.lineStart=Gf.lineEnd=Gf.point=Jo,d6.add(Vi(p6)),p6.reset()},result:function(){var r=d6/2;return d6.reset(),r}};function aK(){Gf.point=sK}function sK(n,r){Gf.point=G7,z7=f6=n,W7=h6=r}function G7(n,r){p6.add(h6*n-f6*r),f6=n,h6=r}function lK(){G7(z7,W7)}var J7,Q7,Xc,$c,Y7=Gf,q_=1/0,$M=q_,U1=-q_,eA=U1,tA={point:function(n,r){nU1&&(U1=n),r<$M&&($M=r),r>eA&&(eA=r)},lineStart:Jo,lineEnd:Jo,polygonStart:Jo,polygonEnd:Jo,result:function(){var r=[[q_,$M],[U1,eA]];return U1=eA=-($M=q_=1/0),r}},m6=0,v6=0,H1=0,nA=0,rA=0,j_=0,g6=0,_6=0,V1=0,ic={point:Gm,lineStart:K7,lineEnd:X7,polygonStart:function(){ic.lineStart=fK,ic.lineEnd=hK},polygonEnd:function(){ic.point=Gm,ic.lineStart=K7,ic.lineEnd=X7},result:function(){var r=V1?[g6/V1,_6/V1]:j_?[nA/j_,rA/j_]:H1?[m6/H1,v6/H1]:[NaN,NaN];return m6=v6=H1=nA=rA=j_=g6=_6=V1=0,r}};function Gm(n,r){m6+=n,v6+=r,++H1}function K7(){ic.point=dK}function dK(n,r){ic.point=pK,Gm(Xc=n,$c=r)}function pK(n,r){var t=n-Xc,i=r-$c,o=Fa(t*t+i*i);nA+=o*(Xc+n)/2,rA+=o*($c+r)/2,j_+=o,Gm(Xc=n,$c=r)}function X7(){ic.point=Gm}function fK(){ic.point=mK}function hK(){$7(J7,Q7)}function mK(n,r){ic.point=$7,Gm(J7=Xc=n,Q7=$c=r)}function $7(n,r){var t=n-Xc,i=r-$c,o=Fa(t*t+i*i);nA+=o*(Xc+n)/2,rA+=o*($c+r)/2,j_+=o,g6+=(o=$c*n-Xc*r)*(Xc+n),_6+=o*($c+r),V1+=3*o,Gm(Xc=n,$c=r)}var e9=ic;function t9(n){this._context=n}t9.prototype={_radius:4.5,pointRadius:function(r){return this._radius=r,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(r,t){switch(this._point){case 0:this._context.moveTo(r,t),this._point=1;break;case 1:this._context.lineTo(r,t);break;default:this._context.moveTo(r+this._radius,t),this._context.arc(r,t,this._radius,0,ll)}},result:Jo};var b6,n9,r9,q1,j1,y6=zf(),iA={point:Jo,lineStart:function(){iA.point=vK},lineEnd:function(){b6&&i9(n9,r9),iA.point=Jo},polygonStart:function(){b6=!0},polygonEnd:function(){b6=null},result:function(){var r=+y6;return y6.reset(),r}};function vK(n,r){iA.point=i9,n9=q1=n,r9=j1=r}function i9(n,r){y6.add(Fa((q1-=n)*q1+(j1-=r)*j1)),q1=n,j1=r}var o9=iA;function a9(){this._string=[]}function s9(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function gK(n,r){var i,o,t=4.5;function a(s){return s&&("function"==typeof t&&o.pointRadius(+t.apply(this,arguments)),nc(s,i(o))),o.result()}return a.area=function(s){return nc(s,i(Y7)),Y7.result()},a.measure=function(s){return nc(s,i(o9)),o9.result()},a.bounds=function(s){return nc(s,i(tA)),tA.result()},a.centroid=function(s){return nc(s,i(e9)),e9.result()},a.projection=function(s){return arguments.length?(i=null==s?(n=null,Wm):(n=s).stream,a):n},a.context=function(s){return arguments.length?(o=null==s?(r=null,new a9):new t9(r=s),"function"!=typeof t&&o.pointRadius(t),a):r},a.pointRadius=function(s){return arguments.length?(t="function"==typeof s?s:(o.pointRadius(+s),+s),a):t},a.projection(n).context(r)}function _K(n){return{stream:z1(n)}}function z1(n){return function(r){var t=new C6;for(var i in n)t[i]=n[i];return t.stream=r,t}}function C6(){}function S6(n,r,t){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),nc(t,n.stream(tA)),r(tA.result()),null!=i&&n.clipExtent(i),n}function oA(n,r,t){return S6(n,function(i){var o=r[1][0]-r[0][0],a=r[1][1]-r[0][1],s=Math.min(o/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),u=+r[0][0]+(o-s*(i[1][0]+i[0][0]))/2,p=+r[0][1]+(a-s*(i[1][1]+i[0][1]))/2;n.scale(150*s).translate([u,p])},t)}function T6(n,r,t){return oA(n,[[0,0],r],t)}function x6(n,r,t){return S6(n,function(i){var o=+r,a=o/(i[1][0]-i[0][0]),s=(o-a*(i[1][0]+i[0][0]))/2,u=-a*i[0][1];n.scale(150*a).translate([s,u])},t)}function w6(n,r,t){return S6(n,function(i){var o=+r,a=o/(i[1][1]-i[0][1]),s=-a*i[0][0],u=(o-a*(i[1][1]+i[0][1]))/2;n.scale(150*a).translate([s,u])},t)}a9.prototype={_radius:4.5,_circle:s9(4.5),pointRadius:function(r){return(r=+r)!==this._radius&&(this._radius=r,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(r,t){switch(this._point){case 0:this._string.push("M",r,",",t),this._point=1;break;case 1:this._string.push("L",r,",",t);break;default:null==this._circle&&(this._circle=s9(this._radius)),this._string.push("M",r,",",t,this._circle)}},result:function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}return null}},C6.prototype={constructor:C6,point:function(r,t){this.stream.point(r,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var yK=Sr(30*Ar);function u9(n,r){return+r?function(n,r){function t(i,o,a,s,u,p,m,C,P,L,G,Y,te,de){var Me=m-i,st=C-o,tt=Me*Me+st*st;if(tt>4*r&&te--){var at=s+L,pt=u+G,Je=p+Y,et=Fa(at*at+pt*pt+Je*Je),It=zl(Je/=et),Et=Vi(Vi(Je)-1)r||Vi((Me*Dt+st*mn)/tt-.5)>.3||s*L+u*G+p*Y2?Dt[2]%360*Ar:0,Wt()):[u*wo,p*wo,m*wo]},Et.angle=function(Dt){return arguments.length?(P=Dt%360*Ar,Wt()):P*wo},Et.precision=function(Dt){return arguments.length?(at=u9(pt,tt=Dt*Dt),ot()):Fa(tt)},Et.fitExtent=function(Dt,mn){return oA(Et,Dt,mn)},Et.fitSize=function(Dt,mn){return T6(Et,Dt,mn)},Et.fitWidth=function(Dt,mn){return x6(Et,Dt,mn)},Et.fitHeight=function(Dt,mn){return w6(Et,Dt,mn)},function(){return r=n.apply(this,arguments),Et.invert=r.invert&&pn,Wt()}}function k6(n){var r=0,t=Oi/3,i=E6(n),o=i(r,t);return o.parallels=function(a){return arguments.length?i(r=a[0]*Ar,t=a[1]*Ar):[r*wo,t*wo]},o}function d9(n,r){var t=cr(n),i=(t+cr(r))/2;if(Vi(i)=.12&&de<.234&&te>=-.425&&te<-.214?o:de>=.166&&de<.234&&te>=-.214&&te<-.115?s:t).invert(L)},C.stream=function(L){return n&&r===L?n:n=function(n){var r=n.length;return{point:function(i,o){for(var a=-1;++a0?u<-ia+Cr&&(u=-ia+Cr):u>ia-Cr&&(u=ia-Cr);var p=o/zN(sA(u),i);return[p*cr(i*s),o-p*Sr(i*s)]}return a.invert=function(s,u){var p=o-u,m=R1(i)*Fa(s*s+p*p);return[Vs(s,Vi(p))/i*R1(p),2*F_(zN(o/m,1/i))-ia]},a}function OK(){return k6(m9).scale(109.5).parallels([30,30])}function Y1(n,r){return[n,r]}function PK(){return fp(Y1).scale(152.63)}function v9(n,r){var t=Sr(n),i=n===r?cr(n):(t-Sr(r))/(r-n),o=t/i+n;if(Vi(i)2?i[2]+90:90]):[(i=t())[0],i[1],i[2]-90]},t([0,0,90]).scale(159.155)}function UK(n,r){return n.parent===r.parent?1:2}function VK(n,r){return n+r.x}function jK(n,r){return Math.max(n,r.y)}function GK(){var n=UK,r=1,t=1,i=!1;function o(a){var s,u=0;a.eachAfter(function(L){var G=L.children;G?(L.x=function(n){return n.reduce(VK,0)/n.length}(G),L.y=function(n){return 1+n.reduce(jK,0)}(G)):(L.x=s?u+=n(L,s):0,L.y=0,s=L)});var p=function(n){for(var r;r=n.children;)n=r[0];return n}(a),m=function(n){for(var r;r=n.children;)n=r[r.length-1];return n}(a),C=p.x-n(p,m)/2,P=m.x+n(m,p)/2;return a.eachAfter(i?function(L){L.x=(L.x-a.x)*r,L.y=(a.y-L.y)*t}:function(L){L.x=(L.x-C)/(P-C)*r,L.y=(1-(a.y?L.y/a.y:1))*t})}return o.separation=function(a){return arguments.length?(n=a,o):n},o.size=function(a){return arguments.length?(i=!1,r=+a[0],t=+a[1],o):i?null:[r,t]},o.nodeSize=function(a){return arguments.length?(i=!0,r=+a[0],t=+a[1],o):i?[r,t]:null},o}function YK(n){var r=0,t=n.children,i=t&&t.length;if(i)for(;--i>=0;)r+=t[i].value;else r=1;n.value=r}function N6(n,r){var o,s,u,p,m,t=new z_(n),i=+n.value&&(t.value=n.value),a=[t];for(null==r&&(r=lX);o=a.pop();)if(i&&(o.value=+o.data.value),(u=r(o.data))&&(m=u.length))for(o.children=new Array(m),p=m-1;p>=0;--p)a.push(s=o.children[p]=new z_(u[p])),s.parent=o,s.depth=o.depth+1;return t.eachBefore(g9)}function lX(n){return n.children}function uX(n){n.data=n.data.data}function g9(n){var r=0;do{n.height=r}while((n=n.parent)&&n.height<++r)}function z_(n){this.data=n,this.depth=this.height=0,this.parent=null}A6.invert=W1(function(n){return n}),G1.invert=function(n,r){return[n,2*F_(n7(r))-ia]},Y1.invert=Y1,D6.invert=W1(F_),O6.invert=function(n,r){var o,t=r,i=25;do{var a=t*t,s=a*a;t-=o=(t*(1.007226+a*(.015085+s*(.028874*a-.044475-.005916*s)))-r)/(1.007226+a*(.045255+s*(.259866*a-.311325-.005916*11*s)))}while(Vi(o)>Cr&&--i>0);return[n/(.8707+(a=t*t)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),t]},P6.invert=W1(zl),I6.invert=W1(function(n){return 2*F_(n)}),R6.invert=function(n,r){return[-r,2*F_(n7(n))-ia]},z_.prototype=N6.prototype={constructor:z_,count:function(){return this.eachAfter(YK)},each:function(n){var t,o,a,s,r=this,i=[r];do{for(t=i.reverse(),i=[];r=t.pop();)if(n(r),o=r.children)for(a=0,s=o.length;a=0;--o)t.push(i[o]);return this},sum:function(n){return this.eachAfter(function(r){for(var t=+n(r.data)||0,i=r.children,o=i&&i.length;--o>=0;)t+=i[o].value;r.value=t})},sort:function(n){return this.eachBefore(function(r){r.children&&r.children.sort(n)})},path:function(n){for(var r=this,t=function(n,r){if(n===r)return n;var t=n.ancestors(),i=r.ancestors(),o=null;for(n=t.pop(),r=i.pop();n===r;)o=n,n=t.pop(),r=i.pop();return o}(r,n),i=[r];r!==t;)i.push(r=r.parent);for(var o=i.length;n!==t;)i.splice(o,0,n),n=n.parent;return i},ancestors:function(){for(var n=this,r=[n];n=n.parent;)r.push(n);return r},descendants:function(){var n=[];return this.each(function(r){n.push(r)}),n},leaves:function(){var n=[];return this.eachBefore(function(r){r.children||n.push(r)}),n},links:function(){var n=this,r=[];return n.each(function(t){t!==n&&r.push({source:t.parent,target:t})}),r},copy:function(){return N6(this).eachBefore(uX)}};var cX=Array.prototype.slice;function _9(n){for(var o,a,r=0,t=(n=function(n){for(var t,i,r=n.length;r;)i=Math.random()*r--|0,t=n[r],n[r]=n[i],n[i]=t;return n}(cX.call(n))).length,i=[];r0&&t*t>i*i+o*o}function Z6(n,r){for(var t=0;t(p*=p)?(o=(m+p-a)/(2*m),u=Math.sqrt(Math.max(0,p/m-o*o)),t.x=n.x-o*i-u*s,t.y=n.y-o*s+u*i):(o=(m+a-p)/(2*m),u=Math.sqrt(Math.max(0,a/m-o*o)),t.x=r.x+o*i-u*s,t.y=r.y+o*s+u*i)):(t.x=r.x+t.r,t.y=r.y)}function S9(n,r){var t=n.r+r.r-1e-6,i=r.x-n.x,o=r.y-n.y;return t>0&&t*t>i*i+o*o}function T9(n){var r=n._,t=n.next._,i=r.r+t.r,o=(r.x*t.r+t.x*r.r)/i,a=(r.y*t.r+t.y*r.r)/i;return o*o+a*a}function cA(n){this._=n,this.next=null,this.previous=null}function x9(n){if(!(o=n.length))return 0;var r,t,i,o,a,s,u,p,m,C,P;if((r=n[0]).x=0,r.y=0,!(o>1))return r.r;if(r.x=-(t=n[1]).r,t.x=r.r,t.y=0,!(o>2))return r.r+t.r;C9(t,r,i=n[2]),r=new cA(r),t=new cA(t),i=new cA(i),r.next=i.previous=t,t.next=r.previous=i,i.next=t.previous=r;e:for(u=3;u0)throw new Error("cycle");return u}return t.id=function(i){return arguments.length?(n=dA(i),t):n},t.parentId=function(i){return arguments.length?(r=dA(i),t):r},t}function xX(n,r){return n.parent===r.parent?1:2}function F6(n){var r=n.children;return r?r[0]:n.t}function B6(n){var r=n.children;return r?r[r.length-1]:n.t}function wX(n,r,t){var i=t/(r.i-n.i);r.c-=i,r.s+=t,n.c+=i,r.z+=t,r.m+=t}function kX(n,r,t){return n.a.parent===r.parent?n.a:t}function pA(n,r){this._=n,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=r}function AX(){var n=xX,r=1,t=1,i=null;function o(m){var C=function(n){for(var t,o,a,s,u,r=new pA(n,0),i=[r];t=i.pop();)if(a=t._.children)for(t.children=new Array(u=a.length),s=u-1;s>=0;--s)i.push(o=t.children[s]=new pA(a[s],s)),o.parent=t;return(r.parent=new pA(null,0)).children=[r],r}(m);if(C.eachAfter(a),C.parent.m=-C.z,C.eachBefore(s),i)m.eachBefore(p);else{var P=m,L=m,G=m;m.eachBefore(function(st){st.xL.x&&(L=st),st.depth>G.depth&&(G=st)});var Y=P===L?1:n(P,L)/2,te=Y-P.x,de=r/(L.x+Y+te),Me=t/(G.depth||1);m.eachBefore(function(st){st.x=(st.x+te)*de,st.y=st.depth*Me})}return m}function a(m){var C=m.children,P=m.parent.children,L=m.i?P[m.i-1]:null;if(C){!function(n){for(var a,r=0,t=0,i=n.children,o=i.length;--o>=0;)(a=i[o]).z+=r,a.m+=r,r+=a.s+(t+=a.c)}(m);var G=(C[0].z+C[C.length-1].z)/2;L?(m.z=L.z+n(m._,L._),m.m=m.z-G):m.z=G}else L&&(m.z=L.z+n(m._,L._));m.parent.A=function(m,C,P){if(C){for(var at,L=m,G=m,Y=C,te=L.parent.children[0],de=L.m,Me=G.m,st=Y.m,tt=te.m;Y=B6(Y),L=F6(L),Y&&L;)te=F6(te),(G=B6(G)).a=m,(at=Y.z+st-L.z-de+n(Y._,L._))>0&&(wX(kX(Y,m,P),m,at),de+=at,Me+=at),st+=Y.m,de+=L.m,tt+=te.m,Me+=G.m;Y&&!B6(G)&&(G.t=Y,G.m+=st-Me),L&&!F6(te)&&(te.t=L,te.m+=de-tt,P=m)}return P}(m,L,m.parent.A||P[0])}function s(m){m._.x=m.z+m.parent.m,m.m+=m.parent.m}function p(m){m.x*=r,m.y=m.depth*t}return o.separation=function(m){return arguments.length?(n=m,o):n},o.size=function(m){return arguments.length?(i=!1,r=+m[0],t=+m[1],o):i?null:[r,t]},o.nodeSize=function(m){return arguments.length?(i=!0,r=+m[0],t=+m[1],o):i?[r,t]:null},o}function fA(n,r,t,i,o){for(var s,a=n.children,u=-1,p=a.length,m=n.value&&(o-t)/n.value;++ust&&(st=m),Je=de*de*pt,(tt=Math.max(st/Je,Je/Me))>at){de-=m;break}at=tt}s.push(p={value:de,dice:G1?i:1)},t}(D9);function DX(){var n=P9,r=!1,t=1,i=1,o=[0],a=Ym,s=Ym,u=Ym,p=Ym,m=Ym;function C(L){return L.x0=L.y0=0,L.x1=t,L.y1=i,L.eachBefore(P),o=[0],r&&L.eachBefore(k9),L}function P(L){var G=o[L.depth],Y=L.x0+G,te=L.y0+G,de=L.x1-G,Me=L.y1-G;de=L-1){var st=a[P];return st.x0=Y,st.y0=te,st.x1=de,void(st.y1=Me)}for(var tt=m[P],at=G/2+tt,pt=P+1,Je=L-1;pt>>1;m[et]Me-te){var pn=(Y*Et+de*It)/G;C(P,pt,It,Y,te,pn,Me),C(pt,L,Et,pn,te,de,Me)}else{var Wt=(te*Et+Me*It)/G;C(P,pt,It,Y,te,de,Wt),C(pt,L,Et,Y,Wt,de,Me)}}(0,u,n.value,r,t,i,o)}function PX(n,r,t,i,o){(1&n.depth?fA:Q1)(n,r,t,i,o)}var IX=function n(r){function t(i,o,a,s,u){if((p=i._squarify)&&p.ratio===r)for(var p,m,C,P,G,L=-1,Y=p.length,te=i.value;++L1?i:1)},t}(D9);function RX(n){for(var i,r=-1,t=n.length,o=n[t-1],a=0;++r1&&ZX(n[t[i-2]],n[t[i-1]],n[o])<=0;)--i;t[i++]=o}return t.slice(0,i)}function FX(n){if((t=n.length)<3)return null;var r,t,i=new Array(t),o=new Array(t);for(r=0;r=0;--r)m.push(n[i[a[r]][2]]);for(r=+u;ra!=u>a&&o<(s-p)*(a-m)/(u-m)+p&&(C=!C),s=p,u=m;return C}function UX(n){for(var o,a,r=-1,t=n.length,i=n[t-1],s=i[0],u=i[1],p=0;++r1);return i+o*u*Math.sqrt(-2*Math.log(s)/s)}}return t.source=n,t}(G_),VX=function n(r){function t(){var i=R9.source(r).apply(this,arguments);return function(){return Math.exp(i())}}return t.source=n,t}(G_),N9=function n(r){function t(i){return function(){for(var o=0,a=0;a2?JX:YX,u=p=null,C}function C(P){return(u||(u=s(t,i,a?function(n){return function(r,t){var i=n(r=+r,t=+t);return function(o){return o<=r?0:o>=t?1:i(o)}}}(n):n,o)))(+P)}return C.invert=function(P){return(p||(p=s(i,t,z6,a?function(n){return function(r,t){var i=n(r=+r,t=+t);return function(o){return o<=0?r:o>=1?t:i(o)}}}(r):r)))(+P)},C.domain=function(P){return arguments.length?(t=U6.call(P,F9),m()):t.slice()},C.range=function(P){return arguments.length?(i=Yf.call(P),m()):i.slice()},C.rangeRound=function(P){return i=Yf.call(P),o=lp,m()},C.clamp=function(P){return arguments.length?(a=!!P,m()):a},C.interpolate=function(P){return arguments.length?(o=P,m()):o},m()}function K1(n){var r=n.domain;return n.ticks=function(t){var i=r();return fm(i[0],i[i.length-1],null==t?10:t)},n.tickFormat=function(t,i){return function(n,r,t){var s,i=n[0],o=n[n.length-1],a=ip(i,o,null==r?10:r);switch((t=I1(null==t?",f":t)).type){case"s":var u=Math.max(Math.abs(i),Math.abs(o));return null==t.precision&&!isNaN(s=X8(a,u))&&(t.precision=s),jN(t,u);case"":case"e":case"g":case"p":case"r":null==t.precision&&!isNaN(s=$8(a,Math.max(Math.abs(i),Math.abs(o))))&&(t.precision=s-("e"===t.type));break;case"f":case"%":null==t.precision&&!isNaN(s=K8(a))&&(t.precision=s-2*("%"===t.type))}return EM(t)}(r(),t,i)},n.nice=function(t){null==t&&(t=10);var p,i=r(),o=0,a=i.length-1,s=i[o],u=i[a];return u0?p=hm(s=Math.floor(s/p)*p,u=Math.ceil(u/p)*p,t):p<0&&(p=hm(s=Math.ceil(s*p)/p,u=Math.floor(u*p)/p,t)),p>0?(i[o]=Math.floor(s/p)*p,i[a]=Math.ceil(u/p)*p,r(i)):p<0&&(i[o]=Math.ceil(s*p)/p,i[a]=Math.floor(u*p)/p,r(i)),n},n}function U9(){var n=mA(z6,Ni);return n.copy=function(){return hA(n,U9())},K1(n)}function H9(){var n=[0,1];function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=U6.call(t,F9),r):n.slice()},r.copy=function(){return H9().domain(n)},K1(r)}function V9(n,r){var s,t=0,i=(n=n.slice()).length-1,o=n[t],a=n[i];return a0){for(;Pm)break;Me.push(te)}}else for(;P=1;--Y)if(!((te=G*Y)m)break;Me.push(te)}}else Me=fm(P,L,Math.min(L-P,de)).map(o);return C?Me.reverse():Me},n.tickFormat=function(s,u){if(null==u&&(u=10===t?".0e":","),"function"!=typeof u&&(u=EM(u)),s===1/0)return u;null==s&&(s=10);var p=Math.max(1,t*s/n.ticks().length);return function(m){var C=m/o(Math.round(i(m)));return C*t0?t[s-1]:n[0],s=t?[i[t-1],r]:[i[p-1],i[p]]},a.copy=function(){return Y9().domain([n,r]).range(o)},K1(a)}function J9(){var n=[.5],r=[0,1],t=1;function i(o){if(o<=o)return r[Of(n,o,0,t)]}return i.domain=function(o){return arguments.length?(n=Yf.call(o),t=Math.min(n.length,r.length-1),i):n.slice()},i.range=function(o){return arguments.length?(r=Yf.call(o),t=Math.min(n.length,r.length-1),i):r.slice()},i.invertExtent=function(o){var a=r.indexOf(o);return[n[a-1],n[a]]},i.copy=function(){return J9().domain(n).range(r)},i}var G6=new Date,Y6=new Date;function Ba(n,r,t,i){function o(a){return n(a=new Date(+a)),a}return o.floor=o,o.ceil=function(a){return n(a=new Date(a-1)),r(a,1),n(a),a},o.round=function(a){var s=o(a),u=o.ceil(a);return a-s0))return p;do{p.push(m=new Date(+a)),r(a,u),n(a)}while(m=s)for(;n(s),!a(s);)s.setTime(s-1)},function(s,u){if(s>=s)if(u<0)for(;++u<=0;)for(;r(s,-1),!a(s););else for(;--u>=0;)for(;r(s,1),!a(s););})},t&&(o.count=function(a,s){return G6.setTime(+a),Y6.setTime(+s),n(G6),n(Y6),Math.floor(t(G6,Y6))},o.every=function(a){return a=Math.floor(a),isFinite(a)&&a>0?a>1?o.filter(i?function(s){return i(s)%a==0}:function(s){return o.count(0,s)%a==0}):o:null}),o}var vA=Ba(function(){},function(n,r){n.setTime(+n+r)},function(n,r){return r-n});vA.every=function(n){return n=Math.floor(n),isFinite(n)&&n>0?n>1?Ba(function(r){r.setTime(Math.floor(r/n)*n)},function(r,t){r.setTime(+r+t*n)},function(r,t){return(t-r)/n}):vA:null};var gA=vA,Q9=vA.range,Jm=6e4,yA=36e5,X9=6048e5,$9=Ba(function(n){n.setTime(n-n.getMilliseconds())},function(n,r){n.setTime(+n+1e3*r)},function(n,r){return(r-n)/1e3},function(n){return n.getUTCSeconds()}),bA=$9,eU=$9.range,tU=Ba(function(n){n.setTime(n-n.getMilliseconds()-1e3*n.getSeconds())},function(n,r){n.setTime(+n+r*Jm)},function(n,r){return(r-n)/Jm},function(n){return n.getMinutes()}),nU=tU,t$=tU.range,rU=Ba(function(n){n.setTime(n-n.getMilliseconds()-1e3*n.getSeconds()-n.getMinutes()*Jm)},function(n,r){n.setTime(+n+r*yA)},function(n,r){return(r-n)/yA},function(n){return n.getHours()}),iU=rU,n$=rU.range,oU=Ba(function(n){n.setHours(0,0,0,0)},function(n,r){n.setDate(n.getDate()+r)},function(n,r){return(r-n-(r.getTimezoneOffset()-n.getTimezoneOffset())*Jm)/864e5},function(n){return n.getDate()-1}),CA=oU,r$=oU.range;function Qm(n){return Ba(function(r){r.setDate(r.getDate()-(r.getDay()+7-n)%7),r.setHours(0,0,0,0)},function(r,t){r.setDate(r.getDate()+7*t)},function(r,t){return(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*Jm)/X9})}var X1=Qm(0),$1=Qm(1),aU=Qm(2),sU=Qm(3),eS=Qm(4),lU=Qm(5),uU=Qm(6),cU=X1.range,i$=$1.range,o$=aU.range,a$=sU.range,s$=eS.range,l$=lU.range,u$=uU.range,dU=Ba(function(n){n.setDate(1),n.setHours(0,0,0,0)},function(n,r){n.setMonth(n.getMonth()+r)},function(n,r){return r.getMonth()-n.getMonth()+12*(r.getFullYear()-n.getFullYear())},function(n){return n.getMonth()}),pU=dU,c$=dU.range,J6=Ba(function(n){n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,r){n.setFullYear(n.getFullYear()+r)},function(n,r){return r.getFullYear()-n.getFullYear()},function(n){return n.getFullYear()});J6.every=function(n){return isFinite(n=Math.floor(n))&&n>0?Ba(function(r){r.setFullYear(Math.floor(r.getFullYear()/n)*n),r.setMonth(0,1),r.setHours(0,0,0,0)},function(r,t){r.setFullYear(r.getFullYear()+t*n)}):null};var Km=J6,d$=J6.range,fU=Ba(function(n){n.setUTCSeconds(0,0)},function(n,r){n.setTime(+n+r*Jm)},function(n,r){return(r-n)/Jm},function(n){return n.getUTCMinutes()}),hU=fU,p$=fU.range,mU=Ba(function(n){n.setUTCMinutes(0,0,0)},function(n,r){n.setTime(+n+r*yA)},function(n,r){return(r-n)/yA},function(n){return n.getUTCHours()}),vU=mU,f$=mU.range,gU=Ba(function(n){n.setUTCHours(0,0,0,0)},function(n,r){n.setUTCDate(n.getUTCDate()+r)},function(n,r){return(r-n)/864e5},function(n){return n.getUTCDate()-1}),SA=gU,h$=gU.range;function Xm(n){return Ba(function(r){r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+7-n)%7),r.setUTCHours(0,0,0,0)},function(r,t){r.setUTCDate(r.getUTCDate()+7*t)},function(r,t){return(t-r)/X9})}var tS=Xm(0),nS=Xm(1),_U=Xm(2),yU=Xm(3),rS=Xm(4),bU=Xm(5),CU=Xm(6),SU=tS.range,m$=nS.range,v$=_U.range,g$=yU.range,_$=rS.range,y$=bU.range,b$=CU.range,TU=Ba(function(n){n.setUTCDate(1),n.setUTCHours(0,0,0,0)},function(n,r){n.setUTCMonth(n.getUTCMonth()+r)},function(n,r){return r.getUTCMonth()-n.getUTCMonth()+12*(r.getUTCFullYear()-n.getUTCFullYear())},function(n){return n.getUTCMonth()}),xU=TU,C$=TU.range,Q6=Ba(function(n){n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,r){n.setUTCFullYear(n.getUTCFullYear()+r)},function(n,r){return r.getUTCFullYear()-n.getUTCFullYear()},function(n){return n.getUTCFullYear()});Q6.every=function(n){return isFinite(n=Math.floor(n))&&n>0?Ba(function(r){r.setUTCFullYear(Math.floor(r.getUTCFullYear()/n)*n),r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},function(r,t){r.setUTCFullYear(r.getUTCFullYear()+t*n)}):null};var $m=Q6,S$=Q6.range;function T$(n){if(0<=n.y&&n.y<100){var r=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return r.setFullYear(n.y),r}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function TA(n){if(0<=n.y&&n.y<100){var r=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return r.setUTCFullYear(n.y),r}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function iS(n){return{y:n,m:0,d:1,H:0,M:0,S:0,L:0}}function wU(n){var r=n.dateTime,t=n.date,i=n.time,o=n.periods,a=n.days,s=n.shortDays,u=n.months,p=n.shortMonths,m=oS(o),C=aS(o),P=oS(a),L=aS(a),G=oS(s),Y=aS(s),te=oS(u),de=aS(u),Me=oS(p),st=aS(p),tt={a:function(hr){return s[hr.getDay()]},A:function(hr){return a[hr.getDay()]},b:function(hr){return p[hr.getMonth()]},B:function(hr){return u[hr.getMonth()]},c:null,d:AU,e:AU,f:G$,H:j$,I:z$,j:W$,L:DU,m:Y$,M:J$,p:function(hr){return o[+(hr.getHours()>=12)]},Q:RU,s:NU,S:Q$,u:K$,U:X$,V:$$,w:eee,W:tee,x:null,X:null,y:nee,Y:ree,Z:iee,"%":IU},at={a:function(hr){return s[hr.getUTCDay()]},A:function(hr){return a[hr.getUTCDay()]},b:function(hr){return p[hr.getUTCMonth()]},B:function(hr){return u[hr.getUTCMonth()]},c:null,d:OU,e:OU,f:lee,H:oee,I:aee,j:see,L:PU,m:uee,M:cee,p:function(hr){return o[+(hr.getUTCHours()>=12)]},Q:RU,s:NU,S:dee,u:pee,U:fee,V:hee,w:mee,W:vee,x:null,X:null,y:gee,Y:_ee,Z:yee,"%":IU},pt={a:function(hr,dr,or){var qn=G.exec(dr.slice(or));return qn?(hr.w=Y[qn[0].toLowerCase()],or+qn[0].length):-1},A:function(hr,dr,or){var qn=P.exec(dr.slice(or));return qn?(hr.w=L[qn[0].toLowerCase()],or+qn[0].length):-1},b:function(hr,dr,or){var qn=Me.exec(dr.slice(or));return qn?(hr.m=st[qn[0].toLowerCase()],or+qn[0].length):-1},B:function(hr,dr,or){var qn=te.exec(dr.slice(or));return qn?(hr.m=de[qn[0].toLowerCase()],or+qn[0].length):-1},c:function(hr,dr,or){return It(hr,r,dr,or)},d:kU,e:kU,f:U$,H:MU,I:MU,j:Z$,L:B$,m:N$,M:L$,p:function(hr,dr,or){var qn=m.exec(dr.slice(or));return qn?(hr.p=C[qn[0].toLowerCase()],or+qn[0].length):-1},Q:V$,s:q$,S:F$,u:M$,U:A$,V:D$,w:k$,W:O$,x:function(hr,dr,or){return It(hr,t,dr,or)},X:function(hr,dr,or){return It(hr,i,dr,or)},y:I$,Y:P$,Z:R$,"%":H$};function Je(hr,dr){return function(or){var ps,_l,_c,qn=[],Ko=-1,wi=0,Ci=hr.length;for(or instanceof Date||(or=new Date(+or));++Ko53)return null;"w"in qn||(qn.w=1),"Z"in qn?(Ci=(wi=TA(iS(qn.y))).getUTCDay(),wi=Ci>4||0===Ci?nS.ceil(wi):nS(wi),wi=SA.offset(wi,7*(qn.V-1)),qn.y=wi.getUTCFullYear(),qn.m=wi.getUTCMonth(),qn.d=wi.getUTCDate()+(qn.w+6)%7):(Ci=(wi=dr(iS(qn.y))).getDay(),wi=Ci>4||0===Ci?$1.ceil(wi):$1(wi),wi=CA.offset(wi,7*(qn.V-1)),qn.y=wi.getFullYear(),qn.m=wi.getMonth(),qn.d=wi.getDate()+(qn.w+6)%7)}else("W"in qn||"U"in qn)&&("w"in qn||(qn.w="u"in qn?qn.u%7:"W"in qn?1:0),Ci="Z"in qn?TA(iS(qn.y)).getUTCDay():dr(iS(qn.y)).getDay(),qn.m=0,qn.d="W"in qn?(qn.w+6)%7+7*qn.W-(Ci+5)%7:qn.w+7*qn.U-(Ci+6)%7);return"Z"in qn?(qn.H+=qn.Z/100|0,qn.M+=qn.Z%100,TA(qn)):dr(qn)}}function It(hr,dr,or,qn){for(var ps,_l,Ko=0,wi=dr.length,Ci=or.length;Ko=Ci)return-1;if(37===(ps=dr.charCodeAt(Ko++))){if(ps=dr.charAt(Ko++),!(_l=pt[ps in EU?dr.charAt(Ko++):ps])||(qn=_l(hr,or,qn))<0)return-1}else if(ps!=or.charCodeAt(qn++))return-1}return qn}return tt.x=Je(t,tt),tt.X=Je(i,tt),tt.c=Je(r,tt),at.x=Je(t,at),at.X=Je(i,at),at.c=Je(r,at),{format:function(dr){var or=Je(dr+="",tt);return or.toString=function(){return dr},or},parse:function(dr){var or=et(dr+="",T$);return or.toString=function(){return dr},or},utcFormat:function(dr){var or=Je(dr+="",at);return or.toString=function(){return dr},or},utcParse:function(dr){var or=et(dr,TA);return or.toString=function(){return dr},or}}}var J_,K6,ZU,xA,X6,EU={"-":"",_:" ",0:"0"},ls=/^\s*\d+/,x$=/^%/,w$=/[\\^$*+?|[\]().{}]/g;function lo(n,r,t){var i=n<0?"-":"",o=(i?-n:n)+"",a=o.length;return i+(a68?1900:2e3),t+i[0].length):-1}function R$(n,r,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(r.slice(t,t+6));return i?(n.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function N$(n,r,t){var i=ls.exec(r.slice(t,t+2));return i?(n.m=i[0]-1,t+i[0].length):-1}function kU(n,r,t){var i=ls.exec(r.slice(t,t+2));return i?(n.d=+i[0],t+i[0].length):-1}function Z$(n,r,t){var i=ls.exec(r.slice(t,t+3));return i?(n.m=0,n.d=+i[0],t+i[0].length):-1}function MU(n,r,t){var i=ls.exec(r.slice(t,t+2));return i?(n.H=+i[0],t+i[0].length):-1}function L$(n,r,t){var i=ls.exec(r.slice(t,t+2));return i?(n.M=+i[0],t+i[0].length):-1}function F$(n,r,t){var i=ls.exec(r.slice(t,t+2));return i?(n.S=+i[0],t+i[0].length):-1}function B$(n,r,t){var i=ls.exec(r.slice(t,t+3));return i?(n.L=+i[0],t+i[0].length):-1}function U$(n,r,t){var i=ls.exec(r.slice(t,t+6));return i?(n.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function H$(n,r,t){var i=x$.exec(r.slice(t,t+1));return i?t+i[0].length:-1}function V$(n,r,t){var i=ls.exec(r.slice(t));return i?(n.Q=+i[0],t+i[0].length):-1}function q$(n,r,t){var i=ls.exec(r.slice(t));return i?(n.Q=1e3*+i[0],t+i[0].length):-1}function AU(n,r){return lo(n.getDate(),r,2)}function j$(n,r){return lo(n.getHours(),r,2)}function z$(n,r){return lo(n.getHours()%12||12,r,2)}function W$(n,r){return lo(1+CA.count(Km(n),n),r,3)}function DU(n,r){return lo(n.getMilliseconds(),r,3)}function G$(n,r){return DU(n,r)+"000"}function Y$(n,r){return lo(n.getMonth()+1,r,2)}function J$(n,r){return lo(n.getMinutes(),r,2)}function Q$(n,r){return lo(n.getSeconds(),r,2)}function K$(n){var r=n.getDay();return 0===r?7:r}function X$(n,r){return lo(X1.count(Km(n),n),r,2)}function $$(n,r){var t=n.getDay();return n=t>=4||0===t?eS(n):eS.ceil(n),lo(eS.count(Km(n),n)+(4===Km(n).getDay()),r,2)}function eee(n){return n.getDay()}function tee(n,r){return lo($1.count(Km(n),n),r,2)}function nee(n,r){return lo(n.getFullYear()%100,r,2)}function ree(n,r){return lo(n.getFullYear()%1e4,r,4)}function iee(n){var r=n.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+lo(r/60|0,"0",2)+lo(r%60,"0",2)}function OU(n,r){return lo(n.getUTCDate(),r,2)}function oee(n,r){return lo(n.getUTCHours(),r,2)}function aee(n,r){return lo(n.getUTCHours()%12||12,r,2)}function see(n,r){return lo(1+SA.count($m(n),n),r,3)}function PU(n,r){return lo(n.getUTCMilliseconds(),r,3)}function lee(n,r){return PU(n,r)+"000"}function uee(n,r){return lo(n.getUTCMonth()+1,r,2)}function cee(n,r){return lo(n.getUTCMinutes(),r,2)}function dee(n,r){return lo(n.getUTCSeconds(),r,2)}function pee(n){var r=n.getUTCDay();return 0===r?7:r}function fee(n,r){return lo(tS.count($m(n),n),r,2)}function hee(n,r){var t=n.getUTCDay();return n=t>=4||0===t?rS(n):rS.ceil(n),lo(rS.count($m(n),n)+(4===$m(n).getUTCDay()),r,2)}function mee(n){return n.getUTCDay()}function vee(n,r){return lo(nS.count($m(n),n),r,2)}function gee(n,r){return lo(n.getUTCFullYear()%100,r,2)}function _ee(n,r){return lo(n.getUTCFullYear()%1e4,r,4)}function yee(){return"+0000"}function IU(){return"%"}function RU(n){return+n}function NU(n){return Math.floor(+n/1e3)}function LU(n){return J_=wU(n),K6=J_.format,ZU=J_.parse,xA=J_.utcFormat,X6=J_.utcParse,J_}LU({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"]});var FU="%Y-%m-%dT%H:%M:%S.%LZ",See=Date.prototype.toISOString?function(n){return n.toISOString()}:xA(FU),wee=+new Date("2000-01-01T00:00:00.000Z")?function(n){var r=new Date(n);return isNaN(r)?null:r}:X6(FU),lS=6e4,uS=60*lS,cS=24*uS,BU=30*cS,$6=365*cS;function kee(n){return new Date(n)}function Mee(n){return n instanceof Date?+n:+new Date(+n)}function eZ(n,r,t,i,o,a,s,u,p){var m=mA(z6,Ni),C=m.invert,P=m.domain,L=p(".%L"),G=p(":%S"),Y=p("%I:%M"),te=p("%I %p"),de=p("%a %d"),Me=p("%b %d"),st=p("%B"),tt=p("%Y"),at=[[s,1,1e3],[s,5,5e3],[s,15,15e3],[s,30,3e4],[a,1,lS],[a,5,5*lS],[a,15,15*lS],[a,30,30*lS],[o,1,uS],[o,3,3*uS],[o,6,6*uS],[o,12,12*uS],[i,1,cS],[i,2,2*cS],[t,1,6048e5],[r,1,BU],[r,3,3*BU],[n,1,$6]];function pt(et){return(s(et)1)&&(n-=Math.floor(n));var r=Math.abs(n-.5);return wA.h=360*n-100,wA.s=1.5-1.5*r,wA.l=.8-.9*r,wA+""}function EA(n){var r=n.length;return function(t){return n[Math.max(0,Math.min(r-1,Math.floor(t*r)))]}}var gte=EA(ri("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),_te=EA(ri("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yte=EA(ri("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),bte=EA(ri("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Cte(n,r){return n.each(function(){var t=r.apply(this,arguments),i=ni(this);for(var o in t)i.attr(o,t[o])})}function Ste(n,r){for(var t in r)n.attr(t,r[t]);return n}function xte(n,r,t){return n.each(function(){var i=r.apply(this,arguments),o=ni(this);for(var a in i)o.style(a,i[a],t)})}function wte(n,r,t){for(var i in r)n.style(i,r[i],t);return n}function kte(n,r){return n.each(function(){var t=r.apply(this,arguments),i=ni(this);for(var o in t)i.property(o,t[o])})}function Mte(n,r){for(var t in r)n.property(t,r[t]);return n}function Dte(n,r){return n.each(function(){var t=r.apply(this,arguments),i=ni(this).transition(n);for(var o in t)i.attr(o,t[o])})}function Ote(n,r){for(var t in r)n.attr(t,r[t]);return n}function Ite(n,r,t){return n.each(function(){var i=r.apply(this,arguments),o=ni(this).transition(n);for(var a in i)o.style(a,i[a],t)})}function Rte(n,r,t){for(var i in r)n.style(i,r[i],t);return n}function ci(n){return function(){return n}}Hl.prototype.attrs=function(n){return("function"==typeof n?Cte:Ste)(this,n)},Hl.prototype.styles=function(n,r){return("function"==typeof n?xte:wte)(this,n,null==r?"":r)},Hl.prototype.properties=function(n){return("function"==typeof n?kte:Mte)(this,n)},pM.prototype.attrs=function(n){return("function"==typeof n?Dte:Ote)(this,n)},pM.prototype.styles=function(n,r){return("function"==typeof n?Ite:Rte)(this,n,null==r?"":r)};var hH=Math.abs,bs=Math.atan2,ev=Math.cos,Zte=Math.max,tZ=Math.min,ed=Math.sin,Q_=Math.sqrt,us=1e-12,tv=Math.PI,kA=tv/2,hp=2*tv;function Lte(n){return n>1?0:n<-1?tv:Math.acos(n)}function mH(n){return n>=1?kA:n<=-1?-kA:Math.asin(n)}function Fte(n){return n.innerRadius}function Bte(n){return n.outerRadius}function Ute(n){return n.startAngle}function Hte(n){return n.endAngle}function Vte(n){return n&&n.padAngle}function qte(n,r,t,i,o,a,s,u){var p=t-n,m=i-r,C=s-o,P=u-a,L=P*p-C*m;if(!(L*Lmn*mn+dn*dn&&(It=pn,Et=Wt),{cx:It,cy:Et,x01:-C,y01:-P,x11:It*(o/pt-1),y11:Et*(o/pt-1)}}function jte(){var n=Fte,r=Bte,t=ci(0),i=null,o=Ute,a=Hte,s=Vte,u=null;function p(){var m,C,P=+n.apply(this,arguments),L=+r.apply(this,arguments),G=o.apply(this,arguments)-kA,Y=a.apply(this,arguments)-kA,te=hH(Y-G),de=Y>G;if(u||(u=m=tc()),Lus)if(te>hp-us)u.moveTo(L*ev(G),L*ed(G)),u.arc(0,0,L,G,Y,!de),P>us&&(u.moveTo(P*ev(Y),P*ed(Y)),u.arc(0,0,P,Y,G,de));else{var ot,Dt,Me=G,st=Y,tt=G,at=Y,pt=te,Je=te,et=s.apply(this,arguments)/2,It=et>us&&(i?+i.apply(this,arguments):Q_(P*P+L*L)),Et=tZ(hH(L-P)/2,+t.apply(this,arguments)),pn=Et,Wt=Et;if(It>us){var mn=mH(It/P*ed(et)),dn=mH(It/L*ed(et));(pt-=2*mn)>us?(tt+=mn*=de?1:-1,at-=mn):(pt=0,tt=at=(G+Y)/2),(Je-=2*dn)>us?(Me+=dn*=de?1:-1,st-=dn):(Je=0,Me=st=(G+Y)/2)}var xn=L*ev(Me),Fn=L*ed(Me),er=P*ev(at),mr=P*ed(at);if(Et>us){var vr,jr=L*ev(st),ir=L*ed(st),Gr=P*ev(tt),ai=P*ed(tt);if(te<=hp-us&&(vr=qte(xn,Fn,Gr,ai,jr,ir,er,mr))){var Bi=xn-vr[0],Bo=Fn-vr[1],hr=jr-vr[0],dr=ir-vr[1],or=1/ed(Lte((Bi*hr+Bo*dr)/(Q_(Bi*Bi+Bo*Bo)*Q_(hr*hr+dr*dr)))/2),qn=Q_(vr[0]*vr[0]+vr[1]*vr[1]);pn=tZ(Et,(P-qn)/(or-1)),Wt=tZ(Et,(L-qn)/(or+1))}}Je>us?Wt>us?(ot=MA(Gr,ai,xn,Fn,L,Wt,de),Dt=MA(jr,ir,er,mr,L,Wt,de),u.moveTo(ot.cx+ot.x01,ot.cy+ot.y01),Wtus&&pt>us?pn>us?(ot=MA(er,mr,jr,ir,P,-pn,de),Dt=MA(xn,Fn,Gr,ai,P,-pn,de),u.lineTo(ot.cx+ot.x01,ot.cy+ot.y01),pn=L;--G)u.point(st[G],tt[G]);u.lineEnd(),u.areaEnd()}de&&(st[P]=+n(te,P,C),tt[P]=+t(te,P,C),u.point(r?+r(te,P,C):st[P],i?+i(te,P,C):tt[P]))}if(Me)return u=null,Me+""||null}function m(){return DA().defined(o).curve(s).context(a)}return p.x=function(C){return arguments.length?(n="function"==typeof C?C:ci(+C),r=null,p):n},p.x0=function(C){return arguments.length?(n="function"==typeof C?C:ci(+C),p):n},p.x1=function(C){return arguments.length?(r=null==C?null:"function"==typeof C?C:ci(+C),p):r},p.y=function(C){return arguments.length?(t="function"==typeof C?C:ci(+C),i=null,p):t},p.y0=function(C){return arguments.length?(t="function"==typeof C?C:ci(+C),p):t},p.y1=function(C){return arguments.length?(i=null==C?null:"function"==typeof C?C:ci(+C),p):i},p.lineX0=p.lineY0=function(){return m().x(n).y(t)},p.lineY1=function(){return m().x(n).y(i)},p.lineX1=function(){return m().x(r).y(t)},p.defined=function(C){return arguments.length?(o="function"==typeof C?C:ci(!!C),p):o},p.curve=function(C){return arguments.length?(s=C,null!=a&&(u=s(a)),p):s},p.context=function(C){return arguments.length?(null==C?a=u=null:u=s(a=C),p):a},p}function zte(n,r){return rn?1:r>=n?0:NaN}function Wte(n){return n}function Gte(){var n=Wte,r=zte,t=null,i=ci(0),o=ci(hp),a=ci(0);function s(u){var p,C,P,Me,at,m=u.length,L=0,G=new Array(m),Y=new Array(m),te=+i.apply(this,arguments),de=Math.min(hp,Math.max(-hp,o.apply(this,arguments)-te)),st=Math.min(Math.abs(de)/m,a.apply(this,arguments)),tt=st*(de<0?-1:1);for(p=0;p0&&(L+=at);for(null!=r?G.sort(function(pt,Je){return r(Y[pt],Y[Je])}):null!=t&&G.sort(function(pt,Je){return t(u[pt],u[Je])}),p=0,P=L?(de-m*tt)/L:0;p0?at*P:0)+tt,padAngle:st};return Y}return s.value=function(u){return arguments.length?(n="function"==typeof u?u:ci(+u),s):n},s.sortValues=function(u){return arguments.length?(r=u,t=null,s):r},s.sort=function(u){return arguments.length?(t=u,r=null,s):t},s.startAngle=function(u){return arguments.length?(i="function"==typeof u?u:ci(+u),s):i},s.endAngle=function(u){return arguments.length?(o="function"==typeof u?u:ci(+u),s):o},s.padAngle=function(u){return arguments.length?(a="function"==typeof u?u:ci(+u),s):a},s}vH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(r,t):this._context.moveTo(r,t);break;case 1:this._point=2;default:this._context.lineTo(r,t)}}};var _H=iZ(AA);function yH(n){this._curve=n}function iZ(n){function r(t){return new yH(n(t))}return r._curve=n,r}function dS(n){var r=n.curve;return n.angle=n.x,delete n.x,n.radius=n.y,delete n.y,n.curve=function(t){return arguments.length?r(iZ(t)):r()._curve},n}function bH(){return dS(DA().curve(_H))}function CH(){var n=gH().curve(_H),r=n.curve,t=n.lineX0,i=n.lineX1,o=n.lineY0,a=n.lineY1;return n.angle=n.x,delete n.x,n.startAngle=n.x0,delete n.x0,n.endAngle=n.x1,delete n.x1,n.radius=n.y,delete n.y,n.innerRadius=n.y0,delete n.y0,n.outerRadius=n.y1,delete n.y1,n.lineStartAngle=function(){return dS(t())},delete n.lineX0,n.lineEndAngle=function(){return dS(i())},delete n.lineX1,n.lineInnerRadius=function(){return dS(o())},delete n.lineY0,n.lineOuterRadius=function(){return dS(a())},delete n.lineY1,n.curve=function(s){return arguments.length?r(iZ(s)):r()._curve},n}function pS(n,r){return[(r=+r)*Math.cos(n-=Math.PI/2),r*Math.sin(n)]}yH.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(r,t){this._curve.point(t*Math.sin(r),t*-Math.cos(r))}};var oZ=Array.prototype.slice;function Yte(n){return n.source}function Jte(n){return n.target}function aZ(n){var r=Yte,t=Jte,i=nZ,o=rZ,a=null;function s(){var u,p=oZ.call(arguments),m=r.apply(this,p),C=t.apply(this,p);if(a||(a=u=tc()),n(a,+i.apply(this,(p[0]=m,p)),+o.apply(this,p),+i.apply(this,(p[0]=C,p)),+o.apply(this,p)),u)return a=null,u+""||null}return s.source=function(u){return arguments.length?(r=u,s):r},s.target=function(u){return arguments.length?(t=u,s):t},s.x=function(u){return arguments.length?(i="function"==typeof u?u:ci(+u),s):i},s.y=function(u){return arguments.length?(o="function"==typeof u?u:ci(+u),s):o},s.context=function(u){return arguments.length?(a=null==u?null:u,s):a},s}function Qte(n,r,t,i,o){n.moveTo(r,t),n.bezierCurveTo(r=(r+i)/2,t,r,o,i,o)}function Kte(n,r,t,i,o){n.moveTo(r,t),n.bezierCurveTo(r,t=(t+o)/2,i,t,i,o)}function Xte(n,r,t,i,o){var a=pS(r,t),s=pS(r,t=(t+o)/2),u=pS(i,t),p=pS(i,o);n.moveTo(a[0],a[1]),n.bezierCurveTo(s[0],s[1],u[0],u[1],p[0],p[1])}function $te(){return aZ(Qte)}function ene(){return aZ(Kte)}function tne(){var n=aZ(Xte);return n.angle=n.x,delete n.x,n.radius=n.y,delete n.y,n}var sZ={draw:function(r,t){var i=Math.sqrt(t/tv);r.moveTo(i,0),r.arc(0,0,i,0,hp)}},SH={draw:function(r,t){var i=Math.sqrt(t/5)/2;r.moveTo(-3*i,-i),r.lineTo(-i,-i),r.lineTo(-i,-3*i),r.lineTo(i,-3*i),r.lineTo(i,-i),r.lineTo(3*i,-i),r.lineTo(3*i,i),r.lineTo(i,i),r.lineTo(i,3*i),r.lineTo(-i,3*i),r.lineTo(-i,i),r.lineTo(-3*i,i),r.closePath()}},TH=Math.sqrt(1/3),nne=2*TH,xH={draw:function(r,t){var i=Math.sqrt(t/nne),o=i*TH;r.moveTo(0,-i),r.lineTo(o,0),r.lineTo(0,i),r.lineTo(-o,0),r.closePath()}},wH=Math.sin(tv/10)/Math.sin(7*tv/10),ine=Math.sin(hp/10)*wH,one=-Math.cos(hp/10)*wH,EH={draw:function(r,t){var i=Math.sqrt(.8908130915292852*t),o=ine*i,a=one*i;r.moveTo(0,-i),r.lineTo(o,a);for(var s=1;s<5;++s){var u=hp*s/5,p=Math.cos(u),m=Math.sin(u);r.lineTo(m*i,-p*i),r.lineTo(p*o-m*a,m*o+p*a)}r.closePath()}},kH={draw:function(r,t){var i=Math.sqrt(t),o=-i/2;r.rect(o,o,i,i)}},lZ=Math.sqrt(3),MH={draw:function(r,t){var i=-Math.sqrt(t/(3*lZ));r.moveTo(0,2*i),r.lineTo(-lZ*i,-i),r.lineTo(lZ*i,-i),r.closePath()}},ku=-.5,Mu=Math.sqrt(3)/2,uZ=1/Math.sqrt(12),ane=3*(uZ/2+1),AH={draw:function(r,t){var i=Math.sqrt(t/ane),o=i/2,a=i*uZ,s=o,u=i*uZ+i,p=-s,m=u;r.moveTo(o,a),r.lineTo(s,u),r.lineTo(p,m),r.lineTo(ku*o-Mu*a,Mu*o+ku*a),r.lineTo(ku*s-Mu*u,Mu*s+ku*u),r.lineTo(ku*p-Mu*m,Mu*p+ku*m),r.lineTo(ku*o+Mu*a,ku*a-Mu*o),r.lineTo(ku*s+Mu*u,ku*u-Mu*s),r.lineTo(ku*p+Mu*m,ku*m-Mu*p),r.closePath()}},sne=[sZ,SH,xH,kH,EH,MH,AH];function lne(){var n=ci(sZ),r=ci(64),t=null;function i(){var o;if(t||(t=o=tc()),n.apply(this,arguments).draw(t,+r.apply(this,arguments)),o)return t=null,o+""||null}return i.type=function(o){return arguments.length?(n="function"==typeof o?o:ci(o),i):n},i.size=function(o){return arguments.length?(r="function"==typeof o?o:ci(+o),i):r},i.context=function(o){return arguments.length?(t=null==o?null:o,i):t},i}function Jf(){}function OA(n,r,t){n._context.bezierCurveTo((2*n._x0+n._x1)/3,(2*n._y0+n._y1)/3,(n._x0+2*n._x1)/3,(n._y0+2*n._y1)/3,(n._x0+4*n._x1+r)/6,(n._y0+4*n._y1+t)/6)}function PA(n){this._context=n}function une(n){return new PA(n)}function DH(n){this._context=n}function cne(n){return new DH(n)}function OH(n){this._context=n}function dne(n){return new OH(n)}function PH(n,r){this._basis=new PA(n),this._beta=r}PA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:OA(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(r,t):this._context.moveTo(r,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:OA(this,r,t)}this._x0=this._x1,this._x1=r,this._y0=this._y1,this._y1=t}},DH.prototype={areaStart:Jf,areaEnd:Jf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1,this._x2=r,this._y2=t;break;case 1:this._point=2,this._x3=r,this._y3=t;break;case 2:this._point=3,this._x4=r,this._y4=t,this._context.moveTo((this._x0+4*this._x1+r)/6,(this._y0+4*this._y1+t)/6);break;default:OA(this,r,t)}this._x0=this._x1,this._x1=r,this._y0=this._y1,this._y1=t}},OH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+r)/6,o=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(i,o):this._context.moveTo(i,o);break;case 3:this._point=4;default:OA(this,r,t)}this._x0=this._x1,this._x1=r,this._y0=this._y1,this._y1=t}},PH.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var r=this._x,t=this._y,i=r.length-1;if(i>0)for(var m,o=r[0],a=t[0],s=r[i]-o,u=t[i]-a,p=-1;++p<=i;)this._basis.point(this._beta*r[p]+(1-this._beta)*(o+(m=p/i)*s),this._beta*t[p]+(1-this._beta)*(a+m*u));this._x=this._y=null,this._basis.lineEnd()},point:function(r,t){this._x.push(+r),this._y.push(+t)}};var pne=function n(r){function t(i){return 1===r?new PA(i):new PH(i,r)}return t.beta=function(i){return n(+i)},t}(.85);function IA(n,r,t){n._context.bezierCurveTo(n._x1+n._k*(n._x2-n._x0),n._y1+n._k*(n._y2-n._y0),n._x2+n._k*(n._x1-r),n._y2+n._k*(n._y1-t),n._x2,n._y2)}function cZ(n,r){this._context=n,this._k=(1-r)/6}cZ.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:IA(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(r,t):this._context.moveTo(r,t);break;case 1:this._point=2,this._x1=r,this._y1=t;break;case 2:this._point=3;default:IA(this,r,t)}this._x0=this._x1,this._x1=this._x2,this._x2=r,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var fne=function n(r){function t(i){return new cZ(i,r)}return t.tension=function(i){return n(+i)},t}(0);function dZ(n,r){this._context=n,this._k=(1-r)/6}dZ.prototype={areaStart:Jf,areaEnd:Jf,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(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1,this._x3=r,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=r,this._y4=t);break;case 2:this._point=3,this._x5=r,this._y5=t;break;default:IA(this,r,t)}this._x0=this._x1,this._x1=this._x2,this._x2=r,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var hne=function n(r){function t(i){return new dZ(i,r)}return t.tension=function(i){return n(+i)},t}(0);function pZ(n,r){this._context=n,this._k=(1-r)/6}pZ.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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:IA(this,r,t)}this._x0=this._x1,this._x1=this._x2,this._x2=r,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var mne=function n(r){function t(i){return new pZ(i,r)}return t.tension=function(i){return n(+i)},t}(0);function fZ(n,r,t){var i=n._x1,o=n._y1,a=n._x2,s=n._y2;if(n._l01_a>us){var u=2*n._l01_2a+3*n._l01_a*n._l12_a+n._l12_2a,p=3*n._l01_a*(n._l01_a+n._l12_a);i=(i*u-n._x0*n._l12_2a+n._x2*n._l01_2a)/p,o=(o*u-n._y0*n._l12_2a+n._y2*n._l01_2a)/p}if(n._l23_a>us){var m=2*n._l23_2a+3*n._l23_a*n._l12_a+n._l12_2a,C=3*n._l23_a*(n._l23_a+n._l12_a);a=(a*m+n._x1*n._l23_2a-r*n._l12_2a)/C,s=(s*m+n._y1*n._l23_2a-t*n._l12_2a)/C}n._context.bezierCurveTo(i,o,a,s,n._x2,n._y2)}function IH(n,r){this._context=n,this._alpha=r}IH.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._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){if(r=+r,t=+t,this._point){var i=this._x2-r,o=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(r,t):this._context.moveTo(r,t);break;case 1:this._point=2;break;case 2:this._point=3;default:fZ(this,r,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=r,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var vne=function n(r){function t(i){return r?new IH(i,r):new cZ(i,0)}return t.alpha=function(i){return n(+i)},t}(.5);function RH(n,r){this._context=n,this._alpha=r}RH.prototype={areaStart:Jf,areaEnd:Jf,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._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=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(r,t){if(r=+r,t=+t,this._point){var i=this._x2-r,o=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=r,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=r,this._y4=t);break;case 2:this._point=3,this._x5=r,this._y5=t;break;default:fZ(this,r,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=r,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var gne=function n(r){function t(i){return r?new RH(i,r):new dZ(i,0)}return t.alpha=function(i){return n(+i)},t}(.5);function NH(n,r){this._context=n,this._alpha=r}NH.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._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(r,t){if(r=+r,t=+t,this._point){var i=this._x2-r,o=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+o*o,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:fZ(this,r,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=r,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var _ne=function n(r){function t(i){return r?new NH(i,r):new pZ(i,0)}return t.alpha=function(i){return n(+i)},t}(.5);function ZH(n){this._context=n}function yne(n){return new ZH(n)}function LH(n){return n<0?-1:1}function FH(n,r,t){var i=n._x1-n._x0,o=r-n._x1,a=(n._y1-n._y0)/(i||o<0&&-0),s=(t-n._y1)/(o||i<0&&-0),u=(a*o+s*i)/(i+o);return(LH(a)+LH(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(u))||0}function BH(n,r){var t=n._x1-n._x0;return t?(3*(n._y1-n._y0)/t-r)/2:r}function hZ(n,r,t){var i=n._x0,a=n._x1,s=n._y1,u=(a-i)/3;n._context.bezierCurveTo(i+u,n._y0+u*r,a-u,s-u*t,a,s)}function RA(n){this._context=n}function UH(n){this._context=new HH(n)}function HH(n){this._context=n}function bne(n){return new RA(n)}function Cne(n){return new UH(n)}function VH(n){this._context=n}function qH(n){var r,i,t=n.length-1,o=new Array(t),a=new Array(t),s=new Array(t);for(o[0]=0,a[0]=2,s[0]=n[0]+2*n[1],r=1;r=0;--r)o[r]=(s[r]-o[r+1])/a[r];for(a[t-1]=(n[t]+o[t-1])/2,r=0;r1)for(var i,o,s,t=1,a=n[r[0]],u=a.length;t=0;)t[r]=r;return t}function Ene(n,r){return n[r]}function kne(){var n=ci([]),r=X_,t=K_,i=Ene;function o(a){var u,P,s=n.apply(this,arguments),p=a.length,m=s.length,C=new Array(m);for(u=0;u0){for(var t,i,s,o=0,a=n[0].length;o1)for(var t,o,a,s,u,p,i=0,m=n[r[0]].length;i=0?(o[0]=s,o[1]=s+=a):a<0?(o[1]=u,o[0]=u+=a):o[0]=s}function Dne(n,r){if((o=n.length)>0){for(var o,t=0,i=n[r[0]],a=i.length;t0&&(a=(o=n[r[0]]).length)>0){for(var o,a,s,t=0,i=1;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(r,t){switch(r=+r,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(r,t):this._context.moveTo(r,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(r,t);else{var i=this._x*(1-this._t)+r*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,t)}}this._x=r,this._y=t}},mZ.prototype={constructor:mZ,insert:function(r,t){var i,o,a;if(r){if(t.P=r,t.N=r.N,r.N&&(r.N.P=t),r.N=t,r.R){for(r=r.R;r.L;)r=r.L;r.L=t}else r.R=t;i=r}else this._?(r=GH(this._),t.P=null,t.N=r,r.P=r.L=t,i=r):(t.P=t.N=null,this._=t,i=null);for(t.L=t.R=null,t.U=i,t.C=!0,r=t;i&&i.C;)i===(o=i.U).L?(a=o.R)&&a.C?(i.C=a.C=!1,o.C=!0,r=o):(r===i.R&&(fS(this,i),i=(r=i).U),i.C=!1,o.C=!0,hS(this,o)):(a=o.L)&&a.C?(i.C=a.C=!1,o.C=!0,r=o):(r===i.L&&(hS(this,i),i=(r=i).U),i.C=!1,o.C=!0,fS(this,o)),i=r.U;this._.C=!1},remove:function(r){r.N&&(r.N.P=r.P),r.P&&(r.P.N=r.N),r.N=r.P=null;var i,s,u,t=r.U,o=r.L,a=r.R;if(s=o?a?GH(a):o:a,t?t.L===r?t.L=s:t.R=s:this._=s,o&&a?(u=s.C,s.C=r.C,s.L=o,o.U=s,s!==a?(t=s.U,s.U=r.U,t.L=r=s.R,s.R=a,a.U=s):(s.U=t,t=s,r=s.R)):(u=r.C,r=s),r&&(r.U=t),!u){if(r&&r.C)return void(r.C=!1);do{if(r===this._)break;if(r===t.L){if((i=t.R).C&&(i.C=!1,t.C=!0,fS(this,t),i=t.R),i.L&&i.L.C||i.R&&i.R.C){(!i.R||!i.R.C)&&(i.L.C=!1,i.C=!0,hS(this,i),i=t.R),i.C=t.C,t.C=i.R.C=!1,fS(this,t),r=this._;break}}else if((i=t.L).C&&(i.C=!1,t.C=!0,hS(this,t),i=t.L),i.L&&i.L.C||i.R&&i.R.C){(!i.L||!i.L.C)&&(i.R.C=!1,i.C=!0,fS(this,i),i=t.L),i.C=t.C,t.C=i.L.C=!1,hS(this,t),r=this._;break}i.C=!0,r=t,t=t.U}while(!r.C);r&&(r.C=!1)}}};var YH=mZ;function mS(n,r,t,i){var o=[null,null],a=Cs.push(o)-1;return o.left=n,o.right=r,t&&LA(o,n,r,t),i&&LA(o,r,n,i),Yl[n.index].halfedges.push(a),Yl[r.index].halfedges.push(a),o}function vS(n,r,t){var i=[r,t];return i.left=n,i}function LA(n,r,t,i){n[0]||n[1]?n.left===t?n[1]=i:n[0]=i:(n[0]=i,n.left=r,n.right=t)}function Fne(n,r,t,i,o){var te,a=n[0],s=n[1],u=a[0],p=a[1],P=0,L=1,G=s[0]-u,Y=s[1]-p;if(te=r-u,G||!(te>0)){if(te/=G,G<0){if(te0){if(te>L)return;te>P&&(P=te)}if(te=i-u,G||!(te<0)){if(te/=G,G<0){if(te>L)return;te>P&&(P=te)}else if(G>0){if(te0)){if(te/=Y,Y<0){if(te0){if(te>L)return;te>P&&(P=te)}if(te=o-p,Y||!(te<0)){if(te/=Y,Y<0){if(te>L)return;te>P&&(P=te)}else if(Y>0){if(te0)&&!(L<1)||(P>0&&(n[0]=[u+P*G,p+P*Y]),L<1&&(n[1]=[u+L*G,p+L*Y])),!0}}}}}function Bne(n,r,t,i,o){var a=n[1];if(a)return!0;var te,de,s=n[0],u=n.left,p=n.right,m=u[0],C=u[1],P=p[0],L=p[1],G=(m+P)/2;if(L===C){if(G=i)return;if(m>P){if(s){if(s[1]>=o)return}else s=[G,t];a=[G,o]}else{if(s){if(s[1]1)if(m>P){if(s){if(s[1]>=o)return}else s=[(t-de)/te,t];a=[(o-de)/te,o]}else{if(s){if(s[1]=i)return}else s=[r,te*r+de];a=[i,te*i+de]}else{if(s){if(s[0]=-Kne)){var G=p*p+m*m,Y=C*C+P*P,te=(P*G-m*Y)/L,de=(p*Y-C*G)/L,Me=QH.pop()||new Wne;Me.arc=n,Me.site=o,Me.x=te+s,Me.y=(Me.cy=de+u)+Math.sqrt(te*te+de*de),n.circle=Me;for(var st=null,tt=gS._;tt;)if(Me.yuo)u=u.L;else{if(!((s=r-Qne(u,t))>uo)){a>-uo?(i=u.P,o=u):s>-uo?(i=u,o=u.N):i=o=u;break}if(!u.R){i=u;break}u=u.R}!function(n){Yl[n.index]={site:n,halfedges:[]}}(n);var p=XH(n);if(ty.insert(i,p),i||o){if(i===o)return ey(i),o=XH(i.site),ty.insert(p,o),p.edge=o.edge=mS(i.site,p.site),$_(i),void $_(o);if(!o)return void(p.edge=mS(i.site,p.site));ey(i),ey(o);var m=i.site,C=m[0],P=m[1],L=n[0]-C,G=n[1]-P,Y=o.site,te=Y[0]-C,de=Y[1]-P,Me=2*(L*de-G*te),st=L*L+G*G,tt=te*te+de*de,at=[(de*st-G*tt)/Me+C,(L*tt-te*st)/Me+P];LA(o.edge,m,Y,at),p.edge=mS(m,n,null,at),o.edge=mS(n,Y,null,at),$_(i),$_(o)}}function $H(n,r){var t=n.site,i=t[0],o=t[1],a=o-r;if(!a)return i;var s=n.P;if(!s)return-1/0;var u=(t=s.site)[0],p=t[1],m=p-r;if(!m)return u;var C=u-i,P=1/a-1/m,L=C/m;return P?(-L+Math.sqrt(L*L-2*P*(C*C/(-2*m)-p+m/2+o-a/2)))/P+i:(i+u)/2}function Qne(n,r){var t=n.N;if(t)return $H(t,r);var i=n.site;return i[1]===r?i[0]:1/0}var ty,Yl,gS,Cs,uo=1e-6,Kne=1e-12;function Xne(n,r,t){return(n[0]-t[0])*(r[1]-n[1])-(n[0]-r[0])*(t[1]-n[1])}function $ne(n,r){return r[1]-n[1]||r[0]-n[0]}function _Z(n,r){var i,o,a,t=n.sort($ne).pop();for(Cs=[],Yl=new Array(n.length),ty=new YH,gS=new YH;;)if(a=vZ,t&&(!a||t[1]uo||Math.abs(a[0][1]-a[1][1])>uo)||delete Cs[o]})(s,u,p,m),function(n,r,t,i){var a,s,u,p,m,C,P,L,G,Y,te,de,o=Yl.length,Me=!0;for(a=0;auo||Math.abs(de-G)>uo)&&(m.splice(p,0,Cs.push(vS(u,Y,Math.abs(te-n)uo?[n,Math.abs(L-n)uo?[Math.abs(G-i)uo?[t,Math.abs(L-t)uo?[Math.abs(G-r)=u)return null;var m=r-p.site[0],C=t-p.site[1],P=m*m+C*C;do{p=o.cells[a=s],s=null,p.halfedges.forEach(function(L){var G=o.edges[L],Y=G.left;if(Y!==p.site&&Y||(Y=G.right)){var te=r-Y[0],de=t-Y[1],Me=te*te+de*de;Mei?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function nV(){var C,P,n=nre,r=rre,t=are,i=ire,o=ore,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,p=t8,m=Cm("start","zoom","end"),L=500,Y=0;function te(ot){ot.property("__zoom",tV).on("wheel.zoom",Je).on("mousedown.zoom",et).on("dblclick.zoom",It).filter(o).on("touchstart.zoom",Et).on("touchmove.zoom",pn).on("touchend.zoom touchcancel.zoom",Wt).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function de(ot,Dt){return(Dt=Math.max(a[0],Math.min(a[1],Dt)))===ot.k?ot:new mp(Dt,ot.x,ot.y)}function Me(ot,Dt,mn){var dn=Dt[0]-mn[0]*ot.k,xn=Dt[1]-mn[1]*ot.k;return dn===ot.x&&xn===ot.y?ot:new mp(ot.k,dn,xn)}function st(ot){return[(+ot[0][0]+ +ot[1][0])/2,(+ot[0][1]+ +ot[1][1])/2]}function tt(ot,Dt,mn){ot.on("start.zoom",function(){at(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){at(this,arguments).end()}).tween("zoom",function(){var dn=this,xn=arguments,Fn=at(dn,xn),er=r.apply(dn,xn),mr=mn||st(er),jr=Math.max(er[1][0]-er[0][0],er[1][1]-er[0][1]),ir=dn.__zoom,Gr="function"==typeof Dt?Dt.apply(dn,xn):Dt,ai=p(ir.invert(mr).concat(jr/ir.k),Gr.invert(mr).concat(jr/Gr.k));return function(vr){if(1===vr)vr=Gr;else{var Bi=ai(vr),Bo=jr/Bi[2];vr=new mp(Bo,mr[0]-Bi[0]*Bo,mr[1]-Bi[1]*Bo)}Fn.zoom(null,vr)}})}function at(ot,Dt,mn){return!mn&&ot.__zooming||new pt(ot,Dt)}function pt(ot,Dt){this.that=ot,this.args=Dt,this.active=0,this.extent=r.apply(ot,Dt),this.taps=0}function Je(){if(n.apply(this,arguments)){var ot=at(this,arguments),Dt=this.__zoom,mn=Math.max(a[0],Math.min(a[1],Dt.k*Math.pow(2,i.apply(this,arguments)))),dn=Fs(this);Dt.k!==mn&&(ot.wheel?((ot.mouse[0][0]!==dn[0]||ot.mouse[0][1]!==dn[1])&&(ot.mouse[1]=Dt.invert(ot.mouse[0]=dn)),clearTimeout(ot.wheel)):(ot.mouse=[dn,Dt.invert(dn)],Um(this),ot.start()),_S(),ot.wheel=setTimeout(xn,150),ot.zoom("mouse",t(Me(de(Dt,mn),ot.mouse[0],ot.mouse[1]),ot.extent,s)))}function xn(){ot.wheel=null,ot.end()}}function et(){if(!P&&n.apply(this,arguments)){var ot=at(this,arguments,!0),Dt=ni(On.view).on("mousemove.zoom",Fn,!0).on("mouseup.zoom",er,!0),mn=Fs(this),dn=On.clientX,xn=On.clientY;Em(On.view),yZ(),ot.mouse=[mn,this.__zoom.invert(mn)],Um(this),ot.start()}function Fn(){if(_S(),!ot.moved){var mr=On.clientX-dn,jr=On.clientY-xn;ot.moved=mr*mr+jr*jr>Y}ot.zoom("mouse",t(Me(ot.that.__zoom,ot.mouse[0]=Fs(ot.that),ot.mouse[1]),ot.extent,s))}function er(){Dt.on("mousemove.zoom mouseup.zoom",null),A_(On.view,ot.moved),_S(),ot.end()}}function It(){if(n.apply(this,arguments)){var ot=this.__zoom,Dt=Fs(this),mn=ot.invert(Dt),dn=ot.k*(On.shiftKey?.5:2),xn=t(Me(de(ot,dn),Dt,mn),r.apply(this,arguments),s);_S(),u>0?ni(this).transition().duration(u).call(tt,xn,Dt):ni(this).call(te.transform,xn)}}function Et(){if(n.apply(this,arguments)){var dn,xn,Fn,er,ot=On.touches,Dt=ot.length,mn=at(this,arguments,On.changedTouches.length===Dt);for(yZ(),xn=0;xn0?a.animate(a._lastPercent,a.options.percent):a.draw(a.options.percent),a._lastPercent=a.options.percent)):(a.options.animation&&a.options.animationDuration>0?a.animate(a._lastPercent,a.options.percent):a.draw(a.options.percent),a._lastPercent=a.options.percent)},this.polarToCartesian=function(s,u,p,m){var C=m*Math.PI/180;return{x:s+Math.sin(C)*p,y:u-Math.cos(C)*p}},this.draw=function(s){var u=(s=void 0===s?a.options.percent:Math.abs(s))>100?100:s,p=2*a.options.radius+2*a.options.outerStrokeWidth;a.options.showBackground&&(p+=2*a.options.backgroundStrokeWidth+a.max(0,2*a.options.backgroundPadding));var L,G,m={x:p/2,y:p/2},C={x:m.x,y:m.y-a.options.radius},P=a.polarToCartesian(m.x,m.y,a.options.radius,360*(a.options.clockwise?u:100-u)/100);if(100===u&&(P.x=P.x+(a.options.clockwise?-.01:.01)),u>50){var te=(0,b.Z)(a.options.clockwise?[1,1]:[1,0],2);L=te[0],G=te[1]}else{var Me=(0,b.Z)(a.options.clockwise?[0,1]:[0,0],2);L=Me[0],G=Me[1]}var st=a.options.animateTitle?s:a.options.percent,tt=st>a.options.maxPercent?"".concat(a.options.maxPercent.toFixed(a.options.toFixed),"+"):st.toFixed(a.options.toFixed),at=a.options.animateSubtitle?s:a.options.percent,pt={x:m.x,y:m.y,textAnchor:"middle",color:a.options.titleColor,fontSize:a.options.titleFontSize,fontWeight:a.options.titleFontWeight,texts:[],tspans:[]};if(void 0!==a.options.titleFormat&&"Function"===a.options.titleFormat.constructor.name){var Je=a.options.titleFormat(st);Je instanceof Array?pt.texts=(0,v.Z)(Je):pt.texts.push(Je.toString())}else"auto"===a.options.title?pt.texts.push(tt):a.options.title instanceof Array?pt.texts=(0,v.Z)(a.options.title):pt.texts.push(a.options.title.toString());var et={x:m.x,y:m.y,textAnchor:"middle",color:a.options.subtitleColor,fontSize:a.options.subtitleFontSize,fontWeight:a.options.subtitleFontWeight,texts:[],tspans:[]};if(void 0!==a.options.subtitleFormat&&"Function"===a.options.subtitleFormat.constructor.name){var It=a.options.subtitleFormat(at);It instanceof Array?et.texts=(0,v.Z)(It):et.texts.push(It.toString())}else a.options.subtitle instanceof Array?et.texts=(0,v.Z)(a.options.subtitle):et.texts.push(a.options.subtitle.toString());var Et={text:"".concat(a.options.units),fontSize:a.options.unitsFontSize,fontWeight:a.options.unitsFontWeight,color:a.options.unitsColor},pn=0,Wt=1;if(a.options.showTitle&&(pn+=pt.texts.length),a.options.showSubtitle&&(pn+=et.texts.length),a.options.showTitle){var Dt,ot=(0,_.Z)(pt.texts);try{for(ot.s();!(Dt=ot.n()).done;)pt.tspans.push({span:Dt.value,dy:a.getRelativeY(Wt,pn)}),Wt++}catch(er){ot.e(er)}finally{ot.f()}}if(a.options.showSubtitle){var xn,dn=(0,_.Z)(et.texts);try{for(dn.s();!(xn=dn.n()).done;)et.tspans.push({span:xn.value,dy:a.getRelativeY(Wt,pn)}),Wt++}catch(er){dn.e(er)}finally{dn.f()}}null===a._gradientUUID&&(a._gradientUUID=a.uuid()),a.svg={viewBox:"0 0 ".concat(p," ").concat(p),width:a.options.responsive?"100%":p,height:a.options.responsive?"100%":p,backgroundCircle:{cx:m.x,cy:m.y,r:a.options.radius+a.options.outerStrokeWidth/2+a.options.backgroundPadding,fill:a.options.backgroundColor,fillOpacity:a.options.backgroundOpacity,stroke:a.options.backgroundStroke,strokeWidth:a.options.backgroundStrokeWidth},path:{d:"M ".concat(C.x," ").concat(C.y,"\n A ").concat(a.options.radius," ").concat(a.options.radius," 0 ").concat(L," ").concat(G," ").concat(P.x," ").concat(P.y),stroke:a.options.outerStrokeColor,strokeWidth:a.options.outerStrokeWidth,strokeLinecap:a.options.outerStrokeLinecap,fill:"none"},circle:{cx:m.x,cy:m.y,r:a.options.radius-a.options.space-a.options.outerStrokeWidth/2-a.options.innerStrokeWidth/2,fill:"none",stroke:a.options.innerStrokeColor,strokeWidth:a.options.innerStrokeWidth},title:pt,units:Et,subtitle:et,image:{x:m.x-a.options.imageWidth/2,y:m.y-a.options.imageHeight/2,src:a.options.imageSrc,width:a.options.imageWidth,height:a.options.imageHeight},outerLinearGradient:{id:"outer-linear-"+a._gradientUUID,colorStop1:a.options.outerStrokeColor,colorStop2:"transparent"===a.options.outerStrokeGradientStopColor?"#FFF":a.options.outerStrokeGradientStopColor},radialGradient:{id:"radial-"+a._gradientUUID,colorStop1:a.options.backgroundColor,colorStop2:"transparent"===a.options.backgroundGradientStopColor?"#FFF":a.options.backgroundGradientStopColor}}},this.getAnimationParameters=function(s,u){var m,C,P,L=a.options.startFromZero||s<0?0:s,G=u<0?0:a.min(u,a.options.maxPercent),Y=Math.abs(Math.round(G-L));return Y>=100?(m=100,C=a.options.animateTitle||a.options.animateSubtitle?Math.round(Y/m):1):(m=Y,C=1),(P=Math.round(a.options.animationDuration/m))<10&&(m=a.options.animationDuration/(P=10),C=!a.options.animateTitle&&!a.options.animateSubtitle&&Y>100?Math.round(100/m):Math.round(Y/m)),C<1&&(C=1),{times:m,step:C,interval:P}},this.animate=function(s,u){a._timerSubscription&&!a._timerSubscription.closed&&a._timerSubscription.unsubscribe();var p=a.options.startFromZero?0:s,m=u,C=a.getAnimationParameters(p,m),P=C.step,L=C.interval,G=p;a._timerSubscription=p=100?(a.draw(m),a._timerSubscription.unsubscribe()):a.draw(G):(a.draw(m),a._timerSubscription.unsubscribe())}):(0,yS.H)(0,L).subscribe(function(){(G-=P)>=m?!a.options.animateTitle&&!a.options.animateSubtitle&&m>=100?(a.draw(m),a._timerSubscription.unsubscribe()):a.draw(G):(a.draw(m),a._timerSubscription.unsubscribe())})},this.emitClickEvent=function(s){a.options.renderOnClick&&a.animate(0,a.options.percent),a.onClick.emit(s)},this.applyOptions=function(){for(var s=0,u=Object.keys(a.options);s0?+a.options.percent:0,a.options.maxPercent=Math.abs(+a.options.maxPercent),a.options.animationDuration=Math.abs(a.options.animationDuration),a.options.outerStrokeWidth=Math.abs(+a.options.outerStrokeWidth),a.options.innerStrokeWidth=Math.abs(+a.options.innerStrokeWidth),a.options.backgroundPadding=+a.options.backgroundPadding},this.getRelativeY=function(s,u){return(1*(s-u/2)-.18).toFixed(2)+"em"},this.min=function(s,u){return su?s:u},this.uuid=function(){var s=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(p){var m=(s+16*Math.random())%16|0;return s=Math.floor(s/16),("x"==p?m:3&m|8).toString(16)})},this.findSvgElement=function(){if(null===this.svgElement){var s=this.elRef.nativeElement.getElementsByTagName("svg");s.length>0&&(this.svgElement=s[0])}},this.checkViewport=function(){a.findSvgElement();var s=a.isInViewport;a.isInViewport=a.isElementInViewport(a.svgElement),s!==a.isInViewport&&a.onViewportChanged.emit({oldValue:s,newValue:a.isInViewport})},this.onScroll=function(s){a.checkViewport()},this.loadEventsForLazyMode=function(){if(a.options.lazy){a.document.addEventListener("scroll",a.onScroll,!0),a.window.addEventListener("resize",a.onScroll,!0),null===a._viewportChangedSubscriber&&(a._viewportChangedSubscriber=a.onViewportChanged.subscribe(function(u){u.newValue&&a.render()}));var s=(0,yS.H)(0,50).subscribe(function(){null===a.svgElement?a.checkViewport():s.unsubscribe()})}},this.unloadEventsForLazyMode=function(){a.document.removeEventListener("scroll",a.onScroll,!0),a.window.removeEventListener("resize",a.onScroll,!0),null!==a._viewportChangedSubscriber&&(a._viewportChangedSubscriber.unsubscribe(),a._viewportChangedSubscriber=null)},this.document=o,this.window=this.document.defaultView,Object.assign(this.options,t),Object.assign(this.defaultOptions,t)}return(0,T.Z)(r,[{key:"isDrawing",value:function(){return this._timerSubscription&&!this._timerSubscription.closed}},{key:"isElementInViewport",value:function(i){if(null==i)return!1;var s,o=i.getBoundingClientRect(),a=i.parentNode;do{if(s=a.getBoundingClientRect(),o.top>=s.bottom||o.bottom<=s.top||o.left>=s.right||o.right<=s.left)return!1;a=a.parentNode}while(a!=this.document.body);return!(o.top>=(this.window.innerHeight||this.document.documentElement.clientHeight)||o.bottom<=0||o.left>=(this.window.innerWidth||this.document.documentElement.clientWidth)||o.right<=0)}},{key:"ngOnInit",value:function(){this.loadEventsForLazyMode()}},{key:"ngOnDestroy",value:function(){this.unloadEventsForLazyMode()}},{key:"ngOnChanges",value:function(i){this.render(),"lazy"in i&&(i.lazy.currentValue?this.loadEventsForLazyMode():this.unloadEventsForLazyMode())}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(UA),e.Y36(e.SBq),e.Y36(kt.K0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["circle-progress"]],inputs:{name:"name",class:"class",backgroundGradient:"backgroundGradient",backgroundColor:"backgroundColor",backgroundGradientStopColor:"backgroundGradientStopColor",backgroundOpacity:"backgroundOpacity",backgroundStroke:"backgroundStroke",backgroundStrokeWidth:"backgroundStrokeWidth",backgroundPadding:"backgroundPadding",radius:"radius",space:"space",percent:"percent",toFixed:"toFixed",maxPercent:"maxPercent",renderOnClick:"renderOnClick",units:"units",unitsFontSize:"unitsFontSize",unitsFontWeight:"unitsFontWeight",unitsColor:"unitsColor",outerStrokeGradient:"outerStrokeGradient",outerStrokeWidth:"outerStrokeWidth",outerStrokeColor:"outerStrokeColor",outerStrokeGradientStopColor:"outerStrokeGradientStopColor",outerStrokeLinecap:"outerStrokeLinecap",innerStrokeColor:"innerStrokeColor",innerStrokeWidth:"innerStrokeWidth",titleFormat:"titleFormat",title:"title",titleColor:"titleColor",titleFontSize:"titleFontSize",titleFontWeight:"titleFontWeight",subtitleFormat:"subtitleFormat",subtitle:"subtitle",subtitleColor:"subtitleColor",subtitleFontSize:"subtitleFontSize",subtitleFontWeight:"subtitleFontWeight",imageSrc:"imageSrc",imageHeight:"imageHeight",imageWidth:"imageWidth",animation:"animation",animateTitle:"animateTitle",animateSubtitle:"animateSubtitle",animationDuration:"animationDuration",showTitle:"showTitle",showSubtitle:"showSubtitle",showUnits:"showUnits",showImage:"showImage",showBackground:"showBackground",showInnerStroke:"showInnerStroke",clockwise:"clockwise",responsive:"responsive",startFromZero:"startFromZero",showZeroOuterStroke:"showZeroOuterStroke",lazy:"lazy",templateOptions:["options","templateOptions"]},outputs:{onClick:"onClick"},features:[e.TTD],decls:1,vars:1,consts:[["xmlns","http://www.w3.org/2000/svg","preserveAspectRatio","xMidYMid meet",3,"click",4,"ngIf"],["xmlns","http://www.w3.org/2000/svg","preserveAspectRatio","xMidYMid meet",3,"click"],[4,"ngIf"],["alignment-baseline","baseline",4,"ngIf"],["preserveAspectRatio","none",4,"ngIf"],["offset","5%"],["offset","95%"],["alignment-baseline","baseline"],[4,"ngFor","ngForOf"],["preserveAspectRatio","none"]],template:function(t,i){1&t&&e.YNc(0,xre,9,11,"svg",0),2&t&&e.Q6J("ngIf",i.svg)},directives:[kt.O5,kt.sg],encapsulation:2}),n}(),Ere=function(){var n=function(){function r(){(0,g.Z)(this,r)}return(0,T.Z)(r,null,[{key:"forRoot",value:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{ngModule:r,providers:[{provide:UA,useValue:i}]}}}]),r}();return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[kt.ez]]}),n}(),bZ=function(){function n(r){(0,g.Z)(this,n),this.rawFile=r;var i=function(n){return!(!n||!(n.nodeName||n.prop&&n.attr&&n.find))}(r)?r.value:r;this["_createFrom"+("string"==typeof i?"FakePath":"Object")](i)}return(0,T.Z)(n,[{key:"_createFromFakePath",value:function(t){this.lastModifiedDate=void 0,this.size=void 0,this.type="like/"+t.slice(t.lastIndexOf(".")+1).toLowerCase(),this.name=t.slice(t.lastIndexOf("/")+t.lastIndexOf("\\")+2)}},{key:"_createFromObject",value:function(t){this.size=t.size,this.type=t.type,this.name=t.name}}]),n}(),Mre=function(){function n(r,t,i){(0,g.Z)(this,n),this.url="/",this.headers=[],this.withCredentials=!0,this.formData=[],this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.index=void 0,this.uploader=r,this.some=t,this.options=i,this.file=new bZ(t),this._file=t,r.options&&(this.method=r.options.method||"POST",this.alias=r.options.itemAlias||"file"),this.url=r.options.url}return(0,T.Z)(n,[{key:"upload",value:function(){try{this.uploader.uploadItem(this)}catch(t){this.uploader._onCompleteItem(this,"",0,{}),this.uploader._onErrorItem(this,"",0,{})}}},{key:"cancel",value:function(){this.uploader.cancelItem(this)}},{key:"remove",value:function(){this.uploader.removeFromQueue(this)}},{key:"onBeforeUpload",value:function(){}},{key:"onBuildForm",value:function(t){return{form:t}}},{key:"onProgress",value:function(t){return{progress:t}}},{key:"onSuccess",value:function(t,i,o){return{response:t,status:i,headers:o}}},{key:"onError",value:function(t,i,o){return{response:t,status:i,headers:o}}},{key:"onCancel",value:function(t,i,o){return{response:t,status:i,headers:o}}},{key:"onComplete",value:function(t,i,o){return{response:t,status:i,headers:o}}},{key:"_onBeforeUpload",value:function(){this.isReady=!0,this.isUploading=!0,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!1,this.isError=!1,this.progress=0,this.onBeforeUpload()}},{key:"_onBuildForm",value:function(t){this.onBuildForm(t)}},{key:"_onProgress",value:function(t){this.progress=t,this.onProgress(t)}},{key:"_onSuccess",value:function(t,i,o){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!0,this.isCancel=!1,this.isError=!1,this.progress=100,this.index=void 0,this.onSuccess(t,i,o)}},{key:"_onError",value:function(t,i,o){this.isReady=!1,this.isUploading=!1,this.isUploaded=!0,this.isSuccess=!1,this.isCancel=!1,this.isError=!0,this.progress=0,this.index=void 0,this.onError(t,i,o)}},{key:"_onCancel",value:function(t,i,o){this.isReady=!1,this.isUploading=!1,this.isUploaded=!1,this.isSuccess=!1,this.isCancel=!0,this.isError=!1,this.progress=0,this.index=void 0,this.onCancel(t,i,o)}},{key:"_onComplete",value:function(t,i,o){this.onComplete(t,i,o),this.uploader.options.removeAfterUpload&&this.remove()}},{key:"_prepareToUploading",value:function(){this.index=this.index||++this.uploader._nextIndex,this.isReady=!0}}]),n}(),Are=function(){var n=function(){function r(){(0,g.Z)(this,r)}return(0,T.Z)(r,null,[{key:"getMimeClass",value:function(i){var o="application";return-1!==this.mime_psd.indexOf(i.type)||i.type.match("image.*")?o="image":i.type.match("video.*")?o="video":i.type.match("audio.*")?o="audio":"application/pdf"===i.type?o="pdf":-1!==this.mime_compress.indexOf(i.type)?o="compress":-1!==this.mime_doc.indexOf(i.type)?o="doc":-1!==this.mime_xsl.indexOf(i.type)?o="xls":-1!==this.mime_ppt.indexOf(i.type)&&(o="ppt"),"application"===o&&(o=this.fileTypeDetection(i.name)),o}},{key:"fileTypeDetection",value:function(i){var o={jpg:"image",jpeg:"image",tif:"image",psd:"image",bmp:"image",png:"image",nef:"image",tiff:"image",cr2:"image",dwg:"image",cdr:"image",ai:"image",indd:"image",pin:"image",cdp:"image",skp:"image",stp:"image","3dm":"image",mp3:"audio",wav:"audio",wma:"audio",mod:"audio",m4a:"audio",compress:"compress",zip:"compress",rar:"compress","7z":"compress",lz:"compress",z01:"compress",bz2:"compress",gz:"compress",pdf:"pdf",xls:"xls",xlsx:"xls",ods:"xls",mp4:"video",avi:"video",wmv:"video",mpg:"video",mts:"video",flv:"video","3gp":"video",vob:"video",m4v:"video",mpeg:"video",m2ts:"video",mov:"video",doc:"doc",docx:"doc",eps:"doc",txt:"doc",odt:"doc",rtf:"doc",ppt:"ppt",pptx:"ppt",pps:"ppt",ppsx:"ppt",odp:"ppt"},a=i.split(".");if(a.length<2)return"application";var s=a[a.length-1].toLowerCase();return void 0===o[s]?"application":o[s]}}]),r}();return n.mime_doc=["application/msword","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12"],n.mime_xsl=["application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.ms-excel.sheet.macroEnabled.12","application/vnd.ms-excel.template.macroEnabled.12","application/vnd.ms-excel.addin.macroEnabled.12","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],n.mime_ppt=["application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.ms-powerpoint.addin.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],n.mime_psd=["image/photoshop","image/x-photoshop","image/psd","application/photoshop","application/psd","zz-application/zz-winassoc-psd"],n.mime_compress=["application/x-gtar","application/x-gcompress","application/compress","application/x-tar","application/x-rar-compressed","application/octet-stream","application/x-zip-compressed","application/zip-compressed","application/x-7z-compressed","application/gzip","application/x-bzip2"],n}(),nv=function(){function n(r){(0,g.Z)(this,n),this.isUploading=!1,this.queue=[],this.progress=0,this._nextIndex=0,this.options={autoUpload:!1,isHTML5:!0,filters:[],removeAfterUpload:!1,disableMultipart:!1,formatDataFunction:function(i){return i._file},formatDataFunctionIsAsync:!1},this.setOptions(r),this.response=new e.vpe}return(0,T.Z)(n,[{key:"setOptions",value:function(t){this.options=Object.assign(this.options,t),this.authToken=this.options.authToken,this.authTokenHeader=this.options.authTokenHeader||"Authorization",this.autoUpload=this.options.autoUpload,this.options.filters.unshift({name:"queueLimit",fn:this._queueLimitFilter}),this.options.maxFileSize&&this.options.filters.unshift({name:"fileSize",fn:this._fileSizeFilter}),this.options.allowedFileType&&this.options.filters.unshift({name:"fileType",fn:this._fileTypeFilter}),this.options.allowedMimeType&&this.options.filters.unshift({name:"mimeType",fn:this._mimeTypeFilter});for(var i=0;ithis.options.maxFileSize)}},{key:"_fileTypeFilter",value:function(t){return!(this.options.allowedFileType&&-1===this.options.allowedFileType.indexOf(Are.getMimeClass(t)))}},{key:"_onErrorItem",value:function(t,i,o,a){t._onError(i,o,a),this.onErrorItem(t,i,o,a)}},{key:"_onCompleteItem",value:function(t,i,o,a){t._onComplete(i,o,a),this.onCompleteItem(t,i,o,a);var s=this.getReadyItems()[0];this.isUploading=!1,s?s.upload():(this.onCompleteAll(),this.progress=this._getTotalProgress(),this._render())}},{key:"_headersGetter",value:function(t){return function(i){return i?t[i.toLowerCase()]||void 0:t}}},{key:"_xhrTransport",value:function(t){var s,i=this,o=this,a=t._xhr=new XMLHttpRequest;if(this._onBeforeUploadItem(t),"number"!=typeof t._file.size)throw new TypeError("The file specified is no longer valid");if(this.options.disableMultipart)s=this.options.formatDataFunction(t);else{s=new FormData,this._onBuildItemForm(t,s);var u=function(){return s.append(t.alias,t._file,t.file.name)};this.options.parametersBeforeFiles||u(),void 0!==this.options.additionalParameter&&Object.keys(this.options.additionalParameter).forEach(function(Y){var te=i.options.additionalParameter[Y];"string"==typeof te&&te.indexOf("{{file_name}}")>=0&&(te=te.replace("{{file_name}}",t.file.name)),s.append(Y,te)}),this.options.parametersBeforeFiles&&u()}if(a.upload.onprogress=function(Y){var te=Math.round(Y.lengthComputable?100*Y.loaded/Y.total:0);i._onProgressItem(t,te)},a.onload=function(){var Y=i._parseHeaders(a.getAllResponseHeaders()),te=i._transformResponse(a.response,Y),de=i._isSuccessCode(a.status)?"Success":"Error";i["_on"+de+"Item"](t,te,a.status,Y),i._onCompleteItem(t,te,a.status,Y)},a.onerror=function(){var Y=i._parseHeaders(a.getAllResponseHeaders()),te=i._transformResponse(a.response,Y);i._onErrorItem(t,te,a.status,Y),i._onCompleteItem(t,te,a.status,Y)},a.onabort=function(){var Y=i._parseHeaders(a.getAllResponseHeaders()),te=i._transformResponse(a.response,Y);i._onCancelItem(t,te,a.status,Y),i._onCompleteItem(t,te,a.status,Y)},a.open(t.method,t.url,!0),a.withCredentials=t.withCredentials,this.options.headers){var m,p=(0,_.Z)(this.options.headers);try{for(p.s();!(m=p.n()).done;){var C=m.value;a.setRequestHeader(C.name,C.value)}}catch(Y){p.e(Y)}finally{p.f()}}if(t.headers.length){var L,P=(0,_.Z)(t.headers);try{for(P.s();!(L=P.n()).done;){var G=L.value;a.setRequestHeader(G.name,G.value)}}catch(Y){P.e(Y)}finally{P.f()}}this.authToken&&a.setRequestHeader(this.authTokenHeader,this.authToken),a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&o.response.emit(a.responseText)},this.options.formatDataFunctionIsAsync?s.then(function(Y){return a.send(JSON.stringify(Y))}):a.send(s),this._render()}},{key:"_getTotalProgress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.options.removeAfterUpload)return t;var i=this.getNotUploadedItems().length,o=i?this.queue.length-i:this.queue.length,a=100/this.queue.length,s=t*a/100;return Math.round(o*a+s)}},{key:"_getFilters",value:function(t){if(!t)return this.options.filters;if(Array.isArray(t))return t;if("string"==typeof t){var i=t.match(/[^\s,]+/g);return this.options.filters.filter(function(o){return-1!==i.indexOf(o.name)})}return this.options.filters}},{key:"_render",value:function(){}},{key:"_queueLimitFilter",value:function(){return void 0===this.options.queueLimit||this.queue.length=200&&t<300||304===t}},{key:"_transformResponse",value:function(t,i){return t}},{key:"_parseHeaders",value:function(t){var o,a,s,i={};return t&&t.split("\n").map(function(u){s=u.indexOf(":"),o=u.slice(0,s).trim().toLowerCase(),a=u.slice(s+1).trim(),o&&(i[o]=i[o]?i[o]+", "+a:a)}),i}},{key:"_onWhenAddingFileFailed",value:function(t,i,o){this.onWhenAddingFileFailed(t,i,o)}},{key:"_onAfterAddingFile",value:function(t){this.onAfterAddingFile(t)}},{key:"_onAfterAddingAll",value:function(t){this.onAfterAddingAll(t)}},{key:"_onBeforeUploadItem",value:function(t){t._onBeforeUpload(),this.onBeforeUploadItem(t)}},{key:"_onBuildItemForm",value:function(t,i){t._onBuildForm(i),this.onBuildItemForm(t,i)}},{key:"_onProgressItem",value:function(t,i){var o=this._getTotalProgress(i);this.progress=o,t._onProgress(i),this.onProgressItem(t,i),this.onProgressAll(o),this._render()}},{key:"_onSuccessItem",value:function(t,i,o,a){t._onSuccess(i,o,a),this.onSuccessItem(t,i,o,a)}},{key:"_onCancelItem",value:function(t,i,o,a){t._onCancel(i,o,a),this.onCancelItem(t,i,o,a)}}]),n}(),bS=function(){var n=function(){function r(t){(0,g.Z)(this,r),this.onFileSelected=new e.vpe,this.element=t}return(0,T.Z)(r,[{key:"getOptions",value:function(){return this.uploader.options}},{key:"getFilters",value:function(){return{}}},{key:"isEmptyAfterSelection",value:function(){return!!this.element.nativeElement.attributes.multiple}},{key:"onChange",value:function(){var i=this.element.nativeElement.files,o=this.getOptions(),a=this.getFilters();this.uploader.addToQueue(i,o,a),this.onFileSelected.emit(i),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","ng2FileSelect",""]],hostBindings:function(t,i){1&t&&e.NdJ("change",function(){return i.onChange()})},inputs:{uploader:"uploader"},outputs:{onFileSelected:"onFileSelected"}}),n}(),Ore=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[kt.ez]]}),n}(),CZ=function(){function n(){}return Object.defineProperty(n.prototype,"child_process",{get:function(){return this._child_process||(this._child_process=window.require?window.require("child_process"):null),this._child_process},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isElectronApp",{get:function(){return!!window.navigator.userAgent.match(/Electron/)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"childProcess",{get:function(){return this.child_process?this.child_process:null},enumerable:!0,configurable:!0}),n}(),Pre=(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var i in t)t.hasOwnProperty(i)&&(r[i]=t[i])},function(r,t){function i(){this.constructor=r}n(r,t),r.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ire=function(n){function r(){return n.call(this)||this}return Pre(r,n),r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=e.Yz7({token:r,factory:function(i){return r.\u0275fac(i)}}),r}(CZ),Rre=function(){function n(){}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[{provide:CZ,useClass:Ire}]}),n}(),cs=function(){function n(){(0,g.Z)(this,n)}return(0,T.Z)(n,[{key:"electron",get:function(){return this._electron?this._electron:window&&window.require?(this._electron=window.require("electron"),this._electron):null}},{key:"isElectronApp",get:function(){return!!window.navigator.userAgent.match(/Electron/)}},{key:"isMacOS",get:function(){return this.isElectronApp&&"darwin"===process.platform}},{key:"isWindows",get:function(){return this.isElectronApp&&"win32"===process.platform}},{key:"isLinux",get:function(){return this.isElectronApp&&"linux"===process.platform}},{key:"isX86",get:function(){return this.isElectronApp&&"ia32"===process.arch}},{key:"isX64",get:function(){return this.isElectronApp&&"x64"===process.arch}},{key:"isArm",get:function(){return this.isElectronApp&&"arm"===process.arch}},{key:"desktopCapturer",get:function(){return this.electron?this.electron.desktopCapturer:null}},{key:"ipcRenderer",get:function(){return this.electron?this.electron.ipcRenderer:null}},{key:"remote",get:function(){return this.electron?this.electron.remote:null}},{key:"webFrame",get:function(){return this.electron?this.electron.webFrame:null}},{key:"clipboard",get:function(){return this.electron?this.electron.clipboard:null}},{key:"crashReporter",get:function(){return this.electron?this.electron.crashReporter:null}},{key:"process",get:function(){return this.remote?this.remote.process:null}},{key:"nativeImage",get:function(){return this.electron?this.electron.nativeImage:null}},{key:"screen",get:function(){return this.electron?this.remote.screen:null}},{key:"shell",get:function(){return this.electron?this.electron.shell:null}}]),n}(),Nre=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.call(this)}return i}(cs);return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),Zre=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[{provide:cs,useClass:Nre}]}),n}(),CS=f(88009),Lre=f(64646),rV=f(60131),SZ=f(4499),rv=f(93487),Fre=f(39887),iV=f(31927),Qf=f(13426),SS=f(38575),Bre=f(99583),ny=f(64233),Ure=f(26575),oV=f(59803),TZ=f(65890),vp=function n(r,t){(0,g.Z)(this,n),this.id=r,this.url=t},HA=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o){var a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"imperative",u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return(0,g.Z)(this,t),(a=r.call(this,i,o)).navigationTrigger=s,a.restoredState=u,a}return(0,T.Z)(t,[{key:"toString",value:function(){return"NavigationStart(id: ".concat(this.id,", url: '").concat(this.url,"')")}}]),t}(vp),iv=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a){var s;return(0,g.Z)(this,t),(s=r.call(this,i,o)).urlAfterRedirects=a,s}return(0,T.Z)(t,[{key:"toString",value:function(){return"NavigationEnd(id: ".concat(this.id,", url: '").concat(this.url,"', urlAfterRedirects: '").concat(this.urlAfterRedirects,"')")}}]),t}(vp),xZ=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a){var s;return(0,g.Z)(this,t),(s=r.call(this,i,o)).reason=a,s}return(0,T.Z)(t,[{key:"toString",value:function(){return"NavigationCancel(id: ".concat(this.id,", url: '").concat(this.url,"')")}}]),t}(vp),aV=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a){var s;return(0,g.Z)(this,t),(s=r.call(this,i,o)).error=a,s}return(0,T.Z)(t,[{key:"toString",value:function(){return"NavigationError(id: ".concat(this.id,", url: '").concat(this.url,"', error: ").concat(this.error,")")}}]),t}(vp),Hre=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a,s){var u;return(0,g.Z)(this,t),(u=r.call(this,i,o)).urlAfterRedirects=a,u.state=s,u}return(0,T.Z)(t,[{key:"toString",value:function(){return"RoutesRecognized(id: ".concat(this.id,", url: '").concat(this.url,"', urlAfterRedirects: '").concat(this.urlAfterRedirects,"', state: ").concat(this.state,")")}}]),t}(vp),Vre=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a,s){var u;return(0,g.Z)(this,t),(u=r.call(this,i,o)).urlAfterRedirects=a,u.state=s,u}return(0,T.Z)(t,[{key:"toString",value:function(){return"GuardsCheckStart(id: ".concat(this.id,", url: '").concat(this.url,"', urlAfterRedirects: '").concat(this.urlAfterRedirects,"', state: ").concat(this.state,")")}}]),t}(vp),qre=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a,s,u){var p;return(0,g.Z)(this,t),(p=r.call(this,i,o)).urlAfterRedirects=a,p.state=s,p.shouldActivate=u,p}return(0,T.Z)(t,[{key:"toString",value:function(){return"GuardsCheckEnd(id: ".concat(this.id,", url: '").concat(this.url,"', urlAfterRedirects: '").concat(this.urlAfterRedirects,"', state: ").concat(this.state,", shouldActivate: ").concat(this.shouldActivate,")")}}]),t}(vp),jre=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a,s){var u;return(0,g.Z)(this,t),(u=r.call(this,i,o)).urlAfterRedirects=a,u.state=s,u}return(0,T.Z)(t,[{key:"toString",value:function(){return"ResolveStart(id: ".concat(this.id,", url: '").concat(this.url,"', urlAfterRedirects: '").concat(this.urlAfterRedirects,"', state: ").concat(this.state,")")}}]),t}(vp),zre=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o,a,s){var u;return(0,g.Z)(this,t),(u=r.call(this,i,o)).urlAfterRedirects=a,u.state=s,u}return(0,T.Z)(t,[{key:"toString",value:function(){return"ResolveEnd(id: ".concat(this.id,", url: '").concat(this.url,"', urlAfterRedirects: '").concat(this.urlAfterRedirects,"', state: ").concat(this.state,")")}}]),t}(vp),sV=function(){function n(r){(0,g.Z)(this,n),this.route=r}return(0,T.Z)(n,[{key:"toString",value:function(){return"RouteConfigLoadStart(path: ".concat(this.route.path,")")}}]),n}(),lV=function(){function n(r){(0,g.Z)(this,n),this.route=r}return(0,T.Z)(n,[{key:"toString",value:function(){return"RouteConfigLoadEnd(path: ".concat(this.route.path,")")}}]),n}(),Wre=function(){function n(r){(0,g.Z)(this,n),this.snapshot=r}return(0,T.Z)(n,[{key:"toString",value:function(){return"ChildActivationStart(path: '".concat(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"","')")}}]),n}(),Gre=function(){function n(r){(0,g.Z)(this,n),this.snapshot=r}return(0,T.Z)(n,[{key:"toString",value:function(){return"ChildActivationEnd(path: '".concat(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"","')")}}]),n}(),Yre=function(){function n(r){(0,g.Z)(this,n),this.snapshot=r}return(0,T.Z)(n,[{key:"toString",value:function(){return"ActivationStart(path: '".concat(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"","')")}}]),n}(),Jre=function(){function n(r){(0,g.Z)(this,n),this.snapshot=r}return(0,T.Z)(n,[{key:"toString",value:function(){return"ActivationEnd(path: '".concat(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"","')")}}]),n}(),uV=function(){function n(r,t,i){(0,g.Z)(this,n),this.routerEvent=r,this.position=t,this.anchor=i}return(0,T.Z)(n,[{key:"toString",value:function(){var t=this.position?"".concat(this.position[0],", ").concat(this.position[1]):null;return"Scroll(anchor: '".concat(this.anchor,"', position: '").concat(t,"')")}}]),n}(),di="primary",Qre=function(){function n(r){(0,g.Z)(this,n),this.params=r||{}}return(0,T.Z)(n,[{key:"has",value:function(t){return Object.prototype.hasOwnProperty.call(this.params,t)}},{key:"get",value:function(t){if(this.has(t)){var i=this.params[t];return Array.isArray(i)?i[0]:i}return null}},{key:"getAll",value:function(t){if(this.has(t)){var i=this.params[t];return Array.isArray(i)?i:[i]}return[]}},{key:"keys",get:function(){return Object.keys(this.params)}}]),n}();function ry(n){return new Qre(n)}var cV="ngNavigationCancelingError";function wZ(n){var r=Error("NavigationCancelingError: "+n);return r[cV]=!0,r}function Xre(n,r,t){var i=t.path.split("/");if(i.length>n.length||"full"===t.pathMatch&&(r.hasChildren()||i.length0?n[n.length-1]:null}function ds(n,r){for(var t in n)n.hasOwnProperty(t)&&r(n[t],t)}function nd(n){return(0,e.CqO)(n)?n:(0,e.QGY)(n)?(0,Ya.D)(Promise.resolve(n)):(0,rr.of)(n)}var tie={exact:function vV(n,r,t){if(!av(n.segments,r.segments)||!VA(n.segments,r.segments,t)||n.numberOfChildren!==r.numberOfChildren)return!1;for(var i in r.children)if(!n.children[i]||!vV(n.children[i],r.children[i],t))return!1;return!0},subset:gV},hV={exact:function(n,r){return td(n,r)},subset:function(n,r){return Object.keys(r).length<=Object.keys(n).length&&Object.keys(r).every(function(t){return dV(n[t],r[t])})},ignored:function(){return!0}};function mV(n,r,t){return tie[t.paths](n.root,r.root,t.matrixParams)&&hV[t.queryParams](n.queryParams,r.queryParams)&&!("exact"===t.fragment&&n.fragment!==r.fragment)}function gV(n,r,t){return _V(n,r,r.segments,t)}function _V(n,r,t,i){if(n.segments.length>t.length){var o=n.segments.slice(0,t.length);return!(!av(o,t)||r.hasChildren()||!VA(o,t,i))}if(n.segments.length===t.length){if(!av(n.segments,t)||!VA(n.segments,t,i))return!1;for(var a in r.children)if(!n.children[a]||!gV(n.children[a],r.children[a],i))return!1;return!0}var s=t.slice(0,n.segments.length),u=t.slice(n.segments.length);return!!(av(n.segments,s)&&VA(n.segments,s,i)&&n.children[di])&&_V(n.children[di],r,u,i)}function VA(n,r,t){return r.every(function(i,o){return hV[t](n[o].parameters,i.parameters)})}var ov=function(){function n(r,t,i){(0,g.Z)(this,n),this.root=r,this.queryParams=t,this.fragment=i}return(0,T.Z)(n,[{key:"queryParamMap",get:function(){return this._queryParamMap||(this._queryParamMap=ry(this.queryParams)),this._queryParamMap}},{key:"toString",value:function(){return aie.serialize(this)}}]),n}(),_i=function(){function n(r,t){var i=this;(0,g.Z)(this,n),this.segments=r,this.children=t,this.parent=null,ds(t,function(o,a){return o.parent=i})}return(0,T.Z)(n,[{key:"hasChildren",value:function(){return this.numberOfChildren>0}},{key:"numberOfChildren",get:function(){return Object.keys(this.children).length}},{key:"toString",value:function(){return qA(this)}}]),n}(),TS=function(){function n(r,t){(0,g.Z)(this,n),this.path=r,this.parameters=t}return(0,T.Z)(n,[{key:"parameterMap",get:function(){return this._parameterMap||(this._parameterMap=ry(this.parameters)),this._parameterMap}},{key:"toString",value:function(){return SV(this)}}]),n}();function av(n,r){return n.length===r.length&&n.every(function(t,i){return t.path===r[i].path})}var EZ=function n(){(0,g.Z)(this,n)},yV=function(){function n(){(0,g.Z)(this,n)}return(0,T.Z)(n,[{key:"parse",value:function(t){var i=new mie(t);return new ov(i.parseRootSegment(),i.parseQueryParams(),i.parseFragment())}},{key:"serialize",value:function(t){var i="/".concat(xS(t.root,!0)),o=function(n){var r=Object.keys(n).map(function(t){var i=n[t];return Array.isArray(i)?i.map(function(o){return"".concat(jA(t),"=").concat(jA(o))}).join("&"):"".concat(jA(t),"=").concat(jA(i))}).filter(function(t){return!!t});return r.length?"?".concat(r.join("&")):""}(t.queryParams),a="string"==typeof t.fragment?"#".concat(function(n){return encodeURI(n)}(t.fragment)):"";return"".concat(i).concat(o).concat(a)}}]),n}(),aie=new yV;function qA(n){return n.segments.map(function(r){return SV(r)}).join("/")}function xS(n,r){if(!n.hasChildren())return qA(n);if(r){var t=n.children[di]?xS(n.children[di],!1):"",i=[];return ds(n.children,function(a,s){s!==di&&i.push("".concat(s,":").concat(xS(a,!1)))}),i.length>0?"".concat(t,"(").concat(i.join("//"),")"):t}var o=function(n,r){var t=[];return ds(n.children,function(i,o){o===di&&(t=t.concat(r(i,o)))}),ds(n.children,function(i,o){o!==di&&(t=t.concat(r(i,o)))}),t}(n,function(a,s){return s===di?[xS(n.children[di],!1)]:["".concat(s,":").concat(xS(a,!1))]});return 1===Object.keys(n.children).length&&null!=n.children[di]?"".concat(qA(n),"/").concat(o[0]):"".concat(qA(n),"/(").concat(o.join("//"),")")}function bV(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function jA(n){return bV(n).replace(/%3B/gi,";")}function kZ(n){return bV(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function zA(n){return decodeURIComponent(n)}function CV(n){return zA(n.replace(/\+/g,"%20"))}function SV(n){return"".concat(kZ(n.path)).concat(function(n){return Object.keys(n).map(function(r){return";".concat(kZ(r),"=").concat(kZ(n[r]))}).join("")}(n.parameters))}var cie=/^[^\/()?;=#]+/;function WA(n){var r=n.match(cie);return r?r[0]:""}var die=/^[^=?&#]+/,fie=/^[^?&#]+/,mie=function(){function n(r){(0,g.Z)(this,n),this.url=r,this.remaining=r}return(0,T.Z)(n,[{key:"parseRootSegment",value:function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new _i([],{}):new _i([],this.parseChildren())}},{key:"parseQueryParams",value:function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}},{key:"parseFragment",value:function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}},{key:"parseChildren",value:function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var i={};this.peekStartsWith("/(")&&(this.capture("/"),i=this.parseParens(!0));var o={};return this.peekStartsWith("(")&&(o=this.parseParens(!1)),(t.length>0||Object.keys(i).length>0)&&(o[di]=new _i(t,i)),o}},{key:"parseSegment",value:function(){var t=WA(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '".concat(this.remaining,"'."));return this.capture(t),new TS(zA(t),this.parseMatrixParams())}},{key:"parseMatrixParams",value:function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t}},{key:"parseParam",value:function(t){var i=WA(this.remaining);if(i){this.capture(i);var o="";if(this.consumeOptional("=")){var a=WA(this.remaining);a&&this.capture(o=a)}t[zA(i)]=zA(o)}}},{key:"parseQueryParam",value:function(t){var i=function(n){var r=n.match(die);return r?r[0]:""}(this.remaining);if(i){this.capture(i);var o="";if(this.consumeOptional("=")){var a=function(n){var r=n.match(fie);return r?r[0]:""}(this.remaining);a&&this.capture(o=a)}var s=CV(i),u=CV(o);if(t.hasOwnProperty(s)){var p=t[s];Array.isArray(p)||(t[s]=p=[p]),p.push(u)}else t[s]=u}}},{key:"parseParens",value:function(t){var i={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var o=WA(this.remaining),a=this.remaining[o.length];if("/"!==a&&")"!==a&&";"!==a)throw new Error("Cannot parse url '".concat(this.url,"'"));var s=void 0;o.indexOf(":")>-1?(s=o.substr(0,o.indexOf(":")),this.capture(s),this.capture(":")):t&&(s=di);var u=this.parseChildren();i[s]=1===Object.keys(u).length?u[di]:new _i([],u),this.consumeOptional("//")}return i}},{key:"peekStartsWith",value:function(t){return this.remaining.startsWith(t)}},{key:"consumeOptional",value:function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}},{key:"capture",value:function(t){if(!this.consumeOptional(t))throw new Error('Expected "'.concat(t,'".'))}}]),n}(),TV=function(){function n(r){(0,g.Z)(this,n),this._root=r}return(0,T.Z)(n,[{key:"root",get:function(){return this._root.value}},{key:"parent",value:function(t){var i=this.pathFromRoot(t);return i.length>1?i[i.length-2]:null}},{key:"children",value:function(t){var i=MZ(t,this._root);return i?i.children.map(function(o){return o.value}):[]}},{key:"firstChild",value:function(t){var i=MZ(t,this._root);return i&&i.children.length>0?i.children[0].value:null}},{key:"siblings",value:function(t){var i=AZ(t,this._root);return i.length<2?[]:i[i.length-2].children.map(function(a){return a.value}).filter(function(a){return a!==t})}},{key:"pathFromRoot",value:function(t){return AZ(t,this._root).map(function(i){return i.value})}}]),n}();function MZ(n,r){if(n===r.value)return r;var i,t=(0,_.Z)(r.children);try{for(t.s();!(i=t.n()).done;){var a=MZ(n,i.value);if(a)return a}}catch(s){t.e(s)}finally{t.f()}return null}function AZ(n,r){if(n===r.value)return[r];var i,t=(0,_.Z)(r.children);try{for(t.s();!(i=t.n()).done;){var a=AZ(n,i.value);if(a.length)return a.unshift(r),a}}catch(s){t.e(s)}finally{t.f()}return[]}var gp=function(){function n(r,t){(0,g.Z)(this,n),this.value=r,this.children=t}return(0,T.Z)(n,[{key:"toString",value:function(){return"TreeNode(".concat(this.value,")")}}]),n}();function wS(n){var r={};return n&&n.children.forEach(function(t){return r[t.value.outlet]=t}),r}var xV=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o){var a;return(0,g.Z)(this,t),(a=r.call(this,i)).snapshot=o,DZ((0,CS.Z)(a),i),a}return(0,T.Z)(t,[{key:"toString",value:function(){return this.snapshot.toString()}}]),t}(TV);function wV(n,r){var t=function(n,r){var s=new GA([],{},{},"",{},di,r,null,n.root,-1,{});return new kV("",new gp(s,[]))}(n,r),i=new eo.X([new TS("",{})]),o=new eo.X({}),a=new eo.X({}),s=new eo.X({}),u=new eo.X(""),p=new Dr(i,o,s,u,a,di,r,t.root);return p.snapshot=t.root,new xV(new gp(p,[]),t)}var Dr=function(){function n(r,t,i,o,a,s,u,p){(0,g.Z)(this,n),this.url=r,this.params=t,this.queryParams=i,this.fragment=o,this.data=a,this.outlet=s,this.component=u,this._futureSnapshot=p}return(0,T.Z)(n,[{key:"routeConfig",get:function(){return this._futureSnapshot.routeConfig}},{key:"root",get:function(){return this._routerState.root}},{key:"parent",get:function(){return this._routerState.parent(this)}},{key:"firstChild",get:function(){return this._routerState.firstChild(this)}},{key:"children",get:function(){return this._routerState.children(this)}},{key:"pathFromRoot",get:function(){return this._routerState.pathFromRoot(this)}},{key:"paramMap",get:function(){return this._paramMap||(this._paramMap=this.params.pipe((0,Er.U)(function(t){return ry(t)}))),this._paramMap}},{key:"queryParamMap",get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe((0,Er.U)(function(t){return ry(t)}))),this._queryParamMap}},{key:"toString",value:function(){return this.snapshot?this.snapshot.toString():"Future(".concat(this._futureSnapshot,")")}}]),n}();function EV(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"emptyOnly",t=n.pathFromRoot,i=0;if("always"!==r)for(i=t.length-1;i>=1;){var o=t[i],a=t[i-1];if(o.routeConfig&&""===o.routeConfig.path)i--;else{if(a.component)break;i--}}return gie(t.slice(i))}function gie(n){return n.reduce(function(r,t){return{params:Object.assign(Object.assign({},r.params),t.params),data:Object.assign(Object.assign({},r.data),t.data),resolve:Object.assign(Object.assign({},r.resolve),t._resolvedData)}},{params:{},data:{},resolve:{}})}var GA=function(){function n(r,t,i,o,a,s,u,p,m,C,P){(0,g.Z)(this,n),this.url=r,this.params=t,this.queryParams=i,this.fragment=o,this.data=a,this.outlet=s,this.component=u,this.routeConfig=p,this._urlSegment=m,this._lastPathIndex=C,this._resolve=P}return(0,T.Z)(n,[{key:"root",get:function(){return this._routerState.root}},{key:"parent",get:function(){return this._routerState.parent(this)}},{key:"firstChild",get:function(){return this._routerState.firstChild(this)}},{key:"children",get:function(){return this._routerState.children(this)}},{key:"pathFromRoot",get:function(){return this._routerState.pathFromRoot(this)}},{key:"paramMap",get:function(){return this._paramMap||(this._paramMap=ry(this.params)),this._paramMap}},{key:"queryParamMap",get:function(){return this._queryParamMap||(this._queryParamMap=ry(this.queryParams)),this._queryParamMap}},{key:"toString",value:function(){var t=this.url.map(function(o){return o.toString()}).join("/"),i=this.routeConfig?this.routeConfig.path:"";return"Route(url:'".concat(t,"', path:'").concat(i,"')")}}]),n}(),kV=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(i,o){var a;return(0,g.Z)(this,t),(a=r.call(this,o)).url=i,DZ((0,CS.Z)(a),o),a}return(0,T.Z)(t,[{key:"toString",value:function(){return MV(this._root)}}]),t}(TV);function DZ(n,r){r.value._routerState=n,r.children.forEach(function(t){return DZ(n,t)})}function MV(n){var r=n.children.length>0?" { ".concat(n.children.map(MV).join(", ")," } "):"";return"".concat(n.value).concat(r)}function OZ(n){if(n.snapshot){var r=n.snapshot,t=n._futureSnapshot;n.snapshot=t,td(r.queryParams,t.queryParams)||n.queryParams.next(t.queryParams),r.fragment!==t.fragment&&n.fragment.next(t.fragment),td(r.params,t.params)||n.params.next(t.params),function(n,r){if(n.length!==r.length)return!1;for(var t=0;to;){if(a-=o,!(i=i.parent))throw new Error("Invalid number of '../'");o=i.segments.length}return new RZ(i,!1,o-a)}(t.snapshot._urlSegment,t.snapshot._lastPathIndex+a,n.numberOfDoubleDots)}(a,r,n),u=s.processChildren?QA(s.segmentGroup,s.index,a.commands):PV(s.segmentGroup,s.index,a.commands);return IZ(s.segmentGroup,u,r,i,o)}function JA(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function ES(n){return"object"==typeof n&&null!=n&&n.outlets}function IZ(n,r,t,i,o){var a={};return i&&ds(i,function(s,u){a[u]=Array.isArray(s)?s.map(function(p){return"".concat(p)}):"".concat(s)}),new ov(t.root===n?r:DV(t.root,n,r),a,o)}function DV(n,r,t){var i={};return ds(n.children,function(o,a){i[a]=o===r?t:DV(o,r,t)}),new _i(n.segments,i)}var OV=function(){function n(r,t,i){if((0,g.Z)(this,n),this.isAbsolute=r,this.numberOfDoubleDots=t,this.commands=i,r&&i.length>0&&JA(i[0]))throw new Error("Root segment cannot have matrix parameters");var o=i.find(ES);if(o&&o!==fV(i))throw new Error("{outlets:{}} has to be the last command")}return(0,T.Z)(n,[{key:"toRoot",value:function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}]),n}(),RZ=function n(r,t,i){(0,g.Z)(this,n),this.segmentGroup=r,this.processChildren=t,this.index=i};function PV(n,r,t){if(n||(n=new _i([],{})),0===n.segments.length&&n.hasChildren())return QA(n,r,t);var i=function(n,r,t){for(var i=0,o=r,a={match:!1,pathIndex:0,commandIndex:0};o=t.length)return a;var s=n.segments[o],u=t[i];if(ES(u))break;var p="".concat(u),m=i0&&void 0===p)break;if(p&&m&&"object"==typeof m&&void 0===m.outlets){if(!RV(p,m,s))return a;i+=2}else{if(!RV(p,{},s))return a;i++}o++}return{match:!0,pathIndex:o,commandIndex:i}}(n,r,t),o=t.slice(i.commandIndex);if(i.match&&i.pathIndex1&&void 0!==arguments[1]?arguments[1]:"",t=0;t0)?Object.assign({},BV):{matched:!0,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};var a=(r.matcher||Xre)(t,n,r);if(!a)return Object.assign({},BV);var s={};ds(a.posParams,function(p,m){s[m]=p.path});var u=a.consumed.length>0?Object.assign(Object.assign({},s),a.consumed[a.consumed.length-1].parameters):s;return{matched:!0,consumedSegments:a.consumed,lastChild:a.consumed.length,parameters:u,positionalParamSegments:null!==(i=a.posParams)&&void 0!==i?i:{}}}function XA(n,r,t,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"corrected";if(t.length>0&&Uie(n,t,i)){var a=new _i(r,Bie(n,r,i,new _i(t,n.children)));return a._sourceSegment=n,a._segmentIndexShift=r.length,{segmentGroup:a,slicedSegments:[]}}if(0===t.length&&Hie(n,t,i)){var s=new _i(n.segments,Fie(n,r,t,i,n.children,o));return s._sourceSegment=n,s._segmentIndexShift=r.length,{segmentGroup:s,slicedSegments:t}}var u=new _i(n.segments,n.children);return u._sourceSegment=n,u._segmentIndexShift=r.length,{segmentGroup:u,slicedSegments:t}}function Fie(n,r,t,i,o,a){var p,s={},u=(0,_.Z)(i);try{for(u.s();!(p=u.n()).done;){var m=p.value;if($A(n,t,m)&&!o[Au(m)]){var C=new _i([],{});C._sourceSegment=n,C._segmentIndexShift="legacy"===a?n.segments.length:r.length,s[Au(m)]=C}}}catch(P){u.e(P)}finally{u.f()}return Object.assign(Object.assign({},o),s)}function Bie(n,r,t,i){var o={};o[di]=i,i._sourceSegment=n,i._segmentIndexShift=r.length;var s,a=(0,_.Z)(t);try{for(a.s();!(s=a.n()).done;){var u=s.value;if(""===u.path&&Au(u)!==di){var p=new _i([],{});p._sourceSegment=n,p._segmentIndexShift=r.length,o[Au(u)]=p}}}catch(m){a.e(m)}finally{a.f()}return o}function Uie(n,r,t){return t.some(function(i){return $A(n,r,i)&&Au(i)!==di})}function Hie(n,r,t){return t.some(function(i){return $A(n,r,i)})}function $A(n,r,t){return(!(n.hasChildren()||r.length>0)||"full"!==t.pathMatch)&&""===t.path}function UV(n,r,t,i){return!!(Au(n)===i||i!==di&&$A(r,t,n))&&("**"===n.path||KA(r,n,t).matched)}function HV(n,r,t){return 0===r.length&&!n.children[t]}var AS=function n(r){(0,g.Z)(this,n),this.segmentGroup=r||null},VV=function n(r){(0,g.Z)(this,n),this.urlTree=r};function e2(n){return new aa.y(function(r){return r.error(new AS(n))})}function qV(n){return new aa.y(function(r){return r.error(new VV(n))})}function Vie(n){return new aa.y(function(r){return r.error(new Error("Only absolute redirects can have named outlets. redirectTo: '".concat(n,"'")))})}var zie=function(){function n(r,t,i,o,a){(0,g.Z)(this,n),this.configLoader=t,this.urlSerializer=i,this.urlTree=o,this.config=a,this.allowRedirects=!0,this.ngModule=r.get(e.h0i)}return(0,T.Z)(n,[{key:"apply",value:function(){var t=this,i=XA(this.urlTree.root,[],[],this.config).segmentGroup,o=new _i(i.segments,i.children);return this.expandSegmentGroup(this.ngModule,this.config,o,di).pipe((0,Er.U)(function(u){return t.createUrlTree(FZ(u),t.urlTree.queryParams,t.urlTree.fragment)})).pipe((0,Qf.K)(function(u){if(u instanceof VV)return t.allowRedirects=!1,t.match(u.urlTree);throw u instanceof AS?t.noMatchError(u):u}))}},{key:"match",value:function(t){var i=this;return this.expandSegmentGroup(this.ngModule,this.config,t.root,di).pipe((0,Er.U)(function(s){return i.createUrlTree(FZ(s),t.queryParams,t.fragment)})).pipe((0,Qf.K)(function(s){throw s instanceof AS?i.noMatchError(s):s}))}},{key:"noMatchError",value:function(t){return new Error("Cannot match any routes. URL Segment: '".concat(t.segmentGroup,"'"))}},{key:"createUrlTree",value:function(t,i,o){var a=t.segments.length>0?new _i([],(0,V.Z)({},di,t)):t;return new ov(a,i,o)}},{key:"expandSegmentGroup",value:function(t,i,o,a){return 0===o.segments.length&&o.hasChildren()?this.expandChildren(t,i,o).pipe((0,Er.U)(function(s){return new _i([],s)})):this.expandSegment(t,o,i,o.segments,a,!0)}},{key:"expandChildren",value:function(t,i,o){for(var a=this,s=[],u=0,p=Object.keys(o.children);u1||!a.children[di])return Vie(t.redirectTo);a=a.children[di]}}},{key:"applyRedirectCommands",value:function(t,i,o){return this.applyRedirectCreatreUrlTree(i,this.urlSerializer.parse(i),t,o)}},{key:"applyRedirectCreatreUrlTree",value:function(t,i,o,a){var s=this.createSegmentGroup(t,i.root,o,a);return new ov(s,this.createQueryParams(i.queryParams,this.urlTree.queryParams),i.fragment)}},{key:"createQueryParams",value:function(t,i){var o={};return ds(t,function(a,s){if("string"==typeof a&&a.startsWith(":")){var p=a.substring(1);o[s]=i[p]}else o[s]=a}),o}},{key:"createSegmentGroup",value:function(t,i,o,a){var s=this,u=this.createSegments(t,i.segments,o,a),p={};return ds(i.children,function(m,C){p[C]=s.createSegmentGroup(t,m,o,a)}),new _i(u,p)}},{key:"createSegments",value:function(t,i,o,a){var s=this;return i.map(function(u){return u.path.startsWith(":")?s.findPosParam(t,u,a):s.findOrReturn(u,o)})}},{key:"findPosParam",value:function(t,i,o){var a=o[i.path.substring(1)];if(!a)throw new Error("Cannot redirect to '".concat(t,"'. Cannot find '").concat(i.path,"'."));return a}},{key:"findOrReturn",value:function(t,i){var s,o=0,a=(0,_.Z)(i);try{for(a.s();!(s=a.n()).done;){var u=s.value;if(u.path===t.path)return i.splice(o),u;o++}}catch(p){a.e(p)}finally{a.f()}return t}}]),n}();function FZ(n){for(var r={},t=0,i=Object.keys(n.children);t0||s.hasChildren())&&(r[o]=s)}return function(n){if(1===n.numberOfChildren&&n.children[di]){var r=n.children[di];return new _i(n.segments.concat(r.segments),r.children)}return n}(new _i(n.segments,r))}var jV=function n(r){(0,g.Z)(this,n),this.path=r,this.route=this.path[this.path.length-1]},t2=function n(r,t){(0,g.Z)(this,n),this.component=r,this.route=t};function Yie(n,r,t){var i=n._root;return DS(i,r?r._root:null,t,[i.value])}function n2(n,r,t){var i=function(n){if(!n)return null;for(var r=n.parent;r;r=r.parent){var t=r.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(r);return(i?i.module.injector:t).get(n)}function DS(n,r,t,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{canDeactivateChecks:[],canActivateChecks:[]},a=wS(r);return n.children.forEach(function(s){Kie(s,a[s.value.outlet],t,i.concat([s.value]),o),delete a[s.value.outlet]}),ds(a,function(s,u){return OS(s,t.getContext(u),o)}),o}function Kie(n,r,t,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{canDeactivateChecks:[],canActivateChecks:[]},a=n.value,s=r?r.value:null,u=t?t.getContext(n.value.outlet):null;if(s&&a.routeConfig===s.routeConfig){var p=Xie(s,a,a.routeConfig.runGuardsAndResolvers);p?o.canActivateChecks.push(new jV(i)):(a.data=s.data,a._resolvedData=s._resolvedData),DS(n,r,a.component?u?u.children:null:t,i,o),p&&u&&u.outlet&&u.outlet.isActivated&&o.canDeactivateChecks.push(new t2(u.outlet.component,s))}else s&&OS(r,u,o),o.canActivateChecks.push(new jV(i)),DS(n,null,a.component?u?u.children:null:t,i,o);return o}function Xie(n,r,t){if("function"==typeof t)return t(n,r);switch(t){case"pathParamsChange":return!av(n.url,r.url);case"pathParamsOrQueryParamsChange":return!av(n.url,r.url)||!td(n.queryParams,r.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!PZ(n,r)||!td(n.queryParams,r.queryParams);case"paramsChange":default:return!PZ(n,r)}}function OS(n,r,t){var i=wS(n),o=n.value;ds(i,function(a,s){OS(a,o.component?r?r.children.getContext(s):null:r,t)}),t.canDeactivateChecks.push(new t2(o.component&&r&&r.outlet&&r.outlet.isActivated?r.outlet.component:null,o))}var soe=function n(){(0,g.Z)(this,n)};function zV(n){return new aa.y(function(r){return r.error(n)})}var uoe=function(){function n(r,t,i,o,a,s){(0,g.Z)(this,n),this.rootComponentType=r,this.config=t,this.urlTree=i,this.url=o,this.paramsInheritanceStrategy=a,this.relativeLinkResolution=s}return(0,T.Z)(n,[{key:"recognize",value:function(){var t=XA(this.urlTree.root,[],[],this.config.filter(function(u){return void 0===u.redirectTo}),this.relativeLinkResolution).segmentGroup,i=this.processSegmentGroup(this.config,t,di);if(null===i)return null;var o=new GA([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},di,this.rootComponentType,null,this.urlTree.root,-1,{}),a=new gp(o,i),s=new kV(this.url,a);return this.inheritParamsAndData(s._root),s}},{key:"inheritParamsAndData",value:function(t){var i=this,o=t.value,a=EV(o,this.paramsInheritanceStrategy);o.params=Object.freeze(a.params),o.data=Object.freeze(a.data),t.children.forEach(function(s){return i.inheritParamsAndData(s)})}},{key:"processSegmentGroup",value:function(t,i,o){return 0===i.segments.length&&i.hasChildren()?this.processChildren(t,i):this.processSegment(t,i,i.segments,o)}},{key:"processChildren",value:function(t,i){for(var o=[],a=0,s=Object.keys(i.children);a0?fV(o).parameters:{};s=new GA(o,m,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,JV(t),Au(t),t.component,t,GV(i),YV(i)+o.length,QV(t))}else{var C=KA(i,t,o);if(!C.matched)return null;u=C.consumedSegments,p=o.slice(C.lastChild),s=new GA(u,C.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,JV(t),Au(t),t.component,t,GV(i),YV(i)+u.length,QV(t))}var P=function(n){return n.children?n.children:n.loadChildren?n._loadedConfig.routes:[]}(t),L=XA(i,u,p,P.filter(function(st){return void 0===st.redirectTo}),this.relativeLinkResolution),G=L.segmentGroup,Y=L.slicedSegments;if(0===Y.length&&G.hasChildren()){var te=this.processChildren(P,G);return null===te?null:[new gp(s,te)]}if(0===P.length&&0===Y.length)return[new gp(s,[])];var de=Au(t)===a,Me=this.processSegment(P,G,Y,de?di:a);return null===Me?null:[new gp(s,Me)]}}]),n}();function WV(n){var o,r=[],t=new Set,i=(0,_.Z)(n);try{var a=function(){var L=o.value;if(!function(n){var r=n.value.routeConfig;return r&&""===r.path&&void 0===r.redirectTo}(L))return r.push(L),"continue";var Y,G=r.find(function(te){return L.value.routeConfig===te.value.routeConfig});void 0!==G?((Y=G.children).push.apply(Y,(0,v.Z)(L.children)),t.add(G)):r.push(L)};for(i.s();!(o=i.n()).done;)a()}catch(P){i.e(P)}finally{i.f()}var p,u=(0,_.Z)(t);try{for(u.s();!(p=u.n()).done;){var m=p.value,C=WV(m.children);r.push(new gp(m.value,C))}}catch(P){u.e(P)}finally{u.f()}return r.filter(function(P){return!t.has(P)})}function GV(n){for(var r=n;r._sourceSegment;)r=r._sourceSegment;return r}function YV(n){for(var r=n,t=r._segmentIndexShift?r._segmentIndexShift:0;r._sourceSegment;)t+=(r=r._sourceSegment)._segmentIndexShift?r._segmentIndexShift:0;return t-1}function JV(n){return n.data||{}}function QV(n){return n.resolve||{}}function BZ(n){return(0,Zs.w)(function(r){var t=n(r);return t?(0,Ya.D)(t).pipe((0,Er.U)(function(){return r})):(0,rr.of)(r)})}var boe=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(){return(0,g.Z)(this,t),r.apply(this,arguments)}return t}(function(){function n(){(0,g.Z)(this,n)}return(0,T.Z)(n,[{key:"shouldDetach",value:function(t){return!1}},{key:"store",value:function(t,i){}},{key:"shouldAttach",value:function(t){return!1}},{key:"retrieve",value:function(t){return null}},{key:"shouldReuseRoute",value:function(t,i){return t.routeConfig===i.routeConfig}}]),n}()),UZ=new e.OlP("ROUTES"),KV=function(){function n(r,t,i,o){(0,g.Z)(this,n),this.loader=r,this.compiler=t,this.onLoadStartListener=i,this.onLoadEndListener=o}return(0,T.Z)(n,[{key:"load",value:function(t,i){var o=this;if(i._loader$)return i._loader$;this.onLoadStartListener&&this.onLoadStartListener(i);var s=this.loadModuleFactory(i.loadChildren).pipe((0,Er.U)(function(u){o.onLoadEndListener&&o.onLoadEndListener(i);var p=u.create(t);return new ZZ(pV(p.injector.get(UZ,void 0,e.XFs.Self|e.XFs.Optional)).map(LZ),p)}),(0,Qf.K)(function(u){throw i._loader$=void 0,u}));return i._loader$=new Fre.c(s,function(){return new Pn.xQ}).pipe((0,Ure.x)()),i._loader$}},{key:"loadModuleFactory",value:function(t){var i=this;return"string"==typeof t?(0,Ya.D)(this.loader.load(t)):nd(t()).pipe((0,sa.zg)(function(o){return o instanceof e.YKP?(0,rr.of)(o):(0,Ya.D)(i.compiler.compileModuleAsync(o))}))}}]),n}(),Coe=function n(){(0,g.Z)(this,n),this.outlet=null,this.route=null,this.resolver=null,this.children=new iy,this.attachRef=null},iy=function(){function n(){(0,g.Z)(this,n),this.contexts=new Map}return(0,T.Z)(n,[{key:"onChildOutletCreated",value:function(t,i){var o=this.getOrCreateContext(t);o.outlet=i,this.contexts.set(t,o)}},{key:"onChildOutletDestroyed",value:function(t){var i=this.getContext(t);i&&(i.outlet=null,i.attachRef=null)}},{key:"onOutletDeactivated",value:function(){var t=this.contexts;return this.contexts=new Map,t}},{key:"onOutletReAttached",value:function(t){this.contexts=t}},{key:"getOrCreateContext",value:function(t){var i=this.getContext(t);return i||(i=new Coe,this.contexts.set(t,i)),i}},{key:"getContext",value:function(t){return this.contexts.get(t)||null}}]),n}(),Toe=function(){function n(){(0,g.Z)(this,n)}return(0,T.Z)(n,[{key:"shouldProcessUrl",value:function(t){return!0}},{key:"extract",value:function(t){return t}},{key:"merge",value:function(t,i){return t}}]),n}();function xoe(n){throw n}function woe(n,r,t){return r.parse("/")}function XV(n,r){return(0,rr.of)(null)}var Eoe={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},koe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},xr=function(){var n=function(){function r(t,i,o,a,s,u,p,m){var C=this;(0,g.Z)(this,r),this.rootComponentType=t,this.urlSerializer=i,this.rootContexts=o,this.location=a,this.config=m,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.lastLocationChangeInfo=null,this.navigationId=0,this.currentPageId=0,this.isNgZoneEnabled=!1,this.events=new Pn.xQ,this.errorHandler=xoe,this.malformedUriErrorHandler=woe,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:XV,afterPreactivation:XV},this.urlHandlingStrategy=new Toe,this.routeReuseStrategy=new boe,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.canceledNavigationResolution="replace",this.ngModule=s.get(e.h0i),this.console=s.get(e.c2e);var G=s.get(e.R0b);this.isNgZoneEnabled=G instanceof e.R0b&&e.R0b.isInAngularZone(),this.resetConfig(m),this.currentUrlTree=new ov(new _i([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new KV(u,p,function(te){return C.triggerEvent(new sV(te))},function(te){return C.triggerEvent(new lV(te))}),this.routerState=wV(this.currentUrlTree,this.rootComponentType),this.transitions=new eo.X({id:0,targetPageId:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}return(0,T.Z)(r,[{key:"browserPageId",get:function(){var i;return null===(i=this.location.getState())||void 0===i?void 0:i.\u0275routerPageId}},{key:"setupNavigations",value:function(i){var o=this,a=this.events;return i.pipe((0,mi.h)(function(s){return 0!==s.id}),(0,Er.U)(function(s){return Object.assign(Object.assign({},s),{extractedUrl:o.urlHandlingStrategy.extract(s.rawUrl)})}),(0,Zs.w)(function(s){var u=!1,p=!1;return(0,rr.of)(s).pipe((0,Ra.b)(function(m){o.currentNavigation={id:m.id,initialUrl:m.currentRawUrl,extractedUrl:m.extractedUrl,trigger:m.source,extras:m.extras,previousNavigation:o.lastSuccessfulNavigation?Object.assign(Object.assign({},o.lastSuccessfulNavigation),{previousNavigation:null}):null}}),(0,Zs.w)(function(m){var C=o.browserUrlTree.toString(),P=!o.navigated||m.extractedUrl.toString()!==C||C!==o.currentUrlTree.toString();if(("reload"===o.onSameUrlNavigation||P)&&o.urlHandlingStrategy.shouldProcessUrl(m.rawUrl))return r2(m.source)&&(o.browserUrlTree=m.extractedUrl),(0,rr.of)(m).pipe((0,Zs.w)(function(pt){var Je=o.transitions.getValue();return a.next(new HA(pt.id,o.serializeUrl(pt.extractedUrl),pt.source,pt.restoredState)),Je!==o.transitions.getValue()?rv.E:Promise.resolve(pt)}),function(n,r,t,i){return(0,Zs.w)(function(o){return function(n,r,t,i,o){return new zie(n,r,t,i,o).apply()}(n,r,t,o.extractedUrl,i).pipe((0,Er.U)(function(a){return Object.assign(Object.assign({},o),{urlAfterRedirects:a})}))})}(o.ngModule.injector,o.configLoader,o.urlSerializer,o.config),(0,Ra.b)(function(pt){o.currentNavigation=Object.assign(Object.assign({},o.currentNavigation),{finalUrl:pt.urlAfterRedirects})}),function(n,r,t,i,o){return(0,sa.zg)(function(a){return function(n,r,t,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"emptyOnly",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"legacy";try{var s=new uoe(n,r,t,i,o,a).recognize();return null===s?zV(new soe):(0,rr.of)(s)}catch(u){return zV(u)}}(n,r,a.urlAfterRedirects,t(a.urlAfterRedirects),i,o).pipe((0,Er.U)(function(s){return Object.assign(Object.assign({},a),{targetSnapshot:s})}))})}(o.rootComponentType,o.config,function(pt){return o.serializeUrl(pt)},o.paramsInheritanceStrategy,o.relativeLinkResolution),(0,Ra.b)(function(pt){"eager"===o.urlUpdateStrategy&&(pt.extras.skipLocationChange||o.setBrowserUrl(pt.urlAfterRedirects,pt),o.browserUrlTree=pt.urlAfterRedirects);var Je=new Hre(pt.id,o.serializeUrl(pt.extractedUrl),o.serializeUrl(pt.urlAfterRedirects),pt.targetSnapshot);a.next(Je)}));if(P&&o.rawUrlTree&&o.urlHandlingStrategy.shouldProcessUrl(o.rawUrlTree)){var te=m.extractedUrl,de=m.source,Me=m.restoredState,st=m.extras,tt=new HA(m.id,o.serializeUrl(te),de,Me);a.next(tt);var at=wV(te,o.rootComponentType).snapshot;return(0,rr.of)(Object.assign(Object.assign({},m),{targetSnapshot:at,urlAfterRedirects:te,extras:Object.assign(Object.assign({},st),{skipLocationChange:!1,replaceUrl:!1})}))}return o.rawUrlTree=m.rawUrl,o.browserUrlTree=m.urlAfterRedirects,m.resolve(null),rv.E}),BZ(function(m){var Y=m.extras;return o.hooks.beforePreactivation(m.targetSnapshot,{navigationId:m.id,appliedUrlTree:m.extractedUrl,rawUrlTree:m.rawUrl,skipLocationChange:!!Y.skipLocationChange,replaceUrl:!!Y.replaceUrl})}),(0,Ra.b)(function(m){var C=new Vre(m.id,o.serializeUrl(m.extractedUrl),o.serializeUrl(m.urlAfterRedirects),m.targetSnapshot);o.triggerEvent(C)}),(0,Er.U)(function(m){return Object.assign(Object.assign({},m),{guards:Yie(m.targetSnapshot,m.currentSnapshot,o.rootContexts)})}),function(n,r){return(0,sa.zg)(function(t){var i=t.targetSnapshot,o=t.currentSnapshot,a=t.guards,s=a.canActivateChecks,u=a.canDeactivateChecks;return 0===u.length&&0===s.length?(0,rr.of)(Object.assign(Object.assign({},t),{guardsResult:!0})):function(n,r,t,i){return(0,Ya.D)(n).pipe((0,sa.zg)(function(o){return function(n,r,t,i,o){var a=r&&r.routeConfig?r.routeConfig.canDeactivate:null;if(!a||0===a.length)return(0,rr.of)(!0);var s=a.map(function(u){var m,p=n2(u,r,o);if(function(n){return n&&Kf(n.canDeactivate)}(p))m=nd(p.canDeactivate(n,r,t,i));else{if(!Kf(p))throw new Error("Invalid CanDeactivate guard");m=nd(p(n,r,t,i))}return m.pipe((0,ny.P)())});return(0,rr.of)(s).pipe(MS())}(o.component,o.route,t,r,i)}),(0,ny.P)(function(o){return!0!==o},!0))}(u,i,o,n).pipe((0,sa.zg)(function(p){return p&&function(n){return"boolean"==typeof n}(p)?function(n,r,t,i){return(0,Ya.D)(r).pipe((0,SS.b)(function(o){return(0,rV.z)(function(n,r){return null!==n&&r&&r(new Wre(n)),(0,rr.of)(!0)}(o.route.parent,i),function(n,r){return null!==n&&r&&r(new Yre(n)),(0,rr.of)(!0)}(o.route,i),function(n,r,t){var i=r[r.length-1],a=r.slice(0,r.length-1).reverse().map(function(s){return function(n){var r=n.routeConfig?n.routeConfig.canActivateChild:null;return r&&0!==r.length?{node:n,guards:r}:null}(s)}).filter(function(s){return null!==s}).map(function(s){return(0,SZ.P)(function(){var u=s.guards.map(function(p){var C,m=n2(p,s.node,t);if(function(n){return n&&Kf(n.canActivateChild)}(m))C=nd(m.canActivateChild(i,n));else{if(!Kf(m))throw new Error("Invalid CanActivateChild guard");C=nd(m(i,n))}return C.pipe((0,ny.P)())});return(0,rr.of)(u).pipe(MS())})});return(0,rr.of)(a).pipe(MS())}(n,o.path,t),function(n,r,t){var i=r.routeConfig?r.routeConfig.canActivate:null;if(!i||0===i.length)return(0,rr.of)(!0);var o=i.map(function(a){return(0,SZ.P)(function(){var u,s=n2(a,r,t);if(function(n){return n&&Kf(n.canActivate)}(s))u=nd(s.canActivate(r,n));else{if(!Kf(s))throw new Error("Invalid CanActivate guard");u=nd(s(r,n))}return u.pipe((0,ny.P)())})});return(0,rr.of)(o).pipe(MS())}(n,o.route,t))}),(0,ny.P)(function(o){return!0!==o},!0))}(i,s,n,r):(0,rr.of)(p)}),(0,Er.U)(function(p){return Object.assign(Object.assign({},t),{guardsResult:p})}))})}(o.ngModule.injector,function(m){return o.triggerEvent(m)}),(0,Ra.b)(function(m){if(sv(m.guardsResult)){var C=wZ('Redirecting to "'.concat(o.serializeUrl(m.guardsResult),'"'));throw C.url=m.guardsResult,C}var P=new qre(m.id,o.serializeUrl(m.extractedUrl),o.serializeUrl(m.urlAfterRedirects),m.targetSnapshot,!!m.guardsResult);o.triggerEvent(P)}),(0,mi.h)(function(m){return!!m.guardsResult||(o.restoreHistory(m),o.cancelNavigationTransition(m,""),!1)}),BZ(function(m){if(m.guards.canActivateChecks.length)return(0,rr.of)(m).pipe((0,Ra.b)(function(C){var P=new jre(C.id,o.serializeUrl(C.extractedUrl),o.serializeUrl(C.urlAfterRedirects),C.targetSnapshot);o.triggerEvent(P)}),(0,Zs.w)(function(C){var P=!1;return(0,rr.of)(C).pipe(function(n,r){return(0,sa.zg)(function(t){var i=t.targetSnapshot,o=t.guards.canActivateChecks;if(!o.length)return(0,rr.of)(t);var a=0;return(0,Ya.D)(o).pipe((0,SS.b)(function(s){return function(n,r,t,i){return function(n,r,t,i){var o=Object.keys(n);if(0===o.length)return(0,rr.of)({});var a={};return(0,Ya.D)(o).pipe((0,sa.zg)(function(s){return function(n,r,t,i){var o=n2(n,r,i);return nd(o.resolve?o.resolve(r,t):o(r,t))}(n[s],r,t,i).pipe((0,Ra.b)(function(u){a[s]=u}))}),(0,sk.h)(1),(0,sa.zg)(function(){return Object.keys(a).length===o.length?(0,rr.of)(a):rv.E}))}(n._resolve,n,r,i).pipe((0,Er.U)(function(a){return n._resolvedData=a,n.data=Object.assign(Object.assign({},n.data),EV(n,t).resolve),null}))}(s.route,i,n,r)}),(0,Ra.b)(function(){return a++}),(0,sk.h)(1),(0,sa.zg)(function(s){return a===o.length?(0,rr.of)(t):rv.E}))})}(o.paramsInheritanceStrategy,o.ngModule.injector),(0,Ra.b)({next:function(){return P=!0},complete:function(){P||(o.restoreHistory(C),o.cancelNavigationTransition(C,"At least one route resolver didn't emit any value."))}}))}),(0,Ra.b)(function(C){var P=new zre(C.id,o.serializeUrl(C.extractedUrl),o.serializeUrl(C.urlAfterRedirects),C.targetSnapshot);o.triggerEvent(P)}))}),BZ(function(m){var Y=m.extras;return o.hooks.afterPreactivation(m.targetSnapshot,{navigationId:m.id,appliedUrlTree:m.extractedUrl,rawUrlTree:m.rawUrl,skipLocationChange:!!Y.skipLocationChange,replaceUrl:!!Y.replaceUrl})}),(0,Er.U)(function(m){var C=function(n,r,t){var i=YA(n,r._root,t?t._root:void 0);return new xV(i,r)}(o.routeReuseStrategy,m.targetSnapshot,m.currentRouterState);return Object.assign(Object.assign({},m),{targetRouterState:C})}),(0,Ra.b)(function(m){o.currentUrlTree=m.urlAfterRedirects,o.rawUrlTree=o.urlHandlingStrategy.merge(m.urlAfterRedirects,m.rawUrl),o.routerState=m.targetRouterState,"deferred"===o.urlUpdateStrategy&&(m.extras.skipLocationChange||o.setBrowserUrl(o.rawUrlTree,m),o.browserUrlTree=m.urlAfterRedirects)}),function(r,t,i){return(0,Er.U)(function(o){return new Aie(t,o.targetRouterState,o.currentRouterState,i).activate(r),o})}(o.rootContexts,o.routeReuseStrategy,function(m){return o.triggerEvent(m)}),(0,Ra.b)({next:function(){u=!0},complete:function(){u=!0}}),(0,oV.x)(function(){var m;if(!u&&!p){var C="Navigation ID ".concat(s.id," is not equal to the current navigation id ").concat(o.navigationId);"replace"===o.canceledNavigationResolution&&o.restoreHistory(s),o.cancelNavigationTransition(s,C)}(null===(m=o.currentNavigation)||void 0===m?void 0:m.id)===s.id&&(o.currentNavigation=null)}),(0,Qf.K)(function(m){if(p=!0,function(n){return n&&n[cV]}(m)){var C=sv(m.url);C||(o.navigated=!0,o.restoreHistory(s,!0));var P=new xZ(s.id,o.serializeUrl(s.extractedUrl),m.message);a.next(P),C?setTimeout(function(){var G=o.urlHandlingStrategy.merge(m.url,o.rawUrlTree),Y={skipLocationChange:s.extras.skipLocationChange,replaceUrl:"eager"===o.urlUpdateStrategy||r2(s.source)};o.scheduleNavigation(G,"imperative",null,Y,{resolve:s.resolve,reject:s.reject,promise:s.promise})},0):s.resolve(!1)}else{o.restoreHistory(s,!0);var L=new aV(s.id,o.serializeUrl(s.extractedUrl),m);a.next(L);try{s.resolve(o.errorHandler(m))}catch(G){s.reject(G)}}return rv.E}))}))}},{key:"resetRootComponentType",value:function(i){this.rootComponentType=i,this.routerState.root.component=this.rootComponentType}},{key:"getTransition",value:function(){var i=this.transitions.value;return i.urlAfterRedirects=this.browserUrlTree,i}},{key:"setTransition",value:function(i){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),i))}},{key:"initialNavigation",value:function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}},{key:"setUpLocationChangeListener",value:function(){var i=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(function(o){var a=i.extractLocationChangeInfoFromEvent(o);i.shouldScheduleNavigation(i.lastLocationChangeInfo,a)&&setTimeout(function(){var s=a.source,u=a.state,p=a.urlTree,m={replaceUrl:!0};if(u){var C=Object.assign({},u);delete C.navigationId,delete C.\u0275routerPageId,0!==Object.keys(C).length&&(m.state=C)}i.scheduleNavigation(p,s,u,m)},0),i.lastLocationChangeInfo=a}))}},{key:"extractLocationChangeInfoFromEvent",value:function(i){var o;return{source:"popstate"===i.type?"popstate":"hashchange",urlTree:this.parseUrl(i.url),state:(null===(o=i.state)||void 0===o?void 0:o.navigationId)?i.state:null,transitionId:this.getTransition().id}}},{key:"shouldScheduleNavigation",value:function(i,o){if(!i)return!0;var a=o.urlTree.toString()===i.urlTree.toString();return!(o.transitionId===i.transitionId&&a&&("hashchange"===o.source&&"popstate"===i.source||"popstate"===o.source&&"hashchange"===i.source))}},{key:"url",get:function(){return this.serializeUrl(this.currentUrlTree)}},{key:"getCurrentNavigation",value:function(){return this.currentNavigation}},{key:"triggerEvent",value:function(i){this.events.next(i)}},{key:"resetConfig",value:function(i){LV(i),this.config=i.map(LZ),this.navigated=!1,this.lastSuccessfulId=-1}},{key:"ngOnDestroy",value:function(){this.dispose()}},{key:"dispose",value:function(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}},{key:"createUrlTree",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.relativeTo,s=o.queryParams,u=o.fragment,p=o.queryParamsHandling,m=o.preserveFragment,C=a||this.routerState.root,P=m?this.currentUrlTree.fragment:u,L=null;switch(p){case"merge":L=Object.assign(Object.assign({},this.currentUrlTree.queryParams),s);break;case"preserve":L=this.currentUrlTree.queryParams;break;default:L=s||null}return null!==L&&(L=this.removeEmptyProps(L)),Cie(C,this.currentUrlTree,i,L,null!=P?P:null)}},{key:"navigateByUrl",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{skipLocationChange:!1},a=sv(i)?i:this.parseUrl(i),s=this.urlHandlingStrategy.merge(a,this.rawUrlTree);return this.scheduleNavigation(s,"imperative",null,o)}},{key:"navigate",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{skipLocationChange:!1};return Moe(i),this.navigateByUrl(this.createUrlTree(i,o),o)}},{key:"serializeUrl",value:function(i){return this.urlSerializer.serialize(i)}},{key:"parseUrl",value:function(i){var o;try{o=this.urlSerializer.parse(i)}catch(a){o=this.malformedUriErrorHandler(a,this.urlSerializer,i)}return o}},{key:"isActive",value:function(i,o){var a;if(a=!0===o?Object.assign({},Eoe):!1===o?Object.assign({},koe):o,sv(i))return mV(this.currentUrlTree,i,a);var s=this.parseUrl(i);return mV(this.currentUrlTree,s,a)}},{key:"removeEmptyProps",value:function(i){return Object.keys(i).reduce(function(o,a){var s=i[a];return null!=s&&(o[a]=s),o},{})}},{key:"processNavigations",value:function(){var i=this;this.navigations.subscribe(function(o){i.navigated=!0,i.lastSuccessfulId=o.id,i.currentPageId=o.targetPageId,i.events.next(new iv(o.id,i.serializeUrl(o.extractedUrl),i.serializeUrl(i.currentUrlTree))),i.lastSuccessfulNavigation=i.currentNavigation,o.resolve(!0)},function(o){i.console.warn("Unhandled Navigation Error: ".concat(o))})}},{key:"scheduleNavigation",value:function(i,o,a,s,u){var p,m;if(this.disposed)return Promise.resolve(!1);var te,de,Me,C=this.getTransition(),P=r2(o)&&C&&!r2(C.source),Y=(this.lastSuccessfulId===C.id||this.currentNavigation?C.rawUrl:C.urlAfterRedirects).toString()===i.toString();if(P&&Y)return Promise.resolve(!0);u?(te=u.resolve,de=u.reject,Me=u.promise):Me=new Promise(function(pt,Je){te=pt,de=Je});var tt,st=++this.navigationId;return"computed"===this.canceledNavigationResolution?(0===this.currentPageId&&(a=this.location.getState()),tt=a&&a.\u0275routerPageId?a.\u0275routerPageId:s.replaceUrl||s.skipLocationChange?null!==(p=this.browserPageId)&&void 0!==p?p:0:(null!==(m=this.browserPageId)&&void 0!==m?m:0)+1):tt=0,this.setTransition({id:st,targetPageId:tt,source:o,restoredState:a,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:i,extras:s,resolve:te,reject:de,promise:Me,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),Me.catch(function(pt){return Promise.reject(pt)})}},{key:"setBrowserUrl",value:function(i,o){var a=this.urlSerializer.serialize(i),s=Object.assign(Object.assign({},o.extras.state),this.generateNgRouterState(o.id,o.targetPageId));this.location.isCurrentPathEqualTo(a)||o.extras.replaceUrl?this.location.replaceState(a,"",s):this.location.go(a,"",s)}},{key:"restoreHistory",value:function(i){var a,s,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("computed"===this.canceledNavigationResolution){var u=this.currentPageId-i.targetPageId,p="popstate"===i.source||"eager"===this.urlUpdateStrategy||this.currentUrlTree===(null===(a=this.currentNavigation)||void 0===a?void 0:a.finalUrl);p&&0!==u?this.location.historyGo(u):this.currentUrlTree===(null===(s=this.currentNavigation)||void 0===s?void 0:s.finalUrl)&&0===u&&(this.resetState(i),this.browserUrlTree=i.currentUrlTree,this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(o&&this.resetState(i),this.resetUrlToCurrentUrlTree())}},{key:"resetState",value:function(i){this.routerState=i.currentRouterState,this.currentUrlTree=i.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,i.rawUrl)}},{key:"resetUrlToCurrentUrlTree",value:function(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}},{key:"cancelNavigationTransition",value:function(i,o){var a=new xZ(i.id,this.serializeUrl(i.extractedUrl),o);this.triggerEvent(a),i.resolve(!1)}},{key:"generateNgRouterState",value:function(i,o){return"computed"===this.canceledNavigationResolution?{navigationId:i,"\u0275routerPageId":o}:{navigationId:i}}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(e.DyG),e.LFG(EZ),e.LFG(iy),e.LFG(kt.Ye),e.LFG(e.zs3),e.LFG(e.v3s),e.LFG(e.Sil),e.LFG(void 0))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}();function Moe(n){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};(0,g.Z)(this,r),this.router=t,this.viewportScroller=i,this.options=o,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},o.scrollPositionRestoration=o.scrollPositionRestoration||"disabled",o.anchorScrolling=o.anchorScrolling||"disabled"}return(0,T.Z)(r,[{key:"init",value:function(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}},{key:"createScrollEvents",value:function(){var i=this;return this.router.events.subscribe(function(o){o instanceof HA?(i.store[i.lastId]=i.viewportScroller.getScrollPosition(),i.lastSource=o.navigationTrigger,i.restoredId=o.restoredState?o.restoredState.navigationId:0):o instanceof iv&&(i.lastId=o.id,i.scheduleScrollEvent(o,i.router.parseUrl(o.urlAfterRedirects).fragment))})}},{key:"consumeScrollEvents",value:function(){var i=this;return this.router.events.subscribe(function(o){o instanceof uV&&(o.position?"top"===i.options.scrollPositionRestoration?i.viewportScroller.scrollToPosition([0,0]):"enabled"===i.options.scrollPositionRestoration&&i.viewportScroller.scrollToPosition(o.position):o.anchor&&"enabled"===i.options.anchorScrolling?i.viewportScroller.scrollToAnchor(o.anchor):"disabled"!==i.options.scrollPositionRestoration&&i.viewportScroller.scrollToPosition([0,0]))})}},{key:"scheduleScrollEvent",value:function(i,o){this.router.triggerEvent(new uV(i,"popstate"===this.lastSource?this.store[this.restoredId]:null,o))}},{key:"ngOnDestroy",value:function(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(xr),e.LFG(kt.EM),e.LFG(void 0))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),lv=new e.OlP("ROUTER_CONFIGURATION"),nq=new e.OlP("ROUTER_FORROOT_GUARD"),Roe=[kt.Ye,{provide:EZ,useClass:yV},{provide:xr,useFactory:function(n,r,t,i,o,a,s){var u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},p=arguments.length>8?arguments[8]:void 0,m=arguments.length>9?arguments[9]:void 0,C=new xr(null,n,r,t,i,o,a,pV(s));return p&&(C.urlHandlingStrategy=p),m&&(C.routeReuseStrategy=m),Uoe(u,C),u.enableTracing&&C.events.subscribe(function(P){var L,G;null===(L=console.group)||void 0===L||L.call(console,"Router Event: ".concat(P.constructor.name)),console.log(P.toString()),console.log(P),null===(G=console.groupEnd)||void 0===G||G.call(console)}),C},deps:[EZ,iy,kt.Ye,e.zs3,e.v3s,e.Sil,UZ,lv,[function n(){(0,g.Z)(this,n)},new e.FiY],[function n(){(0,g.Z)(this,n)},new e.FiY]]},iy,{provide:Dr,useFactory:function(n){return n.routerState.root},deps:[xr]},{provide:e.v3s,useClass:e.EAV},tq,eq,Poe,{provide:lv,useValue:{enableTracing:!1}}];function Noe(){return new e.PXZ("Router",xr)}var rq=function(){var n=function(){function r(t,i){(0,g.Z)(this,r)}return(0,T.Z)(r,null,[{key:"forRoot",value:function(i,o){return{ngModule:r,providers:[Roe,iq(i),{provide:nq,useFactory:Foe,deps:[[xr,new e.FiY,new e.tp0]]},{provide:lv,useValue:o||{}},{provide:kt.S$,useFactory:Loe,deps:[kt.lw,[new e.tBr(kt.mr),new e.FiY],lv]},{provide:HZ,useFactory:Zoe,deps:[xr,kt.EM,lv]},{provide:$V,useExisting:o&&o.preloadingStrategy?o.preloadingStrategy:eq},{provide:e.PXZ,multi:!0,useFactory:Noe},[VZ,{provide:e.ip1,multi:!0,useFactory:Voe,deps:[VZ]},{provide:oq,useFactory:qoe,deps:[VZ]},{provide:e.tb,multi:!0,useExisting:oq}]]}}},{key:"forChild",value:function(i){return{ngModule:r,providers:[iq(i)]}}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(nq,8),e.LFG(xr,8))},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({}),n}();function Zoe(n,r,t){return t.scrollOffset&&r.setOffset(t.scrollOffset),new HZ(n,r,t)}function Loe(n,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.useHash?new kt.Do(n,r):new kt.b0(n,r)}function Foe(n){return"guarded"}function iq(n){return[{provide:e.deG,multi:!0,useValue:n},{provide:UZ,multi:!0,useValue:n}]}function Uoe(n,r){n.errorHandler&&(r.errorHandler=n.errorHandler),n.malformedUriErrorHandler&&(r.malformedUriErrorHandler=n.malformedUriErrorHandler),n.onSameUrlNavigation&&(r.onSameUrlNavigation=n.onSameUrlNavigation),n.paramsInheritanceStrategy&&(r.paramsInheritanceStrategy=n.paramsInheritanceStrategy),n.relativeLinkResolution&&(r.relativeLinkResolution=n.relativeLinkResolution),n.urlUpdateStrategy&&(r.urlUpdateStrategy=n.urlUpdateStrategy)}var VZ=function(){var n=function(){function r(t){(0,g.Z)(this,r),this.injector=t,this.initNavigation=!1,this.destroyed=!1,this.resultOfPreactivationDone=new Pn.xQ}return(0,T.Z)(r,[{key:"appInitializer",value:function(){var i=this;return this.injector.get(kt.V_,Promise.resolve(null)).then(function(){if(i.destroyed)return Promise.resolve(!0);var a=null,s=new Promise(function(m){return a=m}),u=i.injector.get(xr),p=i.injector.get(lv);return"disabled"===p.initialNavigation?(u.setUpLocationChangeListener(),a(!0)):"enabled"===p.initialNavigation||"enabledBlocking"===p.initialNavigation?(u.hooks.afterPreactivation=function(){return i.initNavigation?(0,rr.of)(null):(i.initNavigation=!0,a(!0),i.resultOfPreactivationDone)},u.initialNavigation()):a(!0),s})}},{key:"bootstrapListener",value:function(i){var o=this.injector.get(lv),a=this.injector.get(tq),s=this.injector.get(HZ),u=this.injector.get(xr),p=this.injector.get(e.z2F);i===p.components[0]&&(("enabledNonBlocking"===o.initialNavigation||void 0===o.initialNavigation)&&u.initialNavigation(),a.setUpPreloading(),s.init(),u.resetRootComponentType(p.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}},{key:"ngOnDestroy",value:function(){this.destroyed=!0}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(e.zs3))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}();function Voe(n){return n.appInitializer.bind(n)}function qoe(n){return n.bootstrapListener.bind(n)}var oq=new e.OlP("Router Initializer"),a2=function(){return function(){}}(),Qo=f(96153),Br=function(){function n(r){this.httpServer=r,this.serverIds=[],this.serviceInitialized=new Pn.xQ,this.serverIds=this.getServerIds(),this.isServiceInitialized=!0,this.serviceInitialized.next(this.isServiceInitialized)}return n.prototype.getServerIds=function(){var r=localStorage.getItem("serverIds");return(null==r?void 0:r.length)>0?r.split(","):[]},n.prototype.updateServerIds=function(){localStorage.removeItem("serverIds"),localStorage.setItem("serverIds",this.serverIds.toString())},n.prototype.get=function(r){var t=JSON.parse(localStorage.getItem("server-"+r));return new Promise(function(o){o(t)})},n.prototype.create=function(r){return r.id=this.serverIds.length+1,localStorage.setItem("server-"+r.id,JSON.stringify(r)),this.serverIds.push("server-"+r.id),this.updateServerIds(),new Promise(function(i){i(r)})},n.prototype.update=function(r){return localStorage.removeItem("server-"+r.id),localStorage.setItem("server-"+r.id,JSON.stringify(r)),new Promise(function(i){i(r)})},n.prototype.findAll=function(){var r=this;return new Promise(function(i){var o=[];r.serverIds.forEach(function(a){var s=JSON.parse(localStorage.getItem(a));o.push(s)}),i(o)})},n.prototype.delete=function(r){return localStorage.removeItem("server-"+r.id),this.serverIds=this.serverIds.filter(function(i){return i!=="server-"+r.id}),this.updateServerIds(),new Promise(function(i){i(r.id)})},n.prototype.getServerUrl=function(r){return r.protocol+"//"+r.host+":"+r.port+"/"},n.prototype.checkServerVersion=function(r){return this.httpServer.get(r,"/version")},n.prototype.getLocalServer=function(r,t){var i=this;return new Promise(function(a,s){i.findAll().then(function(u){var p=u.find(function(C){return"bundled"===C.location});if(p)p.host=r,p.port=t,p.protocol=location.protocol,i.update(p).then(function(C){a(C)},s);else{var m=new a2;m.name="local",m.host=r,m.port=t,m.location="bundled",m.protocol=location.protocol,i.create(m).then(function(C){a(C)},s)}},s)})},n.\u0275fac=function(t){return new(t||n)(e.LFG(Qo.wh))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),PS=function(){return function(r,t,i){void 0===i&&(i=!1),this.visible=r,this.error=t,this.clear=i}}(),Xf=function(){function n(){this.state=new eo.X(new PS(!1))}return n.prototype.setError=function(r){this.state.next(new PS(!1,r.error))},n.prototype.clear=function(){this.state.next(new PS(!1,null,!0))},n.prototype.activate=function(){this.state.next(new PS(!0))},n.prototype.deactivate=function(){this.state.next(new PS(!1))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac=function(t){return new(t||n)}}),n}();function zoe(n,r){if(1&n&&(e.O4$(),e._UZ(0,"circle",3)),2&n){var t=e.oxw();e.Udp("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),e.uIk("r",t._getCircleRadius())}}function Woe(n,r){if(1&n&&(e.O4$(),e._UZ(0,"circle",3)),2&n){var t=e.oxw();e.Udp("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),e.uIk("r",t._getCircleRadius())}}function Goe(n,r){if(1&n&&(e.O4$(),e._UZ(0,"circle",3)),2&n){var t=e.oxw();e.Udp("animation-name","mat-progress-spinner-stroke-rotate-"+t._spinnerAnimationLabel)("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),e.uIk("r",t._getCircleRadius())}}function Yoe(n,r){if(1&n&&(e.O4$(),e._UZ(0,"circle",3)),2&n){var t=e.oxw();e.Udp("stroke-dashoffset",t._getStrokeDashOffset(),"px")("stroke-dasharray",t._getStrokeCircumference(),"px")("stroke-width",t._getCircleStrokeWidth(),"%"),e.uIk("r",t._getCircleRadius())}}var aq=".mat-progress-spinner{display:block;position:relative;overflow:hidden}.mat-progress-spinner svg{position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center;overflow:visible}.mat-progress-spinner circle{fill:transparent;transform-origin:center;transition:stroke-dashoffset 225ms linear}._mat-animation-noopable.mat-progress-spinner circle{transition:none;animation:none}.cdk-high-contrast-active .mat-progress-spinner circle{stroke:currentColor;stroke:CanvasText}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{animation:mat-progress-spinner-linear-rotate 2000ms linear infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition-property:stroke;animation-duration:4000ms;animation-timing-function:cubic-bezier(0.35, 0, 0.25, 1);animation-iteration-count:infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-animation[mode=indeterminate] circle{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{animation:mat-progress-spinner-stroke-rotate-fallback 10000ms cubic-bezier(0.87, 0.03, 0.33, 1) infinite}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] svg{transition:none;animation:none}.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition-property:stroke}._mat-animation-noopable.mat-progress-spinner.mat-progress-spinner-indeterminate-fallback-animation[mode=indeterminate] circle{transition:none;animation:none}@keyframes mat-progress-spinner-linear-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes mat-progress-spinner-stroke-rotate-100{0%{stroke-dashoffset:268.606171575px;transform:rotate(0)}12.5%{stroke-dashoffset:56.5486677px;transform:rotate(0)}12.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268.606171575px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56.5486677px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268.606171575px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56.5486677px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268.606171575px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56.5486677px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56.5486677px;transform:rotateX(180deg) rotate(341.5deg)}100%{stroke-dashoffset:268.606171575px;transform:rotateX(180deg) rotate(341.5deg)}}@keyframes mat-progress-spinner-stroke-rotate-fallback{0%{transform:rotate(0deg)}25%{transform:rotate(1170deg)}50%{transform:rotate(2340deg)}75%{transform:rotate(3510deg)}100%{transform:rotate(4680deg)}}\n",Qoe=(0,un.pj)(function(){return function n(r){(0,g.Z)(this,n),this._elementRef=r}}(),"primary"),sq=new e.OlP("mat-progress-spinner-default-options",{providedIn:"root",factory:function(){return{diameter:100}}}),$oe=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p){var m;(0,g.Z)(this,i),(m=t.call(this,o))._document=s,m._diameter=100,m._value=0,m._fallbackAnimation=!1,m.mode="determinate";var C=i._diameters;return m._spinnerAnimationLabel=m._getSpinnerAnimationLabel(),C.has(s.head)||C.set(s.head,new Set([100])),m._fallbackAnimation=a.EDGE||a.TRIDENT,m._noopAnimations="NoopAnimations"===u&&!!p&&!p._forceAnimations,p&&(p.diameter&&(m.diameter=p.diameter),p.strokeWidth&&(m.strokeWidth=p.strokeWidth)),m}return(0,T.Z)(i,[{key:"diameter",get:function(){return this._diameter},set:function(a){this._diameter=(0,Mn.su)(a),this._spinnerAnimationLabel=this._getSpinnerAnimationLabel(),!this._fallbackAnimation&&this._styleRoot&&this._attachStyleNode()}},{key:"strokeWidth",get:function(){return this._strokeWidth||this.diameter/10},set:function(a){this._strokeWidth=(0,Mn.su)(a)}},{key:"value",get:function(){return"determinate"===this.mode?this._value:0},set:function(a){this._value=Math.max(0,Math.min(100,(0,Mn.su)(a)))}},{key:"ngOnInit",value:function(){var a=this._elementRef.nativeElement;this._styleRoot=(0,Xr.kV)(a)||this._document.head,this._attachStyleNode();var s="mat-progress-spinner-indeterminate".concat(this._fallbackAnimation?"-fallback":"","-animation");a.classList.add(s)}},{key:"_getCircleRadius",value:function(){return(this.diameter-10)/2}},{key:"_getViewBox",value:function(){var a=2*this._getCircleRadius()+this.strokeWidth;return"0 0 ".concat(a," ").concat(a)}},{key:"_getStrokeCircumference",value:function(){return 2*Math.PI*this._getCircleRadius()}},{key:"_getStrokeDashOffset",value:function(){return"determinate"===this.mode?this._getStrokeCircumference()*(100-this._value)/100:this._fallbackAnimation&&"indeterminate"===this.mode?.2*this._getStrokeCircumference():null}},{key:"_getCircleStrokeWidth",value:function(){return this.strokeWidth/this.diameter*100}},{key:"_attachStyleNode",value:function(){var a=this._styleRoot,s=this._diameter,u=i._diameters,p=u.get(a);if(!p||!p.has(s)){var m=this._document.createElement("style");m.setAttribute("mat-spinner-animation",this._spinnerAnimationLabel),m.textContent=this._getAnimationText(),a.appendChild(m),p||(p=new Set,u.set(a,p)),p.add(s)}}},{key:"_getAnimationText",value:function(){var a=this._getStrokeCircumference();return"\n @keyframes mat-progress-spinner-stroke-rotate-DIAMETER {\n 0% { stroke-dashoffset: START_VALUE; transform: rotate(0); }\n 12.5% { stroke-dashoffset: END_VALUE; transform: rotate(0); }\n 12.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n 25% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(72.5deg); }\n\n 25.0001% { stroke-dashoffset: START_VALUE; transform: rotate(270deg); }\n 37.5% { stroke-dashoffset: END_VALUE; transform: rotate(270deg); }\n 37.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n 50% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(161.5deg); }\n\n 50.0001% { stroke-dashoffset: START_VALUE; transform: rotate(180deg); }\n 62.5% { stroke-dashoffset: END_VALUE; transform: rotate(180deg); }\n 62.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n 75% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(251.5deg); }\n\n 75.0001% { stroke-dashoffset: START_VALUE; transform: rotate(90deg); }\n 87.5% { stroke-dashoffset: END_VALUE; transform: rotate(90deg); }\n 87.5001% { stroke-dashoffset: END_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n 100% { stroke-dashoffset: START_VALUE; transform: rotateX(180deg) rotate(341.5deg); }\n }\n".replace(/START_VALUE/g,"".concat(.95*a)).replace(/END_VALUE/g,"".concat(.2*a)).replace(/DIAMETER/g,"".concat(this._spinnerAnimationLabel))}},{key:"_getSpinnerAnimationLabel",value:function(){return this.diameter.toString().replace(".","_")}}]),i}(Qoe);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(Xr.t4),e.Y36(kt.K0,8),e.Y36(ys.Qb,8),e.Y36(sq))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-progress-spinner"]],hostAttrs:["role","progressbar","tabindex","-1",1,"mat-progress-spinner"],hostVars:10,hostBindings:function(t,i){2&t&&(e.uIk("aria-valuemin","determinate"===i.mode?0:null)("aria-valuemax","determinate"===i.mode?100:null)("aria-valuenow","determinate"===i.mode?i.value:null)("mode",i.mode),e.Udp("width",i.diameter,"px")("height",i.diameter,"px"),e.ekj("_mat-animation-noopable",i._noopAnimations))},inputs:{color:"color",mode:"mode",diameter:"diameter",strokeWidth:"strokeWidth",value:"value"},exportAs:["matProgressSpinner"],features:[e.qOj],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,i){1&t&&(e.O4$(),e.TgZ(0,"svg",0),e.YNc(1,zoe,1,9,"circle",1),e.YNc(2,Woe,1,7,"circle",2),e.qZA()),2&t&&(e.Udp("width",i.diameter,"px")("height",i.diameter,"px"),e.Q6J("ngSwitch","indeterminate"===i.mode),e.uIk("viewBox",i._getViewBox()),e.xp6(1),e.Q6J("ngSwitchCase",!0),e.xp6(1),e.Q6J("ngSwitchCase",!1))},directives:[kt.RF,kt.n9],styles:[aq],encapsulation:2,changeDetection:0}),n._diameters=new WeakMap,n}(),lq=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p){var m;return(0,g.Z)(this,i),(m=t.call(this,o,a,s,u,p)).mode="indeterminate",m}return i}($oe);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(Xr.t4),e.Y36(kt.K0,8),e.Y36(ys.Qb,8),e.Y36(sq))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-spinner"]],hostAttrs:["role","progressbar","mode","indeterminate",1,"mat-spinner","mat-progress-spinner"],hostVars:6,hostBindings:function(t,i){2&t&&(e.Udp("width",i.diameter,"px")("height",i.diameter,"px"),e.ekj("_mat-animation-noopable",i._noopAnimations))},inputs:{color:"color"},features:[e.qOj],decls:3,vars:8,consts:[["preserveAspectRatio","xMidYMid meet","focusable","false","aria-hidden","true",3,"ngSwitch"],["cx","50%","cy","50%",3,"animation-name","stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%",3,"stroke-dashoffset","stroke-dasharray","stroke-width",4,"ngSwitchCase"],["cx","50%","cy","50%"]],template:function(t,i){1&t&&(e.O4$(),e.TgZ(0,"svg",0),e.YNc(1,Goe,1,9,"circle",1),e.YNc(2,Yoe,1,7,"circle",2),e.qZA()),2&t&&(e.Udp("width",i.diameter,"px")("height",i.diameter,"px"),e.Q6J("ngSwitch","indeterminate"===i.mode),e.uIk("viewBox",i._getViewBox()),e.xp6(1),e.Q6J("ngSwitchCase",!0),e.xp6(1),e.Q6J("ngSwitchCase",!1))},directives:[kt.RF,kt.n9],styles:[aq],encapsulation:2,changeDetection:0}),n}(),eae=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[un.BQ,kt.ez],un.BQ]}),n}(),tae=f(11363),jZ=f(91925),nae=["*"];function uq(n){return Error('Unable to find icon with the name "'.concat(n,'"'))}function cq(n){return Error("The URL provided to MatIconRegistry was not trusted as a resource URL "+"via Angular's DomSanitizer. Attempted URL was \"".concat(n,'".'))}function dq(n){return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by "+"Angular's DomSanitizer. Attempted literal was \"".concat(n,'".'))}var uv=function n(r,t,i){(0,g.Z)(this,n),this.url=r,this.svgText=t,this.options=i},IS=function(){var n=function(){function r(t,i,o,a){(0,g.Z)(this,r),this._httpClient=t,this._sanitizer=i,this._errorHandler=a,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=o}return(0,T.Z)(r,[{key:"addSvgIcon",value:function(i,o,a){return this.addSvgIconInNamespace("",i,o,a)}},{key:"addSvgIconLiteral",value:function(i,o,a){return this.addSvgIconLiteralInNamespace("",i,o,a)}},{key:"addSvgIconInNamespace",value:function(i,o,a,s){return this._addSvgIconConfig(i,o,new uv(a,null,s))}},{key:"addSvgIconResolver",value:function(i){return this._resolvers.push(i),this}},{key:"addSvgIconLiteralInNamespace",value:function(i,o,a,s){var u=this._sanitizer.sanitize(e.q3G.HTML,a);if(!u)throw dq(a);return this._addSvgIconConfig(i,o,new uv("",u,s))}},{key:"addSvgIconSet",value:function(i,o){return this.addSvgIconSetInNamespace("",i,o)}},{key:"addSvgIconSetLiteral",value:function(i,o){return this.addSvgIconSetLiteralInNamespace("",i,o)}},{key:"addSvgIconSetInNamespace",value:function(i,o,a){return this._addSvgIconSetConfig(i,new uv(o,null,a))}},{key:"addSvgIconSetLiteralInNamespace",value:function(i,o,a){var s=this._sanitizer.sanitize(e.q3G.HTML,o);if(!s)throw dq(o);return this._addSvgIconSetConfig(i,new uv("",s,a))}},{key:"registerFontClassAlias",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return this._fontCssClassesByAlias.set(i,o),this}},{key:"classNameForFontAlias",value:function(i){return this._fontCssClassesByAlias.get(i)||i}},{key:"setDefaultFontSetClass",value:function(i){return this._defaultFontSetClass=i,this}},{key:"getDefaultFontSetClass",value:function(){return this._defaultFontSetClass}},{key:"getSvgIconFromUrl",value:function(i){var o=this,a=this._sanitizer.sanitize(e.q3G.RESOURCE_URL,i);if(!a)throw cq(i);var s=this._cachedIconsByUrl.get(a);return s?(0,rr.of)(s2(s)):this._loadSvgIconFromConfig(new uv(i,null)).pipe((0,Ra.b)(function(u){return o._cachedIconsByUrl.set(a,u)}),(0,Er.U)(function(u){return s2(u)}))}},{key:"getNamedSvgIcon",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=pq(o,i),s=this._svgIconConfigs.get(a);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(o,i))return this._svgIconConfigs.set(a,s),this._getSvgFromConfig(s);var u=this._iconSetConfigs.get(o);return u?this._getSvgFromIconSetConfigs(i,u):(0,tae._)(uq(a))}},{key:"ngOnDestroy",value:function(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}},{key:"_getSvgFromConfig",value:function(i){return i.svgText?(0,rr.of)(s2(this._svgElementFromConfig(i))):this._loadSvgIconFromConfig(i).pipe((0,Er.U)(function(o){return s2(o)}))}},{key:"_getSvgFromIconSetConfigs",value:function(i,o){var a=this,s=this._extractIconWithNameFromAnySet(i,o);if(s)return(0,rr.of)(s);var u=o.filter(function(p){return!p.svgText}).map(function(p){return a._loadSvgIconSetFromConfig(p).pipe((0,Qf.K)(function(m){var C=a._sanitizer.sanitize(e.q3G.RESOURCE_URL,p.url),P="Loading icon set URL: ".concat(C," failed: ").concat(m.message);return a._errorHandler.handleError(new Error(P)),(0,rr.of)(null)}))});return(0,jZ.D)(u).pipe((0,Er.U)(function(){var p=a._extractIconWithNameFromAnySet(i,o);if(!p)throw uq(i);return p}))}},{key:"_extractIconWithNameFromAnySet",value:function(i,o){for(var a=o.length-1;a>=0;a--){var s=o[a];if(s.svgText&&s.svgText.indexOf(i)>-1){var u=this._svgElementFromConfig(s),p=this._extractSvgIconFromSet(u,i,s.options);if(p)return p}}return null}},{key:"_loadSvgIconFromConfig",value:function(i){var o=this;return this._fetchIcon(i).pipe((0,Ra.b)(function(a){return i.svgText=a}),(0,Er.U)(function(){return o._svgElementFromConfig(i)}))}},{key:"_loadSvgIconSetFromConfig",value:function(i){return i.svgText?(0,rr.of)(null):this._fetchIcon(i).pipe((0,Ra.b)(function(o){return i.svgText=o}))}},{key:"_extractSvgIconFromSet",value:function(i,o,a){var s=i.querySelector('[id="'.concat(o,'"]'));if(!s)return null;var u=s.cloneNode(!0);if(u.removeAttribute("id"),"svg"===u.nodeName.toLowerCase())return this._setSvgAttributes(u,a);if("symbol"===u.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(u),a);var p=this._svgElementFromString("");return p.appendChild(u),this._setSvgAttributes(p,a)}},{key:"_svgElementFromString",value:function(i){var o=this._document.createElement("DIV");o.innerHTML=i;var a=o.querySelector("svg");if(!a)throw Error(" tag not found");return a}},{key:"_toSvgElement",value:function(i){for(var o=this._svgElementFromString(""),a=i.attributes,s=0;s*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n",fae=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],hae=(0,un.pj)((0,un.Id)((0,un.Kr)(function(){return function n(r){(0,g.Z)(this,n),this._elementRef=r}}()))),An=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s){var u;(0,g.Z)(this,i),(u=t.call(this,o))._focusMonitor=a,u._animationMode=s,u.isRoundButton=u._hasHostAttributes("mat-fab","mat-mini-fab"),u.isIconButton=u._hasHostAttributes("mat-icon-button");var m,p=(0,_.Z)(fae);try{for(p.s();!(m=p.n()).done;){var C=m.value;u._hasHostAttributes(C)&&u._getHostElement().classList.add(C)}}catch(P){p.e(P)}finally{p.f()}return o.nativeElement.classList.add("mat-button-base"),u.isRoundButton&&(u.color="accent"),u}return(0,T.Z)(i,[{key:"ngAfterViewInit",value:function(){this._focusMonitor.monitor(this._elementRef,!0)}},{key:"ngOnDestroy",value:function(){this._focusMonitor.stopMonitoring(this._elementRef)}},{key:"focus",value:function(a,s){a?this._focusMonitor.focusVia(this._getHostElement(),a,s):this._getHostElement().focus(s)}},{key:"_getHostElement",value:function(){return this._elementRef.nativeElement}},{key:"_isRippleDisabled",value:function(){return this.disableRipple||this.disabled}},{key:"_hasHostAttributes",value:function(){for(var a=this,s=arguments.length,u=new Array(s),p=0;p visible",(0,on.jt)("200ms cubic-bezier(0, 0, 0.2, 1)",(0,on.F4)([(0,on.oB)({opacity:0,transform:"scale(0)",offset:0}),(0,on.oB)({opacity:.5,transform:"scale(0.99)",offset:.5}),(0,on.oB)({opacity:1,transform:"scale(1)",offset:1})]))),(0,on.eR)("* => hidden",(0,on.jt)("100ms cubic-bezier(0, 0, 0.2, 1)",(0,on.oB)({opacity:0})))])},bq="tooltip-panel",Cq=(0,Xr.i$)({passive:!0}),Sq=new e.OlP("mat-tooltip-scroll-strategy"),Tae={provide:Sq,deps:[so.aV],useFactory:function(n){return function(){return n.scrollStrategies.reposition({scrollThrottle:20})}}},xae=new e.OlP("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),Eae=function(){var n=function(){function r(t,i,o,a,s,u,p,m,C,P,L,G){var Y=this;(0,g.Z)(this,r),this._overlay=t,this._elementRef=i,this._scrollDispatcher=o,this._viewContainerRef=a,this._ngZone=s,this._platform=u,this._ariaDescriber=p,this._focusMonitor=m,this._dir=P,this._defaultOptions=L,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new Pn.xQ,this._handleKeydown=function(te){Y._isTooltipVisible()&&te.keyCode===zr.hY&&!(0,zr.Vb)(te)&&(te.preventDefault(),te.stopPropagation(),Y._ngZone.run(function(){return Y.hide(0)}))},this._scrollStrategy=C,this._document=G,L&&(L.position&&(this.position=L.position),L.touchGestures&&(this.touchGestures=L.touchGestures)),P.change.pipe((0,Zr.R)(this._destroyed)).subscribe(function(){Y._overlayRef&&Y._updatePosition(Y._overlayRef)}),s.runOutsideAngular(function(){i.nativeElement.addEventListener("keydown",Y._handleKeydown)})}return(0,T.Z)(r,[{key:"position",get:function(){return this._position},set:function(i){var o;i!==this._position&&(this._position=i,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(o=this._tooltipInstance)||void 0===o||o.show(0),this._overlayRef.updatePosition()))}},{key:"disabled",get:function(){return this._disabled},set:function(i){this._disabled=(0,Mn.Ig)(i),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}},{key:"message",get:function(){return this._message},set:function(i){var o=this;this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=i?String(i).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(function(){Promise.resolve().then(function(){o._ariaDescriber.describe(o._elementRef.nativeElement,o.message,"tooltip")})}))}},{key:"tooltipClass",get:function(){return this._tooltipClass},set:function(i){this._tooltipClass=i,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}},{key:"ngAfterViewInit",value:function(){var i=this;this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe((0,Zr.R)(this._destroyed)).subscribe(function(o){o?"keyboard"===o&&i._ngZone.run(function(){return i.show()}):i._ngZone.run(function(){return i.hide(0)})})}},{key:"ngOnDestroy",value:function(){var i=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),i.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(function(o){var a=(0,b.Z)(o,2);i.removeEventListener(a[0],a[1],Cq)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(i,this.message,"tooltip"),this._focusMonitor.stopMonitoring(i)}},{key:"show",value:function(){var i=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.showDelay;if(!this.disabled&&this.message&&(!this._isTooltipVisible()||this._tooltipInstance._showTimeoutId||this._tooltipInstance._hideTimeoutId)){var a=this._createOverlay();this._detach(),this._portal=this._portal||new qi.C5(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=a.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe((0,Zr.R)(this._destroyed)).subscribe(function(){return i._detach()}),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(o)}}},{key:"hide",value:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hideDelay;this._tooltipInstance&&this._tooltipInstance.hide(i)}},{key:"toggle",value:function(){this._isTooltipVisible()?this.hide():this.show()}},{key:"_isTooltipVisible",value:function(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}},{key:"_createOverlay",value:function(){var i=this;if(this._overlayRef)return this._overlayRef;var o=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),a=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(".".concat(this._cssClassPrefix,"-tooltip")).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(o);return a.positionChanges.pipe((0,Zr.R)(this._destroyed)).subscribe(function(s){i._updateCurrentPositionClass(s.connectionPair),i._tooltipInstance&&s.scrollableViewProperties.isOverlayClipped&&i._tooltipInstance.isVisible()&&i._ngZone.run(function(){return i.hide(0)})}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:a,panelClass:"".concat(this._cssClassPrefix,"-").concat(bq),scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe((0,Zr.R)(this._destroyed)).subscribe(function(){return i._detach()}),this._overlayRef.outsidePointerEvents().pipe((0,Zr.R)(this._destroyed)).subscribe(function(){var s;return null===(s=i._tooltipInstance)||void 0===s?void 0:s._handleBodyInteraction()}),this._overlayRef}},{key:"_detach",value:function(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}},{key:"_updatePosition",value:function(i){var o=i.getConfig().positionStrategy,a=this._getOrigin(),s=this._getOverlayPosition();o.withPositions([this._addOffset(Object.assign(Object.assign({},a.main),s.main)),this._addOffset(Object.assign(Object.assign({},a.fallback),s.fallback))])}},{key:"_addOffset",value:function(i){return i}},{key:"_getOrigin",value:function(){var a,i=!this._dir||"ltr"==this._dir.value,o=this.position;"above"==o||"below"==o?a={originX:"center",originY:"above"==o?"top":"bottom"}:"before"==o||"left"==o&&i||"right"==o&&!i?a={originX:"start",originY:"center"}:("after"==o||"right"==o&&i||"left"==o&&!i)&&(a={originX:"end",originY:"center"});var s=this._invertPosition(a.originX,a.originY);return{main:a,fallback:{originX:s.x,originY:s.y}}}},{key:"_getOverlayPosition",value:function(){var a,i=!this._dir||"ltr"==this._dir.value,o=this.position;"above"==o?a={overlayX:"center",overlayY:"bottom"}:"below"==o?a={overlayX:"center",overlayY:"top"}:"before"==o||"left"==o&&i||"right"==o&&!i?a={overlayX:"end",overlayY:"center"}:("after"==o||"right"==o&&i||"left"==o&&!i)&&(a={overlayX:"start",overlayY:"center"});var s=this._invertPosition(a.overlayX,a.overlayY);return{main:a,fallback:{overlayX:s.x,overlayY:s.y}}}},{key:"_updateTooltipMessage",value:function(){var i=this;this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe((0,$i.q)(1),(0,Zr.R)(this._destroyed)).subscribe(function(){i._tooltipInstance&&i._overlayRef.updatePosition()}))}},{key:"_setTooltipClass",value:function(i){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=i,this._tooltipInstance._markForCheck())}},{key:"_invertPosition",value:function(i,o){return"above"===this.position||"below"===this.position?"top"===o?o="bottom":"bottom"===o&&(o="top"):"end"===i?i="start":"start"===i&&(i="end"),{x:i,y:o}}},{key:"_updateCurrentPositionClass",value:function(i){var u,o=i.overlayY,a=i.originX;if((u="center"===o?this._dir&&"rtl"===this._dir.value?"end"===a?"left":"right":"start"===a?"left":"right":"bottom"===o&&"top"===i.originY?"above":"below")!==this._currentPosition){var p=this._overlayRef;if(p){var m="".concat(this._cssClassPrefix,"-").concat(bq,"-");p.removePanelClass(m+this._currentPosition),p.addPanelClass(m+u)}this._currentPosition=u}}},{key:"_setupPointerEnterEventsIfNeeded",value:function(){var i=this;this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",function(){i._setupPointerExitEventsIfNeeded(),i.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",function(){i._setupPointerExitEventsIfNeeded(),clearTimeout(i._touchstartTimeout),i._touchstartTimeout=setTimeout(function(){return i.show()},500)}])),this._addListeners(this._passiveListeners))}},{key:"_setupPointerExitEventsIfNeeded",value:function(){var o,i=this;if(!this._pointerExitEventsInitialized){this._pointerExitEventsInitialized=!0;var a=[];if(this._platformSupportsMouseEvents())a.push(["mouseleave",function(){return i.hide()}],["wheel",function(u){return i._wheelListener(u)}]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();var s=function(){clearTimeout(i._touchstartTimeout),i.hide(i._defaultOptions.touchendHideDelay)};a.push(["touchend",s],["touchcancel",s])}this._addListeners(a),(o=this._passiveListeners).push.apply(o,a)}}},{key:"_addListeners",value:function(i){var o=this;i.forEach(function(a){var s=(0,b.Z)(a,2);o._elementRef.nativeElement.addEventListener(s[0],s[1],Cq)})}},{key:"_platformSupportsMouseEvents",value:function(){return!this._platform.IOS&&!this._platform.ANDROID}},{key:"_wheelListener",value:function(i){if(this._isTooltipVisible()){var o=this._document.elementFromPoint(i.clientX,i.clientY),a=this._elementRef.nativeElement;o!==a&&!a.contains(o)&&this.hide()}}},{key:"_disableNativeGesturesIfNecessary",value:function(){var i=this.touchGestures;if("off"!==i){var o=this._elementRef.nativeElement,a=o.style;("on"===i||"INPUT"!==o.nodeName&&"TEXTAREA"!==o.nodeName)&&(a.userSelect=a.msUserSelect=a.webkitUserSelect=a.MozUserSelect="none"),("on"===i||!o.draggable)&&(a.webkitUserDrag="none"),a.touchAction="none",a.webkitTapHighlightColor="transparent"}}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(so.aV),e.Y36(e.SBq),e.Y36(Sa.mF),e.Y36(e.s_b),e.Y36(e.R0b),e.Y36(Xr.t4),e.Y36(Ai.$s),e.Y36(Ai.tE),e.Y36(void 0),e.Y36(Na.Is),e.Y36(void 0),e.Y36(kt.K0))},n.\u0275dir=e.lG2({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n}(),Ja=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p,m,C,P,L,G,Y,te){var de;return(0,g.Z)(this,i),(de=t.call(this,o,a,s,u,p,m,C,P,L,G,Y,te))._tooltipComponent=Mae,de}return i}(Eae);return n.\u0275fac=function(t){return new(t||n)(e.Y36(so.aV),e.Y36(e.SBq),e.Y36(Sa.mF),e.Y36(e.s_b),e.Y36(e.R0b),e.Y36(Xr.t4),e.Y36(Ai.$s),e.Y36(Ai.tE),e.Y36(Sq),e.Y36(Na.Is,8),e.Y36(xae,8),e.Y36(kt.K0))},n.\u0275dir=e.lG2({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[e.qOj]}),n}(),kae=function(){var n=function(){function r(t){(0,g.Z)(this,r),this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new Pn.xQ}return(0,T.Z)(r,[{key:"show",value:function(i){var o=this;clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(function(){o._visibility="visible",o._showTimeoutId=void 0,o._onShow(),o._markForCheck()},i)}},{key:"hide",value:function(i){var o=this;clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(function(){o._visibility="hidden",o._hideTimeoutId=void 0,o._markForCheck()},i)}},{key:"afterHidden",value:function(){return this._onHide}},{key:"isVisible",value:function(){return"visible"===this._visibility}},{key:"ngOnDestroy",value:function(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}},{key:"_animationStart",value:function(){this._closeOnInteraction=!1}},{key:"_animationDone",value:function(i){var o=i.toState;"hidden"===o&&!this.isVisible()&&this._onHide.next(),("visible"===o||"hidden"===o)&&(this._closeOnInteraction=!0)}},{key:"_handleBodyInteraction",value:function(){this._closeOnInteraction&&this.hide(0)}},{key:"_markForCheck",value:function(){this._changeDetectorRef.markForCheck()}},{key:"_onShow",value:function(){}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.sBO))},n.\u0275dir=e.lG2({type:n}),n}(),Mae=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a){var s;return(0,g.Z)(this,i),(s=t.call(this,o))._breakpointObserver=a,s._isHandset=s._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)"),s}return i}(kae);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.sBO),e.Y36(u2))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&e.Udp("zoom","visible"===i._visibility?1:null)},features:[e.qOj],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){var o;1&t&&(e.TgZ(0,"div",0),e.NdJ("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),e.ALo(1,"async"),e._uU(2),e.qZA()),2&t&&(e.ekj("mat-tooltip-handset",null==(o=e.lcZ(1,5,i._isHandset))?null:o.matches),e.Q6J("ngClass",i.tooltipClass)("@state",i._visibility),e.xp6(2),e.Oqu(i.message))},directives:[kt.mk],pipes:[kt.Ov],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[yae.tooltipState]},changeDetection:0}),n}(),Tq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[Tae],imports:[[Ai.rt,kt.ez,so.U8,un.BQ],un.BQ,Sa.ZD]}),n}();function Aae(n,r){1&n&&(e.TgZ(0,"div",4),e._UZ(1,"mat-spinner",5),e.qZA())}function Dae(n,r){if(1&n){var t=e.EpF();e.TgZ(0,"div",6),e.TgZ(1,"div",7),e.TgZ(2,"mat-icon"),e._uU(3,"error_outline"),e.qZA(),e.qZA(),e.TgZ(4,"div"),e._uU(5),e.qZA(),e.TgZ(6,"div"),e.TgZ(7,"button",8),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).refresh()}),e.TgZ(8,"mat-icon"),e._uU(9,"refresh"),e.qZA(),e.qZA(),e.TgZ(10,"button",9),e.TgZ(11,"mat-icon"),e._uU(12,"home"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){var i=e.oxw(2);e.xp6(5),e.hij("Error occurred: ",i.error.message,"")}}function Oae(n,r){if(1&n&&(e.TgZ(0,"div",1),e.YNc(1,Aae,2,0,"div",2),e.YNc(2,Dae,13,1,"div",3),e.qZA()),2&n){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.visible&&!t.error),e.xp6(1),e.Q6J("ngIf",t.error)}}var WZ=function(){function n(r,t){this.progressService=r,this.router=t,this.visible=!1}return n.prototype.ngOnInit=function(){var r=this;this.progressService.state.subscribe(function(t){r.visible=t.visible,t.error&&!r.error&&(r.error=t.error),t.clear&&(r.error=null)}),this.routerSubscription=this.router.events.subscribe(function(){r.progressService.clear()})},n.prototype.refresh=function(){this.router.navigateByUrl(this.router.url)},n.prototype.ngOnDestroy=function(){this.routerSubscription.unsubscribe()},n.\u0275fac=function(t){return new(t||n)(e.Y36(Xf),e.Y36(xr))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-progress"]],decls:1,vars:1,consts:[["class","overlay",4,"ngIf"],[1,"overlay"],["class","loading-spinner",4,"ngIf"],["class","error-state",4,"ngIf"],[1,"loading-spinner"],["color","primary"],[1,"error-state"],[1,"error-icon"],["mat-button","","matTooltip","Refresh page","matTooltipClass","custom-tooltip",3,"click"],["mat-button","","routerLink","/","matTooltip","Go to home","matTooltipClass","custom-tooltip"]],template:function(t,i){1&t&&e.YNc(0,Oae,3,2,"div",0),2&t&&e.Q6J("ngIf",i.visible||i.error)},directives:[kt.O5,lq,sr,An,Ja,ca],styles:[".overlay[_ngcontent-%COMP%]{position:fixed;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.5);z-index:2000}.loading-spinner[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.error-state[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{text-align:center}.error-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px}"]}),n}(),Pae=function(){function n(r,t,i,o){this.router=r,this.serverService=t,this.progressService=i,this.document=o}return n.prototype.ngOnInit=function(){var r=this;this.progressService.activate(),setTimeout(function(){var t;t=parseInt(r.document.location.port,10)?parseInt(r.document.location.port,10):"https:"==r.document.location.protocol?443:80,r.serverService.getLocalServer(r.document.location.hostname,t).then(function(i){r.progressService.deactivate(),r.router.navigate(["/server",i.id,"projects"])})},100)},n.\u0275fac=function(t){return new(t||n)(e.Y36(xr),e.Y36(Br),e.Y36(Xf),e.Y36(kt.K0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-bundled-server-finder"]],decls:1,vars:0,template:function(t,i){1&t&&e._UZ(0,"app-progress")},directives:[WZ],styles:[""]}),n}(),Jn=f(61855),c2=function(){function n(){this.dataChange=new eo.X([])}return Object.defineProperty(n.prototype,"data",{get:function(){return this.dataChange.value},enumerable:!1,configurable:!0}),n.prototype.addServer=function(r){var t=this.data.slice();t.push(r),this.dataChange.next(t)},n.prototype.addServers=function(r){this.dataChange.next(r)},n.prototype.remove=function(r){var t=this.data.indexOf(r);t>=0&&(this.data.splice(t,1),this.dataChange.next(this.data.slice()))},n.prototype.find=function(r){return this.data.find(function(t){return t.name===r})},n.prototype.findIndex=function(r){return this.data.findIndex(function(t){return t.name===r})},n.prototype.update=function(r){var t=this.findIndex(r.name);t>=0&&(this.data[t]=r,this.dataChange.next(this.data.slice()))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac=function(t){return new(t||n)}}),n}();function Iae(n,r){if(1&n){var t=e.EpF();e.TgZ(0,"div",1),e.TgZ(1,"button",2),e.NdJ("click",function(){return e.CHM(t),e.oxw().action()}),e._uU(2),e.qZA(),e.qZA()}if(2&n){var i=e.oxw();e.xp6(2),e.Oqu(i.data.action)}}function Rae(n,r){}var xq=new e.OlP("MatSnackBarData"),d2=function n(){(0,g.Z)(this,n),this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"},Nae=Math.pow(2,31)-1,GZ=function(){function n(r,t){var i=this;(0,g.Z)(this,n),this._overlayRef=t,this._afterDismissed=new Pn.xQ,this._afterOpened=new Pn.xQ,this._onAction=new Pn.xQ,this._dismissedByAction=!1,this.containerInstance=r,this.onAction().subscribe(function(){return i.dismiss()}),r._onExit.subscribe(function(){return i._finishDismiss()})}return(0,T.Z)(n,[{key:"dismiss",value:function(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}},{key:"dismissWithAction",value:function(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}},{key:"closeWithAction",value:function(){this.dismissWithAction()}},{key:"_dismissAfter",value:function(t){var i=this;this._durationTimeoutId=setTimeout(function(){return i.dismiss()},Math.min(t,Nae))}},{key:"_open",value:function(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}},{key:"_finishDismiss",value:function(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}},{key:"afterDismissed",value:function(){return this._afterDismissed}},{key:"afterOpened",value:function(){return this.containerInstance._onEnter}},{key:"onAction",value:function(){return this._onAction}}]),n}(),Zae=function(){var n=function(){function r(t,i){(0,g.Z)(this,r),this.snackBarRef=t,this.data=i}return(0,T.Z)(r,[{key:"action",value:function(){this.snackBarRef.dismissWithAction()}},{key:"hasAction",get:function(){return!!this.data.action}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(GZ),e.Y36(xq))},n.\u0275cmp=e.Xpm({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,i){1&t&&(e.TgZ(0,"span"),e._uU(1),e.qZA(),e.YNc(2,Iae,3,1,"div",0)),2&t&&(e.xp6(1),e.Oqu(i.data.message),e.xp6(1),e.Q6J("ngIf",i.hasAction))},directives:[kt.O5,An],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n}(),Lae={snackBarState:(0,on.X$)("state",[(0,on.SB)("void, hidden",(0,on.oB)({transform:"scale(0.8)",opacity:0})),(0,on.SB)("visible",(0,on.oB)({transform:"scale(1)",opacity:1})),(0,on.eR)("* => visible",(0,on.jt)("150ms cubic-bezier(0, 0, 0.2, 1)")),(0,on.eR)("* => void, * => hidden",(0,on.jt)("75ms cubic-bezier(0.4, 0.0, 1, 1)",(0,on.oB)({opacity:0})))])},Fae=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p){var m;return(0,g.Z)(this,i),(m=t.call(this))._ngZone=o,m._elementRef=a,m._changeDetectorRef=s,m._platform=u,m.snackBarConfig=p,m._announceDelay=150,m._destroyed=!1,m._onAnnounce=new Pn.xQ,m._onExit=new Pn.xQ,m._onEnter=new Pn.xQ,m._animationState="void",m.attachDomPortal=function(C){return m._assertNotAttached(),m._applySnackBarClasses(),m._portalOutlet.attachDomPortal(C)},m._live="assertive"!==p.politeness||p.announcementMessage?"off"===p.politeness?"off":"polite":"assertive",m._platform.FIREFOX&&("polite"===m._live&&(m._role="status"),"assertive"===m._live&&(m._role="alert")),m}return(0,T.Z)(i,[{key:"attachComponentPortal",value:function(a){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(a)}},{key:"attachTemplatePortal",value:function(a){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(a)}},{key:"onAnimationEnd",value:function(a){var u=a.toState;if(("void"===u&&"void"!==a.fromState||"hidden"===u)&&this._completeExit(),"visible"===u){var p=this._onEnter;this._ngZone.run(function(){p.next(),p.complete()})}}},{key:"enter",value:function(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}},{key:"exit",value:function(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}},{key:"ngOnDestroy",value:function(){this._destroyed=!0,this._completeExit()}},{key:"_completeExit",value:function(){var a=this;this._ngZone.onMicrotaskEmpty.pipe((0,$i.q)(1)).subscribe(function(){a._onExit.next(),a._onExit.complete()})}},{key:"_applySnackBarClasses",value:function(){var a=this._elementRef.nativeElement,s=this.snackBarConfig.panelClass;s&&(Array.isArray(s)?s.forEach(function(u){return a.classList.add(u)}):a.classList.add(s)),"center"===this.snackBarConfig.horizontalPosition&&a.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&a.classList.add("mat-snack-bar-top")}},{key:"_assertNotAttached",value:function(){this._portalOutlet.hasAttached()}},{key:"_screenReaderAnnounce",value:function(){var a=this;this._announceTimeoutId||this._ngZone.runOutsideAngular(function(){a._announceTimeoutId=setTimeout(function(){var s=a._elementRef.nativeElement.querySelector("[aria-hidden]"),u=a._elementRef.nativeElement.querySelector("[aria-live]");if(s&&u){var p=null;a._platform.isBrowser&&document.activeElement instanceof HTMLElement&&s.contains(document.activeElement)&&(p=document.activeElement),s.removeAttribute("aria-hidden"),u.appendChild(s),null==p||p.focus(),a._onAnnounce.next(),a._onAnnounce.complete()}},a._announceDelay)})}}]),i}(qi.en);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.R0b),e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(Xr.t4),e.Y36(d2))},n.\u0275cmp=e.Xpm({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){var o;1&t&&e.Gf(qi.Pl,7),2&t&&e.iGM(o=e.CRH())&&(i._portalOutlet=o.first)},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&e.WFA("@state.done",function(a){return i.onAnimationEnd(a)}),2&t&&e.d8E("@state",i._animationState)},features:[e.qOj],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(e.TgZ(0,"div",0),e.YNc(1,Rae,0,0,"ng-template",1),e.qZA(),e._UZ(2,"div")),2&t&&(e.xp6(2),e.uIk("aria-live",i._live)("role",i._role))},directives:[qi.Pl],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[Lae.snackBarState]}}),n}(),wq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[so.U8,qi.eL,kt.ez,l2,un.BQ],un.BQ]}),n}(),Eq=new e.OlP("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new d2}}),Uae=function(){var n=function(){function r(t,i,o,a,s,u){(0,g.Z)(this,r),this._overlay=t,this._live=i,this._injector=o,this._breakpointObserver=a,this._parentSnackBar=s,this._defaultConfig=u,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=Zae,this.snackBarContainerComponent=Fae,this.handsetCssClass="mat-snack-bar-handset"}return(0,T.Z)(r,[{key:"_openedSnackBarRef",get:function(){var i=this._parentSnackBar;return i?i._openedSnackBarRef:this._snackBarRefAtThisLevel},set:function(i){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=i:this._snackBarRefAtThisLevel=i}},{key:"openFromComponent",value:function(i,o){return this._attach(i,o)}},{key:"openFromTemplate",value:function(i,o){return this._attach(i,o)}},{key:"open",value:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=Object.assign(Object.assign({},this._defaultConfig),a);return s.data={message:i,action:o},s.announcementMessage===i&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}},{key:"dismiss",value:function(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}},{key:"ngOnDestroy",value:function(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}},{key:"_attachSnackBarContainer",value:function(i,o){var s=e.zs3.create({parent:o&&o.viewContainerRef&&o.viewContainerRef.injector||this._injector,providers:[{provide:d2,useValue:o}]}),u=new qi.C5(this.snackBarContainerComponent,o.viewContainerRef,s),p=i.attach(u);return p.instance.snackBarConfig=o,p.instance}},{key:"_attach",value:function(i,o){var a=this,s=Object.assign(Object.assign(Object.assign({},new d2),this._defaultConfig),o),u=this._createOverlay(s),p=this._attachSnackBarContainer(u,s),m=new GZ(p,u);if(i instanceof e.Rgc){var C=new qi.UE(i,null,{$implicit:s.data,snackBarRef:m});m.instance=p.attachTemplatePortal(C)}else{var P=this._createInjector(s,m),L=new qi.C5(i,void 0,P),G=p.attachComponentPortal(L);m.instance=G.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe((0,Zr.R)(u.detachments())).subscribe(function(Y){var te=u.overlayElement.classList;Y.matches?te.add(a.handsetCssClass):te.remove(a.handsetCssClass)}),s.announcementMessage&&p._onAnnounce.subscribe(function(){a._live.announce(s.announcementMessage,s.politeness)}),this._animateSnackBar(m,s),this._openedSnackBarRef=m,this._openedSnackBarRef}},{key:"_animateSnackBar",value:function(i,o){var a=this;i.afterDismissed().subscribe(function(){a._openedSnackBarRef==i&&(a._openedSnackBarRef=null),o.announcementMessage&&a._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(function(){i.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):i.containerInstance.enter(),o.duration&&o.duration>0&&i.afterOpened().subscribe(function(){return i._dismissAfter(o.duration)})}},{key:"_createOverlay",value:function(i){var o=new so.X_;o.direction=i.direction;var a=this._overlay.position().global(),s="rtl"===i.direction,u="left"===i.horizontalPosition||"start"===i.horizontalPosition&&!s||"end"===i.horizontalPosition&&s,p=!u&&"center"!==i.horizontalPosition;return u?a.left("0"):p?a.right("0"):a.centerHorizontally(),"top"===i.verticalPosition?a.top("0"):a.bottom("0"),o.positionStrategy=a,this._overlay.create(o)}},{key:"_createInjector",value:function(i,o){return e.zs3.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:GZ,useValue:o},{provide:xq,useValue:i.data}]})}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(so.aV),e.LFG(Ai.Kd),e.LFG(e.zs3),e.LFG(u2),e.LFG(n,12),e.LFG(Eq))},n.\u0275prov=e.Yz7({factory:function(){return new n(e.LFG(so.aV),e.LFG(Ai.Kd),e.LFG(e.gxx),e.LFG(u2),e.LFG(n,12),e.LFG(Eq))},token:n,providedIn:wq}),n}(),Xn=function(){function n(r,t){this.snackbar=r,this.zone=t,this.snackBarConfigForSuccess={duration:4e3,panelClass:["snackabar-success"],MatSnackBarHorizontalPosition:"center",MatSnackBarVerticalPosition:"bottom"},this.snackBarConfigForWarning={duration:4e3,panelClass:["snackabar-warning"],MatSnackBarHorizontalPosition:"center",MatSnackBarVerticalPosition:"bottom"},this.snackBarConfigForError={duration:1e4,panelClass:["snackabar-error"],MatSnackBarHorizontalPosition:"center",MatSnackBarVerticalPosition:"bottom"}}return n.prototype.error=function(r){var t=this;this.zone.run(function(){t.snackbar.open(r,"Close",t.snackBarConfigForError)})},n.prototype.warning=function(r){var t=this;this.zone.run(function(){t.snackbar.open(r,"Close",t.snackBarConfigForWarning)})},n.prototype.success=function(r){var t=this;this.zone.run(function(){t.snackbar.open(r,"Close",t.snackBarConfigForSuccess)})},n.\u0275fac=function(t){return new(t||n)(e.LFG(Uae),e.LFG(e.R0b))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),Hae=["*",[["mat-card-footer"]]],Vae=["*","mat-card-footer"],YZ=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["mat-card-content"],["","mat-card-content",""],["","matCardContent",""]],hostAttrs:[1,"mat-card-content"]}),n}(),kq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-card-title"]}),n}(),Mq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["mat-card-subtitle"],["","mat-card-subtitle",""],["","matCardSubtitle",""]],hostAttrs:[1,"mat-card-subtitle"]}),n}(),Gae=function(){var n=function r(){(0,g.Z)(this,r),this.align="start"};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["mat-card-actions"]],hostAttrs:[1,"mat-card-actions"],hostVars:2,hostBindings:function(t,i){2&t&&e.ekj("mat-card-actions-align-end","end"===i.align)},inputs:{align:"align"},exportAs:["matCardActions"]}),n}(),yi=function(){var n=function r(t){(0,g.Z)(this,r),this._animationMode=t};return n.\u0275fac=function(t){return new(t||n)(e.Y36(ys.Qb,8))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-card"]],hostAttrs:[1,"mat-card","mat-focus-indicator"],hostVars:2,hostBindings:function(t,i){2&t&&e.ekj("_mat-animation-noopable","NoopAnimations"===i._animationMode)},exportAs:["matCard"],ngContentSelectors:Vae,decls:2,vars:0,template:function(t,i){1&t&&(e.F$t(Hae),e.Hsn(0),e.Hsn(1,1))},styles:[".mat-card{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:block;position:relative;padding:16px;border-radius:4px}._mat-animation-noopable.mat-card{transition:none;animation:none}.mat-card .mat-divider-horizontal{position:absolute;left:0;width:100%}[dir=rtl] .mat-card .mat-divider-horizontal{left:auto;right:0}.mat-card .mat-divider-horizontal.mat-divider-inset{position:static;margin:0}[dir=rtl] .mat-card .mat-divider-horizontal.mat-divider-inset{margin-right:0}.cdk-high-contrast-active .mat-card{outline:solid 1px}.mat-card-actions,.mat-card-subtitle,.mat-card-content{display:block;margin-bottom:16px}.mat-card-title{display:block;margin-bottom:8px}.mat-card-actions{margin-left:-8px;margin-right:-8px;padding:8px 0}.mat-card-actions-align-end{display:flex;justify-content:flex-end}.mat-card-image{width:calc(100% + 32px);margin:0 -16px 16px -16px}.mat-card-footer{display:block;margin:0 -16px -16px -16px}.mat-card-actions .mat-button,.mat-card-actions .mat-raised-button,.mat-card-actions .mat-stroked-button{margin:0 8px}.mat-card-header{display:flex;flex-direction:row}.mat-card-header .mat-card-title{margin-bottom:12px}.mat-card-header-text{margin:0 16px}.mat-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;object-fit:cover}.mat-card-title-group{display:flex;justify-content:space-between}.mat-card-sm-image{width:80px;height:80px}.mat-card-md-image{width:112px;height:112px}.mat-card-lg-image{width:152px;height:152px}.mat-card-xl-image{width:240px;height:240px;margin:-8px}.mat-card-title-group>.mat-card-xl-image{margin:-8px 0 8px}@media(max-width: 599px){.mat-card-title-group{margin:0}.mat-card-xl-image{margin-left:0;margin-right:0}}.mat-card>:first-child,.mat-card-content>:first-child{margin-top:0}.mat-card>:last-child:not(.mat-card-footer),.mat-card-content>:last-child:not(.mat-card-footer){margin-bottom:0}.mat-card-image:first-child{margin-top:-16px;border-top-left-radius:inherit;border-top-right-radius:inherit}.mat-card>.mat-card-actions:last-child{margin-bottom:-8px;padding-bottom:0}.mat-card-actions:not(.mat-card-actions-align-end) .mat-button:first-child,.mat-card-actions:not(.mat-card-actions-align-end) .mat-raised-button:first-child,.mat-card-actions:not(.mat-card-actions-align-end) .mat-stroked-button:first-child{margin-left:0;margin-right:0}.mat-card-actions-align-end .mat-button:last-child,.mat-card-actions-align-end .mat-raised-button:last-child,.mat-card-actions-align-end .mat-stroked-button:last-child{margin-left:0;margin-right:0}.mat-card-title:not(:first-child),.mat-card-subtitle:not(:first-child){margin-top:-4px}.mat-card-header .mat-card-subtitle:not(:first-child){margin-top:-8px}.mat-card>.mat-card-xl-image:first-child{margin-top:-8px}.mat-card>.mat-card-xl-image:last-child{margin-bottom:-8px}\n"],encapsulation:2,changeDetection:0}),n}(),Yae=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[un.BQ],un.BQ]}),n}(),Hn=f(36410),Aq=(f(54562),(0,Xr.i$)({passive:!0})),Dq=function(){var n=function(){function r(t,i){(0,g.Z)(this,r),this._platform=t,this._ngZone=i,this._monitoredElements=new Map}return(0,T.Z)(r,[{key:"monitor",value:function(i){var o=this;if(!this._platform.isBrowser)return rv.E;var a=(0,Mn.fI)(i),s=this._monitoredElements.get(a);if(s)return s.subject;var u=new Pn.xQ,p="cdk-text-field-autofilled",m=function(P){"cdk-text-field-autofill-start"!==P.animationName||a.classList.contains(p)?"cdk-text-field-autofill-end"===P.animationName&&a.classList.contains(p)&&(a.classList.remove(p),o._ngZone.run(function(){return u.next({target:P.target,isAutofilled:!1})})):(a.classList.add(p),o._ngZone.run(function(){return u.next({target:P.target,isAutofilled:!0})}))};return this._ngZone.runOutsideAngular(function(){a.addEventListener("animationstart",m,Aq),a.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(a,{subject:u,unlisten:function(){a.removeEventListener("animationstart",m,Aq)}}),u}},{key:"stopMonitoring",value:function(i){var o=(0,Mn.fI)(i),a=this._monitoredElements.get(o);a&&(a.unlisten(),a.subject.complete(),o.classList.remove("cdk-text-field-autofill-monitored"),o.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(o))}},{key:"ngOnDestroy",value:function(){var i=this;this._monitoredElements.forEach(function(o,a){return i.stopMonitoring(a)})}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.LFG(Xr.t4),e.LFG(e.R0b))},n.\u0275prov=e.Yz7({factory:function(){return new n(e.LFG(Xr.t4),e.LFG(e.R0b))},token:n,providedIn:"root"}),n}(),Oq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[Xr.ud]]}),n}(),Kae=new e.OlP("MAT_INPUT_VALUE_ACCESSOR"),Xae=["button","checkbox","file","hidden","image","radio","range","reset","submit"],$ae=0,ese=(0,un.FD)(function(){return function n(r,t,i,o){(0,g.Z)(this,n),this._defaultErrorStateMatcher=r,this._parentForm=t,this._parentFormGroup=i,this.ngControl=o}}()),lr=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p,m,C,P,L,G){var Y;(0,g.Z)(this,i),(Y=t.call(this,m,u,p,s))._elementRef=o,Y._platform=a,Y._autofillMonitor=P,Y._formField=G,Y._uid="mat-input-".concat($ae++),Y.focused=!1,Y.stateChanges=new Pn.xQ,Y.controlType="mat-input",Y.autofilled=!1,Y._disabled=!1,Y._required=!1,Y._type="text",Y._readonly=!1,Y._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(function(Me){return(0,Xr.qK)().has(Me)});var te=Y._elementRef.nativeElement,de=te.nodeName.toLowerCase();return Y._inputValueAccessor=C||te,Y._previousNativeValue=Y.value,Y.id=Y.id,a.IOS&&L.runOutsideAngular(function(){o.nativeElement.addEventListener("keyup",function(Me){var st=Me.target;!st.value&&0===st.selectionStart&&0===st.selectionEnd&&(st.setSelectionRange(1,1),st.setSelectionRange(0,0))})}),Y._isServer=!Y._platform.isBrowser,Y._isNativeSelect="select"===de,Y._isTextarea="textarea"===de,Y._isInFormField=!!G,Y._isNativeSelect&&(Y.controlType=te.multiple?"mat-native-select-multiple":"mat-native-select"),Y}return(0,T.Z)(i,[{key:"disabled",get:function(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled},set:function(a){this._disabled=(0,Mn.Ig)(a),this.focused&&(this.focused=!1,this.stateChanges.next())}},{key:"id",get:function(){return this._id},set:function(a){this._id=a||this._uid}},{key:"required",get:function(){return this._required},set:function(a){this._required=(0,Mn.Ig)(a)}},{key:"type",get:function(){return this._type},set:function(a){this._type=a||"text",this._validateType(),!this._isTextarea&&(0,Xr.qK)().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}},{key:"value",get:function(){return this._inputValueAccessor.value},set:function(a){a!==this.value&&(this._inputValueAccessor.value=a,this.stateChanges.next())}},{key:"readonly",get:function(){return this._readonly},set:function(a){this._readonly=(0,Mn.Ig)(a)}},{key:"ngAfterViewInit",value:function(){var a=this;this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(function(s){a.autofilled=s.isAutofilled,a.stateChanges.next()})}},{key:"ngOnChanges",value:function(){this.stateChanges.next()}},{key:"ngOnDestroy",value:function(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}},{key:"ngDoCheck",value:function(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}},{key:"focus",value:function(a){this._elementRef.nativeElement.focus(a)}},{key:"_focusChanged",value:function(a){a!==this.focused&&(this.focused=a,this.stateChanges.next())}},{key:"_onInput",value:function(){}},{key:"_dirtyCheckPlaceholder",value:function(){var a,s,u=(null===(s=null===(a=this._formField)||void 0===a?void 0:a._hideControlPlaceholder)||void 0===s?void 0:s.call(a))?null:this.placeholder;if(u!==this._previousPlaceholder){var p=this._elementRef.nativeElement;this._previousPlaceholder=u,u?p.setAttribute("placeholder",u):p.removeAttribute("placeholder")}}},{key:"_dirtyCheckNativeValue",value:function(){var a=this._elementRef.nativeElement.value;this._previousNativeValue!==a&&(this._previousNativeValue=a,this.stateChanges.next())}},{key:"_validateType",value:function(){Xae.indexOf(this._type)}},{key:"_isNeverEmpty",value:function(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}},{key:"_isBadInput",value:function(){var a=this._elementRef.nativeElement.validity;return a&&a.badInput}},{key:"empty",get:function(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}},{key:"shouldLabelFloat",get:function(){if(this._isNativeSelect){var a=this._elementRef.nativeElement,s=a.options[0];return this.focused||a.multiple||!this.empty||!!(a.selectedIndex>-1&&s&&s.label)}return this.focused||!this.empty}},{key:"setDescribedByIds",value:function(a){a.length?this._elementRef.nativeElement.setAttribute("aria-describedby",a.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}},{key:"onContainerClick",value:function(){this.focused||this.focus()}},{key:"_isInlineSelect",value:function(){var a=this._elementRef.nativeElement;return this._isNativeSelect&&(a.multiple||a.size>1)}}]),i}(ese);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(Xr.t4),e.Y36(re.a5,10),e.Y36(re.F,8),e.Y36(re.sg,8),e.Y36(un.rD),e.Y36(Kae,10),e.Y36(Dq),e.Y36(e.R0b),e.Y36(Hn.G_,8))},n.\u0275dir=e.lG2({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:11,hostBindings:function(t,i){1&t&&e.NdJ("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(e.Ikx("disabled",i.disabled)("required",i.required),e.uIk("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),e.ekj("mat-input-server",i._isServer)("mat-native-select-inline",i._isInlineSelect()))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[e._Bn([{provide:Hn.Eo,useExisting:n}]),e.qOj,e.TTD]}),n}(),tse=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[un.rD],imports:[[Oq,Hn.lN,un.BQ],Oq,Hn.lN]}),n}(),pi=f(73044);function nse(n,r){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"You must enter a value"),e.qZA())}function rse(n,r){if(1&n&&(e.TgZ(0,"mat-option",14),e._uU(1),e.qZA()),2&n){var t=r.$implicit;e.Q6J("value",t.key),e.xp6(1),e.hij(" ",t.name," ")}}function ise(n,r){if(1&n&&(e.TgZ(0,"mat-option",14),e._uU(1),e.qZA()),2&n){var t=r.$implicit;e.Q6J("value",t.key),e.xp6(1),e.hij(" ",t.name," ")}}function ose(n,r){if(1&n&&(e.TgZ(0,"mat-option",14),e._uU(1),e.qZA()),2&n){var t=r.$implicit;e.Q6J("value",t.key),e.xp6(1),e.hij(" ",t.name," ")}}function ase(n,r){if(1&n&&(e.TgZ(0,"mat-form-field"),e.TgZ(1,"mat-select",15),e.YNc(2,ose,2,2,"mat-option",10),e.qZA(),e.qZA()),2&n){var t=e.oxw();e.xp6(2),e.Q6J("ngForOf",t.authorizations)}}function sse(n,r){1&n&&(e.TgZ(0,"mat-form-field"),e._UZ(1,"input",16),e.qZA())}function lse(n,r){1&n&&(e.TgZ(0,"mat-form-field"),e._UZ(1,"input",17),e.qZA())}var use=function(){function n(r,t,i,o,a){this.serverService=r,this.serverDatabase=t,this.route=i,this.router=o,this.toasterService=a,this.serverOptionsVisibility=!1,this.authorizations=[{key:"none",name:"No authorization"},{key:"basic",name:"Basic authorization"}],this.protocols=[{key:"http:",name:"HTTP"},{key:"https:",name:"HTTPS"}],this.locations=[{key:"local",name:"Local"},{key:"remote",name:"Remote"}],this.serverForm=new re.cw({name:new re.NI("",[re.kI.required]),location:new re.NI(""),protocol:new re.NI("http:"),authorization:new re.NI("none"),login:new re.NI(""),password:new re.NI("")})}return n.prototype.ngOnInit=function(){return(0,Jn.mG)(this,void 0,void 0,function(){var r=this;return(0,Jn.Jh)(this,function(t){return this.serverService.isServiceInitialized&&this.getServers(),this.serverService.serviceInitialized.subscribe(function(i){return(0,Jn.mG)(r,void 0,void 0,function(){return(0,Jn.Jh)(this,function(o){return i&&this.getServers(),[2]})})}),[2]})})},n.prototype.getServers=function(){return(0,Jn.mG)(this,void 0,void 0,function(){var r,t,i=this;return(0,Jn.Jh)(this,function(o){switch(o.label){case 0:return this.serverIp=this.route.snapshot.paramMap.get("server_ip"),this.serverPort=+this.route.snapshot.paramMap.get("server_port"),this.projectId=this.route.snapshot.paramMap.get("project_id"),[4,this.serverService.findAll()];case 1:return r=o.sent(),(t=r.filter(function(a){return a.host===i.serverIp&&a.port===i.serverPort})[0])?this.router.navigate(["/server",t.id,"project",this.projectId]):this.serverOptionsVisibility=!0,[2]}})})},n.prototype.createServer=function(){var r=this;if(this.serverForm.get("name").hasError||this.serverForm.get("location").hasError||this.serverForm.get("protocol").hasError)if("basic"!==this.serverForm.get("authorization").value||this.serverForm.get("login").value||this.serverForm.get("password").value){var t=new a2;t.host=this.serverIp,t.port=this.serverPort,t.name=this.serverForm.get("name").value,t.location=this.serverForm.get("location").value,t.protocol=this.serverForm.get("protocol").value,t.authorization=this.serverForm.get("authorization").value,t.login=this.serverForm.get("login").value,t.password=this.serverForm.get("password").value,this.serverService.create(t).then(function(i){r.router.navigate(["/server",i.id,"project",r.projectId])})}else this.toasterService.error("Please use correct values");else this.toasterService.error("Please use correct values")},n.\u0275fac=function(t){return new(t||n)(e.Y36(Br),e.Y36(c2),e.Y36(Dr),e.Y36(xr),e.Y36(Xn))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-direct-link"]],decls:23,vars:8,consts:[[1,"content",3,"hidden"],[1,"default-header"],[1,"row"],[1,"col"],[1,"default-content"],[1,"matCard"],[3,"formGroup"],["matInput","","tabindex","1","formControlName","name","placeholder","Name"],[4,"ngIf"],["placeholder","Location","formControlName","location"],[3,"value",4,"ngFor","ngForOf"],["placeholder","Protocol","formControlName","protocol"],[1,"buttons-bar"],["mat-raised-button","","color","primary",3,"click"],[3,"value"],["placeholder","Authorization","formControlName","authorization"],["matInput","","tabindex","1","formControlName","login","placeholder","Login"],["matInput","","type","password","tabindex","1","formControlName","password","placeholder","Password"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"h1",3),e._uU(4,"Add new server"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(5,"div",4),e.TgZ(6,"mat-card",5),e.TgZ(7,"form",6),e.TgZ(8,"mat-form-field"),e._UZ(9,"input",7),e.YNc(10,nse,2,0,"mat-error",8),e.qZA(),e.TgZ(11,"mat-form-field"),e.TgZ(12,"mat-select",9),e.YNc(13,rse,2,2,"mat-option",10),e.qZA(),e.qZA(),e.TgZ(14,"mat-form-field"),e.TgZ(15,"mat-select",11),e.YNc(16,ise,2,2,"mat-option",10),e.qZA(),e.qZA(),e.YNc(17,ase,3,1,"mat-form-field",8),e.YNc(18,sse,2,0,"mat-form-field",8),e.YNc(19,lse,2,0,"mat-form-field",8),e.qZA(),e.qZA(),e.TgZ(20,"div",12),e.TgZ(21,"button",13),e.NdJ("click",function(){return i.createServer()}),e._uU(22,"Add server"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.Q6J("hidden",!i.serverOptionsVisibility),e.xp6(7),e.Q6J("formGroup",i.serverForm),e.xp6(3),e.Q6J("ngIf",i.serverForm.get("name").hasError("required")),e.xp6(3),e.Q6J("ngForOf",i.locations),e.xp6(3),e.Q6J("ngForOf",i.protocols),e.xp6(1),e.Q6J("ngIf","remote"===i.serverForm.get("location").value),e.xp6(1),e.Q6J("ngIf","basic"===i.serverForm.get("authorization").value),e.xp6(1),e.Q6J("ngIf","basic"===i.serverForm.get("authorization").value))},directives:[yi,re._Y,re.JL,re.sg,Hn.KE,lr,re.Fj,re.JJ,re.u,kt.O5,pi.gD,kt.sg,An,Hn.TO,un.ey],styles:["mat-form-field{width:100%}\n"],encapsulation:2}),n}(),cse=0,JZ=new e.OlP("CdkAccordion"),dse=function(){var n=function(){function r(){(0,g.Z)(this,r),this._stateChanges=new Pn.xQ,this._openCloseAllActions=new Pn.xQ,this.id="cdk-accordion-".concat(cse++),this._multi=!1}return(0,T.Z)(r,[{key:"multi",get:function(){return this._multi},set:function(i){this._multi=(0,Mn.Ig)(i)}},{key:"openAll",value:function(){this._multi&&this._openCloseAllActions.next(!0)}},{key:"closeAll",value:function(){this._openCloseAllActions.next(!1)}},{key:"ngOnChanges",value:function(i){this._stateChanges.next(i)}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete(),this._openCloseAllActions.complete()}}]),r}();return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:"multi"},exportAs:["cdkAccordion"],features:[e._Bn([{provide:JZ,useExisting:n}]),e.TTD]}),n}(),pse=0,hse=function(){var n=function(){function r(t,i,o){var a=this;(0,g.Z)(this,r),this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=o,this._openCloseAllSubscription=rs.w.EMPTY,this.closed=new e.vpe,this.opened=new e.vpe,this.destroyed=new e.vpe,this.expandedChange=new e.vpe,this.id="cdk-accordion-child-".concat(pse++),this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=function(){},this._removeUniqueSelectionListener=o.listen(function(s,u){a.accordion&&!a.accordion.multi&&a.accordion.id===u&&a.id!==s&&(a.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}return(0,T.Z)(r,[{key:"expanded",get:function(){return this._expanded},set:function(i){i=(0,Mn.Ig)(i),this._expanded!==i&&(this._expanded=i,this.expandedChange.emit(i),i?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}},{key:"disabled",get:function(){return this._disabled},set:function(i){this._disabled=(0,Mn.Ig)(i)}},{key:"ngOnDestroy",value:function(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}},{key:"toggle",value:function(){this.disabled||(this.expanded=!this.expanded)}},{key:"close",value:function(){this.disabled||(this.expanded=!1)}},{key:"open",value:function(){this.disabled||(this.expanded=!0)}},{key:"_subscribeToOpenCloseAllActions",value:function(){var i=this;return this.accordion._openCloseAllActions.subscribe(function(o){i.disabled||(i.expanded=o)})}}]),r}();return n.\u0275fac=function(t){return new(t||n)(e.Y36(JZ,12),e.Y36(e.sBO),e.Y36(Gi.A8))},n.\u0275dir=e.lG2({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[e._Bn([{provide:JZ,useValue:void 0}])]}),n}(),mse=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({}),n}(),vse=["body"];function gse(n,r){}var _se=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],yse=["mat-expansion-panel-header","*","mat-action-row"];function bse(n,r){if(1&n&&e._UZ(0,"span",2),2&n){var t=e.oxw();e.Q6J("@indicatorRotate",t._getExpandedState())}}var Cse=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],Sse=["mat-panel-title","mat-panel-description","*"],QZ=new e.OlP("MAT_ACCORDION"),Pq="225ms cubic-bezier(0.4,0.0,0.2,1)",Iq={indicatorRotate:(0,on.X$)("indicatorRotate",[(0,on.SB)("collapsed, void",(0,on.oB)({transform:"rotate(0deg)"})),(0,on.SB)("expanded",(0,on.oB)({transform:"rotate(180deg)"})),(0,on.eR)("expanded <=> collapsed, void => collapsed",(0,on.jt)(Pq))]),bodyExpansion:(0,on.X$)("bodyExpansion",[(0,on.SB)("collapsed, void",(0,on.oB)({height:"0px",visibility:"hidden"})),(0,on.SB)("expanded",(0,on.oB)({height:"*",visibility:"visible"})),(0,on.eR)("expanded <=> collapsed, void => collapsed",(0,on.jt)(Pq))])},Tse=function(){var n=function r(t){(0,g.Z)(this,r),this._template=t};return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.Rgc))},n.\u0275dir=e.lG2({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n}(),xse=0,Rq=new e.OlP("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),oc=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p,m,C){var P;return(0,g.Z)(this,i),(P=t.call(this,o,a,s))._viewContainerRef=u,P._animationMode=m,P._hideToggle=!1,P.afterExpand=new e.vpe,P.afterCollapse=new e.vpe,P._inputChanges=new Pn.xQ,P._headerId="mat-expansion-panel-header-".concat(xse++),P._bodyAnimationDone=new Pn.xQ,P.accordion=o,P._document=p,P._bodyAnimationDone.pipe((0,u_.x)(function(L,G){return L.fromState===G.fromState&&L.toState===G.toState})).subscribe(function(L){"void"!==L.fromState&&("expanded"===L.toState?P.afterExpand.emit():"collapsed"===L.toState&&P.afterCollapse.emit())}),C&&(P.hideToggle=C.hideToggle),P}return(0,T.Z)(i,[{key:"hideToggle",get:function(){return this._hideToggle||this.accordion&&this.accordion.hideToggle},set:function(a){this._hideToggle=(0,Mn.Ig)(a)}},{key:"togglePosition",get:function(){return this._togglePosition||this.accordion&&this.accordion.togglePosition},set:function(a){this._togglePosition=a}},{key:"_hasSpacing",value:function(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}},{key:"_getExpandedState",value:function(){return this.expanded?"expanded":"collapsed"}},{key:"toggle",value:function(){this.expanded=!this.expanded}},{key:"close",value:function(){this.expanded=!1}},{key:"open",value:function(){this.expanded=!0}},{key:"ngAfterContentInit",value:function(){var a=this;this._lazyContent&&this.opened.pipe((0,ra.O)(null),(0,mi.h)(function(){return a.expanded&&!a._portal}),(0,$i.q)(1)).subscribe(function(){a._portal=new qi.UE(a._lazyContent._template,a._viewContainerRef)})}},{key:"ngOnChanges",value:function(a){this._inputChanges.next(a)}},{key:"ngOnDestroy",value:function(){(0,I.Z)((0,D.Z)(i.prototype),"ngOnDestroy",this).call(this),this._bodyAnimationDone.complete(),this._inputChanges.complete()}},{key:"_containsFocus",value:function(){if(this._body){var a=this._document.activeElement,s=this._body.nativeElement;return a===s||s.contains(a)}return!1}}]),i}(hse);return n.\u0275fac=function(t){return new(t||n)(e.Y36(QZ,12),e.Y36(e.sBO),e.Y36(Gi.A8),e.Y36(e.s_b),e.Y36(kt.K0),e.Y36(ys.Qb,8),e.Y36(Rq,8))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,o){var a;1&t&&e.Suo(o,Tse,5),2&t&&e.iGM(a=e.CRH())&&(i._lazyContent=a.first)},viewQuery:function(t,i){var o;1&t&&e.Gf(vse,5),2&t&&e.iGM(o=e.CRH())&&(i._body=o.first)},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&e.ekj("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[e._Bn([{provide:QZ,useValue:void 0}]),e.qOj,e.TTD],ngContentSelectors:yse,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){1&t&&(e.F$t(_se),e.Hsn(0),e.TgZ(1,"div",0,1),e.NdJ("@bodyExpansion.done",function(a){return i._bodyAnimationDone.next(a)}),e.TgZ(3,"div",2),e.Hsn(4,1),e.YNc(5,gse,0,0,"ng-template",3),e.qZA(),e.Hsn(6,2),e.qZA()),2&t&&(e.xp6(1),e.Q6J("@bodyExpansion",i._getExpandedState())("id",i.id),e.uIk("aria-labelledby",i._headerId),e.xp6(4),e.Q6J("cdkPortalOutlet",i._portal))},directives:[qi.Pl],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[Iq.bodyExpansion]},changeDetection:0}),n}(),kse=(0,un.sb)(function n(){(0,g.Z)(this,n)}),ac=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u,p,m,C){var P;(0,g.Z)(this,i),(P=t.call(this)).panel=o,P._element=a,P._focusMonitor=s,P._changeDetectorRef=u,P._animationMode=m,P._parentChangeSubscription=rs.w.EMPTY;var L=o.accordion?o.accordion._stateChanges.pipe((0,mi.h)(function(G){return!(!G.hideToggle&&!G.togglePosition)})):rv.E;return P.tabIndex=parseInt(C||"")||0,P._parentChangeSubscription=(0,go.T)(o.opened,o.closed,L,o._inputChanges.pipe((0,mi.h)(function(G){return!!(G.hideToggle||G.disabled||G.togglePosition)}))).subscribe(function(){return P._changeDetectorRef.markForCheck()}),o.closed.pipe((0,mi.h)(function(){return o._containsFocus()})).subscribe(function(){return s.focusVia(a,"program")}),p&&(P.expandedHeight=p.expandedHeight,P.collapsedHeight=p.collapsedHeight),P}return(0,T.Z)(i,[{key:"disabled",get:function(){return this.panel.disabled}},{key:"_toggle",value:function(){this.disabled||this.panel.toggle()}},{key:"_isExpanded",value:function(){return this.panel.expanded}},{key:"_getExpandedState",value:function(){return this.panel._getExpandedState()}},{key:"_getPanelId",value:function(){return this.panel.id}},{key:"_getTogglePosition",value:function(){return this.panel.togglePosition}},{key:"_showToggle",value:function(){return!this.panel.hideToggle&&!this.panel.disabled}},{key:"_getHeaderHeight",value:function(){var a=this._isExpanded();return a&&this.expandedHeight?this.expandedHeight:!a&&this.collapsedHeight?this.collapsedHeight:null}},{key:"_keydown",value:function(a){switch(a.keyCode){case zr.L_:case zr.K5:(0,zr.Vb)(a)||(a.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(a))}}},{key:"focus",value:function(a,s){a?this._focusMonitor.focusVia(this._element,a,s):this._element.nativeElement.focus(s)}},{key:"ngAfterViewInit",value:function(){var a=this;this._focusMonitor.monitor(this._element).subscribe(function(s){s&&a.panel.accordion&&a.panel.accordion._handleHeaderFocus(a)})}},{key:"ngOnDestroy",value:function(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}]),i}(kse);return n.\u0275fac=function(t){return new(t||n)(e.Y36(oc,1),e.Y36(e.SBq),e.Y36(Ai.tE),e.Y36(e.sBO),e.Y36(Rq,8),e.Y36(ys.Qb,8),e.$8M("tabindex"))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&e.NdJ("click",function(){return i._toggle()})("keydown",function(a){return i._keydown(a)}),2&t&&(e.uIk("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),e.Udp("height",i._getHeaderHeight()),e.ekj("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[e.qOj],ngContentSelectors:Sse,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(e.F$t(Cse),e.TgZ(0,"span",0),e.Hsn(1),e.Hsn(2,1),e.Hsn(3,2),e.qZA(),e.YNc(4,bse,1,1,"span",1)),2&t&&(e.xp6(4),e.Q6J("ngIf",i._showToggle()))},directives:[kt.O5],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}.cdk-high-contrast-active .mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}\n'],encapsulation:2,data:{animation:[Iq.indicatorRotate]},changeDetection:0}),n}(),Mse=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["mat-panel-description"]],hostAttrs:[1,"mat-expansion-panel-header-description"]}),n}(),rd=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n}(),id=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){var o;return(0,g.Z)(this,i),(o=t.apply(this,arguments))._ownHeaders=new e.n_E,o._hideToggle=!1,o.displayMode="default",o.togglePosition="after",o}return(0,T.Z)(i,[{key:"hideToggle",get:function(){return this._hideToggle},set:function(a){this._hideToggle=(0,Mn.Ig)(a)}},{key:"ngAfterContentInit",value:function(){var a=this;this._headers.changes.pipe((0,ra.O)(this._headers)).subscribe(function(s){a._ownHeaders.reset(s.filter(function(u){return u.panel.accordion===a})),a._ownHeaders.notifyOnChanges()}),this._keyManager=new Ai.Em(this._ownHeaders).withWrap().withHomeAndEnd()}},{key:"_handleHeaderKeydown",value:function(a){this._keyManager.onKeydown(a)}},{key:"_handleHeaderFocus",value:function(a){this._keyManager.updateActiveItem(a)}},{key:"ngOnDestroy",value:function(){(0,I.Z)((0,D.Z)(i.prototype),"ngOnDestroy",this).call(this),this._ownHeaders.destroy()}}]),i}(dse);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["mat-accordion"]],contentQueries:function(t,i,o){var a;1&t&&e.Suo(o,ac,5),2&t&&e.iGM(a=e.CRH())&&(i._headers=a)},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(t,i){2&t&&e.ekj("mat-accordion-multi",i.multi)},inputs:{multi:"multi",displayMode:"displayMode",togglePosition:"togglePosition",hideToggle:"hideToggle"},exportAs:["matAccordion"],features:[e._Bn([{provide:QZ,useExisting:n}]),e.qOj]}),n}(),Ase=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[kt.ez,un.BQ,mse,qi.eL]]}),n}(),Nq=f(93386),KZ=["*"],XZ='.mat-subheader{display:flex;box-sizing:border-box;padding:16px;align-items:center}.mat-list-base .mat-subheader{margin:0}.mat-list-base{padding-top:8px;display:block;-webkit-tap-highlight-color:transparent}.mat-list-base .mat-subheader{height:48px;line-height:16px}.mat-list-base .mat-subheader:first-child{margin-top:-8px}.mat-list-base .mat-list-item,.mat-list-base .mat-list-option{display:block;height:48px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base .mat-list-item .mat-list-item-content,.mat-list-base .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base .mat-list-item .mat-list-item-content-reverse,.mat-list-base .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base .mat-list-item .mat-list-item-ripple,.mat-list-base .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar,.mat-list-base .mat-list-option.mat-list-item-with-avatar{height:56px}.mat-list-base .mat-list-item.mat-2-line,.mat-list-base .mat-list-option.mat-2-line{height:72px}.mat-list-base .mat-list-item.mat-3-line,.mat-list-base .mat-list-option.mat-3-line{height:88px}.mat-list-base .mat-list-item.mat-multi-line,.mat-list-base .mat-list-option.mat-multi-line{height:auto}.mat-list-base .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base .mat-list-item .mat-list-text,.mat-list-base .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base .mat-list-item .mat-list-text>*,.mat-list-base .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base .mat-list-item .mat-list-text:empty,.mat-list-base .mat-list-option .mat-list-text:empty{display:none}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base .mat-list-item .mat-list-avatar,.mat-list-base .mat-list-option .mat-list-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;object-fit:cover}.mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:72px;width:calc(100% - 72px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:72px}.mat-list-base .mat-list-item .mat-list-icon,.mat-list-base .mat-list-option .mat-list-icon{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:64px;width:calc(100% - 64px)}[dir=rtl] .mat-list-base .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:64px}.mat-list-base .mat-list-item .mat-divider,.mat-list-base .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base .mat-list-item .mat-divider,[dir=rtl] .mat-list-base .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-list-base[dense]{padding-top:4px;display:block}.mat-list-base[dense] .mat-subheader{height:40px;line-height:8px}.mat-list-base[dense] .mat-subheader:first-child{margin-top:-4px}.mat-list-base[dense] .mat-list-item,.mat-list-base[dense] .mat-list-option{display:block;height:40px;-webkit-tap-highlight-color:transparent;width:100%;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-item-content,.mat-list-base[dense] .mat-list-option .mat-list-item-content{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;padding:0 16px;position:relative;height:inherit}.mat-list-base[dense] .mat-list-item .mat-list-item-content-reverse,.mat-list-base[dense] .mat-list-option .mat-list-item-content-reverse{display:flex;align-items:center;padding:0 16px;flex-direction:row-reverse;justify-content:space-around}.mat-list-base[dense] .mat-list-item .mat-list-item-ripple,.mat-list-base[dense] .mat-list-option .mat-list-item-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar{height:48px}.mat-list-base[dense] .mat-list-item.mat-2-line,.mat-list-base[dense] .mat-list-option.mat-2-line{height:60px}.mat-list-base[dense] .mat-list-item.mat-3-line,.mat-list-base[dense] .mat-list-option.mat-3-line{height:76px}.mat-list-base[dense] .mat-list-item.mat-multi-line,.mat-list-base[dense] .mat-list-option.mat-multi-line{height:auto}.mat-list-base[dense] .mat-list-item.mat-multi-line .mat-list-item-content,.mat-list-base[dense] .mat-list-option.mat-multi-line .mat-list-item-content{padding-top:16px;padding-bottom:16px}.mat-list-base[dense] .mat-list-item .mat-list-text,.mat-list-base[dense] .mat-list-option .mat-list-text{display:flex;flex-direction:column;flex:auto;box-sizing:border-box;overflow:hidden;padding:0}.mat-list-base[dense] .mat-list-item .mat-list-text>*,.mat-list-base[dense] .mat-list-option .mat-list-text>*{margin:0;padding:0;font-weight:normal;font-size:inherit}.mat-list-base[dense] .mat-list-item .mat-list-text:empty,.mat-list-base[dense] .mat-list-option .mat-list-text:empty{display:none}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:0;padding-left:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:0}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-left:0;padding-right:16px}[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-item.mat-list-option .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar .mat-list-item-content-reverse .mat-list-text,[dir=rtl] .mat-list-base[dense] .mat-list-option.mat-list-option .mat-list-item-content-reverse .mat-list-text{padding-right:0;padding-left:16px}.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-item.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content-reverse .mat-list-text,.mat-list-base[dense] .mat-list-option.mat-list-item-with-avatar.mat-list-option .mat-list-item-content .mat-list-text{padding-right:16px;padding-left:16px}.mat-list-base[dense] .mat-list-item .mat-list-avatar,.mat-list-base[dense] .mat-list-option .mat-list-avatar{flex-shrink:0;width:36px;height:36px;border-radius:50%;object-fit:cover}.mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:68px;width:calc(100% - 68px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-avatar~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-avatar~.mat-divider-inset{margin-left:auto;margin-right:68px}.mat-list-base[dense] .mat-list-item .mat-list-icon,.mat-list-base[dense] .mat-list-option .mat-list-icon{flex-shrink:0;width:20px;height:20px;font-size:20px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:60px;width:calc(100% - 60px)}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-list-icon~.mat-divider-inset,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-list-icon~.mat-divider-inset{margin-left:auto;margin-right:60px}.mat-list-base[dense] .mat-list-item .mat-divider,.mat-list-base[dense] .mat-list-option .mat-divider{position:absolute;bottom:0;left:0;width:100%;margin:0}[dir=rtl] .mat-list-base[dense] .mat-list-item .mat-divider,[dir=rtl] .mat-list-base[dense] .mat-list-option .mat-divider{margin-left:auto;margin-right:0}.mat-list-base[dense] .mat-list-item .mat-divider.mat-divider-inset,.mat-list-base[dense] .mat-list-option .mat-divider.mat-divider-inset{position:absolute}.mat-nav-list a{text-decoration:none;color:inherit}.mat-nav-list .mat-list-item{cursor:pointer;outline:none}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:transparent;text-align:left}[dir=rtl] mat-action-list button{text-align:right}mat-action-list button::-moz-focus-inner{border:0}mat-action-list .mat-list-item{cursor:pointer;outline:inherit}.mat-list-option:not(.mat-list-item-disabled){cursor:pointer;outline:none}.mat-list-item-disabled{pointer-events:none}.cdk-high-contrast-active .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active :host .mat-list-item-disabled{opacity:.5}.cdk-high-contrast-active .mat-selection-list:focus{outline-style:dotted}.cdk-high-contrast-active .mat-list-option:hover,.cdk-high-contrast-active .mat-list-option:focus,.cdk-high-contrast-active .mat-nav-list .mat-list-item:hover,.cdk-high-contrast-active .mat-nav-list .mat-list-item:focus,.cdk-high-contrast-active mat-action-list .mat-list-item:hover,.cdk-high-contrast-active mat-action-list .mat-list-item:focus{outline:dotted 1px;z-index:1}.cdk-high-contrast-active .mat-list-single-selected-option::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}.cdk-high-contrast-active [dir=rtl] .mat-list-single-selected-option::after{right:auto;left:16px}@media(hover: none){.mat-list-option:not(.mat-list-single-selected-option):not(.mat-list-item-disabled):hover,.mat-nav-list .mat-list-item:not(.mat-list-item-disabled):hover,.mat-action-list .mat-list-item:not(.mat-list-item-disabled):hover{background:none}}\n',Dse=[[["","mat-list-avatar",""],["","mat-list-icon",""],["","matListAvatar",""],["","matListIcon",""]],[["","mat-line",""],["","matLine",""]],"*"],Ose=["[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]","[mat-line], [matLine]","*"],Zq=(0,un.Id)((0,un.Kr)(function(){return function n(){(0,g.Z)(this,n)}}())),Zse=(0,un.Kr)(function(){return function n(){(0,g.Z)(this,n)}}()),Lq=new e.OlP("MatList"),Fq=new e.OlP("MatNavList"),Du=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){var o;return(0,g.Z)(this,i),(o=t.apply(this,arguments))._stateChanges=new Pn.xQ,o}return(0,T.Z)(i,[{key:"ngOnChanges",value:function(){this._stateChanges.next()}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}}]),i}(Zq);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-nav-list"]],hostAttrs:["role","navigation",1,"mat-nav-list","mat-list-base"],inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matNavList"],features:[e._Bn([{provide:Fq,useExisting:n}]),e.qOj,e.TTD],ngContentSelectors:KZ,decls:1,vars:0,template:function(t,i){1&t&&(e.F$t(),e.Hsn(0))},styles:[XZ],encapsulation:2,changeDetection:0}),n}(),$Z=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o){var a;return(0,g.Z)(this,i),(a=t.call(this))._elementRef=o,a._stateChanges=new Pn.xQ,"action-list"===a._getListType()&&o.nativeElement.classList.add("mat-action-list"),a}return(0,T.Z)(i,[{key:"_getListType",value:function(){var a=this._elementRef.nativeElement.nodeName.toLowerCase();return"mat-list"===a?"list":"mat-action-list"===a?"action-list":null}},{key:"ngOnChanges",value:function(){this._stateChanges.next()}},{key:"ngOnDestroy",value:function(){this._stateChanges.complete()}}]),i}(Zq);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-list"],["mat-action-list"]],hostAttrs:[1,"mat-list","mat-list-base"],inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matList"],features:[e._Bn([{provide:Lq,useExisting:n}]),e.qOj,e.TTD],ngContentSelectors:KZ,decls:1,vars:0,template:function(t,i){1&t&&(e.F$t(),e.Hsn(0))},styles:[XZ],encapsulation:2,changeDetection:0}),n}(),Bq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["","mat-list-avatar",""],["","matListAvatar",""]],hostAttrs:[1,"mat-list-avatar"]}),n}(),Uq=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=e.lG2({type:n,selectors:[["","mat-list-icon",""],["","matListIcon",""]],hostAttrs:[1,"mat-list-icon"]}),n}(),Ss=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(o,a,s,u){var p;(0,g.Z)(this,i),(p=t.call(this))._element=o,p._isInteractiveList=!1,p._destroyed=new Pn.xQ,p._disabled=!1,p._isInteractiveList=!!(s||u&&"action-list"===u._getListType()),p._list=s||u;var m=p._getHostElement();return"button"===m.nodeName.toLowerCase()&&!m.hasAttribute("type")&&m.setAttribute("type","button"),p._list&&p._list._stateChanges.pipe((0,Zr.R)(p._destroyed)).subscribe(function(){a.markForCheck()}),p}return(0,T.Z)(i,[{key:"disabled",get:function(){return this._disabled||!(!this._list||!this._list.disabled)},set:function(a){this._disabled=(0,Mn.Ig)(a)}},{key:"ngAfterContentInit",value:function(){(0,un.E0)(this._lines,this._element)}},{key:"ngOnDestroy",value:function(){this._destroyed.next(),this._destroyed.complete()}},{key:"_isRippleDisabled",value:function(){return!this._isInteractiveList||this.disableRipple||!(!this._list||!this._list.disableRipple)}},{key:"_getHostElement",value:function(){return this._element.nativeElement}}]),i}(Zse);return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(Fq,8),e.Y36(Lq,8))},n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(t,i,o){var a;1&t&&(e.Suo(o,Bq,5),e.Suo(o,Uq,5),e.Suo(o,un.X2,5)),2&t&&(e.iGM(a=e.CRH())&&(i._avatar=a.first),e.iGM(a=e.CRH())&&(i._icon=a.first),e.iGM(a=e.CRH())&&(i._lines=a))},hostAttrs:[1,"mat-list-item","mat-focus-indicator"],hostVars:6,hostBindings:function(t,i){2&t&&e.ekj("mat-list-item-disabled",i.disabled)("mat-list-item-avatar",i._avatar||i._icon)("mat-list-item-with-avatar",i._avatar||i._icon)},inputs:{disableRipple:"disableRipple",disabled:"disabled"},exportAs:["matListItem"],features:[e.qOj],ngContentSelectors:Ose,decls:6,vars:2,consts:[[1,"mat-list-item-content"],["mat-ripple","",1,"mat-list-item-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-list-text"]],template:function(t,i){1&t&&(e.F$t(Dse),e.TgZ(0,"div",0),e._UZ(1,"div",1),e.Hsn(2),e.TgZ(3,"div",2),e.Hsn(4,1),e.qZA(),e.Hsn(5,2),e.qZA()),2&t&&(e.xp6(1),e.Q6J("matRippleTrigger",i._getHostElement())("matRippleDisabled",i._isRippleDisabled()))},directives:[un.wG],encapsulation:2,changeDetection:0}),n}(),Vse=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[un.uc,un.si,un.BQ,un.us,kt.ez],un.uc,un.BQ,un.us,Nq.t]}),n}(),qse=function(){function n(r){this.httpClient=r,this.thirdpartylicenses="",this.releasenotes=""}return n.prototype.ngOnInit=function(){var r=this;this.httpClient.get(window.location.href+"/3rdpartylicenses.txt",{responseType:"text"}).subscribe(function(t){r.thirdpartylicenses=t.replace(new RegExp("\n","g"),"
")},function(t){404===t.status&&(r.thirdpartylicenses="File not found")}),this.httpClient.get("ReleaseNotes.txt",{responseType:"text"}).subscribe(function(t){r.releasenotes=t.replace(new RegExp("\n","g"),"
")})},n.prototype.goToDocumentation=function(){window.location.href="https://docs.gns3.com/docs/"},n.\u0275fac=function(t){return new(t||n)(e.Y36(Ku.eN))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-help"]],decls:38,vars:2,consts:[[1,"content"],[1,"default-header"],[1,"default-content"],[1,"container","mat-elevation-z8"],[3,"innerHTML"],["mat-button","","color","primary",1,"full-width",3,"click"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"h1"),e._uU(3,"Help"),e.qZA(),e.qZA(),e.TgZ(4,"div",2),e.TgZ(5,"div",3),e.TgZ(6,"mat-accordion"),e.TgZ(7,"mat-expansion-panel"),e.TgZ(8,"mat-expansion-panel-header"),e.TgZ(9,"mat-panel-title"),e._uU(10," Useful shortcuts "),e.qZA(),e.qZA(),e.TgZ(11,"mat-list"),e.TgZ(12,"mat-list-item"),e._uU(13," ctrl + + to zoom in "),e.qZA(),e.TgZ(14,"mat-list-item"),e._uU(15," ctrl + - to zoom out "),e.qZA(),e.TgZ(16,"mat-list-item"),e._uU(17," ctrl + 0 to reset zoom "),e.qZA(),e.TgZ(18,"mat-list-item"),e._uU(19," ctrl + h to hide toolbar "),e.qZA(),e.TgZ(20,"mat-list-item"),e._uU(21," ctrl + a to select all items on map "),e.qZA(),e.TgZ(22,"mat-list-item"),e._uU(23," ctrl + shift + a to deselect all items on map "),e.qZA(),e.TgZ(24,"mat-list-item"),e._uU(25," ctrl + shift + s to go to preferences "),e.qZA(),e.qZA(),e.qZA(),e.TgZ(26,"mat-expansion-panel"),e.TgZ(27,"mat-expansion-panel-header"),e.TgZ(28,"mat-panel-title"),e._uU(29," Third party components "),e.qZA(),e.qZA(),e._UZ(30,"div",4),e.qZA(),e.TgZ(31,"mat-expansion-panel"),e.TgZ(32,"mat-expansion-panel-header"),e.TgZ(33,"mat-panel-title"),e._uU(34," Release notes "),e.qZA(),e.qZA(),e._UZ(35,"div",4),e.qZA(),e.qZA(),e.qZA(),e.TgZ(36,"button",5),e.NdJ("click",function(){return i.goToDocumentation()}),e._uU(37,"Go to documentation"),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(30),e.Q6J("innerHTML",i.thirdpartylicenses,e.oJD),e.xp6(5),e.Q6J("innerHTML",i.releasenotes,e.oJD))},directives:[id,oc,ac,rd,$Z,Ss,An],styles:[".full-width[_ngcontent-%COMP%]{width:100%;margin-top:20px}"]}),n}(),Vq=function(){function n(r){this.electronService=r}return n.prototype.isWindows=function(){return"win32"===this.electronService.process.platform},n.prototype.isLinux=function(){return"linux"===this.electronService.process.platform},n.prototype.isDarwin=function(){return"darwin"===this.electronService.process.platform},n.\u0275fac=function(t){return new(t||n)(e.LFG(cs))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),qq=function(){function n(r){this.platformService=r}return n.prototype.get=function(){return this.platformService.isWindows()?this.getForWindows():this.platformService.isDarwin()?this.getForDarwin():this.getForLinux()},n.prototype.getForWindows=function(){var r=[{name:"Wireshark",locations:["C:\\Program Files\\Wireshark\\Wireshark.exe"],type:"web",resource:"https://1.na.dl.wireshark.org/win64/all-versions/Wireshark-win64-2.6.3.exe",binary:"Wireshark.exe",sudo:!0,installation_arguments:[],installed:!1,installer:!0}];return r},n.prototype.getForLinux=function(){return[]},n.prototype.getForDarwin=function(){return[]},n.\u0275fac=function(t){return new(t||n)(e.LFG(Vq))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),jq=function(){function n(r,t){this.electronService=r,this.externalSoftwareDefinition=t}return n.prototype.list=function(){var r=this.externalSoftwareDefinition.get(),t=this.electronService.remote.require("./installed-software.js").getInstalledSoftware(r);return r.map(function(i){return i.installed=t[i.name].length>0,i})},n.\u0275fac=function(t){return new(t||n)(e.LFG(cs),e.LFG(qq))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n}(),jse=[[["caption"]],[["colgroup"],["col"]]],zse=["caption","colgroup, col"],Jl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){var o;return(0,g.Z)(this,i),(o=t.apply(this,arguments)).stickyCssClass="mat-table-sticky",o.needsPositionStickyOnElement=!1,o}return i}(ep);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-table"],["table","mat-table",""]],hostAttrs:[1,"mat-table"],hostVars:2,hostBindings:function(t,i){2&t&&e.ekj("mat-table-fixed-layout",i.fixedLayout)},exportAs:["matTable"],features:[e._Bn([{provide:Gi.k,useClass:Gi.yy},{provide:ep,useExisting:n},{provide:yu,useExisting:n},{provide:NC,useClass:GE},{provide:sm,useValue:null}]),e.qOj],ngContentSelectors:zse,decls:6,vars:0,consts:[["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,i){1&t&&(e.F$t(jse),e.Hsn(0),e.Hsn(1,1),e.GkF(2,0),e.GkF(3,1),e.GkF(4,2),e.GkF(5,3))},directives:[s_,lm,wf,l_],styles:['mat-table{display:block}mat-header-row{min-height:56px}mat-row,mat-footer-row{min-height:48px}mat-row,mat-header-row,mat-footer-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-row::after,mat-header-row::after,mat-footer-row::after{display:inline-block;min-height:inherit;content:""}mat-cell:first-of-type,mat-header-cell:first-of-type,mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] mat-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] mat-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}mat-cell,mat-header-cell,mat-footer-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}table.mat-table{border-spacing:0}tr.mat-header-row{height:56px}tr.mat-row,tr.mat-footer-row{height:48px}th.mat-header-cell{text-align:left}[dir=rtl] th.mat-header-cell{text-align:right}th.mat-header-cell,td.mat-cell,td.mat-footer-cell{padding:0;border-bottom-width:1px;border-bottom-style:solid}th.mat-header-cell:first-of-type,td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] th.mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] td.mat-cell:first-of-type:not(:only-of-type),[dir=rtl] td.mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}th.mat-header-cell:last-of-type,td.mat-cell:last-of-type,td.mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] th.mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] td.mat-cell:last-of-type:not(:only-of-type),[dir=rtl] td.mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}.mat-table-sticky{position:-webkit-sticky !important;position:sticky !important}.mat-table-fixed-layout{table-layout:fixed}\n'],encapsulation:2}),n}(),ul=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(Sf);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["","matCellDef",""]],features:[e._Bn([{provide:Sf,useExisting:n}]),e.qOj]}),n}(),cl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(jc);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["","matHeaderCellDef",""]],features:[e._Bn([{provide:jc,useExisting:n}]),e.qOj]}),n}(),dl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return(0,T.Z)(i,[{key:"name",get:function(){return this._name},set:function(a){this._setNameInput(a)}},{key:"_updateColumnCssClassName",value:function(){(0,I.Z)((0,D.Z)(i.prototype),"_updateColumnCssClassName",this).call(this),this._columnCssClassName.push("mat-column-".concat(this.cssClassFriendlyName))}}]),i}(Qu);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["","matColumnDef",""]],inputs:{sticky:"sticky",name:["matColumnDef","name"]},features:[e._Bn([{provide:Qu,useExisting:n},{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:n}]),e.qOj]}),n}(),pl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(zE);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["mat-header-cell"],["th","mat-header-cell",""]],hostAttrs:["role","columnheader",1,"mat-header-cell"],features:[e.qOj]}),n}(),fl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(IC);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["mat-cell"],["td","mat-cell",""]],hostAttrs:["role","gridcell",1,"mat-cell"],features:[e.qOj]}),n}(),Ql=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(Tf);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["","matHeaderRowDef",""]],inputs:{columns:["matHeaderRowDef","columns"],sticky:["matHeaderRowDefSticky","sticky"]},features:[e._Bn([{provide:Tf,useExisting:n}]),e.qOj]}),n}(),Kl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(om);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275dir=e.lG2({type:n,selectors:[["","matRowDef",""]],inputs:{columns:["matRowDefColumns","columns"],when:["matRowDefWhen","when"]},features:[e._Bn([{provide:om,useExisting:n}]),e.qOj]}),n}(),Xl=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(FC);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-header-row"],["tr","mat-header-row",""]],hostAttrs:["role","row",1,"mat-header-row"],exportAs:["matHeaderRow"],features:[e._Bn([{provide:FC,useExisting:n}]),e.qOj],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,i){1&t&&e.GkF(0,0)},directives:[bu],encapsulation:2}),n}(),$l=function(){var n=function(r){(0,A.Z)(i,r);var t=(0,S.Z)(i);function i(){return(0,g.Z)(this,i),t.apply(this,arguments)}return i}(i_);return n.\u0275fac=function(){var r;return function(i){return(r||(r=e.n5z(n)))(i||n)}}(),n.\u0275cmp=e.Xpm({type:n,selectors:[["mat-row"],["tr","mat-row",""]],hostAttrs:["role","row",1,"mat-row"],exportAs:["matRow"],features:[e._Bn([{provide:i_,useExisting:n}]),e.qOj],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,i){1&t&&e.GkF(0,0)},directives:[bu],encapsulation:2}),n}(),tle=function(){var n=function r(){(0,g.Z)(this,r)};return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[QE,un.BQ],un.BQ]}),n}(),nle=9007199254740991,zq=function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(){return(0,g.Z)(this,t),r.apply(this,arguments)}return t}(function(n){(0,A.Z)(t,n);var r=(0,S.Z)(t);function t(){var i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,g.Z)(this,t),(i=r.call(this))._renderData=new eo.X([]),i._filter=new eo.X(""),i._internalPageChanges=new Pn.xQ,i._renderChangesSubscription=null,i.sortingDataAccessor=function(a,s){var u=a[s];if((0,Mn.t6)(u)){var p=Number(u);return pL?te=1:P0)){var u=Math.ceil(s.length/s.pageSize)-1||0,p=Math.min(s.pageIndex,u);p!==s.pageIndex&&(s.pageIndex=p,a._internalPageChanges.next())}})}},{key:"connect",value:function(){return this._renderChangesSubscription||this._updateChangeSubscription(),this._renderData}},{key:"disconnect",value:function(){var o;null===(o=this._renderChangesSubscription)||void 0===o||o.unsubscribe(),this._renderChangesSubscription=null}}]),t}(Gi.o2)),sc=f(15132),ile=function(n,r){return{hidden:n,lightTheme:r}},ole=/(.*)<\/a>(.*)\s*