diff --git a/.github/workflows/ptcs-ci.yml b/.github/workflows/ptcs-ci.yml index b3683ea..c19654a 100644 --- a/.github/workflows/ptcs-ci.yml +++ b/.github/workflows/ptcs-ci.yml @@ -4,9 +4,9 @@ on: pull_request: paths: - '.github/workflows/ptcs-ci.yml' + - 'ptcs/ptcs_bridge/**' - 'ptcs/ptcs_control/**' - 'ptcs/ptcs_server/**' - - 'ptcs/usb_bt_bridge/**' - 'ptcs/.flake8' - 'ptcs/poetry.lock' - 'ptcs/poetry.toml' @@ -45,13 +45,13 @@ jobs: - name: Sort imports run: | - poetry run isort ptcs_control ptcs_server usb_bt_bridge 2>&1 | reviewdog -reporter=github-pr-review -f=isort + poetry run isort ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=isort env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Format run: | - poetry run black ptcs_control ptcs_server usb_bt_bridge 2>&1 | reviewdog -reporter=github-pr-review -f=black + poetry run black ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=black env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -62,12 +62,12 @@ jobs: - name: Lint run: | - poetry run flake8 ptcs_control ptcs_server usb_bt_bridge 2>&1 | reviewdog -reporter=github-pr-review -f=flake8 + poetry run flake8 ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=flake8 env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Typecheck run: | - poetry run mypy ptcs_control ptcs_server usb_bt_bridge 2>&1 | reviewdog -reporter=github-pr-review -f=mypy + poetry run mypy ptcs_bridge ptcs_control ptcs_server 2>&1 | reviewdog -reporter=github-pr-review -f=mypy env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/ptcs/poetry.lock b/ptcs/poetry.lock index 2341717..7d76f14 100644 --- a/ptcs/poetry.lock +++ b/ptcs/poetry.lock @@ -75,6 +75,45 @@ d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] +[[package]] +name = "bleak" +version = "0.21.1" +description = "Bluetooth Low Energy platform Agnostic Klient" +optional = false +python-versions = ">=3.8,<3.13" +files = [ + {file = "bleak-0.21.1-py3-none-any.whl", hash = "sha256:ccec260a0f5ec02dd133d68b0351c0151b2ecf3ddd0bcabc4c04a1cdd7f33256"}, + {file = "bleak-0.21.1.tar.gz", hash = "sha256:ec4a1a2772fb315b992cbaa1153070c7e26968a52b0e2727035f443a1af5c18f"}, +] + +[package.dependencies] +bleak-winrt = {version = ">=1.2.0,<2.0.0", markers = "platform_system == \"Windows\" and python_version < \"3.12\""} +dbus-fast = {version = ">=1.83.0,<3", markers = "platform_system == \"Linux\""} +pyobjc-core = {version = ">=9.2,<10.0", markers = "platform_system == \"Darwin\""} +pyobjc-framework-CoreBluetooth = {version = ">=9.2,<10.0", markers = "platform_system == \"Darwin\""} +pyobjc-framework-libdispatch = {version = ">=9.2,<10.0", markers = "platform_system == \"Darwin\""} +typing-extensions = {version = ">=4.7.0", markers = "python_version < \"3.12\""} + +[[package]] +name = "bleak-winrt" +version = "1.2.0" +description = "Python WinRT bindings for Bleak" +optional = false +python-versions = "*" +files = [ + {file = "bleak-winrt-1.2.0.tar.gz", hash = "sha256:0577d070251b9354fc6c45ffac57e39341ebb08ead014b1bdbd43e211d2ce1d6"}, + {file = "bleak_winrt-1.2.0-cp310-cp310-win32.whl", hash = "sha256:a2ae3054d6843ae0cfd3b94c83293a1dfd5804393977dd69bde91cb5099fc47c"}, + {file = "bleak_winrt-1.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:677df51dc825c6657b3ae94f00bd09b8ab88422b40d6a7bdbf7972a63bc44e9a"}, + {file = "bleak_winrt-1.2.0-cp311-cp311-win32.whl", hash = "sha256:9449cdb942f22c9892bc1ada99e2ccce9bea8a8af1493e81fefb6de2cb3a7b80"}, + {file = "bleak_winrt-1.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:98c1b5a6a6c431ac7f76aa4285b752fe14a1c626bd8a1dfa56f66173ff120bee"}, + {file = "bleak_winrt-1.2.0-cp37-cp37m-win32.whl", hash = "sha256:623ac511696e1f58d83cb9c431e32f613395f2199b3db7f125a3d872cab968a4"}, + {file = "bleak_winrt-1.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:13ab06dec55469cf51a2c187be7b630a7a2922e1ea9ac1998135974a7239b1e3"}, + {file = "bleak_winrt-1.2.0-cp38-cp38-win32.whl", hash = "sha256:5a36ff8cd53068c01a795a75d2c13054ddc5f99ce6de62c1a97cd343fc4d0727"}, + {file = "bleak_winrt-1.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:810c00726653a962256b7acd8edf81ab9e4a3c66e936a342ce4aec7dbd3a7263"}, + {file = "bleak_winrt-1.2.0-cp39-cp39-win32.whl", hash = "sha256:dd740047a08925bde54bec357391fcee595d7b8ca0c74c87170a5cbc3f97aa0a"}, + {file = "bleak_winrt-1.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:63130c11acfe75c504a79c01f9919e87f009f5e742bfc7b7a5c2a9c72bf591a7"}, +] + [[package]] name = "bottle" version = "0.12.25" @@ -201,6 +240,49 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "dbus-fast" +version = "2.11.0" +description = "A faster version of dbus-next" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "dbus_fast-2.11.0-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:dfb83e97a56176dcd5541099999fc89075081c3573ec60a0a6d7b1c4c4c16c15"}, + {file = "dbus_fast-2.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:391d2964e81be47cc387c0a8b424b8e7e93d2f02648c1f216d6bdf0926d65e6f"}, + {file = "dbus_fast-2.11.0-cp310-cp310-manylinux_2_31_x86_64.whl", hash = "sha256:c105cad3b81ed888fae1bfdedc2d39b20f23a5137acb35fa8c9b5b0313ba1a88"}, + {file = "dbus_fast-2.11.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:de486da8a0189326973c87d4cdf52972c0912558070c70cdadfc0848d85fca27"}, + {file = "dbus_fast-2.11.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:cd80ab1b1549680879dd16ab62c097e1db32b71a993cd0c9231a22c66e81fe2c"}, + {file = "dbus_fast-2.11.0-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:dcd2491689f485af0fad27055d0fa36ccba464db24e0bcb4f6bad3f842d74e52"}, + {file = "dbus_fast-2.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82b15059b8d4079246b377b57322ac689fa826ff06bdc42f9f3ea7ff1dcdf928"}, + {file = "dbus_fast-2.11.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:2c84ad3ac3c256e3931ab82a6671f9d00144c126a00db667bef6696ac5188888"}, + {file = "dbus_fast-2.11.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0491fbc4943906c3ca158834495e189402f8e577666080706d812e7e014c02e4"}, + {file = "dbus_fast-2.11.0-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:c2fa4409efe496d32981f9a92018b938b03e196f22c77715adc751340af03439"}, + {file = "dbus_fast-2.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:352b0c0374c78de3d10baf8a67b885ebc0620c20d4d39aab782c506bedc6ce4b"}, + {file = "dbus_fast-2.11.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:09c09700b1d718c864f8a6aa78780e9db265ef27ac944039b7f0337797905997"}, + {file = "dbus_fast-2.11.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cf21710cc4ba0f07602f69cfa14fed0d4552b55e133a32db7cddea838659f8dd"}, + {file = "dbus_fast-2.11.0-cp37-cp37m-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:ee7ad6d3d751c4af5c28e920268e1bf771472f90c283bc9184c08b64049f3fb3"}, + {file = "dbus_fast-2.11.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ced79fcd683070b5f22ec77191ec0312603ab8cab79acecfc13fb6415e4f0498"}, + {file = "dbus_fast-2.11.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e54ef273536b69882c9dedc447a93eb238b3ec455a6f34f5f9e27bd128394be8"}, + {file = "dbus_fast-2.11.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:5c62a397cd1e60a700ad3c6cc3260bb66350835903da1458146d6e5b1346f3fa"}, + {file = "dbus_fast-2.11.0-cp38-cp38-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:a6bfe1fde6ee9c6e54fa22b2feb1901b5a79b863b5e88e7b21f7b2ec8933a7c5"}, + {file = "dbus_fast-2.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e728eaf6e9b3c381cd55dbb19def4d29b2f0e6145c306e03cada36a5ec20cc99"}, + {file = "dbus_fast-2.11.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:714019eb363ae0ebe9fbb1e6265aa167b01b300217b8ec1ea7431e264aebbc85"}, + {file = "dbus_fast-2.11.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:17ce49d9c571e823a74cb3188f5878a3cfc51710960837ea211e05bda28e3a70"}, + {file = "dbus_fast-2.11.0-cp39-cp39-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:c1df70b4a2ba8a342ce54cb4515b9e7d0ff95b9120165f992c55a8b4111e7af5"}, + {file = "dbus_fast-2.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aae338afddb54bfdca239bc7dc5287eb97ec8513c6c94d24a5c4a6462ee00e8d"}, + {file = "dbus_fast-2.11.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:8344531ade66e4c97aa019f455e506fe0493a933ff024bf1cb7676b1331dda2b"}, + {file = "dbus_fast-2.11.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:82d093d0737633ad3b77603fd5125f7bea192e04e864499250d6c0c6fa16a752"}, + {file = "dbus_fast-2.11.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:4412f99d448da28663f1187c7836cd0c3bcbb0b80f4dfa86cfbe1f1d185b3ed5"}, + {file = "dbus_fast-2.11.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c935b3d31028e6b052f0fdc3c4445ed9d2fe613e615d6dca76ece205e76151ca"}, + {file = "dbus_fast-2.11.0-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:b46985b5d7fd49f5bb71a2a140ebf826ca85d72d6c09679dfe028b00fbcd132a"}, + {file = "dbus_fast-2.11.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b906bd53b74c9f8d035d1a959c18ba08560f43062a96f7b3b9d1bea6ef3517c6"}, + {file = "dbus_fast-2.11.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:9e57361ababf5ed4a29f69199b15014e946a3725a92b3cf0c5d2422b90f90581"}, + {file = "dbus_fast-2.11.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc65cfe3e74b799f312fd575a4da8c92e670e2f2f8bc169fb6cad3a1b55e5bed"}, + {file = "dbus_fast-2.11.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:8c9b207b899351e92a817960a8aafd176c78e6fd9fd73677cb67fa3383cd74f4"}, + {file = "dbus_fast-2.11.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:794c5e508ab7e90d06418048ebe8a84f969bf1cf11b74b7617ca5e31fac8c6de"}, + {file = "dbus_fast-2.11.0.tar.gz", hash = "sha256:8ed72cad847fb0c2f39d608276e58476381131deed67847922d372a4c6af4dfc"}, +] + [[package]] name = "fastapi" version = "0.103.1" @@ -597,6 +679,43 @@ files = [ [package.dependencies] pyobjc-core = ">=9.2" +[[package]] +name = "pyobjc-framework-corebluetooth" +version = "9.2" +description = "Wrappers for the framework CoreBluetooth on macOS" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyobjc-framework-CoreBluetooth-9.2.tar.gz", hash = "sha256:cb2481b1dfe211ae9ce55f36537dc8155dbf0dc8ff26e0bc2e13f7afb0a291d1"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_10_9_universal2.whl", hash = "sha256:53d888742119d0f0c725d0b0c2389f68e8f21f0cba6d6aec288c53260a0196b6"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:179532882126526e38fe716a50fb0ee8f440e0b838d290252c515e622b5d0e49"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_11_0_universal2.whl", hash = "sha256:256a5031ea9d8a7406541fa1b0dfac549b1de93deae8284605f9355b13fb58be"}, +] + +[package.dependencies] +pyobjc-core = ">=9.2" +pyobjc-framework-Cocoa = ">=9.2" + +[[package]] +name = "pyobjc-framework-libdispatch" +version = "9.2" +description = "Wrappers for libdispatch on macOS" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyobjc-framework-libdispatch-9.2.tar.gz", hash = "sha256:542e7f7c2b041939db5ed6f3119c1d67d73ec14a996278b92485f8513039c168"}, + {file = "pyobjc_framework_libdispatch-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:88d4091d4bcb5702783d6e86b4107db973425a17d1de491543f56bd348909b60"}, + {file = "pyobjc_framework_libdispatch-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1a67b007113328538b57893cc7829a722270764cdbeae6d5e1460a1d911314df"}, + {file = "pyobjc_framework_libdispatch-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:6fccea1a57436cf1ac50d9ebc6e3e725bcf77f829ba6b118e62e6ed7866d359d"}, + {file = "pyobjc_framework_libdispatch-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6eba747b7ad91b0463265a7aee59235bb051fb97687f35ca2233690369b5e4e4"}, + {file = "pyobjc_framework_libdispatch-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2e835495860d04f63c2d2f73ae3dd79da4222864c107096dc0f99e8382700026"}, + {file = "pyobjc_framework_libdispatch-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1b107e5c3580b09553030961ea6b17abad4a5132101eab1af3ad2cb36d0f08bb"}, + {file = "pyobjc_framework_libdispatch-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:83cdb672acf722717b5ecf004768f215f02ac02d7f7f2a9703da6e921ab02222"}, +] + +[package.dependencies] +pyobjc-core = ">=9.2" + [[package]] name = "pyobjc-framework-security" version = "9.2" @@ -780,4 +899,4 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.12" -content-hash = "6fc12ba8290a62f377a2f6efcaed23c8c05f287bb3d5e400ab1876610496a465" +content-hash = "06aad94ec42505439fecc79c1e1cc8dc201f18d9fa38a600cdb66e3c2f4c702f" diff --git a/ptcs/usb_bt_bridge/README.md b/ptcs/ptcs_bridge/README.md similarity index 100% rename from ptcs/usb_bt_bridge/README.md rename to ptcs/ptcs_bridge/README.md diff --git a/ptcs/ptcs_bridge/__init__.py b/ptcs/ptcs_bridge/__init__.py new file mode 100644 index 0000000..ace7c10 --- /dev/null +++ b/ptcs/ptcs_bridge/__init__.py @@ -0,0 +1,7 @@ +import logging + +logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) +handler = logging.StreamHandler() +handler.setFormatter(logging.Formatter("[%(levelname)-8s] %(message)s")) +logger.addHandler(handler) diff --git a/ptcs/usb_bt_bridge/bridge.py b/ptcs/ptcs_bridge/bridge.py similarity index 100% rename from ptcs/usb_bt_bridge/bridge.py rename to ptcs/ptcs_bridge/bridge.py diff --git a/ptcs/ptcs_bridge/bridge2.py b/ptcs/ptcs_bridge/bridge2.py new file mode 100644 index 0000000..db11549 --- /dev/null +++ b/ptcs/ptcs_bridge/bridge2.py @@ -0,0 +1,20 @@ +import asyncio + +from .train_base import TrainBase + + +class Bridge2: + trains: dict[str, TrainBase] + + def __init__(self) -> None: + self.trains = {} + + def add_train(self, train: TrainBase) -> None: + assert train.id not in self.trains + self.trains[train.id] = train + + async def connect_all(self) -> None: + await asyncio.gather(*(train.connect() for train in self.trains.values())) + + async def disconnect_all(self) -> None: + await asyncio.gather(*(train.disconnect() for train in self.trains.values())) diff --git a/ptcs/usb_bt_bridge/receiver/receiver.ino b/ptcs/ptcs_bridge/receiver/receiver.ino similarity index 100% rename from ptcs/usb_bt_bridge/receiver/receiver.ino rename to ptcs/ptcs_bridge/receiver/receiver.ino diff --git a/ptcs/usb_bt_bridge/send_receive.py b/ptcs/ptcs_bridge/send_receive.py similarity index 100% rename from ptcs/usb_bt_bridge/send_receive.py rename to ptcs/ptcs_bridge/send_receive.py diff --git a/ptcs/ptcs_bridge/train_base.py b/ptcs/ptcs_bridge/train_base.py new file mode 100644 index 0000000..c27eefa --- /dev/null +++ b/ptcs/ptcs_bridge/train_base.py @@ -0,0 +1,23 @@ +from typing import Callable + +NotifyPositionIdCallback = Callable[["TrainBase", int], None] +NotifyRotationCallback = Callable[["TrainBase", int], None] + + +class TrainBase: + id: str + + async def connect(self) -> None: + raise NotImplementedError() + + async def disconnect(self) -> None: + raise NotImplementedError() + + async def send_speed(self, speed: int) -> None: + raise NotImplementedError() + + async def start_notify_position_id(self, callback: NotifyPositionIdCallback) -> None: + raise NotImplementedError() + + async def start_notify_rotation(self, callback: NotifyRotationCallback) -> None: + raise NotImplementedError() diff --git a/ptcs/ptcs_bridge/train_client.py b/ptcs/ptcs_bridge/train_client.py new file mode 100644 index 0000000..85b8e7f --- /dev/null +++ b/ptcs/ptcs_bridge/train_client.py @@ -0,0 +1,82 @@ +import logging +from uuid import UUID + +from bleak import BleakClient +from bleak.backends.characteristic import BleakGATTCharacteristic +from bleak.backends.service import BleakGATTService + +from .train_base import NotifyPositionIdCallback, NotifyRotationCallback, TrainBase + +SERVICE_UUID = UUID("63cb613b-6562-4aa5-b602-030f103834a4") +CHARACTERISTIC_MOTOR_INPUT_UUID = UUID("88c9d9ae-bd53-4ab3-9f42-b3547575a743") +CHARACTERISTIC_POSITION_ID_UUID = UUID("8bcd68d5-78ca-c1c3-d1ba-96d527ce8968") +CHARACTERISTIC_ROTATION_UUID = UUID("aab17457-2755-8b50-caa1-432ff553d533") + + +logger = logging.getLogger(__name__) + + +class TrainClient(TrainBase): + id: str + _client: BleakClient + + def __init__(self, id: str, address: str) -> None: + self.id = id + self._client = BleakClient(address) + + def __str__(self) -> str: + return f"TrainClient({self.id}, {self._client.address})" + + async def connect(self) -> None: + await self._client.connect() + logger.info("%s connected", self) + + async def disconnect(self) -> None: + await self._client.disconnect() + logger.info("%s disconnected", self) + + def _get_service(self) -> BleakGATTService: + service = self._client.services.get_service(SERVICE_UUID) + assert service is not None + return service + + def _get_characteristic(self, uuid: UUID) -> BleakGATTCharacteristic: + service = self._get_service() + characteristic = service.get_characteristic(uuid) + assert characteristic is not None + return characteristic + + def _get_characteristic_motor_input(self) -> BleakGATTCharacteristic: + return self._get_characteristic(CHARACTERISTIC_MOTOR_INPUT_UUID) + + def _get_characteristic_position_id(self) -> BleakGATTCharacteristic: + return self._get_characteristic(CHARACTERISTIC_POSITION_ID_UUID) + + def _get_characteristic_rotation(self) -> BleakGATTCharacteristic: + return self._get_characteristic(CHARACTERISTIC_ROTATION_UUID) + + async def send_speed(self, speed: int) -> None: + assert 0 <= speed <= 255 + characteristic_speed = self._get_characteristic_motor_input() + await self._client.write_gatt_char(characteristic_speed, bytes([speed])) + logger.info("%s send speed %s", self, speed) + + async def start_notify_position_id(self, callback: NotifyPositionIdCallback) -> None: + def wrapped_callback(_characteristic: BleakGATTCharacteristic, data: bytearray): + assert len(data) == 1 + position_id = data[0] + logger.info("%s notify position id %s", self, position_id) + callback(self, position_id) + + characteristic_position_id = self._get_characteristic_position_id() + await self._client.start_notify(characteristic_position_id, wrapped_callback) + + async def start_notify_rotation(self, callback: NotifyRotationCallback) -> None: + def wrapped_callback(_characteristic: BleakGATTCharacteristic, data: bytearray): + assert len(data) == 1 + assert data[0] == 1 + logger.info("%s notify rotation %s", self, 1) + callback(self, 1) + + characteristic_rotation = self._get_characteristic_rotation() + await self._client.start_notify(characteristic_rotation, wrapped_callback) diff --git a/ptcs/ptcs_bridge/train_simulator.py b/ptcs/ptcs_bridge/train_simulator.py new file mode 100644 index 0000000..69eb85a --- /dev/null +++ b/ptcs/ptcs_bridge/train_simulator.py @@ -0,0 +1,125 @@ +import asyncio +import logging +import math + +from .train_base import NotifyPositionIdCallback, NotifyRotationCallback, TrainBase + +logger = logging.getLogger(__name__) + +_background_tasks: set[asyncio.Task] = set() + + +class TrainSimulator(TrainBase): + """ + BLE 通信を行わず、列車への速度指令とモーター回転通知をシミュレーションする。 + """ + + id: str + _current_speed_cm_s: float + _target_speed_cm_s: float + _total_rotation: float + _task: asyncio.Task | None + _notify_rotation_callback: NotifyRotationCallback | None + + INTERVAL_SECONDS = 0.1 + INPUT_TO_CENTIMETERS_PER_SECOND = 30.0 / 255 + WHEEL_PERIMETER_CENTIMETERS = 2.4 * math.pi + GEAR_RATIO = 175 / 8448 + + def __init__(self, id: str) -> None: + self.id = id + self._current_speed_cm_s = 0.0 + self._target_speed_cm_s = 0.0 + self._total_rotation = 0.0 + self._task = None + self._notify_rotation_callback = None + + def __str__(self) -> str: + return f"TrainSimulator({self.id})" + + async def _loop(self): + while True: + await asyncio.sleep(self.INTERVAL_SECONDS) + + # とりあえず簡単に、即座に指令速度に変わるものとする + prev_speed_cm_s = self._current_speed_cm_s + self._current_speed_cm_s = self._target_speed_cm_s + + delta_cm = (prev_speed_cm_s + self._current_speed_cm_s) / 2 * self.INTERVAL_SECONDS + + prev_total_rotation = self._total_rotation + self._total_rotation += delta_cm / self.WHEEL_PERIMETER_CENTIMETERS / self.GEAR_RATIO + + rotation = math.floor(self._total_rotation) - math.floor(prev_total_rotation) + + if self._notify_rotation_callback is not None: + for _ in range(rotation): + logger.info("%s notify rotation %s", self, 1) + self._notify_rotation_callback(self, 1) + + async def connect(self) -> None: + assert self._task is None + task = asyncio.create_task(self._loop()) + _background_tasks.add(task) + task.add_done_callback(_background_tasks.discard) + self._task = task + logger.info("%s connected", self) + + async def disconnect(self) -> None: + assert self._task is not None + self._task.cancel() + self._task = None + logger.info("%s disconnected", self) + + async def send_speed(self, speed: int) -> None: + assert 0 <= speed <= 255 + self._target_speed_cm_s = speed * self.INPUT_TO_CENTIMETERS_PER_SECOND + logger.info("%s send speed %s", self, speed) + + async def start_notify_position_id(self, callback: NotifyPositionIdCallback) -> None: + raise NotImplementedError() + + async def start_notify_rotation(self, callback: NotifyRotationCallback) -> None: + self._notify_rotation_callback = callback + + +async def main(): + t0 = TrainSimulator("t0") + t1 = TrainSimulator("t1") + await t0.connect() + await t1.connect() + + def handle_rotation(train: TrainSimulator, _rotation: int): + print(f"{train} rotated!") + + await t0.start_notify_rotation(handle_rotation) + await t1.start_notify_rotation(handle_rotation) + + await asyncio.sleep(1.0) + await t0.send_speed(40) + await asyncio.sleep(1.0) + await t0.send_speed(80) + await asyncio.sleep(1.0) + await t0.send_speed(120) + await asyncio.sleep(1.0) + await t0.send_speed(160) + await asyncio.sleep(1.0) + await t0.send_speed(200) + await asyncio.sleep(10.0) + await t0.send_speed(0) + await asyncio.sleep(5.0) + + await t0.disconnect() + await t1.disconnect() + + +if __name__ == "__main__": + logger = logging.getLogger(__name__) + logger.setLevel(logging.INFO) + handler = logging.StreamHandler() + handler.setFormatter(logging.Formatter("[%(levelname)-8s] %(message)s")) + logger.addHandler(handler) + + loop = asyncio.get_event_loop() + loop.create_task(main()) + loop.run_forever() diff --git a/ptcs/ptcs_client/dist/models/TrainState.ts b/ptcs/ptcs_client/dist/models/TrainState.ts index 497ce2f..77b1789 100644 --- a/ptcs/ptcs_client/dist/models/TrainState.ts +++ b/ptcs/ptcs_client/dist/models/TrainState.ts @@ -9,8 +9,11 @@ export type TrainState = { min_input: number; max_input: number; max_speed: number; + length: number; delta_per_motor_rotation: number; - position: DirectedPosition; + head_position: DirectedPosition; + tail_position: DirectedPosition; + covered_section_ids: Array; stop_id: (string | null); stop_distance: number; departure_time: (number | null); diff --git a/ptcs/ptcs_control/components/base.py b/ptcs/ptcs_control/components/base.py index 84d409d..42c63c5 100644 --- a/ptcs/ptcs_control/components/base.py +++ b/ptcs/ptcs_control/components/base.py @@ -1,5 +1,6 @@ from __future__ import annotations +from abc import ABC from dataclasses import dataclass, field from typing import TYPE_CHECKING @@ -8,9 +9,13 @@ @dataclass -class BaseComponent: +class BaseComponent(ABC): + id: str _control: Control | None = field(default=None, init=False) + def __str__(self) -> str: + return f"{self.__class__.__name__}({self.id})" + def verify(self) -> None: assert self._control is not None diff --git a/ptcs/ptcs_control/components/junction.py b/ptcs/ptcs_control/components/junction.py index 09077dc..f0f722f 100644 --- a/ptcs/ptcs_control/components/junction.py +++ b/ptcs/ptcs_control/components/junction.py @@ -81,17 +81,16 @@ def is_toggle_prohibited(self) -> bool: ジャンクションを列車が通過中であり、切り替えてはいけない場合に `True` を返す。 """ - MERGIN: float = 40 # ポイント通過後すぐに切り替えるとまずいので余裕距離をとる - TRAIN_LENGTH: float = 60 # 列車の長さ[cm] NOTE: 将来的には車両等のパラメータとして外に出す + MERGIN: float = 40.0 # ポイント通過後すぐに切り替えるとまずいので余裕距離をとる for train in self.control.trains.values(): # 列車の最後尾からMERGIN離れた位置(tail)を取得 - tail_position = train.position.get_retracted_position(TRAIN_LENGTH + MERGIN) + tail_position = train.head_position.get_retracted_position(train.length + MERGIN) # 列車の先頭は指定されたjunctionに向かっていないが、 # 列車の最後尾は指定されたjunctionに向かっている場合、 # 列車はそのjunctinoを通過中なので、切り替えを禁止する - if train.position.target_junction != self and tail_position.target_junction == self: + if train.head_position.target_junction != self and tail_position.target_junction == self: return True return False # 誰も通過していなければFalseを返す diff --git a/ptcs/ptcs_control/components/position.py b/ptcs/ptcs_control/components/position.py index 53cf335..81fb785 100644 --- a/ptcs/ptcs_control/components/position.py +++ b/ptcs/ptcs_control/components/position.py @@ -62,3 +62,55 @@ def get_retracted_position(self, delta: float) -> DirectedPosition: """ return self.get_reversed().get_advanced_position(delta).get_reversed() + + def get_advanced_position_with_path(self, delta: float) -> tuple[DirectedPosition, list[Section]]: + """ + 現在の位置と方向から距離 `delta` 分だけ進んだ位置と方向を計算し、 + そこまでに通過したセクションとともに返す。 + """ + + path: list[Section] = [] + + section = self.section + target_junction = self.target_junction + mileage = self.mileage + + if target_junction == section.connected_junctions[SectionConnection.B]: + mileage += delta + elif target_junction == section.connected_junctions[SectionConnection.A]: + mileage -= delta + else: + raise + + while mileage > section.length or mileage < 0: + if mileage > section.length: + surplus_mileage = mileage - section.length + elif mileage < 0: + surplus_mileage = -mileage + else: + raise + + section, target_junction = section.get_next_section_and_target_junction(target_junction) + + if target_junction == section.connected_junctions[SectionConnection.B]: + mileage = surplus_mileage + elif target_junction == section.connected_junctions[SectionConnection.A]: + mileage = section.length - surplus_mileage + else: + raise + + path.append(section) + + if path: + path.pop() + + return DirectedPosition(section, target_junction, mileage), path + + def get_retracted_position_with_path(self, delta: float) -> tuple[DirectedPosition, list[Section]]: + """ + 現在の位置と方向から距離 `delta` 分だけ退いた位置と方向を計算し、 + そこまでに通過したセクションとともに返す。 + """ + + position, path = self.get_reversed().get_advanced_position_with_path(delta) + return position.get_reversed(), list(reversed(path)) diff --git a/ptcs/ptcs_control/components/sensor_position.py b/ptcs/ptcs_control/components/sensor_position.py index afc18eb..8734d75 100644 --- a/ptcs/ptcs_control/components/sensor_position.py +++ b/ptcs/ptcs_control/components/sensor_position.py @@ -26,3 +26,8 @@ class SensorPosition(BaseComponent): 具体的には、通った向きがわかるようなセンシング技術を用いるか、 計算で向きを予測するか(限界はある)のどちらか。 """ + + def verify(self) -> None: + super().verify() + assert self.target_junction in self.section.connected_junctions.values(), f"{self}.target_junction is wrong" + assert 0 <= self.mileage <= self.section.length, f"{self}.length is wrong" diff --git a/ptcs/ptcs_control/components/stop.py b/ptcs/ptcs_control/components/stop.py index 342b523..bb7bd1c 100644 --- a/ptcs/ptcs_control/components/stop.py +++ b/ptcs/ptcs_control/components/stop.py @@ -17,3 +17,10 @@ class Stop(BaseComponent): # config position: DirectedPosition + + def verify(self) -> None: + super().verify() + assert ( + self.position.target_junction in self.position.section.connected_junctions.values() + ), f"{self}.position.target_junction is wrong" + assert 0 <= self.position.mileage <= self.position.section.length, f"{self}.position.length is wrong" diff --git a/ptcs/ptcs_control/components/train.py b/ptcs/ptcs_control/components/train.py index 7fc72b3..36bb873 100644 --- a/ptcs/ptcs_control/components/train.py +++ b/ptcs/ptcs_control/components/train.py @@ -25,10 +25,11 @@ class Train(BaseComponent): min_input: int max_input: int max_speed: float + length: float # 列車の長さ[cm] delta_per_motor_rotation: float # モータ1回転で進む距離[cm] # state - position: DirectedPosition # 位置と方向 + head_position: DirectedPosition # 列車先頭の位置と方向 stop: Stop | None = field(default=None) # 列車の停止目標 stop_distance: float = field(default=0.0) # 停止目標までの距離[cm] departure_time: int | None = field(default=None) # 発車予定時刻 @@ -36,6 +37,15 @@ class Train(BaseComponent): # commands speed_command: float = field(default=0.0) # 速度指令値 + def verify(self) -> None: + super().verify() + assert ( + self.head_position.target_junction in self.head_position.section.connected_junctions.values() + ), f"{self}.head_position.target_junction is wrong" + assert ( + 0 <= self.head_position.mileage <= self.head_position.section.length + ), f"{self}.head_position.length is wrong" + def calc_input(self, speed: float) -> int: if speed > self.max_speed: return self.max_input @@ -56,7 +66,7 @@ def move_forward(self, delta: float) -> None: 列車を距離 delta 分だけ進める。 """ - self.position = self.position.get_advanced_position(delta) + self.head_position = self.head_position.get_advanced_position(delta) def fix_position(self, sensor: SensorPosition) -> None: """ @@ -64,7 +74,7 @@ def fix_position(self, sensor: SensorPosition) -> None: TODO: 向きを割り出すためにどうするか """ - self.position = DirectedPosition(sensor.section, sensor.target_junction, sensor.mileage) + self.head_position = DirectedPosition(sensor.section, sensor.target_junction, sensor.mileage) def send_speed_command(self, speed_command: float) -> None: """ @@ -80,9 +90,7 @@ def find_forward_train(self) -> tuple[Train, float] | None: ジャンクションの開通方向によっては先行列車に到達できない場合があり、そのときはNoneを返す。 """ - TRAIN_LENGTH: float = 60 # 列車の長さ[cm] NOTE:将来的には車両のパラメータとして定義 - - section = self.position.section + section = self.head_position.section forward_train: Train | None = None forward_train_distance: float = 99999999 # ありえない大きな値 @@ -91,18 +99,18 @@ def find_forward_train(self) -> tuple[Train, float] | None: # 指定された列車の前方にいる列車のうち、最も近いもの`forward_train`を取得 for other_train in self.control.trains.values(): - if other_train.position.section == self.position.section: + if other_train.head_position.section == self.head_position.section: if other_train != self: if ( # 端点A(target_junction)<---|other_train|--train---<端点B - self.position.target_junction == section.connected_junctions[SectionConnection.A] - and self.position.mileage <= self.position.mileage + self.head_position.target_junction == section.connected_junctions[SectionConnection.A] + and self.head_position.mileage <= self.head_position.mileage ) or ( # 端点A>---train--|other_train|--->端点B(target_junction) - self.position.target_junction == section.connected_junctions[SectionConnection.B] - and self.position.mileage <= other_train.position.mileage + self.head_position.target_junction == section.connected_junctions[SectionConnection.B] + and self.head_position.mileage <= other_train.head_position.mileage ): - distance = abs(self.position.mileage - other_train.position.mileage) + distance = abs(self.head_position.mileage - other_train.head_position.mileage) if distance < forward_train_distance: forward_train = other_train forward_train_distance = distance @@ -110,13 +118,13 @@ def find_forward_train(self) -> tuple[Train, float] | None: # 指定された列車と同一セクションに先行列車が存在しなければ次のセクションに移り、 # 先行列車が見つかるまで繰り返す - section = self.position.section - target_junction = self.position.target_junction + section = self.head_position.section + target_junction = self.head_position.target_junction - if self.position.target_junction == section.connected_junctions[SectionConnection.A]: - distance = self.position.mileage - elif self.position.target_junction == section.connected_junctions[SectionConnection.B]: - distance = section.length - self.position.mileage + if self.head_position.target_junction == section.connected_junctions[SectionConnection.A]: + distance = self.head_position.mileage + elif self.head_position.target_junction == section.connected_junctions[SectionConnection.B]: + distance = section.length - self.head_position.mileage else: raise @@ -127,13 +135,13 @@ def find_forward_train(self) -> tuple[Train, float] | None: section, target_junction = next_section_and_junction for other_train in self.control.trains.values(): - if other_train.position.section == section: + if other_train.head_position.section == section: # 端点A(target_junction)<---|other_train|-----<端点B if target_junction == section.connected_junctions[SectionConnection.A]: - new_distance = distance + section.length - other_train.position.mileage + new_distance = distance + section.length - other_train.head_position.mileage # 端点A>-----|other_train|--->端点B(target_junction) elif target_junction == section.connected_junctions[SectionConnection.B]: - new_distance = distance + other_train.position.mileage + new_distance = distance + other_train.head_position.mileage else: raise @@ -147,7 +155,7 @@ def find_forward_train(self) -> tuple[Train, float] | None: # 先行列車を発見できたら、その最後尾までの距離を計算し、返す if forward_train: - return (forward_train, forward_train_distance - TRAIN_LENGTH) + return forward_train, forward_train_distance - forward_train.length else: return None @@ -158,7 +166,7 @@ def find_forward_stop(self) -> tuple[Stop, float] | None: NOTE: `find_forward_train` とほぼ同じアルゴリズム """ - section = self.position.section + section = self.head_position.section forward_stop: Stop | None = None forward_stop_distance: float = 99999999 # ありえない大きな値 @@ -168,19 +176,19 @@ def find_forward_stop(self) -> tuple[Stop, float] | None: for stop in self.control.stops.values(): if ( - stop.position.section == self.position.section - and stop.position.target_junction == self.position.target_junction + stop.position.section == self.head_position.section + and stop.position.target_junction == self.head_position.target_junction ): if ( # 端点A(target_junction)<---|stop|--train---<端点B - self.position.target_junction == section.connected_junctions[SectionConnection.A] - and stop.position.mileage <= self.position.mileage + self.head_position.target_junction == section.connected_junctions[SectionConnection.A] + and stop.position.mileage <= self.head_position.mileage ) or ( # 端点A>---train--|stop|--->端点B(target_junction) - self.position.target_junction == section.connected_junctions[SectionConnection.B] - and self.position.mileage <= stop.position.mileage + self.head_position.target_junction == section.connected_junctions[SectionConnection.B] + and self.head_position.mileage <= stop.position.mileage ): - distance = abs(self.position.mileage - stop.position.mileage) + distance = abs(self.head_position.mileage - stop.position.mileage) if distance < forward_stop_distance: forward_stop = stop forward_stop_distance = distance @@ -188,13 +196,13 @@ def find_forward_stop(self) -> tuple[Stop, float] | None: # 指定された列車と同一セクションに停止位置が存在しなければ次のセクションに移り、 # 停止位置が見つかるまで繰り返す - section = self.position.section - target_junction = self.position.target_junction + section = self.head_position.section + target_junction = self.head_position.target_junction - if self.position.target_junction == section.connected_junctions[SectionConnection.A]: - distance = self.position.mileage - elif self.position.target_junction == section.connected_junctions[SectionConnection.B]: - distance = section.length - self.position.mileage + if self.head_position.target_junction == section.connected_junctions[SectionConnection.A]: + distance = self.head_position.mileage + elif self.head_position.target_junction == section.connected_junctions[SectionConnection.B]: + distance = section.length - self.head_position.mileage else: raise @@ -234,6 +242,6 @@ def find_forward_stop(self) -> tuple[Stop, float] | None: # 停止目標を発見できたら、そこまでの距離とともに返す if forward_stop: - return (forward_stop, forward_stop_distance) + return forward_stop, forward_stop_distance else: return None diff --git a/ptcs/ptcs_control/constants.py b/ptcs/ptcs_control/constants.py index c03d2b5..e5b3c03 100644 --- a/ptcs/ptcs_control/constants.py +++ b/ptcs/ptcs_control/constants.py @@ -1,7 +1,9 @@ STRAIGHT_RAIL = 21.50 # 直線レール [cm] +STRAIGHT_1_2_RAIL = 10.70 # 1/2直線レール [cm] STRAIGHT_1_4_RAIL = 5.30 # 1/4直線レール [cm] STRAIGHT_1_6_RAIL = 3.65 # 1/6直線レール [cm] CURVE_RAIL = 16.90 # 曲線レール [cm] +OUTER_CURVE_RAIL = 21.60 # 複線外側曲線レール [cm] U_TURN_RAIL = 101.00 # Uターンレール [cm] WATARI_RAIL_A = 18.50 # 複線わたりポイントレール直線部(長) [cm] WATARI_RAIL_B = 3.00 # 複線わたりポイントレール直線部(短) [cm] diff --git a/ptcs/ptcs_control/control.py b/ptcs/ptcs_control/control.py index b7f45b5..7ceaabc 100644 --- a/ptcs/ptcs_control/control.py +++ b/ptcs/ptcs_control/control.py @@ -118,6 +118,11 @@ def _calc_direction(self) -> None: ポイントをどちら向きにするかを計算する。 """ + for junction in self.junctions.values(): + if not junction.is_toggle_prohibited(): + junction.set_direction(junction.direction_command) + return + # junction定義 j0a = self.junctions["j0"] j0b = self.junctions["j1"] @@ -169,13 +174,13 @@ def _calc_direction(self) -> None: # s5にtrainが存在するか s5_exist: bool = False for train in self.trains.values(): - if train.position.section == s1 and train.position.target_junction == j0b: + if train.head_position.section == s1 and train.head_position.target_junction == j0b: s1_j0b_exist = True - if train.position.section == s1 and train.position.target_junction == j1b: + if train.head_position.section == s1 and train.head_position.target_junction == j1b: s1_j1b_exist = True - if train.position.section == s4: + if train.head_position.section == s4: s4_exist = True - if train.position.section == s5: + if train.head_position.section == s5: s5_exist = True # ポイントの向きを判定 @@ -215,15 +220,15 @@ def _calc_speed(self) -> None: distance = 0.0 - current_section = train.position.section - target_junction = train.position.target_junction + current_section = train.head_position.section + target_junction = train.head_position.target_junction while True: next_section, next_junction = current_section.get_next_section_and_target_junction(target_junction) # いま見ているセクションが閉鎖 -> 即時停止 # ただしすでに列車が閉鎖セクションに入ってしまった場合は、駅まで動かしたいので、止めない - if current_section != train.position.section and current_section.is_blocked is True: + if current_section != train.head_position.section and current_section.is_blocked is True: distance += 0 break @@ -238,11 +243,11 @@ def _calc_speed(self) -> None: current_section.get_next_section_and_target_junction_strict(target_junction) is None or next_section.is_blocked is True ): - if current_section == train.position.section: + if current_section == train.head_position.section: if target_junction == current_section.connected_junctions[SectionConnection.A]: - distance += train.position.mileage - MERGIN + distance += train.head_position.mileage - MERGIN elif target_junction == current_section.connected_junctions[SectionConnection.B]: - distance += current_section.length - train.position.mileage - MERGIN + distance += current_section.length - train.head_position.mileage - MERGIN else: raise else: @@ -261,11 +266,17 @@ def _calc_speed(self) -> None: # 停止条件を満たさなければ次に移る else: - if current_section == train.position.section: - if train.position.target_junction == current_section.connected_junctions[SectionConnection.A]: - distance += train.position.mileage - elif train.position.target_junction == current_section.connected_junctions[SectionConnection.B]: - distance += current_section.length - train.position.mileage + if current_section == train.head_position.section: + if ( + train.head_position.target_junction + == current_section.connected_junctions[SectionConnection.A] + ): + distance += train.head_position.mileage + elif ( + train.head_position.target_junction + == current_section.connected_junctions[SectionConnection.B] + ): + distance += current_section.length - train.head_position.mileage else: raise else: diff --git a/ptcs/ptcs_control/mft2023.py b/ptcs/ptcs_control/mft2023.py index 23e7dc9..46a1b20 100644 --- a/ptcs/ptcs_control/mft2023.py +++ b/ptcs/ptcs_control/mft2023.py @@ -9,6 +9,8 @@ from .components.train import Train from .constants import ( CURVE_RAIL, + OUTER_CURVE_RAIL, + STRAIGHT_1_2_RAIL, STRAIGHT_1_4_RAIL, STRAIGHT_RAIL, WATARI_RAIL_A, @@ -36,23 +38,41 @@ def create_control(logger: logging.Logger | None = None) -> Control: s0 = Section( id="s0", - length=WATARI_RAIL_B * 1 + STRAIGHT_RAIL * 14 + CURVE_RAIL * 8 + STRAIGHT_1_4_RAIL * 1 + WATARI_RAIL_A * 1, + length=WATARI_RAIL_A + 7.03 + STRAIGHT_RAIL + CURVE_RAIL + STRAIGHT_RAIL + WATARI_RAIL_A, ) s1 = Section( id="s1", - length=STRAIGHT_RAIL * 3 + WATARI_RAIL_B * 2, + length=WATARI_RAIL_B + + STRAIGHT_RAIL * 4 + + CURVE_RAIL * 3 + + STRAIGHT_RAIL * 4 + + CURVE_RAIL + + STRAIGHT_RAIL * 2 + + 3.67 + + CURVE_RAIL * 2 + + STRAIGHT_1_2_RAIL + + WATARI_RAIL_B, ) s2 = Section( id="s2", - length=WATARI_RAIL_A * 1 + STRAIGHT_RAIL * 6 + CURVE_RAIL * 8 + STRAIGHT_1_4_RAIL * 1 + WATARI_RAIL_B * 1, + length=WATARI_RAIL_B + 4.70 + OUTER_CURVE_RAIL * 2 + WATARI_RAIL_B, ) s3 = Section( id="s3", - length=WATARI_RAIL_A * 2 + STRAIGHT_RAIL * 3, + length=WATARI_RAIL_A + + STRAIGHT_RAIL * 2 + + OUTER_CURVE_RAIL * 2 + + STRAIGHT_RAIL * 2 + + STRAIGHT_1_2_RAIL + + OUTER_CURVE_RAIL * 2 + + STRAIGHT_RAIL * 3 + + OUTER_CURVE_RAIL * 2 + + 6.01 + + WATARI_RAIL_A, ) s4 = Section( id="s4", - length=WATARI_RAIL_C, + length=WATARI_RAIL_C + WATARI_RAIL_C, ) s5 = Section( id="s5", @@ -90,8 +110,9 @@ def create_control(logger: logging.Logger | None = None) -> Control: min_input=70, max_input=130, max_speed=40.0, + length=60.0, delta_per_motor_rotation=0.2435 * 0.9, - position=DirectedPosition( + head_position=DirectedPosition( section=s0, target_junction=j3, mileage=STRAIGHT_RAIL * 4.5 + WATARI_RAIL_B + 1, # 次駅探索の都合上、stopを1cm通り過ぎた場所にしておく @@ -102,8 +123,9 @@ def create_control(logger: logging.Logger | None = None) -> Control: min_input=90, max_input=130, max_speed=40.0, + length=60.0, delta_per_motor_rotation=0.1919 * 1.1 * 0.9, - position=DirectedPosition( + head_position=DirectedPosition( section=s1, target_junction=j0, mileage=STRAIGHT_RAIL * 2.5 + WATARI_RAIL_B + 1, @@ -155,17 +177,17 @@ def create_control(logger: logging.Logger | None = None) -> Control: ), ) - control.add_stop(stop_0) - control.add_stop(stop_1) - control.add_stop(stop_2) - control.add_stop(stop_3) - control.add_stop(stop_4) + # control.add_stop(stop_0) + # control.add_stop(stop_1) + # control.add_stop(stop_2) + # control.add_stop(stop_3) + # control.add_stop(stop_4) station_0 = Station(id="station_0", stops=[stop_0, stop_1]) station_1 = Station(id="station_1", stops=[stop_2, stop_3, stop_4]) - control.add_station(station_0) - control.add_station(station_1) + # control.add_station(station_0) + # control.add_station(station_1) position_173 = SensorPosition( id="position_173", @@ -192,10 +214,10 @@ def create_control(logger: logging.Logger | None = None) -> Control: mileage=WATARI_RAIL_A * 1 + STRAIGHT_RAIL * 5.5 + CURVE_RAIL * 8 + STRAIGHT_1_4_RAIL * 1, ) - control.add_sensor_position(position_173) - control.add_sensor_position(position_138) - control.add_sensor_position(position_80) - control.add_sensor_position(position_255) + # control.add_sensor_position(position_173) + # control.add_sensor_position(position_138) + # control.add_sensor_position(position_80) + # control.add_sensor_position(position_255) control.verify() return control diff --git a/ptcs/ptcs_server/api.py b/ptcs/ptcs_server/api.py index e2ce6e4..d0a862e 100644 --- a/ptcs/ptcs_server/api.py +++ b/ptcs/ptcs_server/api.py @@ -65,7 +65,7 @@ def update_junction(junction_id: str, params: UpdateJunctionParams, request: Req """ control: Control = request.app.state.control junction = control.junctions[junction_id] - junction.set_direction(params.direction) + junction.direction_command = params.direction @api_router.post("/state/sections/{section_id}/block") diff --git a/ptcs/ptcs_server/bridges.py b/ptcs/ptcs_server/bridges.py index 8597f75..37837f9 100644 --- a/ptcs/ptcs_server/bridges.py +++ b/ptcs/ptcs_server/bridges.py @@ -6,8 +6,8 @@ import serial.tools.list_ports +from ptcs_bridge.bridge import Bridge from ptcs_control.components.sensor_position import SensorPosition -from usb_bt_bridge.bridge import Bridge BridgeTarget = str BridgeDict = dict[BridgeTarget, Bridge] diff --git a/ptcs/ptcs_server/server.py b/ptcs/ptcs_server/server.py index 4c1582d..3adc9de 100644 --- a/ptcs/ptcs_server/server.py +++ b/ptcs/ptcs_server/server.py @@ -1,3 +1,4 @@ +import asyncio import logging import os import threading @@ -9,9 +10,12 @@ from fastapi.staticfiles import StaticFiles from pydantic import BaseModel +from ptcs_bridge.bridge import Bridge +from ptcs_bridge.bridge2 import Bridge2 +from ptcs_bridge.train_base import TrainBase +from ptcs_bridge.train_simulator import TrainSimulator from ptcs_control.control import Control from ptcs_control.mft2023 import create_control -from usb_bt_bridge import Bridge from .api import api_router from .bridges import BridgeManager, BridgeTarget @@ -45,27 +49,54 @@ def create_app() -> FastAPI: def create_app_without_bridge() -> FastAPI: logger = logging.getLogger("uvicorn") + app = FastAPI(generate_unique_id_function=lambda route: route.name) + control = create_control(logger=logger) + app.state.control = control + + # `/api` 以下で API を呼び出す + app.include_router(api_router, prefix="/api") + + # `/` 以下で静的ファイルを配信する + app.mount("/", StaticFiles(directory="./ptcs_ui/dist", html=True), name="static") + + bridge = Bridge2() + bridge.add_train(TrainSimulator("t0")) + bridge.add_train(TrainSimulator("t1")) + + async def loop(): + await bridge.connect_all() + + def handle_notify_rotation(train_client: TrainBase, _rotation: int): + train_control = control.trains.get(train_client.id) + if train_control is None: + return + train_control.move_forward_mr(1) + + for train in bridge.trains.values(): + await train.start_notify_rotation(handle_notify_rotation) - # control 内部の時計を現実世界の時間において進める - def run_clock() -> None: while True: - time.sleep(0.1) + # control 内部の時計を現実世界の時間において進める + await asyncio.sleep(0.1) control.tick() control.update() - clock_thread = threading.Thread(target=run_clock, daemon=True) - clock_thread.start() + for train_id, train_control in control.trains.items(): + train_client = bridge.trains.get(train_id) + if train_client is None: + continue + await train_client.send_speed(train_control.speed_command) - app = FastAPI(generate_unique_id_function=lambda route: route.name) - app.state.control = control - app.state.clock_thread = clock_thread + loop_task = asyncio.create_task(loop()) + app.state.loop_task = loop_task - # `/api` 以下で API を呼び出す - app.include_router(api_router, prefix="/api") + @app.on_event("shutdown") + async def on_shutdown(): + for train in bridge.trains.values(): + await train.send_speed(0) - # `/` 以下で静的ファイルを配信する - app.mount("/", StaticFiles(directory="./ptcs_ui/dist", html=True), name="static") + await bridge.disconnect_all() return app @@ -183,7 +214,7 @@ def serve(*, port: int = DEFAULT_PORT, bridge: bool = False, debug: bool = False port=port, log_level="info", reload=True, - reload_dirs=["ptcs_control", "ptcs_server", "usb_bt_bridge"], + reload_dirs=["ptcs_bridge", "ptcs_control", "ptcs_server"], ) else: uvicorn.run( diff --git a/ptcs/ptcs_server/types/state.py b/ptcs/ptcs_server/types/state.py index 8da20d6..85c548a 100644 --- a/ptcs/ptcs_server/types/state.py +++ b/ptcs/ptcs_server/types/state.py @@ -10,6 +10,7 @@ from ptcs_control.components.junction import JunctionConnection, PointDirection from ptcs_control.components.section import SectionConnection +from ptcs_control.components.train import Train from ptcs_control.control import Control @@ -42,13 +43,43 @@ class TrainState(BaseModel): min_input: int max_input: int max_speed: float + length: float delta_per_motor_rotation: float - position: DirectedPosition + head_position: DirectedPosition + tail_position: DirectedPosition + covered_section_ids: list[str] stop_id: str | None stop_distance: float departure_time: int | None speed_command: float + @staticmethod + def from_control(train: Train) -> TrainState: + tail_position, covered_sections = train.head_position.get_retracted_position_with_path(train.length) + return TrainState( + id=train.id, + min_input=train.min_input, + max_input=train.max_input, + max_speed=train.max_speed, + length=train.length, + delta_per_motor_rotation=train.delta_per_motor_rotation, + head_position=DirectedPosition( + section_id=train.head_position.section.id, + target_junction_id=train.head_position.target_junction.id, + mileage=train.head_position.mileage, + ), + tail_position=DirectedPosition( + section_id=tail_position.section.id, + target_junction_id=tail_position.target_junction.id, + mileage=tail_position.mileage, + ), + covered_section_ids=[section.id for section in covered_sections], + stop_id=train.stop.id if train.stop else None, + stop_distance=train.stop_distance, + departure_time=train.departure_time, + speed_command=train.speed_command, + ) + class StopState(BaseModel): id: str @@ -101,25 +132,7 @@ def get_state_from_control(control: Control) -> RailwayState: ) for section in control.sections.values() }, - trains={ - train.id: TrainState( - id=train.id, - min_input=train.min_input, - max_input=train.max_input, - max_speed=train.max_speed, - delta_per_motor_rotation=train.delta_per_motor_rotation, - position=DirectedPosition( - section_id=train.position.section.id, - target_junction_id=train.position.target_junction.id, - mileage=train.position.mileage, - ), - stop_id=train.stop.id if train.stop else None, - stop_distance=train.stop_distance, - departure_time=train.departure_time, - speed_command=train.speed_command, - ) - for train in control.trains.values() - }, + trains={train.id: TrainState.from_control(train) for train in control.trains.values()}, stops={ stop.id: StopState( id=stop.id, diff --git a/ptcs/ptcs_ui/dist/assets/index-5bd54ca8.js b/ptcs/ptcs_ui/dist/assets/index-5bd54ca8.js deleted file mode 100644 index a5a231d..0000000 --- a/ptcs/ptcs_ui/dist/assets/index-5bd54ca8.js +++ /dev/null @@ -1,74 +0,0 @@ -var Yy=Object.defineProperty;var Zy=(e,t,n)=>t in e?Yy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t,n)=>(Zy(e,typeof t!="symbol"?t+"":t,n),n);function Jy(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function qy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I={},eg={get exports(){return I},set exports(e){I=e}},gl={},k={},tg={get exports(){return k},set exports(e){k=e}},H={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var $o=Symbol.for("react.element"),ng=Symbol.for("react.portal"),rg=Symbol.for("react.fragment"),og=Symbol.for("react.strict_mode"),ig=Symbol.for("react.profiler"),lg=Symbol.for("react.provider"),ag=Symbol.for("react.context"),sg=Symbol.for("react.forward_ref"),ug=Symbol.for("react.suspense"),cg=Symbol.for("react.memo"),fg=Symbol.for("react.lazy"),rc=Symbol.iterator;function dg(e){return e===null||typeof e!="object"?null:(e=rc&&e[rc]||e["@@iterator"],typeof e=="function"?e:null)}var Yd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zd=Object.assign,Jd={};function Sr(e,t,n){this.props=e,this.context=t,this.refs=Jd,this.updater=n||Yd}Sr.prototype.isReactComponent={};Sr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Sr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qd(){}qd.prototype=Sr.prototype;function Fs(e,t,n){this.props=e,this.context=t,this.refs=Jd,this.updater=n||Yd}var Us=Fs.prototype=new qd;Us.constructor=Fs;Zd(Us,Sr.prototype);Us.isPureReactComponent=!0;var oc=Array.isArray,ep=Object.prototype.hasOwnProperty,Bs={current:null},tp={key:!0,ref:!0,__self:!0,__source:!0};function np(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)ep.call(t,r)&&!tp.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,ue=N[K];if(0>>1;Ko(yn,U))cto(Wt,yn)?(N[K]=Wt,N[ct]=U,K=ct):(N[K]=yn,N[tt]=U,K=tt);else if(cto(Wt,U))N[K]=Wt,N[ct]=U,K=ct;else break e}}return D}function o(N,D){var U=N.sortIndex-D.sortIndex;return U!==0?U:N.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var s=[],u=[],d=1,m=null,c=3,g=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(N){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=N)r(u),D.sortIndex=D.expirationTime,t(s,D);else break;D=n(u)}}function w(N){if(v=!1,h(N),!y)if(n(s)!==null)y=!0,mn(E);else{var D=n(u);D!==null&&se(w,D.startTime-N)}}function E(N,D){y=!1,v&&(v=!1,p(R),R=-1),g=!0;var U=c;try{for(h(D),m=n(s);m!==null&&(!(m.expirationTime>D)||N&&!Z());){var K=m.callback;if(typeof K=="function"){m.callback=null,c=m.priorityLevel;var ue=K(m.expirationTime<=D);D=e.unstable_now(),typeof ue=="function"?m.callback=ue:m===n(s)&&r(s),h(D)}else r(s);m=n(s)}if(m!==null)var Ht=!0;else{var tt=n(u);tt!==null&&se(w,tt.startTime-D),Ht=!1}return Ht}finally{m=null,c=U,g=!1}}var $=!1,P=null,R=-1,V=5,T=-1;function Z(){return!(e.unstable_now()-TN||125K?(N.sortIndex=U,t(u,N),n(s)===null&&N===n(u)&&(v?(p(R),R=-1):v=!0,se(w,U-K))):(N.sortIndex=ue,t(s,N),y||g||(y=!0,mn(E))),N},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(N){var D=c;return function(){var U=c;c=D;try{return N.apply(this,arguments)}finally{c=U}}}})(op);(function(e){e.exports=op})(Pg);/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ip=k,Ze=Ia;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Da=Object.prototype.hasOwnProperty,kg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,lc={},ac={};function Og(e){return Da.call(ac,e)?!0:Da.call(lc,e)?!1:kg.test(e)?ac[e]=!0:(lc[e]=!0,!1)}function Cg(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $g(e,t,n,r){if(t===null||typeof t>"u"||Cg(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function De(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Ce={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ce[e]=new De(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ce[t]=new De(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ce[e]=new De(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ce[e]=new De(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ce[e]=new De(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ce[e]=new De(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ce[e]=new De(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ce[e]=new De(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ce[e]=new De(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hs=/[\-:]([a-z])/g;function Ws(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Hs,Ws);Ce[t]=new De(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Hs,Ws);Ce[t]=new De(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Hs,Ws);Ce[t]=new De(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ce[e]=new De(e,1,!1,e.toLowerCase(),null,!1,!1)});Ce.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ce[e]=new De(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gs(e,t,n,r){var o=Ce.hasOwnProperty(t)?Ce[t]:null;(o!==null?o.type!==0:r||!(2a||o[l]!==i[a]){var s=` -`+o[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{na=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fr(e):""}function Rg(e){switch(e.tag){case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 2:case 15:return e=ra(e.type,!1),e;case 11:return e=ra(e.type.render,!1),e;case 1:return e=ra(e.type,!0),e;default:return""}}function Ba(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gn:return"Fragment";case Wn:return"Portal";case Aa:return"Profiler";case Qs:return"StrictMode";case Fa:return"Suspense";case Ua:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sp:return(e.displayName||"Context")+".Consumer";case ap:return(e._context.displayName||"Context")+".Provider";case Ks:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xs:return t=e.displayName||null,t!==null?t:Ba(e.type)||"Memo";case Xt:t=e._payload,e=e._init;try{return Ba(e(t))}catch{}}return null}function jg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ba(t);case 8:return t===Qs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function cn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ng(e){var t=cp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qo(e){e._valueTracker||(e._valueTracker=Ng(e))}function fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=cp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Oi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Va(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=cn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dp(e,t){t=t.checked,t!=null&&Gs(e,"checked",t,!1)}function Ha(e,t){dp(e,t);var n=cn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Wa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wa(e,t.type,cn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Wa(e,t,n){(t!=="number"||Oi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ur=Array.isArray;function or(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zg=["Webkit","ms","Moz","O"];Object.keys(Wr).forEach(function(e){zg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wr[t]=Wr[e]})});function yp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Wr.hasOwnProperty(e)&&Wr[e]?(""+t).trim():t+"px"}function gp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=yp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var bg=ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ka(e,t){if(t){if(bg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function Xa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ya=null;function Ys(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Za=null,ir=null,lr=null;function pc(e){if(e=No(e)){if(typeof Za!="function")throw Error(C(280));var t=e.stateNode;t&&(t=xl(t),Za(e.stateNode,e.type,t))}}function vp(e){ir?lr?lr.push(e):lr=[e]:ir=e}function wp(){if(ir){var e=ir,t=lr;if(lr=ir=null,pc(e),t)for(e=0;e>>=0,e===0?32:31-(Hg(e)/Wg|0)|0}var Xo=64,Yo=4194304;function Br(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ji(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=Br(a):(i&=l,i!==0&&(r=Br(i)))}else l=n&~o,l!==0?r=Br(l):i!==0&&(r=Br(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ro(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function Xg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Qr),xc=String.fromCharCode(32),Ec=!1;function Ap(e,t){switch(e){case"keyup":return E0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qn=!1;function k0(e,t){switch(e){case"compositionend":return Fp(t);case"keypress":return t.which!==32?null:(Ec=!0,xc);case"textInput":return e=t.data,e===xc&&Ec?null:e;default:return null}}function O0(e,t){if(Qn)return e==="compositionend"||!ou&&Ap(e,t)?(e=Ip(),hi=tu=qt=null,Qn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cc(n)}}function Hp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wp(){for(var e=window,t=Oi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Oi(e.document)}return t}function iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function L0(e){var t=Wp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Hp(n.ownerDocument.documentElement,n)){if(r!==null&&iu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=$c(n,i);var l=$c(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Kn=null,rs=null,Xr=null,os=!1;function Rc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;os||Kn==null||Kn!==Oi(r)||(r=Kn,"selectionStart"in r&&iu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xr&&fo(Xr,r)||(Xr=r,r=bi(rs,"onSelect"),0Zn||(e.current=cs[Zn],cs[Zn]=null,Zn--)}function te(e,t){Zn++,cs[Zn]=e.current,e.current=t}var fn={},be=pn(fn),Be=pn(!1),bn=fn;function pr(e,t){var n=e.type.contextTypes;if(!n)return fn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ve(e){return e=e.childContextTypes,e!=null}function Li(){re(Be),re(be)}function Mc(e,t,n){if(be.current!==fn)throw Error(C(168));te(be,t),te(Be,n)}function eh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(C(108,jg(e)||"Unknown",o));return ae({},n,r)}function Mi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,bn=be.current,te(be,e),te(Be,Be.current),!0}function Ic(e,t,n){var r=e.stateNode;if(!r)throw Error(C(169));n?(e=eh(e,t,bn),r.__reactInternalMemoizedMergedChildContext=e,re(Be),re(be),te(be,e)):re(Be),te(Be,n)}var Tt=null,El=!1,ga=!1;function th(e){Tt===null?Tt=[e]:Tt.push(e)}function Q0(e){El=!0,th(e)}function hn(){if(!ga&&Tt!==null){ga=!0;var e=0,t=q;try{var n=Tt;for(q=1;e>=l,o-=l,Lt=1<<32-gt(t)+o|n<R?(V=P,P=null):V=P.sibling;var T=c(p,P,h[R],w);if(T===null){P===null&&(P=V);break}e&&P&&T.alternate===null&&t(p,P),f=i(T,f,R),$===null?E=T:$.sibling=T,$=T,P=V}if(R===h.length)return n(p,P),oe&&xn(p,R),E;if(P===null){for(;RR?(V=P,P=null):V=P.sibling;var Z=c(p,P,T.value,w);if(Z===null){P===null&&(P=V);break}e&&P&&Z.alternate===null&&t(p,P),f=i(Z,f,R),$===null?E=Z:$.sibling=Z,$=Z,P=V}if(T.done)return n(p,P),oe&&xn(p,R),E;if(P===null){for(;!T.done;R++,T=h.next())T=m(p,T.value,w),T!==null&&(f=i(T,f,R),$===null?E=T:$.sibling=T,$=T);return oe&&xn(p,R),E}for(P=r(p,P);!T.done;R++,T=h.next())T=g(P,p,R,T.value,w),T!==null&&(e&&T.alternate!==null&&P.delete(T.key===null?R:T.key),f=i(T,f,R),$===null?E=T:$.sibling=T,$=T);return e&&P.forEach(function(ye){return t(p,ye)}),oe&&xn(p,R),E}function x(p,f,h,w){if(typeof h=="object"&&h!==null&&h.type===Gn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Go:e:{for(var E=h.key,$=f;$!==null;){if($.key===E){if(E=h.type,E===Gn){if($.tag===7){n(p,$.sibling),f=o($,h.props.children),f.return=p,p=f;break e}}else if($.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Xt&&Hc(E)===$.type){n(p,$.sibling),f=o($,h.props),f.ref=br(p,$,h),f.return=p,p=f;break e}n(p,$);break}else t(p,$);$=$.sibling}h.type===Gn?(f=Nn(h.props.children,p.mode,w,h.key),f.return=p,p=f):(w=xi(h.type,h.key,h.props,null,p.mode,w),w.ref=br(p,f,h),w.return=p,p=w)}return l(p);case Wn:e:{for($=h.key;f!==null;){if(f.key===$)if(f.tag===4&&f.stateNode.containerInfo===h.containerInfo&&f.stateNode.implementation===h.implementation){n(p,f.sibling),f=o(f,h.children||[]),f.return=p,p=f;break e}else{n(p,f);break}else t(p,f);f=f.sibling}f=ka(h,p.mode,w),f.return=p,p=f}return l(p);case Xt:return $=h._init,x(p,f,$(h._payload),w)}if(Ur(h))return y(p,f,h,w);if($r(h))return v(p,f,h,w);ri(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,f!==null&&f.tag===6?(n(p,f.sibling),f=o(f,h),f.return=p,p=f):(n(p,f),f=Pa(h,p.mode,w),f.return=p,p=f),l(p)):n(p,f)}return x}var mr=uh(!0),ch=uh(!1),zo={},$t=pn(zo),yo=pn(zo),go=pn(zo);function Cn(e){if(e===zo)throw Error(C(174));return e}function hu(e,t){switch(te(go,t),te(yo,e),te($t,zo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qa(t,e)}re($t),te($t,t)}function yr(){re($t),re(yo),re(go)}function fh(e){Cn(go.current);var t=Cn($t.current),n=Qa(t,e.type);t!==n&&(te(yo,e),te($t,n))}function mu(e){yo.current===e&&(re($t),re(yo))}var ie=pn(0);function Bi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var va=[];function yu(){for(var e=0;en?n:4,e(!0);var r=wa.transition;wa.transition={};try{e(!1),t()}finally{q=n,wa.transition=r}}function Ch(){return at().memoizedState}function Z0(e,t,n){var r=sn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},$h(e))Rh(t,n);else if(n=ih(e,t,n,r),n!==null){var o=Me();vt(n,e,r,o),jh(n,t,r)}}function J0(e,t,n){var r=sn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if($h(e))Rh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,wt(a,l)){var s=t.interleaved;s===null?(o.next=o,du(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=ih(e,t,o,r),n!==null&&(o=Me(),vt(n,e,r,o),jh(n,t,r))}}function $h(e){var t=e.alternate;return e===le||t!==null&&t===le}function Rh(e,t){Yr=Vi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Js(e,n)}}var Hi={readContext:lt,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},q0={readContext:lt,useCallback:function(e,t){return Et().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Gc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vi(4194308,4,xh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vi(4194308,4,e,t)},useInsertionEffect:function(e,t){return vi(4,2,e,t)},useMemo:function(e,t){var n=Et();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Et();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Z0.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=Et();return e={current:e},t.memoizedState=e},useState:Wc,useDebugValue:_u,useDeferredValue:function(e){return Et().memoizedState=e},useTransition:function(){var e=Wc(!1),t=e[0];return e=Y0.bind(null,e[1]),Et().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=le,o=Et();if(oe){if(n===void 0)throw Error(C(407));n=n()}else{if(n=t(),_e===null)throw Error(C(349));Ln&30||hh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Gc(yh.bind(null,r,i,e),[e]),r.flags|=2048,So(9,mh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Et(),t=_e.identifierPrefix;if(oe){var n=Mt,r=Lt;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vo++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Ot]=t,e[mo]=r,Ah(e,t,!1,!1),t.stateNode=e;e:{switch(l=Xa(n,r),n){case"dialog":ne("cancel",e),ne("close",e),o=r;break;case"iframe":case"object":case"embed":ne("load",e),o=r;break;case"video":case"audio":for(o=0;ovr&&(t.flags|=128,r=!0,Tr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Bi(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!oe)return je(t),null}else 2*de()-i.renderingStartTime>vr&&n!==1073741824&&(t.flags|=128,r=!0,Tr(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=de(),t.sibling=null,n=ie.current,te(ie,r?n&1|2:n&1),t):(je(t),null);case 22:case 23:return Cu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qe&1073741824&&(je(t),t.subtreeFlags&6&&(t.flags|=8192)):je(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function av(e,t){switch(au(t),t.tag){case 1:return Ve(t.type)&&Li(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yr(),re(Be),re(be),yu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mu(t),null;case 13:if(re(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));hr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(ie),null;case 4:return yr(),null;case 10:return fu(t.type._context),null;case 22:case 23:return Cu(),null;case 24:return null;default:return null}}var ii=!1,ze=!1,sv=typeof WeakSet=="function"?WeakSet:Set,z=null;function tr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){fe(e,t,r)}else n.current=null}function xs(e,t,n){try{n()}catch(r){fe(e,t,r)}}var tf=!1;function uv(e,t){if(is=Ni,e=Wp(),iu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,d=0,m=e,c=null;t:for(;;){for(var g;m!==n||o!==0&&m.nodeType!==3||(a=l+o),m!==i||r!==0&&m.nodeType!==3||(s=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(g=m.firstChild)!==null;)c=m,m=g;for(;;){if(m===e)break t;if(c===n&&++u===o&&(a=l),c===i&&++d===r&&(s=l),(g=m.nextSibling)!==null)break;m=c,c=m.parentNode}m=g}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(ls={focusedElem:e,selectionRange:n},Ni=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,x=y.memoizedState,p=t.stateNode,f=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:ht(t.type,v),x);p.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(w){fe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return y=tf,tf=!1,y}function Zr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&xs(t,n,i)}o=o.next}while(o!==r)}}function Ol(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Es(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bh(e){var t=e.alternate;t!==null&&(e.alternate=null,Bh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ot],delete t[mo],delete t[us],delete t[W0],delete t[G0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Vh(e){return e.tag===5||e.tag===3||e.tag===4}function nf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ps(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ti));else if(r!==4&&(e=e.child,e!==null))for(Ps(e,t,n),e=e.sibling;e!==null;)Ps(e,t,n),e=e.sibling}function ks(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ks(e,t,n),e=e.sibling;e!==null;)ks(e,t,n),e=e.sibling}var Ee=null,mt=!1;function Gt(e,t,n){for(n=n.child;n!==null;)Hh(e,t,n),n=n.sibling}function Hh(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(vl,n)}catch{}switch(n.tag){case 5:ze||tr(n,t);case 6:var r=Ee,o=mt;Ee=null,Gt(e,t,n),Ee=r,mt=o,Ee!==null&&(mt?(e=Ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ee.removeChild(n.stateNode));break;case 18:Ee!==null&&(mt?(e=Ee,n=n.stateNode,e.nodeType===8?ya(e.parentNode,n):e.nodeType===1&&ya(e,n),uo(e)):ya(Ee,n.stateNode));break;case 4:r=Ee,o=mt,Ee=n.stateNode.containerInfo,mt=!0,Gt(e,t,n),Ee=r,mt=o;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&xs(n,t,l),o=o.next}while(o!==r)}Gt(e,t,n);break;case 1:if(!ze&&(tr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){fe(n,t,a)}Gt(e,t,n);break;case 21:Gt(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,Gt(e,t,n),ze=r):Gt(e,t,n);break;default:Gt(e,t,n)}}function rf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sv),t.forEach(function(r){var o=vv.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function pt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fv(r/1960))-r,10e?16:e,en===null)var r=!1;else{if(e=en,en=null,Qi=0,Q&6)throw Error(C(331));var o=Q;for(Q|=4,z=e.current;z!==null;){var i=z,l=i.child;if(z.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sde()-ku?jn(e,0):Pu|=n),He(e,t)}function Jh(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=Me();e=Ft(e,t),e!==null&&(Ro(e,t,n),He(e,n))}function gv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jh(e,n)}function vv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(C(314))}r!==null&&r.delete(t),Jh(e,n)}var qh;qh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Ue=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ue=!1,iv(e,t,n);Ue=!!(e.flags&131072)}else Ue=!1,oe&&t.flags&1048576&&nh(t,Di,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wi(e,t),e=t.pendingProps;var o=pr(t,be.current);sr(t,n),o=vu(null,t,r,e,o,n);var i=wu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ve(r)?(i=!0,Mi(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,pu(t),o.updater=Pl,t.stateNode=o,o._reactInternals=t,ms(t,r,e,n),t=vs(null,t,r,!0,i,n)):(t.tag=0,oe&&i&&lu(t),Le(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Sv(r),e=ht(r,e),o){case 0:t=gs(null,t,r,e,n);break e;case 1:t=Jc(null,t,r,e,n);break e;case 11:t=Yc(null,t,r,e,n);break e;case 14:t=Zc(null,t,r,ht(r.type,e),n);break e}throw Error(C(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ht(r,o),gs(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ht(r,o),Jc(e,t,r,o,n);case 3:e:{if(Mh(t),e===null)throw Error(C(387));r=t.pendingProps,i=t.memoizedState,o=i.element,lh(e,t),Ui(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=gr(Error(C(423)),t),t=qc(e,t,r,n,o);break e}else if(r!==o){o=gr(Error(C(424)),t),t=qc(e,t,r,n,o);break e}else for(Ke=on(t.stateNode.containerInfo.firstChild),Xe=t,oe=!0,yt=null,n=ch(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(hr(),r===o){t=Ut(e,t,n);break e}Le(e,t,r,n)}t=t.child}return t;case 5:return fh(t),e===null&&ds(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,as(r,o)?l=null:i!==null&&as(r,i)&&(t.flags|=32),Lh(e,t),Le(e,t,l,n),t.child;case 6:return e===null&&ds(t),null;case 13:return Ih(e,t,n);case 4:return hu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mr(t,null,r,n):Le(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ht(r,o),Yc(e,t,r,o,n);case 7:return Le(e,t,t.pendingProps,n),t.child;case 8:return Le(e,t,t.pendingProps.children,n),t.child;case 12:return Le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,te(Ai,r._currentValue),r._currentValue=l,i!==null)if(wt(i.value,l)){if(i.children===o.children&&!Be.current){t=Ut(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=It(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?s.next=s:(s.next=d.next,d.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ps(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(C(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),ps(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Le(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,sr(t,n),o=lt(o),r=r(o),t.flags|=1,Le(e,t,r,n),t.child;case 14:return r=t.type,o=ht(r,t.pendingProps),o=ht(r.type,o),Zc(e,t,r,o,n);case 15:return bh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ht(r,o),wi(e,t),t.tag=1,Ve(r)?(e=!0,Mi(t)):e=!1,sr(t,n),sh(t,r,o),ms(t,r,o,n),vs(null,t,r,!0,e,n);case 19:return Dh(e,t,n);case 22:return Th(e,t,n)}throw Error(C(156,t.tag))};function em(e,t){return Op(e,t)}function wv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ot(e,t,n,r){return new wv(e,t,n,r)}function Ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sv(e){if(typeof e=="function")return Ru(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ks)return 11;if(e===Xs)return 14}return 2}function un(e,t){var n=e.alternate;return n===null?(n=ot(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xi(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")Ru(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Gn:return Nn(n.children,o,i,t);case Qs:l=8,o|=8;break;case Aa:return e=ot(12,n,t,o|2),e.elementType=Aa,e.lanes=i,e;case Fa:return e=ot(13,n,t,o),e.elementType=Fa,e.lanes=i,e;case Ua:return e=ot(19,n,t,o),e.elementType=Ua,e.lanes=i,e;case up:return $l(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ap:l=10;break e;case sp:l=9;break e;case Ks:l=11;break e;case Xs:l=14;break e;case Xt:l=16,r=null;break e}throw Error(C(130,e==null?e:typeof e,""))}return t=ot(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Nn(e,t,n,r){return e=ot(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=ot(22,e,r,t),e.elementType=up,e.lanes=n,e.stateNode={isHidden:!1},e}function Pa(e,t,n){return e=ot(6,e,null,t),e.lanes=n,e}function ka(e,t,n){return t=ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _v(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ia(0),this.expirationTimes=ia(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ia(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ju(e,t,n,r,o,i,l,a,s){return e=new _v(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ot(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pu(i),e}function xv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Je})(Eg);var df=Ma;La.createRoot=df.createRoot,La.hydrateRoot=df.hydrateRoot;/** - * @remix-run/router v1.3.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function $v(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rv(){return Math.random().toString(36).substr(2,8)}function hf(e,t){return{usr:e.state,key:e.key,idx:t}}function xo(e,t,n,r){return n===void 0&&(n=null),Y({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?jt(t):t,{state:n,key:t&&t.key||r||Rv()})}function Dn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function jt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function jv(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,a=pe.Pop,s=null,u=d();u==null&&(u=0,l.replaceState(Y({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function m(){a=pe.Pop;let x=d(),p=x==null?null:x-u;u=x,s&&s({action:a,location:v.location,delta:p})}function c(x,p){a=pe.Push;let f=xo(v.location,x,p);n&&n(f,x),u=d()+1;let h=hf(f,u),w=v.createHref(f);try{l.pushState(h,"",w)}catch{o.location.assign(w)}i&&s&&s({action:a,location:v.location,delta:1})}function g(x,p){a=pe.Replace;let f=xo(v.location,x,p);n&&n(f,x),u=d();let h=hf(f,u),w=v.createHref(f);l.replaceState(h,"",w),i&&s&&s({action:a,location:v.location,delta:0})}function y(x){let p=o.location.origin!=="null"?o.location.origin:o.location.href,f=typeof x=="string"?x:Dn(x);return B(p,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,p)}let v={get action(){return a},get location(){return e(o,l)},listen(x){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(pf,m),s=x,()=>{o.removeEventListener(pf,m),s=null}},createHref(x){return t(o,x)},createURL:y,encodeLocation(x){let p=y(x);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:c,replace:g,go(x){return l.go(x)}};return v}var Pe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pe||(Pe={}));function Nv(e){return e.index===!0}function om(e,t,n){return t===void 0&&(t=[]),n===void 0&&(n=new Set),e.map((r,o)=>{let i=[...t,o],l=typeof r.id=="string"?r.id:i.join("-");return B(r.index!==!0||!r.children,"Cannot specify children on an index route"),B(!n.has(l),'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),n.add(l),Nv(r)?Y({},r,{id:l}):Y({},r,{id:l,children:r.children?om(r.children,i,n):void 0})})}function Hr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?jt(t):t,o=am(r.pathname||"/",n);if(o==null)return null;let i=im(e);zv(i);let l=null;for(let a=0;l==null&&a{let s={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};s.relativePath.startsWith("/")&&(B(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=zn([r,s.relativePath]),d=n.concat(s);i.children&&i.children.length>0&&(B(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),im(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Av(u,i.index),routesMeta:d})};return e.forEach((i,l)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,l);else for(let s of lm(i.path))o(i,l,s)}),t}function lm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=lm(r.join("/")),a=[];return a.push(...l.map(s=>s===""?i:[i,s].join("/"))),o&&a.push(...l),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function zv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Fv(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const bv=/^:\w+$/,Tv=3,Lv=2,Mv=1,Iv=10,Dv=-2,mf=e=>e==="*";function Av(e,t){let n=e.split("/"),r=n.length;return n.some(mf)&&(r+=Dv),t&&(r+=Lv),n.filter(o=>!mf(o)).reduce((o,i)=>o+(bv.test(i)?Tv:i===""?Mv:Iv),r)}function Fv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Uv(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let l=0;l{if(d==="*"){let c=a[m]||"";l=i.slice(0,i.length-c.length).replace(/(.)\/+$/,"$1")}return u[d]=Wv(a[m]||"",d),u},{}),pathname:i,pathnameBase:l,pattern:e}}function Vv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Eo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(l,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Hv(e){try{return decodeURI(e)}catch(t){return Eo(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Wv(e,t){try{return decodeURIComponent(e)}catch(n){return Eo(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function am(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Eo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Gv(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?jt(e):e;return{pathname:n?n.startsWith("/")?n:Qv(n,t):t,search:Yv(r),hash:Zv(o)}}function Qv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Oa(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function sm(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Kv(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=jt(e):(o=Y({},e),B(!o.pathname||!o.pathname.includes("?"),Oa("?","pathname","search",o)),B(!o.pathname||!o.pathname.includes("#"),Oa("#","pathname","hash",o)),B(!o.search||!o.search.includes("#"),Oa("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,a;if(r||l==null)a=n;else{let m=t.length-1;if(l.startsWith("..")){let c=l.split("/");for(;c[0]==="..";)c.shift(),m-=1;o.pathname=c.join("/")}a=m>=0?t[m]:"/"}let s=Gv(o,a),u=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||d)&&(s.pathname+="/"),s}const zn=e=>e.join("/").replace(/\/\/+/g,"/"),Xv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Yv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Zv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class yf extends Error{}class Jv{constructor(t,n){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],B(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((i,l)=>r=l),this.controller=new AbortController;let o=()=>r(new yf("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",o),this.controller.signal.addEventListener("abort",o),this.data=Object.entries(t).reduce((i,l)=>{let[a,s]=l;return Object.assign(i,{[a]:this.trackPromise(a,s)})},{}),this.done&&this.unlistenAbortSignal(),this.init=n}trackPromise(t,n){if(!(n instanceof Promise))return n;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let r=Promise.race([n,this.abortPromise]).then(o=>this.onSettle(r,t,null,o),o=>this.onSettle(r,t,o));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(t,n,r,o){return this.controller.signal.aborted&&r instanceof yf?(this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>r}),Promise.reject(r)):(this.pendingKeysSet.delete(n),this.done&&this.unlistenAbortSignal(),r?(Object.defineProperty(t,"_error",{get:()=>r}),this.emit(!1,n),Promise.reject(r)):(Object.defineProperty(t,"_data",{get:()=>o}),this.emit(!1,n),o))}emit(t,n){this.subscribers.forEach(r=>r(t,n))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,n)=>this.pendingKeysSet.delete(n)),this.emit(!0)}async resolveData(t){let n=!1;if(!this.done){let r=()=>this.cancel();t.addEventListener("abort",r),n=await new Promise(o=>{this.subscribe(i=>{t.removeEventListener("abort",r),(i||this.done)&&o(i)})})}return n}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return B(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,n)=>{let[r,o]=n;return Object.assign(t,{[r]:e1(o)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function qv(e){return e instanceof Promise&&e._tracked===!0}function e1(e){if(!qv(e))return e;if(e._error)throw e._error;return e._data}class Tu{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function um(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cm=["post","put","patch","delete"],t1=new Set(cm),n1=["get",...cm],r1=new Set(n1),o1=new Set([301,302,303,307,308]),i1=new Set([307,308]),Ca={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},l1={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},gf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a1=!fm;function s1(e){B(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=om(e.routes),n=null,r=new Set,o=null,i=null,l=null,a=e.hydrationData!=null,s=Hr(t,e.history.location,e.basename),u=null;if(s==null){let S=Qt(404,{pathname:e.history.location.pathname}),{matches:_,route:O}=Ef(t);s=_,u={[O.id]:S}}let d=!s.some(S=>S.route.loader)||e.hydrationData!=null,m,c={historyAction:e.history.action,location:e.history.location,matches:s,initialized:d,navigation:Ca,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||u,fetchers:new Map,blockers:new Map},g=pe.Pop,y=!1,v,x=!1,p=!1,f=[],h=[],w=new Map,E=0,$=-1,P=new Map,R=new Set,V=new Map,T=new Map,Z=null,ye=new Map,Ge=!1;function Un(){return n=e.history.listen(S=>{let{action:_,location:O,delta:L}=S;if(Ge){Ge=!1;return}Eo(Z!=null&&L===null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let b=ec({currentLocation:c.location,nextLocation:O,historyAction:_});if(b&&L!=null){Ge=!0,e.history.go(L*-1),Uo(b,{state:"blocked",location:O,proceed(){Uo(b,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),e.history.go(L)},reset(){Or(b),se({blockers:new Map(m.state.blockers)})}});return}return K(_,O)}),c.initialized||K(pe.Pop,c.location),m}function kr(){n&&n(),r.clear(),v&&v.abort(),c.fetchers.forEach((S,_)=>Xl(_)),c.blockers.forEach((S,_)=>Or(_))}function mn(S){return r.add(S),()=>r.delete(S)}function se(S){c=Y({},c,S),r.forEach(_=>_(c))}function N(S,_){var O,L;let b=c.actionData!=null&&c.navigation.formMethod!=null&&bt(c.navigation.formMethod)&&c.navigation.state==="loading"&&((O=S.state)==null?void 0:O._isRedirect)!==!0,F;_.actionData?Object.keys(_.actionData).length>0?F=_.actionData:F=null:b?F=c.actionData:F=null;let A=_.loaderData?xf(c.loaderData,_.loaderData,_.matches||[],_.errors):c.loaderData;for(let[M]of ye)Or(M);let G=y===!0||c.navigation.formMethod!=null&&bt(c.navigation.formMethod)&&((L=S.state)==null?void 0:L._isRedirect)!==!0;se(Y({},_,{actionData:F,loaderData:A,historyAction:g,location:S,initialized:!0,navigation:Ca,revalidation:"idle",restoreScrollPosition:tc(S,_.matches||c.matches),preventScrollReset:G,blockers:new Map(c.blockers)})),x||g===pe.Pop||(g===pe.Push?e.history.push(S,S.state):g===pe.Replace&&e.history.replace(S,S.state)),g=pe.Pop,y=!1,x=!1,p=!1,f=[],h=[]}async function D(S,_){if(typeof S=="number"){e.history.go(S);return}let{path:O,submission:L,error:b}=vf(S,_),F=c.location,A=xo(c.location,O,_&&_.state);A=Y({},A,e.history.encodeLocation(A));let G=_&&_.replace!=null?_.replace:void 0,M=pe.Push;G===!0?M=pe.Replace:G===!1||L!=null&&bt(L.formMethod)&&L.formAction===c.location.pathname+c.location.search&&(M=pe.Replace);let Te=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,W=ec({currentLocation:F,nextLocation:A,historyAction:M});if(W){Uo(W,{state:"blocked",location:A,proceed(){Uo(W,{state:"proceeding",proceed:void 0,reset:void 0,location:A}),D(S,_)},reset(){Or(W),se({blockers:new Map(c.blockers)})}});return}return await K(M,A,{submission:L,pendingError:b,preventScrollReset:Te,replace:_&&_.replace})}function U(){if(Ao(),se({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){K(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}K(g||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function K(S,_,O){v&&v.abort(),v=null,g=S,x=(O&&O.startUninterruptedRevalidation)===!0,Gy(c.location,c.matches),y=(O&&O.preventScrollReset)===!0;let L=O&&O.overrideNavigation,b=Hr(t,_,e.basename);if(!b){let ce=Qt(404,{pathname:_.pathname}),{matches:ft,route:dt}=Ef(t);Yl(),N(_,{matches:ft,loaderData:{},errors:{[dt.id]:ce}});return}if(p1(c.location,_)&&!(O&&O.submission&&bt(O.submission.formMethod))){N(_,{matches:b});return}v=new AbortController;let F=Ir(e.history,_,v.signal,O&&O.submission),A,G;if(O&&O.pendingError)G={[rr(b).route.id]:O.pendingError};else if(O&&O.submission&&bt(O.submission.formMethod)){let ce=await ue(F,_,O.submission,b,{replace:O.replace});if(ce.shortCircuited)return;A=ce.pendingActionData,G=ce.pendingActionError,L=Y({state:"loading",location:_},O.submission),F=new Request(F.url,{signal:F.signal})}let{shortCircuited:M,loaderData:Te,errors:W}=await Ht(F,_,b,L,O&&O.submission,O&&O.replace,A,G);M||(v=null,N(_,Y({matches:b},A?{actionData:A}:{},{loaderData:Te,errors:W})))}async function ue(S,_,O,L,b){Ao();let F=Y({state:"submitting",location:_},O);se({navigation:F});let A,G=Cf(L,_);if(!G.route.action)A={type:Pe.error,error:Qt(405,{method:S.method,pathname:_.pathname,routeId:G.route.id})};else if(A=await Mr("action",S,G,L,m.basename),S.signal.aborted)return{shortCircuited:!0};if(cr(A)){let M;return b&&b.replace!=null?M=b.replace:M=A.location===c.location.pathname+c.location.search,await gn(c,A,{submission:O,replace:M}),{shortCircuited:!0}}if(eo(A)){let M=rr(L,G.route.id);return(b&&b.replace)!==!0&&(g=pe.Push),{pendingActionData:{},pendingActionError:{[M.route.id]:A.error}}}if($n(A))throw Qt(400,{type:"defer-action"});return{pendingActionData:{[G.route.id]:A.data}}}async function Ht(S,_,O,L,b,F,A,G){let M=L;M||(M=Y({state:"loading",location:_,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},b));let Te=b||(M.formMethod&&M.formAction&&M.formData&&M.formEncType?{formMethod:M.formMethod,formAction:M.formAction,formData:M.formData,formEncType:M.formEncType}:void 0),[W,ce]=wf(e.history,c,O,Te,_,p,f,h,A,G,V);if(Yl($e=>!(O&&O.some(_t=>_t.route.id===$e))||W&&W.some(_t=>_t.route.id===$e)),W.length===0&&ce.length===0)return N(_,Y({matches:O,loaderData:{},errors:G||null},A?{actionData:A}:{})),{shortCircuited:!0};if(!x){ce.forEach(_t=>{let vn=c.fetchers.get(_t.key),Ho={state:"loading",data:vn&&vn.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(_t.key,Ho)});let $e=A||c.actionData;se(Y({navigation:M},$e?Object.keys($e).length===0?{actionData:null}:{actionData:$e}:{},ce.length>0?{fetchers:new Map(c.fetchers)}:{}))}$=++E,ce.forEach($e=>w.set($e.key,v));let{results:ft,loaderResults:dt,fetcherResults:Cr}=await Do(c.matches,O,W,ce,S);if(S.signal.aborted)return{shortCircuited:!0};ce.forEach($e=>w.delete($e.key));let Bo=Pf(ft);if(Bo)return await gn(c,Bo,{replace:F}),{shortCircuited:!0};let{loaderData:Vo,errors:Bn}=_f(c,O,W,dt,G,ce,Cr,T);T.forEach(($e,_t)=>{$e.subscribe(vn=>{(vn||$e.done)&&T.delete(_t)})}),Vy();let Zl=qu($);return Y({loaderData:Vo,errors:Bn},Zl||ce.length>0?{fetchers:new Map(c.fetchers)}:{})}function tt(S){return c.fetchers.get(S)||l1}function yn(S,_,O,L){if(a1)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");w.has(S)&&Fo(S);let b=Hr(t,O,e.basename);if(!b){Kl(S,_,Qt(404,{pathname:O}));return}let{path:F,submission:A}=vf(O,L,!0),G=Cf(b,F);if(y=(L&&L.preventScrollReset)===!0,A&&bt(A.formMethod)){ct(S,_,F,G,b,A);return}V.set(S,{routeId:_,path:F,match:G,matches:b}),Wt(S,_,F,G,b,A)}async function ct(S,_,O,L,b,F){if(Ao(),V.delete(S),!L.route.action){let Nt=Qt(405,{method:F.formMethod,pathname:O,routeId:_});Kl(S,_,Nt);return}let A=c.fetchers.get(S),G=Y({state:"submitting"},F,{data:A&&A.data," _hasFetcherDoneAnything ":!0});c.fetchers.set(S,G),se({fetchers:new Map(c.fetchers)});let M=new AbortController,Te=Ir(e.history,O,M.signal,F);w.set(S,M);let W=await Mr("action",Te,L,b,m.basename);if(Te.signal.aborted){w.get(S)===M&&w.delete(S);return}if(cr(W)){w.delete(S),R.add(S);let Nt=Y({state:"loading"},F,{data:void 0," _hasFetcherDoneAnything ":!0});return c.fetchers.set(S,Nt),se({fetchers:new Map(c.fetchers)}),gn(c,W,{isFetchActionRedirect:!0})}if(eo(W)){Kl(S,_,W.error);return}if($n(W))throw Qt(400,{type:"defer-action"});let ce=c.navigation.location||c.location,ft=Ir(e.history,ce,M.signal),dt=c.navigation.state!=="idle"?Hr(t,c.navigation.location,e.basename):c.matches;B(dt,"Didn't find any matches after fetcher action");let Cr=++E;P.set(S,Cr);let Bo=Y({state:"loading",data:W.data},F,{" _hasFetcherDoneAnything ":!0});c.fetchers.set(S,Bo);let[Vo,Bn]=wf(e.history,c,dt,F,ce,p,f,h,{[L.route.id]:W.data},void 0,V);Bn.filter(Nt=>Nt.key!==S).forEach(Nt=>{let ql=Nt.key,nc=c.fetchers.get(ql),Xy={state:"loading",data:nc&&nc.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(ql,Xy),w.set(ql,M)}),se({fetchers:new Map(c.fetchers)});let{results:Zl,loaderResults:$e,fetcherResults:_t}=await Do(c.matches,dt,Vo,Bn,ft);if(M.signal.aborted)return;P.delete(S),w.delete(S),Bn.forEach(Nt=>w.delete(Nt.key));let vn=Pf(Zl);if(vn)return gn(c,vn);let{loaderData:Ho,errors:Jl}=_f(c,c.matches,Vo,$e,void 0,Bn,_t,T),Qy={state:"idle",data:W.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(S,Qy);let Ky=qu(Cr);c.navigation.state==="loading"&&Cr>$?(B(g,"Expected pending action"),v&&v.abort(),N(c.navigation.location,{matches:dt,loaderData:Ho,errors:Jl,fetchers:new Map(c.fetchers)})):(se(Y({errors:Jl,loaderData:xf(c.loaderData,Ho,dt,Jl)},Ky?{fetchers:new Map(c.fetchers)}:{})),p=!1)}async function Wt(S,_,O,L,b,F){let A=c.fetchers.get(S),G=Y({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},F,{data:A&&A.data," _hasFetcherDoneAnything ":!0});c.fetchers.set(S,G),se({fetchers:new Map(c.fetchers)});let M=new AbortController,Te=Ir(e.history,O,M.signal);w.set(S,M);let W=await Mr("loader",Te,L,b,m.basename);if($n(W)&&(W=await mm(W,Te.signal,!0)||W),w.get(S)===M&&w.delete(S),Te.signal.aborted)return;if(cr(W)){await gn(c,W);return}if(eo(W)){let ft=rr(c.matches,_);c.fetchers.delete(S),se({fetchers:new Map(c.fetchers),errors:{[ft.route.id]:W.error}});return}B(!$n(W),"Unhandled fetcher deferred data");let ce={state:"idle",data:W.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(S,ce),se({fetchers:new Map(c.fetchers)})}async function gn(S,_,O){var L;let{submission:b,replace:F,isFetchActionRedirect:A}=O===void 0?{}:O;_.revalidate&&(p=!0);let G=xo(S.location,_.location,Y({_isRedirect:!0},A?{_isFetchActionRedirect:!0}:{}));if(B(G,"Expected a location on the redirect navigation"),fm&&typeof((L=window)==null?void 0:L.location)<"u"){let dt=e.history.createURL(_.location).origin;if(window.location.origin!==dt){F?window.location.replace(_.location):window.location.assign(_.location);return}}v=null;let M=F===!0?pe.Replace:pe.Push,{formMethod:Te,formAction:W,formEncType:ce,formData:ft}=S.navigation;!b&&Te&&W&&ft&&ce&&(b={formMethod:Te,formAction:W,formEncType:ce,formData:ft}),i1.has(_.status)&&b&&bt(b.formMethod)?await K(M,G,{submission:Y({},b,{formAction:_.location}),preventScrollReset:y}):await K(M,G,{overrideNavigation:{state:"loading",location:G,formMethod:b?b.formMethod:void 0,formAction:b?b.formAction:void 0,formEncType:b?b.formEncType:void 0,formData:b?b.formData:void 0},preventScrollReset:y})}async function Do(S,_,O,L,b){let F=await Promise.all([...O.map(M=>Mr("loader",b,M,_,m.basename)),...L.map(M=>Mr("loader",Ir(e.history,M.path,b.signal),M.match,M.matches,m.basename))]),A=F.slice(0,O.length),G=F.slice(O.length);return await Promise.all([kf(S,O,A,b.signal,!1,c.loaderData),kf(S,L.map(M=>M.match),G,b.signal,!0)]),{results:F,loaderResults:A,fetcherResults:G}}function Ao(){p=!0,f.push(...Yl()),V.forEach((S,_)=>{w.has(_)&&(h.push(_),Fo(_))})}function Kl(S,_,O){let L=rr(c.matches,_);Xl(S),se({errors:{[L.route.id]:O},fetchers:new Map(c.fetchers)})}function Xl(S){w.has(S)&&Fo(S),V.delete(S),P.delete(S),R.delete(S),c.fetchers.delete(S)}function Fo(S){let _=w.get(S);B(_,"Expected fetch controller: "+S),_.abort(),w.delete(S)}function Ju(S){for(let _ of S){let L={state:"idle",data:tt(_).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(_,L)}}function Vy(){let S=[];for(let _ of R){let O=c.fetchers.get(_);B(O,"Expected fetcher: "+_),O.state==="loading"&&(R.delete(_),S.push(_))}Ju(S)}function qu(S){let _=[];for(let[O,L]of P)if(L0}function Hy(S,_){let O=c.blockers.get(S)||gf;return ye.get(S)!==_&&(ye.set(S,_),Z==null?Z=S:S!==Z&&Eo(!1,"A router only supports one blocker at a time")),O}function Or(S){c.blockers.delete(S),ye.delete(S),Z===S&&(Z=null)}function Uo(S,_){let O=c.blockers.get(S)||gf;B(O.state==="unblocked"&&_.state==="blocked"||O.state==="blocked"&&_.state==="blocked"||O.state==="blocked"&&_.state==="proceeding"||O.state==="blocked"&&_.state==="unblocked"||O.state==="proceeding"&&_.state==="unblocked","Invalid blocker state transition: "+O.state+" -> "+_.state),c.blockers.set(S,_),se({blockers:new Map(c.blockers)})}function ec(S){let{currentLocation:_,nextLocation:O,historyAction:L}=S;if(Z==null)return;let b=ye.get(Z);B(b,"Could not find a function for the active blocker");let F=c.blockers.get(Z);if(!(F&&F.state==="proceeding")&&b({currentLocation:_,nextLocation:O,historyAction:L}))return Z}function Yl(S){let _=[];return T.forEach((O,L)=>{(!S||S(L))&&(O.cancel(),_.push(L),T.delete(L))}),_}function Wy(S,_,O){if(o=S,l=_,i=O||(L=>L.key),!a&&c.navigation===Ca){a=!0;let L=tc(c.location,c.matches);L!=null&&se({restoreScrollPosition:L})}return()=>{o=null,l=null,i=null}}function Gy(S,_){if(o&&i&&l){let O=_.map(b=>Of(b,c.loaderData)),L=i(S,O)||S.key;o[L]=l()}}function tc(S,_){if(o&&i&&l){let O=_.map(F=>Of(F,c.loaderData)),L=i(S,O)||S.key,b=o[L];if(typeof b=="number")return b}return null}return m={get basename(){return e.basename},get state(){return c},get routes(){return t},initialize:Un,subscribe:mn,enableScrollRestoration:Wy,navigate:D,fetch:yn,revalidate:U,createHref:S=>e.history.createHref(S),encodeLocation:S=>e.history.encodeLocation(S),getFetcher:tt,deleteFetcher:Xl,dispose:kr,getBlocker:Hy,deleteBlocker:Or,_internalFetchControllers:w,_internalActiveDeferreds:T},m}function u1(e){return e!=null&&"formData"in e}function vf(e,t,n){n===void 0&&(n=!1);let r=typeof e=="string"?e:Dn(e);if(!t||!u1(t))return{path:r};if(t.formMethod&&!m1(t.formMethod))return{path:r,error:Qt(405,{method:t.formMethod})};let o;if(t.formData&&(o={formMethod:t.formMethod||"get",formAction:hm(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},bt(o.formMethod)))return{path:r,submission:o};let i=jt(r),l=pm(t.formData);return n&&i.search&&ym(i.search)&&l.append("index",""),i.search="?"+l,{path:Dn(i),submission:o}}function c1(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function wf(e,t,n,r,o,i,l,a,s,u,d){let m=u?Object.values(u)[0]:s?Object.values(s)[0]:void 0,c=e.createURL(t.location),g=e.createURL(o),y=i||c.toString()===g.toString()||c.search!==g.search,v=u?Object.keys(u)[0]:void 0,p=c1(n,v).filter((h,w)=>{if(h.route.loader==null)return!1;if(f1(t.loaderData,t.matches[w],h)||l.some(P=>P===h.route.id))return!0;let E=t.matches[w],$=h;return Sf(h,Y({currentUrl:c,currentParams:E.params,nextUrl:g,nextParams:$.params},r,{actionResult:m,defaultShouldRevalidate:y||dm(E,$)}))}),f=[];return d&&d.forEach((h,w)=>{if(n.some(E=>E.route.id===h.routeId))a.includes(w)?f.push(Y({key:w},h)):Sf(h.match,Y({currentUrl:c,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},r,{actionResult:m,defaultShouldRevalidate:y}))&&f.push(Y({key:w},h));else return}),[p,f]}function f1(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function dm(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Sf(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Mr(e,t,n,r,o,i,l,a){o===void 0&&(o="/"),i===void 0&&(i=!1),l===void 0&&(l=!1);let s,u,d,m=new Promise((g,y)=>d=y),c=()=>d();t.signal.addEventListener("abort",c);try{let g=n.route[e];B(g,"Could not find the "+e+' to run on the "'+n.route.id+'" route'),u=await Promise.race([g({request:t,params:n.params,context:a}),m]),B(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(g){s=Pe.error,u=g}finally{t.signal.removeEventListener("abort",c)}if(h1(u)){let g=u.status;if(o1.has(g)){let x=u.headers.get("Location");if(B(x,"Redirects returned/thrown from loaders/actions must have a Location header"),/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(x)){if(!i){let f=new URL(t.url),h=x.startsWith("//")?new URL(f.protocol+x):new URL(x);h.origin===f.origin&&(x=h.pathname+h.search+h.hash)}}else{let f=r.slice(0,r.indexOf(n)+1),h=sm(f).map(E=>E.pathnameBase),w=Kv(x,h,new URL(t.url).pathname);if(B(Dn(w),"Unable to resolve redirect location: "+x),o){let E=w.pathname;w.pathname=E==="/"?o:zn([o,E])}x=Dn(w)}if(i)throw u.headers.set("Location",x),u;return{type:Pe.redirect,status:g,location:x,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:s||Pe.data,response:u};let y,v=u.headers.get("Content-Type");return v&&/\bapplication\/json\b/.test(v)?y=await u.json():y=await u.text(),s===Pe.error?{type:s,error:new Tu(g,u.statusText,y),headers:u.headers}:{type:Pe.data,data:y,statusCode:u.status,headers:u.headers}}return s===Pe.error?{type:s,error:u}:u instanceof Jv?{type:Pe.deferred,deferredData:u}:{type:Pe.data,data:u}}function Ir(e,t,n,r){let o=e.createURL(hm(t)).toString(),i={signal:n};if(r&&bt(r.formMethod)){let{formMethod:l,formEncType:a,formData:s}=r;i.method=l.toUpperCase(),i.body=a==="application/x-www-form-urlencoded"?pm(s):s}return new Request(o,i)}function pm(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function d1(e,t,n,r,o){let i={},l=null,a,s=!1,u={};return n.forEach((d,m)=>{let c=t[m].route.id;if(B(!cr(d),"Cannot handle redirect results in processLoaderData"),eo(d)){let g=rr(e,c),y=d.error;r&&(y=Object.values(r)[0],r=void 0),l=l||{},l[g.route.id]==null&&(l[g.route.id]=y),i[c]=void 0,s||(s=!0,a=um(d.error)?d.error.status:500),d.headers&&(u[c]=d.headers)}else $n(d)?(o.set(c,d.deferredData),i[c]=d.deferredData.data):i[c]=d.data,d.statusCode!=null&&d.statusCode!==200&&!s&&(a=d.statusCode),d.headers&&(u[c]=d.headers)}),r&&(l=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:l,statusCode:a||200,loaderHeaders:u}}function _f(e,t,n,r,o,i,l,a){let{loaderData:s,errors:u}=d1(t,n,r,o,a);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ef(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Qt(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,l="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(l="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"&&(a="defer() is not supported in actions")):e===403?(l="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",a='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new Tu(e||500,l,new Error(a),!0)}function Pf(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(cr(n))return n}}function hm(e){let t=typeof e=="string"?jt(e):e;return Dn(Y({},t,{hash:""}))}function p1(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}function $n(e){return e.type===Pe.deferred}function eo(e){return e.type===Pe.error}function cr(e){return(e&&e.type)===Pe.redirect}function h1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function m1(e){return r1.has(e)}function bt(e){return t1.has(e)}async function kf(e,t,n,r,o,i){for(let l=0;lm.route.id===s.route.id),d=u!=null&&!dm(u,s)&&(i&&i[s.route.id])!==void 0;$n(a)&&(o||d)&&await mm(a,r,o).then(m=>{m&&(n[l]=m||n[l])})}}async function mm(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Pe.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Pe.error,error:o}}return{type:Pe.data,data:e.deferredData.data}}}function ym(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Of(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function Cf(e,t){let n=typeof t=="string"?jt(t).search:t.search;if(e[e.length-1].route.index&&ym(n||""))return e[e.length-1];let r=sm(e);return r[r.length-1]}/** - * React Router v6.8.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.value=r,o.getSnapshot=t,$a(o)&&i({inst:o})},[e,r,t]),w1(()=>($a(o)&&i({inst:o}),e(()=>{$a(o)&&i({inst:o})})),[e]),_1(r),r}function $a(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!g1(n,r)}catch{return!0}}function E1(e,t,n){return t()}const P1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",k1=!P1,O1=k1?E1:x1,C1="useSyncExternalStore"in ro?(e=>e.useSyncExternalStore)(ro):O1,Lu=k.createContext(null),Mu=k.createContext(null),gm=k.createContext(null),bl=k.createContext(null),Tl=k.createContext({outlet:null,matches:[]}),vm=k.createContext(null);function Iu(){return k.useContext(bl)!=null}function $1(){return Iu()||B(!1),k.useContext(bl).location}function R1(e,t){Iu()||B(!1);let{navigator:n}=k.useContext(gm),r=k.useContext(Mu),{matches:o}=k.useContext(Tl),i=o[o.length-1],l=i?i.params:{};i&&i.pathname;let a=i?i.pathnameBase:"/";i&&i.route;let s=$1(),u;if(t){var d;let v=typeof t=="string"?jt(t):t;a==="/"||(d=v.pathname)!=null&&d.startsWith(a)||B(!1),u=v}else u=s;let m=u.pathname||"/",c=a==="/"?m:m.slice(a.length)||"/",g=Hr(e,{pathname:c}),y=b1(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:zn([a,n.encodeLocation?n.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?a:zn([a,n.encodeLocation?n.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,r||void 0);return t&&y?k.createElement(bl.Provider,{value:{location:Yi({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:pe.Pop}},y):y}function j1(){let e=I1(),t=um(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:o},n):null,i)}class N1 extends k.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?k.createElement(Tl.Provider,{value:this.props.routeContext},k.createElement(vm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function z1(e){let{routeContext:t,match:n,children:r}=e,o=k.useContext(Lu);return o&&o.static&&o.staticContext&&n.route.errorElement&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Tl.Provider,{value:t},r)}function b1(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,o=n==null?void 0:n.errors;if(o!=null){let i=r.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));i>=0||B(!1),r=r.slice(0,Math.min(r.length,i+1))}return r.reduceRight((i,l,a)=>{let s=l.route.id?o==null?void 0:o[l.route.id]:null,u=n?l.route.errorElement||k.createElement(j1,null):null,d=t.concat(r.slice(0,a+1)),m=()=>k.createElement(z1,{match:l,routeContext:{outlet:i,matches:d}},s?u:l.route.element!==void 0?l.route.element:i);return n&&(l.route.errorElement||a===0)?k.createElement(N1,{location:n.location,component:u,error:s,children:m(),routeContext:{outlet:null,matches:d}}):m()},null)}var $f;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})($f||($f={}));var Zi;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(Zi||(Zi={}));function T1(e){let t=k.useContext(Mu);return t||B(!1),t}function L1(e){let t=k.useContext(Tl);return t||B(!1),t}function M1(e){let t=L1(),n=t.matches[t.matches.length-1];return n.route.id||B(!1),n.route.id}function I1(){var e;let t=k.useContext(vm),n=T1(Zi.UseRouteError),r=M1(Zi.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function D1(e){let{fallbackElement:t,router:n}=e,r=C1(n.subscribe,()=>n.state,()=>n.state),o=k.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:l=>n.navigate(l),push:(l,a,s)=>n.navigate(l,{state:a,preventScrollReset:s==null?void 0:s.preventScrollReset}),replace:(l,a,s)=>n.navigate(l,{replace:!0,state:a,preventScrollReset:s==null?void 0:s.preventScrollReset})}),[n]),i=n.basename||"/";return k.createElement(k.Fragment,null,k.createElement(Lu.Provider,{value:{router:n,navigator:o,static:!1,basename:i}},k.createElement(Mu.Provider,{value:r},k.createElement(F1,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:o},n.state.initialized?k.createElement(U1,null):t))),null)}function A1(e){B(!1)}function F1(e){let{basename:t="/",children:n=null,location:r,navigationType:o=pe.Pop,navigator:i,static:l=!1}=e;Iu()&&B(!1);let a=t.replace(/^\/*/,"/"),s=k.useMemo(()=>({basename:a,navigator:i,static:l}),[a,i,l]);typeof r=="string"&&(r=jt(r));let{pathname:u="/",search:d="",hash:m="",state:c=null,key:g="default"}=r,y=k.useMemo(()=>{let v=am(u,a);return v==null?null:{pathname:v,search:d,hash:m,state:c,key:g}},[a,u,d,m,c,g]);return y==null?null:k.createElement(gm.Provider,{value:s},k.createElement(bl.Provider,{children:n,value:{location:y,navigationType:o}}))}function U1(e){let{children:t,location:n}=e,r=k.useContext(Lu),o=r&&!t?r.router.routes:js(t);return R1(o,n)}var Rf;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(Rf||(Rf={}));new Promise(()=>{});function js(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,o)=>{if(!k.isValidElement(r))return;if(r.type===k.Fragment){n.push.apply(n,js(r.props.children,t));return}r.type!==A1&&B(!1),!r.props.index||!r.props.children||B(!1);let i=[...t,o],l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,hasErrorBoundary:r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle};r.props.children&&(l.children=js(r.props.children,i)),n.push(l)}),n}function wm(e){return e.map(t=>{let n=Yi({},t);return n.hasErrorBoundary==null&&(n.hasErrorBoundary=n.errorElement!=null),n.children&&(n.children=wm(n.children)),n})}/** - * React Router DOM v6.8.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;tj.createElement(t.Provider,{value:i},o),()=>{const o=k.useContext(t);if(o===null)throw new Error(e);return o}]}function Sm(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t({fontFamily:e.fontFamily||"sans-serif"})}var K1=Object.defineProperty,zf=Object.getOwnPropertySymbols,X1=Object.prototype.hasOwnProperty,Y1=Object.prototype.propertyIsEnumerable,bf=(e,t,n)=>t in e?K1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tf=(e,t)=>{for(var n in t||(t={}))X1.call(t,n)&&bf(e,n,t[n]);if(zf)for(var n of zf(t))Y1.call(t,n)&&bf(e,n,t[n]);return e};function Z1(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:Tf({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:Tf({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function bo(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function Du(e){const t=bo(e);return(n,r,o=!0,i=!0)=>{if(typeof n=="string"&&n.includes(".")){const[a,s]=n.split("."),u=parseInt(s,10);if(a in e.colors&&u>=0&&u<10)return e.colors[a][typeof r=="number"&&!i?r:u]}const l=typeof r=="number"?r:t();return n in e.colors?e.colors[n][l]:o?e.colors[e.primaryColor][l]:n}}function xm(e){let t="";for(let n=1;n{const o={from:(r==null?void 0:r.from)||e.defaultGradient.from,to:(r==null?void 0:r.to)||e.defaultGradient.to,deg:(r==null?void 0:r.deg)||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,n(),!1)} 0%, ${t(o.to,n(),!1)} 100%)`}}function Au(e){if(typeof e.size=="number")return e.size;const t=e.sizes[e.size];return t!==void 0?t:e.size||e.sizes.md}function ew(e){return t=>`@media (min-width: ${Au({size:t,sizes:e.breakpoints})}px)`}function tw(e){return t=>`@media (max-width: ${Au({size:t,sizes:e.breakpoints})-1}px)`}function nw(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function rw(e){let t=e.replace("#","");if(t.length===3){const l=t.split("");t=[l[0],l[0],l[1],l[1],l[2],l[2]].join("")}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function ow(e){const[t,n,r,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:n,b:r,a:o||1}}function Fu(e){return nw(e)?rw(e):e.startsWith("rgb")?ow(e):{r:0,g:0,b:0,a:1}}function Hn(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";const{r:n,g:r,b:o}=Fu(e);return`rgba(${n}, ${r}, ${o}, ${t})`}function iw(e=0){return{position:"absolute",top:e,right:e,left:e,bottom:e}}function lw(e,t){const{r:n,g:r,b:o,a:i}=Fu(e),l=1-t,a=s=>Math.round(s*l);return`rgba(${a(n)}, ${a(r)}, ${a(o)}, ${i})`}function aw(e,t){const{r:n,g:r,b:o,a:i}=Fu(e),l=a=>Math.round(a+(255-a)*t);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function sw(e){return t=>{if(typeof t=="number")return t;const n=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}}function uw(e,t){if(typeof e=="string"&&e.includes(".")){const[n,r]=e.split("."),o=parseInt(r,10);if(n in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:n,shade:o}}return{isSplittedColor:!1}}function cw(e){const t=Du(e),n=bo(e),r=Em(e);return({variant:o,color:i,gradient:l,primaryFallback:a})=>{const s=uw(i,e);switch(o){case"light":return{border:"transparent",background:Hn(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:Hn(t(i,e.colorScheme==="dark"?7:1,a,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:Hn(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:n("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:n("light")),hover:e.colorScheme==="dark"?Hn(t(i,5,a,!1),.05):Hn(t(i,0,a,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(i,n()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(l),color:e.white,border:"transparent",hover:null};default:{const u=n(),d=s.isSplittedColor?s.shade:u,m=s.isSplittedColor?s.key:i;return{border:"transparent",background:t(m,d,a),color:e.white,hover:t(m,d===9?8:d+1)}}}}}function fw(e){return t=>{const n=bo(e)(t);return e.colors[e.primaryColor][n]}}function dw(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function pw(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}const ge={fontStyles:Q1,themeColor:Du,focusStyles:Z1,linearGradient:J1,radialGradient:q1,smallerThan:tw,largerThan:ew,rgba:Hn,size:Au,cover:iw,darken:lw,lighten:aw,radius:sw,variant:cw,primaryShade:bo,hover:dw,gradient:Em,primaryColor:fw,placeholderStyles:pw};var hw=Object.defineProperty,mw=Object.defineProperties,yw=Object.getOwnPropertyDescriptors,Lf=Object.getOwnPropertySymbols,gw=Object.prototype.hasOwnProperty,vw=Object.prototype.propertyIsEnumerable,Mf=(e,t,n)=>t in e?hw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ww=(e,t)=>{for(var n in t||(t={}))gw.call(t,n)&&Mf(e,n,t[n]);if(Lf)for(var n of Lf(t))vw.call(t,n)&&Mf(e,n,t[n]);return e},Sw=(e,t)=>mw(e,yw(t));function Pm(e){return Sw(ww({},e),{fn:{fontStyles:ge.fontStyles(e),themeColor:ge.themeColor(e),focusStyles:ge.focusStyles(e),largerThan:ge.largerThan(e),smallerThan:ge.smallerThan(e),radialGradient:ge.radialGradient,linearGradient:ge.linearGradient,gradient:ge.gradient(e),rgba:ge.rgba,size:ge.size,cover:ge.cover,lighten:ge.lighten,darken:ge.darken,primaryShade:ge.primaryShade(e),radius:ge.radius(e),variant:ge.variant(e),hover:ge.hover,primaryColor:ge.primaryColor(e),placeholderStyles:ge.placeholderStyles(e)}})}Object.keys(_m);const km=["xs","sm","md","lg","xl"],_w={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:_m,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3,fontWeight:void 0},h2:{fontSize:26,lineHeight:1.35,fontWeight:void 0},h3:{fontSize:22,lineHeight:1.4,fontWeight:void 0},h4:{fontSize:18,lineHeight:1.45,fontWeight:void 0},h5:{fontSize:16,lineHeight:1.5,fontWeight:void 0},h6:{fontSize:14,lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(1px)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:2,outline:`2px solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},Rn=Pm(_w);function xw(e){if(e.sheet)return e.sheet;for(var t=0;t0?ke(Er,--We):0,wr--,he===10&&(wr=1,Ml--),he}function Ye(){return he=We2||ko(he)>3?"":" "}function Tw(e,t){for(;--t&&Ye()&&!(he<48||he>102||he>57&&he<65||he>70&&he<97););return To(e,Ei()+(t<6&&Rt()==32&&Ye()==32))}function bs(e){for(;Ye();)switch(he){case e:return We;case 34:case 39:e!==34&&e!==39&&bs(he);break;case 40:e===41&&bs(e);break;case 92:Ye();break}return We}function Lw(e,t){for(;Ye()&&e+he!==47+10;)if(e+he===42+42&&Rt()===47)break;return"/*"+To(t,We-1)+"*"+Ll(e===47?e:Ye())}function Mw(e){for(;!ko(Rt());)Ye();return To(e,We)}function Iw(e){return Nm(ki("",null,null,null,[""],e=jm(e),0,[0],e))}function ki(e,t,n,r,o,i,l,a,s){for(var u=0,d=0,m=l,c=0,g=0,y=0,v=1,x=1,p=1,f=0,h="",w=o,E=i,$=r,P=h;x;)switch(y=f,f=Ye()){case 40:if(y!=108&&ke(P,m-1)==58){zs(P+=J(Pi(f),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:P+=Pi(f);break;case 9:case 10:case 13:case 32:P+=bw(y);break;case 92:P+=Tw(Ei()-1,7);continue;case 47:switch(Rt()){case 42:case 47:si(Dw(Lw(Ye(),Ei()),t,n),s);break;default:P+="/"}break;case 123*v:a[u++]=Pt(P)*p;case 125*v:case 59:case 0:switch(f){case 0:case 125:x=0;case 59+d:g>0&&Pt(P)-m&&si(g>32?Df(P+";",r,n,m-1):Df(J(P," ","")+";",r,n,m-2),s);break;case 59:P+=";";default:if(si($=If(P,t,n,u,d,o,a,h,w=[],E=[],m),i),f===123)if(d===0)ki(P,t,$,$,w,i,m,a,E);else switch(c===99&&ke(P,3)===110?100:c){case 100:case 109:case 115:ki(e,$,$,r&&si(If(e,$,$,0,0,o,a,h,o,w=[],m),E),o,E,m,a,r?w:E);break;default:ki(P,$,$,$,[""],E,0,a,E)}}u=d=g=0,v=p=1,h=P="",m=l;break;case 58:m=1+Pt(P),g=y;default:if(v<1){if(f==123)--v;else if(f==125&&v++==0&&zw()==125)continue}switch(P+=Ll(f),f*v){case 38:p=d>0?1:(P+="\f",-1);break;case 44:a[u++]=(Pt(P)-1)*p,p=1;break;case 64:Rt()===45&&(P+=Pi(Ye())),c=Rt(),d=m=Pt(h=P+=Mw(Ei())),f++;break;case 45:y===45&&Pt(P)==2&&(v=0)}}return i}function If(e,t,n,r,o,i,l,a,s,u,d){for(var m=o-1,c=o===0?i:[""],g=Vu(c),y=0,v=0,x=0;y0?c[p]+" "+f:J(f,/&\f/g,c[p])))&&(s[x++]=h);return Il(e,t,n,o===0?Uu:a,s,u,d)}function Dw(e,t,n){return Il(e,t,n,Om,Ll(Nw()),Po(e,2,-2),0)}function Df(e,t,n,r){return Il(e,t,n,Bu,Po(e,0,r),Po(e,r+1,-1),r)}function fr(e,t){for(var n="",r=Vu(e),o=0;o6)switch(ke(e,t+1)){case 109:if(ke(e,t+4)!==45)break;case 102:return J(e,/(.+:)(.+)-([^]+)/,"$1"+X+"$2-$3$1"+Ji+(ke(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~zs(e,"stretch")?zm(J(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ke(e,t+1)!==115)break;case 6444:switch(ke(e,Pt(e)-3-(~zs(e,"!important")&&10))){case 107:return J(e,":",":"+X)+e;case 101:return J(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+X+(ke(e,14)===45?"inline-":"")+"box$3$1"+X+"$2$3$1"+Ne+"$2box$3")+e}break;case 5936:switch(ke(e,t+11)){case 114:return X+e+Ne+J(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return X+e+Ne+J(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return X+e+Ne+J(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return X+e+Ne+e+e}return e}var Kw=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case Bu:t.return=zm(t.value,t.length);break;case Cm:return fr([Dr(t,{value:J(t.value,"@","@"+X)})],o);case Uu:if(t.length)return jw(t.props,function(i){switch(Rw(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return fr([Dr(t,{props:[J(i,/:(read-\w+)/,":"+Ji+"$1")]})],o);case"::placeholder":return fr([Dr(t,{props:[J(i,/:(plac\w+)/,":"+X+"input-$1")]}),Dr(t,{props:[J(i,/:(plac\w+)/,":"+Ji+"$1")]}),Dr(t,{props:[J(i,/:(plac\w+)/,Ne+"input-$1")]})],o)}return""})}},Xw=[Kw],bm=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(v){var x=v.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var o=t.stylisPlugins||Xw,i={},l,a=[];l=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(v){for(var x=v.getAttribute("data-emotion").split(" "),p=1;p=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var sS={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},uS=/[A-Z]|^ms/g,cS=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dm=function(t){return t.charCodeAt(1)===45},Uf=function(t){return t!=null&&typeof t!="boolean"},Ra=Bw(function(e){return Dm(e)?e:e.replace(uS,"-$&").toLowerCase()}),Bf=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(cS,function(r,o,i){return kt={name:o,styles:i,next:kt},o})}return sS[t]!==1&&!Dm(t)&&typeof n=="number"&&n!==0?n+"px":n};function Oo(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return kt={name:n.name,styles:n.styles,next:kt},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)kt={name:r.name,styles:r.styles,next:kt},r=r.next;var o=n.styles+";";return o}return fS(e,t,n)}case"function":{if(e!==void 0){var i=kt,l=n(e);return kt=i,Oo(e,t,l)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function fS(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ot in e?vS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ES=(e,t)=>{for(var n in t||(t={}))_S.call(t,n)&&Gf(e,n,t[n]);if(Wf)for(var n of Wf(t))xS.call(t,n)&&Gf(e,n,t[n]);return e},PS=(e,t)=>wS(e,SS(t));function kS({theme:e}){return j.createElement(Lo,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:PS(ES({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function ui(e,t,n){Object.keys(t).forEach(r=>{e[`--mantine-${n}-${r}`]=typeof t[r]=="number"?`${t[r]}px`:t[r]})}function OS({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":`${e.headings.fontWeight}`};ui(t,e.shadows,"shadow"),ui(t,e.fontSizes,"font-size"),ui(t,e.radius,"radius"),ui(t,e.spacing,"spacing"),Object.keys(e.colors).forEach(r=>{e.colors[r].forEach((o,i)=>{t[`--mantine-color-${r}-${i}`]=o})});const n=e.headings.sizes;return Object.keys(n).forEach(r=>{t[`--mantine-${r}-font-size`]=`${n[r].fontSize}px`,t[`--mantine-${r}-line-height`]=`${n[r].lineHeight}`}),j.createElement(Lo,{styles:{":root":t}})}var CS=Object.defineProperty,$S=Object.defineProperties,RS=Object.getOwnPropertyDescriptors,Qf=Object.getOwnPropertySymbols,jS=Object.prototype.hasOwnProperty,NS=Object.prototype.propertyIsEnumerable,Kf=(e,t,n)=>t in e?CS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wn=(e,t)=>{for(var n in t||(t={}))jS.call(t,n)&&Kf(e,n,t[n]);if(Qf)for(var n of Qf(t))NS.call(t,n)&&Kf(e,n,t[n]);return e},Xf=(e,t)=>$S(e,RS(t));function zS(e,t){if(!t)return e;const n=Object.keys(e).reduce((r,o)=>{if(o==="headings"&&t.headings){const i=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,a)=>(l[a]=wn(wn({},e.headings.sizes[a]),t.headings.sizes[a]),l),{}):e.headings.sizes;return Xf(wn({},r),{headings:Xf(wn(wn({},e.headings),t.headings),{sizes:i})})}return r[o]=typeof t[o]=="object"?wn(wn({},e[o]),t[o]):typeof t[o]=="number"||typeof t[o]=="boolean"||typeof t[o]=="function"?t[o]:t[o]||e[o],r},{});if(!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function bS(e,t){return Pm(zS(e,t))}function Fm(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}const TS={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:"1px dotted ButtonText"},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"},"[hidden]":{display:"none"}};function LS(){return j.createElement(Lo,{styles:TS})}var MS=Object.defineProperty,Yf=Object.getOwnPropertySymbols,IS=Object.prototype.hasOwnProperty,DS=Object.prototype.propertyIsEnumerable,Zf=(e,t,n)=>t in e?MS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,to=(e,t)=>{for(var n in t||(t={}))IS.call(t,n)&&Zf(e,n,t[n]);if(Yf)for(var n of Yf(t))DS.call(t,n)&&Zf(e,n,t[n]);return e};const qi=k.createContext({theme:Rn});function Vt(){var e;return((e=k.useContext(qi))==null?void 0:e.theme)||Rn}function AS(e){const t=Vt(),n=r=>{var o,i;return{styles:((o=t.components[r])==null?void 0:o.styles)||{},classNames:((i=t.components[r])==null?void 0:i.classNames)||{}}};return Array.isArray(e)?e.map(n):[n(e)]}function Um(){var e;return(e=k.useContext(qi))==null?void 0:e.emotionCache}function ut(e,t,n){var r;const o=Vt(),i=(r=o.components[e])==null?void 0:r.defaultProps,l=typeof i=="function"?i(o):i;return to(to(to({},t),l),Fm(n))}function Bm({theme:e,emotionCache:t,withNormalizeCSS:n=!1,withGlobalStyles:r=!1,withCSSVariables:o=!1,inherit:i=!1,children:l}){const a=k.useContext(qi),s=bS(Rn,i?to(to({},a.theme),e):e);return j.createElement(yS,{theme:s},j.createElement(qi.Provider,{value:{theme:s,emotionCache:t}},n&&j.createElement(LS,null),r&&j.createElement(kS,{theme:s}),o&&j.createElement(OS,{theme:s}),typeof s.globalStyles=="function"&&j.createElement(Lo,{styles:s.globalStyles(s)}),l))}Bm.displayName="@mantine/core/MantineProvider";const FS={app:100,modal:200,popover:300,overlay:400,max:9999};function US(e){return FS[e]}function BS(e,t){const n=k.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const VS=bm({key:"mantine",prepend:!0});function HS(){return Um()||VS}var WS=Object.defineProperty,Jf=Object.getOwnPropertySymbols,GS=Object.prototype.hasOwnProperty,QS=Object.prototype.propertyIsEnumerable,qf=(e,t,n)=>t in e?WS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KS=(e,t)=>{for(var n in t||(t={}))GS.call(t,n)&&qf(e,n,t[n]);if(Jf)for(var n of Jf(t))QS.call(t,n)&&qf(e,n,t[n]);return e};const ja="ref";function XS(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(ja in n))return{args:e,ref:t};t=n[ja];const r=KS({},n);return delete r[ja],{args:[r],ref:t}}const{cssFactory:YS}=(()=>{function e(n,r,o){const i=[],l=iS(n,i,o);return i.length<2?o:l+r(i)}function t(n){const{cache:r}=n,o=(...l)=>{const{ref:a,args:s}=XS(l),u=Qu(s,r.registered);return Im(r,u,!1),`${r.key}-${u.name}${a===void 0?"":` ${a}`}`};return{css:o,cx:(...l)=>e(r.registered,o,G1(l))}}return{cssFactory:t}})();function Vm(){const e=HS();return BS(()=>YS({cache:e}),[e])}function ZS({cx:e,classes:t,context:n,classNames:r,name:o,cache:i}){const l=n.reduce((a,s)=>(Object.keys(s.classNames).forEach(u=>{typeof a[u]!="string"?a[u]=`${s.classNames[u]}`:a[u]=`${a[u]} ${s.classNames[u]}`}),a),{});return Object.keys(t).reduce((a,s)=>(a[s]=e(t[s],l[s],r!=null&&r[s],Array.isArray(o)?o.filter(Boolean).map(u=>`${(i==null?void 0:i.key)||"mantine"}-${u}-${s}`).join(" "):o?`${(i==null?void 0:i.key)||"mantine"}-${o}-${s}`:null),a),{})}var JS=Object.defineProperty,ed=Object.getOwnPropertySymbols,qS=Object.prototype.hasOwnProperty,e_=Object.prototype.propertyIsEnumerable,td=(e,t,n)=>t in e?JS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t)=>{for(var n in t||(t={}))qS.call(t,n)&&td(e,n,t[n]);if(ed)for(var n of ed(t))e_.call(t,n)&&td(e,n,t[n]);return e};function t_(e){return`__mantine-ref-${e||""}`}function nd(e,t,n){const r=o=>typeof o=="function"?o(t,n||{}):o||{};return Array.isArray(e)?e.map(o=>r(o.styles)).reduce((o,i)=>(Object.keys(i).forEach(l=>{o[l]?o[l]=Na(Na({},o[l]),i[l]):o[l]=Na({},i[l])}),o),{}):r(e)}function St(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const i=Vt(),l=AS(o==null?void 0:o.name),a=Um(),{css:s,cx:u}=Vm(),d=t(i,r,t_),m=nd(o==null?void 0:o.styles,i,r),c=nd(l,i,r),g=Object.fromEntries(Object.keys(d).map(y=>{const v=u({[s(d[y])]:!(o!=null&&o.unstyled)},s(c[y]),s(m[y]));return[y,v]}));return{classes:ZS({cx:u,classes:g,context:l,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:a}),cx:u,theme:i}}return n}function n_({styles:e}){const t=Vt();return j.createElement(Lo,{styles:gS(typeof e=="function"?e(t):e)})}var rd=Object.getOwnPropertySymbols,r_=Object.prototype.hasOwnProperty,o_=Object.prototype.propertyIsEnumerable,i_=(e,t)=>{var n={};for(var r in e)r_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rd)for(var r of rd(e))t.indexOf(r)<0&&o_.call(e,r)&&(n[r]=e[r]);return n};function l_(e){const t=e,{m:n,mx:r,my:o,mt:i,mb:l,ml:a,mr:s,p:u,px:d,py:m,pt:c,pb:g,pl:y,pr:v,bg:x,c:p,opacity:f,ff:h,fz:w,fw:E,lts:$,ta:P,lh:R,fs:V,tt:T,td:Z,w:ye,miw:Ge,maw:Un,h:kr,mih:mn,mah:se,bgsz:N,bgp:D,bgr:U,bga:K,pos:ue,top:Ht,left:tt,bottom:yn,right:ct,inset:Wt,display:gn}=t,Do=i_(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:Fm({m:n,mx:r,my:o,mt:i,mb:l,ml:a,mr:s,p:u,px:d,py:m,pt:c,pb:g,pl:y,pr:v,bg:x,c:p,opacity:f,ff:h,fz:w,fw:E,lts:$,ta:P,lh:R,fs:V,tt:T,td:Z,w:ye,miw:Ge,maw:Un,h:kr,mih:mn,mah:se,bgsz:N,bgp:D,bgr:U,bga:K,pos:ue,top:Ht,left:tt,bottom:yn,right:ct,inset:Wt,display:gn}),rest:Do}}function a_(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>t.fn.size({size:r,sizes:t.breakpoints})-t.fn.size({size:o,sizes:t.breakpoints}));return"base"in e?["base",...n]:n}function s_({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return a_(e,t).reduce((l,a)=>{if(a==="base"&&e.base!==void 0){const u=n(e.base,t);return Array.isArray(r)?(r.forEach(d=>{l[d]=u}),l):(l[r]=u,l)}const s=n(e[a],t);return Array.isArray(r)?(l[t.fn.largerThan(a)]={},r.forEach(u=>{l[t.fn.largerThan(a)][u]=s}),l):(l[t.fn.largerThan(a)]={[r]:s},l)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((i,l)=>(i[l]=o,i),{}):{[r]:o}}function u_(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function c_(e){return e}function f_(e,t){return t.fn.size({size:e,sizes:t.fontSizes})}const d_=["-xs","-sm","-md","-lg","-xl"];function p_(e,t){return d_.includes(e)?t.fn.size({size:e.replace("-",""),sizes:t.spacing})*-1:t.fn.size({size:e,sizes:t.spacing})}const h_={color:u_,default:c_,fontSize:f_,spacing:p_},m_={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"default",property:"opacity"},ff:{type:"default",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"default",property:"fontWeight"},lts:{type:"default",property:"letterSpacing"},ta:{type:"default",property:"textAlign"},lh:{type:"default",property:"lineHeight"},fs:{type:"default",property:"fontStyle"},tt:{type:"default",property:"textTransform"},td:{type:"default",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"default",property:"background-size"},bgp:{type:"default",property:"background-position"},bgr:{type:"default",property:"background-repeat"},bga:{type:"default",property:"background-attachment"},pos:{type:"default",property:"position"},top:{type:"default",property:"top"},left:{type:"default",property:"left"},bottom:{type:"default",property:"bottom"},right:{type:"default",property:"right"},inset:{type:"default",property:"inset"},display:{type:"default",property:"display"}};var y_=Object.defineProperty,od=Object.getOwnPropertySymbols,g_=Object.prototype.hasOwnProperty,v_=Object.prototype.propertyIsEnumerable,id=(e,t,n)=>t in e?y_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ld=(e,t)=>{for(var n in t||(t={}))g_.call(t,n)&&id(e,n,t[n]);if(od)for(var n of od(t))v_.call(t,n)&&id(e,n,t[n]);return e};function ad(e,t,n=m_){return Object.keys(n).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push(s_({value:e[i],getValue:h_[n[i].type],property:n[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(l=>{typeof i[l]=="object"&&i[l]!==null&&l in o?o[l]=ld(ld({},o[l]),i[l]):o[l]=i[l]}),o),{})}function sd(e,t){return typeof e=="function"?e(t):e}function w_(e,t,n){const r=Vt(),{css:o,cx:i}=Vm();return Array.isArray(e)?i(n,o(ad(t,r)),e.map(l=>o(sd(l,r)))):i(n,o(sd(e,r)),o(ad(t,r)))}var S_=Object.defineProperty,el=Object.getOwnPropertySymbols,Hm=Object.prototype.hasOwnProperty,Wm=Object.prototype.propertyIsEnumerable,ud=(e,t,n)=>t in e?S_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__=(e,t)=>{for(var n in t||(t={}))Hm.call(t,n)&&ud(e,n,t[n]);if(el)for(var n of el(t))Wm.call(t,n)&&ud(e,n,t[n]);return e},x_=(e,t)=>{var n={};for(var r in e)Hm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&el)for(var r of el(e))t.indexOf(r)<0&&Wm.call(e,r)&&(n[r]=e[r]);return n};const Gm=k.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:i,sx:l}=n,a=x_(n,["className","component","style","sx"]);const{systemStyles:s,rest:u}=l_(a),d=o||"div";return j.createElement(d,__({ref:t,className:w_(l,s,r),style:i},u))});Gm.displayName="@mantine/core/Box";const st=Gm;var E_=Object.defineProperty,P_=Object.defineProperties,k_=Object.getOwnPropertyDescriptors,cd=Object.getOwnPropertySymbols,O_=Object.prototype.hasOwnProperty,C_=Object.prototype.propertyIsEnumerable,fd=(e,t,n)=>t in e?E_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dd=(e,t)=>{for(var n in t||(t={}))O_.call(t,n)&&fd(e,n,t[n]);if(cd)for(var n of cd(t))C_.call(t,n)&&fd(e,n,t[n]);return e},$_=(e,t)=>P_(e,k_(t)),R_=St(e=>({root:$_(dd(dd({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const j_=R_;var N_=Object.defineProperty,tl=Object.getOwnPropertySymbols,Qm=Object.prototype.hasOwnProperty,Km=Object.prototype.propertyIsEnumerable,pd=(e,t,n)=>t in e?N_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z_=(e,t)=>{for(var n in t||(t={}))Qm.call(t,n)&&pd(e,n,t[n]);if(tl)for(var n of tl(t))Km.call(t,n)&&pd(e,n,t[n]);return e},b_=(e,t)=>{var n={};for(var r in e)Qm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tl)for(var r of tl(e))t.indexOf(r)<0&&Km.call(e,r)&&(n[r]=e[r]);return n};const Xm=k.forwardRef((e,t)=>{const n=ut("UnstyledButton",{},e),{className:r,component:o="button",unstyled:i}=n,l=b_(n,["className","component","unstyled"]),{classes:a,cx:s}=j_(null,{name:"UnstyledButton",unstyled:i});return j.createElement(st,z_({component:o,ref:t,className:s(a.root,r),type:o==="button"?"button":void 0},l))});Xm.displayName="@mantine/core/UnstyledButton";const T_=Xm;var L_=Object.defineProperty,nl=Object.getOwnPropertySymbols,Ym=Object.prototype.hasOwnProperty,Zm=Object.prototype.propertyIsEnumerable,hd=(e,t,n)=>t in e?L_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M_=(e,t)=>{for(var n in t||(t={}))Ym.call(t,n)&&hd(e,n,t[n]);if(nl)for(var n of nl(t))Zm.call(t,n)&&hd(e,n,t[n]);return e},I_=(e,t)=>{var n={};for(var r in e)Ym.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nl)for(var r of nl(e))t.indexOf(r)<0&&Zm.call(e,r)&&(n[r]=e[r]);return n};function D_(e){var t=e,{size:n,color:r}=t,o=I_(t,["size","color"]);return j.createElement("svg",M_({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:`${n}px`},o),j.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},j.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),j.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},j.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),j.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},j.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),j.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},j.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),j.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},j.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var A_=Object.defineProperty,rl=Object.getOwnPropertySymbols,Jm=Object.prototype.hasOwnProperty,qm=Object.prototype.propertyIsEnumerable,md=(e,t,n)=>t in e?A_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F_=(e,t)=>{for(var n in t||(t={}))Jm.call(t,n)&&md(e,n,t[n]);if(rl)for(var n of rl(t))qm.call(t,n)&&md(e,n,t[n]);return e},U_=(e,t)=>{var n={};for(var r in e)Jm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rl)for(var r of rl(e))t.indexOf(r)<0&&qm.call(e,r)&&(n[r]=e[r]);return n};function B_(e){var t=e,{size:n,color:r}=t,o=U_(t,["size","color"]);return j.createElement("svg",F_({width:`${n}px`,height:`${n}px`,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},o),j.createElement("g",{fill:"none",fillRule:"evenodd"},j.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},j.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),j.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},j.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var V_=Object.defineProperty,ol=Object.getOwnPropertySymbols,ey=Object.prototype.hasOwnProperty,ty=Object.prototype.propertyIsEnumerable,yd=(e,t,n)=>t in e?V_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H_=(e,t)=>{for(var n in t||(t={}))ey.call(t,n)&&yd(e,n,t[n]);if(ol)for(var n of ol(t))ty.call(t,n)&&yd(e,n,t[n]);return e},W_=(e,t)=>{var n={};for(var r in e)ey.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ol)for(var r of ol(e))t.indexOf(r)<0&&ty.call(e,r)&&(n[r]=e[r]);return n};function G_(e){var t=e,{size:n,color:r}=t,o=W_(t,["size","color"]);return j.createElement("svg",H_({width:`${n}px`,height:`${n/4}px`,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},o),j.createElement("circle",{cx:"15",cy:"15",r:"15"},j.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),j.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},j.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),j.createElement("circle",{cx:"105",cy:"15",r:"15"},j.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),j.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var Q_=Object.defineProperty,il=Object.getOwnPropertySymbols,ny=Object.prototype.hasOwnProperty,ry=Object.prototype.propertyIsEnumerable,gd=(e,t,n)=>t in e?Q_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K_=(e,t)=>{for(var n in t||(t={}))ny.call(t,n)&&gd(e,n,t[n]);if(il)for(var n of il(t))ry.call(t,n)&&gd(e,n,t[n]);return e},X_=(e,t)=>{var n={};for(var r in e)ny.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&il)for(var r of il(e))t.indexOf(r)<0&&ry.call(e,r)&&(n[r]=e[r]);return n};const za={bars:D_,oval:B_,dots:G_},Y_={xs:18,sm:22,md:36,lg:44,xl:58},Z_={size:"md"};function oy(e){const t=ut("Loader",Z_,e),{size:n,color:r,variant:o}=t,i=X_(t,["size","color","variant"]),l=Vt(),a=o in za?o:l.loader;return j.createElement(st,K_({role:"presentation",component:za[a]||za.bars,size:l.fn.size({size:n,sizes:Y_}),color:l.fn.variant({variant:"filled",primaryFallback:!1,color:r||l.primaryColor}).background},i))}oy.displayName="@mantine/core/Loader";const iy=k.createContext({zIndex:1e3,fixed:!1,layout:"default"}),J_=iy.Provider;function q_(){return k.useContext(iy)}function ly(e,t){if(!e)return[];const n=Object.keys(e).filter(r=>r!=="base").map(r=>[t.fn.size({size:r,sizes:t.breakpoints}),e[r]]);return n.sort((r,o)=>r[0]-o[0]),n}var ex=Object.defineProperty,tx=Object.defineProperties,nx=Object.getOwnPropertyDescriptors,vd=Object.getOwnPropertySymbols,rx=Object.prototype.hasOwnProperty,ox=Object.prototype.propertyIsEnumerable,wd=(e,t,n)=>t in e?ex(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ba=(e,t)=>{for(var n in t||(t={}))rx.call(t,n)&&wd(e,n,t[n]);if(vd)for(var n of vd(t))ox.call(t,n)&&wd(e,n,t[n]);return e},Sd=(e,t)=>tx(e,nx(t)),ix=St((e,{height:t,fixed:n,position:r,zIndex:o,borderPosition:i,layout:l})=>{const a=typeof t=="object"&&t!==null?ly(t,e).reduce((s,[u,d])=>(s[`@media (min-width: ${u}px)`]={height:d,minHeight:d},s),{}):null;return{root:Sd(ba(Sd(ba(ba({},e.fn.fontStyles()),r),{zIndex:o,left:l==="alt"?"var(--mantine-navbar-width, 0)":0,right:l==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,maxHeight:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,position:n?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),a),{borderBottom:i==="bottom"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:i==="top"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const lx=ix;var ax=Object.defineProperty,ll=Object.getOwnPropertySymbols,ay=Object.prototype.hasOwnProperty,sy=Object.prototype.propertyIsEnumerable,_d=(e,t,n)=>t in e?ax(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xd=(e,t)=>{for(var n in t||(t={}))ay.call(t,n)&&_d(e,n,t[n]);if(ll)for(var n of ll(t))sy.call(t,n)&&_d(e,n,t[n]);return e},sx=(e,t)=>{var n={};for(var r in e)ay.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ll)for(var r of ll(e))t.indexOf(r)<0&&sy.call(e,r)&&(n[r]=e[r]);return n};const uy=k.forwardRef((e,t)=>{var n=e,{children:r,className:o,classNames:i,styles:l,height:a,fixed:s=!1,withBorder:u=!0,position:d,zIndex:m,section:c,unstyled:g,__staticSelector:y}=n,v=sx(n,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector"]);const x=q_(),p=m||x.zIndex||US("app"),{classes:f,cx:h,theme:w}=lx({height:a,fixed:x.fixed||s,position:d,zIndex:typeof p=="number"&&x.layout==="default"?p+1:p,layout:x.layout,borderPosition:u?c==="header"?"bottom":"top":"none"},{name:y,classNames:i,styles:l,unstyled:g}),E=typeof a=="object"&&a!==null?ly(a,w).reduce(($,[P,R])=>($[`@media (min-width: ${P}px)`]={[`--mantine-${c}-height`]:`${R}px`},$),{}):null;return j.createElement(st,xd({component:c==="header"?"header":"footer",className:h(f.root,o),ref:t},v),r,j.createElement(n_,{styles:()=>({":root":xd({[`--mantine-${c}-height`]:typeof a=="object"?`${a==null?void 0:a.base}px`||"100%":`${a}px`},E)})}))});uy.displayName="@mantine/core/VerticalSection";var ux=Object.defineProperty,cx=Object.defineProperties,fx=Object.getOwnPropertyDescriptors,Ed=Object.getOwnPropertySymbols,dx=Object.prototype.hasOwnProperty,px=Object.prototype.propertyIsEnumerable,Pd=(e,t,n)=>t in e?ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hx=(e,t)=>{for(var n in t||(t={}))dx.call(t,n)&&Pd(e,n,t[n]);if(Ed)for(var n of Ed(t))px.call(t,n)&&Pd(e,n,t[n]);return e},mx=(e,t)=>cx(e,fx(t));const yx={fixed:!1,position:{top:0,left:0,right:0}},cy=k.forwardRef((e,t)=>{const n=ut("Header",yx,e);return j.createElement(uy,mx(hx({section:"header",__staticSelector:"Header"},n),{ref:t}))});cy.displayName="@mantine/core/Header";var gx=Object.defineProperty,kd=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,wx=Object.prototype.propertyIsEnumerable,Od=(e,t,n)=>t in e?gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sx=(e,t)=>{for(var n in t||(t={}))vx.call(t,n)&&Od(e,n,t[n]);if(kd)for(var n of kd(t))wx.call(t,n)&&Od(e,n,t[n]);return e};function _x(e,t){const n=t.fn.size({size:e.padding,sizes:t.spacing}),r=e.navbarOffsetBreakpoint?t.fn.size({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?t.fn.size({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;return e.fixed?{minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${n}px)`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${n}px)`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${n}px)`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${n}px)`,[`@media (max-width: ${r-1}px)`]:{paddingLeft:n},[`@media (max-width: ${o-1}px)`]:{paddingRight:n}}:{padding:n}}var xx=St((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:Sx({flex:1,width:"100vw",boxSizing:"border-box"},_x(t,e))}));const Ex=xx;var Px=Object.defineProperty,al=Object.getOwnPropertySymbols,fy=Object.prototype.hasOwnProperty,dy=Object.prototype.propertyIsEnumerable,Cd=(e,t,n)=>t in e?Px(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kx=(e,t)=>{for(var n in t||(t={}))fy.call(t,n)&&Cd(e,n,t[n]);if(al)for(var n of al(t))dy.call(t,n)&&Cd(e,n,t[n]);return e},Ox=(e,t)=>{var n={};for(var r in e)fy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&al)for(var r of al(e))t.indexOf(r)<0&&dy.call(e,r)&&(n[r]=e[r]);return n};const Cx={fixed:!0,padding:"md"},py=k.forwardRef((e,t)=>{const n=ut("AppShell",Cx,e),{children:r,navbar:o,header:i,footer:l,aside:a,fixed:s,zIndex:u,padding:d,navbarOffsetBreakpoint:m,asideOffsetBreakpoint:c,className:g,styles:y,classNames:v,unstyled:x,hidden:p,layout:f}=n,h=Ox(n,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout"]),{classes:w,cx:E}=Ex({padding:d,fixed:s,navbarOffsetBreakpoint:m,asideOffsetBreakpoint:c},{styles:y,classNames:v,unstyled:x,name:"AppShell"});return p?j.createElement(j.Fragment,null,r):j.createElement(J_,{value:{fixed:s,zIndex:u,layout:f}},j.createElement(st,kx({className:E(w.root,g),ref:t},h),i,j.createElement("div",{className:w.body},o,j.createElement("main",{className:w.main},r),a),l))});py.displayName="@mantine/core/AppShell";const Ar={xs:30,sm:36,md:42,lg:50,xl:60};var $x=St((e,{orientation:t,buttonBorderWidth:n})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"&:last-of-type":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:-n,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const Rx=$x;var jx=Object.defineProperty,sl=Object.getOwnPropertySymbols,hy=Object.prototype.hasOwnProperty,my=Object.prototype.propertyIsEnumerable,$d=(e,t,n)=>t in e?jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nx=(e,t)=>{for(var n in t||(t={}))hy.call(t,n)&&$d(e,n,t[n]);if(sl)for(var n of sl(t))my.call(t,n)&&$d(e,n,t[n]);return e},zx=(e,t)=>{var n={};for(var r in e)hy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sl)for(var r of sl(e))t.indexOf(r)<0&&my.call(e,r)&&(n[r]=e[r]);return n};const bx={orientation:"horizontal",buttonBorderWidth:1},yy=k.forwardRef((e,t)=>{const n=ut("ButtonGroup",bx,e),{className:r,orientation:o,buttonBorderWidth:i,unstyled:l}=n,a=zx(n,["className","orientation","buttonBorderWidth","unstyled"]),{classes:s,cx:u}=Rx({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:l});return j.createElement(st,Nx({className:u(s.root,r),ref:t},a))});yy.displayName="@mantine/core/ButtonGroup";var Tx=Object.defineProperty,Lx=Object.defineProperties,Mx=Object.getOwnPropertyDescriptors,Rd=Object.getOwnPropertySymbols,Ix=Object.prototype.hasOwnProperty,Dx=Object.prototype.propertyIsEnumerable,jd=(e,t,n)=>t in e?Tx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pn=(e,t)=>{for(var n in t||(t={}))Ix.call(t,n)&&jd(e,n,t[n]);if(Rd)for(var n of Rd(t))Dx.call(t,n)&&jd(e,n,t[n]);return e},Is=(e,t)=>Lx(e,Mx(t));const Ds={xs:{height:Ar.xs,paddingLeft:14,paddingRight:14},sm:{height:Ar.sm,paddingLeft:18,paddingRight:18},md:{height:Ar.md,paddingLeft:22,paddingRight:22},lg:{height:Ar.lg,paddingLeft:26,paddingRight:26},xl:{height:Ar.xl,paddingLeft:32,paddingRight:32},"compact-xs":{height:22,paddingLeft:7,paddingRight:7},"compact-sm":{height:26,paddingLeft:8,paddingRight:8},"compact-md":{height:30,paddingLeft:10,paddingRight:10},"compact-lg":{height:34,paddingLeft:12,paddingRight:12},"compact-xl":{height:40,paddingLeft:14,paddingRight:14}};function Ax({compact:e,size:t,withLeftIcon:n,withRightIcon:r}){if(e)return Ds[`compact-${t}`];const o=Ds[t];return Is(Pn({},o),{paddingLeft:n?o.paddingLeft/1.5:o.paddingLeft,paddingRight:r?o.paddingRight/1.5:o.paddingRight})}const Fx=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function Ux({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:Pn({border:`1px solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var Bx=St((e,{color:t,size:n,radius:r,fullWidth:o,compact:i,gradient:l,variant:a,withLeftIcon:s,withRightIcon:u})=>({root:Is(Pn(Is(Pn(Pn(Pn(Pn({},Ax({compact:i,size:n,withLeftIcon:s,withRightIcon:u})),e.fn.fontStyles()),e.fn.focusStyles()),Fx(o)),{borderRadius:e.fn.radius(r),fontWeight:600,position:"relative",lineHeight:1,fontSize:e.fn.size({size:n,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),Ux({variant:a,theme:e,color:t,gradient:l})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(r),cursor:"not-allowed"}}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:10},rightIcon:{marginLeft:10},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const Vx=Bx;var Hx=Object.defineProperty,ul=Object.getOwnPropertySymbols,gy=Object.prototype.hasOwnProperty,vy=Object.prototype.propertyIsEnumerable,Nd=(e,t,n)=>t in e?Hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zd=(e,t)=>{for(var n in t||(t={}))gy.call(t,n)&&Nd(e,n,t[n]);if(ul)for(var n of ul(t))vy.call(t,n)&&Nd(e,n,t[n]);return e},Wx=(e,t)=>{var n={};for(var r in e)gy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ul)for(var r of ul(e))t.indexOf(r)<0&&vy.call(e,r)&&(n[r]=e[r]);return n};const Gx={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},Ku=k.forwardRef((e,t)=>{const n=ut("Button",Gx,e),{className:r,size:o,color:i,type:l,disabled:a,children:s,leftIcon:u,rightIcon:d,fullWidth:m,variant:c,radius:g,uppercase:y,compact:v,loading:x,loaderPosition:p,loaderProps:f,gradient:h,classNames:w,styles:E,unstyled:$}=n,P=Wx(n,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:R,cx:V,theme:T}=Vx({radius:g,color:i,size:o,fullWidth:m,compact:v,gradient:h,variant:c,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:$,classNames:w,styles:E}),Z=T.fn.variant({color:i,variant:c}),ye=j.createElement(oy,zd({color:Z.color,size:T.fn.size({size:o,sizes:Ds}).height/2},f));return j.createElement(T_,zd({className:V(R.root,r),type:l,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":x||void 0,ref:t,unstyled:$},P),j.createElement("div",{className:R.inner},(u||x&&p==="left")&&j.createElement("span",{className:V(R.icon,R.leftIcon)},x&&p==="left"?ye:u),x&&p==="center"&&j.createElement("span",{className:R.centerLoader},ye),j.createElement("span",{className:R.label,style:{textTransform:y?"uppercase":void 0}},s),(d||x&&p==="right")&&j.createElement("span",{className:V(R.icon,R.rightIcon)},x&&p==="right"?ye:d)))});Ku.displayName="@mantine/core/Button";Ku.Group=yy;const wy=Ku;function Qx(e){return k.Children.toArray(e).filter(Boolean)}const Kx={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var Xx=St((e,{spacing:t,position:n,noWrap:r,grow:o,align:i,count:l})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:r?"nowrap":"wrap",justifyContent:Kx[n],gap:e.fn.size({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/l}% - ${e.fn.size({size:t,sizes:e.spacing})-e.fn.size({size:t,sizes:e.spacing})/l}px)`:void 0,flexGrow:o?1:0}}}));const Yx=Xx;var Zx=Object.defineProperty,cl=Object.getOwnPropertySymbols,Sy=Object.prototype.hasOwnProperty,_y=Object.prototype.propertyIsEnumerable,bd=(e,t,n)=>t in e?Zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jx=(e,t)=>{for(var n in t||(t={}))Sy.call(t,n)&&bd(e,n,t[n]);if(cl)for(var n of cl(t))_y.call(t,n)&&bd(e,n,t[n]);return e},qx=(e,t)=>{var n={};for(var r in e)Sy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cl)for(var r of cl(e))t.indexOf(r)<0&&_y.call(e,r)&&(n[r]=e[r]);return n};const eE={position:"left",spacing:"md"},xy=k.forwardRef((e,t)=>{const n=ut("Group",eE,e),{className:r,position:o,align:i,children:l,noWrap:a,grow:s,spacing:u,unstyled:d}=n,m=qx(n,["className","position","align","children","noWrap","grow","spacing","unstyled"]),c=Qx(l),{classes:g,cx:y}=Yx({align:i,grow:s,noWrap:a,spacing:u,position:o,count:c.length},{unstyled:d,name:"Group"});return j.createElement(st,Jx({className:y(g.root,r),ref:t},m),c)});xy.displayName="@mantine/core/Group";var tE=St((e,{spacing:t,align:n,justify:r})=>({root:{display:"flex",flexDirection:"column",alignItems:n,justifyContent:r,gap:e.fn.size({size:t,sizes:e.spacing})}}));const nE=tE;var rE=Object.defineProperty,fl=Object.getOwnPropertySymbols,Ey=Object.prototype.hasOwnProperty,Py=Object.prototype.propertyIsEnumerable,Td=(e,t,n)=>t in e?rE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oE=(e,t)=>{for(var n in t||(t={}))Ey.call(t,n)&&Td(e,n,t[n]);if(fl)for(var n of fl(t))Py.call(t,n)&&Td(e,n,t[n]);return e},iE=(e,t)=>{var n={};for(var r in e)Ey.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fl)for(var r of fl(e))t.indexOf(r)<0&&Py.call(e,r)&&(n[r]=e[r]);return n};const lE={spacing:"md",align:"stretch",justify:"flex-start"},ky=k.forwardRef((e,t)=>{const n=ut("Stack",lE,e),{spacing:r,className:o,align:i,justify:l,unstyled:a}=n,s=iE(n,["spacing","className","align","justify","unstyled"]),{classes:u,cx:d}=nE({spacing:r,align:i,justify:l},{name:"Stack",unstyled:a});return j.createElement(st,oE({className:d(u.root,o),ref:t},s))});ky.displayName="@mantine/core/Stack";var aE=Object.defineProperty,sE=Object.defineProperties,uE=Object.getOwnPropertyDescriptors,Ld=Object.getOwnPropertySymbols,cE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,Md=(e,t,n)=>t in e?aE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dE=(e,t)=>{for(var n in t||(t={}))cE.call(t,n)&&Md(e,n,t[n]);if(Ld)for(var n of Ld(t))fE.call(t,n)&&Md(e,n,t[n]);return e},pE=(e,t)=>sE(e,uE(t)),hE=St((e,{color:t})=>{const n=t||(e.colorScheme==="dark"?"dark":"gray"),r=e.fn.variant({color:n,variant:"light"});return{root:pE(dE({},e.fn.fontStyles()),{lineHeight:e.lineHeight,padding:`2px calc(${e.spacing.xs}px / 2)`,borderRadius:e.radius.sm,color:e.colorScheme==="dark"?n==="dark"?e.colors.dark[0]:e.white:e.colors.dark[7],backgroundColor:e.colorScheme==="dark"&&n==="dark"?e.colors.dark[5]:r.background,fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.xs}),block:{padding:e.spacing.xs,margin:0,overflowX:"auto"}}});const mE=hE;var yE=Object.defineProperty,dl=Object.getOwnPropertySymbols,Oy=Object.prototype.hasOwnProperty,Cy=Object.prototype.propertyIsEnumerable,Id=(e,t,n)=>t in e?yE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dd=(e,t)=>{for(var n in t||(t={}))Oy.call(t,n)&&Id(e,n,t[n]);if(dl)for(var n of dl(t))Cy.call(t,n)&&Id(e,n,t[n]);return e},gE=(e,t)=>{var n={};for(var r in e)Oy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dl)for(var r of dl(e))t.indexOf(r)<0&&Cy.call(e,r)&&(n[r]=e[r]);return n};const $y=k.forwardRef((e,t)=>{const n=ut("Code",{},e),{className:r,children:o,block:i,color:l,unstyled:a}=n,s=gE(n,["className","children","block","color","unstyled"]),{classes:u,cx:d}=mE({color:l},{name:"Code",unstyled:a});return i?j.createElement(st,Dd({component:"pre",dir:"ltr",className:d(u.root,u.block,r),ref:t},s),o):j.createElement(st,Dd({component:"code",className:d(u.root,r),ref:t,dir:"ltr"},s),o)});$y.displayName="@mantine/core/Code";var vE=St((e,{fluid:t,size:n,sizes:r})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":e.fn.size({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const wE=vE;var SE=Object.defineProperty,pl=Object.getOwnPropertySymbols,Ry=Object.prototype.hasOwnProperty,jy=Object.prototype.propertyIsEnumerable,Ad=(e,t,n)=>t in e?SE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_E=(e,t)=>{for(var n in t||(t={}))Ry.call(t,n)&&Ad(e,n,t[n]);if(pl)for(var n of pl(t))jy.call(t,n)&&Ad(e,n,t[n]);return e},xE=(e,t)=>{var n={};for(var r in e)Ry.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pl)for(var r of pl(e))t.indexOf(r)<0&&jy.call(e,r)&&(n[r]=e[r]);return n};const EE={sizes:{xs:540,sm:720,md:960,lg:1140,xl:1320}},Ny=k.forwardRef((e,t)=>{const n=ut("Container",EE,e),{className:r,fluid:o,size:i,unstyled:l,sizes:a}=n,s=xE(n,["className","fluid","size","unstyled","sizes"]),{classes:u,cx:d}=wE({fluid:o,size:i,sizes:a},{unstyled:l,name:"Container"});return j.createElement(st,_E({className:d(u.root,r),ref:t},s))});Ny.displayName="@mantine/core/Container";const[PE,kE]=W1("Grid component was not found in tree");var OE=Object.defineProperty,Fd=Object.getOwnPropertySymbols,CE=Object.prototype.hasOwnProperty,$E=Object.prototype.propertyIsEnumerable,Ud=(e,t,n)=>t in e?OE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RE=(e,t)=>{for(var n in t||(t={}))CE.call(t,n)&&Ud(e,n,t[n]);if(Fd)for(var n of Fd(t))$E.call(t,n)&&Ud(e,n,t[n]);return e};const Xu=(e,t)=>e==="content"?"auto":e==="auto"?"0px":e?`${100/(t/e)}%`:void 0,zy=(e,t,n)=>n||e==="auto"||e==="content"?"unset":Xu(e,t),by=(e,t)=>{if(e)return e==="auto"||t?1:0},Ty=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,Ly=(e,t)=>typeof e<"u"?t.fn.size({size:e,sizes:t.spacing})/2:void 0;function jE({sizes:e,offsets:t,orders:n,theme:r,columns:o,gutters:i,grow:l}){return km.reduce((a,s)=>(a[`@media (min-width: ${r.breakpoints[s]}px)`]={order:n[s],flexBasis:Xu(e[s],o),padding:Ly(i[s],r),flexShrink:0,width:e[s]==="content"?"auto":void 0,maxWidth:zy(e[s],o,l),marginLeft:Ty(t[s],o),flexGrow:by(e[s],l)},a),{})}var NE=St((e,{gutter:t,gutterXs:n,gutterSm:r,gutterMd:o,gutterLg:i,gutterXl:l,grow:a,offset:s,offsetXs:u,offsetSm:d,offsetMd:m,offsetLg:c,offsetXl:g,columns:y,span:v,xs:x,sm:p,md:f,lg:h,xl:w,order:E,orderXs:$,orderSm:P,orderMd:R,orderLg:V,orderXl:T})=>({col:RE({boxSizing:"border-box",flexGrow:by(v,a),order:E,padding:Ly(t,e),marginLeft:Ty(s,y),flexBasis:Xu(v,y),flexShrink:0,width:v==="content"?"auto":void 0,maxWidth:zy(v,y,a)},jE({sizes:{xs:x,sm:p,md:f,lg:h,xl:w},offsets:{xs:u,sm:d,md:m,lg:c,xl:g},orders:{xs:$,sm:P,md:R,lg:V,xl:T},gutters:{xs:n,sm:r,md:o,lg:i,xl:l},theme:e,columns:y,grow:a}))}));const zE=NE;var bE=Object.defineProperty,hl=Object.getOwnPropertySymbols,My=Object.prototype.hasOwnProperty,Iy=Object.prototype.propertyIsEnumerable,Bd=(e,t,n)=>t in e?bE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TE=(e,t)=>{for(var n in t||(t={}))My.call(t,n)&&Bd(e,n,t[n]);if(hl)for(var n of hl(t))Iy.call(t,n)&&Bd(e,n,t[n]);return e},LE=(e,t)=>{var n={};for(var r in e)My.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hl)for(var r of hl(e))t.indexOf(r)<0&&Iy.call(e,r)&&(n[r]=e[r]);return n};const ME={};function IE(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const Dy=k.forwardRef((e,t)=>{const n=ut("GridCol",ME,e),{children:r,span:o,offset:i,offsetXs:l,offsetSm:a,offsetMd:s,offsetLg:u,offsetXl:d,xs:m,sm:c,md:g,lg:y,xl:v,order:x,orderXs:p,orderSm:f,orderMd:h,orderLg:w,orderXl:E,className:$,id:P,unstyled:R}=n,V=LE(n,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","id","unstyled"]),T=kE(),Z=o||T.columns,{classes:ye,cx:Ge}=zE({gutter:T.gutter,gutterXs:T.gutterXs,gutterSm:T.gutterSm,gutterMd:T.gutterMd,gutterLg:T.gutterLg,gutterXl:T.gutterXl,offset:i,offsetXs:l,offsetSm:a,offsetMd:s,offsetLg:u,offsetXl:d,xs:m,sm:c,md:g,lg:y,xl:v,order:x,orderXs:p,orderSm:f,orderMd:h,orderLg:w,orderXl:E,grow:T.grow,columns:T.columns,span:Z},{unstyled:R,name:"Grid"});return!IE(Z)||Z>T.columns?null:j.createElement(st,TE({className:Ge(ye.col,$),ref:t},V),r)});Dy.displayName="@mantine/core/Col";var DE=Object.defineProperty,Vd=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,Hd=(e,t,n)=>t in e?DE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UE=(e,t)=>{for(var n in t||(t={}))AE.call(t,n)&&Hd(e,n,t[n]);if(Vd)for(var n of Vd(t))FE.call(t,n)&&Hd(e,n,t[n]);return e};function BE(e,t){return km.reduce((n,r)=>(typeof e[r]<"u"&&(n[`@media (min-width: ${t.breakpoints[r]}px)`]={margin:-t.fn.size({size:e[r],sizes:t.spacing})/2}),n),{})}var VE=St((e,{justify:t,align:n,gutter:r,gutterXs:o,gutterSm:i,gutterMd:l,gutterLg:a,gutterXl:s})=>({root:UE({margin:-e.fn.size({size:r,sizes:e.spacing})/2,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:n},BE({xs:o,sm:i,md:l,lg:a,xl:s},e))}));const HE=VE;var WE=Object.defineProperty,ml=Object.getOwnPropertySymbols,Ay=Object.prototype.hasOwnProperty,Fy=Object.prototype.propertyIsEnumerable,Wd=(e,t,n)=>t in e?WE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GE=(e,t)=>{for(var n in t||(t={}))Ay.call(t,n)&&Wd(e,n,t[n]);if(ml)for(var n of ml(t))Fy.call(t,n)&&Wd(e,n,t[n]);return e},QE=(e,t)=>{var n={};for(var r in e)Ay.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ml)for(var r of ml(e))t.indexOf(r)<0&&Fy.call(e,r)&&(n[r]=e[r]);return n};const KE={gutter:"md",justify:"flex-start",align:"stretch",columns:12},no=k.forwardRef((e,t)=>{const n=ut("Grid",KE,e),{gutter:r,gutterXs:o,gutterSm:i,gutterMd:l,gutterLg:a,gutterXl:s,children:u,grow:d,justify:m,align:c,columns:g,className:y,id:v,unstyled:x}=n,p=QE(n,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","id","unstyled"]),{classes:f,cx:h}=HE({gutter:r,justify:m,align:c,gutterXs:o,gutterSm:i,gutterMd:l,gutterLg:a,gutterXl:s},{unstyled:x,name:"Grid"});return j.createElement(PE,{value:{gutter:r,gutterXs:o,gutterSm:i,gutterMd:l,gutterLg:a,gutterXl:s,grow:d,columns:g}},j.createElement(st,GE({className:h(f.root,y),ref:t},p),u))});no.Col=Dy;no.displayName="@mantine/core/Grid";class Gd extends Error{constructor(n,r,o){super(o);Ae(this,"url");Ae(this,"status");Ae(this,"statusText");Ae(this,"body");Ae(this,"request");this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.body,this.request=n}}class XE extends Error{constructor(t){super(t),this.name="CancelError"}get isCancelled(){return!0}}var w2;class YE{constructor(t){Ae(this,w2);Ae(this,"_isResolved");Ae(this,"_isRejected");Ae(this,"_isCancelled");Ae(this,"_cancelHandlers");Ae(this,"_promise");Ae(this,"_resolve");Ae(this,"_reject");this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise((n,r)=>{this._resolve=n,this._reject=r;const o=a=>{var s;this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,(s=this._resolve)==null||s.call(this,a))},i=a=>{var s;this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,(s=this._reject)==null||s.call(this,a))},l=a=>{this._isResolved||this._isRejected||this._isCancelled||this._cancelHandlers.push(a)};return Object.defineProperty(l,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(l,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(l,"isCancelled",{get:()=>this._isCancelled}),t(o,i,l)})}then(t,n){return this._promise.then(t,n)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(){var t;if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(const n of this._cancelHandlers)n()}catch(n){console.warn("Cancellation threw an error",n);return}this._cancelHandlers.length=0,(t=this._reject)==null||t.call(this,new XE("Request aborted"))}}get isCancelled(){return this._isCancelled}}w2=Symbol.toStringTag;const Sn={BASE:"",VERSION:"0.1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var Kt=(e=>(e.THROUGH="through",e.DIVERGING="diverging",e.CONVERGING="converging",e))(Kt||{}),As=(e=>(e.STRAIGHT="straight",e.CURVE="curve",e))(As||{}),yl=(e=>(e.A="A",e.B="B",e))(yl||{});const Yu=e=>e!=null,Mo=e=>typeof e=="string",Ta=e=>Mo(e)&&e!=="",Zu=e=>typeof e=="object"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.arrayBuffer=="function"&&typeof e.constructor=="function"&&typeof e.constructor.name=="string"&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),Uy=e=>e instanceof FormData,ZE=e=>{try{return btoa(e)}catch{return Buffer.from(e).toString("base64")}},JE=e=>{const t=[],n=(o,i)=>{t.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(i))}`)},r=(o,i)=>{Yu(i)&&(Array.isArray(i)?i.forEach(l=>{r(o,l)}):typeof i=="object"?Object.entries(i).forEach(([l,a])=>{r(`${o}[${l}]`,a)}):n(o,i))};return Object.entries(e).forEach(([o,i])=>{r(o,i)}),t.length>0?`?${t.join("&")}`:""},qE=(e,t)=>{const n=e.ENCODE_PATH||encodeURI,r=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,(i,l)=>{var a;return(a=t.path)!=null&&a.hasOwnProperty(l)?n(String(t.path[l])):i}),o=`${e.BASE}${r}`;return t.query?`${o}${JE(t.query)}`:o},e2=e=>{if(e.formData){const t=new FormData,n=(r,o)=>{Mo(o)||Zu(o)?t.append(r,o):t.append(r,JSON.stringify(o))};return Object.entries(e.formData).filter(([r,o])=>Yu(o)).forEach(([r,o])=>{Array.isArray(o)?o.forEach(i=>n(r,i)):n(r,o)}),t}},ci=async(e,t)=>typeof t=="function"?t(e):t,t2=async(e,t)=>{const n=await ci(t,e.TOKEN),r=await ci(t,e.USERNAME),o=await ci(t,e.PASSWORD),i=await ci(t,e.HEADERS),l=Object.entries({Accept:"application/json",...i,...t.headers}).filter(([a,s])=>Yu(s)).reduce((a,[s,u])=>({...a,[s]:String(u)}),{});if(Ta(n)&&(l.Authorization=`Bearer ${n}`),Ta(r)&&Ta(o)){const a=ZE(`${r}:${o}`);l.Authorization=`Basic ${a}`}return t.body&&(t.mediaType?l["Content-Type"]=t.mediaType:Zu(t.body)?l["Content-Type"]=t.body.type||"application/octet-stream":Mo(t.body)?l["Content-Type"]="text/plain":Uy(t.body)||(l["Content-Type"]="application/json")),new Headers(l)},n2=e=>{var t;if(e.body)return(t=e.mediaType)!=null&&t.includes("/json")?JSON.stringify(e.body):Mo(e.body)||Zu(e.body)||Uy(e.body)?e.body:JSON.stringify(e.body)},r2=async(e,t,n,r,o,i,l)=>{const a=new AbortController,s={headers:i,body:r??o,method:t.method,signal:a.signal};return e.WITH_CREDENTIALS&&(s.credentials=e.CREDENTIALS),l(()=>a.abort()),await fetch(n,s)},o2=(e,t)=>{if(t){const n=e.headers.get(t);if(Mo(n))return n}},i2=async e=>{if(e.status!==204)try{const t=e.headers.get("Content-Type");if(t)return t.toLowerCase().startsWith("application/json")?await e.json():await e.text()}catch(t){console.error(t)}},l2=(e,t)=>{const r={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors}[t.status];if(r)throw new Gd(e,t,r);if(!t.ok)throw new Gd(e,t,"Generic Error")},_n=(e,t)=>new YE(async(n,r,o)=>{try{const i=qE(e,t),l=e2(t),a=n2(t),s=await t2(e,t);if(!o.isCancelled){const u=await r2(e,t,i,a,l,s,o),d=await i2(u),m=o2(u,t.responseHeader),c={url:i,ok:u.ok,status:u.status,statusText:u.statusText,body:m??d};l2(t,c),n(c.body)}}catch(i){r(i)}});class Co{static hello(){return _n(Sn,{method:"GET",url:"/api/hello"})}static getState(){return _n(Sn,{method:"GET",url:"/api/state"})}static moveTrain(t,n){return _n(Sn,{method:"POST",url:"/api/state/trains/{train_id}/move",path:{train_id:t},body:n,mediaType:"application/json",errors:{422:"Validation Error"}})}static putTrain(t,n){return _n(Sn,{method:"POST",url:"/api/state/trains/{train_id}/put",path:{train_id:t},body:n,mediaType:"application/json",errors:{422:"Validation Error"}})}static updateJunction(t,n){return _n(Sn,{method:"POST",url:"/api/state/junctions/{junction_id}/update",path:{junction_id:t},body:n,mediaType:"application/json",errors:{422:"Validation Error"}})}static blockSection(t){return _n(Sn,{method:"POST",url:"/api/state/sections/{section_id}/block",path:{section_id:t},errors:{422:"Validation Error"}})}static unblockSection(t){return _n(Sn,{method:"POST",url:"/api/state/sections/{section_id}/unblock",path:{section_id:t},errors:{422:"Validation Error"}})}}const a2=({children:e})=>I.jsx(py,{padding:"md",header:I.jsx(cy,{height:60,p:"md",sx:t=>({display:"flex",alignItems:"center",backgroundColor:t.colors.blue[5],fontSize:18,color:t.white,fontWeight:700}),children:"Plarailers Train Control System"}),children:e}),Pr=k.createContext(null),Io=k.createContext(null),s2=({position:e})=>I.jsx("rect",{x:e.x-60/2,y:e.y-20/2,width:60,height:20,fill:"white"}),u2=({id:e,points:t})=>{const n=k.useContext(Pr);if(!n)return null;const r=n.sections[e],o=Qd(t[0],t[1],4),i=t.length,l=Qd(t[i-1],t[i-2],4),a=[o,...t.slice(1,-1),l];return I.jsx("polyline",{points:a.map(s=>`${s.x},${s.y}`).join(" "),fill:"none",stroke:r.is_blocked?"red":"white",strokeWidth:r.is_blocked?4:2,strokeLinecap:"square"})},Qd=(e,t,n)=>({x:e.x+(t.x-e.x)/Math.hypot(t.x-e.x,t.y-e.y)*n,y:e.y+(t.y-e.y)/Math.hypot(t.x-e.x,t.y-e.y)*n}),Kd=e=>{const t=Math.hypot(e.x,e.y);return{x:e.x/t,y:e.y/t}},By=(e,t)=>{let n=0;for(let o=0;o=a)r-=a;else return{position:{x:i.x+(l.x-i.x)*(r/a),y:i.y+(l.y-i.y)*(r/a)},direction:{x:l.x-i.x,y:l.y-i.y}}}{const o=t[t.length-2],i=t[t.length-1];return{position:i,direction:{x:i.x-o.x,y:i.y-o.y}}}},c2=({id:e})=>{const t=Vt(),n=k.useContext(Pr),r=k.useContext(Io);if(!(n&&r))return null;const o=n.trains[e],i=n.sections[o.position.section_id],l=r.sections[o.position.section_id],{position:a,direction:s}=By(o.position.mileage/i.length,l.points);o.position.target_junction_id===i.connected_junction_ids[yl.A]&&(s.x*=-1,s.y*=-1);const u=Math.atan2(s.y,s.x)/Math.PI*180,d=r.trains[e];return I.jsxs("g",{transform:`translate(${a.x}, ${a.y})`,children:[I.jsx("g",{transform:`rotate(${u})`,children:I.jsx("polyline",{points:"-5,-5 -5,5 5,5 10,0 5,-5",fill:d.fill,stroke:d.stroke})}),o.departure_time!=null&&I.jsx("g",{transform:`translate(${0}, ${-10})`,children:I.jsx("text",{textAnchor:"middle",fill:t.colors.gray[5],children:o.departure_time-n.current_time})})]})},f2=({id:e,position:t})=>{const n=Vt(),r=k.useContext(Pr),o=k.useContext(Io);if(!(r&&o))return null;const i=r.junctions[e],l={};for(const u of[Kt.CONVERGING,Kt.THROUGH,Kt.DIVERGING]){const d=i.connected_section_ids[u],m=r.sections[d];if(e===m.connected_junction_ids[yl.A]){const c=o.sections[d].points,g=c[0],y=c[1];l[u]=Kd({x:y.x-g.x,y:y.y-g.y})}else if(e===m.connected_junction_ids[yl.B]){const c=o.sections[d].points,g=c[c.length-1],y=c[c.length-2];l[u]=Kd({x:y.x-g.x,y:y.y-g.y})}}let a;switch(i.current_direction){case As.STRAIGHT:{a=Kt.THROUGH;break}case As.CURVE:{a=Kt.DIVERGING;break}}const s=6;return I.jsxs("g",{transform:`translate(${t.x}, ${t.y})`,children:[I.jsx("circle",{cx:0,cy:0,r:s,fill:n.white,stroke:n.colors.gray[6]}),I.jsx("polyline",{points:[{x:l[Kt.CONVERGING].x*s,y:l[Kt.CONVERGING].y*s},{x:0,y:0},{x:l[a].x*s,y:l[a].y*s}].map(u=>`${u.x},${u.y}`).join(" "),fill:"none",stroke:n.colors.blue[7],strokeWidth:4})]})},d2=({id:e})=>{const t=Vt(),n=k.useContext(Pr),r=k.useContext(Io);if(!(n&&r))return null;const o=n.stops[e],i=n.sections[o.position.section_id],l=r.sections[o.position.section_id],{position:a,direction:s}=By(o.position.mileage/i.length,l.points),u=Math.atan2(s.y,s.x)/Math.PI*180;return I.jsx("g",{transform:`translate(${a.x}, ${a.y})`,children:I.jsx("g",{transform:`rotate(${u+180})`,children:I.jsxs("g",{transform:"translate(0, -10)",children:[I.jsx("polyline",{points:"0,0 0,10",stroke:t.colors.dark[2],strokeWidth:2}),I.jsx("polygon",{points:"-5,0 0,5 5,0 0,-5",fill:t.white,stroke:t.colors.red[7],strokeWidth:2})]})})})},p2=({children:e})=>{const t=k.useContext(Io);return t?I.jsxs("svg",{width:"100%",viewBox:`0 0 ${t.width} ${t.height}`,children:[I.jsx("rect",{width:t.width,height:t.height,fill:"#222222"}),Object.entries(t.platforms).map(([n,r])=>I.jsx(s2,{position:r.position},n)),Object.entries(t.stops).map(([n,r])=>I.jsx(d2,{id:n},n)),Object.entries(t.sections).map(([n,r])=>I.jsx(u2,{id:n,points:r.points},n)),Object.entries(t.junctions).map(([n,r])=>I.jsx(f2,{id:n,position:r.position},n)),Object.entries(t.trains).map(([n,r])=>I.jsx(c2,{id:n},n)),e]}):null},h2=()=>I.jsx("div",{children:I.jsxs(xy,{children:[I.jsx(Xd,{id:"t0",delta:10}),I.jsx(Xd,{id:"t1",delta:10}),I.jsx(m2,{id:"s3"})]})}),Xd=({id:e,delta:t})=>I.jsxs(wy,{styles:n=>({label:{fontFamily:n.fontFamilyMonospace}}),onClick:()=>{Co.moveTrain(e,{delta:t})},children:["MoveTrain(",e,", ",t,")"]},e),m2=({id:e})=>{const t=k.useContext(Pr);if(!t)return null;const n=t.sections[e];return I.jsx(wy,{variant:n.is_blocked?"filled":"light",color:"red",styles:r=>({label:{fontFamily:r.fontFamilyMonospace}}),onClick:()=>{n.is_blocked?Co.unblockSection(e):Co.blockSection(e)},children:n.is_blocked?`UnblockSection(${e})`:`BlockSection(${e})`})},y2={width:440,height:340,platforms:{},junctions:{j0:{position:{x:400,y:160}},j1:{position:{x:360,y:200}},j2:{position:{x:280,y:280}},j3:{position:{x:260,y:300}}},sections:{s0:{from:"j0",to:"j3",points:[{x:400,y:160},{x:400,y:280},{x:380,y:300},{x:260,y:300}]},s1:{from:"j3",to:"j0",points:[{x:260,y:300},{x:60,y:300},{x:40,y:280},{x:40,y:220},{x:220,y:40},{x:380,y:40},{x:400,y:60},{x:400,y:160}]},s2:{from:"j1",to:"j2",points:[{x:360,y:200},{x:360,y:250},{x:330,y:280},{x:280,y:280}]},s3:{from:"j2",to:"j1",points:[{x:280,y:280},{x:110,y:280},{x:80,y:250},{x:80,y:110},{x:110,y:80},{x:330,y:80},{x:360,y:110},{x:360,y:200}]},s4:{from:"j0",to:"j1",points:[{x:400,y:160},{x:360,y:200}]},s5:{from:"j2",to:"j3",points:[{x:280,y:280},{x:260,y:300}]}},trains:{t0:{fill:Rn.colors.yellow[4],stroke:Rn.colors.yellow[9]},t1:{fill:Rn.colors.red[5],stroke:Rn.colors.red[9]}},stops:{stop_0:{},stop_1:{},stop_2:{},stop_3:{},stop_4:{}}},g2=()=>{const[e,t]=k.useState(null),[n,r]=k.useState();return k.useEffect(()=>{Co.getState().then(o=>{t(o)})},[]),k.useEffect(()=>{const o=setInterval(()=>{r(new Date),Co.getState().then(i=>{t(i)})},500);return()=>{clearInterval(o)}},[]),I.jsx(Pr.Provider,{value:e,children:I.jsx(Io.Provider,{value:y2,children:I.jsx(a2,{children:I.jsx(Ny,{children:I.jsxs(ky,{children:[n==null?void 0:n.toLocaleString(),I.jsx(p2,{}),I.jsx(h2,{}),I.jsxs(no,{children:[I.jsx(no.Col,{span:6,children:I.jsx($y,{block:!0,children:JSON.stringify(e,null,4)})}),I.jsx(no.Col,{span:6})]})]})})})})})},v2=B1([{path:"/",element:I.jsx(g2,{})}]);La.createRoot(document.getElementById("root")).render(I.jsx(j.StrictMode,{children:I.jsx(Bm,{withGlobalStyles:!0,withNormalizeCSS:!0,children:I.jsx(D1,{router:v2})})})); diff --git a/ptcs/ptcs_ui/dist/assets/index-d409b46a.js b/ptcs/ptcs_ui/dist/assets/index-d409b46a.js new file mode 100644 index 0000000..d00b761 --- /dev/null +++ b/ptcs/ptcs_ui/dist/assets/index-d409b46a.js @@ -0,0 +1,74 @@ +var zy=Object.defineProperty;var Ty=(e,t,n)=>t in e?zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t,n)=>(Ty(e,typeof t!="symbol"?t+"":t,n),n);function by(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Ly(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L={},Iy={get exports(){return L},set exports(e){L=e}},gl={},C={},My={get exports(){return C},set exports(e){C=e}},V={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var jo=Symbol.for("react.element"),Dy=Symbol.for("react.portal"),Ay=Symbol.for("react.fragment"),Fy=Symbol.for("react.strict_mode"),Uy=Symbol.for("react.profiler"),By=Symbol.for("react.provider"),Vy=Symbol.for("react.context"),Hy=Symbol.for("react.forward_ref"),Wy=Symbol.for("react.suspense"),Gy=Symbol.for("react.memo"),Qy=Symbol.for("react.lazy"),nc=Symbol.iterator;function Ky(e){return e===null||typeof e!="object"?null:(e=nc&&e[nc]||e["@@iterator"],typeof e=="function"?e:null)}var Hd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wd=Object.assign,Gd={};function Pr(e,t,n){this.props=e,this.context=t,this.refs=Gd,this.updater=n||Hd}Pr.prototype.isReactComponent={};Pr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Pr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qd(){}Qd.prototype=Pr.prototype;function As(e,t,n){this.props=e,this.context=t,this.refs=Gd,this.updater=n||Hd}var Fs=As.prototype=new Qd;Fs.constructor=As;Wd(Fs,Pr.prototype);Fs.isPureReactComponent=!0;var rc=Array.isArray,Kd=Object.prototype.hasOwnProperty,Us={current:null},Yd={key:!0,ref:!0,__self:!0,__source:!0};function Xd(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Kd.call(t,r)&&!Yd.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,ue=R[K];if(0>>1;Ko(gn,U))sto(Wt,gn)?(R[K]=Wt,R[st]=U,K=st):(R[K]=gn,R[et]=U,K=et);else if(sto(Wt,U))R[K]=Wt,R[st]=U,K=st;else break e}}return D}function o(R,D){var U=R.sortIndex-D.sortIndex;return U!==0?U:R.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var s=[],u=[],d=1,m=null,c=3,y=!1,v=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(R){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=R)r(u),D.sortIndex=D.expirationTime,t(s,D);else break;D=n(u)}}function w(R){if(g=!1,h(R),!v)if(n(s)!==null)v=!0,yn(E);else{var D=n(u);D!==null&&se(w,D.startTime-R)}}function E(R,D){v=!1,g&&(g=!1,p(j),j=-1),y=!0;var U=c;try{for(h(D),m=n(s);m!==null&&(!(m.expirationTime>D)||R&&!ee());){var K=m.callback;if(typeof K=="function"){m.callback=null,c=m.priorityLevel;var ue=K(m.expirationTime<=D);D=e.unstable_now(),typeof ue=="function"?m.callback=ue:m===n(s)&&r(s),h(D)}else r(s);m=n(s)}if(m!==null)var Ht=!0;else{var et=n(u);et!==null&&se(w,et.startTime-D),Ht=!1}return Ht}finally{m=null,c=U,y=!1}}var $=!1,k=null,j=-1,W=5,I=-1;function ee(){return!(e.unstable_now()-IR||125K?(R.sortIndex=U,t(u,R),n(s)===null&&R===n(u)&&(g?(p(j),j=-1):g=!0,se(w,U-K))):(R.sortIndex=ue,t(s,R),v||y||(v=!0,yn(E))),R},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(R){var D=c;return function(){var U=c;c=D;try{return R.apply(this,arguments)}finally{c=U}}}})(Zd);(function(e){e.exports=Zd})(lg);/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qd=C,Xe=Ma;function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Da=Object.prototype.hasOwnProperty,ag=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ic={},lc={};function sg(e){return Da.call(lc,e)?!0:Da.call(ic,e)?!1:ag.test(e)?lc[e]=!0:(ic[e]=!0,!1)}function ug(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function cg(e,t,n,r){if(t===null||typeof t>"u"||ug(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function De(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Oe[e]=new De(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Oe[t]=new De(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Oe[e]=new De(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Oe[e]=new De(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Oe[e]=new De(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Oe[e]=new De(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Oe[e]=new De(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Oe[e]=new De(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Oe[e]=new De(e,5,!1,e.toLowerCase(),null,!1,!1)});var Vs=/[\-:]([a-z])/g;function Hs(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Vs,Hs);Oe[t]=new De(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Vs,Hs);Oe[t]=new De(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Vs,Hs);Oe[t]=new De(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Oe[e]=new De(e,1,!1,e.toLowerCase(),null,!1,!1)});Oe.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Oe[e]=new De(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ws(e,t,n,r){var o=Oe.hasOwnProperty(t)?Oe[t]:null;(o!==null?o.type!==0:r||!(2a||o[l]!==i[a]){var s=` +`+o[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{na=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hr(e):""}function fg(e){switch(e.tag){case 5:return Hr(e.type);case 16:return Hr("Lazy");case 13:return Hr("Suspense");case 19:return Hr("SuspenseList");case 0:case 2:case 15:return e=ra(e.type,!1),e;case 11:return e=ra(e.type.render,!1),e;case 1:return e=ra(e.type,!0),e;default:return""}}function Ba(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Yn:return"Fragment";case Kn:return"Portal";case Aa:return"Profiler";case Gs:return"StrictMode";case Fa:return"Suspense";case Ua:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case np:return(e.displayName||"Context")+".Consumer";case tp:return(e._context.displayName||"Context")+".Provider";case Qs:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ks:return t=e.displayName||null,t!==null?t:Ba(e.type)||"Memo";case Yt:t=e._payload,e=e._init;try{return Ba(e(t))}catch{}}return null}function dg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ba(t);case 8:return t===Gs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function op(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pg(e){var t=op(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yo(e){e._valueTracker||(e._valueTracker=pg(e))}function ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=op(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ri(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Va(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function lp(e,t){t=t.checked,t!=null&&Ws(e,"checked",t,!1)}function Ha(e,t){lp(e,t);var n=fn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Wa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wa(e,t.type,fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Wa(e,t,n){(t!=="number"||Ri(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wr=Array.isArray;function sr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Xo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function so(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hg=["Webkit","ms","Moz","O"];Object.keys(Yr).forEach(function(e){hg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yr[t]=Yr[e]})});function cp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yr.hasOwnProperty(e)&&Yr[e]?(""+t).trim():t+"px"}function fp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=cp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var mg=ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ka(e,t){if(t){if(mg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function Ya(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xa=null;function Ys(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ja=null,ur=null,cr=null;function dc(e){if(e=To(e)){if(typeof Ja!="function")throw Error(O(280));var t=e.stateNode;t&&(t=xl(t),Ja(e.stateNode,e.type,t))}}function dp(e){ur?cr?cr.push(e):cr=[e]:ur=e}function pp(){if(ur){var e=ur,t=cr;if(cr=ur=null,dc(e),t)for(e=0;e>>=0,e===0?32:31-(Cg(e)/Og|0)|0}var Jo=64,Zo=4194304;function Gr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ti(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=Gr(a):(i&=l,i!==0&&(r=Gr(i)))}else l=n&~o,l!==0?r=Gr(l):i!==0&&(r=Gr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function No(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mt(t),e[t]=n}function Ng(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Jr),_c=String.fromCharCode(32),xc=!1;function Tp(e,t){switch(e){case"keyup":return i0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xn=!1;function a0(e,t){switch(e){case"compositionend":return bp(t);case"keypress":return t.which!==32?null:(xc=!0,_c);case"textInput":return e=t.data,e===_c&&xc?null:e;default:return null}}function s0(e,t){if(Xn)return e==="compositionend"||!ru&&Tp(e,t)?(e=Np(),gi=eu=qt=null,Xn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cc(n)}}function Dp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ap(){for(var e=window,t=Ri();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ri(e.document)}return t}function ou(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function g0(e){var t=Ap(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dp(n.ownerDocument.documentElement,n)){if(r!==null&&ou(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Oc(n,i);var l=Oc(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jn=null,rs=null,qr=null,os=!1;function $c(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;os||Jn==null||Jn!==Ri(r)||(r=Jn,"selectionStart"in r&&ou(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&mo(qr,r)||(qr=r,r=Ii(rs,"onSelect"),0er||(e.current=cs[er],cs[er]=null,er--)}function te(e,t){er++,cs[er]=e.current,e.current=t}var dn={},Te=hn(dn),Be=hn(!1),bn=dn;function vr(e,t){var n=e.type.contextTypes;if(!n)return dn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ve(e){return e=e.childContextTypes,e!=null}function Di(){re(Be),re(Te)}function Lc(e,t,n){if(Te.current!==dn)throw Error(O(168));te(Te,t),te(Be,n)}function Kp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(O(108,dg(e)||"Unknown",o));return ae({},n,r)}function Ai(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||dn,bn=Te.current,te(Te,e),te(Be,Be.current),!0}function Ic(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=Kp(e,t,bn),r.__reactInternalMemoizedMergedChildContext=e,re(Be),re(Te),te(Te,e)):re(Be),te(Be,n)}var bt=null,El=!1,ga=!1;function Yp(e){bt===null?bt=[e]:bt.push(e)}function R0(e){El=!0,Yp(e)}function mn(){if(!ga&&bt!==null){ga=!0;var e=0,t=Z;try{var n=bt;for(Z=1;e>=l,o-=l,Lt=1<<32-mt(t)+o|n<j?(W=k,k=null):W=k.sibling;var I=c(p,k,h[j],w);if(I===null){k===null&&(k=W);break}e&&k&&I.alternate===null&&t(p,k),f=i(I,f,j),$===null?E=I:$.sibling=I,$=I,k=W}if(j===h.length)return n(p,k),oe&&En(p,j),E;if(k===null){for(;jj?(W=k,k=null):W=k.sibling;var ee=c(p,k,I.value,w);if(ee===null){k===null&&(k=W);break}e&&k&&ee.alternate===null&&t(p,k),f=i(ee,f,j),$===null?E=ee:$.sibling=ee,$=ee,k=W}if(I.done)return n(p,k),oe&&En(p,j),E;if(k===null){for(;!I.done;j++,I=h.next())I=m(p,I.value,w),I!==null&&(f=i(I,f,j),$===null?E=I:$.sibling=I,$=I);return oe&&En(p,j),E}for(k=r(p,k);!I.done;j++,I=h.next())I=y(k,p,j,I.value,w),I!==null&&(e&&I.alternate!==null&&k.delete(I.key===null?j:I.key),f=i(I,f,j),$===null?E=I:$.sibling=I,$=I);return e&&k.forEach(function(xe){return t(p,xe)}),oe&&En(p,j),E}function x(p,f,h,w){if(typeof h=="object"&&h!==null&&h.type===Yn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Ko:e:{for(var E=h.key,$=f;$!==null;){if($.key===E){if(E=h.type,E===Yn){if($.tag===7){n(p,$.sibling),f=o($,h.props.children),f.return=p,p=f;break e}}else if($.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Yt&&Vc(E)===$.type){n(p,$.sibling),f=o($,h.props),f.ref=Mr(p,$,h),f.return=p,p=f;break e}n(p,$);break}else t(p,$);$=$.sibling}h.type===Yn?(f=zn(h.props.children,p.mode,w,h.key),f.return=p,p=f):(w=Pi(h.type,h.key,h.props,null,p.mode,w),w.ref=Mr(p,f,h),w.return=p,p=w)}return l(p);case Kn:e:{for($=h.key;f!==null;){if(f.key===$)if(f.tag===4&&f.stateNode.containerInfo===h.containerInfo&&f.stateNode.implementation===h.implementation){n(p,f.sibling),f=o(f,h.children||[]),f.return=p,p=f;break e}else{n(p,f);break}else t(p,f);f=f.sibling}f=Pa(h,p.mode,w),f.return=p,p=f}return l(p);case Yt:return $=h._init,x(p,f,$(h._payload),w)}if(Wr(h))return v(p,f,h,w);if(zr(h))return g(p,f,h,w);ii(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,f!==null&&f.tag===6?(n(p,f.sibling),f=o(f,h),f.return=p,p=f):(n(p,f),f=ka(h,p.mode,w),f.return=p,p=f),l(p)):n(p,f)}return x}var Sr=rh(!0),oh=rh(!1),bo={},Ct=hn(bo),wo=hn(bo),So=hn(bo);function $n(e){if(e===bo)throw Error(O(174));return e}function pu(e,t){switch(te(So,t),te(wo,e),te(Ct,bo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qa(t,e)}re(Ct),te(Ct,t)}function _r(){re(Ct),re(wo),re(So)}function ih(e){$n(So.current);var t=$n(Ct.current),n=Qa(t,e.type);t!==n&&(te(wo,e),te(Ct,n))}function hu(e){wo.current===e&&(re(Ct),re(wo))}var ie=hn(0);function Wi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var va=[];function mu(){for(var e=0;en?n:4,e(!0);var r=wa.transition;wa.transition={};try{e(!1),t()}finally{Z=n,wa.transition=r}}function _h(){return lt().memoizedState}function T0(e,t,n){var r=un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xh(e))Eh(t,n);else if(n=qp(e,t,n,r),n!==null){var o=Ie();yt(n,e,r,o),kh(n,t,r)}}function b0(e,t,n){var r=un(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xh(e))Eh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,gt(a,l)){var s=t.interleaved;s===null?(o.next=o,fu(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=qp(e,t,o,r),n!==null&&(o=Ie(),yt(n,e,r,o),kh(n,t,r))}}function xh(e){var t=e.alternate;return e===le||t!==null&&t===le}function Eh(e,t){eo=Gi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Js(e,n)}}var Qi={readContext:it,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},L0={readContext:it,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:Wc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_i(4194308,4,yh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _i(4194308,4,e,t)},useInsertionEffect:function(e,t){return _i(4,2,e,t)},useMemo:function(e,t){var n=_t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=T0.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:Hc,useDebugValue:Su,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=Hc(!1),t=e[0];return e=z0.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=le,o=_t();if(oe){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Se===null)throw Error(O(349));In&30||sh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Wc(ch.bind(null,r,i,e),[e]),r.flags|=2048,Eo(9,uh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_t(),t=Se.identifierPrefix;if(oe){var n=It,r=Lt;n=(r&~(1<<32-mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_o++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[kt]=t,e[vo]=r,Th(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ya(n,r),n){case"dialog":ne("cancel",e),ne("close",e),o=r;break;case"iframe":case"object":case"embed":ne("load",e),o=r;break;case"video":case"audio":for(o=0;oEr&&(t.flags|=128,r=!0,Dr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Wi(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Dr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!oe)return je(t),null}else 2*de()-i.renderingStartTime>Er&&n!==1073741824&&(t.flags|=128,r=!0,Dr(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=de(),t.sibling=null,n=ie.current,te(ie,r?n&1|2:n&1),t):(je(t),null);case 22:case 23:return Cu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ge&1073741824&&(je(t),t.subtreeFlags&6&&(t.flags|=8192)):je(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function V0(e,t){switch(lu(t),t.tag){case 1:return Ve(t.type)&&Di(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _r(),re(Be),re(Te),mu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return hu(t),null;case 13:if(re(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));wr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(ie),null;case 4:return _r(),null;case 10:return cu(t.type._context),null;case 22:case 23:return Cu(),null;case 24:return null;default:return null}}var ai=!1,ze=!1,H0=typeof WeakSet=="function"?WeakSet:Set,z=null;function or(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){fe(e,t,r)}else n.current=null}function xs(e,t,n){try{n()}catch(r){fe(e,t,r)}}var ef=!1;function W0(e,t){if(is=bi,e=Ap(),ou(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,d=0,m=e,c=null;t:for(;;){for(var y;m!==n||o!==0&&m.nodeType!==3||(a=l+o),m!==i||r!==0&&m.nodeType!==3||(s=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(y=m.firstChild)!==null;)c=m,m=y;for(;;){if(m===e)break t;if(c===n&&++u===o&&(a=l),c===i&&++d===r&&(s=l),(y=m.nextSibling)!==null)break;m=c,c=m.parentNode}m=y}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(ls={focusedElem:e,selectionRange:n},bi=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,x=v.memoizedState,p=t.stateNode,f=p.getSnapshotBeforeUpdate(t.elementType===t.type?g:dt(t.type,g),x);p.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(w){fe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return v=ef,ef=!1,v}function to(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&xs(t,n,i)}o=o.next}while(o!==r)}}function Cl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Es(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ih(e){var t=e.alternate;t!==null&&(e.alternate=null,Ih(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kt],delete t[vo],delete t[us],delete t[O0],delete t[$0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mh(e){return e.tag===5||e.tag===3||e.tag===4}function tf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ks(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Mi));else if(r!==4&&(e=e.child,e!==null))for(ks(e,t,n),e=e.sibling;e!==null;)ks(e,t,n),e=e.sibling}function Ps(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ps(e,t,n),e=e.sibling;e!==null;)Ps(e,t,n),e=e.sibling}var Ee=null,pt=!1;function Gt(e,t,n){for(n=n.child;n!==null;)Dh(e,t,n),n=n.sibling}function Dh(e,t,n){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(vl,n)}catch{}switch(n.tag){case 5:ze||or(n,t);case 6:var r=Ee,o=pt;Ee=null,Gt(e,t,n),Ee=r,pt=o,Ee!==null&&(pt?(e=Ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ee.removeChild(n.stateNode));break;case 18:Ee!==null&&(pt?(e=Ee,n=n.stateNode,e.nodeType===8?ya(e.parentNode,n):e.nodeType===1&&ya(e,n),po(e)):ya(Ee,n.stateNode));break;case 4:r=Ee,o=pt,Ee=n.stateNode.containerInfo,pt=!0,Gt(e,t,n),Ee=r,pt=o;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&xs(n,t,l),o=o.next}while(o!==r)}Gt(e,t,n);break;case 1:if(!ze&&(or(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){fe(n,t,a)}Gt(e,t,n);break;case 21:Gt(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,Gt(e,t,n),ze=r):Gt(e,t,n);break;default:Gt(e,t,n)}}function nf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new H0),t.forEach(function(r){var o=ev.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ft(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Q0(r/1960))-r,10e?16:e,en===null)var r=!1;else{if(e=en,en=null,Xi=0,Q&6)throw Error(O(331));var o=Q;for(Q|=4,z=e.current;z!==null;){var i=z,l=i.child;if(z.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sde()-ku?Nn(e,0):Eu|=n),He(e,t)}function Gh(e,t){t===0&&(e.mode&1?(t=Zo,Zo<<=1,!(Zo&130023424)&&(Zo=4194304)):t=1);var n=Ie();e=Ft(e,t),e!==null&&(No(e,t,n),He(e,n))}function q0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gh(e,n)}function ev(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),Gh(e,n)}var Qh;Qh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Ue=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ue=!1,U0(e,t,n);Ue=!!(e.flags&131072)}else Ue=!1,oe&&t.flags&1048576&&Xp(t,Ui,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xi(e,t),e=t.pendingProps;var o=vr(t,Te.current);dr(t,n),o=gu(null,t,r,e,o,n);var i=vu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ve(r)?(i=!0,Ai(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,du(t),o.updater=kl,t.stateNode=o,o._reactInternals=t,ms(t,r,e,n),t=vs(null,t,r,!0,i,n)):(t.tag=0,oe&&i&&iu(t),Le(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=nv(r),e=dt(r,e),o){case 0:t=gs(null,t,r,e,n);break e;case 1:t=Jc(null,t,r,e,n);break e;case 11:t=Yc(null,t,r,e,n);break e;case 14:t=Xc(null,t,r,dt(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),gs(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),Jc(e,t,r,o,n);case 3:e:{if(jh(t),e===null)throw Error(O(387));r=t.pendingProps,i=t.memoizedState,o=i.element,eh(e,t),Hi(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=xr(Error(O(423)),t),t=Zc(e,t,r,n,o);break e}else if(r!==o){o=xr(Error(O(424)),t),t=Zc(e,t,r,n,o);break e}else for(Qe=ln(t.stateNode.containerInfo.firstChild),Ke=t,oe=!0,ht=null,n=oh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wr(),r===o){t=Ut(e,t,n);break e}Le(e,t,r,n)}t=t.child}return t;case 5:return ih(t),e===null&&ds(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,as(r,o)?l=null:i!==null&&as(r,i)&&(t.flags|=32),Rh(e,t),Le(e,t,l,n),t.child;case 6:return e===null&&ds(t),null;case 13:return Nh(e,t,n);case 4:return pu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Sr(t,null,r,n):Le(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),Yc(e,t,r,o,n);case 7:return Le(e,t,t.pendingProps,n),t.child;case 8:return Le(e,t,t.pendingProps.children,n),t.child;case 12:return Le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,te(Bi,r._currentValue),r._currentValue=l,i!==null)if(gt(i.value,l)){if(i.children===o.children&&!Be.current){t=Ut(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=Mt(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?s.next=s:(s.next=d.next,d.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ps(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(O(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),ps(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Le(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,dr(t,n),o=it(o),r=r(o),t.flags|=1,Le(e,t,r,n),t.child;case 14:return r=t.type,o=dt(r,t.pendingProps),o=dt(r.type,o),Xc(e,t,r,o,n);case 15:return Oh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:dt(r,o),xi(e,t),t.tag=1,Ve(r)?(e=!0,Ai(t)):e=!1,dr(t,n),nh(t,r,o),ms(t,r,o,n),vs(null,t,r,!0,e,n);case 19:return zh(e,t,n);case 22:return $h(e,t,n)}throw Error(O(156,t.tag))};function Kh(e,t){return Sp(e,t)}function tv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rt(e,t,n,r){return new tv(e,t,n,r)}function $u(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nv(e){if(typeof e=="function")return $u(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qs)return 11;if(e===Ks)return 14}return 2}function cn(e,t){var n=e.alternate;return n===null?(n=rt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pi(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")$u(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Yn:return zn(n.children,o,i,t);case Gs:l=8,o|=8;break;case Aa:return e=rt(12,n,t,o|2),e.elementType=Aa,e.lanes=i,e;case Fa:return e=rt(13,n,t,o),e.elementType=Fa,e.lanes=i,e;case Ua:return e=rt(19,n,t,o),e.elementType=Ua,e.lanes=i,e;case rp:return $l(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tp:l=10;break e;case np:l=9;break e;case Qs:l=11;break e;case Ks:l=14;break e;case Yt:l=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=rt(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function zn(e,t,n,r){return e=rt(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=rt(22,e,r,t),e.elementType=rp,e.lanes=n,e.stateNode={isHidden:!1},e}function ka(e,t,n){return e=rt(6,e,null,t),e.lanes=n,e}function Pa(e,t,n){return t=rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rv(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ia(0),this.expirationTimes=ia(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ia(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ru(e,t,n,r,o,i,l,a,s){return e=new rv(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=rt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},du(i),e}function ov(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Je})(ig);var ff=Ia;La.createRoot=ff.createRoot,La.hydrateRoot=ff.hydrateRoot;/** + * @remix-run/router v1.3.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function cv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fv(){return Math.random().toString(36).substr(2,8)}function pf(e,t){return{usr:e.state,key:e.key,idx:t}}function Po(e,t,n,r){return n===void 0&&(n=null),X({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rt(t):t,{state:n,key:t&&t.key||r||fv()})}function An(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Rt(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function dv(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,a=pe.Pop,s=null,u=d();u==null&&(u=0,l.replaceState(X({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function m(){a=pe.Pop;let x=d(),p=x==null?null:x-u;u=x,s&&s({action:a,location:g.location,delta:p})}function c(x,p){a=pe.Push;let f=Po(g.location,x,p);n&&n(f,x),u=d()+1;let h=pf(f,u),w=g.createHref(f);try{l.pushState(h,"",w)}catch{o.location.assign(w)}i&&s&&s({action:a,location:g.location,delta:1})}function y(x,p){a=pe.Replace;let f=Po(g.location,x,p);n&&n(f,x),u=d();let h=pf(f,u),w=g.createHref(f);l.replaceState(h,"",w),i&&s&&s({action:a,location:g.location,delta:0})}function v(x){let p=o.location.origin!=="null"?o.location.origin:o.location.href,f=typeof x=="string"?x:An(x);return B(p,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,p)}let g={get action(){return a},get location(){return e(o,l)},listen(x){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(df,m),s=x,()=>{o.removeEventListener(df,m),s=null}},createHref(x){return t(o,x)},createURL:v,encodeLocation(x){let p=v(x);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:c,replace:y,go(x){return l.go(x)}};return g}var ke;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ke||(ke={}));function pv(e){return e.index===!0}function Zh(e,t,n){return t===void 0&&(t=[]),n===void 0&&(n=new Set),e.map((r,o)=>{let i=[...t,o],l=typeof r.id=="string"?r.id:i.join("-");return B(r.index!==!0||!r.children,"Cannot specify children on an index route"),B(!n.has(l),'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),n.add(l),pv(r)?X({},r,{id:l}):X({},r,{id:l,children:r.children?Zh(r.children,i,n):void 0})})}function Kr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Rt(t):t,o=tm(r.pathname||"/",n);if(o==null)return null;let i=qh(e);hv(i);let l=null;for(let a=0;l==null&&a{let s={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};s.relativePath.startsWith("/")&&(B(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=Tn([r,s.relativePath]),d=n.concat(s);i.children&&i.children.length>0&&(B(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),qh(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:_v(u,i.index),routesMeta:d})};return e.forEach((i,l)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,l);else for(let s of em(i.path))o(i,l,s)}),t}function em(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=em(r.join("/")),a=[];return a.push(...l.map(s=>s===""?i:[i,s].join("/"))),o&&a.push(...l),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function hv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xv(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const mv=/^:\w+$/,yv=3,gv=2,vv=1,wv=10,Sv=-2,hf=e=>e==="*";function _v(e,t){let n=e.split("/"),r=n.length;return n.some(hf)&&(r+=Sv),t&&(r+=gv),n.filter(o=>!hf(o)).reduce((o,i)=>o+(mv.test(i)?yv:i===""?vv:wv),r)}function xv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Ev(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let l=0;l{if(d==="*"){let c=a[m]||"";l=i.slice(0,i.length-c.length).replace(/(.)\/+$/,"$1")}return u[d]=Ov(a[m]||"",d),u},{}),pathname:i,pathnameBase:l,pattern:e}}function Pv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Co(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(l,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Cv(e){try{return decodeURI(e)}catch(t){return Co(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ov(e,t){try{return decodeURIComponent(e)}catch(n){return Co(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function tm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Co(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $v(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Rt(e):e;return{pathname:n?n.startsWith("/")?n:Rv(n,t):t,search:zv(r),hash:Tv(o)}}function Rv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ca(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function nm(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jv(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Rt(e):(o=X({},e),B(!o.pathname||!o.pathname.includes("?"),Ca("?","pathname","search",o)),B(!o.pathname||!o.pathname.includes("#"),Ca("#","pathname","hash",o)),B(!o.search||!o.search.includes("#"),Ca("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,a;if(r||l==null)a=n;else{let m=t.length-1;if(l.startsWith("..")){let c=l.split("/");for(;c[0]==="..";)c.shift(),m-=1;o.pathname=c.join("/")}a=m>=0?t[m]:"/"}let s=$v(o,a),u=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||d)&&(s.pathname+="/"),s}const Tn=e=>e.join("/").replace(/\/\/+/g,"/"),Nv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class mf extends Error{}class bv{constructor(t,n){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],B(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((i,l)=>r=l),this.controller=new AbortController;let o=()=>r(new mf("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",o),this.controller.signal.addEventListener("abort",o),this.data=Object.entries(t).reduce((i,l)=>{let[a,s]=l;return Object.assign(i,{[a]:this.trackPromise(a,s)})},{}),this.done&&this.unlistenAbortSignal(),this.init=n}trackPromise(t,n){if(!(n instanceof Promise))return n;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let r=Promise.race([n,this.abortPromise]).then(o=>this.onSettle(r,t,null,o),o=>this.onSettle(r,t,o));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(t,n,r,o){return this.controller.signal.aborted&&r instanceof mf?(this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>r}),Promise.reject(r)):(this.pendingKeysSet.delete(n),this.done&&this.unlistenAbortSignal(),r?(Object.defineProperty(t,"_error",{get:()=>r}),this.emit(!1,n),Promise.reject(r)):(Object.defineProperty(t,"_data",{get:()=>o}),this.emit(!1,n),o))}emit(t,n){this.subscribers.forEach(r=>r(t,n))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,n)=>this.pendingKeysSet.delete(n)),this.emit(!0)}async resolveData(t){let n=!1;if(!this.done){let r=()=>this.cancel();t.addEventListener("abort",r),n=await new Promise(o=>{this.subscribe(i=>{t.removeEventListener("abort",r),(i||this.done)&&o(i)})})}return n}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return B(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,n)=>{let[r,o]=n;return Object.assign(t,{[r]:Iv(o)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Lv(e){return e instanceof Promise&&e._tracked===!0}function Iv(e){if(!Lv(e))return e;if(e._error)throw e._error;return e._data}class Tu{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function rm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const om=["post","put","patch","delete"],Mv=new Set(om),Dv=["get",...om],Av=new Set(Dv),Fv=new Set([301,302,303,307,308]),Uv=new Set([307,308]),Oa={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},Bv={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},yf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},im=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vv=!im;function Hv(e){B(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let t=Zh(e.routes),n=null,r=new Set,o=null,i=null,l=null,a=e.hydrationData!=null,s=Kr(t,e.history.location,e.basename),u=null;if(s==null){let S=Qt(404,{pathname:e.history.location.pathname}),{matches:_,route:P}=xf(t);s=_,u={[P.id]:S}}let d=!s.some(S=>S.route.loader)||e.hydrationData!=null,m,c={historyAction:e.history.action,location:e.history.location,matches:s,initialized:d,navigation:Oa,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||u,fetchers:new Map,blockers:new Map},y=pe.Pop,v=!1,g,x=!1,p=!1,f=[],h=[],w=new Map,E=0,$=-1,k=new Map,j=new Set,W=new Map,I=new Map,ee=null,xe=new Map,at=!1;function Hn(){return n=e.history.listen(S=>{let{action:_,location:P,delta:b}=S;if(at){at=!1;return}Co(ee!=null&&b===null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let T=qu({currentLocation:c.location,nextLocation:P,historyAction:_});if(T&&b!=null){at=!0,e.history.go(b*-1),Vo(T,{state:"blocked",location:P,proceed(){Vo(T,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),e.history.go(b)},reset(){jr(T),se({blockers:new Map(m.state.blockers)})}});return}return K(_,P)}),c.initialized||K(pe.Pop,c.location),m}function Rr(){n&&n(),r.clear(),g&&g.abort(),c.fetchers.forEach((S,_)=>Yl(_)),c.blockers.forEach((S,_)=>jr(_))}function yn(S){return r.add(S),()=>r.delete(S)}function se(S){c=X({},c,S),r.forEach(_=>_(c))}function R(S,_){var P,b;let T=c.actionData!=null&&c.navigation.formMethod!=null&&Tt(c.navigation.formMethod)&&c.navigation.state==="loading"&&((P=S.state)==null?void 0:P._isRedirect)!==!0,F;_.actionData?Object.keys(_.actionData).length>0?F=_.actionData:F=null:T?F=c.actionData:F=null;let A=_.loaderData?_f(c.loaderData,_.loaderData,_.matches||[],_.errors):c.loaderData;for(let[M]of xe)jr(M);let G=v===!0||c.navigation.formMethod!=null&&Tt(c.navigation.formMethod)&&((b=S.state)==null?void 0:b._isRedirect)!==!0;se(X({},_,{actionData:F,loaderData:A,historyAction:y,location:S,initialized:!0,navigation:Oa,revalidation:"idle",restoreScrollPosition:ec(S,_.matches||c.matches),preventScrollReset:G,blockers:new Map(c.blockers)})),x||y===pe.Pop||(y===pe.Push?e.history.push(S,S.state):y===pe.Replace&&e.history.replace(S,S.state)),y=pe.Pop,v=!1,x=!1,p=!1,f=[],h=[]}async function D(S,_){if(typeof S=="number"){e.history.go(S);return}let{path:P,submission:b,error:T}=gf(S,_),F=c.location,A=Po(c.location,P,_&&_.state);A=X({},A,e.history.encodeLocation(A));let G=_&&_.replace!=null?_.replace:void 0,M=pe.Push;G===!0?M=pe.Replace:G===!1||b!=null&&Tt(b.formMethod)&&b.formAction===c.location.pathname+c.location.search&&(M=pe.Replace);let be=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,H=qu({currentLocation:F,nextLocation:A,historyAction:M});if(H){Vo(H,{state:"blocked",location:A,proceed(){Vo(H,{state:"proceeding",proceed:void 0,reset:void 0,location:A}),D(S,_)},reset(){jr(H),se({blockers:new Map(c.blockers)})}});return}return await K(M,A,{submission:b,pendingError:T,preventScrollReset:be,replace:_&&_.replace})}function U(){if(Uo(),se({revalidation:"loading"}),c.navigation.state!=="submitting"){if(c.navigation.state==="idle"){K(c.historyAction,c.location,{startUninterruptedRevalidation:!0});return}K(y||c.historyAction,c.navigation.location,{overrideNavigation:c.navigation})}}async function K(S,_,P){g&&g.abort(),g=null,y=S,x=(P&&P.startUninterruptedRevalidation)===!0,$y(c.location,c.matches),v=(P&&P.preventScrollReset)===!0;let b=P&&P.overrideNavigation,T=Kr(t,_,e.basename);if(!T){let ce=Qt(404,{pathname:_.pathname}),{matches:ut,route:ct}=xf(t);Xl(),R(_,{matches:ut,loaderData:{},errors:{[ct.id]:ce}});return}if(Yv(c.location,_)&&!(P&&P.submission&&Tt(P.submission.formMethod))){R(_,{matches:T});return}g=new AbortController;let F=Ur(e.history,_,g.signal,P&&P.submission),A,G;if(P&&P.pendingError)G={[lr(T).route.id]:P.pendingError};else if(P&&P.submission&&Tt(P.submission.formMethod)){let ce=await ue(F,_,P.submission,T,{replace:P.replace});if(ce.shortCircuited)return;A=ce.pendingActionData,G=ce.pendingActionError,b=X({state:"loading",location:_},P.submission),F=new Request(F.url,{signal:F.signal})}let{shortCircuited:M,loaderData:be,errors:H}=await Ht(F,_,T,b,P&&P.submission,P&&P.replace,A,G);M||(g=null,R(_,X({matches:T},A?{actionData:A}:{},{loaderData:be,errors:H})))}async function ue(S,_,P,b,T){Uo();let F=X({state:"submitting",location:_},P);se({navigation:F});let A,G=Cf(b,_);if(!G.route.action)A={type:ke.error,error:Qt(405,{method:S.method,pathname:_.pathname,routeId:G.route.id})};else if(A=await Fr("action",S,G,b,m.basename),S.signal.aborted)return{shortCircuited:!0};if(hr(A)){let M;return T&&T.replace!=null?M=T.replace:M=A.location===c.location.pathname+c.location.search,await vn(c,A,{submission:P,replace:M}),{shortCircuited:!0}}if(oo(A)){let M=lr(b,G.route.id);return(T&&T.replace)!==!0&&(y=pe.Push),{pendingActionData:{},pendingActionError:{[M.route.id]:A.error}}}if(Rn(A))throw Qt(400,{type:"defer-action"});return{pendingActionData:{[G.route.id]:A.data}}}async function Ht(S,_,P,b,T,F,A,G){let M=b;M||(M=X({state:"loading",location:_,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},T));let be=T||(M.formMethod&&M.formAction&&M.formData&&M.formEncType?{formMethod:M.formMethod,formAction:M.formAction,formData:M.formData,formEncType:M.formEncType}:void 0),[H,ce]=vf(e.history,c,P,be,_,p,f,h,A,G,W);if(Xl($e=>!(P&&P.some(wt=>wt.route.id===$e))||H&&H.some(wt=>wt.route.id===$e)),H.length===0&&ce.length===0)return R(_,X({matches:P,loaderData:{},errors:G||null},A?{actionData:A}:{})),{shortCircuited:!0};if(!x){ce.forEach(wt=>{let wn=c.fetchers.get(wt.key),Go={state:"loading",data:wn&&wn.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(wt.key,Go)});let $e=A||c.actionData;se(X({navigation:M},$e?Object.keys($e).length===0?{actionData:null}:{actionData:$e}:{},ce.length>0?{fetchers:new Map(c.fetchers)}:{}))}$=++E,ce.forEach($e=>w.set($e.key,g));let{results:ut,loaderResults:ct,fetcherResults:Nr}=await Fo(c.matches,P,H,ce,S);if(S.signal.aborted)return{shortCircuited:!0};ce.forEach($e=>w.delete($e.key));let Ho=Ef(ut);if(Ho)return await vn(c,Ho,{replace:F}),{shortCircuited:!0};let{loaderData:Wo,errors:Wn}=Sf(c,P,H,ct,G,ce,Nr,I);I.forEach(($e,wt)=>{$e.subscribe(wn=>{(wn||$e.done)&&I.delete(wt)})}),Py();let Jl=Zu($);return X({loaderData:Wo,errors:Wn},Jl||ce.length>0?{fetchers:new Map(c.fetchers)}:{})}function et(S){return c.fetchers.get(S)||Bv}function gn(S,_,P,b){if(Vv)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");w.has(S)&&Bo(S);let T=Kr(t,P,e.basename);if(!T){Kl(S,_,Qt(404,{pathname:P}));return}let{path:F,submission:A}=gf(P,b,!0),G=Cf(T,F);if(v=(b&&b.preventScrollReset)===!0,A&&Tt(A.formMethod)){st(S,_,F,G,T,A);return}W.set(S,{routeId:_,path:F,match:G,matches:T}),Wt(S,_,F,G,T,A)}async function st(S,_,P,b,T,F){if(Uo(),W.delete(S),!b.route.action){let Nt=Qt(405,{method:F.formMethod,pathname:P,routeId:_});Kl(S,_,Nt);return}let A=c.fetchers.get(S),G=X({state:"submitting"},F,{data:A&&A.data," _hasFetcherDoneAnything ":!0});c.fetchers.set(S,G),se({fetchers:new Map(c.fetchers)});let M=new AbortController,be=Ur(e.history,P,M.signal,F);w.set(S,M);let H=await Fr("action",be,b,T,m.basename);if(be.signal.aborted){w.get(S)===M&&w.delete(S);return}if(hr(H)){w.delete(S),j.add(S);let Nt=X({state:"loading"},F,{data:void 0," _hasFetcherDoneAnything ":!0});return c.fetchers.set(S,Nt),se({fetchers:new Map(c.fetchers)}),vn(c,H,{isFetchActionRedirect:!0})}if(oo(H)){Kl(S,_,H.error);return}if(Rn(H))throw Qt(400,{type:"defer-action"});let ce=c.navigation.location||c.location,ut=Ur(e.history,ce,M.signal),ct=c.navigation.state!=="idle"?Kr(t,c.navigation.location,e.basename):c.matches;B(ct,"Didn't find any matches after fetcher action");let Nr=++E;k.set(S,Nr);let Ho=X({state:"loading",data:H.data},F,{" _hasFetcherDoneAnything ":!0});c.fetchers.set(S,Ho);let[Wo,Wn]=vf(e.history,c,ct,F,ce,p,f,h,{[b.route.id]:H.data},void 0,W);Wn.filter(Nt=>Nt.key!==S).forEach(Nt=>{let ql=Nt.key,tc=c.fetchers.get(ql),Ny={state:"loading",data:tc&&tc.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(ql,Ny),w.set(ql,M)}),se({fetchers:new Map(c.fetchers)});let{results:Jl,loaderResults:$e,fetcherResults:wt}=await Fo(c.matches,ct,Wo,Wn,ut);if(M.signal.aborted)return;k.delete(S),w.delete(S),Wn.forEach(Nt=>w.delete(Nt.key));let wn=Ef(Jl);if(wn)return vn(c,wn);let{loaderData:Go,errors:Zl}=Sf(c,c.matches,Wo,$e,void 0,Wn,wt,I),Ry={state:"idle",data:H.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(S,Ry);let jy=Zu(Nr);c.navigation.state==="loading"&&Nr>$?(B(y,"Expected pending action"),g&&g.abort(),R(c.navigation.location,{matches:ct,loaderData:Go,errors:Zl,fetchers:new Map(c.fetchers)})):(se(X({errors:Zl,loaderData:_f(c.loaderData,Go,ct,Zl)},jy?{fetchers:new Map(c.fetchers)}:{})),p=!1)}async function Wt(S,_,P,b,T,F){let A=c.fetchers.get(S),G=X({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},F,{data:A&&A.data," _hasFetcherDoneAnything ":!0});c.fetchers.set(S,G),se({fetchers:new Map(c.fetchers)});let M=new AbortController,be=Ur(e.history,P,M.signal);w.set(S,M);let H=await Fr("loader",be,b,T,m.basename);if(Rn(H)&&(H=await um(H,be.signal,!0)||H),w.get(S)===M&&w.delete(S),be.signal.aborted)return;if(hr(H)){await vn(c,H);return}if(oo(H)){let ut=lr(c.matches,_);c.fetchers.delete(S),se({fetchers:new Map(c.fetchers),errors:{[ut.route.id]:H.error}});return}B(!Rn(H),"Unhandled fetcher deferred data");let ce={state:"idle",data:H.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(S,ce),se({fetchers:new Map(c.fetchers)})}async function vn(S,_,P){var b;let{submission:T,replace:F,isFetchActionRedirect:A}=P===void 0?{}:P;_.revalidate&&(p=!0);let G=Po(S.location,_.location,X({_isRedirect:!0},A?{_isFetchActionRedirect:!0}:{}));if(B(G,"Expected a location on the redirect navigation"),im&&typeof((b=window)==null?void 0:b.location)<"u"){let ct=e.history.createURL(_.location).origin;if(window.location.origin!==ct){F?window.location.replace(_.location):window.location.assign(_.location);return}}g=null;let M=F===!0?pe.Replace:pe.Push,{formMethod:be,formAction:H,formEncType:ce,formData:ut}=S.navigation;!T&&be&&H&&ut&&ce&&(T={formMethod:be,formAction:H,formEncType:ce,formData:ut}),Uv.has(_.status)&&T&&Tt(T.formMethod)?await K(M,G,{submission:X({},T,{formAction:_.location}),preventScrollReset:v}):await K(M,G,{overrideNavigation:{state:"loading",location:G,formMethod:T?T.formMethod:void 0,formAction:T?T.formAction:void 0,formEncType:T?T.formEncType:void 0,formData:T?T.formData:void 0},preventScrollReset:v})}async function Fo(S,_,P,b,T){let F=await Promise.all([...P.map(M=>Fr("loader",T,M,_,m.basename)),...b.map(M=>Fr("loader",Ur(e.history,M.path,T.signal),M.match,M.matches,m.basename))]),A=F.slice(0,P.length),G=F.slice(P.length);return await Promise.all([kf(S,P,A,T.signal,!1,c.loaderData),kf(S,b.map(M=>M.match),G,T.signal,!0)]),{results:F,loaderResults:A,fetcherResults:G}}function Uo(){p=!0,f.push(...Xl()),W.forEach((S,_)=>{w.has(_)&&(h.push(_),Bo(_))})}function Kl(S,_,P){let b=lr(c.matches,_);Yl(S),se({errors:{[b.route.id]:P},fetchers:new Map(c.fetchers)})}function Yl(S){w.has(S)&&Bo(S),W.delete(S),k.delete(S),j.delete(S),c.fetchers.delete(S)}function Bo(S){let _=w.get(S);B(_,"Expected fetch controller: "+S),_.abort(),w.delete(S)}function Ju(S){for(let _ of S){let b={state:"idle",data:et(_).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};c.fetchers.set(_,b)}}function Py(){let S=[];for(let _ of j){let P=c.fetchers.get(_);B(P,"Expected fetcher: "+_),P.state==="loading"&&(j.delete(_),S.push(_))}Ju(S)}function Zu(S){let _=[];for(let[P,b]of k)if(b0}function Cy(S,_){let P=c.blockers.get(S)||yf;return xe.get(S)!==_&&(xe.set(S,_),ee==null?ee=S:S!==ee&&Co(!1,"A router only supports one blocker at a time")),P}function jr(S){c.blockers.delete(S),xe.delete(S),ee===S&&(ee=null)}function Vo(S,_){let P=c.blockers.get(S)||yf;B(P.state==="unblocked"&&_.state==="blocked"||P.state==="blocked"&&_.state==="blocked"||P.state==="blocked"&&_.state==="proceeding"||P.state==="blocked"&&_.state==="unblocked"||P.state==="proceeding"&&_.state==="unblocked","Invalid blocker state transition: "+P.state+" -> "+_.state),c.blockers.set(S,_),se({blockers:new Map(c.blockers)})}function qu(S){let{currentLocation:_,nextLocation:P,historyAction:b}=S;if(ee==null)return;let T=xe.get(ee);B(T,"Could not find a function for the active blocker");let F=c.blockers.get(ee);if(!(F&&F.state==="proceeding")&&T({currentLocation:_,nextLocation:P,historyAction:b}))return ee}function Xl(S){let _=[];return I.forEach((P,b)=>{(!S||S(b))&&(P.cancel(),_.push(b),I.delete(b))}),_}function Oy(S,_,P){if(o=S,l=_,i=P||(b=>b.key),!a&&c.navigation===Oa){a=!0;let b=ec(c.location,c.matches);b!=null&&se({restoreScrollPosition:b})}return()=>{o=null,l=null,i=null}}function $y(S,_){if(o&&i&&l){let P=_.map(T=>Pf(T,c.loaderData)),b=i(S,P)||S.key;o[b]=l()}}function ec(S,_){if(o&&i&&l){let P=_.map(F=>Pf(F,c.loaderData)),b=i(S,P)||S.key,T=o[b];if(typeof T=="number")return T}return null}return m={get basename(){return e.basename},get state(){return c},get routes(){return t},initialize:Hn,subscribe:yn,enableScrollRestoration:Oy,navigate:D,fetch:gn,revalidate:U,createHref:S=>e.history.createHref(S),encodeLocation:S=>e.history.encodeLocation(S),getFetcher:et,deleteFetcher:Yl,dispose:Rr,getBlocker:Cy,deleteBlocker:jr,_internalFetchControllers:w,_internalActiveDeferreds:I},m}function Wv(e){return e!=null&&"formData"in e}function gf(e,t,n){n===void 0&&(n=!1);let r=typeof e=="string"?e:An(e);if(!t||!Wv(t))return{path:r};if(t.formMethod&&!Jv(t.formMethod))return{path:r,error:Qt(405,{method:t.formMethod})};let o;if(t.formData&&(o={formMethod:t.formMethod||"get",formAction:sm(r),formEncType:t&&t.formEncType||"application/x-www-form-urlencoded",formData:t.formData},Tt(o.formMethod)))return{path:r,submission:o};let i=Rt(r),l=am(t.formData);return n&&i.search&&cm(i.search)&&l.append("index",""),i.search="?"+l,{path:An(i),submission:o}}function Gv(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function vf(e,t,n,r,o,i,l,a,s,u,d){let m=u?Object.values(u)[0]:s?Object.values(s)[0]:void 0,c=e.createURL(t.location),y=e.createURL(o),v=i||c.toString()===y.toString()||c.search!==y.search,g=u?Object.keys(u)[0]:void 0,p=Gv(n,g).filter((h,w)=>{if(h.route.loader==null)return!1;if(Qv(t.loaderData,t.matches[w],h)||l.some(k=>k===h.route.id))return!0;let E=t.matches[w],$=h;return wf(h,X({currentUrl:c,currentParams:E.params,nextUrl:y,nextParams:$.params},r,{actionResult:m,defaultShouldRevalidate:v||lm(E,$)}))}),f=[];return d&&d.forEach((h,w)=>{if(n.some(E=>E.route.id===h.routeId))a.includes(w)?f.push(X({key:w},h)):wf(h.match,X({currentUrl:c,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:m,defaultShouldRevalidate:v}))&&f.push(X({key:w},h));else return}),[p,f]}function Qv(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function lm(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function wf(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Fr(e,t,n,r,o,i,l,a){o===void 0&&(o="/"),i===void 0&&(i=!1),l===void 0&&(l=!1);let s,u,d,m=new Promise((y,v)=>d=v),c=()=>d();t.signal.addEventListener("abort",c);try{let y=n.route[e];B(y,"Could not find the "+e+' to run on the "'+n.route.id+'" route'),u=await Promise.race([y({request:t,params:n.params,context:a}),m]),B(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){s=ke.error,u=y}finally{t.signal.removeEventListener("abort",c)}if(Xv(u)){let y=u.status;if(Fv.has(y)){let x=u.headers.get("Location");if(B(x,"Redirects returned/thrown from loaders/actions must have a Location header"),/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(x)){if(!i){let f=new URL(t.url),h=x.startsWith("//")?new URL(f.protocol+x):new URL(x);h.origin===f.origin&&(x=h.pathname+h.search+h.hash)}}else{let f=r.slice(0,r.indexOf(n)+1),h=nm(f).map(E=>E.pathnameBase),w=jv(x,h,new URL(t.url).pathname);if(B(An(w),"Unable to resolve redirect location: "+x),o){let E=w.pathname;w.pathname=E==="/"?o:Tn([o,E])}x=An(w)}if(i)throw u.headers.set("Location",x),u;return{type:ke.redirect,status:y,location:x,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(l)throw{type:s||ke.data,response:u};let v,g=u.headers.get("Content-Type");return g&&/\bapplication\/json\b/.test(g)?v=await u.json():v=await u.text(),s===ke.error?{type:s,error:new Tu(y,u.statusText,v),headers:u.headers}:{type:ke.data,data:v,statusCode:u.status,headers:u.headers}}return s===ke.error?{type:s,error:u}:u instanceof bv?{type:ke.deferred,deferredData:u}:{type:ke.data,data:u}}function Ur(e,t,n,r){let o=e.createURL(sm(t)).toString(),i={signal:n};if(r&&Tt(r.formMethod)){let{formMethod:l,formEncType:a,formData:s}=r;i.method=l.toUpperCase(),i.body=a==="application/x-www-form-urlencoded"?am(s):s}return new Request(o,i)}function am(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,r instanceof File?r.name:r);return t}function Kv(e,t,n,r,o){let i={},l=null,a,s=!1,u={};return n.forEach((d,m)=>{let c=t[m].route.id;if(B(!hr(d),"Cannot handle redirect results in processLoaderData"),oo(d)){let y=lr(e,c),v=d.error;r&&(v=Object.values(r)[0],r=void 0),l=l||{},l[y.route.id]==null&&(l[y.route.id]=v),i[c]=void 0,s||(s=!0,a=rm(d.error)?d.error.status:500),d.headers&&(u[c]=d.headers)}else Rn(d)?(o.set(c,d.deferredData),i[c]=d.deferredData.data):i[c]=d.data,d.statusCode!=null&&d.statusCode!==200&&!s&&(a=d.statusCode),d.headers&&(u[c]=d.headers)}),r&&(l=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:l,statusCode:a||200,loaderHeaders:u}}function Sf(e,t,n,r,o,i,l,a){let{loaderData:s,errors:u}=Kv(t,n,r,o,a);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function xf(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Qt(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,l="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(l="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"&&(a="defer() is not supported in actions")):e===403?(l="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",a='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new Tu(e||500,l,new Error(a),!0)}function Ef(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(hr(n))return n}}function sm(e){let t=typeof e=="string"?Rt(e):e;return An(X({},t,{hash:""}))}function Yv(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash!==t.hash}function Rn(e){return e.type===ke.deferred}function oo(e){return e.type===ke.error}function hr(e){return(e&&e.type)===ke.redirect}function Xv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Jv(e){return Av.has(e)}function Tt(e){return Mv.has(e)}async function kf(e,t,n,r,o,i){for(let l=0;lm.route.id===s.route.id),d=u!=null&&!lm(u,s)&&(i&&i[s.route.id])!==void 0;Rn(a)&&(o||d)&&await um(a,r,o).then(m=>{m&&(n[l]=m||n[l])})}}async function um(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:ke.data,data:e.deferredData.unwrappedData}}catch(o){return{type:ke.error,error:o}}return{type:ke.data,data:e.deferredData.data}}}function cm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Pf(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function Cf(e,t){let n=typeof t=="string"?Rt(t).search:t.search;if(e[e.length-1].route.index&&cm(n||""))return e[e.length-1];let r=nm(e);return r[r.length-1]}/** + * React Router v6.8.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.value=r,o.getSnapshot=t,$a(o)&&i({inst:o})},[e,r,t]),t1(()=>($a(o)&&i({inst:o}),e(()=>{$a(o)&&i({inst:o})})),[e]),r1(r),r}function $a(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!qv(n,r)}catch{return!0}}function i1(e,t,n){return t()}const l1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a1=!l1,s1=a1?i1:o1,u1="useSyncExternalStore"in lo?(e=>e.useSyncExternalStore)(lo):s1,bu=C.createContext(null),Lu=C.createContext(null),fm=C.createContext(null),Tl=C.createContext(null),bl=C.createContext({outlet:null,matches:[]}),dm=C.createContext(null);function Iu(){return C.useContext(Tl)!=null}function c1(){return Iu()||B(!1),C.useContext(Tl).location}function f1(e,t){Iu()||B(!1);let{navigator:n}=C.useContext(fm),r=C.useContext(Lu),{matches:o}=C.useContext(bl),i=o[o.length-1],l=i?i.params:{};i&&i.pathname;let a=i?i.pathnameBase:"/";i&&i.route;let s=c1(),u;if(t){var d;let g=typeof t=="string"?Rt(t):t;a==="/"||(d=g.pathname)!=null&&d.startsWith(a)||B(!1),u=g}else u=s;let m=u.pathname||"/",c=a==="/"?m:m.slice(a.length)||"/",y=Kr(e,{pathname:c}),v=m1(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:Tn([a,n.encodeLocation?n.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?a:Tn([a,n.encodeLocation?n.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,r||void 0);return t&&v?C.createElement(Tl.Provider,{value:{location:qi({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:pe.Pop}},v):v}function d1(){let e=w1(),t=rm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:o},n):null,i)}class p1 extends C.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?C.createElement(bl.Provider,{value:this.props.routeContext},C.createElement(dm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h1(e){let{routeContext:t,match:n,children:r}=e,o=C.useContext(bu);return o&&o.static&&o.staticContext&&n.route.errorElement&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(bl.Provider,{value:t},r)}function m1(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,o=n==null?void 0:n.errors;if(o!=null){let i=r.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id]));i>=0||B(!1),r=r.slice(0,Math.min(r.length,i+1))}return r.reduceRight((i,l,a)=>{let s=l.route.id?o==null?void 0:o[l.route.id]:null,u=n?l.route.errorElement||C.createElement(d1,null):null,d=t.concat(r.slice(0,a+1)),m=()=>C.createElement(h1,{match:l,routeContext:{outlet:i,matches:d}},s?u:l.route.element!==void 0?l.route.element:i);return n&&(l.route.errorElement||a===0)?C.createElement(p1,{location:n.location,component:u,error:s,children:m(),routeContext:{outlet:null,matches:d}}):m()},null)}var Of;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(Of||(Of={}));var el;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(el||(el={}));function y1(e){let t=C.useContext(Lu);return t||B(!1),t}function g1(e){let t=C.useContext(bl);return t||B(!1),t}function v1(e){let t=g1(),n=t.matches[t.matches.length-1];return n.route.id||B(!1),n.route.id}function w1(){var e;let t=C.useContext(dm),n=y1(el.UseRouteError),r=v1(el.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function S1(e){let{fallbackElement:t,router:n}=e,r=u1(n.subscribe,()=>n.state,()=>n.state),o=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:l=>n.navigate(l),push:(l,a,s)=>n.navigate(l,{state:a,preventScrollReset:s==null?void 0:s.preventScrollReset}),replace:(l,a,s)=>n.navigate(l,{replace:!0,state:a,preventScrollReset:s==null?void 0:s.preventScrollReset})}),[n]),i=n.basename||"/";return C.createElement(C.Fragment,null,C.createElement(bu.Provider,{value:{router:n,navigator:o,static:!1,basename:i}},C.createElement(Lu.Provider,{value:r},C.createElement(x1,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:o},n.state.initialized?C.createElement(E1,null):t))),null)}function _1(e){B(!1)}function x1(e){let{basename:t="/",children:n=null,location:r,navigationType:o=pe.Pop,navigator:i,static:l=!1}=e;Iu()&&B(!1);let a=t.replace(/^\/*/,"/"),s=C.useMemo(()=>({basename:a,navigator:i,static:l}),[a,i,l]);typeof r=="string"&&(r=Rt(r));let{pathname:u="/",search:d="",hash:m="",state:c=null,key:y="default"}=r,v=C.useMemo(()=>{let g=tm(u,a);return g==null?null:{pathname:g,search:d,hash:m,state:c,key:y}},[a,u,d,m,c,y]);return v==null?null:C.createElement(fm.Provider,{value:s},C.createElement(Tl.Provider,{children:n,value:{location:v,navigationType:o}}))}function E1(e){let{children:t,location:n}=e,r=C.useContext(bu),o=r&&!t?r.router.routes:js(t);return f1(o,n)}var $f;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})($f||($f={}));new Promise(()=>{});function js(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,o)=>{if(!C.isValidElement(r))return;if(r.type===C.Fragment){n.push.apply(n,js(r.props.children,t));return}r.type!==_1&&B(!1),!r.props.index||!r.props.children||B(!1);let i=[...t,o],l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,hasErrorBoundary:r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle};r.props.children&&(l.children=js(r.props.children,i)),n.push(l)}),n}function pm(e){return e.map(t=>{let n=qi({},t);return n.hasErrorBoundary==null&&(n.hasErrorBoundary=n.errorElement!=null),n.children&&(n.children=pm(n.children)),n})}/** + * React Router DOM v6.8.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t({fontFamily:e.fontFamily||"sans-serif"})}var R1=Object.defineProperty,Nf=Object.getOwnPropertySymbols,j1=Object.prototype.hasOwnProperty,N1=Object.prototype.propertyIsEnumerable,zf=(e,t,n)=>t in e?R1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tf=(e,t)=>{for(var n in t||(t={}))j1.call(t,n)&&zf(e,n,t[n]);if(Nf)for(var n of Nf(t))N1.call(t,n)&&zf(e,n,t[n]);return e};function z1(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:Tf({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:Tf({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function Lo(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function Mu(e){const t=Lo(e);return(n,r,o=!0,i=!0)=>{if(typeof n=="string"&&n.includes(".")){const[a,s]=n.split("."),u=parseInt(s,10);if(a in e.colors&&u>=0&&u<10)return e.colors[a][typeof r=="number"&&!i?r:u]}const l=typeof r=="number"?r:t();return n in e.colors?e.colors[n][l]:o?e.colors[e.primaryColor][l]:n}}function ym(e){let t="";for(let n=1;n{const o={from:(r==null?void 0:r.from)||e.defaultGradient.from,to:(r==null?void 0:r.to)||e.defaultGradient.to,deg:(r==null?void 0:r.deg)||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,n(),!1)} 0%, ${t(o.to,n(),!1)} 100%)`}}function Du(e){if(typeof e.size=="number")return e.size;const t=e.sizes[e.size];return t!==void 0?t:e.size||e.sizes.md}function L1(e){return t=>`@media (min-width: ${Du({size:t,sizes:e.breakpoints})}px)`}function I1(e){return t=>`@media (max-width: ${Du({size:t,sizes:e.breakpoints})-1}px)`}function M1(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function D1(e){let t=e.replace("#","");if(t.length===3){const l=t.split("");t=[l[0],l[0],l[1],l[1],l[2],l[2]].join("")}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function A1(e){const[t,n,r,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:n,b:r,a:o||1}}function Au(e){return M1(e)?D1(e):e.startsWith("rgb")?A1(e):{r:0,g:0,b:0,a:1}}function Qn(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";const{r:n,g:r,b:o}=Au(e);return`rgba(${n}, ${r}, ${o}, ${t})`}function F1(e=0){return{position:"absolute",top:e,right:e,left:e,bottom:e}}function U1(e,t){const{r:n,g:r,b:o,a:i}=Au(e),l=1-t,a=s=>Math.round(s*l);return`rgba(${a(n)}, ${a(r)}, ${a(o)}, ${i})`}function B1(e,t){const{r:n,g:r,b:o,a:i}=Au(e),l=a=>Math.round(a+(255-a)*t);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function V1(e){return t=>{if(typeof t=="number")return t;const n=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||n}}function H1(e,t){if(typeof e=="string"&&e.includes(".")){const[n,r]=e.split("."),o=parseInt(r,10);if(n in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:n,shade:o}}return{isSplittedColor:!1}}function W1(e){const t=Mu(e),n=Lo(e),r=gm(e);return({variant:o,color:i,gradient:l,primaryFallback:a})=>{const s=H1(i,e);switch(o){case"light":return{border:"transparent",background:Qn(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1),color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:Qn(t(i,e.colorScheme==="dark"?7:1,a,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),hover:Qn(t(i,e.colorScheme==="dark"?8:0,a,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(i,e.colorScheme==="dark"?5:n("light")),background:"transparent",color:t(i,e.colorScheme==="dark"?5:n("light")),hover:e.colorScheme==="dark"?Qn(t(i,5,a,!1),.05):Qn(t(i,0,a,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(i,n()),hover:null};case"transparent":return{border:"transparent",color:i==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(i,e.colorScheme==="dark"?2:n("light")),background:"transparent",hover:null};case"gradient":return{background:r(l),color:e.white,border:"transparent",hover:null};default:{const u=n(),d=s.isSplittedColor?s.shade:u,m=s.isSplittedColor?s.key:i;return{border:"transparent",background:t(m,d,a),color:e.white,hover:t(m,d===9?8:d+1)}}}}}function G1(e){return t=>{const n=Lo(e)(t);return e.colors[e.primaryColor][n]}}function Q1(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function K1(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}const ye={fontStyles:$1,themeColor:Mu,focusStyles:z1,linearGradient:T1,radialGradient:b1,smallerThan:I1,largerThan:L1,rgba:Qn,size:Du,cover:F1,darken:U1,lighten:B1,radius:V1,variant:W1,primaryShade:Lo,hover:Q1,gradient:gm,primaryColor:G1,placeholderStyles:K1};var Y1=Object.defineProperty,X1=Object.defineProperties,J1=Object.getOwnPropertyDescriptors,bf=Object.getOwnPropertySymbols,Z1=Object.prototype.hasOwnProperty,q1=Object.prototype.propertyIsEnumerable,Lf=(e,t,n)=>t in e?Y1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ew=(e,t)=>{for(var n in t||(t={}))Z1.call(t,n)&&Lf(e,n,t[n]);if(bf)for(var n of bf(t))q1.call(t,n)&&Lf(e,n,t[n]);return e},tw=(e,t)=>X1(e,J1(t));function vm(e){return tw(ew({},e),{fn:{fontStyles:ye.fontStyles(e),themeColor:ye.themeColor(e),focusStyles:ye.focusStyles(e),largerThan:ye.largerThan(e),smallerThan:ye.smallerThan(e),radialGradient:ye.radialGradient,linearGradient:ye.linearGradient,gradient:ye.gradient(e),rgba:ye.rgba,size:ye.size,cover:ye.cover,lighten:ye.lighten,darken:ye.darken,primaryShade:ye.primaryShade(e),radius:ye.radius(e),variant:ye.variant(e),hover:ye.hover,primaryColor:ye.primaryColor(e),placeholderStyles:ye.placeholderStyles(e)}})}Object.keys(mm);const nw={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:mm,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3,fontWeight:void 0},h2:{fontSize:26,lineHeight:1.35,fontWeight:void 0},h3:{fontSize:22,lineHeight:1.4,fontWeight:void 0},h4:{fontSize:18,lineHeight:1.45,fontWeight:void 0},h5:{fontSize:16,lineHeight:1.5,fontWeight:void 0},h6:{fontSize:14,lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(1px)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:2,outline:`2px solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},jn=vm(nw);function rw(e){if(e.sheet)return e.sheet;for(var t=0;t0?Pe($r,--We):0,kr--,he===10&&(kr=1,Il--),he}function Ye(){return he=We2||$o(he)>3?"":" "}function mw(e,t){for(;--t&&Ye()&&!(he<48||he>102||he>57&&he<65||he>70&&he<97););return Io(e,Ci()+(t<6&&Ot()==32&&Ye()==32))}function Ts(e){for(;Ye();)switch(he){case e:return We;case 34:case 39:e!==34&&e!==39&&Ts(he);break;case 40:e===41&&Ts(e);break;case 92:Ye();break}return We}function yw(e,t){for(;Ye()&&e+he!==47+10;)if(e+he===42+42&&Ot()===47)break;return"/*"+Io(t,We-1)+"*"+Ll(e===47?e:Ye())}function gw(e){for(;!$o(Ot());)Ye();return Io(e,We)}function vw(e){return km($i("",null,null,null,[""],e=Em(e),0,[0],e))}function $i(e,t,n,r,o,i,l,a,s){for(var u=0,d=0,m=l,c=0,y=0,v=0,g=1,x=1,p=1,f=0,h="",w=o,E=i,$=r,k=h;x;)switch(v=f,f=Ye()){case 40:if(v!=108&&Pe(k,m-1)==58){zs(k+=J(Oi(f),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:k+=Oi(f);break;case 9:case 10:case 13:case 32:k+=hw(v);break;case 92:k+=mw(Ci()-1,7);continue;case 47:switch(Ot()){case 42:case 47:ci(ww(yw(Ye(),Ci()),t,n),s);break;default:k+="/"}break;case 123*g:a[u++]=xt(k)*p;case 125*g:case 59:case 0:switch(f){case 0:case 125:x=0;case 59+d:y>0&&xt(k)-m&&ci(y>32?Mf(k+";",r,n,m-1):Mf(J(k," ","")+";",r,n,m-2),s);break;case 59:k+=";";default:if(ci($=If(k,t,n,u,d,o,a,h,w=[],E=[],m),i),f===123)if(d===0)$i(k,t,$,$,w,i,m,a,E);else switch(c===99&&Pe(k,3)===110?100:c){case 100:case 109:case 115:$i(e,$,$,r&&ci(If(e,$,$,0,0,o,a,h,o,w=[],m),E),o,E,m,a,r?w:E);break;default:$i(k,$,$,$,[""],E,0,a,E)}}u=d=y=0,g=p=1,h=k="",m=l;break;case 58:m=1+xt(k),y=v;default:if(g<1){if(f==123)--g;else if(f==125&&g++==0&&pw()==125)continue}switch(k+=Ll(f),f*g){case 38:p=d>0?1:(k+="\f",-1);break;case 44:a[u++]=(xt(k)-1)*p,p=1;break;case 64:Ot()===45&&(k+=Oi(Ye())),c=Ot(),d=m=xt(h=k+=gw(Ci())),f++;break;case 45:v===45&&xt(k)==2&&(g=0)}}return i}function If(e,t,n,r,o,i,l,a,s,u,d){for(var m=o-1,c=o===0?i:[""],y=Bu(c),v=0,g=0,x=0;v0?c[p]+" "+f:J(f,/&\f/g,c[p])))&&(s[x++]=h);return Ml(e,t,n,o===0?Fu:a,s,u,d)}function ww(e,t,n){return Ml(e,t,n,wm,Ll(dw()),Oo(e,2,-2),0)}function Mf(e,t,n,r){return Ml(e,t,n,Uu,Oo(e,0,r),Oo(e,r+1,-1),r)}function mr(e,t){for(var n="",r=Bu(e),o=0;o6)switch(Pe(e,t+1)){case 109:if(Pe(e,t+4)!==45)break;case 102:return J(e,/(.+:)(.+)-([^]+)/,"$1"+Y+"$2-$3$1"+tl+(Pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~zs(e,"stretch")?Pm(J(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Pe(e,t+1)!==115)break;case 6444:switch(Pe(e,xt(e)-3-(~zs(e,"!important")&&10))){case 107:return J(e,":",":"+Y)+e;case 101:return J(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Y+(Pe(e,14)===45?"inline-":"")+"box$3$1"+Y+"$2$3$1"+Ne+"$2box$3")+e}break;case 5936:switch(Pe(e,t+11)){case 114:return Y+e+Ne+J(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Y+e+Ne+J(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Y+e+Ne+J(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Y+e+Ne+e+e}return e}var Rw=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case Uu:t.return=Pm(t.value,t.length);break;case Sm:return mr([Br(t,{value:J(t.value,"@","@"+Y)})],o);case Fu:if(t.length)return fw(t.props,function(i){switch(cw(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return mr([Br(t,{props:[J(i,/:(read-\w+)/,":"+tl+"$1")]})],o);case"::placeholder":return mr([Br(t,{props:[J(i,/:(plac\w+)/,":"+Y+"input-$1")]}),Br(t,{props:[J(i,/:(plac\w+)/,":"+tl+"$1")]}),Br(t,{props:[J(i,/:(plac\w+)/,Ne+"input-$1")]})],o)}return""})}},jw=[Rw],Cm=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var x=g.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=t.stylisPlugins||jw,i={},l,a=[];l=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var x=g.getAttribute("data-emotion").split(" "),p=1;p=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Vw={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Hw=/[A-Z]|^ms/g,Ww=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Nm=function(t){return t.charCodeAt(1)===45},Ff=function(t){return t!=null&&typeof t!="boolean"},Ra=Ew(function(e){return Nm(e)?e:e.replace(Hw,"-$&").toLowerCase()}),Uf=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Ww,function(r,o,i){return Et={name:o,styles:i,next:Et},o})}return Vw[t]!==1&&!Nm(t)&&typeof n=="number"&&n!==0?n+"px":n};function Ro(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Et={name:n.name,styles:n.styles,next:Et},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Et={name:r.name,styles:r.styles,next:Et},r=r.next;var o=n.styles+";";return o}return Gw(e,t,n)}case"function":{if(e!==void 0){var i=Et,l=n(e);return Et=i,Ro(e,t,l)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function Gw(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ot in e?qw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oS=(e,t)=>{for(var n in t||(t={}))nS.call(t,n)&&Wf(e,n,t[n]);if(Hf)for(var n of Hf(t))rS.call(t,n)&&Wf(e,n,t[n]);return e},iS=(e,t)=>eS(e,tS(t));function lS({theme:e}){return N.createElement(Mo,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:iS(oS({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function fi(e,t,n){Object.keys(t).forEach(r=>{e[`--mantine-${n}-${r}`]=typeof t[r]=="number"?`${t[r]}px`:t[r]})}function aS({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":`${e.headings.fontWeight}`};fi(t,e.shadows,"shadow"),fi(t,e.fontSizes,"font-size"),fi(t,e.radius,"radius"),fi(t,e.spacing,"spacing"),Object.keys(e.colors).forEach(r=>{e.colors[r].forEach((o,i)=>{t[`--mantine-color-${r}-${i}`]=o})});const n=e.headings.sizes;return Object.keys(n).forEach(r=>{t[`--mantine-${r}-font-size`]=`${n[r].fontSize}px`,t[`--mantine-${r}-line-height`]=`${n[r].lineHeight}`}),N.createElement(Mo,{styles:{":root":t}})}var sS=Object.defineProperty,uS=Object.defineProperties,cS=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,fS=Object.prototype.hasOwnProperty,dS=Object.prototype.propertyIsEnumerable,Qf=(e,t,n)=>t in e?sS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sn=(e,t)=>{for(var n in t||(t={}))fS.call(t,n)&&Qf(e,n,t[n]);if(Gf)for(var n of Gf(t))dS.call(t,n)&&Qf(e,n,t[n]);return e},Kf=(e,t)=>uS(e,cS(t));function pS(e,t){if(!t)return e;const n=Object.keys(e).reduce((r,o)=>{if(o==="headings"&&t.headings){const i=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,a)=>(l[a]=Sn(Sn({},e.headings.sizes[a]),t.headings.sizes[a]),l),{}):e.headings.sizes;return Kf(Sn({},r),{headings:Kf(Sn(Sn({},e.headings),t.headings),{sizes:i})})}return r[o]=typeof t[o]=="object"?Sn(Sn({},e[o]),t[o]):typeof t[o]=="number"||typeof t[o]=="boolean"||typeof t[o]=="function"?t[o]:t[o]||e[o],r},{});if(!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function hS(e,t){return vm(pS(e,t))}function Tm(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}const mS={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:"1px dotted ButtonText"},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"},"[hidden]":{display:"none"}};function yS(){return N.createElement(Mo,{styles:mS})}var gS=Object.defineProperty,Yf=Object.getOwnPropertySymbols,vS=Object.prototype.hasOwnProperty,wS=Object.prototype.propertyIsEnumerable,Xf=(e,t,n)=>t in e?gS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,io=(e,t)=>{for(var n in t||(t={}))vS.call(t,n)&&Xf(e,n,t[n]);if(Yf)for(var n of Yf(t))wS.call(t,n)&&Xf(e,n,t[n]);return e};const nl=C.createContext({theme:jn});function vt(){var e;return((e=C.useContext(nl))==null?void 0:e.theme)||jn}function SS(e){const t=vt(),n=r=>{var o,i;return{styles:((o=t.components[r])==null?void 0:o.styles)||{},classNames:((i=t.components[r])==null?void 0:i.classNames)||{}}};return Array.isArray(e)?e.map(n):[n(e)]}function bm(){var e;return(e=C.useContext(nl))==null?void 0:e.emotionCache}function jt(e,t,n){var r;const o=vt(),i=(r=o.components[e])==null?void 0:r.defaultProps,l=typeof i=="function"?i(o):i;return io(io(io({},t),l),Tm(n))}function Lm({theme:e,emotionCache:t,withNormalizeCSS:n=!1,withGlobalStyles:r=!1,withCSSVariables:o=!1,inherit:i=!1,children:l}){const a=C.useContext(nl),s=hS(jn,i?io(io({},a.theme),e):e);return N.createElement(Jw,{theme:s},N.createElement(nl.Provider,{value:{theme:s,emotionCache:t}},n&&N.createElement(yS,null),r&&N.createElement(lS,{theme:s}),o&&N.createElement(aS,{theme:s}),typeof s.globalStyles=="function"&&N.createElement(Mo,{styles:s.globalStyles(s)}),l))}Lm.displayName="@mantine/core/MantineProvider";const _S={app:100,modal:200,popover:300,overlay:400,max:9999};function xS(e){return _S[e]}function ES(e,t){const n=C.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const kS=Cm({key:"mantine",prepend:!0});function PS(){return bm()||kS}var CS=Object.defineProperty,Jf=Object.getOwnPropertySymbols,OS=Object.prototype.hasOwnProperty,$S=Object.prototype.propertyIsEnumerable,Zf=(e,t,n)=>t in e?CS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RS=(e,t)=>{for(var n in t||(t={}))OS.call(t,n)&&Zf(e,n,t[n]);if(Jf)for(var n of Jf(t))$S.call(t,n)&&Zf(e,n,t[n]);return e};const ja="ref";function jS(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(ja in n))return{args:e,ref:t};t=n[ja];const r=RS({},n);return delete r[ja],{args:[r],ref:t}}const{cssFactory:NS}=(()=>{function e(n,r,o){const i=[],l=Fw(n,i,o);return i.length<2?o:l+r(i)}function t(n){const{cache:r}=n,o=(...l)=>{const{ref:a,args:s}=jS(l),u=Gu(s,r.registered);return jm(r,u,!1),`${r.key}-${u.name}${a===void 0?"":` ${a}`}`};return{css:o,cx:(...l)=>e(r.registered,o,O1(l))}}return{cssFactory:t}})();function Im(){const e=PS();return ES(()=>NS({cache:e}),[e])}function zS({cx:e,classes:t,context:n,classNames:r,name:o,cache:i}){const l=n.reduce((a,s)=>(Object.keys(s.classNames).forEach(u=>{typeof a[u]!="string"?a[u]=`${s.classNames[u]}`:a[u]=`${a[u]} ${s.classNames[u]}`}),a),{});return Object.keys(t).reduce((a,s)=>(a[s]=e(t[s],l[s],r!=null&&r[s],Array.isArray(o)?o.filter(Boolean).map(u=>`${(i==null?void 0:i.key)||"mantine"}-${u}-${s}`).join(" "):o?`${(i==null?void 0:i.key)||"mantine"}-${o}-${s}`:null),a),{})}var TS=Object.defineProperty,qf=Object.getOwnPropertySymbols,bS=Object.prototype.hasOwnProperty,LS=Object.prototype.propertyIsEnumerable,ed=(e,t,n)=>t in e?TS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t)=>{for(var n in t||(t={}))bS.call(t,n)&&ed(e,n,t[n]);if(qf)for(var n of qf(t))LS.call(t,n)&&ed(e,n,t[n]);return e};function IS(e){return`__mantine-ref-${e||""}`}function td(e,t,n){const r=o=>typeof o=="function"?o(t,n||{}):o||{};return Array.isArray(e)?e.map(o=>r(o.styles)).reduce((o,i)=>(Object.keys(i).forEach(l=>{o[l]?o[l]=Na(Na({},o[l]),i[l]):o[l]=Na({},i[l])}),o),{}):r(e)}function Vt(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const i=vt(),l=SS(o==null?void 0:o.name),a=bm(),{css:s,cx:u}=Im(),d=t(i,r,IS),m=td(o==null?void 0:o.styles,i,r),c=td(l,i,r),y=Object.fromEntries(Object.keys(d).map(v=>{const g=u({[s(d[v])]:!(o!=null&&o.unstyled)},s(c[v]),s(m[v]));return[v,g]}));return{classes:zS({cx:u,classes:y,context:l,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:a}),cx:u,theme:i}}return n}function MS({styles:e}){const t=vt();return N.createElement(Mo,{styles:Zw(typeof e=="function"?e(t):e)})}var nd=Object.getOwnPropertySymbols,DS=Object.prototype.hasOwnProperty,AS=Object.prototype.propertyIsEnumerable,FS=(e,t)=>{var n={};for(var r in e)DS.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nd)for(var r of nd(e))t.indexOf(r)<0&&AS.call(e,r)&&(n[r]=e[r]);return n};function US(e){const t=e,{m:n,mx:r,my:o,mt:i,mb:l,ml:a,mr:s,p:u,px:d,py:m,pt:c,pb:y,pl:v,pr:g,bg:x,c:p,opacity:f,ff:h,fz:w,fw:E,lts:$,ta:k,lh:j,fs:W,tt:I,td:ee,w:xe,miw:at,maw:Hn,h:Rr,mih:yn,mah:se,bgsz:R,bgp:D,bgr:U,bga:K,pos:ue,top:Ht,left:et,bottom:gn,right:st,inset:Wt,display:vn}=t,Fo=FS(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:Tm({m:n,mx:r,my:o,mt:i,mb:l,ml:a,mr:s,p:u,px:d,py:m,pt:c,pb:y,pl:v,pr:g,bg:x,c:p,opacity:f,ff:h,fz:w,fw:E,lts:$,ta:k,lh:j,fs:W,tt:I,td:ee,w:xe,miw:at,maw:Hn,h:Rr,mih:yn,mah:se,bgsz:R,bgp:D,bgr:U,bga:K,pos:ue,top:Ht,left:et,bottom:gn,right:st,inset:Wt,display:vn}),rest:Fo}}function BS(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>t.fn.size({size:r,sizes:t.breakpoints})-t.fn.size({size:o,sizes:t.breakpoints}));return"base"in e?["base",...n]:n}function VS({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return BS(e,t).reduce((l,a)=>{if(a==="base"&&e.base!==void 0){const u=n(e.base,t);return Array.isArray(r)?(r.forEach(d=>{l[d]=u}),l):(l[r]=u,l)}const s=n(e[a],t);return Array.isArray(r)?(l[t.fn.largerThan(a)]={},r.forEach(u=>{l[t.fn.largerThan(a)][u]=s}),l):(l[t.fn.largerThan(a)]={[r]:s},l)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((i,l)=>(i[l]=o,i),{}):{[r]:o}}function HS(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function WS(e){return e}function GS(e,t){return t.fn.size({size:e,sizes:t.fontSizes})}const QS=["-xs","-sm","-md","-lg","-xl"];function KS(e,t){return QS.includes(e)?t.fn.size({size:e.replace("-",""),sizes:t.spacing})*-1:t.fn.size({size:e,sizes:t.spacing})}const YS={color:HS,default:WS,fontSize:GS,spacing:KS},XS={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"default",property:"opacity"},ff:{type:"default",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"default",property:"fontWeight"},lts:{type:"default",property:"letterSpacing"},ta:{type:"default",property:"textAlign"},lh:{type:"default",property:"lineHeight"},fs:{type:"default",property:"fontStyle"},tt:{type:"default",property:"textTransform"},td:{type:"default",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"default",property:"background-size"},bgp:{type:"default",property:"background-position"},bgr:{type:"default",property:"background-repeat"},bga:{type:"default",property:"background-attachment"},pos:{type:"default",property:"position"},top:{type:"default",property:"top"},left:{type:"default",property:"left"},bottom:{type:"default",property:"bottom"},right:{type:"default",property:"right"},inset:{type:"default",property:"inset"},display:{type:"default",property:"display"}};var JS=Object.defineProperty,rd=Object.getOwnPropertySymbols,ZS=Object.prototype.hasOwnProperty,qS=Object.prototype.propertyIsEnumerable,od=(e,t,n)=>t in e?JS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,id=(e,t)=>{for(var n in t||(t={}))ZS.call(t,n)&&od(e,n,t[n]);if(rd)for(var n of rd(t))qS.call(t,n)&&od(e,n,t[n]);return e};function ld(e,t,n=XS){return Object.keys(n).reduce((o,i)=>(i in e&&e[i]!==void 0&&o.push(VS({value:e[i],getValue:YS[n[i].type],property:n[i].property,theme:t})),o),[]).reduce((o,i)=>(Object.keys(i).forEach(l=>{typeof i[l]=="object"&&i[l]!==null&&l in o?o[l]=id(id({},o[l]),i[l]):o[l]=i[l]}),o),{})}function ad(e,t){return typeof e=="function"?e(t):e}function e_(e,t,n){const r=vt(),{css:o,cx:i}=Im();return Array.isArray(e)?i(n,o(ld(t,r)),e.map(l=>o(ad(l,r)))):i(n,o(ad(e,r)),o(ld(t,r)))}var t_=Object.defineProperty,rl=Object.getOwnPropertySymbols,Mm=Object.prototype.hasOwnProperty,Dm=Object.prototype.propertyIsEnumerable,sd=(e,t,n)=>t in e?t_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n_=(e,t)=>{for(var n in t||(t={}))Mm.call(t,n)&&sd(e,n,t[n]);if(rl)for(var n of rl(t))Dm.call(t,n)&&sd(e,n,t[n]);return e},r_=(e,t)=>{var n={};for(var r in e)Mm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rl)for(var r of rl(e))t.indexOf(r)<0&&Dm.call(e,r)&&(n[r]=e[r]);return n};const Am=C.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:i,sx:l}=n,a=r_(n,["className","component","style","sx"]);const{systemStyles:s,rest:u}=US(a),d=o||"div";return N.createElement(d,n_({ref:t,className:e_(l,s,r),style:i},u))});Am.displayName="@mantine/core/Box";const $t=Am;var o_=Object.defineProperty,i_=Object.defineProperties,l_=Object.getOwnPropertyDescriptors,ud=Object.getOwnPropertySymbols,a_=Object.prototype.hasOwnProperty,s_=Object.prototype.propertyIsEnumerable,cd=(e,t,n)=>t in e?o_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fd=(e,t)=>{for(var n in t||(t={}))a_.call(t,n)&&cd(e,n,t[n]);if(ud)for(var n of ud(t))s_.call(t,n)&&cd(e,n,t[n]);return e},u_=(e,t)=>i_(e,l_(t)),c_=Vt(e=>({root:u_(fd(fd({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const f_=c_;var d_=Object.defineProperty,ol=Object.getOwnPropertySymbols,Fm=Object.prototype.hasOwnProperty,Um=Object.prototype.propertyIsEnumerable,dd=(e,t,n)=>t in e?d_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p_=(e,t)=>{for(var n in t||(t={}))Fm.call(t,n)&&dd(e,n,t[n]);if(ol)for(var n of ol(t))Um.call(t,n)&&dd(e,n,t[n]);return e},h_=(e,t)=>{var n={};for(var r in e)Fm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ol)for(var r of ol(e))t.indexOf(r)<0&&Um.call(e,r)&&(n[r]=e[r]);return n};const Bm=C.forwardRef((e,t)=>{const n=jt("UnstyledButton",{},e),{className:r,component:o="button",unstyled:i}=n,l=h_(n,["className","component","unstyled"]),{classes:a,cx:s}=f_(null,{name:"UnstyledButton",unstyled:i});return N.createElement($t,p_({component:o,ref:t,className:s(a.root,r),type:o==="button"?"button":void 0},l))});Bm.displayName="@mantine/core/UnstyledButton";const m_=Bm;var y_=Object.defineProperty,il=Object.getOwnPropertySymbols,Vm=Object.prototype.hasOwnProperty,Hm=Object.prototype.propertyIsEnumerable,pd=(e,t,n)=>t in e?y_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g_=(e,t)=>{for(var n in t||(t={}))Vm.call(t,n)&&pd(e,n,t[n]);if(il)for(var n of il(t))Hm.call(t,n)&&pd(e,n,t[n]);return e},v_=(e,t)=>{var n={};for(var r in e)Vm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&il)for(var r of il(e))t.indexOf(r)<0&&Hm.call(e,r)&&(n[r]=e[r]);return n};function w_(e){var t=e,{size:n,color:r}=t,o=v_(t,["size","color"]);return N.createElement("svg",g_({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:`${n}px`},o),N.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},N.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),N.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},N.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),N.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},N.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),N.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},N.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),N.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},N.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var S_=Object.defineProperty,ll=Object.getOwnPropertySymbols,Wm=Object.prototype.hasOwnProperty,Gm=Object.prototype.propertyIsEnumerable,hd=(e,t,n)=>t in e?S_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__=(e,t)=>{for(var n in t||(t={}))Wm.call(t,n)&&hd(e,n,t[n]);if(ll)for(var n of ll(t))Gm.call(t,n)&&hd(e,n,t[n]);return e},x_=(e,t)=>{var n={};for(var r in e)Wm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ll)for(var r of ll(e))t.indexOf(r)<0&&Gm.call(e,r)&&(n[r]=e[r]);return n};function E_(e){var t=e,{size:n,color:r}=t,o=x_(t,["size","color"]);return N.createElement("svg",__({width:`${n}px`,height:`${n}px`,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},o),N.createElement("g",{fill:"none",fillRule:"evenodd"},N.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},N.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),N.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},N.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var k_=Object.defineProperty,al=Object.getOwnPropertySymbols,Qm=Object.prototype.hasOwnProperty,Km=Object.prototype.propertyIsEnumerable,md=(e,t,n)=>t in e?k_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P_=(e,t)=>{for(var n in t||(t={}))Qm.call(t,n)&&md(e,n,t[n]);if(al)for(var n of al(t))Km.call(t,n)&&md(e,n,t[n]);return e},C_=(e,t)=>{var n={};for(var r in e)Qm.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&al)for(var r of al(e))t.indexOf(r)<0&&Km.call(e,r)&&(n[r]=e[r]);return n};function O_(e){var t=e,{size:n,color:r}=t,o=C_(t,["size","color"]);return N.createElement("svg",P_({width:`${n}px`,height:`${n/4}px`,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},o),N.createElement("circle",{cx:"15",cy:"15",r:"15"},N.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),N.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},N.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),N.createElement("circle",{cx:"105",cy:"15",r:"15"},N.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),N.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var $_=Object.defineProperty,sl=Object.getOwnPropertySymbols,Ym=Object.prototype.hasOwnProperty,Xm=Object.prototype.propertyIsEnumerable,yd=(e,t,n)=>t in e?$_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R_=(e,t)=>{for(var n in t||(t={}))Ym.call(t,n)&&yd(e,n,t[n]);if(sl)for(var n of sl(t))Xm.call(t,n)&&yd(e,n,t[n]);return e},j_=(e,t)=>{var n={};for(var r in e)Ym.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sl)for(var r of sl(e))t.indexOf(r)<0&&Xm.call(e,r)&&(n[r]=e[r]);return n};const za={bars:w_,oval:E_,dots:O_},N_={xs:18,sm:22,md:36,lg:44,xl:58},z_={size:"md"};function Jm(e){const t=jt("Loader",z_,e),{size:n,color:r,variant:o}=t,i=j_(t,["size","color","variant"]),l=vt(),a=o in za?o:l.loader;return N.createElement($t,R_({role:"presentation",component:za[a]||za.bars,size:l.fn.size({size:n,sizes:N_}),color:l.fn.variant({variant:"filled",primaryFallback:!1,color:r||l.primaryColor}).background},i))}Jm.displayName="@mantine/core/Loader";const Zm=C.createContext({zIndex:1e3,fixed:!1,layout:"default"}),T_=Zm.Provider;function b_(){return C.useContext(Zm)}function qm(e,t){if(!e)return[];const n=Object.keys(e).filter(r=>r!=="base").map(r=>[t.fn.size({size:r,sizes:t.breakpoints}),e[r]]);return n.sort((r,o)=>r[0]-o[0]),n}var L_=Object.defineProperty,I_=Object.defineProperties,M_=Object.getOwnPropertyDescriptors,gd=Object.getOwnPropertySymbols,D_=Object.prototype.hasOwnProperty,A_=Object.prototype.propertyIsEnumerable,vd=(e,t,n)=>t in e?L_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ta=(e,t)=>{for(var n in t||(t={}))D_.call(t,n)&&vd(e,n,t[n]);if(gd)for(var n of gd(t))A_.call(t,n)&&vd(e,n,t[n]);return e},wd=(e,t)=>I_(e,M_(t)),F_=Vt((e,{height:t,fixed:n,position:r,zIndex:o,borderPosition:i,layout:l})=>{const a=typeof t=="object"&&t!==null?qm(t,e).reduce((s,[u,d])=>(s[`@media (min-width: ${u}px)`]={height:d,minHeight:d},s),{}):null;return{root:wd(Ta(wd(Ta(Ta({},e.fn.fontStyles()),r),{zIndex:o,left:l==="alt"?"var(--mantine-navbar-width, 0)":0,right:l==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,maxHeight:typeof t=="object"?(t==null?void 0:t.base)||"100%":t,position:n?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),a),{borderBottom:i==="bottom"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:i==="top"?`1px solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const U_=F_;var B_=Object.defineProperty,ul=Object.getOwnPropertySymbols,ey=Object.prototype.hasOwnProperty,ty=Object.prototype.propertyIsEnumerable,Sd=(e,t,n)=>t in e?B_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_d=(e,t)=>{for(var n in t||(t={}))ey.call(t,n)&&Sd(e,n,t[n]);if(ul)for(var n of ul(t))ty.call(t,n)&&Sd(e,n,t[n]);return e},V_=(e,t)=>{var n={};for(var r in e)ey.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ul)for(var r of ul(e))t.indexOf(r)<0&&ty.call(e,r)&&(n[r]=e[r]);return n};const ny=C.forwardRef((e,t)=>{var n=e,{children:r,className:o,classNames:i,styles:l,height:a,fixed:s=!1,withBorder:u=!0,position:d,zIndex:m,section:c,unstyled:y,__staticSelector:v}=n,g=V_(n,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector"]);const x=b_(),p=m||x.zIndex||xS("app"),{classes:f,cx:h,theme:w}=U_({height:a,fixed:x.fixed||s,position:d,zIndex:typeof p=="number"&&x.layout==="default"?p+1:p,layout:x.layout,borderPosition:u?c==="header"?"bottom":"top":"none"},{name:v,classNames:i,styles:l,unstyled:y}),E=typeof a=="object"&&a!==null?qm(a,w).reduce(($,[k,j])=>($[`@media (min-width: ${k}px)`]={[`--mantine-${c}-height`]:`${j}px`},$),{}):null;return N.createElement($t,_d({component:c==="header"?"header":"footer",className:h(f.root,o),ref:t},g),r,N.createElement(MS,{styles:()=>({":root":_d({[`--mantine-${c}-height`]:typeof a=="object"?`${a==null?void 0:a.base}px`||"100%":`${a}px`},E)})}))});ny.displayName="@mantine/core/VerticalSection";var H_=Object.defineProperty,W_=Object.defineProperties,G_=Object.getOwnPropertyDescriptors,xd=Object.getOwnPropertySymbols,Q_=Object.prototype.hasOwnProperty,K_=Object.prototype.propertyIsEnumerable,Ed=(e,t,n)=>t in e?H_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y_=(e,t)=>{for(var n in t||(t={}))Q_.call(t,n)&&Ed(e,n,t[n]);if(xd)for(var n of xd(t))K_.call(t,n)&&Ed(e,n,t[n]);return e},X_=(e,t)=>W_(e,G_(t));const J_={fixed:!1,position:{top:0,left:0,right:0}},ry=C.forwardRef((e,t)=>{const n=jt("Header",J_,e);return N.createElement(ny,X_(Y_({section:"header",__staticSelector:"Header"},n),{ref:t}))});ry.displayName="@mantine/core/Header";var Z_=Object.defineProperty,kd=Object.getOwnPropertySymbols,q_=Object.prototype.hasOwnProperty,ex=Object.prototype.propertyIsEnumerable,Pd=(e,t,n)=>t in e?Z_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tx=(e,t)=>{for(var n in t||(t={}))q_.call(t,n)&&Pd(e,n,t[n]);if(kd)for(var n of kd(t))ex.call(t,n)&&Pd(e,n,t[n]);return e};function nx(e,t){const n=t.fn.size({size:e.padding,sizes:t.spacing}),r=e.navbarOffsetBreakpoint?t.fn.size({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?t.fn.size({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;return e.fixed?{minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${n}px)`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${n}px)`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${n}px)`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${n}px)`,[`@media (max-width: ${r-1}px)`]:{paddingLeft:n},[`@media (max-width: ${o-1}px)`]:{paddingRight:n}}:{padding:n}}var rx=Vt((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:tx({flex:1,width:"100vw",boxSizing:"border-box"},nx(t,e))}));const ox=rx;var ix=Object.defineProperty,cl=Object.getOwnPropertySymbols,oy=Object.prototype.hasOwnProperty,iy=Object.prototype.propertyIsEnumerable,Cd=(e,t,n)=>t in e?ix(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lx=(e,t)=>{for(var n in t||(t={}))oy.call(t,n)&&Cd(e,n,t[n]);if(cl)for(var n of cl(t))iy.call(t,n)&&Cd(e,n,t[n]);return e},ax=(e,t)=>{var n={};for(var r in e)oy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cl)for(var r of cl(e))t.indexOf(r)<0&&iy.call(e,r)&&(n[r]=e[r]);return n};const sx={fixed:!0,padding:"md"},ly=C.forwardRef((e,t)=>{const n=jt("AppShell",sx,e),{children:r,navbar:o,header:i,footer:l,aside:a,fixed:s,zIndex:u,padding:d,navbarOffsetBreakpoint:m,asideOffsetBreakpoint:c,className:y,styles:v,classNames:g,unstyled:x,hidden:p,layout:f}=n,h=ax(n,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout"]),{classes:w,cx:E}=ox({padding:d,fixed:s,navbarOffsetBreakpoint:m,asideOffsetBreakpoint:c},{styles:v,classNames:g,unstyled:x,name:"AppShell"});return p?N.createElement(N.Fragment,null,r):N.createElement(T_,{value:{fixed:s,zIndex:u,layout:f}},N.createElement($t,lx({className:E(w.root,y),ref:t},h),i,N.createElement("div",{className:w.body},o,N.createElement("main",{className:w.main},r),a),l))});ly.displayName="@mantine/core/AppShell";const Vr={xs:30,sm:36,md:42,lg:50,xl:60};var ux=Vt((e,{orientation:t,buttonBorderWidth:n})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"&:last-of-type":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:n/2,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:n/2},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:-n,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const cx=ux;var fx=Object.defineProperty,fl=Object.getOwnPropertySymbols,ay=Object.prototype.hasOwnProperty,sy=Object.prototype.propertyIsEnumerable,Od=(e,t,n)=>t in e?fx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dx=(e,t)=>{for(var n in t||(t={}))ay.call(t,n)&&Od(e,n,t[n]);if(fl)for(var n of fl(t))sy.call(t,n)&&Od(e,n,t[n]);return e},px=(e,t)=>{var n={};for(var r in e)ay.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fl)for(var r of fl(e))t.indexOf(r)<0&&sy.call(e,r)&&(n[r]=e[r]);return n};const hx={orientation:"horizontal",buttonBorderWidth:1},uy=C.forwardRef((e,t)=>{const n=jt("ButtonGroup",hx,e),{className:r,orientation:o,buttonBorderWidth:i,unstyled:l}=n,a=px(n,["className","orientation","buttonBorderWidth","unstyled"]),{classes:s,cx:u}=cx({orientation:o,buttonBorderWidth:i},{name:"ButtonGroup",unstyled:l});return N.createElement($t,dx({className:u(s.root,r),ref:t},a))});uy.displayName="@mantine/core/ButtonGroup";var mx=Object.defineProperty,yx=Object.defineProperties,gx=Object.getOwnPropertyDescriptors,$d=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,wx=Object.prototype.propertyIsEnumerable,Rd=(e,t,n)=>t in e?mx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pn=(e,t)=>{for(var n in t||(t={}))vx.call(t,n)&&Rd(e,n,t[n]);if($d)for(var n of $d(t))wx.call(t,n)&&Rd(e,n,t[n]);return e},Ms=(e,t)=>yx(e,gx(t));const Ds={xs:{height:Vr.xs,paddingLeft:14,paddingRight:14},sm:{height:Vr.sm,paddingLeft:18,paddingRight:18},md:{height:Vr.md,paddingLeft:22,paddingRight:22},lg:{height:Vr.lg,paddingLeft:26,paddingRight:26},xl:{height:Vr.xl,paddingLeft:32,paddingRight:32},"compact-xs":{height:22,paddingLeft:7,paddingRight:7},"compact-sm":{height:26,paddingLeft:8,paddingRight:8},"compact-md":{height:30,paddingLeft:10,paddingRight:10},"compact-lg":{height:34,paddingLeft:12,paddingRight:12},"compact-xl":{height:40,paddingLeft:14,paddingRight:14}};function Sx({compact:e,size:t,withLeftIcon:n,withRightIcon:r}){if(e)return Ds[`compact-${t}`];const o=Ds[t];return Ms(Pn({},o),{paddingLeft:n?o.paddingLeft/1.5:o.paddingLeft,paddingRight:r?o.paddingRight/1.5:o.paddingRight})}const _x=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function xx({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:Pn({border:`1px solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var Ex=Vt((e,{color:t,size:n,radius:r,fullWidth:o,compact:i,gradient:l,variant:a,withLeftIcon:s,withRightIcon:u})=>({root:Ms(Pn(Ms(Pn(Pn(Pn(Pn({},Sx({compact:i,size:n,withLeftIcon:s,withRightIcon:u})),e.fn.fontStyles()),e.fn.focusStyles()),_x(o)),{borderRadius:e.fn.radius(r),fontWeight:600,position:"relative",lineHeight:1,fontSize:e.fn.size({size:n,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),xx({variant:a,theme:e,color:t,gradient:l})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":{content:'""',position:"absolute",top:-1,left:-1,right:-1,bottom:-1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(r),cursor:"not-allowed"}}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:10},rightIcon:{marginLeft:10},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const kx=Ex;var Px=Object.defineProperty,dl=Object.getOwnPropertySymbols,cy=Object.prototype.hasOwnProperty,fy=Object.prototype.propertyIsEnumerable,jd=(e,t,n)=>t in e?Px(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nd=(e,t)=>{for(var n in t||(t={}))cy.call(t,n)&&jd(e,n,t[n]);if(dl)for(var n of dl(t))fy.call(t,n)&&jd(e,n,t[n]);return e},Cx=(e,t)=>{var n={};for(var r in e)cy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dl)for(var r of dl(e))t.indexOf(r)<0&&fy.call(e,r)&&(n[r]=e[r]);return n};const Ox={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},Qu=C.forwardRef((e,t)=>{const n=jt("Button",Ox,e),{className:r,size:o,color:i,type:l,disabled:a,children:s,leftIcon:u,rightIcon:d,fullWidth:m,variant:c,radius:y,uppercase:v,compact:g,loading:x,loaderPosition:p,loaderProps:f,gradient:h,classNames:w,styles:E,unstyled:$}=n,k=Cx(n,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:j,cx:W,theme:I}=kx({radius:y,color:i,size:o,fullWidth:m,compact:g,gradient:h,variant:c,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:$,classNames:w,styles:E}),ee=I.fn.variant({color:i,variant:c}),xe=N.createElement(Jm,Nd({color:ee.color,size:I.fn.size({size:o,sizes:Ds}).height/2},f));return N.createElement(m_,Nd({className:W(j.root,r),type:l,disabled:a,"data-button":!0,"data-disabled":a||void 0,"data-loading":x||void 0,ref:t,unstyled:$},k),N.createElement("div",{className:j.inner},(u||x&&p==="left")&&N.createElement("span",{className:W(j.icon,j.leftIcon)},x&&p==="left"?xe:u),x&&p==="center"&&N.createElement("span",{className:j.centerLoader},xe),N.createElement("span",{className:j.label,style:{textTransform:v?"uppercase":void 0}},s),(d||x&&p==="right")&&N.createElement("span",{className:W(j.icon,j.rightIcon)},x&&p==="right"?xe:d)))});Qu.displayName="@mantine/core/Button";Qu.Group=uy;const Ku=Qu;function $x(e){return C.Children.toArray(e).filter(Boolean)}const Rx={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var jx=Vt((e,{spacing:t,position:n,noWrap:r,grow:o,align:i,count:l})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:i||"center",flexWrap:r?"nowrap":"wrap",justifyContent:Rx[n],gap:e.fn.size({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/l}% - ${e.fn.size({size:t,sizes:e.spacing})-e.fn.size({size:t,sizes:e.spacing})/l}px)`:void 0,flexGrow:o?1:0}}}));const Nx=jx;var zx=Object.defineProperty,pl=Object.getOwnPropertySymbols,dy=Object.prototype.hasOwnProperty,py=Object.prototype.propertyIsEnumerable,zd=(e,t,n)=>t in e?zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tx=(e,t)=>{for(var n in t||(t={}))dy.call(t,n)&&zd(e,n,t[n]);if(pl)for(var n of pl(t))py.call(t,n)&&zd(e,n,t[n]);return e},bx=(e,t)=>{var n={};for(var r in e)dy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pl)for(var r of pl(e))t.indexOf(r)<0&&py.call(e,r)&&(n[r]=e[r]);return n};const Lx={position:"left",spacing:"md"},hy=C.forwardRef((e,t)=>{const n=jt("Group",Lx,e),{className:r,position:o,align:i,children:l,noWrap:a,grow:s,spacing:u,unstyled:d}=n,m=bx(n,["className","position","align","children","noWrap","grow","spacing","unstyled"]),c=$x(l),{classes:y,cx:v}=Nx({align:i,grow:s,noWrap:a,spacing:u,position:o,count:c.length},{unstyled:d,name:"Group"});return N.createElement($t,Tx({className:v(y.root,r),ref:t},m),c)});hy.displayName="@mantine/core/Group";var Ix=Vt((e,{spacing:t,align:n,justify:r})=>({root:{display:"flex",flexDirection:"column",alignItems:n,justifyContent:r,gap:e.fn.size({size:t,sizes:e.spacing})}}));const Mx=Ix;var Dx=Object.defineProperty,hl=Object.getOwnPropertySymbols,my=Object.prototype.hasOwnProperty,yy=Object.prototype.propertyIsEnumerable,Td=(e,t,n)=>t in e?Dx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ax=(e,t)=>{for(var n in t||(t={}))my.call(t,n)&&Td(e,n,t[n]);if(hl)for(var n of hl(t))yy.call(t,n)&&Td(e,n,t[n]);return e},Fx=(e,t)=>{var n={};for(var r in e)my.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hl)for(var r of hl(e))t.indexOf(r)<0&&yy.call(e,r)&&(n[r]=e[r]);return n};const Ux={spacing:"md",align:"stretch",justify:"flex-start"},gy=C.forwardRef((e,t)=>{const n=jt("Stack",Ux,e),{spacing:r,className:o,align:i,justify:l,unstyled:a}=n,s=Fx(n,["spacing","className","align","justify","unstyled"]),{classes:u,cx:d}=Mx({spacing:r,align:i,justify:l},{name:"Stack",unstyled:a});return N.createElement($t,Ax({className:d(u.root,o),ref:t},s))});gy.displayName="@mantine/core/Stack";var Bx=Object.defineProperty,Vx=Object.defineProperties,Hx=Object.getOwnPropertyDescriptors,bd=Object.getOwnPropertySymbols,Wx=Object.prototype.hasOwnProperty,Gx=Object.prototype.propertyIsEnumerable,Ld=(e,t,n)=>t in e?Bx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qx=(e,t)=>{for(var n in t||(t={}))Wx.call(t,n)&&Ld(e,n,t[n]);if(bd)for(var n of bd(t))Gx.call(t,n)&&Ld(e,n,t[n]);return e},Kx=(e,t)=>Vx(e,Hx(t)),Yx=Vt((e,{color:t})=>{const n=t||(e.colorScheme==="dark"?"dark":"gray"),r=e.fn.variant({color:n,variant:"light"});return{root:Kx(Qx({},e.fn.fontStyles()),{lineHeight:e.lineHeight,padding:`2px calc(${e.spacing.xs}px / 2)`,borderRadius:e.radius.sm,color:e.colorScheme==="dark"?n==="dark"?e.colors.dark[0]:e.white:e.colors.dark[7],backgroundColor:e.colorScheme==="dark"&&n==="dark"?e.colors.dark[5]:r.background,fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.xs}),block:{padding:e.spacing.xs,margin:0,overflowX:"auto"}}});const Xx=Yx;var Jx=Object.defineProperty,ml=Object.getOwnPropertySymbols,vy=Object.prototype.hasOwnProperty,wy=Object.prototype.propertyIsEnumerable,Id=(e,t,n)=>t in e?Jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Md=(e,t)=>{for(var n in t||(t={}))vy.call(t,n)&&Id(e,n,t[n]);if(ml)for(var n of ml(t))wy.call(t,n)&&Id(e,n,t[n]);return e},Zx=(e,t)=>{var n={};for(var r in e)vy.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ml)for(var r of ml(e))t.indexOf(r)<0&&wy.call(e,r)&&(n[r]=e[r]);return n};const Sy=C.forwardRef((e,t)=>{const n=jt("Code",{},e),{className:r,children:o,block:i,color:l,unstyled:a}=n,s=Zx(n,["className","children","block","color","unstyled"]),{classes:u,cx:d}=Xx({color:l},{name:"Code",unstyled:a});return i?N.createElement($t,Md({component:"pre",dir:"ltr",className:d(u.root,u.block,r),ref:t},s),o):N.createElement($t,Md({component:"code",className:d(u.root,r),ref:t,dir:"ltr"},s),o)});Sy.displayName="@mantine/core/Code";var qx=Vt((e,{fluid:t,size:n,sizes:r})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":e.fn.size({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const eE=qx;var tE=Object.defineProperty,yl=Object.getOwnPropertySymbols,_y=Object.prototype.hasOwnProperty,xy=Object.prototype.propertyIsEnumerable,Dd=(e,t,n)=>t in e?tE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nE=(e,t)=>{for(var n in t||(t={}))_y.call(t,n)&&Dd(e,n,t[n]);if(yl)for(var n of yl(t))xy.call(t,n)&&Dd(e,n,t[n]);return e},rE=(e,t)=>{var n={};for(var r in e)_y.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yl)for(var r of yl(e))t.indexOf(r)<0&&xy.call(e,r)&&(n[r]=e[r]);return n};const oE={sizes:{xs:540,sm:720,md:960,lg:1140,xl:1320}},Ey=C.forwardRef((e,t)=>{const n=jt("Container",oE,e),{className:r,fluid:o,size:i,unstyled:l,sizes:a}=n,s=rE(n,["className","fluid","size","unstyled","sizes"]),{classes:u,cx:d}=eE({fluid:o,size:i,sizes:a},{unstyled:l,name:"Container"});return N.createElement($t,nE({className:d(u.root,r),ref:t},s))});Ey.displayName="@mantine/core/Container";class Ad extends Error{constructor(n,r,o){super(o);Ae(this,"url");Ae(this,"status");Ae(this,"statusText");Ae(this,"body");Ae(this,"request");this.name="ApiError",this.url=r.url,this.status=r.status,this.statusText=r.statusText,this.body=r.body,this.request=n}}class iE extends Error{constructor(t){super(t),this.name="CancelError"}get isCancelled(){return!0}}var jE;class lE{constructor(t){Ae(this,jE);Ae(this,"_isResolved");Ae(this,"_isRejected");Ae(this,"_isCancelled");Ae(this,"_cancelHandlers");Ae(this,"_promise");Ae(this,"_resolve");Ae(this,"_reject");this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise((n,r)=>{this._resolve=n,this._reject=r;const o=a=>{var s;this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,(s=this._resolve)==null||s.call(this,a))},i=a=>{var s;this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,(s=this._reject)==null||s.call(this,a))},l=a=>{this._isResolved||this._isRejected||this._isCancelled||this._cancelHandlers.push(a)};return Object.defineProperty(l,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(l,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(l,"isCancelled",{get:()=>this._isCancelled}),t(o,i,l)})}then(t,n){return this._promise.then(t,n)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(){var t;if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(const n of this._cancelHandlers)n()}catch(n){console.warn("Cancellation threw an error",n);return}this._cancelHandlers.length=0,(t=this._reject)==null||t.call(this,new iE("Request aborted"))}}get isCancelled(){return this._isCancelled}}jE=Symbol.toStringTag;const _n={BASE:"",VERSION:"0.1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var Kt=(e=>(e.THROUGH="through",e.DIVERGING="diverging",e.CONVERGING="converging",e))(Kt||{}),yr=(e=>(e.STRAIGHT="straight",e.CURVE="curve",e))(yr||{}),tn=(e=>(e.A="A",e.B="B",e))(tn||{});const Yu=e=>e!=null,Do=e=>typeof e=="string",ba=e=>Do(e)&&e!=="",Xu=e=>typeof e=="object"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.arrayBuffer=="function"&&typeof e.constructor=="function"&&typeof e.constructor.name=="string"&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),ky=e=>e instanceof FormData,aE=e=>{try{return btoa(e)}catch{return Buffer.from(e).toString("base64")}},sE=e=>{const t=[],n=(o,i)=>{t.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(i))}`)},r=(o,i)=>{Yu(i)&&(Array.isArray(i)?i.forEach(l=>{r(o,l)}):typeof i=="object"?Object.entries(i).forEach(([l,a])=>{r(`${o}[${l}]`,a)}):n(o,i))};return Object.entries(e).forEach(([o,i])=>{r(o,i)}),t.length>0?`?${t.join("&")}`:""},uE=(e,t)=>{const n=e.ENCODE_PATH||encodeURI,r=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,(i,l)=>{var a;return(a=t.path)!=null&&a.hasOwnProperty(l)?n(String(t.path[l])):i}),o=`${e.BASE}${r}`;return t.query?`${o}${sE(t.query)}`:o},cE=e=>{if(e.formData){const t=new FormData,n=(r,o)=>{Do(o)||Xu(o)?t.append(r,o):t.append(r,JSON.stringify(o))};return Object.entries(e.formData).filter(([r,o])=>Yu(o)).forEach(([r,o])=>{Array.isArray(o)?o.forEach(i=>n(r,i)):n(r,o)}),t}},di=async(e,t)=>typeof t=="function"?t(e):t,fE=async(e,t)=>{const n=await di(t,e.TOKEN),r=await di(t,e.USERNAME),o=await di(t,e.PASSWORD),i=await di(t,e.HEADERS),l=Object.entries({Accept:"application/json",...i,...t.headers}).filter(([a,s])=>Yu(s)).reduce((a,[s,u])=>({...a,[s]:String(u)}),{});if(ba(n)&&(l.Authorization=`Bearer ${n}`),ba(r)&&ba(o)){const a=aE(`${r}:${o}`);l.Authorization=`Basic ${a}`}return t.body&&(t.mediaType?l["Content-Type"]=t.mediaType:Xu(t.body)?l["Content-Type"]=t.body.type||"application/octet-stream":Do(t.body)?l["Content-Type"]="text/plain":ky(t.body)||(l["Content-Type"]="application/json")),new Headers(l)},dE=e=>{var t;if(e.body)return(t=e.mediaType)!=null&&t.includes("/json")?JSON.stringify(e.body):Do(e.body)||Xu(e.body)||ky(e.body)?e.body:JSON.stringify(e.body)},pE=async(e,t,n,r,o,i,l)=>{const a=new AbortController,s={headers:i,body:r??o,method:t.method,signal:a.signal};return e.WITH_CREDENTIALS&&(s.credentials=e.CREDENTIALS),l(()=>a.abort()),await fetch(n,s)},hE=(e,t)=>{if(t){const n=e.headers.get(t);if(Do(n))return n}},mE=async e=>{if(e.status!==204)try{const t=e.headers.get("Content-Type");if(t)return t.toLowerCase().startsWith("application/json")?await e.json():await e.text()}catch(t){console.error(t)}},yE=(e,t)=>{const r={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors}[t.status];if(r)throw new Ad(e,t,r);if(!t.ok)throw new Ad(e,t,"Generic Error")},xn=(e,t)=>new lE(async(n,r,o)=>{try{const i=uE(e,t),l=cE(t),a=dE(t),s=await fE(e,t);if(!o.isCancelled){const u=await pE(e,t,i,a,l,s,o),d=await mE(u),m=hE(u,t.responseHeader),c={url:i,ok:u.ok,status:u.status,statusText:u.statusText,body:m??d};yE(t,c),n(c.body)}}catch(i){r(i)}});class Fn{static hello(){return xn(_n,{method:"GET",url:"/api/hello"})}static getState(){return xn(_n,{method:"GET",url:"/api/state"})}static moveTrain(t,n){return xn(_n,{method:"POST",url:"/api/state/trains/{train_id}/move",path:{train_id:t},body:n,mediaType:"application/json",errors:{422:"Validation Error"}})}static putTrain(t,n){return xn(_n,{method:"POST",url:"/api/state/trains/{train_id}/put",path:{train_id:t},body:n,mediaType:"application/json",errors:{422:"Validation Error"}})}static updateJunction(t,n){return xn(_n,{method:"POST",url:"/api/state/junctions/{junction_id}/update",path:{junction_id:t},body:n,mediaType:"application/json",errors:{422:"Validation Error"}})}static blockSection(t){return xn(_n,{method:"POST",url:"/api/state/sections/{section_id}/block",path:{section_id:t},errors:{422:"Validation Error"}})}static unblockSection(t){return xn(_n,{method:"POST",url:"/api/state/sections/{section_id}/unblock",path:{section_id:t},errors:{422:"Validation Error"}})}}const gE=({children:e})=>L.jsx(ly,{padding:"md",header:L.jsx(ry,{height:60,p:"md",sx:t=>({display:"flex",alignItems:"center",backgroundColor:t.colors.blue[5],fontSize:18,color:t.white,fontWeight:700}),children:"Plarailers Train Control System"}),children:e}),Vn=C.createContext(null),Ao=C.createContext(null),vE=({position:e})=>L.jsx("rect",{x:e.x-60/2,y:e.y-20/2,width:60,height:20,fill:"white"}),wE=({id:e,points:t})=>{const n=C.useContext(Vn);if(!n)return null;const r=n.sections[e],o=Fd(t[0],t[1],4),i=t.length,l=Fd(t[i-1],t[i-2],4),a=[o,...t.slice(1,-1),l];return L.jsx("polyline",{points:a.map(s=>`${s.x},${s.y}`).join(" "),fill:"none",stroke:r.is_blocked?"red":"white",strokeWidth:r.is_blocked?4:2,strokeLinecap:"square"})},Fd=(e,t,n)=>({x:e.x+(t.x-e.x)/Math.hypot(t.x-e.x,t.y-e.y)*n,y:e.y+(t.y-e.y)/Math.hypot(t.x-e.x,t.y-e.y)*n}),Ud=e=>{const t=Math.hypot(e.x,e.y);return{x:e.x/t,y:e.y/t}},ar=(e,t)=>{let n=0;for(let o=0;o=a)r-=a;else return{position:{x:i.x+(l.x-i.x)*(r/a),y:i.y+(l.y-i.y)*(r/a)},direction:{x:l.x-i.x,y:l.y-i.y},partitionIndex:o+1}}{const o=t[t.length-2],i=t[t.length-1];return{position:i,direction:{x:i.x-o.x,y:i.y-o.y},partitionIndex:t.length}}},SE=({id:e})=>{const t=vt(),n=C.useContext(Vn),r=C.useContext(Ao);if(!(n&&r))return null;const o=n.trains[e],{position:i,angle:l}=Bd(o.head_position,n,r),{position:a,angle:s}=Bd(o.tail_position,n,r),u=_E(o,n,r),d=r.trains[e];return L.jsxs(L.Fragment,{children:[L.jsx("polyline",{points:u.map(m=>`${m.x},${m.y}`).join(" "),fill:"none",stroke:d.fill,strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"miter"}),L.jsxs("g",{transform:`translate(${i.x}, ${i.y})`,children:[L.jsx("g",{transform:`rotate(${l})`,children:L.jsx("polyline",{points:"-5,5 0,5 5,0 0,-5 -5,-5",fill:d.fill,stroke:d.stroke})}),o.departure_time!=null&&L.jsx("g",{transform:`translate(${0}, ${-10})`,children:L.jsx("text",{textAnchor:"middle",fill:t.colors.gray[5],children:o.departure_time-n.current_time})})]}),L.jsx("g",{transform:`translate(${a.x}, ${a.y})`,children:L.jsx("g",{transform:`rotate(${s})`,children:L.jsx("polyline",{points:"0,-5 -5,-5 -5,5 0,5",fill:d.fill,stroke:d.stroke})})})]})},Bd=(e,t,n)=>{const r=t.sections[e.section_id],o=n.sections[e.section_id],{position:i,direction:l}=ar(e.mileage/r.length,o.points);e.target_junction_id===r.connected_junction_ids[tn.A]&&(l.x*=-1,l.y*=-1);const a=Math.atan2(l.y,l.x)/Math.PI*180;return{position:i,angle:a}},_E=(e,t,n)=>{const r=[];if(e.head_position.section_id===e.tail_position.section_id){const o=t.sections[e.tail_position.section_id],i=n.sections[e.tail_position.section_id],{position:l,direction:a,partitionIndex:s}=ar(e.tail_position.mileage/o.length,i.points);e.tail_position.target_junction_id===o.connected_junction_ids[tn.A]&&(a.x*=-1,a.y*=-1);const u=t.sections[e.head_position.section_id],d=n.sections[e.head_position.section_id],{position:m,direction:c,partitionIndex:y}=ar(e.head_position.mileage/u.length,d.points);e.head_position.target_junction_id===u.connected_junction_ids[tn.A]&&(c.x*=-1,c.y*=-1),y<=s?r.push(m,...d.points.slice(y,s),l):r.push(l,...d.points.slice(s,y),m)}else{const o=t.sections[e.tail_position.section_id],i=n.sections[e.tail_position.section_id],{position:l,direction:a,partitionIndex:s}=ar(e.tail_position.mileage/o.length,i.points);e.tail_position.target_junction_id===o.connected_junction_ids[tn.B]?r.push(l,...i.points.slice(s)):(a.x*=-1,a.y*=-1,r.push(l,...i.points.slice(0,s).reverse()));for(const v of e.covered_section_ids){const g=n.sections[v];g.points[0].x===r[r.length-1].x&&g.points[0].y===r[r.length-1].y?r.push(...g.points):r.push(...g.points.slice().reverse())}const u=t.sections[e.head_position.section_id],d=n.sections[e.head_position.section_id],{position:m,direction:c,partitionIndex:y}=ar(e.head_position.mileage/u.length,d.points);e.head_position.target_junction_id===u.connected_junction_ids[tn.B]?r.push(...d.points.slice(0,y),m):(c.x*=-1,c.y*=-1,r.push(...d.points.slice(y).reverse(),m))}return r},xE=({id:e,position:t})=>{const n=vt(),r=C.useContext(Vn),o=C.useContext(Ao);if(!(r&&o))return null;const i=r.junctions[e],l={};for(const u of[Kt.CONVERGING,Kt.THROUGH,Kt.DIVERGING]){const d=i.connected_section_ids[u],m=r.sections[d];if(e===m.connected_junction_ids[tn.A]){const c=o.sections[d].points,y=c[0],v=c[1];l[u]=Ud({x:v.x-y.x,y:v.y-y.y})}else if(e===m.connected_junction_ids[tn.B]){const c=o.sections[d].points,y=c[c.length-1],v=c[c.length-2];l[u]=Ud({x:v.x-y.x,y:v.y-y.y})}}let a;switch(i.current_direction){case yr.STRAIGHT:{a=Kt.THROUGH;break}case yr.CURVE:{a=Kt.DIVERGING;break}}const s=6;return L.jsxs("g",{transform:`translate(${t.x}, ${t.y})`,children:[L.jsx("circle",{cx:0,cy:0,r:s,fill:n.white,stroke:n.colors.gray[6]}),L.jsx("polyline",{points:[{x:l[Kt.CONVERGING].x*s,y:l[Kt.CONVERGING].y*s},{x:0,y:0},{x:l[a].x*s,y:l[a].y*s}].map(u=>`${u.x},${u.y}`).join(" "),fill:"none",stroke:n.colors.blue[7],strokeWidth:4})]})},EE=({id:e})=>{const t=vt(),n=C.useContext(Vn),r=C.useContext(Ao);if(!(n&&r))return null;const o=n.stops[e],i=n.sections[o.position.section_id],l=r.sections[o.position.section_id],{position:a,direction:s}=ar(o.position.mileage/i.length,l.points),u=Math.atan2(s.y,s.x)/Math.PI*180;return L.jsx("g",{transform:`translate(${a.x}, ${a.y})`,children:L.jsx("g",{transform:`rotate(${u+180})`,children:L.jsxs("g",{transform:"translate(0, -10)",children:[L.jsx("polyline",{points:"0,0 0,10",stroke:t.colors.dark[2],strokeWidth:2}),L.jsx("polygon",{points:"-5,0 0,5 5,0 0,-5",fill:t.white,stroke:t.colors.red[7],strokeWidth:2})]})})})},kE=({children:e})=>{const t=vt(),n=C.useContext(Ao);return n?L.jsxs("svg",{width:"100%",viewBox:`0 0 ${n.width} ${n.height}`,children:[L.jsx("rect",{width:n.width,height:n.height,fill:t.colors.dark[7]}),Object.entries(n.platforms).map(([r,o])=>L.jsx(vE,{position:o.position},r)),Object.entries(n.stops).map(([r,o])=>L.jsx(EE,{id:r},r)),Object.entries(n.sections).map(([r,o])=>L.jsx(wE,{id:r,points:o.points},r)),Object.entries(n.junctions).map(([r,o])=>L.jsx(xE,{id:r,position:o.position},r)),Object.entries(n.trains).map(([r,o])=>L.jsx(SE,{id:r},r)),e]}):null},PE=()=>L.jsx("div",{children:L.jsxs(hy,{children:[L.jsx(Vd,{id:"t0",delta:10}),L.jsx(Vd,{id:"t1",delta:10}),L.jsx(pi,{id:"j0"}),L.jsx(pi,{id:"j1"}),L.jsx(pi,{id:"j2"}),L.jsx(pi,{id:"j3"}),L.jsx(CE,{id:"s3"})]})}),Vd=({id:e,delta:t})=>L.jsxs(Ku,{styles:n=>({label:{fontFamily:n.fontFamilyMonospace}}),onClick:()=>{Fn.moveTrain(e,{delta:t})},children:["MoveTrain(",e,", ",t,")"]},e),pi=({id:e})=>{const t=C.useContext(Vn);if(!t)return null;const n=t.junctions[e];return L.jsxs(Ku,{styles:r=>({label:{fontFamily:r.fontFamilyMonospace}}),onClick:()=>{n.current_direction==yr.STRAIGHT?Fn.updateJunction(e,{direction:yr.CURVE}):Fn.updateJunction(e,{direction:yr.STRAIGHT})},children:["ToggleJunction(",e,")"]},e)},CE=({id:e})=>{const t=C.useContext(Vn);if(!t)return null;const n=t.sections[e];return L.jsx(Ku,{variant:n.is_blocked?"filled":"light",color:"red",styles:r=>({label:{fontFamily:r.fontFamilyMonospace}}),onClick:()=>{n.is_blocked?Fn.unblockSection(e):Fn.blockSection(e)},children:n.is_blocked?`UnblockSection(${e})`:`BlockSection(${e})`})},OE={width:440,height:340,platforms:{},junctions:{j0:{position:{x:400,y:160}},j1:{position:{x:360,y:200}},j2:{position:{x:280,y:280}},j3:{position:{x:260,y:300}}},sections:{s0:{from:"j0",to:"j3",points:[{x:400,y:160},{x:400,y:280},{x:380,y:300},{x:260,y:300}]},s1:{from:"j3",to:"j0",points:[{x:260,y:300},{x:60,y:300},{x:40,y:280},{x:40,y:220},{x:220,y:40},{x:380,y:40},{x:400,y:60},{x:400,y:160}]},s2:{from:"j1",to:"j2",points:[{x:360,y:200},{x:360,y:250},{x:330,y:280},{x:280,y:280}]},s3:{from:"j2",to:"j1",points:[{x:280,y:280},{x:110,y:280},{x:80,y:250},{x:80,y:110},{x:110,y:80},{x:330,y:80},{x:360,y:110},{x:360,y:200}]},s4:{from:"j0",to:"j1",points:[{x:400,y:160},{x:360,y:200}]},s5:{from:"j2",to:"j3",points:[{x:280,y:280},{x:260,y:300}]}},trains:{t0:{fill:jn.colors.yellow[4],stroke:jn.colors.yellow[9]},t1:{fill:jn.colors.red[5],stroke:jn.colors.red[9]}},stops:{}},$E=()=>{const e=vt(),[t,n]=C.useState(null),[r,o]=C.useState(()=>new Date);return C.useEffect(()=>{Fn.getState().then(i=>{o(new Date),n(i)})},[]),C.useEffect(()=>{const i=setInterval(()=>{Fn.getState().then(l=>{o(new Date),n(l)})},500);return()=>{clearInterval(i)}},[]),L.jsx(Vn.Provider,{value:t,children:L.jsx(Ao.Provider,{value:OE,children:L.jsx(gE,{children:L.jsx(Ey,{children:L.jsxs(gy,{px:60,children:[L.jsx(kE,{children:L.jsx("text",{x:10,y:20,fontSize:12,fontFamily:e.fontFamilyMonospace,fill:e.white,children:r.toLocaleString()})}),L.jsx(PE,{}),L.jsx(Sy,{block:!0,children:JSON.stringify(t,null,4)})]})})})})})},RE=k1([{path:"/",element:L.jsx($E,{})}]);La.createRoot(document.getElementById("root")).render(L.jsx(N.StrictMode,{children:L.jsx(Lm,{withGlobalStyles:!0,withNormalizeCSS:!0,theme:{colorScheme:"dark"},children:L.jsx(S1,{router:RE})})})); diff --git a/ptcs/ptcs_ui/dist/index.html b/ptcs/ptcs_ui/dist/index.html index 9c7a340..cc9f362 100644 --- a/ptcs/ptcs_ui/dist/index.html +++ b/ptcs/ptcs_ui/dist/index.html @@ -5,7 +5,7 @@ Plarailers Train Control System - +
diff --git a/ptcs/ptcs_ui/src/components/Debugger.tsx b/ptcs/ptcs_ui/src/components/Debugger.tsx index b0c333a..59810f2 100644 --- a/ptcs/ptcs_ui/src/components/Debugger.tsx +++ b/ptcs/ptcs_ui/src/components/Debugger.tsx @@ -1,5 +1,5 @@ import { Button, Group } from "@mantine/core"; -import { DefaultService } from "ptcs_client"; +import { DefaultService, PointDirection } from "ptcs_client"; import React, { useContext } from "react"; import { RailwayStateContext } from "../contexts"; @@ -9,6 +9,10 @@ export const Debugger: React.FC = () => { + + + + @@ -68,6 +72,42 @@ const PutTrainButton: React.FC = ({ id, positionId }) => { ); }; +interface ToggleJunctionButtonProps { + id: string; +} + +const ToggleJunctionButton: React.FC = ({ id }) => { + const railwayState = useContext(RailwayStateContext); + + if (!railwayState) return null; + + const junctionState = railwayState.junctions[id]; + + return ( + + ); +}; + interface BlockSectionButtonProps { id: string; } diff --git a/ptcs/ptcs_ui/src/components/Railway.tsx b/ptcs/ptcs_ui/src/components/Railway.tsx index df4b325..ee3834f 100644 --- a/ptcs/ptcs_ui/src/components/Railway.tsx +++ b/ptcs/ptcs_ui/src/components/Railway.tsx @@ -5,15 +5,21 @@ import { Train } from "./Train"; import { Junction } from "./Junction"; import { useContext } from "react"; import { Stop } from "./Stop"; +import { useMantineTheme } from "@mantine/core"; export const Railway: React.FC = ({ children }) => { + const theme = useMantineTheme(); const railwayUI = useContext(RailwayUIContext); if (!railwayUI) return null; return ( - + {Object.entries(railwayUI.platforms).map(([id, platform]) => ( ))} diff --git a/ptcs/ptcs_ui/src/components/Train.tsx b/ptcs/ptcs_ui/src/components/Train.tsx index 0a33082..3ca17c5 100644 --- a/ptcs/ptcs_ui/src/components/Train.tsx +++ b/ptcs/ptcs_ui/src/components/Train.tsx @@ -2,7 +2,13 @@ import { useContext } from "react"; import { useMantineTheme } from "@mantine/core"; import { RailwayStateContext, RailwayUIContext } from "../contexts"; import { calculatePositionAndDirection } from "../lib/point"; -import { SectionConnection } from "ptcs_client"; +import { + DirectedPosition, + RailwayState, + SectionConnection, + TrainState, +} from "ptcs_client"; +import { RailwayUI } from "../types"; interface TrainProps { id: string; @@ -19,40 +25,219 @@ export const Train: React.FC = ({ id }) => { } const trainState = railwayState.trains[id]; - const currentSectionState = - railwayState.sections[trainState.position.section_id]; - const currentSectionUI = railwayUI.sections[trainState.position.section_id]; + + const { position: headPosition, angle: headAngle } = + calculatePositionAndAngle( + trainState.head_position, + railwayState, + railwayUI + ); + const { position: tailPosition, angle: tailAngle } = + calculatePositionAndAngle( + trainState.tail_position, + railwayState, + railwayUI + ); + + const path = calculatePath(trainState, railwayState, railwayUI); + + const trainUI = railwayUI.trains[id]; + + return ( + <> + `${p.x},${p.y}`).join(" ")} + fill="none" + stroke={trainUI.fill} + strokeWidth={4} + strokeLinecap="round" + strokeLinejoin="miter" + /> + + + + + {trainState.departure_time != null && ( + + + {trainState.departure_time - railwayState.current_time} + + + )} + + + + + + + + ); +}; + +const calculatePositionAndAngle = ( + trainPosition: DirectedPosition, + railwayState: RailwayState, + railwayUI: RailwayUI +): { position: { x: number; y: number }; angle: number } => { + const currentSectionState = railwayState.sections[trainPosition.section_id]; + const currentSectionUI = railwayUI.sections[trainPosition.section_id]; const { position, direction } = calculatePositionAndDirection( - trainState.position.mileage / currentSectionState.length, + trainPosition.mileage / currentSectionState.length, currentSectionUI.points ); if ( - trainState.position.target_junction_id === + trainPosition.target_junction_id === currentSectionState.connected_junction_ids[SectionConnection.A] ) { direction.x *= -1; direction.y *= -1; } const angle = (Math.atan2(direction.y, direction.x) / Math.PI) * 180; + return { position, angle }; +}; - const trainUI = railwayUI.trains[id]; +const calculatePath = ( + trainState: TrainState, + railwayState: RailwayState, + railwayUI: RailwayUI +): { x: number; y: number }[] => { + const path: { x: number; y: number }[] = []; - return ( - - - - - {trainState.departure_time != null && ( - - - {trainState.departure_time - railwayState.current_time} - - - )} - - ); + if ( + trainState.head_position.section_id === trainState.tail_position.section_id + ) { + const tailSectionState = + railwayState.sections[trainState.tail_position.section_id]; + const tailSectionUI = + railwayUI.sections[trainState.tail_position.section_id]; + const { + position: tailPosition, + direction: tailDirection, + partitionIndex: tailPartitionIndex, + } = calculatePositionAndDirection( + trainState.tail_position.mileage / tailSectionState.length, + tailSectionUI.points + ); + if ( + trainState.tail_position.target_junction_id === + tailSectionState.connected_junction_ids[SectionConnection.A] + ) { + tailDirection.x *= -1; + tailDirection.y *= -1; + } + + const headSectionState = + railwayState.sections[trainState.head_position.section_id]; + const headSectionUI = + railwayUI.sections[trainState.head_position.section_id]; + const { + position: headPosition, + direction: headDirection, + partitionIndex: headPartitionIndex, + } = calculatePositionAndDirection( + trainState.head_position.mileage / headSectionState.length, + headSectionUI.points + ); + if ( + trainState.head_position.target_junction_id === + headSectionState.connected_junction_ids[SectionConnection.A] + ) { + headDirection.x *= -1; + headDirection.y *= -1; + } + + if (headPartitionIndex <= tailPartitionIndex) { + path.push( + headPosition, + ...headSectionUI.points.slice(headPartitionIndex, tailPartitionIndex), + tailPosition + ); + } else { + path.push( + tailPosition, + ...headSectionUI.points.slice(tailPartitionIndex, headPartitionIndex), + headPosition + ); + } + } else { + const tailSectionState = + railwayState.sections[trainState.tail_position.section_id]; + const tailSectionUI = + railwayUI.sections[trainState.tail_position.section_id]; + const { + position: tailPosition, + direction: tailDirection, + partitionIndex: tailPartitionIndex, + } = calculatePositionAndDirection( + trainState.tail_position.mileage / tailSectionState.length, + tailSectionUI.points + ); + if ( + trainState.tail_position.target_junction_id === + tailSectionState.connected_junction_ids[SectionConnection.B] + ) { + path.push( + tailPosition, + ...tailSectionUI.points.slice(tailPartitionIndex) + ); + } else { + tailDirection.x *= -1; + tailDirection.y *= -1; + path.push( + tailPosition, + ...tailSectionUI.points.slice(0, tailPartitionIndex).reverse() + ); + } + + for (const coveredSectionId of trainState.covered_section_ids) { + const coveredSectionUI = railwayUI.sections[coveredSectionId]; + if ( + coveredSectionUI.points[0].x === path[path.length - 1].x && + coveredSectionUI.points[0].y === path[path.length - 1].y + ) { + path.push(...coveredSectionUI.points); + } else { + path.push(...coveredSectionUI.points.slice().reverse()); + } + } + + const headSectionState = + railwayState.sections[trainState.head_position.section_id]; + const headSectionUI = + railwayUI.sections[trainState.head_position.section_id]; + const { + position: headPosition, + direction: headDirection, + partitionIndex: headPartitionIndex, + } = calculatePositionAndDirection( + trainState.head_position.mileage / headSectionState.length, + headSectionUI.points + ); + if ( + trainState.head_position.target_junction_id === + headSectionState.connected_junction_ids[SectionConnection.B] + ) { + path.push( + ...headSectionUI.points.slice(0, headPartitionIndex), + headPosition + ); + } else { + headDirection.x *= -1; + headDirection.y *= -1; + path.push( + ...headSectionUI.points.slice(headPartitionIndex).reverse(), + headPosition + ); + } + } + + return path; }; diff --git a/ptcs/ptcs_ui/src/lib/point.ts b/ptcs/ptcs_ui/src/lib/point.ts index 6040b38..4d3dac4 100644 --- a/ptcs/ptcs_ui/src/lib/point.ts +++ b/ptcs/ptcs_ui/src/lib/point.ts @@ -15,6 +15,11 @@ export const calculatePositionAndDirection = ( ): { position: { x: number; y: number }; direction: { x: number; y: number }; + /** + * UI 上のパスを `[...points.slice(0, partitionIndex), position]` と + * `[...position, points.slice(partitionIndex)]` とに分割するのに使えるインデックス。 + */ + partitionIndex: number; } => { let totalLength = 0; for (let i = 0; i < points.length - 1; i++) { @@ -27,7 +32,11 @@ export const calculatePositionAndDirection = ( if (targetLength < 0) { const p = points[0]; const q = points[1]; - return { position: p, direction: { x: q.x - p.x, y: q.y - p.y } }; + return { + position: p, + direction: { x: q.x - p.x, y: q.y - p.y }, + partitionIndex: 0, + }; } for (let i = 0; i < points.length - 1; i++) { const p = points[i]; @@ -45,12 +54,17 @@ export const calculatePositionAndDirection = ( x: q.x - p.x, y: q.y - p.y, }, + partitionIndex: i + 1, }; } } { const p = points[points.length - 2]; const q = points[points.length - 1]; - return { position: q, direction: { x: q.x - p.x, y: q.y - p.y } }; + return { + position: q, + direction: { x: q.x - p.x, y: q.y - p.y }, + partitionIndex: points.length, + }; } }; diff --git a/ptcs/ptcs_ui/src/main.tsx b/ptcs/ptcs_ui/src/main.tsx index b5d8946..df04cd3 100644 --- a/ptcs/ptcs_ui/src/main.tsx +++ b/ptcs/ptcs_ui/src/main.tsx @@ -13,7 +13,11 @@ const router = createHashRouter([ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + diff --git a/ptcs/ptcs_ui/src/pages/Home.tsx b/ptcs/ptcs_ui/src/pages/Home.tsx index fa3d3a9..cc5a07c 100644 --- a/ptcs/ptcs_ui/src/pages/Home.tsx +++ b/ptcs/ptcs_ui/src/pages/Home.tsx @@ -1,4 +1,10 @@ -import { Code, Container, DEFAULT_THEME, Grid, Stack } from "@mantine/core"; +import { + Code, + Container, + DEFAULT_THEME, + Stack, + useMantineTheme, +} from "@mantine/core"; import { DefaultService, RailwayState } from "ptcs_client"; import { Layout } from "../components/Layout"; import { useEffect, useState } from "react"; @@ -94,28 +100,30 @@ const ui: RailwayUI = { }, }, stops: { - stop_0: {}, - stop_1: {}, - stop_2: {}, - stop_3: {}, - stop_4: {}, + // stop_0: {}, + // stop_1: {}, + // stop_2: {}, + // stop_3: {}, + // stop_4: {}, }, }; export const Home: React.FC = () => { + const theme = useMantineTheme(); const [railwayState, setRailwayState] = useState(null); - const [time, setTime] = useState(); + const [time, setTime] = useState(() => new Date()); useEffect(() => { DefaultService.getState().then((state) => { + setTime(new Date()); setRailwayState(state); }); }, []); useEffect(() => { const interval = setInterval(() => { - setTime(new Date()); DefaultService.getState().then((state) => { + setTime(new Date()); setRailwayState(state); }); }, 500); @@ -129,16 +137,20 @@ export const Home: React.FC = () => { - - {time?.toLocaleString()} - + + + + {time.toLocaleString()} + + - - - {JSON.stringify(railwayState, null, 4)} - - - + {JSON.stringify(railwayState, null, 4)} diff --git a/ptcs/pyproject.toml b/ptcs/pyproject.toml index 4e531eb..3d3599c 100644 --- a/ptcs/pyproject.toml +++ b/ptcs/pyproject.toml @@ -5,9 +5,9 @@ description = "" authors = ["UTokyo Plarailers "] readme = "README.md" packages = [ + { include = "ptcs_bridge" }, { include = "ptcs_control" }, { include = "ptcs_server" }, - { include = "usb_bt_bridge" }, ] [tool.poetry.scripts] @@ -17,6 +17,7 @@ scan = "serial.tools.list_ports:main" [tool.poetry.dependencies] python = ">=3.11,<3.12" +bleak = "^0.21.1" click = "^8.1.3" fastapi = "^0.103.1" uvicorn = "^0.23.2" diff --git a/ptcs/usb_bt_bridge/__init__.py b/ptcs/usb_bt_bridge/__init__.py deleted file mode 100644 index 554f954..0000000 --- a/ptcs/usb_bt_bridge/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -__all__ = ["Bridge"] - -from .bridge import Bridge