From 33dc88a0ec9c94182ca179e7910c09901891f783 Mon Sep 17 00:00:00 2001 From: Simone Orru Date: Tue, 28 Oct 2025 16:21:32 +0100 Subject: [PATCH 1/2] Support for frdm rw612 Signed-off-by: Simone Orru --- .gitignore | 3 + README.md | 61 + README_NXP.md | 6 +- app/CMakeLists.txt | 3 + app/Kconfig | 41 + app/boards/frdm_rw612.conf | 15 + app/boards/frdm_rw612.overlay | 39 + app/boards/mimxrt1064_evk.conf | 2 + app/config_lfs/configuration.json | 6 + app/include/sample_config.h | 38 + app/include/wifi.h | 22 + .../com.example.poc.AmbientTemp.json | 18 + app/interfaces/generated_interfaces.c | 22 + app/interfaces/generated_interfaces.h | 1 + app/prj-wifi.conf | 20 + app/prj.conf | 14 +- app/src/main.c | 228 +- app/src/sample_config.c | 369 + app/src/wifi.c | 209 + app/sysbuild/boards/frdm_rw612.conf | 9 + app/sysbuild/boards/frdm_rw612.overlay | 13 + portal/ambient_temp/CORS | 1 + portal/ambient_temp/app.js | 20966 ++++++++++++++++ portal/cpu_temp/CORS | 1 + portal/cpu_temp/app.js | 20966 ++++++++++++++++ portal/main.mjs | 111 - scripts/.pylintrc | 568 + scripts/clean.py | 81 + scripts/format.py | 89 + scripts/requirements.txt | 5 + scripts/west-commands.yml | 18 + west.yml | 19 +- 32 files changed, 43780 insertions(+), 184 deletions(-) create mode 100644 app/boards/frdm_rw612.conf create mode 100644 app/boards/frdm_rw612.overlay create mode 100644 app/config_lfs/configuration.json create mode 100644 app/include/sample_config.h create mode 100644 app/include/wifi.h create mode 100644 app/interfaces/com.example.poc.AmbientTemp.json create mode 100644 app/prj-wifi.conf create mode 100644 app/src/sample_config.c create mode 100644 app/src/wifi.c create mode 100644 app/sysbuild/boards/frdm_rw612.conf create mode 100644 app/sysbuild/boards/frdm_rw612.overlay create mode 100644 portal/ambient_temp/CORS create mode 100644 portal/ambient_temp/app.js create mode 100644 portal/cpu_temp/CORS create mode 100644 portal/cpu_temp/app.js delete mode 100644 portal/main.mjs create mode 100644 scripts/.pylintrc create mode 100644 scripts/clean.py create mode 100644 scripts/format.py create mode 100644 scripts/requirements.txt create mode 100644 scripts/west-commands.yml diff --git a/.gitignore b/.gitignore index 3788b7a..d8157a6 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ cmake-build-*/ # samples private conf used to store secrets like wifi passwords and credential secrets app/private.conf + +# Binary file for config file +lfs.bin diff --git a/README.md b/README.md index 9a8690a..d7dac8e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Install the required dependencies ```sh west zephyr-export west packages pip --install +west packages pip --install -- -r ./clea_cpu_monitoring_zephyr/scripts/requirements.txt ``` ## Configure the application @@ -49,7 +50,67 @@ You can now build the sample with the following command: ```sh west build --sysbuild -p -b mimxrt1064_evk clea_cpu_monitoring_zephyr/app/ ``` +Or if choosing the FRDM-RW612 board: +```sh +west build --sysbuild -p -b frdm_rw612 clea_cpu_monitoring_zephyr/app -DEXTRA_CONF_FILE="prj-wifi.conf" +``` + Then flash it with the command: ```sh west flash --runner=linkserver ``` + +### Configuration from flash + +Astarte devices are authenticated to the cloud instance using a credential secret and device ID +combination. For various reason it might be inconvenient and unsafe to store such information +within the binary file of your application. +This sample provides the users with two methods to handle sensitive information: +1. The user can provide all sensitive data through the kconfig options. Such data will be embedded +in the final application binary. +2. The user can embed all sensitive data within a separate partition, which can be flashed +independently. The sample will then read the sensitive data from the partition and the application +binary will not contain sensitive or device-specific information. Meaning it will be possible +to flash the same binary file on multiple separate devices. + +The first method is very straight forward and enabled by default. The user should only change +the `CONFIG_ASTARTE_DEVICE_ID` and `CONFIG_ASTARTE_CREDENTIAL_SECRET` options in the `prj.conf`. + +However, to use the flash partition a couple of extra steps will be required. +First, install the `littlefs-python` tool. +```bash +pip install littlefs-python +``` +Next, update the json file `config_lfs/configuration.json` with your desired options and +create the new partition. +```bash +littlefs-python create app/config_lfs/ app/lfs.bin --block-size 4096 --block-count 6 +``` +Finally, flash the partition on your device using your debugger of choice. The produced `lfs.bin` +should be flashed at address `0xBE40000`. +For example using J-Link for the FRDM RW612 bard the following command will do the trick. +```bash +JLinkExe -Device RW612 -if SWD -Speed 4000 +connect +LoadBin app/lfs.bin 0xBE40000 +reset +exit +``` +Now your device has permanently been flashed with the credentials. You can enable the +`CONFIG_GET_CONFIG_FROM_FLASH` option in the kconfig and flash your application as you would normally +do. The standard `west flash` command will only flash the application partition and not the +custom partition used for the credentials. + +The WiFi SSID and password can also be flashed on the devie in this manner. + +### Update WiFi configuration through UART + +When WiFi credentials are stored in flash they can be updated through an UART shell command. +Open a shell with minicom. +```bash +minicom -D /dev/ttyACM0 -b 115200 +``` +Run the command to update the wifi config +```bash +wifi update-credentials -s ssid -p pwd +``` diff --git a/README_NXP.md b/README_NXP.md index 8e9decf..d265647 100644 --- a/README_NXP.md +++ b/README_NXP.md @@ -111,13 +111,17 @@ received from the device and plot it in a couple of graphs. Navigate to the portal section and then under applications select create application. Insert a name and slug of your choice. Add the two interfaces you installed in the previous step in the required Astarte interfaces section. Then add a source URL where the application can be fetched. -We include the application JavaScript source file in this repository in the `portal/main.mjs` +We include the application JavaScript source file in this repository in the `portal/app.js` folder. However, you will need to self host the file and make it available to the portal application. It will need to be accessible through TLS and support Cross-origin resource sharing (CORS). ![Application creation.](/doc/images/application_creation.png) +The application reported in this repo is a slightly modified and pre-compiled version of the +[CPU monitoring example](https://github.com/clea-platform/clea-examples/tree/master/cpu-monitoring-example) +that can be found in the Clea examples repo. + ### 3.4 Creating an organization and accessing portal We should now create an organization and invite at least one user. The invited user will then have diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 0d65fb9..bf21273 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -24,6 +24,9 @@ test_sysbuild() # create source files list FILE(GLOB app_common_sources ${CMAKE_CURRENT_LIST_DIR}/src/*.c) +if(NOT CONFIG_WIFI) + LIST(REMOVE_ITEM app_common_sources ${CMAKE_CURRENT_LIST_DIR}/src/wifi.c) +endif() target_sources(app PRIVATE ${app_common_sources}) target_include_directories(app PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include) diff --git a/app/Kconfig b/app/Kconfig index e6fb0b8..25ea7db 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -4,14 +4,55 @@ endmenu menu "CPU metrics sample application" +config GET_CONFIG_FROM_FLASH + bool "Collect the configuration from flash" + help + Collect the configuration from a file in the dedicated flash partition. + +config WIFI_SSID + string "WiFi SSID" + depends on WIFI + depends on !GET_CONFIG_FROM_FLASH + default "" + help + WiFi access point SSID. + +config WIFI_PASSWORD + string "WiFi password" + depends on WIFI + depends on !GET_CONFIG_FROM_FLASH + default "" + help + WiFi access point password. + +config ENABLE_TRANSMISSION + bool "Enable sensor readings transmission" + default n + help + Enable transmission of sensor readings to Astarte. + +config CPU_TEMP_SENSOR + bool "CPU temperature sensor" + default n + help + Temperature sensor embedded within the CPU die. + +config AMBIENT_TEMP_SENSOR + bool "Ambient temperature sensor" + default n + help + Temperature sensor embedded within the ambient. + config ASTARTE_DEVICE_ID string "Astarte device ID" + depends on !GET_CONFIG_FROM_FLASH default "" help Device ID to be used to connect to Astarte. config ASTARTE_CREDENTIAL_SECRET string "Astarte credential secret" + depends on !GET_CONFIG_FROM_FLASH default "" help The credential secret to be used to connect to Astarte. diff --git a/app/boards/frdm_rw612.conf b/app/boards/frdm_rw612.conf new file mode 100644 index 0000000..91bb193 --- /dev/null +++ b/app/boards/frdm_rw612.conf @@ -0,0 +1,15 @@ +# (C) Copyright 2025, SECO Mind Srl +# +# SPDX-License-Identifier: Apache-2.0 + +# Enable the WiFi +CONFIG_WIFI_NXP=y + +# Use a large log buffer size +CONFIG_LOG_BUFFER_SIZE=32768 + +# Set the ambient temperature sensor in the demo +CONFIG_AMBIENT_TEMP_SENSOR=y + +# This board by default will expect the configuration to be present in flash +CONFIG_GET_CONFIG_FROM_FLASH=y diff --git a/app/boards/frdm_rw612.overlay b/app/boards/frdm_rw612.overlay new file mode 100644 index 0000000..c30b4c2 --- /dev/null +++ b/app/boards/frdm_rw612.overlay @@ -0,0 +1,39 @@ +/* + * (C) Copyright 2025, SECO Mind Srl + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + fstab { + compatible = "zephyr,fstab"; + lfs1: lfs1 { + compatible = "zephyr,fstab,littlefs"; + mount-point = "/lfs1"; + partition = <&config_partition>; + automount; + read-size = <16>; + prog-size = <16>; + cache-size = <64>; + lookahead-size = <32>; + block-cycles = <512>; + }; + }; +}; + +&w25q512jvfiq { + partitions { + astarte_partition: partition@3E00000 { + label = "astarte"; + reg = <0x03E00000 DT_SIZE_K(128)>; + }; + edgehog_partition: partition@3E20000 { + label = "edgehog"; + reg = <0x03E20000 DT_SIZE_K(128)>; + }; + config_partition: partition@3E40000 { + label = "configuration"; + reg = <0x03E40000 DT_SIZE_K(24)>; + }; + }; +}; diff --git a/app/boards/mimxrt1064_evk.conf b/app/boards/mimxrt1064_evk.conf index a10c7a3..dc6f7e6 100644 --- a/app/boards/mimxrt1064_evk.conf +++ b/app/boards/mimxrt1064_evk.conf @@ -10,3 +10,5 @@ CONFIG_EDGEHOG_DEVICE_USE_EDGEHOG_PARTITION=y CONFIG_LOG_MODE_DEFERRED=y CONFIG_LOG_BUFFER_SIZE=32768 + +CONFIG_CPU_TEMP_SENSOR=y diff --git a/app/config_lfs/configuration.json b/app/config_lfs/configuration.json new file mode 100644 index 0000000..d0f6f3b --- /dev/null +++ b/app/config_lfs/configuration.json @@ -0,0 +1,6 @@ +{ + "deviceID": "xxxxxxx" , + "credentialSecret": "xxxxxxx", + "wifiSsid": "xxxxxxx", + "wifiPassword": "xxxxxxx" +} diff --git a/app/include/sample_config.h b/app/include/sample_config.h new file mode 100644 index 0000000..3736660 --- /dev/null +++ b/app/include/sample_config.h @@ -0,0 +1,38 @@ +/* + * (C) Copyright 2025, SECO Mind Srl + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef SAMPLE_CONFIG_H +#define SAMPLE_CONFIG_H + +#include +#include + +#include + +#if defined(CONFIG_WIFI) +#define SAMPLE_CONFIG_WIFI_MAX_STRINGS 255 +#endif + +struct sample_config +{ + char device_id[ASTARTE_DEVICE_ID_LEN + 1]; +#if !defined(CONFIG_DEVICE_REGISTRATION) + char credential_secret[ASTARTE_PAIRING_CRED_SECR_LEN + 1]; +#endif +#if defined(CONFIG_WIFI) + char wifi_ssid[SAMPLE_CONFIG_WIFI_MAX_STRINGS]; + char wifi_pwd[SAMPLE_CONFIG_WIFI_MAX_STRINGS]; +#endif +}; + +int sample_config_get(struct sample_config *cfg); +#if defined(CONFIG_WIFI) +int sample_config_get_wifi_ssid(char output[static SAMPLE_CONFIG_WIFI_MAX_STRINGS]); +int sample_config_update_wifi_creds(char ssid[static SAMPLE_CONFIG_WIFI_MAX_STRINGS], + char pwd[static SAMPLE_CONFIG_WIFI_MAX_STRINGS]); +#endif + +#endif /* SAMPLE_CONFIG_H */ diff --git a/app/include/wifi.h b/app/include/wifi.h new file mode 100644 index 0000000..0a08ff7 --- /dev/null +++ b/app/include/wifi.h @@ -0,0 +1,22 @@ +/* + * (C) Copyright 2025, SECO Mind Srl + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef WIFI_H +#define WIFI_H + +#include + +/** + * @brief Initialize the wifi driver + */ +void app_wifi_init(void); + +/** + * @brief Connect the wifi to an SSID + */ +int app_wifi_connect(const char *ssid, enum wifi_security_type sec, const char *psk); + +#endif /* WIFI_H */ diff --git a/app/interfaces/com.example.poc.AmbientTemp.json b/app/interfaces/com.example.poc.AmbientTemp.json new file mode 100644 index 0000000..cdaa857 --- /dev/null +++ b/app/interfaces/com.example.poc.AmbientTemp.json @@ -0,0 +1,18 @@ +{ + "interface_name": "com.example.poc.AmbientTemp", + "version_major": 0, + "version_minor": 1, + "type": "datastream", + "ownership": "device", + "aggregation": "individual", + "mappings": [ + { + "endpoint": "/temp", + "type": "double", + "database_retention_policy": "use_ttl", + "database_retention_ttl": 5184000, + "explicit_timestamp": true, + "description": "SOC temperature in °C" + } + ] + } diff --git a/app/interfaces/generated_interfaces.c b/app/interfaces/generated_interfaces.c index 0c88c18..e40d614 100644 --- a/app/interfaces/generated_interfaces.c +++ b/app/interfaces/generated_interfaces.c @@ -10,6 +10,28 @@ // Interface names should resemble as closely as possible their respective .json file names. // NOLINTBEGIN(readability-identifier-naming) +static const astarte_mapping_t com_example_poc_AmbientTemp_mappings[1] = { + + { + .endpoint = "/temp", + .type = ASTARTE_MAPPING_TYPE_DOUBLE, + .reliability = ASTARTE_MAPPING_RELIABILITY_UNRELIABLE, + .explicit_timestamp = true, + .allow_unset = false, + }, +}; + +const astarte_interface_t com_example_poc_AmbientTemp = { + .name = "com.example.poc.AmbientTemp", + .major_version = 0, + .minor_version = 1, + .type = ASTARTE_INTERFACE_TYPE_DATASTREAM, + .ownership = ASTARTE_INTERFACE_OWNERSHIP_DEVICE, + .aggregation = ASTARTE_INTERFACE_AGGREGATION_INDIVIDUAL, + .mappings = com_example_poc_AmbientTemp_mappings, + .mappings_length = 1U, +}; + static const astarte_mapping_t com_example_poc_CpuMetrics_mappings[1] = { { diff --git a/app/interfaces/generated_interfaces.h b/app/interfaces/generated_interfaces.h index 088c9c7..bbfc5a2 100644 --- a/app/interfaces/generated_interfaces.h +++ b/app/interfaces/generated_interfaces.h @@ -17,6 +17,7 @@ // Interface names should resemble as closely as possible their respective .json file names. // NOLINTBEGIN(readability-identifier-naming) +extern const astarte_interface_t com_example_poc_AmbientTemp; extern const astarte_interface_t com_example_poc_CpuMetrics; extern const astarte_interface_t com_example_poc_CpuTemp; // NOLINTEND(readability-identifier-naming) diff --git a/app/prj-wifi.conf b/app/prj-wifi.conf new file mode 100644 index 0000000..4cbf6aa --- /dev/null +++ b/app/prj-wifi.conf @@ -0,0 +1,20 @@ +# (C) Copyright 2025, SECO Mind Srl +# +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + +CONFIG_WIFI=y +CONFIG_ETH_DRIVER=n + +CONFIG_NET_IPV6=n +CONFIG_NET_DHCPV6=n + +# Increased stack size for network management +CONFIG_NET_MGMT_EVENT_STACK_SIZE=2048 + +# Large shell stack size used when configuring WiFi through shell +CONFIG_SHELL_STACK_SIZE=16384 +CONFIG_SHELL_GETOPT=y +CONFIG_GETOPT_LONG=y diff --git a/app/prj.conf b/app/prj.conf index d45dd34..2965aa6 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -10,7 +10,7 @@ CONFIG_LOG=y CONFIG_CBPRINTF_FP_SUPPORT=y # Increased stack size -CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=8192 # Enable base64 encoding and decoding CONFIG_BASE64=y @@ -118,7 +118,7 @@ CONFIG_ASTARTE_DEVICE_SDK_PERMANENT_STORAGE=y # Configure the name of the binary # This will also be used to identify the edgehog image -CONFIG_KERNEL_BIN_NAME="sample-edgehog-app" +CONFIG_KERNEL_BIN_NAME="frdm-rw612" # Edgehog depends on CONFIG_IMG_MANAGER=y @@ -131,7 +131,7 @@ CONFIG_EDGEHOG_DEVICE_CA_CERT_OTA_TAG=3 CONFIG_EDGEHOG_DEVICE_ZBUS_OTA_EVENT=y # System info interface data -CONFIG_EDGEHOG_DEVICE_PART_NUMBER="" +CONFIG_EDGEHOG_DEVICE_PART_NUMBER="FRDM-RW612-X" CONFIG_EDGEHOG_DEVICE_SERIAL_NUMBER="" # Sample configuration @@ -168,3 +168,11 @@ CONFIG_SCHED_THREAD_USAGE=y CONFIG_SCHED_THREAD_USAGE_ALL=y CONFIG_SCHED_THREAD_USAGE_ANALYSIS=y CONFIG_SCHED_THREAD_USAGE_AUTO_ENABLE=y + +# Enable littlefs +CONFIG_FILE_SYSTEM=y +CONFIG_FILE_SYSTEM_LITTLEFS=y + +# Enabling shell +CONFIG_SHELL=y +CONFIG_SHELL_AUTOSTART=y diff --git a/app/src/main.c b/app/src/main.c index 6895336..ea5399c 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -28,9 +28,15 @@ LOG_MODULE_REGISTER(cpu_metrics_app, CONFIG_APP_LOG_LEVEL); #include #include +#if defined(CONFIG_WIFI) +#include "wifi.h" +#else #include "eth.h" +#endif #include "generated_interfaces.h" +#include "sample_config.h" + /************************************************ * Constants and defines ***********************************************/ @@ -63,7 +69,17 @@ ZBUS_SUBSCRIBER_DEFINE(edgehog_ota_subscriber, EDGEHOG_OTA_SUBSCRIBER_NOTIFICATI ZBUS_CHAN_ADD_OBS(edgehog_ota_chan, edgehog_ota_subscriber, EDGEHOG_OTA_OBSERVER_NOTIFY_PRIORITY); #endif +#define STATS_THREAD_STACK_SIZE 16384 +#define STATS_THREAD_PRIORITY 0 +K_THREAD_STACK_DEFINE(stats_thread_stack_area, STATS_THREAD_STACK_SIZE); +static struct k_thread stats_thread_data; + +#ifdef CONFIG_CPU_TEMP_SENSOR static const struct device *const die_temp_sensor = DEVICE_DT_GET(DT_ALIAS(die_temp0)); +#endif +#ifdef CONFIG_AMBIENT_TEMP_SENSOR +static const struct device *const ambient_temp_sensor = DEVICE_DT_GET(DT_ALIAS(ambient_temp0)); +#endif enum device_tread_flags { @@ -89,7 +105,7 @@ static void system_time_init(void); * @param arg2 Unused argument. * @param arg3 Unused argument. */ -static void edgehog_device_thread_entry_point(void *arg1, void *arg2, void *arg3); +static void edgehog_device_thread_entry_point(void *device_id, void *cred_secr, void *arg3); #ifdef CONFIG_EDGEHOG_DEVICE_ZBUS_OTA_EVENT /** * @brief Entry point for the Zbus reception thread. @@ -122,13 +138,13 @@ static void astarte_connection_callback(astarte_device_connection_event_t event) */ static void astarte_disconnection_callback(astarte_device_disconnection_event_t event); /** - * @brief Timer handler for the CPU statistics. + * @brief Entry point for the stats thread. * - * @param dummy Unused. + * @param arg1 Unused argument. + * @param arg2 Unused argument. + * @param arg3 Unused argument. */ -void cpu_stats_timer_handler(struct k_timer *dummy); - -K_TIMER_DEFINE(cpu_usage_timer, cpu_stats_timer_handler, NULL); +static void stats_thread_entry_point(void *arg1, void *arg2, void *arg3); /************************************************ * Global functions definition @@ -140,16 +156,44 @@ int main(void) LOG_INF("Edgehog device sample"); LOG_INF("Board: %s", CONFIG_BOARD); + struct sample_config cfg_from_file = { 0 }; + sample_config_get(&cfg_from_file); + LOG_INF("Configured device ID: %s", cfg_from_file.device_id); + LOG_INF("Configured credential secret: %s", cfg_from_file.credential_secret); +#if defined(CONFIG_WIFI) + LOG_INF("Configured WiFi SSID: %s", cfg_from_file.wifi_ssid); + LOG_INF("Configured WiFi password: %s", cfg_from_file.wifi_pwd); +#endif + +#ifdef CONFIG_CPU_TEMP_SENSOR if (!device_is_ready(die_temp_sensor)) { LOG_ERR("sensor: device %s not ready.", die_temp_sensor->name); return -ENODEV; } +#endif +#ifdef CONFIG_AMBIENT_TEMP_SENSOR + if (!device_is_ready(ambient_temp_sensor)) { + LOG_ERR("sensor: device %s not ready.", ambient_temp_sensor->name); + return -ENODEV; + } +#endif - LOG_INF("Initializing Ethernet driver."); +#if defined(CONFIG_WIFI) + LOG_INF("Initializing WiFi driver."); // NOLINT + app_wifi_init(); + k_sleep(K_SECONDS(5)); + enum wifi_security_type sec = WIFI_SECURITY_TYPE_PSK; + if (app_wifi_connect(cfg_from_file.wifi_ssid, sec, cfg_from_file.wifi_pwd) != 0) { + LOG_ERR("Connectivity intialization failed!"); // NOLINT + return -1; + } +#else + LOG_INF("Initializing Ethernet driver."); // NOLINT if (eth_connect() != 0) { - LOG_ERR("Connectivity intialization failed!"); + LOG_ERR("Connectivity intialization failed!"); // NOLINT return -1; } +#endif // Add TLS certificate for Astarte if required #if (!defined(CONFIG_ASTARTE_DEVICE_SDK_DEVELOP_USE_NON_TLS_HTTP) \ @@ -169,9 +213,13 @@ int main(void) // Spawn a new thread for the Edgehog device k_thread_create(&edgehog_device_thread_data, edgehog_device_thread_stack_area, K_THREAD_STACK_SIZEOF(edgehog_device_thread_stack_area), edgehog_device_thread_entry_point, - NULL, NULL, NULL, EDGEHOG_DEVICE_THREAD_PRIORITY, 0, K_NO_WAIT); + cfg_from_file.device_id, cfg_from_file.credential_secret, NULL, + EDGEHOG_DEVICE_THREAD_PRIORITY, 0, K_NO_WAIT); - k_timer_start(&cpu_usage_timer, K_SECONDS(5), K_SECONDS(5)); + // Spawn a new thread for the stats + k_thread_create(&stats_thread_data, stats_thread_stack_area, + K_THREAD_STACK_SIZEOF(stats_thread_stack_area), stats_thread_entry_point, NULL, NULL, NULL, + STATS_THREAD_PRIORITY, 0, K_NO_WAIT); // Wait for a predefined operational time. k_timeout_t finish_timeout = (CONFIG_SAMPLE_DURATION_SECONDS == 0) @@ -180,13 +228,12 @@ int main(void) k_timepoint_t finish_timepoint = sys_timepoint_calc(finish_timeout); while (!K_TIMEOUT_EQ(sys_timepoint_timeout(finish_timepoint), K_NO_WAIT)) { k_timepoint_t timepoint = sys_timepoint_calc(K_MSEC(MAIN_THREAD_PERIOD_MS)); - // Ensure the connectivity is still present +#if !defined(CONFIG_WIFI) eth_poll(); +#endif k_sleep(sys_timepoint_timeout(timepoint)); } - k_timer_stop(&cpu_usage_timer); - // Signal to the Device threads that they should terminate. atomic_set_bit(&device_threads_flags, DEVICE_THREADS_FLAGS_TERMINATION); @@ -226,21 +273,22 @@ static void system_time_init() #endif } -static void edgehog_device_thread_entry_point(void *arg1, void *arg2, void *arg3) +static void edgehog_device_thread_entry_point(void *device_id, void *cred_secr, void *arg3) { - ARG_UNUSED(arg1); - ARG_UNUSED(arg2); ARG_UNUSED(arg3); // Configuring the Astarte device used by the Edgehog device to communicate with the cloud // Edgehog instance. This device can also be leveraged by the user to send and receive data // through Astarte, check out the sample README for more information. - char cred_secr[ASTARTE_PAIRING_CRED_SECR_LEN + 1] = CONFIG_ASTARTE_CREDENTIAL_SECRET; - char device_id[ASTARTE_DEVICE_ID_LEN + 1] = CONFIG_ASTARTE_DEVICE_ID; const astarte_interface_t *interfaces[] = { &com_example_poc_CpuMetrics, +#ifdef CONFIG_CPU_TEMP_SENSOR &com_example_poc_CpuTemp, +#endif +#ifdef CONFIG_AMBIENT_TEMP_SENSOR + &com_example_poc_AmbientTemp, +#endif }; astarte_device_config_t astarte_device_config = { 0 }; @@ -251,8 +299,8 @@ static void edgehog_device_thread_entry_point(void *arg1, void *arg2, void *arg3 astarte_device_config.disconnection_cbk = astarte_disconnection_callback; astarte_device_config.interfaces = interfaces; astarte_device_config.interfaces_size = ARRAY_SIZE(interfaces); - memcpy(astarte_device_config.cred_secr, cred_secr, sizeof(cred_secr)); - memcpy(astarte_device_config.device_id, device_id, sizeof(device_id)); + memcpy(astarte_device_config.cred_secr, cred_secr, ASTARTE_PAIRING_CRED_SECR_LEN + 1); + memcpy(astarte_device_config.device_id, device_id, ASTARTE_DEVICE_ID_LEN + 1); edgehog_result_t eres = EDGEHOG_RESULT_OK; @@ -378,67 +426,115 @@ static void astarte_disconnection_callback(astarte_device_disconnection_event_t atomic_clear_bit(&device_threads_flags, DEVICE_THREADS_FLAGS_ASTARTE_CONNECTED); } -void cpu_stats_timer_handler(struct k_timer *dummy) +static void stats_thread_entry_point(void *arg1, void *arg2, void *arg3) { - int rc; + while (!atomic_test_bit(&device_threads_flags, DEVICE_THREADS_FLAGS_TERMINATION)) { + k_timepoint_t timepoint = sys_timepoint_calc(K_SECONDS(5)); - if (!atomic_test_bit(&device_threads_flags, DEVICE_THREADS_FLAGS_ASTARTE_CONNECTED)) { - LOG_ERR("Skipping stats transmission, Astarte is not connected."); - return; - } + int rc; +#ifdef CONFIG_ENABLE_TRANSMISSION + astarte_result_t ares = ASTARTE_RESULT_OK; +#endif - int64_t timestamp_ms = 0; - struct timespec tspec; - rc = clock_gettime(CLOCK_REALTIME, &tspec); - if (rc != 0) { - LOG_ERR("Failed getting time."); - } - timestamp_ms = (int64_t) tspec.tv_sec * MSEC_PER_SEC + (tspec.tv_nsec / NSEC_PER_MSEC); + if (!atomic_test_bit(&device_threads_flags, DEVICE_THREADS_FLAGS_ASTARTE_CONNECTED)) { + LOG_ERR("Skipping stats transmission, Astarte is not connected."); + k_sleep(sys_timepoint_timeout(timepoint)); + continue; + } - astarte_device_handle_t astarte_device = edgehog_device_get_astarte_device(edgehog_device); + int64_t timestamp_ms = 0; + struct timespec tspec; + rc = clock_gettime(CLOCK_REALTIME, &tspec); + if (rc != 0) { + LOG_ERR("Failed getting time."); + } + timestamp_ms = (int64_t) tspec.tv_sec * MSEC_PER_SEC + (tspec.tv_nsec / NSEC_PER_MSEC); - static uint64_t prev_total_cycles = 0U; // Non idle cycles - static uint64_t prev_execution_cycles = 0U; // Sum of idle + non idle cycles +#ifdef CONFIG_ENABLE_TRANSMISSION + astarte_device_handle_t astarte_device = edgehog_device_get_astarte_device(edgehog_device); +#endif + + static uint64_t prev_total_cycles = 0U; // Non idle cycles + static uint64_t prev_execution_cycles = 0U; // Sum of idle + non idle cycles - k_thread_runtime_stats_t stats; - rc = k_thread_runtime_stats_cpu_get(0, &stats); - if (rc) { - LOG_ERR("Failed reading CPU stats (%d)", rc); - } else { - double cpu_usage = 100.0f * (stats.total_cycles - prev_total_cycles) - / (stats.execution_cycles - prev_execution_cycles); - prev_total_cycles = stats.total_cycles; - prev_execution_cycles = stats.execution_cycles; + k_thread_runtime_stats_t stats; + rc = k_thread_runtime_stats_cpu_get(0, &stats); + if (rc) { + LOG_ERR("Failed reading CPU stats (%d)", rc); + } else { + double cpu_usage = 100.0f * (stats.total_cycles - prev_total_cycles) + / (stats.execution_cycles - prev_execution_cycles); + prev_total_cycles = stats.total_cycles; + prev_execution_cycles = stats.execution_cycles; - LOG_INF("CPU usage: %.2lf %%", cpu_usage); + LOG_INF("CPU usage: %.2lf %%", cpu_usage); - astarte_result_t ares - = astarte_device_send_individual(astarte_device, com_example_poc_CpuMetrics.name, +#ifdef CONFIG_ENABLE_TRANSMISSION + ares = astarte_device_send_individual(astarte_device, com_example_poc_CpuMetrics.name, "/loadavg", astarte_data_from_double(cpu_usage), ×tamp_ms); + if (ares != ASTARTE_RESULT_OK) { + LOG_ERR("Astarte device transmission failure."); + } +#else + LOG_INF("Data transmission is disabled."); +#endif + } + +#ifdef CONFIG_CPU_TEMP_SENSOR + rc = sensor_sample_fetch(die_temp_sensor); + if (rc) { + LOG_ERR("Failed to fetch temperature sample (%d)", rc); + return; + } + + struct sensor_value die_temp_val; + rc = sensor_channel_get(die_temp_sensor, SENSOR_CHAN_DIE_TEMP, &die_temp_val); + if (rc) { + LOG_ERR("Failed to get temperature reading (%d)", rc); + return; + } + + double die_temp = sensor_value_to_double(&die_temp_val); + LOG_INF("CPU Die temperature: %.1f °C", die_temp); + +#ifdef CONFIG_ENABLE_TRANSMISSION + ares = astarte_device_send_individual(astarte_device, com_example_poc_CpuTemp.name, "/temp", + astarte_data_from_double(die_temp), ×tamp_ms); if (ares != ASTARTE_RESULT_OK) { LOG_ERR("Astarte device transmission failure."); } - } +#else + LOG_INF("Data transmission is disabled."); +#endif +#endif +#ifdef CONFIG_AMBIENT_TEMP_SENSOR + rc = sensor_sample_fetch_chan(ambient_temp_sensor, SENSOR_CHAN_AMBIENT_TEMP); + if (rc) { + LOG_ERR("Failed to fetch temperature sample (%d)", rc); + return; + } - rc = sensor_sample_fetch(die_temp_sensor); - if (rc) { - LOG_ERR("Failed to fetch temperature sample (%d)", rc); - return; - } + struct sensor_value ambient_temp_val; + rc = sensor_channel_get(ambient_temp_sensor, SENSOR_CHAN_AMBIENT_TEMP, &ambient_temp_val); + if (rc) { + LOG_ERR("Failed to get temperature reading (%d)", rc); + return; + } - struct sensor_value val; - rc = sensor_channel_get(die_temp_sensor, SENSOR_CHAN_DIE_TEMP, &val); - if (rc) { - LOG_ERR("Failed to get temperature reading (%d)", rc); - return; - } + double ambient_temp = sensor_value_to_double(&ambient_temp_val); + LOG_INF("Ambient temperature: %.1f °C", ambient_temp); - double die_temp = sensor_value_to_double(&val); - LOG_INF("CPU Die temperature: %.1f °C", die_temp); +#ifdef CONFIG_ENABLE_TRANSMISSION + ares = astarte_device_send_individual(astarte_device, com_example_poc_AmbientTemp.name, + "/temp", astarte_data_from_double(ambient_temp), ×tamp_ms); + if (ares != ASTARTE_RESULT_OK) { + LOG_ERR("Astarte device transmission failure."); + } +#else + LOG_INF("Data transmission is disabled."); +#endif +#endif - astarte_result_t ares = astarte_device_send_individual(astarte_device, - com_example_poc_CpuTemp.name, "/temp", astarte_data_from_double(die_temp), ×tamp_ms); - if (ares != ASTARTE_RESULT_OK) { - LOG_ERR("Astarte device transmission failure."); + k_sleep(sys_timepoint_timeout(timepoint)); } } diff --git a/app/src/sample_config.c b/app/src/sample_config.c new file mode 100644 index 0000000..f65b2e9 --- /dev/null +++ b/app/src/sample_config.c @@ -0,0 +1,369 @@ +/* + * (C) Copyright 2025, SECO Mind Srl + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "sample_config.h" + +#include +#include + +#if defined(CONFIG_GET_CONFIG_FROM_FLASH) +#include +#include +#include +#include +#include +#include +#include +#endif + +#include +LOG_MODULE_REGISTER(config_file, CONFIG_APP_LOG_LEVEL); // NOLINT + +/************************************************ + * Checks over configuration values * + ***********************************************/ + +#if !defined(CONFIG_GET_CONFIG_FROM_FLASH) +BUILD_ASSERT(sizeof(CONFIG_ASTARTE_DEVICE_ID) == ASTARTE_DEVICE_ID_LEN + 1, + "Missing device ID in datastreams example"); + +BUILD_ASSERT(sizeof(CONFIG_ASTARTE_CREDENTIAL_SECRET) == ASTARTE_PAIRING_CRED_SECR_LEN + 1, + "Missing credential secret in datastreams example"); +#endif + +/************************************************ + * Defines, constants and typedef * + ***********************************************/ + +#if defined(CONFIG_GET_CONFIG_FROM_FLASH) +/* Matches LFS_NAME_MAX */ +#define MAX_PATH_LEN 255 +#define MAX_CONFIG_FILE_SIZE 4096 + +#define PARTITION_NODE DT_NODELABEL(lfs1) + +#if DT_NODE_EXISTS(PARTITION_NODE) +FS_FSTAB_DECLARE_ENTRY(PARTITION_NODE); +#else /* PARTITION_NODE */ +#error "Could not find the littlefs partition!" +#endif /* PARTITION_NODE */ + +struct fs_mount_t *mountpoint = &FS_FSTAB_ENTRY(PARTITION_NODE); +#endif + +/************************************************ + * Static functions declaration * + ***********************************************/ + +static int copy_configuration(const char *device_id, const char *credential_secret, + const char *wifi_ssid, const char *wifi_pwd, struct sample_config *out_cfg); +#if defined(CONFIG_GET_CONFIG_FROM_FLASH) +static int read_configuration_file( + char fname[static MAX_PATH_LEN], char fcontent[static MAX_CONFIG_FILE_SIZE]); +static int write_configuration_file( + char fname[static MAX_PATH_LEN], char fcontent[static MAX_CONFIG_FILE_SIZE]); +static int parse_configuration_file(char *fcontent, struct sample_config *out_cfg); +static int update_wifi_configuration(char *fcontent, + char new_ssid[static SAMPLE_CONFIG_WIFI_MAX_STRINGS], + char new_pwd[static SAMPLE_CONFIG_WIFI_MAX_STRINGS], char *output_buffer, size_t buffer_size); +#endif + +/************************************************ + * Global functions definition + ***********************************************/ + +int sample_config_get(struct sample_config *cfg) +{ +#if defined(CONFIG_GET_CONFIG_FROM_FLASH) + int rc; + char config_fname[MAX_PATH_LEN] = { 0 }; + char config_fcontent[MAX_CONFIG_FILE_SIZE] = { 0 }; + + rc = snprintf( + config_fname, sizeof(config_fname), "%s/configuration.json", mountpoint->mnt_point); + if (rc >= sizeof(config_fname)) { + LOG_ERR("FAIL: snprinf [rd:%d]", rc); + goto out; + } + + rc = read_configuration_file(config_fname, config_fcontent); + if (rc < 0) { + goto out; + } + LOG_DBG("%s read content:%s (bytes: %d)", config_fname, config_fcontent, rc); + + rc = parse_configuration_file(config_fcontent, cfg); + if (rc != 0) { + goto out; + } + +out: + return (rc != 0) ? -1 : 0; +#else + return copy_configuration(CONFIG_ASTARTE_DEVICE_ID, CONFIG_ASTARTE_CREDENTIAL_SECRET, +#if defined(CONFIG_WIFI) + CONFIG_WIFI_SSID, CONFIG_WIFI_PASSWORD, +#else + NULL, NULL, +#endif + cfg); +#endif +} +#if defined(CONFIG_WIFI) +int sample_config_get_wifi_ssid(char output[static SAMPLE_CONFIG_WIFI_MAX_STRINGS]) +{ +#if defined(CONFIG_GET_CONFIG_FROM_FLASH) + struct sample_config cfg = { 0 }; + int config_get_rc = sample_config_get(&cfg); + if (config_get_rc != 0) { + return -1; + } + int snprintf_rc = snprintf(output, SAMPLE_CONFIG_WIFI_MAX_STRINGS, "%s", cfg.wifi_ssid); +#else + int snprintf_rc + = snprintf(output, SAMPLE_CONFIG_WIFI_MAX_STRINGS, "WiFi configured at build time."); +#endif + if ((snprintf_rc < 0) || (snprintf_rc >= SAMPLE_CONFIG_WIFI_MAX_STRINGS)) { + LOG_ERR("Error encoding the WiFi SSID."); + return -1; + } + return 0; +} +int sample_config_update_wifi_creds(char ssid[static SAMPLE_CONFIG_WIFI_MAX_STRINGS], + char pwd[static SAMPLE_CONFIG_WIFI_MAX_STRINGS]) +{ + int rc; + char config_fname[MAX_PATH_LEN] = { 0 }; + char config_fcontent[MAX_CONFIG_FILE_SIZE] = { 0 }; + char config_fcontent_updated[MAX_CONFIG_FILE_SIZE] = { 0 }; + + rc = snprintf( + config_fname, sizeof(config_fname), "%s/configuration.json", mountpoint->mnt_point); + if (rc >= sizeof(config_fname)) { + LOG_ERR("FAIL: snprinf [rd:%d]", rc); + goto out; + } + + rc = read_configuration_file(config_fname, config_fcontent); + if (rc < 0) { + LOG_ERR("FAIL: read configuration file [rd:%d]", rc); + goto out; + } + LOG_DBG("%s read content:%s (bytes: %d)", config_fname, config_fcontent, rc); + + rc = update_wifi_configuration( + config_fcontent, ssid, pwd, config_fcontent_updated, MAX_CONFIG_FILE_SIZE); + if (rc != 0) { + LOG_ERR("FAIL: updated wifi configuration [rd:%d]", rc); + goto out; + } + rc = write_configuration_file(config_fname, config_fcontent_updated); + if (rc < 0) { + LOG_ERR("FAIL: write new wifi configuration [rd:%d]", rc); + goto out; + } + LOG_DBG("%s", config_fcontent_updated); + +out: + return (rc < 0) ? -1 : 0; +} +#endif + +/************************************************ + * Static functions definitions + ***********************************************/ + +static int copy_configuration(const char *device_id, const char *credential_secret, + const char *wifi_ssid, const char *wifi_pwd, struct sample_config *out_cfg) +{ + // Copy the received credential secret in the output buffer + int snprintf_rc = snprintf(out_cfg->device_id, ARRAY_SIZE(out_cfg->device_id), "%s", device_id); + if ((snprintf_rc < 0) || (snprintf_rc >= ARRAY_SIZE(out_cfg->device_id))) { + LOG_ERR("Error extracting the device ID from the parsed json."); + return -1; + } + snprintf_rc = snprintf(out_cfg->credential_secret, ARRAY_SIZE(out_cfg->credential_secret), "%s", + credential_secret); + if ((snprintf_rc < 0) || (snprintf_rc >= ARRAY_SIZE(out_cfg->credential_secret))) { + LOG_ERR("Error extracting the credential secret from the parsed json."); + return -1; + } +#if defined(CONFIG_WIFI) + snprintf_rc = snprintf(out_cfg->wifi_ssid, ARRAY_SIZE(out_cfg->wifi_ssid), "%s", wifi_ssid); + if ((snprintf_rc < 0) || (snprintf_rc >= ARRAY_SIZE(out_cfg->wifi_ssid))) { + LOG_ERR("Error extracting the WiFi SSID from the parsed json."); + return -1; + } + snprintf_rc = snprintf(out_cfg->wifi_pwd, ARRAY_SIZE(out_cfg->wifi_pwd), "%s", wifi_pwd); + if ((snprintf_rc < 0) || (snprintf_rc >= ARRAY_SIZE(out_cfg->wifi_pwd))) { + LOG_ERR("Error extracting the WiFi password from the parsed json."); + return -1; + } +#else + ARG_UNUSED(wifi_ssid); + ARG_UNUSED(wifi_pwd); +#endif + return 0; +} +#if defined(CONFIG_GET_CONFIG_FROM_FLASH) +static int read_configuration_file( + char fname[static MAX_PATH_LEN], char fcontent[static MAX_CONFIG_FILE_SIZE]) +{ + struct fs_file_t file; + int rc, ret; + + fs_file_t_init(&file); + rc = fs_open(&file, fname, FS_O_READ); + if (rc < 0) { + LOG_ERR("FAIL: open %s: %d", fname, rc); + return rc; + } + + rc = fs_read(&file, fcontent, MAX_CONFIG_FILE_SIZE); + if (rc <= 0) { + LOG_ERR("FAIL: read %s: [rd:%d]", fname, rc); + goto out; + } + +out: + ret = fs_close(&file); + if (ret < 0) { + LOG_ERR("FAIL: close %s: %d", fname, ret); + return ret; + } + + return rc; +} +static int write_configuration_file( + char fname[static MAX_PATH_LEN], char fcontent[static MAX_CONFIG_FILE_SIZE]) +{ + struct fs_file_t file; + int rc, ret; + + fs_file_t_init(&file); + rc = fs_open(&file, fname, FS_O_TRUNC | FS_O_WRITE); + if (rc < 0) { + LOG_ERR("FAIL: open %s: %d", fname, rc); + return rc; + } + + rc = fs_write(&file, fcontent, strnlen(fcontent, MAX_CONFIG_FILE_SIZE) + 1); + if (rc <= 0) { + LOG_ERR("FAIL: write %s: [rd:%d]", fname, rc); + goto out; + } + +out: + ret = fs_close(&file); + if (ret < 0) { + LOG_ERR("FAIL: close %s: %d", fname, ret); + return ret; + } + + return rc; +} + +static int parse_configuration_file(char *fcontent, struct sample_config *out_cfg) +{ + // Define the structure of the expected JSON file + struct full_json_s + { + const char *deviceID; + const char *credentialSecret; + const char *wifiSsid; + const char *wifiPassword; + }; + // Create the descriptors list containing each element of the struct + static const struct json_obj_descr full_json_descr[] = { + JSON_OBJ_DESCR_PRIM(struct full_json_s, deviceID, JSON_TOK_STRING), + JSON_OBJ_DESCR_PRIM(struct full_json_s, credentialSecret, JSON_TOK_STRING), + JSON_OBJ_DESCR_PRIM(struct full_json_s, wifiSsid, JSON_TOK_STRING), + JSON_OBJ_DESCR_PRIM(struct full_json_s, wifiPassword, JSON_TOK_STRING), + }; + // This is only for the outside level, nested elements should be checked individually. + int expected_return_code = (1U << (size_t) ARRAY_SIZE(full_json_descr)) - 1; + // Parse the json into a structure + struct full_json_s parsed_json + = { .deviceID = NULL, .credentialSecret = NULL, .wifiSsid = NULL, .wifiPassword = NULL }; + int64_t ret = json_obj_parse( + fcontent, strlen(fcontent) + 1, full_json_descr, ARRAY_SIZE(full_json_descr), &parsed_json); + if (ret != expected_return_code) { + LOG_ERR("JSON Parse Error: %lld", ret); + return -1; + } + if (!parsed_json.deviceID) { + LOG_ERR("Parsed JSON is missing the deviceID field."); + return -1; + } + if (!parsed_json.credentialSecret) { + LOG_ERR("Parsed JSON is missing the credentialSecret field."); + return -1; + } + if (!parsed_json.wifiSsid) { + LOG_ERR("Parsed JSON is missing the wifiSsid field."); + return -1; + } + if (!parsed_json.wifiPassword) { + LOG_ERR("Parsed JSON is missing the wifiPassword field."); + return -1; + } + + // Copy the received credential secret in the output buffer + return copy_configuration(parsed_json.deviceID, parsed_json.credentialSecret, + parsed_json.wifiSsid, parsed_json.wifiPassword, out_cfg); +} +static int update_wifi_configuration(char *fcontent, + char new_ssid[static SAMPLE_CONFIG_WIFI_MAX_STRINGS], + char new_pwd[static SAMPLE_CONFIG_WIFI_MAX_STRINGS], char *output_buffer, size_t buffer_size) +{ + // Define the structure of the expected JSON file + struct full_json_s + { + const char *deviceID; + const char *credentialSecret; + const char *wifiSsid; + const char *wifiPassword; + }; + + // Create the descriptors list + static const struct json_obj_descr full_json_descr[] = { + JSON_OBJ_DESCR_PRIM(struct full_json_s, deviceID, JSON_TOK_STRING), + JSON_OBJ_DESCR_PRIM(struct full_json_s, credentialSecret, JSON_TOK_STRING), + JSON_OBJ_DESCR_PRIM(struct full_json_s, wifiSsid, JSON_TOK_STRING), + JSON_OBJ_DESCR_PRIM(struct full_json_s, wifiPassword, JSON_TOK_STRING), + }; + + int expected_return_code = (1U << (size_t) ARRAY_SIZE(full_json_descr)) - 1; + struct full_json_s parsed_json = { 0 }; + + int64_t ret = json_obj_parse( + fcontent, strlen(fcontent) + 1, full_json_descr, ARRAY_SIZE(full_json_descr), &parsed_json); + if (ret != expected_return_code) { + LOG_ERR("JSON Parse Error: %lld. Expected %d.", ret, expected_return_code); + return -1; + } + if (!parsed_json.deviceID) { + LOG_ERR("Parsed JSON is missing the deviceID field."); + return -1; + } + if (!parsed_json.credentialSecret) { + LOG_ERR("Parsed JSON is missing the credentialSecret field."); + return -1; + } + + struct full_json_s updated_json = { .deviceID = parsed_json.deviceID, + .credentialSecret = parsed_json.credentialSecret, + .wifiSsid = new_ssid, + .wifiPassword = new_pwd }; + int rc = json_obj_encode_buf( + full_json_descr, ARRAY_SIZE(full_json_descr), &updated_json, output_buffer, buffer_size); + if (rc < 0) { + LOG_ERR("Failed to encode updated JSON."); + return -1; + } + return 0; +} +#endif diff --git a/app/src/wifi.c b/app/src/wifi.c new file mode 100644 index 0000000..db38b50 --- /dev/null +++ b/app/src/wifi.c @@ -0,0 +1,209 @@ +/* + * (C) Copyright 2025, SECO Mind Srl + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "wifi.h" + +#include +#include +#include +#include + +#include +LOG_MODULE_REGISTER(wifi, CONFIG_APP_LOG_LEVEL); // NOLINT + +#include "sample_config.h" + +/************************************************ + * Defines, constants and typedef * + ***********************************************/ + +#define WIFI_SHELL_MGMT_EVENTS (NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT) + +static struct net_mgmt_event_callback wifi_shell_mgmt_cb; +static struct net_mgmt_event_callback ipv4_cb; + +static K_SEM_DEFINE(wifi_connected, 0, 1); +static K_SEM_DEFINE(ipv4_address_obtained, 0, 1); + +/************************************************ + * Callbacks declaration/definition * + ***********************************************/ + +static void wifi_mgmt_event_handler( + struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface) +{ + const struct wifi_status *status = (const struct wifi_status *) event_cb->info; + switch (mgmt_event) { + case NET_EVENT_WIFI_CONNECT_RESULT: + if (status->status) { + LOG_DBG("WiFi connection request failed (%d)", status->status); + k_sem_take(&wifi_connected, K_NO_WAIT); + } else { + LOG_DBG("WiFi connected"); + k_sem_give(&wifi_connected); + } + break; + case NET_EVENT_WIFI_DISCONNECT_RESULT: + k_sem_take(&wifi_connected, K_NO_WAIT); + if (status->status) { + LOG_DBG("WiFi disconnection error, status: (%d)", status->status); + } else { + LOG_DBG("WiFi disconnected"); + } + break; + default: + break; + } +} + +static void ipv4_mgmt_event_handler( + struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface) +{ + (void) event_cb; + (void) iface; + + switch (mgmt_event) { + + case NET_EVENT_IPV4_ADDR_ADD: + LOG_DBG("Network event: NET_EVENT_IPV4_ADDR_ADD."); // NOLINT + k_sem_give(&ipv4_address_obtained); + break; + + case NET_EVENT_IPV4_ADDR_DEL: + LOG_DBG("Network event: NET_EVENT_IPV4_ADDR_DEL."); // NOLINT + k_sem_take(&ipv4_address_obtained, K_NO_WAIT); + break; + + default: + break; + } +} + +static int cmd_update_credentials(const struct shell *sh, size_t argc, char **argv) +{ + char ssid[SAMPLE_CONFIG_WIFI_MAX_STRINGS] = { 0 }; + char pwd[SAMPLE_CONFIG_WIFI_MAX_STRINGS] = { 0 }; + int snprintf_rc; + int opt; + int opt_index = 0; + struct getopt_state *state; + static const struct option long_options[] = { { "ssid", required_argument, 0, 's' }, + { "passphrase", required_argument, 0, 'p' }, { 0, 0, 0, 0 } }; + + while ((opt = getopt_long(argc, argv, "s:p:", long_options, &opt_index)) != -1) { + state = getopt_state_get(); + switch (opt) { + case 's': + snprintf_rc = snprintf(ssid, ARRAY_SIZE(ssid), "%s", state->optarg); + if ((snprintf_rc < 0) || (snprintf_rc >= ARRAY_SIZE(ssid))) { + LOG_ERR("Error copying the SSID parameter."); + return -1; + } + break; + case 'p': + snprintf_rc = snprintf(pwd, ARRAY_SIZE(pwd), "%s", state->optarg); + if ((snprintf_rc < 0) || (snprintf_rc >= ARRAY_SIZE(pwd))) { + LOG_ERR("Error copying the passkey parameter."); + return -1; + } + break; + case '?': + default: + break; + } + } + + int rc = sample_config_update_wifi_creds(ssid, pwd); + if (rc != 0) { + shell_print(sh, "Failed updating WiFi credentials."); + } + shell_print(sh, "WiFi credentials updated."); + shell_print(sh, "Please reboot the board for the changes to take effect."); + return 0; +} + +static int cmd_show_ssid(const struct shell *sh, size_t argc, char **argv) +{ + ARG_UNUSED(argc); + ARG_UNUSED(argv); + + char ssid[SAMPLE_CONFIG_WIFI_MAX_STRINGS] = { 0 }; + int rc = sample_config_get_wifi_ssid(ssid); + if (rc != 0) { + shell_print(sh, "Failed getting WiFi SSID."); + } else { + shell_print(sh, "%s", ssid); + } + return 0; +} + +SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, + SHELL_CMD_ARG(update - credentials, NULL, + " Update WiFi credentials in Fash:\n" + "-s --ssid=\n" + "-p --passphrase= (valid only for secure SSIDs)\n", + cmd_update_credentials, 5, 0), + SHELL_CMD(show - ssid, NULL, "Show used WiFi SSID.", cmd_show_ssid), SHELL_SUBCMD_SET_END); + +SHELL_CMD_REGISTER(wifi, &wifi_commands, "WiFi commands", NULL); + +/************************************************ + * Global functions definitions * + ***********************************************/ + +void app_wifi_init(void) +{ + net_mgmt_init_event_callback( + &wifi_shell_mgmt_cb, wifi_mgmt_event_handler, WIFI_SHELL_MGMT_EVENTS); + net_mgmt_init_event_callback( + &ipv4_cb, ipv4_mgmt_event_handler, NET_EVENT_IPV4_ADDR_ADD | NET_EVENT_IPV4_ADDR_DEL); + + net_mgmt_add_event_callback(&wifi_shell_mgmt_cb); + net_mgmt_add_event_callback(&ipv4_cb); +} + +int app_wifi_connect(const char *ssid, enum wifi_security_type sec, const char *psk) +{ + LOG_INF("Connecting through wifi..."); // NOLINT + + struct net_if *iface = net_if_get_wifi_sta(); + struct wifi_connect_req_params cnx_params = { 0 }; + int ret; + + cnx_params.band = WIFI_FREQ_BAND_UNKNOWN; + cnx_params.channel = WIFI_CHANNEL_ANY; + cnx_params.security = WIFI_SECURITY_TYPE_NONE; + cnx_params.mfp = WIFI_MFP_OPTIONAL; + + cnx_params.ssid = ssid; + cnx_params.ssid_length = strlen(cnx_params.ssid); + cnx_params.security = sec; + cnx_params.psk = psk; + cnx_params.psk_length = strlen(cnx_params.psk); + + ret = net_mgmt( + NET_REQUEST_WIFI_CONNECT, iface, &cnx_params, sizeof(struct wifi_connect_req_params)); + if (ret) { + LOG_ERR("Connection request failed with error: %d", ret); + return -ENOEXEC; + } + + LOG_INF("Waiting for WiFi to be connected."); + while (k_sem_count_get(&wifi_connected) == 0) { + k_sleep(K_MSEC(200)); + } + + net_dhcpv4_start(iface); + + LOG_INF("Waiting for an IPv4 address (DHCP)."); // NOLINT + while (k_sem_count_get(&ipv4_address_obtained) == 0) { + k_sleep(K_MSEC(200)); + } + + LOG_INF("WiFi ready..."); // NOLINT + + return 0; +} diff --git a/app/sysbuild/boards/frdm_rw612.conf b/app/sysbuild/boards/frdm_rw612.conf new file mode 100644 index 0000000..84173e7 --- /dev/null +++ b/app/sysbuild/boards/frdm_rw612.conf @@ -0,0 +1,9 @@ +# (C) Copyright 2025, SECO Mind Srl +# +# SPDX-License-Identifier: Apache-2.0 + +# Enable the WiFi +CONFIG_WIFI_NXP=y + +# Use a large log buffer size +CONFIG_LOG_BUFFER_SIZE=32768 diff --git a/app/sysbuild/boards/frdm_rw612.overlay b/app/sysbuild/boards/frdm_rw612.overlay new file mode 100644 index 0000000..2ebefdf --- /dev/null +++ b/app/sysbuild/boards/frdm_rw612.overlay @@ -0,0 +1,13 @@ +/* + * (C) Copyright 2025, SECO Mind Srl + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "../../boards/frdm_rw612.overlay" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/portal/ambient_temp/CORS b/portal/ambient_temp/CORS new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/portal/ambient_temp/CORS @@ -0,0 +1 @@ +* diff --git a/portal/ambient_temp/app.js b/portal/ambient_temp/app.js new file mode 100644 index 0000000..9f0abc4 --- /dev/null +++ b/portal/ambient_temp/app.js @@ -0,0 +1,20966 @@ +var Rp = Object.defineProperty; +var Ip = (l, f, m) => f in l ? Rp(l, f, { enumerable: !0, configurable: !0, writable: !0, value: m }) : l[f] = m; +var la = (l, f, m) => Ip(l, typeof f != "symbol" ? f + "" : f, m); +function zd(l) { + return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l; +} +var zl = { exports: {} }, ca = {}, Hl = { exports: {} }, Ye = {}; +/** + * @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 jh; +function Mp() { + if (jh) return Ye; + jh = 1; + var l = Symbol.for("react.element"), f = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), M = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), j = Symbol.for("react.memo"), G = Symbol.for("react.lazy"), Q = Symbol.iterator; + function re(Z) { + return Z === null || typeof Z != "object" ? null : (Z = Q && Z[Q] || Z["@@iterator"], typeof Z == "function" ? Z : null); + } + var pe = { isMounted: function() { + return !1; + }, enqueueForceUpdate: function() { + }, enqueueReplaceState: function() { + }, enqueueSetState: function() { + } }, se = Object.assign, ce = {}; + function ee(Z, ue, Fe) { + this.props = Z, this.context = ue, this.refs = ce, this.updater = Fe || pe; + } + ee.prototype.isReactComponent = {}, ee.prototype.setState = function(Z, ue) { + if (typeof Z != "object" && typeof Z != "function" && Z != 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, Z, ue, "setState"); + }, ee.prototype.forceUpdate = function(Z) { + this.updater.enqueueForceUpdate(this, Z, "forceUpdate"); + }; + function le() { + } + le.prototype = ee.prototype; + function B(Z, ue, Fe) { + this.props = Z, this.context = ue, this.refs = ce, this.updater = Fe || pe; + } + var me = B.prototype = new le(); + me.constructor = B, se(me, ee.prototype), me.isPureReactComponent = !0; + var ye = Array.isArray, W = Object.prototype.hasOwnProperty, ke = { current: null }, De = { key: !0, ref: !0, __self: !0, __source: !0 }; + function tt(Z, ue, Fe) { + var Be, Xe = {}, ze = null, Je = null; + if (ue != null) for (Be in ue.ref !== void 0 && (Je = ue.ref), ue.key !== void 0 && (ze = "" + ue.key), ue) W.call(ue, Be) && !De.hasOwnProperty(Be) && (Xe[Be] = ue[Be]); + var We = arguments.length - 2; + if (We === 1) Xe.children = Fe; + else if (1 < We) { + for (var Ke = Array(We), vt = 0; vt < We; vt++) Ke[vt] = arguments[vt + 2]; + Xe.children = Ke; + } + if (Z && Z.defaultProps) for (Be in We = Z.defaultProps, We) Xe[Be] === void 0 && (Xe[Be] = We[Be]); + return { $$typeof: l, type: Z, key: ze, ref: Je, props: Xe, _owner: ke.current }; + } + function Et(Z, ue) { + return { $$typeof: l, type: Z.type, key: ue, ref: Z.ref, props: Z.props, _owner: Z._owner }; + } + function fi(Z) { + return typeof Z == "object" && Z !== null && Z.$$typeof === l; + } + function Si(Z) { + var ue = { "=": "=0", ":": "=2" }; + return "$" + Z.replace(/[=:]/g, function(Fe) { + return ue[Fe]; + }); + } + var wt = /\/+/g; + function Dt(Z, ue) { + return typeof Z == "object" && Z !== null && Z.key != null ? Si("" + Z.key) : ue.toString(36); + } + function Qe(Z, ue, Fe, Be, Xe) { + var ze = typeof Z; + (ze === "undefined" || ze === "boolean") && (Z = null); + var Je = !1; + if (Z === null) Je = !0; + else switch (ze) { + case "string": + case "number": + Je = !0; + break; + case "object": + switch (Z.$$typeof) { + case l: + case f: + Je = !0; + } + } + if (Je) return Je = Z, Xe = Xe(Je), Z = Be === "" ? "." + Dt(Je, 0) : Be, ye(Xe) ? (Fe = "", Z != null && (Fe = Z.replace(wt, "$&/") + "/"), Qe(Xe, ue, Fe, "", function(vt) { + return vt; + })) : Xe != null && (fi(Xe) && (Xe = Et(Xe, Fe + (!Xe.key || Je && Je.key === Xe.key ? "" : ("" + Xe.key).replace(wt, "$&/") + "/") + Z)), ue.push(Xe)), 1; + if (Je = 0, Be = Be === "" ? "." : Be + ":", ye(Z)) for (var We = 0; We < Z.length; We++) { + ze = Z[We]; + var Ke = Be + Dt(ze, We); + Je += Qe(ze, ue, Fe, Ke, Xe); + } + else if (Ke = re(Z), typeof Ke == "function") for (Z = Ke.call(Z), We = 0; !(ze = Z.next()).done; ) ze = ze.value, Ke = Be + Dt(ze, We++), Je += Qe(ze, ue, Fe, Ke, Xe); + else if (ze === "object") throw ue = String(Z), Error("Objects are not valid as a React child (found: " + (ue === "[object Object]" ? "object with keys {" + Object.keys(Z).join(", ") + "}" : ue) + "). If you meant to render a collection of children, use an array instead."); + return Je; + } + function Lt(Z, ue, Fe) { + if (Z == null) return Z; + var Be = [], Xe = 0; + return Qe(Z, Be, "", "", function(ze) { + return ue.call(Fe, ze, Xe++); + }), Be; + } + function St(Z) { + if (Z._status === -1) { + var ue = Z._result; + ue = ue(), ue.then(function(Fe) { + (Z._status === 0 || Z._status === -1) && (Z._status = 1, Z._result = Fe); + }, function(Fe) { + (Z._status === 0 || Z._status === -1) && (Z._status = 2, Z._result = Fe); + }), Z._status === -1 && (Z._status = 0, Z._result = ue); + } + if (Z._status === 1) return Z._result.default; + throw Z._result; + } + var it = { current: null }, ve = { transition: null }, Le = { ReactCurrentDispatcher: it, ReactCurrentBatchConfig: ve, ReactCurrentOwner: ke }; + function Se() { + throw Error("act(...) is not supported in production builds of React."); + } + return Ye.Children = { map: Lt, forEach: function(Z, ue, Fe) { + Lt(Z, function() { + ue.apply(this, arguments); + }, Fe); + }, count: function(Z) { + var ue = 0; + return Lt(Z, function() { + ue++; + }), ue; + }, toArray: function(Z) { + return Lt(Z, function(ue) { + return ue; + }) || []; + }, only: function(Z) { + if (!fi(Z)) throw Error("React.Children.only expected to receive a single React element child."); + return Z; + } }, Ye.Component = ee, Ye.Fragment = m, Ye.Profiler = C, Ye.PureComponent = B, Ye.StrictMode = v, Ye.Suspense = X, Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Le, Ye.act = Se, Ye.cloneElement = function(Z, ue, Fe) { + if (Z == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + Z + "."); + var Be = se({}, Z.props), Xe = Z.key, ze = Z.ref, Je = Z._owner; + if (ue != null) { + if (ue.ref !== void 0 && (ze = ue.ref, Je = ke.current), ue.key !== void 0 && (Xe = "" + ue.key), Z.type && Z.type.defaultProps) var We = Z.type.defaultProps; + for (Ke in ue) W.call(ue, Ke) && !De.hasOwnProperty(Ke) && (Be[Ke] = ue[Ke] === void 0 && We !== void 0 ? We[Ke] : ue[Ke]); + } + var Ke = arguments.length - 2; + if (Ke === 1) Be.children = Fe; + else if (1 < Ke) { + We = Array(Ke); + for (var vt = 0; vt < Ke; vt++) We[vt] = arguments[vt + 2]; + Be.children = We; + } + return { $$typeof: l, type: Z.type, key: Xe, ref: ze, props: Be, _owner: Je }; + }, Ye.createContext = function(Z) { + return Z = { $$typeof: M, _currentValue: Z, _currentValue2: Z, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, Z.Provider = { $$typeof: P, _context: Z }, Z.Consumer = Z; + }, Ye.createElement = tt, Ye.createFactory = function(Z) { + var ue = tt.bind(null, Z); + return ue.type = Z, ue; + }, Ye.createRef = function() { + return { current: null }; + }, Ye.forwardRef = function(Z) { + return { $$typeof: O, render: Z }; + }, Ye.isValidElement = fi, Ye.lazy = function(Z) { + return { $$typeof: G, _payload: { _status: -1, _result: Z }, _init: St }; + }, Ye.memo = function(Z, ue) { + return { $$typeof: j, type: Z, compare: ue === void 0 ? null : ue }; + }, Ye.startTransition = function(Z) { + var ue = ve.transition; + ve.transition = {}; + try { + Z(); + } finally { + ve.transition = ue; + } + }, Ye.unstable_act = Se, Ye.useCallback = function(Z, ue) { + return it.current.useCallback(Z, ue); + }, Ye.useContext = function(Z) { + return it.current.useContext(Z); + }, Ye.useDebugValue = function() { + }, Ye.useDeferredValue = function(Z) { + return it.current.useDeferredValue(Z); + }, Ye.useEffect = function(Z, ue) { + return it.current.useEffect(Z, ue); + }, Ye.useId = function() { + return it.current.useId(); + }, Ye.useImperativeHandle = function(Z, ue, Fe) { + return it.current.useImperativeHandle(Z, ue, Fe); + }, Ye.useInsertionEffect = function(Z, ue) { + return it.current.useInsertionEffect(Z, ue); + }, Ye.useLayoutEffect = function(Z, ue) { + return it.current.useLayoutEffect(Z, ue); + }, Ye.useMemo = function(Z, ue) { + return it.current.useMemo(Z, ue); + }, Ye.useReducer = function(Z, ue, Fe) { + return it.current.useReducer(Z, ue, Fe); + }, Ye.useRef = function(Z) { + return it.current.useRef(Z); + }, Ye.useState = function(Z) { + return it.current.useState(Z); + }, Ye.useSyncExternalStore = function(Z, ue, Fe) { + return it.current.useSyncExternalStore(Z, ue, Fe); + }, Ye.useTransition = function() { + return it.current.useTransition(); + }, Ye.version = "18.3.1", Ye; +} +var Gh; +function $s() { + return Gh || (Gh = 1, Hl.exports = Mp()), Hl.exports; +} +/** + * @license React + * react-jsx-runtime.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 Vh; +function Np() { + if (Vh) return ca; + Vh = 1; + var l = $s(), f = Symbol.for("react.element"), m = Symbol.for("react.fragment"), v = Object.prototype.hasOwnProperty, C = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 }; + function M(O, X, j) { + var G, Q = {}, re = null, pe = null; + j !== void 0 && (re = "" + j), X.key !== void 0 && (re = "" + X.key), X.ref !== void 0 && (pe = X.ref); + for (G in X) v.call(X, G) && !P.hasOwnProperty(G) && (Q[G] = X[G]); + if (O && O.defaultProps) for (G in X = O.defaultProps, X) Q[G] === void 0 && (Q[G] = X[G]); + return { $$typeof: f, type: O, key: re, ref: pe, props: Q, _owner: C.current }; + } + return ca.Fragment = m, ca.jsx = M, ca.jsxs = M, ca; +} +var Uh; +function Op() { + return Uh || (Uh = 1, zl.exports = Np()), zl.exports; +} +var je = Op(), Oe = $s(), Dl = { exports: {} }; +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +var $h; +function Fp() { + return $h || ($h = 1, function(l) { + (function() { + var f = {}.hasOwnProperty; + function m() { + for (var P = "", M = 0; M < arguments.length; M++) { + var O = arguments[M]; + O && (P = C(P, v(O))); + } + return P; + } + function v(P) { + if (typeof P == "string" || typeof P == "number") + return P; + if (typeof P != "object") + return ""; + if (Array.isArray(P)) + return m.apply(null, P); + if (P.toString !== Object.prototype.toString && !P.toString.toString().includes("[native code]")) + return P.toString(); + var M = ""; + for (var O in P) + f.call(P, O) && P[O] && (M = C(M, O)); + return M; + } + function C(P, M) { + return M ? P ? P + " " + M : P + M : P; + } + l.exports ? (m.default = m, l.exports = m) : window.classNames = m; + })(); + }(Dl)), Dl.exports; +} +var zp = Fp(); +const Ht = /* @__PURE__ */ zd(zp), Hp = ["xxl", "xl", "lg", "md", "sm", "xs"], Dp = "xs", qs = /* @__PURE__ */ Oe.createContext({ + prefixes: {}, + breakpoints: Hp, + minBreakpoint: Dp +}), { + Consumer: My, + Provider: Ny +} = qs; +function qt(l, f) { + const { + prefixes: m + } = Oe.useContext(qs); + return l || m[f] || f; +} +function Hd() { + const { + breakpoints: l + } = Oe.useContext(qs); + return l; +} +function Dd() { + const { + minBreakpoint: l + } = Oe.useContext(qs); + return l; +} +var _l = { exports: {} }, Bl, qh; +function _p() { + if (qh) return Bl; + qh = 1; + var l = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; + return Bl = l, Bl; +} +var Xl, Zh; +function Bp() { + if (Zh) return Xl; + Zh = 1; + var l = /* @__PURE__ */ _p(); + function f() { + } + function m() { + } + return m.resetWarningCache = f, Xl = function() { + function v(M, O, X, j, G, Q) { + if (Q !== l) { + var re = new Error( + "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" + ); + throw re.name = "Invariant Violation", re; + } + } + v.isRequired = v; + function C() { + return v; + } + var P = { + array: v, + bigint: v, + bool: v, + func: v, + number: v, + object: v, + string: v, + symbol: v, + any: v, + arrayOf: C, + element: v, + elementType: v, + instanceOf: C, + node: v, + objectOf: C, + oneOf: C, + oneOfType: C, + shape: C, + exact: C, + checkPropTypes: m, + resetWarningCache: f + }; + return P.PropTypes = P, P; + }, Xl; +} +var Qh; +function Xp() { + return Qh || (Qh = 1, _l.exports = /* @__PURE__ */ Bp()()), _l.exports; +} +var Yl = { exports: {} }, Ut = {}, Wl = { exports: {} }, jl = {}; +/** + * @license React + * scheduler.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 Jh; +function Yp() { + return Jh || (Jh = 1, function(l) { + function f(ve, Le) { + var Se = ve.length; + ve.push(Le); + e: for (; 0 < Se; ) { + var Z = Se - 1 >>> 1, ue = ve[Z]; + if (0 < C(ue, Le)) ve[Z] = Le, ve[Se] = ue, Se = Z; + else break e; + } + } + function m(ve) { + return ve.length === 0 ? null : ve[0]; + } + function v(ve) { + if (ve.length === 0) return null; + var Le = ve[0], Se = ve.pop(); + if (Se !== Le) { + ve[0] = Se; + e: for (var Z = 0, ue = ve.length, Fe = ue >>> 1; Z < Fe; ) { + var Be = 2 * (Z + 1) - 1, Xe = ve[Be], ze = Be + 1, Je = ve[ze]; + if (0 > C(Xe, Se)) ze < ue && 0 > C(Je, Xe) ? (ve[Z] = Je, ve[ze] = Se, Z = ze) : (ve[Z] = Xe, ve[Be] = Se, Z = Be); + else if (ze < ue && 0 > C(Je, Se)) ve[Z] = Je, ve[ze] = Se, Z = ze; + else break e; + } + } + return Le; + } + function C(ve, Le) { + var Se = ve.sortIndex - Le.sortIndex; + return Se !== 0 ? Se : ve.id - Le.id; + } + if (typeof performance == "object" && typeof performance.now == "function") { + var P = performance; + l.unstable_now = function() { + return P.now(); + }; + } else { + var M = Date, O = M.now(); + l.unstable_now = function() { + return M.now() - O; + }; + } + var X = [], j = [], G = 1, Q = null, re = 3, pe = !1, se = !1, ce = !1, ee = typeof setTimeout == "function" ? setTimeout : null, le = typeof clearTimeout == "function" ? clearTimeout : null, B = typeof setImmediate < "u" ? setImmediate : null; + typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); + function me(ve) { + for (var Le = m(j); Le !== null; ) { + if (Le.callback === null) v(j); + else if (Le.startTime <= ve) v(j), Le.sortIndex = Le.expirationTime, f(X, Le); + else break; + Le = m(j); + } + } + function ye(ve) { + if (ce = !1, me(ve), !se) if (m(X) !== null) se = !0, St(W); + else { + var Le = m(j); + Le !== null && it(ye, Le.startTime - ve); + } + } + function W(ve, Le) { + se = !1, ce && (ce = !1, le(tt), tt = -1), pe = !0; + var Se = re; + try { + for (me(Le), Q = m(X); Q !== null && (!(Q.expirationTime > Le) || ve && !Si()); ) { + var Z = Q.callback; + if (typeof Z == "function") { + Q.callback = null, re = Q.priorityLevel; + var ue = Z(Q.expirationTime <= Le); + Le = l.unstable_now(), typeof ue == "function" ? Q.callback = ue : Q === m(X) && v(X), me(Le); + } else v(X); + Q = m(X); + } + if (Q !== null) var Fe = !0; + else { + var Be = m(j); + Be !== null && it(ye, Be.startTime - Le), Fe = !1; + } + return Fe; + } finally { + Q = null, re = Se, pe = !1; + } + } + var ke = !1, De = null, tt = -1, Et = 5, fi = -1; + function Si() { + return !(l.unstable_now() - fi < Et); + } + function wt() { + if (De !== null) { + var ve = l.unstable_now(); + fi = ve; + var Le = !0; + try { + Le = De(!0, ve); + } finally { + Le ? Dt() : (ke = !1, De = null); + } + } else ke = !1; + } + var Dt; + if (typeof B == "function") Dt = function() { + B(wt); + }; + else if (typeof MessageChannel < "u") { + var Qe = new MessageChannel(), Lt = Qe.port2; + Qe.port1.onmessage = wt, Dt = function() { + Lt.postMessage(null); + }; + } else Dt = function() { + ee(wt, 0); + }; + function St(ve) { + De = ve, ke || (ke = !0, Dt()); + } + function it(ve, Le) { + tt = ee(function() { + ve(l.unstable_now()); + }, Le); + } + l.unstable_IdlePriority = 5, l.unstable_ImmediatePriority = 1, l.unstable_LowPriority = 4, l.unstable_NormalPriority = 3, l.unstable_Profiling = null, l.unstable_UserBlockingPriority = 2, l.unstable_cancelCallback = function(ve) { + ve.callback = null; + }, l.unstable_continueExecution = function() { + se || pe || (se = !0, St(W)); + }, l.unstable_forceFrameRate = function(ve) { + 0 > ve || 125 < ve ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : Et = 0 < ve ? Math.floor(1e3 / ve) : 5; + }, l.unstable_getCurrentPriorityLevel = function() { + return re; + }, l.unstable_getFirstCallbackNode = function() { + return m(X); + }, l.unstable_next = function(ve) { + switch (re) { + case 1: + case 2: + case 3: + var Le = 3; + break; + default: + Le = re; + } + var Se = re; + re = Le; + try { + return ve(); + } finally { + re = Se; + } + }, l.unstable_pauseExecution = function() { + }, l.unstable_requestPaint = function() { + }, l.unstable_runWithPriority = function(ve, Le) { + switch (ve) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + ve = 3; + } + var Se = re; + re = ve; + try { + return Le(); + } finally { + re = Se; + } + }, l.unstable_scheduleCallback = function(ve, Le, Se) { + var Z = l.unstable_now(); + switch (typeof Se == "object" && Se !== null ? (Se = Se.delay, Se = typeof Se == "number" && 0 < Se ? Z + Se : Z) : Se = Z, ve) { + case 1: + var ue = -1; + break; + case 2: + ue = 250; + break; + case 5: + ue = 1073741823; + break; + case 4: + ue = 1e4; + break; + default: + ue = 5e3; + } + return ue = Se + ue, ve = { id: G++, callback: Le, priorityLevel: ve, startTime: Se, expirationTime: ue, sortIndex: -1 }, Se > Z ? (ve.sortIndex = Se, f(j, ve), m(X) === null && ve === m(j) && (ce ? (le(tt), tt = -1) : ce = !0, it(ye, Se - Z))) : (ve.sortIndex = ue, f(X, ve), se || pe || (se = !0, St(W))), ve; + }, l.unstable_shouldYield = Si, l.unstable_wrapCallback = function(ve) { + var Le = re; + return function() { + var Se = re; + re = Le; + try { + return ve.apply(this, arguments); + } finally { + re = Se; + } + }; + }; + }(jl)), jl; +} +var Kh; +function Wp() { + return Kh || (Kh = 1, Wl.exports = Yp()), Wl.exports; +} +/** + * @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 ed; +function jp() { + if (ed) return Ut; + ed = 1; + var l = $s(), f = Wp(); + function m(r) { + for (var a = "https://reactjs.org/docs/error-decoder.html?invariant=" + r, u = 1; u < arguments.length; u++) a += "&args[]=" + encodeURIComponent(arguments[u]); + return "Minified React error #" + r + "; visit " + a + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; + } + var v = /* @__PURE__ */ new Set(), C = {}; + function P(r, a) { + M(r, a), M(r + "Capture", a); + } + function M(r, a) { + for (C[r] = a, r = 0; r < a.length; r++) v.add(a[r]); + } + var O = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), X = Object.prototype.hasOwnProperty, j = /^[: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]*$/, G = {}, Q = {}; + function re(r) { + return X.call(Q, r) ? !0 : X.call(G, r) ? !1 : j.test(r) ? Q[r] = !0 : (G[r] = !0, !1); + } + function pe(r, a, u, p) { + if (u !== null && u.type === 0) return !1; + switch (typeof a) { + case "function": + case "symbol": + return !0; + case "boolean": + return p ? !1 : u !== null ? !u.acceptsBooleans : (r = r.toLowerCase().slice(0, 5), r !== "data-" && r !== "aria-"); + default: + return !1; + } + } + function se(r, a, u, p) { + if (a === null || typeof a > "u" || pe(r, a, u, p)) return !0; + if (p) return !1; + if (u !== null) switch (u.type) { + case 3: + return !a; + case 4: + return a === !1; + case 5: + return isNaN(a); + case 6: + return isNaN(a) || 1 > a; + } + return !1; + } + function ce(r, a, u, p, S, E, z) { + this.acceptsBooleans = a === 2 || a === 3 || a === 4, this.attributeName = p, this.attributeNamespace = S, this.mustUseProperty = u, this.propertyName = r, this.type = a, this.sanitizeURL = E, this.removeEmptyString = z; + } + var ee = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r) { + ee[r] = new ce(r, 0, !1, r, null, !1, !1); + }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(r) { + var a = r[0]; + ee[a] = new ce(a, 1, !1, r[1], null, !1, !1); + }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(r) { + ee[r] = new ce(r, 2, !1, r.toLowerCase(), null, !1, !1); + }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(r) { + ee[r] = new ce(r, 2, !1, r, 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(r) { + ee[r] = new ce(r, 3, !1, r.toLowerCase(), null, !1, !1); + }), ["checked", "multiple", "muted", "selected"].forEach(function(r) { + ee[r] = new ce(r, 3, !0, r, null, !1, !1); + }), ["capture", "download"].forEach(function(r) { + ee[r] = new ce(r, 4, !1, r, null, !1, !1); + }), ["cols", "rows", "size", "span"].forEach(function(r) { + ee[r] = new ce(r, 6, !1, r, null, !1, !1); + }), ["rowSpan", "start"].forEach(function(r) { + ee[r] = new ce(r, 5, !1, r.toLowerCase(), null, !1, !1); + }); + var le = /[\-:]([a-z])/g; + function B(r) { + return r[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(r) { + var a = r.replace( + le, + B + ); + ee[a] = new ce(a, 1, !1, r, null, !1, !1); + }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r) { + var a = r.replace(le, B); + ee[a] = new ce(a, 1, !1, r, "http://www.w3.org/1999/xlink", !1, !1); + }), ["xml:base", "xml:lang", "xml:space"].forEach(function(r) { + var a = r.replace(le, B); + ee[a] = new ce(a, 1, !1, r, "http://www.w3.org/XML/1998/namespace", !1, !1); + }), ["tabIndex", "crossOrigin"].forEach(function(r) { + ee[r] = new ce(r, 1, !1, r.toLowerCase(), null, !1, !1); + }), ee.xlinkHref = new ce("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(r) { + ee[r] = new ce(r, 1, !1, r.toLowerCase(), null, !0, !0); + }); + function me(r, a, u, p) { + var S = ee.hasOwnProperty(a) ? ee[a] : null; + (S !== null ? S.type !== 0 : p || !(2 < a.length) || a[0] !== "o" && a[0] !== "O" || a[1] !== "n" && a[1] !== "N") && (se(a, u, S, p) && (u = null), p || S === null ? re(a) && (u === null ? r.removeAttribute(a) : r.setAttribute(a, "" + u)) : S.mustUseProperty ? r[S.propertyName] = u === null ? S.type === 3 ? !1 : "" : u : (a = S.attributeName, p = S.attributeNamespace, u === null ? r.removeAttribute(a) : (S = S.type, u = S === 3 || S === 4 && u === !0 ? "" : "" + u, p ? r.setAttributeNS(p, a, u) : r.setAttribute(a, u)))); + } + var ye = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, W = Symbol.for("react.element"), ke = Symbol.for("react.portal"), De = Symbol.for("react.fragment"), tt = Symbol.for("react.strict_mode"), Et = Symbol.for("react.profiler"), fi = Symbol.for("react.provider"), Si = Symbol.for("react.context"), wt = Symbol.for("react.forward_ref"), Dt = Symbol.for("react.suspense"), Qe = Symbol.for("react.suspense_list"), Lt = Symbol.for("react.memo"), St = Symbol.for("react.lazy"), it = Symbol.for("react.offscreen"), ve = Symbol.iterator; + function Le(r) { + return r === null || typeof r != "object" ? null : (r = ve && r[ve] || r["@@iterator"], typeof r == "function" ? r : null); + } + var Se = Object.assign, Z; + function ue(r) { + if (Z === void 0) try { + throw Error(); + } catch (u) { + var a = u.stack.trim().match(/\n( *(at )?)/); + Z = a && a[1] || ""; + } + return ` +` + Z + r; + } + var Fe = !1; + function Be(r, a) { + if (!r || Fe) return ""; + Fe = !0; + var u = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + if (a) if (a = function() { + throw Error(); + }, Object.defineProperty(a.prototype, "props", { set: function() { + throw Error(); + } }), typeof Reflect == "object" && Reflect.construct) { + try { + Reflect.construct(a, []); + } catch (ie) { + var p = ie; + } + Reflect.construct(r, [], a); + } else { + try { + a.call(); + } catch (ie) { + p = ie; + } + r.call(a.prototype); + } + else { + try { + throw Error(); + } catch (ie) { + p = ie; + } + r(); + } + } catch (ie) { + if (ie && p && typeof ie.stack == "string") { + for (var S = ie.stack.split(` +`), E = p.stack.split(` +`), z = S.length - 1, Y = E.length - 1; 1 <= z && 0 <= Y && S[z] !== E[Y]; ) Y--; + for (; 1 <= z && 0 <= Y; z--, Y--) if (S[z] !== E[Y]) { + if (z !== 1 || Y !== 1) + do + if (z--, Y--, 0 > Y || S[z] !== E[Y]) { + var $ = ` +` + S[z].replace(" at new ", " at "); + return r.displayName && $.includes("") && ($ = $.replace("", r.displayName)), $; + } + while (1 <= z && 0 <= Y); + break; + } + } + } finally { + Fe = !1, Error.prepareStackTrace = u; + } + return (r = r ? r.displayName || r.name : "") ? ue(r) : ""; + } + function Xe(r) { + switch (r.tag) { + case 5: + return ue(r.type); + case 16: + return ue("Lazy"); + case 13: + return ue("Suspense"); + case 19: + return ue("SuspenseList"); + case 0: + case 2: + case 15: + return r = Be(r.type, !1), r; + case 11: + return r = Be(r.type.render, !1), r; + case 1: + return r = Be(r.type, !0), r; + default: + return ""; + } + } + function ze(r) { + if (r == null) return null; + if (typeof r == "function") return r.displayName || r.name || null; + if (typeof r == "string") return r; + switch (r) { + case De: + return "Fragment"; + case ke: + return "Portal"; + case Et: + return "Profiler"; + case tt: + return "StrictMode"; + case Dt: + return "Suspense"; + case Qe: + return "SuspenseList"; + } + if (typeof r == "object") switch (r.$$typeof) { + case Si: + return (r.displayName || "Context") + ".Consumer"; + case fi: + return (r._context.displayName || "Context") + ".Provider"; + case wt: + var a = r.render; + return r = r.displayName, r || (r = a.displayName || a.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r; + case Lt: + return a = r.displayName || null, a !== null ? a : ze(r.type) || "Memo"; + case St: + a = r._payload, r = r._init; + try { + return ze(r(a)); + } catch { + } + } + return null; + } + function Je(r) { + var a = r.type; + switch (r.tag) { + case 24: + return "Cache"; + case 9: + return (a.displayName || "Context") + ".Consumer"; + case 10: + return (a._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return r = a.render, r = r.displayName || r.name || "", a.displayName || (r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return a; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return ze(a); + case 8: + return a === tt ? "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 a == "function") return a.displayName || a.name || null; + if (typeof a == "string") return a; + } + return null; + } + function We(r) { + switch (typeof r) { + case "boolean": + case "number": + case "string": + case "undefined": + return r; + case "object": + return r; + default: + return ""; + } + } + function Ke(r) { + var a = r.type; + return (r = r.nodeName) && r.toLowerCase() === "input" && (a === "checkbox" || a === "radio"); + } + function vt(r) { + var a = Ke(r) ? "checked" : "value", u = Object.getOwnPropertyDescriptor(r.constructor.prototype, a), p = "" + r[a]; + if (!r.hasOwnProperty(a) && typeof u < "u" && typeof u.get == "function" && typeof u.set == "function") { + var S = u.get, E = u.set; + return Object.defineProperty(r, a, { configurable: !0, get: function() { + return S.call(this); + }, set: function(z) { + p = "" + z, E.call(this, z); + } }), Object.defineProperty(r, a, { enumerable: u.enumerable }), { getValue: function() { + return p; + }, setValue: function(z) { + p = "" + z; + }, stopTracking: function() { + r._valueTracker = null, delete r[a]; + } }; + } + } + function mr(r) { + r._valueTracker || (r._valueTracker = vt(r)); + } + function Fi(r) { + if (!r) return !1; + var a = r._valueTracker; + if (!a) return !0; + var u = a.getValue(), p = ""; + return r && (p = Ke(r) ? r.checked ? "true" : "false" : r.value), r = p, r !== u ? (a.setValue(r), !0) : !1; + } + function qi(r) { + if (r = r || (typeof document < "u" ? document : void 0), typeof r > "u") return null; + try { + return r.activeElement || r.body; + } catch { + return r.body; + } + } + function xr(r, a) { + var u = a.checked; + return Se({}, a, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: u ?? r._wrapperState.initialChecked }); + } + function wa(r, a) { + var u = a.defaultValue == null ? "" : a.defaultValue, p = a.checked != null ? a.checked : a.defaultChecked; + u = We(a.value != null ? a.value : u), r._wrapperState = { initialChecked: p, initialValue: u, controlled: a.type === "checkbox" || a.type === "radio" ? a.checked != null : a.value != null }; + } + function Sa(r, a) { + a = a.checked, a != null && me(r, "checked", a, !1); + } + function vn(r, a) { + Sa(r, a); + var u = We(a.value), p = a.type; + if (u != null) p === "number" ? (u === 0 && r.value === "" || r.value != u) && (r.value = "" + u) : r.value !== "" + u && (r.value = "" + u); + else if (p === "submit" || p === "reset") { + r.removeAttribute("value"); + return; + } + a.hasOwnProperty("value") ? yn(r, a.type, u) : a.hasOwnProperty("defaultValue") && yn(r, a.type, We(a.defaultValue)), a.checked == null && a.defaultChecked != null && (r.defaultChecked = !!a.defaultChecked); + } + function Xr(r, a, u) { + if (a.hasOwnProperty("value") || a.hasOwnProperty("defaultValue")) { + var p = a.type; + if (!(p !== "submit" && p !== "reset" || a.value !== void 0 && a.value !== null)) return; + a = "" + r._wrapperState.initialValue, u || a === r.value || (r.value = a), r.defaultValue = a; + } + u = r.name, u !== "" && (r.name = ""), r.defaultChecked = !!r._wrapperState.initialChecked, u !== "" && (r.name = u); + } + function yn(r, a, u) { + (a !== "number" || qi(r.ownerDocument) !== r) && (u == null ? r.defaultValue = "" + r._wrapperState.initialValue : r.defaultValue !== "" + u && (r.defaultValue = "" + u)); + } + var vr = Array.isArray; + function Zi(r, a, u, p) { + if (r = r.options, a) { + a = {}; + for (var S = 0; S < u.length; S++) a["$" + u[S]] = !0; + for (u = 0; u < r.length; u++) S = a.hasOwnProperty("$" + r[u].value), r[u].selected !== S && (r[u].selected = S), S && p && (r[u].defaultSelected = !0); + } else { + for (u = "" + We(u), a = null, S = 0; S < r.length; S++) { + if (r[S].value === u) { + r[S].selected = !0, p && (r[S].defaultSelected = !0); + return; + } + a !== null || r[S].disabled || (a = r[S]); + } + a !== null && (a.selected = !0); + } + } + function bn(r, a) { + if (a.dangerouslySetInnerHTML != null) throw Error(m(91)); + return Se({}, a, { value: void 0, defaultValue: void 0, children: "" + r._wrapperState.initialValue }); + } + function ka(r, a) { + var u = a.value; + if (u == null) { + if (u = a.children, a = a.defaultValue, u != null) { + if (a != null) throw Error(m(92)); + if (vr(u)) { + if (1 < u.length) throw Error(m(93)); + u = u[0]; + } + a = u; + } + a == null && (a = ""), u = a; + } + r._wrapperState = { initialValue: We(u) }; + } + function Ca(r, a) { + var u = We(a.value), p = We(a.defaultValue); + u != null && (u = "" + u, u !== r.value && (r.value = u), a.defaultValue == null && r.defaultValue !== u && (r.defaultValue = u)), p != null && (r.defaultValue = "" + p); + } + function Aa(r) { + var a = r.textContent; + a === r._wrapperState.initialValue && a !== "" && a !== null && (r.value = a); + } + function yr(r) { + switch (r) { + case "svg": + return "http://www.w3.org/2000/svg"; + case "math": + return "http://www.w3.org/1998/Math/MathML"; + default: + return "http://www.w3.org/1999/xhtml"; + } + } + function wn(r, a) { + return r == null || r === "http://www.w3.org/1999/xhtml" ? yr(a) : r === "http://www.w3.org/2000/svg" && a === "foreignObject" ? "http://www.w3.org/1999/xhtml" : r; + } + var br, Sn = function(r) { + return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(a, u, p, S) { + MSApp.execUnsafeLocalFunction(function() { + return r(a, u, p, S); + }); + } : r; + }(function(r, a) { + if (r.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in r) r.innerHTML = a; + else { + for (br = br || document.createElement("div"), br.innerHTML = "" + a.valueOf().toString() + "", a = br.firstChild; r.firstChild; ) r.removeChild(r.firstChild); + for (; a.firstChild; ) r.appendChild(a.firstChild); + } + }); + function wr(r, a) { + if (a) { + var u = r.firstChild; + if (u && u === r.lastChild && u.nodeType === 3) { + u.nodeValue = a; + return; + } + } + r.textContent = a; + } + var Qi = { + 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 + }, io = ["Webkit", "ms", "Moz", "O"]; + Object.keys(Qi).forEach(function(r) { + io.forEach(function(a) { + a = a + r.charAt(0).toUpperCase() + r.substring(1), Qi[a] = Qi[r]; + }); + }); + function kn(r, a, u) { + return a == null || typeof a == "boolean" || a === "" ? "" : u || typeof a != "number" || a === 0 || Qi.hasOwnProperty(r) && Qi[r] ? ("" + a).trim() : a + "px"; + } + function Ea(r, a) { + r = r.style; + for (var u in a) if (a.hasOwnProperty(u)) { + var p = u.indexOf("--") === 0, S = kn(u, a[u], p); + u === "float" && (u = "cssFloat"), p ? r.setProperty(u, S) : r[u] = S; + } + } + var ro = Se({ 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 Cn(r, a) { + if (a) { + if (ro[r] && (a.children != null || a.dangerouslySetInnerHTML != null)) throw Error(m(137, r)); + if (a.dangerouslySetInnerHTML != null) { + if (a.children != null) throw Error(m(60)); + if (typeof a.dangerouslySetInnerHTML != "object" || !("__html" in a.dangerouslySetInnerHTML)) throw Error(m(61)); + } + if (a.style != null && typeof a.style != "object") throw Error(m(62)); + } + } + function Yr(r, a) { + if (r.indexOf("-") === -1) return typeof a.is == "string"; + switch (r) { + 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 An = null; + function En(r) { + return r = r.target || r.srcElement || window, r.correspondingUseElement && (r = r.correspondingUseElement), r.nodeType === 3 ? r.parentNode : r; + } + var ki = null, zi = null, Ci = null; + function Tn(r) { + if (r = Un(r)) { + if (typeof ki != "function") throw Error(m(280)); + var a = r.stateNode; + a && (a = $a(a), ki(r.stateNode, r.type, a)); + } + } + function Ta(r) { + zi ? Ci ? Ci.push(r) : Ci = [r] : zi = r; + } + function Pn() { + if (zi) { + var r = zi, a = Ci; + if (Ci = zi = null, Tn(r), a) for (r = 0; r < a.length; r++) Tn(a[r]); + } + } + function Ln(r, a) { + return r(a); + } + function Pa() { + } + var Rn = !1; + function La(r, a, u) { + if (Rn) return r(a, u); + Rn = !0; + try { + return Ln(r, a, u); + } finally { + Rn = !1, (zi !== null || Ci !== null) && (Pa(), Pn()); + } + } + function Sr(r, a) { + var u = r.stateNode; + if (u === null) return null; + var p = $a(u); + if (p === null) return null; + u = p[a]; + e: switch (a) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + case "onMouseEnter": + (p = !p.disabled) || (r = r.type, p = !(r === "button" || r === "input" || r === "select" || r === "textarea")), r = !p; + break e; + default: + r = !1; + } + if (r) return null; + if (u && typeof u != "function") throw Error(m(231, a, typeof u)); + return u; + } + var In = !1; + if (O) try { + var Hi = {}; + Object.defineProperty(Hi, "passive", { get: function() { + In = !0; + } }), window.addEventListener("test", Hi, Hi), window.removeEventListener("test", Hi, Hi); + } catch { + In = !1; + } + function Ra(r, a, u, p, S, E, z, Y, $) { + var ie = Array.prototype.slice.call(arguments, 3); + try { + a.apply(u, ie); + } catch (fe) { + this.onError(fe); + } + } + var Di = !1, Ji = null, ii = !1, Ki = null, no = { onError: function(r) { + Di = !0, Ji = r; + } }; + function ao(r, a, u, p, S, E, z, Y, $) { + Di = !1, Ji = null, Ra.apply(no, arguments); + } + function so(r, a, u, p, S, E, z, Y, $) { + if (ao.apply(this, arguments), Di) { + if (Di) { + var ie = Ji; + Di = !1, Ji = null; + } else throw Error(m(198)); + ii || (ii = !0, Ki = ie); + } + } + function _i(r) { + var a = r, u = r; + if (r.alternate) for (; a.return; ) a = a.return; + else { + r = a; + do + a = r, (a.flags & 4098) !== 0 && (u = a.return), r = a.return; + while (r); + } + return a.tag === 3 ? u : null; + } + function Ia(r) { + if (r.tag === 13) { + var a = r.memoizedState; + if (a === null && (r = r.alternate, r !== null && (a = r.memoizedState)), a !== null) return a.dehydrated; + } + return null; + } + function Mn(r) { + if (_i(r) !== r) throw Error(m(188)); + } + function Ma(r) { + var a = r.alternate; + if (!a) { + if (a = _i(r), a === null) throw Error(m(188)); + return a !== r ? null : r; + } + for (var u = r, p = a; ; ) { + var S = u.return; + if (S === null) break; + var E = S.alternate; + if (E === null) { + if (p = S.return, p !== null) { + u = p; + continue; + } + break; + } + if (S.child === E.child) { + for (E = S.child; E; ) { + if (E === u) return Mn(S), r; + if (E === p) return Mn(S), a; + E = E.sibling; + } + throw Error(m(188)); + } + if (u.return !== p.return) u = S, p = E; + else { + for (var z = !1, Y = S.child; Y; ) { + if (Y === u) { + z = !0, u = S, p = E; + break; + } + if (Y === p) { + z = !0, p = S, u = E; + break; + } + Y = Y.sibling; + } + if (!z) { + for (Y = E.child; Y; ) { + if (Y === u) { + z = !0, u = E, p = S; + break; + } + if (Y === p) { + z = !0, p = E, u = S; + break; + } + Y = Y.sibling; + } + if (!z) throw Error(m(189)); + } + } + if (u.alternate !== p) throw Error(m(190)); + } + if (u.tag !== 3) throw Error(m(188)); + return u.stateNode.current === u ? r : a; + } + function Wr(r) { + return r = Ma(r), r !== null ? Na(r) : null; + } + function Na(r) { + if (r.tag === 5 || r.tag === 6) return r; + for (r = r.child; r !== null; ) { + var a = Na(r); + if (a !== null) return a; + r = r.sibling; + } + return null; + } + var I = f.unstable_scheduleCallback, e = f.unstable_cancelCallback, t = f.unstable_shouldYield, i = f.unstable_requestPaint, n = f.unstable_now, s = f.unstable_getCurrentPriorityLevel, o = f.unstable_ImmediatePriority, c = f.unstable_UserBlockingPriority, h = f.unstable_NormalPriority, g = f.unstable_LowPriority, x = f.unstable_IdlePriority, y = null, w = null; + function k(r) { + if (w && typeof w.onCommitFiberRoot == "function") try { + w.onCommitFiberRoot(y, r, void 0, (r.current.flags & 128) === 128); + } catch { + } + } + var A = Math.clz32 ? Math.clz32 : F, L = Math.log, R = Math.LN2; + function F(r) { + return r >>>= 0, r === 0 ? 32 : 31 - (L(r) / R | 0) | 0; + } + var H = 64, d = 4194304; + function b(r) { + switch (r & -r) { + 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 r & 4194240; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return r & 130023424; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return r; + } + } + function T(r, a) { + var u = r.pendingLanes; + if (u === 0) return 0; + var p = 0, S = r.suspendedLanes, E = r.pingedLanes, z = u & 268435455; + if (z !== 0) { + var Y = z & ~S; + Y !== 0 ? p = b(Y) : (E &= z, E !== 0 && (p = b(E))); + } else z = u & ~S, z !== 0 ? p = b(z) : E !== 0 && (p = b(E)); + if (p === 0) return 0; + if (a !== 0 && a !== p && (a & S) === 0 && (S = p & -p, E = a & -a, S >= E || S === 16 && (E & 4194240) !== 0)) return a; + if ((p & 4) !== 0 && (p |= u & 16), a = r.entangledLanes, a !== 0) for (r = r.entanglements, a &= p; 0 < a; ) u = 31 - A(a), S = 1 << u, p |= r[u], a &= ~S; + return p; + } + function N(r, a) { + switch (r) { + case 1: + case 2: + case 4: + return a + 250; + case 8: + case 16: + case 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 a + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return -1; + } + } + function D(r, a) { + for (var u = r.suspendedLanes, p = r.pingedLanes, S = r.expirationTimes, E = r.pendingLanes; 0 < E; ) { + var z = 31 - A(E), Y = 1 << z, $ = S[z]; + $ === -1 ? ((Y & u) === 0 || (Y & p) !== 0) && (S[z] = N(Y, a)) : $ <= a && (r.expiredLanes |= Y), E &= ~Y; + } + } + function _(r) { + return r = r.pendingLanes & -1073741825, r !== 0 ? r : r & 1073741824 ? 1073741824 : 0; + } + function U() { + var r = H; + return H <<= 1, (H & 4194240) === 0 && (H = 64), r; + } + function V(r) { + for (var a = [], u = 0; 31 > u; u++) a.push(r); + return a; + } + function te(r, a, u) { + r.pendingLanes |= a, a !== 536870912 && (r.suspendedLanes = 0, r.pingedLanes = 0), r = r.eventTimes, a = 31 - A(a), r[a] = u; + } + function oe(r, a) { + var u = r.pendingLanes & ~a; + r.pendingLanes = a, r.suspendedLanes = 0, r.pingedLanes = 0, r.expiredLanes &= a, r.mutableReadLanes &= a, r.entangledLanes &= a, a = r.entanglements; + var p = r.eventTimes; + for (r = r.expirationTimes; 0 < u; ) { + var S = 31 - A(u), E = 1 << S; + a[S] = 0, p[S] = -1, r[S] = -1, u &= ~E; + } + } + function ae(r, a) { + var u = r.entangledLanes |= a; + for (r = r.entanglements; u; ) { + var p = 31 - A(u), S = 1 << p; + S & a | r[p] & a && (r[p] |= a), u &= ~S; + } + } + var he = 0; + function be(r) { + return r &= -r, 1 < r ? 4 < r ? (r & 268435455) !== 0 ? 16 : 536870912 : 4 : 1; + } + var Me, _e, Ge, rt, et, nt = !1, Rt = [], It = null, ri = null, ni = null, mt = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map(), gi = [], Jf = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); + function Tc(r, a) { + switch (r) { + case "focusin": + case "focusout": + It = null; + break; + case "dragenter": + case "dragleave": + ri = null; + break; + case "mouseover": + case "mouseout": + ni = null; + break; + case "pointerover": + case "pointerout": + mt.delete(a.pointerId); + break; + case "gotpointercapture": + case "lostpointercapture": + dt.delete(a.pointerId); + } + } + function Nn(r, a, u, p, S, E) { + return r === null || r.nativeEvent !== E ? (r = { blockedOn: a, domEventName: u, eventSystemFlags: p, nativeEvent: E, targetContainers: [S] }, a !== null && (a = Un(a), a !== null && _e(a)), r) : (r.eventSystemFlags |= p, a = r.targetContainers, S !== null && a.indexOf(S) === -1 && a.push(S), r); + } + function Kf(r, a, u, p, S) { + switch (a) { + case "focusin": + return It = Nn(It, r, a, u, p, S), !0; + case "dragenter": + return ri = Nn(ri, r, a, u, p, S), !0; + case "mouseover": + return ni = Nn(ni, r, a, u, p, S), !0; + case "pointerover": + var E = S.pointerId; + return mt.set(E, Nn(mt.get(E) || null, r, a, u, p, S)), !0; + case "gotpointercapture": + return E = S.pointerId, dt.set(E, Nn(dt.get(E) || null, r, a, u, p, S)), !0; + } + return !1; + } + function Pc(r) { + var a = kr(r.target); + if (a !== null) { + var u = _i(a); + if (u !== null) { + if (a = u.tag, a === 13) { + if (a = Ia(u), a !== null) { + r.blockedOn = a, et(r.priority, function() { + Ge(u); + }); + return; + } + } else if (a === 3 && u.stateNode.current.memoizedState.isDehydrated) { + r.blockedOn = u.tag === 3 ? u.stateNode.containerInfo : null; + return; + } + } + } + r.blockedOn = null; + } + function Oa(r) { + if (r.blockedOn !== null) return !1; + for (var a = r.targetContainers; 0 < a.length; ) { + var u = lo(r.domEventName, r.eventSystemFlags, a[0], r.nativeEvent); + if (u === null) { + u = r.nativeEvent; + var p = new u.constructor(u.type, u); + An = p, u.target.dispatchEvent(p), An = null; + } else return a = Un(u), a !== null && _e(a), r.blockedOn = u, !1; + a.shift(); + } + return !0; + } + function Lc(r, a, u) { + Oa(r) && u.delete(a); + } + function eg() { + nt = !1, It !== null && Oa(It) && (It = null), ri !== null && Oa(ri) && (ri = null), ni !== null && Oa(ni) && (ni = null), mt.forEach(Lc), dt.forEach(Lc); + } + function On(r, a) { + r.blockedOn === a && (r.blockedOn = null, nt || (nt = !0, f.unstable_scheduleCallback(f.unstable_NormalPriority, eg))); + } + function Fn(r) { + function a(S) { + return On(S, r); + } + if (0 < Rt.length) { + On(Rt[0], r); + for (var u = 1; u < Rt.length; u++) { + var p = Rt[u]; + p.blockedOn === r && (p.blockedOn = null); + } + } + for (It !== null && On(It, r), ri !== null && On(ri, r), ni !== null && On(ni, r), mt.forEach(a), dt.forEach(a), u = 0; u < gi.length; u++) p = gi[u], p.blockedOn === r && (p.blockedOn = null); + for (; 0 < gi.length && (u = gi[0], u.blockedOn === null); ) Pc(u), u.blockedOn === null && gi.shift(); + } + var jr = ye.ReactCurrentBatchConfig, Fa = !0; + function tg(r, a, u, p) { + var S = he, E = jr.transition; + jr.transition = null; + try { + he = 1, oo(r, a, u, p); + } finally { + he = S, jr.transition = E; + } + } + function ig(r, a, u, p) { + var S = he, E = jr.transition; + jr.transition = null; + try { + he = 4, oo(r, a, u, p); + } finally { + he = S, jr.transition = E; + } + } + function oo(r, a, u, p) { + if (Fa) { + var S = lo(r, a, u, p); + if (S === null) Eo(r, a, p, za, u), Tc(r, p); + else if (Kf(S, r, a, u, p)) p.stopPropagation(); + else if (Tc(r, p), a & 4 && -1 < Jf.indexOf(r)) { + for (; S !== null; ) { + var E = Un(S); + if (E !== null && Me(E), E = lo(r, a, u, p), E === null && Eo(r, a, p, za, u), E === S) break; + S = E; + } + S !== null && p.stopPropagation(); + } else Eo(r, a, p, null, u); + } + } + var za = null; + function lo(r, a, u, p) { + if (za = null, r = En(p), r = kr(r), r !== null) if (a = _i(r), a === null) r = null; + else if (u = a.tag, u === 13) { + if (r = Ia(a), r !== null) return r; + r = null; + } else if (u === 3) { + if (a.stateNode.current.memoizedState.isDehydrated) return a.tag === 3 ? a.stateNode.containerInfo : null; + r = null; + } else a !== r && (r = null); + return za = r, null; + } + function Rc(r) { + switch (r) { + case "cancel": + case "click": + case "close": + case "contextmenu": + case "copy": + case "cut": + case "auxclick": + case "dblclick": + case "dragend": + case "dragstart": + case "drop": + case "focusin": + case "focusout": + case "input": + case "invalid": + case "keydown": + case "keypress": + case "keyup": + case "mousedown": + case "mouseup": + case "paste": + case "pause": + case "play": + case "pointercancel": + case "pointerdown": + case "pointerup": + case "ratechange": + case "reset": + case "resize": + case "seeked": + case "submit": + case "touchcancel": + case "touchend": + case "touchstart": + case "volumechange": + case "change": + case "selectionchange": + case "textInput": + case "compositionstart": + case "compositionend": + case "compositionupdate": + case "beforeblur": + case "afterblur": + case "beforeinput": + case "blur": + case "fullscreenchange": + case "focus": + case "hashchange": + case "popstate": + case "select": + case "selectstart": + return 1; + case "drag": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "mousemove": + case "mouseout": + case "mouseover": + case "pointermove": + case "pointerout": + case "pointerover": + case "scroll": + case "toggle": + case "touchmove": + case "wheel": + case "mouseenter": + case "mouseleave": + case "pointerenter": + case "pointerleave": + return 4; + case "message": + switch (s()) { + case o: + return 1; + case c: + return 4; + case h: + case g: + return 16; + case x: + return 536870912; + default: + return 16; + } + default: + return 16; + } + } + var er = null, co = null, Ha = null; + function Ic() { + if (Ha) return Ha; + var r, a = co, u = a.length, p, S = "value" in er ? er.value : er.textContent, E = S.length; + for (r = 0; r < u && a[r] === S[r]; r++) ; + var z = u - r; + for (p = 1; p <= z && a[u - p] === S[E - p]; p++) ; + return Ha = S.slice(r, 1 < p ? 1 - p : void 0); + } + function Da(r) { + var a = r.keyCode; + return "charCode" in r ? (r = r.charCode, r === 0 && a === 13 && (r = 13)) : r = a, r === 10 && (r = 13), 32 <= r || r === 13 ? r : 0; + } + function _a() { + return !0; + } + function Mc() { + return !1; + } + function Zt(r) { + function a(u, p, S, E, z) { + this._reactName = u, this._targetInst = S, this.type = p, this.nativeEvent = E, this.target = z, this.currentTarget = null; + for (var Y in r) r.hasOwnProperty(Y) && (u = r[Y], this[Y] = u ? u(E) : E[Y]); + return this.isDefaultPrevented = (E.defaultPrevented != null ? E.defaultPrevented : E.returnValue === !1) ? _a : Mc, this.isPropagationStopped = Mc, this; + } + return Se(a.prototype, { preventDefault: function() { + this.defaultPrevented = !0; + var u = this.nativeEvent; + u && (u.preventDefault ? u.preventDefault() : typeof u.returnValue != "unknown" && (u.returnValue = !1), this.isDefaultPrevented = _a); + }, stopPropagation: function() { + var u = this.nativeEvent; + u && (u.stopPropagation ? u.stopPropagation() : typeof u.cancelBubble != "unknown" && (u.cancelBubble = !0), this.isPropagationStopped = _a); + }, persist: function() { + }, isPersistent: _a }), a; + } + var Gr = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(r) { + return r.timeStamp || Date.now(); + }, defaultPrevented: 0, isTrusted: 0 }, uo = Zt(Gr), zn = Se({}, Gr, { view: 0, detail: 0 }), rg = Zt(zn), ho, fo, Hn, Ba = Se({}, zn, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: po, button: 0, buttons: 0, relatedTarget: function(r) { + return r.relatedTarget === void 0 ? r.fromElement === r.srcElement ? r.toElement : r.fromElement : r.relatedTarget; + }, movementX: function(r) { + return "movementX" in r ? r.movementX : (r !== Hn && (Hn && r.type === "mousemove" ? (ho = r.screenX - Hn.screenX, fo = r.screenY - Hn.screenY) : fo = ho = 0, Hn = r), ho); + }, movementY: function(r) { + return "movementY" in r ? r.movementY : fo; + } }), Nc = Zt(Ba), ng = Se({}, Ba, { dataTransfer: 0 }), ag = Zt(ng), sg = Se({}, zn, { relatedTarget: 0 }), go = Zt(sg), og = Se({}, Gr, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), lg = Zt(og), cg = Se({}, Gr, { clipboardData: function(r) { + return "clipboardData" in r ? r.clipboardData : window.clipboardData; + } }), ug = Zt(cg), hg = Se({}, Gr, { data: 0 }), Oc = Zt(hg), dg = { + Esc: "Escape", + Spacebar: " ", + Left: "ArrowLeft", + Up: "ArrowUp", + Right: "ArrowRight", + Down: "ArrowDown", + Del: "Delete", + Win: "OS", + Menu: "ContextMenu", + Apps: "ContextMenu", + Scroll: "ScrollLock", + MozPrintableKey: "Unidentified" + }, fg = { + 8: "Backspace", + 9: "Tab", + 12: "Clear", + 13: "Enter", + 16: "Shift", + 17: "Control", + 18: "Alt", + 19: "Pause", + 20: "CapsLock", + 27: "Escape", + 32: " ", + 33: "PageUp", + 34: "PageDown", + 35: "End", + 36: "Home", + 37: "ArrowLeft", + 38: "ArrowUp", + 39: "ArrowRight", + 40: "ArrowDown", + 45: "Insert", + 46: "Delete", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "NumLock", + 145: "ScrollLock", + 224: "Meta" + }, gg = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; + function pg(r) { + var a = this.nativeEvent; + return a.getModifierState ? a.getModifierState(r) : (r = gg[r]) ? !!a[r] : !1; + } + function po() { + return pg; + } + var mg = Se({}, zn, { key: function(r) { + if (r.key) { + var a = dg[r.key] || r.key; + if (a !== "Unidentified") return a; + } + return r.type === "keypress" ? (r = Da(r), r === 13 ? "Enter" : String.fromCharCode(r)) : r.type === "keydown" || r.type === "keyup" ? fg[r.keyCode] || "Unidentified" : ""; + }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: po, charCode: function(r) { + return r.type === "keypress" ? Da(r) : 0; + }, keyCode: function(r) { + return r.type === "keydown" || r.type === "keyup" ? r.keyCode : 0; + }, which: function(r) { + return r.type === "keypress" ? Da(r) : r.type === "keydown" || r.type === "keyup" ? r.keyCode : 0; + } }), xg = Zt(mg), vg = Se({}, Ba, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Fc = Zt(vg), yg = Se({}, zn, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: po }), bg = Zt(yg), wg = Se({}, Gr, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Sg = Zt(wg), kg = Se({}, Ba, { + deltaX: function(r) { + return "deltaX" in r ? r.deltaX : "wheelDeltaX" in r ? -r.wheelDeltaX : 0; + }, + deltaY: function(r) { + return "deltaY" in r ? r.deltaY : "wheelDeltaY" in r ? -r.wheelDeltaY : "wheelDelta" in r ? -r.wheelDelta : 0; + }, + deltaZ: 0, + deltaMode: 0 + }), Cg = Zt(kg), Ag = [9, 13, 27, 32], mo = O && "CompositionEvent" in window, Dn = null; + O && "documentMode" in document && (Dn = document.documentMode); + var Eg = O && "TextEvent" in window && !Dn, zc = O && (!mo || Dn && 8 < Dn && 11 >= Dn), Hc = " ", Dc = !1; + function _c(r, a) { + switch (r) { + case "keyup": + return Ag.indexOf(a.keyCode) !== -1; + case "keydown": + return a.keyCode !== 229; + case "keypress": + case "mousedown": + case "focusout": + return !0; + default: + return !1; + } + } + function Bc(r) { + return r = r.detail, typeof r == "object" && "data" in r ? r.data : null; + } + var Vr = !1; + function Tg(r, a) { + switch (r) { + case "compositionend": + return Bc(a); + case "keypress": + return a.which !== 32 ? null : (Dc = !0, Hc); + case "textInput": + return r = a.data, r === Hc && Dc ? null : r; + default: + return null; + } + } + function Pg(r, a) { + if (Vr) return r === "compositionend" || !mo && _c(r, a) ? (r = Ic(), Ha = co = er = null, Vr = !1, r) : null; + switch (r) { + case "paste": + return null; + case "keypress": + if (!(a.ctrlKey || a.altKey || a.metaKey) || a.ctrlKey && a.altKey) { + if (a.char && 1 < a.char.length) return a.char; + if (a.which) return String.fromCharCode(a.which); + } + return null; + case "compositionend": + return zc && a.locale !== "ko" ? null : a.data; + default: + return null; + } + } + var Lg = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 }; + function Xc(r) { + var a = r && r.nodeName && r.nodeName.toLowerCase(); + return a === "input" ? !!Lg[r.type] : a === "textarea"; + } + function Yc(r, a, u, p) { + Ta(p), a = Ga(a, "onChange"), 0 < a.length && (u = new uo("onChange", "change", null, u, p), r.push({ event: u, listeners: a })); + } + var _n = null, Bn = null; + function Rg(r) { + su(r, 0); + } + function Xa(r) { + var a = Qr(r); + if (Fi(a)) return r; + } + function Ig(r, a) { + if (r === "change") return a; + } + var Wc = !1; + if (O) { + var xo; + if (O) { + var vo = "oninput" in document; + if (!vo) { + var jc = document.createElement("div"); + jc.setAttribute("oninput", "return;"), vo = typeof jc.oninput == "function"; + } + xo = vo; + } else xo = !1; + Wc = xo && (!document.documentMode || 9 < document.documentMode); + } + function Gc() { + _n && (_n.detachEvent("onpropertychange", Vc), Bn = _n = null); + } + function Vc(r) { + if (r.propertyName === "value" && Xa(Bn)) { + var a = []; + Yc(a, Bn, r, En(r)), La(Rg, a); + } + } + function Mg(r, a, u) { + r === "focusin" ? (Gc(), _n = a, Bn = u, _n.attachEvent("onpropertychange", Vc)) : r === "focusout" && Gc(); + } + function Ng(r) { + if (r === "selectionchange" || r === "keyup" || r === "keydown") return Xa(Bn); + } + function Og(r, a) { + if (r === "click") return Xa(a); + } + function Fg(r, a) { + if (r === "input" || r === "change") return Xa(a); + } + function zg(r, a) { + return r === a && (r !== 0 || 1 / r === 1 / a) || r !== r && a !== a; + } + var pi = typeof Object.is == "function" ? Object.is : zg; + function Xn(r, a) { + if (pi(r, a)) return !0; + if (typeof r != "object" || r === null || typeof a != "object" || a === null) return !1; + var u = Object.keys(r), p = Object.keys(a); + if (u.length !== p.length) return !1; + for (p = 0; p < u.length; p++) { + var S = u[p]; + if (!X.call(a, S) || !pi(r[S], a[S])) return !1; + } + return !0; + } + function Uc(r) { + for (; r && r.firstChild; ) r = r.firstChild; + return r; + } + function $c(r, a) { + var u = Uc(r); + r = 0; + for (var p; u; ) { + if (u.nodeType === 3) { + if (p = r + u.textContent.length, r <= a && p >= a) return { node: u, offset: a - r }; + r = p; + } + e: { + for (; u; ) { + if (u.nextSibling) { + u = u.nextSibling; + break e; + } + u = u.parentNode; + } + u = void 0; + } + u = Uc(u); + } + } + function qc(r, a) { + return r && a ? r === a ? !0 : r && r.nodeType === 3 ? !1 : a && a.nodeType === 3 ? qc(r, a.parentNode) : "contains" in r ? r.contains(a) : r.compareDocumentPosition ? !!(r.compareDocumentPosition(a) & 16) : !1 : !1; + } + function Zc() { + for (var r = window, a = qi(); a instanceof r.HTMLIFrameElement; ) { + try { + var u = typeof a.contentWindow.location.href == "string"; + } catch { + u = !1; + } + if (u) r = a.contentWindow; + else break; + a = qi(r.document); + } + return a; + } + function yo(r) { + var a = r && r.nodeName && r.nodeName.toLowerCase(); + return a && (a === "input" && (r.type === "text" || r.type === "search" || r.type === "tel" || r.type === "url" || r.type === "password") || a === "textarea" || r.contentEditable === "true"); + } + function Hg(r) { + var a = Zc(), u = r.focusedElem, p = r.selectionRange; + if (a !== u && u && u.ownerDocument && qc(u.ownerDocument.documentElement, u)) { + if (p !== null && yo(u)) { + if (a = p.start, r = p.end, r === void 0 && (r = a), "selectionStart" in u) u.selectionStart = a, u.selectionEnd = Math.min(r, u.value.length); + else if (r = (a = u.ownerDocument || document) && a.defaultView || window, r.getSelection) { + r = r.getSelection(); + var S = u.textContent.length, E = Math.min(p.start, S); + p = p.end === void 0 ? E : Math.min(p.end, S), !r.extend && E > p && (S = p, p = E, E = S), S = $c(u, E); + var z = $c( + u, + p + ); + S && z && (r.rangeCount !== 1 || r.anchorNode !== S.node || r.anchorOffset !== S.offset || r.focusNode !== z.node || r.focusOffset !== z.offset) && (a = a.createRange(), a.setStart(S.node, S.offset), r.removeAllRanges(), E > p ? (r.addRange(a), r.extend(z.node, z.offset)) : (a.setEnd(z.node, z.offset), r.addRange(a))); + } + } + for (a = [], r = u; r = r.parentNode; ) r.nodeType === 1 && a.push({ element: r, left: r.scrollLeft, top: r.scrollTop }); + for (typeof u.focus == "function" && u.focus(), u = 0; u < a.length; u++) r = a[u], r.element.scrollLeft = r.left, r.element.scrollTop = r.top; + } + } + var Dg = O && "documentMode" in document && 11 >= document.documentMode, Ur = null, bo = null, Yn = null, wo = !1; + function Qc(r, a, u) { + var p = u.window === u ? u.document : u.nodeType === 9 ? u : u.ownerDocument; + wo || Ur == null || Ur !== qi(p) || (p = Ur, "selectionStart" in p && yo(p) ? p = { start: p.selectionStart, end: p.selectionEnd } : (p = (p.ownerDocument && p.ownerDocument.defaultView || window).getSelection(), p = { anchorNode: p.anchorNode, anchorOffset: p.anchorOffset, focusNode: p.focusNode, focusOffset: p.focusOffset }), Yn && Xn(Yn, p) || (Yn = p, p = Ga(bo, "onSelect"), 0 < p.length && (a = new uo("onSelect", "select", null, a, u), r.push({ event: a, listeners: p }), a.target = Ur))); + } + function Ya(r, a) { + var u = {}; + return u[r.toLowerCase()] = a.toLowerCase(), u["Webkit" + r] = "webkit" + a, u["Moz" + r] = "moz" + a, u; + } + var $r = { animationend: Ya("Animation", "AnimationEnd"), animationiteration: Ya("Animation", "AnimationIteration"), animationstart: Ya("Animation", "AnimationStart"), transitionend: Ya("Transition", "TransitionEnd") }, So = {}, Jc = {}; + O && (Jc = document.createElement("div").style, "AnimationEvent" in window || (delete $r.animationend.animation, delete $r.animationiteration.animation, delete $r.animationstart.animation), "TransitionEvent" in window || delete $r.transitionend.transition); + function Wa(r) { + if (So[r]) return So[r]; + if (!$r[r]) return r; + var a = $r[r], u; + for (u in a) if (a.hasOwnProperty(u) && u in Jc) return So[r] = a[u]; + return r; + } + var Kc = Wa("animationend"), eu = Wa("animationiteration"), tu = Wa("animationstart"), iu = Wa("transitionend"), ru = /* @__PURE__ */ new Map(), nu = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); + function tr(r, a) { + ru.set(r, a), P(a, [r]); + } + for (var ko = 0; ko < nu.length; ko++) { + var Co = nu[ko], _g = Co.toLowerCase(), Bg = Co[0].toUpperCase() + Co.slice(1); + tr(_g, "on" + Bg); + } + tr(Kc, "onAnimationEnd"), tr(eu, "onAnimationIteration"), tr(tu, "onAnimationStart"), tr("dblclick", "onDoubleClick"), tr("focusin", "onFocus"), tr("focusout", "onBlur"), tr(iu, "onTransitionEnd"), M("onMouseEnter", ["mouseout", "mouseover"]), M("onMouseLeave", ["mouseout", "mouseover"]), M("onPointerEnter", ["pointerout", "pointerover"]), M("onPointerLeave", ["pointerout", "pointerover"]), P("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), P("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), P("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), P("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), P("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), P("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); + var Wn = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), Xg = new Set("cancel close invalid load scroll toggle".split(" ").concat(Wn)); + function au(r, a, u) { + var p = r.type || "unknown-event"; + r.currentTarget = u, so(p, a, void 0, r), r.currentTarget = null; + } + function su(r, a) { + a = (a & 4) !== 0; + for (var u = 0; u < r.length; u++) { + var p = r[u], S = p.event; + p = p.listeners; + e: { + var E = void 0; + if (a) for (var z = p.length - 1; 0 <= z; z--) { + var Y = p[z], $ = Y.instance, ie = Y.currentTarget; + if (Y = Y.listener, $ !== E && S.isPropagationStopped()) break e; + au(S, Y, ie), E = $; + } + else for (z = 0; z < p.length; z++) { + if (Y = p[z], $ = Y.instance, ie = Y.currentTarget, Y = Y.listener, $ !== E && S.isPropagationStopped()) break e; + au(S, Y, ie), E = $; + } + } + } + if (ii) throw r = Ki, ii = !1, Ki = null, r; + } + function st(r, a) { + var u = a[Mo]; + u === void 0 && (u = a[Mo] = /* @__PURE__ */ new Set()); + var p = r + "__bubble"; + u.has(p) || (ou(a, r, 2, !1), u.add(p)); + } + function Ao(r, a, u) { + var p = 0; + a && (p |= 4), ou(u, r, p, a); + } + var ja = "_reactListening" + Math.random().toString(36).slice(2); + function jn(r) { + if (!r[ja]) { + r[ja] = !0, v.forEach(function(u) { + u !== "selectionchange" && (Xg.has(u) || Ao(u, !1, r), Ao(u, !0, r)); + }); + var a = r.nodeType === 9 ? r : r.ownerDocument; + a === null || a[ja] || (a[ja] = !0, Ao("selectionchange", !1, a)); + } + } + function ou(r, a, u, p) { + switch (Rc(a)) { + case 1: + var S = tg; + break; + case 4: + S = ig; + break; + default: + S = oo; + } + u = S.bind(null, a, u, r), S = void 0, !In || a !== "touchstart" && a !== "touchmove" && a !== "wheel" || (S = !0), p ? S !== void 0 ? r.addEventListener(a, u, { capture: !0, passive: S }) : r.addEventListener(a, u, !0) : S !== void 0 ? r.addEventListener(a, u, { passive: S }) : r.addEventListener(a, u, !1); + } + function Eo(r, a, u, p, S) { + var E = p; + if ((a & 1) === 0 && (a & 2) === 0 && p !== null) e: for (; ; ) { + if (p === null) return; + var z = p.tag; + if (z === 3 || z === 4) { + var Y = p.stateNode.containerInfo; + if (Y === S || Y.nodeType === 8 && Y.parentNode === S) break; + if (z === 4) for (z = p.return; z !== null; ) { + var $ = z.tag; + if (($ === 3 || $ === 4) && ($ = z.stateNode.containerInfo, $ === S || $.nodeType === 8 && $.parentNode === S)) return; + z = z.return; + } + for (; Y !== null; ) { + if (z = kr(Y), z === null) return; + if ($ = z.tag, $ === 5 || $ === 6) { + p = E = z; + continue e; + } + Y = Y.parentNode; + } + } + p = p.return; + } + La(function() { + var ie = E, fe = En(u), ge = []; + e: { + var de = ru.get(r); + if (de !== void 0) { + var we = uo, Ae = r; + switch (r) { + case "keypress": + if (Da(u) === 0) break e; + case "keydown": + case "keyup": + we = xg; + break; + case "focusin": + Ae = "focus", we = go; + break; + case "focusout": + Ae = "blur", we = go; + break; + case "beforeblur": + case "afterblur": + we = go; + break; + case "click": + if (u.button === 2) break e; + case "auxclick": + case "dblclick": + case "mousedown": + case "mousemove": + case "mouseup": + case "mouseout": + case "mouseover": + case "contextmenu": + we = Nc; + break; + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + we = ag; + break; + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": + we = bg; + break; + case Kc: + case eu: + case tu: + we = lg; + break; + case iu: + we = Sg; + break; + case "scroll": + we = rg; + break; + case "wheel": + we = Cg; + break; + case "copy": + case "cut": + case "paste": + we = ug; + break; + case "gotpointercapture": + case "lostpointercapture": + case "pointercancel": + case "pointerdown": + case "pointermove": + case "pointerout": + case "pointerover": + case "pointerup": + we = Fc; + } + var Ee = (a & 4) !== 0, pt = !Ee && r === "scroll", J = Ee ? de !== null ? de + "Capture" : null : de; + Ee = []; + for (var q = ie, K; q !== null; ) { + K = q; + var xe = K.stateNode; + if (K.tag === 5 && xe !== null && (K = xe, J !== null && (xe = Sr(q, J), xe != null && Ee.push(Gn(q, xe, K)))), pt) break; + q = q.return; + } + 0 < Ee.length && (de = new we(de, Ae, null, u, fe), ge.push({ event: de, listeners: Ee })); + } + } + if ((a & 7) === 0) { + e: { + if (de = r === "mouseover" || r === "pointerover", we = r === "mouseout" || r === "pointerout", de && u !== An && (Ae = u.relatedTarget || u.fromElement) && (kr(Ae) || Ae[Bi])) break e; + if ((we || de) && (de = fe.window === fe ? fe : (de = fe.ownerDocument) ? de.defaultView || de.parentWindow : window, we ? (Ae = u.relatedTarget || u.toElement, we = ie, Ae = Ae ? kr(Ae) : null, Ae !== null && (pt = _i(Ae), Ae !== pt || Ae.tag !== 5 && Ae.tag !== 6) && (Ae = null)) : (we = null, Ae = ie), we !== Ae)) { + if (Ee = Nc, xe = "onMouseLeave", J = "onMouseEnter", q = "mouse", (r === "pointerout" || r === "pointerover") && (Ee = Fc, xe = "onPointerLeave", J = "onPointerEnter", q = "pointer"), pt = we == null ? de : Qr(we), K = Ae == null ? de : Qr(Ae), de = new Ee(xe, q + "leave", we, u, fe), de.target = pt, de.relatedTarget = K, xe = null, kr(fe) === ie && (Ee = new Ee(J, q + "enter", Ae, u, fe), Ee.target = K, Ee.relatedTarget = pt, xe = Ee), pt = xe, we && Ae) t: { + for (Ee = we, J = Ae, q = 0, K = Ee; K; K = qr(K)) q++; + for (K = 0, xe = J; xe; xe = qr(xe)) K++; + for (; 0 < q - K; ) Ee = qr(Ee), q--; + for (; 0 < K - q; ) J = qr(J), K--; + for (; q--; ) { + if (Ee === J || J !== null && Ee === J.alternate) break t; + Ee = qr(Ee), J = qr(J); + } + Ee = null; + } + else Ee = null; + we !== null && lu(ge, de, we, Ee, !1), Ae !== null && pt !== null && lu(ge, pt, Ae, Ee, !0); + } + } + e: { + if (de = ie ? Qr(ie) : window, we = de.nodeName && de.nodeName.toLowerCase(), we === "select" || we === "input" && de.type === "file") var Pe = Ig; + else if (Xc(de)) if (Wc) Pe = Fg; + else { + Pe = Ng; + var Re = Mg; + } + else (we = de.nodeName) && we.toLowerCase() === "input" && (de.type === "checkbox" || de.type === "radio") && (Pe = Og); + if (Pe && (Pe = Pe(r, ie))) { + Yc(ge, Pe, u, fe); + break e; + } + Re && Re(r, de, ie), r === "focusout" && (Re = de._wrapperState) && Re.controlled && de.type === "number" && yn(de, "number", de.value); + } + switch (Re = ie ? Qr(ie) : window, r) { + case "focusin": + (Xc(Re) || Re.contentEditable === "true") && (Ur = Re, bo = ie, Yn = null); + break; + case "focusout": + Yn = bo = Ur = null; + break; + case "mousedown": + wo = !0; + break; + case "contextmenu": + case "mouseup": + case "dragend": + wo = !1, Qc(ge, u, fe); + break; + case "selectionchange": + if (Dg) break; + case "keydown": + case "keyup": + Qc(ge, u, fe); + } + var Ie; + if (mo) e: { + switch (r) { + case "compositionstart": + var Ne = "onCompositionStart"; + break e; + case "compositionend": + Ne = "onCompositionEnd"; + break e; + case "compositionupdate": + Ne = "onCompositionUpdate"; + break e; + } + Ne = void 0; + } + else Vr ? _c(r, u) && (Ne = "onCompositionEnd") : r === "keydown" && u.keyCode === 229 && (Ne = "onCompositionStart"); + Ne && (zc && u.locale !== "ko" && (Vr || Ne !== "onCompositionStart" ? Ne === "onCompositionEnd" && Vr && (Ie = Ic()) : (er = fe, co = "value" in er ? er.value : er.textContent, Vr = !0)), Re = Ga(ie, Ne), 0 < Re.length && (Ne = new Oc(Ne, r, null, u, fe), ge.push({ event: Ne, listeners: Re }), Ie ? Ne.data = Ie : (Ie = Bc(u), Ie !== null && (Ne.data = Ie)))), (Ie = Eg ? Tg(r, u) : Pg(r, u)) && (ie = Ga(ie, "onBeforeInput"), 0 < ie.length && (fe = new Oc("onBeforeInput", "beforeinput", null, u, fe), ge.push({ event: fe, listeners: ie }), fe.data = Ie)); + } + su(ge, a); + }); + } + function Gn(r, a, u) { + return { instance: r, listener: a, currentTarget: u }; + } + function Ga(r, a) { + for (var u = a + "Capture", p = []; r !== null; ) { + var S = r, E = S.stateNode; + S.tag === 5 && E !== null && (S = E, E = Sr(r, u), E != null && p.unshift(Gn(r, E, S)), E = Sr(r, a), E != null && p.push(Gn(r, E, S))), r = r.return; + } + return p; + } + function qr(r) { + if (r === null) return null; + do + r = r.return; + while (r && r.tag !== 5); + return r || null; + } + function lu(r, a, u, p, S) { + for (var E = a._reactName, z = []; u !== null && u !== p; ) { + var Y = u, $ = Y.alternate, ie = Y.stateNode; + if ($ !== null && $ === p) break; + Y.tag === 5 && ie !== null && (Y = ie, S ? ($ = Sr(u, E), $ != null && z.unshift(Gn(u, $, Y))) : S || ($ = Sr(u, E), $ != null && z.push(Gn(u, $, Y)))), u = u.return; + } + z.length !== 0 && r.push({ event: a, listeners: z }); + } + var Yg = /\r\n?/g, Wg = /\u0000|\uFFFD/g; + function cu(r) { + return (typeof r == "string" ? r : "" + r).replace(Yg, ` +`).replace(Wg, ""); + } + function Va(r, a, u) { + if (a = cu(a), cu(r) !== a && u) throw Error(m(425)); + } + function Ua() { + } + var To = null, Po = null; + function Lo(r, a) { + return r === "textarea" || r === "noscript" || typeof a.children == "string" || typeof a.children == "number" || typeof a.dangerouslySetInnerHTML == "object" && a.dangerouslySetInnerHTML !== null && a.dangerouslySetInnerHTML.__html != null; + } + var Ro = typeof setTimeout == "function" ? setTimeout : void 0, jg = typeof clearTimeout == "function" ? clearTimeout : void 0, uu = typeof Promise == "function" ? Promise : void 0, Gg = typeof queueMicrotask == "function" ? queueMicrotask : typeof uu < "u" ? function(r) { + return uu.resolve(null).then(r).catch(Vg); + } : Ro; + function Vg(r) { + setTimeout(function() { + throw r; + }); + } + function Io(r, a) { + var u = a, p = 0; + do { + var S = u.nextSibling; + if (r.removeChild(u), S && S.nodeType === 8) if (u = S.data, u === "/$") { + if (p === 0) { + r.removeChild(S), Fn(a); + return; + } + p--; + } else u !== "$" && u !== "$?" && u !== "$!" || p++; + u = S; + } while (u); + Fn(a); + } + function ir(r) { + for (; r != null; r = r.nextSibling) { + var a = r.nodeType; + if (a === 1 || a === 3) break; + if (a === 8) { + if (a = r.data, a === "$" || a === "$!" || a === "$?") break; + if (a === "/$") return null; + } + } + return r; + } + function hu(r) { + r = r.previousSibling; + for (var a = 0; r; ) { + if (r.nodeType === 8) { + var u = r.data; + if (u === "$" || u === "$!" || u === "$?") { + if (a === 0) return r; + a--; + } else u === "/$" && a++; + } + r = r.previousSibling; + } + return null; + } + var Zr = Math.random().toString(36).slice(2), Ai = "__reactFiber$" + Zr, Vn = "__reactProps$" + Zr, Bi = "__reactContainer$" + Zr, Mo = "__reactEvents$" + Zr, Ug = "__reactListeners$" + Zr, $g = "__reactHandles$" + Zr; + function kr(r) { + var a = r[Ai]; + if (a) return a; + for (var u = r.parentNode; u; ) { + if (a = u[Bi] || u[Ai]) { + if (u = a.alternate, a.child !== null || u !== null && u.child !== null) for (r = hu(r); r !== null; ) { + if (u = r[Ai]) return u; + r = hu(r); + } + return a; + } + r = u, u = r.parentNode; + } + return null; + } + function Un(r) { + return r = r[Ai] || r[Bi], !r || r.tag !== 5 && r.tag !== 6 && r.tag !== 13 && r.tag !== 3 ? null : r; + } + function Qr(r) { + if (r.tag === 5 || r.tag === 6) return r.stateNode; + throw Error(m(33)); + } + function $a(r) { + return r[Vn] || null; + } + var No = [], Jr = -1; + function rr(r) { + return { current: r }; + } + function ot(r) { + 0 > Jr || (r.current = No[Jr], No[Jr] = null, Jr--); + } + function at(r, a) { + Jr++, No[Jr] = r.current, r.current = a; + } + var nr = {}, Mt = rr(nr), Yt = rr(!1), Cr = nr; + function Kr(r, a) { + var u = r.type.contextTypes; + if (!u) return nr; + var p = r.stateNode; + if (p && p.__reactInternalMemoizedUnmaskedChildContext === a) return p.__reactInternalMemoizedMaskedChildContext; + var S = {}, E; + for (E in u) S[E] = a[E]; + return p && (r = r.stateNode, r.__reactInternalMemoizedUnmaskedChildContext = a, r.__reactInternalMemoizedMaskedChildContext = S), S; + } + function Wt(r) { + return r = r.childContextTypes, r != null; + } + function qa() { + ot(Yt), ot(Mt); + } + function du(r, a, u) { + if (Mt.current !== nr) throw Error(m(168)); + at(Mt, a), at(Yt, u); + } + function fu(r, a, u) { + var p = r.stateNode; + if (a = a.childContextTypes, typeof p.getChildContext != "function") return u; + p = p.getChildContext(); + for (var S in p) if (!(S in a)) throw Error(m(108, Je(r) || "Unknown", S)); + return Se({}, u, p); + } + function Za(r) { + return r = (r = r.stateNode) && r.__reactInternalMemoizedMergedChildContext || nr, Cr = Mt.current, at(Mt, r), at(Yt, Yt.current), !0; + } + function gu(r, a, u) { + var p = r.stateNode; + if (!p) throw Error(m(169)); + u ? (r = fu(r, a, Cr), p.__reactInternalMemoizedMergedChildContext = r, ot(Yt), ot(Mt), at(Mt, r)) : ot(Yt), at(Yt, u); + } + var Xi = null, Qa = !1, Oo = !1; + function pu(r) { + Xi === null ? Xi = [r] : Xi.push(r); + } + function qg(r) { + Qa = !0, pu(r); + } + function ar() { + if (!Oo && Xi !== null) { + Oo = !0; + var r = 0, a = he; + try { + var u = Xi; + for (he = 1; r < u.length; r++) { + var p = u[r]; + do + p = p(!0); + while (p !== null); + } + Xi = null, Qa = !1; + } catch (S) { + throw Xi !== null && (Xi = Xi.slice(r + 1)), I(o, ar), S; + } finally { + he = a, Oo = !1; + } + } + return null; + } + var en = [], tn = 0, Ja = null, Ka = 0, ai = [], si = 0, Ar = null, Yi = 1, Wi = ""; + function Er(r, a) { + en[tn++] = Ka, en[tn++] = Ja, Ja = r, Ka = a; + } + function mu(r, a, u) { + ai[si++] = Yi, ai[si++] = Wi, ai[si++] = Ar, Ar = r; + var p = Yi; + r = Wi; + var S = 32 - A(p) - 1; + p &= ~(1 << S), u += 1; + var E = 32 - A(a) + S; + if (30 < E) { + var z = S - S % 5; + E = (p & (1 << z) - 1).toString(32), p >>= z, S -= z, Yi = 1 << 32 - A(a) + S | u << S | p, Wi = E + r; + } else Yi = 1 << E | u << S | p, Wi = r; + } + function Fo(r) { + r.return !== null && (Er(r, 1), mu(r, 1, 0)); + } + function zo(r) { + for (; r === Ja; ) Ja = en[--tn], en[tn] = null, Ka = en[--tn], en[tn] = null; + for (; r === Ar; ) Ar = ai[--si], ai[si] = null, Wi = ai[--si], ai[si] = null, Yi = ai[--si], ai[si] = null; + } + var Qt = null, Jt = null, ct = !1, mi = null; + function xu(r, a) { + var u = ui(5, null, null, 0); + u.elementType = "DELETED", u.stateNode = a, u.return = r, a = r.deletions, a === null ? (r.deletions = [u], r.flags |= 16) : a.push(u); + } + function vu(r, a) { + switch (r.tag) { + case 5: + var u = r.type; + return a = a.nodeType !== 1 || u.toLowerCase() !== a.nodeName.toLowerCase() ? null : a, a !== null ? (r.stateNode = a, Qt = r, Jt = ir(a.firstChild), !0) : !1; + case 6: + return a = r.pendingProps === "" || a.nodeType !== 3 ? null : a, a !== null ? (r.stateNode = a, Qt = r, Jt = null, !0) : !1; + case 13: + return a = a.nodeType !== 8 ? null : a, a !== null ? (u = Ar !== null ? { id: Yi, overflow: Wi } : null, r.memoizedState = { dehydrated: a, treeContext: u, retryLane: 1073741824 }, u = ui(18, null, null, 0), u.stateNode = a, u.return = r, r.child = u, Qt = r, Jt = null, !0) : !1; + default: + return !1; + } + } + function Ho(r) { + return (r.mode & 1) !== 0 && (r.flags & 128) === 0; + } + function Do(r) { + if (ct) { + var a = Jt; + if (a) { + var u = a; + if (!vu(r, a)) { + if (Ho(r)) throw Error(m(418)); + a = ir(u.nextSibling); + var p = Qt; + a && vu(r, a) ? xu(p, u) : (r.flags = r.flags & -4097 | 2, ct = !1, Qt = r); + } + } else { + if (Ho(r)) throw Error(m(418)); + r.flags = r.flags & -4097 | 2, ct = !1, Qt = r; + } + } + } + function yu(r) { + for (r = r.return; r !== null && r.tag !== 5 && r.tag !== 3 && r.tag !== 13; ) r = r.return; + Qt = r; + } + function es(r) { + if (r !== Qt) return !1; + if (!ct) return yu(r), ct = !0, !1; + var a; + if ((a = r.tag !== 3) && !(a = r.tag !== 5) && (a = r.type, a = a !== "head" && a !== "body" && !Lo(r.type, r.memoizedProps)), a && (a = Jt)) { + if (Ho(r)) throw bu(), Error(m(418)); + for (; a; ) xu(r, a), a = ir(a.nextSibling); + } + if (yu(r), r.tag === 13) { + if (r = r.memoizedState, r = r !== null ? r.dehydrated : null, !r) throw Error(m(317)); + e: { + for (r = r.nextSibling, a = 0; r; ) { + if (r.nodeType === 8) { + var u = r.data; + if (u === "/$") { + if (a === 0) { + Jt = ir(r.nextSibling); + break e; + } + a--; + } else u !== "$" && u !== "$!" && u !== "$?" || a++; + } + r = r.nextSibling; + } + Jt = null; + } + } else Jt = Qt ? ir(r.stateNode.nextSibling) : null; + return !0; + } + function bu() { + for (var r = Jt; r; ) r = ir(r.nextSibling); + } + function rn() { + Jt = Qt = null, ct = !1; + } + function _o(r) { + mi === null ? mi = [r] : mi.push(r); + } + var Zg = ye.ReactCurrentBatchConfig; + function $n(r, a, u) { + if (r = u.ref, r !== null && typeof r != "function" && typeof r != "object") { + if (u._owner) { + if (u = u._owner, u) { + if (u.tag !== 1) throw Error(m(309)); + var p = u.stateNode; + } + if (!p) throw Error(m(147, r)); + var S = p, E = "" + r; + return a !== null && a.ref !== null && typeof a.ref == "function" && a.ref._stringRef === E ? a.ref : (a = function(z) { + var Y = S.refs; + z === null ? delete Y[E] : Y[E] = z; + }, a._stringRef = E, a); + } + if (typeof r != "string") throw Error(m(284)); + if (!u._owner) throw Error(m(290, r)); + } + return r; + } + function ts(r, a) { + throw r = Object.prototype.toString.call(a), Error(m(31, r === "[object Object]" ? "object with keys {" + Object.keys(a).join(", ") + "}" : r)); + } + function wu(r) { + var a = r._init; + return a(r._payload); + } + function Su(r) { + function a(J, q) { + if (r) { + var K = J.deletions; + K === null ? (J.deletions = [q], J.flags |= 16) : K.push(q); + } + } + function u(J, q) { + if (!r) return null; + for (; q !== null; ) a(J, q), q = q.sibling; + return null; + } + function p(J, q) { + for (J = /* @__PURE__ */ new Map(); q !== null; ) q.key !== null ? J.set(q.key, q) : J.set(q.index, q), q = q.sibling; + return J; + } + function S(J, q) { + return J = fr(J, q), J.index = 0, J.sibling = null, J; + } + function E(J, q, K) { + return J.index = K, r ? (K = J.alternate, K !== null ? (K = K.index, K < q ? (J.flags |= 2, q) : K) : (J.flags |= 2, q)) : (J.flags |= 1048576, q); + } + function z(J) { + return r && J.alternate === null && (J.flags |= 2), J; + } + function Y(J, q, K, xe) { + return q === null || q.tag !== 6 ? (q = Rl(K, J.mode, xe), q.return = J, q) : (q = S(q, K), q.return = J, q); + } + function $(J, q, K, xe) { + var Pe = K.type; + return Pe === De ? fe(J, q, K.props.children, xe, K.key) : q !== null && (q.elementType === Pe || typeof Pe == "object" && Pe !== null && Pe.$$typeof === St && wu(Pe) === q.type) ? (xe = S(q, K.props), xe.ref = $n(J, q, K), xe.return = J, xe) : (xe = As(K.type, K.key, K.props, null, J.mode, xe), xe.ref = $n(J, q, K), xe.return = J, xe); + } + function ie(J, q, K, xe) { + return q === null || q.tag !== 4 || q.stateNode.containerInfo !== K.containerInfo || q.stateNode.implementation !== K.implementation ? (q = Il(K, J.mode, xe), q.return = J, q) : (q = S(q, K.children || []), q.return = J, q); + } + function fe(J, q, K, xe, Pe) { + return q === null || q.tag !== 7 ? (q = Or(K, J.mode, xe, Pe), q.return = J, q) : (q = S(q, K), q.return = J, q); + } + function ge(J, q, K) { + if (typeof q == "string" && q !== "" || typeof q == "number") return q = Rl("" + q, J.mode, K), q.return = J, q; + if (typeof q == "object" && q !== null) { + switch (q.$$typeof) { + case W: + return K = As(q.type, q.key, q.props, null, J.mode, K), K.ref = $n(J, null, q), K.return = J, K; + case ke: + return q = Il(q, J.mode, K), q.return = J, q; + case St: + var xe = q._init; + return ge(J, xe(q._payload), K); + } + if (vr(q) || Le(q)) return q = Or(q, J.mode, K, null), q.return = J, q; + ts(J, q); + } + return null; + } + function de(J, q, K, xe) { + var Pe = q !== null ? q.key : null; + if (typeof K == "string" && K !== "" || typeof K == "number") return Pe !== null ? null : Y(J, q, "" + K, xe); + if (typeof K == "object" && K !== null) { + switch (K.$$typeof) { + case W: + return K.key === Pe ? $(J, q, K, xe) : null; + case ke: + return K.key === Pe ? ie(J, q, K, xe) : null; + case St: + return Pe = K._init, de( + J, + q, + Pe(K._payload), + xe + ); + } + if (vr(K) || Le(K)) return Pe !== null ? null : fe(J, q, K, xe, null); + ts(J, K); + } + return null; + } + function we(J, q, K, xe, Pe) { + if (typeof xe == "string" && xe !== "" || typeof xe == "number") return J = J.get(K) || null, Y(q, J, "" + xe, Pe); + if (typeof xe == "object" && xe !== null) { + switch (xe.$$typeof) { + case W: + return J = J.get(xe.key === null ? K : xe.key) || null, $(q, J, xe, Pe); + case ke: + return J = J.get(xe.key === null ? K : xe.key) || null, ie(q, J, xe, Pe); + case St: + var Re = xe._init; + return we(J, q, K, Re(xe._payload), Pe); + } + if (vr(xe) || Le(xe)) return J = J.get(K) || null, fe(q, J, xe, Pe, null); + ts(q, xe); + } + return null; + } + function Ae(J, q, K, xe) { + for (var Pe = null, Re = null, Ie = q, Ne = q = 0, At = null; Ie !== null && Ne < K.length; Ne++) { + Ie.index > Ne ? (At = Ie, Ie = null) : At = Ie.sibling; + var qe = de(J, Ie, K[Ne], xe); + if (qe === null) { + Ie === null && (Ie = At); + break; + } + r && Ie && qe.alternate === null && a(J, Ie), q = E(qe, q, Ne), Re === null ? Pe = qe : Re.sibling = qe, Re = qe, Ie = At; + } + if (Ne === K.length) return u(J, Ie), ct && Er(J, Ne), Pe; + if (Ie === null) { + for (; Ne < K.length; Ne++) Ie = ge(J, K[Ne], xe), Ie !== null && (q = E(Ie, q, Ne), Re === null ? Pe = Ie : Re.sibling = Ie, Re = Ie); + return ct && Er(J, Ne), Pe; + } + for (Ie = p(J, Ie); Ne < K.length; Ne++) At = we(Ie, J, Ne, K[Ne], xe), At !== null && (r && At.alternate !== null && Ie.delete(At.key === null ? Ne : At.key), q = E(At, q, Ne), Re === null ? Pe = At : Re.sibling = At, Re = At); + return r && Ie.forEach(function(gr) { + return a(J, gr); + }), ct && Er(J, Ne), Pe; + } + function Ee(J, q, K, xe) { + var Pe = Le(K); + if (typeof Pe != "function") throw Error(m(150)); + if (K = Pe.call(K), K == null) throw Error(m(151)); + for (var Re = Pe = null, Ie = q, Ne = q = 0, At = null, qe = K.next(); Ie !== null && !qe.done; Ne++, qe = K.next()) { + Ie.index > Ne ? (At = Ie, Ie = null) : At = Ie.sibling; + var gr = de(J, Ie, qe.value, xe); + if (gr === null) { + Ie === null && (Ie = At); + break; + } + r && Ie && gr.alternate === null && a(J, Ie), q = E(gr, q, Ne), Re === null ? Pe = gr : Re.sibling = gr, Re = gr, Ie = At; + } + if (qe.done) return u( + J, + Ie + ), ct && Er(J, Ne), Pe; + if (Ie === null) { + for (; !qe.done; Ne++, qe = K.next()) qe = ge(J, qe.value, xe), qe !== null && (q = E(qe, q, Ne), Re === null ? Pe = qe : Re.sibling = qe, Re = qe); + return ct && Er(J, Ne), Pe; + } + for (Ie = p(J, Ie); !qe.done; Ne++, qe = K.next()) qe = we(Ie, J, Ne, qe.value, xe), qe !== null && (r && qe.alternate !== null && Ie.delete(qe.key === null ? Ne : qe.key), q = E(qe, q, Ne), Re === null ? Pe = qe : Re.sibling = qe, Re = qe); + return r && Ie.forEach(function(Lp) { + return a(J, Lp); + }), ct && Er(J, Ne), Pe; + } + function pt(J, q, K, xe) { + if (typeof K == "object" && K !== null && K.type === De && K.key === null && (K = K.props.children), typeof K == "object" && K !== null) { + switch (K.$$typeof) { + case W: + e: { + for (var Pe = K.key, Re = q; Re !== null; ) { + if (Re.key === Pe) { + if (Pe = K.type, Pe === De) { + if (Re.tag === 7) { + u(J, Re.sibling), q = S(Re, K.props.children), q.return = J, J = q; + break e; + } + } else if (Re.elementType === Pe || typeof Pe == "object" && Pe !== null && Pe.$$typeof === St && wu(Pe) === Re.type) { + u(J, Re.sibling), q = S(Re, K.props), q.ref = $n(J, Re, K), q.return = J, J = q; + break e; + } + u(J, Re); + break; + } else a(J, Re); + Re = Re.sibling; + } + K.type === De ? (q = Or(K.props.children, J.mode, xe, K.key), q.return = J, J = q) : (xe = As(K.type, K.key, K.props, null, J.mode, xe), xe.ref = $n(J, q, K), xe.return = J, J = xe); + } + return z(J); + case ke: + e: { + for (Re = K.key; q !== null; ) { + if (q.key === Re) if (q.tag === 4 && q.stateNode.containerInfo === K.containerInfo && q.stateNode.implementation === K.implementation) { + u(J, q.sibling), q = S(q, K.children || []), q.return = J, J = q; + break e; + } else { + u(J, q); + break; + } + else a(J, q); + q = q.sibling; + } + q = Il(K, J.mode, xe), q.return = J, J = q; + } + return z(J); + case St: + return Re = K._init, pt(J, q, Re(K._payload), xe); + } + if (vr(K)) return Ae(J, q, K, xe); + if (Le(K)) return Ee(J, q, K, xe); + ts(J, K); + } + return typeof K == "string" && K !== "" || typeof K == "number" ? (K = "" + K, q !== null && q.tag === 6 ? (u(J, q.sibling), q = S(q, K), q.return = J, J = q) : (u(J, q), q = Rl(K, J.mode, xe), q.return = J, J = q), z(J)) : u(J, q); + } + return pt; + } + var nn = Su(!0), ku = Su(!1), is = rr(null), rs = null, an = null, Bo = null; + function Xo() { + Bo = an = rs = null; + } + function Yo(r) { + var a = is.current; + ot(is), r._currentValue = a; + } + function Wo(r, a, u) { + for (; r !== null; ) { + var p = r.alternate; + if ((r.childLanes & a) !== a ? (r.childLanes |= a, p !== null && (p.childLanes |= a)) : p !== null && (p.childLanes & a) !== a && (p.childLanes |= a), r === u) break; + r = r.return; + } + } + function sn(r, a) { + rs = r, Bo = an = null, r = r.dependencies, r !== null && r.firstContext !== null && ((r.lanes & a) !== 0 && (jt = !0), r.firstContext = null); + } + function oi(r) { + var a = r._currentValue; + if (Bo !== r) if (r = { context: r, memoizedValue: a, next: null }, an === null) { + if (rs === null) throw Error(m(308)); + an = r, rs.dependencies = { lanes: 0, firstContext: r }; + } else an = an.next = r; + return a; + } + var Tr = null; + function jo(r) { + Tr === null ? Tr = [r] : Tr.push(r); + } + function Cu(r, a, u, p) { + var S = a.interleaved; + return S === null ? (u.next = u, jo(a)) : (u.next = S.next, S.next = u), a.interleaved = u, ji(r, p); + } + function ji(r, a) { + r.lanes |= a; + var u = r.alternate; + for (u !== null && (u.lanes |= a), u = r, r = r.return; r !== null; ) r.childLanes |= a, u = r.alternate, u !== null && (u.childLanes |= a), u = r, r = r.return; + return u.tag === 3 ? u.stateNode : null; + } + var sr = !1; + function Go(r) { + r.updateQueue = { baseState: r.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; + } + function Au(r, a) { + r = r.updateQueue, a.updateQueue === r && (a.updateQueue = { baseState: r.baseState, firstBaseUpdate: r.firstBaseUpdate, lastBaseUpdate: r.lastBaseUpdate, shared: r.shared, effects: r.effects }); + } + function Gi(r, a) { + return { eventTime: r, lane: a, tag: 0, payload: null, callback: null, next: null }; + } + function or(r, a, u) { + var p = r.updateQueue; + if (p === null) return null; + if (p = p.shared, ($e & 2) !== 0) { + var S = p.pending; + return S === null ? a.next = a : (a.next = S.next, S.next = a), p.pending = a, ji(r, u); + } + return S = p.interleaved, S === null ? (a.next = a, jo(p)) : (a.next = S.next, S.next = a), p.interleaved = a, ji(r, u); + } + function ns(r, a, u) { + if (a = a.updateQueue, a !== null && (a = a.shared, (u & 4194240) !== 0)) { + var p = a.lanes; + p &= r.pendingLanes, u |= p, a.lanes = u, ae(r, u); + } + } + function Eu(r, a) { + var u = r.updateQueue, p = r.alternate; + if (p !== null && (p = p.updateQueue, u === p)) { + var S = null, E = null; + if (u = u.firstBaseUpdate, u !== null) { + do { + var z = { eventTime: u.eventTime, lane: u.lane, tag: u.tag, payload: u.payload, callback: u.callback, next: null }; + E === null ? S = E = z : E = E.next = z, u = u.next; + } while (u !== null); + E === null ? S = E = a : E = E.next = a; + } else S = E = a; + u = { baseState: p.baseState, firstBaseUpdate: S, lastBaseUpdate: E, shared: p.shared, effects: p.effects }, r.updateQueue = u; + return; + } + r = u.lastBaseUpdate, r === null ? u.firstBaseUpdate = a : r.next = a, u.lastBaseUpdate = a; + } + function as(r, a, u, p) { + var S = r.updateQueue; + sr = !1; + var E = S.firstBaseUpdate, z = S.lastBaseUpdate, Y = S.shared.pending; + if (Y !== null) { + S.shared.pending = null; + var $ = Y, ie = $.next; + $.next = null, z === null ? E = ie : z.next = ie, z = $; + var fe = r.alternate; + fe !== null && (fe = fe.updateQueue, Y = fe.lastBaseUpdate, Y !== z && (Y === null ? fe.firstBaseUpdate = ie : Y.next = ie, fe.lastBaseUpdate = $)); + } + if (E !== null) { + var ge = S.baseState; + z = 0, fe = ie = $ = null, Y = E; + do { + var de = Y.lane, we = Y.eventTime; + if ((p & de) === de) { + fe !== null && (fe = fe.next = { + eventTime: we, + lane: 0, + tag: Y.tag, + payload: Y.payload, + callback: Y.callback, + next: null + }); + e: { + var Ae = r, Ee = Y; + switch (de = a, we = u, Ee.tag) { + case 1: + if (Ae = Ee.payload, typeof Ae == "function") { + ge = Ae.call(we, ge, de); + break e; + } + ge = Ae; + break e; + case 3: + Ae.flags = Ae.flags & -65537 | 128; + case 0: + if (Ae = Ee.payload, de = typeof Ae == "function" ? Ae.call(we, ge, de) : Ae, de == null) break e; + ge = Se({}, ge, de); + break e; + case 2: + sr = !0; + } + } + Y.callback !== null && Y.lane !== 0 && (r.flags |= 64, de = S.effects, de === null ? S.effects = [Y] : de.push(Y)); + } else we = { eventTime: we, lane: de, tag: Y.tag, payload: Y.payload, callback: Y.callback, next: null }, fe === null ? (ie = fe = we, $ = ge) : fe = fe.next = we, z |= de; + if (Y = Y.next, Y === null) { + if (Y = S.shared.pending, Y === null) break; + de = Y, Y = de.next, de.next = null, S.lastBaseUpdate = de, S.shared.pending = null; + } + } while (!0); + if (fe === null && ($ = ge), S.baseState = $, S.firstBaseUpdate = ie, S.lastBaseUpdate = fe, a = S.shared.interleaved, a !== null) { + S = a; + do + z |= S.lane, S = S.next; + while (S !== a); + } else E === null && (S.shared.lanes = 0); + Rr |= z, r.lanes = z, r.memoizedState = ge; + } + } + function Tu(r, a, u) { + if (r = a.effects, a.effects = null, r !== null) for (a = 0; a < r.length; a++) { + var p = r[a], S = p.callback; + if (S !== null) { + if (p.callback = null, p = u, typeof S != "function") throw Error(m(191, S)); + S.call(p); + } + } + } + var qn = {}, Ei = rr(qn), Zn = rr(qn), Qn = rr(qn); + function Pr(r) { + if (r === qn) throw Error(m(174)); + return r; + } + function Vo(r, a) { + switch (at(Qn, a), at(Zn, r), at(Ei, qn), r = a.nodeType, r) { + case 9: + case 11: + a = (a = a.documentElement) ? a.namespaceURI : wn(null, ""); + break; + default: + r = r === 8 ? a.parentNode : a, a = r.namespaceURI || null, r = r.tagName, a = wn(a, r); + } + ot(Ei), at(Ei, a); + } + function on() { + ot(Ei), ot(Zn), ot(Qn); + } + function Pu(r) { + Pr(Qn.current); + var a = Pr(Ei.current), u = wn(a, r.type); + a !== u && (at(Zn, r), at(Ei, u)); + } + function Uo(r) { + Zn.current === r && (ot(Ei), ot(Zn)); + } + var ut = rr(0); + function ss(r) { + for (var a = r; a !== null; ) { + if (a.tag === 13) { + var u = a.memoizedState; + if (u !== null && (u = u.dehydrated, u === null || u.data === "$?" || u.data === "$!")) return a; + } else if (a.tag === 19 && a.memoizedProps.revealOrder !== void 0) { + if ((a.flags & 128) !== 0) return a; + } else if (a.child !== null) { + a.child.return = a, a = a.child; + continue; + } + if (a === r) break; + for (; a.sibling === null; ) { + if (a.return === null || a.return === r) return null; + a = a.return; + } + a.sibling.return = a.return, a = a.sibling; + } + return null; + } + var $o = []; + function qo() { + for (var r = 0; r < $o.length; r++) $o[r]._workInProgressVersionPrimary = null; + $o.length = 0; + } + var os = ye.ReactCurrentDispatcher, Zo = ye.ReactCurrentBatchConfig, Lr = 0, ht = null, yt = null, kt = null, ls = !1, Jn = !1, Kn = 0, Qg = 0; + function Nt() { + throw Error(m(321)); + } + function Qo(r, a) { + if (a === null) return !1; + for (var u = 0; u < a.length && u < r.length; u++) if (!pi(r[u], a[u])) return !1; + return !0; + } + function Jo(r, a, u, p, S, E) { + if (Lr = E, ht = a, a.memoizedState = null, a.updateQueue = null, a.lanes = 0, os.current = r === null || r.memoizedState === null ? tp : ip, r = u(p, S), Jn) { + E = 0; + do { + if (Jn = !1, Kn = 0, 25 <= E) throw Error(m(301)); + E += 1, kt = yt = null, a.updateQueue = null, os.current = rp, r = u(p, S); + } while (Jn); + } + if (os.current = hs, a = yt !== null && yt.next !== null, Lr = 0, kt = yt = ht = null, ls = !1, a) throw Error(m(300)); + return r; + } + function Ko() { + var r = Kn !== 0; + return Kn = 0, r; + } + function Ti() { + var r = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; + return kt === null ? ht.memoizedState = kt = r : kt = kt.next = r, kt; + } + function li() { + if (yt === null) { + var r = ht.alternate; + r = r !== null ? r.memoizedState : null; + } else r = yt.next; + var a = kt === null ? ht.memoizedState : kt.next; + if (a !== null) kt = a, yt = r; + else { + if (r === null) throw Error(m(310)); + yt = r, r = { memoizedState: yt.memoizedState, baseState: yt.baseState, baseQueue: yt.baseQueue, queue: yt.queue, next: null }, kt === null ? ht.memoizedState = kt = r : kt = kt.next = r; + } + return kt; + } + function ea(r, a) { + return typeof a == "function" ? a(r) : a; + } + function el(r) { + var a = li(), u = a.queue; + if (u === null) throw Error(m(311)); + u.lastRenderedReducer = r; + var p = yt, S = p.baseQueue, E = u.pending; + if (E !== null) { + if (S !== null) { + var z = S.next; + S.next = E.next, E.next = z; + } + p.baseQueue = S = E, u.pending = null; + } + if (S !== null) { + E = S.next, p = p.baseState; + var Y = z = null, $ = null, ie = E; + do { + var fe = ie.lane; + if ((Lr & fe) === fe) $ !== null && ($ = $.next = { lane: 0, action: ie.action, hasEagerState: ie.hasEagerState, eagerState: ie.eagerState, next: null }), p = ie.hasEagerState ? ie.eagerState : r(p, ie.action); + else { + var ge = { + lane: fe, + action: ie.action, + hasEagerState: ie.hasEagerState, + eagerState: ie.eagerState, + next: null + }; + $ === null ? (Y = $ = ge, z = p) : $ = $.next = ge, ht.lanes |= fe, Rr |= fe; + } + ie = ie.next; + } while (ie !== null && ie !== E); + $ === null ? z = p : $.next = Y, pi(p, a.memoizedState) || (jt = !0), a.memoizedState = p, a.baseState = z, a.baseQueue = $, u.lastRenderedState = p; + } + if (r = u.interleaved, r !== null) { + S = r; + do + E = S.lane, ht.lanes |= E, Rr |= E, S = S.next; + while (S !== r); + } else S === null && (u.lanes = 0); + return [a.memoizedState, u.dispatch]; + } + function tl(r) { + var a = li(), u = a.queue; + if (u === null) throw Error(m(311)); + u.lastRenderedReducer = r; + var p = u.dispatch, S = u.pending, E = a.memoizedState; + if (S !== null) { + u.pending = null; + var z = S = S.next; + do + E = r(E, z.action), z = z.next; + while (z !== S); + pi(E, a.memoizedState) || (jt = !0), a.memoizedState = E, a.baseQueue === null && (a.baseState = E), u.lastRenderedState = E; + } + return [E, p]; + } + function Lu() { + } + function Ru(r, a) { + var u = ht, p = li(), S = a(), E = !pi(p.memoizedState, S); + if (E && (p.memoizedState = S, jt = !0), p = p.queue, il(Nu.bind(null, u, p, r), [r]), p.getSnapshot !== a || E || kt !== null && kt.memoizedState.tag & 1) { + if (u.flags |= 2048, ta(9, Mu.bind(null, u, p, S, a), void 0, null), Ct === null) throw Error(m(349)); + (Lr & 30) !== 0 || Iu(u, a, S); + } + return S; + } + function Iu(r, a, u) { + r.flags |= 16384, r = { getSnapshot: a, value: u }, a = ht.updateQueue, a === null ? (a = { lastEffect: null, stores: null }, ht.updateQueue = a, a.stores = [r]) : (u = a.stores, u === null ? a.stores = [r] : u.push(r)); + } + function Mu(r, a, u, p) { + a.value = u, a.getSnapshot = p, Ou(a) && Fu(r); + } + function Nu(r, a, u) { + return u(function() { + Ou(a) && Fu(r); + }); + } + function Ou(r) { + var a = r.getSnapshot; + r = r.value; + try { + var u = a(); + return !pi(r, u); + } catch { + return !0; + } + } + function Fu(r) { + var a = ji(r, 1); + a !== null && bi(a, r, 1, -1); + } + function zu(r) { + var a = Ti(); + return typeof r == "function" && (r = r()), a.memoizedState = a.baseState = r, r = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: ea, lastRenderedState: r }, a.queue = r, r = r.dispatch = ep.bind(null, ht, r), [a.memoizedState, r]; + } + function ta(r, a, u, p) { + return r = { tag: r, create: a, destroy: u, deps: p, next: null }, a = ht.updateQueue, a === null ? (a = { lastEffect: null, stores: null }, ht.updateQueue = a, a.lastEffect = r.next = r) : (u = a.lastEffect, u === null ? a.lastEffect = r.next = r : (p = u.next, u.next = r, r.next = p, a.lastEffect = r)), r; + } + function Hu() { + return li().memoizedState; + } + function cs(r, a, u, p) { + var S = Ti(); + ht.flags |= r, S.memoizedState = ta(1 | a, u, void 0, p === void 0 ? null : p); + } + function us(r, a, u, p) { + var S = li(); + p = p === void 0 ? null : p; + var E = void 0; + if (yt !== null) { + var z = yt.memoizedState; + if (E = z.destroy, p !== null && Qo(p, z.deps)) { + S.memoizedState = ta(a, u, E, p); + return; + } + } + ht.flags |= r, S.memoizedState = ta(1 | a, u, E, p); + } + function Du(r, a) { + return cs(8390656, 8, r, a); + } + function il(r, a) { + return us(2048, 8, r, a); + } + function _u(r, a) { + return us(4, 2, r, a); + } + function Bu(r, a) { + return us(4, 4, r, a); + } + function Xu(r, a) { + if (typeof a == "function") return r = r(), a(r), function() { + a(null); + }; + if (a != null) return r = r(), a.current = r, function() { + a.current = null; + }; + } + function Yu(r, a, u) { + return u = u != null ? u.concat([r]) : null, us(4, 4, Xu.bind(null, a, r), u); + } + function rl() { + } + function Wu(r, a) { + var u = li(); + a = a === void 0 ? null : a; + var p = u.memoizedState; + return p !== null && a !== null && Qo(a, p[1]) ? p[0] : (u.memoizedState = [r, a], r); + } + function ju(r, a) { + var u = li(); + a = a === void 0 ? null : a; + var p = u.memoizedState; + return p !== null && a !== null && Qo(a, p[1]) ? p[0] : (r = r(), u.memoizedState = [r, a], r); + } + function Gu(r, a, u) { + return (Lr & 21) === 0 ? (r.baseState && (r.baseState = !1, jt = !0), r.memoizedState = u) : (pi(u, a) || (u = U(), ht.lanes |= u, Rr |= u, r.baseState = !0), a); + } + function Jg(r, a) { + var u = he; + he = u !== 0 && 4 > u ? u : 4, r(!0); + var p = Zo.transition; + Zo.transition = {}; + try { + r(!1), a(); + } finally { + he = u, Zo.transition = p; + } + } + function Vu() { + return li().memoizedState; + } + function Kg(r, a, u) { + var p = hr(r); + if (u = { lane: p, action: u, hasEagerState: !1, eagerState: null, next: null }, Uu(r)) $u(a, u); + else if (u = Cu(r, a, u, p), u !== null) { + var S = Bt(); + bi(u, r, p, S), qu(u, a, p); + } + } + function ep(r, a, u) { + var p = hr(r), S = { lane: p, action: u, hasEagerState: !1, eagerState: null, next: null }; + if (Uu(r)) $u(a, S); + else { + var E = r.alternate; + if (r.lanes === 0 && (E === null || E.lanes === 0) && (E = a.lastRenderedReducer, E !== null)) try { + var z = a.lastRenderedState, Y = E(z, u); + if (S.hasEagerState = !0, S.eagerState = Y, pi(Y, z)) { + var $ = a.interleaved; + $ === null ? (S.next = S, jo(a)) : (S.next = $.next, $.next = S), a.interleaved = S; + return; + } + } catch { + } finally { + } + u = Cu(r, a, S, p), u !== null && (S = Bt(), bi(u, r, p, S), qu(u, a, p)); + } + } + function Uu(r) { + var a = r.alternate; + return r === ht || a !== null && a === ht; + } + function $u(r, a) { + Jn = ls = !0; + var u = r.pending; + u === null ? a.next = a : (a.next = u.next, u.next = a), r.pending = a; + } + function qu(r, a, u) { + if ((u & 4194240) !== 0) { + var p = a.lanes; + p &= r.pendingLanes, u |= p, a.lanes = u, ae(r, u); + } + } + var hs = { readContext: oi, useCallback: Nt, useContext: Nt, useEffect: Nt, useImperativeHandle: Nt, useInsertionEffect: Nt, useLayoutEffect: Nt, useMemo: Nt, useReducer: Nt, useRef: Nt, useState: Nt, useDebugValue: Nt, useDeferredValue: Nt, useTransition: Nt, useMutableSource: Nt, useSyncExternalStore: Nt, useId: Nt, unstable_isNewReconciler: !1 }, tp = { readContext: oi, useCallback: function(r, a) { + return Ti().memoizedState = [r, a === void 0 ? null : a], r; + }, useContext: oi, useEffect: Du, useImperativeHandle: function(r, a, u) { + return u = u != null ? u.concat([r]) : null, cs( + 4194308, + 4, + Xu.bind(null, a, r), + u + ); + }, useLayoutEffect: function(r, a) { + return cs(4194308, 4, r, a); + }, useInsertionEffect: function(r, a) { + return cs(4, 2, r, a); + }, useMemo: function(r, a) { + var u = Ti(); + return a = a === void 0 ? null : a, r = r(), u.memoizedState = [r, a], r; + }, useReducer: function(r, a, u) { + var p = Ti(); + return a = u !== void 0 ? u(a) : a, p.memoizedState = p.baseState = a, r = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: r, lastRenderedState: a }, p.queue = r, r = r.dispatch = Kg.bind(null, ht, r), [p.memoizedState, r]; + }, useRef: function(r) { + var a = Ti(); + return r = { current: r }, a.memoizedState = r; + }, useState: zu, useDebugValue: rl, useDeferredValue: function(r) { + return Ti().memoizedState = r; + }, useTransition: function() { + var r = zu(!1), a = r[0]; + return r = Jg.bind(null, r[1]), Ti().memoizedState = r, [a, r]; + }, useMutableSource: function() { + }, useSyncExternalStore: function(r, a, u) { + var p = ht, S = Ti(); + if (ct) { + if (u === void 0) throw Error(m(407)); + u = u(); + } else { + if (u = a(), Ct === null) throw Error(m(349)); + (Lr & 30) !== 0 || Iu(p, a, u); + } + S.memoizedState = u; + var E = { value: u, getSnapshot: a }; + return S.queue = E, Du(Nu.bind( + null, + p, + E, + r + ), [r]), p.flags |= 2048, ta(9, Mu.bind(null, p, E, u, a), void 0, null), u; + }, useId: function() { + var r = Ti(), a = Ct.identifierPrefix; + if (ct) { + var u = Wi, p = Yi; + u = (p & ~(1 << 32 - A(p) - 1)).toString(32) + u, a = ":" + a + "R" + u, u = Kn++, 0 < u && (a += "H" + u.toString(32)), a += ":"; + } else u = Qg++, a = ":" + a + "r" + u.toString(32) + ":"; + return r.memoizedState = a; + }, unstable_isNewReconciler: !1 }, ip = { + readContext: oi, + useCallback: Wu, + useContext: oi, + useEffect: il, + useImperativeHandle: Yu, + useInsertionEffect: _u, + useLayoutEffect: Bu, + useMemo: ju, + useReducer: el, + useRef: Hu, + useState: function() { + return el(ea); + }, + useDebugValue: rl, + useDeferredValue: function(r) { + var a = li(); + return Gu(a, yt.memoizedState, r); + }, + useTransition: function() { + var r = el(ea)[0], a = li().memoizedState; + return [r, a]; + }, + useMutableSource: Lu, + useSyncExternalStore: Ru, + useId: Vu, + unstable_isNewReconciler: !1 + }, rp = { readContext: oi, useCallback: Wu, useContext: oi, useEffect: il, useImperativeHandle: Yu, useInsertionEffect: _u, useLayoutEffect: Bu, useMemo: ju, useReducer: tl, useRef: Hu, useState: function() { + return tl(ea); + }, useDebugValue: rl, useDeferredValue: function(r) { + var a = li(); + return yt === null ? a.memoizedState = r : Gu(a, yt.memoizedState, r); + }, useTransition: function() { + var r = tl(ea)[0], a = li().memoizedState; + return [r, a]; + }, useMutableSource: Lu, useSyncExternalStore: Ru, useId: Vu, unstable_isNewReconciler: !1 }; + function xi(r, a) { + if (r && r.defaultProps) { + a = Se({}, a), r = r.defaultProps; + for (var u in r) a[u] === void 0 && (a[u] = r[u]); + return a; + } + return a; + } + function nl(r, a, u, p) { + a = r.memoizedState, u = u(p, a), u = u == null ? a : Se({}, a, u), r.memoizedState = u, r.lanes === 0 && (r.updateQueue.baseState = u); + } + var ds = { isMounted: function(r) { + return (r = r._reactInternals) ? _i(r) === r : !1; + }, enqueueSetState: function(r, a, u) { + r = r._reactInternals; + var p = Bt(), S = hr(r), E = Gi(p, S); + E.payload = a, u != null && (E.callback = u), a = or(r, E, S), a !== null && (bi(a, r, S, p), ns(a, r, S)); + }, enqueueReplaceState: function(r, a, u) { + r = r._reactInternals; + var p = Bt(), S = hr(r), E = Gi(p, S); + E.tag = 1, E.payload = a, u != null && (E.callback = u), a = or(r, E, S), a !== null && (bi(a, r, S, p), ns(a, r, S)); + }, enqueueForceUpdate: function(r, a) { + r = r._reactInternals; + var u = Bt(), p = hr(r), S = Gi(u, p); + S.tag = 2, a != null && (S.callback = a), a = or(r, S, p), a !== null && (bi(a, r, p, u), ns(a, r, p)); + } }; + function Zu(r, a, u, p, S, E, z) { + return r = r.stateNode, typeof r.shouldComponentUpdate == "function" ? r.shouldComponentUpdate(p, E, z) : a.prototype && a.prototype.isPureReactComponent ? !Xn(u, p) || !Xn(S, E) : !0; + } + function Qu(r, a, u) { + var p = !1, S = nr, E = a.contextType; + return typeof E == "object" && E !== null ? E = oi(E) : (S = Wt(a) ? Cr : Mt.current, p = a.contextTypes, E = (p = p != null) ? Kr(r, S) : nr), a = new a(u, E), r.memoizedState = a.state !== null && a.state !== void 0 ? a.state : null, a.updater = ds, r.stateNode = a, a._reactInternals = r, p && (r = r.stateNode, r.__reactInternalMemoizedUnmaskedChildContext = S, r.__reactInternalMemoizedMaskedChildContext = E), a; + } + function Ju(r, a, u, p) { + r = a.state, typeof a.componentWillReceiveProps == "function" && a.componentWillReceiveProps(u, p), typeof a.UNSAFE_componentWillReceiveProps == "function" && a.UNSAFE_componentWillReceiveProps(u, p), a.state !== r && ds.enqueueReplaceState(a, a.state, null); + } + function al(r, a, u, p) { + var S = r.stateNode; + S.props = u, S.state = r.memoizedState, S.refs = {}, Go(r); + var E = a.contextType; + typeof E == "object" && E !== null ? S.context = oi(E) : (E = Wt(a) ? Cr : Mt.current, S.context = Kr(r, E)), S.state = r.memoizedState, E = a.getDerivedStateFromProps, typeof E == "function" && (nl(r, a, E, u), S.state = r.memoizedState), typeof a.getDerivedStateFromProps == "function" || typeof S.getSnapshotBeforeUpdate == "function" || typeof S.UNSAFE_componentWillMount != "function" && typeof S.componentWillMount != "function" || (a = S.state, typeof S.componentWillMount == "function" && S.componentWillMount(), typeof S.UNSAFE_componentWillMount == "function" && S.UNSAFE_componentWillMount(), a !== S.state && ds.enqueueReplaceState(S, S.state, null), as(r, u, S, p), S.state = r.memoizedState), typeof S.componentDidMount == "function" && (r.flags |= 4194308); + } + function ln(r, a) { + try { + var u = "", p = a; + do + u += Xe(p), p = p.return; + while (p); + var S = u; + } catch (E) { + S = ` +Error generating stack: ` + E.message + ` +` + E.stack; + } + return { value: r, source: a, stack: S, digest: null }; + } + function sl(r, a, u) { + return { value: r, source: null, stack: u ?? null, digest: a ?? null }; + } + function ol(r, a) { + try { + console.error(a.value); + } catch (u) { + setTimeout(function() { + throw u; + }); + } + } + var np = typeof WeakMap == "function" ? WeakMap : Map; + function Ku(r, a, u) { + u = Gi(-1, u), u.tag = 3, u.payload = { element: null }; + var p = a.value; + return u.callback = function() { + ys || (ys = !0, Sl = p), ol(r, a); + }, u; + } + function eh(r, a, u) { + u = Gi(-1, u), u.tag = 3; + var p = r.type.getDerivedStateFromError; + if (typeof p == "function") { + var S = a.value; + u.payload = function() { + return p(S); + }, u.callback = function() { + ol(r, a); + }; + } + var E = r.stateNode; + return E !== null && typeof E.componentDidCatch == "function" && (u.callback = function() { + ol(r, a), typeof p != "function" && (cr === null ? cr = /* @__PURE__ */ new Set([this]) : cr.add(this)); + var z = a.stack; + this.componentDidCatch(a.value, { componentStack: z !== null ? z : "" }); + }), u; + } + function th(r, a, u) { + var p = r.pingCache; + if (p === null) { + p = r.pingCache = new np(); + var S = /* @__PURE__ */ new Set(); + p.set(a, S); + } else S = p.get(a), S === void 0 && (S = /* @__PURE__ */ new Set(), p.set(a, S)); + S.has(u) || (S.add(u), r = vp.bind(null, r, a, u), a.then(r, r)); + } + function ih(r) { + do { + var a; + if ((a = r.tag === 13) && (a = r.memoizedState, a = a !== null ? a.dehydrated !== null : !0), a) return r; + r = r.return; + } while (r !== null); + return null; + } + function rh(r, a, u, p, S) { + return (r.mode & 1) === 0 ? (r === a ? r.flags |= 65536 : (r.flags |= 128, u.flags |= 131072, u.flags &= -52805, u.tag === 1 && (u.alternate === null ? u.tag = 17 : (a = Gi(-1, 1), a.tag = 2, or(u, a, 1))), u.lanes |= 1), r) : (r.flags |= 65536, r.lanes = S, r); + } + var ap = ye.ReactCurrentOwner, jt = !1; + function _t(r, a, u, p) { + a.child = r === null ? ku(a, null, u, p) : nn(a, r.child, u, p); + } + function nh(r, a, u, p, S) { + u = u.render; + var E = a.ref; + return sn(a, S), p = Jo(r, a, u, p, E, S), u = Ko(), r !== null && !jt ? (a.updateQueue = r.updateQueue, a.flags &= -2053, r.lanes &= ~S, Vi(r, a, S)) : (ct && u && Fo(a), a.flags |= 1, _t(r, a, p, S), a.child); + } + function ah(r, a, u, p, S) { + if (r === null) { + var E = u.type; + return typeof E == "function" && !Ll(E) && E.defaultProps === void 0 && u.compare === null && u.defaultProps === void 0 ? (a.tag = 15, a.type = E, sh(r, a, E, p, S)) : (r = As(u.type, null, p, a, a.mode, S), r.ref = a.ref, r.return = a, a.child = r); + } + if (E = r.child, (r.lanes & S) === 0) { + var z = E.memoizedProps; + if (u = u.compare, u = u !== null ? u : Xn, u(z, p) && r.ref === a.ref) return Vi(r, a, S); + } + return a.flags |= 1, r = fr(E, p), r.ref = a.ref, r.return = a, a.child = r; + } + function sh(r, a, u, p, S) { + if (r !== null) { + var E = r.memoizedProps; + if (Xn(E, p) && r.ref === a.ref) if (jt = !1, a.pendingProps = p = E, (r.lanes & S) !== 0) (r.flags & 131072) !== 0 && (jt = !0); + else return a.lanes = r.lanes, Vi(r, a, S); + } + return ll(r, a, u, p, S); + } + function oh(r, a, u) { + var p = a.pendingProps, S = p.children, E = r !== null ? r.memoizedState : null; + if (p.mode === "hidden") if ((a.mode & 1) === 0) a.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, at(un, Kt), Kt |= u; + else { + if ((u & 1073741824) === 0) return r = E !== null ? E.baseLanes | u : u, a.lanes = a.childLanes = 1073741824, a.memoizedState = { baseLanes: r, cachePool: null, transitions: null }, a.updateQueue = null, at(un, Kt), Kt |= r, null; + a.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, p = E !== null ? E.baseLanes : u, at(un, Kt), Kt |= p; + } + else E !== null ? (p = E.baseLanes | u, a.memoizedState = null) : p = u, at(un, Kt), Kt |= p; + return _t(r, a, S, u), a.child; + } + function lh(r, a) { + var u = a.ref; + (r === null && u !== null || r !== null && r.ref !== u) && (a.flags |= 512, a.flags |= 2097152); + } + function ll(r, a, u, p, S) { + var E = Wt(u) ? Cr : Mt.current; + return E = Kr(a, E), sn(a, S), u = Jo(r, a, u, p, E, S), p = Ko(), r !== null && !jt ? (a.updateQueue = r.updateQueue, a.flags &= -2053, r.lanes &= ~S, Vi(r, a, S)) : (ct && p && Fo(a), a.flags |= 1, _t(r, a, u, S), a.child); + } + function ch(r, a, u, p, S) { + if (Wt(u)) { + var E = !0; + Za(a); + } else E = !1; + if (sn(a, S), a.stateNode === null) gs(r, a), Qu(a, u, p), al(a, u, p, S), p = !0; + else if (r === null) { + var z = a.stateNode, Y = a.memoizedProps; + z.props = Y; + var $ = z.context, ie = u.contextType; + typeof ie == "object" && ie !== null ? ie = oi(ie) : (ie = Wt(u) ? Cr : Mt.current, ie = Kr(a, ie)); + var fe = u.getDerivedStateFromProps, ge = typeof fe == "function" || typeof z.getSnapshotBeforeUpdate == "function"; + ge || typeof z.UNSAFE_componentWillReceiveProps != "function" && typeof z.componentWillReceiveProps != "function" || (Y !== p || $ !== ie) && Ju(a, z, p, ie), sr = !1; + var de = a.memoizedState; + z.state = de, as(a, p, z, S), $ = a.memoizedState, Y !== p || de !== $ || Yt.current || sr ? (typeof fe == "function" && (nl(a, u, fe, p), $ = a.memoizedState), (Y = sr || Zu(a, u, Y, p, de, $, ie)) ? (ge || typeof z.UNSAFE_componentWillMount != "function" && typeof z.componentWillMount != "function" || (typeof z.componentWillMount == "function" && z.componentWillMount(), typeof z.UNSAFE_componentWillMount == "function" && z.UNSAFE_componentWillMount()), typeof z.componentDidMount == "function" && (a.flags |= 4194308)) : (typeof z.componentDidMount == "function" && (a.flags |= 4194308), a.memoizedProps = p, a.memoizedState = $), z.props = p, z.state = $, z.context = ie, p = Y) : (typeof z.componentDidMount == "function" && (a.flags |= 4194308), p = !1); + } else { + z = a.stateNode, Au(r, a), Y = a.memoizedProps, ie = a.type === a.elementType ? Y : xi(a.type, Y), z.props = ie, ge = a.pendingProps, de = z.context, $ = u.contextType, typeof $ == "object" && $ !== null ? $ = oi($) : ($ = Wt(u) ? Cr : Mt.current, $ = Kr(a, $)); + var we = u.getDerivedStateFromProps; + (fe = typeof we == "function" || typeof z.getSnapshotBeforeUpdate == "function") || typeof z.UNSAFE_componentWillReceiveProps != "function" && typeof z.componentWillReceiveProps != "function" || (Y !== ge || de !== $) && Ju(a, z, p, $), sr = !1, de = a.memoizedState, z.state = de, as(a, p, z, S); + var Ae = a.memoizedState; + Y !== ge || de !== Ae || Yt.current || sr ? (typeof we == "function" && (nl(a, u, we, p), Ae = a.memoizedState), (ie = sr || Zu(a, u, ie, p, de, Ae, $) || !1) ? (fe || typeof z.UNSAFE_componentWillUpdate != "function" && typeof z.componentWillUpdate != "function" || (typeof z.componentWillUpdate == "function" && z.componentWillUpdate(p, Ae, $), typeof z.UNSAFE_componentWillUpdate == "function" && z.UNSAFE_componentWillUpdate(p, Ae, $)), typeof z.componentDidUpdate == "function" && (a.flags |= 4), typeof z.getSnapshotBeforeUpdate == "function" && (a.flags |= 1024)) : (typeof z.componentDidUpdate != "function" || Y === r.memoizedProps && de === r.memoizedState || (a.flags |= 4), typeof z.getSnapshotBeforeUpdate != "function" || Y === r.memoizedProps && de === r.memoizedState || (a.flags |= 1024), a.memoizedProps = p, a.memoizedState = Ae), z.props = p, z.state = Ae, z.context = $, p = ie) : (typeof z.componentDidUpdate != "function" || Y === r.memoizedProps && de === r.memoizedState || (a.flags |= 4), typeof z.getSnapshotBeforeUpdate != "function" || Y === r.memoizedProps && de === r.memoizedState || (a.flags |= 1024), p = !1); + } + return cl(r, a, u, p, E, S); + } + function cl(r, a, u, p, S, E) { + lh(r, a); + var z = (a.flags & 128) !== 0; + if (!p && !z) return S && gu(a, u, !1), Vi(r, a, E); + p = a.stateNode, ap.current = a; + var Y = z && typeof u.getDerivedStateFromError != "function" ? null : p.render(); + return a.flags |= 1, r !== null && z ? (a.child = nn(a, r.child, null, E), a.child = nn(a, null, Y, E)) : _t(r, a, Y, E), a.memoizedState = p.state, S && gu(a, u, !0), a.child; + } + function uh(r) { + var a = r.stateNode; + a.pendingContext ? du(r, a.pendingContext, a.pendingContext !== a.context) : a.context && du(r, a.context, !1), Vo(r, a.containerInfo); + } + function hh(r, a, u, p, S) { + return rn(), _o(S), a.flags |= 256, _t(r, a, u, p), a.child; + } + var ul = { dehydrated: null, treeContext: null, retryLane: 0 }; + function hl(r) { + return { baseLanes: r, cachePool: null, transitions: null }; + } + function dh(r, a, u) { + var p = a.pendingProps, S = ut.current, E = !1, z = (a.flags & 128) !== 0, Y; + if ((Y = z) || (Y = r !== null && r.memoizedState === null ? !1 : (S & 2) !== 0), Y ? (E = !0, a.flags &= -129) : (r === null || r.memoizedState !== null) && (S |= 1), at(ut, S & 1), r === null) + return Do(a), r = a.memoizedState, r !== null && (r = r.dehydrated, r !== null) ? ((a.mode & 1) === 0 ? a.lanes = 1 : r.data === "$!" ? a.lanes = 8 : a.lanes = 1073741824, null) : (z = p.children, r = p.fallback, E ? (p = a.mode, E = a.child, z = { mode: "hidden", children: z }, (p & 1) === 0 && E !== null ? (E.childLanes = 0, E.pendingProps = z) : E = Es(z, p, 0, null), r = Or(r, p, u, null), E.return = a, r.return = a, E.sibling = r, a.child = E, a.child.memoizedState = hl(u), a.memoizedState = ul, r) : dl(a, z)); + if (S = r.memoizedState, S !== null && (Y = S.dehydrated, Y !== null)) return sp(r, a, z, p, Y, S, u); + if (E) { + E = p.fallback, z = a.mode, S = r.child, Y = S.sibling; + var $ = { mode: "hidden", children: p.children }; + return (z & 1) === 0 && a.child !== S ? (p = a.child, p.childLanes = 0, p.pendingProps = $, a.deletions = null) : (p = fr(S, $), p.subtreeFlags = S.subtreeFlags & 14680064), Y !== null ? E = fr(Y, E) : (E = Or(E, z, u, null), E.flags |= 2), E.return = a, p.return = a, p.sibling = E, a.child = p, p = E, E = a.child, z = r.child.memoizedState, z = z === null ? hl(u) : { baseLanes: z.baseLanes | u, cachePool: null, transitions: z.transitions }, E.memoizedState = z, E.childLanes = r.childLanes & ~u, a.memoizedState = ul, p; + } + return E = r.child, r = E.sibling, p = fr(E, { mode: "visible", children: p.children }), (a.mode & 1) === 0 && (p.lanes = u), p.return = a, p.sibling = null, r !== null && (u = a.deletions, u === null ? (a.deletions = [r], a.flags |= 16) : u.push(r)), a.child = p, a.memoizedState = null, p; + } + function dl(r, a) { + return a = Es({ mode: "visible", children: a }, r.mode, 0, null), a.return = r, r.child = a; + } + function fs(r, a, u, p) { + return p !== null && _o(p), nn(a, r.child, null, u), r = dl(a, a.pendingProps.children), r.flags |= 2, a.memoizedState = null, r; + } + function sp(r, a, u, p, S, E, z) { + if (u) + return a.flags & 256 ? (a.flags &= -257, p = sl(Error(m(422))), fs(r, a, z, p)) : a.memoizedState !== null ? (a.child = r.child, a.flags |= 128, null) : (E = p.fallback, S = a.mode, p = Es({ mode: "visible", children: p.children }, S, 0, null), E = Or(E, S, z, null), E.flags |= 2, p.return = a, E.return = a, p.sibling = E, a.child = p, (a.mode & 1) !== 0 && nn(a, r.child, null, z), a.child.memoizedState = hl(z), a.memoizedState = ul, E); + if ((a.mode & 1) === 0) return fs(r, a, z, null); + if (S.data === "$!") { + if (p = S.nextSibling && S.nextSibling.dataset, p) var Y = p.dgst; + return p = Y, E = Error(m(419)), p = sl(E, p, void 0), fs(r, a, z, p); + } + if (Y = (z & r.childLanes) !== 0, jt || Y) { + if (p = Ct, p !== null) { + switch (z & -z) { + case 4: + S = 2; + break; + case 16: + S = 8; + break; + 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: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + S = 32; + break; + case 536870912: + S = 268435456; + break; + default: + S = 0; + } + S = (S & (p.suspendedLanes | z)) !== 0 ? 0 : S, S !== 0 && S !== E.retryLane && (E.retryLane = S, ji(r, S), bi(p, r, S, -1)); + } + return Pl(), p = sl(Error(m(421))), fs(r, a, z, p); + } + return S.data === "$?" ? (a.flags |= 128, a.child = r.child, a = yp.bind(null, r), S._reactRetry = a, null) : (r = E.treeContext, Jt = ir(S.nextSibling), Qt = a, ct = !0, mi = null, r !== null && (ai[si++] = Yi, ai[si++] = Wi, ai[si++] = Ar, Yi = r.id, Wi = r.overflow, Ar = a), a = dl(a, p.children), a.flags |= 4096, a); + } + function fh(r, a, u) { + r.lanes |= a; + var p = r.alternate; + p !== null && (p.lanes |= a), Wo(r.return, a, u); + } + function fl(r, a, u, p, S) { + var E = r.memoizedState; + E === null ? r.memoizedState = { isBackwards: a, rendering: null, renderingStartTime: 0, last: p, tail: u, tailMode: S } : (E.isBackwards = a, E.rendering = null, E.renderingStartTime = 0, E.last = p, E.tail = u, E.tailMode = S); + } + function gh(r, a, u) { + var p = a.pendingProps, S = p.revealOrder, E = p.tail; + if (_t(r, a, p.children, u), p = ut.current, (p & 2) !== 0) p = p & 1 | 2, a.flags |= 128; + else { + if (r !== null && (r.flags & 128) !== 0) e: for (r = a.child; r !== null; ) { + if (r.tag === 13) r.memoizedState !== null && fh(r, u, a); + else if (r.tag === 19) fh(r, u, a); + else if (r.child !== null) { + r.child.return = r, r = r.child; + continue; + } + if (r === a) break e; + for (; r.sibling === null; ) { + if (r.return === null || r.return === a) break e; + r = r.return; + } + r.sibling.return = r.return, r = r.sibling; + } + p &= 1; + } + if (at(ut, p), (a.mode & 1) === 0) a.memoizedState = null; + else switch (S) { + case "forwards": + for (u = a.child, S = null; u !== null; ) r = u.alternate, r !== null && ss(r) === null && (S = u), u = u.sibling; + u = S, u === null ? (S = a.child, a.child = null) : (S = u.sibling, u.sibling = null), fl(a, !1, S, u, E); + break; + case "backwards": + for (u = null, S = a.child, a.child = null; S !== null; ) { + if (r = S.alternate, r !== null && ss(r) === null) { + a.child = S; + break; + } + r = S.sibling, S.sibling = u, u = S, S = r; + } + fl(a, !0, u, null, E); + break; + case "together": + fl(a, !1, null, null, void 0); + break; + default: + a.memoizedState = null; + } + return a.child; + } + function gs(r, a) { + (a.mode & 1) === 0 && r !== null && (r.alternate = null, a.alternate = null, a.flags |= 2); + } + function Vi(r, a, u) { + if (r !== null && (a.dependencies = r.dependencies), Rr |= a.lanes, (u & a.childLanes) === 0) return null; + if (r !== null && a.child !== r.child) throw Error(m(153)); + if (a.child !== null) { + for (r = a.child, u = fr(r, r.pendingProps), a.child = u, u.return = a; r.sibling !== null; ) r = r.sibling, u = u.sibling = fr(r, r.pendingProps), u.return = a; + u.sibling = null; + } + return a.child; + } + function op(r, a, u) { + switch (a.tag) { + case 3: + uh(a), rn(); + break; + case 5: + Pu(a); + break; + case 1: + Wt(a.type) && Za(a); + break; + case 4: + Vo(a, a.stateNode.containerInfo); + break; + case 10: + var p = a.type._context, S = a.memoizedProps.value; + at(is, p._currentValue), p._currentValue = S; + break; + case 13: + if (p = a.memoizedState, p !== null) + return p.dehydrated !== null ? (at(ut, ut.current & 1), a.flags |= 128, null) : (u & a.child.childLanes) !== 0 ? dh(r, a, u) : (at(ut, ut.current & 1), r = Vi(r, a, u), r !== null ? r.sibling : null); + at(ut, ut.current & 1); + break; + case 19: + if (p = (u & a.childLanes) !== 0, (r.flags & 128) !== 0) { + if (p) return gh(r, a, u); + a.flags |= 128; + } + if (S = a.memoizedState, S !== null && (S.rendering = null, S.tail = null, S.lastEffect = null), at(ut, ut.current), p) break; + return null; + case 22: + case 23: + return a.lanes = 0, oh(r, a, u); + } + return Vi(r, a, u); + } + var ph, gl, mh, xh; + ph = function(r, a) { + for (var u = a.child; u !== null; ) { + if (u.tag === 5 || u.tag === 6) r.appendChild(u.stateNode); + else if (u.tag !== 4 && u.child !== null) { + u.child.return = u, u = u.child; + continue; + } + if (u === a) break; + for (; u.sibling === null; ) { + if (u.return === null || u.return === a) return; + u = u.return; + } + u.sibling.return = u.return, u = u.sibling; + } + }, gl = function() { + }, mh = function(r, a, u, p) { + var S = r.memoizedProps; + if (S !== p) { + r = a.stateNode, Pr(Ei.current); + var E = null; + switch (u) { + case "input": + S = xr(r, S), p = xr(r, p), E = []; + break; + case "select": + S = Se({}, S, { value: void 0 }), p = Se({}, p, { value: void 0 }), E = []; + break; + case "textarea": + S = bn(r, S), p = bn(r, p), E = []; + break; + default: + typeof S.onClick != "function" && typeof p.onClick == "function" && (r.onclick = Ua); + } + Cn(u, p); + var z; + u = null; + for (ie in S) if (!p.hasOwnProperty(ie) && S.hasOwnProperty(ie) && S[ie] != null) if (ie === "style") { + var Y = S[ie]; + for (z in Y) Y.hasOwnProperty(z) && (u || (u = {}), u[z] = ""); + } else ie !== "dangerouslySetInnerHTML" && ie !== "children" && ie !== "suppressContentEditableWarning" && ie !== "suppressHydrationWarning" && ie !== "autoFocus" && (C.hasOwnProperty(ie) ? E || (E = []) : (E = E || []).push(ie, null)); + for (ie in p) { + var $ = p[ie]; + if (Y = S != null ? S[ie] : void 0, p.hasOwnProperty(ie) && $ !== Y && ($ != null || Y != null)) if (ie === "style") if (Y) { + for (z in Y) !Y.hasOwnProperty(z) || $ && $.hasOwnProperty(z) || (u || (u = {}), u[z] = ""); + for (z in $) $.hasOwnProperty(z) && Y[z] !== $[z] && (u || (u = {}), u[z] = $[z]); + } else u || (E || (E = []), E.push( + ie, + u + )), u = $; + else ie === "dangerouslySetInnerHTML" ? ($ = $ ? $.__html : void 0, Y = Y ? Y.__html : void 0, $ != null && Y !== $ && (E = E || []).push(ie, $)) : ie === "children" ? typeof $ != "string" && typeof $ != "number" || (E = E || []).push(ie, "" + $) : ie !== "suppressContentEditableWarning" && ie !== "suppressHydrationWarning" && (C.hasOwnProperty(ie) ? ($ != null && ie === "onScroll" && st("scroll", r), E || Y === $ || (E = [])) : (E = E || []).push(ie, $)); + } + u && (E = E || []).push("style", u); + var ie = E; + (a.updateQueue = ie) && (a.flags |= 4); + } + }, xh = function(r, a, u, p) { + u !== p && (a.flags |= 4); + }; + function ia(r, a) { + if (!ct) switch (r.tailMode) { + case "hidden": + a = r.tail; + for (var u = null; a !== null; ) a.alternate !== null && (u = a), a = a.sibling; + u === null ? r.tail = null : u.sibling = null; + break; + case "collapsed": + u = r.tail; + for (var p = null; u !== null; ) u.alternate !== null && (p = u), u = u.sibling; + p === null ? a || r.tail === null ? r.tail = null : r.tail.sibling = null : p.sibling = null; + } + } + function Ot(r) { + var a = r.alternate !== null && r.alternate.child === r.child, u = 0, p = 0; + if (a) for (var S = r.child; S !== null; ) u |= S.lanes | S.childLanes, p |= S.subtreeFlags & 14680064, p |= S.flags & 14680064, S.return = r, S = S.sibling; + else for (S = r.child; S !== null; ) u |= S.lanes | S.childLanes, p |= S.subtreeFlags, p |= S.flags, S.return = r, S = S.sibling; + return r.subtreeFlags |= p, r.childLanes = u, a; + } + function lp(r, a, u) { + var p = a.pendingProps; + switch (zo(a), a.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return Ot(a), null; + case 1: + return Wt(a.type) && qa(), Ot(a), null; + case 3: + return p = a.stateNode, on(), ot(Yt), ot(Mt), qo(), p.pendingContext && (p.context = p.pendingContext, p.pendingContext = null), (r === null || r.child === null) && (es(a) ? a.flags |= 4 : r === null || r.memoizedState.isDehydrated && (a.flags & 256) === 0 || (a.flags |= 1024, mi !== null && (Al(mi), mi = null))), gl(r, a), Ot(a), null; + case 5: + Uo(a); + var S = Pr(Qn.current); + if (u = a.type, r !== null && a.stateNode != null) mh(r, a, u, p, S), r.ref !== a.ref && (a.flags |= 512, a.flags |= 2097152); + else { + if (!p) { + if (a.stateNode === null) throw Error(m(166)); + return Ot(a), null; + } + if (r = Pr(Ei.current), es(a)) { + p = a.stateNode, u = a.type; + var E = a.memoizedProps; + switch (p[Ai] = a, p[Vn] = E, r = (a.mode & 1) !== 0, u) { + case "dialog": + st("cancel", p), st("close", p); + break; + case "iframe": + case "object": + case "embed": + st("load", p); + break; + case "video": + case "audio": + for (S = 0; S < Wn.length; S++) st(Wn[S], p); + break; + case "source": + st("error", p); + break; + case "img": + case "image": + case "link": + st( + "error", + p + ), st("load", p); + break; + case "details": + st("toggle", p); + break; + case "input": + wa(p, E), st("invalid", p); + break; + case "select": + p._wrapperState = { wasMultiple: !!E.multiple }, st("invalid", p); + break; + case "textarea": + ka(p, E), st("invalid", p); + } + Cn(u, E), S = null; + for (var z in E) if (E.hasOwnProperty(z)) { + var Y = E[z]; + z === "children" ? typeof Y == "string" ? p.textContent !== Y && (E.suppressHydrationWarning !== !0 && Va(p.textContent, Y, r), S = ["children", Y]) : typeof Y == "number" && p.textContent !== "" + Y && (E.suppressHydrationWarning !== !0 && Va( + p.textContent, + Y, + r + ), S = ["children", "" + Y]) : C.hasOwnProperty(z) && Y != null && z === "onScroll" && st("scroll", p); + } + switch (u) { + case "input": + mr(p), Xr(p, E, !0); + break; + case "textarea": + mr(p), Aa(p); + break; + case "select": + case "option": + break; + default: + typeof E.onClick == "function" && (p.onclick = Ua); + } + p = S, a.updateQueue = p, p !== null && (a.flags |= 4); + } else { + z = S.nodeType === 9 ? S : S.ownerDocument, r === "http://www.w3.org/1999/xhtml" && (r = yr(u)), r === "http://www.w3.org/1999/xhtml" ? u === "script" ? (r = z.createElement("div"), r.innerHTML = "