diff --git a/Tools/Controller/go.mod b/Tools/Controller/go.mod index 4d3a9e66..e3fdd519 100644 --- a/Tools/Controller/go.mod +++ b/Tools/Controller/go.mod @@ -1,21 +1,23 @@ module pccontroller.local/controller -go 1.27.2 +go 1.27.3 require ( - github.com/Microsoft/go-winio v0.6.3 + github.com/Microsoft/go-winio v0.6.4 github.com/charmbracelet/bubbles v1.0.0 github.com/charmbracelet/bubbletea v1.3.10 github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/x/ansi v0.11.9 + github.com/charmbracelet/x/term v0.2.2 github.com/coder/websocket v1.8.15 github.com/fsnotify/fsnotify v1.10.1 github.com/go-ole/go-ole v1.3.0 github.com/grandcat/zeroconf v1.0.0 + github.com/mattn/go-isatty v0.0.24 github.com/muesli/termenv v0.16.0 github.com/pelletier/go-toml/v2 v2.4.3 go.bug.st/serial v1.8.0 - golang.org/x/net v0.61.0 + golang.org/x/net v0.62.0 golang.org/x/sys v0.49.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -26,12 +28,10 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect - github.com/charmbracelet/x/term v0.2.2 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/lucasb-eyer/go-colorful v1.4.1 // indirect - github.com/mattn/go-isatty v0.0.24 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.31 // indirect github.com/miekg/dns v1.1.73 // indirect diff --git a/Tools/Controller/go.sum b/Tools/Controller/go.sum index 250bc32b..5dcf7ed7 100644 --- a/Tools/Controller/go.sum +++ b/Tools/Controller/go.sum @@ -1,7 +1,7 @@ github.com/DRSDavidSoft/go-serial v0.0.0-20260928083401-fa09c8b9a680 h1:uls49Iavo+ZAwgHKMic4M0It66deqRTLqfVObdPwmY4= github.com/DRSDavidSoft/go-serial v0.0.0-20260928083401-fa09c8b9a680/go.mod h1:d0MmS16Qt9b1m06yoYRNUXhRRTJV5Qg2S5EKqQtnayQ= -github.com/Microsoft/go-winio v0.6.3 h1:M/52tsoyTfwaxajLnXZm7PqkbMGRH8iSWP+8fcg9MQ4= -github.com/Microsoft/go-winio v0.6.3/go.mod h1:ma0QpxizD4fyyzJ1C7MIblymTD2Nxz5Mho/3CepwIZg= +github.com/Microsoft/go-winio v0.6.4 h1:kJF2pamtYCWXf0xAT8sAkwKC0pMl2HYBrRPHAqyUc+g= +github.com/Microsoft/go-winio v0.6.4/go.mod h1:1xl5JXG4ze/m74GH6Dc4Mwxfc3VL5siRVQjIAlHH07U= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= @@ -77,8 +77,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw= -golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= +golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= +golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= diff --git a/Tools/Controller/internal/programmer/toolchain_policy_gen.go b/Tools/Controller/internal/programmer/toolchain_policy_gen.go index df580be2..be642779 100644 --- a/Tools/Controller/internal/programmer/toolchain_policy_gen.go +++ b/Tools/Controller/internal/programmer/toolchain_policy_gen.go @@ -4,7 +4,7 @@ package programmer const generatedToolchainPolicyJSON = "{\n \"name\": \"controllerboardmini-atmega328p\",\n \"fqbn\": \"MiniCore:avr:328:bootloader=uart0,eeprom=keep,baudrate=115200,variant=modelP,BOD=2v7,LTO=Os_flto,clock=16MHz_external\",\n \"target\": {\n \"mcu\": \"atmega328p\",\n \"clock_hz\": 16000000,\n \"bootloader\": \"UART0 Urboot/urclock\",\n \"baud\": 115200,\n \"application_limit_bytes\": 32384,\n \"flash_bytes\": 32768,\n \"eeprom_bytes\": 1024\n },\n \"library_index\": \"https://downloads.arduino.cc/libraries/library_index.json.gz\",\n \"cli\": {\n \"dependency\": \"arduino-cli\",\n \"repository\": \"arduino/arduino-cli\",\n \"release_api\": \"https://api.github.com/repos/arduino/arduino-cli/releases?per_page=100\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"1.5.1\"\n },\n \"assets\": [\n {\n \"goos\": \"windows\",\n \"goarch\": \"amd64\",\n \"suffix\": \"_Windows_64bit.zip\",\n \"archive\": \"zip\"\n },\n {\n \"goos\": \"windows\",\n \"goarch\": \"386\",\n \"suffix\": \"_Windows_32bit.zip\",\n \"archive\": \"zip\"\n },\n {\n \"goos\": \"linux\",\n \"goarch\": \"amd64\",\n \"suffix\": \"_Linux_64bit.tar.gz\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"linux\",\n \"goarch\": \"arm64\",\n \"suffix\": \"_Linux_ARM64.tar.gz\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"darwin\",\n \"goarch\": \"amd64\",\n \"suffix\": \"_macOS_64bit.tar.gz\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"darwin\",\n \"goarch\": \"arm64\",\n \"suffix\": \"_macOS_ARM64.tar.gz\",\n \"archive\": \"tar.gz\"\n }\n ]\n },\n \"core\": {\n \"id\": \"MiniCore:avr\",\n \"index_url\": \"https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"3.1.2\"\n }\n },\n \"libraries\": [\n {\n \"name\": \"Adafruit PWM Servo Driver Library\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"3.0.3\"\n }\n },\n {\n \"name\": \"Adafruit INA219\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"1.2.3\"\n }\n },\n {\n \"name\": \"rc-switch\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"2.6.4\"\n }\n },\n {\n \"name\": \"TM1637TinyDisplay\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"1.12.2\"\n }\n },\n {\n \"name\": \"DallasTemperature\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"4.0.6\"\n }\n },\n {\n \"name\": \"OneWire\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"2.3.8\"\n }\n }\n ],\n \"bootloader\": {\n \"repository\": \"stefanrueger/urboot\",\n \"tag_prefix\": \"u\",\n \"tags_api\": \"https://api.github.com/repos/stefanrueger/urboot/tags?per_page=100\",\n \"commits_api\": \"https://api.github.com/repos/stefanrueger/urboot/commits\",\n \"canary_ref\": \"main\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"8.0\"\n }\n },\n \"go\": {\n \"version_url\": \"https://go.dev/VERSION?m=text\",\n \"constraint\": {\n \"channel\": \"stable\",\n \"minimum_version\": \"1.25.0\"\n }\n }\n}\n" -const generatedToolchainLockJSON = "{\n \"policy_name\": \"controllerboardmini-atmega328p\",\n \"resolved_at_utc\": \"2026-10-10T01:46:26.007Z\",\n \"firmware\": {\n \"name\": \"controllerboardmini-atmega328p\",\n \"fqbn\": \"MiniCore:avr:328:bootloader=uart0,eeprom=keep,baudrate=115200,variant=modelP,BOD=2v7,LTO=Os_flto,clock=16MHz_external\",\n \"package_indexes\": [\n \"https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json\"\n ],\n \"cli\": {\n \"dependency\": \"arduino-cli\",\n \"version\": \"1.5.1\",\n \"assets\": [\n {\n \"goos\": \"windows\",\n \"goarch\": \"amd64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Windows_64bit.zip\",\n \"sha256\": \"fabe42e0eb04d00e776a66178299ff95a46c623dbc260f997e58fd514853dd40\",\n \"archive\": \"zip\"\n },\n {\n \"goos\": \"windows\",\n \"goarch\": \"386\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Windows_32bit.zip\",\n \"sha256\": \"885e491c7c7fb8b396151c09daa5c4c56d8b60697d172a5cfe72c939eed50fe3\",\n \"archive\": \"zip\"\n },\n {\n \"goos\": \"linux\",\n \"goarch\": \"amd64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Linux_64bit.tar.gz\",\n \"sha256\": \"28a8e119c498a25607821c36cb2dc49e8463941b261a0d99091baa7bc692dd2b\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"linux\",\n \"goarch\": \"arm64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Linux_ARM64.tar.gz\",\n \"sha256\": \"1e69e077479f300614d4551334e0a33f08ee40b04315d83b8e7e0e94f0d0ee62\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"darwin\",\n \"goarch\": \"amd64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_macOS_64bit.tar.gz\",\n \"sha256\": \"c982e940027996bea9901050e95fae99c59c1dcfee54beedecaf28141e7bf2e7\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"darwin\",\n \"goarch\": \"arm64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_macOS_ARM64.tar.gz\",\n \"sha256\": \"cb952e8c1621c95ef5f1d17831c945e3d0ec5973f89c557a7ec8feb9c4f7d4c9\",\n \"archive\": \"tar.gz\"\n }\n ]\n },\n \"core_id\": \"MiniCore:avr\",\n \"core_version\": \"3.1.3\",\n \"libraries\": [\n {\n \"name\": \"Adafruit PWM Servo Driver Library\",\n \"version\": \"3.0.3\"\n },\n {\n \"name\": \"Adafruit INA219\",\n \"version\": \"1.2.3\"\n },\n {\n \"name\": \"rc-switch\",\n \"version\": \"2.6.4\"\n },\n {\n \"name\": \"TM1637TinyDisplay\",\n \"version\": \"1.12.2\"\n },\n {\n \"name\": \"DallasTemperature\",\n \"version\": \"4.0.6\"\n },\n {\n \"name\": \"OneWire\",\n \"version\": \"2.3.8\"\n }\n ],\n \"provided_tools\": [\n \"AVR compiler/programmer tools supplied by the resolved MiniCore package\",\n \"Urboot/Urclock UART programmer metadata supplied by the resolved MiniCore package\"\n ]\n },\n \"core_source\": {\n \"url\": \"https://MCUdude.github.io/MiniCore/MiniCore-3.1.3.tar.bz2\",\n \"sha256\": \"385387b09f451e0e6bd45f3852e4c47e070643167be336a742c1a1d2a4c70935\"\n },\n \"libraries\": [\n {\n \"name\": \"Adafruit PWM Servo Driver Library\",\n \"version\": \"3.0.3\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/adafruit/Adafruit_PWM_Servo_Driver_Library-3.0.3.zip\",\n \"sha256\": \"320902ab529a1cfcf4df35212fa0c30293956a6a456b198820df58de3504dbc6\"\n },\n {\n \"name\": \"Adafruit INA219\",\n \"version\": \"1.2.3\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/adafruit/Adafruit_INA219-1.2.3.zip\",\n \"sha256\": \"7187663dc53a87c2d4d83216ccd66f680453c9e9b48416d4632d6f00632e631e\"\n },\n {\n \"name\": \"rc-switch\",\n \"version\": \"2.6.4\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/sui77/rc_switch-2.6.4.zip\",\n \"sha256\": \"ed53920db3a38debe53e43b3bf8849ec3583aa419ef1f421a45662bcf056e014\"\n },\n {\n \"name\": \"TM1637TinyDisplay\",\n \"version\": \"1.12.2\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/jasonacox/TM1637TinyDisplay-1.12.2.zip\",\n \"sha256\": \"50cda70a5cae3ed1b3949ce9db417e9918330716b4d286a7dcb3b1f12ad6dba1\"\n },\n {\n \"name\": \"DallasTemperature\",\n \"version\": \"4.0.6\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/milesburton/DallasTemperature-4.0.6.zip\",\n \"sha256\": \"fb90dffd2bbd10b8eb5943968e8300ada5e4af17793b0f80c10359702d9de4e4\"\n },\n {\n \"name\": \"OneWire\",\n \"version\": \"2.3.8\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/PaulStoffregen/OneWire-2.3.8.zip\",\n \"sha256\": \"dd76d1480a2f4c94348e8c8307ea74206d2936d9c80c73be67783fd200f2be17\"\n }\n ],\n \"bootloader\": {\n \"repository\": \"stefanrueger/urboot\",\n \"tag\": \"u8.0.1\",\n \"version\": \"8.0.1\",\n \"source_commit\": \"bd52751acaa5923163e938a6e35051c22317da68\",\n \"tree_hash\": \"45f53abdb3c6164df0ff853232ba58b62fa1409b\"\n },\n \"go\": {\n \"version\": \"1.27.2\",\n \"go_mod_sha256\": \"e918314d72e42bd92b773612beb7b6595391222b6ae84bf60ceefcbbb6e1b023\",\n \"go_sum_sha256\": \"1cce8880978b8b85e2b1f4167c59617842b8f211f2e0ecf72493291e2350cab5\"\n }\n}\n" +const generatedToolchainLockJSON = "{\n \"policy_name\": \"controllerboardmini-atmega328p\",\n \"resolved_at_utc\": \"2026-10-28T01:23:22.531Z\",\n \"firmware\": {\n \"name\": \"controllerboardmini-atmega328p\",\n \"fqbn\": \"MiniCore:avr:328:bootloader=uart0,eeprom=keep,baudrate=115200,variant=modelP,BOD=2v7,LTO=Os_flto,clock=16MHz_external\",\n \"package_indexes\": [\n \"https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json\"\n ],\n \"cli\": {\n \"dependency\": \"arduino-cli\",\n \"version\": \"1.5.1\",\n \"assets\": [\n {\n \"goos\": \"windows\",\n \"goarch\": \"amd64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Windows_64bit.zip\",\n \"sha256\": \"fabe42e0eb04d00e776a66178299ff95a46c623dbc260f997e58fd514853dd40\",\n \"archive\": \"zip\"\n },\n {\n \"goos\": \"windows\",\n \"goarch\": \"386\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Windows_32bit.zip\",\n \"sha256\": \"885e491c7c7fb8b396151c09daa5c4c56d8b60697d172a5cfe72c939eed50fe3\",\n \"archive\": \"zip\"\n },\n {\n \"goos\": \"linux\",\n \"goarch\": \"amd64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Linux_64bit.tar.gz\",\n \"sha256\": \"28a8e119c498a25607821c36cb2dc49e8463941b261a0d99091baa7bc692dd2b\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"linux\",\n \"goarch\": \"arm64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_Linux_ARM64.tar.gz\",\n \"sha256\": \"1e69e077479f300614d4551334e0a33f08ee40b04315d83b8e7e0e94f0d0ee62\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"darwin\",\n \"goarch\": \"amd64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_macOS_64bit.tar.gz\",\n \"sha256\": \"c982e940027996bea9901050e95fae99c59c1dcfee54beedecaf28141e7bf2e7\",\n \"archive\": \"tar.gz\"\n },\n {\n \"goos\": \"darwin\",\n \"goarch\": \"arm64\",\n \"url\": \"https://github.com/arduino/arduino-cli/releases/download/v1.5.1/arduino-cli_1.5.1_macOS_ARM64.tar.gz\",\n \"sha256\": \"cb952e8c1621c95ef5f1d17831c945e3d0ec5973f89c557a7ec8feb9c4f7d4c9\",\n \"archive\": \"tar.gz\"\n }\n ]\n },\n \"core_id\": \"MiniCore:avr\",\n \"core_version\": \"3.1.3\",\n \"libraries\": [\n {\n \"name\": \"Adafruit PWM Servo Driver Library\",\n \"version\": \"3.0.3\"\n },\n {\n \"name\": \"Adafruit INA219\",\n \"version\": \"1.2.3\"\n },\n {\n \"name\": \"rc-switch\",\n \"version\": \"2.6.4\"\n },\n {\n \"name\": \"TM1637TinyDisplay\",\n \"version\": \"1.12.2\"\n },\n {\n \"name\": \"DallasTemperature\",\n \"version\": \"4.0.6\"\n },\n {\n \"name\": \"OneWire\",\n \"version\": \"2.3.8\"\n }\n ],\n \"provided_tools\": [\n \"AVR compiler/programmer tools supplied by the resolved MiniCore package\",\n \"Urboot/Urclock UART programmer metadata supplied by the resolved MiniCore package\"\n ]\n },\n \"core_source\": {\n \"url\": \"https://MCUdude.github.io/MiniCore/MiniCore-3.1.3.tar.bz2\",\n \"sha256\": \"385387b09f451e0e6bd45f3852e4c47e070643167be336a742c1a1d2a4c70935\"\n },\n \"libraries\": [\n {\n \"name\": \"Adafruit PWM Servo Driver Library\",\n \"version\": \"3.0.3\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/adafruit/Adafruit_PWM_Servo_Driver_Library-3.0.3.zip\",\n \"sha256\": \"320902ab529a1cfcf4df35212fa0c30293956a6a456b198820df58de3504dbc6\"\n },\n {\n \"name\": \"Adafruit INA219\",\n \"version\": \"1.2.3\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/adafruit/Adafruit_INA219-1.2.3.zip\",\n \"sha256\": \"7187663dc53a87c2d4d83216ccd66f680453c9e9b48416d4632d6f00632e631e\"\n },\n {\n \"name\": \"rc-switch\",\n \"version\": \"2.6.4\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/sui77/rc_switch-2.6.4.zip\",\n \"sha256\": \"ed53920db3a38debe53e43b3bf8849ec3583aa419ef1f421a45662bcf056e014\"\n },\n {\n \"name\": \"TM1637TinyDisplay\",\n \"version\": \"1.12.2\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/jasonacox/TM1637TinyDisplay-1.12.2.zip\",\n \"sha256\": \"50cda70a5cae3ed1b3949ce9db417e9918330716b4d286a7dcb3b1f12ad6dba1\"\n },\n {\n \"name\": \"DallasTemperature\",\n \"version\": \"4.0.6\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/milesburton/DallasTemperature-4.0.6.zip\",\n \"sha256\": \"fb90dffd2bbd10b8eb5943968e8300ada5e4af17793b0f80c10359702d9de4e4\"\n },\n {\n \"name\": \"OneWire\",\n \"version\": \"2.3.8\",\n \"url\": \"https://downloads.arduino.cc/libraries/github.com/PaulStoffregen/OneWire-2.3.8.zip\",\n \"sha256\": \"dd76d1480a2f4c94348e8c8307ea74206d2936d9c80c73be67783fd200f2be17\"\n }\n ],\n \"bootloader\": {\n \"repository\": \"stefanrueger/urboot\",\n \"tag\": \"u8.0.1\",\n \"version\": \"8.0.1\",\n \"source_commit\": \"bd52751acaa5923163e938a6e35051c22317da68\",\n \"tree_hash\": \"45f53abdb3c6164df0ff853232ba58b62fa1409b\"\n },\n \"go\": {\n \"version\": \"1.27.3\",\n \"go_mod_sha256\": \"59a2cdac2bbb5146db8bc6f6419f0e5077d8b7a375ffb23b8839811b04dadbd8\",\n \"go_sum_sha256\": \"12b3c9489dfcc0a34010eb558aef19853274ef42d84d4d448d51292416be1380\"\n }\n}\n" const ( generatedBoardProfile = "controllerboardmini-atmega328p" diff --git a/Tools/Controller/internal/webui/dist/assets/app-BpGu_3eg.js b/Tools/Controller/internal/webui/dist/assets/app-BpGu_3eg.js deleted file mode 100644 index d673b7d1..00000000 --- a/Tools/Controller/internal/webui/dist/assets/app-BpGu_3eg.js +++ /dev/null @@ -1,18 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunk-A4VaeTzE.js","assets/chunk-C2nxElbj.js","assets/chunk-B9ewCnSE.js","assets/chunk-ME8Q1Sy7.js","assets/chunk-DvGrMMmP.js","assets/chunk-D76V6mr9.js","assets/chunk-BWN4QWM7.js","assets/chunk-DFSYywIo.js","assets/chunk-DwrIxLY1.js","assets/chunk-Dmio8W6_.js","assets/chunk-CTc1vKfa.js","assets/chunk-DfNNWLG8.js"])))=>i.map(i=>d[i]); -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var ee=Array.isArray;function te(){}var C={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function w(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function T(e,t){return w(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function E(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(te,te):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+E(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=T(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var S=!1,ee=-1,te=5,C=-1;function ne(){return g?!0:!(e.unstable_now()-Ct&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():S=!1}}}var T;if(typeof y==`function`)T=function(){y(w)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=w,T=function(){ie.postMessage(null)}}else T=function(){_(w,0)};function ae(t,n){ee=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ee),ee=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,T()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1Ee||(e.current=Te[Ee],Te[Ee]=null,Ee--)}function k(e,t){Ee++,Te[Ee]=e.current,e.current=t}var ke=De(null),Ae=De(null),je=De(null),Me=De(null);function Ne(e,t){switch(k(je,t),k(Ae,e),k(ke,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Oe(ke),k(ke,e)}function Pe(){Oe(ke),Oe(Ae),Oe(je)}function Fe(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,k(Me,e)),t=ke.current;var n=dp(t,e.type);t!==n&&(k(Ae,e),k(ke,n))}function Ie(e){Ae.current===e&&(Oe(ke),Oe(Ae)),Me.current===e&&(Oe(Me),sh._currentValue=we)}var Le,Re;function ze(e){if(Le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Le=t&&t[1]||``,Re=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ze(n):``}function He(e,t){switch(e.tag){case 26:case 27:case 5:return ze(e.type);case 16:return ze(`Lazy`);case 13:return e.child!==t&&t!==null?ze(`Suspense Fallback`):ze(`Suspense`);case 19:return ze(`SuspenseList`);case 0:case 15:return Ve(e.type,!1);case 11:return Ve(e.type.render,!1);case 1:return Ve(e.type,!0);case 31:return ze(`Activity`);case 30:return ze(`ViewTransition`);default:return``}}function Ue(e){try{var t=``,n=null;do t+=He(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var We=Object.prototype.hasOwnProperty,Ge=t.unstable_scheduleCallback,Ke=t.unstable_cancelCallback,qe=t.unstable_shouldYield,Je=t.unstable_requestPaint,Ye=t.unstable_now,Xe=t.unstable_getCurrentPriorityLevel,Ze=t.unstable_ImmediatePriority,Qe=t.unstable_UserBlockingPriority,$e=t.unstable_NormalPriority,et=t.unstable_LowPriority,tt=t.unstable_IdlePriority,nt=t.log,rt=t.unstable_setDisableYieldValue,it=null,at=null;function ot(e){if(typeof nt==`function`&&rt(e),at&&typeof at.setStrictMode==`function`)try{at.setStrictMode(it,e)}catch{}}var st=Math.clz32?Math.clz32:ut,ct=Math.log,lt=Math.LN2;function ut(e){return e>>>=0,e===0?32:31-(ct(e)/lt|0)|0}var dt=256,ft=262144,pt=4194304;function mt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ht(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=mt(n))):i=mt(o):i=mt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=mt(n))):i=mt(o)):i=mt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function gt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function A(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function bt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=hr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!mr&&yr(e,t)?(e=Ln(),In=Fn=Pn=null,xr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gr(e.document)}return t}function Xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Zr=jn&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ei&&Wr(ei,r)||(ei=r,r=Jf($r,`onSelect`),0>=o,i-=o,Qi=1<<32-st(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&ea(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&ea(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&ea(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&ea(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ae&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case re:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ae){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===pe&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ae?(c=zi(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case ie:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case pe:return o=no(o),_(e,r,o,c)}if(Ce(o))return h(e,r,o,c);if(be(o)){if(l=be(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===ce)return _(e,r,Da(e,o),c);uo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function bo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:ho=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=D.T,s={};s.types=o===null?null:o.types,D.T=s,fc(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Wa(c,r),jd(e)):dc(e,t,r,jd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{O.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,we,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:we,baseState:we,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:we},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},jd())}function ac(){return Ea(sh)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=vo(n);var r=yo(t,e,n);r!==null&&(Pd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Oi(e,t,n,r),n!==null&&(Pd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,jd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ur(s,o))return Di(e,t,i,0),q===null&&Ei(),!1}catch{}if(n=Oi(e,t,i,r),n!==null)return Pd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Oi(e,n,r,2),t!==null&&Pd(t,e,2)}function pc(e){var t=e.alternate;return e===B||t!==null&&t===B}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}var gc={readContext:Ea,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Ea,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){ot(!0);try{n(t)}finally{ot(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,B,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=ss();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=q.identifierPrefix;if(z){var n=$i,r=Qi;n=(r&~(1<<32-st(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[At]=t,o[jt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return H(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=je.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=aa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[At]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[At]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[At]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[At]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),H(t),null);case 4:return Pe(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,H(t),null;case 10:return ba(t.type),H(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return H(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Li(n,e),n=n.sibling;return Bo(t,zo.current&1|2),z&&ea(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ye()>gd&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return H(t),null}else 2*Ye()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ye(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Bo(t,o):(n=o,k(Mo,t),k(zo,n),No===null&&(No=t)),z&&ea(t,r.treeForkCount),e}return H(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Oe(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),H(t),null;case 25:return null;case 30:return t.flags|=33554432,H(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ie(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Pe(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&Oe(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(ra(t),t.tag){case 3:ba(Ma),Pe();break;case 26:case 27:case 5:Ie(t);break;case 4:Pe();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&Oe(Ka);break;case 24:ba(Ma)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){Z(e,e.return,t)}}}function El(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),np(r,t,n),r[At]=e,Ut(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=qr(s,h),v=qr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,D.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,K&6)throw Error(i(331));var c=K;if(K|=4,Yu(o.current),Vu(o,o.current,s,n),K=c,Df(0,!1),at&&typeof at.onPostCommitFiberRoot==`function`)try{at.onPostCommitFiberRoot(it,o)}catch{}return!0}finally{O.p=a,D.T=r,uf(e,t)}}function pf(e,t,n){t=Wi(n,t),t=Ac(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(bt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Wi(n,e),n=jc(2),r=yo(t,n,2),r!==null&&(Mc(n,r,t,e),bt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>Ye()-md?K&2?cd|=n:Vd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=vt()),e=ki(e,t),e!==null&&(bt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Ge(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-st(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=ht(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||gt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Ye(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=cn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ut(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+cn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+cn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+cn(n.imageSizes)+`"]`)):i+=`[href="`+cn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[j]=!0,o.onload=o.onerror=function(){Wt(o)}),Ut(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+cn(r)+`"][href="`+cn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=w({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ut(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ht(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ut(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ht(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=w({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ut(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ht(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ut(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=je.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Ht(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Ht(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Ht(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+cn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[j]){r.loading=1;return}}else t=e.createElement(`link`),t[j]=!0,t.onload=t.onerror=Wt.bind(null,t),np(t,`link`,n),Ut(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+cn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+cn(n.href)+`"]`);if(r)return t.instance=r,Ut(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ut(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Ut(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Ut(a),a):(r=n,(a=vm.get(o))&&(r=w({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ut(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ut(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function y(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:v(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var b=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ee={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function te(e){return e!=null}function C(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??ee.width,a=e.size??e.height??ee.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?S(...c):S(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??ee[`stroke-width`])*Number(e.size??e.width??ee.width)/Number(t.size??t.width??ee.width):t.strokeWidth??ee[`stroke-width`];return[`svg`,{...Object.entries(ee).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&te(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&te(t.width)&&{[r(`width`)]:t.width},...`height`in t&&te(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ne(e,t={}){return C(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var w=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},T=l(d(),1),re=(0,T.createContext)({}),ie=()=>(0,T.useContext)(re),ae=(0,T.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=ie()??{},y=!!c||w(d),[b,x,ee=[]]=ne(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:S(v,s),hasA11yProp:y,attributes:d});return(0,T.createElement)(b,{ref:f,...x},[...ee.map(([e,t])=>(0,T.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function E(e,t=[],n=[]){let r=typeof e==`string`?y(e,t,n):e,i=(0,T.forwardRef)(({className:e,...t},n)=>(0,T.createElement)(ae,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=x(r.name)),i}var oe={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};oe.node;var se=E(oe),ce={name:`audio-lines`,size:24,node:[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]};ce.node;var le=E(ce),ue={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};ue.node;var de=E(ue),fe={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};fe.node;var pe=E(fe),me={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};me.node;var he=E(me),ge={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};ge.node;var _e=E(ge),ve={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};ve.node;var ye=E(ve),be={name:`command`,size:24,node:[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]};be.node;var xe=E(be),Se={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Se.node;var Ce=E(Se),D={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};D.node;var O=E(D),we={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};we.node;var Te=E(we),Ee={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Ee.node;var De=E(Ee),Oe={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};Oe.node;var k=E(Oe),ke={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};ke.node;var Ae=E(ke),je={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};je.node;var Me=E(je),Ne={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Ne.node;var Pe=E(Ne),Fe={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Fe.node;var Ie=E(Fe),Le={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Le.node;var Re=E(Le),ze={name:`package-open`,size:24,node:[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]};ze.node;var Be=E(ze),Ve={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};Ve.node;var He=E(Ve),Ue={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Ue.node;var We=E(Ue),Ge={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Ge.node;var Ke=E(Ge),qe={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};qe.node;var Je=E(qe),Ye={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Ye.node;var Xe=E(Ye),Ze={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ze.node;var Qe=E(Ze),$e={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};$e.node;var et=E($e),tt={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};tt.node;var nt=E(tt),rt={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};rt.node;var it=E(rt),at={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};at.node;var ot=E(at),st={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};st.node;var ct=E(st),lt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};lt.node;var ut=E(lt),dt=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ft=o(((e,t)=>{t.exports=dt()})),pt=(0,T.createContext)({});function mt(e){let t=(0,T.useRef)(null);return t.current===null&&(t.current=e()),t.current}var ht=typeof window<`u`?T.useLayoutEffect:T.useEffect,gt=(0,T.createContext)(null);function A(e,t){e.indexOf(t)===-1&&e.push(t)}function _t(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var vt=(e,t,n)=>n>t?t:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),xt=e=>typeof e==`object`&&!!e,St=e=>/^0[^.\s]+$/u.test(e);function Ct(e){let t;return()=>(t===void 0&&(t=e()),t)}var wt=e=>e,Tt=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Et=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Dt=class{constructor(){this.subscriptions=[]}add(e){return A(this.subscriptions,e),()=>this.remove(e)}remove(e){_t(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;ie*1e3,kt=e=>e/1e3,At=(e,t)=>t?1e3/t*e:0,jt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Mt=1e-7,Nt=12;function Pt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=jt(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Mt&&++sPt(t,0,1,e,n);return e=>e===0||e===1?e:jt(i(e),t,r)}var It=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Lt=e=>t=>1-e(1-t),j=Ft(.33,1.53,.69,.99),Rt=Lt(j),zt=It(Rt),Bt=e=>e>=1?1:(e*=2)<1?.5*Rt(e):.5*(2-2**(-10*(e-1))),Vt=e=>1-Math.sin(Math.acos(e)),Ht=Lt(Vt),Ut=It(Vt),Wt=Ft(.42,0,1,1),Gt=Ft(0,0,.58,1),Kt=Ft(.42,0,.58,1),qt=e=>Array.isArray(e)&&typeof e[0]!=`number`,Jt=e=>Array.isArray(e)&&typeof e[0]==`number`,Yt={linear:wt,easeIn:Wt,easeInOut:Kt,easeOut:Gt,circIn:Vt,circInOut:Ut,circOut:Ht,backIn:Rt,backInOut:zt,backOut:j,anticipate:Bt},Xt=e=>typeof e==`string`,Zt=e=>{if(Jt(e)){e.length;let[t,n,r,i]=e;return Ft(t,n,r,i)}return Xt(e)?(Yt[e],`${e}`,Yt[e]):e},Qt={delta:0,timestamp:0,isProcessing:!1},M;function $t(){M=void 0}var N={now:()=>(M===void 0&&N.set(Qt.isProcessing||yt.useManualTiming?Qt.timestamp:performance.now()),M),set:e=>{M=e,queueMicrotask($t)}},en=e=>Math.round(e*1e5)/1e5,tn=e=>t=>typeof t==`string`&&t.startsWith(e),P=tn(`--`),nn=tn(`var(--`),rn=e=>nn(e)?an.test(e.split(`/*`)[0].trim()):!1,an=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function on(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var sn={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},cn={...sn,transform:e=>vt(0,1,e)},ln={...sn,default:1},un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dn(e){return e==null}var fn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pn=(e,t)=>n=>!!(typeof n==`string`&&fn.test(n)&&n.startsWith(e)||t&&!dn(n)&&Object.prototype.hasOwnProperty.call(n,t)),mn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(un);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},hn=e=>vt(0,255,e),gn={...sn,transform:e=>Math.round(hn(e))},_n={test:pn(`rgb`,`red`),parse:mn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+gn.transform(e)+`, `+gn.transform(t)+`, `+gn.transform(n)+`, `+en(cn.transform(r))+`)`};function vn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var yn={test:pn(`#`),parse:vn,transform:_n.transform},bn=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xn=bn(`deg`),Sn=bn(`%`),F=bn(`px`),Cn=bn(`vh`),wn=bn(`vw`),Tn={...Sn,parse:e=>Sn.parse(e)/100,transform:e=>Sn.transform(e*100)},En={test:pn(`hsl`,`hue`),parse:mn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Sn.transform(en(t))+`, `+Sn.transform(en(n))+`, `+en(cn.transform(r))+`)`},Dn={test:e=>_n.test(e)||yn.test(e)||En.test(e),parse:e=>_n.test(e)?_n.parse(e):En.test(e)?En.parse(e):yn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?_n.transform(e):En.transform(e),getAnimatableNone:e=>{let t=Dn.parse(e);return t.alpha=0,Dn.transform(t)}},On=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,kn=new RegExp(un.source),An=new RegExp(On.source,`i`);function jn(e){return isNaN(e)&&typeof e==`string`&&(kn.test(e)||An.test(e))}var Mn=`number`,Nn=`color`,Pn=`var`,Fn=`var(`,In="${}",Ln=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Rn(e){let t=e.toString();return kn.test(t)||An.test(t)}function zn(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ln,e=>(Dn.test(e)?(r.color.push(a),i.push(Nn),n.push(Dn.parse(e))):e.startsWith(Fn)?(r.var.push(a),i.push(Pn),n.push(e)):(r.number.push(a),i.push(Mn),n.push(parseFloat(e))),++a,In)).split(In),indexes:r,types:i}}function Bn(e){return zn(e).values}function Vn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;atypeof e==`number`?0:Dn.test(e)?Dn.getAnimatableNone(e):e,Wn=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Un(e);function Gn(e){let t=zn(e);return Vn(t)(t.values.map((e,n)=>Wn(e,t.split[n])))}var Kn={test:jn,parse:Bn,createTransformer:Hn,getAnimatableNone:Gn};function qn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Jn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qn(s,r,e+1/3),a=qn(s,r,e),o=qn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Yn(e,t){return n=>n>0?t:e}var I=(e,t,n)=>e+(t-e)*n,Xn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Zn=[yn,_n,En],Qn=e=>Zn.find(t=>t.test(e));function $n(e){let t=Qn(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===En&&(n=Jn(n)),n}var er=(e,t)=>{let n=$n(e),r=$n(t);if(!n||!r)return Yn(e,t);let i={...n};return e=>(i.red=Xn(n.red,r.red,e),i.green=Xn(n.green,r.green,e),i.blue=Xn(n.blue,r.blue,e),i.alpha=I(n.alpha,r.alpha,e),_n.transform(i))},tr=new Set([`none`,`hidden`]);function nr(e,t){return tr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function rr(e,t){return n=>I(e,t,n)}function ir(e){return typeof e==`number`?rr:typeof e==`string`?rn(e)?Yn:Dn.test(e)?er:cr:Array.isArray(e)?ar:typeof e==`object`?Dn.test(e)?er:or:Yn}function ar(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ir(e)(e,t[n]));return e=>{for(let t=0;t{for(let t in r)n[t]=r[t](e);return n}}function sr(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i{let n=Kn.createTransformer(t),r=zn(e),i=zn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?tr.has(e)&&!i.values.length||tr.has(t)&&!r.values.length?nr(e,t):Tt(ar(sr(r,i),i.values),n):(`${e}${t}`,Yn(e,t))},lr=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ur(e,t){let n=lr.exec(e);if(!n)return;let r=lr.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>en(I(a,o,e))+i}function dr(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return I(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=ur(e,t);if(n)return n}return ir(e)(e,t)}var fr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function pr(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var mr=40;function hr(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=fr.reduce((e,t)=>(e[t]=pr(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=yt.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,mr),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:fr.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>L.update(t,e),stop:()=>gr(t),now:()=>Qt.isProcessing?Qt.timestamp:N.now()}},yr=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t=n?1/0:i}function Sr(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(xr(r),br);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:kt(i)}}var Cr={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},wr=e=>e<0?1/Math.max(1+e,Cr.minDamping):Math.max(1-e,Cr.minDamping);function Tr(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Or(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Er(e,t){return e*Math.sqrt(1-t*t)}var Dr=12;function Or(e,t,n){let r=n;for(let n=1;n{let n=t*i,r=n*e,a=Er(t,i),o=Math.exp(-r);return kr-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Er(t*t,i);return(-n(t)+kr>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Or(n,r,a),s=o*Tr(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Ot(e)}}var jr=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Mr(e,t){if(jr(e,t))return e}function Nr(e){let t=Mr(e.stiffness),n=Mr(e.damping,!0),r=Mr(e.mass),i={...e,stiffness:t??Cr.stiffness,damping:n??Cr.damping,mass:r??Cr.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=wr(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Tr(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Ar(i)),i.isResolvedFromDuration=!0;(!jr(i.stiffness)||!jr(i.damping,!0))&&(i.stiffness=Cr.stiffness,i.damping=Cr.damping)}return i}function Pr(e=Cr.visualDuration,t=Cr.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Nr({...n}),f=e=>d?0:-kt(e),p=s/(2*Math.sqrt(o*c)),m=kt(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Cr.restSpeed.granular:Cr.restSpeed.default),g.restDelta=n.restDelta||(e?Cr.restDelta.granular:Cr.restDelta.default)};_();let v,y,b;if(p<1){let e=Er(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Ot(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Ot(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(xr(S),br),t=yr(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Pr.applyToOptions=e=>{let t=Sr(e,100,Pr);return e.ease=t.ease,e.duration=Ot(t.duration),e.type=`keyframes`,e};function Fr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>ec,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Pr({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Ir(e,t,n){let r=[],i=n||yt.mix||dr,a=e.length-1;for(let n=0;nt[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Ir(t,r,i),c=s.length,l=n=>{if(o&&n1)for(;rl(vt(e[0],e[a-1],t)):l}function Rr(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Et(0,t,r);e.push(I(n,1,i))}}function zr(e){let t=[0];return Rr(t,e.length-1),t}function Br(e,t){return e.map(e=>e*t)}function Vr(e,t){return e.map(()=>t||Kt).splice(0,e.length-1)}function Hr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=qt(r)?r.map(Zt):Zt(r)||Kt,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(yt.mix||dr)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?vt(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Lr(Br(n&&n.length===t.length?n:zr(t),e),t,{ease:Array.isArray(i)?i:Vr(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Ur=5;function Wr(e,t,n){let r=Math.max(t-Ur,0);return At(n-e(r),t-r)}function Gr(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Wr(t=>e.next(t).value,t,e.next(t).value)}var Kr=e=>e!==null;function qr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Kr),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Jr={decay:Fr,inertia:Fr,tween:Hr,keyframes:Hr,spring:Pr};function Yr(e){typeof e.type==`string`&&(e.type=Jr[e.type])}function Xr(e,t){return{kind:e,animation:t,timestamp:N.now(),frameTimestamp:Qt.timestamp,frameIsProcessing:Qt.isProcessing}}function Zr(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Xr(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Qr(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Xr(`layout-animation-start`,e),node:t})}catch{}}var $r=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},ei=e=>e/100,ti=class extends $r{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Zr(this,this.options)}initAnimation(){let{options:e}=this;Yr(e);let{type:t=Hr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Hr;s!==Hr&&typeof o[0]!=`number`&&(this.mixKeyframes=Tt(ei,dr(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=xr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=vt(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Fr&&(b.value=qr(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return kt(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+kt(e)}get time(){return kt(this.currentTime)}set time(e){e=Ot(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Gr(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=kt(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=vr,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},ni=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ri(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(un)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ni.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var ii=/\b([a-z-]*)\(.*?\)/gu,ai={...Kn,getAnimatableNone:e=>{let t=e.match(ii);return t?t.map(ri).join(` `):e}},oi={...Kn,getAnimatableNone:e=>{let t=Kn.parse(e);return Kn.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},si={...sn,transform:Math.round},ci={borderWidth:F,borderTopWidth:F,borderRightWidth:F,borderBottomWidth:F,borderLeftWidth:F,borderRadius:F,borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,width:F,maxWidth:F,height:F,maxHeight:F,top:F,right:F,bottom:F,left:F,inset:F,insetBlock:F,insetBlockStart:F,insetBlockEnd:F,insetInline:F,insetInlineStart:F,insetInlineEnd:F,padding:F,paddingTop:F,paddingRight:F,paddingBottom:F,paddingLeft:F,paddingBlock:F,paddingBlockStart:F,paddingBlockEnd:F,paddingInline:F,paddingInlineStart:F,paddingInlineEnd:F,margin:F,marginTop:F,marginRight:F,marginBottom:F,marginLeft:F,marginBlock:F,marginBlockStart:F,marginBlockEnd:F,marginInline:F,marginInlineStart:F,marginInlineEnd:F,fontSize:F,backgroundPositionX:F,backgroundPositionY:F,rotate:xn,pathRotation:xn,rotateX:xn,rotateY:xn,rotateZ:xn,scale:ln,scaleX:ln,scaleY:ln,scaleZ:ln,skew:xn,skewX:xn,skewY:xn,distance:F,translateX:F,translateY:F,translateZ:F,x:F,y:F,z:F,perspective:F,transformPerspective:F,opacity:cn,originX:Tn,originY:Tn,originZ:F,zIndex:si,fillOpacity:cn,strokeOpacity:cn,numOctaves:si},li={...ci,color:Dn,backgroundColor:Dn,outlineColor:Dn,fill:Dn,stroke:Dn,borderColor:Dn,borderTopColor:Dn,borderRightColor:Dn,borderBottomColor:Dn,borderLeftColor:Dn,filter:ai,WebkitFilter:ai,mask:oi,WebkitMask:oi},ui=e=>li[e],di=new Set([ai,oi]);function fi(e,t){let n=ui(e);return di.has(n)||(n=Kn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function pi(e){for(let t=1;te*180/Math.PI,hi=e=>_i(mi(Math.atan2(e[1],e[0]))),gi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:hi,rotateZ:hi,skewX:e=>mi(Math.atan(e[1])),skewY:e=>mi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},_i=e=>(e%=360,e<0&&(e+=360),e),vi=hi,yi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),bi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yi,scaleY:bi,scale:e=>(yi(e)+bi(e))/2,rotateX:e=>_i(mi(Math.atan2(e[6],e[5]))),rotateY:e=>_i(mi(Math.atan2(-e[2],e[0]))),rotateZ:vi,rotate:vi,skewX:e=>mi(Math.atan(e[4])),skewY:e=>mi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Si(e){return+!!e.includes(`scale`)}function Ci(e,t){if(!e||e===`none`)return Si(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=xi,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gi,i=t}if(!i)return Si(t);let a=r[t],o=i[1].split(`,`).map(Ti);return typeof a==`function`?a(o):o[a]}var wi=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ci(n,t)};function Ti(e){return parseFloat(e.trim())}var Ei=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Di=new Set([...Ei,`pathRotation`]),Oi=e=>e===sn||e===F,ki=new Set([`x`,`y`,`z`]),Ai=Ei.filter(e=>!ki.has(e));function ji(e){let t=[];return Ai.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Mi=new Set([`bottom`,`right`]);function Ni(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Pi={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ni(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ni(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ci(e,`x`),y:({transform:e})=>Ci(e,`y`)};Pi.translateX=Pi.x,Pi.translateY=Pi.y;var Fi=new Set,Ii=!1,Li=!1,Ri=!1;function zi(){if(Li){let e=[],t=new Set,n=new Set;Fi.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Mi.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=ji(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Li=!1,Ii=!1,Fi.forEach(e=>e.complete(Ri)),Fi.clear()}function Bi(){Fi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Li=!0)})}function Vi(){Ri=!0,Bi(),zi(),Ri=!1}function Hi(e,t,n){if(typeof e==`string`){if(bt(e)||St(e))return parseFloat(e);if(!Kn.test(e)&&Kn.test(n))return fi(t,n)}return e??void 0}var Ui=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Fi.add(this),Ii||(Ii=!0,L.read(Bi),L.resolveKeyframes(zi))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Hi(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}pi(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Fi.delete(this)}cancel(){this.state===`scheduled`&&(Fi.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Wi=e=>e.startsWith(`--`);function Gi(e,t,n){Wi(t)?e.style.setProperty(t,n):e.style[t]=n}var Ki={};function qi(e,t){let n=Ct(e);return()=>Ki[t]??n()}var Ji=qi(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Yi=qi(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Xi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Zi={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Xi([0,.65,.55,1]),circOut:Xi([.55,0,1,.45]),backIn:Xi([.31,.01,.66,-.59]),backOut:Xi([.33,1.53,.69,.99])};function Qi(e,t){if(e)return typeof e==`function`?Yi()?yr(e,t):`ease-out`:Jt(e)?Xi(e):Array.isArray(e)?e.map(e=>Qi(e,t)||Zi.easeOut):Zi[e]}function $i(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Qi(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function ea(e){return typeof e==`function`&&`applyToOptions`in e}function ta({type:e,...t}){return ea(e)&&Yi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var na=class extends $r{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ta(e);this.animation=$i(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=qr(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Gi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Zr(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return kt(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+kt(e)}get time(){return kt(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ot(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n,...r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Ji()?(this.animation.timeline=e,Object.assign(this.animation,r),t?.(this.animation),wt):n(this)}},ra={anticipate:Bt,backInOut:zt,circInOut:Ut};function ia(e){return e in ra}function aa(e){typeof e.ease==`string`&&ia(e.ease)&&(e.ease=ra[e.ease])}var R=10,z=class extends na{constructor(e){aa(e),Yr(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new ti({...a,autoplay:!1}),s=Math.max(R,N.now()-this.startTime),c=vt(0,R,s-R),l=o.sample(s).value,{name:u}=this.options;i&&u&&Gi(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},oa=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Kn.test(e)||e===`0`)&&!e.startsWith(`url(`));function sa(e){let t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,`animate`));function ha(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(ua.has(n)||pa.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return ma()&&(ua.has(n)||pa.has(n)&&fa(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ga=40,_a=class extends $r{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Ui;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=N.now();let u=!0;ca(e,i,a,o)||(u=!1,(yt.instantAnimations||!s)&&l?.(qr(e,n,t)),e[0]=e[e.length-1],la(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>ga?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&ha(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new z(n)}catch{m=new ti(n)}}else m=new ti(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Vi()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function va(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var ya=30,ba=e=>!isNaN(parseFloat(e)),xa={current:void 0},Sa=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=N.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ba(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Dt)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Dt,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){L.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return xa.current&&xa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ya)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ya);return At(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ca(e,t){return new Sa(e,t)}function wa(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Ta(e,t){let n=e?.[t]??e?.default??e;return n===e?n:wa(n,e)}var Ea={type:`spring`,stiffness:500,damping:25,restSpeed:10},Da=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Oa={type:`keyframes`,duration:.8},ka={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Aa=(e,{keyframes:t})=>t.length>2?Oa:Di.has(e)?e.startsWith(`scale`)?Da(t[1]):Ea:ka,ja=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Ma(e){for(let t in e)if(!ja.has(t))return!0;return!1}var Na=(e,t,n,r={},i,a)=>o=>{let s=Ta(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Ot(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Ma(s)||Object.assign(u,Aa(e,u)),u.duration&&=Ot(u.duration),u.repeatDelay&&=Ot(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(la(u),u.delay===0&&(d=!0)),(yt.instantAnimations||yt.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,la(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=qr(u.keyframes,s);if(e!==void 0){L.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ti(u):new _a(u)},Pa=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Fa(e){let t=Pa.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ia(e,t,n=1){`${e}`;let[r,i]=Fa(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return bt(e)?parseFloat(e):e}return rn(i)?Ia(i,t,n+1):i}function La(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ra(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...La(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function za(e,t,n){return Ra(e.getProps(),t,n,e)}var Ba=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Va=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Ei]),Ha=e=>Array.isArray(e);function Ua(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ca(n))}function Wa(e){return Ha(e)?e[e.length-1]||0:e}function Ga(e,t){let{transitionEnd:n={},transition:r={},...i}=za(e,t)||{};i={...i,...n};for(let t in i)Ua(e,t,Wa(i[t]))}var Ka=e=>!!(e&&e.getVelocity);function qa(e){return!!(Ka(e)&&e.add)}function Ja(e,t){let n=e.getValue(`willChange`);if(qa(n))return n.add(t);if(!n&&yt.WillChange){let n=new yt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ya(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Xa=`data-`+Ya(`framerAppearId`);function Za(e){return e.props[Xa]}var Qa=typeof window<`u`;function $a({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function eo(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?wa(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&$a(f,t))continue;let o={delay:n,...Ta(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){L.update(()=>r.set(i));continue}let p=!1;if(Qa&&window.MotionHandoffAnimation){let n=Za(e);if(n){let e=window.MotionHandoffAnimation(n,t,L);e!==null&&(o.startTime=e,p=!0)}}Ja(e,t);let m=l??e.shouldReduceMotion;r.start(Na(t,r,i,m&&Va.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>L.update(()=>{o&&Ga(e,o)});d.length?Promise.all(d).then(t):t()}return d}function to(e,t,n={}){let r=za(e,t,Ba(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?eo(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(to(e,t,{...n,delay:r+(typeof o==`function`?0:o)+va(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function no(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>to(e,t,n))):typeof t==`string`?to(e,t,n):Promise.all(eo(e,za(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var ro={test:e=>e===`auto`,parse:e=>e},io=e=>t=>t.test(e),ao=[sn,F,Sn,xn,wn,Cn,ro],oo=e=>ao.find(io(e));function so(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||St(e)}var co=new Set([`auto`,`none`,`0`]);function lo(e,t,n){let r=0,i;for(;re.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},fo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function po(e){return xt(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function mo(e){return xt(e)&&`ownerSVGElement`in e}var ho=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function go(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var _o={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},vo=Ei.length;function yo(e,t,n){let r=``,i=!0;for(let a=0;aRo&&(t.x=1),t.yRo&&(t.y=1)}function Vo(e,t){e.min+=t,e.max+=t}function Ho(e,t,n,r,i=.5){Io(e,t,n,I(e.min,e.max,i),r)}function Uo(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function B(e,t,n){let r=n??e;Ho(e.x,Uo(t.x,r.x),t.scaleX,t.scale,t.originX),Ho(e.y,Uo(t.y,r.y),t.scaleY,t.scale,t.originY)}function V(e,t){return Eo(Oo(e.getBoundingClientRect(),t))}function Wo(e,t,n){let r=V(e,n),{scroll:i}=t;return i&&(Vo(r.x,i.offset.x),Vo(r.y,i.offset.y)),r}var{schedule:Go,cancel:Ko}=hr(queueMicrotask,!1),qo={x:!1,y:!1};function Jo(){return qo.x||qo.y}function Yo(e){return e===`x`||e===`y`?qo[e]?null:(qo[e]=!0,()=>{qo[e]=!1}):qo.x||qo.y?null:(qo.x=qo.y=!0,()=>{qo.x=qo.y=!1})}function Xo(e,t){let n=go(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Zo(e){return!(e.pointerType===`touch`||Jo())}function Qo(e,t,n={}){let[r,i,a]=Xo(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Zo(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var $o=(e,t)=>t?e===t||$o(e,t.parentElement):!1,es=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,ts=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function ns(e){return ts.has(e.tagName)||e.isContentEditable===!0}var rs=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function is(e){return rs.has(e.tagName)||e.isContentEditable===!0}var as=new WeakSet;function os(e){return t=>{t.key===`Enter`&&e(t)}}function ss(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var cs=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=os(()=>{if(as.has(n))return;ss(n,`down`);let e=os(()=>{ss(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ss(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function ls(e){return es(e)&&!Jo()}var us=new WeakSet;function ds(e,t,n={}){let[r,i,a]=Xo(e,n),o=e=>{let r=e.currentTarget;if(!ls(e)||us.has(e))return;as.add(r),n.stopPropagation&&us.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),as.has(r)&&as.delete(r),ls(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||$o(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),po(e)&&(e.addEventListener(`focus`,e=>cs(e,i)),!ns(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var fs=new WeakMap,ps,ms=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:mo(r)&&`getBBox`in r?r.getBBox()[t]:r[n],hs=ms(`inline`,`width`,`offsetWidth`),gs=ms(`block`,`height`,`offsetHeight`);function _s({target:e,borderBoxSize:t}){fs.get(e)?.forEach(n=>{n(e,{get width(){return hs(e,t)},get height(){return gs(e,t)}})})}function vs(e){e.forEach(_s)}function ys(){typeof ResizeObserver<`u`&&(ps=new ResizeObserver(vs))}function bs(e,t){ps||ys();let n=go(e);return n.forEach(e=>{let n=fs.get(e);n||(n=new Set,fs.set(e,n)),n.add(t),ps?.observe(e)}),()=>{n.forEach(e=>{let n=fs.get(e);n?.delete(t),n?.size||ps?.unobserve(e)})}}var xs=new Set,Ss;function Cs(){Ss=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};xs.forEach(t=>t(e))},window.addEventListener(`resize`,Ss)}function ws(e){return xs.add(e),Ss||Cs(),()=>{xs.delete(e),!xs.size&&typeof Ss==`function`&&(window.removeEventListener(`resize`,Ss),Ss=void 0)}}function Ts(e,t){return typeof e==`function`?ws(e):bs(e,t)}var Es={value:null,addProjectionMetrics:null};function Ds(e){return mo(e)&&e.tagName===`svg`}var Os=e=>typeof e==`number`?e:parseFloat(e),ks=()=>({translate:0,scale:1,origin:0,originPoint:0}),As=()=>({x:ks(),y:ks()}),js=()=>({min:0,max:0}),Ms=()=>({x:js(),y:js()}),Ns=new WeakMap;function Ps(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Fs(e){return typeof e==`string`||Array.isArray(e)}var Is=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ls=[`initial`,...Is];function Rs(e){if(Ps(e.animate))return!0;for(let t=0;tVs.current=e.matches;e.addEventListener(`change`,t),t()}else Vs.current=!1}}var Gs=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Ks={};function qs(e){Ks=e}function Js(){return Ks}var Ys=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ui,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=N.now();this.renderScheduledAtt.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Hs.current||Ws(),this.shouldReduceMotion=Vs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),gr(this.notifyUpdate),gr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ua.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new na({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ot(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Di.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&L.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ks){let t=Ks[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ms()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t{this.current&&(this.current.textContent=`${e}`)}))}},Zs=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Qs(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var $s={};function ec(e,{layout:t,layoutId:n}){return Di.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!$s[e]||e===`opacity`)}function tc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ka(r[t])||i&&Ka(i[t])||ec(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function nc(e){return window.getComputedStyle(e)}var rc=class extends Xs{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Qs}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Di.has(t))return this.projection?.isProjecting?Si(t):wi(e,t);{let n=nc(e),r=(P(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return V(e,t)}build(e,t,n){bo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return tc(e,t,n)}},ic=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ac=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function oc(e,t,n,r){Qs(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ic.has(n)?n:Ya(n),t.attrs[n])}function sc(e,t,n){let r=tc(e,t,n);for(let n in e)if(Ka(e[n])||Ka(t[n])){let t=Ei.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var cc=class extends Xs{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ms}getBaseTargetFromProps(e,t){return Di.has(t)?super.getBaseTargetFromProps(e,t)??Si(t):e[t]}getDefaultValue(e){return Di.has(e)?this.latestValues[e]??Si(e):void 0}readValueFromInstance(e,t){if(Di.has(t)){let e=ui(t);return e&&e.default||0}if(wo.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=ic.has(t)?t:Ya(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return sc(e,t,n)}build(e,t,n){To(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){oc(e,t,n,r)}mount(e){this.isSVGTag=ac(e.tagName),super.mount(e)}};function lc(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:t,options:n})=>no(e,t,n))),n=pc(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(uc.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Fs(g)||g===!1?g:void 0:h,v=Fs(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||Ps(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=fc(i.prevProp,_),S=x||v&&(y&&!b||r>p),ee=!1,te=Array.isArray(_)?_:[_],C={};if(y!==!1)for(let n of te){let{transition:r,transitionEnd:i,...a}=za(e,n,Ba(e,t))||{};C={...C,...a,...i}}let{prevResolvedValues:ne}=i;for(let t in{...ne,...C}){if(t in f)continue;let n=C[t],r=ne[t],a=Array.isArray(n)&&Array.isArray(r)?!lc(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(ee=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=C,i.isActive&&(f={...f,...C}),S&&(!(b&&x)||ee))for(let n of te){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=za(s,n)?.transition?.delayChildren;r.delay=va(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&za(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Ka(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=pc(),i=!0}}}function fc(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!lc(t,e):!1}function pc(){let e={};for(let t of Is)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function mc(e,t){e.min=t.min,e.max=t.max}function hc(e,t){mc(e.x,t.x),mc(e.y,t.y)}function gc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var _c=.9999,vc=1.0001,yc=-.01,bc=.01;function xc(e){return e.max-e.min}function Sc(e,t,n){return Math.abs(e-t)<=n}function Cc(e,t,n,r=.5){e.origin=r,e.originPoint=I(t.min,t.max,e.origin),e.scale=xc(n)/xc(t),e.translate=I(n.min,n.max,e.origin)-e.originPoint,(e.scale>=_c&&e.scale<=vc||isNaN(e.scale))&&(e.scale=1),(e.translate>=yc&&e.translate<=bc||isNaN(e.translate))&&(e.translate=0)}function wc(e,t,n,r){Cc(e.x,t.x,n.x,r?r.originX:void 0),Cc(e.y,t.y,n.y,r?r.originY:void 0)}function Tc(e,t,n,r=0){e.min=(r?I(n.min,n.max,r):n.min)+t.min,e.max=e.min+xc(t)}function Ec(e,t,n,r){Tc(e.x,t.x,n.x,r?.x),Tc(e.y,t.y,n.y,r?.y)}function Dc(e,t,n,r=0){let i=r?I(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+xc(t)}function Oc(e,t,n,r){Dc(e.x,t.x,n.x,r?.x),Dc(e.y,t.y,n.y,r?.y)}function kc(e,t,n,r,i){return e-=t,e=Po(e,1/n,r),i!==void 0&&(e=Po(e,1/i,r)),e}function Ac(e,t=0,n=1,r=.5,i,a=e,o=e){if(Sn.test(t)&&(t=parseFloat(t),t=I(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=I(a.min,a.max,r);e===a&&(s-=t),e.min=kc(e.min,t,n,s,i),e.max=kc(e.max,t,n,s,i)}function jc(e,t,[n,r,i],a,o){Ac(e,t[n],t[r],t[i],t.scale,a,o)}var Mc=[`x`,`scaleX`,`originX`],Nc=[`y`,`scaleY`,`originY`];function Pc(e,t,n,r){jc(e.x,t,Mc,n?n.x:void 0,r?r.x:void 0),jc(e.y,t,Nc,n?n.y:void 0,r?r.y:void 0)}function Fc(e){return e.translate===0&&e.scale===1}function Ic(e){return Fc(e.x)&&Fc(e.y)}function Lc(e,t){return e.min===t.min&&e.max===t.max}function Rc(e,t){return Lc(e.x,t.x)&&Lc(e.y,t.y)}function zc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Bc(e,t){return zc(e.x,t.x)&&zc(e.y,t.y)}function Vc(e){return xc(e.x)/xc(e.y)}function Hc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Uc(e){return[e(`x`),e(`y`)]}function Wc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Gc={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(F.test(e))e=parseFloat(e);else return e}return`${Wc(e,t.target.x)}% ${Wc(e,t.target.y)}%`}},Kc={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Kn.parse(e);if(i.length>5)return r;let a=Kn.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=I(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function qc(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Jc=fo.length,Yc=e=>typeof e==`number`||F.test(e);function Xc(e,t,n,r,i,a){i?(e.opacity=I(0,n.opacity??1,Qc(r)),e.opacityExit=I(t.opacity??1,0,$c(r))):a&&(e.opacity=I(t.opacity??1,n.opacity??1,r));for(let i=0;irt?1:n(Et(e,t,r))}function tl(e,t,n){let r=Ka(e)?e:Ca(e);return r.start(Na(``,r,t,n)),r.animation}function nl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var rl=(e,t)=>e.depth-t.depth,il=class{constructor(){this.children=[],this.isDirty=!1}add(e){A(this.children,e),this.isDirty=!0}remove(e){_t(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rl),this.isDirty=!1,this.children.forEach(e)}};function al(e,t){let n=N.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(gr(r),e(a-t))};return L.setup(r,!0),()=>gr(r)}function ol(e){return Ka(e)?e.get():e}var sl=class{constructor(){this.members=[]}add(e){A(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(_t(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(_t(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},cl={borderRadius:{...Gc,applyTo:[...fo]},borderTopLeftRadius:Gc,borderTopRightRadius:Gc,borderBottomLeftRadius:Gc,borderBottomRightRadius:Gc,boxShadow:Kc},ll={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign($s,{...cl,...$s});var ul={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},dl=[``,`X`,`Y`,`Z`],fl=1e3,pl=0;function ml(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Za(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,L,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hl(r)}function gl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=pl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Es.value&&(ul.nodes=ul.calculatedTargetDeltas=ul.calculatedProjections=0),this.nodes.forEach(yl),this.nodes.forEach(Ol),this.nodes.forEach(kl),this.nodes.forEach(H),Es.addProjectionMetrics&&Es.addProjectionMetrics(ul)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;L.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=al(i,250),ll.hasAnimatedSinceResize&&(ll.hasAnimatedSinceResize=!1,this.nodes.forEach(Dl)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Il,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Bc(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Ta(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Dl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),gr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Al),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!xc(this.snapshot.measuredBox.x)&&!xc(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=I(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=I(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Ml(o.x,e.x,n),Ml(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Oc(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Pl(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Rc(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Ms(),hc(f,this.relativeTarget)),c&&(this.animationValues=a,Xc(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(gr(this.pendingAnimation),void 0),this.pendingAnimation=L.update(()=>{ll.hasAnimatedSinceResize=!0,this.motionValue||=Ca(0),this.motionValue.jump(0,!1),this.currentAnimation=tl(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Qr(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Vl(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Ms();let t=xc(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=xc(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}hc(t,i),B(t,r),wc(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new sl),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ml(`z`,e,r,this.animationValues);for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(xl),this.root.sharedNodes.clear()}}}function _l(e){e.updateLayout()}function vl(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Uc(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=xc(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;mc(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Vl(i,t.layoutBox,n)&&Uc(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=xc(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=As();wc(o,n,t.layoutBox);let s=As();a?wc(s,e.applyTransform(r,!0),t.measuredBox):wc(s,n,t.layoutBox);let c=!Ic(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Ms();Oc(s,t.layoutBox,i.layoutBox,o);let c=Ms();Oc(c,n,a.layoutBox,o),Bc(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function yl(e){Es.value&&ul.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function H(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function bl(e){e.clearSnapshot()}function xl(e){e.clearMeasurements()}function Sl(e){e.isLayoutDirty=!0,e.updateLayout()}function Cl(e){e.isLayoutDirty=!1}function wl(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Tl(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function El(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Dl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ol(e){e.resolveTargetDelta()}function kl(e){e.calcProjection()}function Al(e){e.resetSkewAndRotation()}function jl(e){e.removeLeadSnapshot()}function Ml(e,t,n){e.translate=I(t.translate,0,n),e.scale=I(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Nl(e,t,n,r){e.min=I(t.min,n.min,r),e.max=I(t.max,n.max,r)}function Pl(e,t,n,r){Nl(e.x,t.x,n.x,r),Nl(e.y,t.y,n.y,r)}function Fl(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Il={duration:.45,ease:[.4,0,.1,1]},Ll=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Rl=Ll(`applewebkit/`)&&!Ll(`chrome/`)?Math.round:wt;function zl(e){e.min=Rl(e.min),e.max=Rl(e.max)}function Bl(e){zl(e.x),zl(e.y)}function Vl(e,t,n){return e===`position`||e===`preserve-aspect`&&!Sc(Vc(t),Vc(n),.2)}function Hl(e){return e!==e.root&&e.scroll?.wasRoot}var Ul=gl({attachResizeListener:(e,t)=>nl(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Wl={current:void 0},Gl=gl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Wl.current){let e=new Ul({});e.mount(window),e.setOptions({layoutScroll:!0}),Wl.current=e}return Wl.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Kl=(0,T.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function ql(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Jl(...e){return t=>{let n=!1,r=e.map(e=>{let r=ql(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(` - [data-motion-pop-id="${o}"] { - position: absolute !important; - width: ${e}px !important; - height: ${u}px !important; - ${_}px !important; - ${v}px !important; - } - `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,U.jsx)(Xl,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:T.cloneElement(e,{ref:u})})}var Ql=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=mt($l),d=(0,T.useId)(),f=(0,T.useRef)(n),p=(0,T.useRef)(r);ht(()=>{f.current=n,p.current=r});let m=!0,h=(0,T.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,T.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),T.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,U.jsx)(Zl,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,U.jsx)(gt.Provider,{value:h,children:e})};function $l(){return new Map}function eu(e=!0){let t=(0,T.useContext)(gt);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,T.useId)();(0,T.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,T.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}function tu(){return nu((0,T.useContext)(gt))}function nu(e){return e===null||e.isPresent}var ru=e=>e.key||``;function iu(e){let t=[];return T.Children.forEach(e,e=>{(0,T.isValidElement)(e)&&t.push(e)}),t}var W=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=eu(o),f=(0,T.useMemo)(()=>iu(e),[e]),p=o&&!u?[]:f.map(ru),m=(0,T.useRef)(!0),h=mt(()=>new Map),g=(0,T.useRef)(new Set),[_,v]=(0,T.useState)(f),[y,b]=(0,T.useState)(f);ht(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]),ht(()=>{m.current=!1;for(let e=0;eh.get(ru(e)))?e=f:a===`wait`&&(e=x),b(iu(e)),v(f),null}let{forceRender:S}=(0,T.useContext)(pt);return(0,U.jsx)(U.Fragment,{children:y.map(e=>{let _=ru(e),b=o&&!u?!1:f===y||p.includes(_);return(0,U.jsx)(Ql,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(S?.(),v([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},_)})})},G=(0,T.createContext)({strict:!1}),au={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},ou=!1;function su(){if(ou)return;let e={};for(let t in au)e[t]={isEnabled:e=>au[t].some(t=>!!e[t])};qs(e),ou=!0}function cu(){return su(),Js()}function lu(e){let t=cu();for(let n in e)t[n]={...t[n],...e[n]};qs(t)}function uu({children:e,...t}){let n=(0,T.useContext)(Kl);t={...n,...t},t.transition=wa(t.transition,n.transition),t.isStatic=mt(()=>t.isStatic);let r=(0,T.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,U.jsx)(Kl.Provider,{value:r,children:e})}var du=(0,T.createContext)({});function fu(e,t){if(Rs(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Fs(t)?t:void 0,animate:Fs(n)?n:void 0}}return e.inherit===!1?{}:t}function pu(e){let{initial:t,animate:n}=fu(e,(0,T.useContext)(du));return(0,T.useMemo)(()=>({initial:t,animate:n}),[mu(t),mu(n)])}function mu(e){return Array.isArray(e)?e.join(` `):e}var hu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gu(e,t,n){for(let r in t)!Ka(t[r])&&!ec(r,n)&&(e[r]=t[r])}function _u({transformTemplate:e},t){return(0,T.useMemo)(()=>{let n=hu();return bo(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vu(e,t){let n=e.style||{},r={};return gu(r,n,e),Object.assign(r,_u(e,t)),r}function yu(e,t){let n={},r=vu(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var bu=()=>({...hu(),attrs:{}});function xu(e,t,n,r){let i=(0,T.useMemo)(()=>{let n=bu();return To(n,t,ac(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};gu(t,e.style,e),i.style={...t,...i.style}}return i}var Su=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Cu(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Su.has(e)}function wu(e,t){return e.startsWith(`on`)?!Cu(e):t?.(e)??!Cu(e)}function Tu(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Ka(e[a])||(wu(a,r)||n===!0&&Cu(a)||!t&&!Cu(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var Eu=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Du(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Eu.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ou(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Du(e)?xu:yu)(t,r,i,e),l=Tu(t,typeof e==`string`,a,s),u=e===T.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,T.useMemo)(()=>Ka(d)?d.get():d,[d]);return(0,T.createElement)(e,{...u,children:f})}function ku({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Au(n,r,i,e),renderState:t()}}function Au(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=ol(a[e]);let{initial:o,animate:s}=e,c=Rs(e),l=zs(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Ps(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{let r=(0,T.useContext)(du),i=(0,T.useContext)(gt),a=()=>ku(e,t,r,i);return n?a():mt(a)},Mu=ju({scrapeMotionValuesFromProps:tc,createRenderState:hu}),Nu=ju({scrapeMotionValuesFromProps:sc,createRenderState:bu}),Pu=Symbol.for(`motionComponentSymbol`);function Fu(e,t,n){let r=(0,T.useRef)(n);(0,T.useInsertionEffect)(()=>{r.current=n});let i=(0,T.useRef)(null);return(0,T.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Iu=(0,T.createContext)({});function Lu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Ru(e,t,n,r,i,a){let{visualElement:o}=(0,T.useContext)(du),s=(0,T.useContext)(G),c=(0,T.useContext)(gt),l=(0,T.useContext)(Kl),u=l.reducedMotion,d=l.skipAnimations,f=(0,T.useRef)(null),p=(0,T.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,T.useContext)(Iu);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&zu(f.current,n,i,h);let g=(0,T.useRef)(!1);(0,T.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[Xa],v=(0,T.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return ht(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),ht(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,T.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function zu(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Bu(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Lu(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Bu(e){if(e)return e.options.allowProjection===!1?Bu(e.parent):e.projection}function Vu(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&lu(r);let a=n?n===`svg`:Du(e),o=a?Nu:Mu;function s(n,s){let c,l={...(0,T.useContext)(Kl),...n,layoutId:Hu(n)},{isStatic:u,isValidProp:d}=l,f=pu(n),p=o(n,u);if(!u&&typeof window<`u`){Uu(l,r);let t=Wu(l);c=t.MeasureLayout,f.visualElement=Ru(e,p,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(du.Provider,{value:f,children:[c&&f.visualElement?(0,U.jsx)(c,{visualElement:f.visualElement,...l}):null,Ou(e,n,Fu(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,T.forwardRef)(s);return c[Pu]=e,c}function Hu({layoutId:e}){let t=(0,T.useContext)(pt).id;return t&&e!==void 0?t+`-`+e:e}function Uu(e,t){(0,T.useContext)(G).strict}function Wu(e){let{drag:t,layout:n}=cu();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Gu(e,t){if(typeof Proxy>`u`)return Vu;let n=new Map,r=(n,r)=>Vu(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Vu(a,void 0,e,t)),n.get(a))})}var Ku=(e,t)=>t.isSVG??Du(e)?new cc(t):new rc(t,{allowProjection:e!==T.Fragment}),qu=class extends Zs{constructor(e){super(e),e.animationState||=dc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ps(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ju=0,Yu={animation:{Feature:qu},exit:{Feature:class extends Zs{constructor(){super(...arguments),this.id=Ju++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=za(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Xu(e){return{point:{x:e.pageX,y:e.pageY}}}var Zu=e=>t=>es(t)&&e(t,Xu(t));function Qu(e,t,n,r){return nl(e,t,Zu(n),r)}var $u=({current:e})=>e?e.ownerDocument.defaultView:null,K=(e,t)=>Math.abs(e-t);function q(e,t){let n=K(e.x,t.x),r=K(e.y,t.y);return Math.sqrt(n**2+r**2)}var J=new Set([`auto`,`scroll`]),Y=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=X(this.lastRawMoveEventInfo,this.transformPagePoint));let e=td(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=q(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:N.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=X(t,this.transformPagePoint),this.hasPendingMove=!0,L.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=td(e.type===`pointercancel`?this.lastMoveEventInfo:X(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!es(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=X(Xu(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Qt;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,td(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Tt(Qu(this.contextWindow,`pointermove`,this.handlePointerMove,d),Qu(this.contextWindow,`pointerup`,this.handlePointerUp,d),Qu(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(J.has(e.overflowX)||J.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),gr(this.updatePoint)}};function X(e,t){return t?{point:t(e.point)}:e}function ed(e,t){return{x:e.x-t.x,y:e.y-t.y}}function td({point:e},t){return{point:e,delta:ed(e,rd(t)),offset:ed(e,nd(t)),velocity:id(t,.1)}}function nd(e){return e[0]}function rd(e){return e[e.length-1]}function id(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=rd(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ot(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ot(t)*2&&(r=e[1]);let a=kt(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ad(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?I(n,e,r.max):Math.min(e,n)),e}function od(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function sd(e,{top:t,left:n,bottom:r,right:i}){return{x:od(e.x,n,i),y:od(e.y,t,r)}}function cd(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Et(t.min,t.max-r,e.min):r>i&&(n=Et(e.min,e.max-i,t.min)),vt(0,1,n)}function dd(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var fd=.35;function pd(e=fd){return e===!1?e=0:e===!0&&(e=fd),{x:md(e,`left`,`right`),y:md(e,`top`,`bottom`)}}function md(e,t,n){return{min:hd(e,t),max:hd(e,n)}}function hd(e,t){return typeof e==`number`?e:e[t]||0}var gd=new WeakMap,_d=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ms(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yo(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Uc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Sn.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=xc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&L.update(()=>i(e,t),!1,!0),Ja(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=xd(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&L.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Y(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:$u(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&L.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!bd(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=ad(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Lu(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?sd(n.layoutBox,e):!1,this.elastic=pd(t),r!==this.constraints&&!Lu(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Uc(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=dd(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Lu(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Wo(n,r.root,this.visualElement.getTransformPagePoint()),a=ld(r.layout.layoutBox,i);if(t){let e=t(Do(a));this.hasMutatedConstraints=!!e,e&&(a=Eo(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Uc(o=>{if(!bd(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ja(this.visualElement,e),n.start(Na(e,n,0,t,this.visualElement,!1))}stopAnimation(){Uc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Uc(e=>{if(!bd(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-I(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Lu(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Uc(e=>{let t=this.getAxisMotionValue(e).get();i[e]=ud({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Uc(t=>{let n=this.getAxisMotionValue(t);if(!bd(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(I(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gd.set(this.visualElement,this);let e=this.visualElement.current,t=Qu(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&is(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Lu(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=yd(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),L.read(r);let o=nl(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Uc(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=fd,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function vd(e){let t=!0;return()=>{t?t=!1:e()}}function yd(e,t,n){let r=Ts(e,vd(n)),i=Ts(t,vd(n));return()=>{r(),i()}}function bd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xd(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Sd=class extends Zs{constructor(e){super(e),this.removeGroupControls=wt,this.removeListeners=wt,this.controls=new _d(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||wt}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Cd=e=>(t,n)=>{e&&L.update(()=>e(t,n),!1,!0)},wd=class extends Zs{constructor(){super(...arguments),this.removePointerDownListener=wt}onPointerDown(e){this.session=new Y(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$u(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Cd(e),onStart:Cd(t),onMove:Cd(n),onEnd:(e,t)=>{delete this.session,r&&L.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Qu(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Td=!1,Ed=class extends T.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Td&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ll.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Td=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||L.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Go.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Td=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Dd(e){let[t,n]=eu(),r=(0,T.useContext)(pt);return(0,U.jsx)(Ed,{...e,layoutGroup:r,switchLayoutGroup:(0,T.useContext)(Iu),isPresent:t,safeToRemove:n})}var Od={pan:{Feature:wd},drag:{Feature:Sd,ProjectionNode:Gl,MeasureLayout:Dd}};function kd(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&L.postRender(()=>i(t,Xu(t)))}var Ad=class extends Zs{mount(){let{current:e}=this.node;e&&(this.unmount=Qo(e,(e,t)=>(kd(this.node,t,`Start`),e=>kd(this.node,e,`End`))))}unmount(){}},jd=class extends Zs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Tt(nl(this.node.current,`focus`,()=>this.onFocus()),nl(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Md(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&L.postRender(()=>i(t,Xu(t)))}var Nd=class extends Zs{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=ds(e,(e,t)=>(Md(this.node,t,`Start`),(e,{success:t})=>Md(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Pd=new WeakMap,Fd=new WeakMap,Id=e=>{let t=Pd.get(e.target);t&&t(e)},Ld=e=>{e.forEach(Id)};function Rd({root:e,...t}){let n=e||document;Fd.has(n)||Fd.set(n,{});let r=Fd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ld,{root:e,...t})),r[i]}function zd(e,t,n){let r=Rd(t);return Pd.set(e,n),r.observe(e),()=>{Pd.delete(e),r.unobserve(e)}}var Bd={some:0,all:1},Vd=class extends Zs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Bd[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=zd(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Hd(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Hd({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Ud={inView:{Feature:Vd},tap:{Feature:Nd},focus:{Feature:jd},hover:{Feature:Ad}},Wd={layout:{ProjectionNode:Gl,MeasureLayout:Dd}},Gd=Gu({...Yu,...Ud,...Od,...Wd},Ku),Kd=h(),qd=_(),Jd=Gd,Yd=1e-4;function Xd(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):0}function Zd(e){switch(e){case`navigation`:return .065;case`focus`:return .11;case`select`:return .16;case`success`:return .24;case`warning`:return .3;case`error`:return .34;case`connect`:case`disconnect`:return .5}}function Qd(){if(typeof window>`u`)return null;let e=window;return e.AudioContext??e.webkitAudioContext??null}function $d(){return Qd()!==null}var ef=class{context=null;master=null;state=`idle`;isMuted;masterVolume;pauseWhenHidden;manuallySuspended=!1;hiddenSuspended=!1;listenerAttached=!1;startPromise=null;sources=new Set;toneSources=new Map;lastCueAt=new Map;constructor(e={}){this.isMuted=e.muted??!1,this.masterVolume=Xd(e.volume??.42),this.pauseWhenHidden=e.pauseWhenHidden??!0}get supported(){return this.context!==null||$d()}get muted(){return this.isMuted}get status(){return this.state}get volume(){return this.masterVolume}start(e){return e?.muted!==void 0&&this.setMuted(e.muted),this.state===`disposed`?Promise.resolve(!1):this.context?this.resume():(this.startPromise||=this.initialize().finally(()=>{this.startPromise=null}),this.startPromise)}setMuted(e){this.state!==`disposed`&&(this.isMuted=e,this.applyMasterGain(.055))}toggleMuted(){return this.setMuted(!this.isMuted),this.isMuted}setVolume(e){this.state!==`disposed`&&(this.masterVolume=Xd(e),this.applyMasterGain(.07))}cue(e,t=`neutral`){let n=this.playableContext(e);if(!n||!this.master)return!1;nf(e);let r=n.currentTime+.005;switch(e){case`focus`:this.tone(n,r,.16,523.25,587.33,.022,0,`sine`);break;case`select`:[392,523.25,659.25].forEach((e,t)=>{this.tone(n,r+t*.027,.3+t*.04,e,e*1.006,.018-t*.002,(t-1)*.14,t===1?`triangle`:`sine`)});break;case`navigation`:{let e=rf(t);this.tone(n,r,.11,e.start,e.end,.02,e.pan,`sine`);break}case`warning`:this.tone(n,r,.21,246.94,196,.027,-.08,`triangle`),this.tone(n,r+.09,.25,220,174.61,.022,.08,`sine`);break;case`success`:this.tone(n,r,.26,329.63,493.88,.021,-.08,`sine`),this.tone(n,r+.06,.32,493.88,659.25,.017,.08,`triangle`);break;case`error`:this.tone(n,r,.28,196,146.83,.026,-.08,`triangle`),this.tone(n,r+.075,.3,164.81,123.47,.02,.08,`sine`);break;case`connect`:this.tone(n,r,.24,293.66,392,.018,-.08,`sine`),this.tone(n,r+.055,.3,440,587.33,.014,.08,`triangle`);break;case`disconnect`:this.tone(n,r,.24,392,293.66,.018,-.08,`triangle`),this.tone(n,r+.055,.3,261.63,196,.014,.08,`sine`)}return!0}playTone(e,t,n,r){let i=this.context;if(!i||!this.master||this.state!==`running`||this.isMuted||this.masterVolume<=0||!Number.isFinite(e)||e<20||e>2e4||!Number.isFinite(t)||t<1||t>6e4||n!==void 0&&(!Number.isFinite(n)||n<0))return!1;let a=n===void 0?.003:n/1e3;return this.tone(i,i.currentTime+a,t/1e3,e,e,.024,0,`square`,r),!0}stopTone(e,t=0){let n=this.context,r=e.trim();if(!n||n.state===`closed`||this.state===`disposed`||!r||!Number.isFinite(t)||t<0)return!1;let i=this.toneSources.get(r);if(!i?.size)return!1;let a=n.currentTime+t/1e3;for(let e of i)try{e.stop(a)}catch{}return this.toneSources.delete(r),!0}async suspend(){let e=this.context;if(e&&this.state!==`disposed`){if(this.manuallySuspended=!0,this.hiddenSuspended=!1,e.state===`running`)try{await e.suspend()}catch{}e===this.context&&(this.state=`paused`)}}async resume(){let e=this.context;if(!e||e.state===`closed`||this.state===`disposed`)return!1;if(typeof document<`u`&&document.hidden)return this.state=`paused`,!1;this.manuallySuspended=!1,this.hiddenSuspended=!1;try{e.state!==`running`&&await e.resume()}catch{return this.state=`paused`,!1}let t=e.state===`running`;return this.state=t?`running`:`paused`,t&&this.applyMasterGain(.12),t}async dispose(){if(this.state===`disposed`)return;this.state=`disposed`,this.detachVisibilityListener();for(let e of this.sources){try{e.stop()}catch{}try{e.disconnect()}catch{}}this.sources.clear(),this.toneSources.clear();let e=this.context;if(this.context=null,this.master=null,e&&e.state!==`closed`)try{await e.close()}catch{}}async initialize(){let e=Qd();if(!e)return this.state=`unsupported`,!1;this.state=`starting`;let t;try{t=new e({latencyHint:`interactive`})}catch{try{t=new e}catch{return this.state=`unsupported`,!1}}this.context=t;let n=t.createGain(),r=t.createDynamicsCompressor();n.gain.setValueAtTime(0,t.currentTime),r.threshold.setValueAtTime(-22,t.currentTime),r.knee.setValueAtTime(16,t.currentTime),r.ratio.setValueAtTime(4,t.currentTime),r.attack.setValueAtTime(.012,t.currentTime),r.release.setValueAtTime(.24,t.currentTime),n.connect(r),r.connect(t.destination),this.master=n,this.attachVisibilityListener(),t.onstatechange=()=>{t===this.context&&this.state!==`disposed`&&(this.state=t.state===`running`?`running`:`paused`)};try{t.state!==`running`&&await t.resume()}catch{return this.state=`paused`,!1}let i=t.state===`running`;return this.state=i?`running`:`paused`,i&&this.applyMasterGain(.32),i}playableContext(e){let t=this.context;if(!t||this.state!==`running`||this.isMuted||this.masterVolume<=0)return null;let n=Zd(e),r=this.lastCueAt.get(e)??-1/0;return t.currentTime-r{if(this.sources.delete(l),m){let e=this.toneSources.get(m);e?.delete(l),e?.size===0&&this.toneSources.delete(m)}l.disconnect(),u.disconnect(),d?.disconnect()},{once:!0}),l.start(t),l.stop(p+.025)}applyMasterGain(e){let t=this.context,n=this.master;if(!t||!n||t.state===`closed`)return;let r=t.currentTime,i=this.isMuted?0:this.masterVolume;n.gain.cancelScheduledValues(r),n.gain.setValueAtTime(n.gain.value,r),n.gain.linearRampToValueAtTime(i,r+Math.max(.005,e))}attachVisibilityListener(){this.pauseWhenHidden&&!this.listenerAttached&&typeof document<`u`&&(document.addEventListener(`visibilitychange`,this.onVisibilityChange),this.listenerAttached=!0)}detachVisibilityListener(){this.listenerAttached&&typeof document<`u`&&(document.removeEventListener(`visibilitychange`,this.onVisibilityChange),this.listenerAttached=!1)}onVisibilityChange=()=>{let e=this.context;e&&this.state!==`disposed`&&(document.hidden?e.state===`running`&&!this.manuallySuspended&&(this.hiddenSuspended=!0,e.suspend().then(()=>{this.state!==`disposed`&&(this.state=`paused`)}).catch(()=>void 0)):this.hiddenSuspended&&!this.manuallySuspended&&(this.hiddenSuspended=!1,e.resume().then(()=>{e.state===`running`&&this.state!==`disposed`&&(this.state=`running`,this.applyMasterGain(.18))}).catch(()=>{this.state=`paused`})))}};function tf(e){return e===`select`?8:e===`success`?[10,22,14]:e===`warning`?[18,32,18]:e===`error`?[22,28,22]:e===`connect`?10:e===`disconnect`?[12,24,10]:null}function nf(e){if(typeof navigator>`u`||typeof navigator.vibrate!=`function`||typeof document<`u`&&document.visibilityState!==`visible`)return;let t=tf(e);t!==null&&navigator.vibrate(t)}function rf(e){switch(e){case`forward`:return{start:349.23,end:415.3,pan:0};case`backward`:return{start:349.23,end:293.66,pan:0};case`left`:return{start:329.63,end:369.99,pan:-.32};case`right`:return{start:329.63,end:369.99,pan:.32};case`up`:return{start:392,end:466.16,pan:0};case`down`:return{start:329.63,end:261.63,pan:0};default:return{start:329.63,end:369.99,pan:0}}}function af(e){return new ef(e)}function of(e){return[e.port.instance_id||e.port.serial_number||e.port.name||`controller`,e.hello.build_hash??``,e.hello.build_timestamp||``].join(`|`)}var sf=class{requestedGeneration=``;shouldRead(e,t){if(!e.connected||e.have_settings)return this.requestedGeneration=``,!1;if(!t)return!1;let n=of(e);return n!==this.requestedGeneration&&(this.requestedGeneration=n,!0)}},cf=class{start;stop;onError;onHoldingChange;active=!1;stopIssued=!1;startPromise=Promise.resolve();constructor(e,t,n,r){this.start=e,this.stop=t,this.onError=n,this.onHoldingChange=r}begin(){if(this.active)return!1;this.active=!0,this.stopIssued=!1,this.onHoldingChange(!0);let e=Promise.resolve().then(this.start);return this.startPromise=e,e.catch(e=>{this.onError(e),this.release()}),!0}release(e=!0){return!this.active||this.stopIssued?!1:(this.active=!1,this.stopIssued=!0,e&&this.onHoldingChange(!1),this.startPromise.catch(()=>void 0).then(this.stop).catch(this.onError),!0)}isHolding(){return this.active}};function lf(e){return e.filter(Number.isFinite)}function uf(e,t){let n=lf(e);if(!n.length)return t===`temperature`?[20,60]:t===`supply`?[0,13]:[0,1];let r=Math.min(...n),i=Math.max(...n);if(t===`supply`)return[0,Math.max(13,Math.ceil(i*1.05*2)/2)];if(t===`temperature`)return[Math.min(20,Math.floor(r-5)),Math.max(60,Math.ceil(i+3))];if(t===`current`)return[0,Math.max(100,Math.ceil(Math.max(0,i)*1.2/50)*50)];if(i>r)return[r,i];let a=Math.max(1,Math.abs(r)*.05);return[r-a,i+a]}function df(e,t=`auto`,n=300,r=92){let i=lf(e),a=i.length>1?i:i.length===1?[i[0],i[0]]:[0,0],[o,s]=uf(a,t),c=Math.max(2**-52,s-o);return a.map((e,t)=>({x:t/Math.max(1,a.length-1)*n,y:r-8-Math.max(0,Math.min(1,(e-o)/c))*(r-20)}))}function ff(e){let t=typeof navigator>`u`?void 0:navigator,n=e??`${t?.userAgentData?.platform??``} ${t?.platform??``} ${t?.userAgent??``}`;return/mac|iphone|ipad|ipod/i.test(n)?`⌘`:`Ctrl`}function pf(e){return ff(e)===`⌘`?`Meta+K`:`Control+K`}function Z(e,t){return typeof document<`u`&&document.documentElement.lang.toLowerCase().startsWith(`fa`)?t:e}function mf({icon:e,size:t=18}){return(0,U.jsx)(e,{"aria-hidden":`true`,size:t,strokeWidth:1.8})}function hf({fallback:e}){let[t,n]=(0,T.useState)(!1);return t?(0,U.jsx)(`span`,{"aria-hidden":`true`,children:e}):(0,U.jsx)(`img`,{src:`/favicon.svg`,alt:``,onError:()=>n(!0)})}function gf({active:e,disabled:t,label:n,onToggle:r}){return(0,U.jsx)(`button`,{type:`button`,className:`relay-switch__toggle`,"aria-label":n,"aria-pressed":e,disabled:t,onClick:r,children:(0,U.jsx)(`i`,{"aria-hidden":`true`,children:(0,U.jsx)(`b`,{})})})}function _f({keys:e,separator:t=`+`}){let n=e.map(e=>Array.isArray(e)?e.join(Z(` or `,` یا `)):e).join(t===`+`?Z(` plus `,` به‌علاوهٔ `):` ${t} `);return(0,U.jsx)(`span`,{className:`key-combo`,dir:`ltr`,"aria-label":n,children:e.map((e,n)=>(0,U.jsxs)(`span`,{className:`key-combo__group`,children:[n>0&&(0,U.jsx)(`span`,{className:`key-combo__separator`,"aria-hidden":`true`,children:t}),(Array.isArray(e)?e:[e]).map((e,t)=>(0,U.jsxs)(`span`,{className:`key-combo__key`,children:[t>0&&(0,U.jsx)(`span`,{className:`key-combo__alternative`,"aria-hidden":`true`,children:`/`}),(0,U.jsx)(`kbd`,{children:e})]},e))]},`${n}-${Array.isArray(e)?e.join(`-`):e}`))})}var vf=(0,T.forwardRef)(function({icon:e,tone:t=`secondary`,busy:n,compact:r,children:i,className:a=``,disabled:o,...s},c){return(0,U.jsxs)(`button`,{className:`button button--${t}${r?` button--compact`:``} ${a}`,disabled:o||n,ref:c,...s,children:[(0,U.jsx)(`span`,{className:`button__wash`,"aria-hidden":`true`}),n?(0,U.jsx)(Pe,{className:`spin`,"aria-hidden":`true`,size:17}):e?(0,U.jsx)(mf,{icon:e,size:17}):null,i?(0,U.jsx)(`span`,{children:i}):null]})});function yf({onHoldStart:e,onHoldStop:t,onHoldError:n,disabled:r,className:i=``,children:a,...o}){let[s,c]=(0,T.useState)(!1),l=(0,T.useRef)(e),u=(0,T.useRef)(t),d=(0,T.useRef)(n);l.current=e,u.current=t,d.current=n;let f=(0,T.useRef)(null);f.current||=new cf(()=>l.current(),()=>u.current(),e=>d.current?.(e),c);let p=f.current;return(0,T.useEffect)(()=>{let e=()=>p.release(),t=()=>{document.visibilityState!==`visible`&&e()};return window.addEventListener(`blur`,e),window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`pagehide`,e),document.removeEventListener(`visibilitychange`,t),p.release(!1)}},[p]),(0,U.jsx)(vf,{...o,disabled:r,className:`${i} hold-action${s?` is-holding`:``}`,"aria-pressed":s,onPointerDown:e=>{e.button!==0||r||(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),p.begin())},onPointerUp:e=>{e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),p.release()},onPointerCancel:()=>p.release(),onPointerLeave:()=>p.release(),onLostPointerCapture:()=>p.release(),onKeyDown:e=>{e.key!==` `&&e.key!==`Enter`||e.repeat||r||(e.preventDefault(),p.begin())},onKeyUp:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),p.release())},"data-touch-mode":`hold`,onBlur:()=>p.release(),children:a})}function bf({icon:e,iconTone:t=`accent`,title:n,eyebrow:r,action:i,menu:a=[],children:o,className:s=``,id:c}){let l=`card-menu-${(0,T.useId)().replace(/:/g,``)}`,[u,d]=(0,T.useState)(!1),[f,p]=(0,T.useState)({left:0,top:0}),m=(0,T.useRef)(null),h=(0,T.useRef)(null),g=(0,T.useRef)(null),_=(0,T.useRef)(null),v=(e=!0)=>{d(!1),e&&window.requestAnimationFrame(()=>_.current?.focus())},y=(e,t,n)=>{_.current=n,p({left:e,top:t}),d(!0)};return(0,T.useLayoutEffect)(()=>{if(!u||!g.current)return;let e=g.current.getBoundingClientRect();p(t=>({left:Math.max(10,Math.min(t.left,window.innerWidth-e.width-10)),top:Math.max(10,Math.min(t.top,window.innerHeight-e.height-10))}))},[u]),(0,T.useEffect)(()=>{if(!u)return;let e=window.requestAnimationFrame(()=>g.current?.querySelector(`button:not(:disabled)`)?.focus()),t=e=>{!g.current?.contains(e.target)&&!h.current?.contains(e.target)&&v(!1)},n=()=>v(!1),r=e=>{let t=e.target;!g.current?.contains(t)&&!h.current?.contains(t)&&v(!1)},i=()=>{document.visibilityState!==`visible`&&v(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,r),document.addEventListener(`visibilitychange`,i),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.cancelAnimationFrame(e),document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,r),document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[u]),(0,U.jsxs)(`section`,{id:c,className:`card ${s}`,ref:m,tabIndex:a.length?0:void 0,onKeyDown:e=>{if(!a.length||!(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`))return;e.preventDefault();let t=m.current?.getBoundingClientRect();t&&y(t.right-12,t.top+44,m.current)},onContextMenu:a.length?e=>{e.preventDefault(),y(e.clientX,e.clientY,m.current)}:void 0,children:[(n||r||i||a.length>0)&&(0,U.jsxs)(`header`,{className:`card__header`,children:[(0,U.jsxs)(`div`,{className:`card__heading`,children:[e&&(0,U.jsx)(`span`,{className:`card__icon card__icon--${t}`,children:(0,U.jsx)(mf,{icon:e,size:18})}),(0,U.jsxs)(`div`,{className:`card__heading-copy`,children:[r&&(0,U.jsx)(`div`,{className:`eyebrow`,children:r}),n&&(0,U.jsx)(`h2`,{children:n})]})]}),(i||a.length>0)&&(0,U.jsxs)(`div`,{className:`card__action`,children:[i,a.length>0&&(0,U.jsx)(`button`,{ref:h,type:`button`,className:`card__menu-trigger`,"aria-label":Z(`Card actions`,`عملیات کارت`),"aria-haspopup":`menu`,"aria-controls":l,"aria-expanded":u,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();y(t.right,t.bottom+7,e.currentTarget)},children:(0,U.jsx)(mf,{icon:O,size:18})})]})]}),o,typeof document<`u`&&(0,Kd.createPortal)((0,U.jsx)(W,{children:u&&(0,U.jsx)(Jd.div,{id:l,ref:g,className:`card-menu`,role:`menu`,"aria-label":Z(`Card actions`,`عملیات کارت`),style:f,initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.14,ease:[.22,1,.36,1]},onKeyDown:e=>{let t=[...g.current?.querySelectorAll(`button:not(:disabled)`)??[]];if(!t.length)return;let n=t.indexOf(document.activeElement),r=n<0?0:n;e.key===`Escape`?(e.preventDefault(),v()):e.key===`Tab`?v(!1):[`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(r+1)%t.length:(r-1+t.length)%t.length]?.focus())},children:a.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,"data-tone":e.tone??`normal`,onClick:()=>{v(),e.onSelect()},children:[e.icon&&(0,U.jsx)(mf,{icon:e.icon,size:17}),(0,U.jsx)(`span`,{children:e.label})]},e.label))})}),document.body)]})}function xf({eyebrow:e,title:t,detail:n,action:r}){return(0,U.jsxs)(`header`,{className:`section-title`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:e}),(0,U.jsx)(`h1`,{children:t}),n&&(0,U.jsx)(`p`,{children:n})]}),r&&(0,U.jsx)(`div`,{className:`section-title__action`,children:r})]})}function Sf({tone:e,children:t,pulse:n}){return(0,U.jsxs)(`span`,{className:`status-badge status-badge--${e}${n?` status-badge--pulse`:``}`,children:[(0,U.jsx)(`span`,{className:`status-badge__line`,"aria-hidden":`true`}),t]})}function Cf({values:e,tone:t=`accent`,label:n,scale:r=`auto`}){let i=(0,T.useId)().replace(/:/g,``),a=df(e,r,300,92).map((e,t)=>`${t===0?`M`:`L`}${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `),o=`${a} L300,92 L0,92 Z`;return(0,U.jsxs)(`svg`,{className:`sparkline sparkline--${t}`,viewBox:`0 0 300 92`,role:`img`,"aria-label":n,preserveAspectRatio:`none`,children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`fill-${i}`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`0`,stopColor:`currentColor`,stopOpacity:`.28`}),(0,U.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`,stopOpacity:`0`})]}),(0,U.jsxs)(`linearGradient`,{id:`line-${i}`,x1:`0`,x2:`1`,children:[(0,U.jsx)(`stop`,{offset:`0`,stopColor:`currentColor`,stopOpacity:`.4`}),(0,U.jsx)(`stop`,{offset:`.55`,stopColor:`currentColor`}),(0,U.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`,stopOpacity:`.65`})]})]}),(0,U.jsx)(`path`,{className:`sparkline__grid`,d:`M0 24H300 M0 48H300 M0 72H300`}),(0,U.jsx)(Jd.path,{className:`sparkline__area`,d:o,fill:`url(#fill-${i})`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.7}}),(0,U.jsx)(Jd.path,{className:`sparkline__line`,d:a,fill:`none`,stroke:`url(#line-${i})`,initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{duration:.8,ease:[.22,1,.36,1]}})]})}function wf({icon:e,label:t,value:n,unit:r,values:i,tone:a,detail:o,scale:s=`auto`}){return(0,U.jsxs)(`article`,{className:`metric metric--${a}`,children:[(0,U.jsxs)(`div`,{className:`metric__top`,children:[(0,U.jsx)(`span`,{className:`metric__icon`,children:(0,U.jsx)(mf,{icon:e,size:19})}),(0,U.jsx)(`span`,{className:`metric__label`,children:t})]}),(0,U.jsxs)(`div`,{className:`metric__value`,dir:`ltr`,children:[(0,U.jsx)(`strong`,{children:n}),(0,U.jsx)(`span`,{children:r})]}),o&&(0,U.jsx)(`div`,{className:`metric__detail`,children:o}),(0,U.jsx)(Cf,{values:i,tone:a,scale:s,label:Z(`${t} trend`,`روند ${t}`)})]})}function Tf({checked:e,onChange:t,label:n,detail:r,disabled:i}){return(0,U.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":e,className:`toggle-row${i?` is-disabled`:``}`,disabled:i,onClick:()=>t(!e),children:[(0,U.jsxs)(`span`,{className:`toggle-row__copy`,children:[(0,U.jsx)(`strong`,{children:n}),r&&(0,U.jsx)(`small`,{children:r})]}),(0,U.jsx)(`span`,{className:`toggle`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})})]})}function Ef({label:e,value:t,min:n,max:r,step:i=1,unit:a,onChange:o,disabled:s}){let c=(0,T.useId)(),[l,u]=(0,T.useState)(String(t));(0,T.useEffect)(()=>u(String(t)),[t]);let d=(t-n)/Math.max(1,r-n)*100;return(0,U.jsxs)(`div`,{className:`range-field${s?` is-disabled`:``}`,children:[(0,U.jsxs)(`span`,{className:`range-field__label`,children:[(0,U.jsx)(`label`,{htmlFor:c,children:(0,U.jsx)(`strong`,{children:e})}),(0,U.jsxs)(`span`,{className:`range-field__value`,dir:`ltr`,children:[(0,U.jsx)(`input`,{className:`range-field__number`,type:`number`,value:l,min:n,max:r,step:i,disabled:s,"aria-label":typeof e==`string`?Z(`${e} exact value`,`مقدار دقیق ${e}`):Z(`Exact value`,`مقدار دقیق`),onInput:e=>u(e.currentTarget.value),onBlur:()=>{let e=Number(l);if(!Number.isFinite(e)){u(String(t));return}let i=Math.min(r,Math.max(n,e));u(String(i)),o(i)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}}),a&&(0,U.jsx)(`span`,{children:a})]})]}),(0,U.jsx)(`input`,{id:c,type:`range`,value:t,min:n,max:r,step:i,disabled:s,style:{"--range":`${d}%`},onChange:e=>o(Number(e.target.value))})]})}function Df({value:e,options:t,onChange:n,label:r}){return(0,U.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-label":r,children:t.map(t=>(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t.value===e,className:t.value===e?`is-active`:``,onClick:()=>n(t.value),children:[t.icon&&(0,U.jsx)(mf,{icon:t.icon,size:16}),(0,U.jsx)(`span`,{children:t.label})]},t.value))})}function Of({label:e,hint:t,error:n,success:r,action:i,id:a,"aria-describedby":o,...s}){let c=(0,T.useId)(),l=a||`field-${c.replace(/:/g,``)}`,u=`${l}-message`,d=n||r||t,f=!!t&&!n&&!r;return(0,U.jsxs)(`div`,{className:`text-field${n?` is-invalid`:r?` is-valid`:``}`,children:[(0,U.jsx)(`label`,{htmlFor:l,children:e}),(0,U.jsxs)(`div`,{className:`text-field__control`,children:[(0,U.jsx)(`input`,{id:l,"aria-describedby":[o,d?u:``].filter(Boolean).join(` `)||void 0,"aria-invalid":n?!0:void 0,...s}),i&&(0,U.jsx)(`div`,{className:`text-field__action`,children:i})]}),d&&(0,U.jsx)(`small`,{id:u,className:`text-field__message${f?` text-field__message--contextual`:``}`,role:n?`alert`:`status`,children:d})]})}function kf({icon:e,title:t,detail:n,action:r}){return(0,U.jsxs)(`div`,{className:`empty-state`,children:[(0,U.jsx)(`span`,{className:`empty-state__icon`,children:(0,U.jsx)(mf,{icon:e,size:25})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:t}),(0,U.jsx)(`p`,{children:n})]}),r]})}function Af({label:e,value:t,mono:n,tone:r}){return(0,U.jsxs)(`div`,{className:`data-row`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:`${n?`mono`:``}${r?` text-${r}`:``}`,children:t})]})}function jf({icon:e,label:t,active:n,badge:r,onClick:i}){return(0,U.jsxs)(`button`,{className:`nav-button${n?` is-active`:``}`,onClick:i,"aria-label":t,"aria-current":n?`page`:void 0,children:[(0,U.jsx)(`span`,{className:`nav-button__icon`,children:(0,U.jsx)(mf,{icon:e,size:20})}),(0,U.jsx)(`span`,{className:`nav-button__label`,children:t}),r&&(0,U.jsx)(`span`,{className:`nav-button__badge`,children:r}),(0,U.jsx)(ye,{className:`nav-button__chevron`,"aria-hidden":`true`,size:15})]})}function Mf(e){if(!e?.isConnected)return!1;let t=e.querySelector(`h1`)??e;return t.dataset.routeFocusTarget=``,t.hasAttribute(`tabindex`)||t.setAttribute(`tabindex`,`-1`),t.focus({preventScroll:!0}),!0}function Nf({focusOnEnter:e,children:t}){let n=(0,T.useRef)(null),r=tu(),i=(0,T.useRef)(e);return(0,U.jsx)(Jd.div,{ref:n,className:`page`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18,ease:`easeOut`},onAnimationComplete:()=>{r&&i.current&&Mf(n.current)},children:t})}function Pf({pageKey:e,children:t}){let n=(0,T.useRef)(!1);return(0,T.useEffect)(()=>{n.current=!0},[]),(0,U.jsx)(W,{mode:`wait`,initial:!1,children:(0,U.jsx)(Nf,{focusOnEnter:n.current,children:t},e)})}function Ff({open:e,progress:t,locale:n,productTitle:r,productShortName:i,productTagline:a,onEnter:o}){let s=t>=100,c=t<34?n===`fa`?`بارگذاری هویت سامانه`:`Loading system identity`:t<68?n===`fa`?`برقراری مسیر کنترل`:`Establishing control route`:t<96?n===`fa`?`همگام‌سازی وضعیت میزبان`:`Synchronizing host state`:n===`fa`?`مرکز کنترل آماده است`:`Control center is ready`;return(0,U.jsx)(W,{children:e&&(0,U.jsxs)(Jd.section,{className:`boot-gate`,role:`dialog`,"aria-modal":`true`,"aria-busy":!s,"aria-labelledby":`boot-title`,initial:{opacity:1},exit:{opacity:0},transition:{duration:.28,ease:`easeOut`},children:[(0,U.jsxs)(`div`,{className:`boot-fuji`,"aria-hidden":`true`,children:[(0,U.jsx)(`span`,{className:`boot-fuji__rear`}),(0,U.jsx)(`span`,{className:`boot-fuji__face`}),(0,U.jsx)(`span`,{className:`boot-fuji__snow`}),(0,U.jsx)(`span`,{className:`boot-fuji__trace`})]}),(0,U.jsxs)(`div`,{className:`boot-identity`,children:[(0,U.jsx)(`div`,{className:`brand__mark`,"aria-hidden":`true`,children:(0,U.jsx)(hf,{fallback:i})}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`span`,{children:[r.toUpperCase(),` / `,a]}),(0,U.jsx)(`h1`,{id:`boot-title`,children:n===`fa`?`مرکز کنترل یکپارچه`:r})]})]}),(0,U.jsxs)(`div`,{className:`boot-status`,"aria-live":`polite`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:c}),(0,U.jsxs)(`b`,{dir:`ltr`,children:[Math.round(t).toString().padStart(2,`0`),`%`]})]}),(0,U.jsx)(`div`,{className:`boot-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),children:(0,U.jsx)(`span`,{style:{inlineSize:`${t}%`}})})]}),(0,U.jsxs)(`div`,{className:`boot-entry${s?` is-ready`:``}`,inert:!s||void 0,children:[(0,U.jsx)(vf,{tone:`primary`,icon:le,disabled:!s,onClick:()=>o(!0),children:n===`fa`?`ورود با نشانه‌های صوتی`:`Enter with audio cues`}),(0,U.jsx)(vf,{icon:it,disabled:!s,onClick:()=>o(!1),children:n===`fa`?`ورود بی‌صدا`:`Enter quietly`})]})]})})}function If({open:e,locale:t,onClose:n}){let r=t===`fa`?`میانبرهای مرکز کنترل`:`Control center shortcuts`,i=ff(),a=t===`fa`?[{keys:[i,`K`],detail:`فرمان‌ها و صفحه‌ها`},{keys:[`Alt`,`1…8`],detail:`رفتن مستقیم به صفحه`},{keys:[`G`,[`D`,`C`,`B`,`V`,`W`,`E`,`S`]],separator:`سپس`,detail:`رفتن به داشبورد، کنترلر، میزکار تجهیزات، دستگاه، فضای داده، رویدادها یا تنظیمات`},{keys:[i,`Shift`,[`←`,`→`]],detail:`صفحهٔ کناری در جهت دیداری`},{keys:[`?`],detail:`نمایش یا بستن این راهنما`},{keys:[`M`],detail:`قطع یا وصل نشانه‌های صوتی`},{keys:[`Esc`],detail:`بستن لایهٔ فعال`}]:[{keys:[i,`K`],detail:`Commands and pages`},{keys:[`Alt`,`1…8`],detail:`Open a page directly`},{keys:[`G`,[`D`,`C`,`B`,`V`,`W`,`E`,`S`]],separator:`then`,detail:`Go to dashboard, controls, peripheral workbench, device, data workspace, events, or settings`},{keys:[i,`Shift`,[`←`,`→`]],detail:`Adjacent page in the visual direction`},{keys:[`?`],detail:`Show or close this guide`},{keys:[`M`],detail:`Mute or enable interaction cues`},{keys:[`Esc`],detail:`Close the active layer`}];return(0,U.jsx)(W,{children:e&&(0,U.jsxs)(Jd.div,{className:`hotkey-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,U.jsx)(`button`,{className:`modal-backdrop`,"aria-label":t===`fa`?`بستن راهنمای صفحه‌کلید`:`Close keyboard guide`,onClick:n}),(0,U.jsxs)(Jd.section,{className:`hotkey-help`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`hotkey-help-title`,initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.99},transition:{duration:.2,ease:`easeOut`},children:[(0,U.jsxs)(`header`,{children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(De,{size:19}),(0,U.jsx)(`i`,{children:t===`fa`?`راهنمای کلیدها`:`KEY MAP`})]}),(0,U.jsx)(`button`,{className:`modal__close`,onClick:n,"aria-label":t===`fa`?`بستن`:`Close`,children:(0,U.jsx)(ut,{size:18})})]}),(0,U.jsx)(`h2`,{id:`hotkey-help-title`,children:r}),(0,U.jsx)(`div`,{className:`hotkey-list`,children:a.map(e=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(_f,{keys:e.keys,separator:e.separator}),(0,U.jsx)(`span`,{children:e.detail})]},`${e.keys.flat().join(`-`)}-${e.detail}`))})]})]})})}function Lf({state:e,onClose:t,busy:n}){let r=(0,T.useRef)(null),i=(0,T.useRef)(null),a=(0,T.useRef)(null),o=(0,T.useRef)(t),s=(0,T.useRef)(!!n);return o.current=t,s.current=!!n,(0,T.useEffect)(()=>{if(!e.open)return;let t=document.activeElement,n=window.requestAnimationFrame(()=>{((e.tone===`danger`?i.current:r.current)??a.current)?.focus()}),c=e=>{if(e.key===`Escape`&&!s.current){e.preventDefault(),o.current();return}if(e.key!==`Tab`||!a.current)return;let t=[...a.current.querySelectorAll(`button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [href], [tabindex]:not([tabindex="-1"])`)].filter(e=>e.offsetParent!==null);if(!t.length){e.preventDefault(),a.current.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,c),()=>{window.cancelAnimationFrame(n),document.removeEventListener(`keydown`,c),t?.isConnected&&t.focus()}},[e.open,e.tone]),(0,U.jsx)(W,{children:e.open&&(0,U.jsxs)(Jd.div,{className:`modal-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,U.jsx)(Jd.button,{className:`modal-backdrop`,"aria-label":Z(`Close dialog`,`بستن گفت‌وگو`),onClick:t,disabled:n}),(0,U.jsxs)(Jd.div,{ref:a,className:`modal modal--${e.tone??`normal`}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`active-dialog-title`,tabIndex:-1,initial:{opacity:0,scale:.985,y:8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.99,y:5},transition:{duration:.2,ease:[.22,1,.36,1]},children:[(0,U.jsx)(`button`,{className:`modal__close`,"aria-label":Z(`Close`,`بستن`),onClick:t,disabled:n,children:(0,U.jsx)(ut,{size:18})}),(0,U.jsx)(`div`,{className:`modal__signal`,"aria-hidden":`true`,children:e.tone===`danger`?(0,U.jsx)(nt,{size:25}):(0,U.jsx)(_e,{size:25})}),(0,U.jsx)(`h2`,{id:`active-dialog-title`,children:e.title}),(0,U.jsx)(`p`,{children:e.body}),(0,U.jsxs)(`div`,{className:`modal__actions`,children:[(0,U.jsx)(vf,{ref:i,tone:`ghost`,onClick:t,disabled:n,children:Z(`Cancel`,`انصراف`)}),(0,U.jsx)(vf,{ref:r,tone:e.tone===`danger`?`danger`:`primary`,busy:n,onClick:()=>e.action?.(),children:e.confirmLabel})]})]})]})})}function Rf({messages:e,dismiss:t}){return(0,U.jsx)(`div`,{className:`toast-stack`,"aria-live":`polite`,"aria-atomic":`false`,children:(0,U.jsx)(W,{initial:!1,children:e.map(e=>(0,U.jsxs)(Jd.article,{className:`toast toast--${e.tone}`,initial:{opacity:0,x:18},animate:{opacity:1,x:0},exit:{opacity:0,x:12},transition:{duration:.32,ease:[.22,1,.36,1]},children:[(0,U.jsx)(`span`,{className:`toast__rail`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`toast__body`,children:[(0,U.jsx)(`strong`,{children:e.title}),e.detail&&(0,U.jsx)(`p`,{children:e.detail}),e.updateOperationID&&(0,U.jsxs)(`div`,{className:`toast__progress${e.progressKnown?``:` is-indeterminate`}`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:Z(`Transfer`,`انتقال`)}),(0,U.jsx)(`bdi`,{title:e.bytesTotal?`${e.bytesDone??0} / ${e.bytesTotal} bytes`:void 0,children:e.progressLabel})]}),(0,U.jsx)(`div`,{className:`update-progress${e.progressKnown?``:` is-indeterminate`}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.progressKnown?e.progressPercent:void 0,"aria-valuetext":e.progressLabel,children:(0,U.jsx)(`i`,{style:e.progressKnown?{width:`${e.progressPercent??0}%`}:void 0})})]}),e.correlation&&(0,U.jsxs)(`code`,{className:`toast__correlation`,children:[(0,U.jsx)(`span`,{children:Z(`Reference`,`شناسه`)}),(0,U.jsxs)(`bdi`,{children:[`#`,e.correlation]})]}),e.action&&(0,U.jsxs)(`div`,{className:`toast__action-context`,children:[(0,U.jsx)(`span`,{children:e.actionLabel||Z(`Suggested action`,`عملیات پیشنهادی`)}),(0,U.jsx)(`code`,{dir:`ltr`,children:e.action})]})]}),(0,U.jsx)(`button`,{className:`toast__dismiss`,"aria-label":Z(`Dismiss`,`بستن اعلان`),onClick:()=>t(e.id),children:(0,U.jsx)(ut,{size:16})})]},e.id))})})}var zf=/[\u0000-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,Bf=/\s+/g;function Vf(e,t=``){return{normalized:e,error:t,valid:!t}}function Q(e){return e.normalize(`NFKC`).replace(zf,``).replace(Bf,` `).slice(0,64)}function Hf(e){let t=Q(e),n=t.trim();return n?n.length>64?Vf(t,`Application title must be 64 characters or fewer.`):/[\p{L}\p{N}]/u.test(n)?Vf(n):Vf(t,`Application title must include a letter or number.`):Vf(t,`Application title is required.`)}function Uf(e){let t=e.normalize(`NFKC`).replace(zf,``).replace(Bf,` `);return Array.from(t).slice(0,64).join(``)}function Wf(e){let t=Uf(e).trim();return Array.from(t).length>64?Vf(t,`Peripheral name must be 64 characters or fewer.`):Vf(t)}function Gf(e){return e.normalize(`NFKC`).replace(zf,``).replace(Bf,``).slice(0,4096)}function Kf(e){return e.normalize(`NFKC`).replace(/[\s,]+/g,` `).replace(zf,``).trimStart().toLowerCase()}function qf(e){let t=Kf(e).trim().split(` `).filter(Boolean),n=t.join(` `),r=t.some(e=>!/^[\x21-\x7e]+$/.test(e)),i=new Set(t).size!==t.length,a=``;return t.length>14?a=`Use no more than 14 page keys or IDs.`:r?a=`Page keys or IDs must use printable ASCII characters.`:i&&(a=`Page keys or IDs must be unique.`),{normalized:n,pages:t,error:a,valid:!a}}function Jf(e){return e.normalize(`NFKC`).replace(/[\t\r\n\f\v]+/g,` `).replace(zf,``)}function Yf(e,t){let n=Jf(e),r=new TextEncoder().encode(n).length,i=Math.max(0,40-t),a=``;return/^[\x20-\x7e]*$/.test(n)?r<5?a=`Text must contain at least 5 printable ASCII bytes.`:r+t>40&&(a=`Text and repeat gap must fit within 40 bytes.`):a=`Text must use printable ASCII characters.`,{normalized:n,byteLength:r,availableBytes:i,error:a,valid:!a}}function Xf(e,t){let n=qf(e.pages.join(` `)).pages,r=qf(t.pages.join(` `)).pages;return e.enabled===t.enabled&&e.speed_ms===t.speed_ms&&e.gap_cells===t.gap_cells&&Jf(e.door_open_text)===Jf(t.door_open_text)&&Jf(e.door_closed_text)===Jf(t.door_closed_text)&&n.length===r.length&&n.every((e,t)=>e===r[t])}function Zf(e){return e.normalize(`NFKC`).replace(zf,``).replace(Bf,``).replace(/\\/g,`/`).replace(/^([a-z][a-z\d+.-]*):\/(?!\/)/i,`$1://`).slice(0,2048)}function Qf(e,t){let n=Zf(e);if(!n)return t?{normalized:n,error:`A root URL is required while this integration is enabled.`}:{normalized:n};let r=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`http://${n}`,i;try{i=new URL(r)}catch{return{normalized:n,error:`Enter a valid HTTP or HTTPS root URL.`}}return i.protocol!==`http:`&&i.protocol!==`https:`?{normalized:n,error:`Only HTTP and HTTPS are supported.`}:i.username||i.password?{normalized:n,error:`Credentials are not allowed in the URL.`}:i.search||i.hash?{normalized:n,error:`Query strings and fragments are not allowed.`}:i.pathname!==`/`&&i.pathname!==``?{normalized:n,error:`Use the service root without a path.`}:(i.pathname=`/`,{normalized:i.toString().replace(/\/$/,``),url:i})}function $f(e){let t=e.split(`.`).map(Number);return t.length!==4||t.some(e=>!Number.isInteger(e)||e<0||e>255)?!1:t[0]===10||t[0]===127||t[0]===169&&t[1]===254||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&t[1]===168}function ep(e){return!e||e.length>253?!1:e.split(`.`).every(e=>e.length>=1&&e.length<=63&&!e.startsWith(`-`)&&!e.endsWith(`-`)&&/^[a-z\d-]+$/i.test(e))}function $(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return t.includes(`:`)?t===`::1`||/^(?:fc|fd)[0-9a-f]{2}:/i.test(t)||/^fe[89ab][0-9a-f]:/i.test(t):$f(t)?!0:ep(t)?t===`localhost`||!t.includes(`.`)||[`.local`,`.lan`,`.home.arpa`,`.localdomain`].some(e=>t.endsWith(e)&&t.length>e.length):!1}function tp(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``),n=t.split(`.`).map(Number),r=n.length===4&&n[0]===127&&n.every(e=>Number.isInteger(e)&&e>=0&&e<=255);return t===`localhost`||t===`::1`||r}function np(e,t){let n=Qf(e,t);return n.error||!n.url?Vf(n.normalized,n.error??``):$(n.url.hostname)?Vf(n.normalized):Vf(n.normalized,`Use a private, loopback, link-local, or local-DNS host.`)}function rp(e,t){let n=Qf(e,t);return n.error||!n.url?Vf(n.normalized,n.error??``):tp(n.url.hostname)?Vf(n.normalized):Vf(n.normalized,`The data service must use localhost or a loopback address.`)}function ip(e,t){return e.local_device.enabled===t.local_device.enabled&&Zf(e.local_device.base_url??``)===Zf(t.local_device.base_url??``)&&e.data_hub.enabled===t.data_hub.enabled&&Zf(e.data_hub.base_url??``)===Zf(t.data_hub.base_url??``)&&e.lifecycle_safety.session_lock===t.lifecycle_safety.session_lock&&e.lifecycle_safety.suspend===t.lifecycle_safety.suspend&&e.lifecycle_safety.refresh_on_resume===t.lifecycle_safety.refresh_on_resume}var ap=`controller`,op=`pccontroller.controller-origin`;function sp(){let e=``,t=``,n=null;try{e=globalThis.location?.href??``,t=globalThis.location?.origin??``}catch{}try{n=globalThis.localStorage}catch{}return{href:e,origin:t,localStorage:n,generatedConfig:globalThis.PCControllerWebConfig}}function cp(e){let t=Zf(e);if(!t)return null;let n=/^[a-z][a-z\d+.-]*:\/\//i.test(t)?t:`http://${t}`,r;try{r=new URL(n)}catch{return null}return![`http:`,`https:`,`ws:`,`wss:`].includes(r.protocol)||r.username||r.password||r.search||r.hash||r.pathname!==``&&r.pathname!==`/`?null:(r.pathname=``,r)}function lp(e){let t=cp(e);return t?t.origin.toLowerCase():``}function up(e){let t=new Set;for(let n of e?.trusted_controller_origins??[]){if(typeof n!=`string`)continue;let e=cp(n);!e||e.protocol!==`https:`&&e.protocol!==`wss:`||t.add(e.origin.toLowerCase())}return t}function dp(e,t=new Set){let n=cp(e);if(!n)return{valid:!1,normalized:``,error:`Use an HTTP(S) or WS(S) service root without credentials, a path, query, or fragment.`};let r=$(n.hostname),i=(n.protocol===`https:`||n.protocol===`wss:`)&&t.has(n.origin.toLowerCase());return!r&&!i?{valid:!1,normalized:n.origin,error:`Use a local/private target or an explicitly trusted HTTPS/WSS origin.`}:{valid:!0,normalized:n.origin,error:``}}function fp(e,t){let n=new URL(t),r=n.protocol===`https:`||n.protocol===`wss:`;n.protocol=r?`https:`:`http:`;let i=n.origin;return n.protocol=r?`wss:`:`ws:`,{source:e,controllerOrigin:t,httpOrigin:i,websocketOrigin:n.origin,external:!0}}function pp(e){let t=lp(e);if(!t)return{source:`same-origin`,controllerOrigin:``,httpOrigin:``,websocketOrigin:``,external:!1};let n=new URL(t);return n.protocol=n.protocol===`https:`?`wss:`:`ws:`,{source:`same-origin`,controllerOrigin:t,httpOrigin:t,websocketOrigin:n.origin,external:!1}}function mp(e=sp()){let t=e.generatedConfig,n=up(t),r=typeof t?.controller_origin==`string`?t.controller_origin.trim():``;if(r){let e=dp(r,n);if(!e.valid)throw TypeError(`Invalid generated controller origin: ${e.error}`);return fp(`generated-config`,e.normalized)}let i=null;if(e.href)try{i=new URL(e.href).searchParams.get(ap)}catch{}if(i!==null){let t=dp(i,n);if(!t.valid)throw TypeError(`Invalid controller query target: ${t.error}`);try{e.localStorage?.setItem(op,t.normalized)}catch{}return fp(`query`,t.normalized)}let a=``;try{a=e.localStorage?.getItem(`pccontroller.controller-origin`)?.trim()??``}catch{}if(a){let t=dp(a,n);if(t.valid)return fp(`local-setting`,t.normalized);try{e.localStorage?.removeItem(op)}catch{}}return pp(e.origin??``)}function hp(e){let t=e.trim();if(!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`\\`)||/[\u0000-\u001f\u007f]/.test(t))throw TypeError(`controller transport path must be an absolute local path`);return t}function gp(e){let t=hp(e),n=mp();return n.external?new URL(t,`${n.httpOrigin}/`).toString():t}function _p(e){let t=hp(e),n=mp();if(n.websocketOrigin)return new URL(t,`${n.websocketOrigin}/`).toString();let r=globalThis.location?.protocol===`https:`?`wss:`:`ws:`;return new URL(t,`${r}//${globalThis.location?.host??``}`).toString()}function vp(){return mp().httpOrigin||void 0}var yp=`pccontroller.session-token`,bp=`pccontroller.ticket.`,xp=1,Sp=null,Cp=0,wp=new Map,Tp=class extends Error{code;constructor(e,t){super(t),this.name=`ControllerRPCError`,this.code=e}};function Ep(){return sessionStorage.getItem(yp)??``}function Dp(e){let t=e.trim();t?sessionStorage.setItem(yp,t):sessionStorage.removeItem(yp)}function Op(e=!1){let t={};e&&(t[`Content-Type`]=`application/json`);let n=Ep();return n&&(t.Authorization=`Bearer ${n}`),t}function kp(e,t,n){if(typeof e==`object`&&e&&`error`in e){let t=e.error;return typeof t==`object`&&t&&`message`in t?String(t.message):String(t)}return typeof e==`string`?e:t||`HTTP ${n}`}async function Ap(e){let t=await e.text(),n=null;if(t)try{n=JSON.parse(t)}catch{n=t}return n}async function jp(e){let t=await Ap(e);if(!e.ok){let n=kp(t,e.statusText,e.status);throw Error(n||`HTTP ${e.status}`)}return t}function Mp(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Controller returned an invalid JSON-RPC response`);let n=e;if(n.jsonrpc!==`2.0`||n.id!==t)throw Error(`Controller returned a mismatched JSON-RPC response`);let r=Object.prototype.hasOwnProperty.call(n,`result`),i=Object.prototype.hasOwnProperty.call(n,`error`);if(r===i)throw Error(`Controller returned an invalid JSON-RPC response`);if(i){let e=n.error;if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Controller returned an invalid JSON-RPC error`);let t=e;if(!Number.isInteger(t.code)||typeof t.message!=`string`)throw Error(`Controller returned an invalid JSON-RPC error`);return{error:new Tp(t.code,t.message)}}return{result:n.result}}async function Np(e){let t=await jp(await fetch(gp(`/api/ui-config`),{signal:e,cache:`no-store`}));if(typeof t?.setup_complete!=`boolean`)throw Error(`UI configuration is missing required setup_complete state`);if(!t.appearance||typeof t.appearance!=`object`||typeof t.appearance_etag!=`string`||!/^[a-f0-9]{64}$/.test(t.appearance_etag))throw Error(`UI configuration is missing host-authoritative appearance state`);if(typeof t.session_ticket_path!=`string`||t.session_ticket_path.startsWith(`//`)||!/^\/[A-Za-z0-9._~!$&'()*+,;=:@%/-]+$/.test(t.session_ticket_path))throw Error(`UI configuration is missing a safe session-ticket path`);if(!Number.isSafeInteger(t.status_interval_ms)||t.status_interval_ms<50||t.status_interval_ms>6e4||!Number.isSafeInteger(t.measurement_freshness_ms)||t.measurement_freshness_ms12e4)throw Error(`UI configuration is missing valid live-measurement timing`);return t}async function Pp(e){return jp(await fetch(gp(`/api/snapshot`),{headers:Op(),signal:e,cache:`no-store`}))}async function Fp(e,t){let n=await fetch(gp(`/api/rpc`),{method:`POST`,headers:Op(!0),body:JSON.stringify(e),signal:t}),r=await Ap(n),i=Mp(r,e.id);if(i.error)throw i.error;if(!n.ok){let e=kp(r,n.statusText,n.status);throw Error(e||`HTTP ${n.status}`)}return i.result}function Ip(e,t){for(let[n,r]of wp)r.socket===e&&(wp.delete(n),r.cleanup(),r.reject(Error(t)))}function Lp(e,t,n){return n?.aborted?Promise.reject(n.reason instanceof Error?n.reason:new DOMException(`Aborted`,`AbortError`)):new Promise((r,i)=>{let a=()=>{wp.delete(t.id),i(n?.reason instanceof Error?n.reason:new DOMException(`Aborted`,`AbortError`))},o=()=>n?.removeEventListener(`abort`,a);wp.set(t.id,{socket:e,resolve:e=>r(e),reject:i,cleanup:o}),n?.addEventListener(`abort`,a,{once:!0});try{e.send(JSON.stringify(t))}catch(e){wp.delete(t.id),o(),i(e instanceof Error?e:Error(String(e)))}})}function Rp(e,t={},n){let r={jsonrpc:`2.0`,id:xp++,method:e,params:t},i=Sp;return i&&i.readyState===WebSocket.OPEN?Lp(i,r,n):Fp(r,n)}function zp(e,t){return Rp(`controller.command.execute`,{command:e},t)}async function Bp(e,t){if(Ep(),!e.auth_required)return[];let n=await jp(await fetch(gp(e.session_ticket_path),{method:`POST`,headers:Op(!0),body:JSON.stringify({transport:`websocket`}),signal:t,cache:`no-store`}));if(!/^[a-f0-9]{64}$/.test(n.ticket)||n.protocol!==`pccontroller`||!Number.isFinite(n.expires_in_ms)||n.expires_in_ms<=0||n.expires_in_ms>15e3||Number.isNaN(Date.parse(n.expires_at))||typeof n.principal!=`string`||!n.principal.trim())throw Error(`Controller returned an invalid WebSocket session ticket`);return[n.protocol,`${bp}${n.ticket}`]}function Vp(e,t=Math.random){let n=500*2**Math.min(Math.max(0,e),5);return Math.min(12e3,n+Math.floor(Math.max(0,Math.min(.999,t()))*250))}function Hp(e,t){let n=null,r=!1,i=0,a=0,o=0,s=null,c=e.status_interval_ms,l=(e,t=!1)=>{let n=xp++;return e.send(JSON.stringify({jsonrpc:`2.0`,id:n,method:`controller.subscribe`,params:t?{topics:[`status`],interval_ms:c,preserve:!0}:{topics:[`events`,`state`,`status`],interval_ms:c,after_id:0}})),n},u=(e,n)=>{if(r)return;i+=1;let o=Vp(i);t.state(`waiting`,e||`retrying in ${Math.ceil(o/1e3)}s`,n),window.clearTimeout(a),a=window.setTimeout(()=>{d()},o)},d=async()=>{if(r)return;let a=++o,c=++Cp;t.state(`connecting`,void 0,{generation:c}),s?.abort();let d=new AbortController;s=d;let f;try{f=await Bp(e,d.signal)}catch(e){if(r||a!==o||d.signal.aborted)return;u(e instanceof Error?e.message:String(e),{generation:c});return}finally{s===d&&(s=null)}if(r||a!==o)return;let p;try{let t=_p(e.websocket_path);p=f.length>0?new WebSocket(t,f):new WebSocket(t)}catch(e){if(r||a!==o)return;u(e instanceof Error?e.message:String(e),{generation:c});return}n=p;let m=()=>!r&&a===o&&n===p,h=0,g=``,_=!1,v=[],y=null,b=()=>({generation:c,...g?{instanceID:g}:{}}),x=e=>{m()&&t.event(e,b())},S=e=>{m()&&t.snapshot?.(e,b())};p.addEventListener(`open`,()=>{m()&&(i=0,Sp=p,h=l(p))}),p.addEventListener(`message`,e=>{if(m())try{let n=JSON.parse(String(e.data));if(typeof n.id==`number`){let e=wp.get(n.id);if(e&&e.socket===p){wp.delete(n.id),e.cleanup();try{let t=Mp(n,n.id);t.error?e.reject(t.error):e.resolve(t.result)}catch(t){e.reject(t instanceof Error?t:Error(String(t)))}}if(!m())return;if(n.id===h){if(n.error){p.close();return}let e=n.result;if(e?.subscribed!==!0){p.close();return}g=e.instance_id?.trim()??``,_=!0,t.state(`open`,void 0,b());for(let e of v.splice(0))x(e);y&&=(S(y),null)}}if(n.method===`controller.status`&&t.status(n.params,b()),n.method===`controller.event`&&x(n.params),n.method===`controller.state`){let e=n.params;_?x(e):v.push(e)}if(n.method===`controller.snapshot`){let e=n.params;_?S(e):y=e}if(n.method===`controller.error`){let e=n.params?.error;t.state(_?`open`:`connecting`,e,b())}}catch{}}),p.addEventListener(`close`,e=>{m()&&(n===p&&(n=null),Sp===p&&(Sp=null),Ip(p,e.reason||`WebSocket RPC connection closed`),r?t.state(`closed`,void 0,b()):u(e.reason||`WebSocket connection closed`,b()))}),p.addEventListener(`error`,()=>{m()&&p.close()})};d();let f=(()=>{r=!0,o+=1,s?.abort(),window.clearTimeout(a);let e=n;n?.close(1e3,`view closed`),e&&(Sp===e&&(Sp=null),Ip(e,`WebSocket RPC view closed`)),n=null});return f.updateStatusInterval=e=>{if(!Number.isSafeInteger(e)||e<50||e>6e4)throw RangeError(`status interval must be 50..60000 ms`);if(c===e)return;c=e;let t=n;t&&t.readyState===WebSocket.OPEN&&l(t,!0)},f}async function Up(e,t,n={}){let r=t.startsWith(`/`)?t.slice(1):t;return jp(await fetch(gp(`/api/integrations/${e}/${r}`),{...n,headers:{...Op(!!n.body),...n.headers??{}}}))}function Wp(e,t){let n=e.headers.get(`Content-Disposition`)??``,r=n.match(/filename\*=UTF-8''([^;]+)/i)?.[1],i=n.match(/filename="([^"]+)"/i)?.[1],a=``;if(r)try{a=decodeURIComponent(r)}catch{a=``}let o=a||i||t.split(`/`).filter(Boolean).at(-1)||`controller-data.bin`;return o=o.replace(/[\\/:*?"<>|\u0000-\u001f\u007f]/g,`_`).trim().slice(0,180),o||`controller-data.bin`}async function Gp(e,t,n){let r=t.startsWith(`/`)?t.slice(1):t,i=gp(`/api/integrations/${e}/${r}`),a=await fetch(i,{headers:Op(),signal:n});a.ok||await jp(a);let o=await a.blob(),s=URL.createObjectURL(o),c=document.createElement(`a`);c.href=s,c.download=Wp(a,r),c.rel=`noopener`,document.body.append(c),c.click(),c.remove(),URL.revokeObjectURL(s)}var Kp=[`dashboard`,`controls`,`workbench`,`device`,`data`,`updates`,`events`,`settings`],qp=[`input`,`textarea`,`select`,`[contenteditable]:not([contenteditable="false"])`,`[role="textbox"]`,`[role="combobox"]`].join(`,`);function Jp(e){if(!e)return!1;let t=e;return t.isContentEditable?!0:typeof t.closest==`function`&&!!t.closest(qp)}function Yp(e){return e.defaultPrevented||e.isComposing||e.keyCode===229||Jp(e.target)}function Xp(e){let t=(e??``).trim().toLowerCase().replace(/[\s_]+/g,`-`);return t?{0:`controls`,1:`dashboard`,2:`controls`,3:`controls`,4:`controls`,5:`settings`,6:`controls`,7:`controls`,8:`controls`,9:`events`,app:`settings`,automate:`workbench`,automation:`workbench`,automations:`workbench`,board:`workbench`,catalog:`data`,console:`workbench`,control:`controls`,controls:`controls`,dashboard:`dashboard`,event:`events`,events:`events`,data:`data`,"data-hub":`data`,datahub:`data`,device:`device`,devices:`device`,export:`data`,firmware:`updates`,flash:`updates`,history:`events`,home:`dashboard`,"local-device":`device`,live:`dashboard`,i2c:`workbench`,macros:`workbench`,menus:`workbench`,output:`controls`,outputs:`controls`,records:`data`,recovery:`updates`,program:`updates`,programming:`updates`,peripherals:`workbench`,rf:`workbench`,settings:`settings`,timeline:`events`,terminal:`workbench`,workbench:`workbench`,update:`updates`,updates:`updates`}[t]??null:null}function Zp(e,t=Date.now(),n=1e4){let r=Date.parse(e??``);return Number.isFinite(r)&&r<=t+1e3&&t-r<=n}function Qp(e){if(!e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.repeat)return null;let t=Number(e.key)-1;return Number.isInteger(t)&&t>=0&&trm[e][t]??rm.en[t]}function am(e,t,n=1){return new Intl.NumberFormat(e===`fa`?`fa-IR`:`en-US`,{minimumFractionDigits:n,maximumFractionDigits:n}).format(Number.isFinite(t)?t:0)}function om(e,t){return new Intl.NumberFormat(e===`fa`?`fa-IR`:`en-US`,{notation:`compact`,maximumFractionDigits:1}).format(t)}function sm(e,t){return(e===`fa`?tm:nm).format(t)}function cm(e,t){if(!Number.isFinite(t)||t<0)return`—`;let n=Math.floor(t/1e3),r=Math.floor(n/86400),i=Math.floor(n%86400/3600),a=Math.floor(n%3600/60),o=n%60,s=(r>0?[`${r}d`,`${i}h`,`${a}m`,`${o}s`]:i>0?[`${i}h`,`${a}m`,`${o}s`]:a>0?[`${a}m`,`${o}s`]:[`${o}s`]).join(` `);return e===`fa`?s.replace(/\d+/g,t=>sm(e,Number(t))).replace(`d`,`ر`).replace(`h`,`س`).replace(`m`,`د`).replace(`s`,`ث`):s}function lm(e,t,n,r=Date.now()){if(t===void 0)return e===`fa`?`در انتظار دستگاه`:`Waiting for device`;let i=t instanceof Date?t.getTime():typeof t==`number`?t:Date.parse(t);if(!Number.isFinite(i))return e===`fa`?`در انتظار دستگاه`:`Waiting for device`;let a=Math.max(0,r-i);if(a0&&!/[\s'"\\]/.test(e)?e:`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function fm(e){let t=e.match(/^(\s*os\s+power\s+\S+)(\s+[\s\S]+)$/i);return t?`${t[1].trim()} [REDACTED]`:e}function pm(e,t,n,r,i,a,o=e.output_persistence,s=e.relay_restore_mask){let c=e.extended_flags&1?1:0,l=e=>e===0?2:e-1,u=e.extended_flags>>1&7,d=l(e.extended_flags>>4&3),f=l(e.extended_flags>>6&3);return[`settings`,`set`,e.flags,e.light_mode,e.on_brightness,e.off_brightness,t,n,r,o,i,e.default_page,c,u,d,f,a,s].join(` `)}function mm(e){return e.reset_lines_available===!0}function hm(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function gm(e,t){let n=Math.max(0,t)/1e3;return new Intl.NumberFormat(e===`fa`?`fa-IR`:`en`,{maximumFractionDigits:+(n<10)}).format(n)+(e===`fa`?` ثانیه`:`s`)}function _m(e){return e.connection_phase?e.connection_phase:e.connected?`connected`:e.paused?`paused`:e.connection_state===`reconnecting`||e.connection_state===`connecting`?`queued`:`disconnected`}function vm(e,t,n=Date.now()){let r=(e,n)=>t===`fa`?n:e,i=_m(e),a=e.connection_candidate,o=a?.friendly_name||a?.product||a?.name||e.port.friendly_name||e.port.product||e.port.name||``,s=e.connection_attempt??0,c=s>0?r(`Attempt ${s}`,`تلاش ${new Intl.NumberFormat(`fa-IR`).format(s)}`):``,l=hm(e.connection_attempt_started),u=hm(e.connection_next_retry),d=e.connection_reason?.trim()||``;return i===`connected`?{phase:i,title:r(`Board connected`,`برد متصل است`),detail:o,candidate:o,timing:``,attempt:``,action:r(`Reconnect`,`اتصال دوباره`),retryDisabled:!1,tone:`good`,animated:!1}:i===`attempting`?{phase:i,title:r(`Contacting controller board`,`در حال تماس با برد کنترلر`),detail:o?r(`Authenticating the application protocol on ${o}.`,`در حال احراز پروتکل برنامه روی ${o}.`):r(`Discovering a compatible controller and authenticating its application protocol.`,`در حال یافتن کنترلر سازگار و احراز پروتکل برنامهٔ آن.`),candidate:o,timing:l===void 0?``:r(`Elapsed ${gm(t,n-l)}`,`گذشته ${gm(t,n-l)}`),attempt:c,action:r(`Attempt in progress`,`تلاش در حال انجام است`),retryDisabled:!0,tone:`info`,animated:!0}:i===`waiting_retry`?{phase:i,title:r(`Board did not answer`,`برد پاسخ نداد`),detail:d||r(`The serial device is present, but the application handshake did not complete.`,`دستگاه سریال حاضر است، اما دست‌دهی برنامه کامل نشد.`),candidate:o,timing:u===void 0?``:u>n?r(`Next automatic attempt in ${gm(t,u-n)}`,`تلاش خودکار بعدی تا ${gm(t,u-n)}`):r(`Next automatic attempt is due now`,`زمان تلاش خودکار بعدی رسیده است`),attempt:c,action:r(`Try now`,`اکنون تلاش کن`),retryDisabled:!1,tone:`warn`,animated:!1}:i===`queued`?{phase:i,title:r(`Reconnect queued`,`اتصال دوباره در صف است`),detail:d||r(`The host is preparing a bounded connection attempt.`,`میزبان در حال آماده‌سازی یک تلاش اتصال محدود است.`),candidate:o,timing:``,attempt:c,action:r(`Try now`,`اکنون تلاش کن`),retryDisabled:!1,tone:`info`,animated:!1}:i===`paused`?{phase:i,title:r(`Board connection is closed`,`اتصال برد بسته است`),detail:d||r(`Automatic reconnect is paused by the operator.`,`اتصال خودکار توسط کاربر متوقف شده است.`),candidate:o,timing:``,attempt:``,action:r(`Resume connection`,`ازسرگیری اتصال`),retryDisabled:!1,tone:`neutral`,animated:!1}:i===`blocked`?{phase:i,title:r(`Serial cleanup needs attention`,`پاک‌سازی درگاه سریال نیاز به بررسی دارد`),detail:d||r(`The previous serial handle could not be released safely.`,`درگاه سریال قبلی با اطمینان آزاد نشد.`),candidate:o,timing:``,attempt:c,action:r(`Retry cleanup`,`تلاش دوباره برای پاک‌سازی`),retryDisabled:!1,tone:`bad`,animated:!1}:{phase:i,title:r(`Controller board disconnected`,`برد کنترلر قطع است`),detail:d||r(`No authenticated controller application is connected.`,`هیچ برنامهٔ کنترلر احرازشده‌ای متصل نیست.`),candidate:o,timing:``,attempt:c,action:r(`Connect`,`اتصال`),retryDisabled:!1,tone:`bad`,animated:!1}}function ym(e,t){return e?.trim()||t.trim()}function bm(e,t){let n=e.trim().split(/\s+/).filter(Boolean);return n.length>1?n.slice(0,2).map(e=>e[0]).join(``).toUpperCase():Array.from(n[0]||t).slice(0,2).join(``).toUpperCase()}var xm={connected:{color:`#43a86f`,label:`Board connected`},connecting:{color:`#d19345`,label:`Controller reconnecting`},fault:{color:`#d96369`,label:`Controller alert`},offline:{color:`#77717f`,label:`Board offline`}};function Sm(e){let t=e.connection_state.trim().toLowerCase(),n=(e.connection_reason??``).trim().toLowerCase();return(e.hardware_problems?.length??0)>0||e.have_status&&e.status.hot||/^(error|fault|failed|rejected)$/.test(t)||/authentication|permission|protocol mismatch|unsupported firmware/.test(n)?`fault`:e.connected?`connected`:t===`connecting`||t===`reconnecting`?`connecting`:`offline`}function Cm(e){let t=xm[e],n=`${t.label}`;return`data:image/svg+xml,${encodeURIComponent(n)}`}function wm(e,t=document){let n=t.querySelector(`link[data-controller-state-icon]`);n||(n=t.createElement(`link`),n.rel=`icon`,n.type=`image/svg+xml`,n.sizes=`any`,n.dataset.controllerStateIcon=``,t.head.append(n)),n.dataset.state!==e&&(n.dataset.state=e,n.href=Cm(e))}var Tm=new Set([`telemetry`,`rx`,`tx`,`front_panel.segment`,`status_led.changed`,`buzzer.note`]);function Em(e){return e.stream?e.stream===`activity`:!Tm.has(e.kind.trim().toLowerCase())}function Dm(e){return e.filter(Em)}function Om(e,t,n=500){let r=Dm(e);return Em(t)?[t,...r.filter(e=>e.id!==t.id)].slice(0,n):r.slice(0,n)}function km(e,t=``){let n=e.kind.trim().toLowerCase(),r=e.source?.trim().toLowerCase()??``,i=e.metadata?.source?.trim().toLowerCase()??``,a=r&&r!==`board`?r:i||r,o=e.text?.trim().toLowerCase()??``;if(/^(hello|status|telemetry|rx|tx)(?:[._-]|$)/.test(n)||/^(hello|status)\b/.test(o))return!1;if(/^peer-update\.(queued|artifact-verified|reconnecting|health-checking|completed|failed|outcome-uncertain)$/.test(n)||n===`hardware.problem`)return!0;if(n===`message`){let n=t.trim().toLowerCase();return(e.targets?.map(e=>e.trim().toLowerCase())??[]).some(e=>e===`all`||e===`*`||e===`webui`||e===`surface:webui`||e===`capability:messages`||!!(n&&e===n))}return/(^|[._-])(relay|output)([._-]|$)/.test(n)?a===`physical`||a===`rf`:/error|warning|fault|hot|door/.test(n)}function Am(e){return typeof e==`string`?e.trim():``}function jm(){let e=typeof document>`u`?null:document.querySelector(`script[type="module"][src*="/assets/app-"]`),t=``;if(e?.src)try{t=new URL(e.src,document.baseURI).pathname}catch{}return{hostVersion:`0.0.0-development`,resourcePath:t}}function Mm(e){return`${Am(e.host_version)}|${Am(e.web_resource_path)}`}function Nm(e,t=jm()){let n=Am(e.host_version),r=Am(e.web_resource_path),i=Am(t.hostVersion),a=Am(t.resourcePath);return!n||!r||!i||!a?!1:n!==i||r!==a}function Pm(e,t,n={}){let r=n.signal?.aborted===!0,i=!1,a=0,o=null,s,c=()=>{a+=1,s!==void 0&&clearTimeout(s),s=void 0,o&&=(clearTimeout(o.timeout),o.abort.abort(),null)},l=e=>!r&&i&&a===e,u=(r,i)=>{if(!l(r))return;let a=new AbortController,c={abort:a,timeout:setTimeout(()=>a.abort(Error(`Host resource identity check timed out`)),5e3)};o=c,e(a.signal).then(e=>{l(r)&&!a.signal.aborted&&t(e)}).catch(e=>{l(r)&&(i===0?s=setTimeout(()=>{s=void 0,u(r,1)},250):n.onError?.(e))}).finally(()=>{clearTimeout(c.timeout),o===c&&(o=null)})},d=()=>{r=!0,i=!1,c(),n.signal?.removeEventListener(`abort`,d)};return n.signal?.addEventListener(`abort`,d,{once:!0}),{state(e){r||(e===`open`?i||(i=!0,c(),u(a,0)):(i=!1,c()))},dispose:d}}var Fm=[`background:#7656d6`,`border-radius:7px`,`color:#fff`,`font:600 12px/1.8 ui-sans-serif,system-ui,sans-serif`,`padding:2px 8px`].join(`;`),Im=[`color:#9b7ce8`,`font:600 11px/1.6 ui-sans-serif,system-ui,sans-serif`].join(`;`),Lm=`color:#2f9e67;font:600 11px/1.6 ui-sans-serif,system-ui,sans-serif`,Rm=`color:#d8793f;font:600 11px/1.6 ui-sans-serif,system-ui,sans-serif`,zm=`color:inherit;font:inherit`;function Bm(e,t,n=96){let r=String(e??``).normalize(`NFKC`).replace(/[\u0000-\u001f\u007f-\u009f]/g,` `).replace(/\s+/g,` `).trim();return r?r.slice(0,n):t}function Vm(e){switch(e){case`open`:return`Host event stream connected`;case`connecting`:return`Host event stream connecting`;case`waiting`:return`Host event stream waiting to reconnect`;case`closed`:return`Host event stream closed`}}function Hm(e,t=console){let n=Bm(e.productTitle,`Controller`),r=e.demonstration?`demonstration`:Bm(e.config?.host_version,`not reported`),i=e.boardConnected?Bm(e.port,`authenticated port`):``;t.groupCollapsed(`%c%s%c · browser control center`,Fm,n,zm),t.info(`%cHost%c version %s · living API`,Im,zm,r),e.boardConnected?t.info(`%cController%c connected · %s`,Lm,zm,i):t.info(`%cController%c offline · no authenticated board`,Rm,zm),t.debug(`%cTransport%c %s`,Im,zm,Vm(e.streamState)),t.groupEnd()}var Um=`pccontroller.tab-sync`,Wm=`pccontroller://local`,Gm=3e4,Km=3e5,qm=32768,Jm=8192,Ym=4096,Xm=32,Zm=512,Qm=0,$m=/(?:authorization|cookie|password|passwd|secret|session(?:[_-]?id)?|(?:access|refresh)?[_-]?token|api[_-]?key)/i,eh=[/\b(?:authorization|access[_-]?token|refresh[_-]?token|api[_-]?key|password|passwd|secret|session[_-]?id)\s*[:=]\s*\S+/i,/\b(?:bearer|basic)\s+[a-z0-9._~+/=-]{8,}/i,/\beyJ[a-z0-9_-]{8,}\.[a-z0-9_-]{8,}\.[a-z0-9_-]{8,}\b/i,/-----BEGIN [A-Z ]*PRIVATE KEY-----/i],th=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f\u202a-\u202e\u2066-\u2069\ufeff]/g,nh=/^[a-z0-9._:-]{1,180}$/i,rh=/^[a-z0-9._/-]{1,96}$/i;function ih(){try{let e=globalThis.location?.origin;if(e&&e!==`null`)return e}catch{}return Wm}function ah(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=Math.random().toString(36).slice(2);return`${Date.now().toString(36)}-${t}-${(++Qm).toString(36)}`}function oh(e){let t=e.trim();if(!t||t.length>256||th.test(t))throw th.lastIndex=0,TypeError(`tab channel origin is invalid`);if(th.lastIndex=0,t.toLowerCase()===Wm)return Wm;try{let e=new URL(t);if(e.username||e.password||e.origin===`null`)throw TypeError(`tab channel origin cannot contain credentials`);return e.origin.toLowerCase()}catch(e){throw e instanceof TypeError&&e.message.includes(`credentials`)?e:TypeError(`tab channel origin is invalid`)}}function sh(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function ch(e,t,n){let r=e.trim();return r.length<=n&&nh.test(r)?r:t}function lh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uh(e){return new TextEncoder().encode(e).byteLength}function dh(e){return eh.some(t=>t.test(e))}function fh(e){let t=[e],n=new Set;for(;t.length>0;){let e=t.pop();if(typeof e==`string`){if(dh(e))return!0}else if(typeof e==`object`&&e){if(n.has(e))return!0;if(n.add(e),Array.isArray(e))t.push(...e);else for(let[n,r]of Object.entries(e)){if($m.test(n))return!0;t.push(r)}}}return!1}function ph(e,t,n=!1){if(typeof e!=`string`||uh(e)>t)return null;let r=e.replace(th,``);return dh(r)||!n&&r.length===0?null:r}function mh(e,t){if(e!==void 0)return ph(e,t,!0)}function hh(e,t,n){if(e!==void 0)return typeof e!=`number`||!Number.isSafeInteger(e)||en?null:e}function gh(e){return e.state!==`active`&&e.state!==`hidden`&&e.state!==`leaving`||e.page!==void 0&&(typeof e.page!=`string`||!rh.test(e.page))?null:{type:`presence`,state:e.state,...e.page===void 0?{}:{page:e.page}}}function _h(e){if(!lh(e.appearance)||e.etag!==void 0&&(typeof e.etag!=`string`||!/^[a-f0-9]{64}$/.test(e.etag)))return null;let t=e.appearance,n={};if(t.theme!==void 0){if(t.theme!==`system`&&t.theme!==`light`&&t.theme!==`dark`)return null;n.theme=t.theme}if(t.locale!==void 0){if(t.locale!==`en`&&t.locale!==`fa`)return null;n.locale=t.locale}if(t.direction!==void 0){if(t.direction!==`auto`&&t.direction!==`ltr`&&t.direction!==`rtl`)return null;n.direction=t.direction}for(let e of[`reduceMotion`,`compactNumbers`,`audioMuted`])if(t[e]!==void 0){if(typeof t[e]!=`boolean`)return null;n[e]=t[e]}if(t.audioVolume!==void 0){if(typeof t.audioVolume!=`number`||!Number.isFinite(t.audioVolume)||t.audioVolume<0||t.audioVolume>1)return null;n.audioVolume=t.audioVolume}return Object.keys(n).length===0?null:{type:`appearance`,appearance:n,...e.etag===void 0?{}:{etag:e.etag}}}function vh(e){if(!lh(e.entry))return null;let t=e.entry;if(t.kind!==`command`&&t.kind!==`output`&&t.kind!==`error`&&t.kind!==`system`)return null;let n=ph(t.text,Jm),r=hh(t.at,0,2**53-1);return n===null||r===null?null:{type:`terminal`,entry:{kind:t.kind,text:n,...r===void 0?{}:{at:r}}}}function yh(e){if(e===void 0)return;if(!lh(e)||Object.keys(e).length>Xm)return null;let t={};for(let[n,r]of Object.entries(e)){if(!n||n.length>64||$m.test(n))return null;let e=ph(r,1024,!0);if(e===null)return null;t[n]=e}return t}function bh(e){if(!lh(e.event))return null;let t=e.event,n=hh(t.id,0,2**53-1),r=ph(t.time,80),i=ph(t.kind,128),a=ph(t.text,Ym,!0);if(n==null||r===null||i===null||a===null)return null;let o=[`state`,`lifecycle`,`reason`,`source`,`target`,`message_type`,`action`,`severity`,`correlation`,`delivery`,`gesture`],s={};for(let e of o){let n=mh(t[e],e===`reason`?1024:256);if(n===null)return null;n!==void 0&&(s[e]=n)}let c;if(t.targets!==void 0){if(!Array.isArray(t.targets)||t.targets.length>32)return null;c=[];for(let e of t.targets){let t=ph(e,180);if(t===null)return null;c.push(t)}}let l=[`key`,`rf_id`,`rf_code`,`rf_bits`,`rf_protocol`],u={};for(let e of l){let n=e===`rf_code`?4294967295:2**53-1,r=hh(t[e],0,n);if(r===null)return null;r!==void 0&&(u[e]=r)}let d=yh(t.metadata);return d===null?null:{type:`controller-event`,event:{id:n,time:r,kind:i,text:a,...s,...u,...c===void 0?{}:{targets:c},...d===void 0?{}:{metadata:d}}}}function xh(e){if(!lh(e)||!Sh(e)||fh(e)||typeof e.type!=`string`)return null;switch(e.type){case`presence`:return gh(e);case`appearance`:return _h(e);case`terminal`:return vh(e);case`controller-event`:return bh(e);default:return null}}function Sh(e){try{return uh(JSON.stringify(e))<=qm}catch{return!1}}function Ch(e={}){let t=oh(e.origin??ih()),n=e.now??Date.now,r=e.idFactory??(()=>ah()),i=e.ttlMS??Gm;if(!Number.isSafeInteger(i)||i<1||i>Km)throw RangeError(`tab channel ttlMS must be 1..${Km}`);let a=typeof globalThis.BroadcastChannel==`function`?globalThis.BroadcastChannel:null,o=e.BroadcastChannel===void 0?a:e.BroadcastChannel,s=++Qm,c=`tab:${ch(r(`tab`),`fallback-${s.toString(36)}`,64)}:${s.toString(36)}`,l=`${Um}:${sh(t)}`,u=new Set,d=new Map,f=0,p=!1,m=null,h=e=>{for(let[t,n]of d)n<=e&&d.delete(t);for(;d.size>Zm;){let e=d.keys().next().value;if(e===void 0)break;d.delete(e)}},g=e=>{if(!lh(e)||!Sh(e)||fh(e)||e.protocol!==Um||e.origin!==t||typeof e.messageId!=`string`||!nh.test(e.messageId)||typeof e.tabId!=`string`||!nh.test(e.tabId)||e.tabId===c||typeof e.sentAt!=`number`||!Number.isSafeInteger(e.sentAt)||e.sentAt<0||typeof e.expiresAt!=`number`||!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=e.sentAt||e.expiresAt-e.sentAt>Km)return null;let r=n();if(e.expiresAt<=r||e.sentAt>r+Km||(h(r),d.has(e.messageId)))return null;let i=xh(e.payload);return i===null?null:(d.set(e.messageId,e.expiresAt),{protocol:Um,origin:t,messageId:e.messageId,tabId:e.tabId,sentAt:e.sentAt,expiresAt:e.expiresAt,payload:i})},_=e=>{if(p)return;let t=g(e.data);if(t!==null)for(let e of[...u])try{e(t)}catch{}};if(o!==null)try{m=new o(l),m.addEventListener(`message`,_)}catch{m=null}let v=(e,a=i)=>{if(p||m===null||!Number.isSafeInteger(a)||a<1||a>Km)return null;let o=xh(e);if(o===null)return null;let s=n();if(!Number.isSafeInteger(s)||s<0||s>2**53-1-a)return null;f+=1;let l=ch(r(`message`),`message-${f.toString(36)}`,64),u=`${c}:${f.toString(36)}:${l}`,g={protocol:Um,origin:t,messageId:u,tabId:c,sentAt:s,expiresAt:s+a,payload:o};if(!Sh(g))return null;try{return m.postMessage(g),d.set(u,g.expiresAt),h(s),u}catch{return null}};return{channelName:l,origin:t,supported:m!==null,tabId:c,publish:v,publishPresence:(e,t)=>v({type:`presence`,state:e,...t===void 0?{}:{page:t}}),publishAppearance:(e,t)=>v({type:`appearance`,appearance:e,...t===void 0?{}:{etag:t}}),publishTerminal:e=>v({type:`terminal`,entry:e}),publishControllerEvent:e=>v({type:`controller-event`,event:e}),subscribe(e){if(p)return()=>void 0;u.add(e);let t=!0;return()=>{t&&(t=!1,u.delete(e))}},close(){p||(p=!0,u.clear(),d.clear(),m!==null&&(m.removeEventListener(`message`,_),m.close(),m=null))}}}function wh(e,t,n){let r=(e??``).trim().toLowerCase();return r===``||r===`*`||r===t.trim().toLowerCase()||r===n.trim().toLowerCase()}var Th=`default`,Eh={sync:`navigation_sync`,group:`navigation_group`,epoch:`navigation_epoch`,revision:`navigation_revision`,source:`navigation_source`,catchUp:`navigation_catch_up`,operation:`navigation_operation_id`,targetEpoch:`navigation_target_epoch`,targetRevision:`navigation_target_revision`},Dh=/^[A-Za-z0-9._-]{1,64}$/,Oh=/^[A-Za-z0-9._:-]{1,180}$/,kh=/^[a-f0-9]{32}$/;function Ah(){let e=new Uint8Array(16);return globalThis.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function jh(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function Mh(e){if(!e||!/^\d{1,20}$/.test(e))return null;let t=Number(e);return jh(t)?t:null}function Nh(e){return[`dashboard`,`controls`,`workbench`,`device`,`data`,`updates`,`events`,`settings`].includes(e)}var Ph=class{epoch;group;reportSequence=0;operationSequence=0;coordinatorEpoch=``;coordinatorRevision=0;constructor(e=Ah(),t=Th){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase()||`default`;if(!kh.test(n))throw TypeError(`navigation epoch is invalid`);if(!Dh.test(r))throw TypeError(`navigation group is invalid`);this.epoch=n,this.group=r}nextValues(e,t=!1){return this.reportSequence+=1,{[Eh.sync]:e?`follow`:`independent`,[Eh.group]:this.group,[Eh.epoch]:this.epoch,[Eh.revision]:String(this.reportSequence),...e&&t?{[Eh.catchUp]:`true`}:{}}}nextCommit(e,t){if(!Oh.test(e.trim()))throw TypeError(`navigation source is invalid`);return this.operationSequence+=1,{group:this.group,source:e.trim(),page:t,operation_id:`${this.epoch}-${this.operationSequence}`}}acceptAction(e,t){if(!e||e[Eh.sync]?.toLowerCase()!==`group`||e[Eh.group]?.toLowerCase()!==this.group||!Nh(t))return null;let n=e[Eh.epoch]?.trim().toLowerCase()??``,r=Mh(e[Eh.revision]),i=e[Eh.source]?.trim()??``;if(!kh.test(n)||r===null||!Oh.test(i))return null;let a=e[Eh.targetEpoch]?.trim().toLowerCase()??``,o=e[Eh.targetRevision];if(a||o){let e=Mh(o);if(a!==this.epoch||e===null||e=t&&e<=n}function tg(e){let{status:t}=e,n=e.hello.capabilities??0,r=e.connected&&e.have_status,i=r&&!!(n&Hh)&&!!(t.ina219_available||t.flags&Rh),a=r&&!!(n&Uh)&&!!(t.temperature_led_available||t.flags&Bh),o=r&&!!(n&Uh)&&!!(t.temperature_bt_audio_available||t.flags&Vh),s=eg(t.supply_mv,0,1e5)&&eg(t.bus_mv,0,1e5)&&eg(t.current_ma,-1e5,1e5)&&eg(t.power_mw,-1e7,1e7),c=eg(t.temperature_led_centi_c,-5500,12500),l=eg(t.temperature_bt_audio_centi_c,-5500,12500);return{ina219:i&&s,pwm:r&&!!(n&Wh)&&!!(t.pwm_available||t.flags&zh),temperatureLED:a&&c,temperatureBTAudio:o&&l,lcd:r&&!!(n&Jh)&&!!(e.front_panel?.lcd_available||e.front_panel?.lcd_address||t.lcd_address),bluetoothAudio:r&&!!(n&Qh),relays:r&&!!(n&Gh),rf:r&&!!(n&Kh),segments:r&&!!(n&qh),statusLED:r&&!!(n&Yh),settings:r&&!!(n&Xh),menus:r&&!!(n&Zh),buzzer:r&&!!(n&$h),invalidINA219:i&&!s,invalidTemperatureLED:a&&!c,invalidTemperatureBTAudio:o&&!l}}var ng={request:e=>window.requestAnimationFrame(e),cancel:e=>window.cancelAnimationFrame(e)},rg=class{deliver;clock;generation=0;pending=[];frame=null;disposed=!1;constructor(e,t=ng){this.deliver=e,this.clock=t}adoptGeneration(e){return this.disposed||!Number.isSafeInteger(e)||e<=0||e{if(this.frame=null,this.disposed||n!==this.generation||this.pending.length===0)return;let e=this.pending;this.pending=[],this.deliver(e,n)}),!0}cancelPending(e){this.disposed||e!==this.generation||(this.pending=[],this.frame!==null&&(this.clock.cancel(this.frame),this.frame=null))}dispose(){this.disposed||(this.disposed=!0,this.pending=[],this.frame!==null&&(this.clock.cancel(this.frame),this.frame=null))}};function ig(e,t=Date.now()){let n=e.status,r=tg(e);return{at:t,...r.ina219?{supply:n.supply_mv/1e3,bus:n.bus_mv/1e3,current:n.current_ma,power:n.power_mw/1e3}:{},...r.temperatureLED?{ledTemp:n.temperature_led_centi_c/100}:{},...r.temperatureBTAudio?{btTemp:n.temperature_bt_audio_centi_c/100}:{}}}function ag(e){return e.connected?JSON.stringify([e.port.instance_id||``,e.port.serial_number||``,e.port.name||``,e.hello.board_kind??null,e.hello.name||``,e.hello.build_hash??null,e.hello.build_timestamp||``,e.hello.capabilities??null]):``}function og(e,t,n,r=Date.now()){if(!n.connected||!n.have_status)return[];let i=ig(n,r);return ag(t)===ag(n)?[...e.slice(-71),i]:[i]}function sg(e,t,n){let r=e,i=t,a=``,o=0;for(let e of n){if(e.error){a=e.error;continue}a=``;let t={...r,connected:!0,have_status:!0,status:e.status,status_updated:e.time};i=og(i,r,t,new Date(e.time).getTime()),r=t,o+=1}return{snapshot:r,samples:i,detail:a,applied:o}}function cg(e,t){return e.epoch===t.epoch&&(e.instanceID?.trim()??``)===(t.instanceID?.trim()??``)}function lg(e,t){if(t.epoche.epoch?{epoch:t.epoch,...n?{instanceID:n}:{}}:n?{epoch:e.epoch,instanceID:n}:e}function ug(e,t){let n=e.host_instance_id?.trim()??``,r=t.instanceID?.trim()??``;return n===``||r===``||n===r}var dg=e=>{if(e===void 0||e.trim()===``)return null;let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255?t:null};function fg(e){if(e.kind.toLowerCase()!==`status_led.changed`)return null;let t=dg(e.metadata?.red),n=dg(e.metadata?.green),r=dg(e.metadata?.blue),i=dg(e.metadata?.brightness),a=dg(e.metadata?.effect),o=dg(e.metadata?.condition);return[t,n,r,i,a,o].some(e=>e===null)?null:{red:t,green:n,blue:r,brightness:i,effect:a,condition:o}}var pg=e=>{let t=Number(e.metadata?.revision);return Number.isSafeInteger(t)&&t>0?t:0};function mg(e=0,t=0,n=0,r=0){return e===0&&n===0?`unknown`:e===0?`newer`:n===0||ne?`newer`:t===0&&r===0?`unknown`:t===0?`newer`:r===0||r(e.status_led_epoch??0);return o===`older`||e.have_status_led&&(o===`equal`||!t.have_status_led&&!s)?{...r,host_instance_id:e.host_instance_id,status_led:e.status_led,have_status_led:!0,status_led_updated:e.status_led_updated,status_led_revision:e.status_led_revision,status_led_epoch:e.status_led_epoch}:e.have_status_led&&!t.have_status_led?{...r,status_led:e.status_led,have_status_led:!0,status_led_updated:e.status_led_updated}:r}function _g(e){if(e.kind.toLowerCase()!==`front_panel.segment`)return null;let t=e.metadata?.raw_segments?.trim(),n=dg(e.metadata?.brightness);return!t||!/^[0-9a-f]{8}$/i.test(t)||n===null?null:{raw_segments:[0,2,4,6].map(e=>Number.parseInt(t.slice(e,e+2),16)),brightness:n}}function vg(e){let t=e.kind.trim().toLowerCase();return t===`status_led.changed`||t===`front_panel.segment`}function yg(e,t,n={epoch:0}){if(fg(t))return hg(e,t,n);let r=_g(t);if(!r)return e;let i=e.front_panel??{schema:0,raw_segments:[0,0,0,0],brightness:0,blink:!1,segments_active:!1,category_selector:!1,lcd_address:0,lcd_available:!1,lcd_backlight:!1,lcd_line_1:``,lcd_line_2:``,pressed_keys:0,menu_page:0,program_mode:0,host_captured:!1,host_state:0,host_editable_value:0};return{...e,front_panel:{...i,...r,segments_active:!0},have_front_panel_segments:!0,front_panel_updated:t.time}}var bg=3e8,xg=250,Sg=8,Cg=class{anchors=new Map;plan(e,t){if(!Number.isFinite(t)||!Number.isFinite(e.frequencyHz)||e.frequencyHz<0||!Number.isFinite(e.durationMS)||e.durationMS<0||e.durationMS>6e4||e.durationMS===0&&e.frequencyHz!==0)return null;let n=t+Sg;if(e.deviceMicros!==void 0){if(!Number.isInteger(e.deviceMicros)||e.deviceMicros<0||e.deviceMicros>4294967295)return null;let r=e.deviceMicros>>>0,i=e.generation?.trim()??``,a=this.anchors.get(e.source);if(a){let e=r-a.deviceMicros>>>0,o=a.startMS+e/1e3,s=o>=t-xg&&o<=t+xg;a.generation===i&&e<=bg&&s&&(n=o)}this.anchors.set(e.source,{deviceMicros:r,startMS:n,generation:i})}let r=n+e.durationMS,i=Math.max(0,r-Math.max(n,t));return{delayMS:Math.max(0,n-t),durationMS:i,audible:e.frequencyHz>=20&&e.frequencyHz<=2e4&&i>=1,stop:e.frequencyHz===0}}};function wg(e,t){return!e&&!t?`both`:e?t?`none`:`host`:`board`}var Tg=new Set([`cancelled`,`completed`,`failed`,`local-cancelled`,`local-completed`,`local-failed`]),Eg=new Set([`saved`,`saved-truncated`,`discarded`,`failed`,`cleared`]);function Dg(e,t,n){let r=Number(e.metadata?.[t]);return Number.isFinite(r)?r:n}function Og(e,t){return{id:Dg(e,`macro_id`,t.id??0),name:e.metadata?.macro_name||t.name}}function kg(e){let t=e.kind.trim().toLowerCase();return t===`macro`||t.startsWith(`macro.`)}function Ag(e,t,n=80){return kg(t)?[t,...e.filter(e=>e.id!==t.id)].slice(0,n):e.slice(0,n)}function jg(e){let t=e.kind.trim().toLowerCase();return t===`macro.library`||t===`macro.recording`||t===`macro.recovery`}function Mg(e,t){if(!kg(t))return e;let n=t.kind.trim().toLowerCase(),r=(t.lifecycle||t.state||``).trim().toLowerCase(),i={...e,latest_event_id:Math.max(e.latest_event_id??0,t.id),playback:{...e.playback},recording:{...e.recording},library:e.library};if(n===`macro.recording.step`){let e=Og(t,i.recording);return i.recording={...i.recording,...e,active:!0,steps:Dg(t,`step`,i.recording.steps),last_at_us:Dg(t,`at_us`,i.recording.last_at_us??0),last_delta_us:Dg(t,`delta_us`,i.recording.last_delta_us??0),last_opcode:Dg(t,`opcode`,i.recording.last_opcode??0),last_source:Dg(t,`source`,i.recording.last_source??0)},i}if(n===`macro.recording`){let e=!Eg.has(r)&&!r.startsWith(`saved`)&&r!==`idle`;return i.recording={...i.recording,active:e,last_error:r===`failed`?t.reason||t.text:i.recording.last_error},i}if(n===`macro`||n===`macro.playback`||n===`macro.step`){let e=Og(t,i.playback),a=Tg.has(r);i.playback={...i.playback,...e,category:t.metadata?.category??i.playback.category,color:t.metadata?.color??i.playback.color,running:n===`macro.step`||!a&&r!==`idle`,lifecycle:r||i.playback.lifecycle,step:Dg(t,`step`,i.playback.step),step_count:Dg(t,`steps`,i.playback.step_count),last_timing_delta_us:Dg(t,`mcu_delta_us`,i.playback.last_timing_delta_us??0),maximum_timing_error_us:Dg(t,`timing_error_us`,i.playback.maximum_timing_error_us),underruns:Dg(t,`underruns`,i.playback.underruns??0),dispatch_errors:Dg(t,`dispatch_errors`,i.playback.dispatch_errors??0),faithful:t.metadata?.faithful===void 0?i.playback.faithful:t.metadata.faithful===`true`,last_error:r===`failed`?t.reason||t.text:i.playback.last_error}}return i}var Ng={connected:!1,paused:!1,port:{},hello:{},status:{uptime_ms:0,supply_mv:0,bus_mv:0,current_ma:0,power_mw:0,temperature_led_centi_c:0,temperature_bt_audio_centi_c:0,flags:0,ina219_available:!1,temperature_led_available:!1,temperature_bt_audio_available:!1,program_running:!1,host_offline:!1,hot:!1,raw_inputs:0,active_keys:0,active_relays:0,menu_page:0,program_mode:0,door_open:!1,bluetooth_audio_state:0,pwm_available:!1,pwm_channel:0,pwm_value:0,lcd_address:0,pwm_errors:0,framing_errors:0,crc_errors:0,reset_cause:0,reset_count:0},settings:{flags:0,light_mode:0,on_brightness:0,off_brightness:0,display_brightness:0,display_closed_brightness:0,motion_exit_hold_seconds:2,status_brightness:0,output_persistence:0,relay_restore_mask:0,stream_period_ms:200,default_page:0,extended_flags:0,motion_break_ms:1,persisted:!1},have_status:!1,have_settings:!1,emergency_stop:{active:!1,revision:0},hardware_problems:[],illumination:{available:!1,mode:0,on_brightness:0,off_brightness:0,door_open:!1,target_brightness:0,target_pwm:0,applied_brightness:0,applied_pwm:0,at_target:!1,persisted:!1},front_panel:{schema:0,raw_segments:[0,0,0,0],brightness:0,blink:!1,segments_active:!1,category_selector:!1,lcd_address:0,lcd_available:!1,lcd_backlight:!1,lcd_line_1:``,lcd_line_2:``,pressed_keys:0,menu_page:0,program_mode:0,host_captured:!1,host_state:0,host_editable_value:0},have_front_panel:!1,connection_state:`offline`},Pg=/\b(?:http\s*)?401\b|unauthori[sz]ed|authentication (?:required|rejected|failed)|invalid (?:session )?token|token (?:is )?(?:missing|invalid|rejected|required|expired)/i;function Fg(e){return e.streamState===`open`?!1:Pg.test(`${e.streamDetail??``} ${e.connectionReason??``}`)?!0:e.hostRequiresAuthentication?!e.token.trim():!1}function Ig(e,t){let n=t===`fa`,r=n?`خرابی سخت‌افزار کنترلر`:`Controller hardware failure`,i=n?`کابل داده، برق و درگاه USB کنترلر را بررسی کنید.`:`Check the controller data cable, power, and USB port.`;switch(e.code){case`usb_descriptor_failure`:r=n?`خرابی اتصال USB کنترلر`:`Controller USB connection failed`,i=n?`دریافت شناسهٔ دستگاه USB ناموفق بود. کابل داده، برق و درگاه USB کنترلر را بررسی کنید.`:`The USB device descriptor failed. Check the controller data cable, power, or try another USB port.`;break;case`device_cannot_start`:case`device_reported_problem`:r=n?`دستگاه USB کنترلر راه‌اندازی نشد`:`Controller USB device could not start`,i=n?`کنترلر را دوباره متصل کنید یا از کابل و درگاه USB دیگری استفاده کنید.`:`Reconnect the controller or use another data cable and USB port.`;break;case`device_disabled`:r=n?`دستگاه کنترلر غیرفعال است`:`Controller device is disabled`,i=n?`دستگاه را در «مدیریت دستگاه‌ها» فعال کنید و سپس دوباره متصل شوید.`:`Enable the device in Device Manager, then reconnect.`;break;case`device_driver_missing`:case`device_driver_failure`:r=n?`درایور USB کنترلر خراب است`:`Controller USB driver problem`,i=n?`درایور USB کنترلر را نصب یا تعمیر کنید و سپس دستگاه را دوباره متصل کنید.`:`Install or repair the controller USB driver, then reconnect the device.`;break;case`device_removal_pending`:r=n?`جداسازی کنترلر در انتظار است`:`Controller removal is pending`,i=n?`کنترلر را جدا کنید و دوباره وصل کنید.`:`Unplug the controller and reconnect it.`}let a=e.impact===`active_operation_outcome_unknown`?n?`ارتباط هنگام یک عملیات فعال قطع شد و نتیجهٔ آن نامشخص است. پیش از ادامه، وضعیت سخت‌افزار را بررسی کنید.`:`Communication was lost during an active operation and its outcome is unknown. Verify the hardware state before continuing.`:void 0;return{title:r,guidance:i,impact:a}}var Lg=new Set([`app.page`,`app.title`,`app.progress`]);function Rg(e,t,n=Date.now()){let r=e.metadata?.operation_id?.trim()??``,i=e.metadata?.operation_delivery_id?.trim()??``,a=e.metadata?.operation_expires_at?.trim()??``,o=e.kind.trim().toLowerCase();if(!r||!i||!a||!Lg.has(o)||!wh(e.metadata?.target_instance,t,`webui`))return null;let s=Date.parse(a);return!Number.isFinite(s)||s<=n?null:{operationID:r,deliveryID:i,receiptKey:`${r}\u0000${i}`,kind:o,value:(o===`app.page`?e.metadata?.page:e.metadata?.value)?.trim()??``}}function zg(e){switch(e.kind){case`app.page`:{let t=Xp(e.value);return t?{outcome:`applied`,page:t}:{outcome:`rejected`,reason:`unknown_page`}}case`app.title`:return e.value.toLowerCase()===`auto`?{outcome:`applied`,title:null}:!e.value||[...e.value].length>120||/[\u0000-\u001f\u007f]/u.test(e.value)?{outcome:`rejected`,reason:`invalid_title`}:{outcome:`applied`,title:e.value};case`app.progress`:{let t=Vg(e.value);return t===void 0?{outcome:`rejected`,reason:`invalid_progress`}:{outcome:`applied`,progress:t}}}}function Bg(e,t){return e.outcome===`applied`&&(`page`in e?t.replacePage(e.page):`title`in e?t.setTitle(e.title):t.setProgress(e.progress),!0)}function Vg(e){let t=e.trim().toLowerCase().split(/\s+/u).filter(Boolean);if(t.length===0||t.length>2)return;let n={0:`clear`,clear:`clear`,1:`normal`,normal:`normal`,2:`error`,error:`error`,3:`indeterminate`,indeterminate:`indeterminate`,4:`warning`,warning:`warning`}[t[0]];if(!n)return;if(n===`clear`)return t.length===1?null:void 0;if(n===`indeterminate`)return t.length===1?{state:n}:void 0;if(t.length!==2||!/^\d{1,3}$/u.test(t[1]))return;let r=Number(t[1]);if(!(!Number.isInteger(r)||r<0||r>100))return{state:n,percent:r}}var Hg=class{maximum;values=new Map;constructor(e=256){this.maximum=e}get(e){return this.values.get(e)}remember(e,t){if(!this.values.has(e)&&this.values.size>=this.maximum){let e=this.values.keys().next().value;e&&this.values.delete(e)}this.values.set(e,t)}};function Ug(e,t,n,r=Date.now()){let i=Rg(e,t,r);if(!i)return null;let a=n.get(i.receiptKey);if(a)return{action:i,acknowledgement:a,duplicate:!0};let o=zg(i),s={operation_id:i.operationID,delivery_id:i.deliveryID,instance_id:t,state:o.outcome,...o.outcome===`rejected`?{reason:o.reason}:{}};return n.remember(i.receiptKey,s),{action:i,effect:o,acknowledgement:s,duplicate:!1}}var Wg=3,Gg=100;function Kg(e){return new Promise(t=>globalThis.setTimeout(t,e))}async function qg(e,t,n=Kg){let r;for(let i=1;i<=Wg;i+=1)try{await t(e);return}catch(e){r=e,it===`fa`?n:e;if((0,T.useEffect)(()=>{e&&c(`appearance`)},[e]),(0,T.useEffect)(()=>{if(e)return u.current=document.activeElement,()=>{let e=u.current;u.current=null,window.requestAnimationFrame(()=>e?.focus())}},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=window.requestAnimationFrame(()=>l.current?.querySelector(`button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]:not([tabindex="-1"])`)?.focus()),n=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopImmediatePropagation(),o();return}if(e.key!==`Tab`||!l.current)return;let t=[...l.current.querySelectorAll(`button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]:not([tabindex="-1"])`)];if(!t.length)return;let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,n,!0),()=>{window.cancelAnimationFrame(t),document.removeEventListener(`keydown`,n,!0)}},[o,e]),!e)return null;let f=(e,t)=>{a({...r,[e]:t})},p=e=>c(e);return(0,U.jsxs)(`div`,{className:`app-preferences-layer`,role:`presentation`,children:[(0,U.jsx)(`button`,{type:`button`,className:`app-preferences-backdrop`,"aria-label":d(`Close application preferences`,`بستن ترجیحات برنامه`),onClick:o}),(0,U.jsxs)(`section`,{ref:l,className:`app-preferences-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`app-preferences-title`,children:[(0,U.jsxs)(`header`,{children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(Xe,{size:19}),(0,U.jsx)(`strong`,{id:`app-preferences-title`,children:d(`Application preferences`,`ترجیحات برنامه`)})]}),(0,U.jsx)(vf,{compact:!0,"aria-label":d(`Close application preferences`,`بستن ترجیحات برنامه`),icon:ut,onClick:o,children:d(`Close`,`بستن`)})]}),(0,U.jsxs)(`div`,{className:`app-preferences-tabs`,role:`tablist`,"aria-label":d(`Preference category`,`دستهٔ ترجیحات`),children:[(0,U.jsxs)(`button`,{id:`app-preferences-tab-appearance`,type:`button`,role:`tab`,"aria-selected":s===`appearance`,"aria-controls":`app-preferences-panel-appearance`,tabIndex:s===`appearance`?0:-1,className:s===`appearance`?`is-active`:``,onClick:()=>p(`appearance`),children:[(0,U.jsx)(Ke,{size:16}),d(`Appearance`,`ظاهر`)]}),(0,U.jsxs)(`button`,{id:`app-preferences-tab-header`,type:`button`,role:`tab`,"aria-selected":s===`header`,"aria-controls":`app-preferences-panel-header`,tabIndex:s===`header`?0:-1,className:s===`header`?`is-active`:``,onClick:()=>p(`header`),children:[(0,U.jsx)(Xe,{size:16}),d(`Quick header`,`نوار سریع`)]})]}),s===`appearance`?(0,U.jsxs)(`div`,{id:`app-preferences-panel-appearance`,className:`app-preferences-content`,role:`tabpanel`,"aria-labelledby":`app-preferences-tab-appearance`,children:[(0,U.jsxs)(`div`,{className:`setting-group`,children:[(0,U.jsx)(`label`,{children:d(`Theme`,`پوسته`)}),(0,U.jsx)(Df,{value:n.theme,label:d(`Theme`,`پوسته`),options:[{value:`system`,label:d(`System`,`سیستم`),icon:Ke},{value:`dark`,label:d(`Dark`,`تیره`)},{value:`light`,label:d(`Light`,`روشن`)}],onChange:e=>i({...n,theme:e})})]}),(0,U.jsxs)(`label`,{className:`app-preferences-select`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(k,{size:16}),d(`Language`,`زبان`)]}),(0,U.jsxs)(`select`,{value:n.locale,onChange:e=>i({...n,locale:e.target.value}),children:[(0,U.jsx)(`option`,{value:`en`,children:`English`}),(0,U.jsx)(`option`,{value:`fa`,children:`فارسی`})]})]}),(0,U.jsxs)(`div`,{className:`setting-group`,children:[(0,U.jsx)(`label`,{children:d(`Direction`,`جهت`)}),(0,U.jsx)(Df,{value:n.direction,label:d(`Direction`,`جهت`),options:[{value:`auto`,label:d(`Auto`,`خودکار`)},{value:`ltr`,label:d(`Left to right`,`چپ به راست`)},{value:`rtl`,label:d(`Right to left`,`راست به چپ`)}],onChange:e=>i({...n,direction:e})})]}),(0,U.jsx)(Tf,{checked:n.reduceMotion,onChange:e=>i({...n,reduceMotion:e}),label:d(`Reduce interface motion`,`کاهش حرکت رابط`),detail:d(`Applies to this browser and is synchronized by the host.`,`در همین مرورگر اعمال می‌شود و میزبان آن را همگام نگه می‌دارد.`)}),(0,U.jsx)(Tf,{checked:n.compactNumbers,onChange:e=>i({...n,compactNumbers:e}),label:d(`Compact large numbers`,`فشرده‌سازی اعداد بزرگ`)}),(0,U.jsx)(Tf,{checked:!n.audioMuted,onChange:e=>i({...n,audioMuted:!e}),label:(0,U.jsxs)(`span`,{className:`setting-icon-label`,children:[(0,U.jsx)(ot,{size:16}),d(`Interaction audio`,`صدای تعامل`)]})}),!n.audioMuted&&(0,U.jsx)(Ef,{label:(0,U.jsxs)(`span`,{className:`setting-icon-label`,children:[(0,U.jsx)(Te,{size:16}),d(`Interaction volume`,`بلندی صدای تعامل`)]}),value:Math.round(n.audioVolume*100),min:0,max:100,unit:`%`,onChange:e=>i({...n,audioVolume:e/100})})]}):(0,U.jsxs)(`div`,{id:`app-preferences-panel-header`,className:`app-preferences-content`,role:`tabpanel`,"aria-labelledby":`app-preferences-tab-header`,children:[(0,U.jsx)(`p`,{children:d(`Choose which optional controls appear in the quick header. The preferences button remains visible so every choice is reversible.`,`انتخاب کنید کدام کنترل‌های اختیاری در نوار سریع نمایش داده شوند. دکمهٔ ترجیحات همیشه دیده می‌شود تا همهٔ انتخاب‌ها برگشت‌پذیر باشند.`)}),(0,U.jsx)(Tf,{checked:r.theme,onChange:e=>f(`theme`,e),label:d(`Theme switch`,`تغییر پوسته`)}),(0,U.jsx)(Tf,{checked:r.language,onChange:e=>f(`language`,e),label:d(`Language switch`,`تغییر زبان`)}),(0,U.jsx)(Tf,{checked:r.audio,onChange:e=>f(`audio`,e),label:d(`Interaction audio`,`صدای تعامل`)}),(0,U.jsx)(Tf,{checked:r.hotkeys,onChange:e=>f(`hotkeys`,e),label:d(`Keyboard guide`,`راهنمای صفحه‌کلید`)}),(0,U.jsx)(Tf,{checked:r.notifications,onChange:e=>f(`notifications`,e),label:d(`Event notifications`,`اعلان رویدادها`)})]}),(0,U.jsx)(`footer`,{children:d(`These preferences affect the host interface only. Controller settings remain on the Settings page.`,`این ترجیحات فقط روی رابط میزبان اثر می‌گذارند. تنظیمات کنترلر در صفحهٔ تنظیمات باقی می‌مانند.`)})]})]})}var Yg=`pccontroller:state`;function Xg(e){if(typeof window>`u`)return()=>void 0;let t=window.PCController;return Object.defineProperty(window,"PCController",{configurable:!0,value:Object.freeze(e)}),()=>{window.PCController===e&&(t===void 0?delete window.PCController:Object.defineProperty(window,"PCController",{configurable:!0,value:t}))}}function Zg(e){typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(Yg,{detail:Object.freeze({...e})}))}var Qg=[`theme`,`language`,`audio`,`hotkeys`,`notifications`],$g={theme:!0,language:!0,audio:!0,hotkeys:!0,notifications:!0},e_=`pccontroller.quick-header-controls`;function t_(e){let t=e&&typeof e==`object`?e:{};return Object.fromEntries(Qg.map(e=>[e,typeof t[e]==`boolean`?t[e]:$g[e]]))}function n_(){try{return t_(JSON.parse(window.localStorage.getItem(e_)??`null`))}catch{return{...$g}}}function r_(e){try{window.localStorage.setItem(e_,JSON.stringify(t_(e)))}catch{}}function i_(e){switch(e.severity?.trim().toLowerCase()){case`success`:return`success`;case`warning`:return`warning`;case`error`:return`danger`;default:return`info`}}function a_(e,t,n){return e===`fa`?n:t}function o_(e,t){if(e.kind.trim().toLowerCase()!==`message`||!Number.isSafeInteger(e.id)||e.id<=0)return null;let n=e.action?.trim()||void 0,r=e.correlation?.trim()||void 0;return{tone:i_(e),title:e.metadata?.title?.trim()||e.message_type?.trim()||a_(t,`Message`,`پیام`),detail:e.text,messageEventID:e.id,correlation:r,action:n,actionLabel:n?e.metadata?.action_label?.trim()||a_(t,`Suggested action`,`عملیات پیشنهادی`):void 0,persistent:!!(n||r)}}function s_(e,t=`unknown`){if(!Number.isFinite(e)||e==null||e<0)return t;if(e===0)return`0 B`;let n=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],r=Math.min(n.length-1,Math.floor(Math.log(e)/Math.log(1024))),i=e/1024**r,a=r===0||i>=100?0:i>=10?1:2;return`${i.toFixed(a)} ${n[r]}`}function c_(e,t,n=`unknown`){return`${s_(e,n)} / ${s_(t,n)}`}var l_=new Set([`completed`,`failed`,`cancelled`,`downloaded`,`staged`,`outcome-uncertain`]);function u_(e,t){return{host:[`Host update`,`به‌روزرسانی میزبان`],firmware:[`Firmware update`,`به‌روزرسانی میان‌افزار`],eeprom:[`EEPROM update`,`به‌روزرسانی EEPROM`],"artifact-fetch":[`Artifact download`,`دریافت فایل`],"artifact-upload":[`Artifact upload`,`ارسال فایل`],"peer-artifact-upload":[`Incoming host update`,`دریافت به‌روزرسانی میزبان`],"device-capture":[`Board readback`,`بازخوانی برد`]}[e]?.[+(t===`fa`)]??e.replaceAll(`-`,` `)}function d_(e,t){let n=e.kind.trim().toLowerCase();if(!/^(update|peer-update)\./.test(n))return null;let r=e.metadata,i=r?.operation_id?.trim();if(!i)return null;let a=(r?.state||n.split(`.`).slice(1).join(`.`)).trim().toLowerCase(),o=(r?.kind||(n.startsWith(`peer-update.`)?`host`:`update`)).trim().toLowerCase(),s=(r?.stage||a).replaceAll(`-`,` `),c=Number(r?.progress_percent),l=r?.progress_known===`true`&&Number.isFinite(c),u=l?Math.max(0,Math.min(100,c)):void 0,d=Number(r?.bytes_done),f=Number(r?.bytes_total),p=Number.isFinite(d)&&d>=0?d:void 0,m=Number.isFinite(f)&&f>0?f:void 0,h=l_.has(a);return{tone:a===`failed`?`danger`:a===`cancelled`||a===`outcome-uncertain`?`warning`:h?`success`:`info`,title:`${u_(o,t)} · ${s}`,detail:e.text||r?.detail,persistent:!h,updateOperationID:i,progressKnown:l,progressPercent:u,bytesDone:p,bytesTotal:m,progressLabel:m===void 0?l?`${u}%`:t===`fa`?`در حال انتقال`:`Transfer in progress`:c_(p??0,m)}}var f_=`modulepreload`,p_=function(e){return`/`+e},m_={},h_=function(e){return e.pathname.endsWith(`.css`)},g_=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},__=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=p_(t,n);let r=s(t),i=h_(r);return g_(m_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:f_,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},v_=(0,T.lazy)(()=>__(async()=>{let{DashboardView:e}=await import(`./chunk-A4VaeTzE.js`);return{DashboardView:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({DashboardView:e})=>({default:e}))),y_=(0,T.lazy)(()=>__(async()=>{let{ControlsView:e}=await import(`./chunk-A4VaeTzE.js`);return{ControlsView:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({ControlsView:e})=>({default:e}))),b_=(0,T.lazy)(()=>__(async()=>{let{LocalDeviceView:e}=await import(`./chunk-A4VaeTzE.js`);return{LocalDeviceView:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({LocalDeviceView:e})=>({default:e}))),x_=(0,T.lazy)(()=>__(async()=>{let{EventsView:e}=await import(`./chunk-A4VaeTzE.js`);return{EventsView:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({EventsView:e})=>({default:e}))),S_=(0,T.lazy)(()=>__(async()=>{let{SettingsView:e}=await import(`./chunk-A4VaeTzE.js`);return{SettingsView:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({SettingsView:e})=>({default:e}))),C_=(0,T.lazy)(()=>__(async()=>{let{WorkbenchView:e}=await import(`./chunk-DFSYywIo.js`);return{WorkbenchView:e}},__vite__mapDeps([7,4,5,3,8,6])).then(({WorkbenchView:e})=>({default:e}))),w_=(0,T.lazy)(()=>__(async()=>{let{DataWorkspaceView:e}=await import(`./chunk-Dmio8W6_.js`);return{DataWorkspaceView:e}},__vite__mapDeps([9,1,2,3,10,6])).then(({DataWorkspaceView:e})=>({default:e}))),T_=(0,T.lazy)(()=>__(async()=>{let{UpdatesView:e}=await import(`./chunk-DfNNWLG8.js`);return{UpdatesView:e}},__vite__mapDeps([11,10,4,2,8,6])).then(({UpdatesView:e})=>({default:e}))),E_=[{id:`dashboard`,label:`dashboard`,icon:Ae,view:v_,group:`core`},{id:`controls`,label:`controls`,icon:Te,view:y_,group:`core`},{id:`workbench`,label:`workbench`,icon:ct,view:C_,group:`core`},{id:`device`,label:`device`,icon:Me,view:b_,group:`integrations`},{id:`data`,label:`data`,icon:he,view:w_,group:`integrations`},{id:`updates`,label:`updates`,icon:Be,view:T_,group:`system`},{id:`events`,label:`events`,icon:se,view:x_,group:`system`},{id:`settings`,label:`settings`,icon:Qe,view:S_,group:`system`}];function D_(e){return E_.find(t=>t.id===e)?.view??v_}function O_(e,t=!1){return t||e!==null&&!e.setup_complete}var k_={theme:`system`,locale:`en`,direction:`auto`,reduceMotion:!1,compactNumbers:!1,audioMuted:!1,audioVolume:.42},A_=`pccontroller.appearance`,j_=`pccontroller.resource-reload`;function M_(e){let t=Mm(e);if(!Nm(e)){try{sessionStorage.removeItem(j_)}catch{}return!1}try{if(sessionStorage.getItem(j_)===t)return!1;sessionStorage.setItem(j_,t)}catch{return!1}return window.location.reload(),!0}function N_(){try{return P_(JSON.parse(localStorage.getItem(A_)??`{}`))}catch{return k_}}function P_(e,t=k_){return{theme:e.theme===`light`||e.theme===`dark`||e.theme===`system`?e.theme:t.theme,locale:e.locale===`fa`||e.locale===`en`?e.locale:t.locale,direction:e.direction===`ltr`||e.direction===`rtl`||e.direction===`auto`?e.direction:t.direction,reduceMotion:typeof e.reduceMotion==`boolean`?e.reduceMotion:t.reduceMotion,compactNumbers:typeof e.compactNumbers==`boolean`?e.compactNumbers:t.compactNumbers,audioMuted:typeof e.audioMuted==`boolean`?e.audioMuted:t.audioMuted,audioVolume:Number.isFinite(e.audioVolume)?Math.max(0,Math.min(1,Number(e.audioVolume))):t.audioVolume}}function F_(e,t){return e.theme===t.theme&&e.locale===t.locale&&e.direction===t.direction&&e.reduceMotion===t.reduceMotion&&e.compactNumbers===t.compactNumbers&&e.audioMuted===t.audioMuted&&e.audioVolume===t.audioVolume}function I_(e){let t=e.theme===`system`?matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`:e.theme,n=e.direction===`auto`?e.locale===`fa`?`rtl`:`ltr`:e.direction;document.documentElement.dataset.theme=t,document.documentElement.lang=e.locale===`fa`?`fa-IR`:`en`,document.documentElement.dir=n,document.documentElement.classList.toggle(`reduce-motion`,e.reduceMotion),document.documentElement.classList.toggle(`compact-numbers`,e.compactNumbers),document.querySelector(`meta[data-runtime-theme]`)?.setAttribute(`content`,t===`dark`?`#0b0a0e`:`#f5f3f6`)}function L_(e){let t=e.replace(/^#\/?/,``).split(/[/?#]/)[0];return E_.some(e=>e.id===t)?t:`dashboard`}function R_(e){return`#/${e}`}function z_(e,t=location.pathname,n=location.search){return`${t}${n}${R_(e)}`}function B_(e,t){return e!==t}function V_(){return L_(location.hash)}function H_(e,t){return e.filter(e=>!!e.status).map(e=>ig({...Ng,connected:!0,have_status:!0,hello:t,status:e.status},e.time?new Date(e.time).getTime():Date.now())).filter(e=>Number.isFinite(e.at)).slice(-360)}function U_(e,t){let n=e.trim().toLowerCase().replace(/\s+/g,` `),r=t===`fa`,i=(e,t,n)=>({title:e,body:t,confirmLabel:n});return/^(reset|boot|program|programmer|firmware|flash|upload|restore|query|write)(?: |$)/.test(n)?r?i(`ورود به مسیر بازیابی یا برنامه‌ریزی؟`,`این فرمان ممکن است درگاه سریال را آزاد کند، خطوط کنترل را تغییر دهد یا وارد مسیر محافظت‌شدهٔ برنامه‌ریزی شود. فرمان را یک‌بار دیگر بررسی کنید.`,`تأیید و ارسال`):i(`Enter a recovery or programming path?`,`This command may release the serial port, pulse control lines, or enter the guarded programming workflow. Review the exact command before dispatch.`,`Confirm and dispatch`):/^rf send(?: |$)/.test(n)?r?i(`فرمان رادیویی ارسال شود؟`,`این ارسال می‌تواند یک وسیلهٔ خارجی را فعال کند. کد، پروتکل و تعداد تکرار را پیش از ارسال کنترل کنید.`,`ارسال آگاهانه`):i(`Transmit the radio command?`,`This transmission can actuate an external device. Verify the code, protocol, and repeat count before dispatch.`,`Transmit explicitly`):/^(macro play|automation run|bridge call)(?: |$)/.test(n)?r?i(`اجرای گردش‌کار تأیید شود؟`,`تعریف انتخاب‌شده می‌تواند خروجی‌های برد، فرمان‌های میزبان یا یک میزبان راه‌دور را فعال کند. ابتدا نام و مقصد را بررسی کنید.`,`تأیید اجرا`):i(`Confirm workflow execution?`,`The selected definition can operate board outputs, host actions, or a remote peer. Verify its name and destination first.`,`Confirm run`):/^(os (power|sleep|suspend|hibernate|restart|shutdown|lock)|quit|exit)(?: |$)/.test(n)?r?i(`عملیات میزبان اجرا شود؟`,`این فرمان می‌تواند نشست یا رایانه را متوقف کند. سیاست و توکن تأیید میزبان همچنان در سمت سرویس اعمال می‌شود.`,`تأیید عملیات`):i(`Run the host operation?`,`This command can end the session or affect the computer. Host-side policy and confirmation-token checks still apply.`,`Confirm operation`):null}function W_(e,t,n=``){return{...e}}function G_(e){return typeof e!=`number`||!Number.isFinite(e)?1e3:Math.min(5e3,Math.max(750,Math.round(e*4)))}function K_(e,t,n,r){let i=(e,t)=>r===`fa`?t:e;if(t===`connecting`)return i(`Connecting`,`در حال اتصال`);if(t!==`open`)return i(`Reconnecting`,`در حال اتصال دوباره`);if(n===`loading`)return i(`Synchronizing`,`در حال همگام‌سازی`);if(e.connected)return i(`Board connected`,`برد متصل`);let a=e.connection_state.trim().toLowerCase();return a===`paused`?i(`Paused`,`متوقف`):[`connecting`,`discovering`,`scanning`,`searching`].includes(a)?i(`Searching`,`در حال جستجو`):i(`No board`,`بدون برد`)}function q_(e){return e.kind.toLowerCase()===`update.completed`&&e.metadata?.kind===`host`}function J_(e,t,n=Date.now()){let r=e.kind.toLowerCase();return t!==`updates`&&(r.startsWith(`update.`)||r.startsWith(`peer-update.`))&&Zp(e.time,n)}function Y_(e,t,n=!0,r=!1){return r||!n||e===null||e===t?null:t?`connect`:`disconnect`}function X_(e,t=!1){return!t&&(e===`waiting`||e===`closed`)}function Z_(){let[e,t]=(0,T.useState)(N_),[n,r]=(0,T.useState)(V_),[i,a]=(0,T.useState)(!0),[o,s]=(0,T.useState)(!1),[c,l]=(0,T.useState)(Ng),[u,d]=(0,T.useState)(()=>[]),[f,p]=(0,T.useState)(()=>[]),[m,h]=(0,T.useState)([]),[g,_]=(0,T.useState)(`idle`),[v,y]=(0,T.useState)(null),[b,x]=(0,T.useState)(`connecting`),[S,ee]=(0,T.useState)(``),[te,C]=(0,T.useState)(0),[ne,w]=(0,T.useState)([]),[re,ie]=(0,T.useState)({open:!1,title:``,body:``,confirmLabel:``}),[ae,E]=(0,T.useState)(!1),[oe,se]=(0,T.useState)(!1),[ce,le]=(0,T.useState)(``),[ue,fe]=(0,T.useState)(0),[me,he]=(0,T.useState)(!1),[ge,ve]=(0,T.useState)(!1),[ye,be]=(0,T.useState)(n_),[Se,D]=(0,T.useState)(!1),[O,we]=(0,T.useState)({left:0,top:0}),[Te,Ee]=(0,T.useState)(!1),[Oe,ke]=(0,T.useState)(!1),[Ae,je]=(0,T.useState)(12),[Me,Ne]=(0,T.useState)(24),[Pe,Fe]=(0,T.useState)(!1),[Le,ze]=(0,T.useState)(Ep),[Be,Ve]=(0,T.useState)(!1),[Ue,Ge]=(0,T.useState)(0),[Ke,qe]=(0,T.useState)(``),[Ye,Ze]=(0,T.useState)([]),[Qe,$e]=(0,T.useState)(Ih),[tt,rt]=(0,T.useState)({state:`idle`,detail:``}),[at]=(0,T.useState)(()=>new Ph),[st,ct]=(0,T.useState)(null),[lt,dt]=(0,T.useState)(null),[ft,pt]=(0,T.useState)([]),mt=(0,T.useRef)(0),ht=(0,T.useRef)(new Map),gt=(0,T.useRef)(0),A=(0,T.useRef)(null),_t=(0,T.useRef)(new Cg),vt=(0,T.useRef)(null),yt=(0,T.useRef)(null),bt=(0,T.useRef)(null),xt=(0,T.useRef)(``),St=(0,T.useRef)(e),Ct=(0,T.useRef)(Promise.resolve()),wt=(0,T.useRef)(!1),Tt=(0,T.useRef)(!1),Et=(0,T.useRef)(n),Dt=(0,T.useRef)(null),Ot=(0,T.useRef)(null),kt=(0,T.useRef)(Qe),At=(0,T.useRef)(()=>void 0),jt=(0,T.useRef)(()=>void 0),Mt=(0,T.useRef)(new sf),Nt=(0,T.useRef)(``),Pt=(0,T.useRef)(c),Ft=(0,T.useRef)(0),It=(0,T.useRef)(``),Lt=(0,T.useRef)(new Hg),j=(0,T.useMemo)(()=>im(e.locale),[e.locale]),Rt=ym(v?.name,`PCController`),zt=bm(Rt,`PC`),Bt=v?.tagline?.trim()||`One host. Every board surface.`,Vt=e.direction===`auto`?e.locale===`fa`?`rtl`:`ltr`:e.direction,Ht=Vt===`rtl`?`18px`:`-18px`;kt.current=Qe;let Ut=(0,T.useCallback)(e=>{t(e);try{localStorage.setItem(A_,JSON.stringify(e))}catch{}I_(e),A.current?.setVolume(e.audioVolume),A.current?.setMuted(e.audioMuted)},[]),Wt=(0,T.useCallback)(e=>{let t=t_(e);be(t),r_(t)},[]),Gt=(0,T.useCallback)((e,t)=>{let n=P_(e);xt.current=t,St.current=n,Ut(n)},[Ut]),Kt=(0,T.useCallback)(async()=>{let e=await Np();return y(e),bt.current?.updateStatusInterval(e.status_interval_ms),Gt(e.appearance,e.appearance_etag),e},[Gt]),qt=(0,T.useCallback)((e,t)=>{y(n=>n&&{...n,status_interval_ms:e,measurement_freshness_ms:t}),bt.current?.updateStatusInterval(e)},[]);(0,T.useEffect)(()=>{let e=j(E_.find(e=>e.id===n)?.label??`dashboard`);document.title=st??`${Rt} — ${e}`},[n,Rt,st,j]),(0,T.useEffect)(()=>{wm(Sm(c))},[!1,c.connected,c.connection_reason,c.connection_state,c.have_status,c.status.hot]),(0,T.useEffect)(()=>{Pe&&!Tt.current&&(Tt.current=!0,Hm({productTitle:Rt,config:v,boardConnected:c.connected,port:c.port.name,streamState:b,demonstration:!1}))},[!1,Rt,c.connected,c.port.name,Pe,b,v]),(0,T.useEffect)(()=>{Et.current=n},[n]);let Jt=(0,T.useCallback)((e,t)=>{let n=Dt.current?.getBoundingClientRect();we({left:e??(i?n?.left??10:(n?.right??84)+7),top:t??(n?.bottom??10)+7}),D(!0)},[i]);(0,T.useLayoutEffect)(()=>{if(!Se||!Ot.current)return;let e=Ot.current.getBoundingClientRect();we(t=>({left:Math.max(10,Math.min(t.left,window.innerWidth-e.width-10)),top:Math.max(10,Math.min(t.top,window.innerHeight-e.height-10))}))},[Se]),(0,T.useEffect)(()=>{if(!Se)return;let e=e=>{let t=e.target;!Dt.current?.contains(t)&&!Ot.current?.contains(t)&&D(!1)},t=e=>{e.key===`Escape`&&(D(!1),Dt.current?.focus())},n=()=>D(!1),r=window.requestAnimationFrame(()=>Ot.current?.querySelector(`button`)?.focus());return window.addEventListener(`pointerdown`,e),window.addEventListener(`focusin`,e),window.addEventListener(`keydown`,t),window.addEventListener(`blur`,n),window.addEventListener(`hashchange`,n),()=>{window.cancelAnimationFrame(r),window.removeEventListener(`pointerdown`,e),window.removeEventListener(`focusin`,e),window.removeEventListener(`keydown`,t),window.removeEventListener(`blur`,n),window.removeEventListener(`hashchange`,n)}},[Se]),(0,T.useEffect)(()=>{c.connected||D(!1)},[c.connected]),(0,T.useEffect)(()=>{let t=af({muted:e.audioMuted,volume:e.audioVolume,pauseWhenHidden:!0});A.current=t;let n=()=>{t.start()};return window.addEventListener(`pointerdown`,n,{capture:!0,once:!0}),window.addEventListener(`keydown`,n,{capture:!0,once:!0}),()=>{window.removeEventListener(`pointerdown`,n,{capture:!0}),window.removeEventListener(`keydown`,n,{capture:!0}),A.current===t&&(A.current=null),t.dispose()}},[]),(0,T.useEffect)(()=>{if(!Pe)return;let e=vt.current;vt.current=c.connected;let t=Y_(e,c.connected,Pe,!1);t&&A.current?.cue(t)},[!1,c.connected,Pe]),(0,T.useEffect)(()=>{let e=Ch({origin:vp()}),t=new Map;yt.current=e,qe(e.tabId),Ve(e.supported);let n=()=>{let e=Date.now()-4e4;for(let[n,r]of t)r{let r=e.payload;if(r.type===`presence`)r.state===`leaving`?t.delete(e.tabId):t.set(e.tabId,e.sentAt),n();else if(t.set(e.tabId,e.sentAt),n(),r.type===`appearance`&&(!r.etag||r.etag!==xt.current)&&Kt().catch(()=>void 0),r.type===`terminal`&&pt(t=>[...t.filter(t=>t.id!==e.messageId).slice(-119),{id:e.messageId,tabId:e.tabId,...r.entry}]),r.type===`controller-event`){let e=r.event;kg(e)&&h(t=>Ag(t,e)),vg(e)&&l(t=>{let n=yg(t,e);return Pt.current=n,n}),p(t=>Om(t,e))}}),i=()=>e.publishPresence(document.hidden?`hidden`:`active`,Et.current),a=()=>i();i(),document.addEventListener(`visibilitychange`,a);let o=window.setInterval(()=>{i(),n()},12e3);return()=>{document.removeEventListener(`visibilitychange`,a),window.clearInterval(o),e.publishPresence(`leaving`,Et.current),r(),e.close(),yt.current===e&&(yt.current=null),qe(t=>t===e.tabId?``:t)}},[Kt]);let Yt=(0,T.useCallback)((t=document.hidden?`hidden`:`active`,n=!1)=>!Pe||!Ke?Promise.resolve():Rp(`controller.app.instance.report`,{id:Ke,surface:`webui`,page:Et.current,state:t,lease_seconds:45,self:{kind:`browser`,vars:{origin:window.location.origin,platform:navigator.platform||`unknown`,language:navigator.language||`unknown`,user_agent:navigator.userAgent}},values:{color_mode:e.theme,locale:e.locale,direction:Vt,app_actions:`app.page,app.progress,app.title`,...at.nextValues(Qe,n)}}),[Ke,e.locale,e.theme,!1,at,Qe,Vt,Pe]);At.current=(e=!1)=>{e&&kt.current&&rt({state:`pending`,detail:``}),Yt(void 0,e).catch(t=>{e&&kt.current&&rt({state:`error`,detail:t instanceof Error?t.message:String(t)})})},(0,T.useEffect)(()=>{if(!Pe||!Ke)return;let e=(e=document.hidden?`hidden`:`active`)=>{Yt(e).catch(()=>void 0)},t=()=>e();e(),document.addEventListener(`visibilitychange`,t);let n=window.setInterval(()=>e(),3e4);return()=>{document.removeEventListener(`visibilitychange`,t),window.clearInterval(n)}},[Ke,!1,Yt,Pe,Le]),(0,T.useEffect)(()=>()=>{Ke&&Rp(`controller.app.instance.report`,{id:Ke,surface:`webui`,page:Et.current,state:`leaving`,lease_seconds:45}).catch(()=>void 0)},[Ke]),(0,T.useEffect)(()=>{if(!Pe)return;let e=!0,t=()=>Rp(`controller.app.instances`).then(t=>{e&&Ze(t)}).catch(()=>{e&&Ze([])});t();let n=window.setInterval(t,3e4);return()=>{e=!1,window.clearInterval(n)}},[!1,Pe,Le]),(0,T.useEffect)(()=>{if(Ae>=Me)return;let e=window.setInterval(()=>{je(e=>{let t=Me-e;return t<=0?e:t<.8?Me:Math.min(Me,e+Math.max(.75,t*.14))})},72);return()=>window.clearInterval(e)},[Ae,Me]);let Xt=(0,T.useCallback)(e=>{mt.current+=1;let t=mt.current;return w(n=>[...n.slice(-3),{id:t,...e}]),e.tone===`danger`&&A.current?.cue(`error`),e.tone===`warning`&&A.current?.cue(`warning`),e.tone===`success`&&A.current?.cue(`success`),e.persistent||window.setTimeout(()=>w(e=>e.filter(e=>e.id!==t)),5200),t},[]),Zt=(0,T.useCallback)((e,t,n)=>{Xt({tone:e,title:t,detail:n})},[Xt]),Qt=(0,T.useCallback)(e=>{let t=d_(e,St.current.locale);if(!t?.updateOperationID)return!1;let n=t.updateOperationID,r=ht.current.get(n);r===void 0&&(mt.current+=1,r=mt.current,ht.current.set(n,r));let i={id:r,...t};return w(e=>{let t=e.findIndex(e=>e.updateOperationID===n);return t<0?[...e.slice(-3),i]:e.map((e,n)=>n===t?i:e)}),t.persistent||(ht.current.delete(n),window.setTimeout(()=>w(e=>e.filter(e=>e.id!==r)),5200)),!0},[]);(0,T.useEffect)(()=>{let e=e=>{let t=e.detail;if(!t?.id||!t.state)return;let n={operation_id:t.id,kind:t.kind,state:t.state,stage:t.stage||t.state,detail:t.detail||``,progress_known:String(t.progress_known===!0),progress_percent:String(t.progress_percent??0),updated_at:t.updated_at||new Date().toISOString()};t.bytes_done!==void 0&&(n.bytes_done=String(t.bytes_done)),t.bytes_total!==void 0&&(n.bytes_total=String(t.bytes_total)),Qt({id:0,time:n.updated_at,kind:`update.${t.state}`,text:t.detail||``,metadata:n})};return window.addEventListener(`pccontroller:update-transfer-progress`,e),()=>window.removeEventListener(`pccontroller:update-transfer-progress`,e)},[Qt]),(0,T.useEffect)(()=>{let t=()=>{let t=A.current;Zt(`success`,e.locale===`fa`?`اعلان آزمایشی`:`Test notification`,e.locale===`fa`?`صدا، لرزش و اعلان آماده‌اند.`:`Audio, haptics, and notifications are ready.`),t&&t.start().then(e=>{e&&t.cue(`success`)})};return window.addEventListener(`pccontroller:test-feedback`,t),()=>window.removeEventListener(`pccontroller:test-feedback`,t)},[e.locale,Zt]);let M=(0,T.useCallback)(async()=>{try{let e={epoch:Ft.current,instanceID:It.current},t=await Pp();if(!cg(e,{epoch:Ft.current,instanceID:It.current})||!ug(t,e))return;let n=Pt.current,r=gg(n,t,{epoch:e.epoch,instanceID:t.host_instance_id,authoritativeInstanceID:e.instanceID});Pt.current=r,l(r),d(e=>og(e,n,r))}catch(e){Zt(`warning`,`Snapshot unavailable`,e instanceof Error?e.message:String(e))}},[!1,Zt]);(0,T.useEffect)(()=>{let e=Mt.current.shouldRead(c,n===`settings`);if(b!==`open`||!c.connected||!c.have_status){Nt.current=``,_(`idle`);return}if(c.have_settings){_(`ready`);return}if(!e)return;_(`loading`);let t=of(c);Nt.current=t,zp(`settings`).then(()=>M()).then(()=>{Nt.current===t&&_(`unavailable`)}).catch(()=>{Nt.current===t&&_(`unavailable`)})},[n,M,c.connected,c.have_status,c.have_settings,c.hello.build_hash,c.hello.build_timestamp,c.port.instance_id,c.port.name,c.port.serial_number,b]);let $t=(0,T.useCallback)(async(e,t,n=!1)=>{let r=fm(e);yt.current?.publishTerminal({kind:`command`,text:`pc› ${r}`,at:Date.now()});try{let i=(await zp(e)).output??``;return yt.current?.publishTerminal({kind:`output`,text:i||`✓ accepted`,at:Date.now()}),Zt(`success`,t||`Command completed`,i||r),n&&M(),i}catch(e){let t=e instanceof Error?e.message:String(e);throw yt.current?.publishTerminal({kind:`error`,text:`! ${t}`,at:Date.now()}),Zt(`danger`,`Command failed`,t),e}},[!1,Zt,M]),N=(0,T.useCallback)((t,n,r=!1)=>{let i=U_(t,e.locale);return i?new Promise((a,o)=>{let s=!1;ie({open:!0,tone:`danger`,title:i.title,body:`${i.body}\n\n${fm(t)}`,confirmLabel:i.confirmLabel,cancel:()=>{s||(s=!0,a(e.locale===`fa`?`پیش از ارسال لغو شد.`:`Cancelled before dispatch.`))},action:async()=>{try{let e=await $t(t,n,r);s=!0,a(e)}catch(e){throw s=!0,o(e),e}}})}):$t(t,n,r)},[e.locale,!1,$t]),en=(0,T.useCallback)(e=>{ie({...e,open:!0})},[]),tn=(0,T.useCallback)((t,n=`push`)=>{let i=B_(Et.current,t),a=R_(t);n===`push`&&(Et.current!==t||location.hash!==a)?history.pushState({page:t},``,z_(t)):n===`replace`&&(Et.current!==t||location.hash!==a)&&history.replaceState({page:t},``,z_(t)),Et.current=t,r(t),s(!1),yt.current?.publishPresence(document.hidden?`hidden`:`active`,t),i&&At.current(),i&&document.querySelector(`.app-main`)?.scrollTo({top:0,behavior:e.reduceMotion?`auto`:`smooth`})},[e.reduceMotion]),P=(0,T.useCallback)((t,n=`push`)=>{if(tn(t,n),!Qe||!Pe||!Ke)return;rt({state:`pending`,detail:``});let r;try{r=at.nextCommit(Ke,t)}catch(e){rt({state:`error`,detail:e instanceof Error?e.message:String(e)});return}Rp(`controller.app.navigation.commit`,r).then(t=>{let n=at.settle(t,r.operation_id);if(n)tn(n,`replace`),rt({state:`idle`,detail:``});else throw Error(e.locale===`fa`?`پاسخ هماهنگ‌کننده با درخواست فعلی مطابقت ندارد.`:`The coordinator response did not match this request.`)}).catch(e=>{At.current(!0),rt({state:`error`,detail:e instanceof Error?e.message:String(e)})})},[Ke,e.locale,tn,!1,at,Qe,Pe]),nn=(0,T.useMemo)(()=>({title:Rt,hostVersion:v?.host_version||``,page:n,hostOnline:b===`open`,boardConnected:c.connected,port:c.port.name||``,transport:b,eventCount:f.length}),[!1,f.length,n,Rt,c.connected,c.port.name,b,v?.host_version]);(0,T.useEffect)(()=>Xg({api:`PCController.browser`,inspect:()=>nn,command:e=>{let t=e.trim();return t?N(t):Promise.reject(Error(`PCController.command requires a non-empty command`))},refresh:M,navigate:e=>{let t=E_.find(t=>t.id===e)?.id;if(!t)throw Error(`Unknown PCController page: ${e}`);P(t)}}),[nn,P,M,N]),(0,T.useEffect)(()=>{Zg(nn)},[nn]),(0,T.useEffect)(()=>(jt.current=e=>P(e,`none`),()=>{jt.current=()=>void 0}),[P]);let rn=(0,T.useCallback)(e=>{Lh(e),at.resetCoordinator(),rt(e?{state:`pending`,detail:``}:{state:`idle`,detail:``}),$e(e)},[at]),an=(0,T.useCallback)(t=>{let n=P_(t,St.current);St.current=n,Ut(n);let r=A.current;!n.audioMuted&&r&&r.start({muted:!1}).then(e=>{e&&r.cue(`select`)}),Ct.current=Ct.current.then(async()=>{let e=await Rp(`controller.ui.config.set`,{appearance:n,if_match:xt.current});xt.current=e.appearance_etag,y(t=>t&&{...t,appearance:e.appearance,appearance_etag:e.appearance_etag}),F_(St.current,n)&&Gt(e.appearance,e.appearance_etag),yt.current?.publishAppearance(e.appearance,e.appearance_etag)}).catch(async t=>{try{await Kt()}catch{}Zt(`warning`,e.locale===`fa`?`تنظیم ظاهر ذخیره نشد`:`Appearance was not saved`,t instanceof Error?t.message:String(t))})},[Gt,e.locale,Ut,!1,Zt,Kt]),on=(0,T.useCallback)(t=>{let n={...e,audioMuted:!t};an(n);let r=A.current;r?.setVolume(n.audioVolume),r&&r.start({muted:!t}).then(e=>{e&&t&&r.cue(`success`)}),v?.setup_complete?Ee(!1):v?Rp(`controller.ui.config.set`,{setup_complete:!0}).then(e=>{y(t=>t&&{...t,name:e.app_title,tagline:e.tagline,setup_complete:e.setup_complete,welcome_melody:e.welcome_melody})}).catch(e=>Zt(`warning`,`Setup state was not saved`,e instanceof Error?e.message:String(e))).finally(()=>Ee(!1)):Zt(`warning`,`Setup state is unavailable`,`The current host configuration has not loaded yet.`)},[e,!1,Zt,an,v?.setup_complete]),sn=(0,T.useCallback)(async e=>{let t=await Rp(`controller.ui.config.set`,{app_title:e.trim()});return y(e=>e&&{...e,name:t.app_title,tagline:t.tagline,setup_complete:t.setup_complete,welcome_melody:t.welcome_melody}),Zt(`success`,`Application title saved`,t.app_title),t.app_title},[Zt]),cn=(0,T.useCallback)(async e=>{await N(`buzzer path ${e}`,`Buzzer routing updated`),await Kt()},[Kt,N]),ln=(0,T.useCallback)(()=>{an({...e,audioMuted:!e.audioMuted})},[e,an]),un=(0,T.useCallback)(e=>{Dp(e),ze(e.trim()),Zt(`success`,e.trim()?`Session token applied`:`Session token cleared`),window.setTimeout(()=>location.reload(),180)},[Zt]);(0,T.useEffect)(()=>{I_(e);let t=matchMedia(`(prefers-color-scheme: light)`),n=()=>e.theme===`system`&&I_(e);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),(0,T.useEffect)(()=>{let e=V_();location.hash!==R_(e)&&history.replaceState(history.state,``,z_(e));let t=()=>{let e=V_();jt.current(e)};return window.addEventListener(`hashchange`,t),window.addEventListener(`popstate`,t),()=>{window.removeEventListener(`hashchange`,t),window.removeEventListener(`popstate`,t)}},[]),(0,T.useEffect)(()=>{let e=e=>{if(Te||ge)return;let t=e.isComposing||e.keyCode===229;if(oe){if(t)return;let n=E_.filter(e=>j(e.label).toLowerCase().includes(ce.toLowerCase()));if(e.key===`Escape`){e.preventDefault(),se(!1),le(``);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Home`||e.key===`End`){e.preventDefault(),fe(t=>!n.length||e.key===`Home`?0:e.key===`End`?n.length-1:(t+(e.key===`ArrowDown`?1:-1)+n.length)%n.length),A.current?.cue(`navigation`,e.key===`ArrowUp`?`up`:`down`);return}if(e.key===`Enter`&&n.length){e.preventDefault();let t=n[Math.min(ue,n.length-1)];P(t.id),se(!1),le(``),A.current?.cue(`select`);return}(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),se(!1));return}if(me){(e.key===`Escape`||e.key===`?`)&&(e.preventDefault(),he(!1));return}if(re.open)return;if(e.key===`Escape`&&o){e.preventDefault(),s(!1);return}if(Yp(e))return;if((e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`k`){e.preventDefault(),fe(0),se(!0);return}if(!e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key===`?`){e.preventDefault(),he(!0);return}if(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.key.toLowerCase()===`m`&&!e.repeat){e.preventDefault(),ln();return}let r=Qp(e),i=$p(e,n,document.documentElement.dir===`rtl`?`rtl`:`ltr`);if(r||i){e.preventDefault(),P(r??i),A.current?.cue(`navigation`,e.key.includes(`Left`)?`left`:e.key.includes(`Right`)?`right`:`forward`);return}let a=!e.altKey&&!e.ctrlKey&&!e.metaKey;if(a&&performance.now()<=gt.current){gt.current=0;let t=em(e.key);if(t){e.preventDefault(),P(t),A.current?.cue(`navigation`,`forward`);return}}a&&!e.shiftKey&&e.key.toLowerCase()===`g`&&!e.repeat&&(e.preventDefault(),gt.current=performance.now()+1400,A.current?.cue(`focus`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ge,Te,re.open,me,o,P,n,oe,ue,ce,j,ln]),(0,T.useEffect)(()=>{fe(0)},[ce]),(0,T.useEffect)(()=>{if(Te)return;let e=null,t=e=>e instanceof Element?e.closest(`button:not(:disabled), a[href], [role="button"]:not([aria-disabled="true"])`):null,n=n=>{let r=t(n.target);r&&r!==e&&(e=r,A.current?.cue(`focus`))},r=t=>{e&&!e.contains(t.relatedTarget)&&(e=null)},i=e=>{t(e.target)&&A.current?.cue(`select`)};return document.addEventListener(`focusin`,n),document.addEventListener(`pointerover`,n),document.addEventListener(`pointerout`,r),document.addEventListener(`click`,i),()=>{document.removeEventListener(`focusin`,n),document.removeEventListener(`pointerover`,n),document.removeEventListener(`pointerout`,r),document.removeEventListener(`click`,i)}},[Te]),(0,T.useEffect)(()=>{let e=new AbortController,t=Pm(Np,M_,{signal:e.signal,onError:e=>ee(`Host resource check: ${e instanceof Error?e.message:String(e)}`)}),n=Object.assign(()=>{},{updateStatusInterval:e=>void 0}),r=null;return(async()=>{try{Ne(42);let i=await Np(e.signal);if(M_(i))return;y(i),Gt(i.appearance,i.appearance_etag);let a=O_(i);Ee(a),ke(!0),Ne(70);let o=await Pp(e.signal);Pt.current=o,l(o),Fe(!0),o.have_status&&d([ig(o)]);let s=new Date(Date.now()-36e5).toISOString(),[c,u]=await Promise.allSettled([Rp(`controller.history.status`,{since:s},e.signal),Rp(`controller.history.timeline`,{since:s,limit:500},e.signal)]);if(c.status===`fulfilled`){let e=H_(c.value,o.hello);d(t=>[...e,...t].slice(-360))}if(u.status===`fulfilled`&&(p(Dm(u.value).slice(-500).reverse()),h(u.value.filter(kg).slice(-80).reverse())),Ne(92),a&&o.connected&&i.welcome_melody?.trim())try{await zp(`melody wait ${dm(i.welcome_melody.trim())}`,e.signal)}catch(e){ee(`Welcome melody unavailable: ${e instanceof Error?e.message:String(e)}`)}r=new rg(e=>{let t=Pt.current,n=sg(t,[],e);ee(n.detail),n.applied!==0&&(Pt.current=n.snapshot,l(n.snapshot),d(n=>sg(t,n,e).samples))}),n=Hp(i,{status:(e,t)=>{r?.enqueue(t.generation,e)},snapshot:(e,t)=>{let n=Pt.current,r=gg(n,e,{epoch:t.generation,instanceID:e.host_instance_id,authoritativeInstanceID:t.instanceID});Pt.current=r,l(r),d(e=>og(e,n,r))},event:(e,t)=>{let n=lg({epoch:Ft.current,instanceID:It.current},{epoch:t.generation,instanceID:t.instanceID});if(!n)return;Ft.current=n.epoch,It.current=n.instanceID??``;let r=e.kind.toLowerCase();r===`app.instance.changed`&&Rp(`controller.app.instances`).then(Ze).catch(()=>void 0);let a=kg(e);if(a&&h(t=>Ag(t,e)),vg(e)&&l(n=>{let r=yg(n,e,{epoch:t.generation,instanceID:t.instanceID});return Pt.current=r,r}),i.integrations?.buzzer_web_audio&&r===`buzzer.note`){let t=Number(e.metadata?.frequency_hz),n=Number(e.metadata?.duration_ms),r=e.metadata?.device_micros,i=r===void 0?void 0:Number(r),a=e.metadata?.[`bridge.ingress`]?`bridge:${e.metadata[`bridge.ingress`]}`:`local-board`,o=_t.current.plan({source:a,frequencyHz:t,durationMS:n,deviceMicros:i,generation:e.metadata?.connection_generation},performance.now());o?.stop?A.current?.stopTone(a,o.delayMS):o?.audible&&(A.current?.stopTone(a,o.delayMS),A.current?.playTone(t,o.durationMS,o.delayMS,a))}let o=Em(e);o&&p(t=>Om(t,e));let s=Ug(e,Ke,Lt.current);if(s){let{acknowledgement:e}=s;if(!s.duplicate){let{effect:e}=s;Bg(e,{replacePage:e=>{tn(e,`replace`),A.current?.cue(`navigation`,`forward`)},setTitle:ct,setProgress:dt})}qg(e,e=>Rp(`controller.app.action.ack`,e)).catch(e=>{let t=St.current.locale;Zt(`warning`,t===`fa`?`تأیید فرمان ارسال نشد`:`Action not confirmed`,e instanceof Error?e.message:String(e))})}if((o||vg(e)||a)&&yt.current?.publishControllerEvent(e),!e.metadata?.operation_id&&e.kind.toLowerCase()===`app.page`&&Zp(e.time)&&wh(e.metadata?.target_instance,Ke,`webui`)){let t=Xp(e.metadata?.page??e.metadata?.value??e.text);if(t){let n=e.metadata?.navigation_sync?.toLowerCase()===`group`,r=n?kt.current?at.acceptAction(e.metadata,t):null:t;r&&(tn(r,`replace`),n&&rt({state:`idle`,detail:``}),A.current?.cue(`navigation`,`forward`))}}if(J_(e,Et.current)&&(tn(`updates`,`replace`),A.current?.cue(`navigation`,`forward`)),!Qt(e)&&km(e,Ke)){let t=o_(e,St.current.locale);t?Xt(t):Zt(Q_(e),e.kind,e.text)}q_(e)&&(wt.current=!0),/config/i.test(e.kind)&&Kt().catch(()=>void 0),/device|connection|settings|illumination|^macro/i.test(e.kind)&&M()},state:(e,n,i)=>{if(i?.generation){if(!r?.adoptGeneration(i.generation))return;let e=lg({epoch:Ft.current,instanceID:It.current},{epoch:i.generation,instanceID:i.instanceID});if(!e)return;Ft.current=e.epoch,It.current=e.instanceID??``}if(t.state(e),x(e),ee(n??``),e===`open`){if(at.resetCoordinator(),At.current(!0),wt.current){wt.current=!1,window.location.reload();return}M()}else i?.generation&&r?.cancelPending(i.generation),l(t=>{let r=W_(t,e,n);return Pt.current=r,r})}}),bt.current=n,Ne(100)}catch(e){Fe(!0),Ee(!1),ke(!0),x(`waiting`),ee(e instanceof Error?e.message:String(e)),l(t=>{let n=W_(t,`waiting`,e instanceof Error?e.message:String(e));return Pt.current=n,n}),Ne(100)}})(),()=>{e.abort(),t.dispose(),r?.dispose(),bt.current===n&&(bt.current=null),n()}},[Gt,Ke,tn,!1,Xt,P,at,Zt,Qt,M,Kt,te,Le]),(0,T.useEffect)(()=>{if(!Pe||b===`open`)return;let e=!0,t=async()=>{try{let t=await Pp();if(!e)return;let n=Pt.current;Pt.current=t,l(t),d(e=>og(e,n,t))}catch{}};t();let n=window.setInterval(t,G_(v?.status_interval_ms));return()=>{e=!1,window.clearInterval(n)}},[!1,Pe,b,v?.status_interval_ms]);let dn=Fg({hostRequiresAuthentication:v?.auth_required===!0,streamState:b,token:Le,streamDetail:S,connectionReason:c.connection_reason}),fn=b===`open`&&c.connected&&c.have_status?`ready`:!Pe||b===`connecting`?`loading`:`unavailable`,pn={reduceMotion:e.reduceMotion,appTitle:Rt,snapshot:c,samples:u,events:f,macroEvents:m,locale:e.locale,t:j,command:N,refresh:M,openDialog:en,boardSettingsReadState:g,transport:{streamState:b,authenticationRequired:dn,boardState:fn,tabBusSupported:Be,tabPeers:Ue,statusIntervalMS:v?.status_interval_ms,measurementFreshnessMS:v?.measurement_freshness_ms},relayedTerminal:ft,broadcastTerminal:e=>{yt.current?.publishTerminal(e)}},mn=D_(n),hn=c.hardware_problems?.[0],gn=hn?Ig(hn,e.locale):void 0,_n=(0,U.jsx)(T.Suspense,{fallback:(0,U.jsxs)(`section`,{className:`page-loading`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`spinner`}),e.locale===`fa`?`در حال بارگیری…`:`Loading page…`]}),children:n===`settings`?(0,U.jsx)(mn,{...pn,appearance:e,onAppearance:an,token:Le,onToken:un,onAppTitle:sn,uiConfig:v,onMeasurementTiming:qt,onBuzzerPath:cn,navigationSync:Qe,navigationSyncStatus:tt,onNavigationSync:rn,appInstances:Ye}):(0,U.jsx)(mn,{...pn})}),vn=E_.find(e=>e.id===n)??E_[0],yn=E_.filter(e=>j(e.label).toLowerCase().includes(ce.toLowerCase())),bn=()=>{ae||(re.cancel?.(),ie(e=>({...e,open:!1})))},xn=async()=>{if(!re.action)ie(e=>({...e,open:!1}));else{E(!0);try{await re.action(),ie(e=>({...e,open:!1}))}catch{}finally{E(!1)}}},Sn=c.connected&&b===`open`?`good`:b===`connecting`?`info`:b===`open`?`neutral`:`warn`,F=K_(c,b,fn,e.locale),Cn=vm(c,e.locale),wn=mm(c),Tn=c.connected?[[`status`,`${c.port.name||(e.locale===`fa`?`کنترلر`:`Controller`)} · ${c.status_updated?um(e.locale,c.status_updated):j(`online`)}`],[`relay off`,c.status.active_relays?e.locale===`fa`?`${c.status.active_relays.toString(2).replace(/0/g,``).length} خروجی فعال`:`${c.status.active_relays.toString(2).replace(/0/g,``).length} active outputs`:e.locale===`fa`?`همهٔ خروجی‌ها آزادند`:`All outputs released`],[`rf list`,e.locale===`fa`?`فهرست رادیویی کنترلر`:`Controller radio inventory`],[`macro list`,e.locale===`fa`?`فهرست ماکروهای کنترلر`:`Controller macro inventory`]]:[[`ports`,c.connection_reason||(e.locale===`fa`?`جستجوی درگاه‌های سریال موجود`:`Discover available serial ports`)],[`hotkeys status`,e.locale===`fa`?`سرویس میان‌برهای سراسری`:`Global shortcut service`],[`os status`,e.locale===`fa`?`وضعیت سیستم‌عامل میزبان`:`Host operating-system state`]],En=e.locale===`fa`?`WS ${b===`open`?`باز`:b===`connecting`?`در حال اتصال`:b===`closed`?`بسته`:b} · ${sm(`fa`,Ue+1)} زبانه`:`WS ${b} · ${Ue+1} ${Ue===0?`tab`:`tabs`}`,Dn=X_(b,!1);return(0,U.jsxs)(uu,{reducedMotion:e.reduceMotion?`always`:`user`,children:[(0,U.jsxs)(`div`,{className:`app-shell${i?``:` is-sidebar-compact`}${Oe?``:` is-bootstrap-pending`}`,inert:!Oe||Te||me||ge?!0:void 0,"aria-hidden":!Oe||Te||me||ge?!0:void 0,children:[lt&&(0,U.jsx)(`div`,{className:`app-action-progress app-action-progress--${lt.state}`,role:`progressbar`,"aria-label":e.locale===`fa`?`پیشرفت فرمان راه دور`:`Remote action progress`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":lt.percent,children:(0,U.jsx)(`span`,{style:lt.percent===void 0?void 0:{width:`${lt.percent}%`}})}),(0,U.jsxs)(`aside`,{className:`sidebar`,"aria-label":j(`primaryNavigation`),children:[(0,U.jsxs)(`div`,{className:`brand`,children:[(0,U.jsx)(`a`,{className:`brand__mark`,href:`#/dashboard`,"aria-label":`${Rt} ${j(`dashboardLink`)}`,children:(0,U.jsx)(hf,{fallback:zt})}),(0,U.jsxs)(`a`,{className:`brand__copy`,href:`#/dashboard`,children:[(0,U.jsx)(`strong`,{children:Rt}),(0,U.jsx)(`span`,{children:Bt})]}),(0,U.jsx)(`button`,{className:`sidebar-toggle`,"aria-label":j(i?`collapseNavigation`:`expandNavigation`),title:j(i?`collapseNavigation`:`expandNavigation`),"aria-expanded":i,"aria-controls":`primary-navigation`,onClick:()=>a(e=>!e),children:i?(0,U.jsx)(He,{size:18}):(0,U.jsx)(We,{size:18})})]}),(0,U.jsxs)(`button`,{ref:Dt,type:`button`,className:`sidebar__status`,"aria-haspopup":`menu`,"aria-expanded":Se,"aria-disabled":!c.connected&&Cn.retryDisabled,"aria-label":c.connected?e.locale===`fa`?`منوی اتصال برد`:`Board connection menu`:e.locale===`fa`?`اتصال مجدد برد`:`Reconnect board`,title:`${c.connected?e.locale===`fa`?`برد آنلاین`:`Board online`:Cn.title} · ${Cn.candidate||c.connection_state}`,onClick:()=>{if(c.connected)Se?D(!1):Jt();else{if(D(!1),Cn.retryDisabled)return;N(`reconnect`)}},onContextMenu:e=>{e.preventDefault(),Jt(e.clientX,e.clientY)},onKeyDown:e=>{(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`)&&(e.preventDefault(),Jt())},children:[(0,U.jsx)(`span`,{className:`status-rail status-rail--${c.connected?`good`:Cn.tone}`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:c.connected?e.locale===`fa`?`برد آنلاین`:`Board online`:Cn.title}),(0,U.jsx)(`small`,{children:c.connected?c.port.name:Cn.timing||Cn.candidate||c.connection_state})]}),(0,U.jsx)(Ce,{size:18,"aria-hidden":`true`})]}),Se&&typeof document<`u`&&(0,Kd.createPortal)((0,U.jsxs)(`div`,{ref:Ot,className:`sidebar__status-menu`,role:`menu`,"aria-label":e.locale===`fa`?`عملیات اتصال برد`:`Board connection actions`,style:O,children:[(0,U.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:!c.connected&&Cn.retryDisabled,onClick:()=>{D(!1),N(`reconnect`)},children:c.connected?e.locale===`fa`?`اتصال مجدد`:`Reconnect`:Cn.action}),wn&&(0,U.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{D(!1),N(`reset lines`)},children:e.locale===`fa`?`بازنشانی سخت‌افزاری (DTR)`:`Hardware reset (DTR)`}),c.connected&&(0,U.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{D(!1),N(`close`)},children:e.locale===`fa`?`بستن درگاه`:`Close port`}),(0,U.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{D(!1),le(`ports`),fe(0),se(!0)},children:e.locale===`fa`?`انتخاب درگاه USB`:`Choose USB port`}),(0,U.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{D(!1),P(`device`)},children:e.locale===`fa`?`جزئیات دستگاه`:`Device details`})]}),document.body),(0,U.jsx)(`nav`,{className:`sidebar__nav`,id:`primary-navigation`,children:[`core`,`integrations`,`system`].map(e=>(0,U.jsxs)(`div`,{className:`nav-group`,children:[(0,U.jsx)(`span`,{className:`nav-group__label`,children:j(e===`core`?`system`:e===`integrations`?`integrations`:`operations`).toUpperCase()}),E_.filter(t=>t.group===e).map(e=>(0,U.jsx)(jf,{icon:e.icon,label:j(e.label),active:n===e.id,badge:e.id===`events`&&f.length?String(Math.min(f.length,99)):void 0,onClick:()=>P(e.id)},e.id))]},e))}),(0,U.jsxs)(`div`,{className:`sidebar__footer`,children:[(0,U.jsx)(Ce,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:F}),(0,U.jsx)(`span`,{children:En})]})]})]}),(0,U.jsxs)(`header`,{className:`topbar`,children:[(0,U.jsx)(`button`,{className:`mobile-menu`,"aria-label":j(`openNavigation`),onClick:()=>s(!0),children:(0,U.jsx)(Ie,{size:20})}),(0,U.jsxs)(`div`,{className:`breadcrumbs`,children:[(0,U.jsx)(`span`,{children:zt}),(0,U.jsx)(`i`,{children:`/`}),(0,U.jsx)(`strong`,{children:j(vn.label)})]}),(0,U.jsxs)(`button`,{className:`command-trigger`,"aria-keyshortcuts":pf(),onClick:()=>{fe(0),se(!0)},children:[(0,U.jsx)(Je,{size:16}),(0,U.jsx)(`span`,{children:j(`searchCommands`)}),(0,U.jsx)(_f,{keys:[ff(),`K`]})]}),(0,U.jsxs)(`div`,{className:`topbar__actions`,children:[!1,Dn?(0,U.jsx)(`button`,{className:`transport-reconnect`,title:S||void 0,"aria-label":e.locale===`fa`?`اتصال مجدد فوری میزبان`:`Reconnect host now`,onClick:()=>{Dn&&(ee(``),x(`connecting`),C(e=>e+1))},children:(0,U.jsx)(Sf,{tone:Sn,children:F})}):(0,U.jsx)(`span`,{title:S||void 0,children:(0,U.jsx)(Sf,{tone:Sn,pulse:b===`connecting`,children:F})}),(0,U.jsx)(`button`,{className:`topbar-icon`,"aria-label":e.locale===`fa`?`ترجیحات برنامه`:`Application preferences`,"aria-haspopup":`dialog`,"aria-expanded":ge,onClick:()=>ve(!0),children:(0,U.jsx)(Xe,{size:18})}),ye.theme&&(0,U.jsx)(`button`,{className:`topbar-icon`,"aria-label":j(`toggleTheme`),onClick:()=>an({...e,theme:document.documentElement.dataset.theme===`dark`?`light`:`dark`}),children:document.documentElement.dataset.theme===`dark`?(0,U.jsx)(et,{size:18}):(0,U.jsx)(Re,{size:18})}),ye.language&&(0,U.jsx)(`button`,{className:`topbar-icon`,"aria-label":j(`switchLanguage`),onClick:()=>an({...e,locale:e.locale===`en`?`fa`:`en`}),children:(0,U.jsx)(k,{size:18})}),ye.audio&&(0,U.jsx)(`button`,{className:`topbar-icon topbar-audio`,"aria-label":j(e.audioMuted?`enableAudio`:`muteAudio`),"aria-pressed":e.audioMuted,"aria-keyshortcuts":`M`,onClick:ln,children:e.audioMuted?(0,U.jsx)(it,{size:18}):(0,U.jsx)(ot,{size:18})}),ye.hotkeys&&(0,U.jsx)(`button`,{className:`topbar-icon topbar-hotkeys`,"aria-label":j(`keyboardShortcuts`),"aria-keyshortcuts":`?`,onClick:()=>he(!0),children:(0,U.jsx)(De,{size:18})}),ye.notifications&&(0,U.jsxs)(`button`,{className:`topbar-icon`,"aria-label":j(`notifications`),onClick:()=>P(`events`),children:[(0,U.jsx)(de,{size:18}),f.length>0&&(0,U.jsx)(`i`,{})]})]})]}),(0,U.jsxs)(`main`,{className:`app-main`,children:[n!==`dashboard`&&hn&&gn&&(0,U.jsxs)(`section`,{className:`hardware-alert app-hardware-alert is-${hn.severity}`,role:`alert`,"aria-live":`assertive`,children:[(0,U.jsx)(`div`,{className:`hardware-alert__icon`,children:(0,U.jsx)(nt,{size:24,"aria-hidden":`true`})}),(0,U.jsxs)(`div`,{className:`hardware-alert__copy`,children:[(0,U.jsx)(`strong`,{children:gn.title}),(0,U.jsx)(`p`,{children:gn.guidance}),gn.impact&&(0,U.jsx)(`p`,{className:`hardware-alert__impact`,children:gn.impact})]})]}),(0,U.jsx)(Pf,{pageKey:n,children:_n})]}),(0,U.jsx)(`nav`,{className:`mobile-bottom-nav`,"aria-label":j(`mobileNavigation`),children:E_.slice(0,5).map(e=>(0,U.jsxs)(`button`,{className:n===e.id?`is-active`:``,onClick:()=>P(e.id),children:[(0,U.jsx)(mf,{icon:e.icon,size:20}),(0,U.jsx)(`span`,{children:j(e.label)})]},e.id))}),(0,U.jsx)(W,{children:o&&(0,U.jsxs)(Jd.div,{className:`mobile-drawer-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,U.jsx)(`button`,{className:`mobile-drawer-backdrop`,"aria-label":j(`dismissNavigation`),onClick:()=>s(!1)}),(0,U.jsxs)(Jd.aside,{className:`mobile-drawer`,initial:{x:Ht,opacity:0},animate:{x:0,opacity:1},exit:{x:Ht,opacity:0},transition:{duration:.32,ease:[.22,1,.36,1]},children:[(0,U.jsxs)(`header`,{children:[(0,U.jsx)(`div`,{className:`brand__mark`,children:(0,U.jsx)(hf,{fallback:zt})}),(0,U.jsx)(`strong`,{children:Rt}),(0,U.jsx)(`button`,{type:`button`,"aria-label":j(`closeNavigation`),onClick:()=>s(!1),children:(0,U.jsx)(ut,{size:19})})]}),E_.map(e=>(0,U.jsx)(jf,{icon:e.icon,label:j(e.label),active:n===e.id,onClick:()=>P(e.id)},e.id))]})]})}),(0,U.jsx)(W,{children:oe&&(0,U.jsxs)(Jd.div,{className:`palette-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,U.jsx)(`button`,{className:`palette-backdrop`,"aria-label":j(`closeCommandPalette`),onClick:()=>{se(!1),le(``)}}),(0,U.jsxs)(Jd.section,{className:`palette`,role:`dialog`,"aria-modal":`true`,"aria-label":j(`commandPalette`),initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.99},transition:{duration:.2,ease:`easeOut`},children:[(0,U.jsxs)(`header`,{children:[(0,U.jsx)(xe,{size:19}),(0,U.jsx)(`input`,{autoFocus:!0,value:ce,placeholder:j(`commandPalettePlaceholder`),"aria-controls":`palette-results`,"aria-activedescendant":yn[ue]?`palette-page-${yn[ue].id}`:void 0,onChange:e=>le(e.target.value)}),(0,U.jsx)(_f,{keys:[`Esc`]})]}),(0,U.jsxs)(`div`,{className:`palette__results`,id:`palette-results`,role:`listbox`,"aria-label":j(`matchingPages`),children:[(0,U.jsx)(`span`,{className:`palette__label`,children:j(`pagesLabel`).toUpperCase()}),yn.map((t,r)=>(0,U.jsxs)(`button`,{id:`palette-page-${t.id}`,role:`option`,"aria-selected":r===ue,className:r===ue?`is-highlighted`:``,onPointerMove:()=>fe(r),onClick:()=>{P(t.id),se(!1),le(``)},children:[(0,U.jsx)(mf,{icon:t.icon,size:18}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:j(t.label)}),(0,U.jsx)(`small`,{children:n===t.id?e.locale===`fa`?`صفحه فعلی`:`Current page`:e.locale===`fa`?`باز کردن`:`Open`})]}),(0,U.jsx)(_e,{className:n===t.id?`is-visible`:``,size:16})]},t.id)),(0,U.jsx)(`span`,{className:`palette__label`,children:j(`quickCommandsLabel`).toUpperCase()}),Tn.filter(([e,t])=>`${e} ${t}`.toLowerCase().includes(ce.toLowerCase())).map(([e,t])=>(0,U.jsxs)(`button`,{role:`option`,"aria-selected":`false`,onClick:()=>{N(e),se(!1)},children:[(0,U.jsx)(pe,{size:18}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{dir:`ltr`,children:e}),(0,U.jsx)(`small`,{children:t})]})]},e))]}),(0,U.jsxs)(`footer`,{children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(_f,{keys:[[`↑`,`↓`]]}),` `,j(`navigate`)]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(_f,{keys:[`Enter`]}),` `,j(`select`)]}),(0,U.jsxs)(`span`,{children:[yn.length+Tn.length,` `,j(`actions`),` · WS `,b]})]})]})]})}),(0,U.jsx)(Lf,{state:{...re,action:xn},onClose:bn,busy:ae}),(0,U.jsx)(Rf,{messages:ne,dismiss:e=>w(t=>t.filter(t=>t.id!==e))})]}),(0,U.jsx)(Jg,{open:ge,locale:e.locale,appearance:e,quickHeader:ye,onAppearance:an,onQuickHeader:Wt,onClose:()=>ve(!1)}),(0,U.jsx)(Ff,{open:Oe&&Te,progress:Ae,locale:e.locale,productTitle:Rt,productShortName:zt,productTagline:Bt,onEnter:on}),(0,U.jsx)(If,{open:me,locale:e.locale,onClose:()=>he(!1)})]})}function Q_(e){let t=e.kind.toLowerCase();return/error|fault|hot/.test(t)?`danger`:/warning|door|disconnect/.test(t)?`warning`:/connect|ready|complete/.test(t)?`success`:`info`}var $_=class{suppressUntil=new WeakMap;begin(e,t,n,r=Date.now()){return t!==`touch`||!n?!1:(this.suppressUntil.set(e,r+800),!0)}shouldSuppressNativeClick(e,t,n=Date.now()){return t===0||n>(this.suppressUntil.get(e)??0)?!1:(this.suppressUntil.delete(e),!0)}};function ev(e){return e instanceof Element?e.closest(`button, [role="button"], [role="switch"], input[type="checkbox"]`)||(e.closest(`label`)?.querySelector(`input[type="checkbox"]`)??null):null}function tv(e){return!e.matches(`:disabled, [aria-disabled="true"]`)&&!e.closest(`[data-touch-mode="hold"], [data-touch-mode="deferred"]`)}function nv(e=document){let t=new $_,n=new WeakSet,r=e=>{let r=ev(e.target);if(r&&tv(r)&&t.begin(r,e.pointerType,e.isPrimary)){e.preventDefault();try{r.focus({preventScroll:!0})}catch{r.focus()}n.add(r),r.click(),n.delete(r)}},i=e=>{let r=ev(e.target);r&&!n.has(r)&&t.shouldSuppressNativeClick(r,e.detail)&&(e.preventDefault(),e.stopImmediatePropagation())};return e.addEventListener(`pointerdown`,r,!0),e.addEventListener(`click`,i,!0),()=>{e.removeEventListener(`pointerdown`,r,!0),e.removeEventListener(`click`,i,!0)}}var rv=document.getElementById(`root`);if(!rv)throw Error(`Controller UI root is missing`);(0,qd.createRoot)(rv).render((0,U.jsx)(T.StrictMode,{children:(0,U.jsx)(Z_,{})}));var iv=nv();window.addEventListener(`pagehide`,iv,{once:!0}),window.requestAnimationFrame(()=>document.getElementById(`startup-preloader`)?.remove()),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/service-worker.js`,{scope:`/`}).catch(()=>void 0)},{once:!0});export{Sf as $,Zf as A,o as At,Yf as B,Up as C,_e as Ct,ip as D,E as Dt,gp as E,se as Et,Hf as F,yf as G,bf as H,rp as I,wf as J,mf as K,np as L,Jf as M,l as Mt,Gf as N,Q as O,h as Ot,Xf as P,Df as Q,Wf as R,Ep as S,ye as St,Rp as T,le as Tt,Af as U,vf as V,kf as W,gf as X,Ef as Y,xf as Z,lm as _,k as _t,Mg as a,ut as at,Tp as b,O as bt,tg as c,nt as ct,fm as d,Je as dt,Of as et,pm as f,Ke as ft,cm as g,Ae as gt,om as h,Me as ht,Ig as i,ft as it,Kf as j,s as jt,Uf as k,d as kt,vm as l,et as lt,um as m,Pe as mt,c_ as n,Jd as nt,jg as o,ot,dm as p,Re as pt,_f as q,s_ as r,W as rt,wg as s,it as st,__ as t,Tf as tt,mm as u,Xe as ut,am as v,De as vt,kp as w,pe as wt,Gp as x,Ce as xt,sm as y,Te as yt,qf as z}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/app-BxYXetji.js b/Tools/Controller/internal/webui/dist/assets/app-BxYXetji.js new file mode 100644 index 00000000..051071a9 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/app-BxYXetji.js @@ -0,0 +1,10 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunk-FwOzfXMP.js","assets/chunk-DIrhZHWK.js","assets/chunk-GmnEjCp4.js","assets/chunk-BgHNRN_V.js","assets/chunk-BT8krml-.js","assets/chunk-Dmz4i1nq.js","assets/chunk-DDsZ2KKt.js","assets/chunk-B5OrbcTy.js","assets/chunk-DXoxHaI-.js","assets/chunk-D1EF5rbN.js","assets/workbench-D1U8nUNX.css","assets/chunk-DBQKI-WA.js","assets/chunk-D02q3HLn.js","assets/chunk-CqZLUILw.js"])))=>i.map(i=>d[i]); +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function ee(){}var w={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return T(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function D(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function O(e,t){return typeof e==`object`&&e&&e.key!=null?D(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ee,ee):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+O(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,ee=5,w=-1;function te(){return g?!0:!(e.unstable_now()-wt&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(T)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,D=ne.port2;ne.port1.onmessage=T,E=function(){D.postMessage(null)}}else E=function(){_(T,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1we||(e.current=Ce[we],Ce[we]=null,we--)}function j(e,t){we++,Ce[we]=e.current,e.current=t}var De=Te(null),Oe=Te(null),ke=Te(null),Ae=Te(null);function je(e,t){switch(j(ke,t),j(Oe,e),j(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ee(De),j(De,e)}function Me(){Ee(De),Ee(Oe),Ee(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,j(Ae,e)),t=De.current;var n=dp(t,e.type);t!==n&&(j(Oe,e),j(De,n))}function Pe(e){Oe.current===e&&(Ee(De),Ee(Oe)),Ae.current===e&&(Ee(Ae),sh._currentValue=Se)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Le(n):``}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le(`Lazy`);case 13:return e.child!==t&&t!==null?Le(`Suspense Fallback`):Le(`Suspense`);case 19:return Le(`SuspenseList`);case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Le(`Activity`);case 30:return Le(`ViewTransition`);default:return``}}function Ve(e){try{var t=``,n=null;do t+=Be(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var He=Object.prototype.hasOwnProperty,Ue=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Ke=t.unstable_requestPaint,qe=t.unstable_now,Je=t.unstable_getCurrentPriorityLevel,Ye=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Qe=t.unstable_LowPriority,$e=t.unstable_IdlePriority,et=t.log,tt=t.unstable_setDisableYieldValue,nt=null,rt=null;function it(e){if(typeof et==`function`&&tt(e),rt&&typeof rt.setStrictMode==`function`)try{rt.setStrictMode(nt,e)}catch{}}var at=Math.clz32?Math.clz32:ct,ot=Math.log,st=Math.LN2;function ct(e){return e>>>=0,e===0?32:31-(ot(e)/st|0)|0}var lt=256,ut=262144,dt=4194304;function ft(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ft(n))):i=ft(o):i=ft(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ft(n))):i=ft(o)):i=ft(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ht(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function M(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!R&&vr(e,t)?(e=In(),Fn=Pn=Nn=null,br=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=An&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Ur($r,r)||($r=r,r=Yf(Qr,`onSelect`),0>=o,i-=o,Zi=1<<32-at(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&$i(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&$i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&$i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ne:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===de&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Ri(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case de:return o=no(o),_(e,r,o,c)}if(xe(o))return h(e,r,o,c);if(ve(o)){if(l=ve(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===oe)return _(e,r,Da(e,o),c);uo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function bo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xt(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:ho=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),cd|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=k.T,s={};s.types=o===null?null:o.types,k.T=s,fc(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Wa(c,r),Md(e)):dc(e,t,r,Md(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},Md())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,Se,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Se,baseState:Se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:Se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},Md())}function ac(){return Ea(sh)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Md();e=vo(n);var r=yo(t,e,n);r!==null&&(Fd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=Md();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Di(e,t,n,r),n!==null&&(Fd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,Md())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),G===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Fd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Ff(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Fd(t,e,2)}function pc(e){var t=e.alternate;return e===B||t!==null&&t===B}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xt(e,n)}}var gc={readContext:Ea,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Ea,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){it(!0);try{n(t)}finally{it(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,B,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=ss();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),G===null)throw Error(i(349));q&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=G.identifierPrefix;if(z){var n=Qi,r=Zi;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[N]=t,o[Ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch($(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return H(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ke.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[N]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[N]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[N]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[N]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),H(t),null);case 4:return Me(),e===null&&Gf(t.stateNode.containerInfo),t.flags|=67108864,H(t),null;case 10:return ba(t.type),H(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return H(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Bo(t,zo.current&1|2),z&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&qe()>_d&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return H(t),null}else 2*qe()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=qe(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Bo(t,o):(n=o,j(Mo,t),j(zo,n),No===null&&(No=t)),z&&$i(t,r.treeForkCount),e}return H(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ee(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),H(t),null;case 25:return null;case 30:return t.flags|=33554432,H(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&Ee(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(na(t),t.tag){case 3:ba(Ma),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&Ee(Ka);break;case 24:ba(Ma)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){X(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){X(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){X(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){X(e,e.return,t)}}}function El(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){X(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){X(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){X(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){X(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),$(r,t,n),r[N]=e,Bt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,k.T=null,n=Td,Td=null;var o=xd,s=Cd;if(bd=0,Sd=xd=null,Cd=0,W&6)throw Error(i(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,Of(0,!1),rt&&typeof rt.onPostCommitFiberRoot==`function`)try{rt.onPostCommitFiberRoot(nt,o)}catch{}return!0}finally{A.p=a,k.T=r,df(e,t)}}function mf(e,t,n){t=Ui(n,t),t=Ac(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(M(e,2),Df(e))}function X(e,t,n){if(e.tag===3)mf(e,e,n);else for(;t!==null;){if(t.tag===3){mf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Ui(n,e),n=jc(2),r=yo(t,n,2),r!==null&&(Mc(n,r,t,e),M(r,2),Df(r));break}}t=t.return}}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=gf.bind(null,e,t,n),t.then(e,e))}function gf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,G===e&&(q&n)===n&&(sd===4||sd===3&&(q&62914560)===q&&300>qe()-hd?W&2?Y|=n:Hd(e,0):Y|=n,dd===q&&(dd=0)),Df(e)}function _f(e,t){t===0&&(t=_t()),e=Oi(e,t),e!==null&&(M(e,t),Df(e))}function vf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_f(e,n)}function yf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),_f(e,n)}function bf(e,t){return Ue(e,t)}var xf=null,Sf=null,Cf=!1,wf=!1,Tf=!1,Ef=0;function Df(e){e!==Sf&&e.next===null&&(Sf===null?xf=Sf=e:Sf=Sf.next=e),wf=!0,Cf||(Cf=!0,Pf())}function Of(e,t){if(!Tf&&wf){Tf=!0;do for(var n=!1,r=xf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-at(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=q,a=pt(r,r===G?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||mt(r,a)||(n=!0,Nf(r,a))}r=r.next}while(n);Tf=!1}}function kf(){Af()}function Af(){wf=Cf=!1;var e=0;Ef!==0&&hp()&&(e=Ef);for(var t=qe(),n=null,r=xf;r!==null;){var i=r.next,a=jf(r,t);a===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&(Sf=n)):(n=r,(e!==0||a&3)&&(wf=!0)),r=i}bd!==0&&bd!==5||Of(e,!1),Ef!==0&&(Ef=0)}function jf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),$(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);$(o,`link`,e),t===`style`&&(o[Ft]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),$(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=zt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Bt(c),$(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=zt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Bt(a),$(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=zt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Bt(a),$(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=ke.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=zt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=zt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=zt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+sn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ft]){r.loading=1;return}}else t=e.createElement(`link`),t[Ft]=!0,t.onload=t.onerror=Vt.bind(null,t),$(t,`link`,n),Bt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+sn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,Bt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Bt(r),$(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),$(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Bt(a),a):(r=n,(a=vm.get(o))&&(r=T({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Bt(a),$(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),$(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function y(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:v(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var b=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ee(e){return e!=null}function w(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??C.width,a=e.size??e.height??C.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?S(...c):S(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??C[`stroke-width`])*Number(e.size??e.width??C.width)/Number(t.size??t.width??C.width):t.strokeWidth??C[`stroke-width`];return[`svg`,{...Object.entries(C).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ee(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ee(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ee(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function te(e,t={}){return w(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=l(d(),1),ne=(0,E.createContext)({}),D=()=>(0,E.useContext)(ne),re=(0,E.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=D()??{},y=!!c||T(d),[b,x,C=[]]=te(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:S(v,s),hasA11yProp:y,attributes:d});return(0,E.createElement)(b,{ref:f,...x},[...C.map(([e,t])=>(0,E.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function O(e,t=[],n=[]){let r=typeof e==`string`?y(e,t,n):e,i=(0,E.forwardRef)(({className:e,...t},n)=>(0,E.createElement)(re,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=x(r.name)),i}var ie={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};ie.node;var ae=O(ie),oe={name:`audio-lines`,size:24,node:[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]};oe.node;var se=O(oe),ce={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};ce.node;var le=O(ce),ue={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};ue.node;var de=O(ue),fe={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};fe.node;var pe=O(fe),me={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};me.node;var he=O(me),ge={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};ge.node;var _e=O(ge),ve={name:`command`,size:24,node:[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]};ve.node;var ye=O(ve),be={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};be.node;var xe=O(be),k={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};k.node;var A=O(k),Se={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Se.node;var Ce=O(Se),we={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};we.node;var Te=O(we),Ee={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};Ee.node;var j=O(Ee),De={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};De.node;var Oe=O(De),ke={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};ke.node;var Ae=O(ke),je={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};je.node;var Me=O(je),Ne={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Ne.node;var Pe=O(Ne),Fe={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Fe.node;var Ie=O(Fe),Le={name:`package-open`,size:24,node:[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]};Le.node;var Re=O(Le),ze={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};ze.node;var Be=O(ze),Ve={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Ve.node;var He=O(Ve),Ue={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Ue.node;var We=O(Ue),Ge={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Ge.node;var Ke=O(Ge),qe={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};qe.node;var Je=O(qe),Ye={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ye.node;var Xe=O(Ye),Ze={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Ze.node;var Qe=O(Ze),$e={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};$e.node;var et=O($e),tt={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};tt.node;var nt=O(tt),rt={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};rt.node;var it=O(rt),at={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};at.node;var ot=O(at),st={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};st.node;var ct=O(st),lt=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ut=o(((e,t)=>{t.exports=lt()})),dt=(0,E.createContext)({});function ft(e){let t=(0,E.useRef)(null);return t.current===null&&(t.current=e()),t.current}var pt=typeof window<`u`?E.useLayoutEffect:E.useEffect,mt=(0,E.createContext)(null);function ht(e,t){e.indexOf(t)===-1&&e.push(t)}function gt(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var _t=(e,t,n)=>n>t?t:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),yt=e=>typeof e==`object`&&!!e,bt=e=>/^0[^.\s]+$/u.test(e);function xt(e){let t;return()=>(t===void 0&&(t=e()),t)}var St=e=>e,Ct=(...e)=>e.reduce((e,t)=>n=>t(e(n))),wt=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Tt=class{constructor(){this.subscriptions=[]}add(e){return ht(this.subscriptions,e),()=>this.remove(e)}remove(e){gt(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;ie*1e3,Dt=e=>e/1e3,N=(e,t)=>t?1e3/t*e:0,Ot=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function kt(e,t,n,r){return e===t&&n===r?St:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Ot(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Ot(s+1e-7,e,n)-i-r)}return Ot(s,t,r)}}var At=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,jt=e=>t=>1-e(1-t),Mt=kt(.33,1.53,.69,.99),Nt=jt(Mt),Pt=At(Nt),Ft=e=>e>=1?1:(e*=2)<1?.5*Nt(e):.5*(2-2**(-10*(e-1))),It=e=>1-Math.sin(Math.acos(e)),Lt=jt(It),Rt=At(It),P=kt(.42,0,1,1),zt=kt(0,0,.58,1),Bt=kt(.42,0,.58,1),Vt=e=>Array.isArray(e)&&typeof e[0]!=`number`,Ht=e=>Array.isArray(e)&&typeof e[0]==`number`,Ut={linear:St,easeIn:P,easeInOut:Bt,easeOut:zt,circIn:It,circInOut:Rt,circOut:Lt,backIn:Nt,backInOut:Pt,backOut:Mt,anticipate:Ft},Wt=e=>typeof e==`string`,Gt=e=>{if(Ht(e)){let[t,n,r,i]=e;return kt(t,n,r,i)}return Wt(e)?Ut[e]:e},Kt={delta:0,timestamp:0,isProcessing:!1},qt;function Jt(){qt=void 0}var Yt={now:()=>(qt===void 0&&Yt.set(Kt.isProcessing||vt.useManualTiming?Kt.timestamp:performance.now()),qt),set:e=>{qt=e,queueMicrotask(Jt)}},F=e=>Math.round(e*1e5)/1e5,Xt=e=>t=>typeof t==`string`&&t.startsWith(e),Zt=Xt(`--`),Qt=Xt(`var(--`),$t=e=>Qt(e)?en.test(e.split(`/*`)[0].trim()):!1,en=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tn(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var nn={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},rn={...nn,transform:e=>_t(0,1,e)},an={...nn,default:1},on=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function sn(e){return e==null}var cn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ln=(e,t)=>n=>!!(typeof n==`string`&&cn.test(n)&&n.startsWith(e)||t&&!sn(n)&&Object.prototype.hasOwnProperty.call(n,t)),un=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(on);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},dn=e=>_t(0,255,e),fn={...nn,transform:e=>Math.round(dn(e))},pn={test:ln(`rgb`,`red`),parse:un(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+fn.transform(e)+`, `+fn.transform(t)+`, `+fn.transform(n)+`, `+F(rn.transform(r))+`)`},mn=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function hn(e){let t=e.length>5?2:1,n=mn(e,3,t);return{red:parseInt(mn(e,0,t),16),green:parseInt(mn(e,1,t),16),blue:parseInt(mn(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var gn={test:ln(`#`),parse:hn,transform:pn.transform},_n=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vn=_n(`deg`),yn=_n(`%`),I=_n(`px`),bn=_n(`vh`),xn=_n(`vw`),Sn={...yn,parse:e=>yn.parse(e)/100,transform:e=>yn.transform(e*100)},Cn={test:ln(`hsl`,`hue`),parse:un(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+yn.transform(F(t))+`, `+yn.transform(F(n))+`, `+F(rn.transform(r))+`)`},wn={test:e=>pn.test(e)||gn.test(e)||Cn.test(e),parse:e=>pn.test(e)?pn.parse(e):Cn.test(e)?Cn.parse(e):gn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?pn.transform(e):Cn.transform(e),getAnimatableNone:e=>{let t=wn.parse(e);return t.alpha=0,wn.transform(t)}},Tn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,En=new RegExp(on.source),Dn=new RegExp(Tn.source,`i`);function On(e){return isNaN(e)&&typeof e==`string`&&(En.test(e)||Dn.test(e))}var kn=`number`,An=`color`,jn=`var`,Mn=`var(`,Nn="${}",Pn=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Fn(e){let t=e.toString();return En.test(t)||Dn.test(t)}function In(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Pn,e=>(wn.test(e)?(r.color.push(a),i.push(An),n.push(wn.parse(e))):e.startsWith(Mn)?(r.var.push(a),i.push(jn),n.push(e)):(r.number.push(a),i.push(kn),n.push(parseFloat(e))),++a,Nn)).split(Nn),indexes:r,types:i}}function Ln(e){return In(e).values}function Rn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;atypeof e==`number`?0:wn.test(e)?wn.getAnimatableNone(e):e,Vn=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Bn(e);function Hn(e){let t=In(e);return Rn(t)(t.values.map((e,n)=>Vn(e,t.split[n])))}var Un={test:On,parse:Ln,createTransformer:zn,getAnimatableNone:Hn};function Wn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Gn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Wn(s,r,e+1/3),a=Wn(s,r,e),o=Wn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Kn(e,t){return n=>n>0?t:e}var L=(e,t,n)=>e+(t-e)*n,qn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Jn=[gn,pn,Cn],Yn=e=>Jn.find(t=>t.test(e));function Xn(e){let t=Yn(e);if(!t)return!1;let n=t.parse(e);return t===Cn&&(n=Gn(n)),n}var Zn=(e,t)=>{let n=Xn(e),r=Xn(t);if(!n||!r)return Kn(e,t);let i={...n};return e=>(i.red=qn(n.red,r.red,e),i.green=qn(n.green,r.green,e),i.blue=qn(n.blue,r.blue,e),i.alpha=L(n.alpha,r.alpha,e),pn.transform(i))},Qn=new Set([`none`,`hidden`]);function $n(e,t){return Qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function er(e,t){return n=>L(e,t,n)}function tr(e){return typeof e==`number`?er:typeof e==`string`?$t(e)?Kn:wn.test(e)?Zn:ar:Array.isArray(e)?nr:typeof e==`object`?wn.test(e)?Zn:rr:Kn}function nr(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>tr(e)(e,t[n]));return e=>{for(let t=0;t{for(let t in r)n[t]=r[t](e);return n}}function ir(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i{let n=In(e),r=In(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Qn.has(e)&&!r.values.length||Qn.has(t)&&!n.values.length?$n(e,t):Ct(nr(ir(n,r),r.values),Rn(r)):Kn(e,t)},or=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function sr(e,t){let n=or.exec(e);if(!n)return;let r=or.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>F(L(a,o,e))+i}function cr(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return L(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=sr(e,t);if(n)return n}return tr(e)(e,t)}var lr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ur(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var dr=40;function fr(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=lr.reduce((e,t)=>(e[t]=ur(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=vt.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,dr),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:lr.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>R.update(t,e),stop:()=>pr(t),now:()=>Kt.isProcessing?Kt.timestamp:Yt.now()}},gr=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t=n?1/0:i}function yr(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(vr(o),_r);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:Dt(s)}}var br=100,xr=10,Sr=1,Cr=800,wr=.3,Tr=.3,Er=.01,Dr=2,Or=.005,kr=.5,Ar=.01,jr=10,Mr=.05,Nr=e=>e<0?1/Math.max(1+e,Mr):Math.max(1-e,Mr);function Pr(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Lr(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Fr(e,t){return e*Math.sqrt(1-t*t)}var Ir=12;function Lr(e,t,n){let r=n;for(let n=1;n{let n=t*i,r=n*e,a=Fr(t,i),o=Math.exp(-r);return Rr-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Fr(t*t,i);return(-n(t)+Rr>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Lr(n,r,a),s=o*Pr(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Et(e)}}var Br=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Vr(e,t){if(Br(e,t))return e}function Hr(e){let t=Vr(e.stiffness),n=Vr(e.damping,!0),r=Vr(e.mass),i={...e,stiffness:t??br,damping:n??xr,mass:r??Sr,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Nr(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Pr(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,zr(i)),i.isResolvedFromDuration=!0;Br(i.stiffness)&&Br(i.damping,!0)||(i.stiffness=br,i.damping=xr)}return i}function Ur(e=Tr,t=wr){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Hr({...n}),f=e=>d?0:-Dt(e),p=s/(2*Math.sqrt(o*c)),m=Dt(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Er:Dr),g.restDelta=n.restDelta||(e?Or:kr)};_();let v,y,b;if(p<1){let e=Fr(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Et(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Et(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(vr(S),_r),t=gr(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var Wr=Object.assign(Ur,{applyToOptions:e=>{let t=yr(e,100,Ur);return e.ease=t.ease,e.duration=Et(t.duration),e.type=`keyframes`,e}});function Gr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>ec,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Wr({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Kr(e,t,n){let r=[],i=n||vt.mix||cr,a=e.length-1;for(let n=0;nt[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Kr(t,r,i),c=s.length,l=n=>{if(o&&n1)for(;rl(_t(e[0],e[a-1],t)):l}function Jr(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=wt(0,t,r);e.push(L(n,1,i))}}function Yr(e){let t=[0];return Jr(t,e.length-1),t}function Xr(e,t){return e.map(e=>e*t)}function Zr(e,t){return e.map(()=>t||Bt).splice(0,e.length-1)}function Qr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Vt(r)?r.map(Gt):Gt(r)||Bt,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(vt.mix||cr)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?_t(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=qr(Xr(n&&n.length===t.length?n:Yr(t),e),t,{ease:Array.isArray(i)?i:Zr(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var $r=5;function ei(e,t,n){let r=Math.max(t-$r,0);return N(n-e(r),t-r)}function ti(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):ei(t=>e.next(t).value,t,e.next(t).value)}var ni=e=>e!==null;function ri(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(ni),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var ii={decay:Gr,inertia:Gr,tween:Qr,keyframes:Qr,spring:Wr};function ai(e){typeof e.type==`string`&&(e.type=ii[e.type])}var oi=40,si=(e,t)=>t-e>oi&&!vt.useManualTiming?t:e;function ci(e,t){return{kind:e,animation:t,timestamp:Yt.now(),frameTimestamp:Kt.timestamp,frameIsProcessing:Kt.isProcessing}}function li(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...ci(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function ui(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...ci(`layout-animation-start`,e),node:t})}catch{}}var di=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},fi=e=>e/100,pi=e=>Math.round(e*1e4)/1e4,mi=class extends di{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Yt.now()&&this.tick(Yt.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),li(this,this.options)}initAnimation(){let{options:e}=this;ai(e);let{type:t=Qr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Qr;s!==Qr&&typeof o[0]!=`number`&&(this.mixKeyframes=Ct(fi,cr(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=vr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=si(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==Gr&&(f.value=ri(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??pi((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==Gr?ri(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=_t(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return Dt(this.calculatedDuration)}get iterationDuration(){return this.duration+Dt(this.options.delay??0)}get time(){return Dt(this.currentTime)}set time(e){e=Et(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return ti(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Yt.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Dt(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=hr,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Yt.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},hi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function gi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(on)||[];if(!r)return e;let i=n.replace(r,``),a=+!!hi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var _i=/\b([a-z-]*)\(.*?\)/gu,vi={...Un,getAnimatableNone:e=>{let t=e.match(_i);return t?t.map(gi).join(` `):e}},yi={...Un,getAnimatableNone:e=>{let t=Un.parse(e);return Un.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},bi={...nn,transform:Math.round},xi={rotate:vn,pathRotation:vn,rotateX:vn,rotateY:vn,rotateZ:vn,scale:an,scaleX:an,scaleY:an,scaleZ:an,skew:vn,skewX:vn,skewY:vn,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:rn,originX:Sn,originY:Sn,originZ:I},Si={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,inset:I,insetBlock:I,insetBlockStart:I,insetBlockEnd:I,insetInline:I,insetInlineStart:I,insetInlineEnd:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockStart:I,paddingBlockEnd:I,paddingInline:I,paddingInlineStart:I,paddingInlineEnd:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockStart:I,marginBlockEnd:I,marginInline:I,marginInlineStart:I,marginInlineEnd:I,fontSize:I,backgroundPositionX:I,backgroundPositionY:I,...xi,zIndex:bi,fillOpacity:rn,strokeOpacity:rn,numOctaves:bi},Ci={...Si,color:wn,backgroundColor:wn,outlineColor:wn,fill:wn,stroke:wn,borderColor:wn,borderTopColor:wn,borderRightColor:wn,borderBottomColor:wn,borderLeftColor:wn,filter:vi,WebkitFilter:vi,mask:yi,WebkitMask:yi},wi=e=>Ci[e],Ti=new Set([vi,yi]);function Ei(e,t){let n=wi(e);return Ti.has(n)||(n=Un),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function Di(e){for(let t=1;te*180/Math.PI,ki=e=>ji(Oi(Math.atan2(e[1],e[0]))),Ai={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ki,rotateZ:ki,skewX:e=>Oi(Math.atan(e[1])),skewY:e=>Oi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ji=e=>(e%=360,e<0&&(e+=360),e),Mi=ki,Ni=e=>Math.hypot(e[0],e[1]),Pi=e=>Math.hypot(e[4],e[5]),Fi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ni,scaleY:Pi,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(Ni(e)+Pi(e))/2,rotateX:e=>ji(Oi(Math.atan2(e[6],e[5]))),rotateY:e=>ji(Oi(Math.atan2(-e[2],e[0]))),rotateZ:Mi,rotate:Mi,skewX:e=>Oi(Math.atan(e[4])),skewY:e=>Oi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ii(e){return+!!e.includes(`scale`)}function Li(e,t){if(!e||e===`none`)return Ii(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return Ii(t);let r=(n[1]?Fi:Ai)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var Ri=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Li(n,t)},zi=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Bi=new Set([...zi,`pathRotation`]),Vi=e=>e===nn||e===I,Hi=new Set([`x`,`y`,`z`]),Ui=zi.filter(e=>!Hi.has(e));function Wi(e){let t=[];return Ui.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Gi=new Set([`bottom`,`right`]);function Ki(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var qi=({transform:e})=>Li(e,`x`),Ji=({transform:e})=>Li(e,`y`),Yi={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ki(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ki(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:qi,y:Ji,translateX:qi,translateY:Ji},Xi=new Set,Zi=!1,Qi=!1,$i=!1;function ea(){if(Qi){let e=[],t=new Set,n=new Set;Xi.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Gi.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Wi(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Qi=!1,Zi=!1,Xi.forEach(e=>e.complete($i)),Xi.clear()}function ta(){Xi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Qi=!0)})}function na(){$i=!0,ta(),ea(),$i=!1}function ra(e,t,n){if(typeof e==`string`){if(M(e)||bt(e))return parseFloat(e);if(!Un.test(e)&&Un.test(n))return Ei(t,n)}return e??void 0}var ia=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Xi.add(this),Zi||(Zi=!0,R.read(ta),R.resolveKeyframes(ea))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=ra(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Di(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Xi.delete(this)}cancel(){this.state===`scheduled`&&(Xi.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},aa=e=>e.startsWith(`--`);function z(e,t,n){aa(t)?e.style.setProperty(t,n):e.style[t]=n}var oa={};function sa(e,t){let n=xt(e);return()=>oa[t]??n()}var ca=sa(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),la=sa(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),ua=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,da={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:ua([0,.65,.55,1]),circOut:ua([.55,0,1,.45]),backIn:ua([.31,.01,.66,-.59]),backOut:ua([.33,1.53,.69,.99])};function fa(e,t){if(e)return typeof e==`function`?la()?gr(e,t):`ease-out`:Ht(e)?ua(e):Array.isArray(e)?e.map(e=>fa(e,t)||da.easeOut):da[e]}function pa(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=fa(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function ma(e){return typeof e==`function`&&`applyToOptions`in e}function ha({type:e,...t}){return ma(e)&&la()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var ga=class extends di{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=ha(e);this.animation=pa(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=ri(r,this.options,o,this.speed);this.updateMotionValue?.(e),z(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},li(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Dt(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Dt(e)}get time(){return Dt(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Et(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&ca()?(this.animation.timeline=e,t?.(this.animation),St):n(this)}},_a={anticipate:Ft,backInOut:Pt,circInOut:Rt};function va(e){return e in _a}function ya(e){typeof e.ease==`string`&&va(e.ease)&&(e.ease=_a[e.ease])}var ba=class extends ga{constructor(e){ya(e),ai(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(Yt.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new mi({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?_t(0,10,a):0,s=this.sample(a);n&&r&&z(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},xa=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Un.test(e)||e===`0`)&&!e.startsWith(`url(`));function Sa(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n!vt.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Aa(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(Ta.has(n)||Oa.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return ka()&&(Ta.has(n)||Oa.has(n)&&Da(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ja=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Ma={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Na=zi.length,Pa={},Fa=(e,t,n=ja(t,xi[e]))=>(Pa[e]||(Pa[e]=(Ma[e]||e)+`(`))+n+`)`,Ia=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function La(e,t,n){let r=``;for(let i=0;i/^(linear|ease(In|Out|InOut))$/.test(e),Ga=(e,t)=>e-t,Ka=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(L(e,t,i/n));return r},qa=e=>e.motionValue.owner,Ja=e=>Ra.get(e),Ya=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),Xa=({name:e,motionValue:t})=>e&&zi.includes(e)&&t?.owner?.current instanceof HTMLElement&&ka()&&la();function Za(e){let t=qa(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Ya(t,`transform`)||`none`)===`none`&&!Ya(t,`pathRotation`)&&!t.projection?.isProjecting()}var Qa=class extends mi{constructor(e){let t=qa(e).current,{driver:n=hr}=e,r,i=Za(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=Ja(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=Ja(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return Ja(qa(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(Yt.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=Ht(n)?ua(n):Wa(n)&&da[n];if(o&&!i&&!r&&e.length===2&&t===Qr&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Qr)===Qr?u||Yr(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?zi:a){let a=r.get(s),c=t===void 0?Ya(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&Ia(r,i)||(n+=Fa(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=Yt.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),D.schedule(!1)}),e.oncancel=()=>s.includes(r)&&D.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(za,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Ka(t,n,i).concat(r).sort(Ga),o=e=>wt(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*Ba>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=Ba)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=Ba)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=Ba))return`linear`;let l=[],u=(e,t=c(e))=>l.push(pi(t)+` `+pi(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?Ha:Va))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=Ka(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(Ga))e>c&&o(c,e,0),c=e;return i.sort(Ga)},ee=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},w=(e,t,n,r={fill:`both`},i,a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=a||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,i)),u={transform:l};return s||(u.offset=c.map(e=>wt(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,i)),u=null),y(u,{...r,duration:n-t,easing:s||`linear`})},te=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=zi.filter(t=>{if(r.has(t))return!0;let n=i[t]=Ya(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),v(!1);let m=!l&&ee(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(w(d,e,n,void 0,void 0,r),e-t,n-e)}else c>t&&(b(w(d,t,c),0,c-t),p.forEach(e=>e{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},E=()=>!n.size&&(u=!0,Ja(t)===D&&Ra.delete(t),D.isJS||v(),!0),ne=()=>{let t=Yt.now();if(D.isJS||(D.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=Ya(e,n.name),o.has(n)||(c=!0))}),D.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),E()))return;for(let e of n)if(!e.canAccelerate)return D.demote(!0);D.isJS&&(D.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!T(t)){if(a){if(t-f{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),D.isJS=!0,o=new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Ra.set(t,D),D}var eo=class extends di{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Yt.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||ia;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Yt.now();let u=Ca(e,i,a,o);u||((vt.instantAnimations||!s)&&l?.(ri(e,n,t)),e[0]=e[e.length-1],wa(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Aa(n),p=!f&&Xa(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=si(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new ba(n)}catch{m=new mi(n)}}else m=p?new Qa(n):new mi(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),na()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}};function to(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var no=30,ro=e=>!isNaN(parseFloat(e)),io={current:void 0},ao=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Yt.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Yt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ro(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Tt)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Tt,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){R.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){io.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=Yt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>no)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,no);return N(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function oo(e,t){return new ao(e,t)}function so(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function co(e,t){let n=e?.[t]??e?.default??e;return n===e?n:so(n,e)}var lo={type:`spring`,stiffness:500,damping:25,restSpeed:10},uo=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fo={type:`keyframes`,duration:.8},po={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},mo=(e,{keyframes:t})=>t.length>2?fo:Bi.has(e)?e.startsWith(`scale`)?uo(t[1]):lo:po,ho=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`]);function go(e){for(let t in e)if(!ho.has(t))return!0;return!1}var _o=(e,t,n,r={},i,a)=>o=>{let s=co(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Et(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};go(s)||Object.assign(u,mo(e,u)),u.duration&&=Et(u.duration),u.repeatDelay&&=Et(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(wa(u),u.delay===0&&(d=!0)),(vt.instantAnimations||vt.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,wa(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=ri(u.keyframes,s);if(e!==void 0){R.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new mi(u):new eo(u)},vo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yo(e){let t=vo.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function bo(e,t,n=1){let[r,i]=yo(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return M(e)?parseFloat(e):e}return $t(i)?bo(i,t,n+1):i}function xo(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function So(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...xo(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Co(e,t,n){return So(e.getProps(),t,n,e)}var wo=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,To=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...zi]),Eo=e=>Array.isArray(e);function Do(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,oo(n))}function Oo(e){return Eo(e)?e[e.length-1]||0:e}function ko(e,t){let{transitionEnd:n={},transition:r={},...i}=Co(e,t)||{};i={...i,...n};for(let t in i)Do(e,t,Oo(i[t]))}var Ao=e=>!!(e&&e.getVelocity);function jo(e){return!!(Ao(e)&&e.add)}function Mo(e,t){let n=e.getValue(`willChange`);if(jo(n))return n.add(t);if(!n&&vt.WillChange){let n=new vt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var No=`data-framer-appear-id`;function Po(e){return e.props[No]}var Fo=typeof window<`u`;function Io({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Lo(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?so(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Io(f,t))continue;let o={delay:n,...co(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){R.update(()=>r.set(i));continue}let p=!1;if(Fo&&window.MotionHandoffAnimation){let n=Po(e);if(n){let e=window.MotionHandoffAnimation(n,t,R);e!==null&&(o.startTime=e,p=!0)}}Mo(e,t);let m=l??e.shouldReduceMotion;r.start(_o(t,r,i,m&&To.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>R.update(()=>{o&&ko(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ro(e,t,n={}){let r=Co(e,t,wo(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Lo(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Ro(e,t,{...n,delay:r+(typeof o==`function`?0:o)+to(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function zo(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Ro(e,t,n))):typeof t==`string`?Ro(e,t,n):Promise.all(Lo(e,Co(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var Bo={test:e=>e===`auto`,parse:e=>e},Vo=e=>t=>t.test(e),Ho=[nn,I,yn,vn,xn,bn,Bo],Uo=e=>Ho.find(Vo(e));function B(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||bt(e)}var V=new Set([`auto`,`none`,`0`]);function Wo(e,t,n){let r=0,i;for(;re.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},Ko=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function qo(e){return yt(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Jo(e){return yt(e)&&`ownerSVGElement`in e}var Yo={};function Xo(e){return Yo.current?.add(e),e}var Zo=e=>Yo.current?Yo.current.bind(e):e;function Qo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Yo.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function $o(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function es(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Bi.has(e))o=!0;else if(Zt(e))i[e]=n;else{let t=ja(n,Si[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=La(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ts={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ns={offset:`strokeDashoffset`,array:`strokeDasharray`};function rs(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ts:ns;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var is=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function as(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(es(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of is)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&rs(d,i,a,o,!1)}function os({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ss({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cs(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ls(e){return e===void 0||e===1}function us({scale:e,scaleX:t,scaleY:n}){return!ls(e)||!ls(t)||!ls(n)}var ds=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function fs(e){return us(e)||ms(e)||ps(e)}function ps(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function ms(e){return hs(e.x)||hs(e.y)}function hs(e){return e&&e!==`0%`}function gs(e,t,n){return n+t*(e-n)}function _s(e,t,n,r,i){return i!==void 0&&(e=gs(e,i,r)),gs(e,n,r)+t}function vs(e,t=0,n=1,r,i){e.min=_s(e.min,t,n,r,i),e.max=_s(e.max,t,n,r,i)}function ys(e,{x:t,y:n}){vs(e.x,t.translate,t.scale,t.originPoint),vs(e.y,n.translate,n.scale,n.originPoint)}var bs=.999999999999,xs=1.0000000000001;function Ss(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;sbs&&(t.x=1),t.ybs&&(t.y=1)}function Cs(e,t){e.min+=t,e.max+=t}function ws(e,t,n,r,i=.5){vs(e,t,n,L(e.min,e.max,i),r)}function Ts(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Es(e,t,n){let r=n??e;ws(e.x,Ts(t.x,r.x),t.scaleX,t.scale,t.originX),ws(e.y,Ts(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ds(e,t){return os(cs(e.getBoundingClientRect(),t))}function Os(e,t,n){let r=Ds(e,n),{scroll:i}=t;return i&&(Cs(r.x,i.offset.x),Cs(r.y,i.offset.y)),r}var{schedule:ks,cancel:As}=fr(queueMicrotask,!1);function js(e,t,n){let r=Ao(e)?e:oo(e);return r.start(_o(``,r,t,n)),r.animation}var Ms={},Ns={value:null,addProjectionMetrics:null};function Ps(e,t){let n=Yt.now();e=Zo(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(pr(r),e(a-t))};return R.setup(r,!0),Xo(()=>pr(r))}function Fs(e){return Jo(e)&&e.tagName===`svg`}function Is(e){return Ao(e)?e.get():e}var Ls=e=>typeof e==`number`?e:parseFloat(e),Rs=Ko.length,zs=e=>typeof e==`number`||I.test(e);function Bs(e,t,n,r,i,a){i?(e.opacity=L(0,n.opacity??1,Hs(r)),e.opacityExit=L(t.opacity??1,0,Us(r))):a&&(e.opacity=L(t.opacity??1,n.opacity??1,r));for(let i=0;irt?1:n(wt(e,t,r))}function Gs(e,t){e.min=t.min,e.max=t.max}function Ks(e,t){Gs(e.x,t.x),Gs(e.y,t.y)}function qs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Js=.9999,Ys=1.0001,Xs=-.01,Zs=.01;function Qs(e){return e.max-e.min}function $s(e,t,n){return Math.abs(e-t)<=n}function ec(e,t,n,r=.5){e.origin=r,e.originPoint=L(t.min,t.max,e.origin),e.scale=Qs(n)/Qs(t),e.translate=L(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Js&&e.scale<=Ys||isNaN(e.scale))&&(e.scale=1),(e.translate>=Xs&&e.translate<=Zs||isNaN(e.translate))&&(e.translate=0)}function tc(e,t,n,r){ec(e.x,t.x,n.x,r?.originX),ec(e.y,t.y,n.y,r?.originY)}function nc(e,t,n,r=0){e.min=(r?L(n.min,n.max,r):n.min)+t.min,e.max=e.min+Qs(t)}function rc(e,t,n,r){nc(e.x,t.x,n.x,r?.x),nc(e.y,t.y,n.y,r?.y)}function ic(e,t,n,r=0){let i=r?L(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Qs(t)}function ac(e,t,n,r){ic(e.x,t.x,n.x,r?.x),ic(e.y,t.y,n.y,r?.y)}function oc(e,t,n,r,i){return e-=t,e=gs(e,1/n,r),i!==void 0&&(e=gs(e,1/i,r)),e}function sc(e,t=0,n=1,r=.5,i,a=e,o=e){if(yn.test(t)&&(t=parseFloat(t),t=L(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=L(a.min,a.max,r);e===a&&(s-=t),e.min=oc(e.min,t,n,s,i),e.max=oc(e.max,t,n,s,i)}function cc(e,t,[n,r,i],a,o){sc(e,t[n],t[r],t[i],t.scale,a,o)}var lc=[`x`,`scaleX`,`originX`],uc=[`y`,`scaleY`,`originY`];function dc(e,t,n,r){cc(e.x,t,lc,n?.x,r?.x),cc(e.y,t,uc,n?.y,r?.y)}var fc=()=>({translate:0,scale:1,origin:0,originPoint:0}),pc=()=>({x:fc(),y:fc()}),mc=()=>({min:0,max:0}),hc=()=>({x:mc(),y:mc()});function gc(e){return e.translate===0&&e.scale===1}function _c(e){return gc(e.x)&&gc(e.y)}function vc(e,t){return e.min===t.min&&e.max===t.max}function yc(e,t){return vc(e.x,t.x)&&vc(e.y,t.y)}function bc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function xc(e,t){return bc(e.x,t.x)&&bc(e.y,t.y)}function Sc(e){return Qs(e.x)/Qs(e.y)}function Cc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var wc=class{constructor(){this.members=[]}add(e){ht(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(gt(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(gt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Tc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ec={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(I.test(e))e=parseFloat(e);else return e}return`${Tc(e,t.target.x)}% ${Tc(e,t.target.y)}%`}},Dc={borderRadius:Object.assign({},Ec,{applyTo:Ko.slice()}),borderTopLeftRadius:Ec,borderTopRightRadius:Ec,borderBottomLeftRadius:Ec,borderBottomRightRadius:Ec,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Un.parse(e);if(i.length>5)return r;let a=Un.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=L(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Oc(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;ee.depth-t.depth,jc=class{constructor(){this.children=[],this.isDirty=!1}add(e){ht(this.children,e),this.isDirty=!0}remove(e){gt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ac),this.isDirty=!1,this.children.forEach(e)}},Mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Nc={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Pc=[`z`,`skew`,`skewZ`],Fc=1e3,Ic=0;function Lc(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Rc=e=>e.instance&&Ra.get(e.instance)?.demote()&&e.resetSkewAndRotation();function zc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Po(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,R,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&zc(r)}function Bc({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Ms,{...Dc,...Ms}),class{constructor(e={},n=t?.()){this.id=Ic++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ns.value&&(Nc.nodes=Nc.calculatedTargetDeltas=Nc.calculatedProjections=0),this.nodes.forEach(Uc),this.nodes.forEach(el),this.nodes.forEach(tl),this.nodes.forEach(Wc),Ns.addProjectionMetrics&&Ns.addProjectionMetrics(Nc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;R.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Ps(i,250),Mc.hasAnimatedSinceResize&&(Mc.hasAnimatedSinceResize=!1,this.nodes.forEach($c)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||sl,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!xc(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...co(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||$c(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,pr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(nl),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Rc(this),this.isLayoutDirty=!0;for(let e=0;ee.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,R.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){R.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Qs(this.snapshot.measuredBox.x)&&!Qs(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e{let n=t/1e3,r=p?.(n);rl(o.x,e.x,n),rl(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ac(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),al(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&yc(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=hc(),Ks(f,this.relativeTarget)),c&&(this.animationValues=a,Bs(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(pr(this.pendingAnimation),void 0),this.pendingAnimation=R.update(()=>{Mc.hasAnimatedSinceResize=!0,this.motionValue||=oo(0),this.motionValue.jump(0,!1),this.currentAnimation=js(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),ui(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Fc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&pl(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||hc(),fl(i.x,t.x,e.x),fl(i.y,t.y,e.y)}Ks(t,i),Es(t,r),tc(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new wc),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!ps(t))return;let n={};for(let t=0;te.currentAnimation?.stop()),this.root.nodes.forEach(Kc),this.root.sharedNodes.clear()}}}function Vc(e){e.updateLayout(),Yc(e)}function Hc(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)kc(e=>{let t=Qs(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Gs(r[e],a[e])}else pl(i,t.layoutBox,n)&&kc(t=>{let n=Qs(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=pc();tc(c,n,t.layoutBox);let l=pc();tc(l,a?e.applyTransform(r,!0):n,s);let u=!_c(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=hc();ac(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=hc();ac(l,n,i.layoutBox,s),a&&o(c,l),xc(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function Uc(e){Ns.value&&Nc.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Wc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gc(e){e.clearSnapshot()}function Kc(e){e.clearMeasurements()}function qc(e){e.isLayoutDirty=!0,e.updateLayout()}function Jc(e){e.isLayoutDirty=!1}function Yc(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;kc(e=>Cs(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Xc(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Zc(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Qc(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function $c(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function el(e){e.resolveTargetDelta()}function tl(e){e.calcProjection()}function nl(e){e.resetSkewAndRotation()}function rl(e,t,n){e.translate=L(t.translate,0,n),e.scale=L(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function il(e,t,n,r){e.min=L(t.min,n.min,r),e.max=L(t.max,n.max,r)}function al(e,t,n,r){il(e.x,t.x,n.x,r),il(e.y,t.y,n.y,r)}function ol(e){return e.animationValues?.opacityExit!==void 0}var sl={duration:.45,ease:[.4,0,.1,1]},cl=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ll=cl(`applewebkit/`)&&!cl(`chrome/`)?Math.round:St;function ul(e){e.min=ll(e.min),e.max=ll(e.max)}function dl(e){ul(e.x),ul(e.y)}function fl(e,t,n){e.max=Qs(n)+(e.min=t.min)}function pl(e,t,n){return e===`position`||e===`preserve-aspect`&&!$s(Sc(t),Sc(n),.2)}function ml(e){return e!==e.root&&e.scroll?.wasRoot}function hl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var gl=Bc({attachResizeListener:(e,t)=>hl(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),_l={current:void 0},vl=Bc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_l.current){let e=new gl({});e.mount(window),e.setOptions({layoutScroll:!0}),_l.current=e}return _l.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),yl=new WeakMap;function H(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function bl(e){return typeof e==`string`||Array.isArray(e)}var xl=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Sl=[`initial`].concat(xl);function Cl(e){if(H(e.animate))return!0;for(let t=0;tEl.current=e.matches;e.addEventListener(`change`,t),t()}else El.current=!1}}var Al=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],jl={};function Ml(e){jl=e}function Nl(){return jl}var Pl=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ia,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Yt.now();this.renderScheduledAtt.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Dl.current||kl(),this.shouldReduceMotion=El.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),pr(this.notifyUpdate),pr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&Ta.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new ga({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Et(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Bi.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&R.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Ra.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in jl){let t=jl[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):hc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Ra.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t{this.current&&(this.current.textContent=`${e}`)}))}};function Il(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Ll(e,{layout:t,layoutId:n}){return Bi.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ms[e]||e===`opacity`)}function Rl(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ao(r[t])||i&&Ao(i[t])||Ll(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function zl(e){return window.getComputedStyle(e)}var Bl=class extends Fl{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Il}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Bi.has(t))return this.projection?.isProjecting?Ii(t):Ri(e,t);{let n=zl(e),r=(Zt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ds(e,t)}build(e,t,n){es(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Rl(e,t,n)}},Vl=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Hl(e){return{point:{x:e.pageX,y:e.pageY}}}var Ul=e=>t=>Vl(t)&&e(t,Hl(t));function Wl(e,t,n,r){return hl(e,t,Ul(n),r)}var Gl=new WeakMap,Kl,ql=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Jo(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Jl=ql(`inline`,`width`,`offsetWidth`),Yl=ql(`block`,`height`,`offsetHeight`);function Xl({target:e,borderBoxSize:t}){Gl.get(e)?.forEach(n=>{n(e,{get width(){return Jl(e,t)},get height(){return Yl(e,t)}})})}function Zl(e){e.forEach(Xl)}function Ql(){typeof ResizeObserver<`u`&&(Kl=new ResizeObserver(Zl))}function $l(e,t){Kl||Ql();let n=Qo(e);return n.forEach(e=>{let n=Gl.get(e);n||(n=new Set,Gl.set(e,n)),n.add(t),Kl?.observe(e)}),()=>{n.forEach(e=>{let n=Gl.get(e);n?.delete(t),n?.size||Kl?.unobserve(e)})}}var eu=new Set,tu;function nu(){tu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};eu.forEach(t=>t(e))},window.addEventListener(`resize`,tu)}function ru(e){return eu.add(e),tu||nu(),()=>{eu.delete(e),!eu.size&&typeof tu==`function`&&(window.removeEventListener(`resize`,tu),tu=void 0)}}function iu(e,t){return Xo(typeof e==`function`?ru(e):$l(e,t))}var au=(e,t)=>Math.abs(e-t);function ou(e,t){let n=au(e.x,t.x),r=au(e.y,t.y);return Math.sqrt(n**2+r**2)}var U=new Set([`auto`,`scroll`]),su=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=lu(this.lastRawMoveEventInfo,this.transformPagePoint));let e=du(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=ou(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Yt.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=lu(t,this.transformPagePoint),this.hasPendingMove=!0,R.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=du(e.type===`pointercancel`?this.lastMoveEventInfo:lu(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Vl(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=lu(Hl(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:Yt.now()}];let{onSessionStart:l}=t;l&&l(e,du(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=Ct(Wl(this.contextWindow,`pointermove`,this.handlePointerMove,u),Wl(this.contextWindow,`pointerup`,this.handlePointerUp,u),Wl(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(U.has(e.overflowX)||U.has(e.overflowY))&&this.scrollPositions.set(t,cu(t)),t=t.parentElement}this.scrollPositions.set(window,cu(window)),this.removeScrollListeners=Ct(hl(window,`scroll`,this.onElementScroll,{capture:!0}),hl(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=cu(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),R.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),pr(this.updatePoint)}},cu=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function lu(e,t){return t?{point:t(e.point)}:e}function uu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function du({point:e},t){return{point:e,delta:uu(e,pu(t)),offset:uu(e,fu(t)),velocity:mu(t,.1)}}function fu(e){return e[0]}function pu(e){return e[e.length-1]}function mu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=pu(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Et(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Et(t)*2&&(r=e[1]);let a=Dt(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var hu=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function gu(e){return hu.has(e.tagName)||e.isContentEditable===!0}var _u=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function vu(e){return _u.has(e.tagName)||e.isContentEditable===!0}var yu={x:!1,y:!1};function bu(){return yu.x||yu.y}function xu(e){return e===`x`||e===`y`?yu[e]?null:(yu[e]=!0,()=>{yu[e]=!1}):yu.x||yu.y?null:(yu.x=yu.y=!0,()=>{yu.x=yu.y=!1})}function Su(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?L(n,e,r.max):Math.min(e,n)),e}function Cu(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function wu(e,{top:t,left:n,bottom:r,right:i}){return{x:Cu(e.x,n,i),y:Cu(e.y,t,r)}}function Tu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=wt(t.min,t.max-r,e.min):r>i&&(n=wt(e.min,e.max-i,t.min)),_t(0,1,n)}function Ou(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var ku=.35;function Au(e=ku){return e===!1?e=0:e===!0&&(e=ku),{x:ju(e,`left`,`right`),y:ju(e,`top`,`bottom`)}}function ju(e,t,n){return{min:Mu(e,t),max:Mu(e,n)}}function Mu(e,t){return typeof e==`number`?e:e[t]||0}function Nu(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Pu=new WeakMap,Fu=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=hc(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=xu(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),kc(e=>{let t=this.getAxisMotionValue(e).get()||0;if($t(t)&&(t=bo(t,this.visualElement.current)||0),I.test(t))t=parseFloat(t);else if(yn.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=Qs(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&R.update(()=>i(e,t),!1,!0),Mo(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Vu(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&R.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new su(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&R.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Bu(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Su(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Iu(e)?this.constraints&&this.scroll===Nu(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?wu(r.layoutBox,e):!1,this.elastic=Au(t),i!==this.constraints&&!Iu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&kc(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Ou(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Iu(e))return!1;let n=Lu(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Nu(r);let i=Os(n,r.root,this.visualElement.getTransformPagePoint()),a=Eu(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(ss(a));this.hasMutatedConstraints=!!e,e&&(a=os(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=kc(s=>{if(!Bu(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Mo(this.visualElement,e),n.start(_o(e,n,0,t,this.visualElement,!1))}stopAnimation(){kc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();kc(e=>{if(!Bu(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-L(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Iu(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};kc(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Du({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),kc(t=>{let n=this.getAxisMotionValue(t);if(!Bu(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(L(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Pu.set(this.visualElement,this);let e=this.visualElement.current,t=Wl(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&vu(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Iu(t)&&Lu(t);r&&(this.constraints=this.resolveRefConstraints(),n||=zu(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),R.read(r);let o=hl(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(kc(t=>{if(!Bu(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=ku,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Iu(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Lu=e=>`current`in e?e.current:e;function Ru(e){let t=!0;return()=>{t?t=!1:e()}}function zu(e,t,n){let r=iu(e,Ru(n)),i=iu(t,Ru(n));return()=>{r(),i()}}function Bu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Vu(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Hu(e,t){let n=Qo(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Xo(()=>r.abort())]}function Uu(e){return!(e.pointerType===`touch`||bu())}function Wu(e,t,n={}){t=Zo(t);let[r,i,a]=Hu(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Uu(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Gu=(e,t)=>t?e===t||Gu(e,t.parentElement):!1,Ku=new WeakSet;function qu(e){return t=>{t.key===`Enter`&&e(t)}}function Ju(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Yu=(e,t)=>{let n=!1,r=qu(()=>{Ku.has(e)||(n=!0,Ju(e,`down`))}),i=qu(()=>{n&&(n=!1,Ju(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&Ju(e,`cancel`)},{...t,once:!0})};function Xu(e){return Vl(e)&&!bu()}var Zu=new WeakSet;function Qu(e,t,n={}){t=Zo(t);let[r,i,a]=Hu(e,n),o=e=>{let r=e.currentTarget;if(!Xu(e)||Zu.has(e))return;Ku.add(r),n.stopPropagation&&Zu.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Ku.has(r)&&Ku.delete(r),Xu(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Gu(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),qo(e)&&(e.addEventListener(`focus`,()=>Yu(e,i),i),!gu(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var $u=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ed=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),td=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function W(e,t,n,r){Il(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(ed.has(n)?n:$o(n),t.attrs[n])}function G(e,t,n){let r=Rl(e,t,n);for(let n in e)if(n!==`children`&&(Ao(e[n])||Ao(t[n]))){let t=zi.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var K=class extends Fl{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=hc}getBaseTargetFromProps(e,t){return Bi.has(t)?super.getBaseTargetFromProps(e,t)??Ii(t):e[t]}getDefaultValue(e){return Bi.has(e)?this.latestValues[e]??Ii(e):void 0}readValueFromInstance(e,t){if(Bi.has(t)){let e=wi(t);return e&&e.default||0}if(is.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=ed.has(t)?t:$o(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return G(e,t,n)}build(e,t,n){as(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){W(e,t,n,r)}mount(e){this.isSVGTag=td(e.tagName),super.mount(e)}};function q(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;re?.out===!0?e:e?.out;function rd(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>zo(e,t,n))),n=ad(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Co(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&nd(f(l??(g&&g.props.initial))?.transition);if(J.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?bl(f)||f===!1?f:void 0:l,y=bl(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||H(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=id(i.prevProp,v),C=S||y&&(b&&!x||r>h),ee=!1,w=Array.isArray(v)?v:[v],te={},T;if(b!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Co(e,n,wo(e,t))||{};te={...te,...a,...i},T=nd(r)||T}let{prevResolvedValues:E}=i;for(let t in{...E,...te}){if(t in m)continue;let n=te[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!q(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(ee=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=te,i.prevOut=T,i.isActive&&(m={...m,...te}),C&&(!(x&&S)||ee))for(let n of w){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Co(s,n)?.transition?.delayChildren;r.delay=to(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!Ao(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ad(),i=!0}}}function id(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!q(t,e):!1}function ad(){let e={};for(let t of xl)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var od=(0,E.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function sd(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function cd(...e){return t=>{let n=!1,r=e.map(e=>{let r=sd(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},dd=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=ud(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=ud(e.offsetParent);return[t/i,n/a]},fd=class extends E.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(qo(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=qo(e)&&e.offsetWidth||0,r=qo(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=dd(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function pd({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,E.useId)(),c=(0,E.useRef)(null),l=(0,E.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,E.useContext)(od),d=ld(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,E.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return ks.setup(()=>{let[e,t]=dd(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),ks.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,Y.jsx)(fd,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:E.cloneElement(e,{ref:d})})}var md=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=ft(hd),d=(0,E.useId)(),f=(0,E.useRef)(),p=(0,E.useRef)(n),m=(0,E.useRef)(r);pt(()=>{p.current=n,m.current=r});let h=!0,g=(0,E.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,E.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),E.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,Y.jsx)(pd,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,Y.jsx)(mt.Provider,{value:g,children:e})};function hd(){return new Map}function gd(e=!0){let t=(0,E.useContext)(mt);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,E.useId)();(0,E.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,E.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}function _d(){return vd((0,E.useContext)(mt))}function vd(e){return e===null||e.isPresent}var yd=e=>e.key||``;function bd(e){let t=[];return E.Children.forEach(e,e=>{(0,E.isValidElement)(e)&&t.push(e)}),t}var xd=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=gd(o),f=(0,E.useMemo)(()=>bd(e),[e]),p=o&&!u?[]:f.map(yd),m=(0,E.useRef)(!0),h=ft(()=>new Map),g=(0,E.useRef)(new Set),[_,v]=(0,E.useState)(f),[y,b]=(0,E.useState)(f);pt(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,E.useRef)();(0,E.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),pt(()=>{m.current=!1;for(let e=0;eh.get(yd(e)))?e=f:a===`wait`&&(e=S),b(bd(e)),v(f),null}let{forceRender:C}=(0,E.useContext)(dt);return(0,Y.jsx)(Y.Fragment,{children:y.map(e=>{let _=yd(e),b=o&&!u?!1:f===y||p.includes(_);return(0,Y.jsx)(md,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Sd=(0,E.createContext)({strict:!1}),Cd={animation:[`variants`,...xl],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},wd=!1;function Td(){if(wd)return;let e={};for(let t in Cd)e[t]={isEnabled:e=>Cd[t].some(t=>!!e[t])};Ml(e),wd=!0}function Ed(){return Td(),Nl()}function Dd(e){let t=Ed();for(let n in e)t[n]={...t[n],...e[n]};Ml(t)}function Od({children:e,...t}){let n=(0,E.useContext)(od);t={...n,...t},t.transition=so(t.transition,n.transition),t.isStatic=ft(()=>t.isStatic);let r=(0,E.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,Y.jsx)(od.Provider,{value:r,children:e})}var kd=(0,E.createContext)({});function Ad(e,t){if(Cl(e)){let{initial:t,animate:n}=e;return{initial:t===!1||bl(t)?t:void 0,animate:bl(n)?n:void 0}}return e.inherit===!1?{}:t}function jd(e){let{initial:t,animate:n}=Ad(e,(0,E.useContext)(kd));return(0,E.useMemo)(()=>({initial:t,animate:n}),[Md(t),Md(n)])}function Md(e){return Array.isArray(e)?e.join(` `):e}var Nd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pd(e,t,n){for(let r in t)!Ao(t[r])&&!Ll(r,n)&&(e[r]=t[r])}function Fd({transformTemplate:e},t){return(0,E.useMemo)(()=>{let n=Nd();return es(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Id(e,t){let n=e.style||{},r={};return Pd(r,n,e),Object.assign(r,Fd(e,t)),r}function Ld(e,t){let n={},r=Id(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Rd=()=>({...Nd(),attrs:{}});function zd(e,t,n,r){let i=(0,E.useMemo)(()=>{let n=Rd();return as(n,t,td(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return Pd(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var Bd=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Vd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Bd.has(e)}function Hd(e,t){return e.startsWith(`on`)?!Vd(e):t?.(e)??!Vd(e)}function Ud(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||Ao(e[a])||(Hd(a,r)||n===!0&&Vd(a)||!t&&!Vd(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var Wd=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Gd(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Wd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Kd(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Gd(e)?zd:Ld)(t,r,i,e),l=Ud(t,typeof e==`string`,a,s),u=e===E.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,E.useMemo)(()=>Ao(d)?d.get():d,[d]);return(0,E.createElement)(e,{...u,children:f})}function qd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Jd(n,r,i,e),renderState:t()}}function Jd(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Is(a[e]);let{initial:o,animate:s}=e,c=Cl(e),l=wl(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!H(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n(t,n)=>{let r=(0,E.useContext)(kd),i=(0,E.useContext)(mt),a=()=>qd(e,t,r,i);return n?a():ft(a)},Xd=Yd({scrapeMotionValuesFromProps:Rl,createRenderState:Nd}),Zd=Yd({scrapeMotionValuesFromProps:G,createRenderState:Rd}),Qd=Symbol.for(`motionComponentSymbol`);function $d(e,t,n){let r=(0,E.useRef)(n);(0,E.useInsertionEffect)(()=>{r.current=n});let i=(0,E.useRef)(null);return(0,E.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var ef=(0,E.createContext)({});function tf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function nf(e,t,n,r,i,a){let{visualElement:o}=(0,E.useContext)(kd),s=(0,E.useContext)(Sd),c=(0,E.useContext)(mt),l=(0,E.useContext)(od),u=l.reducedMotion,d=l.skipAnimations,f=(0,E.useRef)(null),p=(0,E.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,E.useContext)(ef);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&rf(f.current,n,i,h),(0,E.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[No],_=(0,E.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return pt(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),pt(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,E.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function rf(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:af(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&tf(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function af(e){if(e)return e.options.allowProjection===!1?af(e.parent):e.projection}function of(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Dd(r);let a=n?n===`svg`:Gd(e),o=a?Zd:Xd;function s(n,s){let c,l=sf(n);ft(()=>!!_l.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,E.useContext)(od),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=jd(n),m=o(n,d);if(!d&&typeof window<`u`){cf(u,r);let t=lf(u);p.visualElement=nf(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,Y.jsxs)(kd.Provider,{value:p,children:[c&&p.visualElement?(0,Y.jsx)(c,{visualElement:p.visualElement,...u}):null,Kd(e,n,$d(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,E.forwardRef)(s);return c[Qd]=e,c}function sf({layoutId:e}){let t=(0,E.useContext)(dt).id;return t&&e!==void 0?t+`-`+e:e}function cf(e,t){(0,E.useContext)(Sd).strict}function lf(e){let{drag:t,layout:n}=Ed();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function uf(e,t){if(typeof Proxy>`u`)return of;let n=new Map,r=(n,r)=>of(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,of(a,void 0,e,t)),n.get(a))})}var df=(e,t)=>t.isSVG??Gd(e)?new K(t):new Bl(t,{allowProjection:e!==E.Fragment}),ff=class extends $u{constructor(e){super(e),e.animationState||=rd(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();H(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},pf=0,mf={animation:{Feature:ff},exit:{Feature:class extends $u{constructor(){super(...arguments),this.id=pf++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Co(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},X=class extends $u{constructor(e){super(e),this.removeGroupControls=St,this.removeListeners=St,this.controls=new Fu(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||St}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},hf=e=>(t,n)=>{e&&R.update(()=>e(t,n),!1,!0)},gf=class extends $u{constructor(){super(...arguments),this.removePointerDownListener=St}onPointerDown(e){this.session=new su(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:hf(e),onStart:hf(t),onMove:hf(n),onEnd:(e,t)=>{delete this.session,r&&R.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Wl(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},_f=!1,vf=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),yf=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},bf=class extends E.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),_f&&i.root.didUpdate(),i.options.layoutId!==r&&yf(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...vf(this.props),onExitComplete:()=>this.safeToRemove()})),Mc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),yf(o,n)),o.setOptions({...o.options,...vf(this.props)}),_f=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||R.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),ks.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_f=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function xf(e){let[t,n]=gd(),r=(0,E.useContext)(dt);return(0,Y.jsx)(bf,{...e,layoutGroup:r,switchLayoutGroup:(0,E.useContext)(ef),isPresent:t,safeToRemove:n})}var Sf={pan:{Feature:gf},drag:{Feature:X,ProjectionNode:vl,MeasureLayout:xf}};function Cf(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&R.postRender(()=>o(t,Hl(t)))}var wf=class extends $u{mount(){let{current:e}=this.node;e&&(this.unmount=Wu(e,(e,t)=>(Cf(this.node,t,`Hover`,`Start`),e=>Cf(this.node,e,`Hover`,`End`))))}unmount(){}},Tf=class extends $u{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Ct(hl(this.node.current,`focus`,()=>this.onFocus()),hl(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Ef(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Cf(e,t,`Tap`,n)}var Df=class extends $u{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Qu(e,(e,t)=>(Ef(this.node,t,`Start`),(e,{success:t})=>Ef(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Of=new WeakMap,kf=new WeakMap,Af=e=>{let t=Of.get(e.target);t&&t(e)},jf=e=>{e.forEach(Af)};function Mf({root:e,...t}){let n=e||document;kf.has(n)||kf.set(n,{});let r=kf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(jf,{root:e,...t})),r[i]}function Nf(e,t,n){let r=Mf(t);return Of.set(e,n),r.observe(e),()=>{Of.delete(e),r.unobserve(e)}}var Pf={some:0,all:1},Ff=class extends $u{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Pf[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Nf(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(If(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function If({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Lf=uf(Object.assign({},mf,{inView:{Feature:Ff},tap:{Feature:Df},focus:{Feature:Tf},hover:{Feature:wf}},Sf,{layout:{ProjectionNode:vl,MeasureLayout:xf}}),df),Rf=h(),zf=_(),Bf=Lf,Vf=1e-4;function Hf(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):0}function Z(e){switch(e){case`navigation`:return .065;case`focus`:return .11;case`select`:return .16;case`success`:return .24;case`warning`:return .3;case`error`:return .34;case`connect`:case`disconnect`:return .5}}function Uf(){if(typeof window>`u`)return null;let e=window;return e.AudioContext??e.webkitAudioContext??null}function Wf(){return Uf()!==null}var Gf=class{context=null;master=null;state=`idle`;isMuted;masterVolume;pauseWhenHidden;manuallySuspended=!1;hiddenSuspended=!1;listenerAttached=!1;startPromise=null;sources=new Set;toneSources=new Map;lastCueAt=new Map;constructor(e={}){this.isMuted=e.muted??!1,this.masterVolume=Hf(e.volume??.42),this.pauseWhenHidden=e.pauseWhenHidden??!0}get supported(){return this.context!==null||Wf()}get muted(){return this.isMuted}get status(){return this.state}get volume(){return this.masterVolume}start(e){return e?.muted!==void 0&&this.setMuted(e.muted),this.state===`disposed`?Promise.resolve(!1):this.context?this.resume():(this.startPromise||=this.initialize().finally(()=>{this.startPromise=null}),this.startPromise)}setMuted(e){this.state!==`disposed`&&(this.isMuted=e,this.applyMasterGain(.055))}toggleMuted(){return this.setMuted(!this.isMuted),this.isMuted}setVolume(e){this.state!==`disposed`&&(this.masterVolume=Hf(e),this.applyMasterGain(.07))}cue(e,t=`neutral`){let n=this.playableContext(e);if(!n||!this.master)return!1;qf(e);let r=n.currentTime+.005;switch(e){case`focus`:this.tone(n,r,.16,523.25,587.33,.022,0,`sine`);break;case`select`:[392,523.25,659.25].forEach((e,t)=>{this.tone(n,r+t*.027,.3+t*.04,e,e*1.006,.018-t*.002,(t-1)*.14,t===1?`triangle`:`sine`)});break;case`navigation`:{let e=Jf(t);this.tone(n,r,.11,e.start,e.end,.02,e.pan,`sine`);break}case`warning`:this.tone(n,r,.21,246.94,196,.027,-.08,`triangle`),this.tone(n,r+.09,.25,220,174.61,.022,.08,`sine`);break;case`success`:this.tone(n,r,.26,329.63,493.88,.021,-.08,`sine`),this.tone(n,r+.06,.32,493.88,659.25,.017,.08,`triangle`);break;case`error`:this.tone(n,r,.28,196,146.83,.026,-.08,`triangle`),this.tone(n,r+.075,.3,164.81,123.47,.02,.08,`sine`);break;case`connect`:this.tone(n,r,.24,293.66,392,.018,-.08,`sine`),this.tone(n,r+.055,.3,440,587.33,.014,.08,`triangle`);break;case`disconnect`:this.tone(n,r,.24,392,293.66,.018,-.08,`triangle`),this.tone(n,r+.055,.3,261.63,196,.014,.08,`sine`)}return!0}playTone(e,t,n,r){let i=this.context;if(!i||!this.master||this.state!==`running`||this.isMuted||this.masterVolume<=0||!Number.isFinite(e)||e<20||e>2e4||!Number.isFinite(t)||t<1||t>6e4||n!==void 0&&(!Number.isFinite(n)||n<0))return!1;let a=n===void 0?.003:n/1e3;return this.tone(i,i.currentTime+a,t/1e3,e,e,.024,0,`square`,r),!0}stopTone(e,t=0){let n=this.context,r=e.trim();if(!n||n.state===`closed`||this.state===`disposed`||!r||!Number.isFinite(t)||t<0)return!1;let i=this.toneSources.get(r);if(!i?.size)return!1;let a=n.currentTime+t/1e3;for(let e of i)try{e.stop(a)}catch{}return this.toneSources.delete(r),!0}async suspend(){let e=this.context;if(e&&this.state!==`disposed`){if(this.manuallySuspended=!0,this.hiddenSuspended=!1,e.state===`running`)try{await e.suspend()}catch{}e===this.context&&(this.state=`paused`)}}async resume(){let e=this.context;if(!e||e.state===`closed`||this.state===`disposed`)return!1;if(typeof document<`u`&&document.hidden)return this.state=`paused`,!1;this.manuallySuspended=!1,this.hiddenSuspended=!1;try{e.state!==`running`&&await e.resume()}catch{return this.state=`paused`,!1}let t=e.state===`running`;return this.state=t?`running`:`paused`,t&&this.applyMasterGain(.12),t}async dispose(){if(this.state===`disposed`)return;this.state=`disposed`,this.detachVisibilityListener();for(let e of this.sources){try{e.stop()}catch{}try{e.disconnect()}catch{}}this.sources.clear(),this.toneSources.clear();let e=this.context;if(this.context=null,this.master=null,e&&e.state!==`closed`)try{await e.close()}catch{}}async initialize(){let e=Uf();if(!e)return this.state=`unsupported`,!1;this.state=`starting`;let t;try{t=new e({latencyHint:`interactive`})}catch{try{t=new e}catch{return this.state=`unsupported`,!1}}this.context=t;let n=t.createGain(),r=t.createDynamicsCompressor();n.gain.setValueAtTime(0,t.currentTime),r.threshold.setValueAtTime(-22,t.currentTime),r.knee.setValueAtTime(16,t.currentTime),r.ratio.setValueAtTime(4,t.currentTime),r.attack.setValueAtTime(.012,t.currentTime),r.release.setValueAtTime(.24,t.currentTime),n.connect(r),r.connect(t.destination),this.master=n,this.attachVisibilityListener(),t.onstatechange=()=>{t===this.context&&this.state!==`disposed`&&(this.state=t.state===`running`?`running`:`paused`)};try{t.state!==`running`&&await t.resume()}catch{return this.state=`paused`,!1}let i=t.state===`running`;return this.state=i?`running`:`paused`,i&&this.applyMasterGain(.32),i}playableContext(e){let t=this.context;if(!t||this.state!==`running`||this.isMuted||this.masterVolume<=0)return null;let n=Z(e),r=this.lastCueAt.get(e)??-1/0;return t.currentTime-r{if(this.sources.delete(l),m){let e=this.toneSources.get(m);e?.delete(l),e?.size===0&&this.toneSources.delete(m)}l.disconnect(),u.disconnect(),d?.disconnect()},{once:!0}),l.start(t),l.stop(p+.025)}applyMasterGain(e){let t=this.context,n=this.master;if(!t||!n||t.state===`closed`)return;let r=t.currentTime,i=this.isMuted?0:this.masterVolume;n.gain.cancelScheduledValues(r),n.gain.setValueAtTime(n.gain.value,r),n.gain.linearRampToValueAtTime(i,r+Math.max(.005,e))}attachVisibilityListener(){this.pauseWhenHidden&&!this.listenerAttached&&typeof document<`u`&&(document.addEventListener(`visibilitychange`,this.onVisibilityChange),this.listenerAttached=!0)}detachVisibilityListener(){this.listenerAttached&&typeof document<`u`&&(document.removeEventListener(`visibilitychange`,this.onVisibilityChange),this.listenerAttached=!1)}onVisibilityChange=()=>{let e=this.context;e&&this.state!==`disposed`&&(document.hidden?e.state===`running`&&!this.manuallySuspended&&(this.hiddenSuspended=!0,e.suspend().then(()=>{this.state!==`disposed`&&(this.state=`paused`)}).catch(()=>void 0)):this.hiddenSuspended&&!this.manuallySuspended&&(this.hiddenSuspended=!1,e.resume().then(()=>{e.state===`running`&&this.state!==`disposed`&&(this.state=`running`,this.applyMasterGain(.18))}).catch(()=>{this.state=`paused`})))}};function Kf(e){return e===`select`?8:e===`success`?[10,22,14]:e===`warning`?[18,32,18]:e===`error`?[22,28,22]:e===`connect`?10:e===`disconnect`?[12,24,10]:null}function qf(e){if(typeof navigator>`u`||typeof navigator.vibrate!=`function`||typeof document<`u`&&document.visibilityState!==`visible`)return;let t=Kf(e);t!==null&&navigator.vibrate(t)}function Jf(e){switch(e){case`forward`:return{start:349.23,end:415.3,pan:0};case`backward`:return{start:349.23,end:293.66,pan:0};case`left`:return{start:329.63,end:369.99,pan:-.32};case`right`:return{start:329.63,end:369.99,pan:.32};case`up`:return{start:392,end:466.16,pan:0};case`down`:return{start:329.63,end:261.63,pan:0};default:return{start:329.63,end:369.99,pan:0}}}function Yf(e){return new Gf(e)}function Xf(e){return[e.port.instance_id||e.port.serial_number||e.port.name||`controller`,e.hello.build_hash??``,e.hello.build_timestamp||``].join(`|`)}var Zf=class{requestedGeneration=``;shouldRead(e,t){if(!e.connected||e.have_settings)return this.requestedGeneration=``,!1;if(!t)return!1;let n=Xf(e);return n!==this.requestedGeneration&&(this.requestedGeneration=n,!0)}},Qf=class{start;stop;onError;onHoldingChange;active=!1;stopIssued=!1;startPromise=Promise.resolve();constructor(e,t,n,r){this.start=e,this.stop=t,this.onError=n,this.onHoldingChange=r}begin(){if(this.active)return!1;this.active=!0,this.stopIssued=!1,this.onHoldingChange(!0);let e=Promise.resolve().then(this.start);return this.startPromise=e,e.catch(e=>{this.onError(e),this.release()}),!0}release(e=!0){return!this.active||this.stopIssued?!1:(this.active=!1,this.stopIssued=!0,e&&this.onHoldingChange(!1),this.startPromise.catch(()=>void 0).then(this.stop).catch(this.onError),!0)}isHolding(){return this.active}};function $f(e){return e.filter(Number.isFinite)}function ep(e,t){let n=$f(e);if(!n.length)return t===`temperature`?[20,60]:t===`supply`?[0,13]:[0,1];let r=Math.min(...n),i=Math.max(...n);if(t===`supply`)return[0,Math.max(13,Math.ceil(i*1.05*2)/2)];if(t===`temperature`)return[Math.min(20,Math.floor(r-5)),Math.max(60,Math.ceil(i+3))];if(t===`current`)return[0,Math.max(100,Math.ceil(Math.max(0,i)*1.2/50)*50)];if(i>r)return[r,i];let a=Math.max(1,Math.abs(r)*.05);return[r-a,i+a]}function tp(e,t=`auto`,n=300,r=92){let i=$f(e),a=i.length>1?i:i.length===1?[i[0],i[0]]:[0,0],[o,s]=ep(a,t),c=Math.max(2**-52,s-o);return a.map((e,t)=>({x:t/Math.max(1,a.length-1)*n,y:r-8-Math.max(0,Math.min(1,(e-o)/c))*(r-20)}))}function Q(e){let t=typeof navigator>`u`?void 0:navigator,n=e??`${t?.userAgentData?.platform??``} ${t?.platform??``} ${t?.userAgent??``}`;return/mac|iphone|ipad|ipod/i.test(n)?`⌘`:`Ctrl`}function np(e){return Q(e)===`⌘`?`Meta+K`:`Control+K`}function $(e,t){return typeof document<`u`&&document.documentElement.lang.toLowerCase().startsWith(`fa`)?t:e}function rp({icon:e,size:t=18}){return(0,Y.jsx)(e,{"aria-hidden":`true`,size:t,strokeWidth:1.8})}function ip({fallback:e}){let[t,n]=(0,E.useState)(!1);return t?(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:e}):(0,Y.jsx)(`img`,{src:`/favicon.svg`,alt:``,onError:()=>n(!0)})}function ap({active:e,disabled:t,label:n,onToggle:r}){return(0,Y.jsx)(`button`,{type:`button`,className:`relay-switch__toggle`,"aria-label":n,"aria-pressed":e,disabled:t,onClick:r,children:(0,Y.jsx)(`i`,{"aria-hidden":`true`,children:(0,Y.jsx)(`b`,{})})})}function op({keys:e,separator:t=`+`}){let n=e.map(e=>Array.isArray(e)?e.join($(` or `,` یا `)):e).join(t===`+`?$(` plus `,` به‌علاوهٔ `):` ${t} `);return(0,Y.jsx)(`span`,{className:`key-combo`,dir:`ltr`,"aria-label":n,children:e.map((e,n)=>(0,Y.jsxs)(`span`,{className:`key-combo__group`,children:[n>0&&(0,Y.jsx)(`span`,{className:`key-combo__separator`,"aria-hidden":`true`,children:t}),(Array.isArray(e)?e:[e]).map((e,t)=>(0,Y.jsxs)(`span`,{className:`key-combo__key`,children:[t>0&&(0,Y.jsx)(`span`,{className:`key-combo__alternative`,"aria-hidden":`true`,children:`/`}),(0,Y.jsx)(`kbd`,{children:e})]},e))]},`${n}-${Array.isArray(e)?e.join(`-`):e}`))})}var sp=(0,E.forwardRef)(function({icon:e,tone:t=`secondary`,busy:n,compact:r,children:i,className:a=``,disabled:o,...s},c){return(0,Y.jsxs)(`button`,{className:`button button--${t}${r?` button--compact`:``} ${a}`,disabled:o||n,ref:c,...s,children:[(0,Y.jsx)(`span`,{className:`button__wash`,"aria-hidden":`true`}),n?(0,Y.jsx)(Me,{className:`spin`,"aria-hidden":`true`,size:17}):e?(0,Y.jsx)(rp,{icon:e,size:17}):null,i?(0,Y.jsx)(`span`,{children:i}):null]})});function cp({onHoldStart:e,onHoldStop:t,onHoldError:n,disabled:r,className:i=``,children:a,...o}){let[s,c]=(0,E.useState)(!1),l=(0,E.useRef)(e),u=(0,E.useRef)(t),d=(0,E.useRef)(n);l.current=e,u.current=t,d.current=n;let f=(0,E.useRef)(null);f.current||=new Qf(()=>l.current(),()=>u.current(),e=>d.current?.(e),c);let p=f.current;return(0,E.useEffect)(()=>{let e=()=>p.release(),t=()=>{document.visibilityState!==`visible`&&e()};return window.addEventListener(`blur`,e),window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`pagehide`,e),document.removeEventListener(`visibilitychange`,t),p.release(!1)}},[p]),(0,Y.jsx)(sp,{...o,disabled:r,className:`${i} hold-action${s?` is-holding`:``}`,"aria-pressed":s,onPointerDown:e=>{e.button!==0||r||(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),p.begin())},onPointerUp:e=>{e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),p.release()},onPointerCancel:()=>p.release(),onPointerLeave:()=>p.release(),onLostPointerCapture:()=>p.release(),onKeyDown:e=>{e.key!==` `&&e.key!==`Enter`||e.repeat||r||(e.preventDefault(),p.begin())},onKeyUp:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),p.release())},"data-touch-mode":`hold`,onBlur:()=>p.release(),children:a})}function lp({icon:e,iconTone:t=`accent`,title:n,eyebrow:r,action:i,menu:a=[],children:o,className:s=``,id:c}){let l=`card-menu-${(0,E.useId)().replace(/:/g,``)}`,[u,d]=(0,E.useState)(!1),[f,p]=(0,E.useState)({left:0,top:0}),m=(0,E.useRef)(null),h=(0,E.useRef)(null),g=(0,E.useRef)(null),_=(0,E.useRef)(null),v=(e=!0)=>{d(!1),e&&window.requestAnimationFrame(()=>_.current?.focus())},y=(e,t,n)=>{_.current=n,p({left:e,top:t}),d(!0)};return(0,E.useLayoutEffect)(()=>{if(!u||!g.current)return;let e=g.current.getBoundingClientRect();p(t=>({left:Math.max(10,Math.min(t.left,window.innerWidth-e.width-10)),top:Math.max(10,Math.min(t.top,window.innerHeight-e.height-10))}))},[u]),(0,E.useEffect)(()=>{if(!u)return;let e=window.requestAnimationFrame(()=>g.current?.querySelector(`button:not(:disabled)`)?.focus()),t=e=>{!g.current?.contains(e.target)&&!h.current?.contains(e.target)&&v(!1)},n=()=>v(!1),r=e=>{let t=e.target;!g.current?.contains(t)&&!h.current?.contains(t)&&v(!1)},i=()=>{document.visibilityState!==`visible`&&v(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,r),document.addEventListener(`visibilitychange`,i),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.cancelAnimationFrame(e),document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,r),document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[u]),(0,Y.jsxs)(`section`,{id:c,className:`card ${s}`,ref:m,tabIndex:a.length?0:void 0,onKeyDown:e=>{if(!a.length||!(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`))return;e.preventDefault();let t=m.current?.getBoundingClientRect();t&&y(t.right-12,t.top+44,m.current)},onContextMenu:a.length?e=>{e.preventDefault(),y(e.clientX,e.clientY,m.current)}:void 0,children:[(n||r||i||a.length>0)&&(0,Y.jsxs)(`header`,{className:`card__header`,children:[(0,Y.jsxs)(`div`,{className:`card__heading`,children:[e&&(0,Y.jsx)(`span`,{className:`card__icon card__icon--${t}`,children:(0,Y.jsx)(rp,{icon:e,size:18})}),(0,Y.jsxs)(`div`,{className:`card__heading-copy`,children:[r&&(0,Y.jsx)(`div`,{className:`eyebrow`,children:r}),n&&(0,Y.jsx)(`h2`,{children:n})]})]}),(i||a.length>0)&&(0,Y.jsxs)(`div`,{className:`card__action`,children:[i,a.length>0&&(0,Y.jsx)(`button`,{ref:h,type:`button`,className:`card__menu-trigger`,"aria-label":$(`Card actions`,`عملیات کارت`),"aria-haspopup":`menu`,"aria-controls":l,"aria-expanded":u,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();y(t.right,t.bottom+7,e.currentTarget)},children:(0,Y.jsx)(rp,{icon:A,size:18})})]})]}),o,typeof document<`u`&&(0,Rf.createPortal)((0,Y.jsx)(xd,{children:u&&(0,Y.jsx)(Bf.div,{id:l,ref:g,className:`card-menu`,role:`menu`,"aria-label":$(`Card actions`,`عملیات کارت`),style:f,initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.14,ease:[.22,1,.36,1]},onKeyDown:e=>{let t=[...g.current?.querySelectorAll(`button:not(:disabled)`)??[]];if(!t.length)return;let n=t.indexOf(document.activeElement),r=n<0?0:n;e.key===`Escape`?(e.preventDefault(),v()):e.key===`Tab`?v(!1):[`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)&&(e.preventDefault(),t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(r+1)%t.length:(r-1+t.length)%t.length]?.focus())},children:a.map(e=>(0,Y.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,"data-tone":e.tone??`normal`,onClick:()=>{v(),e.onSelect()},children:[e.icon&&(0,Y.jsx)(rp,{icon:e.icon,size:17}),(0,Y.jsx)(`span`,{children:e.label})]},e.label))})}),document.body)]})}function up({eyebrow:e,title:t,detail:n,action:r}){return(0,Y.jsxs)(`header`,{className:`section-title`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`eyebrow`,children:e}),(0,Y.jsx)(`h1`,{children:t}),n&&(0,Y.jsx)(`p`,{children:n})]}),r&&(0,Y.jsx)(`div`,{className:`section-title__action`,children:r})]})}function dp({tone:e,children:t,pulse:n}){return(0,Y.jsxs)(`span`,{className:`status-badge status-badge--${e}${n?` status-badge--pulse`:``}`,children:[(0,Y.jsx)(`span`,{className:`status-badge__line`,"aria-hidden":`true`}),t]})}function fp({values:e,tone:t=`accent`,label:n,scale:r=`auto`}){let i=(0,E.useId)().replace(/:/g,``),a=tp(e,r,300,92).map((e,t)=>`${t===0?`M`:`L`}${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `),o=`${a} L300,92 L0,92 Z`;return(0,Y.jsxs)(`svg`,{className:`sparkline sparkline--${t}`,viewBox:`0 0 300 92`,role:`img`,"aria-label":n,preserveAspectRatio:`none`,children:[(0,Y.jsxs)(`defs`,{children:[(0,Y.jsxs)(`linearGradient`,{id:`fill-${i}`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,Y.jsx)(`stop`,{offset:`0`,stopColor:`currentColor`,stopOpacity:`.28`}),(0,Y.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`,stopOpacity:`0`})]}),(0,Y.jsxs)(`linearGradient`,{id:`line-${i}`,x1:`0`,x2:`1`,children:[(0,Y.jsx)(`stop`,{offset:`0`,stopColor:`currentColor`,stopOpacity:`.4`}),(0,Y.jsx)(`stop`,{offset:`.55`,stopColor:`currentColor`}),(0,Y.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`,stopOpacity:`.65`})]})]}),(0,Y.jsx)(`path`,{className:`sparkline__grid`,d:`M0 24H300 M0 48H300 M0 72H300`}),(0,Y.jsx)(Bf.path,{className:`sparkline__area`,d:o,fill:`url(#fill-${i})`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.7}}),(0,Y.jsx)(Bf.path,{className:`sparkline__line`,d:a,fill:`none`,stroke:`url(#line-${i})`,initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{duration:.8,ease:[.22,1,.36,1]}})]})}function pp({icon:e,label:t,value:n,unit:r,values:i,tone:a,detail:o,scale:s=`auto`}){return(0,Y.jsxs)(`article`,{className:`metric metric--${a}`,children:[(0,Y.jsxs)(`div`,{className:`metric__top`,children:[(0,Y.jsx)(`span`,{className:`metric__icon`,children:(0,Y.jsx)(rp,{icon:e,size:19})}),(0,Y.jsx)(`span`,{className:`metric__label`,children:t})]}),(0,Y.jsxs)(`div`,{className:`metric__value`,dir:`ltr`,children:[(0,Y.jsx)(`strong`,{children:n}),(0,Y.jsx)(`span`,{children:r})]}),o&&(0,Y.jsx)(`div`,{className:`metric__detail`,children:o}),(0,Y.jsx)(fp,{values:i,tone:a,scale:s,label:$(`${t} trend`,`روند ${t}`)})]})}function mp({checked:e,onChange:t,label:n,detail:r,disabled:i}){return(0,Y.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":e,className:`toggle-row${i?` is-disabled`:``}`,disabled:i,onClick:()=>t(!e),children:[(0,Y.jsxs)(`span`,{className:`toggle-row__copy`,children:[(0,Y.jsx)(`strong`,{children:n}),r&&(0,Y.jsx)(`small`,{children:r})]}),(0,Y.jsx)(`span`,{className:`toggle`,"aria-hidden":`true`,children:(0,Y.jsx)(`span`,{})})]})}function hp({label:e,value:t,min:n,max:r,step:i=1,unit:a,onChange:o,disabled:s,onEditStart:c,onEditEnd:l}){let u=(0,E.useId)(),[d,f]=(0,E.useState)(String(t));(0,E.useEffect)(()=>f(String(t)),[t]);let p=(t-n)/Math.max(1,r-n)*100,m=()=>{let e=Number(d);if(!Number.isFinite(e)){f(String(t));return}let i=Math.min(r,Math.max(n,e));f(String(i)),o(i)};return(0,Y.jsxs)(`div`,{className:`range-field${s?` is-disabled`:``}`,children:[(0,Y.jsxs)(`span`,{className:`range-field__label`,children:[(0,Y.jsx)(`label`,{htmlFor:u,children:(0,Y.jsx)(`strong`,{children:e})}),(0,Y.jsxs)(`span`,{className:`range-field__value`,dir:`ltr`,children:[(0,Y.jsx)(`input`,{className:`range-field__number`,type:`number`,value:d,min:n,max:r,step:i,disabled:s,"aria-label":typeof e==`string`?$(`${e} exact value`,`مقدار دقیق ${e}`):$(`Exact value`,`مقدار دقیق`),onInput:e=>f(e.currentTarget.value),onFocus:c,onBlur:()=>{m(),l?.()},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}}),a&&(0,Y.jsx)(`span`,{children:a})]})]}),(0,Y.jsx)(`input`,{id:u,type:`range`,value:t,min:n,max:r,step:i,disabled:s,style:{"--range":`${p}%`},onPointerDown:c,onPointerUp:l,onPointerCancel:l,onLostPointerCapture:l,onBlur:l,onKeyDown:e=>{[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`PageUp`,`PageDown`].includes(e.key)&&c?.()},onKeyUp:l,onChange:e=>o(Number(e.target.value))})]})}function gp({value:e,options:t,onChange:n,label:r}){return(0,Y.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-label":r,children:t.map(t=>(0,Y.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t.value===e,className:t.value===e?`is-active`:``,onClick:()=>n(t.value),children:[t.icon&&(0,Y.jsx)(rp,{icon:t.icon,size:16}),(0,Y.jsx)(`span`,{children:t.label})]},t.value))})}function _p({label:e,hint:t,error:n,success:r,action:i,id:a,"aria-describedby":o,...s}){let c=(0,E.useId)(),l=a||`field-${c.replace(/:/g,``)}`,u=`${l}-message`,d=n||r||t,f=!!t&&!n&&!r;return(0,Y.jsxs)(`div`,{className:`text-field${n?` is-invalid`:r?` is-valid`:``}`,children:[(0,Y.jsx)(`label`,{htmlFor:l,children:e}),(0,Y.jsxs)(`div`,{className:`text-field__control`,children:[(0,Y.jsx)(`input`,{id:l,"aria-describedby":[o,d?u:``].filter(Boolean).join(` `)||void 0,"aria-invalid":n?!0:void 0,...s}),i&&(0,Y.jsx)(`div`,{className:`text-field__action`,children:i})]}),d&&(0,Y.jsx)(`small`,{id:u,className:`text-field__message${f?` text-field__message--contextual`:``}`,role:n?`alert`:`status`,children:d})]})}function vp({icon:e,title:t,detail:n,action:r}){return(0,Y.jsxs)(`div`,{className:`empty-state`,children:[(0,Y.jsx)(`span`,{className:`empty-state__icon`,children:(0,Y.jsx)(rp,{icon:e,size:25})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:t}),(0,Y.jsx)(`p`,{children:n})]}),r]})}function yp({label:e,value:t,mono:n,tone:r}){return(0,Y.jsxs)(`div`,{className:`data-row`,children:[(0,Y.jsx)(`span`,{children:e}),(0,Y.jsx)(`strong`,{className:`${n?`mono`:``}${r?` text-${r}`:``}`,children:t})]})}function bp({icon:e,label:t,active:n,badge:r,onClick:i}){return(0,Y.jsxs)(`button`,{className:`nav-button${n?` is-active`:``}`,onClick:i,"aria-label":t,"aria-current":n?`page`:void 0,children:[(0,Y.jsx)(`span`,{className:`nav-button__icon`,children:(0,Y.jsx)(rp,{icon:e,size:20})}),(0,Y.jsx)(`span`,{className:`nav-button__label`,children:t}),r&&(0,Y.jsx)(`span`,{className:`nav-button__badge`,children:r}),(0,Y.jsx)(_e,{className:`nav-button__chevron`,"aria-hidden":`true`,size:15})]})}function xp(e){if(!e?.isConnected)return!1;let t=e.querySelector(`h1`)??e;return t.dataset.routeFocusTarget=``,t.hasAttribute(`tabindex`)||t.setAttribute(`tabindex`,`-1`),t.focus({preventScroll:!0}),!0}function Sp({focusOnEnter:e,children:t}){let n=(0,E.useRef)(null),r=_d(),i=(0,E.useRef)(e);return(0,Y.jsx)(Bf.div,{ref:n,className:`page`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18,ease:`easeOut`},onAnimationComplete:()=>{r&&i.current&&xp(n.current)},children:t})}function Cp({pageKey:e,children:t}){let n=(0,E.useRef)(!1);return(0,E.useEffect)(()=>{n.current=!0},[]),(0,Y.jsx)(xd,{mode:`wait`,initial:!1,children:(0,Y.jsx)(Sp,{focusOnEnter:n.current,children:t},e)})}function wp({open:e,progress:t,locale:n,productTitle:r,productShortName:i,productTagline:a,onEnter:o}){let s=t>=100,c=t<34?n===`fa`?`بارگذاری هویت سامانه`:`Loading system identity`:t<68?n===`fa`?`برقراری مسیر کنترل`:`Establishing control route`:t<96?n===`fa`?`همگام‌سازی وضعیت میزبان`:`Synchronizing host state`:n===`fa`?`مرکز کنترل آماده است`:`Control center is ready`;return(0,Y.jsx)(xd,{children:e&&(0,Y.jsxs)(Bf.section,{className:`boot-gate`,role:`dialog`,"aria-modal":`true`,"aria-busy":!s,"aria-labelledby":`boot-title`,initial:{opacity:1},exit:{opacity:0},transition:{duration:.28,ease:`easeOut`},children:[(0,Y.jsxs)(`div`,{className:`boot-fuji`,"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{className:`boot-fuji__rear`}),(0,Y.jsx)(`span`,{className:`boot-fuji__face`}),(0,Y.jsx)(`span`,{className:`boot-fuji__snow`}),(0,Y.jsx)(`span`,{className:`boot-fuji__trace`})]}),(0,Y.jsxs)(`div`,{className:`boot-identity`,children:[(0,Y.jsx)(`div`,{className:`brand__mark`,"aria-hidden":`true`,children:(0,Y.jsx)(ip,{fallback:i})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`span`,{children:[r.toUpperCase(),` / `,a]}),(0,Y.jsx)(`h1`,{id:`boot-title`,children:n===`fa`?`مرکز کنترل یکپارچه`:r})]})]}),(0,Y.jsxs)(`div`,{className:`boot-status`,"aria-live":`polite`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:c}),(0,Y.jsxs)(`b`,{dir:`ltr`,children:[Math.round(t).toString().padStart(2,`0`),`%`]})]}),(0,Y.jsx)(`div`,{className:`boot-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t),children:(0,Y.jsx)(`span`,{style:{inlineSize:`${t}%`}})})]}),(0,Y.jsxs)(`div`,{className:`boot-entry${s?` is-ready`:``}`,inert:!s||void 0,children:[(0,Y.jsx)(sp,{tone:`primary`,icon:se,disabled:!s,onClick:()=>o(!0),children:n===`fa`?`ورود با نشانه‌های صوتی`:`Enter with audio cues`}),(0,Y.jsx)(sp,{icon:it,disabled:!s,onClick:()=>o(!1),children:n===`fa`?`ورود بی‌صدا`:`Enter quietly`})]})]})})}function Tp({open:e,locale:t,onClose:n}){let r=t===`fa`?`میانبرهای مرکز کنترل`:`Control center shortcuts`,i=Q(),a=t===`fa`?[{keys:[i,`K`],detail:`فرمان‌ها و صفحه‌ها`},{keys:[`Alt`,`1…8`],detail:`رفتن مستقیم به صفحه`},{keys:[`G`,[`D`,`C`,`B`,`V`,`W`,`E`,`S`]],separator:`سپس`,detail:`رفتن به داشبورد، کنترلر، میزکار تجهیزات، دستگاه، فضای داده، رویدادها یا تنظیمات`},{keys:[i,`Shift`,[`←`,`→`]],detail:`صفحهٔ کناری در جهت دیداری`},{keys:[`?`],detail:`نمایش یا بستن این راهنما`},{keys:[`M`],detail:`قطع یا وصل نشانه‌های صوتی`},{keys:[`Esc`],detail:`بستن لایهٔ فعال`}]:[{keys:[i,`K`],detail:`Commands and pages`},{keys:[`Alt`,`1…8`],detail:`Open a page directly`},{keys:[`G`,[`D`,`C`,`B`,`V`,`W`,`E`,`S`]],separator:`then`,detail:`Go to dashboard, controls, peripheral workbench, device, data workspace, events, or settings`},{keys:[i,`Shift`,[`←`,`→`]],detail:`Adjacent page in the visual direction`},{keys:[`?`],detail:`Show or close this guide`},{keys:[`M`],detail:`Mute or enable interaction cues`},{keys:[`Esc`],detail:`Close the active layer`}];return(0,Y.jsx)(xd,{children:e&&(0,Y.jsxs)(Bf.div,{className:`hotkey-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,Y.jsx)(`button`,{className:`modal-backdrop`,"aria-label":t===`fa`?`بستن راهنمای صفحه‌کلید`:`Close keyboard guide`,onClick:n}),(0,Y.jsxs)(Bf.section,{className:`hotkey-help`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`hotkey-help-title`,initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.99},transition:{duration:.2,ease:`easeOut`},children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(Te,{size:19}),(0,Y.jsx)(`i`,{children:t===`fa`?`راهنمای کلیدها`:`KEY MAP`})]}),(0,Y.jsx)(`button`,{className:`modal__close`,onClick:n,"aria-label":t===`fa`?`بستن`:`Close`,children:(0,Y.jsx)(ct,{size:18})})]}),(0,Y.jsx)(`h2`,{id:`hotkey-help-title`,children:r}),(0,Y.jsx)(`div`,{className:`hotkey-list`,children:a.map(e=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(op,{keys:e.keys,separator:e.separator}),(0,Y.jsx)(`span`,{children:e.detail})]},`${e.keys.flat().join(`-`)}-${e.detail}`))})]})]})})}function Ep({state:e,onClose:t,busy:n}){let r=(0,E.useRef)(null),i=(0,E.useRef)(null),a=(0,E.useRef)(null),o=(0,E.useRef)(t),s=(0,E.useRef)(!!n);return o.current=t,s.current=!!n,(0,E.useEffect)(()=>{if(!e.open)return;let t=document.activeElement,n=window.requestAnimationFrame(()=>{((e.tone===`danger`?i.current:r.current)??a.current)?.focus()}),c=e=>{if(e.key===`Escape`&&!s.current){e.preventDefault(),o.current();return}if(e.key!==`Tab`||!a.current)return;let t=[...a.current.querySelectorAll(`button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [href], [tabindex]:not([tabindex="-1"])`)].filter(e=>e.offsetParent!==null);if(!t.length){e.preventDefault(),a.current.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,c),()=>{window.cancelAnimationFrame(n),document.removeEventListener(`keydown`,c),t?.isConnected&&t.focus()}},[e.open,e.tone]),(0,Y.jsx)(xd,{children:e.open&&(0,Y.jsxs)(Bf.div,{className:`modal-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,Y.jsx)(Bf.button,{className:`modal-backdrop`,"aria-label":$(`Close dialog`,`بستن گفت‌وگو`),onClick:t,disabled:n}),(0,Y.jsxs)(Bf.div,{ref:a,className:`modal modal--${e.tone??`normal`}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`active-dialog-title`,tabIndex:-1,initial:{opacity:0,scale:.985,y:8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.99,y:5},transition:{duration:.2,ease:[.22,1,.36,1]},children:[(0,Y.jsx)(`button`,{className:`modal__close`,"aria-label":$(`Close`,`بستن`),onClick:t,disabled:n,children:(0,Y.jsx)(ct,{size:18})}),(0,Y.jsx)(`div`,{className:`modal__signal`,"aria-hidden":`true`,children:e.tone===`danger`?(0,Y.jsx)(et,{size:25}):(0,Y.jsx)(he,{size:25})}),(0,Y.jsx)(`h2`,{id:`active-dialog-title`,children:e.title}),(0,Y.jsx)(`p`,{children:e.body}),(0,Y.jsxs)(`div`,{className:`modal__actions`,children:[(0,Y.jsx)(sp,{ref:i,tone:`ghost`,onClick:t,disabled:n,children:$(`Cancel`,`انصراف`)}),(0,Y.jsx)(sp,{ref:r,tone:e.tone===`danger`?`danger`:`primary`,busy:n,onClick:()=>e.action?.(),children:e.confirmLabel})]})]})]})})}function Dp({messages:e,dismiss:t}){return(0,Y.jsx)(`div`,{className:`toast-stack`,"aria-live":`polite`,"aria-atomic":`false`,children:(0,Y.jsx)(xd,{initial:!1,children:e.map(e=>(0,Y.jsxs)(Bf.article,{className:`toast toast--${e.tone}`,initial:{opacity:0,x:18},animate:{opacity:1,x:0},exit:{opacity:0,x:12},transition:{duration:.32,ease:[.22,1,.36,1]},children:[(0,Y.jsx)(`span`,{className:`toast__rail`,"aria-hidden":`true`}),(0,Y.jsxs)(`div`,{className:`toast__body`,children:[(0,Y.jsx)(`strong`,{children:e.title}),e.detail&&(0,Y.jsx)(`p`,{children:e.detail}),e.updateOperationID&&(0,Y.jsxs)(`div`,{className:`toast__progress${e.progressKnown?``:` is-indeterminate`}`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:$(`Transfer`,`انتقال`)}),(0,Y.jsx)(`bdi`,{title:e.bytesTotal?`${e.bytesDone??0} / ${e.bytesTotal} bytes`:void 0,children:e.progressLabel})]}),(0,Y.jsx)(`div`,{className:`update-progress${e.progressKnown?``:` is-indeterminate`}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.progressKnown?e.progressPercent:void 0,"aria-valuetext":e.progressLabel,children:(0,Y.jsx)(`i`,{style:e.progressKnown?{width:`${e.progressPercent??0}%`}:void 0})})]}),e.correlation&&(0,Y.jsxs)(`code`,{className:`toast__correlation`,children:[(0,Y.jsx)(`span`,{children:$(`Reference`,`شناسه`)}),(0,Y.jsxs)(`bdi`,{children:[`#`,e.correlation]})]}),e.action&&(0,Y.jsxs)(`div`,{className:`toast__action-context`,children:[(0,Y.jsx)(`span`,{children:e.actionLabel||$(`Suggested action`,`عملیات پیشنهادی`)}),(0,Y.jsx)(`code`,{dir:`ltr`,children:e.action})]})]}),(0,Y.jsx)(`button`,{className:`toast__dismiss`,"aria-label":$(`Dismiss`,`بستن اعلان`),onClick:()=>t(e.id),children:(0,Y.jsx)(ct,{size:16})})]},e.id))})})}var Op=/[\u0000-\u001f\u007f-\u009f\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,kp=/\s+/g;function Ap(e,t=``){return{normalized:e,error:t,valid:!t}}function jp(e){return e.normalize(`NFKC`).replace(Op,``).replace(kp,` `).slice(0,64)}function Mp(e){let t=jp(e),n=t.trim();return n?n.length>64?Ap(t,`Application title must be 64 characters or fewer.`):/[\p{L}\p{N}]/u.test(n)?Ap(n):Ap(t,`Application title must include a letter or number.`):Ap(t,`Application title is required.`)}function Np(e){let t=e.normalize(`NFKC`).replace(Op,``).replace(kp,` `);return Array.from(t).slice(0,64).join(``)}function Pp(e){let t=Np(e).trim();return Array.from(t).length>64?Ap(t,`Peripheral name must be 64 characters or fewer.`):Ap(t)}function Fp(e){return e.normalize(`NFKC`).replace(Op,``).replace(kp,``).slice(0,4096)}function Ip(e){return e.normalize(`NFKC`).replace(/[\s,]+/g,` `).replace(Op,``).trimStart().toLowerCase()}function Lp(e){let t=Ip(e).trim().split(` `).filter(Boolean),n=t.join(` `),r=t.some(e=>!/^[\x21-\x7e]+$/.test(e)),i=new Set(t).size!==t.length,a=``;return t.length>14?a=`Use no more than 14 page keys or IDs.`:r?a=`Page keys or IDs must use printable ASCII characters.`:i&&(a=`Page keys or IDs must be unique.`),{normalized:n,pages:t,error:a,valid:!a}}function Rp(e){return e.normalize(`NFKC`).replace(/[\t\r\n\f\v]+/g,` `).replace(Op,``)}function zp(e,t){let n=Rp(e),r=new TextEncoder().encode(n).length,i=Math.max(0,40-t),a=``;return/^[\x20-\x7e]*$/.test(n)?r<5?a=`Text must contain at least 5 printable ASCII bytes.`:r+t>40&&(a=`Text and repeat gap must fit within 40 bytes.`):a=`Text must use printable ASCII characters.`,{normalized:n,byteLength:r,availableBytes:i,error:a,valid:!a}}function Bp(e,t){let n=Lp(e.pages.join(` `)).pages,r=Lp(t.pages.join(` `)).pages;return e.enabled===t.enabled&&e.speed_ms===t.speed_ms&&e.gap_cells===t.gap_cells&&Rp(e.door_open_text)===Rp(t.door_open_text)&&Rp(e.door_closed_text)===Rp(t.door_closed_text)&&n.length===r.length&&n.every((e,t)=>e===r[t])}function Vp(e){return e.normalize(`NFKC`).replace(Op,``).replace(kp,``).replace(/\\/g,`/`).replace(/^([a-z][a-z\d+.-]*):\/(?!\/)/i,`$1://`).slice(0,2048)}function Hp(e,t){let n=Vp(e);if(!n)return t?{normalized:n,error:`A root URL is required while this integration is enabled.`}:{normalized:n};let r=/^[a-z][a-z\d+.-]*:\/\//i.test(n)?n:`http://${n}`,i;try{i=new URL(r)}catch{return{normalized:n,error:`Enter a valid HTTP or HTTPS root URL.`}}return i.protocol!==`http:`&&i.protocol!==`https:`?{normalized:n,error:`Only HTTP and HTTPS are supported.`}:i.username||i.password?{normalized:n,error:`Credentials are not allowed in the URL.`}:i.search||i.hash?{normalized:n,error:`Query strings and fragments are not allowed.`}:i.pathname!==`/`&&i.pathname!==``?{normalized:n,error:`Use the service root without a path.`}:(i.pathname=`/`,{normalized:i.toString().replace(/\/$/,``),url:i})}function Up(e){let t=e.split(`.`).map(Number);return t.length!==4||t.some(e=>!Number.isInteger(e)||e<0||e>255)?!1:t[0]===10||t[0]===127||t[0]===169&&t[1]===254||t[0]===172&&t[1]>=16&&t[1]<=31||t[0]===192&&t[1]===168}function Wp(e){return!e||e.length>253?!1:e.split(`.`).every(e=>e.length>=1&&e.length<=63&&!e.startsWith(`-`)&&!e.endsWith(`-`)&&/^[a-z\d-]+$/i.test(e))}function Gp(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return t.includes(`:`)?t===`::1`||/^(?:fc|fd)[0-9a-f]{2}:/i.test(t)||/^fe[89ab][0-9a-f]:/i.test(t):Up(t)?!0:Wp(t)?t===`localhost`||!t.includes(`.`)||[`.local`,`.lan`,`.home.arpa`,`.localdomain`].some(e=>t.endsWith(e)&&t.length>e.length):!1}function Kp(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``),n=t.split(`.`).map(Number),r=n.length===4&&n[0]===127&&n.every(e=>Number.isInteger(e)&&e>=0&&e<=255);return t===`localhost`||t===`::1`||r}function qp(e,t){let n=Hp(e,t);return n.error||!n.url?Ap(n.normalized,n.error??``):Gp(n.url.hostname)?Ap(n.normalized):Ap(n.normalized,`Use a private, loopback, link-local, or local-DNS host.`)}function Jp(e,t){let n=Hp(e,t);return n.error||!n.url?Ap(n.normalized,n.error??``):Kp(n.url.hostname)?Ap(n.normalized):Ap(n.normalized,`The data service must use localhost or a loopback address.`)}function Yp(e,t){return e.local_device.enabled===t.local_device.enabled&&Vp(e.local_device.base_url??``)===Vp(t.local_device.base_url??``)&&e.data_hub.enabled===t.data_hub.enabled&&Vp(e.data_hub.base_url??``)===Vp(t.data_hub.base_url??``)&&e.lifecycle_safety.session_lock===t.lifecycle_safety.session_lock&&e.lifecycle_safety.suspend===t.lifecycle_safety.suspend&&e.lifecycle_safety.refresh_on_resume===t.lifecycle_safety.refresh_on_resume}var Xp=`controller`,Zp=`pccontroller.controller-origin`;function Qp(){let e=``,t=``,n=null;try{e=globalThis.location?.href??``,t=globalThis.location?.origin??``}catch{}try{n=globalThis.localStorage}catch{}return{href:e,origin:t,localStorage:n,generatedConfig:globalThis.PCControllerWebConfig}}function $p(e){let t=Vp(e);if(!t)return null;let n=/^[a-z][a-z\d+.-]*:\/\//i.test(t)?t:`http://${t}`,r;try{r=new URL(n)}catch{return null}return![`http:`,`https:`,`ws:`,`wss:`].includes(r.protocol)||r.username||r.password||r.search||r.hash||r.pathname!==``&&r.pathname!==`/`?null:(r.pathname=``,r)}function em(e){let t=$p(e);return t?t.origin.toLowerCase():``}function tm(e){let t=new Set;for(let n of e?.trusted_controller_origins??[]){if(typeof n!=`string`)continue;let e=$p(n);!e||e.protocol!==`https:`&&e.protocol!==`wss:`||t.add(e.origin.toLowerCase())}return t}function nm(e,t=new Set){let n=$p(e);if(!n)return{valid:!1,normalized:``,error:`Use an HTTP(S) or WS(S) service root without credentials, a path, query, or fragment.`};let r=Gp(n.hostname),i=(n.protocol===`https:`||n.protocol===`wss:`)&&t.has(n.origin.toLowerCase());return!r&&!i?{valid:!1,normalized:n.origin,error:`Use a local/private target or an explicitly trusted HTTPS/WSS origin.`}:{valid:!0,normalized:n.origin,error:``}}function rm(e,t){let n=new URL(t),r=n.protocol===`https:`||n.protocol===`wss:`;n.protocol=r?`https:`:`http:`;let i=n.origin;return n.protocol=r?`wss:`:`ws:`,{source:e,controllerOrigin:t,httpOrigin:i,websocketOrigin:n.origin,external:!0}}function im(e){let t=em(e);if(!t)return{source:`same-origin`,controllerOrigin:``,httpOrigin:``,websocketOrigin:``,external:!1};let n=new URL(t);return n.protocol=n.protocol===`https:`?`wss:`:`ws:`,{source:`same-origin`,controllerOrigin:t,httpOrigin:t,websocketOrigin:n.origin,external:!1}}function am(e=Qp()){let t=e.generatedConfig,n=tm(t),r=typeof t?.controller_origin==`string`?t.controller_origin.trim():``;if(r){let e=nm(r,n);if(!e.valid)throw TypeError(`Invalid generated controller origin: ${e.error}`);return rm(`generated-config`,e.normalized)}let i=null;if(e.href)try{i=new URL(e.href).searchParams.get(Xp)}catch{}if(i!==null){let t=nm(i,n);if(!t.valid)throw TypeError(`Invalid controller query target: ${t.error}`);try{e.localStorage?.setItem(Zp,t.normalized)}catch{}return rm(`query`,t.normalized)}let a=``;try{a=e.localStorage?.getItem(`pccontroller.controller-origin`)?.trim()??``}catch{}if(a){let t=nm(a,n);if(t.valid)return rm(`local-setting`,t.normalized);try{e.localStorage?.removeItem(Zp)}catch{}}return im(e.origin??``)}function om(e){let t=e.trim();if(!t.startsWith(`/`)||t.startsWith(`//`)||t.includes(`\\`)||/[\u0000-\u001f\u007f]/.test(t))throw TypeError(`controller transport path must be an absolute local path`);return t}function sm(e){let t=om(e),n=am();return n.external?new URL(t,`${n.httpOrigin}/`).toString():t}function cm(e){let t=om(e),n=am();if(n.websocketOrigin)return new URL(t,`${n.websocketOrigin}/`).toString();let r=globalThis.location?.protocol===`https:`?`wss:`:`ws:`;return new URL(t,`${r}//${globalThis.location?.host??``}`).toString()}function lm(){return am().httpOrigin||void 0}var um=`pccontroller.session-token`,dm=`pccontroller.ticket.`,fm=1,pm=null,mm=0,hm=new Map,gm=class extends Error{code;constructor(e,t){super(t),this.name=`ControllerRPCError`,this.code=e}};function _m(){return sessionStorage.getItem(um)??``}function vm(e){let t=e.trim();t?sessionStorage.setItem(um,t):sessionStorage.removeItem(um)}function ym(e=!1){let t={};e&&(t[`Content-Type`]=`application/json`);let n=_m();return n&&(t.Authorization=`Bearer ${n}`),t}function bm(e,t,n){if(typeof e==`object`&&e&&`error`in e){let t=e.error;return typeof t==`object`&&t&&`message`in t?String(t.message):String(t)}return typeof e==`string`?e:t||`HTTP ${n}`}async function xm(e){let t=await e.text(),n=null;if(t)try{n=JSON.parse(t)}catch{n=t}return n}async function Sm(e){let t=await xm(e);if(!e.ok){let n=bm(t,e.statusText,e.status);throw Error(n||`HTTP ${e.status}`)}return t}function Cm(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Controller returned an invalid JSON-RPC response`);let n=e;if(n.jsonrpc!==`2.0`||n.id!==t)throw Error(`Controller returned a mismatched JSON-RPC response`);let r=Object.prototype.hasOwnProperty.call(n,`result`),i=Object.prototype.hasOwnProperty.call(n,`error`);if(r===i)throw Error(`Controller returned an invalid JSON-RPC response`);if(i){let e=n.error;if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Controller returned an invalid JSON-RPC error`);let t=e;if(!Number.isInteger(t.code)||typeof t.message!=`string`)throw Error(`Controller returned an invalid JSON-RPC error`);return{error:new gm(t.code,t.message)}}return{result:n.result}}async function wm(e){let t=await Sm(await fetch(sm(`/api/ui-config`),{signal:e,cache:`no-store`}));if(typeof t?.setup_complete!=`boolean`)throw Error(`UI configuration is missing required setup_complete state`);if(!t.appearance||typeof t.appearance!=`object`||typeof t.appearance_etag!=`string`||!/^[a-f0-9]{64}$/.test(t.appearance_etag))throw Error(`UI configuration is missing host-authoritative appearance state`);if(typeof t.session_ticket_path!=`string`||t.session_ticket_path.startsWith(`//`)||!/^\/[A-Za-z0-9._~!$&'()*+,;=:@%/-]+$/.test(t.session_ticket_path))throw Error(`UI configuration is missing a safe session-ticket path`);if(!Number.isSafeInteger(t.status_interval_ms)||t.status_interval_ms<50||t.status_interval_ms>6e4||!Number.isSafeInteger(t.measurement_freshness_ms)||t.measurement_freshness_ms12e4)throw Error(`UI configuration is missing valid live-measurement timing`);return t}async function Tm(e){return Sm(await fetch(sm(`/api/snapshot`),{headers:ym(),signal:e,cache:`no-store`}))}async function Em(e,t){let n=await fetch(sm(`/api/rpc`),{method:`POST`,headers:ym(!0),body:JSON.stringify(e),signal:t}),r=await xm(n),i=Cm(r,e.id);if(i.error)throw i.error;if(!n.ok){let e=bm(r,n.statusText,n.status);throw Error(e||`HTTP ${n.status}`)}return i.result}function Dm(e,t){for(let[n,r]of hm)r.socket===e&&(hm.delete(n),r.cleanup(),r.reject(Error(t)))}function Om(e,t,n){return n?.aborted?Promise.reject(n.reason instanceof Error?n.reason:new DOMException(`Aborted`,`AbortError`)):new Promise((r,i)=>{let a=()=>{hm.delete(t.id),i(n?.reason instanceof Error?n.reason:new DOMException(`Aborted`,`AbortError`))},o=()=>n?.removeEventListener(`abort`,a);hm.set(t.id,{socket:e,resolve:e=>r(e),reject:i,cleanup:o}),n?.addEventListener(`abort`,a,{once:!0});try{e.send(JSON.stringify(t))}catch(e){hm.delete(t.id),o(),i(e instanceof Error?e:Error(String(e)))}})}function km(e,t={},n){let r={jsonrpc:`2.0`,id:fm++,method:e,params:t},i=pm;return i&&i.readyState===WebSocket.OPEN?Om(i,r,n):Em(r,n)}function Am(e,t){return km(`controller.command.execute`,{command:e},t)}async function jm(e,t){if(_m(),!e.auth_required)return[];let n=await Sm(await fetch(sm(e.session_ticket_path),{method:`POST`,headers:ym(!0),body:JSON.stringify({transport:`websocket`}),signal:t,cache:`no-store`}));if(!/^[a-f0-9]{64}$/.test(n.ticket)||n.protocol!==`pccontroller`||!Number.isFinite(n.expires_in_ms)||n.expires_in_ms<=0||n.expires_in_ms>15e3||Number.isNaN(Date.parse(n.expires_at))||typeof n.principal!=`string`||!n.principal.trim())throw Error(`Controller returned an invalid WebSocket session ticket`);return[n.protocol,`${dm}${n.ticket}`]}function Mm(e,t=Math.random){let n=500*2**Math.min(Math.max(0,e),5);return Math.min(12e3,n+Math.floor(Math.max(0,Math.min(.999,t()))*250))}function Nm(e,t){let n=null,r=!1,i=0,a=0,o=0,s=null,c=e.status_interval_ms,l=(e,t=!1)=>{let n=fm++;return e.send(JSON.stringify({jsonrpc:`2.0`,id:n,method:`controller.subscribe`,params:t?{topics:[`status`],interval_ms:c,preserve:!0}:{topics:[`events`,`state`,`status`],interval_ms:c,after_id:0}})),n},u=(e,n)=>{if(r)return;i+=1;let o=Mm(i);t.state(`waiting`,e||`retrying in ${Math.ceil(o/1e3)}s`,n),window.clearTimeout(a),a=window.setTimeout(()=>{d()},o)},d=async()=>{if(r)return;let a=++o,c=++mm;t.state(`connecting`,void 0,{generation:c}),s?.abort();let d=new AbortController;s=d;let f;try{f=await jm(e,d.signal)}catch(e){if(r||a!==o||d.signal.aborted)return;u(e instanceof Error?e.message:String(e),{generation:c});return}finally{s===d&&(s=null)}if(r||a!==o)return;let p;try{let t=cm(e.websocket_path);p=f.length>0?new WebSocket(t,f):new WebSocket(t)}catch(e){if(r||a!==o)return;u(e instanceof Error?e.message:String(e),{generation:c});return}n=p;let m=()=>!r&&a===o&&n===p,h=0,g=``,_=!1,v=[],y=null,b=null,x=null,S=()=>({generation:c,...g?{instanceID:g}:{}}),C=e=>{m()&&t.event(e,S())},ee=e=>{m()&&t.snapshot?.(e,S())};p.addEventListener(`open`,()=>{m()&&(i=0,pm=p,h=l(p))}),p.addEventListener(`message`,e=>{if(m())try{let n=JSON.parse(String(e.data));if(typeof n.id==`number`){let e=hm.get(n.id);if(e&&e.socket===p){hm.delete(n.id),e.cleanup();try{let t=Cm(n,n.id);t.error?e.reject(t.error):e.resolve(t.result)}catch(t){e.reject(t instanceof Error?t:Error(String(t)))}}if(!m())return;if(n.id===h){if(n.error){p.close();return}let e=n.result;if(e?.subscribed!==!0){p.close();return}g=e.instance_id?.trim()??``,_=!0,t.state(`open`,void 0,S());for(let e of v.splice(0))C(e);y&&=(ee(y),null),b&&=(t.pwm?.(b,S()),null),x&&=(t.status(x,S()),null)}}if(n.method===`controller.status`&&(_?t.status(n.params,S()):x=n.params),n.method===`controller.pwm.values`&&(_?t.pwm?.(n.params,S()):(!b||Number(n.params.revision)>Number(b.revision))&&(b=n.params)),n.method===`controller.event`&&C(n.params),n.method===`controller.state`){let e=n.params;_?C(e):(v.length>=256&&v.shift(),v.push(e))}if(n.method===`controller.snapshot`){let e=n.params;_?ee(e):y=e}if(n.method===`controller.error`){let e=n.params?.error;t.state(_?`open`:`connecting`,e,S())}}catch{}}),p.addEventListener(`close`,e=>{m()&&(n===p&&(n=null),pm===p&&(pm=null),Dm(p,e.reason||`WebSocket RPC connection closed`),r?t.state(`closed`,void 0,S()):u(e.reason||`WebSocket connection closed`,S()))}),p.addEventListener(`error`,()=>{m()&&p.close()})};d();let f=(()=>{r=!0,o+=1,s?.abort(),window.clearTimeout(a);let e=n;n?.close(1e3,`view closed`),e&&(pm===e&&(pm=null),Dm(e,`WebSocket RPC view closed`)),n=null});return f.updateStatusInterval=e=>{if(!Number.isSafeInteger(e)||e<50||e>6e4)throw RangeError(`status interval must be 50..60000 ms`);if(c===e)return;c=e;let t=n;t&&t.readyState===WebSocket.OPEN&&l(t,!0)},f}async function Pm(e,t,n={}){let r=t.startsWith(`/`)?t.slice(1):t;return Sm(await fetch(sm(`/api/integrations/${e}/${r}`),{...n,headers:{...ym(!!n.body),...n.headers??{}}}))}function Fm(e,t){let n=e.headers.get(`Content-Disposition`)??``,r=n.match(/filename\*=UTF-8''([^;]+)/i)?.[1],i=n.match(/filename="([^"]+)"/i)?.[1],a=``;if(r)try{a=decodeURIComponent(r)}catch{a=``}let o=a||i||t.split(`/`).filter(Boolean).at(-1)||`controller-data.bin`;return o=o.replace(/[\\/:*?"<>|\u0000-\u001f\u007f]/g,`_`).trim().slice(0,180),o||`controller-data.bin`}async function Im(e,t,n){let r=t.startsWith(`/`)?t.slice(1):t,i=sm(`/api/integrations/${e}/${r}`),a=await fetch(i,{headers:ym(),signal:n});a.ok||await Sm(a);let o=await a.blob(),s=URL.createObjectURL(o),c=document.createElement(`a`);c.href=s,c.download=Fm(a,r),c.rel=`noopener`,document.body.append(c),c.click(),c.remove(),URL.revokeObjectURL(s)}var Lm=[`dashboard`,`controls`,`workbench`,`device`,`data`,`updates`,`events`,`settings`],Rm=`input,textarea,select,[contenteditable]:not([contenteditable="false"]),[role="textbox"],[role="combobox"]`;function zm(e){if(!e)return!1;let t=e;return t.isContentEditable?!0:typeof t.closest==`function`&&!!t.closest(Rm)}function Bm(e){return e.defaultPrevented||e.isComposing||e.keyCode===229||zm(e.target)}function Vm(e){let t=(e??``).trim().toLowerCase().replace(/[\s_]+/g,`-`);return t?{0:`controls`,1:`dashboard`,2:`controls`,3:`controls`,4:`controls`,5:`settings`,6:`controls`,7:`controls`,8:`controls`,9:`events`,app:`settings`,automate:`workbench`,automation:`workbench`,automations:`workbench`,board:`workbench`,catalog:`data`,console:`workbench`,control:`controls`,controls:`controls`,dashboard:`dashboard`,event:`events`,events:`events`,data:`data`,"data-hub":`data`,datahub:`data`,device:`device`,devices:`device`,export:`data`,firmware:`updates`,flash:`updates`,history:`events`,home:`dashboard`,"local-device":`device`,live:`dashboard`,i2c:`workbench`,macros:`workbench`,menus:`workbench`,output:`controls`,outputs:`controls`,records:`data`,recovery:`updates`,program:`updates`,programming:`updates`,peripherals:`workbench`,rf:`workbench`,settings:`settings`,timeline:`events`,terminal:`workbench`,workbench:`workbench`,update:`updates`,updates:`updates`}[t]??null:null}function Hm(e,t=Date.now(),n=1e4){let r=Date.parse(e??``);return Number.isFinite(r)&&r<=t+1e3&&t-r<=n}function Um(e){if(!e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.repeat)return null;let t=Number(e.key)-1;return Number.isInteger(t)&&t>=0&&tJm[e][t]??Jm.en[t]}function Xm(e,t,n=1){return new Intl.NumberFormat(e===`fa`?`fa-IR`:`en-US`,{minimumFractionDigits:n,maximumFractionDigits:n}).format(Number.isFinite(t)?t:0)}function Zm(e,t){return new Intl.NumberFormat(e===`fa`?`fa-IR`:`en-US`,{notation:`compact`,maximumFractionDigits:1}).format(t)}function Qm(e,t){return(e===`fa`?Km:qm).format(t)}function $m(e,t){if(!Number.isFinite(t)||t<0)return`—`;let n=Math.floor(t/1e3),r=Math.floor(n/86400),i=Math.floor(n%86400/3600),a=Math.floor(n%3600/60),o=n%60,s=(r>0?[`${r}d`,`${i}h`,`${a}m`,`${o}s`]:i>0?[`${i}h`,`${a}m`,`${o}s`]:a>0?[`${a}m`,`${o}s`]:[`${o}s`]).join(` `);return e===`fa`?s.replace(/\d+/g,t=>Qm(e,Number(t))).replace(`d`,`ر`).replace(`h`,`س`).replace(`m`,`د`).replace(`s`,`ث`):s}function eh(e,t,n,r=Date.now()){if(t===void 0)return e===`fa`?`در انتظار دستگاه`:`Waiting for device`;let i=t instanceof Date?t.getTime():typeof t==`number`?t:Date.parse(t);if(!Number.isFinite(i))return e===`fa`?`در انتظار دستگاه`:`Waiting for device`;let a=Math.max(0,r-i);if(a0&&!/[\s'"\\]/.test(e)?e:`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function rh(e){let t=e.match(/^(\s*os\s+power\s+\S+)(\s+[\s\S]+)$/i);return t?`${t[1].trim()} [REDACTED]`:e}function ih(e,t,n,r,i,a,o=e.output_persistence,s=e.relay_restore_mask){let c=e.extended_flags&1?1:0,l=e=>e===0?2:e-1,u=e.extended_flags>>1&7,d=l(e.extended_flags>>4&3),f=l(e.extended_flags>>6&3);return[`settings`,`set`,e.flags,e.light_mode,e.on_brightness,e.off_brightness,t,n,r,o,i,e.default_page,c,u,d,f,a,s].join(` `)}function ah(e){return e.reset_lines_available===!0}function oh(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function sh(e,t){let n=Math.max(0,t)/1e3;return new Intl.NumberFormat(e===`fa`?`fa-IR`:`en`,{maximumFractionDigits:+(n<10)}).format(n)+(e===`fa`?` ثانیه`:`s`)}function ch(e){return e.connection_phase?e.connection_phase:e.connected?`connected`:e.paused?`paused`:e.connection_state===`reconnecting`||e.connection_state===`connecting`?`queued`:`disconnected`}function lh(e,t,n=Date.now()){let r=(e,n)=>t===`fa`?n:e,i=ch(e),a=e.connection_candidate,o=a?.friendly_name||a?.product||a?.name||e.port.friendly_name||e.port.product||e.port.name||``,s=e.connection_attempt??0,c=s>0?r(`Attempt ${s}`,`تلاش ${new Intl.NumberFormat(`fa-IR`).format(s)}`):``,l=oh(e.connection_attempt_started),u=oh(e.connection_next_retry),d=e.connection_reason?.trim()||``;return i===`connected`?{phase:i,title:r(`Board connected`,`برد متصل است`),detail:o,candidate:o,timing:``,attempt:``,action:r(`Reconnect`,`اتصال دوباره`),retryDisabled:!1,tone:`good`,animated:!1}:i===`attempting`?{phase:i,title:r(`Contacting controller board`,`در حال تماس با برد کنترلر`),detail:o?r(`Authenticating the application protocol on ${o}.`,`در حال احراز پروتکل برنامه روی ${o}.`):r(`Discovering a compatible controller and authenticating its application protocol.`,`در حال یافتن کنترلر سازگار و احراز پروتکل برنامهٔ آن.`),candidate:o,timing:l===void 0?``:r(`Elapsed ${sh(t,n-l)}`,`گذشته ${sh(t,n-l)}`),attempt:c,action:r(`Attempt in progress`,`تلاش در حال انجام است`),retryDisabled:!0,tone:`info`,animated:!0}:i===`waiting_retry`?{phase:i,title:r(`Board did not answer`,`برد پاسخ نداد`),detail:d||r(`The serial device is present, but the application handshake did not complete.`,`دستگاه سریال حاضر است، اما دست‌دهی برنامه کامل نشد.`),candidate:o,timing:u===void 0?``:u>n?r(`Next automatic attempt in ${sh(t,u-n)}`,`تلاش خودکار بعدی تا ${sh(t,u-n)}`):r(`Next automatic attempt is due now`,`زمان تلاش خودکار بعدی رسیده است`),attempt:c,action:r(`Try now`,`اکنون تلاش کن`),retryDisabled:!1,tone:`warn`,animated:!1}:i===`queued`?{phase:i,title:r(`Reconnect queued`,`اتصال دوباره در صف است`),detail:d||r(`The host is preparing a bounded connection attempt.`,`میزبان در حال آماده‌سازی یک تلاش اتصال محدود است.`),candidate:o,timing:``,attempt:c,action:r(`Try now`,`اکنون تلاش کن`),retryDisabled:!1,tone:`info`,animated:!1}:i===`paused`?{phase:i,title:r(`Board connection is closed`,`اتصال برد بسته است`),detail:d||r(`Automatic reconnect is paused by the operator.`,`اتصال خودکار توسط کاربر متوقف شده است.`),candidate:o,timing:``,attempt:``,action:r(`Resume connection`,`ازسرگیری اتصال`),retryDisabled:!1,tone:`neutral`,animated:!1}:i===`blocked`?{phase:i,title:r(`Serial cleanup needs attention`,`پاک‌سازی درگاه سریال نیاز به بررسی دارد`),detail:d||r(`The previous serial handle could not be released safely.`,`درگاه سریال قبلی با اطمینان آزاد نشد.`),candidate:o,timing:``,attempt:c,action:r(`Retry cleanup`,`تلاش دوباره برای پاک‌سازی`),retryDisabled:!1,tone:`bad`,animated:!1}:{phase:i,title:r(`Controller board disconnected`,`برد کنترلر قطع است`),detail:d||r(`No authenticated controller application is connected.`,`هیچ برنامهٔ کنترلر احرازشده‌ای متصل نیست.`),candidate:o,timing:``,attempt:c,action:r(`Connect`,`اتصال`),retryDisabled:!1,tone:`bad`,animated:!1}}function uh(e,t){return e?.trim()||t.trim()}function dh(e,t){let n=e.trim().split(/\s+/).filter(Boolean);return n.length>1?n.slice(0,2).map(e=>e[0]).join(``).toUpperCase():Array.from(n[0]||t).slice(0,2).join(``).toUpperCase()}var fh={connected:{color:`#43a86f`,label:`Board connected`},connecting:{color:`#d19345`,label:`Controller reconnecting`},fault:{color:`#d96369`,label:`Controller alert`},offline:{color:`#77717f`,label:`Board offline`}};function ph(e){let t=e.connection_state.trim().toLowerCase(),n=(e.connection_reason??``).trim().toLowerCase();return(e.hardware_problems?.length??0)>0||e.have_status&&e.status.hot||/^(error|fault|failed|rejected)$/.test(t)||/authentication|permission|protocol mismatch|unsupported firmware/.test(n)?`fault`:e.connected?`connected`:t===`connecting`||t===`reconnecting`?`connecting`:`offline`}function mh(e){let t=fh[e],n=`${t.label}`;return`data:image/svg+xml,${encodeURIComponent(n)}`}function hh(e,t=document){let n=t.querySelector(`link[data-controller-state-icon]`);n||(n=t.createElement(`link`),n.rel=`icon`,n.type=`image/svg+xml`,n.sizes=`any`,n.dataset.controllerStateIcon=``,t.head.append(n)),n.dataset.state!==e&&(n.dataset.state=e,n.href=mh(e))}var gh=new Set([`telemetry`,`rx`,`tx`,`front_panel.segment`,`status_led.changed`,`buzzer.note`]);function _h(e){return e.stream?e.stream===`activity`:!gh.has(e.kind.trim().toLowerCase())}function vh(e){return e.filter(_h)}function yh(e,t,n=500){let r=vh(e);return _h(t)?[t,...r.filter(e=>e.id!==t.id)].slice(0,n):r.slice(0,n)}function bh(e,t=``){let n=e.kind.trim().toLowerCase(),r=e.source?.trim().toLowerCase()??``,i=e.metadata?.source?.trim().toLowerCase()??``,a=r&&r!==`board`?r:i||r,o=e.text?.trim().toLowerCase()??``;if(/^(hello|status|telemetry|rx|tx)(?:[._-]|$)/.test(n)||/^(hello|status)\b/.test(o))return!1;if(/^peer-update\.(queued|artifact-verified|reconnecting|health-checking|completed|failed|outcome-uncertain)$/.test(n)||n===`hardware.problem`)return!0;if(n===`message`){let n=t.trim().toLowerCase();return(e.targets?.map(e=>e.trim().toLowerCase())??[]).some(e=>e===`all`||e===`*`||e===`webui`||e===`surface:webui`||e===`capability:messages`||!!(n&&e===n))}return/(^|[._-])(relay|output)([._-]|$)/.test(n)?a===`physical`||a===`rf`:/error|warning|fault|hot|door/.test(n)}function xh(e){return typeof e==`string`?e.trim():``}function Sh(){let e=typeof document>`u`?null:document.querySelector(`script[type="module"][src*="/assets/app-"]`),t=``;if(e?.src)try{t=new URL(e.src,document.baseURI).pathname}catch{}return{hostVersion:`0.0.0-development`,resourcePath:t}}function Ch(e){return`${xh(e.host_version)}|${xh(e.web_resource_path)}`}function wh(e,t=Sh()){let n=xh(e.host_version),r=xh(e.web_resource_path),i=xh(t.hostVersion),a=xh(t.resourcePath);return!n||!r||!i||!a?!1:n!==i||r!==a}function Th(e,t,n={}){let r=n.signal?.aborted===!0,i=!1,a=0,o=null,s,c=()=>{a+=1,s!==void 0&&clearTimeout(s),s=void 0,o&&=(clearTimeout(o.timeout),o.abort.abort(),null)},l=e=>!r&&i&&a===e,u=(r,i)=>{if(!l(r))return;let a=new AbortController,c={abort:a,timeout:setTimeout(()=>a.abort(Error(`Host resource identity check timed out`)),5e3)};o=c,e(a.signal).then(e=>{l(r)&&!a.signal.aborted&&t(e)}).catch(e=>{l(r)&&(i===0?s=setTimeout(()=>{s=void 0,u(r,1)},250):n.onError?.(e))}).finally(()=>{clearTimeout(c.timeout),o===c&&(o=null)})},d=()=>{r=!0,i=!1,c(),n.signal?.removeEventListener(`abort`,d)};return n.signal?.addEventListener(`abort`,d,{once:!0}),{state(e){r||(e===`open`?i||(i=!0,c(),u(a,0)):(i=!1,c()))},dispose:d}}var Eh=`background:#7656d6;border-radius:7px;color:#fff;font:600 12px/1.8 ui-sans-serif,system-ui,sans-serif;padding:2px 8px`,Dh=`color:#9b7ce8;font:600 11px/1.6 ui-sans-serif,system-ui,sans-serif`,Oh=`color:#2f9e67;font:600 11px/1.6 ui-sans-serif,system-ui,sans-serif`,kh=`color:#d8793f;font:600 11px/1.6 ui-sans-serif,system-ui,sans-serif`,Ah=`color:inherit;font:inherit`;function jh(e,t,n=96){let r=String(e??``).normalize(`NFKC`).replace(/[\u0000-\u001f\u007f-\u009f]/g,` `).replace(/\s+/g,` `).trim();return r?r.slice(0,n):t}function Mh(e){switch(e){case`open`:return`Host event stream connected`;case`connecting`:return`Host event stream connecting`;case`waiting`:return`Host event stream waiting to reconnect`;case`closed`:return`Host event stream closed`}}function Nh(e,t=console){let n=jh(e.productTitle,`Controller`),r=e.demonstration?`demonstration`:jh(e.config?.host_version,`not reported`),i=e.boardConnected?jh(e.port,`authenticated port`):``;t.groupCollapsed(`%c%s%c · browser control center`,Eh,n,Ah),t.info(`%cHost%c version %s · living API`,Dh,Ah,r),e.boardConnected?t.info(`%cController%c connected · %s`,Oh,Ah,i):t.info(`%cController%c offline · no authenticated board`,kh,Ah),t.debug(`%cTransport%c %s`,Dh,Ah,Mh(e.streamState)),t.groupEnd()}var Ph=`pccontroller.tab-sync`,Fh=`pccontroller://local`,Ih=3e4,Lh=3e5,Rh=32768,zh=8192,Bh=4096,Vh=32,Hh=512,Uh=0,Wh=/(?:authorization|cookie|password|passwd|secret|session(?:[_-]?id)?|(?:access|refresh)?[_-]?token|api[_-]?key)/i,Gh=[/\b(?:authorization|access[_-]?token|refresh[_-]?token|api[_-]?key|password|passwd|secret|session[_-]?id)\s*[:=]\s*\S+/i,/\b(?:bearer|basic)\s+[a-z0-9._~+/=-]{8,}/i,/\beyJ[a-z0-9_-]{8,}\.[a-z0-9_-]{8,}\.[a-z0-9_-]{8,}\b/i,/-----BEGIN [A-Z ]*PRIVATE KEY-----/i],Kh=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f\u202a-\u202e\u2066-\u2069\ufeff]/g,qh=/^[a-z0-9._:-]{1,180}$/i,Jh=/^[a-z0-9._/-]{1,96}$/i;function Yh(){try{let e=globalThis.location?.origin;if(e&&e!==`null`)return e}catch{}return Fh}function Xh(){let e=globalThis.crypto;if(e&&typeof e.randomUUID==`function`)return e.randomUUID();let t=Math.random().toString(36).slice(2);return`${Date.now().toString(36)}-${t}-${(++Uh).toString(36)}`}function Zh(e){let t=e.trim();if(!t||t.length>256||Kh.test(t))throw Kh.lastIndex=0,TypeError(`tab channel origin is invalid`);if(Kh.lastIndex=0,t.toLowerCase()===Fh)return Fh;try{let e=new URL(t);if(e.username||e.password||e.origin===`null`)throw TypeError(`tab channel origin cannot contain credentials`);return e.origin.toLowerCase()}catch(e){throw e instanceof TypeError&&e.message.includes(`credentials`)?e:TypeError(`tab channel origin is invalid`)}}function Qh(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function $h(e,t,n){let r=e.trim();return r.length<=n&&qh.test(r)?r:t}function eg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tg(e){return new TextEncoder().encode(e).byteLength}function ng(e){return Gh.some(t=>t.test(e))}function rg(e){let t=[e],n=new Set;for(;t.length>0;){let e=t.pop();if(typeof e==`string`){if(ng(e))return!0}else if(typeof e==`object`&&e){if(n.has(e))return!0;if(n.add(e),Array.isArray(e))t.push(...e);else for(let[n,r]of Object.entries(e)){if(Wh.test(n))return!0;t.push(r)}}}return!1}function ig(e,t,n=!1){if(typeof e!=`string`||tg(e)>t)return null;let r=e.replace(Kh,``);return ng(r)||!n&&r.length===0?null:r}function ag(e,t){if(e!==void 0)return ig(e,t,!0)}function og(e,t,n){if(e!==void 0)return typeof e!=`number`||!Number.isSafeInteger(e)||en?null:e}function sg(e){return e.state!==`active`&&e.state!==`hidden`&&e.state!==`leaving`||e.page!==void 0&&(typeof e.page!=`string`||!Jh.test(e.page))?null:{type:`presence`,state:e.state,...e.page===void 0?{}:{page:e.page}}}function cg(e){if(!eg(e.appearance)||e.etag!==void 0&&(typeof e.etag!=`string`||!/^[a-f0-9]{64}$/.test(e.etag)))return null;let t=e.appearance,n={};if(t.theme!==void 0){if(t.theme!==`system`&&t.theme!==`light`&&t.theme!==`dark`)return null;n.theme=t.theme}if(t.locale!==void 0){if(t.locale!==`en`&&t.locale!==`fa`)return null;n.locale=t.locale}if(t.direction!==void 0){if(t.direction!==`auto`&&t.direction!==`ltr`&&t.direction!==`rtl`)return null;n.direction=t.direction}for(let e of[`reduceMotion`,`compactNumbers`,`audioMuted`])if(t[e]!==void 0){if(typeof t[e]!=`boolean`)return null;n[e]=t[e]}if(t.audioVolume!==void 0){if(typeof t.audioVolume!=`number`||!Number.isFinite(t.audioVolume)||t.audioVolume<0||t.audioVolume>1)return null;n.audioVolume=t.audioVolume}return Object.keys(n).length===0?null:{type:`appearance`,appearance:n,...e.etag===void 0?{}:{etag:e.etag}}}function lg(e){if(!eg(e.entry))return null;let t=e.entry;if(t.kind!==`command`&&t.kind!==`output`&&t.kind!==`error`&&t.kind!==`system`)return null;let n=ig(t.text,zh),r=og(t.at,0,2**53-1);return n===null||r===null?null:{type:`terminal`,entry:{kind:t.kind,text:n,...r===void 0?{}:{at:r}}}}function ug(e){if(e===void 0)return;if(!eg(e)||Object.keys(e).length>Vh)return null;let t={};for(let[n,r]of Object.entries(e)){if(!n||n.length>64||Wh.test(n))return null;let e=ig(r,1024,!0);if(e===null)return null;t[n]=e}return t}function dg(e){if(!eg(e.event))return null;let t=e.event,n=og(t.id,0,2**53-1),r=ig(t.time,80),i=ig(t.kind,128),a=ig(t.text,Bh,!0);if(n==null||r===null||i===null||a===null)return null;let o=[`state`,`lifecycle`,`reason`,`source`,`target`,`message_type`,`action`,`severity`,`correlation`,`delivery`,`gesture`],s={};for(let e of o){let n=ag(t[e],e===`reason`?1024:256);if(n===null)return null;n!==void 0&&(s[e]=n)}let c;if(t.targets!==void 0){if(!Array.isArray(t.targets)||t.targets.length>32)return null;c=[];for(let e of t.targets){let t=ig(e,180);if(t===null)return null;c.push(t)}}let l=[`key`,`rf_id`,`rf_code`,`rf_bits`,`rf_protocol`],u={};for(let e of l){let n=e===`rf_code`?4294967295:2**53-1,r=og(t[e],0,n);if(r===null)return null;r!==void 0&&(u[e]=r)}let d=ug(t.metadata);return d===null?null:{type:`controller-event`,event:{id:n,time:r,kind:i,text:a,...s,...u,...c===void 0?{}:{targets:c},...d===void 0?{}:{metadata:d}}}}function fg(e){if(!eg(e)||!pg(e)||rg(e)||typeof e.type!=`string`)return null;switch(e.type){case`presence`:return sg(e);case`appearance`:return cg(e);case`terminal`:return lg(e);case`controller-event`:return dg(e);default:return null}}function pg(e){try{return tg(JSON.stringify(e))<=Rh}catch{return!1}}function mg(e={}){let t=Zh(e.origin??Yh()),n=e.now??Date.now,r=e.idFactory??(()=>Xh()),i=e.ttlMS??Ih;if(!Number.isSafeInteger(i)||i<1||i>Lh)throw RangeError(`tab channel ttlMS must be 1..${Lh}`);let a=typeof globalThis.BroadcastChannel==`function`?globalThis.BroadcastChannel:null,o=e.BroadcastChannel===void 0?a:e.BroadcastChannel,s=++Uh,c=`tab:${$h(r(`tab`),`fallback-${s.toString(36)}`,64)}:${s.toString(36)}`,l=`${Ph}:${Qh(t)}`,u=new Set,d=new Map,f=0,p=!1,m=null,h=e=>{for(let[t,n]of d)n<=e&&d.delete(t);for(;d.size>Hh;){let e=d.keys().next().value;if(e===void 0)break;d.delete(e)}},g=e=>{if(!eg(e)||!pg(e)||rg(e)||e.protocol!==`pccontroller.tab-sync`||e.origin!==t||typeof e.messageId!=`string`||!qh.test(e.messageId)||typeof e.tabId!=`string`||!qh.test(e.tabId)||e.tabId===c||typeof e.sentAt!=`number`||!Number.isSafeInteger(e.sentAt)||e.sentAt<0||typeof e.expiresAt!=`number`||!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=e.sentAt||e.expiresAt-e.sentAt>Lh)return null;let r=n();if(e.expiresAt<=r||e.sentAt>r+Lh||(h(r),d.has(e.messageId)))return null;let i=fg(e.payload);return i===null?null:(d.set(e.messageId,e.expiresAt),{protocol:Ph,origin:t,messageId:e.messageId,tabId:e.tabId,sentAt:e.sentAt,expiresAt:e.expiresAt,payload:i})},_=e=>{if(p)return;let t=g(e.data);if(t!==null)for(let e of[...u])try{e(t)}catch{}};if(o!==null)try{m=new o(l),m.addEventListener(`message`,_)}catch{m=null}let v=(e,a=i)=>{if(p||m===null||!Number.isSafeInteger(a)||a<1||a>Lh)return null;let o=fg(e);if(o===null)return null;let s=n();if(!Number.isSafeInteger(s)||s<0||s>2**53-1-a)return null;f+=1;let l=$h(r(`message`),`message-${f.toString(36)}`,64),u=`${c}:${f.toString(36)}:${l}`,g={protocol:Ph,origin:t,messageId:u,tabId:c,sentAt:s,expiresAt:s+a,payload:o};if(!pg(g))return null;try{return m.postMessage(g),d.set(u,g.expiresAt),h(s),u}catch{return null}};return{channelName:l,origin:t,supported:m!==null,tabId:c,publish:v,publishPresence:(e,t)=>v({type:`presence`,state:e,...t===void 0?{}:{page:t}}),publishAppearance:(e,t)=>v({type:`appearance`,appearance:e,...t===void 0?{}:{etag:t}}),publishTerminal:e=>v({type:`terminal`,entry:e}),publishControllerEvent:e=>v({type:`controller-event`,event:e}),subscribe(e){if(p)return()=>void 0;u.add(e);let t=!0;return()=>{t&&(t=!1,u.delete(e))}},close(){p||(p=!0,u.clear(),d.clear(),m!==null&&(m.removeEventListener(`message`,_),m.close(),m=null))}}}function hg(e,t){let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>!e.hidden&&/^(pwm\.\d+|relay\.\d+|seat\.[ab])$/.test(e.key)&&`${e.name} ${e.key} ${e.group??``} ${e.kind}`.toLocaleLowerCase().includes(n)):[]}function gg(e,t,n){let r=(e??``).trim().toLowerCase();return r===``||r===`*`||r===t.trim().toLowerCase()||r===n.trim().toLowerCase()}var _g=`default`,vg={sync:`navigation_sync`,group:`navigation_group`,epoch:`navigation_epoch`,revision:`navigation_revision`,source:`navigation_source`,catchUp:`navigation_catch_up`,operation:`navigation_operation_id`,targetEpoch:`navigation_target_epoch`,targetRevision:`navigation_target_revision`},yg=/^[A-Za-z0-9._-]{1,64}$/,bg=/^[A-Za-z0-9._:-]{1,180}$/,xg=/^[a-f0-9]{32}$/;function Sg(){let e=new Uint8Array(16);return globalThis.crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function Cg(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function wg(e){if(!e||!/^\d{1,20}$/.test(e))return null;let t=Number(e);return Cg(t)?t:null}function Tg(e){return[`dashboard`,`controls`,`workbench`,`device`,`data`,`updates`,`events`,`settings`].includes(e)}var Eg=class{epoch;group;reportSequence=0;operationSequence=0;coordinatorEpoch=``;coordinatorRevision=0;constructor(e=Sg(),t=_g){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase()||`default`;if(!xg.test(n))throw TypeError(`navigation epoch is invalid`);if(!yg.test(r))throw TypeError(`navigation group is invalid`);this.epoch=n,this.group=r}nextValues(e,t=!1){return this.reportSequence+=1,{[vg.sync]:e?`follow`:`independent`,[vg.group]:this.group,[vg.epoch]:this.epoch,[vg.revision]:String(this.reportSequence),...e&&t?{[vg.catchUp]:`true`}:{}}}nextCommit(e,t){if(!bg.test(e.trim()))throw TypeError(`navigation source is invalid`);return this.operationSequence+=1,{group:this.group,source:e.trim(),page:t,operation_id:`${this.epoch}-${this.operationSequence}`}}acceptAction(e,t){if(!e||e[vg.sync]?.toLowerCase()!==`group`||e[vg.group]?.toLowerCase()!==this.group||!Tg(t))return null;let n=e[vg.epoch]?.trim().toLowerCase()??``,r=wg(e[vg.revision]),i=e[vg.source]?.trim()??``;if(!xg.test(n)||r===null||!bg.test(i))return null;let a=e[vg.targetEpoch]?.trim().toLowerCase()??``,o=e[vg.targetRevision];if(a||o){let e=wg(o);if(a!==this.epoch||e===null||e=t&&e<=n}function qg(e){let{status:t}=e,n=e.hello.capabilities??0,r=e.connected&&e.have_status,i=r&&!!(n&Pg)&&!!(t.ina219_available||t.flags&Ag),a=r&&!!(n&Fg)&&!!(t.temperature_led_available||t.flags&Mg),o=r&&!!(n&Fg)&&!!(t.temperature_bt_audio_available||t.flags&Ng),s=Kg(t.supply_mv,0,1e5)&&Kg(t.bus_mv,0,1e5)&&Kg(t.current_ma,-1e5,1e5)&&Kg(t.power_mw,-1e7,1e7),c=Kg(t.temperature_led_centi_c,-5500,12500),l=Kg(t.temperature_bt_audio_centi_c,-5500,12500);return{ina219:i&&s,pwm:r&&!!(n&Ig)&&!!(t.pwm_available||t.flags&jg),temperatureLED:a&&c,temperatureBTAudio:o&&l,lcd:r&&!!(n&Bg)&&!!(e.front_panel?.lcd_available||e.front_panel?.lcd_address||t.lcd_address),bluetoothAudio:r&&!!(n&Wg),relays:r&&!!(n&Lg),rf:r&&!!(n&Rg),segments:r&&!!(n&zg),statusLED:r&&!!(n&Vg),settings:r&&!!(n&Hg),menus:r&&!!(n&Ug),buzzer:r&&!!(n&Gg),invalidINA219:i&&!s,invalidTemperatureLED:a&&!c,invalidTemperatureBTAudio:o&&!l}}var Jg={request:e=>window.requestAnimationFrame(e),cancel:e=>window.cancelAnimationFrame(e)},Yg=class{deliver;clock;generation=0;pending=[];frame=null;disposed=!1;constructor(e,t=Jg){this.deliver=e,this.clock=t}adoptGeneration(e){return this.disposed||!Number.isSafeInteger(e)||e<=0||e{if(this.frame=null,this.disposed||n!==this.generation||this.pending.length===0)return;let e=this.pending;this.pending=[],this.deliver(e,n)}),!0}cancelPending(e){this.disposed||e!==this.generation||(this.pending=[],this.frame!==null&&(this.clock.cancel(this.frame),this.frame=null))}dispose(){this.disposed||(this.disposed=!0,this.pending=[],this.frame!==null&&(this.clock.cancel(this.frame),this.frame=null))}};function Xg(e,t=Date.now()){let n=e.status,r=qg(e);return{at:t,...r.ina219?{supply:n.supply_mv/1e3,bus:n.bus_mv/1e3,current:n.current_ma,power:n.power_mw/1e3}:{},...r.temperatureLED?{ledTemp:n.temperature_led_centi_c/100}:{},...r.temperatureBTAudio?{btTemp:n.temperature_bt_audio_centi_c/100}:{}}}function Zg(e){return e.connected?JSON.stringify([e.port.instance_id||``,e.port.serial_number||``,e.port.name||``,e.hello.board_kind??null,e.hello.name||``,e.hello.build_hash??null,e.hello.build_timestamp||``,e.hello.capabilities??null]):``}function Qg(e,t,n,r=Date.now()){if(!n.connected||!n.have_status)return[];let i=Xg(n,r);return Zg(t)===Zg(n)?[...e.slice(-71),i]:[i]}function $g(e,t,n){let r=e,i=t,a=``,o=0;for(let e of n){if(e.error){a=e.error;continue}a=``;let t={...r,connected:!0,have_status:!0,status:e.status,status_updated:e.time};i=Qg(i,r,t,new Date(e.time).getTime()),r=t,o+=1}return{snapshot:r,samples:i,detail:a,applied:o}}function e_(e,t){return e.epoch===t.epoch&&(e.instanceID?.trim()??``)===(t.instanceID?.trim()??``)}function t_(e,t){if(t.epoche.epoch?{epoch:t.epoch,...n?{instanceID:n}:{}}:n?{epoch:e.epoch,instanceID:n}:e}function n_(e,t){let n=e.host_instance_id?.trim()??``,r=t.instanceID?.trim()??``;return n===``||r===``||n===r}var r_=e=>{if(e===void 0||e.trim()===``)return null;let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255?t:null};function i_(e){if(e.kind.toLowerCase()!==`status_led.changed`)return null;let t=r_(e.metadata?.red),n=r_(e.metadata?.green),r=r_(e.metadata?.blue),i=r_(e.metadata?.brightness),a=r_(e.metadata?.effect),o=r_(e.metadata?.condition);return[t,n,r,i,a,o].some(e=>e===null)?null:{red:t,green:n,blue:r,brightness:i,effect:a,condition:o}}var a_=e=>{let t=Number(e.metadata?.revision);return Number.isSafeInteger(t)&&t>0?t:0};function o_(e=0,t=0,n=0,r=0){return e===0&&n===0?`unknown`:e===0?`newer`:n===0||ne?`newer`:t===0&&r===0?`unknown`:t===0?`newer`:r===0||r(e.status_led_epoch??0);return o===`older`||e.have_status_led&&(o===`equal`||!t.have_status_led&&!s)?{...r,host_instance_id:e.host_instance_id,status_led:e.status_led,have_status_led:!0,status_led_updated:e.status_led_updated,status_led_revision:e.status_led_revision,status_led_epoch:e.status_led_epoch}:e.have_status_led&&!t.have_status_led?{...r,status_led:e.status_led,have_status_led:!0,status_led_updated:e.status_led_updated}:r}function l_(e){if(e.kind.toLowerCase()!==`front_panel.segment`)return null;let t=e.metadata?.raw_segments?.trim(),n=r_(e.metadata?.brightness);return!t||!/^[0-9a-f]{8}$/i.test(t)||n===null?null:{raw_segments:[0,2,4,6].map(e=>Number.parseInt(t.slice(e,e+2),16)),brightness:n}}function u_(e){let t=e.kind.trim().toLowerCase();return t===`status_led.changed`||t===`front_panel.segment`}function d_(e,t,n={epoch:0}){let r=t.metadata?.connection_generation;if(r!==void 0&&Number(r)!==e.connection_generation)return e;if(i_(t))return s_(e,t,n);let i=l_(t);if(!i)return e;let a=e.front_panel??{schema:0,raw_segments:[0,0,0,0],brightness:0,blink:!1,segments_active:!1,category_selector:!1,lcd_address:0,lcd_available:!1,lcd_backlight:!1,lcd_line_1:``,lcd_line_2:``,pressed_keys:0,menu_page:0,program_mode:0,host_captured:!1,host_state:0,host_editable_value:0};return{...e,front_panel:{...a,...i,segments_active:!0},have_front_panel_segments:!0,front_panel_updated:t.time}}var f_=Object.freeze(Array.from({length:11},(e,t)=>t));function p_(e){return Number.isFinite(e)?Math.max(0,Math.min(4095,Math.round(e))):0}function m_(e,t){let n=p_(e)/4095;return t?.curve===`gamma`&&(n=__(n,t.gamma)),Math.round(n*1e3)/10}function h_(e,t){if(!Number.isFinite(e))return 0;let n=Math.max(0,Math.min(100,e))/100;t?.curve===`gamma`&&(n=g_(n,t.gamma));let r=p_(n*4095);return e>0&&r===0?1:r}function g_(e,t){let n=.04,r=(t-1)*n,i=(t*n/(1+r))**t;return e<=n?e*i/n:((e+r)/(1+r))**+t}function __(e,t){let n=.04,r=(t-1)*n,i=(t*n/(1+r))**t;return e<=i?e*n/i:e**(1/t)*(1+r)-r}function v_(e){if(typeof e?.available!=`boolean`||!Number.isInteger(e?.selected_channel)||e.selected_channel<0||e.selected_channel>15||!Array.isArray(e?.values)||e.values.length!==16)throw Error(`Controller returned an invalid PWM snapshot`);let t=e.values.map(e=>{if(!Number.isInteger(e)||e<0||e>4095)throw Error(`Controller returned an out-of-range PWM value`);return e}),n=e.channels?.map(e=>({...e,config:{...e.config}}));return{...e,available:e.available,selected_channel:e.selected_channel,values:t,channels:n}}var y_=class{queued=[];active=!1;run(e){return new Promise((t,n)=>{this.queued.push(()=>{let r;try{r=e()}catch(e){n(e),this.advance();return}r.then(e=>{t(e),this.advance()},e=>{n(e),this.advance()})}),this.drain()})}drain(){if(this.active)return;let e=this.queued.shift();e&&(this.active=!0,e())}advance(){this.active=!1,this.drain()}},b_=class{intervalMS;options;timer=null;readAbort=null;generation=0;running=!1;constructor(e){this.options=e,this.intervalMS=Math.max(250,Math.min(3e4,Math.round(e.intervalMS??1500)))}start(){if(this.running)return;this.running=!0;let e=++this.generation;this.schedule(0,e)}stop(){this.running=!1,this.generation++,this.timer!==null&&clearTimeout(this.timer),this.timer=null,this.readAbort?.abort(),this.readAbort=null}schedule(e,t){this.running&&t===this.generation&&(this.timer=setTimeout(()=>{this.timer=null,this.tick(t)},e))}async tick(e){if(!this.running||e!==this.generation)return;if(!this.options.canRead()){this.schedule(this.intervalMS,e);return}let t=new AbortController;this.readAbort=t;try{let n=v_(await this.options.operations.run(()=>this.options.read(t.signal)));this.running&&e===this.generation&&this.options.onAuthoritative(n)}catch(t){this.running&&e===this.generation&&this.options.onError(t instanceof Error?t:Error(String(t)))}finally{this.readAbort===t&&(this.readAbort=null),this.options.eventDriven||this.schedule(this.intervalMS,e)}}},x_=class{delayMS;options;operations;desired=new Map;inFlight=new Set;timers=new Map;editing=new Set;revision=0;disposed=!1;constructor(e){this.options=e,this.operations=e.operations??new y_,this.delayMS=Math.max(0,Math.round(e.delayMS??140))}schedule(e,t,n=!1){if(this.disposed)return;if(!f_.includes(e)){this.options.onError(e,Error(`Generic PWM controls are limited to user channels 0..10`),!0);return}let r=p_(t);this.desired.set(e,{value:r,revision:++this.revision}),this.options.onDraft(e,r);let i=this.timers.get(e);i&&clearTimeout(i),this.timers.delete(e),this.notifyPending(),n?this.flush(e):this.timers.set(e,setTimeout(()=>{this.timers.delete(e),this.flush(e)},this.delayMS))}pendingChannels(){return[...new Set([...this.desired.keys(),...this.inFlight,...this.editing])].sort((e,t)=>e-t)}beginEdit(e){!this.disposed&&f_.includes(e)&&(this.editing.add(e),this.notifyPending())}isEditing(e){return this.editing.has(e)}endEdit(e){this.editing.delete(e);let t=this.timers.get(e);t&&clearTimeout(t),this.timers.delete(e),this.desired.has(e)&&this.flush(e),this.notifyPending()}dispose(){this.disposed=!0;for(let e of this.timers.values())clearTimeout(e);this.timers.clear(),this.desired.clear(),this.editing.clear()}async flush(e){if(this.disposed||this.inFlight.has(e))return;let t=this.desired.get(e);if(t){this.inFlight.add(e),this.notifyPending();try{let n=v_(await this.operations.run(()=>this.options.commit(e,t.value)));if(this.disposed)return;let r=this.desired.get(e)?.revision===t.revision;r&&this.desired.delete(e),this.options.onAuthoritative(n,r?e:null)}catch(n){if(this.disposed)return;let r=this.desired.get(e);r?.revision===t.revision&&this.desired.delete(e),this.options.onError(e,n instanceof Error?n:Error(String(n)),r?.revision===t.revision)}finally{this.inFlight.delete(e),!this.disposed&&this.desired.has(e)&&this.flush(e),this.notifyPending()}}}notifyPending(){this.disposed||this.options.onPending(this.pendingChannels())}};function S_(e,t,n){if(!e.connected||!n||n!==e.host_instance_id||t.host_instance_id!==n||t.connection_generation!==e.connection_generation||!Number.isSafeInteger(t.revision)||t.revision<=(e.pwm_revision??0)||!t.time||!Number.isFinite(Date.parse(t.time))||!Array.isArray(t.channels)||t.channels.length!==16||new Set(t.channels.map(e=>e.channel)).size!==16||t.channels.some(e=>!Number.isInteger(e.channel)||e.channel<0||e.channel>15||!Number.isInteger(e.raw_value)||e.raw_value<0||e.raw_value>4095||!Number.isFinite(e.logical_percent)||e.logical_percent<0||e.logical_percent>100))return e;try{let n=v_(t);return{...e,pwm_values:n,pwm_revision:t.revision,pwm_updated:t.time}}catch{return e}}function C_(e,t){return t.connected&&e.host_instance_id===t.host_instance_id&&e.connection_generation===t.connection_generation&&(e.pwm_revision??0)>(t.pwm_revision??0)?{...t,pwm_values:e.pwm_values,pwm_revision:e.pwm_revision,pwm_updated:e.pwm_updated}:t}var w_=3e8,T_=250,E_=8,D_=class{anchors=new Map;plan(e,t){if(!Number.isFinite(t)||!Number.isFinite(e.frequencyHz)||e.frequencyHz<0||!Number.isFinite(e.durationMS)||e.durationMS<0||e.durationMS>6e4||e.durationMS===0&&e.frequencyHz!==0)return null;let n=t+E_;if(e.deviceMicros!==void 0){if(!Number.isInteger(e.deviceMicros)||e.deviceMicros<0||e.deviceMicros>4294967295)return null;let r=e.deviceMicros>>>0,i=e.generation?.trim()??``,a=this.anchors.get(e.source);if(a){let e=r-a.deviceMicros>>>0,o=a.startMS+e/1e3,s=o>=t-T_&&o<=t+T_;a.generation===i&&e<=w_&&s&&(n=o)}this.anchors.set(e.source,{deviceMicros:r,startMS:n,generation:i})}let r=n+e.durationMS,i=Math.max(0,r-Math.max(n,t));return{delayMS:Math.max(0,n-t),durationMS:i,audible:e.frequencyHz>=20&&e.frequencyHz<=2e4&&i>=1,stop:e.frequencyHz===0}}};function O_(e,t){return!e&&!t?`both`:e?t?`none`:`host`:`board`}var k_=new Set([`cancelled`,`completed`,`failed`,`local-cancelled`,`local-completed`,`local-failed`]),A_=new Set([`saved`,`saved-truncated`,`discarded`,`failed`,`cleared`]);function j_(e,t,n){let r=Number(e.metadata?.[t]);return Number.isFinite(r)?r:n}function M_(e,t){return{id:j_(e,`macro_id`,t.id??0),name:e.metadata?.macro_name||t.name}}function N_(e){let t=e.kind.trim().toLowerCase();return t===`macro`||t.startsWith(`macro.`)}function P_(e,t,n=80){return N_(t)?[t,...e.filter(e=>e.id!==t.id)].slice(0,n):e.slice(0,n)}function F_(e){let t=e.kind.trim().toLowerCase();return t===`macro.library`||t===`macro.recording`||t===`macro.recovery`}function I_(e,t){if(!N_(t))return e;let n=t.kind.trim().toLowerCase(),r=(t.lifecycle||t.state||``).trim().toLowerCase(),i={...e,latest_event_id:Math.max(e.latest_event_id??0,t.id),playback:{...e.playback},recording:{...e.recording},library:e.library};if(n===`macro.recording.step`){let e=M_(t,i.recording);return i.recording={...i.recording,...e,active:!0,steps:j_(t,`step`,i.recording.steps),last_at_us:j_(t,`at_us`,i.recording.last_at_us??0),last_delta_us:j_(t,`delta_us`,i.recording.last_delta_us??0),last_opcode:j_(t,`opcode`,i.recording.last_opcode??0),last_source:j_(t,`source`,i.recording.last_source??0)},i}if(n===`macro.recording`){let e=!A_.has(r)&&!r.startsWith(`saved`)&&r!==`idle`;return i.recording={...i.recording,active:e,last_error:r===`failed`?t.reason||t.text:i.recording.last_error},i}if(n===`macro`||n===`macro.playback`||n===`macro.step`){let e=M_(t,i.playback),a=k_.has(r);i.playback={...i.playback,...e,category:t.metadata?.category??i.playback.category,color:t.metadata?.color??i.playback.color,running:n===`macro.step`||!a&&r!==`idle`,lifecycle:r||i.playback.lifecycle,step:j_(t,`step`,i.playback.step),step_count:j_(t,`steps`,i.playback.step_count),last_timing_delta_us:j_(t,`mcu_delta_us`,i.playback.last_timing_delta_us??0),maximum_timing_error_us:j_(t,`timing_error_us`,i.playback.maximum_timing_error_us),underruns:j_(t,`underruns`,i.playback.underruns??0),dispatch_errors:j_(t,`dispatch_errors`,i.playback.dispatch_errors??0),faithful:t.metadata?.faithful===void 0?i.playback.faithful:t.metadata.faithful===`true`,last_error:r===`failed`?t.reason||t.text:i.playback.last_error}}return i}var L_={connected:!1,paused:!1,port:{},hello:{},status:{uptime_ms:0,supply_mv:0,bus_mv:0,current_ma:0,power_mw:0,temperature_led_centi_c:0,temperature_bt_audio_centi_c:0,flags:0,ina219_available:!1,temperature_led_available:!1,temperature_bt_audio_available:!1,program_running:!1,host_offline:!1,hot:!1,raw_inputs:0,active_keys:0,active_relays:0,menu_page:0,program_mode:0,door_open:!1,bluetooth_audio_state:0,pwm_available:!1,pwm_channel:0,pwm_value:0,lcd_address:0,pwm_errors:0,framing_errors:0,crc_errors:0,reset_cause:0,reset_count:0},settings:{flags:0,light_mode:0,on_brightness:0,off_brightness:0,display_brightness:0,display_closed_brightness:0,motion_exit_hold_seconds:2,status_brightness:0,output_persistence:0,relay_restore_mask:0,stream_period_ms:200,default_page:0,extended_flags:0,motion_break_ms:1,persisted:!1},have_status:!1,have_settings:!1,emergency_stop:{active:!1,revision:0},hardware_problems:[],illumination:{available:!1,mode:0,on_brightness:0,off_brightness:0,door_open:!1,target_brightness:0,target_pwm:0,applied_brightness:0,applied_pwm:0,at_target:!1,persisted:!1},front_panel:{schema:0,raw_segments:[0,0,0,0],brightness:0,blink:!1,segments_active:!1,category_selector:!1,lcd_address:0,lcd_available:!1,lcd_backlight:!1,lcd_line_1:``,lcd_line_2:``,pressed_keys:0,menu_page:0,program_mode:0,host_captured:!1,host_state:0,host_editable_value:0},have_front_panel:!1,connection_state:`offline`},R_=/\b(?:http\s*)?401\b|unauthori[sz]ed|authentication (?:required|rejected|failed)|invalid (?:session )?token|token (?:is )?(?:missing|invalid|rejected|required|expired)/i;function z_(e){return e.streamState===`open`?!1:R_.test(`${e.streamDetail??``} ${e.connectionReason??``}`)?!0:e.hostRequiresAuthentication?!e.token.trim():!1}function B_(e,t){let n=t===`fa`,r=n?`خرابی سخت‌افزار کنترلر`:`Controller hardware failure`,i=n?`کابل داده، برق و درگاه USB کنترلر را بررسی کنید.`:`Check the controller data cable, power, and USB port.`;switch(e.code){case`usb_descriptor_failure`:r=n?`خرابی اتصال USB کنترلر`:`Controller USB connection failed`,i=n?`دریافت شناسهٔ دستگاه USB ناموفق بود. کابل داده، برق و درگاه USB کنترلر را بررسی کنید.`:`The USB device descriptor failed. Check the controller data cable, power, or try another USB port.`;break;case`device_cannot_start`:case`device_reported_problem`:r=n?`دستگاه USB کنترلر راه‌اندازی نشد`:`Controller USB device could not start`,i=n?`کنترلر را دوباره متصل کنید یا از کابل و درگاه USB دیگری استفاده کنید.`:`Reconnect the controller or use another data cable and USB port.`;break;case`device_disabled`:r=n?`دستگاه کنترلر غیرفعال است`:`Controller device is disabled`,i=n?`دستگاه را در «مدیریت دستگاه‌ها» فعال کنید و سپس دوباره متصل شوید.`:`Enable the device in Device Manager, then reconnect.`;break;case`device_driver_missing`:case`device_driver_failure`:r=n?`درایور USB کنترلر خراب است`:`Controller USB driver problem`,i=n?`درایور USB کنترلر را نصب یا تعمیر کنید و سپس دستگاه را دوباره متصل کنید.`:`Install or repair the controller USB driver, then reconnect the device.`;break;case`device_removal_pending`:r=n?`جداسازی کنترلر در انتظار است`:`Controller removal is pending`,i=n?`کنترلر را جدا کنید و دوباره وصل کنید.`:`Unplug the controller and reconnect it.`}let a=e.impact===`active_operation_outcome_unknown`?n?`ارتباط هنگام یک عملیات فعال قطع شد و نتیجهٔ آن نامشخص است. پیش از ادامه، وضعیت سخت‌افزار را بررسی کنید.`:`Communication was lost during an active operation and its outcome is unknown. Verify the hardware state before continuing.`:void 0;return{title:r,guidance:i,impact:a}}var V_=new Set([`app.page`,`app.title`,`app.progress`]);function H_(e,t,n=Date.now()){let r=e.metadata?.operation_id?.trim()??``,i=e.metadata?.operation_delivery_id?.trim()??``,a=e.metadata?.operation_expires_at?.trim()??``,o=e.kind.trim().toLowerCase();if(!r||!i||!a||!V_.has(o)||!gg(e.metadata?.target_instance,t,`webui`))return null;let s=Date.parse(a);return!Number.isFinite(s)||s<=n?null:{operationID:r,deliveryID:i,receiptKey:`${r}\u0000${i}`,kind:o,value:(o===`app.page`?e.metadata?.page:e.metadata?.value)?.trim()??``}}function U_(e){switch(e.kind){case`app.page`:{let t=Vm(e.value);return t?{outcome:`applied`,page:t}:{outcome:`rejected`,reason:`unknown_page`}}case`app.title`:return e.value.toLowerCase()===`auto`?{outcome:`applied`,title:null}:!e.value||[...e.value].length>120||/[\u0000-\u001f\u007f]/u.test(e.value)?{outcome:`rejected`,reason:`invalid_title`}:{outcome:`applied`,title:e.value};case`app.progress`:{let t=G_(e.value);return t===void 0?{outcome:`rejected`,reason:`invalid_progress`}:{outcome:`applied`,progress:t}}}}function W_(e,t){return e.outcome===`applied`&&(`page`in e?t.replacePage(e.page):`title`in e?t.setTitle(e.title):t.setProgress(e.progress),!0)}function G_(e){let t=e.trim().toLowerCase().split(/\s+/u).filter(Boolean);if(t.length===0||t.length>2)return;let n={0:`clear`,clear:`clear`,1:`normal`,normal:`normal`,2:`error`,error:`error`,3:`indeterminate`,indeterminate:`indeterminate`,4:`warning`,warning:`warning`}[t[0]];if(!n)return;if(n===`clear`)return t.length===1?null:void 0;if(n===`indeterminate`)return t.length===1?{state:n}:void 0;if(t.length!==2||!/^\d{1,3}$/u.test(t[1]))return;let r=Number(t[1]);if(!(!Number.isInteger(r)||r<0||r>100))return{state:n,percent:r}}var K_=class{maximum;values=new Map;constructor(e=256){this.maximum=e}get(e){return this.values.get(e)}remember(e,t){if(!this.values.has(e)&&this.values.size>=this.maximum){let e=this.values.keys().next().value;e&&this.values.delete(e)}this.values.set(e,t)}};function q_(e,t,n,r=Date.now()){let i=H_(e,t,r);if(!i)return null;let a=n.get(i.receiptKey);if(a)return{action:i,acknowledgement:a,duplicate:!0};let o=U_(i),s={operation_id:i.operationID,delivery_id:i.deliveryID,instance_id:t,state:o.outcome,...o.outcome===`rejected`?{reason:o.reason}:{}};return n.remember(i.receiptKey,s),{action:i,effect:o,acknowledgement:s,duplicate:!1}}var J_=3,Y_=100;function X_(e){return new Promise(t=>globalThis.setTimeout(t,e))}async function Z_(e,t,n=X_){let r;for(let i=1;i<=J_;i+=1)try{await t(e);return}catch(e){r=e,it===`fa`?n:e;if((0,E.useEffect)(()=>{e&&c(`appearance`)},[e]),(0,E.useEffect)(()=>{if(e)return u.current=document.activeElement,()=>{let e=u.current;u.current=null,window.requestAnimationFrame(()=>e?.focus())}},[e]),(0,E.useEffect)(()=>{if(!e)return;let t=window.requestAnimationFrame(()=>l.current?.querySelector(`button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]:not([tabindex="-1"])`)?.focus()),n=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopImmediatePropagation(),o();return}if(e.key!==`Tab`||!l.current)return;let t=[...l.current.querySelectorAll(`button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]:not([tabindex="-1"])`)];if(!t.length)return;let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,n,!0),()=>{window.cancelAnimationFrame(t),document.removeEventListener(`keydown`,n,!0)}},[o,e]),!e)return null;let f=(e,t)=>{a({...r,[e]:t})},p=e=>c(e);return(0,Y.jsxs)(`div`,{className:`app-preferences-layer`,role:`presentation`,children:[(0,Y.jsx)(`button`,{type:`button`,className:`app-preferences-backdrop`,"aria-label":d(`Close application preferences`,`بستن ترجیحات برنامه`),onClick:o}),(0,Y.jsxs)(`section`,{ref:l,className:`app-preferences-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`app-preferences-title`,children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(Je,{size:19}),(0,Y.jsx)(`strong`,{id:`app-preferences-title`,children:d(`Application preferences`,`ترجیحات برنامه`)})]}),(0,Y.jsx)(sp,{compact:!0,"aria-label":d(`Close application preferences`,`بستن ترجیحات برنامه`),icon:ct,onClick:o,children:d(`Close`,`بستن`)})]}),(0,Y.jsxs)(`div`,{className:`app-preferences-tabs`,role:`tablist`,"aria-label":d(`Preference category`,`دستهٔ ترجیحات`),children:[(0,Y.jsxs)(`button`,{id:`app-preferences-tab-appearance`,type:`button`,role:`tab`,"aria-selected":s===`appearance`,"aria-controls":`app-preferences-panel-appearance`,tabIndex:s===`appearance`?0:-1,className:s===`appearance`?`is-active`:``,onClick:()=>p(`appearance`),children:[(0,Y.jsx)(We,{size:16}),d(`Appearance`,`ظاهر`)]}),(0,Y.jsxs)(`button`,{id:`app-preferences-tab-header`,type:`button`,role:`tab`,"aria-selected":s===`header`,"aria-controls":`app-preferences-panel-header`,tabIndex:s===`header`?0:-1,className:s===`header`?`is-active`:``,onClick:()=>p(`header`),children:[(0,Y.jsx)(Je,{size:16}),d(`Quick header`,`نوار سریع`)]})]}),s===`appearance`?(0,Y.jsxs)(`div`,{id:`app-preferences-panel-appearance`,className:`app-preferences-content`,role:`tabpanel`,"aria-labelledby":`app-preferences-tab-appearance`,children:[(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:d(`Theme`,`پوسته`)}),(0,Y.jsx)(gp,{value:n.theme,label:d(`Theme`,`پوسته`),options:[{value:`system`,label:d(`System`,`سیستم`),icon:We},{value:`dark`,label:d(`Dark`,`تیره`)},{value:`light`,label:d(`Light`,`روشن`)}],onChange:e=>i({...n,theme:e})})]}),(0,Y.jsxs)(`label`,{className:`app-preferences-select`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(j,{size:16}),d(`Language`,`زبان`)]}),(0,Y.jsxs)(`select`,{value:n.locale,onChange:e=>i({...n,locale:e.target.value}),children:[(0,Y.jsx)(`option`,{value:`en`,children:`English`}),(0,Y.jsx)(`option`,{value:`fa`,children:`فارسی`})]})]}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:d(`Direction`,`جهت`)}),(0,Y.jsx)(gp,{value:n.direction,label:d(`Direction`,`جهت`),options:[{value:`auto`,label:d(`Auto`,`خودکار`)},{value:`ltr`,label:d(`Left to right`,`چپ به راست`)},{value:`rtl`,label:d(`Right to left`,`راست به چپ`)}],onChange:e=>i({...n,direction:e})})]}),(0,Y.jsx)(mp,{checked:n.reduceMotion,onChange:e=>i({...n,reduceMotion:e}),label:d(`Reduce interface motion`,`کاهش حرکت رابط`),detail:d(`Applies to this browser and is synchronized by the host.`,`در همین مرورگر اعمال می‌شود و میزبان آن را همگام نگه می‌دارد.`)}),(0,Y.jsx)(mp,{checked:n.compactNumbers,onChange:e=>i({...n,compactNumbers:e}),label:d(`Compact large numbers`,`فشرده‌سازی اعداد بزرگ`)}),(0,Y.jsx)(mp,{checked:!n.audioMuted,onChange:e=>i({...n,audioMuted:!e}),label:(0,Y.jsxs)(`span`,{className:`setting-icon-label`,children:[(0,Y.jsx)(nt,{size:16}),d(`Interaction audio`,`صدای تعامل`)]})}),!n.audioMuted&&(0,Y.jsx)(hp,{label:(0,Y.jsxs)(`span`,{className:`setting-icon-label`,children:[(0,Y.jsx)(Ce,{size:16}),d(`Interaction volume`,`بلندی صدای تعامل`)]}),value:Math.round(n.audioVolume*100),min:0,max:100,unit:`%`,onChange:e=>i({...n,audioVolume:e/100})})]}):(0,Y.jsxs)(`div`,{id:`app-preferences-panel-header`,className:`app-preferences-content`,role:`tabpanel`,"aria-labelledby":`app-preferences-tab-header`,children:[(0,Y.jsx)(`p`,{children:d(`Choose which optional controls appear in the quick header. The preferences button remains visible so every choice is reversible.`,`انتخاب کنید کدام کنترل‌های اختیاری در نوار سریع نمایش داده شوند. دکمهٔ ترجیحات همیشه دیده می‌شود تا همهٔ انتخاب‌ها برگشت‌پذیر باشند.`)}),(0,Y.jsx)(mp,{checked:r.theme,onChange:e=>f(`theme`,e),label:d(`Theme switch`,`تغییر پوسته`)}),(0,Y.jsx)(mp,{checked:r.language,onChange:e=>f(`language`,e),label:d(`Language switch`,`تغییر زبان`)}),(0,Y.jsx)(mp,{checked:r.audio,onChange:e=>f(`audio`,e),label:d(`Interaction audio`,`صدای تعامل`)}),(0,Y.jsx)(mp,{checked:r.hotkeys,onChange:e=>f(`hotkeys`,e),label:d(`Keyboard guide`,`راهنمای صفحه‌کلید`)}),(0,Y.jsx)(mp,{checked:r.notifications,onChange:e=>f(`notifications`,e),label:d(`Event notifications`,`اعلان رویدادها`)})]}),(0,Y.jsx)(`footer`,{children:d(`These preferences affect the host interface only. Controller settings remain on the Settings page.`,`این ترجیحات فقط روی رابط میزبان اثر می‌گذارند. تنظیمات کنترلر در صفحهٔ تنظیمات باقی می‌مانند.`)})]})]})}var $_=`pccontroller:state`;function ev(e){if(typeof window>`u`)return()=>void 0;let t=window.PCController;return Object.defineProperty(window,"PCController",{configurable:!0,value:Object.freeze(e)}),()=>{window.PCController===e&&(t===void 0?delete window.PCController:Object.defineProperty(window,"PCController",{configurable:!0,value:t}))}}function tv(e){typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent($_,{detail:Object.freeze({...e})}))}var nv=[`theme`,`language`,`audio`,`hotkeys`,`notifications`],rv={theme:!0,language:!0,audio:!0,hotkeys:!0,notifications:!0},iv=`pccontroller.quick-header-controls`;function av(e){let t=e&&typeof e==`object`?e:{};return Object.fromEntries(nv.map(e=>[e,typeof t[e]==`boolean`?t[e]:rv[e]]))}function ov(){try{return av(JSON.parse(window.localStorage.getItem(iv)??`null`))}catch{return{...rv}}}function sv(e){try{window.localStorage.setItem(iv,JSON.stringify(av(e)))}catch{}}function cv(e){switch(e.severity?.trim().toLowerCase()){case`success`:return`success`;case`warning`:return`warning`;case`error`:return`danger`;default:return`info`}}function lv(e,t,n){return e===`fa`?n:t}function uv(e,t){if(e.kind.trim().toLowerCase()!==`message`||!Number.isSafeInteger(e.id)||e.id<=0)return null;let n=e.action?.trim()||void 0,r=e.correlation?.trim()||void 0;return{tone:cv(e),title:e.metadata?.title?.trim()||e.message_type?.trim()||lv(t,`Message`,`پیام`),detail:e.text,messageEventID:e.id,correlation:r,action:n,actionLabel:n?e.metadata?.action_label?.trim()||lv(t,`Suggested action`,`عملیات پیشنهادی`):void 0,persistent:!!(n||r)}}function dv(e,t=`unknown`){if(!Number.isFinite(e)||e==null||e<0)return t;if(e===0)return`0 B`;let n=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],r=Math.min(n.length-1,Math.floor(Math.log(e)/Math.log(1024))),i=e/1024**r,a=r===0||i>=100?0:i>=10?1:2;return`${i.toFixed(a)} ${n[r]}`}function fv(e,t,n=`unknown`){return`${dv(e,n)} / ${dv(t,n)}`}var pv=new Set([`completed`,`failed`,`cancelled`,`downloaded`,`staged`,`outcome-uncertain`]);function mv(e,t){return{host:[`Host update`,`به‌روزرسانی میزبان`],firmware:[`Firmware update`,`به‌روزرسانی میان‌افزار`],eeprom:[`EEPROM update`,`به‌روزرسانی EEPROM`],"artifact-fetch":[`Artifact download`,`دریافت فایل`],"artifact-upload":[`Artifact upload`,`ارسال فایل`],"peer-artifact-upload":[`Incoming host update`,`دریافت به‌روزرسانی میزبان`],"device-capture":[`Board readback`,`بازخوانی برد`]}[e]?.[+(t===`fa`)]??e.replaceAll(`-`,` `)}function hv(e,t){let n=e.kind.trim().toLowerCase();if(!/^(update|peer-update)\./.test(n))return null;let r=e.metadata,i=r?.operation_id?.trim();if(!i)return null;let a=(r?.state||n.split(`.`).slice(1).join(`.`)).trim().toLowerCase(),o=(r?.kind||(n.startsWith(`peer-update.`)?`host`:`update`)).trim().toLowerCase(),s=(r?.stage||a).replaceAll(`-`,` `),c=Number(r?.progress_percent),l=r?.progress_known===`true`&&Number.isFinite(c),u=l?Math.max(0,Math.min(100,c)):void 0,d=Number(r?.bytes_done),f=Number(r?.bytes_total),p=Number.isFinite(d)&&d>=0?d:void 0,m=Number.isFinite(f)&&f>0?f:void 0,h=pv.has(a);return{tone:a===`failed`?`danger`:a===`cancelled`||a===`outcome-uncertain`?`warning`:h?`success`:`info`,title:`${mv(o,t)} · ${s}`,detail:e.text||r?.detail,persistent:!h,updateOperationID:i,progressKnown:l,progressPercent:u,bytesDone:p,bytesTotal:m,progressLabel:m===void 0?l?`${u}%`:t===`fa`?`در حال انتقال`:`Transfer in progress`:fv(p??0,m)}}var gv=`modulepreload`,_v=function(e){return`/`+e},vv={},yv=function(e){return e.pathname.endsWith(`.css`)},bv=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},xv=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=_v(t,n);let r=s(t),i=yv(r);return bv(vv,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:gv,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Sv=(0,E.lazy)(()=>xv(async()=>{let{DashboardView:e}=await import(`./chunk-FwOzfXMP.js`);return{DashboardView:e}},__vite__mapDeps([0,1,2,3,4,5,6,7])).then(({DashboardView:e})=>({default:e}))),Cv=(0,E.lazy)(()=>xv(async()=>{let{ControlsView:e}=await import(`./chunk-FwOzfXMP.js`);return{ControlsView:e}},__vite__mapDeps([0,1,2,3,4,5,6,7])).then(({ControlsView:e})=>({default:e}))),wv=(0,E.lazy)(()=>xv(async()=>{let{LocalDeviceView:e}=await import(`./chunk-FwOzfXMP.js`);return{LocalDeviceView:e}},__vite__mapDeps([0,1,2,3,4,5,6,7])).then(({LocalDeviceView:e})=>({default:e}))),Tv=(0,E.lazy)(()=>xv(async()=>{let{EventsView:e}=await import(`./chunk-FwOzfXMP.js`);return{EventsView:e}},__vite__mapDeps([0,1,2,3,4,5,6,7])).then(({EventsView:e})=>({default:e}))),Ev=(0,E.lazy)(()=>xv(async()=>{let{SettingsView:e}=await import(`./chunk-FwOzfXMP.js`);return{SettingsView:e}},__vite__mapDeps([0,1,2,3,4,5,6,7])).then(({SettingsView:e})=>({default:e}))),Dv=(0,E.lazy)(()=>xv(async()=>{let{WorkbenchView:e}=await import(`./chunk-DXoxHaI-.js`);return{WorkbenchView:e}},__vite__mapDeps([8,4,5,3,9,7,10])).then(({WorkbenchView:e})=>({default:e}))),Ov=(0,E.lazy)(()=>xv(async()=>{let{DataWorkspaceView:e}=await import(`./chunk-DBQKI-WA.js`);return{DataWorkspaceView:e}},__vite__mapDeps([11,1,2,3,12,7])).then(({DataWorkspaceView:e})=>({default:e}))),kv=(0,E.lazy)(()=>xv(async()=>{let{UpdatesView:e}=await import(`./chunk-CqZLUILw.js`);return{UpdatesView:e}},__vite__mapDeps([13,12,4,6,2,9,7])).then(({UpdatesView:e})=>({default:e}))),Av=[{id:`dashboard`,label:`dashboard`,icon:Oe,view:Sv,group:`core`},{id:`controls`,label:`controls`,icon:Ce,view:Cv,group:`core`},{id:`workbench`,label:`workbench`,icon:ot,view:Dv,group:`core`},{id:`device`,label:`device`,icon:Ae,view:wv,group:`integrations`},{id:`data`,label:`data`,icon:pe,view:Ov,group:`integrations`},{id:`updates`,label:`updates`,icon:Re,view:kv,group:`system`},{id:`events`,label:`events`,icon:ae,view:Tv,group:`system`},{id:`settings`,label:`settings`,icon:Xe,view:Ev,group:`system`}];function jv(e){return Av.find(t=>t.id===e)?.view??Sv}function Mv(e,t=!1){return t||e!==null&&!e.setup_complete}var Nv={theme:`system`,locale:`en`,direction:`auto`,reduceMotion:!1,compactNumbers:!1,audioMuted:!1,audioVolume:.42},Pv=`pccontroller.appearance`,Fv=`pccontroller.resource-reload`;function Iv(e){let t=Ch(e);if(!wh(e)){try{sessionStorage.removeItem(Fv)}catch{}return!1}try{if(sessionStorage.getItem(Fv)===t)return!1;sessionStorage.setItem(Fv,t)}catch{return!1}return window.location.reload(),!0}function Lv(){try{return Rv(JSON.parse(localStorage.getItem(Pv)??`{}`))}catch{return Nv}}function Rv(e,t=Nv){return{theme:e.theme===`light`||e.theme===`dark`||e.theme===`system`?e.theme:t.theme,locale:e.locale===`fa`||e.locale===`en`?e.locale:t.locale,direction:e.direction===`ltr`||e.direction===`rtl`||e.direction===`auto`?e.direction:t.direction,reduceMotion:typeof e.reduceMotion==`boolean`?e.reduceMotion:t.reduceMotion,compactNumbers:typeof e.compactNumbers==`boolean`?e.compactNumbers:t.compactNumbers,audioMuted:typeof e.audioMuted==`boolean`?e.audioMuted:t.audioMuted,audioVolume:Number.isFinite(e.audioVolume)?Math.max(0,Math.min(1,Number(e.audioVolume))):t.audioVolume}}function zv(e,t){return e.theme===t.theme&&e.locale===t.locale&&e.direction===t.direction&&e.reduceMotion===t.reduceMotion&&e.compactNumbers===t.compactNumbers&&e.audioMuted===t.audioMuted&&e.audioVolume===t.audioVolume}function Bv(e){let t=e.theme===`system`?matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`:e.theme,n=e.direction===`auto`?e.locale===`fa`?`rtl`:`ltr`:e.direction;document.documentElement.dataset.theme=t,document.documentElement.lang=e.locale===`fa`?`fa-IR`:`en`,document.documentElement.dir=n,document.documentElement.classList.toggle(`reduce-motion`,e.reduceMotion),document.documentElement.classList.toggle(`compact-numbers`,e.compactNumbers),document.querySelector(`meta[data-runtime-theme]`)?.setAttribute(`content`,t===`dark`?`#0b0a0e`:`#f5f3f6`)}function Vv(e){let t=e.replace(/^#\/?/,``).split(/[/?#]/)[0];return Av.some(e=>e.id===t)?t:`dashboard`}function Hv(e){return`#/${e}`}function Uv(e,t=location.pathname,n=location.search){return`${t}${n}${Hv(e)}`}function Wv(e,t){return e!==t}function Gv(){return Vv(location.hash)}function Kv(e,t){return e.filter(e=>!!e.status).map(e=>Xg({...L_,connected:!0,have_status:!0,hello:t,status:e.status},e.time?new Date(e.time).getTime():Date.now())).filter(e=>Number.isFinite(e.at)).slice(-360)}function qv(e,t){let n=e.trim().toLowerCase().replace(/\s+/g,` `),r=t===`fa`,i=(e,t,n)=>({title:e,body:t,confirmLabel:n});return/^(reset|boot|program|programmer|firmware|flash|upload|restore|query|write)(?: |$)/.test(n)?r?i(`ورود به مسیر بازیابی یا برنامه‌ریزی؟`,`این فرمان ممکن است درگاه سریال را آزاد کند، خطوط کنترل را تغییر دهد یا وارد مسیر محافظت‌شدهٔ برنامه‌ریزی شود. فرمان را یک‌بار دیگر بررسی کنید.`,`تأیید و ارسال`):i(`Enter a recovery or programming path?`,`This command may release the serial port, pulse control lines, or enter the guarded programming workflow. Review the exact command before dispatch.`,`Confirm and dispatch`):/^rf send(?: |$)/.test(n)?r?i(`فرمان رادیویی ارسال شود؟`,`این ارسال می‌تواند یک وسیلهٔ خارجی را فعال کند. کد، پروتکل و تعداد تکرار را پیش از ارسال کنترل کنید.`,`ارسال آگاهانه`):i(`Transmit the radio command?`,`This transmission can actuate an external device. Verify the code, protocol, and repeat count before dispatch.`,`Transmit explicitly`):/^(macro play|automation run|bridge call)(?: |$)/.test(n)?r?i(`اجرای گردش‌کار تأیید شود؟`,`تعریف انتخاب‌شده می‌تواند خروجی‌های برد، فرمان‌های میزبان یا یک میزبان راه‌دور را فعال کند. ابتدا نام و مقصد را بررسی کنید.`,`تأیید اجرا`):i(`Confirm workflow execution?`,`The selected definition can operate board outputs, host actions, or a remote peer. Verify its name and destination first.`,`Confirm run`):/^(os (power|sleep|suspend|hibernate|restart|shutdown|lock)|quit|exit)(?: |$)/.test(n)?r?i(`عملیات میزبان اجرا شود؟`,`این فرمان می‌تواند نشست یا رایانه را متوقف کند. سیاست و توکن تأیید میزبان همچنان در سمت سرویس اعمال می‌شود.`,`تأیید عملیات`):i(`Run the host operation?`,`This command can end the session or affect the computer. Host-side policy and confirmation-token checks still apply.`,`Confirm operation`):null}function Jv(e,t,n=``){return{...e}}function Yv(e){return typeof e!=`number`||!Number.isFinite(e)?1e3:Math.min(5e3,Math.max(750,Math.round(e*4)))}function Xv(e,t,n,r){let i=(e,t)=>r===`fa`?t:e;if(t===`connecting`)return i(`Connecting`,`در حال اتصال`);if(t!==`open`)return i(`Reconnecting`,`در حال اتصال دوباره`);if(n===`loading`)return i(`Synchronizing`,`در حال همگام‌سازی`);if(e.connected)return i(`Board connected`,`برد متصل`);let a=e.connection_state.trim().toLowerCase();return a===`paused`?i(`Paused`,`متوقف`):[`connecting`,`discovering`,`scanning`,`searching`].includes(a)?i(`Searching`,`در حال جستجو`):i(`No board`,`بدون برد`)}function Zv(e){return e.kind.toLowerCase()===`update.completed`&&e.metadata?.kind===`host`}function Qv(e,t,n=Date.now()){let r=e.kind.toLowerCase();return t!==`updates`&&(r.startsWith(`update.`)||r.startsWith(`peer-update.`))&&Hm(e.time,n)}function $v(e,t,n=!0,r=!1){return r||!n||e===null||e===t?null:t?`connect`:`disconnect`}function ey(e,t=!1){return!t&&(e===`waiting`||e===`closed`)}function ty(){let[e,t]=(0,E.useState)(Lv),[n,r]=(0,E.useState)(Gv),[i,a]=(0,E.useState)(!0),[o,s]=(0,E.useState)(!1),[c,l]=(0,E.useState)(L_),[u,d]=(0,E.useState)(()=>[]),[f,p]=(0,E.useState)(()=>[]),[m,h]=(0,E.useState)([]),[g,_]=(0,E.useState)(`idle`),[v,y]=(0,E.useState)(null),[b,x]=(0,E.useState)(`connecting`),[S,C]=(0,E.useState)(``),[ee,w]=(0,E.useState)(0),[te,T]=(0,E.useState)([]),[ne,D]=(0,E.useState)({open:!1,title:``,body:``,confirmLabel:``}),[re,O]=(0,E.useState)(!1),[ie,ae]=(0,E.useState)(!1),[oe,se]=(0,E.useState)(``),[ce,ue]=(0,E.useState)(0),[fe,pe]=(0,E.useState)([]),[me,ge]=(0,E.useState)(),[_e,ve]=(0,E.useState)(!1),[be,k]=(0,E.useState)(!1),[A,Se]=(0,E.useState)(ov),[Ce,we]=(0,E.useState)(!1),[Ee,De]=(0,E.useState)({left:0,top:0}),[Oe,ke]=(0,E.useState)(!1),[Ae,je]=(0,E.useState)(!1),[Me,Ne]=(0,E.useState)(12),[Fe,Le]=(0,E.useState)(24),[Re,ze]=(0,E.useState)(!1),[Ve,Ue]=(0,E.useState)(_m),[We,Ge]=(0,E.useState)(!1),[qe,Ye]=(0,E.useState)(0),[Xe,Ze]=(0,E.useState)(``),[$e,tt]=(0,E.useState)([]),[rt,at]=(0,E.useState)(Og),[ot,st]=(0,E.useState)({state:`idle`,detail:``}),[lt]=(0,E.useState)(()=>new Eg),[ut,dt]=(0,E.useState)(null),[ft,pt]=(0,E.useState)(null),[mt,ht]=(0,E.useState)([]),gt=(0,E.useRef)(0),_t=(0,E.useRef)(new Map),vt=(0,E.useRef)(0),M=(0,E.useRef)(null),yt=(0,E.useRef)(new D_),bt=(0,E.useRef)(null),xt=(0,E.useRef)(null),St=(0,E.useRef)(null),Ct=(0,E.useRef)(``),wt=(0,E.useRef)(e),Tt=(0,E.useRef)(Promise.resolve()),Et=(0,E.useRef)(!1),Dt=(0,E.useRef)(!1),N=(0,E.useRef)(n),Ot=(0,E.useRef)(null),kt=(0,E.useRef)(null),At=(0,E.useRef)(rt),jt=(0,E.useRef)(()=>void 0),Mt=(0,E.useRef)(()=>void 0),Nt=(0,E.useRef)(new Zf),Pt=(0,E.useRef)(``),Ft=(0,E.useRef)(c),It=(0,E.useRef)(0),Lt=(0,E.useRef)(``),Rt=(0,E.useRef)(new K_),P=(0,E.useMemo)(()=>Ym(e.locale),[e.locale]),zt=uh(v?.name,`PCController`),Bt=dh(zt,`PC`),Vt=v?.tagline?.trim()||`One host. Every board surface.`,Ht=e.direction===`auto`?e.locale===`fa`?`rtl`:`ltr`:e.direction,Ut=Ht===`rtl`?`18px`:`-18px`;At.current=rt;let Wt=(0,E.useCallback)(e=>{t(e);try{localStorage.setItem(Pv,JSON.stringify(e))}catch{}Bv(e),M.current?.setVolume(e.audioVolume),M.current?.setMuted(e.audioMuted)},[]),Gt=(0,E.useCallback)(e=>{let t=av(e);Se(t),sv(t)},[]),Kt=(0,E.useCallback)((e,t)=>{let n=Rv(e);Ct.current=t,wt.current=n,Wt(n)},[Wt]),qt=(0,E.useCallback)(async()=>{let e=await wm();return y(e),St.current?.updateStatusInterval(e.status_interval_ms),Kt(e.appearance,e.appearance_etag),e},[Kt]),Jt=(0,E.useCallback)((e,t)=>{y(n=>n&&{...n,status_interval_ms:e,measurement_freshness_ms:t}),St.current?.updateStatusInterval(e)},[]);(0,E.useEffect)(()=>{let e=P(Av.find(e=>e.id===n)?.label??`dashboard`);document.title=ut??`${zt} — ${e}`},[n,zt,ut,P]),(0,E.useEffect)(()=>{hh(ph(c))},[!1,c.connected,c.connection_reason,c.connection_state,c.have_status,c.status.hot]),(0,E.useEffect)(()=>{Re&&!Dt.current&&(Dt.current=!0,Nh({productTitle:zt,config:v,boardConnected:c.connected,port:c.port.name,streamState:b,demonstration:!1}))},[!1,zt,c.connected,c.port.name,Re,b,v]),(0,E.useEffect)(()=>{N.current=n},[n]);let Yt=(0,E.useCallback)((e,t)=>{let n=Ot.current?.getBoundingClientRect();De({left:e??(i?n?.left??10:(n?.right??84)+7),top:t??(n?.bottom??10)+7}),we(!0)},[i]);(0,E.useLayoutEffect)(()=>{if(!Ce||!kt.current)return;let e=kt.current.getBoundingClientRect();De(t=>({left:Math.max(10,Math.min(t.left,window.innerWidth-e.width-10)),top:Math.max(10,Math.min(t.top,window.innerHeight-e.height-10))}))},[Ce]),(0,E.useEffect)(()=>{if(!Ce)return;let e=e=>{let t=e.target;!Ot.current?.contains(t)&&!kt.current?.contains(t)&&we(!1)},t=e=>{e.key===`Escape`&&(we(!1),Ot.current?.focus())},n=()=>we(!1),r=window.requestAnimationFrame(()=>kt.current?.querySelector(`button`)?.focus());return window.addEventListener(`pointerdown`,e),window.addEventListener(`focusin`,e),window.addEventListener(`keydown`,t),window.addEventListener(`blur`,n),window.addEventListener(`hashchange`,n),()=>{window.cancelAnimationFrame(r),window.removeEventListener(`pointerdown`,e),window.removeEventListener(`focusin`,e),window.removeEventListener(`keydown`,t),window.removeEventListener(`blur`,n),window.removeEventListener(`hashchange`,n)}},[Ce]),(0,E.useEffect)(()=>{c.connected||we(!1)},[c.connected]),(0,E.useEffect)(()=>{let t=Yf({muted:e.audioMuted,volume:e.audioVolume,pauseWhenHidden:!0});M.current=t;let n=()=>{t.start()};return window.addEventListener(`pointerdown`,n,{capture:!0,once:!0}),window.addEventListener(`keydown`,n,{capture:!0,once:!0}),()=>{window.removeEventListener(`pointerdown`,n,{capture:!0}),window.removeEventListener(`keydown`,n,{capture:!0}),M.current===t&&(M.current=null),t.dispose()}},[]),(0,E.useEffect)(()=>{if(!Re)return;let e=bt.current;bt.current=c.connected;let t=$v(e,c.connected,Re,!1);t&&M.current?.cue(t)},[!1,c.connected,Re]),(0,E.useEffect)(()=>{let e=mg({origin:lm()}),t=new Map;xt.current=e,Ze(e.tabId),Ge(e.supported);let n=()=>{let e=Date.now()-4e4;for(let[n,r]of t)r{let r=e.payload;if(r.type===`presence`)r.state===`leaving`?t.delete(e.tabId):t.set(e.tabId,e.sentAt),n();else if(t.set(e.tabId,e.sentAt),n(),r.type===`appearance`&&(r.etag&&r.etag===Ct.current||qt().catch(()=>void 0)),r.type===`terminal`&&ht(t=>[...t.filter(t=>t.id!==e.messageId).slice(-119),{id:e.messageId,tabId:e.tabId,...r.entry}]),r.type===`controller-event`){let e=r.event;N_(e)&&h(t=>P_(t,e)),u_(e)&&l(t=>{let n=d_(t,e);return Ft.current=n,n}),p(t=>yh(t,e))}}),i=()=>e.publishPresence(document.hidden?`hidden`:`active`,N.current),a=()=>i();i(),document.addEventListener(`visibilitychange`,a);let o=window.setInterval(()=>{i(),n()},12e3);return()=>{document.removeEventListener(`visibilitychange`,a),window.clearInterval(o),e.publishPresence(`leaving`,N.current),r(),e.close(),xt.current===e&&(xt.current=null),Ze(t=>t===e.tabId?``:t)}},[qt]);let F=(0,E.useCallback)((t=document.hidden?`hidden`:`active`,n=!1)=>!Re||!Xe?Promise.resolve():km(`controller.app.instance.report`,{id:Xe,surface:`webui`,page:N.current,state:t,lease_seconds:45,self:{kind:`browser`,vars:{origin:window.location.origin,platform:navigator.platform||`unknown`,language:navigator.language||`unknown`,user_agent:navigator.userAgent}},values:{color_mode:e.theme,locale:e.locale,direction:Ht,app_actions:`app.page,app.progress,app.title`,...lt.nextValues(rt,n)}}),[Xe,e.locale,e.theme,!1,lt,rt,Ht,Re]);jt.current=(e=!1)=>{e&&At.current&&st({state:`pending`,detail:``}),F(void 0,e).catch(t=>{e&&At.current&&st({state:`error`,detail:t instanceof Error?t.message:String(t)})})},(0,E.useEffect)(()=>{if(!Re||!Xe)return;let e=(e=document.hidden?`hidden`:`active`)=>{F(e).catch(()=>void 0)},t=()=>e();e(),document.addEventListener(`visibilitychange`,t);let n=window.setInterval(()=>e(),3e4);return()=>{document.removeEventListener(`visibilitychange`,t),window.clearInterval(n)}},[Xe,!1,F,Re,Ve]),(0,E.useEffect)(()=>()=>{Xe&&km(`controller.app.instance.report`,{id:Xe,surface:`webui`,page:N.current,state:`leaving`,lease_seconds:45}).catch(()=>void 0)},[Xe]),(0,E.useEffect)(()=>{if(!Re)return;let e=!0,t=()=>km(`controller.app.instances`).then(t=>{e&&tt(t)}).catch(()=>{e&&tt([])});t();let n=window.setInterval(t,3e4);return()=>{e=!1,window.clearInterval(n)}},[!1,Re,Ve]),(0,E.useEffect)(()=>{if(Me>=Fe)return;let e=window.setInterval(()=>{Ne(e=>{let t=Fe-e;return t<=0?e:t<.8?Fe:Math.min(Fe,e+Math.max(.75,t*.14))})},72);return()=>window.clearInterval(e)},[Me,Fe]);let Xt=(0,E.useCallback)(e=>{gt.current+=1;let t=gt.current;return T(n=>[...n.slice(-3),{id:t,...e}]),e.tone===`danger`&&M.current?.cue(`error`),e.tone===`warning`&&M.current?.cue(`warning`),e.tone===`success`&&M.current?.cue(`success`),e.persistent||window.setTimeout(()=>T(e=>e.filter(e=>e.id!==t)),5200),t},[]),Zt=(0,E.useCallback)((e,t,n)=>{Xt({tone:e,title:t,detail:n})},[Xt]),Qt=(0,E.useCallback)(e=>{let t=hv(e,wt.current.locale);if(!t?.updateOperationID)return!1;let n=t.updateOperationID,r=_t.current.get(n);r===void 0&&(gt.current+=1,r=gt.current,_t.current.set(n,r));let i={id:r,...t};return T(e=>{let t=e.findIndex(e=>e.updateOperationID===n);return t<0?[...e.slice(-3),i]:e.map((e,n)=>n===t?i:e)}),t.persistent||(_t.current.delete(n),window.setTimeout(()=>T(e=>e.filter(e=>e.id!==r)),5200)),!0},[]);(0,E.useEffect)(()=>{let e=e=>{let t=e.detail;if(!t?.id||!t.state)return;let n={operation_id:t.id,kind:t.kind,state:t.state,stage:t.stage||t.state,detail:t.detail||``,progress_known:String(t.progress_known===!0),progress_percent:String(t.progress_percent??0),updated_at:t.updated_at||new Date().toISOString()};t.bytes_done!==void 0&&(n.bytes_done=String(t.bytes_done)),t.bytes_total!==void 0&&(n.bytes_total=String(t.bytes_total)),Qt({id:0,time:n.updated_at,kind:`update.${t.state}`,text:t.detail||``,metadata:n})};return window.addEventListener(`pccontroller:update-transfer-progress`,e),()=>window.removeEventListener(`pccontroller:update-transfer-progress`,e)},[Qt]),(0,E.useEffect)(()=>{let t=()=>{let t=M.current;Zt(`success`,e.locale===`fa`?`اعلان آزمایشی`:`Test notification`,e.locale===`fa`?`صدا، لرزش و اعلان آماده‌اند.`:`Audio, haptics, and notifications are ready.`),t&&t.start().then(e=>{e&&t.cue(`success`)})};return window.addEventListener(`pccontroller:test-feedback`,t),()=>window.removeEventListener(`pccontroller:test-feedback`,t)},[e.locale,Zt]);let $t=(0,E.useCallback)(async()=>{try{let e={epoch:It.current,instanceID:Lt.current},t=await Tm();if(!e_(e,{epoch:It.current,instanceID:Lt.current})||!n_(t,e))return;let n=Ft.current,r=c_(n,t,{epoch:e.epoch,instanceID:t.host_instance_id,authoritativeInstanceID:e.instanceID});Ft.current=r,l(r),d(e=>Qg(e,n,r))}catch(e){Zt(`warning`,`Snapshot unavailable`,e instanceof Error?e.message:String(e))}},[!1,Zt]);(0,E.useEffect)(()=>{let e=Nt.current.shouldRead(c,n===`settings`);if(b!==`open`||!c.connected||!c.have_status){Pt.current=``,_(`idle`);return}if(c.have_settings){_(`ready`);return}if(!e)return;_(`loading`);let t=Xf(c);Pt.current=t,Am(`settings`).then(()=>$t()).then(()=>{Pt.current===t&&_(`unavailable`)}).catch(()=>{Pt.current===t&&_(`unavailable`)})},[n,$t,c.connected,c.have_status,c.have_settings,c.hello.build_hash,c.hello.build_timestamp,c.port.instance_id,c.port.name,c.port.serial_number,b]);let en=(0,E.useCallback)(async(e,t,n=!1)=>{let r=rh(e);xt.current?.publishTerminal({kind:`command`,text:`pc› ${r}`,at:Date.now()});try{let i=(await Am(e)).output??``;return xt.current?.publishTerminal({kind:`output`,text:i||`✓ accepted`,at:Date.now()}),Zt(`success`,t||`Command completed`,i||r),n&&$t(),i}catch(e){let t=e instanceof Error?e.message:String(e);throw xt.current?.publishTerminal({kind:`error`,text:`! ${t}`,at:Date.now()}),Zt(`danger`,`Command failed`,t),e}},[!1,Zt,$t]),tn=(0,E.useCallback)((t,n,r=!1)=>{let i=qv(t,e.locale);return i?new Promise((a,o)=>{let s=!1;D({open:!0,tone:`danger`,title:i.title,body:`${i.body}\n\n${rh(t)}`,confirmLabel:i.confirmLabel,cancel:()=>{s||(s=!0,a(e.locale===`fa`?`پیش از ارسال لغو شد.`:`Cancelled before dispatch.`))},action:async()=>{try{let e=await en(t,n,r);s=!0,a(e)}catch(e){throw s=!0,o(e),e}}})}):en(t,n,r)},[e.locale,!1,en]),nn=(0,E.useCallback)(e=>{D({...e,open:!0})},[]),rn=(0,E.useCallback)((t,n=`push`)=>{let i=Wv(N.current,t),a=Hv(t);n===`push`&&(N.current!==t||location.hash!==a)?history.pushState({page:t},``,Uv(t)):n===`replace`&&(N.current!==t||location.hash!==a)&&history.replaceState({page:t},``,Uv(t)),N.current=t,r(t),s(!1),xt.current?.publishPresence(document.hidden?`hidden`:`active`,t),i&&jt.current(),i&&document.querySelector(`.app-main`)?.scrollTo({top:0,behavior:e.reduceMotion?`auto`:`smooth`})},[e.reduceMotion]),an=(0,E.useCallback)((t,n=`push`)=>{if(rn(t,n),!rt||!Re||!Xe)return;st({state:`pending`,detail:``});let r;try{r=lt.nextCommit(Xe,t)}catch(e){st({state:`error`,detail:e instanceof Error?e.message:String(e)});return}km(`controller.app.navigation.commit`,r).then(t=>{let n=lt.settle(t,r.operation_id);if(n)rn(n,`replace`),st({state:`idle`,detail:``});else throw Error(e.locale===`fa`?`پاسخ هماهنگ‌کننده با درخواست فعلی مطابقت ندارد.`:`The coordinator response did not match this request.`)}).catch(e=>{jt.current(!0),st({state:`error`,detail:e instanceof Error?e.message:String(e)})})},[Xe,e.locale,rn,!1,lt,rt,Re]),on=(0,E.useMemo)(()=>({title:zt,hostVersion:v?.host_version||``,page:n,hostOnline:b===`open`,boardConnected:c.connected,port:c.port.name||``,transport:b,eventCount:f.length}),[!1,f.length,n,zt,c.connected,c.port.name,b,v?.host_version]);(0,E.useEffect)(()=>ev({api:`PCController.browser`,inspect:()=>on,command:e=>{let t=e.trim();return t?tn(t):Promise.reject(Error(`PCController.command requires a non-empty command`))},refresh:$t,navigate:e=>{let t=Av.find(t=>t.id===e)?.id;if(!t)throw Error(`Unknown PCController page: ${e}`);an(t)}}),[on,an,$t,tn]),(0,E.useEffect)(()=>{tv(on)},[on]),(0,E.useEffect)(()=>(Mt.current=e=>an(e,`none`),()=>{Mt.current=()=>void 0}),[an]);let sn=(0,E.useCallback)(e=>{kg(e),lt.resetCoordinator(),st(e?{state:`pending`,detail:``}:{state:`idle`,detail:``}),at(e)},[lt]),cn=(0,E.useCallback)(t=>{let n=Rv(t,wt.current);wt.current=n,Wt(n);let r=M.current;!n.audioMuted&&r&&r.start({muted:!1}).then(e=>{e&&r.cue(`select`)}),Tt.current=Tt.current.then(async()=>{let e=await km(`controller.ui.config.set`,{appearance:n,if_match:Ct.current});Ct.current=e.appearance_etag,y(t=>t&&{...t,appearance:e.appearance,appearance_etag:e.appearance_etag}),zv(wt.current,n)&&Kt(e.appearance,e.appearance_etag),xt.current?.publishAppearance(e.appearance,e.appearance_etag)}).catch(async t=>{try{await qt()}catch{}Zt(`warning`,e.locale===`fa`?`تنظیم ظاهر ذخیره نشد`:`Appearance was not saved`,t instanceof Error?t.message:String(t))})},[Kt,e.locale,Wt,!1,Zt,qt]),ln=(0,E.useCallback)(t=>{let n={...e,audioMuted:!t};cn(n);let r=M.current;r?.setVolume(n.audioVolume),r&&r.start({muted:!t}).then(e=>{e&&t&&r.cue(`success`)}),v?.setup_complete?ke(!1):v?km(`controller.ui.config.set`,{setup_complete:!0}).then(e=>{y(t=>t&&{...t,name:e.app_title,tagline:e.tagline,setup_complete:e.setup_complete,welcome_melody:e.welcome_melody})}).catch(e=>Zt(`warning`,`Setup state was not saved`,e instanceof Error?e.message:String(e))).finally(()=>ke(!1)):Zt(`warning`,`Setup state is unavailable`,`The current host configuration has not loaded yet.`)},[e,!1,Zt,cn,v?.setup_complete]),un=(0,E.useCallback)(async e=>{let t=await km(`controller.ui.config.set`,{app_title:e.trim()});return y(e=>e&&{...e,name:t.app_title,tagline:t.tagline,setup_complete:t.setup_complete,welcome_melody:t.welcome_melody}),Zt(`success`,`Application title saved`,t.app_title),t.app_title},[Zt]),dn=(0,E.useCallback)(async e=>{await tn(`buzzer path ${e}`,`Buzzer routing updated`),await qt()},[qt,tn]),fn=(0,E.useCallback)(()=>{cn({...e,audioMuted:!e.audioMuted})},[e,cn]),pn=(0,E.useCallback)(e=>{vm(e),Ue(e.trim()),Zt(`success`,e.trim()?`Session token applied`:`Session token cleared`),window.setTimeout(()=>location.reload(),180)},[Zt]);(0,E.useEffect)(()=>{Bv(e);let t=matchMedia(`(prefers-color-scheme: light)`),n=()=>e.theme===`system`&&Bv(e);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),(0,E.useEffect)(()=>{let e=Gv();location.hash!==Hv(e)&&history.replaceState(history.state,``,Uv(e));let t=()=>{let e=Gv();Mt.current(e)};return window.addEventListener(`hashchange`,t),window.addEventListener(`popstate`,t),()=>{window.removeEventListener(`hashchange`,t),window.removeEventListener(`popstate`,t)}},[]);let mn=Av.filter(e=>P(e.label).toLowerCase().includes(oe.toLowerCase())),hn=hg(fe,oe),gn=f.find(e=>e.kind===`peripherals.changed`||e.kind===`config`)?.id;(0,E.useEffect)(()=>{if(!ie||!c.connected){c.connected||pe([]);return}let e=new AbortController;return km(`controller.peripherals.get`,{},e.signal).then(t=>{e.signal.aborted||pe(t.controls)}).catch(t=>{e.signal.aborted||Zt(`warning`,`Channel search unavailable`,t instanceof Error?t.message:String(t))}),()=>e.abort()},[ie,c.connected,c.port.name,gn]);let _n=e=>{ge(t=>({key:e,revision:(t?.revision??0)+1})),an(`controls`),ae(!1),se(``)};(0,E.useEffect)(()=>{let e=e=>{if(Oe||be)return;let t=e.isComposing||e.keyCode===229;if(ie){if(t)return;let n=[...mn.map(e=>()=>an(e.id)),...hn.map(e=>()=>_n(e.key))];if(e.key===`Escape`){e.preventDefault(),ae(!1),se(``);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Home`||e.key===`End`){e.preventDefault(),ue(t=>!n.length||e.key===`Home`?0:e.key===`End`?n.length-1:(t+(e.key===`ArrowDown`?1:-1)+n.length)%n.length),M.current?.cue(`navigation`,e.key===`ArrowUp`?`up`:`down`);return}if(e.key===`Enter`&&n.length){e.preventDefault(),n[Math.min(ce,n.length-1)](),ae(!1),se(``),M.current?.cue(`select`);return}(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),ae(!1));return}if(_e){(e.key===`Escape`||e.key===`?`)&&(e.preventDefault(),ve(!1));return}if(ne.open)return;if(e.key===`Escape`&&o){e.preventDefault(),s(!1);return}if(Bm(e))return;if((e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`k`){e.preventDefault(),ue(0),ae(!0);return}if(!e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key===`?`){e.preventDefault(),ve(!0);return}if(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.key.toLowerCase()===`m`&&!e.repeat){e.preventDefault(),fn();return}let r=Um(e),i=Wm(e,n,document.documentElement.dir===`rtl`?`rtl`:`ltr`);if(r||i){e.preventDefault(),an(r??i),M.current?.cue(`navigation`,e.key.includes(`Left`)?`left`:e.key.includes(`Right`)?`right`:`forward`);return}let a=!e.altKey&&!e.ctrlKey&&!e.metaKey;if(a&&performance.now()<=vt.current){vt.current=0;let t=Gm(e.key);if(t){e.preventDefault(),an(t),M.current?.cue(`navigation`,`forward`);return}}a&&!e.shiftKey&&e.key.toLowerCase()===`g`&&!e.repeat&&(e.preventDefault(),vt.current=performance.now()+1400,M.current?.cue(`focus`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[be,Oe,ne.open,_e,o,an,n,ie,ce,oe,fe,P,fn]),(0,E.useEffect)(()=>{ue(0)},[oe]),(0,E.useEffect)(()=>{if(Oe)return;let e=null,t=e=>e instanceof Element?e.closest(`button:not(:disabled), a[href], [role="button"]:not([aria-disabled="true"])`):null,n=n=>{let r=t(n.target);r&&r!==e&&(e=r,M.current?.cue(`focus`))},r=t=>{e&&!e.contains(t.relatedTarget)&&(e=null)},i=e=>{t(e.target)&&M.current?.cue(`select`)};return document.addEventListener(`focusin`,n),document.addEventListener(`pointerover`,n),document.addEventListener(`pointerout`,r),document.addEventListener(`click`,i),()=>{document.removeEventListener(`focusin`,n),document.removeEventListener(`pointerover`,n),document.removeEventListener(`pointerout`,r),document.removeEventListener(`click`,i)}},[Oe]),(0,E.useEffect)(()=>{let e=new AbortController,t=Th(wm,Iv,{signal:e.signal,onError:e=>C(`Host resource check: ${e instanceof Error?e.message:String(e)}`)}),n=Object.assign(()=>{},{updateStatusInterval:e=>void 0}),r=null;return(async()=>{try{Le(42);let i=await wm(e.signal);if(Iv(i))return;y(i),Kt(i.appearance,i.appearance_etag);let a=Mv(i);ke(a),je(!0),Le(70);let o=await Tm(e.signal);Ft.current=o,l(o),ze(!0),o.have_status&&d([Xg(o)]);let s=new Date(Date.now()-36e5).toISOString(),[c,u]=await Promise.allSettled([km(`controller.history.status`,{since:s},e.signal),km(`controller.history.timeline`,{since:s,limit:500},e.signal)]);if(c.status===`fulfilled`){let e=Kv(c.value,o.hello);d(t=>[...e,...t].slice(-360))}if(u.status===`fulfilled`&&(p(vh(u.value).slice(-500).reverse()),h(u.value.filter(N_).slice(-80).reverse())),Le(92),a&&o.connected&&i.welcome_melody?.trim())try{await Am(`melody wait ${nh(i.welcome_melody.trim())}`,e.signal)}catch(e){C(`Welcome melody unavailable: ${e instanceof Error?e.message:String(e)}`)}r=new Yg(e=>{let t=Ft.current,n=$g(t,[],e);C(n.detail),n.applied!==0&&(Ft.current=n.snapshot,l(n.snapshot),d(n=>$g(t,n,e).samples))}),n=Nm(i,{pwm:(e,t)=>{let n=S_(Ft.current,e,t.instanceID);n!==Ft.current&&(Ft.current=n,l(n))},status:(e,t)=>{(e.host_instance_id===void 0||e.host_instance_id===Ft.current.host_instance_id)&&(e.connection_generation!==void 0&&e.connection_generation!==Ft.current.connection_generation?$t():r?.enqueue(t.generation,e))},snapshot:(e,t)=>{let n=Ft.current,r=C_(n,c_(n,e,{epoch:t.generation,instanceID:e.host_instance_id,authoritativeInstanceID:t.instanceID}));Ft.current=r,l(r),d(e=>Qg(e,n,r))},event:(e,t)=>{let n=t_({epoch:It.current,instanceID:Lt.current},{epoch:t.generation,instanceID:t.instanceID});if(!n)return;It.current=n.epoch,Lt.current=n.instanceID??``;let r=e.kind.toLowerCase();r===`app.instance.changed`&&km(`controller.app.instances`).then(tt).catch(()=>void 0);let a=N_(e);if(a&&h(t=>P_(t,e)),u_(e)&&l(n=>{let r=d_(n,e,{epoch:t.generation,instanceID:t.instanceID});return Ft.current=r,r}),i.integrations?.buzzer_web_audio&&r===`buzzer.note`){let t=Number(e.metadata?.frequency_hz),n=Number(e.metadata?.duration_ms),r=e.metadata?.device_micros,i=r===void 0?void 0:Number(r),a=e.metadata?.[`bridge.ingress`]?`bridge:${e.metadata[`bridge.ingress`]}`:`local-board`,o=yt.current.plan({source:a,frequencyHz:t,durationMS:n,deviceMicros:i,generation:e.metadata?.connection_generation},performance.now());o?.stop?M.current?.stopTone(a,o.delayMS):o?.audible&&(M.current?.stopTone(a,o.delayMS),M.current?.playTone(t,o.durationMS,o.delayMS,a))}let o=_h(e);o&&p(t=>yh(t,e));let s=q_(e,Xe,Rt.current);if(s){let{acknowledgement:e}=s;if(!s.duplicate){let{effect:e}=s;W_(e,{replacePage:e=>{rn(e,`replace`),M.current?.cue(`navigation`,`forward`)},setTitle:dt,setProgress:pt})}Z_(e,e=>km(`controller.app.action.ack`,e)).catch(e=>{let t=wt.current.locale;Zt(`warning`,t===`fa`?`تأیید فرمان ارسال نشد`:`Action not confirmed`,e instanceof Error?e.message:String(e))})}if((o||u_(e)||a)&&xt.current?.publishControllerEvent(e),!e.metadata?.operation_id&&e.kind.toLowerCase()===`app.page`&&Hm(e.time)&&gg(e.metadata?.target_instance,Xe,`webui`)){let t=Vm(e.metadata?.page??e.metadata?.value??e.text);if(t){let n=e.metadata?.navigation_sync?.toLowerCase()===`group`,r=n?At.current?lt.acceptAction(e.metadata,t):null:t;r&&(rn(r,`replace`),n&&st({state:`idle`,detail:``}),M.current?.cue(`navigation`,`forward`))}}if(Qv(e,N.current)&&(rn(`updates`,`replace`),M.current?.cue(`navigation`,`forward`)),!Qt(e)&&bh(e,Xe)){let t=uv(e,wt.current.locale);t?Xt(t):Zt(ny(e),e.kind,e.text)}Zv(e)&&(Et.current=!0),/config/i.test(e.kind)&&qt().catch(()=>void 0),/device|connection|settings|illumination|^macro/i.test(e.kind)&&$t()},state:(e,n,i)=>{if(i?.generation){if(!r?.adoptGeneration(i.generation))return;let e=t_({epoch:It.current,instanceID:Lt.current},{epoch:i.generation,instanceID:i.instanceID});if(!e)return;It.current=e.epoch,Lt.current=e.instanceID??``}if(t.state(e),x(e),C(n??``),e===`open`){if(lt.resetCoordinator(),jt.current(!0),Et.current){Et.current=!1,window.location.reload();return}$t()}else i?.generation&&r?.cancelPending(i.generation),l(t=>{let r=Jv(t,e,n);return Ft.current=r,r})}}),St.current=n,Le(100)}catch(e){ze(!0),ke(!1),je(!0),x(`waiting`),C(e instanceof Error?e.message:String(e)),l(t=>{let n=Jv(t,`waiting`,e instanceof Error?e.message:String(e));return Ft.current=n,n}),Le(100)}})(),()=>{e.abort(),t.dispose(),r?.dispose(),St.current===n&&(St.current=null),n()}},[Kt,Xe,rn,!1,Xt,an,lt,Zt,Qt,$t,qt,ee,Ve]),(0,E.useEffect)(()=>{if(!Re||b===`open`)return;let e=!0,t=async()=>{try{let t=await Tm();if(!e)return;let n=Ft.current;Ft.current=t,l(t),d(e=>Qg(e,n,t))}catch{}};t();let n=window.setInterval(t,Yv(v?.status_interval_ms));return()=>{e=!1,window.clearInterval(n)}},[!1,Re,b,v?.status_interval_ms]);let vn=z_({hostRequiresAuthentication:v?.auth_required===!0,streamState:b,token:Ve,streamDetail:S,connectionReason:c.connection_reason}),yn=b===`open`&&c.connected&&c.have_status?`ready`:!Re||b===`connecting`?`loading`:`unavailable`,I={focusControl:me,reduceMotion:e.reduceMotion,appTitle:zt,snapshot:c,samples:u,events:f,macroEvents:m,locale:e.locale,t:P,command:tn,refresh:$t,openDialog:nn,boardSettingsReadState:g,transport:{streamState:b,authenticationRequired:vn,boardState:yn,tabBusSupported:We,tabPeers:qe,statusIntervalMS:v?.status_interval_ms,measurementFreshnessMS:v?.measurement_freshness_ms},relayedTerminal:mt,broadcastTerminal:e=>{xt.current?.publishTerminal(e)}},bn=jv(n),xn=c.hardware_problems?.[0],Sn=xn?B_(xn,e.locale):void 0,Cn=(0,Y.jsx)(E.Suspense,{fallback:(0,Y.jsxs)(`section`,{className:`page-loading`,role:`status`,"aria-live":`polite`,children:[(0,Y.jsx)(`span`,{className:`spinner`}),e.locale===`fa`?`در حال بارگیری…`:`Loading page…`]}),children:n===`settings`?(0,Y.jsx)(bn,{...I,appearance:e,onAppearance:cn,token:Ve,onToken:pn,onAppTitle:un,uiConfig:v,onMeasurementTiming:Jt,onBuzzerPath:dn,navigationSync:rt,navigationSyncStatus:ot,onNavigationSync:sn,appInstances:$e}):(0,Y.jsx)(bn,{...I})}),wn=Av.find(e=>e.id===n)??Av[0],Tn=()=>{re||(ne.cancel?.(),D(e=>({...e,open:!1})))},En=async()=>{if(!ne.action)D(e=>({...e,open:!1}));else{O(!0);try{await ne.action(),D(e=>({...e,open:!1}))}catch{}finally{O(!1)}}},Dn=c.connected&&b===`open`?`good`:b===`connecting`?`info`:b===`open`?`neutral`:`warn`,On=Xv(c,b,yn,e.locale),kn=lh(c,e.locale),An=ah(c),jn=c.connected?[[`status`,`${c.port.name||(e.locale===`fa`?`کنترلر`:`Controller`)} · ${c.status_updated?th(e.locale,c.status_updated):P(`online`)}`],[`relay off`,c.status.active_relays?e.locale===`fa`?`${c.status.active_relays.toString(2).replace(/0/g,``).length} خروجی فعال`:`${c.status.active_relays.toString(2).replace(/0/g,``).length} active outputs`:e.locale===`fa`?`همهٔ خروجی‌ها آزادند`:`All outputs released`],[`rf list`,e.locale===`fa`?`فهرست رادیویی کنترلر`:`Controller radio inventory`],[`macro list`,e.locale===`fa`?`فهرست ماکروهای کنترلر`:`Controller macro inventory`]]:[[`ports`,c.connection_reason||(e.locale===`fa`?`جستجوی درگاه‌های سریال موجود`:`Discover available serial ports`)],[`hotkeys status`,e.locale===`fa`?`سرویس میان‌برهای سراسری`:`Global shortcut service`],[`os status`,e.locale===`fa`?`وضعیت سیستم‌عامل میزبان`:`Host operating-system state`]],Mn=e.locale===`fa`?`WS ${b===`open`?`باز`:b===`connecting`?`در حال اتصال`:b===`closed`?`بسته`:b} · ${Qm(`fa`,qe+1)} زبانه`:`WS ${b} · ${qe+1} ${qe===0?`tab`:`tabs`}`,Nn=ey(b,!1);return(0,Y.jsxs)(Od,{reducedMotion:e.reduceMotion?`always`:`user`,children:[(0,Y.jsxs)(`div`,{className:`app-shell${i?``:` is-sidebar-compact`}${Ae?``:` is-bootstrap-pending`}`,inert:!Ae||Oe||_e||be?!0:void 0,"aria-hidden":!Ae||Oe||_e||be?!0:void 0,children:[ft&&(0,Y.jsx)(`div`,{className:`app-action-progress app-action-progress--${ft.state}`,role:`progressbar`,"aria-label":e.locale===`fa`?`پیشرفت فرمان راه دور`:`Remote action progress`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ft.percent,children:(0,Y.jsx)(`span`,{style:ft.percent===void 0?void 0:{width:`${ft.percent}%`}})}),(0,Y.jsxs)(`aside`,{className:`sidebar`,"aria-label":P(`primaryNavigation`),children:[(0,Y.jsxs)(`div`,{className:`brand`,children:[(0,Y.jsx)(`a`,{className:`brand__mark`,href:`#/dashboard`,"aria-label":`${zt} ${P(`dashboardLink`)}`,children:(0,Y.jsx)(ip,{fallback:Bt})}),(0,Y.jsxs)(`a`,{className:`brand__copy`,href:`#/dashboard`,children:[(0,Y.jsx)(`strong`,{children:zt}),(0,Y.jsx)(`span`,{children:Vt})]}),(0,Y.jsx)(`button`,{className:`sidebar-toggle`,"aria-label":P(i?`collapseNavigation`:`expandNavigation`),title:P(i?`collapseNavigation`:`expandNavigation`),"aria-expanded":i,"aria-controls":`primary-navigation`,onClick:()=>a(e=>!e),children:i?(0,Y.jsx)(Be,{size:18}):(0,Y.jsx)(He,{size:18})})]}),(0,Y.jsxs)(`button`,{ref:Ot,type:`button`,className:`sidebar__status`,"aria-haspopup":`menu`,"aria-expanded":Ce,"aria-disabled":!c.connected&&kn.retryDisabled,"aria-label":c.connected?e.locale===`fa`?`منوی اتصال برد`:`Board connection menu`:e.locale===`fa`?`اتصال مجدد برد`:`Reconnect board`,title:`${c.connected?e.locale===`fa`?`برد آنلاین`:`Board online`:kn.title} · ${kn.candidate||c.connection_state}`,onClick:()=>{if(c.connected)Ce?we(!1):Yt();else{if(we(!1),kn.retryDisabled)return;tn(`reconnect`)}},onContextMenu:e=>{e.preventDefault(),Yt(e.clientX,e.clientY)},onKeyDown:e=>{(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`)&&(e.preventDefault(),Yt())},children:[(0,Y.jsx)(`span`,{className:`status-rail status-rail--${c.connected?`good`:kn.tone}`,"aria-hidden":`true`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:c.connected?e.locale===`fa`?`برد آنلاین`:`Board online`:kn.title}),(0,Y.jsx)(`small`,{children:c.connected?c.port.name:kn.timing||kn.candidate||c.connection_state})]}),(0,Y.jsx)(xe,{size:18,"aria-hidden":`true`})]}),Ce&&typeof document<`u`&&(0,Rf.createPortal)((0,Y.jsxs)(`div`,{ref:kt,className:`sidebar__status-menu`,role:`menu`,"aria-label":e.locale===`fa`?`عملیات اتصال برد`:`Board connection actions`,style:Ee,children:[(0,Y.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:!c.connected&&kn.retryDisabled,onClick:()=>{we(!1),tn(`reconnect`)},children:c.connected?e.locale===`fa`?`اتصال مجدد`:`Reconnect`:kn.action}),An&&(0,Y.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{we(!1),tn(`reset lines`)},children:e.locale===`fa`?`بازنشانی سخت‌افزاری (DTR)`:`Hardware reset (DTR)`}),c.connected&&(0,Y.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{we(!1),tn(`close`)},children:e.locale===`fa`?`بستن درگاه`:`Close port`}),(0,Y.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{we(!1),se(`ports`),ue(0),ae(!0)},children:e.locale===`fa`?`انتخاب درگاه USB`:`Choose USB port`}),(0,Y.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{we(!1),an(`device`)},children:e.locale===`fa`?`جزئیات دستگاه`:`Device details`})]}),document.body),(0,Y.jsx)(`nav`,{className:`sidebar__nav`,id:`primary-navigation`,children:[`core`,`integrations`,`system`].map(e=>(0,Y.jsxs)(`div`,{className:`nav-group`,children:[(0,Y.jsx)(`span`,{className:`nav-group__label`,children:P(e===`core`?`system`:e===`integrations`?`integrations`:`operations`).toUpperCase()}),Av.filter(t=>t.group===e).map(e=>(0,Y.jsx)(bp,{icon:e.icon,label:P(e.label),active:n===e.id,badge:e.id===`events`&&f.length?String(Math.min(f.length,99)):void 0,onClick:()=>an(e.id)},e.id))]},e))}),(0,Y.jsxs)(`div`,{className:`sidebar__footer`,children:[(0,Y.jsx)(xe,{size:17}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:On}),(0,Y.jsx)(`span`,{children:Mn})]})]})]}),(0,Y.jsxs)(`header`,{className:`topbar`,children:[(0,Y.jsx)(`button`,{className:`mobile-menu`,"aria-label":P(`openNavigation`),onClick:()=>s(!0),children:(0,Y.jsx)(Pe,{size:20})}),(0,Y.jsxs)(`div`,{className:`breadcrumbs`,children:[(0,Y.jsx)(`span`,{children:Bt}),(0,Y.jsx)(`i`,{children:`/`}),(0,Y.jsx)(`strong`,{children:P(wn.label)})]}),(0,Y.jsxs)(`button`,{className:`command-trigger`,"aria-keyshortcuts":np(),onClick:()=>{ue(0),ae(!0)},children:[(0,Y.jsx)(Ke,{size:16}),(0,Y.jsx)(`span`,{children:P(`searchCommands`)}),(0,Y.jsx)(op,{keys:[Q(),`K`]})]}),(0,Y.jsxs)(`div`,{className:`topbar__actions`,children:[!1,Nn?(0,Y.jsx)(`button`,{className:`transport-reconnect`,title:S||void 0,"aria-label":e.locale===`fa`?`اتصال مجدد فوری میزبان`:`Reconnect host now`,onClick:()=>{Nn&&(C(``),x(`connecting`),w(e=>e+1))},children:(0,Y.jsx)(dp,{tone:Dn,children:On})}):(0,Y.jsx)(`span`,{title:S||void 0,children:(0,Y.jsx)(dp,{tone:Dn,pulse:b===`connecting`,children:On})}),(0,Y.jsx)(`button`,{className:`topbar-icon`,"aria-label":e.locale===`fa`?`ترجیحات برنامه`:`Application preferences`,"aria-haspopup":`dialog`,"aria-expanded":be,onClick:()=>k(!0),children:(0,Y.jsx)(Je,{size:18})}),A.theme&&(0,Y.jsx)(`button`,{className:`topbar-icon`,"aria-label":P(`toggleTheme`),onClick:()=>cn({...e,theme:document.documentElement.dataset.theme===`dark`?`light`:`dark`}),children:document.documentElement.dataset.theme===`dark`?(0,Y.jsx)(Qe,{size:18}):(0,Y.jsx)(Ie,{size:18})}),A.language&&(0,Y.jsx)(`button`,{className:`topbar-icon`,"aria-label":P(`switchLanguage`),onClick:()=>cn({...e,locale:e.locale===`en`?`fa`:`en`}),children:(0,Y.jsx)(j,{size:18})}),A.audio&&(0,Y.jsx)(`button`,{className:`topbar-icon topbar-audio`,"aria-label":P(e.audioMuted?`enableAudio`:`muteAudio`),"aria-pressed":e.audioMuted,"aria-keyshortcuts":`M`,onClick:fn,children:e.audioMuted?(0,Y.jsx)(it,{size:18}):(0,Y.jsx)(nt,{size:18})}),A.hotkeys&&(0,Y.jsx)(`button`,{className:`topbar-icon topbar-hotkeys`,"aria-label":P(`keyboardShortcuts`),"aria-keyshortcuts":`?`,onClick:()=>ve(!0),children:(0,Y.jsx)(Te,{size:18})}),A.notifications&&(0,Y.jsxs)(`button`,{className:`topbar-icon`,"aria-label":P(`notifications`),onClick:()=>an(`events`),children:[(0,Y.jsx)(le,{size:18}),f.length>0&&(0,Y.jsx)(`i`,{})]})]})]}),(0,Y.jsxs)(`main`,{className:`app-main`,children:[n!==`dashboard`&&xn&&Sn&&(0,Y.jsxs)(`section`,{className:`hardware-alert app-hardware-alert is-${xn.severity}`,role:`alert`,"aria-live":`assertive`,children:[(0,Y.jsx)(`div`,{className:`hardware-alert__icon`,children:(0,Y.jsx)(et,{size:24,"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{className:`hardware-alert__copy`,children:[(0,Y.jsx)(`strong`,{children:Sn.title}),(0,Y.jsx)(`p`,{children:Sn.guidance}),Sn.impact&&(0,Y.jsx)(`p`,{className:`hardware-alert__impact`,children:Sn.impact})]})]}),(0,Y.jsx)(Cp,{pageKey:n,children:Cn})]}),(0,Y.jsx)(`nav`,{className:`mobile-bottom-nav`,"aria-label":P(`mobileNavigation`),children:Av.slice(0,5).map(e=>(0,Y.jsxs)(`button`,{className:n===e.id?`is-active`:``,onClick:()=>an(e.id),children:[(0,Y.jsx)(rp,{icon:e.icon,size:20}),(0,Y.jsx)(`span`,{children:P(e.label)})]},e.id))}),(0,Y.jsx)(xd,{children:o&&(0,Y.jsxs)(Bf.div,{className:`mobile-drawer-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,Y.jsx)(`button`,{className:`mobile-drawer-backdrop`,"aria-label":P(`dismissNavigation`),onClick:()=>s(!1)}),(0,Y.jsxs)(Bf.aside,{className:`mobile-drawer`,initial:{x:Ut,opacity:0},animate:{x:0,opacity:1},exit:{x:Ut,opacity:0},transition:{duration:.32,ease:[.22,1,.36,1]},children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsx)(`div`,{className:`brand__mark`,children:(0,Y.jsx)(ip,{fallback:Bt})}),(0,Y.jsx)(`strong`,{children:zt}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":P(`closeNavigation`),onClick:()=>s(!1),children:(0,Y.jsx)(ct,{size:19})})]}),Av.map(e=>(0,Y.jsx)(bp,{icon:e.icon,label:P(e.label),active:n===e.id,onClick:()=>an(e.id)},e.id))]})]})}),(0,Y.jsx)(xd,{children:ie&&(0,Y.jsxs)(Bf.div,{className:`palette-layer`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,Y.jsx)(`button`,{className:`palette-backdrop`,"aria-label":P(`closeCommandPalette`),onClick:()=>{ae(!1),se(``)}}),(0,Y.jsxs)(Bf.section,{className:`palette`,role:`dialog`,"aria-modal":`true`,"aria-label":P(`commandPalette`),initial:{opacity:0,scale:.985},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.99},transition:{duration:.2,ease:`easeOut`},children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsx)(ye,{size:19}),(0,Y.jsx)(`input`,{autoFocus:!0,value:oe,placeholder:P(`commandPalettePlaceholder`),"aria-controls":`palette-results`,"aria-activedescendant":mn[ce]?`palette-page-${mn[ce].id}`:hn[ce-mn.length]?`palette-channel-${hn[ce-mn.length].key}`:void 0,onChange:e=>se(e.target.value)}),(0,Y.jsx)(op,{keys:[`Esc`]})]}),(0,Y.jsxs)(`div`,{className:`palette__results`,id:`palette-results`,role:`listbox`,"aria-label":P(`matchingPages`),children:[(0,Y.jsx)(`span`,{className:`palette__label`,children:P(`pagesLabel`).toUpperCase()}),mn.map((t,r)=>(0,Y.jsxs)(`button`,{id:`palette-page-${t.id}`,role:`option`,"aria-selected":r===ce,className:r===ce?`is-highlighted`:``,onPointerMove:()=>ue(r),onClick:()=>{an(t.id),ae(!1),se(``)},children:[(0,Y.jsx)(rp,{icon:t.icon,size:18}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:P(t.label)}),(0,Y.jsx)(`small`,{children:n===t.id?e.locale===`fa`?`صفحه فعلی`:`Current page`:e.locale===`fa`?`باز کردن`:`Open`})]}),(0,Y.jsx)(he,{className:n===t.id?`is-visible`:``,size:16})]},t.id)),(0,Y.jsx)(`span`,{className:`palette__label`,children:P(`quickCommandsLabel`).toUpperCase()}),hn.map((e,t)=>(0,Y.jsxs)(`button`,{id:`palette-channel-${e.key}`,role:`option`,"aria-selected":ce===mn.length+t,className:ce===mn.length+t?`is-highlighted`:``,onPointerMove:()=>ue(mn.length+t),onClick:()=>_n(e.key),children:[(0,Y.jsx)(de,{size:18}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:e.name}),(0,Y.jsx)(`small`,{children:e.key})]})]},e.key)),jn.filter(([e,t])=>`${e} ${t}`.toLowerCase().includes(oe.toLowerCase())).map(([e,t])=>(0,Y.jsxs)(`button`,{role:`option`,"aria-selected":`false`,onClick:()=>{tn(e),ae(!1)},children:[(0,Y.jsx)(de,{size:18}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{dir:`ltr`,children:e}),(0,Y.jsx)(`small`,{children:t})]})]},e))]}),(0,Y.jsxs)(`footer`,{children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(op,{keys:[[`↑`,`↓`]]}),` `,P(`navigate`)]}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(op,{keys:[`Enter`]}),` `,P(`select`)]}),(0,Y.jsxs)(`span`,{children:[mn.length+hn.length+jn.filter(([e,t])=>`${e} ${t}`.toLowerCase().includes(oe.toLowerCase())).length,` `,P(`actions`),` · WS `,b]})]})]})]})}),(0,Y.jsx)(Ep,{state:{...ne,action:En},onClose:Tn,busy:re}),(0,Y.jsx)(Dp,{messages:te,dismiss:e=>T(t=>t.filter(t=>t.id!==e))})]}),(0,Y.jsx)(Q_,{open:be,locale:e.locale,appearance:e,quickHeader:A,onAppearance:cn,onQuickHeader:Gt,onClose:()=>k(!1)}),(0,Y.jsx)(wp,{open:Ae&&Oe,progress:Me,locale:e.locale,productTitle:zt,productShortName:Bt,productTagline:Vt,onEnter:ln}),(0,Y.jsx)(Tp,{open:_e,locale:e.locale,onClose:()=>ve(!1)})]})}function ny(e){let t=e.kind.toLowerCase();return/error|fault|hot/.test(t)?`danger`:/warning|door|disconnect/.test(t)?`warning`:/connect|ready|complete/.test(t)?`success`:`info`}var ry=class{suppressUntil=new WeakMap;begin(e,t,n,r=Date.now()){return t!==`touch`||!n?!1:(this.suppressUntil.set(e,r+800),!0)}shouldSuppressNativeClick(e,t,n=Date.now()){return t===0||n>(this.suppressUntil.get(e)??0)?!1:(this.suppressUntil.delete(e),!0)}};function iy(e){return e instanceof Element?e.closest(`button, [role="button"], [role="switch"], input[type="checkbox"]`)||(e.closest(`label`)?.querySelector(`input[type="checkbox"]`)??null):null}function ay(e){return!e.matches(`:disabled, [aria-disabled="true"]`)&&!e.closest(`[data-touch-mode="hold"], [data-touch-mode="deferred"]`)}function oy(e=document){let t=new ry,n=new WeakSet,r=e=>{let r=iy(e.target);if(r&&ay(r)&&t.begin(r,e.pointerType,e.isPrimary)){e.preventDefault();try{r.focus({preventScroll:!0})}catch{r.focus()}n.add(r),r.click(),n.delete(r)}},i=e=>{let r=iy(e.target);r&&!n.has(r)&&t.shouldSuppressNativeClick(r,e.detail)&&(e.preventDefault(),e.stopImmediatePropagation())};return e.addEventListener(`pointerdown`,r,!0),e.addEventListener(`click`,i,!0),()=>{e.removeEventListener(`pointerdown`,r,!0),e.removeEventListener(`click`,i,!0)}}var sy=document.getElementById(`root`);if(!sy)throw Error(`Controller UI root is missing`);(0,zf.createRoot)(sy).render((0,Y.jsx)(E.StrictMode,{children:(0,Y.jsx)(ty,{})}));var cy=oy();window.addEventListener(`pagehide`,cy,{once:!0}),window.requestAnimationFrame(()=>document.getElementById(`startup-preloader`)?.remove()),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/service-worker.js`,{scope:`/`}).catch(()=>void 0)},{once:!0});export{rp as $,Pm as A,he as At,Fp as B,$m as C,Oe as Ct,gm as D,A as Dt,Qm as E,Ce as Et,jp as F,h as Ft,Pp as G,Mp as H,Np as I,d as It,sp as J,Lp as K,Vp as L,o as Lt,km as M,se as Mt,sm as N,ae as Nt,Im as O,xe as Ot,Yp as P,O as Pt,cp as Q,Ip as R,s as Rt,Zm as S,Ae as St,Xm as T,Te as Tt,Jp as U,Bp as V,qp as W,yp as X,lp as Y,vp as Z,ah as _,Je as _t,I_ as a,gp as at,nh as b,Ie as bt,x_ as c,mp as ct,f_ as d,ut as dt,op as et,v_ as f,ct as ft,lh as g,Qe as gt,qg as h,et as ht,B_ as i,up as it,bm as j,de as jt,_m as k,_e as kt,y_ as l,Bf as lt,h_ as m,nt as mt,fv as n,hp as nt,F_ as o,dp as ot,m_ as p,it as pt,zp as q,dv as r,ap as rt,O_ as s,_p as st,xv as t,pp as tt,b_ as u,xd as ut,rh as v,Ke as vt,eh as w,j as wt,th as x,Me as xt,ih as y,We as yt,Rp as z,l as zt}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-A4VaeTzE.js b/Tools/Controller/internal/webui/dist/assets/chunk-A4VaeTzE.js deleted file mode 100644 index c1bcffa4..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-A4VaeTzE.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunk-D0cdfCGq.js","assets/app-BpGu_3eg.js","assets/index-DQn3kTuT.css"])))=>i.map(i=>d[i]); -import{n as e,t}from"./chunk-C2nxElbj.js";import{a as n,i as r,n as i,r as a,t as o}from"./chunk-DvGrMMmP.js";import{_ as s,a as c,c as l,d as u,f as d,g as f,h as p,i as ee,l as m,m as h,n as g,o as _,p as v,r as te,s as y,t as b,u as ne,v as x,x as S,y as C}from"./chunk-D76V6mr9.js";import{n as w,t as T}from"./chunk-ME8Q1Sy7.js";import{n as E,t as D}from"./chunk-BWN4QWM7.js";import{$ as O,A as k,B as A,D as j,Dt as M,Et as re,F as ie,G as N,H as P,I as F,J as ae,L as oe,M as I,Mt as se,N as ce,O as L,P as le,Q as R,R as ue,T as z,U as B,V,W as de,X as fe,Y as H,Z as pe,_ as me,_t as he,c as ge,ct as _e,et as ve,f as ye,ft as U,g as be,ht as xe,i as Se,it as Ce,j as we,k as Te,kt as Ee,l as De,lt as Oe,m as ke,nt as Ae,ot as je,pt as Me,q as Ne,rt as Pe,s as Fe,t as Ie,tt as W,u as Le,ut as G,v as Re,vt as ze,xt as Be,y as Ve,yt as He,z as Ue}from"./app-BpGu_3eg.js";var We={name:`chart-no-axes-combined`,size:24,node:[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]};We.node;var Ge=M(We),Ke={name:`circle-power`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 7v4`,key:`xawao1`}],[`path`,{d:`M7.998 9.003a5 5 0 1 0 8-.005`,key:`1pek45`}]],aliases:[`power-circle`]};Ke.node;var qe=M(Ke),Je={name:`circuit-board`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]};Je.node;var Ye=M(Je),Xe={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};Xe.node;var Ze=M(Xe),Qe={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Qe.node;var $e=M(Qe),K={name:`heart-pulse`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]};K.node;var et=M(K),tt={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};tt.node;var nt=M(tt),rt={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};rt.node;var it=M(rt),at={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};at.node;var ot=M(at),st={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};st.node;var ct=M(st),lt={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};lt.node;var ut=M(lt),q={name:`timer-reset`,size:24,node:[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]};q.node;var dt=M(q),ft={name:`toggle-right`,size:24,node:[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};ft.node;var pt=M(ft),mt={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};mt.node;var ht=M(mt),J=se(Ee(),1),Y=Ce();function gt(e){let t=e.kind.toLowerCase();return t.includes(`error`)||t.includes(`fault`)||t.includes(`hot`)?`bad`:t.includes(`warning`)||t.includes(`door`)||t.includes(`disconnect`)?`warn`:t.includes(`connect`)||t.includes(`ready`)||t.includes(`complete`)?`good`:`info`}function _t(e){return e.text||e.reason||e.state}function vt({events:n,locale:r,t:i,limit:a=6,toolbar:o=!1}){let s=(e,t)=>r===`fa`?t:e,c=(0,J.useMemo)(()=>[{id:`time`,label:s(`Time`,`زمان`),get:e=>e.time,width:142},{id:`kind`,label:s(`Type`,`نوع`),get:e=>e.kind,width:165},{id:`message`,label:s(`Message`,`پیام`),get:_t,width:330},{id:`source`,label:s(`Source`,`مبدأ`),get:e=>e.source,width:170,visible:o},{id:`metadata`,label:s(`Metadata`,`فراداده`),get:e=>e.metadata,width:270,visible:o}],[r,o]),l=n.slice(0,a);return(0,Y.jsx)(e,{records:l,fields:c,locale:r,direction:r===`fa`?`rtl`:`ltr`,ariaLabel:s(`Controller event collection`,`مجموعهٔ رویدادهای کنترلر`),filename:`controller-events`,toolbar:o,windowSize:120,preserveViewportAnchor:!0,className:`typed-collection--events${o?``:` typed-collection--compact`}`,rowKey:e=>`${e.id}:${e.time}`,rowClassName:e=>`typed-collection__row--${gt(e)}`,renderCell:(e,n,i)=>{if(e.id===`time`)return(0,Y.jsx)(`time`,{dateTime:i.time,children:ke(r,i.time)});if(e.id===`kind`)return(0,Y.jsx)(`strong`,{className:`typed-collection__event-kind`,children:i.kind});if(e.id===`message`)return(0,Y.jsxs)(`div`,{className:`typed-collection__event-copy`,children:[(0,Y.jsx)(`span`,{className:`typed-collection__event-message`,dir:`auto`,children:_t(i)||`—`}),!o&&i.metadata&&Object.keys(i.metadata).length>0&&(0,Y.jsx)(t,{value:i.metadata,label:s(`Expand event metadata`,`نمایش فرادادهٔ رویداد`)})]});if(e.id===`metadata`&&i.metadata&&Object.keys(i.metadata).length)return(0,Y.jsx)(t,{value:i.metadata,label:s(`Expand event metadata`,`نمایش فرادادهٔ رویداد`)});if(n===void 0)return(0,Y.jsx)(`span`,{"aria-hidden":`true`,children:`—`})},empty:(0,Y.jsx)(de,{icon:re,title:i(`noEvents`),detail:i(`eventStream`)})})}var yt=[{value:`app page dashboard`,group:`navigation`,label:{en:`Open dashboard`,fa:`باز کردن داشبورد`}},{value:`app page controls`,group:`navigation`,label:{en:`Open controls`,fa:`باز کردن کنترل‌ها`}},{value:`app page workbench`,group:`navigation`,label:{en:`Open workbench`,fa:`باز کردن میزکار`}},{value:`app page updates`,group:`navigation`,label:{en:`Open updates`,fa:`باز کردن به‌روزرسانی‌ها`}},{value:`app page settings`,group:`navigation`,label:{en:`Open settings`,fa:`باز کردن تنظیمات`}},{value:`app page events`,group:`navigation`,label:{en:`Open event timeline`,fa:`باز کردن رویدادها`}},{value:`status`,group:`diagnostics`,label:{en:`Read controller status`,fa:`خواندن وضعیت کنترلر`}},{value:`os facts system`,group:`diagnostics`,label:{en:`Read host system facts`,fa:`خواندن اطلاعات سیستم میزبان`}},{value:`os facts serial`,group:`diagnostics`,label:{en:`Inspect host serial ports`,fa:`بررسی درگاه‌های سریال میزبان`}},{value:`relay off`,group:`safety`,label:{en:`Turn all outputs off`,fa:`خاموش کردن همه خروجی‌ها`}}],bt=new Set([`Alt`,`AltGraph`,`Control`,`Meta`,`OS`,`Shift`,`Super`,`Win`,`Windows`]),xt={Backspace:`BACKSPACE`,Tab:`TAB`,Enter:`ENTER`,Escape:`ESC`,Esc:`ESC`," ":`SPACE`,Space:`SPACE`,Spacebar:`SPACE`,PageUp:`PAGEUP`,PageDown:`PAGEDOWN`,End:`END`,Home:`HOME`,ArrowLeft:`LEFT`,Left:`LEFT`,ArrowUp:`UP`,Up:`UP`,ArrowRight:`RIGHT`,Right:`RIGHT`,ArrowDown:`DOWN`,Down:`DOWN`,Insert:`INSERT`,Delete:`DELETE`,Del:`DELETE`,AudioVolumeMute:`VOLUME_MUTE`,VolumeMute:`VOLUME_MUTE`,AudioVolumeDown:`VOLUME_DOWN`,VolumeDown:`VOLUME_DOWN`,AudioVolumeUp:`VOLUME_UP`,VolumeUp:`VOLUME_UP`,MediaTrackNext:`MEDIA_NEXT`,MediaNextTrack:`MEDIA_NEXT`,MediaTrackPrevious:`MEDIA_PREVIOUS`,MediaPreviousTrack:`MEDIA_PREVIOUS`,MediaStop:`MEDIA_STOP`,MediaPlayPause:`MEDIA_PLAY_PAUSE`},St={ESC:`Esc`,BACKSPACE:`Backspace`,TAB:`Tab`,ENTER:`Enter`,SPACE:`Space`,PAGEUP:`Page Up`,PAGEDOWN:`Page Down`,END:`End`,HOME:`Home`,LEFT:`←`,UP:`↑`,RIGHT:`→`,DOWN:`↓`,INSERT:`Insert`,DELETE:`Delete`,VOLUME_MUTE:`Mute`,VOLUME_DOWN:`Volume Down`,VOLUME_UP:`Volume Up`,MEDIA_NEXT:`Media Next`,MEDIA_PREVIOUS:`Media Previous`,MEDIA_STOP:`Media Stop`,MEDIA_PLAY_PAUSE:`Play/Pause`};function Ct(e){let t=e.code??``;return/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^F(?:[1-9]|1[0-9]|2[0-4])$/.test(t)?t:xt[e.key]||(/^F(?:[1-9]|1[0-9]|2[0-4])$/i.test(e.key)||/^[a-z0-9]$/i.test(e.key)?e.key.toUpperCase():null)}function wt(e){if(e.repeat||e.isComposing||e.keyCode===229||e.key===`Process`||e.key===`Dead`||e.key===`Unidentified`||bt.has(e.key)||e.getModifierState?.(`AltGraph`))return null;let t=Ct(e);if(!t)return null;let n=[];if(e.ctrlKey&&n.push(`Ctrl`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),e.metaKey&&n.push(`Win`),n.length===0&&!/^F(?:[1-9]|1[0-9]|2[0-4])$/.test(t))return null;let r=[...n,t].join(`+`);return{canonical:r,keys:Tt(r)}}function Tt(e){return e.split(`+`).map(e=>e.trim()).filter(Boolean).map(e=>St[e.toUpperCase()]??{CTRL:`Ctrl`,CONTROL:`Ctrl`,ALT:`Alt`,OPTION:`Alt`,SHIFT:`Shift`,WIN:`Win`,WINDOWS:`Win`,META:`Win`,SUPER:`Win`}[e.toUpperCase()]??e)}function Et(e){return new TextEncoder().encode(e).length}function Dt(e,t){let n=``;for(let r of e){if(Et(n+r)>t)break;n+=r}return n}function Ot(e){return Dt(e.normalize(`NFKC`).replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,``).replace(/\s+/g,` `).trimStart(),64)}function kt(e){return yt.some(t=>t.value===e)}function At(e){let t=e.status;if(!t)return{state:`unavailable`,detail:`The host did not expose registrar status.`};if(t.last_error)return{state:`error`,detail:t.last_error};if(!t.supported)return{state:`error`,detail:`Global hotkeys are not supported by this host.`};let n=e.bindings.filter(e=>e.enabled),r=t.bindings??[];if(n.length===0)return!t.running&&r.length===0?{state:`idle`,detail:`No global shortcuts are enabled.`}:{state:`pending`,detail:`The host is removing the previous shortcuts.`};if(!t.running)return{state:`pending`,detail:`The host registrar has not started yet.`};if(n.length!==r.length)return{state:`pending`,detail:`The host is reconciling the shortcut set.`};let i=new Map(r.map(e=>[e.name.toLocaleLowerCase(`en-US`),e]));for(let e of n){let t=i.get(e.name.toLocaleLowerCase(`en-US`));if(!t||t.accelerator!==e.chord||t.command!==e.command)return{state:`pending`,detail:`The host has not confirmed ${e.name} yet.`}}return{state:`active`,detail:`${n.length} global shortcut${n.length===1?``:`s`} active.`}}var jt=new Set([`Alt`,`AltGraph`,`Control`,`Meta`,`OS`,`Shift`,`Super`,`Win`,`Windows`]);function X(e,t,n){return e===`fa`?n:t}function Z(e,t,n){if(n.state===`active`){let n=t.bindings.filter(e=>e.enabled).length;return e===`fa`?`${Ve(`fa`,n)} میانبر سراسری فعال است.`:`${n} global ${n===1?`shortcut is`:`shortcuts are`} active.`}return n.state===`idle`?X(e,`No global shortcuts are enabled.`,`هیچ میانبر سراسری فعالی وجود ندارد.`):n.detail}function Mt(e,t){return new Promise(n=>{if(t.aborted){n(!1);return}let r=window.setTimeout(()=>{t.removeEventListener(`abort`,i),n(!0)},e),i=()=>{window.clearTimeout(r),n(!1)};t.addEventListener(`abort`,i,{once:!0})})}function Nt({chord:e}){return(0,Y.jsx)(Ne,{keys:Tt(e)})}function Pt({locale:e}){let[t,n]=(0,J.useState)(null),[i,o]=(0,J.useState)(!0),[c,l]=(0,J.useState)(``),[d,f]=(0,J.useState)(null),[ee,m]=(0,J.useState)(``),[h,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(yt[0].value),[te,y]=(0,J.useState)(!0),[b,ne]=(0,J.useState)(!1),[x,S]=(0,J.useState)(!1),[C,w]=(0,J.useState)(!1),[T,D]=(0,J.useState)(``),[k,A]=(0,J.useState)(`info`),[j,M]=(0,J.useState)(!1),re=(0,J.useRef)(null),ie=(0,J.useRef)(null),N=(0,J.useRef)(null),F=e=>{f(e.name),m(e.name),g(e.chord),v(e.command),y(e.enabled),ne(!1),M(!1),D(``)},ae=(t=!1)=>{f(null),m(``),g(``),v(yt[0].value),y(!0),ne(!1),M(!1),D(X(e,`Name the shortcut, record its keys, then choose an action.`,`میانبر را نام‌گذاری کنید، کلیدها را ضبط و سپس یک کنش انتخاب کنید.`)),A(`info`),t&&window.requestAnimationFrame(()=>ie.current?.focus())},oe=async(e,t=!1)=>{l(``);try{let r=await z(`controller.hotkeys.get`,{},e);if(n(r),t){let e=r.bindings[0];e?F(e):ae()}return r}catch(t){if(e?.aborted)return null;let n=t instanceof Error?t.message:String(t);return l(n),null}finally{e?.aborted||o(!1)}};(0,J.useEffect)(()=>{let e=new AbortController;return oe(e.signal,!0),()=>{e.abort(),N.current?.abort()}},[]);let I=(0,J.useMemo)(()=>t?.bindings.find(e=>e.name.toLocaleLowerCase(`en-US`)===d?.toLocaleLowerCase(`en-US`)),[d,t]),se=Ot(ee).trim(),ce=t?.bindings.some(e=>e.name.toLocaleLowerCase(`en-US`)===se.toLocaleLowerCase(`en-US`)&&e.name.toLocaleLowerCase(`en-US`)!==d?.toLocaleLowerCase(`en-US`))??!1,L=t?.bindings.some(e=>e.chord===h&&e.name.toLocaleLowerCase(`en-US`)!==d?.toLocaleLowerCase(`en-US`))??!1,le=se?ce?X(e,`That name is already in use.`,`این نام قبلاً استفاده شده است.`):``:X(e,`A binding name is required.`,`نام میانبر الزامی است.`),R=h?L?X(e,`That key combination is already assigned.`,`این ترکیب کلید قبلاً اختصاص یافته است.`):``:X(e,`Record a supported key combination.`,`یک ترکیب کلید پشتیبانی‌شده ضبط کنید.`),ue=kt(_)?``:X(e,`Choose an approved action before saving.`,`پیش از ذخیره، یک کنش تأییدشده انتخاب کنید.`),B=ee?le:``,de=h?R:``,fe=!le&&!R&&!ue,H=!I||I.enabled!==te||I.chord!==h||I.command!==_,pe=t?At(t):null,me=!!(t?.apply_pending||C),he=!me&&pe?.state===`error`?pe.detail:``,ge=he?`danger`:k,ye=i?{tone:`neutral`,label:X(e,`Synchronizing`,`همگام‌سازی`)}:c?{tone:`bad`,label:X(e,`Unavailable`,`دردسترس نیست`)}:me?{tone:`warn`,label:X(e,`Apply pending`,`در انتظار اعمال`)}:pe?.state===`active`?{tone:`good`,label:X(e,`Active`,`فعال`)}:pe?.state===`error`?{tone:`bad`,label:X(e,`Registration failed`,`ثبت ناموفق`)}:pe?.state===`idle`?{tone:`neutral`,label:X(e,`No active bindings`,`بدون میانبر فعال`)}:{tone:`warn`,label:X(e,`Not confirmed`,`تأیید نشده`)},U=async t=>{N.current?.abort();let r=new AbortController;N.current=r,w(!0),n(t),D(X(e,`Saved. Waiting for the host registrar to confirm the change…`,`ذخیره شد؛ در انتظار تأیید تغییر توسط میزبان…`)),A(`info`);for(let t=0;t<16;t+=1){if(!await Mt(t===0?100:250,r.signal))return;let i;try{i=await z(`controller.hotkeys.get`,{},r.signal)}catch(e){if(r.signal.aborted)return;w(!1),n(e=>e&&{...e,apply_pending:!1}),D(e instanceof Error?e.message:String(e)),A(`danger`);return}n(i);let a=At(i);if(a.state===`active`||a.state===`idle`){w(!1),D(Z(e,i,a)),A(`success`);return}if(a.state===`error`||a.state===`unavailable`){w(!1),D(a.detail),A(a.state===`error`?`danger`:`warning`);return}}w(!1),D(X(e,`Saved, but the registrar did not confirm the change in time.`,`ذخیره شد، اما ثبت‌کننده در زمان مقرر تغییر را تأیید نکرد.`)),A(`warning`)},be=async e=>{if(e.preventDefault(),fe&&H){S(!0),M(!1),D(``);try{let e=await z(`controller.hotkeys.set`,{operation:`upsert`,name:I?.name??se,enabled:te,chord:h,command:_}),t=e.bindings.find(e=>e.name.toLocaleLowerCase(`en-US`)===(I?.name??se).toLocaleLowerCase(`en-US`));t&&F(t),U(e)}catch(e){D(e instanceof Error?e.message:String(e)),A(`danger`)}finally{S(!1)}}},xe=async()=>{if(I){if(!j)M(!0),D(X(e,`Confirm removal of “${I.name}”.`,`حذف «${I.name}» را تأیید کنید.`)),A(`warning`);else{S(!0);try{let e=await z(`controller.hotkeys.set`,{operation:`remove`,name:I.name});ae(!0),U(e)}catch(e){D(e instanceof Error?e.message:String(e)),A(`danger`)}finally{S(!1)}}}},Se=()=>{ne(!0),M(!1),D(X(e,`Listening now. Press a combination, or Escape to cancel.`,`در حال شنیدن؛ ترکیب کلید را بزنید یا با Escape لغو کنید.`)),A(`info`),window.requestAnimationFrame(()=>re.current?.focus())},Ce=t=>{if(!b||t.nativeEvent.isComposing||t.keyCode===229)return;if(t.stopPropagation(),t.key===`Escape`&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.metaKey){t.preventDefault(),ne(!1),D(X(e,`Shortcut recording cancelled.`,`ضبط میانبر لغو شد.`)),A(`info`);return}if(jt.has(t.key)||t.repeat)return;t.preventDefault();let n=wt(t.nativeEvent);n?(g(n.canonical),ne(!1),M(!1),D(X(e,`Recorded ${n.canonical}.`,`${n.canonical} ضبط شد.`)),A(`success`)):(D(X(e,`Use Ctrl, Alt, Shift or Win with a supported key; F1–F24 may be used alone.`,`از Ctrl، Alt، Shift یا Win همراه یک کلید پشتیبانی‌شده استفاده کنید؛ F1 تا F24 می‌توانند تنها باشند.`)),A(`warning`))},we=[`navigation`,`diagnostics`,`safety`].map(e=>({group:e,commands:yt.filter(t=>t.group===e)}));return(0,Y.jsx)(P,{icon:ze,iconTone:ye.tone===`bad`?`red`:ye.tone===`good`?`green`:ye.tone===`warn`?`amber`:`violet`,title:X(e,`Global shortcuts`,`میانبرهای سراسری`),eyebrow:ye.label,className:`settings-card settings-card--wide hotkey-card`,action:(0,Y.jsx)(O,{tone:ye.tone,pulse:me,children:ye.label}),children:c&&!t?(0,Y.jsxs)(`div`,{className:`hotkey-editor__load-error`,role:`alert`,children:[(0,Y.jsx)(_e,{"aria-hidden":`true`,size:20}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:X(e,`Hotkey settings could not be loaded`,`تنظیمات میانبر بارگیری نشد`)}),(0,Y.jsx)(`span`,{children:c})]}),(0,Y.jsx)(V,{icon:a,busy:i,onClick:()=>{o(!0),oe(void 0,!0)},children:X(e,`Retry`,`تلاش دوباره`)})]}):(0,Y.jsxs)(`div`,{className:`hotkey-editor`,children:[(0,Y.jsxs)(`section`,{className:`hotkey-editor__library`,"aria-label":X(e,`Configured global shortcuts`,`میانبرهای سراسری پیکربندی‌شده`),children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:X(e,`Bindings`,`میانبرها`)}),(0,Y.jsx)(`small`,{children:t?X(e,`${t.bindings.length} configured`,`${t.bindings.length} مورد پیکربندی شده`):X(e,`Loading…`,`در حال بارگیری…`)})]}),(0,Y.jsx)(V,{ref:ie,compact:!0,icon:s,onClick:()=>ae(),children:X(e,`New`,`جدید`)})]}),(0,Y.jsxs)(`div`,{className:`hotkey-binding-list`,children:[t?.bindings.map(t=>(0,Y.jsxs)(`button`,{type:`button`,className:t.name.toLocaleLowerCase(`en-US`)===d?.toLocaleLowerCase(`en-US`)?`is-selected`:``,"aria-pressed":t.name.toLocaleLowerCase(`en-US`)===d?.toLocaleLowerCase(`en-US`),onClick:()=>F(t),children:[(0,Y.jsx)(`span`,{className:`hotkey-binding-list__icon`,children:(0,Y.jsx)(ze,{"aria-hidden":`true`,size:17})}),(0,Y.jsxs)(`span`,{className:`hotkey-binding-list__copy`,children:[(0,Y.jsx)(`strong`,{children:t.name}),(0,Y.jsx)(Nt,{chord:t.chord})]}),(0,Y.jsx)(`span`,{className:`hotkey-binding-list__state${t.enabled?` is-enabled`:``}`,children:t.enabled?X(e,`Enabled`,`فعال`):X(e,`Disabled`,`غیرفعال`)})]},t.name)),t?.bindings.length===0&&(0,Y.jsxs)(`div`,{className:`hotkey-binding-list__empty`,children:[(0,Y.jsx)(ze,{"aria-hidden":`true`,size:22}),(0,Y.jsx)(`span`,{children:X(e,`No shortcuts configured yet.`,`هنوز میانبری پیکربندی نشده است.`)})]})]})]}),(0,Y.jsxs)(`form`,{className:`hotkey-editor__form`,onSubmit:e=>void be(e),children:[(0,Y.jsxs)(`header`,{className:`hotkey-editor__form-heading`,children:[(0,Y.jsx)(`span`,{className:`hotkey-editor__form-icon`,children:I?(0,Y.jsx)(E,{"aria-hidden":`true`,size:19}):(0,Y.jsx)(s,{"aria-hidden":`true`,size:19})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`small`,{children:I?X(e,`EDIT BINDING`,`ویرایش میانبر`):X(e,`NEW BINDING`,`میانبر جدید`)}),(0,Y.jsx)(`strong`,{children:I?.name||X(e,`Create a global shortcut`,`ایجاد میانبر سراسری`)})]})]}),(0,Y.jsxs)(`div`,{className:`hotkey-editor__fields`,children:[(0,Y.jsx)(ve,{label:X(e,`Binding name`,`نام میانبر`),value:ee,disabled:!!I,autoComplete:`off`,spellCheck:!1,onInput:e=>{m(Ot(e.currentTarget.value)),D(``),M(!1)},onChange:e=>{m(Ot(e.currentTarget.value)),D(``),M(!1)},onBlur:()=>m(e=>e.trim()),error:B||void 0,hint:I?X(e,`Names stay fixed so an edit cannot create a duplicate binding.`,`نام ثابت می‌ماند تا ویرایش، میانبر تکراری نسازد.`):void 0}),(0,Y.jsxs)(`label`,{className:`hotkey-command-field${ue?` is-invalid`:``}`,children:[(0,Y.jsx)(`span`,{children:X(e,`Action`,`کنش`)}),(0,Y.jsxs)(`select`,{value:_,"aria-invalid":ue?!0:void 0,onChange:e=>{v(e.currentTarget.value),D(``),M(!1)},children:[!kt(_)&&(0,Y.jsx)(`option`,{value:_,disabled:!0,children:X(e,`Existing custom action — choose a safe replacement`,`کنش سفارشی فعلی — یک جایگزین امن انتخاب کنید`)}),we.map(({group:t,commands:n})=>(0,Y.jsx)(`optgroup`,{label:{navigation:X(e,`Navigation`,`پیمایش`),diagnostics:X(e,`Diagnostics`,`عیب‌یابی`),safety:X(e,`Safety`,`ایمنی`)}[t],children:n.map(t=>(0,Y.jsx)(`option`,{value:t.value,children:t.label[e]},t.value))},t))]}),(0,Y.jsx)(`small`,{className:ue?`text-bad`:``,dir:`ltr`,children:ue||_})]}),(0,Y.jsxs)(`div`,{className:`hotkey-recorder-field${de?` is-invalid`:``}`,children:[(0,Y.jsx)(`span`,{children:X(e,`Key combination`,`ترکیب کلید`)}),(0,Y.jsxs)(`button`,{ref:re,type:`button`,className:`hotkey-recorder${b?` is-recording`:``}`,"aria-pressed":b,"aria-describedby":`hotkey-recorder-message`,onClick:Se,onKeyDown:Ce,onBlur:()=>{b&&(ne(!1),D(X(e,`Shortcut recording stopped.`,`ضبط میانبر متوقف شد.`)),A(`info`))},children:[(0,Y.jsx)(`span`,{className:`hotkey-recorder__indicator`,"aria-hidden":`true`}),h?(0,Y.jsx)(Nt,{chord:h}):(0,Y.jsx)(`span`,{children:X(e,`Record shortcut`,`ضبط میانبر`)}),(0,Y.jsx)(`small`,{children:b?X(e,`Listening…`,`در حال شنیدن…`):X(e,`Press to record`,`برای ضبط فشار دهید`)})]}),(0,Y.jsx)(`small`,{id:`hotkey-recorder-message`,className:de?`text-bad`:``,role:de?`alert`:`status`,children:de||(b?X(e,`Waiting for a non-modifier key.`,`در انتظار یک کلید غیرترکیبی.`):h?X(e,`The recorded combination is valid.`,`ترکیب ضبط‌شده معتبر است.`):X(e,`No key combination recorded.`,`هنوز ترکیب کلیدی ضبط نشده است.`))})]})]}),(0,Y.jsx)(W,{checked:te,onChange:e=>{y(e),D(``),M(!1)},label:X(e,`Enable this global shortcut`,`فعال‌سازی این میانبر سراسری`),detail:te?X(e,`The host will register it after saving.`,`میزبان پس از ذخیره آن را ثبت می‌کند.`):X(e,`The binding is saved but not registered.`,`میانبر ذخیره می‌شود اما ثبت نخواهد شد.`)}),(0,Y.jsxs)(`div`,{className:`hotkey-editor__notice is-${ge}`,role:ge===`danger`?`alert`:`status`,"aria-live":`polite`,children:[ge===`danger`?(0,Y.jsx)(_e,{"aria-hidden":`true`,size:17}):ge===`success`?(0,Y.jsx)(r,{"aria-hidden":`true`,size:17}):(0,Y.jsx)(`span`,{className:`hotkey-editor__notice-line`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:he||T||(t&&pe?Z(e,t,pe):``)||X(e,`Choose a binding to edit or create a new one.`,`یک میانبر را برای ویرایش انتخاب یا میانبر تازه‌ای ایجاد کنید.`)})]}),(0,Y.jsxs)(`footer`,{className:`hotkey-editor__actions`,children:[(0,Y.jsx)(V,{type:`submit`,tone:`primary`,icon:p,busy:x,disabled:!fe||!H||j||me,children:I?X(e,`Save binding`,`ذخیره میانبر`):X(e,`Add binding`,`افزودن میانبر`)}),I&&(0,Y.jsx)(V,{type:`button`,tone:`danger`,icon:u,busy:x,disabled:me,onClick:()=>void xe(),children:j?X(e,`Confirm remove`,`تأیید حذف`):X(e,`Remove`,`حذف`)}),j&&(0,Y.jsx)(V,{type:`button`,tone:`ghost`,onClick:()=>{M(!1),D(``)},children:X(e,`Cancel`,`لغو`)})]})]})]})})}var Ft=[`relay`,`motion`,`pwm`,`display`,`sensor`];function It(e,t){let n=new Map(t.map(e=>[e.key,e.default_name]));return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,ue(t).normalized]).filter(([e,t])=>t&&t!==n.get(e)).sort(([e],[t])=>e.localeCompare(t)))}function Lt(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Rt({locale:e}){let t=(t,n)=>e===`fa`?n:t,[n,r]=(0,J.useState)([]),[a,o]=(0,J.useState)({}),[s,c]=(0,J.useState)({}),[l,u]=(0,J.useState)(!0),[d,f]=(0,J.useState)(``),[p,ee]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let e=!0;return z(`controller.peripherals.get`).then(t=>{if(!e)return;let n=It(t.peripheral_names??{},t.peripherals??[]);r(t.peripherals??[]),o(n),c(n),f(``),ee(!1)}).catch(t=>{e&&(f(t instanceof Error?t.message:String(t)),ee(!0))}).finally(()=>{e&&u(!1)}),()=>{e=!1}},[]);let m=(0,J.useMemo)(()=>It(s,n),[n,s]),h=!Lt(m,a),g=Object.keys(m).length,_=(0,J.useMemo)(()=>Ft.map(e=>({kind:e,entries:n.filter(t=>t.kind===e)})).filter(e=>e.entries.length),[n]),v=e=>({relay:t(`Relays`,`رله‌ها`),motion:t(`Motion sides`,`سمت‌های حرکت`),pwm:t(`PWM and lighting`,`PWM و نورپردازی`),display:t(`Displays`,`نمایشگرها`),sensor:t(`Sensors`,`حسگرها`)})[e]??e,te=(e,t)=>{f(``),ee(!1),c(n=>({...n,[e]:Te(t)}))},y=async()=>{if(h){u(!0),f(``),ee(!1);try{let e=await z(`controller.peripherals.set`,{peripheral_names:m}),i=It(e.peripheral_names??{},e.peripherals??n);r(e.peripherals??n),o(i),c(i),f(t(`Names saved.`,`نام‌ها ذخیره شدند.`))}catch(e){f(e instanceof Error?e.message:String(e)),ee(!0)}finally{u(!1)}}},b=d||(l?t(`Synchronizing the host peripheral catalog…`,`در حال همگام‌سازی فهرست تجهیزات میزبان…`):h?t(`${g} custom name${g===1?``:`s`} in the validated draft.`,`${g} نام سفارشی در پیش‌نویس معتبر است.`):t(`${n.length} peripherals synchronized · ${g} customized.`,`${n.length} تجهیز همگام است · ${g} مورد سفارشی شده.`));return(0,Y.jsxs)(P,{icon:U,iconTone:`accent`,title:t(`Peripheral names`,`نام تجهیزات`),eyebrow:l?t(`Synchronizing`,`در حال همگام‌سازی`):h?t(`Unsaved changes`,`تغییرات ذخیره‌نشده`):t(`Host authoritative`,`مرجع میزبان`),className:`settings-card settings-card--wide peripheral-names-card`,menu:n.length?[{label:t(`Restore every default name`,`بازگردانی همهٔ نام‌های پیش‌فرض`),icon:i,onSelect:()=>{c({}),f(``),ee(!1)}}]:void 0,children:[(0,Y.jsx)(`div`,{className:`peripheral-name-groups`,"aria-busy":l,children:_.map((e,n)=>(0,Y.jsxs)(`details`,{className:`peripheral-name-group`,open:n===0,children:[(0,Y.jsxs)(`summary`,{children:[(0,Y.jsx)(`span`,{children:v(e.kind)}),(0,Y.jsx)(`small`,{children:e.entries.length})]}),(0,Y.jsx)(`div`,{className:`peripheral-name-grid`,children:e.entries.map(e=>{let n=s[e.key]??``,r=ue(n),a=!!(r.normalized&&r.normalized!==e.default_name);return(0,Y.jsx)(ve,{label:e.default_name,value:n,placeholder:e.default_name,maxLength:64,onInput:t=>te(e.key,t.currentTarget.value),onChange:t=>te(e.key,t.currentTarget.value),error:r.valid?void 0:r.error,success:a?t(`Custom · ${e.key}`,`سفارشی · ${e.key}`):void 0,action:(0,Y.jsx)(V,{compact:!0,disabled:!n,icon:i,onClick:()=>te(e.key,``),children:t(`Default`,`پیش‌فرض`)})},e.key)})})]},e.kind))}),(0,Y.jsxs)(`footer`,{className:`peripheral-names-card__footer`,children:[(0,Y.jsx)(`span`,{className:p?`text-warn`:d&&!h?`text-good`:``,role:`status`,"aria-live":`polite`,children:b}),(0,Y.jsx)(V,{tone:`primary`,icon:E,busy:l,disabled:!h,onClick:()=>void y(),children:t(`Save names`,`ذخیرهٔ نام‌ها`)})]})]})}function zt(e){return e?e.transitioning?e.requested:e.applied:`unknown`}var Bt=Object.freeze(Array.from({length:11},(e,t)=>t));function Q(e){return Number.isFinite(e)?Math.max(0,Math.min(4095,Math.round(e))):0}function Vt(e,t){let n=Q(e)/4095;return t?.curve===`gamma`&&(n=Wt(n,t.gamma)),Math.round(n*1e3)/10}function Ht(e,t){if(!Number.isFinite(e))return 0;let n=Math.max(0,Math.min(100,e))/100;t?.curve===`gamma`&&(n=Ut(n,t.gamma));let r=Q(n*4095);return e>0&&r===0?1:r}function Ut(e,t){let n=.04,r=(t-1)*n,i=(t*n/(1+r))**t;return e<=n?e*i/n:((e+r)/(1+r))**+t}function Wt(e,t){let n=.04,r=(t-1)*n,i=(t*n/(1+r))**t;return e<=i?e*n/i:e**(1/t)*(1+r)-r}function Gt(e){if(typeof e?.available!=`boolean`||!Number.isInteger(e?.selected_channel)||e.selected_channel<0||e.selected_channel>15||!Array.isArray(e?.values)||e.values.length!==16)throw Error(`Controller returned an invalid PWM snapshot`);let t=e.values.map(e=>{if(!Number.isInteger(e)||e<0||e>4095)throw Error(`Controller returned an out-of-range PWM value`);return e}),n=e.channels?.map(e=>({...e,config:{...e.config}}));return{available:e.available,selected_channel:e.selected_channel,values:t,channels:n}}var Kt=class{queued=[];active=!1;run(e){return new Promise((t,n)=>{this.queued.push(()=>{let r;try{r=e()}catch(e){n(e),this.advance();return}r.then(e=>{t(e),this.advance()},e=>{n(e),this.advance()})}),this.drain()})}drain(){if(this.active)return;let e=this.queued.shift();e&&(this.active=!0,e())}advance(){this.active=!1,this.drain()}},qt=class{intervalMS;options;timer=null;readAbort=null;generation=0;running=!1;constructor(e){this.options=e,this.intervalMS=Math.max(250,Math.min(3e4,Math.round(e.intervalMS??1500)))}start(){if(this.running)return;this.running=!0;let e=++this.generation;this.schedule(0,e)}stop(){this.running=!1,this.generation++,this.timer!==null&&clearTimeout(this.timer),this.timer=null,this.readAbort?.abort(),this.readAbort=null}schedule(e,t){this.running&&t===this.generation&&(this.timer=setTimeout(()=>{this.timer=null,this.tick(t)},e))}async tick(e){if(!this.running||e!==this.generation)return;if(!this.options.canRead()){this.schedule(this.intervalMS,e);return}let t=new AbortController;this.readAbort=t;try{let n=Gt(await this.options.operations.run(()=>this.options.read(t.signal)));this.running&&e===this.generation&&this.options.onAuthoritative(n)}catch(t){this.running&&e===this.generation&&this.options.onError(t instanceof Error?t:Error(String(t)))}finally{this.readAbort===t&&(this.readAbort=null),this.schedule(this.intervalMS,e)}}},$=class{delayMS;options;operations;desired=new Map;inFlight=new Set;timers=new Map;revision=0;disposed=!1;constructor(e){this.options=e,this.operations=e.operations??new Kt,this.delayMS=Math.max(0,Math.round(e.delayMS??140))}schedule(e,t,n=!1){if(this.disposed)return;if(!Bt.includes(e)){this.options.onError(e,Error(`Generic PWM controls are limited to user channels 0..10`));return}let r=Q(t);this.desired.set(e,{value:r,revision:++this.revision}),this.options.onDraft(e,r);let i=this.timers.get(e);i&&clearTimeout(i),this.timers.delete(e),this.notifyPending(),n?this.flush(e):this.timers.set(e,setTimeout(()=>{this.timers.delete(e),this.flush(e)},this.delayMS))}pendingChannels(){return[...new Set([...this.desired.keys(),...this.inFlight])].sort((e,t)=>e-t)}dispose(){this.disposed=!0;for(let e of this.timers.values())clearTimeout(e);this.timers.clear(),this.desired.clear()}async flush(e){if(this.disposed||this.inFlight.has(e))return;let t=this.desired.get(e);if(t){this.inFlight.add(e),this.notifyPending();try{let n=Gt(await this.operations.run(()=>this.options.commit(e,t.value)));if(this.disposed)return;let r=this.desired.get(e)?.revision===t.revision;r&&this.desired.delete(e),this.options.onAuthoritative(n,r?e:null)}catch(n){if(this.disposed)return;this.desired.get(e)?.revision===t.revision&&this.desired.delete(e),this.options.onError(e,n instanceof Error?n:Error(String(n)))}finally{this.inFlight.delete(e),!this.disposed&&this.desired.has(e)&&this.flush(e),this.notifyPending()}}}notifyPending(){this.disposed||this.options.onPending(this.pendingChannels())}};function Jt(e,t,n){return e?.find(e=>e.key===t)?.name.trim()||n}var Yt=(0,J.lazy)(()=>Ie(()=>import(`./chunk-D0cdfCGq.js`).then(e=>({default:e.TelemetryChart})),__vite__mapDeps([0,1,2])));function Xt(e,t){let[n,r]=(0,J.useState)(Date.now);return(0,J.useEffect)(()=>{let n=0,i=!1,a=e?Date.parse(e):NaN,o=()=>{if(i||!Number.isFinite(a))return;let e=Math.max(0,Date.now()-a),s=e{r(Date.now()),o()},s)};return r(Date.now()),o(),()=>{i=!0,window.clearTimeout(n)}},[t,e]),n}function Zt(e,t,n){return e.connected?e.port.friendly_name||e.port.product||e.port.name||t:e.connection_reason||(n===`fa`?`در انتظار اتصال کنترلر`:`Waiting for a controller connection`)}function Qt(e,t){return e.map(e=>e[t]).filter(e=>typeof e==`number`&&Number.isFinite(e))}function $t(e){let t=e.kind.toLowerCase();return t.includes(`error`)||t.includes(`fault`)||t.includes(`hot`)?`bad`:t.includes(`warning`)||t.includes(`door`)||t.includes(`disconnect`)?`warn`:t.includes(`connect`)||t.includes(`ready`)||t.includes(`complete`)?`good`:`info`}function en({state:e,locale:t,action:n,showTitle:r=!0}){let i=(e,n)=>t===`fa`?n:e,a=e===`connecting`||e===`transport-offline`,o=e===`transport-offline`?i(`Reconnecting…`,`در حال اتصال دوباره…`):e===`connecting`?i(`Connecting…`,`در حال اتصال…`):i(`Board offline`,`برد آفلاین`);return(0,Y.jsxs)(`div`,{className:`controller-unavailable is-${e}`,role:`status`,"aria-live":`polite`,children:[a?(0,Y.jsxs)(`div`,{className:`connection-fuji`,"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{className:`connection-fuji__sun`}),(0,Y.jsx)(`span`,{className:`connection-fuji__rear`}),(0,Y.jsx)(`span`,{className:`connection-fuji__face`}),(0,Y.jsx)(`span`,{className:`connection-fuji__snow`}),(0,Y.jsx)(`span`,{className:`connection-fuji__trace`})]}):(0,Y.jsx)(`span`,{className:`controller-unavailable__icon`,"aria-hidden":`true`,children:(0,Y.jsx)(S,{size:28})}),r&&(0,Y.jsx)(`strong`,{children:o}),n&&(0,Y.jsx)(`div`,{className:`controller-unavailable__action`,children:n})]})}function tn({snapshot:e,locale:t,reconnect:n,hardwareReset:r}){let i=(e,n)=>t===`fa`?n:e,[s,c]=(0,J.useState)(Date.now);(0,J.useEffect)(()=>{if(e.connection_phase!==`attempting`&&e.connection_phase!==`waiting_retry`)return;let t=window.setInterval(()=>c(Date.now()),250);return()=>window.clearInterval(t)},[e.connection_phase,e.connection_attempt_started,e.connection_next_retry]);let l=De(e,t,s),u=l.phase===`blocked`?(0,Y.jsx)(ot,{size:30}):l.phase===`paused`?(0,Y.jsx)(ne,{size:30}):l.phase===`waiting_retry`?(0,Y.jsx)(dt,{size:30}):(0,Y.jsx)(ct,{size:30});return(0,Y.jsxs)(`div`,{className:`connection-state connection-state--${l.tone} is-${l.phase}`,role:`status`,"aria-live":`polite`,children:[(0,Y.jsx)(`div`,{className:`connection-state__icon`,"aria-hidden":`true`,children:u}),(0,Y.jsxs)(`div`,{className:`connection-state__body`,children:[(0,Y.jsxs)(`div`,{className:`connection-state__heading`,children:[(0,Y.jsx)(`strong`,{children:l.title}),l.attempt&&(0,Y.jsx)(`span`,{className:`connection-state__attempt`,children:l.attempt})]}),(0,Y.jsx)(`p`,{children:l.detail}),(0,Y.jsxs)(`div`,{className:`connection-state__facts`,children:[l.candidate&&(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(o,{size:15}),l.candidate]}),l.timing&&(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(dt,{size:15}),l.timing]})]})]}),(0,Y.jsxs)(`div`,{className:`connection-state__actions`,children:[r&&(0,Y.jsx)(V,{compact:!0,icon:C,onClick:r,children:i(`Hardware reset`,`بازنشانی سخت‌افزاری`)}),(0,Y.jsx)(V,{compact:!0,tone:l.phase===`blocked`?`danger`:`primary`,icon:l.animated?a:ct,busy:l.animated,disabled:l.retryDisabled,onClick:n,children:l.action})]})]})}var nn=[`telemetry`,`outputs`,`overview`,`actions`,`events`];function rn(e){let{appTitle:t,snapshot:n,samples:r,events:i,locale:o,t:s,command:u,refresh:f,openDialog:p}=e,h=(e,t)=>o===`fa`?t:e,v=n.status,x=e.transport.boardState===`ready`&&n.connected&&n.have_status,S=ge(n),C=S.ina219||S.temperatureLED||S.temperatureBTAudio,w=C,T=[S.invalidINA219?h(`Power measurements unavailable`,`اندازه‌گیری‌های توان در دسترس نیست`):``,S.invalidTemperatureLED?h(`LED temperature unavailable`,`دمای LED در دسترس نیست`):``,S.invalidTemperatureBTAudio?h(`BT Amplifier temperature unavailable`,`دمای آمپلی‌فایر بلوتوث در دسترس نیست`):``].filter(Boolean),k=n.hardware_problems?.[0],A=k?Se(k,o):void 0,j=!x&&e.transport.authenticationRequired,M=e.transport.boardState===`loading`,ie=!j&&e.transport.streamState===`connecting`,N=!j&&e.transport.streamState!==`open`,F=De(n,o),oe=x?`good`:ie?`info`:F.tone,I=N?ie?h(`Connecting…`,`در حال اتصال…`):h(`Reconnecting…`,`در حال اتصال دوباره…`):A?.title||(M?h(`Discovering controller board…`,`در حال جستجوی برد کنترلر…`):F.title),se=N?void 0:A?.guidance||n.connection_reason||s(`noHardware`),ce=x?s(`online`):ie?h(`Connecting`,`در حال اتصال`):N?h(`Reconnecting`,`در حال اتصال دوباره`):M?h(`Searching for board`,`در حال جستجوی برد`):F.title,L=n.hello.build_hash?n.hello.build_hash.toString(16).toUpperCase().padStart(8,`0`):`—`,le=Array.from({length:8},(e,t)=>!!(v.active_relays&1<e.kind===`config`)?.id??0,ue=e.transport.measurementFreshnessMS??1500,de=Xt(n.status_updated,ue),fe=me(o,n.status_updated,ue,de),[H,he]=(0,J.useState)(null),[ve,ye]=(0,J.useState)(!1),[U,Ce]=(0,J.useState)(()=>b(`dashboard`,nn)),[we,Te]=(0,J.useState)(null),Ee=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!x){he(null);return}let e=!0;return z(`controller.ui.config.get`).then(t=>{e&&he(t)}).catch(()=>{e&&he(null)}),()=>{e=!1}},[x,R]);let Oe=(e,t)=>Jt(H?.controls,e,H?.peripheral_names?.[e]?.trim()||t),Ae=[h(`Side A direction`,`جهت سمت A`),h(`Side A output`,`خروجی سمت A`),h(`Side B direction`,`جهت سمت B`),h(`Side B output`,`خروجی سمت B`),h(`User relay 5`,`رلهٔ کاربر ۵`),h(`User relay 6`,`رلهٔ کاربر ۶`),h(`User relay 7`,`رلهٔ کاربر ۷`),h(`User relay 8`,`رلهٔ کاربر ۸`)],je={move:h(`Move`,`جابجایی`),collapse:h(`Collapse`,`جمع‌کردن`),expand:h(`Expand`,`بازکردن`),hide:h(`Hide`,`پنهان‌کردن`),show:h(`Show`,`نمایش`),customize:h(`Arrange`,`چیدمان`),done:h(`Done`,`پایان`),reset:h(`Reset layout`,`بازنشانی چیدمان`),hidden:h(`Hidden cards`,`کارت‌های پنهان`)},Me=[{id:`telemetry`,label:s(`liveTelemetry`)},{id:`outputs`,label:s(`outputs`)},{id:`overview`,label:s(`status`)},{id:`actions`,label:s(`quickActions`)},{id:`events`,label:s(`events`)}],Ne=U.order.filter(e=>x?e===`telemetry`?C:e!==`outputs`||S.relays:!1),Pe=e=>{Ce(t=>{let n=e(t);return ee(`dashboard`,nn,n),n})},Fe=()=>{te(`dashboard`),Ce(b(`dashboard`,nn))},Ie=(e,t,n)=>{let r=document.elementFromPoint(t,n)?.closest(`[data-layout-card-id]`)?.dataset.layoutCardId,i=nn.includes(r)?r:void 0;l(Ee.current,e,i)&&(Ee.current=i,Pe(t=>g(t,e,i)))},W=(e,t)=>Pe(n=>{let r=n.order.filter(e=>Ne.includes(e)&&!n.hidden.includes(e)),i=r[r.indexOf(e)+t];return i?g(n,e,i):n}),G=(e,t,n)=>(0,Y.jsx)(y,{id:e,title:t,order:U.order.indexOf(e),collapsed:U.collapsed.includes(e),hidden:U.hidden.includes(e),editing:ve,dragging:we===e,copy:je,onToggleCollapsed:()=>Pe(t=>({...t,collapsed:c(t.collapsed,e)})),onHide:()=>Pe(t=>({...t,hidden:c(t.hidden,e)})),onReorderStart:e=>{Ee.current=null,Te(e)},onReorderMove:Ie,onReorderEnd:()=>{Ee.current=null,Te(null)},onKeyboardReorder:W,children:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:x?fe:ie?h(`Reconnecting`,`اتصال دوباره`):N?h(`Connection unavailable`,`اتصال در دسترس نیست`):n.paused?h(`Board connection paused`,`اتصال برد متوقف شده`):M?h(`Discovering board`,`در حال جستجوی برد`):h(`PCController host online`,`میزبان PCController آنلاین است`),title:s(`dashboard`),detail:j?s(`authenticationDashboardDetail`):x?Zt(n,t,o):se,action:(0,Y.jsxs)(`div`,{className:`header-actions`,children:[(0,Y.jsx)(O,{tone:oe,pulse:ie||n.connection_state===`connecting`,children:ce}),!x&&!j&&!N&&(0,Y.jsx)(V,{icon:ct,compact:!0,busy:F.animated,disabled:F.retryDisabled,onClick:()=>void u(`reconnect`,F.action),children:F.action}),(0,Y.jsx)(V,{icon:a,compact:!0,onClick:()=>void f(),children:s(`refresh`)}),Ne.length>0&&(0,Y.jsx)(_,{copy:je,editing:ve,cards:Me.filter(({id:e})=>Ne.includes(e)),hidden:U.hidden,onToggleEditing:()=>ye(e=>!e),onShow:e=>Pe(t=>({...t,hidden:t.hidden.filter(t=>t!==e)})),onReset:Fe})]})}),(0,Y.jsxs)(`section`,{className:`hero-panel${x?` is-online`:``}`,children:[(0,Y.jsxs)(`div`,{className:`hero-panel__identity`,children:[!N&&(0,Y.jsx)(`div`,{className:`eyebrow`,children:x?`${h(`Controller board`,`برد کنترلر`)} · ${n.connection_state}`:h(`PCController host · online`,`میزبان PCController · آنلاین`)}),N&&!j?(0,Y.jsx)(en,{state:ie?`connecting`:`transport-offline`,locale:o}):!x&&!j&&!k?(0,Y.jsx)(tn,{snapshot:n,locale:o,reconnect:()=>void u(`reconnect`,F.action),hardwareReset:Le(n)?()=>void u(`reset lines`,h(`Hardware reset sent`,`بازنشانی سخت‌افزاری ارسال شد`)):void 0}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`h2`,{children:x?n.hello.name||t:j?s(`authenticationDashboard`):I}),(x||j||se)&&(0,Y.jsx)(`p`,{children:x?`USB ${n.port.vid||`—`}:${n.port.pid||`—`} · ${n.port.name||h(`automatic port`,`درگاه خودکار`)}`:j?s(`authenticationDashboardDetail`):se})]}),j&&(0,Y.jsx)(V,{icon:E,tone:`primary`,onClick:()=>{window.location.hash=`#/settings`},children:h(`Enter access token`,`ورود توکن دسترسی`)})]}),x&&(0,Y.jsxs)(`div`,{className:`hero-panel__readout`,dir:`ltr`,children:[(0,Y.jsx)(`span`,{children:h(`BUILD`,`ساخت`)}),(0,Y.jsx)(`strong`,{children:L}),(0,Y.jsx)(`span`,{children:h(`UPTIME`,`زمان کارکرد`)}),(0,Y.jsx)(`strong`,{children:be(o,v.uptime_ms)})]})]}),k&&A&&(0,Y.jsxs)(`section`,{className:`hardware-alert is-${k.severity}`,role:`alert`,"aria-live":`assertive`,children:[(0,Y.jsx)(`div`,{className:`hardware-alert__icon`,children:(0,Y.jsx)(_e,{size:24,"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{className:`hardware-alert__copy`,children:[(0,Y.jsx)(`strong`,{children:A.title}),(0,Y.jsx)(`p`,{children:A.guidance}),A.impact&&(0,Y.jsx)(`p`,{className:`hardware-alert__impact`,children:A.impact}),(k.os_problem_code||k.location)&&(0,Y.jsx)(`span`,{dir:`ltr`,children:[k.os_problem_code?`Windows code ${k.os_problem_code}`:``,k.location||``].filter(Boolean).join(` · `)})]})]}),x&&w&&(0,Y.jsxs)(`section`,{className:`metric-grid`,children:[S.ina219&&(0,Y.jsx)(ae,{icon:ht,label:Oe(`sensor.supply-voltage`,s(`voltage`)),value:Re(o,v.supply_mv/1e3,2),unit:`V`,values:Qt(r,`supply`),tone:`accent`,scale:`supply`,detail:`${Oe(`sensor.bus-voltage`,h(`Bus voltage`,`ولتاژ باس`))} · ${Re(o,v.bus_mv/1e3,2)} V`}),S.ina219&&(0,Y.jsx)(ae,{icon:m,label:Oe(`sensor.current`,s(`current`)),value:Re(o,v.current_ma,0),unit:`mA`,values:Qt(r,`current`),tone:`green`,scale:`current`,detail:`${Oe(`sensor.power`,h(`Load power`,`توان بار`))} · ${Re(o,v.power_mw/1e3,2)} W`}),S.temperatureLED&&(0,Y.jsx)(ae,{icon:d,label:Oe(`sensor.temperature-led`,`${s(`temperature`)} · LED`),value:Re(o,v.temperature_led_centi_c/100,1),unit:`°C`,values:Qt(r,`ledTemp`),tone:`amber`,scale:`temperature`}),S.temperatureBTAudio&&(0,Y.jsx)(ae,{icon:d,label:Oe(`sensor.temperature-audio`,h(`BT Amplifier temperature`,`دمای آمپلی‌فایر بلوتوث`)),value:Re(o,v.temperature_bt_audio_centi_c/100,1),unit:`°C`,values:Qt(r,`btTemp`),tone:`violet`,scale:`temperature`})]}),x&&T.length>0&&(0,Y.jsx)(`div`,{className:`measurement-alerts`,role:`status`,"aria-live":`polite`,children:T.map(e=>(0,Y.jsxs)(`div`,{className:`measurement-alert`,children:[(0,Y.jsx)(_e,{size:16}),(0,Y.jsx)(`span`,{children:e})]},e))}),(0,Y.jsxs)(`section`,{className:`dashboard-layout-grid`,children:[x&&C&&G(`telemetry`,s(`liveTelemetry`),(0,Y.jsx)(P,{icon:Ge,iconTone:`violet`,title:s(`liveTelemetry`),eyebrow:fe,className:`telemetry-chart-card`,action:(0,Y.jsxs)(O,{tone:`good`,children:[r.length,` `,h(`samples`,`نمونه`)]}),menu:[{label:h(`Refresh telemetry`,`تازه‌سازی تله‌متری`),icon:a,onSelect:()=>{f()}},{label:h(`Open Workbench`,`بازکردن میزکار`),icon:D,onSelect:()=>{window.location.hash=`#/workbench`}}],children:(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsxs)(`div`,{className:`telemetry-chart__empty`,role:`status`,children:[(0,Y.jsx)(re,{size:22}),(0,Y.jsx)(`span`,{children:o===`fa`?`در حال آماده‌سازی نمودار…`:`Preparing chart…`})]}),children:(0,Y.jsx)(Yt,{connected:!0,locale:o,samples:r,reduceMotion:e.reduceMotion})})})),x&&S.relays&&G(`outputs`,s(`outputs`),(0,Y.jsxs)(P,{icon:pt,iconTone:le?`amber`:`green`,title:s(`outputs`),eyebrow:`R1—R8`,className:`outputs-card`,action:(0,Y.jsx)(O,{tone:v.active_relays?`warn`:`neutral`,children:v.active_relays?`${le} ${h(`ACTIVE`,`فعال`)}`:h(`SAFE`,`ایمن`)}),menu:[{label:h(`Read controller status`,`خواندن وضعیت کنترلر`),icon:He,onSelect:()=>{u(`status`)}},{label:h(`Release every output`,`آزادسازی همهٔ خروجی‌ها`),icon:ne,tone:`danger`,onSelect:()=>p({tone:`danger`,title:s(`confirmEmergencyTitle`),body:s(`confirmEmergencyBody`),confirmLabel:s(`emergencyOff`),action:async()=>{await u(`relay off`),await u(`pwm off`)}})}],children:[(0,Y.jsx)(`div`,{className:`output-matrix`,children:Array.from({length:8},(e,t)=>{let r=!!(v.active_relays&1<void u(`relay ${t+1} ${r?`off`:`on`}`,h(`R${t+1} ${r?`off`:`on`}`,`رلهٔ ${t+1} ${r?`خاموش`:`روشن`} شد`)),"aria-pressed":r,children:[(0,Y.jsxs)(`span`,{children:[`R`,t+1,` · `,Oe(`relay.${t+1}`,Ae[t])]}),(0,Y.jsx)(`strong`,{children:s(r?`on`:`off`)}),(0,Y.jsx)(`i`,{"aria-hidden":`true`})]},t)})}),(0,Y.jsxs)(`div`,{className:`safety-strip`,children:[(0,Y.jsx)(E,{size:17}),(0,Y.jsx)(`span`,{children:le?h(`${le} outputs active · confirmation required for emergency release`,`${le} خروجی فعال است · آزادسازی اضطراری به تأیید نیاز دارد`):h(`All physical outputs are released`,`همهٔ خروجی‌های فیزیکی آزاد هستند`)})]})]})),x&&G(`overview`,s(`status`),(0,Y.jsx)(P,{icon:He,iconTone:`green`,title:s(`status`),eyebrow:s(`device`),className:`device-card`,menu:[{label:h(`Read identity`,`خواندن شناسه`),icon:Be,onSelect:()=>{u(`hello`)}},{label:h(`Open controller controls`,`بازکردن کنترل‌های برد`),icon:Ye,onSelect:()=>{window.location.hash=`#/controls`}}],children:(0,Y.jsxs)(`div`,{className:`data-list`,children:[(0,Y.jsx)(B,{label:s(`device`),value:n.port.friendly_name||n.port.name||`—`}),(0,Y.jsx)(B,{label:s(`firmware`),value:n.hello.build_timestamp||L,mono:!0}),(0,Y.jsx)(B,{label:s(`door`),value:v.door_open?s(`open`):s(`closed`),tone:v.door_open?`warn`:`good`}),S.bluetoothAudio&&(0,Y.jsx)(B,{label:s(`bluetooth`),value:v.bluetooth_audio_state===2?s(`online`):v.bluetooth_audio_state===1?s(`connecting`):s(`offline`)}),(0,Y.jsx)(B,{label:h(`UART CRC / framing`,`CRC / قاب‌بندی UART`),value:`${v.crc_errors} / ${v.framing_errors}`,mono:!0,tone:v.crc_errors||v.framing_errors?`warn`:`good`}),(0,Y.jsx)(B,{label:h(`Reset count`,`تعداد بازنشانی`),value:v.reset_count,mono:!0})]})})),x&&G(`actions`,s(`quickActions`),(0,Y.jsx)(P,{icon:ht,iconTone:`amber`,title:s(`quickActions`),eyebrow:h(`Confirmation protected`,`محافظت‌شده با تأیید`),className:`actions-card`,children:(0,Y.jsxs)(`div`,{className:`action-grid`,children:[(0,Y.jsx)(V,{icon:ot,tone:`danger`,onClick:()=>void u(`estop ${n.emergency_stop?.active?`off`:`on`}`),children:n.emergency_stop?.active?h(`Release E-STOP`,`آزادسازی توقف اضطراری`):h(`Engage E-STOP`,`فعال‌سازی توقف اضطراری`)}),(0,Y.jsx)(V,{icon:He,onClick:()=>void u(`status`),children:h(`Read status`,`خواندن وضعیت`)}),S.statusLED&&(0,Y.jsx)(V,{icon:xe,onClick:()=>void u(`rgb effect play attention`),children:h(`Attention cue`,`اعلان توجه`)})]})})),x&&G(`events`,s(`events`),(0,Y.jsx)(P,{icon:re,iconTone:`violet`,title:s(`events`),eyebrow:i.length?`${ke(o,i[0].time)} · ${i[0].kind}`:s(`eventStream`),className:`activity-card`,action:(0,Y.jsx)(`span`,{className:`count-chip`,children:i.length}),menu:[{label:h(`Open full timeline`,`بازکردن خط زمانی کامل`),icon:re,onSelect:()=>{window.location.hash=`#/events`}},{label:h(`Refresh snapshot`,`تازه‌سازی وضعیت`),icon:a,onSelect:()=>{f()}}],children:(0,Y.jsx)(vt,{events:i,locale:o,t:s})}))]})]})}function an(e){let{snapshot:t,locale:n,t:r,command:i,openDialog:o}=e,s=(e,t)=>n===`fa`?t:e,c=e.transport.boardState===`ready`&&t.connected&&t.have_status,l=ge(t),u=!!t.emergency_stop?.active,d=()=>Array.from({length:16},(e,n)=>n===t.status.pwm_channel?t.status.pwm_value:0),[p,ee]=(0,J.useState)(d),[m,g]=(0,J.useState)(d),[_,te]=(0,J.useState)(!1),[y,b]=(0,J.useState)([]),[C,w]=(0,J.useState)(``),[T,E]=(0,J.useState)(!1),[D,k]=(0,J.useState)(null),A=(0,J.useRef)({}),[j,M]=(0,J.useState)(25),[re,ie]=(0,J.useState)(130),[F,ae]=(0,J.useState)(220),[oe,I]=(0,J.useState)(190),[se,ce]=(0,J.useState)(`#000000`),[L,le]=(0,J.useState)(`color`),[R,ue]=(0,J.useState)(1600),[B,de]=(0,J.useState)(8),[me,he]=(0,J.useState)(`loop`),[_e,ve]=(0,J.useState)(`ready`),ye=e.events.find(e=>e.kind===`config`)?.id??0,U=(0,J.useRef)(p),be=(0,J.useRef)(T),Se=(0,J.useRef)(null),Ce=(0,J.useRef)(null),we=`#${[j,re,F].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`.toUpperCase(),Te=t.have_status_led?t.status_led:void 0,Ee=Te?`#${[Te.red,Te.green,Te.blue].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`.toUpperCase():`#000000`,Oe=`${L===`color`?``:` --period ${R} --minimum ${B} --repeat ${me}`}${L===`flash`||L===`cycle`||L===`transition`?` --to "${se}"`:``}`,ke=L===`color`?`rgb color "${we}" ${oe}`:`rgb effect ${L} "${we}" --brightness ${oe}${Oe}`,Ae=L===`color`?`rgb profile set ${_e} color "${we}" ${oe}`:`rgb profile set ${_e} ${L} "${we}" --brightness ${oe}${Oe}`;Se.current||=new Kt,A.current=D?.pwm_channels??{};let je=e=>A.current[`pwm.${e}`],Me=(e,t=null)=>{let n=Gt(e);U.current=n.values,ee(n.values),g(e=>e.map((e,r)=>r===t?n.values[r]:Ce.current?.pendingChannels().includes(r)?e:n.values[r])),w(``),te(!0)};Ce.current||=new $({operations:Se.current,commit:(e,t)=>z(`controller.pwm.set`,{channel:e,percent:Vt(t,je(e))}),onDraft:(e,t)=>{w(``),g(n=>n.map((n,r)=>r===e?t:n))},onAuthoritative:Me,onPending:e=>b([...e]),onError:(e,t)=>{w(t.message),g(t=>t.map((t,n)=>n===e?U.current[e]:t))}}),(0,J.useEffect)(()=>()=>Ce.current?.dispose(),[]),(0,J.useEffect)(()=>{if(!c){k(null);return}let e=!0;return z(`controller.ui.config.get`).then(t=>{e&&k(t)}).catch(()=>{e&&k(null)}),()=>{e=!1}},[c,ye]),(0,J.useEffect)(()=>{if(!c||!l.pwm){te(!1);return}w(``);let e=new qt({operations:Se.current,canRead:()=>!be.current&&(Ce.current?.pendingChannels().length??0)===0,read:e=>z(`controller.pwm.values`,{},e),onAuthoritative:e=>Me(e),onError:e=>w(e.message)});return e.start(),()=>e.stop()},[l.pwm,c]),(0,J.useEffect)(()=>{if(!c||!l.pwm||t.status.pwm_channel<0||t.status.pwm_channel>15)return;let e=t.status.pwm_channel,n=t.status.pwm_value;U.current=U.current.map((t,r)=>r===e?n:t),ee(U.current),Ce.current?.pendingChannels().includes(e)||g(t=>t.map((t,r)=>r===e?n:t))},[l.pwm,c,t.status.pwm_channel,t.status.pwm_value]);let Ne=[`MOSFET 1`,`MOSFET 2`,`MOSFET 3`,`MOSFET 4`,`MOSFET 5`,`MOSFET 6`,`MOSFET 7`,`MOSFET 8`,s(`User PWM 9`,`PWM کاربر ۹`),s(`User PWM 10`,`PWM کاربر ۱۰`),s(`User PWM 11`,`PWM کاربر ۱۱`),s(`Enclosure light`,`نور محفظه`),s(`Power indicator`,`نشانگر توان`),s(`Status red`,`وضعیت قرمز`),s(`Status green`,`وضعیت سبز`),s(`Status blue`,`وضعیت آبی`)],Pe=[s(`Side A direction`,`جهت سمت A`),s(`Side A output`,`خروجی سمت A`),s(`Side B direction`,`جهت سمت B`),s(`Side B output`,`خروجی سمت B`),s(`User relay 5`,`رلهٔ کاربر ۵`),s(`User relay 6`,`رلهٔ کاربر ۶`),s(`User relay 7`,`رلهٔ کاربر ۷`),s(`User relay 8`,`رلهٔ کاربر ۸`)],Fe=(e,t)=>Jt(D?.controls,e,D?.peripheral_names?.[e]?.trim()||t),Ie=e=>Fe(`pwm.${e}`,Ne[e]),W=(e,t,n=!1)=>{Ce.current?.schedule(e,Ht(t,je(e)),n)},G=async(e,t)=>{let n=je(e);if(n){w(``);try{await z(`controller.pwm.channel.configure`,{channel:e,...n,...t});let r=await z(`controller.ui.config.get`);k(r),Me(await Se.current.run(()=>z(`controller.pwm.values`)))}catch(e){w(e instanceof Error?e.message:String(e))}}},Re=async()=>{if(!y.length){be.current=!0,E(!0),w(``);try{Me(await Se.current.run(()=>z(`controller.pwm.off`)))}catch(e){w(e instanceof Error?e.message:String(e))}finally{be.current=!1,E(!1)}}};if(!c){let a=e.transport.streamState===`connecting`,o=e.transport.streamState!==`open`,c=a?`connecting`:o?`transport-offline`:`board-offline`,l=De(t,n),u=a?s(`Connecting…`,`در حال اتصال…`):o?s(`Reconnecting…`,`در حال اتصال دوباره…`):l.title;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:s(`Controller board controls`,`کنترل‌های برد`),title:r(`controls`),detail:o?void 0:t.connection_reason}),(0,Y.jsx)(P,{icon:o?f:S,iconTone:`amber`,title:u,eyebrow:a?s(`Reconnecting`,`اتصال دوباره`):s(`Connection`,`اتصال`),children:o?(0,Y.jsx)(en,{state:c,locale:n,showTitle:!1}):(0,Y.jsx)(tn,{snapshot:t,locale:n,reconnect:()=>void i(`reconnect`,l.action),hardwareReset:Le(t)?()=>void i(`reset lines`,s(`Hardware reset sent`,`بازنشانی سخت‌افزاری ارسال شد`)):void 0})})]})}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:s(`Connected controller`,`کنترلر متصل`),title:r(`controls`),detail:Zt(t,e.appTitle,n)}),(0,Y.jsxs)(`div`,{className:`safety-strip controller-estop${u?` is-danger`:``}`,role:`status`,"aria-live":`assertive`,children:[(0,Y.jsx)(ot,{size:17}),(0,Y.jsx)(`span`,{children:u?s(`E-STOP locked · effects, motion, relay-on, and PWM output are blocked`,`توقف اضطراری قفل است · افکت‌ها، حرکت، روشن‌کردن رله و خروجی PWM مسدود هستند`):s(`E-STOP ready`,`توقف اضطراری آماده است`)}),(0,Y.jsx)(V,{compact:!0,tone:`danger`,onClick:()=>void i(`estop ${u?`off`:`on`}`),children:u?s(`Release`,`آزادسازی`):s(`Engage`,`فعال‌سازی`)})]}),(0,Y.jsxs)(`section`,{className:`control-layout`,children:[l.relays&&(0,Y.jsxs)(P,{icon:Ye,iconTone:t.status.active_relays?`amber`:`green`,eyebrow:s(`Eight protected outputs`,`هشت خروجی محافظت‌شده`),title:s(`Relays & motion`,`رله‌ها و حرکت`),className:`relay-control-card`,action:(0,Y.jsx)(O,{tone:t.status.active_relays?`warn`:`good`,children:t.status.active_relays?s(`ENERGIZED`,`برقدار`):s(`RELEASED`,`آزاد`)}),menu:[{label:s(`Refresh output state`,`تازه‌سازی وضعیت خروجی‌ها`),icon:a,onSelect:()=>{i(`status`)}},{label:s(`Release every relay`,`آزادسازی همهٔ رله‌ها`),icon:ne,tone:`danger`,onSelect:()=>o({tone:`danger`,title:r(`confirmEmergencyTitle`),body:r(`confirmEmergencyBody`),confirmLabel:r(`emergencyOff`),action:async()=>{await i(`relay off`)}})}],children:[(0,Y.jsx)(`div`,{className:`relay-bank`,children:Array.from({length:8},(e,n)=>{let a=!!(t.status.active_relays&1<void i(`relay ${n+1} ${a?`off`:`on`}`)}),(0,Y.jsx)(`small`,{children:Fe(`relay.${n+1}`,Pe[n])}),(0,Y.jsxs)(`div`,{className:`relay-switch__actions`,children:[(0,Y.jsx)(V,{compact:!0,disabled:a||u,onClick:()=>void i(`relay ${n+1} on`),children:r(`on`)}),(0,Y.jsx)(V,{compact:!0,disabled:!a,onClick:()=>void i(`relay ${n+1} off`),children:r(`off`)})]})]},n)})}),(0,Y.jsx)(`div`,{className:`motion-actions`,children:[`left`,`right`].map(e=>{let n=t.motion?.[e],r=zt(n),a=r===`up`?s(`UP`,`بالا`):r===`down`?s(`DOWN`,`پایین`):r===`stop`?s(`STOPPED`,`متوقف`):s(`UNKNOWN`,`نامشخص`);return(0,Y.jsxs)(`div`,{className:`motion-side`,children:[(0,Y.jsxs)(`div`,{className:`motion-side__identity`,children:[(0,Y.jsx)(`strong`,{children:e===`left`?Fe(`motion.a`,s(`Side A motion`,`حرکت سمت A`)):Fe(`motion.b`,s(`Side B motion`,`حرکت سمت B`))}),(0,Y.jsx)(O,{tone:r===`unknown`?`neutral`:r===`stop`?`good`:n?.transitioning?`warn`:`info`,pulse:n?.transitioning,children:n?.transitioning?`${a} · ${s(`SYNCING`,`همگام‌سازی`)}`:a})]}),(0,Y.jsx)(N,{compact:!0,disabled:u,onHoldStart:()=>i(`relay side ${e} up`),onHoldStop:()=>i(`relay side ${e} stop`),children:s(`Hold Up`,`بالا نگه‌دار`)}),(0,Y.jsx)(V,{compact:!0,onClick:()=>void i(`relay side ${e} stop`),children:s(`Stop`,`توقف`)}),(0,Y.jsx)(N,{compact:!0,disabled:u,onHoldStart:()=>i(`relay side ${e} down`),onHoldStop:()=>i(`relay side ${e} stop`),children:s(`Hold Down`,`پایین نگه‌دار`)})]},e)})}),(0,Y.jsx)(V,{icon:ot,tone:`danger`,onClick:()=>o({tone:`danger`,title:r(`confirmEmergencyTitle`),body:r(`confirmEmergencyBody`),confirmLabel:r(`emergencyOff`),action:async()=>{await i(`relay off`)}}),children:r(`emergencyOff`)})]}),l.pwm&&(0,Y.jsxs)(P,{icon:h,iconTone:`violet`,eyebrow:s(`11 user channels · acknowledged writes`,`۱۱ کانال کاربر · نوشتن با تأیید`),title:s(`PWM mixer`,`میکسر PWM`),className:`pwm-card`,action:(0,Y.jsx)(O,{tone:C?`bad`:y.length?`warn`:_?`good`:`neutral`,children:C?s(`ERROR`,`خطا`):y.length?s(`SYNCING`,`همگام‌سازی`):_?s(`CONFIRMED`,`تأییدشده`):s(`READING`,`در حال خواندن`)}),children:[(0,Y.jsx)(`div`,{className:`pwm-mixer`,children:Bt.map(e=>{let n=p[e],i=m[e],a=y.includes(e),o=Ie(e),c=je(e);return(0,Y.jsxs)(`div`,{className:`pwm-mixer__row${t.status.pwm_channel===e&&!a?` is-live`:``}${a?` is-pending`:``}`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`strong`,{children:[c?.icon===`lightbulb`?`💡 `:c?.output_type===`motor`?`⚙️ `:``,o]}),(0,Y.jsx)(`small`,{children:a?s(`Board ${n} · draft ${i}`,`برد ${n} · پیش‌نویس ${i}`):s(`${Vt(n,c)}% brightness · raw ${n}`,`${Vt(n,c)}٪ روشنایی · خام ${n}`)}),(0,Y.jsxs)(`div`,{className:`pwm-channel-config`,children:[(0,Y.jsxs)(`select`,{"aria-label":s(`${o} output type`,`نوع خروجی ${o}`),value:c?.output_type??`general`,onChange:t=>void G(e,{output_type:t.target.value,icon:t.target.value===`lighting`?`lightbulb`:t.target.value===`indicator`?`led`:t.target.value===`motor`?`settings`:`sliders-horizontal`}),children:[(0,Y.jsx)(`option`,{value:`lighting`,children:s(`Lighting`,`روشنایی`)}),(0,Y.jsx)(`option`,{value:`indicator`,children:s(`LED indicator`,`نشانگر LED`)}),(0,Y.jsx)(`option`,{value:`motor`,children:s(`Motor`,`موتور`)}),(0,Y.jsx)(`option`,{value:`general`,children:s(`General PWM`,`PWM عمومی`)})]}),(0,Y.jsxs)(`select`,{"aria-label":s(`${o} response curve`,`منحنی پاسخ ${o}`),value:c?.curve??`linear`,onChange:t=>void G(e,{curve:t.target.value,gamma:t.target.value===`linear`?1:c?.gamma===1?2.2:c?.gamma??2.2}),children:[(0,Y.jsx)(`option`,{value:`gamma`,children:s(`Perceptual`,`ادراکی`)}),(0,Y.jsx)(`option`,{value:`linear`,children:s(`Linear`,`خطی`)})]})]})]}),(0,Y.jsx)(H,{label:s(`${o} brightness`,`روشنایی ${o}`),value:Vt(i,c),min:0,max:100,step:.1,unit:`%`,disabled:!_||T||u,onChange:t=>W(e,t)}),(0,Y.jsxs)(`div`,{className:`pwm-mixer__actions`,children:[(0,Y.jsx)(V,{compact:!0,disabled:!_||T||i===0,onClick:()=>W(e,0,!0),children:r(`off`)}),(0,Y.jsx)(V,{compact:!0,disabled:!_||T||i===4095||u,onClick:()=>W(e,100,!0),children:s(`FULL`,`کامل`)})]}),c?.curve===`gamma`&&(0,Y.jsx)(H,{label:s(`Curve strength`,`شدت منحنی`),value:c.gamma,min:.1,max:5,step:.1,disabled:T,onChange:t=>void G(e,{gamma:t})})]},e)})}),(0,Y.jsx)(`div`,{className:`system-output-summary`,"aria-label":s(`Role-specific system PWM channels`,`کانال‌های PWM سیستمی با کنترل اختصاصی`),children:[11,12,13,14,15].map(e=>(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`strong`,{children:Ie(e)}),(0,Y.jsxs)(`small`,{children:[p[e],` / 4095`]})]},e))}),(0,Y.jsx)(`div`,{className:`pwm-authority-status${C?` is-error`:``}`,role:`status`,"aria-live":`polite`,children:C||(y.length?s(`${y.length} channel${y.length===1?``:`s`} waiting for controller acknowledgement.`,`${y.length} کانال در انتظار تأیید کنترلر است.`):_?s(`Every displayed board value is authoritative; sliders are separate local drafts until acknowledged.`,`همهٔ مقادیر برد معتبرند؛ لغزنده‌ها تا زمان تأیید، پیش‌نویس محلی جداگانه‌اند.`):s(`Reading the complete 16-channel state from the controller…`,`در حال خواندن وضعیت کامل ۱۶ کانال از کنترلر…`))}),(0,Y.jsx)(V,{icon:ut,busy:T,disabled:!_||T||y.length>0,onClick:()=>void Re(),children:s(`Clear all PWM channels`,`پاک‌کردن همهٔ کانال‌های PWM`)})]}),l.statusLED&&(0,Y.jsxs)(P,{icon:xe,iconTone:`amber`,eyebrow:s(`Color and effects`,`رنگ و افکت‌ها`),title:s(`Status lighting`,`نور وضعیت`),className:`rgb-card`,children:[(0,Y.jsxs)(`div`,{className:`status-led-previews`,children:[(0,Y.jsxs)(`div`,{className:`color-preview`,style:{"--preview":we},children:[(0,Y.jsx)(`span`,{}),(0,Y.jsxs)(`strong`,{children:[s(`Selected`,`انتخاب‌شده`),` · `,we,` · RGB `,j,` `,re,` `,F]})]}),(0,Y.jsxs)(`div`,{className:`status-led-live`,style:{"--preview":Ee},children:[(0,Y.jsx)(`i`,{"aria-hidden":`true`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:s(`Physical LED mirror`,`بازتاب LED فیزیکی`)}),(0,Y.jsx)(`small`,{dir:`ltr`,children:Te?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`mono`,children:Ee}),` · effect ${Te.effect} · condition ${Te.condition}`]}):s(`Awaiting pushed board state`,`در انتظار وضعیت ارسالی برد`)})]})]})]}),(0,Y.jsxs)(`label`,{className:`native-color-field`,children:[(0,Y.jsx)(`span`,{children:s(`Color picker`,`انتخاب‌گر رنگ`)}),(0,Y.jsx)(`input`,{type:`color`,value:we,"aria-label":s(`Status LED color`,`رنگ LED وضعیت`),onChange:e=>{let t=e.target.value;M(Number.parseInt(t.slice(1,3),16)),ie(Number.parseInt(t.slice(3,5),16)),ae(Number.parseInt(t.slice(5,7),16))}}),(0,Y.jsx)(`code`,{children:we})]}),_&&(0,Y.jsxs)(`div`,{className:`rgb-board-state`,children:[(0,Y.jsx)(`span`,{children:s(`Board-reported PWM`,`PWM گزارش‌شدهٔ برد`)}),(0,Y.jsxs)(`strong`,{dir:`ltr`,children:[p[13],` · `,p[14],` · `,p[15]]})]}),(0,Y.jsx)(H,{label:s(`Red`,`قرمز`),value:j,min:0,max:255,onChange:M}),(0,Y.jsx)(H,{label:s(`Green`,`سبز`),value:re,min:0,max:255,onChange:ie}),(0,Y.jsx)(H,{label:s(`Blue`,`آبی`),value:F,min:0,max:255,onChange:ae}),(0,Y.jsx)(H,{label:s(`Brightness`,`روشنایی`),value:oe,min:0,max:255,onChange:e=>{I(e),de(t=>Math.min(t,e))}}),(0,Y.jsxs)(`div`,{className:`rgb-effect-fields`,children:[(0,Y.jsxs)(`label`,{children:[(0,Y.jsx)(`span`,{children:s(`Presentation`,`نحوه نمایش`)}),(0,Y.jsxs)(`select`,{value:L,onChange:e=>le(e.target.value),children:[(0,Y.jsx)(`option`,{value:`color`,children:s(`Steady color`,`رنگ ثابت`)}),(0,Y.jsx)(`option`,{value:`breathe`,children:s(`Breathe`,`تنفس`)}),(0,Y.jsx)(`option`,{value:`flash`,children:s(`Flash`,`چشمک`)}),(0,Y.jsx)(`option`,{value:`cycle`,children:s(`Two-color cycle`,`چرخه دو رنگ`)}),(0,Y.jsx)(`option`,{value:`transition`,children:s(`Transition`,`گذار`)})]})]}),L!==`color`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`label`,{children:[(0,Y.jsx)(`span`,{children:s(`Period`,`دوره`)}),(0,Y.jsx)(`input`,{type:`number`,min:640,max:6e4,value:R,onChange:e=>ue(Math.max(640,Math.min(6e4,Number(e.target.value))))}),(0,Y.jsx)(`small`,{children:`ms`})]}),(0,Y.jsxs)(`label`,{children:[(0,Y.jsx)(`span`,{children:s(`Repeat`,`تکرار`)}),(0,Y.jsxs)(`select`,{value:me,onChange:e=>he(e.target.value),children:[(0,Y.jsx)(`option`,{value:`once`,children:s(`Once`,`یک‌بار`)}),(0,Y.jsx)(`option`,{value:`loop`,children:s(`Loop`,`پیوسته`)})]})]})]}),L===`breathe`&&(0,Y.jsxs)(`label`,{children:[(0,Y.jsx)(`span`,{children:s(`Minimum brightness`,`حداقل روشنایی`)}),(0,Y.jsx)(`input`,{type:`number`,min:0,max:oe,value:B,onChange:e=>de(Math.max(0,Math.min(oe,Number(e.target.value))))})]}),(L===`flash`||L===`cycle`||L===`transition`)&&(0,Y.jsxs)(`label`,{className:`native-color-field native-color-field--compact`,children:[(0,Y.jsx)(`span`,{children:s(`Second color`,`رنگ دوم`)}),(0,Y.jsx)(`input`,{type:`color`,value:se,onChange:e=>ce(e.target.value.toUpperCase())}),(0,Y.jsx)(`code`,{children:se})]})]}),(0,Y.jsxs)(`div`,{className:`inline-actions`,children:[(0,Y.jsx)(V,{tone:`primary`,icon:v,disabled:!t.connected,onClick:()=>void i(ke),children:s(`Apply live`,`اعمال زنده`)}),(0,Y.jsx)(V,{disabled:!t.connected,onClick:()=>void i(`rgb effect stop`),children:s(`Stop effect`,`توقف افکت`)})]}),(0,Y.jsxs)(`div`,{className:`rgb-profile-row`,children:[(0,Y.jsxs)(`label`,{children:[(0,Y.jsx)(`span`,{children:s(`EEPROM condition`,`شرط EEPROM`)}),(0,Y.jsx)(`select`,{value:_e,onChange:e=>ve(e.target.value),children:[`off`,`boot`,`ready`,`learning`,`hot`,`fault`,`custom`,`bluetooth-connected`,`bluetooth-off`,`bluetooth-waiting`,`running`,`door-open`,`door-closed`,`bluetooth`,`menu`,`radio`,`save`,`discard`,`reset`].map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))})]}),(0,Y.jsx)(V,{icon:x,disabled:!t.connected,onClick:()=>void i(Ae),children:s(`Save profile (live when active)`,`ذخیره پروفایل (هنگام فعال‌شدن زنده)`)})]})]})]})]})}var on=[`capabilities`,`snapshot`];function sn(e){return e.http_reachable===!0}function cn(e){return e.configured===!0&&!sn(e)}function ln({locale:e,t}){let r=(t,n)=>e===`fa`?n:t,[i,o]=(0,J.useState)({power:`unknown`,phase:`idle`}),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(null),[p,ee]=(0,J.useState)(`capabilities`),[m,h]=(0,J.useState)(``),g=async()=>{try{o(await z(`controller.device.status`)),h(``)}catch(e){h(e instanceof Error?e.message:String(e))}};(0,J.useEffect)(()=>{g();let e=window.setInterval(()=>void g(),3e3);return()=>window.clearInterval(e)},[]);let _=async(t,n=``,r=0)=>{if(t!==`passive.refresh`&&!sn(i))h(e===`fa`?`ارتباط HTTP وسیله در دسترس نیست.`:`The device HTTP command transport is unavailable.`);else{c(t);try{o(await z(`controller.device.action`,{action:t,text:n,count:r})),h(``),t===`display.message`&&u(``)}catch(e){h(e instanceof Error?e.message:String(e))}finally{c(``)}}},v=async()=>{if(!sn(i))h(e===`fa`?`برای بازرسی، ارتباط HTTP لازم است.`:`Inspection requires the device HTTP transport.`);else{c(`inspect`);try{f(await z(`controller.device.inspect`,{resource:p})),h(``)}catch(e){h(e instanceof Error?e.message:String(e))}finally{c(``)}}},te=i.power?.toUpperCase(),y=te===`ON`,b=sn(i),x=cn(i),S=i.configured===!1?e===`fa`?`یکپارچه‌سازی وسیله غیرفعال است`:`Local device integration is disabled`:i.events_online?e===`fa`?`مسیر فرمان HTTP در دسترس نیست`:`HTTP command transport is unavailable`:i.configured?e===`fa`?`وسیلهٔ محلی در دسترس نیست`:`Local companion is unreachable`:m?e===`fa`?`وضعیت وسیله دریافت نشد`:`Companion status is unavailable`:e===`fa`?`در حال بررسی وسیلهٔ محلی`:`Checking local companion availability`,C=i.last_error||m||(i.configured===!1?e===`fa`?`نشانی و فعال‌سازی را در تنظیمات خدمات محلی بررسی کنید.`:`Choose a private-network endpoint and enable it in local-service settings.`:e===`fa`?`وضعیت فعلی: ${i.phase||`نامشخص`}`:`Current phase: ${i.phase||`unknown`}`),w=[{label:e===`fa`?`تازه‌سازی وضعیت`:`Refresh device status`,icon:a,onSelect:()=>{g()}},...x?[{label:e===`fa`?`تلاش دوباره برای اتصال`:`Retry companion connection`,icon:ct,onSelect:()=>{_(`passive.refresh`)}}]:[],...b?[{label:y?e===`fa`?`خاموش‌کردن وسیله`:`Turn device off`:e===`fa`?`روشن‌کردن وسیله`:`Turn device on`,icon:qe,onSelect:()=>{_(y?`power.off`:`power.on`)}}]:[]];return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:`${r(`Local companion`,`وسیلهٔ محلی`)} · ${i.phase||`idle`}`,title:i.name||t(`device`),detail:i.base_url||r(`Typed local-network companion through the primary host`,`وسیلهٔ شبکهٔ محلی با قرارداد مشخص، از طریق میزبان اصلی`),action:(0,Y.jsx)(O,{tone:i.events_online?`good`:i.http_reachable?`warn`:`bad`,pulse:i.phase===`connecting`,children:i.events_online?r(`EVENT STREAM`,`جریان رویداد`):i.http_reachable?`HTTP`:t(`offline`)})}),(0,Y.jsxs)(`section`,{className:`device-layout`,children:[(0,Y.jsxs)(P,{icon:Be,iconTone:y?`green`:`amber`,title:r(`Local device`,`وسیلهٔ محلی`),eyebrow:i.events_online?r(`Events connected`,`رویدادها متصل‌اند`):i.http_reachable?r(`HTTP reachable`,`HTTP در دسترس`):r(`Unavailable`,`دردسترس نیست`),className:`device-stage${y?` is-on`:``}`,menu:w,children:[(0,Y.jsxs)(`div`,{className:`device-overview`,"aria-label":r(`Device power ${i.power??`unknown`}`,`توان وسیله ${i.power??`نامشخص`}`),children:[(0,Y.jsxs)(`div`,{className:`device-overview__mark`,children:[(0,Y.jsx)(Be,{size:38}),(0,Y.jsx)(`span`,{"aria-hidden":`true`})]}),(0,Y.jsxs)(`div`,{className:`device-overview__copy`,children:[(0,Y.jsx)(`span`,{children:i.base_url||r(`Host-mediated local connection`,`اتصال محلی با میانجی‌گری میزبان`)}),(0,Y.jsx)(`strong`,{children:y?r(`Device is powered on`,`وسیله روشن است`):te===`OFF`?r(`Device is powered off`,`وسیله خاموش است`):r(`Power state is unknown`,`وضعیت توان نامشخص است`)}),(0,Y.jsx)(`small`,{children:i.last_event||i.last_error||(i.phase?`${r(`Phase`,`مرحله`)}: ${i.phase}`:r(`No device event received`,`رویدادی از وسیله دریافت نشده است`))})]})]}),(0,Y.jsxs)(`div`,{className:`device-facts`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:t(`status`)}),(0,Y.jsx)(`strong`,{children:i.power??t(`unknown`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:r(`Transport`,`رسانهٔ ارتباطی`)}),(0,Y.jsx)(`strong`,{children:i.events_online?r(`Events`,`رویدادها`):i.http_reachable?`HTTP`:t(`offline`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:r(`Updated`,`آخرین تغییر`)}),(0,Y.jsx)(`strong`,{children:i.updated_at?ke(e,i.updated_at):`—`})]})]}),b?(0,Y.jsxs)(`div`,{className:`device-actions`,children:[(0,Y.jsx)(V,{tone:`success`,icon:Oe,busy:s===`power.on`,onClick:()=>void _(`power.on`),children:t(`on`)}),(0,Y.jsx)(V,{tone:`secondary`,icon:Me,busy:s===`power.off`,onClick:()=>void _(`power.off`),children:t(`off`)}),(0,Y.jsx)(V,{tone:`primary`,icon:qe,busy:s===`power.toggle`,onClick:()=>void _(`power.toggle`),children:t(`toggle`)})]}):(0,Y.jsx)(de,{icon:i.configured===!1?G:ne,title:S,detail:C,action:(0,Y.jsxs)(`div`,{className:`device-unavailable__actions`,children:[x&&(0,Y.jsx)(V,{compact:!0,tone:`primary`,icon:ct,busy:s===`passive.refresh`,onClick:()=>void _(`passive.refresh`),children:e===`fa`?`تلاش دوباره`:`Retry connection`}),(0,Y.jsx)(V,{compact:!0,icon:a,busy:s===`status`,onClick:()=>void g(),children:e===`fa`?`تازه‌سازی وضعیت`:`Refresh status`}),i.configured!==!0&&(0,Y.jsx)(V,{compact:!0,icon:G,onClick:()=>{window.location.hash=`#/settings`},children:e===`fa`?`تنظیم یکپارچه‌سازی`:`Open integration settings`})]})}),(0,Y.jsx)(Pe,{initial:!1,children:m&&(0,Y.jsx)(Ae.div,{className:`inline-error-presence`,initial:{height:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(4px)`},animate:{height:`auto`,opacity:1,clipPath:`inset(0 0 0% 0)`,filter:`blur(0px)`},exit:{height:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(3px)`},transition:{duration:.28,ease:[.22,1,.36,1]},children:(0,Y.jsxs)(`div`,{className:`inline-error`,role:`alert`,children:[(0,Y.jsx)(ot,{size:17}),(0,Y.jsx)(`span`,{children:m})]})},`local-device-error`)})]}),(0,Y.jsxs)(`div`,{className:`device-side`,children:[b&&(0,Y.jsxs)(P,{icon:nt,iconTone:`violet`,title:t(`message`),eyebrow:l.length?r(`${l.length} characters`,`${l.length} نویسه`):r(`No message entered`,`پیامی وارد نشده`),action:(0,Y.jsx)(O,{tone:`info`,children:r(`LOCAL DEVICE`,`وسیلهٔ محلی`)}),children:[(0,Y.jsxs)(`div`,{className:`message-compose`,children:[(0,Y.jsx)(`input`,{value:l,maxLength:256,placeholder:r(`A bounded display message`,`پیام کوتاه برای نمایش`),onChange:e=>u(e.target.value)}),(0,Y.jsx)(V,{icon:T,tone:`primary`,busy:s===`display.message`,disabled:!l.trim(),onClick:()=>void _(`display.message`,l.trim()),children:t(`send`)})]}),(0,Y.jsxs)(`div`,{className:`beep-row`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(je,{size:18}),(0,Y.jsxs)(`span`,{children:[t(`beep`),` · `,r(`explicit alert pulse`,`پالس هشدار صریح`)]})]}),[1,2,3].map(e=>(0,Y.jsxs)(V,{compact:!0,busy:s===`alert.pulse`,onClick:()=>void _(`alert.pulse`,``,e),children:[e,`×`]},e))]})]}),b&&(0,Y.jsxs)(P,{icon:n,iconTone:`accent`,title:t(`diagnostics`),eyebrow:d?r(`Inspection loaded`,`بازرسی بارگیری شد`):r(`Not inspected`,`بازرسی نشده`),action:(0,Y.jsx)(V,{icon:a,compact:!0,busy:s===`inspect`,onClick:()=>void v(),children:t(`fetch`)}),children:[(0,Y.jsx)(`div`,{className:`diagnostic-picker`,children:on.map(e=>(0,Y.jsx)(`button`,{className:p===e?`is-active`:``,onClick:()=>ee(e),dir:`ltr`,children:e},e))}),d!==null&&(0,Y.jsx)(`pre`,{className:`diagnostic-output`,dir:`ltr`,children:JSON.stringify(d,null,2)})]}),(0,Y.jsx)(P,{icon:et,iconTone:i.events_online?`green`:`amber`,title:r(`Connection health`,`سلامت اتصال`),eyebrow:i.events_online?r(`Event stream connected`,`جریان رویداد متصل است`):i.http_reachable?r(`HTTP reachable`,`HTTP در دسترس`):r(`Unavailable`,`دردسترس نیست`),action:(0,Y.jsx)(V,{icon:a,compact:!0,onClick:()=>void g(),children:e===`fa`?`تازه‌سازی`:`Refresh`}),children:(0,Y.jsxs)(`div`,{className:`data-list`,children:[(0,Y.jsx)(B,{label:r(`Phase`,`مرحله`),value:i.phase||`idle`}),(0,Y.jsx)(B,{label:`HTTP`,value:i.http_reachable?t(`online`):t(`offline`),tone:i.http_reachable?`good`:`bad`}),(0,Y.jsx)(B,{label:r(`Event stream`,`جریان رویداد`),value:i.events_online?t(`online`):t(`offline`),tone:i.events_online?`good`:`warn`}),(0,Y.jsx)(B,{label:r(`Last event`,`آخرین رویداد`),value:i.last_event||`—`}),(0,Y.jsx)(B,{label:r(`Identity`,`هویت`),value:[i.name,i.model,i.firmware].filter(Boolean).join(` · `)||`—`}),(0,Y.jsx)(B,{label:r(`Device ID`,`شناسهٔ وسیله`),value:i.device_id||`—`,mono:!0})]})})]})]})]})}function un({events:e,locale:t,t:n}){let r=(e,n)=>t===`fa`?n:e,[i,a]=(0,J.useState)(`all`),o=e.filter(e=>i===`all`||$t(e)===i);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:r(`Unified history`,`تاریخچهٔ یکپارچه`),title:n(`events`),detail:r(`One timeline for controller lifecycle, RF, doors, macros, automations and integrated services.`,`یک خط زمانی برای چرخهٔ کنترلر، RF، درها، ماکروها، خودکارسازی‌ها و سرویس‌های یکپارچه.`),action:(0,Y.jsxs)(O,{tone:`info`,children:[e.length,` `,r(`retained`,`نگه‌داری‌شده`)]})}),(0,Y.jsxs)(P,{icon:re,iconTone:`violet`,className:`events-page-card`,title:r(`Event timeline`,`خط زمانی رویدادها`),eyebrow:r(`${o.length} visible`,`${o.length} مورد نمایان`),children:[(0,Y.jsx)(`div`,{className:`event-toolbar`,children:(0,Y.jsx)(R,{value:i,label:r(`Event severity`,`شدت رویداد`),options:[{value:`all`,label:r(`All`,`همه`)},{value:`good`,label:r(`Good`,`عادی`)},{value:`warn`,label:r(`Warn`,`هشدار`)},{value:`bad`,label:r(`Fault`,`خطا`)},{value:`info`,label:r(`Info`,`اطلاعات`)}],onChange:a})}),(0,Y.jsx)(vt,{events:o,locale:t,t:n,limit:o.length,toolbar:!0})]})]})}function dn({appTitle:e,snapshot:t,locale:r,t:i,command:a,appearance:s,onAppearance:c,token:l,onToken:u,onAppTitle:d,boardSettingsReadState:f,uiConfig:p,onMeasurementTiming:ee,onBuzzerPath:m,transport:g,navigationSync:_,navigationSyncStatus:v={state:`idle`,detail:``},onNavigationSync:te,appInstances:y=[]}){let b=(e,t)=>r===`fa`?t:e,S=ge(t),C=e=>r===`fa`?{"Application title is required.":`عنوان برنامه الزامی است.`,"Application title must be 64 characters or fewer.":`عنوان برنامه باید حداکثر ۶۴ نویسه باشد.`,"Application title must include a letter or number.":`عنوان برنامه باید دست‌کم یک حرف یا عدد داشته باشد.`,"A root URL is required while this integration is enabled.":`وقتی یکپارچه‌سازی فعال است، نشانی ریشه الزامی است.`,"Enter a valid HTTP or HTTPS root URL.":`یک نشانی ریشهٔ معتبر HTTP یا HTTPS وارد کنید.`,"Only HTTP and HTTPS are supported.":`فقط HTTP و HTTPS پشتیبانی می‌شوند.`,"Credentials are not allowed in the URL.":`اطلاعات دسترسی نباید داخل نشانی باشد.`,"Query strings and fragments are not allowed.":`پارامتر پرس‌وجو و قطعه در نشانی مجاز نیست.`,"Use the service root without a path.":`ریشهٔ سرویس را بدون مسیر وارد کنید.`,"Use a private, loopback, link-local, or local-DNS host.":`از میزبان خصوصی، loopback، link-local یا DNS محلی استفاده کنید.`,"The data service must use localhost or a loopback address.":`سرویس داده باید از localhost یا نشانی loopback استفاده کند.`,"Use no more than 14 page keys or IDs.":`حداکثر ۱۴ کلید یا شناسهٔ صفحه وارد کنید.`,"Page keys or IDs must use printable ASCII characters.":`کلیدها یا شناسه‌های صفحه باید فقط از نویسه‌های قابل چاپ ASCII باشند.`,"Page keys or IDs must be unique.":`کلیدها یا شناسه‌های صفحه باید یکتا باشند.`,"Text must use printable ASCII characters.":`متن باید فقط از نویسه‌های قابل چاپ ASCII باشد.`,"Text must contain at least 5 printable ASCII bytes.":`متن باید دست‌کم ۵ بایت ASCII قابل چاپ داشته باشد.`,"Text and repeat gap must fit within 40 bytes.":`متن همراه با فاصلهٔ تکرار باید در ۴۰ بایت جا شود.`}[e]??e:e,[T,D]=(0,J.useState)(l),[M,N]=(0,J.useState)(e),[ae,se]=(0,J.useState)(!1),[ue,fe]=(0,J.useState)(``),[me,_e]=(0,J.useState)(!1),[be,Se]=(0,J.useState)(``),[Ce,Te]=(0,J.useState)(t.settings.display_brightness),[Ee,De]=(0,J.useState)(t.settings.display_closed_brightness),[ke,Ae]=(0,J.useState)(t.settings.motion_exit_hold_seconds||2),[Ne,Pe]=(0,J.useState)(t.settings.status_brightness),[Ie,Le]=(0,J.useState)(t.settings.stream_period_ms||200),[G,ze]=(0,J.useState)(t.settings.output_persistence),[Be,Ve]=(0,J.useState)(t.settings.relay_restore_mask),[We,Ge]=(0,J.useState)(String(t.settings.light_mode)),[Ke,Je]=(0,J.useState)(t.settings.on_brightness),[Xe,Qe]=(0,J.useState)(t.settings.off_brightness),[K,et]=(0,J.useState)(t.illumination),[tt,nt]=(0,J.useState)(t.illumination.applied_pwm),[rt,at]=(0,J.useState)(!1),[ot,st]=(0,J.useState)(``),[ct,lt]=(0,J.useState)(!1),[q,dt]=(0,J.useState)({enabled:!0,pages:[`door`],door_open_text:`door is open`,door_closed_text:`door is closed`,speed_ms:220,gap_cells:3}),[ft,pt]=(0,J.useState)(`door`),[mt,ht]=(0,J.useState)(null),[gt,_t]=(0,J.useState)(!0),[vt,yt]=(0,J.useState)(``),[bt,xt]=(0,J.useState)(!1),[St,Ct]=(0,J.useState)(p?.status_interval_ms??200),[wt,Tt]=(0,J.useState)(p?.measurement_freshness_ms??1500),[Et,Dt]=(0,J.useState)({refresh:p?.status_interval_ms??200,freshness:p?.measurement_freshness_ms??1500}),[Ot,kt]=(0,J.useState)(p===null),[At,jt]=(0,J.useState)(``),[X,Z]=(0,J.useState)({local_device:{enabled:!1,base_url:``},data_hub:{enabled:!1,base_url:`http://127.0.0.1:8080`},lifecycle_safety:{session_lock:`stop-motion`,suspend:`stop-motion`,refresh_on_resume:!0},buzzer_mirror:{enabled:!1,native_enabled:!1,web_audio_enabled:!0,backend:`auto`,executable:``,driver_directory:``}}),[Mt,Nt]=(0,J.useState)({local_device:{enabled:!1,base_url:``},data_hub:{enabled:!1,base_url:`http://127.0.0.1:8080`},lifecycle_safety:{session_lock:`stop-motion`,suspend:`stop-motion`,refresh_on_resume:!0},buzzer_mirror:{enabled:!1,native_enabled:!1,web_audio_enabled:!0,backend:`auto`,executable:``,driver_directory:``}}),[Ft,It]=(0,J.useState)(!0),[Lt,zt]=(0,J.useState)(!1),[Bt,Q]=(0,J.useState)(``),[Vt,Ht]=(0,J.useState)(p?.buzzer_runtime),Ut=(e,t)=>c({...s,[e]:t}),Wt=(0,J.useMemo)(()=>ie(M),[M]),Gt=(0,J.useMemo)(()=>ce(T),[T]),Kt=t.connected&&t.have_settings,qt=Kt&&!!(t.settings.flags&1),$=Vt??p?.buzzer_runtime,Jt=$?!$.host_mirror:!(p?.integrations?.buzzer_host_enabled??!1),Yt=Kt?Fe(qt,Jt):null,Xt=$?.effective_path&&$.effective_path!==`unknown`?$.effective_path:Yt,Zt=async e=>{_e(!0),Se(``);try{await m(e);let t=await z(`controller.integrations.status`);Ht(t.buzzer_runtime),Se(b(`Applied and verified.`,`اعمال و تأیید شد.`))}catch(e){Se(e instanceof Error?e.message:String(e))}finally{_e(!1)}},Qt=(0,J.useMemo)(()=>oe(X.local_device.base_url??``,X.local_device.enabled),[X.local_device.base_url,X.local_device.enabled]),$t=(0,J.useMemo)(()=>F(X.data_hub.base_url??``,X.data_hub.enabled),[X.data_hub.base_url,X.data_hub.enabled]),en=Qt.valid&&$t.valid,tn=Lt&&!j(X,Mt),nn=Wt.normalized!==e,rn=Gt!==l,an=(0,J.useMemo)(()=>Ue(ft),[ft]),on=(0,J.useMemo)(()=>A(q.door_open_text,q.gap_cells),[q.door_open_text,q.gap_cells]),sn=(0,J.useMemo)(()=>A(q.door_closed_text,q.gap_cells),[q.door_closed_text,q.gap_cells]),cn=(0,J.useMemo)(()=>({...q,pages:an.pages,door_open_text:on.normalized,door_closed_text:sn.normalized}),[sn.normalized,on.normalized,an.pages,q]),ln=an.valid&&on.valid&&sn.valid,un=mt!==null&&!le(cn,mt),dn=St>=50&&St<=6e4&&wt>=St+100&&wt<=12e4,fn=St!==Et.refresh||wt!==Et.freshness,pn=[{value:`leave`,label:b(`Release keys`,`رهاسازی کلیدها`)},{value:`stop-motion`,label:b(`Stop motion`,`توقف حرکت`)},{value:`all-off`,label:b(`All outputs off`,`خاموشی همه خروجی‌ها`)}],mn=vt||(gt?mt?b(`Saving the validated scrolling configuration…`,`در حال ذخیرهٔ تنظیمات معتبر پیمایش…`):b(`Loading the persisted scrolling configuration…`,`در حال بارگذاری تنظیمات ذخیره‌شدهٔ پیمایش…`):ln?un?b(`Validated draft · ready to save.`,`پیش‌نویس معتبر است و آمادهٔ ذخیره است.`):mt?b(`Saved configuration is up to date.`,`تنظیمات ذخیره‌شده به‌روز است.`):b(`Persistent scrolling configuration is unavailable.`,`تنظیمات ماندگار پیمایش در دسترس نیست.`):b(`Correct the highlighted fields before saving.`,`پیش از ذخیره، فیلدهای مشخص‌شده را اصلاح کنید.`));(0,J.useEffect)(()=>N(e),[e]),(0,J.useEffect)(()=>D(l),[l]),(0,J.useEffect)(()=>{p&&(Ct(p.status_interval_ms),Tt(p.measurement_freshness_ms),Dt({refresh:p.status_interval_ms,freshness:p.measurement_freshness_ms}),kt(!1))},[p?.measurement_freshness_ms,p?.status_interval_ms]),(0,J.useEffect)(()=>{let e=!0;return z(`controller.ui.config.get`).then(t=>{if(!e)return;let n=Ue(t.segment_scroll.pages.join(` `)).pages,r={...t.segment_scroll,pages:n,door_open_text:I(t.segment_scroll.door_open_text),door_closed_text:I(t.segment_scroll.door_closed_text)};dt(r),ht(r),pt(n.join(` `)),yt(``),xt(!1)}).catch(t=>{e&&(yt(t instanceof Error?t.message:String(t)),xt(!0))}).finally(()=>{e&&_t(!1)}),()=>{e=!1}},[]),(0,J.useEffect)(()=>{Ge(String(t.settings.light_mode)),Je(t.settings.on_brightness),Qe(t.settings.off_brightness),Te(t.settings.display_brightness),De(t.settings.display_closed_brightness),Ae(t.settings.motion_exit_hold_seconds||2),Pe(t.settings.status_brightness),Le(t.settings.stream_period_ms||200),ze(t.settings.output_persistence),Ve(t.settings.relay_restore_mask)},[t.settings.light_mode,t.settings.on_brightness,t.settings.off_brightness,t.settings.display_brightness,t.settings.display_closed_brightness,t.settings.motion_exit_hold_seconds,t.settings.status_brightness,t.settings.stream_period_ms,t.settings.output_persistence,t.settings.relay_restore_mask]),(0,J.useEffect)(()=>{et(t.illumination)},[t.illumination]),(0,J.useEffect)(()=>{nt(t.illumination.applied_pwm)},[t.illumination.applied_pwm]),(0,J.useEffect)(()=>{if(!t.connected||!t.have_settings||!S.pwm)return;let e=new AbortController;return z(`controller.illumination.get`,{},e.signal).then(t=>{e.signal.aborted||et(t)}).catch(t=>{e.signal.aborted||(st(t instanceof Error?t.message:String(t)),lt(!0))}),()=>e.abort()},[t.connected,t.have_settings,S.pwm]);let hn=async()=>{at(!0),st(``),lt(!1);try{let e=await z(`controller.illumination.set`,{mode:Number(We),on_brightness:Ke,off_brightness:Xe});et(e),st(b(`Applied live and verified durable in EEPROM.`,`به‌صورت زنده اعمال و ماندگاری آن در EEPROM تأیید شد.`))}catch(e){st(e instanceof Error?e.message:String(e)),lt(!0)}finally{at(!1)}},gn=async()=>{at(!0),st(``),lt(!1);try{let e=await z(`controller.illumination.override`,{value:tt});et(e),nt(e.applied_pwm),st(b(`Manual value applied and verified. The enclosure-lighting policy remains the owner.`,`مقدار دستی اعمال و تأیید شد. سیاست روشنایی محفظه همچنان مالک است.`))}catch(e){st(e instanceof Error?e.message:String(e)),lt(!0)}finally{at(!1)}},_n=(e,t)=>{ze(n=>t?n|e:n&~e)},vn=e=>{yt(``),xt(!1),dt(e)},yn=e=>{yt(``),xt(!1),pt(we(e))},bn=async e=>{if(e.preventDefault(),!ln)yt(b(`Correct the highlighted scrolling fields before saving.`,`پیش از ذخیره، فیلدهای پیمایش مشخص‌شده را اصلاح کنید.`)),xt(!0);else if(un){_t(!0),yt(``),xt(!1);try{let e=await z(`controller.ui.config.set`,{segment_scroll:cn}),t=Ue(e.segment_scroll.pages.join(` `)).pages,n={...e.segment_scroll,pages:t,door_open_text:I(e.segment_scroll.door_open_text),door_closed_text:I(e.segment_scroll.door_closed_text)};dt(n),ht(n),pt(t.join(` `)),yt(b(`Saved and applied by the file-watched HOST service.`,`ذخیره شد و سرویس میزبان آن را اعمال کرد.`))}catch(e){yt(e instanceof Error?e.message:String(e)),xt(!0)}finally{_t(!1)}}},xn=async e=>{if(e.preventDefault(),dn&&fn){kt(!0),jt(``);try{let e=await z(`controller.ui.config.set`,{status_interval_ms:St,measurement_freshness_ms:wt});Ct(e.status_interval_ms),Tt(e.measurement_freshness_ms),Dt({refresh:e.status_interval_ms,freshness:e.measurement_freshness_ms}),ee?.(e.status_interval_ms,e.measurement_freshness_ms),jt(b(`Applied.`,`اعمال شد.`))}catch(e){jt(e instanceof Error?e.message:String(e))}finally{kt(!1)}}},Sn=async e=>{e.preventDefault(),se(!0),fe(``);try{if(!Wt.valid){fe(C(Wt.error));return}let e=await d(Wt.normalized);N(e),fe(`Saved`)}catch(e){fe(e instanceof Error?e.message:String(e))}finally{se(!1)}};(0,J.useEffect)(()=>{let e=!0;return z(`controller.integrations.local.get`).then(t=>{if(!e)return;let n={local_device:{...t.local_device,base_url:k(t.local_device.base_url??``)},data_hub:{...t.data_hub,base_url:k(t.data_hub.base_url??``)},lifecycle_safety:t.lifecycle_safety??{session_lock:`stop-motion`,suspend:`stop-motion`,refresh_on_resume:!0},buzzer_mirror:t.buzzer_mirror??{enabled:!1,native_enabled:!1,web_audio_enabled:!0,backend:`auto`,executable:``,driver_directory:``},buzzer_runtime:t.buzzer_runtime};Ht(t.buzzer_runtime),Z(n),Nt(n),zt(!0),Q(``)}).catch(t=>{e&&Q(t instanceof Error?t.message:String(t))}).finally(()=>{e&&It(!1)}),()=>{e=!1}},[]);let Cn=async()=>{if(!en)Q(b(`Correct the highlighted field before saving.`,`پیش از ذخیره، فیلد مشخص‌شده را اصلاح کنید.`));else{It(!0),Q(``);try{let e={local_device:{...X.local_device,base_url:Qt.normalized},data_hub:{...X.data_hub,base_url:$t.normalized},lifecycle_safety:X.lifecycle_safety,buzzer_mirror:X.buzzer_mirror},t=await z(`controller.integrations.local.set`,e),n={local_device:{...t.local_device,base_url:k(t.local_device.base_url??``)},data_hub:{...t.data_hub,base_url:k(t.data_hub.base_url??``)},lifecycle_safety:t.lifecycle_safety,buzzer_mirror:t.buzzer_mirror,buzzer_runtime:t.buzzer_runtime};Ht(t.buzzer_runtime),Z(n),Nt(n),Q(`Saved`)}catch(e){Q(e instanceof Error?e.message:String(e))}finally{It(!1)}}},wn=async e=>{e.preventDefault(),await Cn()},Tn=i(s.theme),En=i(s.locale===`fa`?`persian`:`english`),Dn=i(s.direction===`auto`?`auto`:s.direction===`ltr`?`leftToRight`:`rightToLeft`),On=g.boardState===`ready`&&t.connected&&t.have_status;return g.authenticationRequired?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:b(`Host recovery`,`بازیابی میزبان`),title:i(`settings`),detail:i(`authenticationDashboardDetail`)}),(0,Y.jsx)(`section`,{className:`settings-grid`,children:(0,Y.jsx)(P,{icon:E,iconTone:`amber`,title:i(`security`),eyebrow:b(`Authentication required`,`احراز هویت لازم است`),className:`settings-card`,children:(0,Y.jsx)(ve,{label:i(`authToken`),type:`password`,value:T,autoComplete:`off`,spellCheck:!1,onInput:e=>D(ce(e.currentTarget.value)),onChange:e=>D(ce(e.currentTarget.value)),hint:rn?b(`${Gt.length} normalized characters · not applied`,`${Gt.length} نویسهٔ نرمال‌شده · اعمال نشده`):b(`Enter this host’s access token.`,`توکن دسترسی این میزبان را وارد کنید.`),action:(0,Y.jsx)(V,{tone:`primary`,icon:E,disabled:!rn,onClick:()=>{u(Gt),D(Gt)},children:i(`apply`)})})})})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(pe,{eyebrow:On?b(`Host and controller settings`,`تنظیمات میزبان و کنترلر`):b(`Host settings`,`تنظیمات میزبان`),title:i(`settings`),detail:`${b(`Theme`,`پوسته`)}: ${Tn} · ${b(`Language`,`زبان`)}: ${En} · ${b(`Direction`,`جهت`)}: ${Dn}${On?b(` · controller available`,` · کنترلر در دسترس`):``}`}),(0,Y.jsxs)(`section`,{className:`settings-grid`,children:[(0,Y.jsx)(P,{icon:$e,iconTone:`violet`,title:b(`PC host identity`,`هویت میزبان رایانه`),eyebrow:ae?b(`Saving`,`در حال ذخیره`):nn?b(`Unsaved change`,`تغییر ذخیره‌نشده`):b(`Saved`,`ذخیره‌شده`),className:`settings-card`,children:(0,Y.jsx)(`form`,{onSubmit:e=>void Sn(e),children:(0,Y.jsx)(ve,{label:b(`Application title`,`عنوان برنامه`),value:M,minLength:1,maxLength:64,onInput:e=>{fe(``),N(L(e.currentTarget.value))},onChange:e=>{fe(``),N(L(e.currentTarget.value))},error:nn&&!Wt.valid?C(Wt.error):void 0,success:ue===`Saved`?b(`Saved as “${e}”.`,`با عنوان «${e}» ذخیره شد.`):void 0,hint:nn?b(`${Wt.normalized.length}/64 characters · ready to save`,`${Wt.normalized.length} از ۶۴ نویسه · آمادهٔ ذخیره`):b(`Current title: ${e}`,`عنوان فعلی: ${e}`),action:(0,Y.jsx)(V,{type:`submit`,tone:`primary`,icon:E,busy:ae,disabled:!nn||!Wt.valid,children:b(`Save`,`ذخیره`)})})})}),(0,Y.jsx)(P,{icon:it,iconTone:`green`,title:b(`Connected applications`,`برنامه‌های متصل`),eyebrow:`${y.length} ${b(`live`,`فعال`)}`,className:`settings-card settings-card--wide`,children:y.length===0?(0,Y.jsx)(de,{icon:it,title:b(`No connected applications`,`برنامهٔ متصلی وجود ندارد`),detail:b(`Live clients appear here after they advertise their controls.`,`کلاینت‌های زنده پس از معرفی کنترل‌های خود اینجا ظاهر می‌شوند.`)}):(0,Y.jsx)(`div`,{className:`connected-apps-list`,children:y.map(e=>{let t=(e.values?.app_actions??``).split(`,`).map(e=>e.trim()).filter(Boolean),n=e.surface.toLowerCase()===`pealayer`,r=e.self?.pid??e.self?.vars?.pid,i=e.self?.vars?.web_ui??e.self?.vars?.websocket??e.self?.vars?.rpc;return(0,Y.jsxs)(`article`,{className:`connected-app`,children:[(0,Y.jsxs)(`div`,{className:`connected-app__identity`,children:[(0,Y.jsx)(O,{tone:e.state===`active`?`good`:`neutral`,children:e.state||b(`present`,`حاضر`)}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:e.surface}),(0,Y.jsx)(`span`,{children:e.id})]})]}),(0,Y.jsxs)(`div`,{className:`connected-app__facts`,children:[e.page&&(0,Y.jsxs)(`span`,{children:[b(`Page`,`صفحه`),`: `,e.page]}),e.self?.kind&&(0,Y.jsxs)(`span`,{children:[e.self.kind,r?` · PID ${r}`:``]}),(0,Y.jsxs)(`span`,{children:[t.length,` `,b(`controls`,`کنترل`)]}),i&&(0,Y.jsx)(`span`,{title:i,children:i})]}),(0,Y.jsxs)(`div`,{className:`connected-app__capabilities`,"aria-label":b(`Advertised controls`,`کنترل‌های معرفی‌شده`),children:[t.slice(0,5).map(e=>(0,Y.jsx)(`code`,{children:e.replace(/^pealayer\./,``)},e)),t.length>5&&(0,Y.jsxs)(`span`,{title:t.slice(5).join(`, `),children:[`+`,t.length-5]})]}),n&&(0,Y.jsxs)(`div`,{className:`connected-app__actions`,children:[t.includes(`pealayer.play`)&&(0,Y.jsx)(V,{icon:ut,onClick:()=>void z(`controller.app.action`,{kind:`pealayer.play`,target:e.id}),children:b(`Play`,`پخش`)}),t.includes(`pealayer.pause`)&&(0,Y.jsx)(V,{icon:qe,onClick:()=>void z(`controller.app.action`,{kind:`pealayer.pause`,target:e.id}),children:b(`Pause`,`مکث`)})]})]},e.id)})})}),(0,Y.jsx)(Rt,{locale:r}),p&&(0,Y.jsx)(P,{icon:He,iconTone:`green`,title:b(`Live measurements`,`اندازه‌گیری‌های زنده`),eyebrow:Ot?b(`Synchronizing`,`در حال همگام‌سازی`):`${Re(r,1e3/St,St===200?0:1)} ${b(`Hz`,`هرتز`)}`,className:`settings-card settings-card--wide`,children:(0,Y.jsxs)(`form`,{className:`segment-scroll-settings`,onSubmit:e=>void xn(e),children:[(0,Y.jsx)(H,{label:b(`Refresh/update interval`,`فاصلهٔ تازه‌سازی/به‌روزرسانی`),value:St,min:50,max:6e4,step:50,unit:`ms`,onChange:e=>{jt(``),Ct(e)}}),(0,Y.jsx)(H,{label:b(`Freshness window`,`پنجرهٔ تازگی`),value:wt,min:St+100,max:12e4,step:100,unit:`ms`,onChange:e=>{jt(``),Tt(e)}}),(0,Y.jsxs)(`div`,{className:`local-integrations-form__footer`,children:[(0,Y.jsx)(`span`,{className:`segment-scroll-settings__notice${dn?``:` is-error`}`,role:`status`,"aria-live":`polite`,children:dn?At:b(`Freshness must be ${St+100}..120000 ms.`,`تازگی باید بین ${St+100} تا ۱۲۰۰۰۰ میلی‌ثانیه باشد.`)}),(0,Y.jsx)(V,{type:`submit`,tone:`primary`,icon:E,busy:Ot,disabled:!fn||!dn,children:b(`Apply live timing`,`اعمال زمان‌بندی زنده`)})]})]})}),(0,Y.jsx)(P,{icon:n,iconTone:`accent`,title:b(`HOST display scrolling`,`پیمایش نمایشگر میزبان`),eyebrow:q.enabled?b(`Enabled`,`فعال`):b(`Disabled`,`غیرفعال`),className:`settings-card settings-card--wide`,children:(0,Y.jsxs)(`form`,{className:`segment-scroll-settings`,onSubmit:e=>void bn(e),children:[(0,Y.jsx)(W,{checked:q.enabled,onChange:e=>vn(t=>({...t,enabled:e})),label:b(`Supply scrolling text to selected pages`,`ارسال متن پیمایشی به صفحات انتخابی`),detail:b(`The board keeps OPEN/CLSD as its offline fallback; warnings, edits, programming, and other critical overlays remain higher priority.`,`برد در حالت آفلاین OPEN/CLSD را نمایش می‌دهد و هشدارها و لایه‌های مهم اولویت بالاتری دارند.`)}),(0,Y.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,Y.jsx)(ve,{label:b(`Selected page keys or IDs`,`کلید یا شناسه صفحات`),value:ft,dir:`ltr`,spellCheck:!1,onInput:e=>yn(e.currentTarget.value),onChange:e=>yn(e.currentTarget.value),error:an.valid?void 0:C(an.error),success:un&&an.valid?b(`${an.pages.length} canonical target${an.pages.length===1?``:`s`}.`,`${an.pages.length} مقصد معتبر.`):void 0,hint:b(`Spaces and commas normalize automatically; maximum 14 unique ASCII IDs.`,`فاصله و ویرگول خودکار یکسان می‌شوند؛ حداکثر ۱۴ شناسهٔ یکتای ASCII.`)}),(0,Y.jsx)(ve,{label:b(`Door open text`,`متن درب باز`),value:q.door_open_text,dir:`ltr`,maxLength:40,spellCheck:!1,onInput:e=>vn(t=>({...t,door_open_text:I(e.currentTarget.value)})),onChange:e=>vn(t=>({...t,door_open_text:I(e.currentTarget.value)})),error:on.valid?void 0:C(on.error),success:un&&on.valid?b(`${on.byteLength} + ${q.gap_cells} / 40 bytes.`,`${on.byteLength} + ${q.gap_cells} از ۴۰ بایت.`):void 0,hint:b(`${on.availableBytes} ASCII bytes available before the repeat gap.`,`${on.availableBytes} بایت ASCII پیش از فاصلهٔ تکرار در دسترس است.`)}),(0,Y.jsx)(ve,{label:b(`Door closed text`,`متن درب بسته`),value:q.door_closed_text,dir:`ltr`,maxLength:40,spellCheck:!1,onInput:e=>vn(t=>({...t,door_closed_text:I(e.currentTarget.value)})),onChange:e=>vn(t=>({...t,door_closed_text:I(e.currentTarget.value)})),error:sn.valid?void 0:C(sn.error),success:un&&sn.valid?b(`${sn.byteLength} + ${q.gap_cells} / 40 bytes.`,`${sn.byteLength} + ${q.gap_cells} از ۴۰ بایت.`):void 0,hint:b(`${sn.availableBytes} ASCII bytes available before the repeat gap.`,`${sn.availableBytes} بایت ASCII پیش از فاصلهٔ تکرار در دسترس است.`)})]}),(0,Y.jsx)(H,{label:b(`Scroll window dwell`,`مکث هر پنجره پیمایش`),value:q.speed_ms,min:60,max:5e3,step:20,unit:`ms`,onChange:e=>vn(t=>({...t,speed_ms:e}))}),(0,Y.jsx)(H,{label:b(`Gap between repeats`,`فاصله بین تکرارها`),value:q.gap_cells,min:0,max:12,unit:b(` cells`,` خانه`),onChange:e=>vn(t=>({...t,gap_cells:e}))}),(0,Y.jsxs)(`div`,{className:`local-integrations-form__footer`,children:[(0,Y.jsx)(`span`,{className:`segment-scroll-settings__notice${bt||!ln?` is-error`:``}`,role:`status`,"aria-live":`polite`,children:mn}),(0,Y.jsx)(V,{type:`submit`,tone:`primary`,icon:E,busy:gt,disabled:!un||!ln,children:b(`Save scrolling`,`ذخیره پیمایش`)})]})]})}),(0,Y.jsxs)(P,{icon:je,iconTone:`green`,title:b(`Buzzer routing`,`مسیر بیزر`),eyebrow:(Xt??b(`Pending`,`در انتظار`)).toUpperCase(),className:`settings-card settings-card--wide`,children:[(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:b(`Playback path`,`مسیر پخش`)}),(0,Y.jsx)(R,{value:Xt??$?.requested_path??X.buzzer_mirror.path??`none`,label:b(`Buzzer playback path`,`مسیر پخش بیزر`),options:[{value:`board`,label:b(`Board`,`برد`)},{value:`host`,label:b(`PC`,`رایانه`)},{value:`both`,label:b(`Both`,`هر دو`)},{value:`none`,label:b(`None`,`هیچ‌کدام`)}],onChange:e=>void Zt(e)})]}),(0,Y.jsxs)(`div`,{className:`settings-inline-status`,children:[Kt?(0,Y.jsx)(O,{tone:qt?`neutral`:`good`,children:b(`Board ${qt?`silent`:`active`}`,`برد ${qt?`بی‌صدا`:`فعال`}`)}):(0,Y.jsx)(O,{tone:`neutral`,children:b(`Board state unavailable`,`وضعیت برد در دسترس نیست`)}),(0,Y.jsx)(O,{tone:Jt?`neutral`:`good`,children:b(`PC ${Jt?`silent`:`active`}`,`رایانه ${Jt?`بی‌صدا`:`فعال`}`)}),me&&(0,Y.jsx)(O,{tone:`warn`,children:b(`Applying…`,`در حال اعمال…`)}),$?.requested_path&&$.requested_path!==`unknown`&&$.requested_path!==$.effective_path&&(0,Y.jsx)(O,{tone:$.board_apply_state===`error`?`warn`:`neutral`,children:`${$.requested_path} · ${$.board_apply_state}`}),$&&(0,Y.jsx)(O,{tone:$.backend_error?`warn`:`neutral`,children:`${$.backend_requested} → ${$.backend_effective}`})]}),(0,Y.jsx)(W,{checked:X.buzzer_mirror.enabled,onChange:e=>{Q(``),Z(t=>{let n=t.buzzer_mirror.path,r=n===`host`||n===`none`;return{...t,buzzer_mirror:{...t.buzzer_mirror,enabled:e,path:n&&Fe(r,!e)}}})},label:b(`Mirror board beeps on this host`,`بازپخش بوق‌های برد روی این میزبان`)}),X.buzzer_mirror.enabled&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(W,{checked:X.buzzer_mirror.native_enabled,onChange:e=>{Q(``),Z(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,native_enabled:e,backend:e&&t.buzzer_mirror.backend===`off`?`auto`:t.buzzer_mirror.backend}}))},label:b(`PC speaker renderer`,`پخش‌کنندهٔ بلندگوی رایانه`)}),(0,Y.jsx)(W,{checked:X.buzzer_mirror.web_audio_enabled,onChange:e=>{Q(``),Z(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,web_audio_enabled:e}}))},label:b(`Web browser renderer`,`پخش‌کنندهٔ مرورگر وب`)}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:b(`PC speaker backend`,`پشتیبان بلندگوی رایانه`)}),(0,Y.jsx)(R,{value:X.buzzer_mirror.backend,label:b(`PC speaker backend`,`پشتیبان بلندگوی رایانه`),options:[{value:`auto`,label:b(`Auto`,`خودکار`)},{value:`native`,label:b(`Native`,`بومی`)},{value:`external`,label:b(`Command`,`فرمان`)},{value:`off`,label:b(`Off`,`خاموش`)}],onChange:e=>{Q(``),Z(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,backend:e,native_enabled:e!==`off`&&t.buzzer_mirror.native_enabled}}))}})]}),X.buzzer_mirror.backend!==`native`&&X.buzzer_mirror.backend!==`off`&&(0,Y.jsx)(ve,{label:b(`Beep executable (optional)`,`فایل اجرایی بوق (اختیاری)`),dir:`ltr`,spellCheck:!1,value:X.buzzer_mirror.executable??``,placeholder:b(`Blank uses beep from PATH`,`خالی: استفاده از beep در PATH`),onChange:e=>{Q(``),Z(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,executable:e.currentTarget.value}}))}})]}),(0,Y.jsx)(`div`,{className:`inline-actions`,children:(0,Y.jsx)(V,{icon:E,tone:`primary`,busy:Ft,disabled:!tn,onClick:()=>void Cn(),children:b(`Save PC buzzer settings`,`ذخیرهٔ تنظیمات بیزر رایانه`)})}),be&&(0,Y.jsx)(`p`,{className:`settings-action-feedback`,role:`status`,children:be})]}),(0,Y.jsxs)(P,{icon:U,iconTone:`accent`,title:i(`appearance`),eyebrow:`${Tn} · ${Dn}`,className:`settings-card settings-card--wide`,menu:[{label:b(`Follow system appearance`,`پیروی از ظاهر سیستم`),icon:U,onSelect:()=>c({...s,theme:`system`,direction:`auto`})},{label:s.reduceMotion?b(`Enable interface motion`,`فعال‌سازی حرکت رابط`):b(`Reduce interface motion`,`کاهش حرکت رابط`),icon:re,onSelect:()=>Ut(`reduceMotion`,!s.reduceMotion)}],children:[(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:i(`theme`)}),(0,Y.jsx)(R,{value:s.theme,label:i(`theme`),options:[{value:`system`,label:i(`system`),icon:U},{value:`dark`,label:i(`dark`),icon:Me},{value:`light`,label:i(`light`),icon:Oe}],onChange:e=>Ut(`theme`,e)})]}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:i(`language`)}),(0,Y.jsx)(R,{value:s.locale,label:i(`language`),options:[{value:`en`,label:i(`english`),icon:he},{value:`fa`,label:i(`persian`),icon:he}],onChange:e=>Ut(`locale`,e)})]}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:i(`direction`)}),(0,Y.jsx)(R,{value:s.direction,label:i(`direction`),options:[{value:`auto`,label:i(`auto`)},{value:`ltr`,label:i(`leftToRight`)},{value:`rtl`,label:i(`rightToLeft`)}],onChange:e=>Ut(`direction`,e)})]}),(0,Y.jsx)(W,{checked:s.reduceMotion,onChange:e=>Ut(`reduceMotion`,e),label:i(`reduceMotion`),detail:s.reduceMotion?b(`Nonessential motion is off.`,`حرکت‌های غیرضروری خاموش‌اند.`):b(`Smooth interface transitions are on.`,`گذارهای نرم رابط فعال‌اند.`)}),(0,Y.jsx)(W,{checked:s.compactNumbers,onChange:e=>Ut(`compactNumbers`,e),label:i(`compactNumbers`),detail:s.compactNumbers?b(`Large values use compact notation.`,`مقادیر بزرگ به‌صورت فشرده نمایش داده می‌شوند.`):b(`Large values use full notation.`,`مقادیر بزرگ به‌صورت کامل نمایش داده می‌شوند.`)}),(0,Y.jsx)(W,{checked:_,onChange:te,label:b(`Sync this tab with other instances`,`همگام‌سازی این زبانه با نمونه‌های دیگر`),detail:v.state===`pending`?(0,Y.jsx)(`span`,{role:`status`,children:b(`Synchronizing…`,`در حال همگام‌سازی…`)}):v.state===`error`?(0,Y.jsx)(`span`,{role:`alert`,children:v.detail}):void 0}),(0,Y.jsx)(W,{checked:!s.audioMuted,onChange:e=>Ut(`audioMuted`,!e),label:(0,Y.jsxs)(`span`,{className:`setting-icon-label`,children:[(0,Y.jsx)(je,{size:16}),b(`Interaction audio`,`صدای تعامل`)]}),detail:s.audioMuted?b(`Audio cues are off.`,`نشانه‌های صوتی خاموش‌اند.`):b(`Audio cues are at ${Math.round(s.audioVolume*100)}%.`,`بلندی نشانه‌های صوتی ${Math.round(s.audioVolume*100)}٪ است.`)}),!s.audioMuted&&(0,Y.jsx)(H,{label:b(`Cue volume`,`بلندی نشانه‌ها`),value:Math.round(s.audioVolume*100),min:0,max:100,unit:`%`,onChange:e=>Ut(`audioVolume`,e/100)}),!s.audioMuted&&(0,Y.jsx)(V,{icon:je,onClick:()=>window.dispatchEvent(new Event(`pccontroller:test-feedback`)),children:b(`Test notification`,`آزمایش اعلان`)})]}),(0,Y.jsx)(Pt,{locale:s.locale}),p?.auth_required===!0&&(0,Y.jsx)(P,{icon:E,iconTone:`green`,title:i(`security`),eyebrow:rn?b(`Token change pending`,`تغییر توکن در انتظار اعمال`):l?b(`Session authenticated`,`نشست معتبر است`):b(`No session token`,`بدون توکن نشست`),className:`settings-card`,children:(0,Y.jsx)(ve,{label:i(`authToken`),type:`password`,value:T,autoComplete:`off`,spellCheck:!1,onInput:e=>D(ce(e.currentTarget.value)),onChange:e=>D(ce(e.currentTarget.value)),hint:rn?b(`${Gt.length} normalized characters · not applied`,`${Gt.length} نویسهٔ نرمال‌شده · اعمال نشده`):l?b(`Applied to this browser tab.`,`در این زبانهٔ مرورگر اعمال شده است.`):b(`Enter a token if the host requires one.`,`اگر میزبان توکن می‌خواهد، آن را وارد کنید.`),action:(0,Y.jsx)(V,{tone:`primary`,icon:E,disabled:!rn,onClick:()=>{u(Gt),D(Gt)},children:i(`apply`)})})}),On&&S.settings&&(0,Y.jsx)(P,{icon:xe,iconTone:`amber`,title:b(`Enclosure illumination`,`روشنایی محفظه`),eyebrow:K.available?K.at_target?b(`Applied · at target`,`اعمال‌شده · در مقدار هدف`):b(`Transitioning to target`,`در حال گذار به مقدار هدف`):b(`Waiting for live PWM state`,`در انتظار وضعیت زندهٔ PWM`),className:`settings-card settings-card--wide illumination-settings-card`,children:t.have_settings?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`illumination-state-grid`,"aria-label":b(`Live enclosure illumination state`,`وضعیت زندهٔ روشنایی محفظه`),children:[(0,Y.jsx)(B,{label:b(`Policy`,`سیاست`),value:[b(`Off`,`خاموش`),b(`Auto`,`خودکار`),b(`On`,`روشن`)][K.mode]??String(K.mode)}),(0,Y.jsx)(B,{label:b(`Door input`,`ورودی درب`),value:K.door_open?b(`Open`,`باز`):b(`Closed`,`بسته`),tone:K.door_open?`warn`:`good`}),(0,Y.jsx)(B,{label:b(`Selected target`,`مقدار هدف انتخاب‌شده`),value:`${K.target_brightness}/255 · ${K.target_pwm}/4095`,mono:!0}),(0,Y.jsx)(B,{label:b(`Applied MOSFET channel 12`,`مقدار اعمال‌شدهٔ کانال ۱۲ ماسفت`),value:K.available?`${K.applied_brightness}/255 · ${K.applied_pwm}/4095`:b(`Unavailable`,`در دسترس نیست`),tone:K.available?K.at_target?`good`:`warn`:void 0,mono:!0}),(0,Y.jsx)(B,{label:b(`EEPROM durability`,`ماندگاری EEPROM`),value:K.persisted?b(`Verified`,`تأییدشده`):b(`Not confirmed`,`تأییدنشده`),tone:K.persisted?`good`:`warn`})]}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:b(`Operating mode`,`حالت عملکرد`)}),(0,Y.jsx)(R,{value:We,label:b(`Enclosure illumination mode`,`حالت روشنایی محفظه`),options:[{value:`0`,label:b(`Off`,`خاموش`)},{value:`1`,label:b(`Auto · door`,`خودکار · درب`)},{value:`2`,label:b(`On`,`روشن`)}],onChange:e=>{st(``),Ge(e)}})]}),(0,Y.jsx)(H,{label:b(`Door-open / On brightness`,`روشنایی درب باز / حالت روشن`),value:Ke,min:0,max:255,onChange:e=>{st(``),Je(e)}}),(0,Y.jsx)(H,{label:b(`Door-closed / Off brightness`,`روشنایی درب بسته / حالت خاموش`),value:Xe,min:0,max:255,onChange:e=>{st(``),Qe(e)}}),(0,Y.jsx)(H,{label:b(`Manual raw override · MOSFET channel 12`,`کنترل دستی خام · کانال ۱۲ ماسفت`),value:tt,min:0,max:4095,onChange:e=>{st(``),nt(e)}}),(0,Y.jsxs)(`div`,{className:`illumination-settings-card__footer`,children:[(0,Y.jsx)(`p`,{className:ct?`settings-action-feedback text-bad`:`settings-action-feedback`,role:ct?`alert`:`status`,children:ot||b(`Manual adjustment is temporary: policy ownership and EEPROM settings remain unchanged and may reapply the selected target.`,`تنظیم دستی موقت است: مالکیت سیاست و تنظیمات EEPROM تغییر نمی‌کند و ممکن است مقدار هدف دوباره اعمال شود.`)}),(0,Y.jsxs)(`div`,{className:`inline-actions`,children:[(0,Y.jsx)(V,{icon:h,busy:rt,disabled:!S.pwm||!K.available,onClick:()=>void gn(),children:b(`Apply manual override`,`اعمال کنترل دستی`)}),(0,Y.jsx)(V,{tone:`primary`,icon:xe,busy:rt,disabled:!S.pwm||!K.available,onClick:()=>void hn(),children:b(`Apply policy`,`اعمال سیاست`)})]})]})]}):(0,Y.jsx)(de,{icon:xe,title:b(`Reading illumination policy`,`در حال خواندن سیاست روشنایی`),detail:b(`The controls appear only after the board returns authoritative EEPROM settings.`,`کنترل‌ها پس از دریافت تنظیمات معتبر EEPROM از برد نمایش داده می‌شوند.`)})}),On&&S.settings&&(0,Y.jsx)(P,{icon:Ye,iconTone:`amber`,title:b(`Board EEPROM settings`,`تنظیمات EEPROM برد`),eyebrow:t.have_settings?b(`Live draft · explicit write`,`پیش‌نویس زنده · نوشتن صریح`):f===`loading`?b(`Reading board settings`,`در حال خواندن تنظیمات برد`):b(`Settings unavailable`,`تنظیمات در دسترس نیست`),className:`settings-card`,children:t.have_settings?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`table`,{className:`settings-value-table`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:b(`Setting`,`تنظیم`)}),(0,Y.jsx)(`th`,{children:b(`EEPROM report`,`گزارش EEPROM`)}),(0,Y.jsx)(`th`,{children:b(`Live draft`,`پیش‌نویس زنده`)})]})}),(0,Y.jsxs)(`tbody`,{children:[(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`td`,{children:[`TM1637 · `,b(`door open`,`درب باز`)]}),(0,Y.jsx)(`td`,{children:t.settings.display_brightness}),(0,Y.jsx)(`td`,{children:Ce})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`td`,{children:[`TM1637 · `,b(`door closed`,`درب بسته`)]}),(0,Y.jsx)(`td`,{children:t.settings.display_closed_brightness}),(0,Y.jsx)(`td`,{children:Ee})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Motion-menu exit hold`,`مکث خروج از منوی حرکت`)}),(0,Y.jsxs)(`td`,{children:[t.settings.motion_exit_hold_seconds,` s`]}),(0,Y.jsxs)(`td`,{children:[ke,` s`]})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Status brightness`,`روشنایی وضعیت`)}),(0,Y.jsx)(`td`,{children:t.settings.status_brightness}),(0,Y.jsx)(`td`,{children:Ne})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Telemetry period`,`دورهٔ تله‌متری`)}),(0,Y.jsxs)(`td`,{children:[t.settings.stream_period_ms,` ms`]}),(0,Y.jsxs)(`td`,{children:[Ie,` ms`]})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Remember motion command`,`به‌خاطرسپاری فرمان حرکت`)}),(0,Y.jsx)(`td`,{children:t.settings.output_persistence&1?b(`Yes`,`بله`):b(`No`,`خیر`)}),(0,Y.jsx)(`td`,{children:G&1?b(`Yes`,`بله`):b(`No`,`خیر`)})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Remember user relays`,`به‌خاطرسپاری رله‌های کاربر`)}),(0,Y.jsx)(`td`,{children:t.settings.output_persistence&2?b(`Yes`,`بله`):b(`No`,`خیر`)}),(0,Y.jsx)(`td`,{children:G&2?b(`Yes`,`بله`):b(`No`,`خیر`)})]}),S.pwm&&(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Remember user PWM`,`به‌خاطرسپاری PWM کاربر`)}),(0,Y.jsx)(`td`,{children:t.settings.output_persistence&4?b(`Yes`,`بله`):b(`No`,`خیر`)}),(0,Y.jsx)(`td`,{children:G&4?b(`Yes`,`بله`):b(`No`,`خیر`)})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Stop retains direction`,`حفظ جهت هنگام توقف`)}),(0,Y.jsx)(`td`,{children:t.settings.output_persistence&8?b(`Yes`,`بله`):b(`No`,`خیر`)}),(0,Y.jsx)(`td`,{children:G&8?b(`Yes`,`بله`):b(`No`,`خیر`)})]}),(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:b(`Stored relay restore mask`,`ماسک ذخیره‌شدهٔ بازیابی رله`)}),(0,Y.jsxs)(`td`,{colSpan:2,children:[`0x`,Be.toString(16).toUpperCase().padStart(2,`0`)]})]})]})]}),(0,Y.jsx)(H,{label:b(`TM1637 · door-open brightness`,`TM1637 · روشنایی درب باز`),value:Ce,min:0,max:7,onChange:Te}),(0,Y.jsx)(H,{label:b(`TM1637 · door-closed brightness`,`TM1637 · روشنایی درب بسته`),value:Ee,min:0,max:7,onChange:De}),(0,Y.jsx)(H,{label:b(`Motion-menu exit hold`,`مکث خروج از منوی حرکت`),value:ke,min:1,max:31,unit:`s`,onChange:Ae}),(0,Y.jsx)(H,{label:b(`Status brightness`,`روشنایی وضعیت`),value:Ne,min:0,max:255,onChange:Pe}),(0,Y.jsx)(H,{label:b(`Telemetry period`,`دورهٔ تله‌متری`),value:Ie,min:50,max:5e3,step:50,unit:`ms`,onChange:Le}),(0,Y.jsx)(W,{checked:!!(G&1),onChange:e=>_n(1,e),label:b(`Remember motion command`,`به‌خاطرسپاری فرمان حرکت`),detail:b(`Disabled by default; motion starts released after a reboot.`,`به‌طور پیش‌فرض غیرفعال است؛ حرکت پس از راه‌اندازی دوباره در حالت آزاد آغاز می‌شود.`)}),(0,Y.jsx)(W,{checked:!!(G&2),onChange:e=>_n(2,e),label:b(`Remember user relays R5–R8`,`به‌خاطرسپاری رله‌های کاربر R5 تا R8`),detail:b(`Restore the user-output relay mask kept in EEPROM.`,`ماسک رله‌های خروجی کاربر ذخیره‌شده در EEPROM بازیابی می‌شود.`)}),S.pwm&&(0,Y.jsx)(W,{checked:!!(G&4),onChange:e=>_n(4,e),label:b(`Remember user PWM values`,`به‌خاطرسپاری مقادیر PWM کاربر`),detail:b(`Restore MOSFET/user PWM channel values after boot.`,`مقادیر کانال‌های MOSFET/PWM کاربر پس از راه‌اندازی بازیابی می‌شوند.`)}),(0,Y.jsx)(W,{checked:!!(G&8),onChange:e=>_n(8,e),label:b(`Stop keeps direction relay`,`توقف، رلهٔ جهت را حفظ کند`),detail:G&8?b(`Motion stop releases only the output/enable relay.`,`توقف حرکت فقط رلهٔ خروجی/فعال‌سازی را آزاد می‌کند.`):b(`Motion stop releases both direction and output relays.`,`توقف حرکت هر دو رلهٔ جهت و خروجی را آزاد می‌کند.`)}),(0,Y.jsx)(V,{tone:`primary`,icon:x,onClick:()=>void a(ye(t.settings,Ce,Ee,Ne,Ie,ke,G,Be)),children:b(`Write board settings`,`نوشتن تنظیمات برد`)})]}):(0,Y.jsx)(de,{icon:x,title:f===`loading`?b(`Reading board settings`,`در حال خواندن تنظیمات برد`):b(`Board settings are unavailable`,`تنظیمات برد در دسترس نیست`),detail:f===`loading`?b(`Waiting for the controller to return its live EEPROM settings.`,`در انتظار دریافت تنظیمات زندهٔ EEPROM از برد.`):b(`No EEPROM values are shown until the controller returns an authoritative settings report.`,`تا دریافت گزارش معتبر تنظیمات از برد، هیچ مقدار EEPROM نمایش داده نمی‌شود.`)})}),On&&(0,Y.jsxs)(P,{icon:o,iconTone:`green`,title:i(`connection`),eyebrow:b(`Controller board connected`,`برد کنترلر متصل است`),className:`settings-card`,children:[(0,Y.jsxs)(`div`,{className:`data-list`,children:[(0,Y.jsx)(B,{label:b(`State`,`وضعیت`),value:t.connection_state,tone:`good`}),(0,Y.jsx)(B,{label:b(`Port`,`درگاه`),value:t.port.name||b(`automatic`,`خودکار`),mono:!0}),(0,Y.jsx)(B,{label:`VID:PID`,value:`${t.port.vid||`—`}:${t.port.pid||`—`}`,mono:!0}),(0,Y.jsx)(B,{label:b(`Serial`,`سریال`),value:t.port.serial_number||`—`,mono:!0}),(0,Y.jsx)(B,{label:b(`Baud`,`نرخ باد`),value:`115200 8N1`,mono:!0})]}),t.port_process&&(0,Y.jsxs)(`div`,{className:`data-list`,children:[(0,Y.jsx)(B,{label:b(`Port process`,`پردازش درگاه`),value:t.port_process.state,tone:t.port_process.state===`free`?`good`:t.port_process.state===`owned`?`warn`:void 0}),(0,Y.jsx)(B,{label:b(`Owner`,`مالک`),value:t.port_process.pid?`${t.port_process.name||`unknown`} · PID ${t.port_process.pid}`:t.port_process.error||`—`,mono:!0}),t.port_process.executable&&(0,Y.jsx)(B,{label:b(`Executable`,`فایل اجرا`),value:t.port_process.executable,mono:!0}),(0,Y.jsx)(B,{label:b(`Takeover`,`واگذاری`),value:t.port_process.takeover_ready?b(`armed when free`,`با آزادشدن آماده`):b(`not armed`,`مسلح نیست`)})]}),(0,Y.jsx)(`div`,{className:`inline-actions`,children:(0,Y.jsx)(V,{icon:ne,onClick:()=>void a(`close`),children:b(`Pause controller`,`توقف کنترلر`)})})]}),(0,Y.jsx)(P,{icon:w,iconTone:`violet`,title:b(`Host services and lifecycle`,`سرویس‌ها و چرخهٔ میزبان`),eyebrow:Ft?b(`Synchronizing`,`در حال همگام‌سازی`):tn?b(`Unsaved changes`,`تغییرات ذخیره‌نشده`):Bt===`Saved`?b(`Saved`,`ذخیره‌شده`):b(`Up to date`,`به‌روز`),className:`settings-card settings-card--wide`,children:(0,Y.jsxs)(`form`,{className:`local-integrations-form`,onSubmit:e=>void wn(e),children:[(0,Y.jsxs)(`section`,{className:`integration-config-panel`,children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsx)(w,{size:19}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:b(`Local device`,`وسیلهٔ محلی`)}),(0,Y.jsx)(`small`,{children:X.local_device.enabled?b(`Enabled`,`فعال`):b(`Disabled`,`غیرفعال`)})]})]}),(0,Y.jsx)(W,{checked:X.local_device.enabled,onChange:e=>{Q(``),Z(t=>({...t,local_device:{...t.local_device,enabled:e}}))},label:b(`Enable local device`,`فعال‌سازی وسیلهٔ محلی`),detail:X.local_device.enabled?b(`The host will mediate local commands and events.`,`میزبان میانجی فرمان‌ها و رویدادهای محلی خواهد بود.`):b(`No local-device requests will be sent.`,`هیچ درخواستی برای وسیلهٔ محلی ارسال نمی‌شود.`)}),X.local_device.enabled&&(0,Y.jsx)(ve,{label:b(`Device root URL`,`نشانی ریشهٔ وسیله`),type:`url`,dir:`ltr`,spellCheck:!1,placeholder:`http://controller-device.local`,value:X.local_device.base_url??``,onInput:e=>{Q(``),Z(t=>({...t,local_device:{...t.local_device,base_url:k(e.currentTarget.value)}}))},onChange:e=>{Q(``),Z(t=>({...t,local_device:{...t.local_device,base_url:k(e.currentTarget.value)}}))},onBlur:()=>Qt.valid&&Z(e=>({...e,local_device:{...e.local_device,base_url:Qt.normalized}})),error:Qt.valid?void 0:C(Qt.error),success:Qt.valid&&Qt.normalized?b(`Validated: ${Qt.normalized}`,`تأیید شد: ${Qt.normalized}`):void 0})]}),(0,Y.jsxs)(`section`,{className:`integration-config-panel`,children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsx)(Ze,{size:19}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:b(`Data hub`,`مرکز داده`)}),(0,Y.jsx)(`small`,{children:X.data_hub.enabled?b(`Enabled`,`فعال`):b(`Disabled`,`غیرفعال`)})]})]}),(0,Y.jsx)(W,{checked:X.data_hub.enabled,onChange:e=>{Q(``),Z(t=>({...t,data_hub:{...t.data_hub,enabled:e}}))},label:b(`Enable data hub`,`فعال‌سازی مرکز داده`),detail:X.data_hub.enabled?b(`Authenticated data operations are routed through the host.`,`عملیات معتبر داده از طریق میزبان مسیریابی می‌شود.`):b(`No data-hub requests will be sent.`,`هیچ درخواستی برای مرکز داده ارسال نمی‌شود.`)}),X.data_hub.enabled&&(0,Y.jsx)(ve,{label:b(`Data-hub root URL`,`نشانی ریشهٔ مرکز داده`),type:`url`,dir:`ltr`,spellCheck:!1,placeholder:`http://127.0.0.1:8080`,value:X.data_hub.base_url??``,onInput:e=>{Q(``),Z(t=>({...t,data_hub:{...t.data_hub,base_url:k(e.currentTarget.value)}}))},onChange:e=>{Q(``),Z(t=>({...t,data_hub:{...t.data_hub,base_url:k(e.currentTarget.value)}}))},onBlur:()=>$t.valid&&Z(e=>({...e,data_hub:{...e.data_hub,base_url:$t.normalized}})),error:$t.valid?void 0:C($t.error),success:$t.valid&&$t.normalized?b(`Validated: ${$t.normalized}`,`تأیید شد: ${$t.normalized}`):void 0})]}),(0,Y.jsxs)(`section`,{className:`integration-config-panel integration-config-panel--wide`,children:[(0,Y.jsxs)(`header`,{children:[(0,Y.jsx)(E,{size:19}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:b(`Session and power safety`,`ایمنی نشست و توان`)}),(0,Y.jsx)(`small`,{children:X.lifecycle_safety.refresh_on_resume?b(`Automatic reconciliation`,`همگام‌سازی خودکار`):b(`Manual reconciliation`,`همگام‌سازی دستی`)})]})]}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:b(`When Windows locks`,`هنگام قفل‌شدن ویندوز`)}),(0,Y.jsx)(R,{value:X.lifecycle_safety.session_lock,label:b(`Session-lock safety action`,`عمل ایمنی هنگام قفل نشست`),options:pn,onChange:e=>{Q(``),Z(t=>({...t,lifecycle_safety:{...t.lifecycle_safety,session_lock:e}}))}})]}),(0,Y.jsxs)(`div`,{className:`setting-group`,children:[(0,Y.jsx)(`label`,{children:b(`Before system suspend`,`پیش از تعلیق سیستم`)}),(0,Y.jsx)(R,{value:X.lifecycle_safety.suspend,label:b(`Suspend safety action`,`عمل ایمنی هنگام تعلیق`),options:pn,onChange:e=>{Q(``),Z(t=>({...t,lifecycle_safety:{...t.lifecycle_safety,suspend:e}}))}})]}),(0,Y.jsx)(W,{checked:X.lifecycle_safety.refresh_on_resume,onChange:e=>{Q(``),Z(t=>({...t,lifecycle_safety:{...t.lifecycle_safety,refresh_on_resume:e}}))},label:b(`Reconcile after unlock, resume, and network changes`,`همگام‌سازی پس از بازشدن قفل، بازگشت و تغییر شبکه`),detail:X.lifecycle_safety.refresh_on_resume?b(t.connected?`The host will refresh live telemetry without forcing a reconnect.`:`The host will re-arm discovery while respecting a manually paused connection.`,t.connected?`میزبان بدون اتصال مجدد اجباری، تله‌متری زنده را تازه می‌کند.`:`میزبان با حفظ توقف دستی اتصال، کشف دستگاه را دوباره فعال می‌کند.`):b(`The current connection state will be preserved until you act.`,`وضعیت فعلی اتصال تا اقدام شما حفظ می‌شود.`)})]}),(0,Y.jsxs)(`footer`,{className:`local-integrations-form__footer`,children:[(0,Y.jsx)(`span`,{className:Bt===`Saved`?`text-good`:Bt?`text-warn`:``,children:Bt===`Saved`?b(`Host service and lifecycle settings saved.`,`تنظیمات سرویس و چرخهٔ میزبان ذخیره شد.`):Bt||(tn?b(`Review and save the current changes.`,`تغییرات فعلی را بازبینی و ذخیره کنید.`):b(`No pending changes.`,`تغییری در انتظار ذخیره نیست.`))}),(0,Y.jsx)(V,{type:`submit`,tone:`primary`,icon:E,busy:Ft,disabled:!tn||!en,children:b(`Save host settings`,`ذخیرهٔ تنظیمات میزبان`)})]})]})})]})]})}export{an as ControlsView,rn as DashboardView,un as EventsView,ln as LocalDeviceView,dn as SettingsView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-BWN4QWM7.js b/Tools/Controller/internal/webui/dist/assets/chunk-B5OrbcTy.js similarity index 89% rename from Tools/Controller/internal/webui/dist/assets/chunk-BWN4QWM7.js rename to Tools/Controller/internal/webui/dist/assets/chunk-B5OrbcTy.js index 19340241..70877104 100644 --- a/Tools/Controller/internal/webui/dist/assets/chunk-BWN4QWM7.js +++ b/Tools/Controller/internal/webui/dist/assets/chunk-B5OrbcTy.js @@ -1 +1 @@ -import{Dt as e}from"./app-BpGu_3eg.js";var t={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};t.node;var n=e(t),r={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};r.node;var i=e(r);export{n,i as t}; \ No newline at end of file +import{Pt as e}from"./app-BxYXetji.js";var t={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};t.node;var n=e(t),r={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};r.node;var i=e(r);export{n,i as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-BT8krml-.js b/Tools/Controller/internal/webui/dist/assets/chunk-BT8krml-.js new file mode 100644 index 00000000..589eb2c6 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-BT8krml-.js @@ -0,0 +1 @@ +import{Pt as e}from"./app-BxYXetji.js";var t={name:`binary`,size:24,node:[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]};t.node;var n=e(t),r={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};r.node;var i=e(r),a={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};a.node;var o=e(a),s={name:`usb`,size:24,node:[[`circle`,{cx:`10`,cy:`7`,r:`1`,key:`dypaad`}],[`circle`,{cx:`4`,cy:`20`,r:`1`,key:`22iqad`}],[`path`,{d:`M4.7 19.3 19 5`,key:`1enqfc`}],[`path`,{d:`m21 3-3 1 2 2Z`,key:`d3ov82`}],[`path`,{d:`M9.26 7.68 5 12l2 5`,key:`1esawj`}],[`path`,{d:`m10 14 5 2 3.5-3.5`,key:`v8oal5`}],[`path`,{d:`m18 12 1-1 1 1-1 1Z`,key:`1bh22v`}]]};s.node;var c=e(s);export{n as i,o as n,i as r,c as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-ME8Q1Sy7.js b/Tools/Controller/internal/webui/dist/assets/chunk-BgHNRN_V.js similarity index 96% rename from Tools/Controller/internal/webui/dist/assets/chunk-ME8Q1Sy7.js rename to Tools/Controller/internal/webui/dist/assets/chunk-BgHNRN_V.js index 64c9a07f..c592de7c 100644 --- a/Tools/Controller/internal/webui/dist/assets/chunk-ME8Q1Sy7.js +++ b/Tools/Controller/internal/webui/dist/assets/chunk-BgHNRN_V.js @@ -1 +1 @@ -import{Dt as e}from"./app-BpGu_3eg.js";var t={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};t.node;var n=e(t),r={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};r.node;var i=e(r),a={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};a.node;var o=e(a),s={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};s.node;var c=e(s),l={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};l.node;var u=e(l);export{n as a,i,c as n,o as r,u as t}; \ No newline at end of file +import{Pt as e}from"./app-BxYXetji.js";var t={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};t.node;var n=e(t),r={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};r.node;var i=e(r),a={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};a.node;var o=e(a),s={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};s.node;var c=e(s),l={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};l.node;var u=e(l);export{n as a,i,c as n,o as r,u as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-C2nxElbj.js b/Tools/Controller/internal/webui/dist/assets/chunk-C2nxElbj.js deleted file mode 100644 index a42eb6de..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-C2nxElbj.js +++ /dev/null @@ -1,3 +0,0 @@ -import{t as e}from"./chunk-B9ewCnSE.js";import{a as t,i as n,r}from"./chunk-ME8Q1Sy7.js";import{Ct as i,Dt as a,Mt as o,St as s,at as ee,bt as te,dt as c,it as ne,kt as l}from"./app-BpGu_3eg.js";var u={name:`arrow-down-a-z`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]],aliases:[`arrow-down-az`]};u.node;var re=a(u),d={name:`arrow-up-a-z`,size:24,node:[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]],aliases:[`arrow-up-az`]};d.node;var ie=a(d),ae={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ae.node;var oe=a(ae),f={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};f.node;var se=a(f),ce={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]};ce.node;var le=a(ce),p=o(l(),1),ue=88,de=520,fe=8,pe=500;function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return e===null?`null`:e===void 0?`Not set`:typeof e==`string`?e:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?Number.isNaN(e)?`NaN`:e===1/0?`+Infinity`:e===-1/0?`-Infinity`:Object.is(e,-0)?`-0`:e.toString():typeof e==`bigint`?`${e.toString()}n`:typeof e==`symbol`?e.description?`Symbol(${e.description})`:`Symbol`:typeof e==`function`?e.name?`Function(${e.name})`:`Function`:null}function g(e){try{return Object.keys(e)}catch{return null}}function me(e,t){try{return Reflect.get(e,t)}catch{return`[unreadable]`}}function _(e){let t=h(e);if(t!==null)return t;if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?e.toISOString():`Invalid date`}if(Array.isArray(e))return`Array · ${e.length} item${e.length===1?``:`s`}`;if(m(e)){let t=g(e);return t===null?`Unreadable object`:`Object · ${t.length} field${t.length===1?``:`s`}`}return`Unsupported value`}function v(e,t,n,r){let i=h(e);if(i!==null)return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e)?e:i;if(e instanceof Date)return _(e);if(typeof e!=`object`||!e)return`Unsupported value`;if(t.has(e))return`[circular]`;if(n>=fe)return`[depth limit]`;if(r.remaining<=0)return`[entry limit]`;let a=new Set(t);if(a.add(e),Array.isArray(e)){let t=[];for(let i of e){if(r.remaining<=0){t.push(`[entry limit]`);break}--r.remaining,t.push(v(i,a,n+1,r))}return t}let o=g(e);if(o===null)return`[unreadable object]`;let s=Object.create(null);for(let t of o){if(r.remaining<=0){s[`…`]=`[entry limit]`;break}--r.remaining,s[t]=v(me(e,t),a,n+1,r)}return s}function y(e){return v(e,new Set,0,{remaining:pe})}function b(e,t=!1){let n=y(e);try{return JSON.stringify(n,null,t?2:0)??`null`}catch{return`"[unserializable]"`}}function x(e){let t=h(e);return t===null?b(e):t}function S(e,t){try{if(e.get)return e.get(t);if(m(t))return me(t,e.id)}catch{return`[unreadable]`}}function C(e){return/metadata|details|message|description|reason|title/i.test(e)?260:/time|date|updated|created/i.test(e)?190:156}function he(e,t){return Number.isFinite(e)?Math.min(de,Math.max(ue,Math.round(e))):C(t)}function ge(e,t=[]){let n=new Set;for(let t of e){if(!m(t))continue;let e=g(t);if(e!==null)for(let t of e)n.add(t)}return[...t.filter(e=>n.delete(e)),...n].map(e=>({id:e,label:e.replaceAll(`_`,` `)}))}function w(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=new Set;for(let t of e){let e=n.get(t.id);r.push({...t,...e??{},id:t.id,label:e?.label?.trim()||t.label,visible:t.visible,width:t.width,sortable:e?.sortable??t.sortable}),i.add(t.id)}for(let e of t)e.id&&!i.has(e.id)&&(r.push({...e,label:e.label?.trim()||e.id.replaceAll(`_`,` `),visible:e.visible!==!1,width:he(e.width,e.id),sortable:e.sortable!==!1}),i.add(e.id));return r}function _e(e,t,n){return e===t?0:e==null?1:t==null?-1:typeof e==`number`&&typeof t==`number`?Number.isNaN(e)?+!Number.isNaN(t):Number.isNaN(t)?-1:e-t:typeof e==`boolean`&&typeof t==`boolean`?Number(e)-Number(t):n.compare(x(e),x(t))}function ve(e,t,n,r){if(n===null)return[...e];let i=t.find(e=>e.id===n.field);if(!i||i.sortable===!1)return[...e];let a=new Intl.Collator(r,{numeric:!0,sensitivity:`base`}),o=n.direction===`asc`?1:-1;return e.map((e,t)=>({entry:e,stableIndex:t})).sort((e,t)=>{let n=_e(S(i,e.entry.row),S(i,t.entry.row),a);return n===0?e.stableIndex-t.stableIndex:n*o}).map(({entry:e})=>e)}function ye(e,t,n,r){let i=n.trim().toLocaleLowerCase(r);return i?e.filter(({row:e})=>t.some(t=>x(S(t,e)).toLocaleLowerCase(r).includes(i))):[...e]}function T(e){if(e==null)return``;let t=h(e);return t===null?b(e):t}function E(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function be(e,t){return[t.map(e=>E(e.id)).join(`,`),...e.map(e=>t.map(t=>E(T(S(t,e)))).join(`,`))].join(`\r -`)}function xe(e){return b(e,!0)}function Se(e,t,n){return Math.max(0,e+n-t)}function Ce(e,t,n){return Math.max(0,Math.min(e,Math.max(0,t-n)))}function we(e){return e.key===`ContextMenu`||e.key===`Apps`||e.key===`F10`&&e.shiftKey}function Te(e,t,n,r,i,a=!1){let o=Math.max(0,r-1),s=Math.max(0,n-1);if(a&&t===`Home`)return{area:`header`,field:0,row:0};if(a&&t===`End`&&n>0)return{area:`row`,field:o,row:s};if(t===`Home`)return{...e,field:0};if(t===`End`)return{...e,field:o};if(t===`ArrowLeft`||t===`ArrowRight`){let n=t===`ArrowRight`?1:-1,r=i===`rtl`?-n:n;return{...e,field:Math.max(0,Math.min(o,e.field+r))}}if(t===`ArrowDown`)return n===0?e:e.area===`header`?{area:`row`,field:e.field,row:0}:{...e,row:Math.min(s,e.row+1)};if(t===`ArrowUp`){if(e.area===`row`&&e.row===0)return{area:`header`,field:e.field,row:0};if(e.area===`row`)return{...e,row:Math.max(0,e.row-1)}}return e}function Ee(e){return Math.min(de,Math.max(ue,Math.round(e)))}var D=ne(),De={search:`Filter records`,columns:`Columns`,export:`Export`,exportAllJSON:`All · JSON`,exportFilteredJSON:`Filtered · JSON`,exportAllCSV:`All · CSV`,exportFilteredCSV:`Filtered · CSV`,selected:`selected`,clearSelection:`Clear selection`,clearFilter:`Clear filter`,noRecords:`No records are available.`,noMatches:`No records match this filter.`,copyCell:`Copy cell`,copyRow:`Copy row as JSON`,copyColumn:`Copy filtered column`,selectRow:`Select row`,deselectRow:`Deselect row`,sortAscending:`Sort ascending`,sortDescending:`Sort descending`,hideColumn:`Hide column`,showColumn:`Show column`,moveEarlier:`Move earlier`,moveLater:`Move later`,columnActions:`Column actions`,reorderColumn:`Reorder column`,resizeColumn:`Resize column`,previousWindow:`Previous rows`,nextWindow:`Next rows`,showing:`Showing`,of:`of`,copied:`Copied to clipboard`,copyUnavailable:`Clipboard unavailable`,filtered:`filtered`,all:`all`,structuredValue:`Structured value`},Oe={search:`فیلتر رکوردها`,columns:`ستون‌ها`,export:`خروجی`,exportAllJSON:`همه · JSON`,exportFilteredJSON:`فیلترشده · JSON`,exportAllCSV:`همه · CSV`,exportFilteredCSV:`فیلترشده · CSV`,selected:`انتخاب‌شده`,clearSelection:`پاک‌کردن انتخاب`,clearFilter:`پاک‌کردن فیلتر`,noRecords:`رکوردی در دسترس نیست.`,noMatches:`هیچ رکوردی با این فیلتر هم‌خوانی ندارد.`,copyCell:`کپی سلول`,copyRow:`کپی رکورد به‌صورت JSON`,copyColumn:`کپی ستون فیلترشده`,selectRow:`انتخاب ردیف`,deselectRow:`برداشتن انتخاب ردیف`,sortAscending:`مرتب‌سازی صعودی`,sortDescending:`مرتب‌سازی نزولی`,hideColumn:`پنهان‌کردن ستون`,showColumn:`نمایش ستون`,moveEarlier:`انتقال به قبل`,moveLater:`انتقال به بعد`,columnActions:`اقدام‌های ستون`,reorderColumn:`جابجایی ستون`,resizeColumn:`تغییر عرض ستون`,previousWindow:`ردیف‌های قبلی`,nextWindow:`ردیف‌های بعدی`,showing:`نمایش`,of:`از`,copied:`در کلیپ‌بورد کپی شد`,copyUnavailable:`کلیپ‌بورد در دسترس نیست`,filtered:`فیلترشده`,all:`همه`,structuredValue:`مقدار ساخت‌یافته`},ke=[];function O(e){return typeof e==`object`&&!!e}function k(e){return Array.isArray(e)?`Array · ${e.length}`:typeof e==`object`&&e?`Object · ${Object.keys(e).length}`:e===null?`null`:typeof e==`string`?e:typeof e==`number`?e.toString():typeof e==`boolean`?e?`true`:`false`:`Not set`}function A({value:e,depth:t}){if(Array.isArray(e))return e.length?(0,D.jsx)(`ol`,{className:`structured-value__array`,children:e.map((e,n)=>(0,D.jsx)(`li`,{children:(0,D.jsx)(A,{value:e,depth:t+1})},n))}):(0,D.jsx)(`span`,{className:`structured-value__empty`,children:`[]`});if(typeof e==`object`&&e){let n=Object.entries(e);return n.length?(0,D.jsx)(`dl`,{className:`structured-value__object`,children:n.map(([e,n])=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:e}),(0,D.jsx)(`dd`,{children:(0,D.jsx)(A,{value:n,depth:t+1})})]},e))}):(0,D.jsx)(`span`,{className:`structured-value__empty`,children:`{}`})}return(0,D.jsx)(`span`,{className:`structured-value__scalar`,dir:`auto`,children:k(e)})}function Ae({value:e,label:t}){return O(e)?(0,D.jsxs)(`details`,{className:`structured-value`,children:[(0,D.jsx)(`summary`,{"aria-label":t,children:_(e)}),(0,D.jsx)(`div`,{className:`structured-value__content`,dir:`auto`,children:(0,D.jsx)(A,{value:y(e),depth:0})})]}):(0,D.jsx)(`span`,{className:`structured-value__scalar`,dir:`auto`,children:_(e)})}function j(e,t,n){if(n)try{let r=n(e,t).trim();if(r)return r}catch{}if(typeof e==`object`&&e)for(let t of[`id`,`code`,`key`]){let n;try{n=Reflect.get(e,t)}catch{n=void 0}if(typeof n==`string`&&n)return`${t}:${n}`;if(typeof n==`number`&&Number.isFinite(n))return`${t}:${n.toString()}`}return`row:${t}`}function je(e,t){let n=new Map;return e.map((e,r)=>{let i=j(e,r,t),a=n.get(i)??0;return n.set(i,a+1),{key:a===0?i:`${i}#${a}`,row:e,sourceIndex:r}})}function Me(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.id===r.id&&e.label===r.label&&e.get===r.get&&e.visible===r.visible&&e.width===r.width&&e.sortable===r.sortable})}async function Ne(e){try{let t=globalThis.navigator?.clipboard;return!t||typeof t.writeText!=`function`?!1:(await t.writeText(e),!0)}catch{return!1}}function Pe(e){return e.trim().replace(/[^a-z0-9._-]+/gi,`-`).replace(/^-+|-+$/g,``)||`records`}function Fe(e,t=!1){return O(e)?b(e,t):_(e)}function Ie(e,t,n){if(typeof document>`u`||typeof URL.createObjectURL!=`function`)return;let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.hidden=!0,document.body.append(i),i.click(),i.remove(),globalThis.setTimeout(()=>URL.revokeObjectURL(r),0)}function Le({records:a,fields:o,preferredFields:ne=ke,locale:l,direction:u=l.toLowerCase().startsWith(`fa`)?`rtl`:`ltr`,ariaLabel:d,labels:ae,rowKey:f,rowClassName:ce,renderCell:ue,windowSize:de=120,toolbar:fe=!0,filename:pe=`records`,initialSort:m=null,preserveViewportAnchor:h=!1,className:g=``,empty:me}){let _={...l.toLowerCase().startsWith(`fa`)?Oe:De,...ae},v=(0,p.useId)().replaceAll(`:`,``),y=Math.max(20,Math.min(200,Math.round(de))),x=(0,p.useMemo)(()=>o?[]:ge(a,ne),[a,ne,o]),C=o??x,[he,_e]=(0,p.useState)(()=>w([],C)),T=(0,p.useMemo)(()=>w(he,C),[C,he]);(0,p.useEffect)(()=>{_e(e=>{let t=w(e,C);return Me(e,t)?e:t})},[C]);let E=(0,p.useMemo)(()=>{let e=T.filter(e=>e.visible);return e.length?e:T.slice(0,1)},[T]),O=(0,p.useMemo)(()=>je(a,f),[a,f]),[k,A]=(0,p.useState)(``),[j,Le]=(0,p.useState)(m),[M,N]=(0,p.useState)(()=>new Set),[Re,P]=(0,p.useState)(0),[F,I]=(0,p.useState)({area:`header`,field:0,row:0}),[L,R]=(0,p.useState)(null),[ze,Be]=(0,p.useState)(``),[z,B]=(0,p.useState)(null),V=(0,p.useRef)(null),H=(0,p.useRef)(null),Ve=(0,p.useRef)(null),He=(0,p.useMemo)(()=>ve(O,T,j,l),[T,O,l,j]),U=(0,p.useMemo)(()=>ye(He,T,k,l),[He,T,l,k]),W=Math.max(0,Math.floor(Math.max(0,U.length-1)/y)*y),G=Math.min(Re,W),Ue=U.slice(G,G+y),We=G+Ue.length;(0,p.useEffect)(()=>P(0),[k,j?.direction,j?.field]),(0,p.useEffect)(()=>{Re>W&&P(W)},[W,Re]),(0,p.useEffect)(()=>{I(e=>{let t=Math.max(0,Math.min(Math.max(0,E.length-1),e.field));return e.area===`header`||U.length===0?{area:`header`,field:t,row:0}:{area:`row`,field:t,row:Math.min(U.length-1,e.row)}})},[U.length,E.length]),(0,p.useEffect)(()=>{let e=new Set(O.map(e=>e.key));N(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})},[O]);let K=()=>{if(!h)return;let e=V.current;if(!e)return;let t=e.getBoundingClientRect(),n=[...e.querySelectorAll(`[data-collection-row-key]`)],r=n.find(e=>e.getBoundingClientRect().bottom>t.top+1)??n[0];r&&(Ve.current={key:r.dataset.collectionRowKey??``,offset:r.getBoundingClientRect().top-t.top,scrollTop:e.scrollTop,nearStart:e.scrollTop<=4})};(0,p.useLayoutEffect)(()=>{if(!h)return;let e=V.current,t=Ve.current;if(!e||!t)K();else{if(t.nearStart)e.scrollTop=0;else{let n=typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(t.key):t.key.replace(/["\\]/g,`\\$&`),r=e.querySelector(`[data-collection-row-key="${n}"]`);if(r){let n=r.getBoundingClientRect().top-e.getBoundingClientRect().top;e.scrollTop=Se(e.scrollTop,t.offset,n)}else e.scrollTop=Ce(t.scrollTop,e.scrollHeight,e.clientHeight)}K()}},[U,h]),(0,p.useEffect)(()=>{if(!L)return;let e=e=>{H.current?.contains(e.target)||R(null)},t=e=>{e.key===`Escape`&&R(null)},n=e=>{H.current?.contains(e.target)||R(null)},r=()=>R(null);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),document.addEventListener(`focusin`,n),globalThis.addEventListener(`blur`,r),H.current?.querySelector(`button`)?.focus(),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t),document.removeEventListener(`focusin`,n),globalThis.removeEventListener(`blur`,r)}},[L]),(0,p.useLayoutEffect)(()=>{if(!L||!H.current)return;let e=H.current.getBoundingClientRect(),t=globalThis.visualViewport,n=t?.width??globalThis.innerWidth,r=t?.height??globalThis.innerHeight,i=Math.round(Math.max(8,Math.min(L.left,n-e.width-8))),a=Math.round(Math.max(8,Math.min(L.top,r-e.height-8)));(i!==L.left||a!==L.top)&&R(e=>e&&{...e,left:i,top:a})},[L]);let q=e=>{_e(t=>e(w(t,C)))},Ge=(e,t)=>q(n=>n.map(n=>n.id===e?{...n,width:Ee(t)}:n)),Ke=(e,t)=>q(n=>n.map(n=>n.id===e?{...n,visible:t}:n)),qe=(e,t)=>q(n=>{let r=n.findIndex(t=>t.id===e),i=Math.max(0,Math.min(n.length-1,r+t));if(r<0||r===i)return n;let a=[...n],[o]=a.splice(r,1);return a.splice(i,0,o),a}),J=(e,t)=>q(n=>{let r=n.findIndex(t=>t.id===e),i=n.findIndex(e=>e.id===t);if(r<0||i<0||r===i)return n;let a=[...n],[o]=a.splice(r,1);return a.splice(i,0,o),a}),Je=e=>N(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Ye=async e=>{let t=await Ne(e);Be(t?_.copied:_.copyUnavailable)},Xe=(e,t)=>{e.sortable&&Le({field:e.id,direction:t}),R(null)},Ze=e=>{e.sortable&&Le(t=>t?.field===e.id?{field:e.id,direction:t.direction===`asc`?`desc`:`asc`}:{field:e.id,direction:`asc`})},Y=(e,t,n,r,i)=>{let a=r.getBoundingClientRect(),o=globalThis.innerWidth||1024,s=globalThis.innerHeight||768,ee=Math.max(8,Math.min(i?.left??a.left,o-226)),te=Math.max(8,Math.min(i?.top??a.bottom+4,s-280));R({kind:e,field:t,row:n,left:ee,top:te})},X=e=>`${v}-${e.area}-${e.row}-${e.field}`,Qe=e=>{I(e),e.area===`row`&&(e.row=We)&&P(Math.floor(e.row/y)*y),globalThis.requestAnimationFrame?.(()=>{V.current?.querySelector(`[data-focus-token="${X(e)}"]`)?.focus()})},$e=(e,t)=>{if(we(e)){e.preventDefault(),Y(t.area,t.field,t.row,e.currentTarget);return}if(t.area===`row`&&e.key===` `){e.preventDefault();let n=U[t.row];n&&Je(n.key);return}if(t.area===`row`&&e.key===`Enter`){let t=e.currentTarget.querySelector(`summary`);t&&(e.preventDefault(),t.click());return}let n=Te(t,e.key,U.length,E.length,u,e.ctrlKey||e.metaKey);(n.area!==t.area||n.field!==t.field||n.row!==t.row)&&(e.preventDefault(),Qe(n))},et=(e,t)=>{t.preventDefault();let n=t.clientX,r=e.width,i=u===`rtl`?-1:1,a=t=>Ge(e.id,r+(t.clientX-n)*i),o=()=>{globalThis.removeEventListener(`pointermove`,a),globalThis.removeEventListener(`pointerup`,o),globalThis.removeEventListener(`pointercancel`,o)};globalThis.addEventListener(`pointermove`,a),globalThis.addEventListener(`pointerup`,o),globalThis.addEventListener(`pointercancel`,o)},Z=(e,t)=>{let n=(e===`all`?He:U).map(e=>e.row),r=t===`json`?xe(n):be(n,T),i=e===`all`?`all`:`filtered`;Ie(`${Pe(pe)}-${i}.${t}`,r,t===`json`?`application/json;charset=utf-8`:`text/csv;charset=utf-8`)},Q=L?E[L.field]:void 0,$=L?.kind===`row`?U[L.row]:void 0,tt=T.filter(e=>e.visible).length;return(0,D.jsxs)(`section`,{className:`typed-collection ${g}`.trim(),dir:u,"aria-label":d,children:[fe&&(0,D.jsxs)(`div`,{className:`typed-collection__toolbar`,children:[(0,D.jsxs)(`label`,{className:`typed-collection__search`,children:[(0,D.jsx)(c,{size:16,"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:`sr-only`,children:_.search}),(0,D.jsx)(`input`,{value:k,placeholder:_.search,onChange:e=>A(e.target.value)}),k&&(0,D.jsx)(`button`,{type:`button`,"aria-label":_.clearFilter,onClick:()=>A(``),children:(0,D.jsx)(ee,{size:14})})]}),(0,D.jsxs)(`div`,{className:`typed-collection__summary`,"aria-live":`polite`,children:[(0,D.jsx)(`strong`,{children:U.length}),(0,D.jsx)(`span`,{children:k?_.filtered:_.all}),M.size>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`i`,{"aria-hidden":`true`}),(0,D.jsx)(`strong`,{children:M.size}),(0,D.jsx)(`span`,{children:_.selected})]})]}),M.size>0&&(0,D.jsx)(`button`,{type:`button`,className:`typed-collection__quiet-action`,onClick:()=>N(new Set),children:_.clearSelection}),(0,D.jsxs)(`details`,{className:`typed-collection__popover typed-collection__columns`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(e.currentTarget.open=!1)},children:[(0,D.jsxs)(`summary`,{children:[(0,D.jsx)(le,{size:16}),_.columns]}),(0,D.jsx)(`div`,{className:`typed-collection__popover-panel`,role:`group`,"aria-label":_.columns,children:T.map(e=>(0,D.jsxs)(`div`,{className:`typed-collection__column-option`,onDragOver:t=>{z&&z!==e.id&&t.preventDefault()},onDrop:t=>{t.preventDefault();let n=z??t.dataTransfer.getData(`text/plain`);n&&J(n,e.id),B(null)},children:[(0,D.jsxs)(`label`,{children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:e.visible,disabled:e.visible&&tt<=1,onChange:t=>Ke(e.id,t.target.checked)}),e.visible?(0,D.jsx)(n,{size:14}):(0,D.jsx)(t,{size:14}),(0,D.jsx)(`span`,{children:e.label})]}),(0,D.jsx)(`button`,{type:`button`,className:`typed-collection__column-drag`,draggable:!0,"aria-label":`${_.reorderColumn}: ${e.label}`,onDragStart:t=>{B(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id)},onDragEnd:()=>B(null),onKeyDown:t=>{(t.key===`ArrowUp`||t.key===`ArrowDown`)&&(t.preventDefault(),qe(e.id,t.key===`ArrowUp`?-1:1))},disabled:T.length<2,children:(0,D.jsx)(r,{size:15})})]},e.id))})]}),(0,D.jsxs)(`details`,{className:`typed-collection__popover typed-collection__export`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(e.currentTarget.open=!1)},children:[(0,D.jsxs)(`summary`,{children:[(0,D.jsx)(e,{size:16}),_.export]}),(0,D.jsxs)(`div`,{className:`typed-collection__popover-panel`,role:`group`,"aria-label":_.export,children:[(0,D.jsx)(`button`,{type:`button`,onClick:()=>Z(`all`,`json`),children:_.exportAllJSON}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>Z(`filtered`,`json`),children:_.exportFilteredJSON}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>Z(`all`,`csv`),children:_.exportAllCSV}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>Z(`filtered`,`csv`),children:_.exportFilteredCSV})]})]})]}),!T.length||!a.length?me??(0,D.jsx)(`p`,{className:`typed-collection__empty`,children:_.noRecords}):U.length?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`typed-collection__viewport`,ref:V,onScroll:K,children:(0,D.jsxs)(`table`,{className:`typed-collection__grid`,role:`grid`,"aria-label":d,"aria-multiselectable":`true`,"aria-rowcount":U.length+1,"aria-colcount":E.length+1,children:[(0,D.jsxs)(`colgroup`,{children:[(0,D.jsx)(`col`,{className:`typed-collection__select-column`}),E.map(e=>(0,D.jsx)(`col`,{style:{width:e.width}},e.id))]}),(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{role:`row`,"aria-rowindex":1,children:[(0,D.jsx)(`th`,{className:`typed-collection__select`,scope:`col`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:_.selected})}),E.map((e,t)=>{let n={area:`header`,field:t,row:0},i=j?.field===e.id?j.direction:null;return(0,D.jsxs)(`th`,{scope:`col`,role:`columnheader`,"aria-colindex":t+2,"aria-sort":i===`asc`?`ascending`:i===`desc`?`descending`:`none`,"aria-haspopup":`menu`,tabIndex:F.area===`header`&&F.field===t?0:-1,"data-focus-token":X(n),style:{"--collection-column-width":`${e.width}px`},onFocus:()=>I(n),onKeyDown:e=>$e(e,n),onContextMenu:e=>{e.preventDefault(),Y(`header`,t,0,e.currentTarget,{left:e.clientX,top:e.clientY})},onDragOver:t=>{z&&z!==e.id&&t.preventDefault()},onDrop:t=>{t.preventDefault();let n=z??t.dataTransfer.getData(`text/plain`);n&&J(n,e.id),B(null)},onDragEnd:()=>B(null),children:[(0,D.jsxs)(`button`,{type:`button`,className:`typed-collection__sort`,tabIndex:-1,disabled:!e.sortable,onClick:()=>Ze(e),children:[(0,D.jsx)(`span`,{children:e.label}),i===`asc`?(0,D.jsx)(re,{size:14}):i===`desc`?(0,D.jsx)(ie,{size:14}):(0,D.jsx)(`span`,{className:`typed-collection__sort-placeholder`,"aria-hidden":`true`})]}),(0,D.jsxs)(`span`,{className:`typed-collection__header-actions`,children:[(0,D.jsx)(`button`,{type:`button`,className:`typed-collection__header-menu`,tabIndex:-1,"aria-label":`${_.columnActions}: ${e.label}`,"aria-haspopup":`menu`,onClick:e=>Y(`header`,t,0,e.currentTarget),children:(0,D.jsx)(te,{size:14})}),(0,D.jsx)(`button`,{type:`button`,className:`typed-collection__reorder`,tabIndex:-1,draggable:!0,"aria-label":`${_.reorderColumn}: ${e.label}`,onDragStart:t=>{B(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id)},onDragEnd:()=>B(null),children:(0,D.jsx)(r,{size:13})})]}),(0,D.jsx)(`button`,{type:`button`,className:`typed-collection__resize`,tabIndex:-1,"aria-label":`${_.resizeColumn}: ${e.label}`,onPointerDown:t=>et(e,t),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?12:-12;Ge(e.id,e.width+(u===`rtl`?-n:n))},children:(0,D.jsx)(r,{size:13})})]},e.id)})]})}),(0,D.jsx)(`tbody`,{children:Ue.map((e,t)=>{let n=G+t,r=M.has(e.key);return(0,D.jsxs)(`tr`,{role:`row`,"aria-rowindex":n+2,"aria-selected":r,"data-collection-row-key":e.key,className:ce?.(e.row),children:[(0,D.jsx)(`td`,{className:`typed-collection__select`,role:`gridcell`,"aria-colindex":1,children:(0,D.jsxs)(`label`,{children:[(0,D.jsx)(`input`,{type:`checkbox`,tabIndex:-1,checked:r,onChange:()=>Je(e.key)}),(0,D.jsx)(`span`,{className:`sr-only`,children:r?_.deselectRow:_.selectRow}),r&&(0,D.jsx)(i,{size:13,"aria-hidden":`true`})]})}),E.map((t,r)=>{let i=S(t,e.row),a=ue?.(t,i,e.row),o={area:`row`,field:r,row:n};return(0,D.jsx)(`td`,{role:`gridcell`,"aria-colindex":r+2,"aria-haspopup":`menu`,tabIndex:F.area===`row`&&F.row===n&&F.field===r?0:-1,"data-focus-token":X(o),onFocus:()=>I(o),onKeyDown:e=>$e(e,o),onContextMenu:e=>{e.preventDefault(),Y(`row`,r,n,e.currentTarget,{left:e.clientX,top:e.clientY})},children:a===void 0?(0,D.jsx)(Ae,{value:i,label:`${_.structuredValue}: ${t.label}`}):a},t.id)})]},e.key)})})]})}),U.length>y&&(0,D.jsxs)(`nav`,{className:`typed-collection__window-nav`,"aria-label":`${d} · ${_.showing}`,children:[(0,D.jsxs)(`button`,{type:`button`,disabled:G===0,onClick:()=>P(Math.max(0,G-y)),children:[(0,D.jsx)(oe,{size:15}),_.previousWindow]}),(0,D.jsxs)(`span`,{children:[_.showing,` `,(0,D.jsxs)(`strong`,{children:[G+1,`–`,We]}),` `,_.of,` `,(0,D.jsx)(`strong`,{children:U.length})]}),(0,D.jsxs)(`button`,{type:`button`,disabled:We>=U.length,onClick:()=>P(Math.min(W,G+y)),children:[_.nextWindow,(0,D.jsx)(s,{size:15})]})]})]}):(0,D.jsxs)(`div`,{className:`typed-collection__empty`,children:[(0,D.jsx)(c,{size:21}),(0,D.jsx)(`p`,{children:_.noMatches}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>A(``),children:_.clearFilter})]}),(0,D.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:ze}),L&&Q&&(0,D.jsx)(`div`,{ref:H,className:`typed-collection__context-menu`,role:`menu`,"aria-label":L.kind===`header`?Q.label:`${Q.label} · ${L.row+1}`,style:{left:L.left,top:L.top},onKeyDown:e=>{let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)],n=t.indexOf(document.activeElement);(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),t[(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())},children:L.kind===`header`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!Q.sortable,onClick:()=>Xe(Q,`asc`),children:[(0,D.jsx)(re,{size:15}),_.sortAscending]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!Q.sortable,onClick:()=>Xe(Q,`desc`),children:[(0,D.jsx)(ie,{size:15}),_.sortDescending]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:L.field===0,onClick:()=>{J(Q.id,E[L.field-1].id),R(null)},children:[u===`rtl`?(0,D.jsx)(s,{size:15}):(0,D.jsx)(oe,{size:15}),_.moveEarlier]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:L.field===E.length-1,onClick:()=>{J(Q.id,E[L.field+1].id),R(null)},children:[u===`rtl`?(0,D.jsx)(oe,{size:15}):(0,D.jsx)(s,{size:15}),_.moveLater]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Ye(U.map(e=>Fe(S(Q,e.row))).join(` -`)),R(null)},children:[(0,D.jsx)(se,{size:15}),_.copyColumn]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:tt<=1,onClick:()=>{Ke(Q.id,!1),R(null)},children:[(0,D.jsx)(t,{size:15}),_.hideColumn]})]}):$?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Ye(Fe(S(Q,$.row),!0)),R(null)},children:[(0,D.jsx)(se,{size:15}),_.copyCell]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Ye(b($.row,!0)),R(null)},children:[(0,D.jsx)(se,{size:15}),_.copyRow]}),(0,D.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":M.has($.key),onClick:()=>{Je($.key),R(null)},children:[(0,D.jsx)(i,{size:15}),M.has($.key)?_.deselectRow:_.selectRow]}),M.size>0&&(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{N(new Set),R(null)},children:[(0,D.jsx)(ee,{size:15}),_.clearSelection]}),k&&(0,D.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{A(``),R(null)},children:[(0,D.jsx)(c,{size:15}),_.clearFilter]})]}):null})]})}export{Le as n,b as r,Ae as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-CqZLUILw.js b/Tools/Controller/internal/webui/dist/assets/chunk-CqZLUILw.js new file mode 100644 index 00000000..ba8858ab --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-CqZLUILw.js @@ -0,0 +1 @@ +import{n as e,r as t,t as n}from"./chunk-D02q3HLn.js";import{i as r,n as i,r as a,t as o}from"./chunk-BT8krml-.js";import{t as s}from"./chunk-DDsZ2KKt.js";import{t as c}from"./chunk-GmnEjCp4.js";import{t as l}from"./chunk-D1EF5rbN.js";import{n as u,t as d}from"./chunk-B5OrbcTy.js";import{D as f,Et as p,It as m,J as h,M as g,N as _,Ot as ee,Pt as v,X as y,Y as b,Z as te,dt as x,ht as ne,it as re,j as ie,jt as ae,k as S,n as oe,ot as C,r as w,st as T,x as se,xt as ce,zt as E}from"./app-BxYXetji.js";var D={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};D.node;var le=v(D),O={name:`clock-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]};O.node;var ue=v(O),k={name:`cloud-download`,size:24,node:[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]],aliases:[`download-cloud`]};k.node;var de=v(k),fe={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};fe.node;var pe=v(fe),A={name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]};A.node;var j=v(A),M={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};M.node;var me=v(M),N={name:`file-up`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]};N.node;var P=v(N),F={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};F.node;var he=v(F),I={name:`package-check`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]};I.node;var ge=v(I),L={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};L.node;var R=v(L),z=E(m(),1);function _e(e,t){return g(`controller.discovery.github.workflow`,e,t)}function B(e,t){return g(`controller.discovery.github.release`,e,t)}function ve(e,t,n){return g(`controller.discovery.manifest`,{url:e,...t?{bearer_token:t}:{}},n)}function V(e,t,n){return g(`controller.discovery.check`,{current:e??{},kind:t.kind,platform:t.platform??``,candidates:[t]},n)}function ye(e,t,n){let r=`stage:${e.id}:${e.sha256||e.archive_sha256||`unhashed`}`;return g(`controller.discovery.stage`,{candidate:e,idempotency_key:r,...t?{bearer_token:t}:{}},n)}function be(e,t){return g(`controller.discovery.status`,e?{id:e}:{},t)}function xe(){let e=typeof navigator>`u`?void 0:navigator,t=`${e?.userAgent??``} ${e?.platform??``}`.toLowerCase();return`${t.includes(`win`)?`windows`:t.includes(`mac`)?`darwin`:`linux`}/${t.includes(`arm64`)||t.includes(`aarch64`)?`arm64`:`amd64`}`}var H=x(),Se=[`firmware`,`eeprom`,`flash-backup`,`host-executable`];function Ce(e,t){if(e=e.trim(),!e)return;let n=Number.parseInt(e.replace(/^0x/i,``),e.toLowerCase().startsWith(`0x`)?16:10);if(!Number.isSafeInteger(n)||n<0||n>4294967295)throw Error(t);return n}function we(e,t){if(e)return t===`host-executable`?e.current.host:t===`eeprom`?e.current.eeprom:t===`flash-backup`?e.current.flash_readback:e.current.firmware}function Te(e,t){return e?e.slice(0,12).toUpperCase():t}function Ee({manifest:t,events:n,locale:r,openDialog:i,onArtifactsChanged:o}){let c=(e,t)=>r===`fa`?t:e,l=e=>({firmware:c(`Board firmware`,`میان‌افزار برد`),eeprom:c(`Board EEPROM`,`EEPROM برد`),"flash-backup":c(`Flash backup`,`پشتیبان فلش`),"host-executable":c(`Host executable`,`فایل اجرایی میزبان`)})[e],[d,f]=(0,z.useState)(`release`),[p,m]=(0,z.useState)(`firmware`),[g,_]=(0,z.useState)(``),[ee,v]=(0,z.useState)(`main`),[x,ne]=(0,z.useState)(`Build`),[re,ie]=(0,z.useState)(``),[S,oe]=(0,z.useState)(``),[se,E]=(0,z.useState)(``),[D,le]=(0,z.useState)(()=>xe()),[O,ue]=(0,z.useState)(``),[k,fe]=(0,z.useState)(``),[pe,A]=(0,z.useState)(``),[j,M]=(0,z.useState)(null),[me,N]=(0,z.useState)(``),[P,F]=(0,z.useState)(null),[I,ge]=(0,z.useState)(null),[L,R]=(0,z.useState)(``),[Ee,U]=(0,z.useState)(``),W=j?.candidates.find(e=>e.id===me),De=(0,z.useMemo)(()=>n.find(e=>e.kind.startsWith(`artifact.discovery.`)),[n]),G=e=>{ge(e),e.state===`failed`?U(e.error||e.detail||c(`Candidate staging failed.`,`آماده‌سازی گزینهٔ انتخابی ناموفق بود.`)):e.state===`completed`&&(fe(``),o())};(0,z.useEffect)(()=>{I?.id&&De&&be(I.id).then(G).catch(e=>{U(e instanceof Error?e.message:String(e))})},[De?.id,De?.time]),(0,z.useEffect)(()=>{F(null),W&&V(we(t,W.kind),W).then(F).catch(e=>{U(e instanceof Error?e.message:String(e))})},[me,t]);let Oe=async e=>{e.preventDefault(),R(`discover`),U(``);try{let e=Ce(O,c(`Packed timestamp must be a 32-bit decimal or 0x-prefixed hexadecimal value.`,`مهر زمانی فشرده باید یک عدد ده‌دهی ۳۲ بیتی یا مقدار شانزده‌شانزدهی با پیشوند 0x باشد.`)),t=k?{bearer_token:k}:{},n=d===`manifest`?await ve(S.trim(),k):d===`workflow`?await _e({repository:g.trim(),branch:ee.trim(),workflow:x.trim(),kind:p,platform:p===`host-executable`?D.trim():void 0,api_base_url:se.trim()||void 0,packed_timestamp:e,...t}):await B({repository:g.trim(),tag:re.trim()||void 0,kind:p,platform:p===`host-executable`?D.trim():void 0,api_base_url:se.trim()||void 0,packed_timestamp:e,...t});M(n),N(n.candidates[0]?.id??``),U(c(`${n.candidates.length} verified metadata candidate${n.candidates.length===1?``:`s`} discovered. No file was downloaded.`,`${n.candidates.length} گزینه با فرادادهٔ تأییدشده پیدا شد. هیچ فایلی دانلود نشده است.`))}catch(e){U(e instanceof Error?e.message:String(e))}finally{R(``)}},ke=e=>i({title:c(`Download and stage this candidate?`,`این گزینه دانلود و آماده شود؟`),body:`${e.name}\n${e.repository||e.url}\n${e.archive_sha256||e.sha256||c(`No provider digest; the content-addressed store will still calculate SHA-256.`,`ارائه‌دهنده چکیده‌ای نداده است؛ مخزن محتوامحور همچنان SHA-256 را محاسبه می‌کند.`)}\n\n${c(`This downloads through the primary host, safely selects a ZIP member when needed, verifies all available size/digest metadata, and stages it. It does not open or program the board.`,`فایل از طریق میزبان اصلی دانلود می‌شود، در صورت نیاز عضو مناسب ZIP با ایمنی انتخاب می‌گردد، همهٔ فراداده‌های موجودِ اندازه و چکیده بررسی و سپس آماده می‌شود. این کار برد را باز یا پروگرام نمی‌کند.`)}`,confirmLabel:c(`Download and stage only`,`فقط دانلود و آماده‌سازی`),action:async()=>{R(`stage`);try{let t=await ye(pe.trim()?{...e,archive_path:pe.trim()}:e,k);G(t.operation),U(c(`Verified download queued. Programming still requires a separate update authorization.`,`دانلود تأییدشده در صف قرار گرفت. پروگرام همچنان به مجوز جداگانهٔ به‌روزرسانی نیاز دارد.`))}catch(e){throw U(e instanceof Error?e.message:String(e)),e}finally{R(``)}}});return(0,H.jsxs)(b,{icon:e,iconTone:`violet`,title:c(`Release & workflow discovery`,`کشف انتشار و گردش‌کار`),eyebrow:`${d===`release`?c(`Release`,`انتشار`):d===`workflow`?c(`Workflow`,`گردش‌کار`):c(`Manifest`,`مانیفست`)} · ${c(`proxy aware`,`سازگار با پراکسی`)}`,className:`release-discovery-card`,action:(0,H.jsx)(C,{tone:I?.state===`failed`?`bad`:I?.state===`completed`?`good`:I?`info`:`neutral`,children:I?.state?.toUpperCase()||c(`READY`,`آماده`)}),children:[(0,H.jsx)(`p`,{className:`card-copy`,children:c(`Discover build artifacts without hardcoded product names. Provider metadata, release checksums, hashes, packed timestamps and platform are preserved into the content-addressed inventory.`,`خروجی‌های ساخت بدون نام محصولِ ثابت کشف می‌شوند. فرادادهٔ ارائه‌دهنده، چک‌سام انتشار، هش، مهر زمانی فشرده و پلتفرم در فهرست محتوامحور حفظ می‌شود.`)}),(0,H.jsxs)(`form`,{className:`release-discovery-form`,onSubmit:e=>void Oe(e),children:[(0,H.jsxs)(`div`,{className:`discovery-source-picker`,children:[(0,H.jsxs)(`button`,{type:`button`,className:d===`release`?`is-active`:``,onClick:()=>f(`release`),children:[(0,H.jsx)(he,{}),c(`GitHub release`,`انتشار GitHub`)]}),(0,H.jsxs)(`button`,{type:`button`,className:d===`workflow`?`is-active`:``,onClick:()=>f(`workflow`),children:[(0,H.jsx)(he,{}),c(`Workflow artifact`,`خروجی گردش‌کار`)]}),(0,H.jsxs)(`button`,{type:`button`,className:d===`manifest`?`is-active`:``,onClick:()=>f(`manifest`),children:[(0,H.jsx)(e,{}),c(`HTTP manifest`,`مانیفست HTTP`)]})]}),d===`manifest`?(0,H.jsx)(T,{label:c(`Manifest URL`,`نشانی مانیفست`),type:`url`,dir:`ltr`,value:S,placeholder:`https://host.example/update-manifest.json`,onChange:e=>oe(e.target.value)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`compact-fields`,children:[(0,H.jsx)(T,{label:c(`Repository`,`مخزن`),dir:`ltr`,value:g,placeholder:`owner/repository`,onChange:e=>_(e.target.value)}),d===`workflow`?(0,H.jsx)(T,{label:c(`Branch`,`شاخه`),dir:`ltr`,value:ee,onChange:e=>v(e.target.value)}):(0,H.jsx)(T,{label:c(`Tag (blank = latest stable)`,`برچسب (خالی = آخرین نسخهٔ پایدار)`),dir:`ltr`,value:re,onChange:e=>ie(e.target.value)})]}),d===`workflow`&&(0,H.jsx)(T,{label:c(`Workflow name`,`نام گردش‌کار`),value:x,onChange:e=>ne(e.target.value)}),(0,H.jsx)(T,{label:c(`GitHub API base (optional)`,`نشانی پایهٔ API گیت‌هاب (اختیاری)`),type:`url`,dir:`ltr`,value:se,placeholder:`https://api.github.com`,onChange:e=>E(e.target.value),hint:c(`Supports GitHub Enterprise; normal GitHub uses the default when blank.`,`از GitHub Enterprise پشتیبانی می‌کند؛ برای گیت‌هاب عادی، خالی بگذارید تا مقدار پیش‌فرض استفاده شود.`)})]}),(0,H.jsxs)(`div`,{className:`compact-fields`,children:[(0,H.jsxs)(`label`,{className:`field`,children:[(0,H.jsx)(`span`,{children:c(`Artifact kind`,`نوع خروجی`)}),(0,H.jsx)(`select`,{value:p,onChange:e=>m(e.target.value),children:Se.map(e=>(0,H.jsx)(`option`,{value:e,children:l(e)},e))})]}),(0,H.jsx)(T,{label:c(`Target platform`,`پلتفرم مقصد`),dir:`ltr`,value:D,disabled:p!==`host-executable`,onChange:e=>le(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`compact-fields`,children:[(0,H.jsx)(T,{label:c(`Packed timestamp override`,`بازنویسی مهر زمانی فشرده`),dir:`ltr`,value:O,placeholder:c(`0x… or decimal`,`0x… یا ده‌دهی`),onChange:e=>ue(e.target.value)}),(0,H.jsx)(T,{label:c(`Provider / peer bearer token`,`توکن حامل ارائه‌دهنده / همتا`),type:`password`,autoComplete:`off`,dir:`ltr`,value:k,onChange:e=>fe(e.target.value),hint:c(`Held only in this browser session and cleared after a successful stage.`,`فقط در همین نشست مرورگر نگهداری و پس از آماده‌سازی موفق پاک می‌شود.`)})]}),(0,H.jsx)(h,{type:`submit`,tone:`primary`,icon:e,busy:L===`discover`,disabled:d===`manifest`?!S.trim():!g.trim(),children:c(`Discover metadata`,`کشف فراداده`)})]}),Ee&&(0,H.jsxs)(`div`,{className:`update-notice${/failed|error|invalid|mismatch/i.test(Ee)?` is-error`:``}`,children:[(0,H.jsx)(s,{size:17}),(0,H.jsx)(`span`,{children:Ee})]}),j?.candidates.length?(0,H.jsx)(`div`,{className:`release-candidates`,children:j.candidates.map(e=>(0,H.jsxs)(`label`,{className:e.id===me?`is-selected`:``,children:[(0,H.jsx)(`input`,{type:`radio`,name:`release-candidate`,checked:e.id===me,onChange:()=>N(e.id)}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`strong`,{children:e.name}),(0,H.jsxs)(`small`,{children:[e.release_tag?`${c(`release`,`انتشار`)} ${e.release_tag}`:e.workflow_run_id?`${c(`run`,`اجرا`)} ${e.workflow_run_id}`:e.source,` · `,e.platform||c(`platform-neutral`,`مستقل از پلتفرم`)]})]}),(0,H.jsx)(`code`,{children:Te(e.archive_sha256||e.sha256,c(`UNPUBLISHED`,`منتشرنشده`))}),(0,H.jsx)(`em`,{children:w(e.archive_bytes||e.bytes,c(`unknown`,`نامشخص`))})]},e.id))}):!L&&j&&(0,H.jsx)(te,{icon:ae,title:c(`No matching candidates`,`گزینهٔ منطبقی پیدا نشد`),detail:c(`Adjust artifact kind, platform, release tag, branch, or workflow name.`,`نوع خروجی، پلتفرم، برچسب انتشار، شاخه یا نام گردش‌کار را تغییر دهید.`)}),W&&(0,H.jsxs)(`div`,{className:`release-selection`,children:[(0,H.jsxs)(`div`,{className:`data-list`,children:[(0,H.jsx)(y,{label:c(`Comparison`,`مقایسه`),value:P?.status||c(`checking`,`در حال بررسی`),tone:P?.status===`newer`?`good`:P?.status===`older`?`warn`:void 0}),(0,H.jsx)(y,{label:c(`Reason`,`دلیل`),value:P?.reason||c(`Comparing hashes and packed/build timestamps…`,`در حال مقایسهٔ هش و مهرهای زمانی فشرده/ساخت…`)}),(0,H.jsx)(y,{label:c(`Build hash`,`هش ساخت`),value:W.build_hash||c(`not supplied`,`ارائه نشده`),mono:!0}),(0,H.jsx)(y,{label:c(`Build time`,`زمان ساخت`),value:W.build_timestamp||c(`not supplied`,`ارائه نشده`),mono:!0})]}),W.archive&&(0,H.jsx)(T,{label:c(`ZIP member path (optional)`,`مسیر عضو ZIP (اختیاری)`),dir:`ltr`,value:pe,placeholder:c(`Auto-select a unique platform/kind match`,`انتخاب خودکار فایل یکتای منطبق با پلتفرم و نوع`),onChange:e=>A(e.target.value),hint:c(`Specify this only when an archive contains multiple equally suitable files.`,`فقط زمانی مشخص کنید که آرشیو چند فایل به یک اندازه مناسب دارد.`)}),(0,H.jsx)(h,{tone:`primary`,icon:de,busy:L===`stage`,onClick:()=>ke(W),children:c(`Review verified staging`,`بازبینی آماده‌سازی تأییدشده`)})]}),I&&(0,H.jsxs)(`div`,{className:`release-operation`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(ce,{className:I.state===`queued`||I.state===`downloading`?`spin`:``}),(0,H.jsx)(`strong`,{children:I.error||I.detail||I.state}),(0,H.jsxs)(`span`,{children:[w(I.bytes_done,c(`unknown`,`نامشخص`)),` / `,w(I.bytes_total,c(`unknown`,`نامشخص`))]})]}),(0,H.jsx)(`div`,{className:`update-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.max(0,Math.min(100,I.progress_percent)),children:(0,H.jsx)(`i`,{style:{width:`${Math.max(0,Math.min(100,I.progress_percent))}%`}})}),(0,H.jsx)(h,{compact:!0,icon:a,onClick:()=>void be(I.id).then(G).catch(e=>U(e instanceof Error?e.message:String(e))),children:c(`Refresh operation`,`تازه‌سازی عملیات`)}),I.artifact&&(0,H.jsxs)(`p`,{children:[(0,H.jsx)(u,{}),` `,c(`Staged as`,`آماده‌شده با شناسه`),` `,(0,H.jsx)(`code`,{children:I.artifact.sha256}),`؛ `,c(`board programming remains a separate action.`,`پروگرام برد همچنان عملی جداگانه است.`)]})]})]})}var U=new Set([`completed`,`failed`,`cancelled`,`downloaded`,`staged`]);function W(e){return!!e?.state&&!U.has(e.state)}function De(e){return!W(e)||!e?.progress_known||!Number.isFinite(e.progress_percent)?null:Math.max(0,Math.min(100,e.progress_percent))}function G(e,t){let n=Date.parse(e.started_at??``),r=W(e)?t:Date.parse(e.updated_at??``);if(!Number.isFinite(n)||!Number.isFinite(r)||r=60?`${Math.floor(i/60)}m ${i%60}s`:`${i}s`}var Oe={queued:[`Queued`,`در صف`],preflight:[`Checking tools & target`,`بررسی ابزارها و مقصد`],uploading:[`Uploading artifact`,`ارسال فایل`],receiving:[`Receiving artifact`,`دریافت فایل`],preparing:[`Preparing board`,`آماده‌سازی برد`],"backing-up":[`Saving board settings`,`ذخیره تنظیمات برد`],reading:[`Reading memory`,`خواندن حافظه`],writing:[`Writing memory`,`نوشتن حافظه`],programming:[`Programming board`,`پروگرام برد`],erasing:[`Erasing memory`,`پاک کردن حافظه`],verifying:[`Verifying memory`,`تأیید حافظه`],reconnecting:[`Reconnecting board`,`اتصال دوباره برد`],restoring:[`Restoring settings`,`بازیابی تنظیمات`],downloading:[`Downloading artifact`,`دریافت فایل`],staging:[`Preparing host replacement`,`آماده‌سازی جایگزین میزبان`],staged:[`Host replacement ready`,`جایگزین میزبان آماده است`],prepare:[`Preparing board`,`آماده‌سازی برد`],settings:[`Reading settings`,`خواندن تنظیمات`],release:[`Releasing serial port`,`آزاد کردن درگاه سریال`],backup:[`Saving board backup`,`ذخیره پشتیبان برد`],flash:[`Programming board`,`پروگرام برد`],reconnect:[`Reconnecting board`,`اتصال دوباره برد`],restore:[`Restoring settings`,`بازیابی تنظیمات`],"flash read":[`Reading flash`,`خواندن فلش`],"EEPROM read":[`Reading EEPROM`,`خواندن EEPROM`],"flash write":[`Writing flash`,`نوشتن فلش`],"flash verification":[`Verifying flash`,`تأیید فلش`]};function ke({status:e,locale:t}){let n=(e,n)=>t===`fa`?n:e,r=W(e),i=De(e),[a,o]=(0,z.useState)(Date.now);(0,z.useEffect)(()=>{if(!r)return;let e=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(e)},[r]);let c=G(e,a),l=e.state===`failed`||e.state===`cancelled`,u=e.stage||(r?e.state:``),f=u.split(`:`)[0],p=Oe[f]?.[+(t===`fa`)]||f.replaceAll(`-`,` `),m=l?n(`Update stopped`,`به‌روزرسانی متوقف شد`):r?p:n(`Operation complete`,`عملیات کامل شد`),h=l?ne:r?ce:s;return(0,H.jsxs)(`section`,{className:`update-operation ${l?`is-failed`:r?`is-running`:`is-complete`}`,"aria-label":n(`Update operation`,`عملیات به‌روزرسانی`),children:[(0,H.jsxs)(`header`,{className:`update-operation__header`,children:[(0,H.jsx)(`div`,{className:`update-operation__icon`,children:(0,H.jsx)(h,{className:r?`spin`:void 0})}),(0,H.jsxs)(`div`,{className:`update-operation__heading`,children:[(0,H.jsx)(`span`,{children:e.kind===`firmware`?n(`Board firmware`,`میان‌افزار برد`):e.kind.replaceAll(`-`,` `)}),(0,H.jsx)(`h2`,{children:m})]}),c&&(0,H.jsxs)(`span`,{className:`update-operation__elapsed`,children:[(0,H.jsx)(ue,{size:16}),(0,H.jsx)(`b`,{children:c})]})]}),r&&(0,H.jsxs)(`div`,{className:`update-operation__measurement`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{children:i===null?n(`Waiting for this stage`,`در انتظار این مرحله`):n(`Current stage`,`مرحله جاری`)}),(0,H.jsx)(`strong`,{children:i===null?`…`:`${i}%`})]}),(0,H.jsx)(`div`,{className:`update-progress${i===null?` is-indeterminate`:``}`,role:`progressbar`,"aria-label":p,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i??void 0,"aria-valuetext":i===null?n(`In progress; duration unknown`,`در حال اجرا؛ زمان نامشخص`):void 0,children:(0,H.jsx)(`i`,{style:i===null?void 0:{width:`${i}%`}})},u)]}),e.detail&&(0,H.jsx)(`div`,{className:`update-operation__detail`,dir:`auto`,role:l?`alert`:void 0,children:e.detail}),(0,H.jsxs)(`dl`,{className:`update-operation__facts`,children:[l&&p&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:n(`Last stage`,`آخرین مرحله`)}),(0,H.jsx)(`dd`,{children:p})]}),e.programming_method&&e.programming_method!==`none`&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:n(`Connection`,`اتصال`)}),(0,H.jsx)(`dd`,{children:e.programming_method===`urclock`?`UART / Urclock`:`USBasp / ISP`})]}),!!e.bytes_total&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:n(`Transferred`,`انتقال داده`)}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`bdi`,{title:`${e.bytes_done??0} / ${e.bytes_total} bytes`,children:oe(e.bytes_done??0,e.bytes_total)})})]}),e.updated_at&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:n(`Last activity`,`آخرین فعالیت`)}),(0,H.jsx)(`dd`,{children:new Date(e.updated_at).toLocaleTimeString(t)})]})]}),(0,H.jsxs)(`details`,{className:`update-operation__diagnostics`,children:[(0,H.jsxs)(`summary`,{children:[(0,H.jsx)(d,{size:16}),n(`Technical details`,`جزئیات فنی`)]}),(0,H.jsxs)(`dl`,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:n(`Operation`,`عملیات`)}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`bdi`,{children:(0,H.jsx)(`code`,{children:e.id})})})]}),e.error_code&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:n(`Error`,`خطا`)}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`bdi`,{children:(0,H.jsx)(`code`,{children:e.error_code})})})]}),e.artifact_sha256&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`SHA-256`}),(0,H.jsx)(`dd`,{children:(0,H.jsx)(`bdi`,{children:(0,H.jsx)(`code`,{children:e.artifact_sha256})})})]})]})]})]})}function K(){let e=S();return e?{Authorization:`Bearer ${e}`}:{}}async function Ae(e){let t=await e.text(),n=null;if(t)try{n=JSON.parse(t)}catch{n=t}if(!e.ok){let t=ie(n,e.statusText,e.status);throw Error(t||`HTTP ${e.status}`)}return n}function je(e){return g(`controller.artifact.manifest`,{},e)}function Me(e,t){return g(`controller.artifact.list`,e?{kind:e}:{},t)}function Ne(e,t){return g(`controller.artifact.fetch`,e,t)}function Pe(e,t){return g(`controller.artifact.capture`,e,t)}function Fe(e,t){return g(`controller.update.firmware`,e,t)}function Ie(e,t){return g(`controller.restore.flash`,e,t)}function Le(e,t){return g(`controller.update.eeprom`,e,t)}function Re(e,t){return g(`controller.update.host`,e,t)}function ze(e){return g(`controller.bridge.list`,{},e)}var Be=`pccontroller.peer-update.intent.`,q=new Map,J;function Y(e,t){try{sessionStorage!==J&&(q.clear(),J=sessionStorage)}catch{}return`${Be}${encodeURIComponent(e.trim().toLowerCase())}.${t}`}function X(e){let t=new Uint8Array(16);globalThis.crypto.getRandomValues(t);let n=Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``);return`peer-host-${e.slice(0,12)}-${n}`}function Z(e,t){if(!e.trim())throw Error(`Peer host update requires a peer`);let n=t.trim().toLowerCase();if(!/^[0-9a-f]{64}$/.test(n))throw Error(`Peer host update requires an exact SHA-256 digest`);let r=Y(e,n),i=q.get(r);if(i)return i;try{let e=sessionStorage.getItem(r)?.trim()??``;if(/^[A-Za-z0-9._:-]{1,128}$/.test(e))return q.set(r,e),e}catch{}let a=X(n);q.set(r,a);try{sessionStorage.setItem(r,a)}catch{}return a}function Q(e,t,n){let r=Y(e,t.trim().toLowerCase());q.get(r)===n&&q.delete(r);try{sessionStorage.getItem(r)===n&&sessionStorage.removeItem(r)}catch{}}function Ve(e,t,n){let r=t.trim().toLowerCase(),i=n.trim();if(!e.trim()||!/^[0-9a-f]{64}$/.test(r)||!/^[A-Za-z0-9._:-]{1,128}$/.test(i))return!1;q.set(Y(e,r),i);try{return sessionStorage.setItem(Y(e,r),i),!0}catch{return!0}}function He(e,t,n){Q(e,t,n.trim())}async function Ue(e,t,n){let r=t.trim().toLowerCase(),i=Z(e,r);try{let t=await g(`controller.peer.update.host`,{peer:e,artifact_sha256:r,authorized:!0,idempotency_key:i},n);return Q(e,r,i),t}catch(t){throw t instanceof f&&t.code!==-32004&&Q(e,r,i),t}}async function We(e,t,n,r,i){let a=new URL(_(`/api/artifacts/upload`),location.href);a.searchParams.set(`kind`,t),a.searchParams.set(`name`,e.name),a.searchParams.set(`sha256`,n),a.searchParams.set(`bytes`,String(e.size));let o=new FormData;return o.set(`artifact`,e,e.name),i&&typeof XMLHttpRequest<`u`?new Promise((t,n)=>{let s=new XMLHttpRequest,c=e.size,l=()=>s.abort();s.open(`POST`,a.toString());for(let[e,t]of Object.entries(K()))s.setRequestHeader(e,t);s.upload.onprogress=e=>{c=e.lengthComputable&&e.total>0?e.total:c,i(e.loaded,c)},s.onerror=()=>n(Error(`Artifact upload transport failed`)),s.onabort=()=>n(new DOMException(`Artifact upload was cancelled`,`AbortError`)),s.onload=()=>{r?.removeEventListener(`abort`,l);let e=null;try{e=s.responseText?JSON.parse(s.responseText):null}catch{e=s.responseText}s.status<200||s.status>=300?n(Error(ie(e,s.statusText,s.status))):(i(c,c),t(e))},r?.addEventListener(`abort`,l,{once:!0}),r?.aborted?l():s.send(o)}):Ae(await fetch(a.toString(),{method:`POST`,headers:K(),body:o,signal:r}))}async function Ge(e,t,n){let r=_(`/api/artifacts/${encodeURIComponent(e.kind)}/${encodeURIComponent(e.sha256)}`);if(n&&typeof XMLHttpRequest<`u`){Ke(await new Promise((i,a)=>{let o=new XMLHttpRequest,s=()=>o.abort();o.open(`GET`,r),o.responseType=`blob`;for(let[e,t]of Object.entries(K()))o.setRequestHeader(e,t);o.onprogress=t=>n(t.loaded,t.lengthComputable?t.total:e.bytes),o.onerror=()=>a(Error(`Artifact download transport failed`)),o.onabort=()=>a(new DOMException(`Artifact download was cancelled`,`AbortError`)),o.onload=()=>{t?.removeEventListener(`abort`,s),o.status<200||o.status>=300?a(Error(o.statusText||`HTTP ${o.status}`)):(n(e.bytes,e.bytes),i(o.response))},t?.addEventListener(`abort`,s,{once:!0}),t?.aborted?s():o.send()}),e.name);return}let i=await fetch(r,{headers:K(),signal:t});i.ok||await Ae(i),Ke(await i.blob(),e.name)}function Ke(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function qe(e){let t=await crypto.subtle.digest(`SHA-256`,await e.arrayBuffer());return Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,`0`)).join(``)}function Je(e,t){return!e||!t?`unknown`:e.sha256.toLowerCase()===t.sha256.toLowerCase()?`same`:!e.build_timestamp||!t.build_timestamp||t.build_timestamp===e.build_timestamp?`different`:t.build_timestamp>e.build_timestamp?`newer`:`older`}var Ye=[`firmware`,`eeprom`,`flash-backup`,`host-executable`];function Xe(e){return e?e.slice(0,12).toUpperCase():`—`}function Ze(e){let t=e.metadata;return!et(e)||!t?.operation_id||!t.kind||!t.state?null:{id:t.operation_id,kind:t.kind,state:t.state,stage:t.stage,detail:t.detail??e.text,error_code:t.error_code,progress_known:t.progress_known===`true`,progress_percent:Number(t.progress_percent),started_at:t.started_at,updated_at:t.updated_at,stage_started_at:t.stage_started_at,artifact_sha256:t.sha256,programming_method:t.programming_method,bootloader_outcome:t.bootloader_outcome,isp_fallback_suggested:t.isp_fallback_suggested===`true`,toolchain:t.toolchain_ready?{ready:t.toolchain_ready===`true`,policy:t.toolchain_policy,provider:t.toolchain_provider,version:t.toolchain_version,compatible_sources:t.toolchain_compatible_sources?Number(t.toolchain_compatible_sources):void 0,providers:t.toolchain_providers?t.toolchain_providers.split(`,`).filter(Boolean):void 0}:void 0,bytes_done:t.bytes_done?Number(t.bytes_done):void 0,bytes_total:t.bytes_total?Number(t.bytes_total):void 0}}function $(e,t){return{firmware:[`Board firmware`,`میان‌افزار برد`],eeprom:[`Board EEPROM`,`EEPROM برد`],"flash-backup":[`Flash readback`,`بازخوانی فلش`],"host-executable":[`Host executable`,`فایل اجرایی میزبان`]}[e]?.[+(t===`fa`)]??e}function Qe(e,t){return t(e.operation),e.artifact}function $e(e,t){return t===`host-executable`||e}function et(e){return e.kind.startsWith(`update.`)&&e.source!==`bridge`&&!e.metadata?.[`bridge.ingress`]}function tt(e){let t=e.kind.trim().toLowerCase();if(!t.startsWith(`peer-update.`))return null;let n=e.metadata?.peer?.trim()??``,r=(e.metadata?.state??t.slice(12)).trim().toLowerCase();if(!n||!r)return null;let i=Number(e.metadata?.progress_percent);return{peer:n,state:r,operationID:e.metadata?.remote_operation_id?.trim()||e.metadata?.operation_id?.trim()||`—`,progressPercent:Number.isFinite(i)?Math.min(100,Math.max(0,i)):0,progressKnown:e.metadata?.progress_known===`true`&&Number.isFinite(i),bytesDone:e.metadata?.bytes_done?Number(e.metadata.bytes_done):void 0,bytesTotal:e.metadata?.bytes_total?Number(e.metadata.bytes_total):void 0,detail:e.text,artifactSHA256:e.metadata?.sha256?.trim().toLowerCase()??``,idempotencyKey:e.metadata?.idempotency_key?.trim()??``,retrySameIntent:e.metadata?.retry_same_idempotency_key===`true`,terminalVerified:e.metadata?.terminal_verified===`true`}}function nt({appTitle:e,snapshot:u,events:d,locale:f,openDialog:m}){let g=(e,t)=>f===`fa`?t:e,[_,v]=(0,z.useState)(null),[x,ie]=(0,z.useState)([]),[ae,S]=(0,z.useState)(``),[E,D]=(0,z.useState)(null),[O,ue]=(0,z.useState)([]),[k,fe]=(0,z.useState)(null),[A,M]=(0,z.useState)(``),[N,F]=(0,z.useState)(``),[he,I]=(0,z.useState)(``),[L,_e]=(0,z.useState)(`firmware`),[B,ve]=(0,z.useState)(null),[V,ye]=(0,z.useState)(``),[be,xe]=(0,z.useState)(!1),[Se,Ce]=(0,z.useState)(!1),[we,Te]=(0,z.useState)(``),[U,De]=(0,z.useState)(``),[G,Oe]=(0,z.useState)(``),[K,Ae]=(0,z.useState)(``),Be=(0,z.useRef)(null),q=(0,z.useCallback)(async()=>{M(e=>e||`refresh`);try{let[e,t,n]=await Promise.all([je(),Me(),ze()]);v(e),ie(t.artifacts),D(e.update??null),ue(n),I(``),S(n=>n&&t.artifacts.some(e=>e.sha256===n)?n:e.defaults.firmware?.sha256??t.artifacts[0]?.sha256??``)}catch(e){v(null),ie([]),ue([]),I(e instanceof Error?e.message:String(e))}finally{M(e=>e===`refresh`?``:e)}},[]);(0,z.useEffect)(()=>{q()},[q]);let J=(0,z.useMemo)(()=>d.find(et),[d]),Y=(0,z.useMemo)(()=>d.map(tt).find(e=>e!==null)??null,[d]);(0,z.useEffect)(()=>{Y?.idempotencyKey&&Y.artifactSHA256&&(Y.state===`outcome-uncertain`&&Y.retrySameIntent?Ve(Y.peer,Y.artifactSHA256,Y.idempotencyKey):(Y.state===`failed`||Y.state===`completed`)&&He(Y.peer,Y.artifactSHA256,Y.idempotencyKey))},[Y]);let X=Y??(k?{peer:k.peer,state:k.stage,operationID:k.operation.id,progressPercent:k.operation.progress_percent,progressKnown:k.operation.progress_known===!0,bytesDone:k.operation.bytes_done,bytesTotal:k.operation.bytes_total,detail:k.operation.detail??``,artifactSHA256:k.artifact.sha256,idempotencyKey:k.operation.idempotency_key??``,retrySameIntent:!1,terminalVerified:k.terminal_verified}:null);(0,z.useEffect)(()=>{if(!J)return;let e=Ze(J);e&&(D(t=>t?.updated_at&&e.updated_at&&Date.parse(t.updated_at)>Date.parse(e.updated_at)?t:e),W(e)||q())},[J?.id,J?.time]);let Z=x.find(e=>e.sha256===ae),Q=Je(Z?.kind===`host-executable`?_?.current.host:Z?.kind===`eeprom`?_?.current.eeprom:Z?.kind===`flash-backup`?_?.current.flash_readback:_?.current.firmware,Z),Ke=E?.isp_fallback_suggested===!0,nt=async e=>{if(ve(e),ye(``),F(``),e){xe(!0);try{ye(await qe(e))}catch(e){F(`${g(`Could not hash selection`,`محاسبهٔ هش فایل انتخابی ممکن نشد`)}: ${e instanceof Error?e.message:String(e)}`)}finally{xe(!1)}}},rt=e=>{nt(e.currentTarget.files?.[0]??null)},it=e=>{e.preventDefault(),Ce(!1),nt(e.dataTransfer.files?.[0]??null)},at=async()=>{if(!B||!V)return;M(`upload`);let e=`browser-upload-${V.slice(0,16)}`,t=new Date().toISOString(),n=0,r=B.size;try{let i=Qe(await We(B,L,V,void 0,(i,a)=>{n=i,r=a;let o=a>0?Math.max(0,Math.min(100,Math.round(i*100/a))):0,s={id:e,kind:`artifact-upload`,state:`uploading`,stage:`uploading`,progress_known:a>0,progress_percent:o,bytes_done:i,bytes_total:a,detail:g(`Sending selected artifact to this host`,`ارسال فایل انتخاب‌شده به این میزبان`),started_at:t,updated_at:new Date().toISOString()};D(s),window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:s}))}),D);window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:{id:e,kind:`artifact-upload`,state:`completed`,stage:`completed`,progress_known:r>0,progress_percent:100,bytes_done:r,bytes_total:r,detail:g(`Artifact upload completed and was verified`,`ارسال فایل کامل و تأیید شد`),started_at:t,updated_at:new Date().toISOString()}})),F(g(`${B.name} was verified and staged. Nothing has been programmed.`,`${B.name} تأیید و آماده شد. هیچ چیزی پروگرام نشده است.`)),await q(),i&&S(i.sha256)}catch(i){let a=i instanceof Error?i.message:String(i);window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:{id:e,kind:`artifact-upload`,state:`failed`,stage:`uploading`,progress_known:r>0,progress_percent:r>0?Math.max(0,Math.min(100,Math.round(n*100/r))):0,bytes_done:n,bytes_total:r,detail:a,started_at:t,updated_at:new Date().toISOString()}})),F(a)}finally{M(``)}},ot=async e=>{e.preventDefault();let t=G.trim().toLowerCase();if(t&&!/^[0-9a-f]{64}$/.test(t))F(g(`Expected SHA-256 must contain exactly 64 hexadecimal characters.`,`مقدار مورد انتظار SHA-256 باید دقیقاً ۶۴ نویسهٔ شانزده‌شانزدهی داشته باشد.`));else{M(`remote`);try{let e=Qe(await Ne({url:we.trim(),kind:L,...U.trim()?{name:U.trim()}:{},...t?{sha256:t}:{},...K?{bearer_token:K}:{}}),D);F(g(`Remote content was downloaded, checked and staged. Nothing has been programmed.`,`محتوای راه‌دور دانلود، بررسی و آماده شد. هیچ چیزی پروگرام نشده است.`)),Ae(``),await q(),e&&S(e.sha256)}catch(e){F(e instanceof Error?e.message:String(e))}finally{M(``)}}},st=(e,t=`urclock`)=>{let n=e.kind!==`host-executable`;if(!$e(u.connected,e.kind)){F(g(`Connect the controller before starting a board update.`,`پیش از آغاز به‌روزرسانی برد، کنترلر را متصل کنید.`));return}let r=e.kind===`host-executable`?g(`replace the host application`,`برنامهٔ میزبان را جایگزین می‌کند`):e.kind===`eeprom`?g(`restore MCU EEPROM`,`EEPROM ریزکنترل‌گر را بازیابی می‌کند`):e.kind===`flash-backup`?g(`restore the captured flash image`,`تصویر ثبت‌شدهٔ فلش را بازیابی می‌کند`):g(`program board firmware`,`میان‌افزار برد را پروگرام می‌کند`);m({tone:`danger`,title:e.kind===`flash-backup`?g(`Authorize guarded flash restore?`,`بازیابی محافظت‌شدهٔ فلش مجاز شود؟`):g(`Authorize ${$(e.kind,f).toLowerCase()} update?`,`به‌روزرسانی ${$(e.kind,f)} مجاز شود؟`),body:`${e.name}\nSHA-256 ${e.sha256}\n\n${g(`This is the authorization step. Selection and staging did not write hardware.`,`این مرحلهٔ صدور مجوز است. انتخاب و آماده‌سازی چیزی روی سخت‌افزار ننوشته‌اند.`)} ${n?g(`The primary host will make the board safe, back up flash and EEPROM, then ${r}, verify readback, and restore lifecycle settings.`,`میزبان اصلی ابتدا برد را در وضعیت امن قرار می‌دهد، از فلش و EEPROM پشتیبان می‌گیرد، سپس ${r}، بازخوانی را تأیید و تنظیمات چرخهٔ کار را بازیابی می‌کند.`):g(`The primary host will verify the package, prepare a recoverable replacement, and ${r} only after the current process exits cleanly.`,`میزبان اصلی بسته را تأیید و جایگزینی قابل‌بازیابی آماده می‌کند و فقط پس از خروج پاک فرایند فعلی، ${r}.`)}`,confirmLabel:t===`usbasp`?g(`Authorize ISP programming`,`اجازهٔ پروگرام ISP`):g(`Authorize verified update`,`اجازهٔ به‌روزرسانی تأییدشده`),action:async()=>{M(`update`);try{let n={artifact_sha256:e.sha256,authorized:!0,method:t,...u.port.name?{port:u.port.name}:{}};Qe(e.kind===`host-executable`?await Re(n):e.kind===`eeprom`?await Le(n):e.kind===`flash-backup`?await Ie(n):await Fe(n),D),F(g(`${e.name} entered the guarded ${e.kind===`flash-backup`?`restore`:`update`} queue.`,`${e.name} وارد صف محافظت‌شدهٔ ${e.kind===`flash-backup`?`بازیابی`:`به‌روزرسانی`} شد.`))}catch(e){throw F(e instanceof Error?e.message:String(e)),e}finally{M(``)}}})},ct=(e,t)=>{!e.connected||!e.allow_commands?F(g(`Peer ${e.name} is not connected for commands.`,`همتای ${e.name} برای فرمان‌ها متصل نیست.`)):m({tone:`danger`,title:g(`Upgrade ${e.name}?`,`به‌روزرسانی ${e.name}؟`),body:`${t.name}\nSHA-256 ${t.sha256}\n\n${g(`The primary instance will transfer the verified executable over its configured bridge, ask the remote coordinator to perform its journaled replacement, wait through restart, and verify the peer acknowledges this exact active SHA.`,`نمونهٔ اصلی فایل اجرایی تأییدشده را از پل معتبر منتقل می‌کند، از هماهنگ‌کنندهٔ راه‌دور می‌خواهد جایگزینی ثبت‌شده را انجام دهد، در طول راه‌اندازی مجدد منتظر می‌ماند و تأیید می‌کند که همتا همین SHA فعال دقیق را اعلام می‌کند.`)}`,confirmLabel:g(`Authorize peer upgrade`,`اجازهٔ به‌روزرسانی همتا`),action:async()=>{M(`peer-update`);try{let n=await Ue(e.name,t.sha256);fe(n),F(g(`${e.name} restarted and acknowledged ${n.artifact.sha256.slice(0,12)} as its active host executable.`,`${e.name} دوباره راه‌اندازی شد و ${n.artifact.sha256.slice(0,12)} را به‌عنوان فایل اجرایی فعال میزبان تأیید کرد.`))}catch(e){F(e instanceof Error?e.message:String(e))}finally{M(``)}}})},lt=(e=`urclock`)=>{u.connected?m({title:g(`Capture current flash and EEPROM?`,`فلش و EEPROM فعلی ثبت شوند؟`),body:`${g(`The primary host will briefly take ownership of the programming path, read both memories, verify their exact byte counts, and store content-addressed backups. Existing identical images are not duplicated.`,`میزبان اصلی برای مدتی کوتاه مسیر پروگرام را در اختیار می‌گیرد، هر دو حافظه را می‌خواند، شمار دقیق بایت‌ها را تأیید و پشتیبان‌های محتوامحور ذخیره می‌کند. تصاویر یکسان موجود دوباره کپی نمی‌شوند.`)}${e===`usbasp`?`\n\n${g(`ISP access is being used because the bootloader probe failed.`,`به‌دلیل ناموفق بودن بررسی بوت‌لودر، از دسترسی ISP استفاده می‌شود.`)}`:``}`,confirmLabel:e===`usbasp`?g(`Authorize ISP capture`,`اجازهٔ ثبت با ISP`):g(`Authorize readback`,`اجازهٔ بازخوانی`),action:async()=>{M(`capture`);try{Qe(await Pe({components:[`flash`,`eeprom`],authorized:!0,method:e}),D),F(g(`Flash and EEPROM capture entered the guarded queue.`,`ثبت فلش و EEPROM وارد صف محافظت‌شده شد.`))}catch(e){throw F(e instanceof Error?e.message:String(e)),e}finally{M(``)}}}):F(g(`Connect the controller before capturing its memories.`,`پیش از ثبت حافظه‌ها، کنترلر را متصل کنید.`))},ut=async e=>{let t=`browser-download-${e.sha256.slice(0,16)}`,n=new Date().toISOString(),r=0,i=e.bytes,a=(e,a,o,s)=>{r=a,i=o;let c=o>0?Math.max(0,Math.min(100,Math.round(a*100/o))):0;window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:{id:t,kind:`artifact-fetch`,state:e,stage:e===`completed`?`completed`:`downloading`,progress_known:o>0,progress_percent:c,bytes_done:a,bytes_total:o,detail:s,started_at:n,updated_at:new Date().toISOString()}}))};try{await Ge(e,void 0,(e,t)=>a(`downloading`,e,t,g(`Downloading verified artifact to this browser`,`دریافت فایل تأییدشده در این مرورگر`))),a(`completed`,e.bytes,e.bytes,g(`Artifact download completed`,`دریافت فایل کامل شد`))}catch(e){let t=e instanceof Error?e.message:String(e);a(`failed`,r,i,t),F(t)}};return he?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(re,{eyebrow:g(`Verified host updates`,`به‌روزرسانی تأییدشدهٔ میزبان`),title:g(`Firmware & updates`,`میان‌افزار و به‌روزرسانی`),detail:g(`Remote update is performed by the primary host over the board programming link; it is not MCU-native OTA.`,`به‌روزرسانی راه‌دور توسط میزبان اصلی و از مسیر پروگرام برد انجام می‌شود؛ این فرایند OTA بومی ریزکنترل‌گر نیست.`)}),(0,H.jsxs)(b,{icon:R,iconTone:`red`,title:g(`Artifact service`,`سرویس خروجی‌های ساخت`),eyebrow:g(`Unavailable`,`دردسترس نیست`),className:`updates-unavailable`,children:[(0,H.jsx)(te,{icon:R,title:g(`Artifact service unavailable`,`سرویس خروجی‌های ساخت در دسترس نیست`),detail:he}),(0,H.jsx)(h,{icon:a,onClick:()=>void q(),children:g(`Retry typed service`,`تلاش دوباره برای سرویس`)})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(re,{eyebrow:g(`Verified host updates`,`به‌روزرسانی تأییدشدهٔ میزبان`),title:g(`Firmware & updates`,`میان‌افزار و به‌روزرسانی`)}),E&&(0,H.jsx)(ke,{status:E,locale:f}),N&&(0,H.jsxs)(`div`,{className:`update-notice${/failed|error|could not|expected/i.test(N)?` is-error`:``}`,children:[(0,H.jsx)(s,{size:17}),(0,H.jsx)(`span`,{children:N})]}),(0,H.jsxs)(`section`,{className:`updates-grid`,children:[(0,H.jsxs)(b,{icon:P,iconTone:`violet`,title:g(`Stage a local artifact`,`آماده‌سازی خروجی محلی`),eyebrow:g(`Select · hash · stage`,`انتخاب · هش · آماده‌سازی`),className:`update-source-card`,action:(0,H.jsx)(C,{tone:B&&V?`good`:`neutral`,children:B?be?g(`HASHING`,`در حال هش`):g(`SELECTED`,`انتخاب‌شده`):g(`NO FILE`,`بدون فایل`)}),children:[(0,H.jsx)(`div`,{className:`artifact-kind-picker`,role:`radiogroup`,"aria-label":g(`Artifact kind`,`نوع خروجی`),children:Ye.map(e=>(0,H.jsxs)(`button`,{role:`radio`,"aria-checked":L===e,className:L===e?`is-active`:``,onClick:()=>_e(e),children:[e===`firmware`?(0,H.jsx)(me,{}):e===`eeprom`?(0,H.jsx)(r,{}):e===`host-executable`?(0,H.jsx)(ee,{}):(0,H.jsx)(j,{}),(0,H.jsx)(`span`,{children:$(e,f)})]},e))}),(0,H.jsx)(`input`,{ref:Be,className:`visually-hidden`,type:`file`,accept:`.hex,.eep,.bin,.exe,application/octet-stream,text/plain`,onChange:rt}),(0,H.jsxs)(`button`,{className:`artifact-drop${Se?` is-dragging`:``}`,type:`button`,onClick:()=>Be.current?.click(),onDragEnter:e=>{e.preventDefault(),Ce(!0)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`},onDragLeave:()=>Ce(!1),onDrop:it,children:[be?(0,H.jsx)(ce,{className:`spin`}):(0,H.jsx)(P,{}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:B?.name||g(`Browse for firmware, EEPROM, or readback`,`انتخاب میان‌افزار، EEPROM یا بازخوانی`)}),(0,H.jsx)(`span`,{children:B?`${w(B.size)} · SHA-256 ${Xe(V)}`:g(`The browser calculates SHA-256 locally before the host receives anything.`,`مرورگر پیش از دریافت هر چیزی توسط میزبان، SHA-256 را به‌صورت محلی محاسبه می‌کند.`)})]}),(0,H.jsx)(`span`,{children:g(`Choose file`,`انتخاب فایل`)})]}),(0,H.jsx)(h,{tone:`primary`,icon:pe,busy:A===`upload`,disabled:!B||!V||be,onClick:()=>void at(),children:g(`Verify and stage only`,`فقط تأیید و آماده‌سازی`)})]}),(0,H.jsx)(b,{icon:de,iconTone:`accent`,title:g(`Stage from a remote source`,`آماده‌سازی از منبع راه‌دور`),eyebrow:g(`HTTPS or trusted peer`,`HTTPS یا همتای مورد اعتماد`),className:`update-source-card`,children:(0,H.jsxs)(`form`,{className:`remote-artifact-form`,onSubmit:e=>void ot(e),children:[(0,H.jsx)(T,{label:g(`Source URL`,`نشانی منبع`),type:`url`,dir:`ltr`,value:we,placeholder:`https://host.example/artifacts/firmware/…`,onChange:e=>Te(e.target.value),hint:g(`The host respects configured proxy environment variables, validates redirects, size, and digest, then stages without programming.`,`میزبان تنظیمات پراکسی محیط را رعایت می‌کند، تغییرمسیرها، اندازه و چکیده را می‌سنجد و سپس بدون پروگرام فایل را آماده می‌کند.`)}),(0,H.jsxs)(`div`,{className:`compact-fields`,children:[(0,H.jsx)(T,{label:g(`Display name (optional)`,`نام نمایشی (اختیاری)`),value:U,onChange:e=>De(e.target.value)}),(0,H.jsx)(T,{label:g(`Expected SHA-256 (recommended)`,`SHA-256 مورد انتظار (پیشنهادی)`),dir:`ltr`,value:G,maxLength:64,onChange:e=>Oe(e.target.value.replace(/[^0-9a-f]/gi,``).toLowerCase())})]}),(0,H.jsx)(T,{label:g(`Peer bearer token (optional)`,`توکن حامل همتا (اختیاری)`),type:`password`,autoComplete:`off`,dir:`ltr`,value:K,onChange:e=>Ae(e.target.value),hint:g(`Used once by the primary host for this peer download; it is not persisted or printed.`,`فقط یک‌بار توسط میزبان اصلی برای دانلود معتبر از همتا استفاده می‌شود و ذخیره یا چاپ نخواهد شد.`)}),(0,H.jsx)(h,{type:`submit`,tone:`primary`,icon:de,busy:A===`remote`,disabled:!we.trim(),children:g(`Download, verify and stage`,`دانلود، تأیید و آماده‌سازی`)})]})}),(0,H.jsx)(Ee,{manifest:_,events:d,locale:f,openDialog:m,onArtifactsChanged:()=>void q()}),(0,H.jsxs)(b,{icon:R,iconTone:`accent`,title:g(`Update a configured peer`,`به‌روزرسانی همتای معتبر`),eyebrow:g(`Bridge-native · verified · coordinated`,`پل بومی · تأییدشده · هماهنگ`),action:(0,H.jsxs)(C,{tone:O.some(e=>e.connected)?`good`:`warn`,children:[O.filter(e=>e.connected).length,` `,g(`CONNECTED`,`متصل`)]}),children:[(0,H.jsx)(`p`,{className:`card-copy`,children:g(`Transfer the selected verified host executable over the configured bridge, perform the peer’s recoverable replacement, and wait for restart health plus an exact active-SHA acknowledgement. No SSH command or shared filesystem is used.`,`فایل اجرایی تأییدشدهٔ میزبان را از پل پیکربندی‌شده منتقل می‌کند، جایگزینی قابل‌بازیابی همتا را انجام می‌دهد و تا سلامت راه‌اندازی مجدد و تأیید دقیق SHA فعال منتظر می‌ماند. هیچ فرمان SSH یا فایل مشترکی استفاده نمی‌شود.`)}),X&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`data-list`,children:[(0,H.jsx)(y,{label:g(`Shared peer progress · ${X.peer}`,`پیشرفت مشترک همتا · ${X.peer}`),value:X.state===`completed`?g(`Restarted and active SHA verified`,`راه‌اندازی مجدد و SHA فعال تأیید شد`):X.state===`remote-staged`?g(`Remote staged`,`آماده‌شده در راه‌دور`):X.state===`remote-queued`?g(`Remote queued`,`در صف راه‌دور`):X.state===`outcome-uncertain`?g(`Outcome uncertain — retry this update`,`نتیجه نامشخص است — همین به‌روزرسانی را دوباره امتحان کنید`):X.state===`failed`?g(`Peer attempt failed`,`تلاش همتا ناموفق بود`):X.progressKnown?`${X.state.replaceAll(`-`,` `)} · ${Math.round(X.progressPercent)}%`:X.state.replaceAll(`-`,` `),tone:X.state===`completed`&&X.terminalVerified?`good`:X.state===`failed`?`bad`:`warn`}),(0,H.jsx)(y,{label:g(`Transferred`,`انتقال داده`),value:X.bytesTotal?oe(X.bytesDone??0,X.bytesTotal):g(`Not measured for this stage`,`برای این مرحله اندازه‌گیری نشده`),mono:!0}),(0,H.jsx)(y,{label:g(`Peer operation`,`عملیات همتا`),value:X.operationID,mono:!0}),(0,H.jsx)(y,{label:g(`Terminal replacement`,`جایگزینی نهایی`),value:X.terminalVerified?g(`Acknowledged · active SHA matches`,`تأیید شد · SHA فعال مطابقت دارد`):g(`Waiting for health, reconnect & active SHA`,`در انتظار سلامت، اتصال دوباره و SHA فعال`),tone:X.terminalVerified?`good`:`warn`})]}),(0,H.jsx)(`div`,{className:`update-progress${X.progressKnown?``:` is-indeterminate`}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":X.progressKnown?X.progressPercent:void 0,"aria-valuetext":X.bytesTotal?oe(X.bytesDone??0,X.bytesTotal):X.detail,children:(0,H.jsx)(`i`,{style:X.progressKnown?{width:`${X.progressPercent}%`}:void 0})})]}),O.length?(0,H.jsx)(`div`,{className:`data-list`,children:O.map(e=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(y,{label:e.name,value:e.connected?g(`Connected`,`متصل`):e.last_error||g(`Disconnected`,`قطع`),tone:e.connected?`good`:`bad`}),(0,H.jsx)(`div`,{className:`inline-actions`,children:(0,H.jsx)(h,{icon:i,tone:`primary`,disabled:!e.connected||!e.allow_commands||Z?.kind!==`host-executable`||A===`peer-update`,busy:A===`peer-update`,onClick:()=>Z&&void ct(e,Z),children:g(`Review peer host update`,`بازبینی به‌روزرسانی میزبان همتا`)})})]},e.name))}):(0,H.jsx)(te,{icon:R,title:g(`No bridge peers configured`,`هیچ همتای پلی پیکربندی نشده`),detail:g(`Add a peer in integration settings; connected peers appear here immediately.`,`یک همتای معتبر را در تنظیمات یکپارچه‌سازی بیفزایید؛ همتایان متصل فوراً اینجا ظاهر می‌شوند.`)})]}),(0,H.jsxs)(b,{icon:le,iconTone:`green`,title:g(`Embedded first-board recovery`,`بازیابی تعبیه‌شدهٔ نخستین برد`),eyebrow:g(`Verified build defaults`,`پیش‌فرض‌های تأییدشدهٔ ساخت`),action:(0,H.jsx)(C,{tone:_?.defaults_enabled?`good`:`warn`,children:_?.defaults_enabled?g(`AVAILABLE`,`موجود`):g(`NOT PACKAGED`,`بسته‌بندی نشده`)}),children:[(0,H.jsx)(`p`,{className:`card-copy`,children:g(`Enabled automatically only when the release contains both a real firmware image and a generated valid default EEPROM image. It is never auto-flashed—even a non-responsive, corrupt, or older board still requires your grant.`,`فقط وقتی خودکار فعال می‌شود که انتشار هم تصویر واقعی میان‌افزار و هم تصویر معتبرِ تولیدشده برای EEPROM پیش‌فرض داشته باشد. هرگز خودکار فلش نمی‌شود؛ حتی برد پاسخ‌گو‌نبود‌ه، خراب یا قدیمی نیز به اجازهٔ شما نیاز دارد.`)}),(0,H.jsxs)(`div`,{className:`data-list`,children:[(0,H.jsx)(y,{label:g(`Firmware`,`میان‌افزار`),value:_?.defaults.firmware?`${Xe(_.defaults.firmware.sha256)} · ${w(_.defaults.firmware.bytes)}`:g(`Missing from this host`,`در این میزبان موجود نیست`),mono:!0}),(0,H.jsx)(y,{label:g(`Default EEPROM`,`EEPROM پیش‌فرض`),value:_?.defaults.eeprom?`${Xe(_.defaults.eeprom.sha256)} · ${w(_.defaults.eeprom.bytes)}`:g(`Missing; empty .eep is never accepted`,`موجود نیست؛ فایل خالی .eep پذیرفته نمی‌شود`),mono:!0})]}),u.connected&&(0,H.jsxs)(`div`,{className:`inline-actions`,children:[(0,H.jsx)(h,{icon:ee,tone:`primary`,disabled:!_?.defaults.firmware||A===`update`,onClick:()=>_?.defaults.firmware&&st(_.defaults.firmware),children:g(`Review firmware programming`,`بازبینی پروگرام میان‌افزار`)}),(0,H.jsx)(h,{icon:le,disabled:!_?.defaults.eeprom||A===`update`,onClick:()=>_?.defaults.eeprom&&st(_.defaults.eeprom),children:g(`Review EEPROM restore`,`بازبینی بازیابی EEPROM`)})]})]}),u.connected&&(0,H.jsxs)(b,{icon:l,iconTone:`amber`,title:g(`Capture this connected board`,`ثبت برد متصل`),eyebrow:g(`Flash + EEPROM · deduplicated`,`فلش + EEPROM · بدون تکرار`),action:(0,H.jsx)(C,{tone:`good`,children:u.port.name||g(`CONNECTED`,`متصل`)}),children:[(0,H.jsx)(`p`,{className:`card-copy`,children:g(`A readback is stored by content hash. Identical firmware is referenced, not copied, and the resulting flash/EEPROM artifacts can be served to configured peers or downloaded below.`,`بازخوانی بر پایهٔ هش محتوا ذخیره می‌شود. به میان‌افزار یکسان ارجاع داده می‌شود و دوباره کپی نمی‌گردد؛ خروجی فلش/EEPROM را می‌توان در اختیار همتاهای معتبر گذاشت یا از پایین دانلود کرد.`)}),(0,H.jsxs)(`div`,{className:`data-list`,children:[(0,H.jsx)(y,{label:g(`Current board`,`برد فعلی`),value:u.hello.name||e}),(0,H.jsx)(y,{label:g(`Running build`,`ساخت در حال اجرا`),value:u.hello.build_hash?u.hello.build_hash.toString(16).toUpperCase().padStart(8,`0`):`—`,mono:!0}),(0,H.jsx)(y,{label:g(`Port owner`,`مالک درگاه`),value:u.port.name||g(`automatic`,`خودکار`),mono:!0})]}),(0,H.jsx)(h,{icon:l,busy:A===`capture`,onClick:()=>lt(),children:g(`Review flash + EEPROM capture`,`بازبینی ثبت فلش + EEPROM`)})]}),u.connected&&Ke&&(0,H.jsxs)(b,{icon:ne,iconTone:`red`,title:g(`Bootloader probe failed`,`بررسی بوت‌لودر ناموفق بود`),eyebrow:g(`ISP fallback recommended`,`مسیر جایگزین ISP پیشنهاد می‌شود`),className:`isp-fallback-card`,action:(0,H.jsx)(C,{tone:`bad`,children:g(`NO BOOTLOADER ROUTE`,`بدون مسیر بوت‌لودر`)}),children:[(0,H.jsxs)(`div`,{className:`isp-guidance`,children:[(0,H.jsx)(ne,{}),(0,H.jsx)(`p`,{children:g(`The host could not enter Urboot/Urclock. Connect a supported ISP programmer; the same primary host will back up what it can, program through ISP, verify the image, and restore the application lifecycle. ISP was not suggested before this failed probe.`,`میزبان نتوانست وارد Urboot/Urclock شود. یک پروگرامر ISP پشتیبانی‌شده متصل کنید؛ همان میزبان اصلی از بخش‌های ممکن پشتیبان می‌گیرد، از طریق ISP پروگرام می‌کند، تصویر را تأیید و چرخهٔ کار برنامه را بازیابی می‌کند. پیش از این بررسی ناموفق، ISP پیشنهاد نشده بود.`)})]}),(0,H.jsxs)(`div`,{className:`inline-actions`,children:[(0,H.jsx)(h,{tone:`danger`,icon:o,disabled:!Z||Z.kind===`host-executable`,onClick:()=>Z&&st(Z,`usbasp`),children:g(`Review ISP programming`,`بازبینی پروگرام ISP`)}),(0,H.jsx)(h,{icon:n,onClick:()=>lt(`usbasp`),children:g(`Review ISP capture`,`بازبینی ثبت با ISP`)})]})]}),(0,H.jsxs)(b,{icon:j,iconTone:`violet`,title:g(`Verified artifact inventory`,`فهرست خروجی‌های تأییدشده`),eyebrow:g(`${x.length} content-addressed artifacts`,`${x.length} خروجی محتوامحور`),className:`artifact-inventory`,action:(0,H.jsxs)(C,{tone:`info`,children:[x.length,` `,g(`UNIQUE`,`یکتا`)]}),children:[x.length?(0,H.jsx)(`div`,{className:`artifact-table-wrap`,children:(0,H.jsxs)(`table`,{className:`artifact-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{"aria-label":g(`Select`,`انتخاب`)}),(0,H.jsx)(`th`,{children:g(`Artifact`,`خروجی`)}),(0,H.jsx)(`th`,{children:g(`Source`,`منبع`)}),(0,H.jsx)(`th`,{children:g(`Build / digest`,`ساخت / چکیده`)}),(0,H.jsx)(`th`,{children:g(`Size`,`اندازه`)}),(0,H.jsx)(`th`,{children:g(`Created`,`ایجاد`)}),(0,H.jsx)(`th`,{children:g(`Actions`,`عملیات`)})]})}),(0,H.jsx)(`tbody`,{children:x.map(e=>{let t=ae===e.sha256,n=e.metadata,r=n?.repository||(n?.workflow_run_id?`${g(`run`,`اجرا`)} ${n.workflow_run_id}`:n?.release_id?`${g(`release`,`انتشار`)} ${n.release_id}`:``);return(0,H.jsxs)(`tr`,{className:t?`is-selected`:``,children:[(0,H.jsx)(`td`,{children:(0,H.jsx)(`input`,{type:`radio`,name:`artifact`,checked:t,"aria-label":g(`Select ${e.name}`,`انتخاب ${e.name}`),onChange:()=>S(e.sha256)})}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`strong`,{children:e.name}),(0,H.jsxs)(`span`,{children:[$(e.kind,f),e.embedded?g(` · embedded`,` · تعبیه‌شده`):``,e.current?g(` · current`,` · فعلی`):``]})]}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`strong`,{children:n?.provider||e.source}),r&&(0,H.jsx)(`span`,{children:r})]}),(0,H.jsxs)(`td`,{className:`mono`,children:[(0,H.jsx)(`strong`,{children:e.build_hash||Xe(e.sha256)}),(0,H.jsx)(`span`,{children:e.build_timestamp||e.sha256})]}),(0,H.jsx)(`td`,{className:`mono`,children:w(e.bytes)}),(0,H.jsx)(`td`,{children:se(f,e.created_at)}),(0,H.jsx)(`td`,{children:(0,H.jsx)(h,{compact:!0,icon:c,onClick:()=>void ut(e),children:g(`Download`,`دانلود`)})})]},`${e.kind}-${e.sha256}`)})})]})}):(0,H.jsx)(te,{icon:j,title:g(`No verified artifacts yet`,`هنوز خروجی تأییدشده‌ای وجود ندارد`),detail:g(`Stage a local or remote image, or capture the connected board.`,`یک تصویر محلی یا راه‌دور آماده کنید یا از برد متصل نسخه بگیرید.`)}),Z&&(0,H.jsxs)(`div`,{className:`artifact-selection`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`span`,{children:[g(`SELECTED`,`انتخاب‌شده`),` / `,$(Z.kind,f).toUpperCase()]}),(0,H.jsx)(`strong`,{children:Z.name}),(0,H.jsx)(`code`,{children:Z.sha256})]}),(0,H.jsx)(C,{tone:Q===`same`?`good`:Q===`newer`?`info`:Q===`older`?`warn`:`neutral`,children:Q===`same`?g(`SAME`,`یکسان`):Q===`newer`?g(`NEWER`,`جدیدتر`):Q===`older`?g(`OLDER`,`قدیمی‌تر`):g(`UNKNOWN`,`نامشخص`)}),$e(u.connected,Z.kind)&&(0,H.jsx)(h,{icon:Z.kind===`host-executable`?i:Z.kind===`flash-backup`?le:p,tone:`primary`,disabled:A===`update`,onClick:()=>st(Z),children:Z.kind===`host-executable`?g(`Review host self-update`,`بازبینی به‌روزرسانی میزبان`):Z.kind===`eeprom`?g(`Review EEPROM restore`,`بازبینی بازیابی EEPROM`):Z.kind===`flash-backup`?g(`Review flash restore`,`بازبینی بازیابی فلش`):g(`Review board programming`,`بازبینی پروگرام برد`)})]})]}),(0,H.jsx)(b,{icon:R,iconTone:`accent`,title:g(`Distribution paths`,`مسیرهای توزیع`),eyebrow:g(`Serve · download · bridge`,`ارائه · دانلود · پل`),className:`update-distribution-card`,children:(0,H.jsxs)(`div`,{className:`distribution-grid`,children:[(0,H.jsxs)(`article`,{children:[(0,H.jsx)(R,{}),(0,H.jsx)(`strong`,{children:g(`Authenticated serving`,`ارائهٔ معتبر`)}),(0,H.jsx)(`p`,{children:g(`Current flash, EEPROM, firmware, host packages and backups are served by exact SHA-256 through HTTP and bridge RPC.`,`فلش فعلی، EEPROM، میان‌افزار، بسته‌های میزبان و پشتیبان‌ها با SHA-256 دقیق از طریق HTTP و RPC پل ارائه می‌شوند.`)})]}),(0,H.jsxs)(`article`,{children:[(0,H.jsx)(t,{}),(0,H.jsx)(`strong`,{children:g(`Remote synchronization`,`همگام‌سازی راه‌دور`)}),(0,H.jsx)(`p`,{children:g(`Secondary instances request staging and updates through the primary owner; they never race it for the serial port.`,`نمونه‌های ثانویه آماده‌سازی و به‌روزرسانی را از مالک اصلی درخواست می‌کنند و هرگز برای درگاه سریال با آن رقابت ندارند.`)})]}),(0,H.jsxs)(`article`,{children:[(0,H.jsx)(ge,{}),(0,H.jsx)(`strong`,{children:g(`Verified replacement`,`جایگزینی تأییدشده`)}),(0,H.jsx)(`p`,{children:g(`Size, digest, packed date/time and build hash comparisons are visible before any update is authorized.`,`مقایسهٔ اندازه، چکیده، تاریخ/زمان فشرده و هش ساخت پیش از صدور مجوز هر به‌روزرسانی دیده می‌شود.`)})]})]})})]})]})}export{nt as UpdatesView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-CvBDG8li.js b/Tools/Controller/internal/webui/dist/assets/chunk-CvBDG8li.js new file mode 100644 index 00000000..01e4c629 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-CvBDG8li.js @@ -0,0 +1,57 @@ +import{Ft as e,It as t,Lt as n,Rt as r,at as i,dt as a,ot as o,zt as s}from"./app-BxYXetji.js";function c(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,u=e.desc,d=S(e,b),p=a||{width:r,height:i,x:0,y:0},m=l(`recharts-surface`,o);return f.createElement(`svg`,x({},v(d),{className:m,width:r,height:i,style:s,viewBox:`${p.x} ${p.y} ${p.width} ${p.height}`,ref:t}),f.createElement(`title`,null,c),f.createElement(`desc`,null,u),n)}),T=[`children`,`className`];function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=e.children,r=e.className,i=D(e,T),a=l(`recharts-layer`,r);return f.createElement(`g`,E({className:a},v(i),{ref:t}),n)});function A(e){return e===`__proto__`}var j=Object.prototype.hasOwnProperty;function M(e,t){return j.call(e,t)}var N=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function ee(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:N.test(e);default:return!1}}function te(e){var t;return typeof e==`string`||typeof e==`symbol`?e:Object.is(e==null||(t=e.valueOf)==null?void 0:t.call(e),-0)?`-0`:String(e)}function ne(e){return typeof e==`symbol`||e instanceof Symbol}function re(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n=0;n0&&(t+=`,`),t+=re(e[n]);return t}if(ne(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function ie(e){return e==null?``:re(e)}function ae(e){if(Array.isArray(e))return e.map(te);if(typeof e==`symbol`)return[e];e=ie(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r1&&arguments[1]!==void 0?arguments[1]:ce),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function P(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+le(i)+n},``)}var ue=e=>e===0?0:e>0?1:-1,de=e=>typeof e==`number`&&e!=+e,fe=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,F=e=>(typeof e==`number`||e instanceof Number)&&!de(e),pe=e=>F(e)||typeof e==`string`,me=0,he=e=>{var t=++me;return`${e||``}${t}`},ge=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!F(e)&&typeof e!=`string`)return n;var i;if(fe(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return de(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},_e=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;re&&(typeof t==`function`?t(e):oe(e,t))===n)}var I=e=>e==null,be=e=>I(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function xe(e){return e!=null}function Se(){}function Ce(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Te(e){for(var t=1;t{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=Ce(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?Te({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?Te({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?Te({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?Te({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?Te({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?Te({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?Te({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?Te({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(F(n.x)||fe(n.x))&&(F(n.y)||fe(n.y))?Te({x:c+ge(n.x,g),y:l+ge(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):Te({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},Ae=[`top`,`left`,`right`,`bottom`];function je(e){return e==null?!1:typeof e==`object`||Ae.includes(e)}var Me=(0,f.createContext)(null),Ne=()=>(0,f.useContext)(Me);function L(e){return function(){return e}}var Pe=Math.cos,Fe=Math.sin,Ie=Math.sqrt,Le=Math.PI;Le/2;var Re=2*Le,ze=Math.PI,Be=2*ze,Ve=1e-6,He=Be-Ve;function Ue(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ue;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tVe){if(!(Math.abs(u*s-c*l)>Ve)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((ze-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Ve&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Ve||Math.abs(this._y1-l)>Ve)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Be+Be),d>He?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Ve&&this._append`A${n},${n},0,${+(d>=ze)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Ge.prototype;function Ke(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Ge(t)}Array.prototype.slice;function qe(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Je(e){this._context=e}Je.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Ye(e){return new Je(e)}function Xe(e){return e[0]}function Ze(e){return e[1]}function Qe(e,t){var n=L(!0),r=null,i=Ye,a=null,o=Ke(s);e=typeof e==`function`?e:e===void 0?Xe:L(e),t=typeof t==`function`?t:t===void 0?Ze:L(t);function s(s){var c,l=(s=qe(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Qe().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:L(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:L(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:L(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:L(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:L(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:L(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:L(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var et=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function tt(e){return new et(e,!0)}function nt(e){return new et(e,!1)}var rt={draw(e,t){let n=Ie(t/Le);e.moveTo(n,0),e.arc(0,0,n,0,Re)}},it={draw(e,t){let n=Ie(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},at=Ie(1/3),ot=at*2,st={draw(e,t){let n=Ie(t/ot),r=n*at;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ct={draw(e,t){let n=Ie(t),r=-n/2;e.rect(r,r,n,n)}},lt=.8908130915292852,ut=Fe(Le/10)/Fe(7*Le/10),dt=Fe(Re/10)*ut,ft=-Pe(Re/10)*ut,pt={draw(e,t){let n=Ie(t*lt),r=dt*n,i=ft*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Re*t/5,o=Pe(a),s=Fe(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},mt=Ie(3),ht={draw(e,t){let n=-Ie(t/(mt*3));e.moveTo(0,n*2),e.lineTo(-mt*n,-n),e.lineTo(mt*n,-n),e.closePath()}},gt=-.5,_t=Ie(3)/2,vt=1/Ie(12),yt=(vt/2+1)*3,bt={draw(e,t){let n=Ie(t/yt),r=n/2,i=n*vt,a=r,o=n*vt+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(gt*r-_t*i,_t*r+gt*i),e.lineTo(gt*a-_t*o,_t*a+gt*o),e.lineTo(gt*s-_t*c,_t*s+gt*c),e.lineTo(gt*r+_t*i,gt*i-_t*r),e.lineTo(gt*a+_t*o,gt*o-_t*a),e.lineTo(gt*s+_t*c,gt*c-_t*s),e.closePath()}};function xt(e,t){let n=null,r=Ke(i);e=typeof e==`function`?e:L(e||rt),t=typeof t==`function`?t:L(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:L(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:L(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function St(){}function Ct(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function wt(e){this._context=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ct(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ct(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tt(e){return new wt(e)}function Et(e){this._context=e}Et.prototype={areaStart:St,areaEnd:St,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ct(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Dt(e){return new Et(e)}function Ot(e){this._context=e}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ct(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kt(e){return new Ot(e)}function At(e){this._context=e}At.prototype={areaStart:St,areaEnd:St,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jt(e){return new At(e)}function Mt(e){return e<0?-1:1}function Nt(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Mt(a)+Mt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Pt(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ft(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function It(e){this._context=e}It.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ft(this,this._t0,Pt(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ft(this,Pt(this,n=Nt(this,e,t)),n);break;default:Ft(this,this._t0,n=Nt(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Lt(e){this._context=new Rt(e)}(Lt.prototype=Object.create(It.prototype)).point=function(e,t){It.prototype.point.call(this,t,e)};function Rt(e){this._context=e}Rt.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function zt(e){return new It(e)}function Bt(e){return new Lt(e)}function Vt(e){this._context=e}Vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Ht(e),i=Ht(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function Gt(e){return new Wt(e,.5)}function Kt(e){return new Wt(e,0)}function qt(e){return new Wt(e,1)}function Jt(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n=0;)n[t]=t;return n}function Xt(e,t){return e[t]}function Zt(e){let t=[];return t.key=e,t}function Qt(){var e=L([]),t=Yt,n=Jt,r=Xt;function i(i){var a=Array.from(e.apply(this,arguments),Zt),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;rfn[`symbol${be(e)}`]||rt,hn=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*pn;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},gn=(e,t)=>{fn[`symbol${be(e)}`]=t},_n=e=>{var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=on(on({},un(e,nn)),{},{type:n,size:i,sizeType:o}),c=`circle`;typeof n==`string`&&(c=n);var u=()=>{var e=mn(c),t=xt().type(e).size(hn(i,o,c))();if(t!==null)return t},d=s.className,p=s.cx,m=s.cy,h=v(s);return F(p)&&F(m)&&F(i)?f.createElement(`path`,rn({},h,{className:l(`recharts-symbols`,d),transform:`translate(${p}, ${m})`,d:u()})):null};_n.registerSymbol=gn;var vn=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,yn=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,f.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{d(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},bn=(e,t,n)=>r=>(e(t,n,r),null),xn=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];d(i)&&typeof a==`function`&&(r||={},r[i]=bn(a,t,n))}),r};function Sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function On(){return On=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var p=t.formatter||i,m=l({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var h=typeof s==`object`?An({},s):{};h.color=t.inactive?a:h.color||t.color,h.whiteSpace??=`normal`,h.overflowWrap??=`break-word`;var g=p?p(t.value,t,r):t.value;return f.createElement(`li`,On({className:m,style:u,key:`legend-item-${r}`},xn(e,t,r)),f.createElement(w,{width:n,height:n,viewBox:c,style:d,"aria-label":t.value==null?`legend icon`:`${t.value} legend icon`},f.createElement(Ln,{data:t,iconType:o,inactiveColor:a})),f.createElement(`span`,{className:`recharts-legend-item-text`,style:h},g))})}var zn=e=>{var t=Dn(e,Fn),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return f.createElement(`ul`,{className:`recharts-default-legend`,style:a},f.createElement(Rn,On({},t,{payload:n})))};function Bn(e,t){let n=new Map;for(let r=0;r=0}function Wn(e){return e!=null&&typeof e!=`function`&&Un(e.length)}function Gn(e){return function(t){return oe(t,e)}}function Kn(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function qn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Jn=`[object RegExp]`,Yn=`[object String]`,Xn=`[object Number]`,Zn=`[object Boolean]`,Qn=`[object Arguments]`,$n=`[object Symbol]`,er=`[object Date]`,tr=`[object Map]`,nr=`[object Set]`,rr=`[object Array]`,ir=`[object Function]`,ar=`[object ArrayBuffer]`,or=`[object Object]`,sr=`[object Error]`,cr=`[object DataView]`,lr=`[object Uint8Array]`,ur=`[object Uint8ClampedArray]`,dr=`[object Uint16Array]`,fr=`[object Uint32Array]`,pr=`[object BigUint64Array]`,mr=`[object Int8Array]`,hr=`[object Int16Array]`,gr=`[object Int32Array]`,_r=`[object BigInt64Array]`,vr=`[object Float32Array]`,yr=`[object Float64Array]`;function br(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function xr(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Sr(e,t,n){return typeof n==`function`?Cr(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?Cr(t,r,e,s,!1):!!c},new Map,!0):Sr(e,t,()=>void 0)}function Cr(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return wr(e,t,n,r,i);case`function`:return Object.keys(t).length>0?Cr(e,Object.assign({},t),n,r,i):br(e,t);default:return xr(e)&&i?typeof t!=`string`||t===``:br(e,t)}}function wr(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return Er(e,t,n,r);if(t instanceof Map)return Tr(e,t,n,r);if(t instanceof Set)return Dr(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Kn(e)&&(e=Object(e));else{if(qn(t)===`[object Error]`)return qn(e)===`[object Error]`&&e.name===t.name&&e.message===t.message;let n=qn(e);if(n!==`[object Object]`&&n!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;ivoid 0)}function kr(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var Ar=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function jr(e){return Ar.Buffer!==void 0&&Ar.Buffer.isBuffer(e)}function Mr(e){return jr(e)}function Nr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pr(e){return Nr(e)}function Fr(e,t){return Ir(e,void 0,e,new Map,t)}function Ir(e,t,n,r,i){if(i!=null){let a=i(e,t,n,r);if(a!==void 0)return a}if(Kn(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a{t.set(a,Ir(e,a,n,r,i))}),t}if(e instanceof Set){let t=new Set;return r.set(e,t),e.forEach(e=>{t.add(Ir(e,void 0,n,r,i))}),t}if(Mr(e))return e.subarray();if(Pr(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;aOr(t,e)}var Vr=/^(?:0|[1-9]\d*)$/;function Hr(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Zr=n(((e,t)=>{t.exports=Xr()})),Qr=n((e=>{var n=t(),r=Zr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),$r=n(((e,t)=>{t.exports=Qr()})),ei=(0,f.createContext)(null),ti=$r(),ni=e=>e,R=()=>{var e=(0,f.useContext)(ei);return e?e.store.dispatch:ni},ri=()=>{},ii=()=>ri,ai=(e,t)=>e===t;function z(e){var t=(0,f.useContext)(ei),n=(0,f.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:ri,[t,e]);return(0,ti.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:ii,t?t.store.getState:ri,t?t.store.getState:ri,n,ai)}function oi(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function si(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var ci=e=>Array.isArray(e)?e:[e];function li(e){let t=Array.isArray(e[0])?e[0]:e;return si(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function ui(e,t){let n=[],{length:r}=e;for(let i=0;i`u`?di:WeakRef,pi=0,mi=1;function hi(){return{s:pi,v:void 0,o:null,p:null}}function gi(e){return e instanceof fi?e.deref():e}function _i(e,t={}){let n=hi(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e{n=hi(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function vi(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),oi(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=_i,argsMemoizeOptions:u=[]}={...n,...a},d=ci(c),f=ci(u),p=li(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=ui(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var B=vi(_i);function yi(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a{if(e!==t){let r=Si(e),i=Si(t);if(r===i&&r===0){if(et)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},wi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ti=/^\w*$/;function Ei(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||ne(e)?!0:typeof e==`string`&&(Ti.test(e)||!wi.test(e))||t!=null&&M(t,e)}function Di(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Wn(e)?Array.from(e):xi(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?M(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||Ei(e)?e:{key:e,path:ae(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;re.original)}function Oi(e,...t){let n=t.length;return n>1&&bi(e,t[0],t[1])?t=[]:n>2&&bi(t[0],t[1],t[2])&&(t=[t[0]]),Di(e,yi(t),[`asc`])}var ki=e=>e.legend.settings,Ai=e=>e.legend.size,ji=B([e=>e.legend.payload,ki],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Oi(r,n):r});function Mi(){return z(ji)}function Ni(e,t){return Ri(e)||Li(e,t)||Fi(e,t)||Pi()}function Pi(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fi(e,t){if(e){if(typeof e==`string`)return Ii(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ii(e,t):void 0}}function Ii(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nzi||Math.abs(e.left-t.left)>zi||Math.abs(e.top-t.top)>zi||Math.abs(e.width-t.width)>zi}function Vi(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Hi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=Ni((0,f.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,f.useRef)(null),a=(0,f.useRef)(n);a.current=n;var o=(0,f.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=Vi(e);if(Bi(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=Vi(e);Bi(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,f.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function Ui(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Wi=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Gi=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Ki={INIT:`@@redux/INIT${Gi()}`,REPLACE:`@@redux/REPLACE${Gi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Gi()}`};function qi(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Ji(e,t,n){if(typeof e!=`function`)throw Error(Ui(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Ui(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Ui(1));return n(Ji)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Ui(3));return i}function d(e){if(typeof e!=`function`)throw Error(Ui(4));if(c)throw Error(Ui(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Ui(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!qi(e))throw Error(Ui(7));if(e.type===void 0)throw Error(Ui(8));if(typeof e.type!=`string`)throw Error(Ui(17));if(c)throw Error(Ui(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Ui(10));r=e,f({type:Ki.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Ui(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Wi](){return this}}}return f({type:Ki.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[Wi]:m}}function Yi(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Ki.INIT})===void 0)throw Error(Ui(12));if(n(void 0,{type:Ki.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Ui(13))})}function Xi(e){let t=Object.keys(e),n={};for(let r=0;re:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Qi(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Ui(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=Zi(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function $i(e){return qi(e)&&`type`in e&&typeof e.type==`string`}var ea=Symbol.for(`immer-nothing`),ta=Symbol.for(`immer-draftable`),na=Symbol.for(`immer-state`);function ra(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ia=Object,aa=ia.getPrototypeOf,oa=`constructor`,sa=`prototype`,ca=`configurable`,la=`enumerable`,ua=`writable`,da=`value`,fa=e=>!!e&&!!e[na];function pa(e){return e?ga(e)||Ca(e)||!!e[ta]||!!e[oa]?.[ta]||wa(e)||Ta(e):!1}var ma=ia[sa][oa].toString(),ha=new WeakMap;function ga(e){if(!e||!Ea(e))return!1;let t=aa(e);if(t===null||t===ia[sa])return!0;let n=ia.hasOwnProperty.call(t,oa)&&t[oa];if(n===Object)return!0;if(!Da(n))return!1;let r=ha.get(n);return r===void 0&&(r=Function.toString.call(n),ha.set(n,r)),r===ma}function _a(e,t,n=!0){va(e)===0?(n?Reflect.ownKeys(e):ia.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function va(e){let t=e[na];return t?t.type_:Ca(e)?1:wa(e)?2:Ta(e)?3:0}var ya=(e,t,n=va(e))=>n===2?e.has(t):ia[sa].hasOwnProperty.call(e,t),ba=(e,t,n=va(e))=>n===2?e.get(t):e[t],xa=(e,t,n,r=va(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Sa(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Ca=Array.isArray,wa=e=>e instanceof Map,Ta=e=>e instanceof Set,Ea=e=>typeof e==`object`,Da=e=>typeof e==`function`,Oa=e=>typeof e==`boolean`;function ka(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Aa=e=>e.copy_||e.base_,ja=e=>e.modified_?e.copy_:e.base_;function Ma(e,t){if(wa(e))return new Map(e);if(Ta(e))return new Set(e);if(Ca(e))return Array[sa].slice.call(e);let n=ga(e);if(t===!0||t===`class_only`&&!n){let t=ia.getOwnPropertyDescriptors(e);delete t[na];let n=Reflect.ownKeys(t);for(let r=0;r1&&ia.defineProperties(e,{set:Fa,add:Fa,clear:Fa,delete:Fa}),ia.freeze(e),t&&_a(e,(e,t)=>{Na(t,!0)},!1)),e}function Pa(){ra(2)}var Fa={[da]:Pa};function Ia(e){return e===null||!Ea(e)||ia.isFrozen(e)}var La=`MapSet`,Ra=`Patches`,za=`ArrayMethods`,Ba={};function Va(e){let t=Ba[e];return t||ra(0,e),t}var Ha=e=>!!Ba[e],Ua,Wa=()=>Ua,Ga=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ha(La)?Va(La):void 0,arrayMethodsPlugin_:Ha(za)?Va(za):void 0});function Ka(e,t){t&&(e.patchPlugin_=Va(Ra),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qa(e){Ja(e),e.drafts_.forEach(Xa),e.drafts_=null}function Ja(e){e===Ua&&(Ua=e.parent_)}var Ya=e=>Ua=Ga(Ua,e);function Xa(e){let t=e[na];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Za(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[na].modified_&&(qa(t),ra(4)),pa(e)&&(e=Qa(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[na].base_,e,t)}else e=Qa(t,n);return $a(t,e,!0),qa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===ea?void 0:e}function Qa(e,t){if(Ia(t))return t;let n=t[na];if(!n)return so(t,e.handledSet_,e);if(!to(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);ao(n,e)}return n.copy_}function $a(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Na(t,n)}function eo(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var to=(e,t)=>e.scope_===t,no=[];function ro(e,t,n,r){let i=Aa(e),a=e.type_;if(r!==void 0&&ba(i,r,a)===t){xa(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;_a(i,(e,n)=>{if(fa(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??no;for(let e of o)xa(i,e,n,a)}function io(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!to(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=ja(i);ro(e,i.draft_??i,a,n),ao(i,r)})}function ao(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}eo(e)}}function oo(e,t,n){let{scope_:r}=e;if(fa(n)){let i=n[na];to(i,r)&&i.callbacks_.push(function(){_o(e),ro(e,n,ja(i),t)})}else pa(n)&&e.callbacks_.push(function(){let i=Aa(e);e.type_===3?i.has(n)&&so(n,r.handledSet_,r):ba(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&so(ba(e.copy_,t,e.type_),r.handledSet_,r)})}function so(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||fa(e)||t.has(e)||!pa(e)||Ia(e)||(t.add(e),_a(e,(r,i)=>{if(fa(i)){let t=i[na];to(t,n)&&(xa(e,r,ja(t),e.type_),eo(t))}else pa(i)&&so(i,t,n)})),e}function co(e,t){let n=Ca(e),r={type_:+!!n,scope_:t?t.scope_:Wa(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=lo;n&&(i=[r],a=uo);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var lo={get(e,t){if(t===na)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Aa(e);if(!ya(i,t,e.type_))return mo(e,i,t);let a=i[t];if(e.finalized_||!pa(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&ka(t))return a;if(a===fo(e.base_,t)||po(e,t,a)){_o(e);let n=e.type_===1?+t:t,r=yo(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Aa(e)},ownKeys(e){return Reflect.ownKeys(Aa(e))},set(e,t,n){let r=ho(Aa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=fo(Aa(e),t),i=r?.[na];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(Sa(n,r)&&(n!==void 0||ya(e.base_,t,e.type_)))return!0;_o(e),go(e)}return e.copy_[t]===n&&(n!==void 0||ya(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),oo(e,t,n)),!0},deleteProperty(e,t){return _o(e),fo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),go(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Aa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ua]:!0,[ca]:e.type_!==1||t!==`length`,[la]:r[la],[da]:n[t]}},defineProperty(){ra(11)},getPrototypeOf(e){return aa(e.base_)},setPrototypeOf(){ra(12)}},uo={};for(let e in lo){let t=lo[e];uo[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}uo.deleteProperty=function(e,t){return uo.set.call(this,e,t,void 0)},uo.set=function(e,t,n){return lo.set.call(this,e[0],t,n,e[0])};function fo(e,t){let n=e[na];return(n?Aa(n):e)[t]}function po(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!pa(n)||n[na]?!1:e.baseRefs_.has(n)}function mo(e,t,n){let r=ho(t,n);return r?da in r?r[da]:r.get?.call(e.draft_):void 0}function ho(e,t){if(!(t in e))return;let n=aa(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=aa(n)}}function go(e){e.modified_||(e.modified_=!0,e.parent_&&go(e.parent_))}function _o(e){e.copy_||=(e.assigned_=new Map,Ma(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vo=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Da(e)&&!Da(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Da(t)||ra(6),n!==void 0&&!Da(n)&&ra(7);let r;if(pa(e)){let i=Ya(this),a=yo(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?qa(i):Ja(i)}return Ka(i,n),Za(r,i)}if(!e||!Ea(e)){if(r=t(e),r===void 0&&(r=e),r===ea&&(r=void 0),this.autoFreeze_&&Na(r,!0),n){let t=[],i=[];Va(Ra).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}ra(1,e)},this.produceWithPatches=(e,t)=>{if(Da(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Oa(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Oa(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Oa(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){pa(e)||ra(8),fa(e)&&(e=bo(e));let t=Ya(this),n=yo(t,e,void 0);return n[na].isManual_=!0,Ja(t),n}finishDraft(e,t){let n=e&&e[na];n&&n.isManual_||ra(9);let{scope_:r}=n;return Ka(r,t),Za(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Va(Ra).applyPatches_;return fa(e)?r(e,t):this.produce(e,e=>r(e,t))}};function yo(e,t,n,r){let[i,a]=wa(t)?Va(La).proxyMap_(t,n):Ta(t)?Va(La).proxySet_(t,n):co(t,n);return(n?.scope_??Wa()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?io(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function bo(e){return fa(e)||ra(10,e),xo(e)}function xo(e){if(!pa(e)||Ia(e))return e;let t=e[na],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ma(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ma(e,!0);let i=n;return Ta(n)&&(n=new Set),_a(i,(e,t)=>{xa(n,e,xo(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var So=new vo().produce,V=e=>e;function Co(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var wo=Co(),To=Co,Eo=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?Zi:Zi.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Do(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Fs(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>$i(t)&&t.type===e,n}var Oo=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ko(e){return pa(e)?So(e,()=>{}):e}function Ao(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function jo(e){return typeof e==`boolean`}var Mo=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Oo;return t&&(jo(t)?a.push(wo):a.push(To(t.extraArgument))),a},No=`RTK_autoBatch`,H=()=>e=>({payload:e,meta:{[No]:!0}}),Po=e=>t=>{setTimeout(t,e)},Fo=(e,t)=>n=>{let r=!1,i,a,o=()=>{r||(r=!0,cancelAnimationFrame(i),clearTimeout(a),n())};i=e(o),a=setTimeout(o,t)},Io=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Fo(window.requestAnimationFrame,100):Po(10):e.type===`callback`?e.queueNotification:Po(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[No],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Lo=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Oo(e);return n&&r.push(Io(typeof n==`object`?n:void 0)),r};function Ro(e){let t=Mo(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(qi(n))c=Xi(n);else throw Error(Fs(1));let l;l=typeof r==`function`?r(t):t();let u=Zi;i&&(u=Eo({trace:!1,...typeof i==`object`&&i}));let d=Lo(Qi(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Ji(c,o,p)}function zo(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Fs(28));if(r in t)throw Error(Fs(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Bo(e){return typeof e==`function`}function Vo(e,t){let[n,r,i]=zo(t),a;if(Bo(e))a=()=>ko(e());else{let t=ko(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(fa(e)){let r=n(e,t);return r===void 0?e:r}if(pa(e))return So(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(Fs(9))}return r}}return e},e)}return o.getInitialState=a,o}var Ho=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Uo=(e=21)=>{let t=``,n=e;for(;n--;)t+=Ho[Math.random()*64|0];return t},Wo=Symbol.for(`rtk-slice-createasyncthunk`);function Go(e,t){return`${e}/${t}`}function Ko({creators:e}={}){let t=e?.asyncThunk?.[Wo];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Fs(11));let i=(typeof e.reducers==`function`?e.reducers(Yo()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Fs(12));if(n in o.sliceCaseReducersByType)throw Error(Fs(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Go(n,r),createNotation:typeof e.reducers==`function`};Zo(a)?$o(o,a,s,t):Xo(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?zo(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Vo(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Ao(d,r,m)),i}function i(t=l){return Ao(Ao(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=qo(a,t,()=>Ao(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function qo(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var Jo=Ko();function Yo(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function Xo({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Qo(r))throw Error(Fs(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Do(e,o):Do(e))}function Zo(e){return e._reducerDefinitionType===`asyncThunk`}function Qo(e){return e._reducerDefinitionType===`reducerWithPrepare`}function $o({type:e,reducerName:t},n,r,i){if(!i)throw Error(Fs(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||es,pending:s||es,rejected:c||es,settled:l||es})}function es(){}var ts=`task`,ns=`listener`,rs=`completed`,is=`cancelled`,as=`task-${is}`,os=`task-${rs}`,ss=`${ns}-${is}`,cs=`${ns}-${rs}`,ls=class{code;name=`TaskAbortError`;message;constructor(e){this.code=e,this.message=`${ts} ${is} (reason: ${e})`}},us=(e,t)=>{if(typeof e!=`function`)throw TypeError(Fs(32))},ds=()=>{},fs=(e,t=ds)=>(e.catch(t),e),ps=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),ms=e=>{if(e.aborted)throw new ls(e.reason)};function hs(e,t){let n=ds;return new Promise((r,i)=>{let a=()=>i(new ls(e.reason));e.aborted?a():(n=ps(e,a),t.finally(()=>n()).then(r,i))}).finally(()=>{n=ds})}var gs=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof ls?`cancelled`:`rejected`,error:e}}finally{t?.()}},_s=e=>t=>fs(hs(e,t).then(t=>(ms(e),t))),vs=e=>{let t=_s(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:ys}=Object,bs={},xs=`listenerMiddleware`,Ss=(e,t)=>{let n=t=>ps(e,()=>t.abort(e.reason));return(r,i)=>{us(r,`taskExecutor`);let a=new AbortController;n(a);let o=gs(async()=>{ms(e),ms(a.signal);let t=await r({pause:_s(a.signal),delay:vs(a.signal),signal:a.signal});return ms(a.signal),t},()=>a.abort(os));return i?.autoJoin&&t.push(o.catch(ds)),{result:_s(e)(o),cancel(){a.abort(as)}}}},Cs=(e,t)=>{let n=async(n,r)=>{ms(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await hs(t,Promise.race(a));return ms(t),e}finally{i()}};return((e,t)=>fs(n(e,t)))},ws=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Do(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Fs(21));return us(a,`options.listener`),{predicate:i,type:t,effect:a}},Ts=ys(e=>{let{type:t,predicate:n,effect:r}=ws(e);return{id:Uo(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Fs(22))}}},{withTypes:()=>Ts}),Es=(e,t)=>{let{type:n,effect:r,predicate:i}=ws(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},Ds=e=>{e.pending.forEach(e=>{e.abort(ss)})},Os=(e,t)=>()=>{for(let e of t.keys())Ds(e);e.clear()},ks=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},As=ys(Do(`${xs}/add`),{withTypes:()=>As}),js=Do(`${xs}/removeAll`),Ms=ys(Do(`${xs}/remove`),{withTypes:()=>Ms}),Ns=(...e)=>{console.error(`${xs}/error`,...e)},Ps=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=Ns}=e;us(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Ds(e)}),c=(e=>{let n=Es(t,e)??Ts(e);return s(n)});ys(c,{withTypes:()=>c});let l=e=>{let n=Es(t,e);return n&&(n.unsubscribe(),e.cancelActive&&Ds(n)),!!n};ys(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=Cs(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,ys({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:vs(u.signal),pause:_s(u.signal),extra:a,signal:u.signal,fork:Ss(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(ss),n.delete(e))})},cancel:()=>{u.abort(ss),e.pending.delete(u)},throwIfCancelled:()=>{ms(u.signal)}})))}catch(e){e instanceof ls||ks(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(cs),i(e),e.pending.delete(u)}},d=Os(t,n);return{middleware:e=>n=>r=>{if(!$i(r))return n(r);if(As.match(r))return c(r.payload);if(js.match(r)){d();return}if(Ms.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===bs)throw Error(Fs(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,ks(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=bs}return s},startListening:c,stopListening:l,clearListeners:d}};function Fs(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Is=Jo({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),Ls=Is.actions,Rs=Ls.setMargin,zs=Ls.setLayout,Bs=Ls.setChartSize,Vs=Ls.setScale,Hs=Is.reducer;function Us(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function U(e){return Number.isFinite(e)}function Ws(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Gs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ks(e){for(var t=1;t{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(je(c)){if(c===`top`&&F(e.top))return Ks(Ks({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&F(e.bottom))return Ks(Ks({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&F(e.left))return Ks(Ks({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&F(e.right))return Ks(Ks({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&F(e[a]))return Ks(Ks({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&F(e[o]))return Ks(Ks({},e),{},{[o]:e[o]+(i||0)})}return e},Zs=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Qs={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:$t,none:Jt,silhouette:en,wiggle:tn,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},$s=(e,t,n)=>{var r=Qs[n]??Jt,i=Qt().keys(t).value((e,t)=>Number(W(e,t,0))).order(Yt).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=W(e[i],t[r],0);Array.isArray(a)&&a.length===2&&F(a[0])&&F(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function ec(e){return e==null?void 0:String(e)}function tc(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!I(i[t.dataKey])){var s=ye(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=W(i,I(o)?t.dataKey:o),l=t.scale.map(c);return F(l)?l:null}var nc=e=>{var t=e.flat(2).filter(F);return[Math.min(...t),Math.max(...t)]},rc=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ic=(e,t,n)=>{if(e!=null&&Object.keys(e).length!==0)return rc(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=nc(Us(r,t,n));return!U(i[0])||!U(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},ac=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oc=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,sc=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Oi(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;su&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function cc(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Ks(Ks({},t),{},{dataKey:n,payload:r,value:i,name:a})}function lc(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var uc=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},dc=(e,t)=>t===`centric`?e.angle:e.radius,fc=e=>e.layout.width,pc=e=>e.layout.height,mc=e=>e.layout.scale,hc=e=>e.layout.margin,gc=B(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),_c=B(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),vc=`data-recharts-item-index`;function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bc(e){for(var t=1;te.brush.height;function Tc(e){return _c(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Ec(e){return _c(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Dc(e){return gc(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function Oc(e){return gc(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var kc=B([fc,pc,hc,wc,Tc,Ec,Dc,Oc,ki,Ai],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=bc(bc({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=Xs(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return bc(bc({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Ac=B(kc,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),jc=B(fc,pc,(e,t)=>({x:0,y:0,width:e,height:t})),Mc=(0,f.createContext)(null),Nc=()=>(0,f.useContext)(Mc)!=null,Pc=e=>e.brush,Fc=B([Pc,kc,hc],(e,t,n)=>({height:e.height,x:F(e.x)?e.x:t.left,y:F(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:F(e.width)?e.width:t.width}));function Ic(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Lc(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=Ic(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Rc(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Lc(e,t,{leading:r,maxWait:t,trailing:i})}var zc=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},Bc={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Vc=(e,t,n)=>{var r=n.width,i=r===void 0?Bc.width:r,a=n.height,o=a===void 0?Bc.height:a,s=n.aspect,c=n.maxHeight,l=fe(i)?e:Number(i),u=fe(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},Hc={width:0,height:0,overflow:`visible`},Uc={width:0,overflowX:`visible`},Wc={height:0,overflowY:`visible`},Gc={},Kc=e=>{var t=e.width,n=e.height,r=fe(t),i=fe(n);return r&&i?Hc:r?Uc:i?Wc:Gc};function qc(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Bc.width,a=Bc.height):i===void 0?i=r&&r>0?void 0:Bc.width:a===void 0&&(a=r&&r>0?void 0:Bc.height),{width:i,height:a}}var Jc=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function Yc(){return Yc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n({width:n,height:r}),[n,r]);return ul(i)?f.createElement(ll.Provider,{value:i},t):null}var fl=()=>(0,f.useContext)(ll),pl=(0,f.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Bc.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?Bc.minWidth:s,u=e.minHeight,d=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?Bc.debounce:m,g=e.id,_=e.className,v=e.onResize,y=e.style,b=y===void 0?{}:y,x=sl(e,Jc),S=(0,f.useRef)(null),C=(0,f.useRef)();C.current=v,(0,f.useImperativeHandle)(t,()=>S.current);var w=tl((0,f.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,f.useCallback)((e,t)=>{E(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,f.useEffect)(()=>{if(S.current==null||typeof ResizeObserver>`u`)return Se;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;D(i,a),(t=C.current)==null||t.call(C,i,a)}};h>0&&(e=Rc(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),()=>{t.disconnect()}},[D,h]);var O=T.containerWidth,k=T.containerHeight;zc(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var A=Vc(O,k,{width:a,height:o,aspect:n,maxHeight:d}),j=A.calculatedWidth,M=A.calculatedHeight;return zc(O<0||k<0||j!=null&&j>0||M!=null&&M>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,j,M,a,o,c,u,n),f.createElement(`div`,Yc({id:g?`${g}`:void 0,className:l(`recharts-responsive-container`,_),style:Zc(Zc({},b),{},{width:a,height:o,minWidth:c,minHeight:u,maxHeight:d}),ref:S},x),f.createElement(`div`,{style:Kc({width:a,height:o})},f.createElement(dl,{width:j,height:M},p)))}),ml=(0,f.forwardRef)((e,t)=>{var n=fl();if(Ws(n.width)&&Ws(n.height))return e.children;var r=qc({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=Vc(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return F(s)&&F(c)?f.createElement(dl,{width:s,height:c},e.children):f.createElement(pl,Yc({},e,{width:i,height:a,ref:t}))}),hl=()=>{var e=Nc(),t=z(Ac),n=z(Fc),r=z(Pc)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},gl={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},_l=()=>z(kc)??gl,vl=()=>z(fc),yl=()=>z(pc),bl=()=>z(e=>e.layout.margin),G=e=>e.layout.layoutType,xl=()=>z(G),Sl=()=>{var e=xl();if(e===`horizontal`||e===`vertical`)return e},Cl=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},wl=()=>xl()!==void 0,Tl=e=>{var t=R(),n=Nc(),r=e.width,i=e.height,a=fl(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,f.useEffect)(()=>{!n&&Ws(o)&&Ws(s)&&t(Bs({width:o,height:s}))},[t,n,o,s]),null},El=Jo({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`,position:void 0,offset:0},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter,e.settings.position=t.payload.position,e.settings.offset=t.payload.offset},addLegendPayload:{reducer(e,t){e.payload.push(V(t.payload))},prepare:H()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=bo(e).payload.indexOf(V(r));a>-1&&(e.payload[a]=V(i))},prepare:H()},removeLegendPayload:{reducer(e,t){var n=bo(e).payload.indexOf(V(t.payload));n>-1&&e.payload.splice(n,1)},prepare:H()}}}),Dl=El.actions,Ol=Dl.setLegendSize,kl=Dl.setLegendSettings,Al=Dl.addLegendPayload,jl=Dl.replaceLegendPayload,Ml=Dl.removeLegendPayload,Nl=El.reducer,Pl=n((e=>{var n=t();n.useSyncExternalStore,n.useRef,n.useEffect,n.useMemo,n.useDebugValue}));n(((e,t)=>{t.exports=Pl()}))();function Fl(e){e()}function Il(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Fl(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){r&&e!==null&&(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Ll={notify(){},get:()=>[]};function Rl(e,t){let n,r=Ll,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Il())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Ll)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var zl=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Bl=typeof navigator<`u`&&navigator.product===`ReactNative`,Vl=zl||Bl?f.useLayoutEffect:f.useEffect;function Hl(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function Ul(e,t){if(Hl(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r{let e=Rl(i);return{store:i,subscription:e,getServerState:r==null?void 0:()=>r}},[i,r]),o=f.useMemo(()=>i.getState(),[i]);Vl(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||ql;return f.createElement(s.Provider,{value:a},t)}var Yl=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function Xl(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function Zl(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(Yl.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Ul(e[n],t[n]))return!1}else if(!Xl(e[n],t[n]))return!1;return!0}var Ql=B([fc,pc,hc],(e,t,n)=>({x:n.left||0,y:n.top||0,width:Math.max(e-(n.left||0)-(n.right||0),0),height:Math.max(t-(n.top||0)-(n.bottom||0),0)}));function $l(e,t){return e===`start`&&t===`start`?``:`translate(${e===`inherit`?`0`:{start:`0`,middle:`-50%`,end:`-100%`}[e]}, ${{start:`0`,middle:`-50%`,end:`-100%`}[t]??`0`})`}var eu=e(),tu=[`contextPayload`];function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{s(kl({align:t,layout:n,verticalAlign:r,itemSorter:i,position:a,offset:o}))},[s,t,n,r,i,a,o]),null}function Cu(e){var t=e.width,n=e.height,r=R();return(0,f.useLayoutEffect)(()=>{r(Ol({width:t,height:n}))},[r,t,n]),(0,f.useLayoutEffect)(()=>()=>{r(Ol({width:0,height:0}))},[r]),null}function wu(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var Tu={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,labelStyle:{},layout:`auto`,verticalAlign:`bottom`,offset:0};function Eu(e){var t=Dn(e,Tu),n=e.layout&&e.layout!==`auto`?e.layout:vu(t.position),r=Mi(),i=Ne(),a=bl(),o=z(e=>yu(e,t.position)),s=t.width,c=t.height,l=t.wrapperStyle,u=t.portal,d=u==null&&(t.position==null||je(t.position)),p=ru(Hi([r]),2),m=p[0],h=p[1],g=vl(),_=yl();if(g==null||_==null||t.position!=null&&o==null)return null;var v=wu(n,c,s,g-(a?.left||0)-(a?.right||0)),y=t.position==null?null:ke({viewBox:o??{x:0,y:0,width:g,height:_},position:t.position,offset:t.offset??0}),b=bu(t.position,t.offset??0,m),x=n===`vertical`?(o?.width??0)/2:o?.width??0,S=n===`horizontal`?(o?.height??0)/2:o?.height??0,C=y?{width:`max-content`,height:`max-content`,maxWidth:x,maxHeight:S,overflowY:`auto`,top:y.y+(b.top??0),left:y.x+(b.left??0),transform:$l(y.horizontalAnchor,y.verticalAnchor)}:xu(l,t,a,g,_,m),w=u?l:uu(uu({position:`absolute`,width:v?.width||s||`auto`,height:v?.height||c||`auto`},C),l),T=u??i;if(T==null||r==null)return null;var E=f.createElement(`div`,{className:`recharts-legend-wrapper`,style:w,ref:h},f.createElement(Su,{layout:n,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter,position:t.position,offset:t.offset}),d&&f.createElement(Cu,m),f.createElement(_u,nu({},t,{layout:n},v,{margin:a,chartWidth:g,chartHeight:_,contextPayload:r})));return(0,eu.createPortal)(E,T)}var Du=f.memo(Eu,Zl);Du.displayName=`Legend`;function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.separator,n=t===void 0?Vu.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?Vu.labelStyle:a,s=e.payload,c=e.formatter,u=e.itemSorter,d=e.wrapperClassName,p=e.labelClassName,m=e.label,h=e.labelFormatter,g=e.accessibilityLayer,_=g===void 0?Vu.accessibilityLayer:g,v=()=>{if(s&&s.length){var e={padding:0,margin:0},t=Hu(s,u).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||Bu,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var p=Pu(d,2);l=p[0],u=p[1]}else if(d!=null)l=d;else return null}var m=Au(Au({},Vu.itemStyle),{},{color:e.color||Vu.itemStyle.color},i);return f.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:m},pe(u)?f.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,pe(u)?f.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,f.createElement(`span`,{className:`recharts-tooltip-item-value`},l),f.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return f.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},y=Au(Au({},Vu.contentStyle),r),b=Au({margin:0},o),x=!I(m),S=x?m:``,C=l(`recharts-default-tooltip`,d),w=l(`recharts-tooltip-label`,p);x&&h&&s!=null&&(S=h(m,s));var T=_?{role:`status`,"aria-live":`assertive`}:{};return f.createElement(`div`,Ou({className:C,style:y},T),f.createElement(`p`,{className:w,style:b},f.isValidElement(S)?S:`${S}`),v())},Wu=`recharts-tooltip-wrapper`,Gu={visibility:`hidden`};function Ku(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return l(Wu,{[`${Wu}-right`]:F(n)&&t&&F(t.x)&&n>=t.x,[`${Wu}-left`]:F(n)&&t&&F(t.x)&&n=t.y,[`${Wu}-top`]:F(r)&&t&&F(t.y)&&r0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(uf+l?Math.max(u,f):Math.max(d,f)}function Ju(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Yu(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s&&s.height>0&&s.width>0&&n?(d=qu({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=qu({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Ju({translateX:d,translateY:f,useTranslate3d:c})):u=Gu,{cssProperties:u,cssClasses:Ku({translateX:d,translateY:f,coordinate:n})}}var Xu={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Zu(e,t){return nd(e)||td(e,t)||$u(e,t)||Qu()}function Qu(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $u(e,t){if(e){if(typeof e==`string`)return ed(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ed(e,t):void 0}}function ed(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nXu.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),2),t=e[0],n=e[1];return(0,f.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{n(e.matches)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}},[]),t}function id(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ad(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];f.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(ad(ad({},r),{},{dismissed:!1}));var a=Yu({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:e.lastBoundingBox,useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=ad(ad({},e.hasPortalFromProps?{}:ad(ad({transition:hd({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return f.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var _d=f.memo(gd),vd=()=>z(e=>e.rootProps.accessibilityLayer)??!0;function yd(){return yd=Object.assign?Object.assign.bind():function(e){for(var t=1;tU(e.x)&&U(e.y),Dd=e=>e.base!=null&&Ed(e.base)&&Ed(e),Od=e=>e.x,kd=e=>e.y,Ad=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${be(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=Td[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return Td[n]||Ye},jd={connectNulls:!1,type:`linear`},Md=e=>{var t=e.type,n=t===void 0?jd.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?jd.connectNulls:s,l=Ad(n,o),u=c?i.filter(Ed):i;if(Array.isArray(a)){var d,f=i.map((e,t)=>xd(xd({},e),{},{base:a[t]}));return d=o===`vertical`?$e().y(kd).x1(Od).x0(e=>e.base.x):$e().x(Od).y1(kd).y0(e=>e.base.y),d.defined(Dd).curve(l)(c?f.filter(Dd):f)}return(o===`vertical`&&F(a)?$e().y(kd).x1(Od).x0(a):F(a)?$e().x(Od).y1(kd).y0(a):Qe().x(Od).y(kd)).defined(Ed).curve(l)(u)},Nd=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=xl();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?Md(o):r;return f.createElement(`path`,yd({},g(e),yn(e),{className:l(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},Pd=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t`M${e},${i}v${r}M${a},${t}h${n}`,Wd=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,u=e.width,d=u===void 0?0:u,p=e.height,m=p===void 0?0:p,h=e.className,g=Vd(e,Pd),_=Ld({x:n,y:i,top:o,left:c,width:d,height:m},g);return!F(n)||!F(i)||!F(d)||!F(m)||!F(o)||!F(c)?null:f.createElement(`path`,Fd({},v(_),{className:l(`recharts-cross`,h),d:Ud(n,i,d,m,o,c)}))};function Gd(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}var Kd=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],qd=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),Jd=(e,t)=>n=>qd(Kd(e,t),n),Yd=(e,t)=>n=>qd([...Kd(e,t).map((e,t)=>e*t).slice(1),0],n),Xd=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},Zd=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=Xd(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},Qd=(e,t,n,r)=>{var i=Jd(e,n),a=Jd(t,r),o=Yd(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},$d=function(){return Qd(...Zd(...arguments))},ef=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?16.67:a,s=1,c=[0],l=0,u=0,d=1e4,f=0;f{if(e<=0)return 0;if(e>=1)return s;var t=e*h,n=Math.floor(t),r=t-n;return(c[n]??0)+((c[n+1]??0)-(c[n]??0))*r}},tf=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return $d(e);case`spring`:return ef();default:if(e.split(`(`)[0]===`cubic-bezier`)return $d(e)}return typeof e==`function`?e:null},nf=(0,f.createContext)((e,t,n)=>{var r,i=a=>{var o=t.tick(a);if(t.getState()===`active`){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,o)}else r=e.setTimeout(i,o)};return r=e.setTimeout(i,0),()=>r?.()});nf.Provider;function rf(e){var t=(0,f.useContext)(nf);return(0,f.useMemo)(()=>e??t,[e,t])}function af(e,t,n){return(t=of(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function of(e){var t=sf(e,`string`);return typeof t==`symbol`?t:t+``}function sf(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var cf=`init`,lf=`pending`,uf=`active`,df=`completed`;function ff(e){return Math.max(0,e)}var pf=class{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;af(this,`state`,cf),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=ff(e.animationDuration),this.animationBegin=ff(e.animationBegin),this.progress=0,this.from=e.from,this.to=e.to,this.easing=e.easing,(t=e.onAnimationStart)==null||t.call(e)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(e){if(this.getState()===cf)return this.state=lf,this.beginStartedTime=e,this.animationBegin;if(this.getState()===lf){if(this.beginStartedTime==null)throw Error();var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=uf,this.animationStartedTime=e,this.nextAnimationUpdate(0)):ff(this.animationBegin-t)}if(this.getState()===uf){if(this.animationStartedTime==null)throw Error();var n=e-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state===`active`){var e;(e=this.onAnimationEnd)==null||e.call(this)}this.state=df}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}},mf=class extends pf{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ve(this.getFrom(),this.getTo(),this.getProgress()))}},hf=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):r=requestAnimationFrame(i)};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function gf(e,t){return xf(e)||bf(e,t)||vf(e,t)||_f()}function _f(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vf(e,t){if(e){if(typeof e==`string`)return yf(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yf(e,t):void 0}}function yf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{},onAnimationStart:()=>{}},Cf=0,wf=1;function Tf(e){var t=Dn(e,Sf),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,s=t.begin,c=t.onAnimationEnd,l=t.onAnimationStart,u=t.children,d=rd(),p=r===`auto`?!Xu.isSsr&&!d:r,m=rf(t.animationController),h=gf((0,f.useState)(p?Cf:wf),2),g=h[0],_=h[1];return(0,f.useEffect)(()=>{p||_(wf)},[p]),(0,f.useEffect)(()=>{var e=tf(o);return!p||!i||e==null?Se:m(new hf,new mf({animationId:n,easing:e,animationDuration:a,animationBegin:s,onAnimationStart:l,onAnimationEnd:c,from:Cf,to:wf}),_)},[m,n,p,i,a,o,s,l,c]),u(Number(g))}function Ef(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,f.useRef)(he(t)),r=(0,f.useRef)(e);return r.current!==e&&(n.current=he(t),r.current=e),n.current}var Df=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),Of=(e,t,n)=>e.map(e=>`${Df(e)} ${t}ms ${n}`).join(`,`),kf=[`radius`],Af=[`radius`],jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf;function Vf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hf(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{var a=le(n),o=le(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;ps?s:h}d=P(jf||=tp([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=P(Mf||=tp([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=P(Nf||=tp([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=P(Pf||=tp([`A `,`,`,`,0,0,`,`, + `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=P(Ff||=tp([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=P(If||=tp([`A `,`,`,`,0,0,`,`, + `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=P(Lf||=tp([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=P(Rf||=tp([`A `,`,`,`,0,0,`,`, + `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=P(zf||=tp(`M .,. + A .,.,0,0,.,.,. + L .,. + A .,.,0,0,.,.,. + L .,. + A .,.,0,0,.,.,. + L .,. + A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=P(Bf||=tp([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},rp={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},ip=e=>{var t=Dn(e,rp),n=(0,f.useRef)(null),r=Yf((0,f.useState)(-1),2),i=r[0],a=r[1];(0,f.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,u=t.height,d=t.radius,p=t.className,m=t.animationEasing,h=t.animationDuration,g=t.animationBegin,_=t.isAnimationActive,y=t.isUpdateAnimationActive,b=(0,f.useRef)(c),x=(0,f.useRef)(u),S=(0,f.useRef)(o),C=(0,f.useRef)(s),w=Ef((0,f.useMemo)(()=>({x:o,y:s,width:c,height:u,radius:d}),[o,s,c,u,d]),`rectangle-`);if(o!==+o||s!==+s||c!==+c||u!==+u||c===0||u===0)return null;var T=l(`recharts-rectangle`,p);if(!y){var E=v(t);E.radius;var D=qf(E,kf);return f.createElement(`path`,Kf({},D,{x:le(o),y:le(s),width:le(c),height:le(u),radius:typeof d==`number`?d:void 0,className:T,d:np(o,s,c,u,d)}))}var O=b.current,k=x.current,A=S.current,j=C.current,M=`0px ${i===-1?1:i}px`,N=`${i}px ${i}px`,ee=Of([`strokeDasharray`],h,typeof m==`string`?m:rp.animationEasing);return f.createElement(Tf,{animationId:w,key:w,canBegin:i>0,duration:h,easing:m,isActive:y,begin:g},e=>{var r=ve(O,c,e),i=ve(k,u,e),a=ve(A,o,e),l=ve(j,s,e);n.current&&(b.current=r,x.current=i,S.current=a,C.current=l);var p=_?e>0?{transition:ee,strokeDasharray:N}:{strokeDasharray:M}:{strokeDasharray:N},m=v(t);m.radius;var h=qf(m,Af);return f.createElement(`path`,Kf({},h,{radius:typeof d==`number`?d:void 0,className:T,d:np(a,l,r,i,d),ref:n,style:Hf(Hf({},p),t.style)}))})};function ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function op(e){for(var t=1;te*180/Math.PI,fp=(e,t,n,r)=>({x:e+Math.cos(-up*r)*n,y:t+Math.sin(-up*r)*n}),pp=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},mp=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},hp=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,o=mp({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:dp(c),angleInRadian:c}},gp=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},_p=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},vp=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=hp({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(ac||a===0)return null;var l=gp(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f=u&&f<=d}else{for(;f>u;)f-=360;for(;f=d&&f<=u}return p?op(op({},t),{},{radius:a,angle:_p(f,t)}):null};function yp(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[fp(t,n,r,i),fp(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var bp,xp,Sp,Cp,wp,Tp,Ep;function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;tue(t-e)*Math.min(Math.abs(t-e),359.999),Ap=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/up,d=c?i:i+a*u,f=fp(t,n,l,d),p=fp(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:fp(t,n,l*Math.cos(u*up),m),theta:u}},jp=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=kp(a,o),c=a+s,l=fp(t,n,i,a),u=fp(t,n,i,c),d=P(bp||=Op([`M `,`,`,` + A `,`,`,`,0, + `,`,`,`, + `,`,`,` + `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=fp(t,n,r,a),p=fp(t,n,r,c);d+=P(xp||=Op([`L `,`,`,` + A `,`,`,`,0, + `,`,`,`, + `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=P(Sp||=Op([`L `,`,`,` Z`]),t,n);return d},Mp=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=ue(l-c),d=Ap({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=Ap({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?P(Cp||=Op([`M `,`,`,` + a`,`,`,`,0,0,1,`,`,0 + a`,`,`,`,0,0,1,`,`,0 + `]),p.x,p.y,a,a,a*2,a,a,-a*2):jp({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=P(wp||=Op([`M `,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,` + A`,`,`,`,0,`,`,`,`,`,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,` + `]),p.x,p.y,a,a,+(u<0),f.x,f.y,i,i,+(y>180),+(u<0),g.x,g.y,a,a,+(u<0),_.x,_.y);if(r>0){var x=Ap({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=Ap({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=P(Tp||=Op([`L`,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,` + A`,`,`,`,0,`,`,`,`,`,`,`,` + A`,`,`,`,0,0,`,`,`,`,`,`Z`]),D.x,D.y,a,a,+(u<0),E.x,E.y,r,r,+(k>180),+(u>0),S.x,S.y,a,a,+(u<0),C.x,C.y)}else b+=P(Ep||=Op([`L`,`,`,`Z`]),t,n);return b},Np={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Pp=e=>{var t=Dn(e,Np),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,p=t.className;if(a0&&Math.abs(u-d)<360?Mp({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,h/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}):jp({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});return f.createElement(`path`,Dp({},v(t),{className:m,d:_}))};function Fp(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(vn(t)){if(e===`centric`){var r=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,s=t.angle,c=fp(r,i,a,s),l=fp(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return yp(t)}}function Ip(e){return ne(e)?NaN:Number(e)}function Lp(e){return e?(e=Ip(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function Rp(e,t,n){n&&typeof n!=`number`&&bi(e,t,n)&&(t=n=void 0),e=Lp(e),t===void 0?(t=e,e=0):t=Lp(t),n=n===void 0?ee.chartData,Bp=B([zp],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Vp=(e,t,n,r)=>r?Bp(e):zp(e),Hp=(e,t,n)=>n?Bp(e):zp(e),Up=B([Vp],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});B([Bp],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});var Wp=B([zp],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});function Gp(e,t){return Xp(e)||Yp(e,t)||qp(e,t)||Kp()}function Kp(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qp(e,t){if(e){if(typeof e==`string`)return Jp(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jp(e,t):void 0}}function Jp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||en)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;tr?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),rh||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i)t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;else{if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(n)}))());function tm(e){return e===0?1:Math.floor(new K.default(e).abs().log(10).toNumber())+1}function nm(e,t,n){for(var r=new K.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function rm(e,t){return cm(e)||sm(e,t)||am(e,t)||im()}function im(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function am(e,t){if(e){if(typeof e==`string`)return om(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?om(e,t):void 0}}function om(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=rm(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},um=(e,t,n)=>{if(e.lte(0))return new K.default(0);var r=tm(e.toNumber()),i=new K.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new K.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new K.default(s.toNumber()):new K.default(Math.ceil(s.toNumber()))},dm=(e,t,n)=>{if(e.lte(0))return new K.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new K.default(i).abs().log(10).toNumber()),o=new K.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new K.default(10).pow(l))}var u=r[c]??1,d=new K.default(u).mul(o);return t?d:new K.default(Math.ceil(d.toNumber()))},fm=(e,t,n)=>{var r=new K.default(1),i=new K.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new K.default(10).pow(tm(e)-1),i=new K.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new K.default(Math.floor(e)))}else e===0?i=new K.default(Math.floor((t-1)/2)):n||(i=new K.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:um;if(!Number.isFinite((t-e)/(n-1)))return{step:new K.default(0),tickMin:new K.default(0),tickMax:new K.default(0)};var o=a(new K.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new K.default(0):(s=new K.default(e).add(t).div(2),s=s.sub(new K.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new K.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?pm(e,t,n,r,i+1,a):(u0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new K.default(c).mul(o)),tickMax:s.add(new K.default(l).mul(o))})},mm=function(e){var t=rm(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=Math.max(i,2),c=rm(lm([n,r]),2),l=c[0],u=c[1];if(l===-1/0||u===1/0){var d=u===1/0?[l,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?d.reverse():d}if(l===u)return fm(l,i,a);var f=pm(l,u,s,a,0,o===`snap125`?dm:um),p=f.step,m=f.tickMin,h=f.tickMax,g=nm(m,h.add(new K.default(.1).mul(p)),p);return n>r?g.reverse():g},hm=function(e,t){var n=rm(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=rm(lm([r,i]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0)return[r,i];if(c===l)return[c];var u=o===`snap125`?dm:um,d=Math.max(t,2),f=u(new K.default(l).sub(c).div(d-1),a,0),p=[...nm(new K.default(c),new K.default(l),f),l];if(a===!1){p=p.map(e=>Math.round(e));var m=p.length-1;m>0&&p[m]===p[m-1]&&(p=p.slice(0,m))}return r>i?p.reverse():p},gm=e=>e.rootProps.barCategoryGap,_m=e=>e.rootProps.stackOffset,vm=e=>e.rootProps.reverseStackOrder,ym=e=>e.options.chartName,bm=e=>e.rootProps.syncId,xm=e=>e.rootProps.syncMethod,Sm=e=>e.options.eventEmitter,Cm=e=>e.rootProps.baseValue,wm={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Tm={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:wm.axis},Em={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:wm.axis},Dm=(e,t)=>{if(e&&t)return e!=null&&e.reversed?[t[1],t[0]]:t};function Om(e,t,n){if(n!==`auto`)return n;if(e!=null)return Zs(e,t)?`category`:`number`}function km(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Am(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Cl],(e,t)=>{if(e!=null)return e;var n=Om(t,`angleAxis`,Pm.type)??`category`;return Am(Am({},Pm),{},{type:n})}),Lm=B([(e,t)=>e.polarAxis.radiusAxis[t],Cl],(e,t)=>{if(e!=null)return e;var n=Om(t,`radiusAxis`,Fm.type)??`category`;return Am(Am({},Fm),{},{type:n})}),Rm=e=>e.polarOptions,zm=B([fc,pc,kc],pp),Bm=B([Rm,zm],(e,t)=>{if(e!=null)return ge(e.innerRadius,t,0)}),Vm=B([Rm,zm],(e,t)=>{if(e!=null)return ge(e.outerRadius,t,t*.8)}),Hm=B([Rm],e=>e==null?[0,0]:[e.startAngle,e.endAngle]);B([Im,Hm],Dm);var Um=B([zm,Bm,Vm],(e,t,n)=>{if(e!=null&&t!=null&&n!=null)return[t,n]});B([Lm,Um],Dm);var Wm=B([G,Rm,Bm,Vm,fc,pc],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var o=t.cx,s=t.cy,c=t.startAngle,l=t.endAngle;return{cx:ge(o,i,i/2),cy:ge(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),Gm=(e,t)=>t,Km=(e,t,n)=>n;function qm(e){return e?.id}function Jm(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,o=n.dataKey,s=new Map;return e.forEach(e=>{var t=e.data??i;if(t!=null&&t.length!==0){var n=qm(e);t.forEach((t,r)=>{var i=o==null||a?r:String(W(t,o,null)),c=W(t,e.dataKey,0),l=s.has(i)?s.get(i):{};Object.assign(l,{[n]:c}),s.set(i,l)})}}),Array.from(s.values())}function Ym(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var Xm=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Zm(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Qm(e,t){if(e.length===t.length){for(var n=0;n{var t=G(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},eh=e=>e.tooltip.settings.axisId;function th(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i}}return r}}}}}var nh=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!Zp(t)){for(var n,r,i=0;ir)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function rh(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function ih(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ah(e){let t,n,r;e.length===2?(t=e===rh||e===ih?e:oh,n=e,r=e):(t=rh,n=(t,n)=>rh(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function oh(){return 0}function sh(e){return e===null?NaN:+e}function*ch(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var lh=ah(rh),uh=lh.right;lh.left,ah(sh).center;var dh=class extends Map{constructor(e,t=hh){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(fh(this,e))}has(e){return super.has(fh(this,e))}set(e,t){return super.set(ph(this,e),t)}delete(e){return super.delete(mh(this,e))}};function fh({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function ph({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function mh({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function hh(e){return typeof e==`object`&&e?e.valueOf():e}function gh(e=rh){if(e===rh)return _h;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function _h(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et))}var vh=Math.sqrt(50),yh=Math.sqrt(10),bh=Math.sqrt(2);function xh(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=vh?10:a>=yh?5:a>=bh?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function Eh(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Dh(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?_h:gh(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));Dh(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Oh(e,n,t),i(e[r],a)>0&&Oh(e,n,r);o0;)--s}i(e[n],a)===0?Oh(e,n,s):(++s,Oh(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Oh(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function kh(e,t,n){if(e=Float64Array.from(ch(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return Eh(e);if(t>=1)return Th(e);var r,i=(r-1)*t,a=Math.floor(i),o=Th(Dh(e,a).subarray(0,a+1));return o+(Eh(e.subarray(a+1))-o)*(i-a)}}function Ah(e,t,n=sh){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function jh(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Jh.exec(e))?new ug(t[1],t[2],t[3],1):(t=Yh.exec(e))?new ug(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Xh.exec(e))?sg(t[1],t[2],t[3],t[4]):(t=Zh.exec(e))?sg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Qh.exec(e))?_g(t[1],t[2]/100,t[3]/100,1):(t=$h.exec(e))?_g(t[1],t[2]/100,t[3]/100,t[4]):eg.hasOwnProperty(e)?og(eg[e]):e===`transparent`?new ug(NaN,NaN,NaN,0):null}function og(e){return new ug(e>>16&255,e>>8&255,e&255,1)}function sg(e,t,n,r){return r<=0&&(e=t=n=NaN),new ug(e,t,n,r)}function cg(e){return e instanceof Vh||(e=ag(e)),e?(e=e.rgb(),new ug(e.r,e.g,e.b,e.opacity)):new ug}function lg(e,t,n,r){return arguments.length===1?cg(e):new ug(e,t,n,r??1)}function ug(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}zh(ug,lg,Bh(Vh,{brighter(e){return e=e==null?Uh:Uh**+e,new ug(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hh:Hh**+e,new ug(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ug(hg(this.r),hg(this.g),hg(this.b),mg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dg,formatHex:dg,formatHex8:fg,formatRgb:pg,toString:pg}));function dg(){return`#${gg(this.r)}${gg(this.g)}${gg(this.b)}`}function fg(){return`#${gg(this.r)}${gg(this.g)}${gg(this.b)}${gg((isNaN(this.opacity)?1:this.opacity)*255)}`}function pg(){let e=mg(this.opacity);return`${e===1?`rgb(`:`rgba(`}${hg(this.r)}, ${hg(this.g)}, ${hg(this.b)}${e===1?`)`:`, ${e})`}`}function mg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gg(e){return e=hg(e),(e<16?`0`:``)+e.toString(16)}function _g(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bg(e,t,n,r)}function vg(e){if(e instanceof bg)return new bg(e.h,e.s,e.l,e.opacity);if(e instanceof Vh||(e=ag(e)),!e)return new bg;if(e instanceof bg)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new bg(o,s,c,e.opacity)}function yg(e,t,n,r){return arguments.length===1?vg(e):new bg(e,t,n,r??1)}function bg(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}zh(bg,yg,Bh(Vh,{brighter(e){return e=e==null?Uh:Uh**+e,new bg(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hh:Hh**+e,new bg(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ug(Cg(e>=240?e-240:e+120,i,r),Cg(e,i,r),Cg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new bg(xg(this.h),Sg(this.s),Sg(this.l),mg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=mg(this.opacity);return`${e===1?`hsl(`:`hsla(`}${xg(this.h)}, ${Sg(this.s)*100}%, ${Sg(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function xg(e){return e=(e||0)%360,e<0?e+360:e}function Sg(e){return Math.max(0,Math.min(1,e||0))}function Cg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var wg=e=>()=>e;function Tg(e,t){return function(n){return e+n*t}}function Eg(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Dg(e){return(e=+e)==1?Og:function(t,n){return n-t?Eg(t,n,e):wg(isNaN(t)?n:t)}}function Og(e,t){var n=t-e;return n?Tg(e,n):wg(isNaN(e)?t:e)}var kg=(function e(t){var n=Dg(t);function r(e,t){var r=n((e=lg(e)).r,(t=lg(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Og(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ag(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Pg(r,i)})),n=Lg.lastIndex;return nt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Xg(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?Zg:Xg,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Pg))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Gg),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Hg,u()},d.clamp=function(e){return arguments.length?(o=e?!0:qg,u()):o!==qg},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function e_(){return $g()(qg,qg)}function t_(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function n_(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function r_(e){return e=n_(Math.abs(e)),e?e[1]:NaN}function i_(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function a_(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var o_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function s_(e){if(!(t=o_.exec(e)))throw Error(`invalid format: `+e);var t;return new c_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}s_.prototype=c_.prototype;function c_(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}c_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function l_(e){out:for(var t=e.length,n=1,r=-1,i;n0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var u_;function d_(e,t){var n=n_(e,t);if(!n)return u_=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(u_=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+n_(e,Math.max(0,t+a-1))[0]}function f_(e,t){var n=n_(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var p_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:t_,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>f_(e*100,t),r:f_,s:d_,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function m_(e){return e}var h_=Array.prototype.map,g_=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function __(e){var t=e.grouping===void 0||e.thousands===void 0?m_:i_(h_.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?m_:a_(h_.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=s_(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):p_[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=p_[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=l_(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&u_!==void 0?g_[8+u_/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++op||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(r_(t)/3)))*3,r=10**-n,i=l((e=s_(e),e.type=`f`,e),{suffix:g_[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var v_,y_,b_;x_({thousands:`,`,grouping:[3],currency:[`$`,``]});function x_(e){return v_=__(e),y_=v_.format,b_=v_.formatPrefix,v_}function S_(e){return Math.max(0,-r_(Math.abs(e)))}function C_(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(r_(t)/3)))*3-r_(Math.abs(e)))}function w_(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r_(t)-r_(e))+1}function T_(e,t,n,r){var i=wh(e,t,n),a;switch(r=s_(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=C_(i,o))&&(r.precision=a),b_(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=w_(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=S_(i))&&(r.precision=a-(r.type===`%`)*2)}return y_(r)}function E_(e){var t=e.domain;return e.ticks=function(e){var n=t();return Sh(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return T_(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=Ch(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function D_(){var e=e_();return e.copy=function(){return Qg(e,D_())},Mh.apply(e,arguments),E_(e)}function O_(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Gg),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return O_(e).unknown(t)},e=arguments.length?Array.from(e,Gg):[0,1],E_(n)}function k_(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return ae**+t}function I_(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function L_(e){return(t,n)=>-e(-t,n)}function R_(e){let t=e(A_,j_),n=t.domain,r=10,i,a;function o(){return i=I_(r),a=F_(r),n()[0]<0?(i=L_(i),a=L_(a),e(M_,N_)):e(A_,j_),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s0){for(;l<=u;++l)for(d=1;ds)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(fs)break;m.push(f)}m.length*2{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=s_(n)).precision==null&&(n.trim=!0),n=y_(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*rn(k_(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function z_(){let e=R_($g()).domain([1,10]);return e.copy=()=>Qg(e,z_()).base(e.base()),Mh.apply(e,arguments),e}function B_(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function V_(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function H_(e){var t=1,n=e(B_(t),V_(t));return n.constant=function(n){return arguments.length?e(B_(t=+n),V_(t)):t},E_(n)}function U_(){var e=H_($g());return e.copy=function(){return Qg(e,U_()).constant(e.constant())},Mh.apply(e,arguments)}function W_(e){return function(t){return t<0?-((-t)**+e):t**+e}}function G_(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function K_(e){return e<0?-e*e:e*e}function q_(e){var t=e(qg,qg),n=1;function r(){return n===1?e(qg,qg):n===.5?e(G_,K_):e(W_(n),W_(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},E_(t)}function J_(){var e=q_($g());return e.copy=function(){return Qg(e,J_()).exponent(e.exponent())},Mh.apply(e,arguments),e}function Y_(){return J_.apply(null,arguments).exponent(.5)}function X_(e){return Math.sign(e)*e*e}function Z_(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Q_(){var e=e_(),t=[0,1],n=!1,r;function i(t){var i=Z_(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(X_(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,Gg)).map(X_)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Q_(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Mh.apply(i,arguments),E_(i)}function $_(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return ev().domain([e,t]).range(i).unknown(a)},Mh.apply(E_(o),arguments)}function tv(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[uh(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return tv().domain(e).range(t).unknown(n)},Mh.apply(i,arguments)}var nv=new Date,rv=new Date;function q(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(sq(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(nv.setTime(+t),rv.setTime(+r),e(nv),e(rv),Math.floor(n(nv,rv))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var iv=q(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);iv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?q(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):iv),iv.range;var av=1e3,ov=av*60,sv=ov*60,cv=sv*24,lv=cv*7,uv=cv*30,dv=cv*365,fv=q(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*av)},(e,t)=>(t-e)/av,e=>e.getUTCSeconds());fv.range;var pv=q(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*av)},(e,t)=>{e.setTime(+e+t*ov)},(e,t)=>(t-e)/ov,e=>e.getMinutes());pv.range;var mv=q(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ov)},(e,t)=>(t-e)/ov,e=>e.getUTCMinutes());mv.range;var hv=q(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*av-e.getMinutes()*ov)},(e,t)=>{e.setTime(+e+t*sv)},(e,t)=>(t-e)/sv,e=>e.getHours());hv.range;var gv=q(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*sv)},(e,t)=>(t-e)/sv,e=>e.getUTCHours());gv.range;var _v=q(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ov)/cv,e=>e.getDate()-1);_v.range;var vv=q(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/cv,e=>e.getUTCDate()-1);vv.range;var yv=q(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/cv,e=>Math.floor(e/cv));yv.range;function bv(e){return q(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ov)/lv)}var xv=bv(0),Sv=bv(1),Cv=bv(2),wv=bv(3),Tv=bv(4),Ev=bv(5),Dv=bv(6);xv.range,Sv.range,Cv.range,wv.range,Tv.range,Ev.range,Dv.range;function Ov(e){return q(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/lv)}var kv=Ov(0),Av=Ov(1),jv=Ov(2),Mv=Ov(3),Nv=Ov(4),Pv=Ov(5),Fv=Ov(6);kv.range,Av.range,jv.range,Mv.range,Nv.range,Pv.range,Fv.range;var Iv=q(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Iv.range;var Lv=q(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Lv.range;var Rv=q(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:q(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Rv.range;var zv=q(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());zv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:q(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),zv.range;function Bv(e,t,n,r,i,a){let o=[[fv,1,av],[fv,5,5*av],[fv,15,15*av],[fv,30,30*av],[a,1,ov],[a,5,5*ov],[a,15,15*ov],[a,30,30*ov],[i,1,sv],[i,3,3*sv],[i,6,6*sv],[i,12,12*sv],[r,1,cv],[r,2,2*cv],[n,1,lv],[t,1,uv],[t,3,3*uv],[e,1,dv]];function s(e,t,n){let r=te).right(o,i);if(a===o.length)return e.every(wh(t/dv,n/dv,r));if(a===0)return iv.every(Math.max(wh(t,n,r),1));let[s,c]=o[i/o[a-1][2]53)return null;`w`in r||(r.w=1),`Z`in r?(a=Kv(qv(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Av.ceil(a):Av(a),a=vv.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Gv(qv(r.y,0,1)),o=a.getDay(),a=o>4||o===0?Sv.ceil(a):Sv(a),a=_v.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Kv(qv(r.y,0,1)).getUTCDay():Gv(qv(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Kv(r)):Gv(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in Yv?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function ee(e){return a[e.getDay()]}function te(e){return c[e.getMonth()]}function ne(e){return s[e.getMonth()]}function re(e){return i[+(e.getHours()>=12)]}function ie(e){return 1+~~(e.getMonth()/3)}function ae(e){return o[e.getUTCDay()]}function oe(e){return a[e.getUTCDay()]}function se(e){return c[e.getUTCMonth()]}function ce(e){return s[e.getUTCMonth()]}function le(e){return i[+(e.getUTCHours()>=12)]}function P(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var Yv={"-":``,_:` `,0:`0`},Xv=/^\s*\d+/,Zv=/^%/,Qv=/[\\^$*+?|[\]().{}]/g;function J(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a[e.toLowerCase(),t]))}function ny(e,t,n){var r=Xv.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ry(e,t,n){var r=Xv.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function iy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ay(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function oy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function sy(e,t,n){var r=Xv.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function cy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ly(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function uy(e,t,n){var r=Xv.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function fy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function py(e,t,n){var r=Xv.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function my(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function gy(e,t,n){var r=Xv.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function _y(e,t,n){var r=Xv.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function vy(e,t,n){var r=Xv.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yy(e,t,n){var r=Zv.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function by(e,t,n){var r=Xv.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function xy(e,t,n){var r=Xv.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Sy(e,t){return J(e.getDate(),t,2)}function Cy(e,t){return J(e.getHours(),t,2)}function wy(e,t){return J(e.getHours()%12||12,t,2)}function Ty(e,t){return J(1+_v.count(Rv(e),e),t,3)}function Ey(e,t){return J(e.getMilliseconds(),t,3)}function Dy(e,t){return Ey(e,t)+`000`}function Oy(e,t){return J(e.getMonth()+1,t,2)}function ky(e,t){return J(e.getMinutes(),t,2)}function Ay(e,t){return J(e.getSeconds(),t,2)}function jy(e){var t=e.getDay();return t===0?7:t}function My(e,t){return J(xv.count(Rv(e)-1,e),t,2)}function Ny(e){var t=e.getDay();return t>=4||t===0?Tv(e):Tv.ceil(e)}function Py(e,t){return e=Ny(e),J(Tv.count(Rv(e),e)+(Rv(e).getDay()===4),t,2)}function Fy(e){return e.getDay()}function Iy(e,t){return J(Sv.count(Rv(e)-1,e),t,2)}function Ly(e,t){return J(e.getFullYear()%100,t,2)}function Ry(e,t){return e=Ny(e),J(e.getFullYear()%100,t,2)}function zy(e,t){return J(e.getFullYear()%1e4,t,4)}function By(e,t){var n=e.getDay();return e=n>=4||n===0?Tv(e):Tv.ceil(e),J(e.getFullYear()%1e4,t,4)}function Vy(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+J(t/60|0,`0`,2)+J(t%60,`0`,2)}function Hy(e,t){return J(e.getUTCDate(),t,2)}function Uy(e,t){return J(e.getUTCHours(),t,2)}function Wy(e,t){return J(e.getUTCHours()%12||12,t,2)}function Gy(e,t){return J(1+vv.count(zv(e),e),t,3)}function Ky(e,t){return J(e.getUTCMilliseconds(),t,3)}function qy(e,t){return Ky(e,t)+`000`}function Jy(e,t){return J(e.getUTCMonth()+1,t,2)}function Yy(e,t){return J(e.getUTCMinutes(),t,2)}function Xy(e,t){return J(e.getUTCSeconds(),t,2)}function Zy(e){var t=e.getUTCDay();return t===0?7:t}function Qy(e,t){return J(kv.count(zv(e)-1,e),t,2)}function $y(e){var t=e.getUTCDay();return t>=4||t===0?Nv(e):Nv.ceil(e)}function eb(e,t){return e=$y(e),J(Nv.count(zv(e),e)+(zv(e).getUTCDay()===4),t,2)}function tb(e){return e.getUTCDay()}function nb(e,t){return J(Av.count(zv(e)-1,e),t,2)}function rb(e,t){return J(e.getUTCFullYear()%100,t,2)}function ib(e,t){return e=$y(e),J(e.getUTCFullYear()%100,t,2)}function ab(e,t){return J(e.getUTCFullYear()%1e4,t,4)}function ob(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Nv(e):Nv.ceil(e),J(e.getUTCFullYear()%1e4,t,4)}function sb(){return`+0000`}function cb(){return`%`}function lb(e){return+e}function ub(e){return Math.floor(e/1e3)}var db,fb,pb;mb({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function mb(e){return db=Jv(e),fb=db.format,db.parse,pb=db.utcFormat,db.utcParse,db}function hb(e){return new Date(e)}function gb(e){return e instanceof Date?+e:+new Date(+e)}function _b(e,t,n,r,i,a,o,s,c,l){var u=e_(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>kh(e,r/t))},n.copy=function(){return Db(t).domain(e)},Nh.apply(n,arguments)}function Ob(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=qg,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*eIh,scaleDiverging:()=>kb,scaleDivergingLog:()=>Ab,scaleDivergingPow:()=>Mb,scaleDivergingSqrt:()=>Nb,scaleDivergingSymlog:()=>jb,scaleIdentity:()=>O_,scaleImplicit:()=>Ph,scaleLinear:()=>D_,scaleLog:()=>z_,scaleOrdinal:()=>Fh,scalePoint:()=>Rh,scalePow:()=>J_,scaleQuantile:()=>$_,scaleQuantize:()=>ev,scaleRadial:()=>Q_,scaleSequential:()=>Sb,scaleSequentialLog:()=>Cb,scaleSequentialPow:()=>Tb,scaleSequentialQuantile:()=>Db,scaleSequentialSqrt:()=>Eb,scaleSequentialSymlog:()=>wb,scaleSqrt:()=>Y_,scaleSymlog:()=>U_,scaleThreshold:()=>tv,scaleTime:()=>vb,scaleUtc:()=>yb,tickFormat:()=>T_});function Fb(e){var t=Pb;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${be(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function Ib(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=Fb(e);if(r!=null)return r.domain(t).range(n),r}}function Lb(e,t,n,r){if(n!=null&&r!=null)return typeof e.scale==`function`?Ib(e.scale,n,r):Ib(t,n,r)}function Rb(e){return`scale${be(e)}`}function zb(e){return Rb(e)in Pb}var Bb=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return zb(r)?r:`point`}};function Vb(e,t){for(var n=0,r=e.length,i=e[0]t)?n=a+1:r=a}return n}function Hb(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=Vb(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function Ub(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):Hb(e,void 0)}function Wb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gb(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.cartesianAxis.xAxis[t],rx=(e,t)=>nx(e,t)??Y,X={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:tx,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},ix=(e,t)=>e.cartesianAxis.yAxis[t],ax=(e,t)=>ix(e,t)??X,ox={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},sx=(e,t)=>e.cartesianAxis.zAxis[t]??ox,cx=(e,t,n)=>{switch(t){case`xAxis`:return rx(e,n);case`yAxis`:return ax(e,n);case`zAxis`:return sx(e,n);case`angleAxis`:return Im(e,n);case`radiusAxis`:return Lm(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},lx=(e,t,n)=>{switch(t){case`xAxis`:return rx(e,n);case`yAxis`:return ax(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},ux=(e,t,n)=>{switch(t){case`xAxis`:return rx(e,n);case`yAxis`:return ax(e,n);case`angleAxis`:return Im(e,n);case`radiusAxis`:return Lm(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},dx=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function fx(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var px=e=>e.graphicalItems.cartesianItems,mx=B([Gm,Km],fx),hx=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0||!e.hide),gx=B([px,cx,mx],hx,{memoizeOptions:{resultEqualityCheck:Zm}}),_x=B([gx],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(Ym)),vx=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),yx=B([gx],vx),bx=e=>e.map(e=>e.data).filter(Boolean).flat(1),xx=B([gx],e=>e.some(e=>!e.data)),Sx=B([gx],bx,{memoizeOptions:{resultEqualityCheck:Zm}}),Cx=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},wx=B([Sx,Vp],Cx),Tx=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:W(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:W(e,t.dataKey)})),Ex=(e,t,n,r,i,a)=>{var o=r.chartData,s=o===void 0?[]:o,c=r.dataStartIndex,l=r.dataEndIndex,u=Tx(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...s.slice(c,l+1).map(e=>({value:W(e,t.dataKey)})).filter(e=>e.value!=null),...u]:u},Dx=B([wx,cx,gx,Vp,xx,Sx],Ex);function Ox(e){if(pe(e)||e instanceof Date){var t=Number(e);if(U(t))return t}}function kx(e){if(Array.isArray(e)){var t=[Ox(e[0]),Ox(e[1])];return Zp(t)?t:void 0}var n=Ox(e);if(n!=null)return[n,n]}function Ax(e){return e.map(Ox).filter(xe)}function jx(e,t){var n=Ox(e),r=Ox(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Mx=B([Dx],e=>e?.map(e=>e.value).sort(jx));function Nx(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function Px(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!de(t))r=t;else if(Array.isArray(t)){var i=Ax(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ax(n.flatMap(t=>{var n=W(e,t.dataKey),i,a;if(Array.isArray(n)){var o=Yb(n,2);i=o[0],a=o[1]}else i=a=n;if(U(i)&&U(a))return[r-i,r+a]}))}var Z=e=>ux(e,$m(e),eh(e)),Fx=B([Z],e=>e?.dataKey),Ix=B([_x,Vp,Z],Jm),Lx=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var i=Yb(t,2),a=i[0],o=i[1],s=r?[...o].reverse():o;return[a,{stackedData:$s(e,s.map(qm),n),graphicalItems:s}]}))},Rx=B([Ix,_x,_m,vm],Lx),zx=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!==`zAxis`)return ic(e,i,a)},Bx=B([cx],e=>e.allowDataOverflow),Vx=e=>{if(e==null||!(`domain`in e))return tx;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=Ax(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??tx},Hx=B([cx],Vx),Ux=B([Hx,Bx],$p),Wx=B([Rx,zp,Gm,Ux],zx,{memoizeOptions:{resultEqualityCheck:Xm}}),Gx=e=>e.errorBars,Kx=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>Nx(n,e)),qx=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},Jx=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>Nx(i,e));n.forEach(n=>{var r=W(n,t.dataKey??e.dataKey),i=Px(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||as)&&(s=l)}var u=kx(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=kx(W(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),U(o)&&U(s))return[o,s]},Yx=B([wx,cx,yx,Gx,Gm,Up],Jx,{memoizeOptions:{resultEqualityCheck:Xm}});function Xx(e){var t=e.value;if(pe(t)||t instanceof Date)return t}var Zx=(e,t,n)=>{var r=e.map(Xx).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&_e(r))?Rp(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Qx=e=>e.referenceElements.dots,$x=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),eS=B([Qx,Gm,Km],$x),tS=e=>e.referenceElements.areas,nS=B([tS,Gm,Km],$x),rS=e=>e.referenceElements.lines,iS=B([rS,Gm,Km],$x),aS=(e,t)=>{if(e!=null){var n=Ax(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},oS=B(eS,Gm,aS),sS=(e,t)=>{if(e!=null){var n=Ax(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},cS=B([nS,Gm],sS);function lS(e){if(e.x!=null)return Ax([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:Ax(t)}function uS(e){if(e.y!=null)return Ax([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:Ax(t)}var dS=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?lS(e):uS(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},fS=B(oS,B([iS,Gm],dS),cS,(e,t,n)=>qx(e,n,t)),pS=(e,t,n,r,i,a,o,s,c)=>{if(n!=null)return n;var l=o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?qx(r,a,i):qx(a,i),u=em(t,l,e.allowDataOverflow);return u==null&&e.allowDataOverflow&&l==null&&c!=null?c:u},mS=B([cx,Hx,Ux,Wx,Yx,fS,G,Gm,B([cx],e=>{if(e!=null&&e.type===`number`&&`ticks`in e&&e.ticks!=null){var t=Ax(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},{memoizeOptions:{resultEqualityCheck:Xm}})],pS,{memoizeOptions:{resultEqualityCheck:Xm}}),hS=[0,1],gS=(e,t,n,r,i,a,o)=>{if(e!=null&&n!=null&&n.length!==0||o!==void 0){var s=e.dataKey,c=e.type,l=Zs(t,a);return l&&s==null?Rp(0,n?.length??0):c===`category`?Zx(r,e,l):i===`expand`&&!l?hS:o}},_S=B([cx,G,wx,Dx,_m,Gm,mS],gS),vS=B([cx,dx,ym],Bb),yS=(e,t,n)=>{var r=t.niceTicks;if(r!==`none`){var i=Vx(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&Zp(e)){if(a)return mm(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return hm(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&Zp(e))return mm(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&Zp(e))return hm(e,t.tickCount,t.allowDecimals,`adaptive`)}}},bS=B([_S,ux,vS],yS),xS=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&Zp(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},SS=B([cx,_S,bS,Gm],xS),CS=B(B(Dx,cx,(e,t)=>{if(t&&t.type===`number`){var n=1/0,r=Array.from(Ax(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;si,(e,t,n,r,i)=>{if(!U(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=ge(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),wS=(e,t,n)=>{var r=rx(e,t);return r==null||typeof r.padding!=`string`?0:CS(e,`xAxis`,t,n,r.padding)},TS=(e,t,n)=>{var r=ax(e,t);return r==null||typeof r.padding!=`string`?0:CS(e,`yAxis`,t,n,r.padding)},ES=B(rx,wS,(e,t)=>{if(e==null)return{left:0,right:0};var n=e.padding;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),DS=B(ax,TS,(e,t)=>{if(e==null)return{top:0,bottom:0};var n=e.padding;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),OS=B([kc,ES,Fc,Pc,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),kS=B([kc,G,DS,Fc,Pc,(e,t,n)=>n],(e,t,n,r,i,a)=>{var o=i.padding;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),AS=(e,t,n,r)=>{switch(t){case`xAxis`:return OS(e,n,r);case`yAxis`:return kS(e,n,r);case`zAxis`:return sx(e,n)?.range;case`angleAxis`:return Hm(e);case`radiusAxis`:return Um(e,n);default:return}},jS=B([cx,AS],Dm),MS=B([cx,vS,B([vS,SS],nh),jS],Lb),NS=(e,t,n,r)=>{if(n!=null&&n.dataKey!=null){var i=n.type,a=n.scale;if(Zs(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},PS=B([G,Dx,ux,Gm],NS),FS=B([MS],th);B([MS],Ub),B([MS,Mx],Hb),B([gx,Gx,Gm],Kx);function IS(e,t){return e.idt.id)}var LS=(e,t)=>t,RS=(e,t,n)=>n,zS=B(gc,LS,RS,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(IS)),BS=B(_c,LS,RS,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(IS)),VS=(e,t)=>{var n=typeof t.height==`number`?t.height:30;return{width:e.width,height:n}},HS=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),US=B(kc,rx,VS),WS=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},GS=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},KS=B(pc,kc,zS,LS,RS,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=VS(t,n);o??=WS(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),qS=B(fc,kc,BS,LS,RS,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=HS(t,n);o??=GS(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),JS=B([kc,rx,(e,t)=>{var n=rx(e,t);if(n!=null)return KS(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),YS=B([kc,ax,(e,t)=>{var n=ax(e,t);if(n!=null)return qS(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),XS=B(kc,ax,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),ZS=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,o=n.dataKey,s=Zs(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&_e(l))return c}},QS=B([G,Dx,cx,Gm],ZS);B([G,lx,vS,FS,QS,PS,AS,bS,Gm],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=Zs(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}});var $S=B([G,ux,vS,FS,bS,AS,QS,PS,Gm],(e,t,n,r,i,a,o,s,c)=>{if(t!=null&&r!=null){var l=Zs(e,c),u=t.type,d=t.ticks,f=t.tickCount,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?ue(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return U(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(xe):l&&s?s.map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(xe):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(xe):r.domain().map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(xe)}}),eC=B([G,ux,FS,AS,QS,PS,Gm],(e,t,n,r,i,a,o)=>{if(t!=null&&n!=null&&r!=null&&r[0]!==r[1]){var s=Zs(e,o),c=t.tickCount,l=0;return l=o===`angleAxis`&&r?.length>=2?ue(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return U(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(xe):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return U(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(xe):n.domain().map((e,t)=>{var r=n.map(e);return U(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(xe)}}),tC=B(cx,FS,(e,t)=>{if(e!=null&&t!=null)return Gb(Gb({},e),{},{scale:t})});B((e,t,n)=>sx(e,n),B([B([cx,vS,_S,jS],Lb)],th),(e,t)=>{if(e!=null&&t!=null)return Gb(Gb({},e),{},{scale:t})});var nC=B([G,gc,_c],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});B([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(e&&e.length!==0)return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);ae.options.defaultTooltipEventType,iC=e=>e.options.validateTooltipEventTypes;function aC(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function oC(e,t){return aC(t,rC(e),iC(e))}function sC(e){return z(t=>oC(t,e))}var cC=(e,t)=>{var n,r=Number(t);if(!(de(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},lC=e=>e.tooltip.settings,uC={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},dC=Jo({name:`tooltip`,initialState:{itemInteraction:{click:uC,hover:uC},axisInteraction:{click:uC,hover:uC},keyboardInteraction:uC,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(V(t.payload))},prepare:H()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=bo(e).tooltipItemPayloads.indexOf(V(r));a>-1&&(e.tooltipItemPayloads[a]=V(i))},prepare:H()},removeTooltipEntrySettings:{reducer(e,t){var n=bo(e).tooltipItemPayloads.indexOf(V(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:H()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),fC=dC.actions,pC=fC.addTooltipEntrySettings,mC=fC.replaceTooltipEntrySettings,hC=fC.removeTooltipEntrySettings,gC=fC.setTooltipSettingsState,_C=fC.setActiveMouseOverItemIndex;fC.mouseLeaveItem;var vC=fC.mouseLeaveChart;fC.setActiveClickItemIndex;var yC=fC.setMouseOverAxisIndex,bC=fC.setMouseClickAxisIndex,xC=fC.setSyncInteraction,SC=fC.setKeyboardInteraction,CC=dC.reducer;function wC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TC(e){for(var t=1;t{if(t==null)return uC;var i=kC(e,t,n);if(i==null)return uC;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(AC(i)){if(a)return TC(TC({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return TC(TC({},uC),{},{coordinate:i.coordinate})};function MC(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function NC(e,t){var n=MC(e),r=t[0],i=t[1];return n!==void 0&&n>=Math.min(r,i)&&n<=Math.max(r,i)}function PC(e,t,n){if(n==null||t==null)return!0;var r=W(e,t);return r==null||!Zp(n)||NC(r,n)}var FC=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!U(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||PC(l,n,r)?String(c):null},IC=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},LC=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},RC=e=>e.options.tooltipPayloadSearcher,zC=e=>e.tooltip;function BC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VC(e){for(var t=1;te(t)}function JC(e){if(typeof e==`string`)return e}function YC(e){if(typeof e==`object`&&e)return{name:`name`in e?GC(e.name):void 0,unit:`unit`in e?KC(e.unit):void 0,dataKey:`dataKey`in e?qC(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?JC(e.color):void 0,fill:`fill`in e?JC(e.fill):void 0}}function XC(e,t){return e??t}var ZC=(e,t,n,r,i,a,o)=>{if(t!=null&&a!=null){var s=n.chartData,c=n.computedData,l=n.dataStartIndex,u=n.dataEndIndex;return e.reduce((e,n)=>{var d=n.dataDefinedOnItem,f=n.settings,p=XC(d,s),m=Array.isArray(p)?Us(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_;return r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?(_=ye(m,r,i),_??=a(m,t,c,g)):_=a(m,t,c,g),Array.isArray(_)?_.forEach(t=>{var n=YC(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=VC(VC({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(cc({tooltipEntrySettings:o,dataKey:i,payload:a,value:W(a,i),name:r==null?void 0:String(r)}))}):e.push(cc({tooltipEntrySettings:f,dataKey:h,payload:_,value:W(_,h),name:W(_,g)??f?.name})),e},[])}},QC=B([Z,dx,ym],Bb),$C=B([B([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Z,B([$m,eh],fx)],hx,{memoizeOptions:{resultEqualityCheck:Zm}}),ew=B([$C],e=>e.filter(Ym)),tw=B([$C],bx,{memoizeOptions:{resultEqualityCheck:Zm}}),nw=B([$C],e=>e.some(e=>!e.data)),rw=B([tw,zp],Cx),iw=B([ew,zp,Z],Jm),aw=B([rw,Z,$C,zp,nw,tw],Ex),ow=B([Z],Vx),sw=B([ow,B([Z],e=>e.allowDataOverflow)],$p),cw=B([B([iw,B([$C],e=>e.filter(Ym)),_m,vm],Lx),zp,$m,sw],zx),lw=B([rw,Z,B([$C],vx),Gx,$m,Wp],Jx,{memoizeOptions:{resultEqualityCheck:Xm}}),uw=B([B([Qx,$m,eh],$x),$m],aS),dw=B([B([tS,$m,eh],$x),$m],sS),fw=B([Z,G,rw,aw,_m,$m,B([Z,ow,sw,cw,lw,B([uw,B([B([rS,$m,eh],$x),$m],dS),dw],qx),G,$m],pS)],gS),pw=B([Z,fw,B([fw,Z,QC],yS),$m],xS),mw=e=>AS(e,$m(e),eh(e),!1),hw=B([Z,mw],Dm),gw=B([B([Z,QC,pw,hw],Lb)],th),_w=B([G,Z,QC,gw,mw,B([G,aw,Z,$m],ZS),B([G,aw,Z,$m],NS),$m],(e,t,n,r,i,a,o,s)=>{if(t){var c=t.type,l=Zs(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?ue(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(xe):r.domain().map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(xe)}}}),vw=B([rC,iC,lC],(e,t,n)=>aC(n.shared,e,t)),yw=e=>e.tooltip.settings.trigger,bw=e=>e.tooltip.settings.defaultIndex,xw=B([zC,vw,yw,bw],jC),Sw=B([xw,rw,Fx,fw],FC),Cw=B([_w,Sw],cC),ww=B([xw],e=>{if(e)return e.dataKey}),Tw=B([xw],e=>{if(e)return e.graphicalItemId}),Ew=B([zC,vw,yw,bw],LC),Dw=B([xw,B([fc,pc,G,kc,_w,bw,Ew],IC)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Ow=B([xw],e=>e?.active??!1),kw=B([B([Ew,Sw,zp,Fx,Cw,RC,vw],ZC)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function Aw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jw(e){for(var t=1;tz(Z),Iw=()=>{var e=Fw(),t=z(_w),n=z(gw);return sc(!e||!n?void 0:jw(jw({},e),{},{scale:n}),t)};function Lw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rw(e){for(var t=1;t{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Uw=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,o=r.radius;return Rw(Rw(Rw({},r),fp(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Rw(Rw(Rw({},r),fp(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Ww(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var Gw=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=i[1]-i[0],s=(t,n,r)=>[e,e+o,e-o].some(e=>(r?e>=t:e>t)&&e<=n),c=0;c0?n[c-1]?.coordinate:n[a-1]?.coordinate,u=n[c]?.coordinate,d=c>=a-1?n[0]?.coordinate:n[c+1]?.coordinate,f=void 0;if(l!=null&&u!=null&&d!=null){if(ue(u-l)!==ue(d-u)){var p=[];if(ue(d-u)===ue(i[1]-i[0])){f=d;var m=u+i[1]-i[0];p[0]=Math.min(m,(m+l)/2),p[1]=Math.max(m,(m+l)/2)}else{f=l;var h=d+i[1]-i[0];p[0]=Math.min(u,(h+u)/2),p[1]=Math.max(u,(h+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(s(g[0],g[1],!1)||s(p[0],p[1],!0))return n[c]?.index}else{var _=Math.min(l,d),v=Math.max(l,d);if(s((_+u)/2,(v+u)/2,!1))return n[c]?.index}}}else if(t)for(var y=0;y(b.coordinate+S.coordinate)/2||y>0&&y(b.coordinate+S.coordinate)/2&&e<=(b.coordinate+x.coordinate)/2)return b.index}}return-1},Kw=()=>z(ym),qw=(e,t)=>t,Jw=(e,t,n)=>n,Yw=(e,t,n,r)=>r,Xw=B(_w,e=>Oi(e,e=>e.coordinate)),Zw=B([zC,qw,Jw,Yw],jC),Qw=B([Zw,rw,Fx,fw],FC),$w=(e,t,n)=>{if(t!=null){var r=zC(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},eT=B([zC,qw,Jw,Yw],LC),tT=B([fc,pc,G,kc,_w,Yw,eT],IC),nT=B([Zw,tT],(e,t)=>e.coordinate??t),rT=B([_w,Qw],cC),iT=B([eT,Qw,zp,Fx,rT,RC,qw],ZC),aT=B([Zw,Qw],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),oT=(e,t,n,r,i,a,o)=>{if(e&&n&&r&&i&&Ww(e,o)){var s=Gw(uc(e,t),a,i,n,r),c=Hw(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},sT=(e,t,n,r,i,a,o)=>{if(e&&r&&i&&a&&n){var s=vp(e,n);if(s){var c=Gw(dc(s,t),o,a,r,i),l=Uw(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},cT=(e,t,n,r,i,a,o,s)=>{if(e&&t&&r&&i&&a)return t===`horizontal`||t===`vertical`?oT(e,t,r,i,a,o,s):sT(e,t,n,r,i,a,o)},lT=B(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),uT=B(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(wm));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:Qm}});function dT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fT(e){for(var t=1;tfT(fT({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},_T=new Set(Object.values(wm));function vT(e){return _T.has(e)}var yT=Jo({name:`zIndex`,initialState:gT,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:H()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!vT(n)&&delete e.zIndexMap[n])},prepare:H()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=V(i):e.zIndexMap[r].element=V(i):e.zIndexMap[r]={consumers:0,element:a?void 0:V(i),panoramaElement:a?V(i):void 0}},prepare:H()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:H()}}}),bT=yT.actions,xT=bT.registerZIndexPortal,ST=bT.unregisterZIndexPortal,CT=bT.registerZIndexPortalElement,wT=bT.unregisterZIndexPortalElement,TT=yT.reducer;function ET(e){var t=e.zIndex,n=e.children,r=wl()&&t!==void 0&&t!==0,i=Nc(),a=(0,f.useRef)(void 0),o=(0,f.useRef)(new Set),s=R(),c=z(e=>lT(e,t,i));if((0,f.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(ST({zIndex:e}))}),e.clear(),a.current=void 0}else if(o.current.has(t)||(s(xT({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(ST({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,f.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(ST({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,eu.createPortal)(n,l):null}function DT(){return DT=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,f.useContext)(IT),RT=s(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!de(n))return e[n]}},UT=Jo({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),WT=UT.reducer,GT=UT.actions.createEventEmitter;function KT(e){return e.tooltip.syncInteraction}var qT=Jo({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){e.chartData=V(t.payload),t.payload==null?(e.dataStartIndex=0,e.dataEndIndex=0):t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),JT=qT.actions,YT=JT.setChartData,XT=JT.setDataStartEndIndexes;JT.setComputedData;var ZT=qT.reducer,QT=[`x`,`y`];function $T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eE(e){for(var t=1;te.rootProps.className);(0,f.useEffect)(()=>{if(e==null)return Se;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1)n(xC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));else if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,f=d.x,p=d.y,m=iE(d,QT),h=c.payload.sourceViewBox,g=h.x,_=h.y,v=h.width,y=h.height,b=eE(eE({},m),{},{x:o.x+(v?(f-g)/v:0)*o.width,y:o.y+(y?(p-_)/y:0)*o.height});n(eE(eE({},c),{},{payload:eE(eE({},c.payload),{},{coordinate:b})}))}else n(c)}else if(i!=null){var x;typeof r==`function`?x=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(x=i.find(e=>String(e.value)===c.payload.label));var S=c.payload.coordinate;if(S==null||o==null)n(xC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));else if(x==null)n(xC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));else{var C=S.x,w=S.y,T=Math.min(C,o.x+o.width),E=Math.min(w,o.y+o.height),D={x:a===`horizontal`?x.coordinate:T,y:a===`horizontal`?E:x.coordinate};n(xC({active:c.payload.active,coordinate:D,dataKey:c.payload.dataKey,index:String(x.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}}};return zT.on(BT,s),()=>{zT.off(BT,s)}},[s,n,t,e,r,i,a,o])}function sE(){var e=z(bm),t=z(Sm),n=R();(0,f.useEffect)(()=>{if(e==null)return Se;var r=(r,i,a)=>{t!==a&&e===r&&n(XT(i))};return zT.on(VT,r),()=>{zT.off(VT,r)}},[n,t,e])}function cE(){var e=R();(0,f.useEffect)(()=>{e(GT())},[e]),oE(),sE()}function lE(e,t,n,r,i,a){var o=z(n=>$w(n,e,t)),s=z(Tw),c=z(Sm),l=z(bm),u=z(xm),d=z(KT)?.sourceViewBox!=null,p=hl();(0,f.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=xC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:p,graphicalItemId:s});zT.emit(BT,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,p])}function uE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{S(gC({shared:_,trigger:v,axisId:x,active:n,defaultIndex:C}))},[S,_,v,x,n,C]);var w=hl(),T=vd(),E=sC(_),D=z(e=>aT(e,E,v,C))??{},O=D.activeIndex,k=D.isActive,A=z(e=>iT(e,E,v,C)),j=z(e=>rT(e,E,v,C)),M=z(e=>nT(e,E,v,C)),N=A,ee=LT(),te=n??k??!1,ne=hE(Hi([N,te]),2),re=ne[0],ie=ne[1],ae=E===`axis`?j:void 0;lE(E,v,M,ae,O,te);var oe=b??ee;if(oe==null||w==null||E==null)return null;var se=N??CE;te||(se=CE),s&&se.length&&(se=Yr(se.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,xE));var ce=se.length>0,le=dE(dE({},t),{},{payload:se,label:ae,active:te,activeIndex:O,coordinate:M,accessibilityLayer:T}),P=f.createElement(_d,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:te,coordinate:M,hasPayload:ce,offset:l,position:d,reverseDirection:p,useTranslate3d:m,viewBox:w,wrapperStyle:h,lastBoundingBox:re,innerRef:ie,hasPortalFromProps:!!b},SE(o,le));return f.createElement(f.Fragment,null,(0,eu.createPortal)(P,oe),te&&f.createElement(FT,{cursor:g,tooltipEventType:E,coordinate:M,payload:se,index:O}))}function EE(e,t,n){return(t=DE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DE(e){var t=OE(e,`string`);return typeof t==`symbol`?t:t+``}function OE(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var kE=class{constructor(e){EE(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jE(e){for(var t=1;t{try{var n=document.getElementById(RE);n||(n=document.createElement(`span`),n.setAttribute(`id`,RE),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,LE,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},VE=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Xu.isSsr)return{width:0,height:0};if(!FE.enableCache)return BE(e,t);var n=zE(e,t),r=IE.get(n);if(r)return r;var i=BE(e,t);return IE.set(n,i),i},HE;function UE(e,t){return JE(e)||qE(e,t)||GE(e,t)||WE()}function WE(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GE(e,t){if(e){if(typeof e==`string`)return KE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KE(e,t):void 0}}function KE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return I(t)||(i=n?t.toString().split(``):t.toString().split(TD)),{wordsWithComputedWidth:i.map(e=>({word:e,width:VE(e,r).width})),spaceWidth:n?0:VE(`\xA0`,r).width}}catch{return null}};function DD(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function OD(e){return I(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var kD=(e,t,n,r)=>e.reduce((e,i)=>{var a=i.word,o=i.width,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+ne.reduce((e,t)=>e.width>t.width?e:t),jD=`…`,MD=(e,t,n,r,i,a,o,s)=>{var c=ED({breakAll:n,style:r,children:e.slice(0,t)+jD});if(!c)return[!1,[]];var l=kD(c.wordsWithComputedWidth,a,o,s);return[l.length>i||AD(l).width>Number(a),l]},ND=(e,t,n,r,i)=>{var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=F(a),u=String(o),d=kD(t,r,n,i);if(!l||i||!(d.length>a||AD(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),_=yD(MD(u,g-1,c,s,a,r,n,i),2),v=_[0],y=_[1],b=yD(MD(u,g,c,s,a,r,n,i),1)[0];if(!v&&!b&&(f=g+1),v&&b&&(p=g-1),!v&&b){h=y;break}m++}return h||d},PD=e=>[{words:I(e)?[]:e.toString().split(TD),width:void 0}],FD=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!Xu.isSsr){var s,c,l=ED({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return PD(r);return ND({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return PD(r)},ID=`#808080`,LD={angle:0,breakAll:!1,capHeight:`0.71em`,fill:ID,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},RD=(0,f.forwardRef)((e,t)=>{var n=Dn(e,LD),r=n.x,i=n.y,a=n.lineHeight,o=n.capHeight,s=n.fill,c=n.scaleToFit,u=n.textAnchor,d=n.verticalAnchor,p=_D(n,mD),m=(0,f.useMemo)(()=>FD({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:c,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,c,p.style,p.width]),h=p.dx,g=p.dy,_=p.angle,y=p.className,b=p.breakAll,x=_D(p,hD);if(!pe(r)||!pe(i)||m.length===0)return null;var S=Number(r)+(F(h)?h:0),C=Number(i)+(F(g)?g:0);if(!U(S)||!U(C))return null;var w;switch(d){case`start`:w=pD(`calc(${o})`);break;case`middle`:w=pD(`calc(${(m.length-1)/2} * -${a} + (${o} / 2))`);break;default:w=pD(`calc(${m.length-1} * -${a})`)}var T=[],E=m[0];if(c&&E!=null){var D=E.width,O=p.width;T.push(`scale(${F(O)&&F(D)?O/D:1})`)}return _&&T.push(`rotate(${_}, ${S}, ${C})`),T.length&&(x.transform=T.join(` `)),f.createElement(`text`,gD({},v(x),{ref:t,x:S,y:C,className:l(`recharts-text`,y),textAnchor:u,fill:s.includes(`url`)?ID:s}),m.map((e,t)=>{var n=e.words.join(b?``:` `);return f.createElement(`tspan`,{x:S,dy:t===0?w:a,key:`${n}-${t}`},n)}))});RD.displayName=`Text`;var zD=[`labelRef`],BD=[`content`];function VD(e,t){if(e==null)return{};var n,r,i=HD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,s=e.children,c=(0,f.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return f.createElement(YD.Provider,{value:c},s)},ZD=()=>{var e=(0,f.useContext)(YD),t=hl();return e||(t?Ce(t):void 0)},QD=(0,f.createContext)(null),$D=()=>{var e=(0,f.useContext)(QD),t=z(Wm);return e||t},eO=e=>{var t=e.value,n=e.formatter,r=I(e.children)?t:e.children;return typeof n==`function`?n(r):r},tO=e=>e!=null&&typeof e==`function`,nO=(e,t)=>ue(t-e)*Math.min(Math.abs(t-e),360),rO=(e,t,n,r,i)=>{var a=e.offset,o=e.className,s=i.cx,c=i.cy,u=i.innerRadius,d=i.outerRadius,p=i.startAngle,m=i.endAngle,h=i.clockWise,g=(u+d)/2,_=nO(p,m),v=_>=0?1:-1,y,b;switch(t){case`insideStart`:y=p+v*a,b=h;break;case`insideEnd`:y=m-v*a,b=!h;break;case`end`:y=m+v*a,b=h;break;default:throw Error(`Unsupported position ${t}`)}b=_<=0?b:!b;var x=fp(s,c,g,y),S=fp(s,c,g,y+(b?1:-1)*359),C=`M${x.x},${x.y} + A${g},${g},0,1,${+!b}, + ${S.x},${S.y}`,w=I(e.id)?he(`recharts-radial-line-`):e.id;return f.createElement(`text`,JD({},r,{dominantBaseline:`central`,className:l(`recharts-radial-bar-label`,o)}),f.createElement(`defs`,null,f.createElement(`path`,{id:w,d:C})),f.createElement(`textPath`,{xlinkHref:`#${w}`},n))},iO=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,s=(e.startAngle+e.endAngle)/2;if(n===`outside`){var c=fp(r,i,o+t,s),l=c.x;return{x:l,y:c.y,textAnchor:l>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var u=fp(r,i,(a+o)/2,s);return{x:u.x,y:u.y,textAnchor:`middle`,verticalAnchor:`middle`}},aO=e=>e!=null&&`cx`in e&&F(e.cx),oO={angle:0,offset:5,zIndex:wm.label,position:`middle`,textBreakAll:!1};function sO(e){if(!aO(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function cO(e){var t=Dn(e,oO),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,o=t.children,s=t.content,c=t.className,u=c===void 0?``:c,d=t.textBreakAll,p=t.labelRef,m=$D(),h=ZD(),g=n==null?i===`center`?h:m??h:aO(n)?n:Ce(n),_,y,b=sO(g);if(!g||I(a)&&I(o)&&!(0,f.isValidElement)(s)&&typeof s!=`function`)return null;var x=aO(g)&&(i===`insideStart`||i===`insideEnd`||i===`end`);if(aO(g))x||(y=iO(g,t.offset,t.position));else if(b){var S=ke({viewBox:b,position:i,offset:t.offset,parentViewBox:aO(r)?void 0:r,clamp:!0});y=WD(WD({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width===void 0?{}:{width:S.width}),S.height===void 0?{}:{height:S.height})}var C=WD(WD(WD(WD({},y?.x===void 0?{}:{x:y.x}),y?.y===void 0?{}:{y:y.y}),t),{},{viewBox:g});if((0,f.isValidElement)(s)){C.labelRef;var w=VD(C,zD);return(0,f.cloneElement)(s,w)}if(typeof s==`function`){C.content;var T=VD(C,BD);if(_=(0,f.createElement)(s,T),(0,f.isValidElement)(_))return _}else _=eO(t);var E=v(t);return x&&aO(g)?rO(t,i,_,E,g):y==null?null:f.createElement(ET,{zIndex:t.zIndex},f.createElement(RD,JD({ref:p,className:l(`recharts-label`,u)},E,y,{textAnchor:DD(E.textAnchor)?E.textAnchor:y.textAnchor,breakAll:d}),_))}cO.displayName=`Label`;var lO=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?f.createElement(cO,JD({key:`label-implicit`},r)):pe(e)?f.createElement(cO,JD({key:`label-implicit`,value:e},r)):(0,f.isValidElement)(e)?e.type===cO?(0,f.cloneElement)(e,WD({key:`label-implicit`},r)):f.createElement(cO,JD({key:`label-implicit`,content:e},r)):tO(e)?f.createElement(cO,JD({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?f.createElement(cO,JD({},e,{key:`label-implicit`},r)):null};function uO(e){var t=e.label,n=e.labelRef;return lO(t,ZD(),n)||null}var dO=[`valueAccessor`],fO=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function pO(){return pO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(OD(t))return t},_O=(0,f.createContext)(void 0),vO=_O.Provider,yO=(0,f.createContext)(void 0);yO.Provider;function bO(){return(0,f.useContext)(_O)}function xO(){return(0,f.useContext)(yO)}function SO(e){var t=e.valueAccessor,n=t===void 0?gO:t,r=mO(e,dO),i=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,s=r.zIndex,c=mO(r,fO),l=bO(),u=xO(),d=l||u;return!d||!d.length?null:f.createElement(ET,{zIndex:s??wm.label},f.createElement(k,{className:`recharts-label-list`},d.map((e,t)=>{var s=I(i)?n(e,t):W(e.payload,i),l=I(a)?{}:{id:`${a}-${t}`};return f.createElement(cO,pO({key:`label-${t}`},v(e),c,l,{fill:r.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:t,zIndex:0}))})))}SO.displayName=`LabelList`;function CO(e){var t=e.label;return t?t===!0?f.createElement(SO,{key:`labelList-implicit`}):f.isValidElement(t)||tO(t)?f.createElement(SO,{key:`labelList-implicit`,content:t}):typeof t==`object`?f.createElement(SO,pO({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}function wO(){return wO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=l(`recharts-dot`,i);return F(t)&&F(n)&&F(r)?f.createElement(`circle`,wO({},g(e),yn(e),{className:a,cx:t,cy:n,r})):null},EO=Jo({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=V(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=V(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),DO=EO.actions;DO.addRadiusAxis,DO.removeRadiusAxis,DO.addAngleAxis,DO.removeAngleAxis;var OO=EO.reducer;function kO(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var AO=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0;function jO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MO(e){for(var t=1;t{r||(i.current===null?n(pC(t)):i.current!==t&&n(mC({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,f.useLayoutEffect)(()=>()=>{i.current&&=(n(hC(i.current)),null)},[n]),null}function UO(e){var t=e.legendPayload,n=R(),r=Nc(),i=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{r||(i.current===null?n(Al(t)):i.current!==t&&n(jl({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,f.useLayoutEffect)(()=>()=>{i.current&&=(n(Ml(i.current)),null)},[n]),null}function WO(e,t){return YO(e)||JO(e,t)||KO(e,t)||GO()}function GO(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KO(e,t){if(e){if(typeof e==`string`)return qO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qO(e,t):void 0}}function qO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if(t.payload==null||typeof t.payload!=`object`)return null;var n=W(t.payload,e);return n==null?null:typeof n==`string`||typeof n==`number`?n:JSON.stringify(n)}}function QO(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:`removed`,prev:i});for(var a=0;ae[Math.floor(r*n)]),t)}function ek(e,t){return QO(t.map((t,n)=>e[n]),t)}function tk(e,t){for(var n=new Map,r=0;r{var a=n(e,t);if(a!=null){var o=r.get(a);if(o!==void 0)return i.add(a),o}}),o=[];for(var s of r){var c=WO(s,2),l=c[0],u=c[1];i.has(l)||o.push(u)}return QO(a,t,o)}function rk(e,t,n){return t==null?null:e==null?t.map(e=>({status:`added`,next:e})):n===`index`?$O(e,t):n===`append`?ek(e,t):nk(e,t,n)}function ik(e,t){var n=(0,f.useRef)(e),r=(0,f.useRef)(t.current),i=(0,f.useRef)(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=(0,f.useCallback)(function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;n===0?i.current=!0:(n===1&&(r.current=e),n>0&&i.current&&a&&(t.current=e))},[t]);return{startValue:r.current,syncStepValue:a}}function ak(e,t){return uk(e)||lk(e,t)||sk(e,t)||ok()}function ok(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sk(e,t){if(e){if(typeof e==`string`)return ck(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ck(e,t):void 0}}function ck(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{typeof e==`function`&&e(),i(!0)},[e]),handleAnimationEnd:(0,f.useCallback)(()=>{typeof t==`function`&&t(),i(!1)},[t])}}function fk(e){var t=e.animationInput,n=e.animationIdPrefix,r=e.items,i=e.previousItemsRef,a=e.isAnimationActive,o=e.animationBegin,s=e.animationDuration,c=e.animationEasing,l=e.onAnimationStart,u=e.onAnimationEnd,d=e.animationInterpolateFn,p=e.animationMatchBy,m=e.shouldUpdatePreviousRef,h=e.children,g=e.layout,_=Ef(t,n),v=ik(_,i),y=v.startValue??null,b=rk(y,r,p??XO);return f.createElement(Tf,{animationId:_,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:u,onAnimationStart:l,key:_},e=>{var t=y==null,n=r==null?r:d(b,e,g),i=m?m(e):e>0;return v.syncStepValue(n,e,i),n==null?null:h(n,e,t)})}function pk(e,t){return vk(e)||_k(e,t)||hk(e,t)||mk()}function mk(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hk(e,t){if(e){if(typeof e==`string`)return gk(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gk(e,t):void 0}}function gk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);npk(f.useState(()=>he(`uid-`)),1)[0]);function bk(e,t){var n=yk();return t||(e?`${e}-${n}`:n)}var xk=(0,f.createContext)(void 0),Sk=e=>{var t=e.id,n=e.type,r=e.children,i=bk(`recharts-${n}`,t);return f.createElement(xk.Provider,{value:i},r(i))},Ck=Jo({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(V(t.payload))},prepare:H()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=bo(e).cartesianItems.indexOf(V(r));a>-1&&(e.cartesianItems[a]=V(i))},prepare:H()},removeCartesianGraphicalItem:{reducer(e,t){var n=bo(e).cartesianItems.indexOf(V(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:H()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(V(t.payload))},prepare:H()},removePolarGraphicalItem:{reducer(e,t){var n=bo(e).polarItems.indexOf(V(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:H()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=bo(e).polarItems.indexOf(V(r));a>-1&&(e.polarItems[a]=V(i))},prepare:H()}}}),wk=Ck.actions,Tk=wk.addCartesianGraphicalItem,Ek=wk.replaceCartesianGraphicalItem,Dk=wk.removeCartesianGraphicalItem;wk.addPolarGraphicalItem,wk.removePolarGraphicalItem,wk.replacePolarGraphicalItem;var Ok=Ck.reducer,kk=(0,f.memo)(e=>{var t=R(),n=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{n.current===null?t(Tk(e)):n.current!==e&&t(Ek({prev:n.current,next:e})),n.current=e},[t,e]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(Dk(n.current)),null)},[t]),null}),Ak=[`points`];function jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mk(e){for(var t=1;t{var s=Mk(Mk(Mk({r:3},o),p),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return f.createElement(zk,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),h={};return s&&c!=null&&(h.clipPath=`url(#clipPath-${d?``:`dots-`}${c})`),f.createElement(ET,{zIndex:u},f.createElement(k,Ik({className:r},h),m))}function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Uk(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),fc,pc],(e,t,n)=>{if(e&&t!=null&&n!=null)return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),aA=()=>z(iA),oA=()=>z(kw);function sA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s=cA(cA(cA({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),_(i)),yn(i)),c=(0,f.isValidElement)(i)?(0,f.cloneElement)(i,s):typeof i==`function`?i(s):f.createElement(TO,s);return f.createElement(k,{className:`recharts-active-dot`,clipPath:o},c)};function pA(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,s=o===void 0?wm.activeDot:o,c=z(Sw),l=oA();if(t==null||l==null)return null;var u=t.find(e=>l.includes(e.payload));return I(u)?null:f.createElement(ET,{zIndex:s},f.createElement(fA,{point:u,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var mA=e=>{var t=e.chartData,n=R(),r=Nc();return(0,f.useEffect)(()=>r?()=>{}:(n(YT(t)),()=>{n(YT(void 0))}),[t,n,r]),null},hA={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},gA=Jo({name:`brush`,initialState:hA,reducers:{setBrushSettings(e,t){return t.payload==null?hA:t.payload}}});gA.actions.setBrushSettings;var _A=gA.reducer;function vA(e){return(e%180+180)%180}var yA=function(e){var t=e.width,n=e.height,r=vA(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=bo(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=bo(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(V(t.payload))},removeLine:(e,t)=>{var n=bo(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),xA=bA.actions;xA.addDot,xA.removeDot,xA.addArea,xA.removeArea,xA.addLine,xA.removeLine;var SA=bA.reducer;function CA(e,t){return OA(e)||DA(e,t)||TA(e,t)||wA()}function wA(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TA(e,t){if(e){if(typeof e==`string`)return EA(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EA(e,t):void 0}}function EA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.children,n=CA((0,f.useState)(`${he(`recharts`)}-clip`),1)[0],r=aA();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return f.createElement(kA.Provider,{value:n},f.createElement(`defs`,null,f.createElement(`clipPath`,{id:n},f.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function jA(){}function MA(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:Object.prototype.toString.call(e)===`[object Object]`}function NA(e,t,n){return PA(e,t,void 0,void 0,void 0,void 0,n)}function PA(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return FA(e,t,a,o)}return FA(e,t,a,o)}function FA(e,t,n,r){if(Object.is(e,t))return!0;let i=qn(e),a=qn(t);if(i===`[object Arguments]`&&(i=or),a===`[object Arguments]`&&(a=or),i!==a)return!1;switch(i){case Yn:return e.toString()===t.toString();case Xn:return br(e.valueOf(),t.valueOf());case Zn:case er:case $n:return Object.is(e.valueOf(),t.valueOf());case Jn:return e.source===t.source&&e.flags===t.flags;case ir:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case tr:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!PA(a,t.get(i),i,e,t,n,r))return!1;return!0;case nr:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;oPA(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case rr:case lr:case ur:case dr:case fr:case pr:case mr:case hr:case gr:case _r:case vr:case yr:if(jr(e)!==jr(t)||e.length!==t.length)return!1;for(let i=0;ie*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function VA(e,t){return LA(e,t+1)}function HA(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:LA(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||BA(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function UA(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var o=t.start,s=t.end,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||BA(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=GA(GA({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=GA(GA({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&BA(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=GA(GA({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function XA(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=GA(GA({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&BA(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=GA(GA({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=GA(GA({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=GA(GA({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&BA(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=GA(GA({},a),{},{isShow:!0}))},h=0;h{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?RA(VE(i,{fontSize:t,letterSpacing:n}),m,d):VE(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?ue(_.coordinate-g.coordinate):1,y=zA(a,v,p);return c===`equidistantPreserveStart`?HA(v,y,h,i,o):c===`equidistantPreserveEnd`?UA(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?XA(v,y,h,i,o,c===`preserveStartEnd`):YA(v,y,h,i,o),f.filter(e=>e.isShow))}var QA=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r===void 0?5:r,a=e.tickSize,o=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,l=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>l&&(l=t.width)}});var u=n?n.getBoundingClientRect().width:0,d=o+c,f=l+d+u+(n?i:0);return Math.round(f)}return 0},$A=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r===void 0?5:r,a=e.tickSize,o=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,l=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.height>l&&(l=t.height)}});var u=n?n.getBoundingClientRect().height:0,d=o+c,f=l+d+u+(n?i:0);return Math.round(f)}return 0},ej=Jo({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=V(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),tj=ej.actions,nj=tj.setRenderedTicks,rj=tj.removeRenderedTicks,ij=ej.reducer,aj=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function oj(e,t){return dj(e)||uj(e,t)||cj(e,t)||sj()}function sj(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cj(e,t){if(e){if(typeof e==`string`)return lj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lj(e,t):void 0}}function lj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if(r!=null&&n!=null){var e=t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),o=a.current;o!=null&&o.axisId===r&&o.axisType===n&&IA(o.ticks,e)||(a.current={ticks:e,axisId:r,axisType:n},i(nj({ticks:e,axisId:r,axisType:n})))}},[i,t,r,n]),(0,f.useEffect)(()=>r==null||n==null?Se:()=>{i(rj({axisId:r,axisType:n}))},[i,r,n]),null}var Ej=(0,f.forwardRef)((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,o=e.stroke,s=e.tickFormatter,c=e.unit,u=e.padding,d=e.tickTextProps,p=e.orientation,m=e.mirror,h=e.x,v=e.y,y=e.width,b=e.height,x=e.tickSize,S=e.tickMargin,C=e.fontSize,w=e.letterSpacing,T=e.getTicksConfig,E=e.events,D=e.axisType,O=e.axisId,A=ZA(Q(Q({},T),{},{ticks:r}),C,w),j=g(T),M=_(i),N=DD(j.textAnchor)?j.textAnchor:Sj(p,m),ee=Cj(p,m),te={};typeof a==`object`&&(te=a);var ne=Q(Q({},j),{},{fill:`none`},te),re=A.map(e=>Q({entry:e},xj(e,h,v,y,b,p,x,m,S))),ie=re.map(e=>{var t=e.entry,n=e.line;return f.createElement(k,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},a&&f.createElement(`line`,mj({},ne,n,{className:l(`recharts-cartesian-axis-tick-line`,oe(a,`className`))})))}),ae=re.map((e,t)=>{var n=e.entry,r=e.tick,a=Q(Q({},Q(Q(Q(Q({verticalAnchor:ee},j),{},{textAnchor:N,stroke:`none`,fill:o},r),{},{index:t,payload:n,visibleTicksCount:A.length,tickFormatter:s,padding:u},d),{},{angle:d?.angle??j.angle??0})),M);return f.createElement(k,mj({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},xn(E,n,t)),i&&f.createElement(wj,{option:i,tickProps:a,value:`${typeof s==`function`?s(n.value,t):n.value}${c||``}`}))});return f.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${D}-ticks`},f.createElement(Tj,{ticks:A,axisId:O,axisType:D}),ae.length>0&&f.createElement(ET,{zIndex:wm.label},f.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${D}-tick-labels`,ref:t},ae)),ie.length>0&&f.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${D}-tick-lines`},ie))}),Dj=(0,f.forwardRef)((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,o=e.hide,s=e.ticks,c=e.axisType,u=e.axisId,d=fj(e,aj),p=oj((0,f.useState)(``),2),m=p[0],h=p[1],_=oj((0,f.useState)(``),2),v=_[0],y=_[1],b=(0,f.useRef)(null);(0,f.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>QA({ticks:b.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin}),getCalculatedHeight:()=>$A({ticks:b.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var x=(0,f.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);b.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==m||a!==v)&&(h(i),y(a))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:f.createElement(ET,{zIndex:e.zIndex},f.createElement(k,{className:l(`recharts-cartesian-axis`,a)},f.createElement(bj,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:g(e)}),f.createElement(Ej,{ref:x,axisType:c,events:d,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),f.createElement(XD,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},f.createElement(uO,{label:e.label,labelRef:e.labelRef}),e.children)))}),Oj=f.forwardRef((e,t)=>{var n=Dn(e,yj);return f.createElement(Dj,mj({},n,{ref:t}))});Oj.displayName=`CartesianAxis`;var kj=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function Aj(){return Aj=Object.assign?Object.assign.bind():function(e){for(var t=1;te+t,0);if(!i)return Pj(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;co){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...Ij(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function Rj(e,t,n){return e?Lj(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Pj(t,n)}function zj(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=jj(e,kj),a=r??!1,o;if(t!=null){var s=i.pathRef;o=Rj(n,Nj(s?.current??null),t)}else n!=null&&(o=String(n));return f.createElement(Nd,Aj({},i,{connectNulls:a,strokeDasharray:o}))}function Bj(e){var t=(0,f.useRef)(0),n=(0,f.useRef)(0),r=(0,f.useRef)(!1),i=(0,f.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,f.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(le(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var Vj=Jo({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(e=>e.dataKey===i.dataKey&&e.direction===i.direction?a:e))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==i.dataKey||e.direction!==i.direction))}}}),Hj=Vj.actions;Hj.addErrorBar,Hj.replaceErrorBar,Hj.removeErrorBar;var Uj=Vj.reducer,Wj=[`children`];function Gj(e,t){if(e==null)return{};var n,r,i=Kj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0});function Jj(e){var t=e.children,n=Gj(e,Wj);return f.createElement(qj.Provider,{value:n},t)}function Yj(e,t){var n=z(t=>rx(t,e)),r=z(e=>ax(e,t)),i=n?.allowDataOverflow??Y.allowDataOverflow,a=r?.allowDataOverflow??X.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function Xj(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=aA(),a=Yj(t,n),o=a.needClipX,s=a.needClipY,c=a.needClip,l=z(e=>OS(e,t,!1)),u=z(e=>kS(e,n,!1));if(!c||!i)return null;var d=i.x,p=i.y,m=i.width,h=i.height,g=o&&l?Math.min(l[0],l[1]):d-m/2,_=s&&u?Math.min(u[0],u[1]):p-h/2,v=o&&l?Math.abs(l[1]-l[0]):m*2,y=s&&u?Math.abs(u[1]-u[0]):h*2;return f.createElement(`clipPath`,{id:`clipPath-${r}`},f.createElement(`rect`,{x:g,y:_,width:v,height:y}))}var Zj=(e,t,n,r)=>tC(e,`xAxis`,t,r),Qj=(e,t,n,r)=>eC(e,`xAxis`,t,r),$j=(e,t,n,r)=>tC(e,`yAxis`,n,r),eM=(e,t,n,r)=>eC(e,`yAxis`,n,r),tM=B([G,Zj,$j,Qj,eM],(e,t,n,r,i)=>Zs(e,`xAxis`)?sc(t,r,!1):sc(n,i,!1)),nM=(e,t,n,r,i)=>i;function rM(e){return e.type===`line`}var iM=B([G,Zj,$j,Qj,eM,B([px,nM],(e,t)=>e.filter(rM).find(e=>e.id===t)),tM,Vp],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return AM({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function aM(e){var t=_(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var oM=[`id`],sM=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],cM=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function lM(){return lM=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t/n:0}var yM={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=vM(e),r=[];for(var i of e)if(i.status===`matched`)r.push(pM(pM({},i.next),{},{x:ve(i.prev.x,i.next.x,t),y:ve(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(pM(pM({},i.next),{},{x:ve(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(pM(pM({},i.prev),{},{x:ve(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:XO,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:zj,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:wm.line,type:`linear`},bM=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:lc(n,t),payload:e}]},xM=f.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,p={dataDefinedOnItem:n,getPosition:Se,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:lc(o,t),hide:s,type:u,color:r,unit:c,formatter:l,graphicalItemId:d}};return f.createElement(HO,{tooltipEntrySettings:p})});function SM(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,o=r.needClip;r.id;var s=g(uM(r,oM));return f.createElement(Vk,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:s,needClip:o,clipPathId:t})}function CM(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,f.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return pM(pM({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return f.createElement(vO,{value:t?i:void 0},n)}function wM(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,p=i.needClip,m=i.shape,h=i.strokeDasharray,g=pM(pM({},v(uM(i,sM))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:p?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:h??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return f.createElement(f.Fragment,null,r?.length>1&&f.createElement(VO,{option:m,DefaultShape:yM.shape,shapeProps:g}),f.createElement(SM,{points:r,clipPathId:t,props:i}))}function TM(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,p=n.layout,m=_M(r.current),h=dk(n.onAnimationStart,n.onAnimationEnd),g=h.isAnimating,_=h.handleAnimationStart,v=h.handleAnimationEnd,y=!g,b=Bj(a),x=(0,f.useCallback)(e=>e>0&&m>0,[m]);return f.createElement(CM,{points:a,showLabels:y},n.children,f.createElement(fk,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:_,onAnimationEnd:v,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:x,layout:p},(e,i,a)=>{var o=g||i<1,s=o?b(i,m):null;return f.createElement(wM,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),f.createElement(CO,{label:n.label}))}function EM(e){var t=e.clipPathId,n=e.props,r=(0,f.useRef)(null),i=(0,f.useRef)(null);return f.createElement(TM,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var DM=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:W(e.payload,t)}),OM=class extends f.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,c=e.left,u=e.width,d=e.height,p=e.id,m=e.needClip,h=e.zIndex;if(t)return null;var g=l(`recharts-line`,i),_=p,v=aM(n),y=v.r,b=v.strokeWidth,x=AO(n),S=y*2+b,C=m?`url(#clipPath-${x?``:`dots-`}${_})`:void 0;return f.createElement(ET,{zIndex:h},f.createElement(k,{className:g},m&&f.createElement(`defs`,null,f.createElement(Xj,{clipPathId:_,xAxisId:a,yAxisId:o}),!x&&f.createElement(`clipPath`,{id:`clipPath-dots-${_}`},f.createElement(`rect`,{x:c-S/2,y:s-S/2,width:u+S,height:d+S}))),f.createElement(Jj,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:DM,errorBarOffset:0},f.createElement(EM,{props:this.props,clipPathId:_}))),f.createElement(pA,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:C}))}};function kM(e){var t=Dn(e,yM),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,p=t.legendType,m=t.xAxisId,h=t.yAxisId,g=t.id,_=uM(t,cM),v=Yj(m,h).needClip,y=aA(),b=xl(),x=Nc(),S=z(e=>iM(e,m,h,x,g));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,w=y.width,T=y.x,E=y.y;return f.createElement(OM,lM({},_,{id:g,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:p,xAxisId:m,yAxisId:h,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:v}))}function AM(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize;return e.displayedData.map((e,c)=>{var l=W(e,o);if(t===`horizontal`)return{x:tc({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(I(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=I(l)?null:n.scale.map(l),d=tc({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function jM(e){var t=Dn(e,yM),n=Nc();return f.createElement(Sk,{id:t.id,type:`line`},e=>f.createElement(f.Fragment,null,f.createElement(UO,{legendPayload:bM(t)}),f.createElement(xM,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),f.createElement(kk,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),f.createElement(kM,lM({},t,{id:e}))))}var MM=f.memo(jM,Zl);MM.displayName=`Line`;function NM(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function PM(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var FM=(e,t,n)=>tC(e,`xAxis`,NM(e,t),n),IM=(e,t,n)=>eC(e,`xAxis`,NM(e,t),n),LM=(e,t,n)=>tC(e,`yAxis`,PM(e,t),n),RM=(e,t,n)=>eC(e,`yAxis`,PM(e,t),n),zM=B([G,FM,LM,IM,RM],(e,t,n,r,i)=>Zs(e,`xAxis`)?sc(t,r,!1):sc(n,i,!1)),BM=B([px,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),VM=e=>Zs(G(e),`xAxis`)?`yAxis`:`xAxis`,HM=(e,t)=>VM(e)===`yAxis`?PM(e,t):NM(e,t),UM=(e,t,n)=>Rx(e,VM(e),HM(e,t),n),WM=B([G,FM,LM,IM,RM,B([BM,UM],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=qm(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Hp,zM,BM,Cm,B([BM,UM],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(xe)}})],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return CN({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),GM=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],KM=[`id`,`baseLine`];function qM(){return qM=Object.assign?Object.assign.bind():function(e){for(var t=1;te.y||0));return F(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),F(c)?f.createElement(`rect`,{x:ae.x||0));return F(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),F(c)?f.createElement(`rect`,{x:0,y:ae==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[oN(oN({},e.next),{},{x:ve(e.prev.x,e.next.x,t),y:ve(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:$M,xAxisId:0,yAxisId:0,zIndex:wm.area};function dN(e,t){return e&&e!==`none`?e:t}var fN=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:dN(r,i),value:lc(n,t),payload:e}]},pN=f.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,p={dataDefinedOnItem:n,getPosition:Se,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:lc(o,t),hide:s,type:u,color:dN(r,a),unit:c,formatter:l,graphicalItemId:d}};return f.createElement(HO,{tooltipEntrySettings:p})});function mN(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=g(r);return f.createElement(Vk,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function hN(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return oN(oN({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return f.createElement(vO,{value:t?r:void 0},n)}function gN(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,p=a.connectNulls,m=a.isRange,h=a.shape,g=a.id,_=rN(a,eN),y=oN(oN({},v(_)),{},{id:g,points:t,connectNulls:p,type:u,baseLine:n,layout:l,stroke:d,isRange:m,animationElapsedTime:o,isAnimating:s,isEntrance:c});return f.createElement(f.Fragment,null,t?.length>1&&f.createElement(k,{clipPath:r?`url(#clipPath-${i})`:void 0},f.createElement(VO,{option:h,DefaultShape:uN.shape,shapeProps:y})),f.createElement(mN,{points:t,props:_,clipPathId:i}))}function _N(e,t,n){return F(e)?ve(F(t)?t:void 0,e,n):I(e)||de(e)?ve(F(t)?t:void 0,0,n):e}function vN(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,p=r.animationMatchBy,m=r.animationInterpolateFn,h=(0,f.useMemo)(()=>({points:o,baseLine:s}),[o,s]),g=ik(h,a),_=Sl(),v=dk(r.onAnimationStart,r.onAnimationEnd),y=v.isAnimating,b=v.handleAnimationStart,x=v.handleAnimationEnd,S=g.startValue;if(_==null)return null;var C=Array.isArray(s)&&Array.isArray(S)?rk(S,s,p):Array.isArray(s)?rk(null,s,p):null;return f.createElement(fk,{animationInput:h,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:b,onAnimationEnd:x,animationInterpolateFn:m,animationMatchBy:p,layout:_},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?m(C,i,_):a?s:_N(s,S,i);return g.syncStepValue(c,i),f.createElement(hN,{showLabels:!y,points:o},r.children,f.createElement(gN,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:y||i<1,isEntrance:a}),f.createElement(CO,{label:r.label}))})}function yN(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,f.useRef)(null),a=(0,f.useRef)();return f.createElement(vN,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var bN=class extends f.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,u=e.yAxisId,d=e.width,p=e.height,m=e.id,h=e.baseLine,g=e.zIndex;if(t)return null;var _=l(`recharts-area`,i),v=m,y=aM(n),b=y.r,x=y.strokeWidth,S=AO(n),C=b*2+x,w=s?`url(#clipPath-${S?``:`dots-`}${v})`:void 0;return f.createElement(ET,{zIndex:g},f.createElement(k,{className:_},s&&f.createElement(`defs`,null,f.createElement(Xj,{clipPathId:v,xAxisId:c,yAxisId:u}),!S&&f.createElement(`clipPath`,{id:`clipPath-dots-${v}`},f.createElement(`rect`,{x:o-C/2,y:a-C/2,width:d+C,height:p+C}))),f.createElement(yN,{needClip:s,clipPathId:v,props:this.props})),f.createElement(pA,{points:r,mainColor:dN(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}),this.props.isRange&&Array.isArray(h)&&f.createElement(pA,{points:h,mainColor:dN(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}))}};function xN(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,p=e.stroke,m=e.xAxisId,h=e.yAxisId,g=rN(e,tN),_=xl(),v=Kw(),y=Yj(m,h).needClip,b=Nc(),x=z(t=>WM(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=aA();if(_!==`horizontal`&&_!==`vertical`||T==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var E=T.height,D=T.width,O=T.x,k=T.y;return!S||!S.length?null:f.createElement(bN,nN({},g,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:_,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:p,width:D,left:O,top:k,xAxisId:m,yAxisId:h}))}var SN=(e,t,n,r,i)=>{var a=n??t;if(F(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function CN(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=SN(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=W(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=W(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>W(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:tc({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:tc({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function wN(e){var t=Dn(e,uN),n=Nc();return f.createElement(Sk,{id:t.id,type:`area`},e=>f.createElement(f.Fragment,null,f.createElement(UO,{legendPayload:fN(t)}),f.createElement(pN,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),f.createElement(kk,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ec(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),f.createElement(xN,nN({},t,{id:e}))))}var TN=f.memo(wN,Zl);TN.displayName=`Area`;var EN=[`domain`,`range`],DN=[`domain`,`range`];function ON(e,t){if(e==null)return{};var n,r,i=kN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{if(o!=null)return LN(LN({},a),{},{type:o})},[a,o]);return(0,f.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(Yk(s)):n.current!==s&&t(Xk({prev:n.current,next:s})),n.current=s)},[s,t]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(Zk(n.current)),null)},[t]),null}var WN=e=>{var t=e.xAxisId,n=e.className,r=e.height,i=e.label,a=(0,f.useRef)(null),o=(0,f.useRef)(null),s=z(jc),c=Nc(),u=R(),d=`xAxis`,p=z(e=>$S(e,d,t,c)),m=z(e=>US(e,t)),h=z(e=>JS(e,t)),g=z(e=>nx(e,t));if((0,f.useLayoutEffect)(()=>{if(!(r!==`auto`||!m||tO(i)||(0,f.isValidElement)(i)||g==null)){var e=a.current;if(e){var n=e.getCalculatedHeight();Math.round(m.height)!==Math.round(n)&&u(nA({id:t,height:n}))}}},[p,m,u,i,t,r,g]),m==null||h==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var _=VN(e,NN);g.id,g.scale;var v=VN(g,PN);return f.createElement(Oj,FN({},_,v,{ref:a,labelRef:o,x:h.x,y:h.y,width:m.width,height:m.height,className:l(`recharts-${d} ${d}`,n),viewBox:s,ticks:p,axisType:d,axisId:t}))},GN={allowDataOverflow:Y.allowDataOverflow,allowDecimals:Y.allowDecimals,allowDuplicatedCategory:Y.allowDuplicatedCategory,angle:Y.angle,axisLine:yj.axisLine,height:Y.height,hide:!1,includeHidden:Y.includeHidden,interval:Y.interval,label:!1,minTickGap:Y.minTickGap,mirror:Y.mirror,orientation:Y.orientation,padding:Y.padding,reversed:Y.reversed,scale:Y.scale,tick:Y.tick,tickCount:Y.tickCount,tickLine:yj.tickLine,tickSize:yj.tickSize,type:Y.type,niceTicks:Y.niceTicks,xAxisId:0},KN=f.memo(e=>{var t=Dn(e,GN);return f.createElement(f.Fragment,null,f.createElement(UN,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),f.createElement(WN,t))},jN);KN.displayName=`XAxis`;var qN=[`type`],JN=[`dangerouslySetInnerHTML`,`ticks`,`scale`],YN=[`id`,`scale`];function XN(){return XN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(o!=null)return QN(QN({},a),{},{type:o})},[o,a]);return(0,f.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(Qk(s)):n.current!==s&&t($k({prev:n.current,next:s})),n.current=s)},[s,t]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(eA(n.current)),null)},[t]),null}function aP(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=(0,f.useRef)(null),o=(0,f.useRef)(null),s=z(jc),c=Nc(),u=R(),d=`yAxis`,p=z(e=>XS(e,t)),m=z(e=>YS(e,t)),h=z(e=>$S(e,d,t,c)),g=z(e=>ix(e,t));if((0,f.useLayoutEffect)(()=>{if(!(r!==`auto`||!p||tO(i)||(0,f.isValidElement)(i)||g==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(p.width)!==Math.round(n)&&u(tA({id:t,width:n}))}}},[h,p,u,i,t,r,g]),p==null||m==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var _=nP(e,JN);g.id,g.scale;var v=nP(g,YN);return f.createElement(Oj,XN({},_,v,{ref:a,labelRef:o,x:m.x,y:m.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:p.width,height:p.height,className:l(`recharts-${d} ${d}`,n),viewBox:s,ticks:h,axisType:d,axisId:t}))}var oP={allowDataOverflow:X.allowDataOverflow,allowDecimals:X.allowDecimals,allowDuplicatedCategory:X.allowDuplicatedCategory,angle:X.angle,axisLine:yj.axisLine,hide:!1,includeHidden:X.includeHidden,interval:X.interval,label:!1,minTickGap:X.minTickGap,mirror:X.mirror,orientation:X.orientation,padding:X.padding,reversed:X.reversed,scale:X.scale,tick:X.tick,tickCount:X.tickCount,tickLine:yj.tickLine,tickSize:yj.tickSize,type:X.type,niceTicks:X.niceTicks,width:X.width,yAxisId:0},sP=f.memo(e=>{var t=Dn(e,oP);return f.createElement(f.Fragment,null,f.createElement(iP,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),f.createElement(aP,t))},jN);sP.displayName=`YAxis`;var cP=B([(e,t)=>t,G,Wm,$m,hw,_w,Xw,kc],cT);function lP(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function uP(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(lP(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var dP=Do(`mouseClick`),fP=Ps();fP.startListening({actionCreator:dP,effect:(e,t)=>{var n=e.payload,r=cP(t.getState(),uP(n));r?.activeIndex!=null&&t.dispatch(bC({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var pP=Do(`mouseMove`),mP=Ps(),hP=null,gP=null,_P=null;mP.startListening({actionCreator:pP,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);hP!==null&&(cancelAnimationFrame(hP),hP=null),gP===null||typeof i==`number`&&o||(clearTimeout(gP),gP=null),_P=uP(n);var s=()=>{var e=t.getState(),n=oC(e,e.tooltip.settings.shared);if(!_P)hP=null,gP=null;else{if(n===`axis`){var r=cP(e,_P);r?.activeIndex==null?t.dispatch(vC()):t.dispatch(yC({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}hP=null,gP=null}};o?i===`raf`?hP=requestAnimationFrame(s):typeof i==`number`&&gP===null&&(gP=setTimeout(s,i)):s()}});function vP(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<>`:t}var yP={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},bP=Jo({name:`rootProps`,initialState:yP,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??yP.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),xP=bP.reducer,SP=bP.actions.updateOptions,CP=Jo({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}});CP.actions.updatePolarOptions;var wP=CP.reducer,TP=Do(`keyDown`),EP=Do(`focus`),DP=Do(`blur`),OP=Ps(),kP=null,AP=null,jP=null;OP.startListening({actionCreator:TP,effect:(e,t)=>{jP=e.payload,kP!==null&&(cancelAnimationFrame(kP),kP=null);var n=t.getState().eventSettings,r=n.throttleDelay,i=n.throttledEvents,a=i===`all`||i.includes(`keydown`);AP===null||typeof r==`number`&&a||(clearTimeout(AP),AP=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=jP;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=FC(n,rw(e),Fx(e),fw(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=_w(e),c=rw(e),l=oC(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=tT(e,l,`hover`,String(n.index));t.dispatch(SC({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=nC(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=Fx(e),h=fw(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v=0;y--)if(FC(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=tT(e,l,`hover`,String(p));t.dispatch(SC({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{kP=null,AP=null}};a?r===`raf`?kP=requestAnimationFrame(o):typeof r==`number`&&AP===null&&(o(),jP=null,AP=setTimeout(()=>{jP?o():(AP=null,kP=null)},r)):o()}}),OP.startListening({actionCreator:EP,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;if(!r.active&&r.index==null){var i=`0`,a=tT(n,oC(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(SC({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),OP.startListening({actionCreator:DP,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(SC({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function MP(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var NP=Do(`externalEvent`),PP=Ps(),FP=new Map,IP=new Map,LP=new Map;PP.startListening({actionCreator:NP,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=MP(i);LP.set(a,{handler:r,reactEvent:o});var s=FP.get(a);s!==void 0&&(cancelAnimationFrame(s),FP.delete(a));var c=t.getState().eventSettings,l=c.throttleDelay,u=c.throttledEvents,d=u===`all`||u?.includes(a),f=IP.get(a);f===void 0||typeof l==`number`&&d||(clearTimeout(f),IP.delete(a));var p=()=>{var e=LP.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:Dw(i),activeDataKey:ww(i),activeIndex:Sw(i),activeLabel:Cw(i),activeTooltipIndex:Sw(i),isTooltipActive:Ow(i)};n&&n(o,r)}finally{FP.delete(a),IP.delete(a),LP.delete(a)}};if(!d)p();else if(l===`raf`){var m=requestAnimationFrame(p);FP.set(a,m)}else if(typeof l==`number`){if(!IP.has(a)){p();var h=setTimeout(p,l);IP.set(a,h)}}else p()}}});var RP=B([B([zC],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),zP=Do(`touchMove`),BP=Ps(),VP=null,HP=null,UP=null,WP=null;BP.startListening({actionCreator:zP,effect:(e,t)=>{var n=e.payload;if(n.touches!=null&&n.touches.length!==0){WP=MP(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);VP!==null&&(cancelAnimationFrame(VP),VP=null),HP===null||typeof i==`number`&&o||(clearTimeout(HP),HP=null),UP=Array.from(n.touches).map(e=>uP({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(WP!=null){var e=t.getState(),n=oC(e,e.tooltip.settings.shared);if(n===`axis`){var r=UP?.[0];if(r==null){VP=null,HP=null;return}var i=cP(e,r);i?.activeIndex!=null&&t.dispatch(yC({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=WP.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(vc),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=$C(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=RP(e,s,c);t.dispatch(_C({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}VP=null,HP=null}};o?i===`raf`?VP=requestAnimationFrame(s):typeof i==`number`&&HP===null&&(s(),WP=null,HP=setTimeout(()=>{WP?s():(HP=null,VP=null)},i)):s()}}});var GP={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},KP=Jo({name:`eventSettings`,initialState:GP,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=V(t.payload.throttledEvents))}}}),qP=KP.actions.setEventSettings,JP=KP.reducer,YP=Xi({brush:_A,cartesianAxis:rA,chartData:ZT,errorBars:Uj,eventSettings:JP,graphicalItems:Ok,layout:Hs,legend:Nl,options:WT,polarAxis:OO,polarOptions:wP,referenceElements:SA,renderedTicks:ij,rootProps:xP,tooltip:CC,zIndex:TT}),XP=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Ro({reducer:YP,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([fP.middleware,mP.middleware,OP.middleware,PP.middleware,BP.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(Io({type:`raf`}))},devTools:Xu.devToolsEnabled&&{serialize:{replacer:vP},name:`recharts-${t}`}})};function ZP(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Nc(),a=(0,f.useRef)(null);if(i)return n;a.current??=XP(t,r);var o=ei;return f.createElement(Jl,{context:o,store:a.current},n)}function QP(e){var t=e.layout,n=e.margin,r=R(),i=Nc();return(0,f.useEffect)(()=>{i||(r(zs(t)),r(Rs(n)))},[r,i,t,n]),null}var $P=(0,f.memo)(QP,Zl);function eF(e){var t=R();return(0,f.useEffect)(()=>{t(SP(e))},[t,e]),null}var tF=(0,f.memo)(e=>{var t=R();return(0,f.useEffect)(()=>{t(qP(e))},[t,e]),null},Zl);function nF(e){var t=e.zIndex,n=e.isPanorama,r=(0,f.useRef)(null),i=R();return(0,f.useLayoutEffect)(()=>(r.current&&i(CT({zIndex:t,element:r.current,isPanorama:n})),()=>{i(wT({zIndex:t,isPanorama:n}))}),[i,t,n]),f.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function rF(e){var t=e.children,n=e.isPanorama,r=z(uT);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return f.createElement(f.Fragment,null,i.map(e=>f.createElement(nF,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>f.createElement(nF,{key:e,zIndex:e,isPanorama:n})))}var iF=[`children`];function aF(e,t){if(e==null)return{};var n,r,i=oF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=vl(),r=yl(),i=vd();if(!Ws(n)||!Ws(r))return null;var a=e.children,o=e.otherAttributes,s=e.title,c=e.desc,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),f.createElement(w,sF({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:cF,ref:t}),a)}),uF=e=>{var t=e.children,n=z(Fc);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return f.createElement(w,{width:r,height:i,x:o,y:a},t)},dF=(0,f.forwardRef)((e,t)=>{var n=e.children,r=aF(e,iF);return Nc()?f.createElement(uF,null,f.createElement(rF,{isPanorama:!0},n)):f.createElement(lF,sF({ref:t},r),f.createElement(rF,{isPanorama:!1},n))});function fF(e,t){return _F(e)||gF(e,t)||mF(e,t)||pF()}function pF(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mF(e,t){if(e){if(typeof e==`string`)return hF(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hF(e,t):void 0}}function hF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if(n!=null){var t=n.getBoundingClientRect().width/n.offsetWidth;U(t)&&t!==i&&e(Vs(t))}},[n,e,i]),r}function yF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bF(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n(cE(),null);function MF(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var NF=(0,f.forwardRef)((e,t)=>{var n=(0,f.useRef)(null),r=TF((0,f.useState)({containerWidth:MF(e.style?.width),containerHeight:MF(e.style?.height)}),2),i=r[0],a=r[1],o=(0,f.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,f.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var r=e.getBoundingClientRect(),i=r.width,a=r.height;o(i,a);var s=new ResizeObserver(e=>{var t=e[0];if(t!=null){var n=t.contentRect,r=n.width,i=n.height;o(r,i)}});s.observe(e),n.current=s}},[t,o]);return(0,f.useEffect)(()=>()=>{n.current?.disconnect()},[o]),f.createElement(f.Fragment,null,f.createElement(Tl,{width:i.containerWidth,height:i.containerHeight}),f.createElement(`div`,wF({ref:s},e)))}),PF=(0,f.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=TF((0,f.useState)({containerWidth:MF(n),containerHeight:MF(r)}),2),a=i[0],o=i[1],s=(0,f.useCallback)((e,t)=>{o(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),c=(0,f.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var n=e.getBoundingClientRect(),r=n.width,i=n.height;s(r,i)}},[t,s]);return f.createElement(f.Fragment,null,f.createElement(Tl,{width:a.containerWidth,height:a.containerHeight}),f.createElement(`div`,wF({ref:c},e)))}),FF=(0,f.forwardRef)((e,t)=>{var n=e.width,r=e.height;return f.createElement(f.Fragment,null,f.createElement(Tl,{width:n,height:r}),f.createElement(`div`,wF({ref:t},e)))}),IF=(0,f.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?f.createElement(PF,wF({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?f.createElement(FF,wF({},e,{width:n,height:r,ref:t})):f.createElement(f.Fragment,null,f.createElement(Tl,{width:n,height:r}),f.createElement(`div`,wF({ref:t},e)))});function LF(e){return e?NF:IF}var RF=(0,f.forwardRef)((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,u=e.onMouseEnter,d=e.onMouseLeave,p=e.onMouseMove,m=e.onMouseUp,h=e.onTouchEnd,g=e.onTouchMove,_=e.onTouchStart,v=e.style,y=e.width,b=e.responsive,x=e.dispatchTouchEvents,S=x===void 0||x,C=(0,f.useRef)(null),w=R(),T=TF((0,f.useState)(null),2),E=T[0],D=T[1],O=TF((0,f.useState)(null),2),k=O[0],A=O[1],j=vF(),M=fl(),N=M?.width>0?M.width:y,ee=M?.height>0?M.height:i,te=(0,f.useCallback)(e=>{j(e),typeof t==`function`&&t(e),D(e),A(e),e!=null&&(C.current=e)},[j,t,D,A]),ne=(0,f.useCallback)(e=>{w(dP(e)),w(NP({handler:a,reactEvent:e}))},[w,a]),re=(0,f.useCallback)(e=>{w(pP(e)),w(NP({handler:u,reactEvent:e}))},[w,u]),ie=(0,f.useCallback)(e=>{w(vC()),w(NP({handler:d,reactEvent:e}))},[w,d]),ae=(0,f.useCallback)(e=>{w(pP(e)),w(NP({handler:p,reactEvent:e}))},[w,p]),oe=(0,f.useCallback)(()=>{w(EP())},[w]),se=(0,f.useCallback)(()=>{w(DP())},[w]),ce=(0,f.useCallback)(e=>{w(TP(e.key))},[w]),le=(0,f.useCallback)(e=>{w(NP({handler:o,reactEvent:e}))},[w,o]),P=(0,f.useCallback)(e=>{w(NP({handler:s,reactEvent:e}))},[w,s]),ue=(0,f.useCallback)(e=>{w(NP({handler:c,reactEvent:e}))},[w,c]),de=(0,f.useCallback)(e=>{w(NP({handler:m,reactEvent:e}))},[w,m]),fe=(0,f.useCallback)(e=>{w(NP({handler:_,reactEvent:e}))},[w,_]),F=(0,f.useCallback)(e=>{S&&w(zP(e)),w(NP({handler:g,reactEvent:e}))},[w,S,g]),pe=(0,f.useCallback)(e=>{w(NP({handler:h,reactEvent:e}))},[w,h]),me=LF(b);return f.createElement(IT.Provider,{value:E},f.createElement(Me.Provider,{value:k},f.createElement(me,{width:N??v?.width,height:ee??v?.height,className:l(`recharts-wrapper`,r),style:bF({position:`relative`,cursor:`default`,width:N,height:ee},v),onClick:ne,onContextMenu:le,onDoubleClick:P,onFocus:oe,onBlur:se,onKeyDown:ce,onMouseDown:ue,onMouseEnter:re,onMouseLeave:ie,onMouseMove:ae,onMouseUp:de,onTouchEnd:pe,onTouchMove:F,onTouchStart:fe,ref:te},f.createElement(jF,null),n)))}),zF=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function BF(e,t){if(e==null)return{};var n,r,i=VF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=g(BF(e,zF));return c?f.createElement(f.Fragment,null,f.createElement(Tl,{width:n,height:r}),f.createElement(dF,{otherAttributes:d,title:l,desc:u},a)):f.createElement(RF,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},f.createElement(dF,{otherAttributes:d,title:l,desc:u,ref:t},f.createElement(AA,null,a)))});function UF(){return UF=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(XF,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:ZF,tooltipPayloadSearcher:HT,categoricalChartProps:e,ref:t})),$F=[`supply`,`bus`,`current`,`power`,`ledTemp`,`btTemp`];function eI(e){return typeof e==`number`&&Number.isFinite(e)}function tI(e){if(!eI(e.at))return null;let t={at:e.at};for(let n of $F){let r=e[n];eI(r)&&(t[n]=r)}return $F.some(e=>t[e]!==void 0)?t:null}function nI(e){let t=e.filter(eI).sort((e,t)=>e-t);if(!t.length)return;let n=Math.floor(t.length/2);return t.length%2==1?t[n]:(t[n-1]+t[n])/2}function rI(e){let t=new Map;for(let n of e){let e=tI(n);e&&t.set(e.at,e)}return[...t.values()].sort((e,t)=>e.at-t.at)}function iI(e){return e.map((t,n)=>{let r=e.slice(Math.max(0,n-1),Math.min(e.length,n+2)),i={...t};for(let e of $F){if(!eI(t[e]))continue;let n=nI(r.map(t=>t[e]).filter(eI));n!==void 0&&(i[e]=n)}return i})}function aI(e,t=.2,n=1){let r;return e.map(e=>{let i=e.current;if(!eI(i))return r=void 0,e;let a=r===void 0?i:r+t*(i-r),o=r!==void 0&&Math.abs(a-r)t.map(t=>e[t]).filter(eI))}function lI(e){let t=cI(e,[`supply`,`bus`]);if(!t.length)return[0,1];let n=Math.min(...t),r=Math.max(...t);return[Math.max(0,oI(n-Math.max(.8,r*.075),.25)),sI(r+Math.max(.2,r*.025),.25)]}function uI(e){let t=cI(e,[`ledTemp`,`btTemp`]);if(!t.length)return[20,55];let n=Math.min(...t),r=Math.max(...t);return[Math.max(0,Math.min(20,oI(n-8,1))),Math.max(55,sI(r+3,1))]}function dI(e){let t=cI(e,[`current`]);return t.length?[0,Math.max(100,sI(Math.max(0,...t)*1.2,50))]:[0,100]}var $=a(),fI={electrical:{en:`Electrical`,fa:`الکتریکی`},power:{en:`Power`,fa:`توان`},thermal:{en:`Thermal`,fa:`دما`}};function pI(e){return typeof e==`number`&&Number.isFinite(e)?e.toFixed(2):String(e??`—`)}var mI=ZO(`at`);function hI(e=!1){return{isAnimationActive:!e&&`auto`,animationBegin:0,animationDuration:250,animationEasing:`linear`,animationMatchBy:mI}}function gI({connected:e,locale:t,samples:n,reduceMotion:r=!1}){let a=hI(r),[s,c]=(0,f.useState)(`electrical`),[l,u]=(0,f.useState)(`60`),[d,p]=(0,f.useState)(`smoothed`),m=t===`fa`,h=(0,f.useMemo)(()=>rI(n),[n]),g=(0,f.useMemo)(()=>{let e=l===`all`?h.length:Number(l),t=new Intl.DateTimeFormat(m?`fa-IR`:`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),n=h.slice(-e);return(d===`smoothed`?aI(iI(n)):n).map(e=>({...e,timeLabel:t.format(e.at)}))},[h,m,d,l]),_=(0,f.useMemo)(()=>{let e=[];return h.some(e=>[e.supply,e.bus,e.current].some(e=>typeof e==`number`&&Number.isFinite(e)))&&e.push(`electrical`),h.some(e=>typeof e.power==`number`&&Number.isFinite(e.power))&&e.push(`power`),h.some(e=>[e.ledTemp,e.btTemp].some(e=>typeof e==`number`&&Number.isFinite(e)))&&e.push(`thermal`),e},[h]),v=_.includes(s)?s:_[0]??`electrical`,y=g.at(-1),b=(0,f.useMemo)(()=>lI(g),[g]),x=(0,f.useMemo)(()=>uI(g),[g]),S=(0,f.useMemo)(()=>dI(g),[g]),C=m?`نمودار ${fI[v].fa} با ${g.length} نمونه`:`${fI[v].en} chart with ${g.length} samples`;return g.length?(0,$.jsxs)(`div`,{className:`telemetry-chart`,children:[(0,$.jsxs)(`div`,{className:`telemetry-chart__toolbar`,children:[(0,$.jsx)(i,{value:v,label:m?`گروه نمودار`:`Chart group`,options:_.map(e=>({value:e,label:fI[e][m?`fa`:`en`]})),onChange:c}),(0,$.jsx)(i,{value:l,label:m?`بازه نمونه‌ها`:`Sample window`,options:[{value:`30`,label:m?`۳۰ نمونه`:`30 samples`},{value:`60`,label:m?`۶۰ نمونه`:`60 samples`},{value:`all`,label:m?`همه`:`All`}],onChange:u}),(0,$.jsx)(i,{value:d,label:m?`پردازش نمودار`:`Chart processing`,options:[{value:`smoothed`,label:m?`هموار`:`Smoothed`},{value:`raw`,label:m?`خام`:`Raw`}],onChange:p})]}),(0,$.jsx)(`div`,{className:`telemetry-chart__canvas`,role:`img`,"aria-label":C,children:(0,$.jsx)(ml,{width:`100%`,height:`100%`,children:(0,$.jsxs)(QF,{data:g,margin:{top:14,right:18,bottom:2,left:4},children:[(0,$.jsxs)(`defs`,{children:[(0,$.jsxs)(`linearGradient`,{id:`telemetry-accent-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,$.jsx)(`stop`,{offset:`0`,stopColor:`var(--accent)`,stopOpacity:.34}),(0,$.jsx)(`stop`,{offset:`1`,stopColor:`var(--accent)`,stopOpacity:.01})]}),(0,$.jsxs)(`linearGradient`,{id:`telemetry-amber-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,$.jsx)(`stop`,{offset:`0`,stopColor:`var(--amber)`,stopOpacity:.28}),(0,$.jsx)(`stop`,{offset:`1`,stopColor:`var(--amber)`,stopOpacity:.01})]})]}),(0,$.jsx)(KN,{dataKey:`timeLabel`,minTickGap:38,tick:{fill:`var(--text-muted)`,fontSize:9},axisLine:{stroke:`var(--line-strong)`},tickLine:!1}),(0,$.jsx)(sP,{yAxisId:`left`,width:44,tick:{fill:`var(--text-muted)`,fontSize:9},axisLine:!1,tickLine:!1,domain:v===`electrical`?b:v===`thermal`?x:[`auto`,`auto`]}),v===`electrical`&&(0,$.jsx)(sP,{yAxisId:`right`,orientation:`right`,width:46,tick:{fill:`var(--text-muted)`,fontSize:9},axisLine:!1,tickLine:!1,domain:S}),(0,$.jsx)(TE,{cursor:{stroke:`var(--line-strong)`,strokeWidth:1},contentStyle:{background:`var(--glass-strong)`,border:`1px solid var(--line-strong)`,borderRadius:12,boxShadow:`var(--shadow-tight)`,color:`var(--text)`},labelStyle:{color:`var(--text-muted)`,marginBottom:6},formatter:(e,t)=>[pI(e),String(t)]}),(0,$.jsx)(Du,{iconType:`plainline`,wrapperStyle:{color:`var(--text-soft)`,fontSize:10,paddingTop:7}}),v===`electrical`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(TN,{yAxisId:`left`,type:`linear`,dataKey:`supply`,name:m?`تغذیه V`:`Supply V`,stroke:`var(--accent)`,strokeWidth:2.2,fill:`url(#telemetry-accent-fill)`,...a}),(0,$.jsx)(MM,{yAxisId:`left`,type:`linear`,dataKey:`bus`,name:m?`باس V`:`Bus V`,stroke:`var(--violet)`,strokeWidth:1.8,dot:!1,...a}),(0,$.jsx)(MM,{yAxisId:`right`,type:`linear`,dataKey:`current`,name:m?`جریان mA`:`Current mA`,stroke:`var(--amber)`,strokeWidth:1.8,dot:!1,...a})]}),v===`power`&&(0,$.jsx)(TN,{yAxisId:`left`,type:`linear`,dataKey:`power`,name:m?`توان W`:`Power W`,stroke:`var(--amber)`,strokeWidth:2.2,fill:`url(#telemetry-amber-fill)`,...a}),v===`thermal`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(TN,{yAxisId:`left`,type:`linear`,dataKey:`ledTemp`,name:m?`دمای LED °C`:`LED °C`,stroke:`var(--red)`,strokeWidth:2.1,fill:`url(#telemetry-amber-fill)`,...a}),(0,$.jsx)(MM,{yAxisId:`left`,type:`linear`,dataKey:`btTemp`,name:m?`دمای صدا °C`:`Audio °C`,stroke:`var(--violet)`,strokeWidth:1.9,dot:!1,...a})]})]})})}),(0,$.jsxs)(`div`,{className:`telemetry-chart__summary`,"aria-live":`polite`,children:[(0,$.jsx)(o,{tone:e?`good`:`warn`,children:e?m?`زنده`:`Live`:m?`آخرین داده`:`Last known`}),(0,$.jsx)(`span`,{children:m?`${g.length} نمونه`:`${g.length} samples`}),y&&(0,$.jsx)(`span`,{dir:`ltr`,children:y.timeLabel})]}),(0,$.jsxs)(`table`,{className:`sr-only`,children:[(0,$.jsx)(`caption`,{children:C}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{children:[(0,$.jsx)(`th`,{children:m?`زمان`:`Time`}),(0,$.jsx)(`th`,{children:m?`تغذیه`:`Supply`}),(0,$.jsx)(`th`,{children:m?`جریان`:`Current`}),(0,$.jsx)(`th`,{children:m?`توان`:`Power`}),(0,$.jsx)(`th`,{children:m?`دما`:`Temperature`})]})}),(0,$.jsx)(`tbody`,{children:g.slice(-10).map(e=>(0,$.jsxs)(`tr`,{children:[(0,$.jsx)(`td`,{children:e.timeLabel}),(0,$.jsx)(`td`,{children:e.supply}),(0,$.jsx)(`td`,{children:e.current}),(0,$.jsx)(`td`,{children:e.power}),(0,$.jsx)(`td`,{children:e.ledTemp})]},e.at))})]})]}):(0,$.jsxs)(`div`,{className:`telemetry-chart__empty`,role:`status`,children:[(0,$.jsx)(`strong`,{children:m?`هنوز نمونه‌ای دریافت نشده است`:`No telemetry samples yet`}),(0,$.jsx)(`span`,{children:e?m?`در انتظار اولین وضعیت برد`:`Waiting for the first board status`:m?`برد آفلاین است`:`Board offline`})]})}export{gI as TelemetryChart}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-CTc1vKfa.js b/Tools/Controller/internal/webui/dist/assets/chunk-D02q3HLn.js similarity index 93% rename from Tools/Controller/internal/webui/dist/assets/chunk-CTc1vKfa.js rename to Tools/Controller/internal/webui/dist/assets/chunk-D02q3HLn.js index 384515df..1c9275f8 100644 --- a/Tools/Controller/internal/webui/dist/assets/chunk-CTc1vKfa.js +++ b/Tools/Controller/internal/webui/dist/assets/chunk-D02q3HLn.js @@ -1 +1 @@ -import{Dt as e}from"./app-BpGu_3eg.js";var t={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};t.node;var n=e(t),r={name:`package-search`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M20.27 18.27 22 20`,key:`er2am`}],[`path`,{d:`M21 10.498V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.98-.559`,key:`tok1h1`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}],[`circle`,{cx:`18.5`,cy:`16.5`,r:`2.5`,key:`ke13xx`}]]};r.node;var i=e(r),a={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};a.node;var o=e(a);export{i as n,n as r,o as t}; \ No newline at end of file +import{Pt as e}from"./app-BxYXetji.js";var t={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};t.node;var n=e(t),r={name:`package-search`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M20.27 18.27 22 20`,key:`er2am`}],[`path`,{d:`M21 10.498V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.98-.559`,key:`tok1h1`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}],[`circle`,{cx:`18.5`,cy:`16.5`,r:`2.5`,key:`ke13xx`}]]};r.node;var i=e(r),a={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};a.node;var o=e(a);export{i as n,n as r,o as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-D0cdfCGq.js b/Tools/Controller/internal/webui/dist/assets/chunk-D0cdfCGq.js deleted file mode 100644 index 95cb8264..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-D0cdfCGq.js +++ /dev/null @@ -1,57 +0,0 @@ -import{$ as e,At as t,Mt as n,Ot as r,Q as i,it as a,jt as o,kt as s}from"./app-BpGu_3eg.js";function c(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,u=e.desc,d=S(e,b),p=a||{width:r,height:i,x:0,y:0},m=l(`recharts-surface`,o);return f.createElement(`svg`,x({},v(d),{className:m,width:r,height:i,style:s,viewBox:`${p.x} ${p.y} ${p.width} ${p.height}`,ref:t}),f.createElement(`title`,null,c),f.createElement(`desc`,null,u),n)}),T=[`children`,`className`];function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=e.children,r=e.className,i=D(e,T),a=l(`recharts-layer`,r);return f.createElement(`g`,E({className:a},v(i),{ref:t}),n)});function A(e){return e===`__proto__`}var j=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function M(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:j.test(e);default:return!1}}function N(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function ee(e){return typeof e==`symbol`||e instanceof Symbol}function te(e){return e==null?``:ne(e)}function ne(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(ne).join(`,`);if(ee(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function re(e){if(Array.isArray(e))return e.map(N);if(typeof e==`symbol`)return[e];e=te(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r1&&arguments[1]!==void 0?arguments[1]:oe),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function P(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+se(i)+n},``)}var ce=e=>e===0?0:e>0?1:-1,le=e=>typeof e==`number`&&e!=+e,ue=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,F=e=>(typeof e==`number`||e instanceof Number)&&!le(e),de=e=>F(e)||typeof e==`string`,fe=0,pe=e=>{var t=++fe;return`${e||``}${t}`},me=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!F(e)&&typeof e!=`string`)return n;var i;if(ue(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return le(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},he=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;re&&(typeof t==`function`?t(e):ie(e,t))===n)}var I=e=>e==null,ve=e=>I(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function ye(e){return e!=null}function be(){}function xe(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=xe(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?Ce({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?Ce({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?Ce({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?Ce({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?Ce({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?Ce({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?Ce({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?Ce({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(F(n.x)||ue(n.x))&&(F(n.y)||ue(n.y))?Ce({x:c+me(n.x,g),y:l+me(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):Ce({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},Oe=[`top`,`left`,`right`,`bottom`];function ke(e){return e==null?!1:typeof e==`object`||Oe.includes(e)}var Ae=(0,f.createContext)(null),je=()=>(0,f.useContext)(Ae);function L(e){return function(){return e}}var Me=Math.cos,Ne=Math.sin,Pe=Math.sqrt,Fe=Math.PI;Fe/2;var Ie=2*Fe,Le=Math.PI,Re=2*Le,ze=1e-6,Be=Re-ze;function Ve(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ve;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tze){if(!(Math.abs(u*s-c*l)>ze)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Le-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>ze&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>ze||Math.abs(this._y1-l)>ze)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Re+Re),d>Be?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>ze&&this._append`A${n},${n},0,${+(d>=Le)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Ue.prototype;function We(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Ue(t)}Array.prototype.slice;function Ge(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ke(e){this._context=e}Ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function qe(e){return new Ke(e)}function Je(e){return e[0]}function Ye(e){return e[1]}function Xe(e,t){var n=L(!0),r=null,i=qe,a=null,o=We(s);e=typeof e==`function`?e:e===void 0?Je:L(e),t=typeof t==`function`?t:t===void 0?Ye:L(t);function s(s){var c,l=(s=Ge(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Xe().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:L(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:L(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:L(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:L(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:L(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:L(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:L(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Qe=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function $e(e){return new Qe(e,!0)}function et(e){return new Qe(e,!1)}var tt={draw(e,t){let n=Pe(t/Fe);e.moveTo(n,0),e.arc(0,0,n,0,Ie)}},nt={draw(e,t){let n=Pe(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},rt=Pe(1/3),it=rt*2,at={draw(e,t){let n=Pe(t/it),r=n*rt;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ot={draw(e,t){let n=Pe(t),r=-n/2;e.rect(r,r,n,n)}},st=.8908130915292852,ct=Ne(Fe/10)/Ne(7*Fe/10),lt=Ne(Ie/10)*ct,ut=-Me(Ie/10)*ct,dt={draw(e,t){let n=Pe(t*st),r=lt*n,i=ut*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Ie*t/5,o=Me(a),s=Ne(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},ft=Pe(3),pt={draw(e,t){let n=-Pe(t/(ft*3));e.moveTo(0,n*2),e.lineTo(-ft*n,-n),e.lineTo(ft*n,-n),e.closePath()}},mt=-.5,ht=Pe(3)/2,gt=1/Pe(12),_t=(gt/2+1)*3,vt={draw(e,t){let n=Pe(t/_t),r=n/2,i=n*gt,a=r,o=n*gt+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(mt*r-ht*i,ht*r+mt*i),e.lineTo(mt*a-ht*o,ht*a+mt*o),e.lineTo(mt*s-ht*c,ht*s+mt*c),e.lineTo(mt*r+ht*i,mt*i-ht*r),e.lineTo(mt*a+ht*o,mt*o-ht*a),e.lineTo(mt*s+ht*c,mt*c-ht*s),e.closePath()}};function yt(e,t){let n=null,r=We(i);e=typeof e==`function`?e:L(e||tt),t=typeof t==`function`?t:L(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:L(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:L(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function bt(){}function xt(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function St(e){this._context=e}St.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xt(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ct(e){return new St(e)}function wt(e){this._context=e}wt.prototype={areaStart:bt,areaEnd:bt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:xt(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tt(e){return new wt(e)}function Et(e){this._context=e}Et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:xt(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Dt(e){return new Et(e)}function Ot(e){this._context=e}Ot.prototype={areaStart:bt,areaEnd:bt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function kt(e){return new Ot(e)}function At(e){return e<0?-1:1}function jt(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(At(a)+At(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Mt(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Nt(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Pt(e){this._context=e}Pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Nt(this,this._t0,Mt(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Nt(this,Mt(this,n=jt(this,e,t)),n);break;default:Nt(this,this._t0,n=jt(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ft(e){this._context=new It(e)}(Ft.prototype=Object.create(Pt.prototype)).point=function(e,t){Pt.prototype.point.call(this,t,e)};function It(e){this._context=e}It.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Lt(e){return new Pt(e)}function Rt(e){return new Ft(e)}function zt(e){this._context=e}zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Bt(e),i=Bt(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function Ut(e){return new Ht(e,.5)}function Wt(e){return new Ht(e,0)}function Gt(e){return new Ht(e,1)}function Kt(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n=0;)n[t]=t;return n}function Jt(e,t){return e[t]}function Yt(e){let t=[];return t.key=e,t}function Xt(){var e=L([]),t=qt,n=Kt,r=Jt;function i(i){var a=Array.from(e.apply(this,arguments),Yt),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;run[`symbol${ve(e)}`]||tt,pn=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*dn;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},mn=(e,t)=>{un[`symbol${ve(e)}`]=t},hn=e=>{var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=rn(rn({},cn(e,en)),{},{type:n,size:i,sizeType:o}),c=`circle`;typeof n==`string`&&(c=n);var u=()=>{var e=fn(c),t=yt().type(e).size(pn(i,o,c))();if(t!==null)return t},d=s.className,p=s.cx,m=s.cy,h=v(s);return F(p)&&F(m)&&F(i)?f.createElement(`path`,tn({},h,{className:l(`recharts-symbols`,d),transform:`translate(${p}, ${m})`,d:u()})):null};hn.registerSymbol=mn;var gn=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,_n=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,f.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{d(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},vn=(e,t,n)=>r=>(e(t,n,r),null),yn=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];d(i)&&typeof a==`function`&&(r||={},r[i]=vn(a,t,n))}),r};function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var p=t.formatter||i,m=l({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var h=typeof s==`object`?On({},s):{};h.color=t.inactive?a:h.color||t.color,h.whiteSpace??=`normal`,h.overflowWrap??=`break-word`;var g=p?p(t.value,t,r):t.value;return f.createElement(`li`,En({className:m,style:u,key:`legend-item-${r}`},yn(e,t,r)),f.createElement(w,{width:n,height:n,viewBox:c,style:d,"aria-label":t.value==null?`legend icon`:`${t.value} legend icon`},f.createElement(Fn,{data:t,iconType:o,inactiveColor:a})),f.createElement(`span`,{className:`recharts-legend-item-text`,style:h},g))})}var Ln=e=>{var t=Tn(e,Nn),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return f.createElement(`ul`,{className:`recharts-default-legend`,style:a},f.createElement(In,En({},t,{payload:n})))};function Rn(e,t){let n=new Map;for(let r=0;r=0}function Hn(e){return e!=null&&typeof e!=`function`&&Vn(e.length)}function Un(e){return function(t){return ie(t,e)}}function Wn(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Gn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kn(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function qn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Jn=`[object RegExp]`,Yn=`[object String]`,Xn=`[object Number]`,Zn=`[object Boolean]`,Qn=`[object Arguments]`,$n=`[object Symbol]`,er=`[object Date]`,tr=`[object Map]`,nr=`[object Set]`,rr=`[object Array]`,ir=`[object Function]`,ar=`[object ArrayBuffer]`,or=`[object Object]`,sr=`[object Error]`,cr=`[object DataView]`,lr=`[object Uint8Array]`,ur=`[object Uint8ClampedArray]`,dr=`[object Uint16Array]`,fr=`[object Uint32Array]`,pr=`[object BigUint64Array]`,mr=`[object Int8Array]`,hr=`[object Int16Array]`,gr=`[object Int32Array]`,_r=`[object BigInt64Array]`,vr=`[object Float32Array]`,yr=`[object Float64Array]`,br=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function xr(e){return br.Buffer!==void 0&&br.Buffer.isBuffer(e)}function Sr(e,t){return Cr(e,void 0,e,new Map,t)}function Cr(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Wn(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;avoid 0)}function Ar(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return jr(e,t,n,r,i);case`function`:return Object.keys(t).length>0?Ar(e,{...t},n,r,i):Dr(e,t);default:return Or(e)&&i?typeof t!=`string`||t===``:Dr(e,t)}}function jr(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return Nr(e,t,n,r);if(t instanceof Map)return Mr(e,t,n,r);if(t instanceof Set)return Pr(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Wn(e)&&(e=Object(e));else{let t=qn(e);if(t!==`[object Object]`&&t!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;ivoid 0)}function Ir(e){return e=Er(e),t=>Fr(t,e)}function Lr(e,t){return Sr(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(qn(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),wr(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Xn:case Yn:case Zn:{let t=new e.constructor(e?.valueOf());return wr(t,e),t}case Qn:{let t={};return wr(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Rr(e){return Lr(e)}var zr=/^(?:0|[1-9]\d*)$/;function Br(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{var t=s();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),s=r[0].inst,l=r[1];return o(function(){s.value=n,s.getSnapshot=t,u(s)&&l({inst:s})},[e,n,t]),a(function(){return u(s)&&l({inst:s}),e(function(){u(s)&&l({inst:s})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Yr=t(((e,t)=>{t.exports=Jr()})),Xr=t((e=>{var t=s(),n=Yr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),s!==void 0&&f.hasValue){var t=f.value;if(s(t,e))return c=t}return c=e}if(t=c,i(o,e))return t;var n=r(e);return s!==void 0&&s(t,n)?(o=e,t):(o=e,c=n)}var a=!1,o,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,s]);var p=a(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Zr=t(((e,t)=>{t.exports=Xr()})),Qr=(0,f.createContext)(null),$r=Zr(),ei=e=>e,R=()=>{var e=(0,f.useContext)(Qr);return e?e.store.dispatch:ei},ti=()=>{},ni=()=>ti,ri=(e,t)=>e===t;function z(e){var t=(0,f.useContext)(Qr),n=(0,f.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:ti,[t,e]);return(0,$r.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:ni,t?t.store.getState:ti,t?t.store.getState:ti,n,ri)}function ii(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function ai(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var oi=e=>Array.isArray(e)?e:[e];function si(e){let t=Array.isArray(e[0])?e[0]:e;return ai(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function ci(e,t){let n=[],{length:r}=e;for(let i=0;i`u`?li:WeakRef,di=0,fi=1;function pi(){return{s:di,v:void 0,o:null,p:null}}function mi(e){return e instanceof ui?e.deref():e}function hi(e,t={}){let n=pi(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e{n=pi(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function gi(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),ii(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=hi,argsMemoizeOptions:u=[]}={...n,...a},d=oi(c),f=oi(u),p=si(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=ci(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var B=gi(hi);function _i(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a{if(e!==t){let r=yi(e),i=yi(t);if(r===i&&r===0){if(et)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},xi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Si=/^\w*$/;function Ci(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||ee(e)?!0:typeof e==`string`&&(Si.test(e)||!xi.test(e))||t!=null&&Object.hasOwn(t,e)}function wi(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Hn(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||Ci(e)?e:{key:e,path:re(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;re.original)}function Ti(e,...t){let n=t.length;return n>1&&vi(e,t[0],t[1])?t=[]:n>2&&vi(t[0],t[1],t[2])&&(t=[t[0]]),wi(e,_i(t),[`asc`])}var Ei=e=>e.legend.settings,Di=e=>e.legend.size,Oi=B([e=>e.legend.payload,Ei],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Ti(r,n):r});function ki(){return z(Oi)}function Ai(e,t){return Fi(e)||Pi(e,t)||Mi(e,t)||ji()}function ji(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mi(e,t){if(e){if(typeof e==`string`)return Ni(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ni(e,t):void 0}}function Ni(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nIi||Math.abs(e.left-t.left)>Ii||Math.abs(e.top-t.top)>Ii||Math.abs(e.width-t.width)>Ii}function Ri(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function zi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=Ai((0,f.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,f.useRef)(null),a=(0,f.useRef)(n);a.current=n;var o=(0,f.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=Ri(e);if(Li(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=Ri(e);Li(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,f.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function Bi(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Vi=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Hi=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Ui={INIT:`@@redux/INIT${Hi()}`,REPLACE:`@@redux/REPLACE${Hi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Hi()}`};function Wi(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Gi(e,t,n){if(typeof e!=`function`)throw Error(Bi(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(Bi(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(Bi(1));return n(Gi)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(Bi(3));return i}function d(e){if(typeof e!=`function`)throw Error(Bi(4));if(c)throw Error(Bi(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(Bi(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!Wi(e))throw Error(Bi(7));if(e.type===void 0)throw Error(Bi(8));if(typeof e.type!=`string`)throw Error(Bi(17));if(c)throw Error(Bi(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(Bi(10));r=e,f({type:Ui.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(Bi(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Vi](){return this}}}return f({type:Ui.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[Vi]:m}}function Ki(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Ui.INIT})===void 0)throw Error(Bi(12));if(n(void 0,{type:Ui.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(Bi(13))})}function qi(e){let t=Object.keys(e),n={};for(let r=0;re:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Yi(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(Bi(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=Ji(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function Xi(e){return Wi(e)&&`type`in e&&typeof e.type==`string`}var Zi=Symbol.for(`immer-nothing`),Qi=Symbol.for(`immer-draftable`),$i=Symbol.for(`immer-state`);function ea(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ta=Object,na=ta.getPrototypeOf,ra=`constructor`,ia=`prototype`,aa=`configurable`,oa=`enumerable`,sa=`writable`,ca=`value`,la=e=>!!e&&!!e[$i];function ua(e){return e?pa(e)||ba(e)||!!e[Qi]||!!e[ra]?.[Qi]||xa(e)||Sa(e):!1}var da=ta[ia][ra].toString(),fa=new WeakMap;function pa(e){if(!e||!Ca(e))return!1;let t=na(e);if(t===null||t===ta[ia])return!0;let n=ta.hasOwnProperty.call(t,ra)&&t[ra];if(n===Object)return!0;if(!wa(n))return!1;let r=fa.get(n);return r===void 0&&(r=Function.toString.call(n),fa.set(n,r)),r===da}function ma(e,t,n=!0){ha(e)===0?(n?Reflect.ownKeys(e):ta.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ha(e){let t=e[$i];return t?t.type_:ba(e)?1:xa(e)?2:Sa(e)?3:0}var ga=(e,t,n=ha(e))=>n===2?e.has(t):ta[ia].hasOwnProperty.call(e,t),_a=(e,t,n=ha(e))=>n===2?e.get(t):e[t],va=(e,t,n,r=ha(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ya(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var ba=Array.isArray,xa=e=>e instanceof Map,Sa=e=>e instanceof Set,Ca=e=>typeof e==`object`,wa=e=>typeof e==`function`,Ta=e=>typeof e==`boolean`;function Ea(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Da=e=>e.copy_||e.base_,Oa=e=>e.modified_?e.copy_:e.base_;function ka(e,t){if(xa(e))return new Map(e);if(Sa(e))return new Set(e);if(ba(e))return Array[ia].slice.call(e);let n=pa(e);if(t===!0||t===`class_only`&&!n){let t=ta.getOwnPropertyDescriptors(e);delete t[$i];let n=Reflect.ownKeys(t);for(let r=0;r1&&ta.defineProperties(e,{set:Ma,add:Ma,clear:Ma,delete:Ma}),ta.freeze(e),t&&ma(e,(e,t)=>{Aa(t,!0)},!1)),e}function ja(){ea(2)}var Ma={[ca]:ja};function Na(e){return e===null||!Ca(e)||ta.isFrozen(e)}var Pa=`MapSet`,Fa=`Patches`,Ia=`ArrayMethods`,La={};function Ra(e){let t=La[e];return t||ea(0,e),t}var za=e=>!!La[e],Ba,Va=()=>Ba,Ha=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:za(Pa)?Ra(Pa):void 0,arrayMethodsPlugin_:za(Ia)?Ra(Ia):void 0});function Ua(e,t){t&&(e.patchPlugin_=Ra(Fa),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wa(e){Ga(e),e.drafts_.forEach(qa),e.drafts_=null}function Ga(e){e===Ba&&(Ba=e.parent_)}var Ka=e=>Ba=Ha(Ba,e);function qa(e){let t=e[$i];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ja(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[$i].modified_&&(Wa(t),ea(4)),ua(e)&&(e=Ya(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[$i].base_,e,t)}else e=Ya(t,n);return Xa(t,e,!0),Wa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Zi?void 0:e}function Ya(e,t){if(Na(t))return t;let n=t[$i];if(!n)return io(t,e.handledSet_,e);if(!Qa(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);no(n,e)}return n.copy_}function Xa(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Aa(t,n)}function Za(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Qa=(e,t)=>e.scope_===t,$a=[];function eo(e,t,n,r){let i=Da(e),a=e.type_;if(r!==void 0&&_a(i,r,a)===t){va(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;ma(i,(e,n)=>{if(la(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??$a;for(let e of o)va(i,e,n,a)}function to(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Qa(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Oa(i);eo(e,i.draft_??i,a,n),no(i,r)})}function no(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Za(e)}}function ro(e,t,n){let{scope_:r}=e;if(la(n)){let i=n[$i];Qa(i,r)&&i.callbacks_.push(function(){mo(e),eo(e,n,Oa(i),t)})}else ua(n)&&e.callbacks_.push(function(){let i=Da(e);e.type_===3?i.has(n)&&io(n,r.handledSet_,r):_a(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&io(_a(e.copy_,t,e.type_),r.handledSet_,r)})}function io(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||la(e)||t.has(e)||!ua(e)||Na(e)||(t.add(e),ma(e,(r,i)=>{if(la(i)){let t=i[$i];Qa(t,n)&&(va(e,r,Oa(t),e.type_),Za(t))}else ua(i)&&io(i,t,n)})),e}function ao(e,t){let n=ba(e),r={type_:+!!n,scope_:t?t.scope_:Va(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=oo;n&&(i=[r],a=so);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var oo={get(e,t){if(t===$i)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Da(e);if(!ga(i,t,e.type_))return uo(e,i,t);let a=i[t];if(e.finalized_||!ua(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Ea(t))return a;if(a===co(e.base_,t)||lo(e,t,a)){mo(e);let n=e.type_===1?+t:t,r=go(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Da(e)},ownKeys(e){return Reflect.ownKeys(Da(e))},set(e,t,n){let r=fo(Da(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=co(Da(e),t),i=r?.[$i];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(ya(n,r)&&(n!==void 0||ga(e.base_,t,e.type_)))return!0;mo(e),po(e)}return e.copy_[t]===n&&(n!==void 0||ga(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),ro(e,t,n)),!0},deleteProperty(e,t){return mo(e),co(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),po(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Da(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[sa]:!0,[aa]:e.type_!==1||t!==`length`,[oa]:r[oa],[ca]:n[t]}},defineProperty(){ea(11)},getPrototypeOf(e){return na(e.base_)},setPrototypeOf(){ea(12)}},so={};for(let e in oo){let t=oo[e];so[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}so.deleteProperty=function(e,t){return so.set.call(this,e,t,void 0)},so.set=function(e,t,n){return oo.set.call(this,e[0],t,n,e[0])};function co(e,t){let n=e[$i];return(n?Da(n):e)[t]}function lo(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!ua(n)||n[$i]?!1:e.baseRefs_.has(n)}function uo(e,t,n){let r=fo(t,n);return r?ca in r?r[ca]:r.get?.call(e.draft_):void 0}function fo(e,t){if(!(t in e))return;let n=na(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=na(n)}}function po(e){e.modified_||(e.modified_=!0,e.parent_&&po(e.parent_))}function mo(e){e.copy_||=(e.assigned_=new Map,ka(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ho=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(wa(e)&&!wa(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}wa(t)||ea(6),n!==void 0&&!wa(n)&&ea(7);let r;if(ua(e)){let i=Ka(this),a=go(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Wa(i):Ga(i)}return Ua(i,n),Ja(r,i)}if(!e||!Ca(e)){if(r=t(e),r===void 0&&(r=e),r===Zi&&(r=void 0),this.autoFreeze_&&Aa(r,!0),n){let t=[],i=[];Ra(Fa).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}ea(1,e)},this.produceWithPatches=(e,t)=>{if(wa(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Ta(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ta(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ta(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ua(e)||ea(8),la(e)&&(e=_o(e));let t=Ka(this),n=go(t,e,void 0);return n[$i].isManual_=!0,Ga(t),n}finishDraft(e,t){let n=e&&e[$i];(!n||!n.isManual_)&&ea(9);let{scope_:r}=n;return Ua(r,t),Ja(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Ra(Fa).applyPatches_;return la(e)?r(e,t):this.produce(e,e=>r(e,t))}};function go(e,t,n,r){let[i,a]=xa(t)?Ra(Pa).proxyMap_(t,n):Sa(t)?Ra(Pa).proxySet_(t,n):ao(t,n);return(n?.scope_??Va()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?to(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function _o(e){return la(e)||ea(10,e),vo(e)}function vo(e){if(!ua(e)||Na(e))return e;let t=e[$i],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ka(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ka(e,!0);return ma(n,(e,t)=>{va(n,e,vo(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var yo=new ho().produce,V=e=>e;function bo(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var xo=bo(),So=bo,Co=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?Ji:Ji.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function wo(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Ms(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Xi(t)&&t.type===e,n}var To=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Eo(e){return ua(e)?yo(e,()=>{}):e}function Do(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Oo(e){return typeof e==`boolean`}var ko=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new To;return t&&(Oo(t)?a.push(xo):a.push(So(t.extraArgument))),a},Ao=`RTK_autoBatch`,H=()=>e=>({payload:e,meta:{[Ao]:!0}}),jo=e=>t=>{setTimeout(t,e)},Mo=(e,t)=>n=>{let r=!1,i,a,o=()=>{r||(r=!0,cancelAnimationFrame(i),clearTimeout(a),n())};i=e(o),a=setTimeout(o,t)},No=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Mo(window.requestAnimationFrame,100):jo(10):e.type===`callback`?e.queueNotification:jo(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Ao],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Po=e=>function(t){let{autoBatch:n=!0}=t??{},r=new To(e);return n&&r.push(No(typeof n==`object`?n:void 0)),r};function Fo(e){let t=ko(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(Wi(n))c=qi(n);else throw Error(Ms(1));let l;l=typeof r==`function`?r(t):t();let u=Ji;i&&(u=Co({trace:!1,...typeof i==`object`&&i}));let d=Po(Yi(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Gi(c,o,p)}function Io(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Ms(28));if(r in t)throw Error(Ms(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Lo(e){return typeof e==`function`}function Ro(e,t){let[n,r,i]=Io(t),a;if(Lo(e))a=()=>Eo(e());else{let t=Eo(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(la(e)){let r=n(e,t);return r===void 0?e:r}if(ua(e))return yo(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(Ms(9))}return r}}return e},e)}return o.getInitialState=a,o}var zo=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Bo=(e=21)=>{let t=``,n=e;for(;n--;)t+=zo[Math.random()*64|0];return t},Vo=Symbol.for(`rtk-slice-createasyncthunk`);function Ho(e,t){return`${e}/${t}`}function Uo({creators:e}={}){let t=e?.asyncThunk?.[Vo];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Ms(11));let i=(typeof e.reducers==`function`?e.reducers(Ko()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Ms(12));if(n in o.sliceCaseReducersByType)throw Error(Ms(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Ho(n,r),createNotation:typeof e.reducers==`function`};Jo(a)?Xo(o,a,s,t):qo(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?Io(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Ro(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Do(d,r,m)),i}function i(t=l){return Do(Do(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Wo(a,t,()=>Do(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Wo(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var Go=Uo();function Ko(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function qo({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Yo(r))throw Error(Ms(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?wo(e,o):wo(e))}function Jo(e){return e._reducerDefinitionType===`asyncThunk`}function Yo(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Xo({type:e,reducerName:t},n,r,i){if(!i)throw Error(Ms(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Zo,pending:s||Zo,rejected:c||Zo,settled:l||Zo})}function Zo(){}var Qo=`task`,$o=`listener`,es=`completed`,ts=`cancelled`,ns=`task-${ts}`,rs=`task-${es}`,is=`${$o}-${ts}`,as=`${$o}-${es}`,os=class{code;name=`TaskAbortError`;message;constructor(e){this.code=e,this.message=`${Qo} ${ts} (reason: ${e})`}},ss=(e,t)=>{if(typeof e!=`function`)throw TypeError(Ms(32))},cs=()=>{},ls=(e,t=cs)=>(e.catch(t),e),us=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),ds=e=>{if(e.aborted)throw new os(e.reason)};function fs(e,t){let n=cs;return new Promise((r,i)=>{let a=()=>i(new os(e.reason));e.aborted?a():(n=us(e,a),t.finally(()=>n()).then(r,i))}).finally(()=>{n=cs})}var ps=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof os?`cancelled`:`rejected`,error:e}}finally{t?.()}},ms=e=>t=>ls(fs(e,t).then(t=>(ds(e),t))),hs=e=>{let t=ms(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:gs}=Object,_s={},vs=`listenerMiddleware`,ys=(e,t)=>{let n=t=>us(e,()=>t.abort(e.reason));return(r,i)=>{ss(r,`taskExecutor`);let a=new AbortController;n(a);let o=ps(async()=>{ds(e),ds(a.signal);let t=await r({pause:ms(a.signal),delay:hs(a.signal),signal:a.signal});return ds(a.signal),t},()=>a.abort(rs));return i?.autoJoin&&t.push(o.catch(cs)),{result:ms(e)(o),cancel(){a.abort(ns)}}}},bs=(e,t)=>{let n=async(n,r)=>{ds(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await fs(t,Promise.race(a));return ds(t),e}finally{i()}};return((e,t)=>ls(n(e,t)))},xs=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=wo(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Ms(21));return ss(a,`options.listener`),{predicate:i,type:t,effect:a}},Ss=gs(e=>{let{type:t,predicate:n,effect:r}=xs(e);return{id:Bo(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Ms(22))}}},{withTypes:()=>Ss}),Cs=(e,t)=>{let{type:n,effect:r,predicate:i}=xs(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},ws=e=>{e.pending.forEach(e=>{e.abort(is)})},Ts=(e,t)=>()=>{for(let e of t.keys())ws(e);e.clear()},Es=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},Ds=gs(wo(`${vs}/add`),{withTypes:()=>Ds}),Os=wo(`${vs}/removeAll`),ks=gs(wo(`${vs}/remove`),{withTypes:()=>ks}),As=(...e)=>{console.error(`${vs}/error`,...e)},js=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=As}=e;ss(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&ws(e)}),c=(e=>{let n=Cs(t,e)??Ss(e);return s(n)});gs(c,{withTypes:()=>c});let l=e=>{let n=Cs(t,e);return n&&(n.unsubscribe(),e.cancelActive&&ws(n)),!!n};gs(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=bs(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,gs({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:hs(u.signal),pause:ms(u.signal),extra:a,signal:u.signal,fork:ys(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(is),n.delete(e))})},cancel:()=>{u.abort(is),e.pending.delete(u)},throwIfCancelled:()=>{ds(u.signal)}})))}catch(e){e instanceof os||Es(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(as),i(e),e.pending.delete(u)}},d=Ts(t,n);return{middleware:e=>n=>r=>{if(!Xi(r))return n(r);if(Ds.match(r))return c(r.payload);if(Os.match(r)){d();return}if(ks.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===_s)throw Error(Ms(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,Es(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=_s}return s},startListening:c,stopListening:l,clearListeners:d}};function Ms(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ns=Go({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),Ps=Ns.actions,Fs=Ps.setMargin,Is=Ps.setLayout,Ls=Ps.setChartSize,Rs=Ps.setScale,zs=Ns.reducer;function Bs(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function U(e){return Number.isFinite(e)}function Vs(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Hs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Us(e){for(var t=1;t{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(ke(c)){if(c===`top`&&F(e.top))return Us(Us({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&F(e.bottom))return Us(Us({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&F(e.left))return Us(Us({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&F(e.right))return Us(Us({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&F(e[a]))return Us(Us({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&F(e[o]))return Us(Us({},e),{},{[o]:e[o]+(i||0)})}return e},Js=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Ys={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Zt,none:Kt,silhouette:Qt,wiggle:$t,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},Xs=(e,t,n)=>{var r=Ys[n]??Kt,i=Xt().keys(t).value((e,t)=>Number(W(e,t,0))).order(qt).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=W(e[i],t[r],0);Array.isArray(a)&&a.length===2&&F(a[0])&&F(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function Zs(e){return e==null?void 0:String(e)}function Qs(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!I(i[t.dataKey])){var s=_e(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=W(i,I(o)?t.dataKey:o),l=t.scale.map(c);return F(l)?l:null}var $s=e=>{var t=e.flat(2).filter(F);return[Math.min(...t),Math.max(...t)]},ec=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],tc=(e,t,n)=>{if(e!=null&&Object.keys(e).length!==0)return ec(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=$s(Bs(r,t,n));return!U(i[0])||!U(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},nc=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,rc=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ic=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Ti(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;su&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function ac(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Us(Us({},t),{},{dataKey:n,payload:r,value:i,name:a})}function oc(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var sc=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},cc=(e,t)=>t===`centric`?e.angle:e.radius,lc=e=>e.layout.width,uc=e=>e.layout.height,dc=e=>e.layout.scale,fc=e=>e.layout.margin,pc=B(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),mc=B(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),hc=`data-recharts-item-index`;function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _c(e){for(var t=1;te.brush.height;function Sc(e){return mc(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Cc(e){return mc(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function wc(e){return pc(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function Tc(e){return pc(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var Ec=B([lc,uc,fc,xc,Sc,Cc,wc,Tc,Ei,Di],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=_c(_c({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=qs(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return _c(_c({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Dc=B(Ec,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Oc=B(lc,uc,(e,t)=>({x:0,y:0,width:e,height:t})),kc=(0,f.createContext)(null),Ac=()=>(0,f.useContext)(kc)!=null,jc=e=>e.brush,Mc=B([jc,Ec,fc],(e,t,n)=>({height:e.height,x:F(e.x)?e.x:t.left,y:F(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:F(e.width)?e.width:t.width}));function Nc(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Pc(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=Nc(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Fc(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Pc(e,t,{leading:r,maxWait:t,trailing:i})}var Ic=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},Lc={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Rc=(e,t,n)=>{var r=n.width,i=r===void 0?Lc.width:r,a=n.height,o=a===void 0?Lc.height:a,s=n.aspect,c=n.maxHeight,l=ue(i)?e:Number(i),u=ue(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},zc={width:0,height:0,overflow:`visible`},Bc={width:0,overflowX:`visible`},Vc={height:0,overflowY:`visible`},Hc={},Uc=e=>{var t=e.width,n=e.height,r=ue(t),i=ue(n);return r&&i?zc:r?Bc:i?Vc:Hc};function Wc(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Lc.width,a=Lc.height):i===void 0?i=r&&r>0?void 0:Lc.width:a===void 0&&(a=r&&r>0?void 0:Lc.height),{width:i,height:a}}var Gc=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function Kc(){return Kc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n({width:n,height:r}),[n,r]);return sl(i)?f.createElement(ol.Provider,{value:i},t):null}var ll=()=>(0,f.useContext)(ol),ul=(0,f.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Lc.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?Lc.minWidth:s,u=e.minHeight,d=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?Lc.debounce:m,g=e.id,_=e.className,v=e.onResize,y=e.style,b=y===void 0?{}:y,x=il(e,Gc),S=(0,f.useRef)(null),C=(0,f.useRef)();C.current=v,(0,f.useImperativeHandle)(t,()=>S.current);var w=Qc((0,f.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,f.useCallback)((e,t)=>{E(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,f.useEffect)(()=>{if(S.current==null||typeof ResizeObserver>`u`)return be;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;D(i,a),(t=C.current)==null||t.call(C,i,a)}};h>0&&(e=Fc(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),()=>{t.disconnect()}},[D,h]);var O=T.containerWidth,k=T.containerHeight;Ic(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var A=Rc(O,k,{width:a,height:o,aspect:n,maxHeight:d}),j=A.calculatedWidth,M=A.calculatedHeight;return Ic(O<0||k<0||j!=null&&j>0||M!=null&&M>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,j,M,a,o,c,u,n),f.createElement(`div`,Kc({id:g?`${g}`:void 0,className:l(`recharts-responsive-container`,_),style:Jc(Jc({},b),{},{width:a,height:o,minWidth:c,minHeight:u,maxHeight:d}),ref:S},x),f.createElement(`div`,{style:Uc({width:a,height:o})},f.createElement(cl,{width:j,height:M},p)))}),dl=(0,f.forwardRef)((e,t)=>{var n=ll();if(Vs(n.width)&&Vs(n.height))return e.children;var r=Wc({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=Rc(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return F(s)&&F(c)?f.createElement(cl,{width:s,height:c},e.children):f.createElement(ul,Kc({},e,{width:i,height:a,ref:t}))}),fl=()=>{var e=Ac(),t=z(Dc),n=z(Mc),r=z(jc)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},pl={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},ml=()=>z(Ec)??pl,hl=()=>z(lc),gl=()=>z(uc),_l=()=>z(e=>e.layout.margin),G=e=>e.layout.layoutType,vl=()=>z(G),yl=()=>{var e=vl();if(e===`horizontal`||e===`vertical`)return e},bl=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},xl=()=>vl()!==void 0,Sl=e=>{var t=R(),n=Ac(),r=e.width,i=e.height,a=ll(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,f.useEffect)(()=>{!n&&Vs(o)&&Vs(s)&&t(Ls({width:o,height:s}))},[t,n,o,s]),null},Cl=Go({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`,position:void 0,offset:0},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter,e.settings.position=t.payload.position,e.settings.offset=t.payload.offset},addLegendPayload:{reducer(e,t){e.payload.push(V(t.payload))},prepare:H()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=_o(e).payload.indexOf(V(r));a>-1&&(e.payload[a]=V(i))},prepare:H()},removeLegendPayload:{reducer(e,t){var n=_o(e).payload.indexOf(V(t.payload));n>-1&&e.payload.splice(n,1)},prepare:H()}}}),wl=Cl.actions,Tl=wl.setLegendSize,El=wl.setLegendSettings,Dl=wl.addLegendPayload,Ol=wl.replaceLegendPayload,kl=wl.removeLegendPayload,Al=Cl.reducer,jl=t((e=>{var t=s();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));t(((e,t)=>{t.exports=jl()}))();function Ml(e){e()}function Nl(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Ml(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){r&&e!==null&&(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Pl={notify(){},get:()=>[]};function Fl(e,t){let n,r=Pl,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Nl())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Pl)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var Il=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ll=typeof navigator<`u`&&navigator.product===`ReactNative`,Rl=Il||Ll?f.useLayoutEffect:f.useEffect;function zl(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function Bl(e,t){if(zl(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r{let e=Fl(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=f.useMemo(()=>i.getState(),[i]);Rl(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||Wl;return f.createElement(s.Provider,{value:a},t)}var Kl=Gl,ql=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function Jl(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function Yl(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(ql.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Bl(e[n],t[n]))return!1}else if(!Jl(e[n],t[n]))return!1;return!0}var Xl=B([lc,uc,fc],(e,t,n)=>({x:n.left||0,y:n.top||0,width:Math.max(e-(n.left||0)-(n.right||0),0),height:Math.max(t-(n.top||0)-(n.bottom||0),0)}));function Zl(e,t){return e===`start`&&t===`start`?``:`translate(${e===`inherit`?`0`:{start:`0`,middle:`-50%`,end:`-100%`}[e]}, ${{start:`0`,middle:`-50%`,end:`-100%`}[t]??`0`})`}var Ql=r(),$l=[`contextPayload`];function eu(){return eu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{s(El({align:t,layout:n,verticalAlign:r,itemSorter:i,position:a,offset:o}))},[s,t,n,r,i,a,o]),null}function xu(e){var t=e.width,n=e.height,r=R();return(0,f.useLayoutEffect)(()=>{r(Tl({width:t,height:n}))},[r,t,n]),(0,f.useLayoutEffect)(()=>()=>{r(Tl({width:0,height:0}))},[r]),null}function Su(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var Cu={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,labelStyle:{},layout:`auto`,verticalAlign:`bottom`,offset:0};function wu(e){var t=Tn(e,Cu),n=e.layout&&e.layout!==`auto`?e.layout:gu(t.position),r=ki(),i=je(),a=_l(),o=z(e=>_u(e,t.position)),s=t.width,c=t.height,l=t.wrapperStyle,u=t.portal,d=u==null&&(t.position==null||ke(t.position)),p=tu(zi([r]),2),m=p[0],h=p[1],g=hl(),_=gl();if(g==null||_==null||t.position!=null&&o==null)return null;var v=Su(n,c,s,g-(a?.left||0)-(a?.right||0)),y=t.position==null?null:De({viewBox:o??{x:0,y:0,width:g,height:_},position:t.position,offset:t.offset??0}),b=vu(t.position,t.offset??0,m),x=n===`vertical`?(o?.width??0)/2:o?.width??0,S=n===`horizontal`?(o?.height??0)/2:o?.height??0,C=y?{width:`max-content`,height:`max-content`,maxWidth:x,maxHeight:S,overflowY:`auto`,top:y.y+(b.top??0),left:y.x+(b.left??0),transform:Zl(y.horizontalAnchor,y.verticalAnchor)}:yu(l,t,a,g,_,m),w=u?l:cu(cu({position:`absolute`,width:v?.width||s||`auto`,height:v?.height||c||`auto`},C),l),T=u??i;if(T==null||r==null)return null;var E=f.createElement(`div`,{className:`recharts-legend-wrapper`,style:w,ref:h},f.createElement(bu,{layout:n,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter,position:t.position,offset:t.offset}),d&&f.createElement(xu,m),f.createElement(hu,eu({},t,{layout:n},v,{margin:a,chartWidth:g,chartHeight:_,contextPayload:r})));return(0,Ql.createPortal)(E,T)}var Tu=f.memo(wu,Yl);Tu.displayName=`Legend`;function Eu(){return Eu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.separator,n=t===void 0?zu.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?zu.labelStyle:a,s=e.payload,c=e.formatter,u=e.itemSorter,d=e.wrapperClassName,p=e.labelClassName,m=e.label,h=e.labelFormatter,g=e.accessibilityLayer,_=g===void 0?zu.accessibilityLayer:g,v=()=>{if(s&&s.length){var e={padding:0,margin:0},t=Bu(s,u).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||Ru,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var p=Mu(d,2);l=p[0],u=p[1]}else if(d!=null)l=d;else return null}var m=Ou(Ou({},zu.itemStyle),{},{color:e.color||zu.itemStyle.color},i);return f.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:m},de(u)?f.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,de(u)?f.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,f.createElement(`span`,{className:`recharts-tooltip-item-value`},l),f.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return f.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},y=Ou(Ou({},zu.contentStyle),r),b=Ou({margin:0},o),x=!I(m),S=x?m:``,C=l(`recharts-default-tooltip`,d),w=l(`recharts-tooltip-label`,p);x&&h&&s!=null&&(S=h(m,s));var T=_?{role:`status`,"aria-live":`assertive`}:{};return f.createElement(`div`,Eu({className:C,style:y},T),f.createElement(`p`,{className:w,style:b},f.isValidElement(S)?S:`${S}`),v())},Hu=`recharts-tooltip-wrapper`,Uu={visibility:`hidden`};function Wu(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return l(Hu,{[`${Hu}-right`]:F(n)&&t&&F(t.x)&&n>=t.x,[`${Hu}-left`]:F(n)&&t&&F(t.x)&&n=t.y,[`${Hu}-top`]:F(r)&&t&&F(t.y)&&r0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(uf+l?Math.max(u,f):Math.max(d,f)}function Ku(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function qu(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s&&s.height>0&&s.width>0&&n?(d=Gu({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=Gu({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Ku({translateX:d,translateY:f,useTranslate3d:c})):u=Uu,{cssProperties:u,cssClasses:Wu({translateX:d,translateY:f,coordinate:n})}}var Ju={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function Yu(e,t){return ed(e)||$u(e,t)||Zu(e,t)||Xu()}function Xu(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zu(e,t){if(e){if(typeof e==`string`)return Qu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qu(e,t):void 0}}function Qu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nJu.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),2),t=e[0],n=e[1];return(0,f.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{n(e.matches)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}},[]),t}function nd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rd(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];f.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(rd(rd({},r),{},{dismissed:!1}));var a=qu({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:e.lastBoundingBox,useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=rd(rd({},e.hasPortalFromProps?{}:rd(rd({transition:pd({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return f.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var hd=f.memo(md),gd=()=>z(e=>e.rootProps.accessibilityLayer)??!0;function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;tU(e.x)&&U(e.y),Td=e=>e.base!=null&&wd(e.base)&&wd(e),Ed=e=>e.x,Dd=e=>e.y,Od=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${ve(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=Cd[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return Cd[n]||qe},kd={connectNulls:!1,type:`linear`},Ad=e=>{var t=e.type,n=t===void 0?kd.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?kd.connectNulls:s,l=Od(n,o),u=c?i.filter(wd):i;if(Array.isArray(a)){var d,f=i.map((e,t)=>yd(yd({},e),{},{base:a[t]}));return d=o===`vertical`?Ze().y(Dd).x1(Ed).x0(e=>e.base.x):Ze().x(Ed).y1(Dd).y0(e=>e.base.y),d.defined(Td).curve(l)(c?f.filter(Td):f)}return(o===`vertical`&&F(a)?Ze().y(Dd).x1(Ed).x0(a):F(a)?Ze().x(Ed).y1(Dd).y0(a):Xe().x(Ed).y(Dd)).defined(wd).curve(l)(u)},jd=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=vl();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?Ad(o):r;return f.createElement(`path`,_d({},g(e),_n(e),{className:l(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},Md=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Nd(){return Nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t`M${e},${i}v${r}M${a},${t}h${n}`,Hd=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,u=e.width,d=u===void 0?0:u,p=e.height,m=p===void 0?0:p,h=e.className,g=zd(e,Md),_=Fd({x:n,y:i,top:o,left:c,width:d,height:m},g);return!F(n)||!F(i)||!F(d)||!F(m)||!F(o)||!F(c)?null:f.createElement(`path`,Nd({},v(_),{className:l(`recharts-cross`,h),d:Vd(n,i,d,m,o,c)}))};function Ud(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}var Wd=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Gd=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),Kd=(e,t)=>n=>Gd(Wd(e,t),n),qd=(e,t)=>n=>Gd([...Wd(e,t).map((e,t)=>e*t).slice(1),0],n),Jd=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},Yd=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=Jd(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},Xd=(e,t,n,r)=>{var i=Kd(e,n),a=Kd(t,r),o=qd(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},Zd=function(){return Xd(...Yd(...arguments))},Qd=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?16.67:a,s=1,c=[0],l=0,u=0,d=1e4,f=0;f{if(e<=0)return 0;if(e>=1)return s;var t=e*h,n=Math.floor(t),r=t-n;return(c[n]??0)+((c[n+1]??0)-(c[n]??0))*r}},$d=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return Zd(e);case`spring`:return Qd();default:if(e.split(`(`)[0]===`cubic-bezier`)return Zd(e)}return typeof e==`function`?e:null},ef=(0,f.createContext)((e,t,n)=>{var r,i=a=>{var o=t.tick(a);if(t.getState()===`active`){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,o)}else r=e.setTimeout(i,o)};return r=e.setTimeout(i,0),()=>r?.()});ef.Provider;function tf(e){var t=(0,f.useContext)(ef);return(0,f.useMemo)(()=>e??t,[e,t])}function nf(e,t,n){return(t=rf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rf(e){var t=af(e,`string`);return typeof t==`symbol`?t:t+``}function af(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var of=`init`,sf=`pending`,cf=`active`,lf=`completed`;function uf(e){return Math.max(0,e)}var df=class{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;nf(this,`state`,of),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=uf(e.animationDuration),this.animationBegin=uf(e.animationBegin),this.progress=0,this.from=e.from,this.to=e.to,this.easing=e.easing,(t=e.onAnimationStart)==null||t.call(e)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(e){if(this.getState()===of)return this.state=sf,this.beginStartedTime=e,this.animationBegin;if(this.getState()===sf){if(this.beginStartedTime==null)throw Error();var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=cf,this.animationStartedTime=e,this.nextAnimationUpdate(0)):uf(this.animationBegin-t)}if(this.getState()===cf){if(this.animationStartedTime==null)throw Error();var n=e-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state===`active`){var e;(e=this.onAnimationEnd)==null||e.call(this)}this.state=lf}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}},ff=class extends df{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ge(this.getFrom(),this.getTo(),this.getProgress()))}},pf=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):r=requestAnimationFrame(i)};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function mf(e,t){return yf(e)||vf(e,t)||gf(e,t)||hf()}function hf(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gf(e,t){if(e){if(typeof e==`string`)return _f(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_f(e,t):void 0}}function _f(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{},onAnimationStart:()=>{}},xf=0,Sf=1;function Cf(e){var t=Tn(e,bf),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,s=t.begin,c=t.onAnimationEnd,l=t.onAnimationStart,u=t.children,d=td(),p=r===`auto`?!Ju.isSsr&&!d:r,m=tf(t.animationController),h=mf((0,f.useState)(p?xf:Sf),2),g=h[0],_=h[1];return(0,f.useEffect)(()=>{p||_(Sf)},[p]),(0,f.useEffect)(()=>{var e=$d(o);return!p||!i||e==null?be:m(new pf,new ff({animationId:n,easing:e,animationDuration:a,animationBegin:s,onAnimationStart:l,onAnimationEnd:c,from:xf,to:Sf}),_)},[m,n,p,i,a,o,s,l,c]),u(Number(g))}function wf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,f.useRef)(pe(t)),r=(0,f.useRef)(e);return r.current!==e&&(n.current=pe(t),r.current=e),n.current}var Tf=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),Ef=(e,t,n)=>e.map(e=>`${Tf(e)} ${t}ms ${n}`).join(`,`),Df=[`radius`],Of=[`radius`],kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf;function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bf(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{var a=se(n),o=se(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;ps?s:h}d=P(kf||=$f([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=P(Af||=$f([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=P(jf||=$f([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=P(Mf||=$f([`A `,`,`,`,0,0,`,`, - `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=P(Nf||=$f([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=P(Pf||=$f([`A `,`,`,`,0,0,`,`, - `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=P(Ff||=$f([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=P(If||=$f([`A `,`,`,`,0,0,`,`, - `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=P(Lf||=$f(`M .,. - A .,.,0,0,.,.,. - L .,. - A .,.,0,0,.,.,. - L .,. - A .,.,0,0,.,.,. - L .,. - A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=P(Rf||=$f([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},tp={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},np=e=>{var t=Tn(e,tp),n=(0,f.useRef)(null),r=qf((0,f.useState)(-1),2),i=r[0],a=r[1];(0,f.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,u=t.height,d=t.radius,p=t.className,m=t.animationEasing,h=t.animationDuration,g=t.animationBegin,_=t.isAnimationActive,y=t.isUpdateAnimationActive,b=(0,f.useRef)(c),x=(0,f.useRef)(u),S=(0,f.useRef)(o),C=(0,f.useRef)(s),w=wf((0,f.useMemo)(()=>({x:o,y:s,width:c,height:u,radius:d}),[o,s,c,u,d]),`rectangle-`);if(o!==+o||s!==+s||c!==+c||u!==+u||c===0||u===0)return null;var T=l(`recharts-rectangle`,p);if(!y){var E=v(t);E.radius;var D=Gf(E,Df);return f.createElement(`path`,Wf({},D,{x:se(o),y:se(s),width:se(c),height:se(u),radius:typeof d==`number`?d:void 0,className:T,d:ep(o,s,c,u,d)}))}var O=b.current,k=x.current,A=S.current,j=C.current,M=`0px ${i===-1?1:i}px`,N=`${i}px ${i}px`,ee=Ef([`strokeDasharray`],h,typeof m==`string`?m:tp.animationEasing);return f.createElement(Cf,{animationId:w,key:w,canBegin:i>0,duration:h,easing:m,isActive:y,begin:g},e=>{var r=ge(O,c,e),i=ge(k,u,e),a=ge(A,o,e),l=ge(j,s,e);n.current&&(b.current=r,x.current=i,S.current=a,C.current=l);var p=_?e>0?{transition:ee,strokeDasharray:N}:{strokeDasharray:M}:{strokeDasharray:N},m=v(t);m.radius;var h=Gf(m,Of);return f.createElement(`path`,Wf({},h,{radius:typeof d==`number`?d:void 0,className:T,d:ep(a,l,r,i,d),ref:n,style:Bf(Bf({},p),t.style)}))})};function rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ip(e){for(var t=1;te*180/Math.PI,up=(e,t,n,r)=>({x:e+Math.cos(-cp*r)*n,y:t+Math.sin(-cp*r)*n}),dp=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},fp=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},pp=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,o=fp({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:lp(c),angleInRadian:c}},mp=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},hp=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},gp=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=pp({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(ac||a===0)return null;var l=mp(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f=u&&f<=d}else{for(;f>u;)f-=360;for(;f=d&&f<=u}return p?ip(ip({},t),{},{radius:a,angle:hp(f,t)}):null};function _p(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[up(t,n,r,i),up(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var vp,yp,bp,xp,Sp,Cp,wp;function Tp(){return Tp=Object.assign?Object.assign.bind():function(e){for(var t=1;tce(t-e)*Math.min(Math.abs(t-e),359.999),Op=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/cp,d=c?i:i+a*u,f=up(t,n,l,d),p=up(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:up(t,n,l*Math.cos(u*cp),m),theta:u}},kp=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=Dp(a,o),c=a+s,l=up(t,n,i,a),u=up(t,n,i,c),d=P(vp||=Ep([`M `,`,`,` - A `,`,`,`,0, - `,`,`,`, - `,`,`,` - `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=up(t,n,r,a),p=up(t,n,r,c);d+=P(yp||=Ep([`L `,`,`,` - A `,`,`,`,0, - `,`,`,`, - `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=P(bp||=Ep([`L `,`,`,` Z`]),t,n);return d},Ap=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=ce(l-c),d=Op({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=Op({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?P(xp||=Ep([`M `,`,`,` - a`,`,`,`,0,0,1,`,`,0 - a`,`,`,`,0,0,1,`,`,0 - `]),p.x,p.y,a,a,a*2,a,a,-a*2):kp({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=P(Sp||=Ep([`M `,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,` - A`,`,`,`,0,`,`,`,`,`,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,` - `]),p.x,p.y,a,a,+(u<0),f.x,f.y,i,i,+(y>180),+(u<0),g.x,g.y,a,a,+(u<0),_.x,_.y);if(r>0){var x=Op({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=Op({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=P(Cp||=Ep([`L`,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,` - A`,`,`,`,0,`,`,`,`,`,`,`,` - A`,`,`,`,0,0,`,`,`,`,`,`Z`]),D.x,D.y,a,a,+(u<0),E.x,E.y,r,r,+(k>180),+(u>0),S.x,S.y,a,a,+(u<0),C.x,C.y)}else b+=P(wp||=Ep([`L`,`,`,`Z`]),t,n);return b},jp={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Mp=e=>{var t=Tn(e,jp),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,p=t.className;if(a0&&Math.abs(u-d)<360?Ap({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,h/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}):kp({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});return f.createElement(`path`,Tp({},v(t),{className:m,d:_}))};function Np(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(gn(t)){if(e===`centric`){var r=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,s=t.angle,c=up(r,i,a,s),l=up(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return _p(t)}}function Pp(e){return ee(e)?NaN:Number(e)}function Fp(e){return e?(e=Pp(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function Ip(e,t,n){n&&typeof n!=`number`&&vi(e,t,n)&&(t=n=void 0),e=Fp(e),t===void 0?(t=e,e=0):t=Fp(t),n=n===void 0?ee.chartData,Rp=B([Lp],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),zp=(e,t,n,r)=>r?Rp(e):Lp(e),Bp=(e,t,n)=>n?Rp(e):Lp(e),Vp=B([zp],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});B([Rp],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});var Hp=B([Lp],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});function Up(e,t){return Jp(e)||qp(e,t)||Gp(e,t)||Wp()}function Wp(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gp(e,t){if(e){if(typeof e==`string`)return Kp(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kp(e,t):void 0}}function Kp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||en)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;tr?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),rh||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i)t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;else{if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function $p(e){return e===0?1:Math.floor(new K.default(e).abs().log(10).toNumber())+1}function em(e,t,n){for(var r=new K.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function tm(e,t){return om(e)||am(e,t)||rm(e,t)||nm()}function nm(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rm(e,t){if(e){if(typeof e==`string`)return im(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?im(e,t):void 0}}function im(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=tm(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},cm=(e,t,n)=>{if(e.lte(0))return new K.default(0);var r=$p(e.toNumber()),i=new K.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new K.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new K.default(s.toNumber()):new K.default(Math.ceil(s.toNumber()))},lm=(e,t,n)=>{if(e.lte(0))return new K.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new K.default(i).abs().log(10).toNumber()),o=new K.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new K.default(10).pow(l))}var u=r[c]??1,d=new K.default(u).mul(o);return t?d:new K.default(Math.ceil(d.toNumber()))},um=(e,t,n)=>{var r=new K.default(1),i=new K.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new K.default(10).pow($p(e)-1),i=new K.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new K.default(Math.floor(e)))}else e===0?i=new K.default(Math.floor((t-1)/2)):n||(i=new K.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cm;if(!Number.isFinite((t-e)/(n-1)))return{step:new K.default(0),tickMin:new K.default(0),tickMax:new K.default(0)};var o=a(new K.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new K.default(0):(s=new K.default(e).add(t).div(2),s=s.sub(new K.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new K.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?dm(e,t,n,r,i+1,a):(u0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new K.default(c).mul(o)),tickMax:s.add(new K.default(l).mul(o))})},fm=function(e){var t=tm(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=Math.max(i,2),c=tm(sm([n,r]),2),l=c[0],u=c[1];if(l===-1/0||u===1/0){var d=u===1/0?[l,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?d.reverse():d}if(l===u)return um(l,i,a);var f=dm(l,u,s,a,0,o===`snap125`?lm:cm),p=f.step,m=f.tickMin,h=f.tickMax,g=em(m,h.add(new K.default(.1).mul(p)),p);return n>r?g.reverse():g},pm=function(e,t){var n=tm(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=tm(sm([r,i]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0)return[r,i];if(c===l)return[c];var u=o===`snap125`?lm:cm,d=Math.max(t,2),f=u(new K.default(l).sub(c).div(d-1),a,0),p=[...em(new K.default(c),new K.default(l),f),l];if(a===!1){p=p.map(e=>Math.round(e));var m=p.length-1;m>0&&p[m]===p[m-1]&&(p=p.slice(0,m))}return r>i?p.reverse():p},mm=e=>e.rootProps.barCategoryGap,hm=e=>e.rootProps.stackOffset,gm=e=>e.rootProps.reverseStackOrder,_m=e=>e.options.chartName,vm=e=>e.rootProps.syncId,ym=e=>e.rootProps.syncMethod,bm=e=>e.options.eventEmitter,xm=e=>e.rootProps.baseValue,Sm={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Cm={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:Sm.axis},wm={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:Sm.axis},Tm=(e,t)=>{if(e&&t)return e!=null&&e.reversed?[t[1],t[0]]:t};function Em(e,t,n){if(n!==`auto`)return n;if(e!=null)return Js(e,t)?`category`:`number`}function Dm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},bl],(e,t)=>{if(e!=null)return e;var n=Em(t,`angleAxis`,Mm.type)??`category`;return Om(Om({},Mm),{},{type:n})}),Fm=B([(e,t)=>e.polarAxis.radiusAxis[t],bl],(e,t)=>{if(e!=null)return e;var n=Em(t,`radiusAxis`,Nm.type)??`category`;return Om(Om({},Nm),{},{type:n})}),Im=e=>e.polarOptions,Lm=B([lc,uc,Ec],dp),Rm=B([Im,Lm],(e,t)=>{if(e!=null)return me(e.innerRadius,t,0)}),zm=B([Im,Lm],(e,t)=>{if(e!=null)return me(e.outerRadius,t,t*.8)}),Bm=B([Im],e=>e==null?[0,0]:[e.startAngle,e.endAngle]);B([Pm,Bm],Tm);var Vm=B([Lm,Rm,zm],(e,t,n)=>{if(e!=null&&t!=null&&n!=null)return[t,n]});B([Fm,Vm],Tm);var Hm=B([G,Im,Rm,zm,lc,uc],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var o=t.cx,s=t.cy,c=t.startAngle,l=t.endAngle;return{cx:me(o,i,i/2),cy:me(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),Um=(e,t)=>t,Wm=(e,t,n)=>n;function Gm(e){return e?.id}function Km(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,o=n.dataKey,s=new Map;return e.forEach(e=>{var t=e.data??i;if(t!=null&&t.length!==0){var n=Gm(e);t.forEach((t,r)=>{var i=o==null||a?r:String(W(t,o,null)),c=W(t,e.dataKey,0),l=s.has(i)?s.get(i):{};Object.assign(l,{[n]:c}),s.set(i,l)})}}),Array.from(s.values())}function qm(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var Jm=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ym(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Xm(e,t){if(e.length===t.length){for(var n=0;n{var t=G(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},Qm=e=>e.tooltip.settings.axisId;function $m(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i}}return r}}}}}var eh=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!Yp(t)){for(var n,r,i=0;ir)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function th(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function nh(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function rh(e){let t,n,r;e.length===2?(t=e===th||e===nh?e:ih,n=e,r=e):(t=th,n=(t,n)=>th(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function ih(){return 0}function ah(e){return e===null?NaN:+e}function*oh(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var sh=rh(th),ch=sh.right;sh.left,rh(ah).center;var lh=class extends Map{constructor(e,t=ph){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(uh(this,e))}has(e){return super.has(uh(this,e))}set(e,t){return super.set(dh(this,e),t)}delete(e){return super.delete(fh(this,e))}};function uh({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function dh({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function fh({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ph(e){return typeof e==`object`&&e?e.valueOf():e}function mh(e=th){if(e===th)return hh;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function hh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et))}var gh=Math.sqrt(50),_h=Math.sqrt(10),vh=Math.sqrt(2);function yh(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=gh?10:a>=_h?5:a>=vh?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function wh(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Th(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?hh:mh(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));Th(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Eh(e,n,t),i(e[r],a)>0&&Eh(e,n,r);o0;)--s}i(e[n],a)===0?Eh(e,n,s):(++s,Eh(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Eh(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Dh(e,t,n){if(e=Float64Array.from(oh(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return wh(e);if(t>=1)return Ch(e);var r,i=(r-1)*t,a=Math.floor(i),o=Ch(Th(e,a).subarray(0,a+1));return o+(wh(e.subarray(a+1))-o)*(i-a)}}function Oh(e,t,n=ah){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function kh(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ag(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ag(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Kh.exec(e))?new cg(t[1],t[2],t[3],1):(t=qh.exec(e))?new cg(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Jh.exec(e))?ag(t[1],t[2],t[3],t[4]):(t=Yh.exec(e))?ag(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Xh.exec(e))?hg(t[1],t[2]/100,t[3]/100,1):(t=Zh.exec(e))?hg(t[1],t[2]/100,t[3]/100,t[4]):Qh.hasOwnProperty(e)?ig(Qh[e]):e===`transparent`?new cg(NaN,NaN,NaN,0):null}function ig(e){return new cg(e>>16&255,e>>8&255,e&255,1)}function ag(e,t,n,r){return r<=0&&(e=t=n=NaN),new cg(e,t,n,r)}function og(e){return e instanceof zh||(e=rg(e)),e?(e=e.rgb(),new cg(e.r,e.g,e.b,e.opacity)):new cg}function sg(e,t,n,r){return arguments.length===1?og(e):new cg(e,t,n,r??1)}function cg(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Lh(cg,sg,Rh(zh,{brighter(e){return e=e==null?Vh:Vh**+e,new cg(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bh:Bh**+e,new cg(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cg(pg(this.r),pg(this.g),pg(this.b),fg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lg,formatHex:lg,formatHex8:ug,formatRgb:dg,toString:dg}));function lg(){return`#${mg(this.r)}${mg(this.g)}${mg(this.b)}`}function ug(){return`#${mg(this.r)}${mg(this.g)}${mg(this.b)}${mg((isNaN(this.opacity)?1:this.opacity)*255)}`}function dg(){let e=fg(this.opacity);return`${e===1?`rgb(`:`rgba(`}${pg(this.r)}, ${pg(this.g)}, ${pg(this.b)}${e===1?`)`:`, ${e})`}`}function fg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mg(e){return e=pg(e),(e<16?`0`:``)+e.toString(16)}function hg(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new vg(e,t,n,r)}function gg(e){if(e instanceof vg)return new vg(e.h,e.s,e.l,e.opacity);if(e instanceof zh||(e=rg(e)),!e)return new vg;if(e instanceof vg)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new vg(o,s,c,e.opacity)}function _g(e,t,n,r){return arguments.length===1?gg(e):new vg(e,t,n,r??1)}function vg(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Lh(vg,_g,Rh(zh,{brighter(e){return e=e==null?Vh:Vh**+e,new vg(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bh:Bh**+e,new vg(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new cg(xg(e>=240?e-240:e+120,i,r),xg(e,i,r),xg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new vg(yg(this.h),bg(this.s),bg(this.l),fg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=fg(this.opacity);return`${e===1?`hsl(`:`hsla(`}${yg(this.h)}, ${bg(this.s)*100}%, ${bg(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function yg(e){return e=(e||0)%360,e<0?e+360:e}function bg(e){return Math.max(0,Math.min(1,e||0))}function xg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Sg=e=>()=>e;function Cg(e,t){return function(n){return e+n*t}}function wg(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Tg(e){return(e=+e)==1?Eg:function(t,n){return n-t?wg(t,n,e):Sg(isNaN(t)?n:t)}}function Eg(e,t){var n=t-e;return n?Cg(e,n):Sg(isNaN(e)?t:e)}var Dg=(function e(t){var n=Tg(t);function r(e,t){var r=n((e=sg(e)).r,(t=sg(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Eg(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Og(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Mg(r,i)})),n=Fg.lastIndex;return nt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Jg(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?Yg:Jg,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Mg))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Ug),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Bg,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Gg,u()):o!==Gg},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Qg(){return Zg()(Gg,Gg)}function $g(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function e_(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function t_(e){return e=e_(Math.abs(e)),e?e[1]:NaN}function n_(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function r_(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var i_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a_(e){if(!(t=i_.exec(e)))throw Error(`invalid format: `+e);var t;return new o_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}a_.prototype=o_.prototype;function o_(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}o_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function s_(e){out:for(var t=e.length,n=1,r=-1,i;n0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var c_;function l_(e,t){var n=e_(e,t);if(!n)return c_=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(c_=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+e_(e,Math.max(0,t+a-1))[0]}function u_(e,t){var n=e_(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var d_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:$g,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>u_(e*100,t),r:u_,s:l_,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function f_(e){return e}var p_=Array.prototype.map,m_=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function h_(e){var t=e.grouping===void 0||e.thousands===void 0?f_:n_(p_.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?f_:r_(p_.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=a_(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):d_[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=d_[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=s_(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&c_!==void 0?m_[8+c_/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++op||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(t_(t)/3)))*3,r=10**-n,i=l((e=a_(e),e.type=`f`,e),{suffix:m_[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var g_,__,v_;y_({thousands:`,`,grouping:[3],currency:[`$`,``]});function y_(e){return g_=h_(e),__=g_.format,v_=g_.formatPrefix,g_}function b_(e){return Math.max(0,-t_(Math.abs(e)))}function x_(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(t_(t)/3)))*3-t_(Math.abs(e)))}function S_(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,t_(t)-t_(e))+1}function C_(e,t,n,r){var i=Sh(e,t,n),a;switch(r=a_(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=x_(i,o))&&(r.precision=a),v_(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=S_(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=b_(i))&&(r.precision=a-(r.type===`%`)*2)}return __(r)}function w_(e){var t=e.domain;return e.ticks=function(e){var n=t();return bh(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return C_(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=xh(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function T_(){var e=Qg();return e.copy=function(){return Xg(e,T_())},Ah.apply(e,arguments),w_(e)}function E_(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Ug),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return E_(e).unknown(t)},e=arguments.length?Array.from(e,Ug):[0,1],w_(n)}function D_(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return ae**+t}function P_(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function F_(e){return(t,n)=>-e(-t,n)}function I_(e){let t=e(O_,k_),n=t.domain,r=10,i,a;function o(){return i=P_(r),a=N_(r),n()[0]<0?(i=F_(i),a=F_(a),e(A_,j_)):e(O_,k_),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s0){for(;l<=u;++l)for(d=1;ds)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(fs)break;m.push(f)}m.length*2{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=a_(n)).precision==null&&(n.trim=!0),n=__(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*rn(D_(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function L_(){let e=I_(Zg()).domain([1,10]);return e.copy=()=>Xg(e,L_()).base(e.base()),Ah.apply(e,arguments),e}function R_(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function z_(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function B_(e){var t=1,n=e(R_(t),z_(t));return n.constant=function(n){return arguments.length?e(R_(t=+n),z_(t)):t},w_(n)}function V_(){var e=B_(Zg());return e.copy=function(){return Xg(e,V_()).constant(e.constant())},Ah.apply(e,arguments)}function H_(e){return function(t){return t<0?-((-t)**+e):t**+e}}function U_(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function W_(e){return e<0?-e*e:e*e}function G_(e){var t=e(Gg,Gg),n=1;function r(){return n===1?e(Gg,Gg):n===.5?e(U_,W_):e(H_(n),H_(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},w_(t)}function K_(){var e=G_(Zg());return e.copy=function(){return Xg(e,K_()).exponent(e.exponent())},Ah.apply(e,arguments),e}function q_(){return K_.apply(null,arguments).exponent(.5)}function J_(e){return Math.sign(e)*e*e}function Y_(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function X_(){var e=Qg(),t=[0,1],n=!1,r;function i(t){var i=Y_(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(J_(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,Ug)).map(J_)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return X_(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ah.apply(i,arguments),w_(i)}function Z_(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r0?n[i-1]:e[0],i=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Q_().domain([e,t]).range(i).unknown(a)},Ah.apply(w_(o),arguments)}function $_(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[ch(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return $_().domain(e).range(t).unknown(n)},Ah.apply(i,arguments)}var ev=new Date,tv=new Date;function q(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(sq(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(ev.setTime(+t),tv.setTime(+r),e(ev),e(tv),Math.floor(n(ev,tv))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var nv=q(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);nv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?q(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):nv),nv.range;var rv=1e3,iv=rv*60,av=iv*60,ov=av*24,sv=ov*7,cv=ov*30,lv=ov*365,uv=q(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*rv)},(e,t)=>(t-e)/rv,e=>e.getUTCSeconds());uv.range;var dv=q(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*rv)},(e,t)=>{e.setTime(+e+t*iv)},(e,t)=>(t-e)/iv,e=>e.getMinutes());dv.range;var fv=q(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*iv)},(e,t)=>(t-e)/iv,e=>e.getUTCMinutes());fv.range;var pv=q(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*rv-e.getMinutes()*iv)},(e,t)=>{e.setTime(+e+t*av)},(e,t)=>(t-e)/av,e=>e.getHours());pv.range;var mv=q(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*av)},(e,t)=>(t-e)/av,e=>e.getUTCHours());mv.range;var hv=q(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*iv)/ov,e=>e.getDate()-1);hv.range;var gv=q(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ov,e=>e.getUTCDate()-1);gv.range;var _v=q(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ov,e=>Math.floor(e/ov));_v.range;function vv(e){return q(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*iv)/sv)}var yv=vv(0),bv=vv(1),xv=vv(2),Sv=vv(3),Cv=vv(4),wv=vv(5),Tv=vv(6);yv.range,bv.range,xv.range,Sv.range,Cv.range,wv.range,Tv.range;function Ev(e){return q(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/sv)}var Dv=Ev(0),Ov=Ev(1),kv=Ev(2),Av=Ev(3),jv=Ev(4),Mv=Ev(5),Nv=Ev(6);Dv.range,Ov.range,kv.range,Av.range,jv.range,Mv.range,Nv.range;var Pv=q(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Pv.range;var Fv=q(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Fv.range;var Iv=q(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Iv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:q(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Iv.range;var Lv=q(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Lv.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:q(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Lv.range;function Rv(e,t,n,r,i,a){let o=[[uv,1,rv],[uv,5,5*rv],[uv,15,15*rv],[uv,30,30*rv],[a,1,iv],[a,5,5*iv],[a,15,15*iv],[a,30,30*iv],[i,1,av],[i,3,3*av],[i,6,6*av],[i,12,12*av],[r,1,ov],[r,2,2*ov],[n,1,sv],[t,1,cv],[t,3,3*cv],[e,1,lv]];function s(e,t,n){let r=te).right(o,i);if(a===o.length)return e.every(Sh(t/lv,n/lv,r));if(a===0)return nv.every(Math.max(Sh(t,n,r),1));let[s,c]=o[i/o[a-1][2]53)return null;`w`in r||(r.w=1),`Z`in r?(a=Wv(Gv(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Ov.ceil(a):Ov(a),a=gv.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Uv(Gv(r.y,0,1)),o=a.getDay(),a=o>4||o===0?bv.ceil(a):bv(a),a=hv.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Wv(Gv(r.y,0,1)).getUTCDay():Uv(Gv(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Wv(r)):Uv(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in qv?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function ee(e){return a[e.getDay()]}function te(e){return c[e.getMonth()]}function ne(e){return s[e.getMonth()]}function re(e){return i[+(e.getHours()>=12)]}function ie(e){return 1+~~(e.getMonth()/3)}function ae(e){return o[e.getUTCDay()]}function oe(e){return a[e.getUTCDay()]}function se(e){return c[e.getUTCMonth()]}function P(e){return s[e.getUTCMonth()]}function ce(e){return i[+(e.getUTCHours()>=12)]}function le(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var qv={"-":``,_:` `,0:`0`},Jv=/^\s*\d+/,Yv=/^%/,Xv=/[\\^$*+?|[\]().{}]/g;function J(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a[e.toLowerCase(),t]))}function ey(e,t,n){var r=Jv.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ty(e,t,n){var r=Jv.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function ny(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ry(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function iy(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ay(e,t,n){var r=Jv.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function oy(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function sy(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function cy(e,t,n){var r=Jv.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ly(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function uy(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function dy(e,t,n){var r=Jv.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function fy(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function py(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function my(e,t,n){var r=Jv.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hy(e,t,n){var r=Jv.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function gy(e,t,n){var r=Jv.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function _y(e,t,n){var r=Yv.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function vy(e,t,n){var r=Jv.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function yy(e,t,n){var r=Jv.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function by(e,t){return J(e.getDate(),t,2)}function xy(e,t){return J(e.getHours(),t,2)}function Sy(e,t){return J(e.getHours()%12||12,t,2)}function Cy(e,t){return J(1+hv.count(Iv(e),e),t,3)}function wy(e,t){return J(e.getMilliseconds(),t,3)}function Ty(e,t){return wy(e,t)+`000`}function Ey(e,t){return J(e.getMonth()+1,t,2)}function Dy(e,t){return J(e.getMinutes(),t,2)}function Oy(e,t){return J(e.getSeconds(),t,2)}function ky(e){var t=e.getDay();return t===0?7:t}function Ay(e,t){return J(yv.count(Iv(e)-1,e),t,2)}function jy(e){var t=e.getDay();return t>=4||t===0?Cv(e):Cv.ceil(e)}function My(e,t){return e=jy(e),J(Cv.count(Iv(e),e)+(Iv(e).getDay()===4),t,2)}function Ny(e){return e.getDay()}function Py(e,t){return J(bv.count(Iv(e)-1,e),t,2)}function Fy(e,t){return J(e.getFullYear()%100,t,2)}function Iy(e,t){return e=jy(e),J(e.getFullYear()%100,t,2)}function Ly(e,t){return J(e.getFullYear()%1e4,t,4)}function Ry(e,t){var n=e.getDay();return e=n>=4||n===0?Cv(e):Cv.ceil(e),J(e.getFullYear()%1e4,t,4)}function zy(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+J(t/60|0,`0`,2)+J(t%60,`0`,2)}function By(e,t){return J(e.getUTCDate(),t,2)}function Vy(e,t){return J(e.getUTCHours(),t,2)}function Hy(e,t){return J(e.getUTCHours()%12||12,t,2)}function Uy(e,t){return J(1+gv.count(Lv(e),e),t,3)}function Wy(e,t){return J(e.getUTCMilliseconds(),t,3)}function Gy(e,t){return Wy(e,t)+`000`}function Ky(e,t){return J(e.getUTCMonth()+1,t,2)}function qy(e,t){return J(e.getUTCMinutes(),t,2)}function Jy(e,t){return J(e.getUTCSeconds(),t,2)}function Yy(e){var t=e.getUTCDay();return t===0?7:t}function Xy(e,t){return J(Dv.count(Lv(e)-1,e),t,2)}function Zy(e){var t=e.getUTCDay();return t>=4||t===0?jv(e):jv.ceil(e)}function Qy(e,t){return e=Zy(e),J(jv.count(Lv(e),e)+(Lv(e).getUTCDay()===4),t,2)}function $y(e){return e.getUTCDay()}function eb(e,t){return J(Ov.count(Lv(e)-1,e),t,2)}function tb(e,t){return J(e.getUTCFullYear()%100,t,2)}function nb(e,t){return e=Zy(e),J(e.getUTCFullYear()%100,t,2)}function rb(e,t){return J(e.getUTCFullYear()%1e4,t,4)}function ib(e,t){var n=e.getUTCDay();return e=n>=4||n===0?jv(e):jv.ceil(e),J(e.getUTCFullYear()%1e4,t,4)}function ab(){return`+0000`}function ob(){return`%`}function sb(e){return+e}function cb(e){return Math.floor(e/1e3)}var lb,ub,db;fb({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function fb(e){return lb=Kv(e),ub=lb.format,lb.parse,db=lb.utcFormat,lb.utcParse,lb}function pb(e){return new Date(e)}function mb(e){return e instanceof Date?+e:+new Date(+e)}function hb(e,t,n,r,i,a,o,s,c,l){var u=Qg(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>Dh(e,r/t))},n.copy=function(){return Tb(t).domain(e)},jh.apply(n,arguments)}function Eb(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=Gg,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*ePh,scaleDiverging:()=>Db,scaleDivergingLog:()=>Ob,scaleDivergingPow:()=>Ab,scaleDivergingSqrt:()=>jb,scaleDivergingSymlog:()=>kb,scaleIdentity:()=>E_,scaleImplicit:()=>Mh,scaleLinear:()=>T_,scaleLog:()=>L_,scaleOrdinal:()=>Nh,scalePoint:()=>Ih,scalePow:()=>K_,scaleQuantile:()=>Z_,scaleQuantize:()=>Q_,scaleRadial:()=>X_,scaleSequential:()=>bb,scaleSequentialLog:()=>xb,scaleSequentialPow:()=>Cb,scaleSequentialQuantile:()=>Tb,scaleSequentialSqrt:()=>wb,scaleSequentialSymlog:()=>Sb,scaleSqrt:()=>q_,scaleSymlog:()=>V_,scaleThreshold:()=>$_,scaleTime:()=>gb,scaleUtc:()=>_b,tickFormat:()=>C_});function Nb(e){var t=Mb;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${ve(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function Pb(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=Nb(e);if(r!=null)return r.domain(t).range(n),r}}function Fb(e,t,n,r){if(n!=null&&r!=null)return typeof e.scale==`function`?Pb(e.scale,n,r):Pb(t,n,r)}function Ib(e){return`scale${ve(e)}`}function Lb(e){return Ib(e)in Mb}var Rb=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return Lb(r)?r:`point`}};function zb(e,t){for(var n=0,r=e.length,i=e[0]t)?n=a+1:r=a}return n}function Bb(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=zb(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function Vb(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):Bb(e,void 0)}function Hb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ub(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.cartesianAxis.xAxis[t],tx=(e,t)=>ex(e,t)??Y,X={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:$b,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},nx=(e,t)=>e.cartesianAxis.yAxis[t],rx=(e,t)=>nx(e,t)??X,ix={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},ax=(e,t)=>e.cartesianAxis.zAxis[t]??ix,ox=(e,t,n)=>{switch(t){case`xAxis`:return tx(e,n);case`yAxis`:return rx(e,n);case`zAxis`:return ax(e,n);case`angleAxis`:return Pm(e,n);case`radiusAxis`:return Fm(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},sx=(e,t,n)=>{switch(t){case`xAxis`:return tx(e,n);case`yAxis`:return rx(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},cx=(e,t,n)=>{switch(t){case`xAxis`:return tx(e,n);case`yAxis`:return rx(e,n);case`angleAxis`:return Pm(e,n);case`radiusAxis`:return Fm(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},lx=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function ux(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var dx=e=>e.graphicalItems.cartesianItems,fx=B([Um,Wm],ux),px=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0||!e.hide),mx=B([dx,ox,fx],px,{memoizeOptions:{resultEqualityCheck:Ym}}),hx=B([mx],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(qm)),gx=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),_x=B([mx],gx),vx=e=>e.map(e=>e.data).filter(Boolean).flat(1),yx=B([mx],e=>e.some(e=>!e.data)),bx=B([mx],vx,{memoizeOptions:{resultEqualityCheck:Ym}}),xx=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},Sx=B([bx,zp],xx),Cx=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:W(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:W(e,t.dataKey)})),wx=(e,t,n,r,i,a)=>{var o=r.chartData,s=o===void 0?[]:o,c=r.dataStartIndex,l=r.dataEndIndex,u=Cx(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...s.slice(c,l+1).map(e=>({value:W(e,t.dataKey)})).filter(e=>e.value!=null),...u]:u},Tx=B([Sx,ox,mx,zp,yx,bx],wx);function Ex(e){if(de(e)||e instanceof Date){var t=Number(e);if(U(t))return t}}function Dx(e){if(Array.isArray(e)){var t=[Ex(e[0]),Ex(e[1])];return Yp(t)?t:void 0}var n=Ex(e);if(n!=null)return[n,n]}function Ox(e){return e.map(Ex).filter(ye)}function kx(e,t){var n=Ex(e),r=Ex(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Ax=B([Tx],e=>e?.map(e=>e.value).sort(kx));function jx(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function Mx(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!le(t))r=t;else if(Array.isArray(t)){var i=Ox(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ox(n.flatMap(t=>{var n=W(e,t.dataKey),i,a;if(Array.isArray(n)){var o=qb(n,2);i=o[0],a=o[1]}else i=a=n;if(U(i)&&U(a))return[r-i,r+a]}))}var Z=e=>cx(e,Zm(e),Qm(e)),Nx=B([Z],e=>e?.dataKey),Px=B([hx,zp,Z],Km),Fx=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var i=qb(t,2),a=i[0],o=i[1],s=r?[...o].reverse():o;return[a,{stackedData:Xs(e,s.map(Gm),n),graphicalItems:s}]}))},Ix=B([Px,hx,hm,gm],Fx),Lx=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!==`zAxis`)return tc(e,i,a)},Rx=B([ox],e=>e.allowDataOverflow),zx=e=>{if(e==null||!(`domain`in e))return $b;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=Ox(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??$b},Bx=B([ox],zx),Vx=B([Bx,Rx],Zp),Hx=B([Ix,Lp,Um,Vx],Lx,{memoizeOptions:{resultEqualityCheck:Jm}}),Ux=e=>e.errorBars,Wx=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>jx(n,e)),Gx=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},Kx=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>jx(i,e));n.forEach(n=>{var r=W(n,t.dataKey??e.dataKey),i=Mx(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||as)&&(s=l)}var u=Dx(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=Dx(W(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),U(o)&&U(s))return[o,s]},qx=B([Sx,ox,_x,Ux,Um,Vp],Kx,{memoizeOptions:{resultEqualityCheck:Jm}});function Jx(e){var t=e.value;if(de(t)||t instanceof Date)return t}var Yx=(e,t,n)=>{var r=e.map(Jx).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&he(r))?Ip(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Xx=e=>e.referenceElements.dots,Zx=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),Qx=B([Xx,Um,Wm],Zx),$x=e=>e.referenceElements.areas,eS=B([$x,Um,Wm],Zx),tS=e=>e.referenceElements.lines,nS=B([tS,Um,Wm],Zx),rS=(e,t)=>{if(e!=null){var n=Ox(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},iS=B(Qx,Um,rS),aS=(e,t)=>{if(e!=null){var n=Ox(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},oS=B([eS,Um],aS);function sS(e){if(e.x!=null)return Ox([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:Ox(t)}function cS(e){if(e.y!=null)return Ox([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:Ox(t)}var lS=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?sS(e):cS(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},uS=B(iS,B([nS,Um],lS),oS,(e,t,n)=>Gx(e,n,t)),dS=(e,t,n,r,i,a,o,s,c)=>{if(n!=null)return n;var l=o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?Gx(r,a,i):Gx(a,i),u=Qp(t,l,e.allowDataOverflow);return u==null&&e.allowDataOverflow&&l==null&&c!=null?c:u},fS=B([ox,Bx,Vx,Hx,qx,uS,G,Um,B([ox],e=>{if(e!=null&&e.type===`number`&&`ticks`in e&&e.ticks!=null){var t=Ox(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},{memoizeOptions:{resultEqualityCheck:Jm}})],dS,{memoizeOptions:{resultEqualityCheck:Jm}}),pS=[0,1],mS=(e,t,n,r,i,a,o)=>{if(e!=null&&n!=null&&n.length!==0||o!==void 0){var s=e.dataKey,c=e.type,l=Js(t,a);return l&&s==null?Ip(0,n?.length??0):c===`category`?Yx(r,e,l):i===`expand`&&!l?pS:o}},hS=B([ox,G,Sx,Tx,hm,Um,fS],mS),gS=B([ox,lx,_m],Rb),_S=(e,t,n)=>{var r=t.niceTicks;if(r!==`none`){var i=zx(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&Yp(e)){if(a)return fm(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return pm(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&Yp(e))return fm(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&Yp(e))return pm(e,t.tickCount,t.allowDecimals,`adaptive`)}}},vS=B([hS,cx,gS],_S),yS=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&Yp(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},bS=B([ox,hS,vS,Um],yS),xS=B(B(Tx,ox,(e,t)=>{if(t&&t.type===`number`){var n=1/0,r=Array.from(Ox(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;si,(e,t,n,r,i)=>{if(!U(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=me(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),SS=(e,t,n)=>{var r=tx(e,t);return r==null||typeof r.padding!=`string`?0:xS(e,`xAxis`,t,n,r.padding)},CS=(e,t,n)=>{var r=rx(e,t);return r==null||typeof r.padding!=`string`?0:xS(e,`yAxis`,t,n,r.padding)},wS=B(tx,SS,(e,t)=>{if(e==null)return{left:0,right:0};var n=e.padding;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),TS=B(rx,CS,(e,t)=>{if(e==null)return{top:0,bottom:0};var n=e.padding;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),ES=B([Ec,wS,Mc,jc,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),DS=B([Ec,G,TS,Mc,jc,(e,t,n)=>n],(e,t,n,r,i,a)=>{var o=i.padding;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),OS=(e,t,n,r)=>{switch(t){case`xAxis`:return ES(e,n,r);case`yAxis`:return DS(e,n,r);case`zAxis`:return ax(e,n)?.range;case`angleAxis`:return Bm(e);case`radiusAxis`:return Vm(e,n);default:return}},kS=B([ox,OS],Tm),AS=B([ox,gS,B([gS,bS],eh),kS],Fb),jS=(e,t,n,r)=>{if(n!=null&&n.dataKey!=null){var i=n.type,a=n.scale;if(Js(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},MS=B([G,Tx,cx,Um],jS),NS=B([AS],$m);B([AS],Vb),B([AS,Ax],Bb),B([mx,Ux,Um],Wx);function PS(e,t){return e.idt.id)}var FS=(e,t)=>t,IS=(e,t,n)=>n,LS=B(pc,FS,IS,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(PS)),RS=B(mc,FS,IS,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(PS)),zS=(e,t)=>{var n=typeof t.height==`number`?t.height:30;return{width:e.width,height:n}},BS=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),VS=B(Ec,tx,zS),HS=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},US=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},WS=B(uc,Ec,LS,FS,IS,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=zS(t,n);o??=HS(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),GS=B(lc,Ec,RS,FS,IS,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=BS(t,n);o??=US(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),KS=B([Ec,tx,(e,t)=>{var n=tx(e,t);if(n!=null)return WS(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),qS=B([Ec,rx,(e,t)=>{var n=rx(e,t);if(n!=null)return GS(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),JS=B(Ec,rx,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),YS=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,o=n.dataKey,s=Js(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&he(l))return c}},XS=B([G,Tx,ox,Um],YS);B([G,sx,gS,NS,XS,MS,OS,vS,Um],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=Js(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}});var ZS=B([G,cx,gS,NS,vS,OS,XS,MS,Um],(e,t,n,r,i,a,o,s,c)=>{if(t!=null&&r!=null){var l=Js(e,c),u=t.type,d=t.ticks,f=t.tickCount,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?ce(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return U(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(ye):l&&s?s.map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(ye):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(ye):r.domain().map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(ye)}}),QS=B([G,cx,NS,OS,XS,MS,Um],(e,t,n,r,i,a,o)=>{if(t!=null&&n!=null&&r!=null&&r[0]!==r[1]){var s=Js(e,o),c=t.tickCount,l=0;return l=o===`angleAxis`&&r?.length>=2?ce(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return U(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(ye):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return U(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(ye):n.domain().map((e,t)=>{var r=n.map(e);return U(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(ye)}}),$S=B(ox,NS,(e,t)=>{if(e!=null&&t!=null)return Ub(Ub({},e),{},{scale:t})});B((e,t,n)=>ax(e,n),B([B([ox,gS,hS,kS],Fb)],$m),(e,t)=>{if(e!=null&&t!=null)return Ub(Ub({},e),{},{scale:t})});var eC=B([G,pc,mc],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});B([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(e&&e.length!==0)return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);ae.options.defaultTooltipEventType,nC=e=>e.options.validateTooltipEventTypes;function rC(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function iC(e,t){return rC(t,tC(e),nC(e))}function aC(e){return z(t=>iC(t,e))}var oC=(e,t)=>{var n,r=Number(t);if(!(le(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},sC=e=>e.tooltip.settings,cC={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},lC=Go({name:`tooltip`,initialState:{itemInteraction:{click:cC,hover:cC},axisInteraction:{click:cC,hover:cC},keyboardInteraction:cC,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(V(t.payload))},prepare:H()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=_o(e).tooltipItemPayloads.indexOf(V(r));a>-1&&(e.tooltipItemPayloads[a]=V(i))},prepare:H()},removeTooltipEntrySettings:{reducer(e,t){var n=_o(e).tooltipItemPayloads.indexOf(V(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:H()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),uC=lC.actions,dC=uC.addTooltipEntrySettings,fC=uC.replaceTooltipEntrySettings,pC=uC.removeTooltipEntrySettings,mC=uC.setTooltipSettingsState,hC=uC.setActiveMouseOverItemIndex;uC.mouseLeaveItem;var gC=uC.mouseLeaveChart;uC.setActiveClickItemIndex;var _C=uC.setMouseOverAxisIndex,vC=uC.setMouseClickAxisIndex,yC=uC.setSyncInteraction,bC=uC.setKeyboardInteraction,xC=lC.reducer;function SC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CC(e){for(var t=1;t{if(t==null)return cC;var i=DC(e,t,n);if(i==null)return cC;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(OC(i)){if(a)return CC(CC({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return CC(CC({},cC),{},{coordinate:i.coordinate})};function AC(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function jC(e,t){var n=AC(e),r=t[0],i=t[1];return n!==void 0&&n>=Math.min(r,i)&&n<=Math.max(r,i)}function MC(e,t,n){if(n==null||t==null)return!0;var r=W(e,t);return r==null||!Yp(n)||jC(r,n)}var NC=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!U(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||MC(l,n,r)?String(c):null},PC=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},FC=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},IC=e=>e.options.tooltipPayloadSearcher,LC=e=>e.tooltip;function RC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zC(e){for(var t=1;te(t)}function KC(e){if(typeof e==`string`)return e}function qC(e){if(typeof e==`object`&&e)return{name:`name`in e?UC(e.name):void 0,unit:`unit`in e?WC(e.unit):void 0,dataKey:`dataKey`in e?GC(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?KC(e.color):void 0,fill:`fill`in e?KC(e.fill):void 0}}function JC(e,t){return e??t}var YC=(e,t,n,r,i,a,o)=>{if(t!=null&&a!=null){var s=n.chartData,c=n.computedData,l=n.dataStartIndex,u=n.dataEndIndex;return e.reduce((e,n)=>{var d=n.dataDefinedOnItem,f=n.settings,p=JC(d,s),m=Array.isArray(p)?Bs(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_;return r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?(_=_e(m,r,i),_??=a(m,t,c,g)):_=a(m,t,c,g),Array.isArray(_)?_.forEach(t=>{var n=qC(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=zC(zC({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(ac({tooltipEntrySettings:o,dataKey:i,payload:a,value:W(a,i),name:r==null?void 0:String(r)}))}):e.push(ac({tooltipEntrySettings:f,dataKey:h,payload:_,value:W(_,h),name:W(_,g)??f?.name})),e},[])}},XC=B([Z,lx,_m],Rb),ZC=B([B([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Z,B([Zm,Qm],ux)],px,{memoizeOptions:{resultEqualityCheck:Ym}}),QC=B([ZC],e=>e.filter(qm)),$C=B([ZC],vx,{memoizeOptions:{resultEqualityCheck:Ym}}),ew=B([ZC],e=>e.some(e=>!e.data)),tw=B([$C,Lp],xx),nw=B([QC,Lp,Z],Km),rw=B([tw,Z,ZC,Lp,ew,$C],wx),iw=B([Z],zx),aw=B([iw,B([Z],e=>e.allowDataOverflow)],Zp),ow=B([B([nw,B([ZC],e=>e.filter(qm)),hm,gm],Fx),Lp,Zm,aw],Lx),sw=B([tw,Z,B([ZC],gx),Ux,Zm,Hp],Kx,{memoizeOptions:{resultEqualityCheck:Jm}}),cw=B([B([Xx,Zm,Qm],Zx),Zm],rS),lw=B([B([$x,Zm,Qm],Zx),Zm],aS),uw=B([Z,G,tw,rw,hm,Zm,B([Z,iw,aw,ow,sw,B([cw,B([B([tS,Zm,Qm],Zx),Zm],lS),lw],Gx),G,Zm],dS)],mS),dw=B([Z,uw,B([uw,Z,XC],_S),Zm],yS),fw=e=>OS(e,Zm(e),Qm(e),!1),pw=B([Z,fw],Tm),mw=B([B([Z,XC,dw,pw],Fb)],$m),hw=B([G,Z,XC,mw,fw,B([G,rw,Z,Zm],YS),B([G,rw,Z,Zm],jS),Zm],(e,t,n,r,i,a,o,s)=>{if(t){var c=t.type,l=Js(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?ce(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(ye):r.domain().map((e,t)=>{var n=r.map(e);return U(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(ye)}}}),gw=B([tC,nC,sC],(e,t,n)=>rC(n.shared,e,t)),_w=e=>e.tooltip.settings.trigger,vw=e=>e.tooltip.settings.defaultIndex,yw=B([LC,gw,_w,vw],kC),bw=B([yw,tw,Nx,uw],NC),xw=B([hw,bw],oC),Sw=B([yw],e=>{if(e)return e.dataKey}),Cw=B([yw],e=>{if(e)return e.graphicalItemId}),ww=B([LC,gw,_w,vw],FC),Tw=B([yw,B([lc,uc,G,Ec,hw,vw,ww],PC)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Ew=B([yw],e=>e?.active??!1),Dw=B([B([ww,bw,Lp,Nx,xw,IC,gw],YC)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function Ow(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kw(e){for(var t=1;tz(Z),Pw=()=>{var e=Nw(),t=z(hw),n=z(mw);return ic(!e||!n?void 0:kw(kw({},e),{},{scale:n}),t)};function Fw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Iw(e){for(var t=1;t{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Vw=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,o=r.radius;return Iw(Iw(Iw({},r),up(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Iw(Iw(Iw({},r),up(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Hw(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var Uw=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=i[1]-i[0],s=(t,n,r)=>[e,e+o,e-o].some(e=>(r?e>=t:e>t)&&e<=n),c=0;c0?n[c-1]?.coordinate:n[a-1]?.coordinate,u=n[c]?.coordinate,d=c>=a-1?n[0]?.coordinate:n[c+1]?.coordinate,f=void 0;if(l!=null&&u!=null&&d!=null){if(ce(u-l)!==ce(d-u)){var p=[];if(ce(d-u)===ce(i[1]-i[0])){f=d;var m=u+i[1]-i[0];p[0]=Math.min(m,(m+l)/2),p[1]=Math.max(m,(m+l)/2)}else{f=l;var h=d+i[1]-i[0];p[0]=Math.min(u,(h+u)/2),p[1]=Math.max(u,(h+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(s(g[0],g[1],!1)||s(p[0],p[1],!0))return n[c]?.index}else{var _=Math.min(l,d),v=Math.max(l,d);if(s((_+u)/2,(v+u)/2,!1))return n[c]?.index}}}else if(t)for(var y=0;y(b.coordinate+S.coordinate)/2||y>0&&y(b.coordinate+S.coordinate)/2&&e<=(b.coordinate+x.coordinate)/2)return b.index}}return-1},Ww=()=>z(_m),Gw=(e,t)=>t,Kw=(e,t,n)=>n,qw=(e,t,n,r)=>r,Jw=B(hw,e=>Ti(e,e=>e.coordinate)),Yw=B([LC,Gw,Kw,qw],kC),Xw=B([Yw,tw,Nx,uw],NC),Zw=(e,t,n)=>{if(t!=null){var r=LC(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},Qw=B([LC,Gw,Kw,qw],FC),$w=B([lc,uc,G,Ec,hw,qw,Qw],PC),eT=B([Yw,$w],(e,t)=>e.coordinate??t),tT=B([hw,Xw],oC),nT=B([Qw,Xw,Lp,Nx,tT,IC,Gw],YC),rT=B([Yw,Xw],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),iT=(e,t,n,r,i,a,o)=>{if(e&&n&&r&&i&&Hw(e,o)){var s=Uw(sc(e,t),a,i,n,r),c=Bw(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},aT=(e,t,n,r,i,a,o)=>{if(e&&r&&i&&a&&n){var s=gp(e,n);if(s){var c=Uw(cc(s,t),o,a,r,i),l=Vw(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},oT=(e,t,n,r,i,a,o,s)=>{if(e&&t&&r&&i&&a)return t===`horizontal`||t===`vertical`?iT(e,t,r,i,a,o,s):aT(e,t,n,r,i,a,o)},sT=B(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),cT=B(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(Sm));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:Xm}});function lT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uT(e){for(var t=1;tuT(uT({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},hT=new Set(Object.values(Sm));function gT(e){return hT.has(e)}var _T=Go({name:`zIndex`,initialState:mT,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:H()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!gT(n)&&delete e.zIndexMap[n])},prepare:H()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=V(i):e.zIndexMap[r].element=V(i):e.zIndexMap[r]={consumers:0,element:a?void 0:V(i),panoramaElement:a?V(i):void 0}},prepare:H()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:H()}}}),vT=_T.actions,yT=vT.registerZIndexPortal,bT=vT.unregisterZIndexPortal,xT=vT.registerZIndexPortalElement,ST=vT.unregisterZIndexPortalElement,CT=_T.reducer;function wT(e){var t=e.zIndex,n=e.children,r=xl()&&t!==void 0&&t!==0,i=Ac(),a=(0,f.useRef)(void 0),o=(0,f.useRef)(new Set),s=R(),c=z(e=>sT(e,t,i));if((0,f.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(bT({zIndex:e}))}),e.clear(),a.current=void 0}else if(o.current.has(t)||(s(yT({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(bT({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,f.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(bT({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,Ql.createPortal)(n,l):null}function TT(){return TT=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,f.useContext)(PT),IT=n(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!le(n))return e[n]}},VT=Go({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),HT=VT.reducer,UT=VT.actions.createEventEmitter;function WT(e){return e.tooltip.syncInteraction}var GT=Go({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){e.chartData=V(t.payload),t.payload==null?(e.dataStartIndex=0,e.dataEndIndex=0):t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),KT=GT.actions,qT=KT.setChartData,JT=KT.setDataStartEndIndexes;KT.setComputedData;var YT=GT.reducer,XT=[`x`,`y`];function ZT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QT(e){for(var t=1;te.rootProps.className);(0,f.useEffect)(()=>{if(e==null)return be;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1)n(yC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));else if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,f=d.x,p=d.y,m=nE(d,XT),h=c.payload.sourceViewBox,g=h.x,_=h.y,v=h.width,y=h.height,b=QT(QT({},m),{},{x:o.x+(v?(f-g)/v:0)*o.width,y:o.y+(y?(p-_)/y:0)*o.height});n(QT(QT({},c),{},{payload:QT(QT({},c.payload),{},{coordinate:b})}))}else n(c)}else if(i!=null){var x;typeof r==`function`?x=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(x=i.find(e=>String(e.value)===c.payload.label));var S=c.payload.coordinate;if(S==null||o==null)n(yC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));else if(x==null)n(yC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));else{var C=S.x,w=S.y,T=Math.min(C,o.x+o.width),E=Math.min(w,o.y+o.height),D={x:a===`horizontal`?x.coordinate:T,y:a===`horizontal`?E:x.coordinate};n(yC({active:c.payload.active,coordinate:D,dataKey:c.payload.dataKey,index:String(x.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}}};return LT.on(RT,s),()=>{LT.off(RT,s)}},[s,n,t,e,r,i,a,o])}function aE(){var e=z(vm),t=z(bm),n=R();(0,f.useEffect)(()=>{if(e==null)return be;var r=(r,i,a)=>{t!==a&&e===r&&n(JT(i))};return LT.on(zT,r),()=>{LT.off(zT,r)}},[n,t,e])}function oE(){var e=R();(0,f.useEffect)(()=>{e(UT())},[e]),iE(),aE()}function sE(e,t,n,r,i,a){var o=z(n=>Zw(n,e,t)),s=z(Cw),c=z(bm),l=z(vm),u=z(ym),d=z(WT)?.sourceViewBox!=null,p=fl();(0,f.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=yC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:p,graphicalItemId:s});LT.emit(RT,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,p])}function cE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lE(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{S(mC({shared:_,trigger:v,axisId:x,active:n,defaultIndex:C}))},[S,_,v,x,n,C]);var w=fl(),T=gd(),E=aC(_),D=z(e=>rT(e,E,v,C))??{},O=D.activeIndex,k=D.isActive,A=z(e=>nT(e,E,v,C)),j=z(e=>tT(e,E,v,C)),M=z(e=>eT(e,E,v,C)),N=A,ee=FT(),te=n??k??!1,ne=pE(zi([N,te]),2),re=ne[0],ie=ne[1],ae=E===`axis`?j:void 0;sE(E,v,M,ae,O,te);var oe=b??ee;if(oe==null||w==null||E==null)return null;var se=N??xE;te||(se=xE),s&&se.length&&(se=qr(se.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,yE));var P=se.length>0,ce=lE(lE({},t),{},{payload:se,label:ae,active:te,activeIndex:O,coordinate:M,accessibilityLayer:T}),le=f.createElement(hd,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:te,coordinate:M,hasPayload:P,offset:l,position:d,reverseDirection:p,useTranslate3d:m,viewBox:w,wrapperStyle:h,lastBoundingBox:re,innerRef:ie,hasPortalFromProps:!!b},bE(o,ce));return f.createElement(f.Fragment,null,(0,Ql.createPortal)(le,oe),te&&f.createElement(NT,{cursor:g,tooltipEventType:E,coordinate:M,payload:se,index:O}))}function wE(e,t,n){return(t=TE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TE(e){var t=EE(e,`string`);return typeof t==`symbol`?t:t+``}function EE(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var DE=class{constructor(e){wE(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function OE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kE(e){for(var t=1;t{try{var n=document.getElementById(IE);n||(n=document.createElement(`span`),n.setAttribute(`id`,IE),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,FE,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},zE=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Ju.isSsr)return{width:0,height:0};if(!NE.enableCache)return RE(e,t);var n=LE(e,t),r=PE.get(n);if(r)return r;var i=RE(e,t);return PE.set(n,i),i},BE;function VE(e,t){return KE(e)||GE(e,t)||UE(e,t)||HE()}function HE(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UE(e,t){if(e){if(typeof e==`string`)return WE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WE(e,t):void 0}}function WE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return I(t)||(i=n?t.toString().split(``):t.toString().split(CD)),{wordsWithComputedWidth:i.map(e=>({word:e,width:zE(e,r).width})),spaceWidth:n?0:zE(`\xA0`,r).width}}catch{return null}};function TD(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function ED(e){return I(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var DD=(e,t,n,r)=>e.reduce((e,i)=>{var a=i.word,o=i.width,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+ne.reduce((e,t)=>e.width>t.width?e:t),kD=`…`,AD=(e,t,n,r,i,a,o,s)=>{var c=wD({breakAll:n,style:r,children:e.slice(0,t)+kD});if(!c)return[!1,[]];var l=DD(c.wordsWithComputedWidth,a,o,s);return[l.length>i||OD(l).width>Number(a),l]},jD=(e,t,n,r,i)=>{var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=F(a),u=String(o),d=DD(t,r,n,i);if(!l||i||!(d.length>a||OD(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),_=_D(AD(u,g-1,c,s,a,r,n,i),2),v=_[0],y=_[1],b=_D(AD(u,g,c,s,a,r,n,i),1)[0];if(!v&&!b&&(f=g+1),v&&b&&(p=g-1),!v&&b){h=y;break}m++}return h||d},MD=e=>[{words:I(e)?[]:e.toString().split(CD),width:void 0}],ND=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!Ju.isSsr){var s,c,l=wD({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return MD(r);return jD({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return MD(r)},PD=`#808080`,FD={angle:0,breakAll:!1,capHeight:`0.71em`,fill:PD,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},ID=(0,f.forwardRef)((e,t)=>{var n=Tn(e,FD),r=n.x,i=n.y,a=n.lineHeight,o=n.capHeight,s=n.fill,c=n.scaleToFit,u=n.textAnchor,d=n.verticalAnchor,p=hD(n,fD),m=(0,f.useMemo)(()=>ND({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:c,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,c,p.style,p.width]),h=p.dx,g=p.dy,_=p.angle,y=p.className,b=p.breakAll,x=hD(p,pD);if(!de(r)||!de(i)||m.length===0)return null;var S=Number(r)+(F(h)?h:0),C=Number(i)+(F(g)?g:0);if(!U(S)||!U(C))return null;var w;switch(d){case`start`:w=dD(`calc(${o})`);break;case`middle`:w=dD(`calc(${(m.length-1)/2} * -${a} + (${o} / 2))`);break;default:w=dD(`calc(${m.length-1} * -${a})`)}var T=[],E=m[0];if(c&&E!=null){var D=E.width,O=p.width;T.push(`scale(${F(O)&&F(D)?O/D:1})`)}return _&&T.push(`rotate(${_}, ${S}, ${C})`),T.length&&(x.transform=T.join(` `)),f.createElement(`text`,mD({},v(x),{ref:t,x:S,y:C,className:l(`recharts-text`,y),textAnchor:u,fill:s.includes(`url`)?PD:s}),m.map((e,t)=>{var n=e.words.join(b?``:` `);return f.createElement(`tspan`,{x:S,dy:t===0?w:a,key:`${n}-${t}`},n)}))});ID.displayName=`Text`;var LD=[`labelRef`],RD=[`content`];function zD(e,t){if(e==null)return{};var n,r,i=BD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,s=e.children,c=(0,f.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return f.createElement(qD.Provider,{value:c},s)},YD=()=>{var e=(0,f.useContext)(qD),t=fl();return e||(t?xe(t):void 0)},XD=(0,f.createContext)(null),ZD=()=>{var e=(0,f.useContext)(XD),t=z(Hm);return e||t},QD=e=>{var t=e.value,n=e.formatter,r=I(e.children)?t:e.children;return typeof n==`function`?n(r):r},$D=e=>e!=null&&typeof e==`function`,eO=(e,t)=>ce(t-e)*Math.min(Math.abs(t-e),360),tO=(e,t,n,r,i)=>{var a=e.offset,o=e.className,s=i.cx,c=i.cy,u=i.innerRadius,d=i.outerRadius,p=i.startAngle,m=i.endAngle,h=i.clockWise,g=(u+d)/2,_=eO(p,m),v=_>=0?1:-1,y,b;switch(t){case`insideStart`:y=p+v*a,b=h;break;case`insideEnd`:y=m-v*a,b=!h;break;case`end`:y=m+v*a,b=h;break;default:throw Error(`Unsupported position ${t}`)}b=_<=0?b:!b;var x=up(s,c,g,y),S=up(s,c,g,y+(b?1:-1)*359),C=`M${x.x},${x.y} - A${g},${g},0,1,${+!b}, - ${S.x},${S.y}`,w=I(e.id)?pe(`recharts-radial-line-`):e.id;return f.createElement(`text`,KD({},r,{dominantBaseline:`central`,className:l(`recharts-radial-bar-label`,o)}),f.createElement(`defs`,null,f.createElement(`path`,{id:w,d:C})),f.createElement(`textPath`,{xlinkHref:`#${w}`},n))},nO=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,s=(e.startAngle+e.endAngle)/2;if(n===`outside`){var c=up(r,i,o+t,s),l=c.x;return{x:l,y:c.y,textAnchor:l>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var u=up(r,i,(a+o)/2,s);return{x:u.x,y:u.y,textAnchor:`middle`,verticalAnchor:`middle`}},rO=e=>e!=null&&`cx`in e&&F(e.cx),iO={angle:0,offset:5,zIndex:Sm.label,position:`middle`,textBreakAll:!1};function aO(e){if(!rO(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function oO(e){var t=Tn(e,iO),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,o=t.children,s=t.content,c=t.className,u=c===void 0?``:c,d=t.textBreakAll,p=t.labelRef,m=ZD(),h=YD(),g=n==null?i===`center`?h:m??h:rO(n)?n:xe(n),_,y,b=aO(g);if(!g||I(a)&&I(o)&&!(0,f.isValidElement)(s)&&typeof s!=`function`)return null;var x=rO(g)&&(i===`insideStart`||i===`insideEnd`||i===`end`);if(rO(g))x||(y=nO(g,t.offset,t.position));else if(b){var S=De({viewBox:b,position:i,offset:t.offset,parentViewBox:rO(r)?void 0:r,clamp:!0});y=HD(HD({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width===void 0?{}:{width:S.width}),S.height===void 0?{}:{height:S.height})}var C=HD(HD(HD(HD({},y?.x===void 0?{}:{x:y.x}),y?.y===void 0?{}:{y:y.y}),t),{},{viewBox:g});if((0,f.isValidElement)(s)){C.labelRef;var w=zD(C,LD);return(0,f.cloneElement)(s,w)}if(typeof s==`function`){C.content;var T=zD(C,RD);if(_=(0,f.createElement)(s,T),(0,f.isValidElement)(_))return _}else _=QD(t);var E=v(t);return x&&rO(g)?tO(t,i,_,E,g):y==null?null:f.createElement(wT,{zIndex:t.zIndex},f.createElement(ID,KD({ref:p,className:l(`recharts-label`,u)},E,y,{textAnchor:TD(E.textAnchor)?E.textAnchor:y.textAnchor,breakAll:d}),_))}oO.displayName=`Label`;var sO=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?f.createElement(oO,KD({key:`label-implicit`},r)):de(e)?f.createElement(oO,KD({key:`label-implicit`,value:e},r)):(0,f.isValidElement)(e)?e.type===oO?(0,f.cloneElement)(e,HD({key:`label-implicit`},r)):f.createElement(oO,KD({key:`label-implicit`,content:e},r)):$D(e)?f.createElement(oO,KD({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?f.createElement(oO,KD({},e,{key:`label-implicit`},r)):null};function cO(e){var t=e.label,n=e.labelRef;return sO(t,YD(),n)||null}var lO=[`valueAccessor`],uO=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function dO(){return dO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(ED(t))return t},hO=(0,f.createContext)(void 0),gO=hO.Provider,_O=(0,f.createContext)(void 0);_O.Provider;function vO(){return(0,f.useContext)(hO)}function yO(){return(0,f.useContext)(_O)}function bO(e){var t=e.valueAccessor,n=t===void 0?mO:t,r=fO(e,lO),i=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,s=r.zIndex,c=fO(r,uO),l=vO(),u=yO(),d=l||u;return!d||!d.length?null:f.createElement(wT,{zIndex:s??Sm.label},f.createElement(k,{className:`recharts-label-list`},d.map((e,t)=>{var s=I(i)?n(e,t):W(e.payload,i),l=I(a)?{}:{id:`${a}-${t}`};return f.createElement(oO,dO({key:`label-${t}`},v(e),c,l,{fill:r.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:t,zIndex:0}))})))}bO.displayName=`LabelList`;function xO(e){var t=e.label;return t?t===!0?f.createElement(bO,{key:`labelList-implicit`}):f.isValidElement(t)||$D(t)?f.createElement(bO,{key:`labelList-implicit`,content:t}):typeof t==`object`?f.createElement(bO,dO({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}function SO(){return SO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=l(`recharts-dot`,i);return F(t)&&F(n)&&F(r)?f.createElement(`circle`,SO({},g(e),_n(e),{className:a,cx:t,cy:n,r})):null},wO=Go({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=V(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=V(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),TO=wO.actions;TO.addRadiusAxis,TO.removeRadiusAxis,TO.addAngleAxis,TO.removeAngleAxis;var EO=wO.reducer;function DO(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var OO=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0;function kO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AO(e){for(var t=1;t{r||(i.current===null?n(dC(t)):i.current!==t&&n(fC({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,f.useLayoutEffect)(()=>()=>{i.current&&=(n(pC(i.current)),null)},[n]),null}function VO(e){var t=e.legendPayload,n=R(),r=Ac(),i=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{r||(i.current===null?n(Dl(t)):i.current!==t&&n(Ol({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,f.useLayoutEffect)(()=>()=>{i.current&&=(n(kl(i.current)),null)},[n]),null}function HO(e,t){return qO(e)||KO(e,t)||WO(e,t)||UO()}function UO(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WO(e,t){if(e){if(typeof e==`string`)return GO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?GO(e,t):void 0}}function GO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if(t.payload==null||typeof t.payload!=`object`)return null;var n=W(t.payload,e);return n==null?null:typeof n==`string`||typeof n==`number`?n:JSON.stringify(n)}}function XO(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:`removed`,prev:i});for(var a=0;ae[Math.floor(r*n)]),t)}function QO(e,t){return XO(t.map((t,n)=>e[n]),t)}function $O(e,t){for(var n=new Map,r=0;r{var a=n(e,t);if(a!=null){var o=r.get(a);if(o!==void 0)return i.add(a),o}}),o=[];for(var s of r){var c=HO(s,2),l=c[0],u=c[1];i.has(l)||o.push(u)}return XO(a,t,o)}function tk(e,t,n){return t==null?null:e==null?t.map(e=>({status:`added`,next:e})):n===`index`?ZO(e,t):n===`append`?QO(e,t):ek(e,t,n)}function nk(e,t){var n=(0,f.useRef)(e),r=(0,f.useRef)(t.current),i=(0,f.useRef)(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=(0,f.useCallback)(function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;n===0?i.current=!0:(n===1&&(r.current=e),n>0&&i.current&&a&&(t.current=e))},[t]);return{startValue:r.current,syncStepValue:a}}function rk(e,t){return ck(e)||sk(e,t)||ak(e,t)||ik()}function ik(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ak(e,t){if(e){if(typeof e==`string`)return ok(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ok(e,t):void 0}}function ok(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{typeof e==`function`&&e(),i(!0)},[e]),handleAnimationEnd:(0,f.useCallback)(()=>{typeof t==`function`&&t(),i(!1)},[t])}}function uk(e){var t=e.animationInput,n=e.animationIdPrefix,r=e.items,i=e.previousItemsRef,a=e.isAnimationActive,o=e.animationBegin,s=e.animationDuration,c=e.animationEasing,l=e.onAnimationStart,u=e.onAnimationEnd,d=e.animationInterpolateFn,p=e.animationMatchBy,m=e.shouldUpdatePreviousRef,h=e.children,g=e.layout,_=wf(t,n),v=nk(_,i),y=v.startValue??null,b=tk(y,r,p??JO);return f.createElement(Cf,{animationId:_,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:u,onAnimationStart:l,key:_},e=>{var t=y==null,n=r==null?r:d(b,e,g),i=m?m(e):e>0;return v.syncStepValue(n,e,i),n==null?null:h(n,e,t)})}function dk(e,t){return gk(e)||hk(e,t)||pk(e,t)||fk()}function fk(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pk(e,t){if(e){if(typeof e==`string`)return mk(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mk(e,t):void 0}}function mk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ndk(f.useState(()=>pe(`uid-`)),1)[0]);function vk(e,t){var n=_k();return t||(e?`${e}-${n}`:n)}var yk=(0,f.createContext)(void 0),bk=e=>{var t=e.id,n=e.type,r=e.children,i=vk(`recharts-${n}`,t);return f.createElement(yk.Provider,{value:i},r(i))},xk=Go({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(V(t.payload))},prepare:H()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=_o(e).cartesianItems.indexOf(V(r));a>-1&&(e.cartesianItems[a]=V(i))},prepare:H()},removeCartesianGraphicalItem:{reducer(e,t){var n=_o(e).cartesianItems.indexOf(V(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:H()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(V(t.payload))},prepare:H()},removePolarGraphicalItem:{reducer(e,t){var n=_o(e).polarItems.indexOf(V(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:H()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=_o(e).polarItems.indexOf(V(r));a>-1&&(e.polarItems[a]=V(i))},prepare:H()}}}),Sk=xk.actions,Ck=Sk.addCartesianGraphicalItem,wk=Sk.replaceCartesianGraphicalItem,Tk=Sk.removeCartesianGraphicalItem;Sk.addPolarGraphicalItem,Sk.removePolarGraphicalItem,Sk.replacePolarGraphicalItem;var Ek=xk.reducer,Dk=(0,f.memo)(e=>{var t=R(),n=(0,f.useRef)(null);return(0,f.useLayoutEffect)(()=>{n.current===null?t(Ck(e)):n.current!==e&&t(wk({prev:n.current,next:e})),n.current=e},[t,e]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(Tk(n.current)),null)},[t]),null}),Ok=[`points`];function kk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ak(e){for(var t=1;t{var s=Ak(Ak(Ak({r:3},o),p),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return f.createElement(Lk,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),h={};return s&&c!=null&&(h.clipPath=`url(#clipPath-${d?``:`dots-`}${c})`),f.createElement(wT,{zIndex:u},f.createElement(k,Pk({className:r},h),m))}function Bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vk(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lc,uc],(e,t,n)=>{if(e&&t!=null&&n!=null)return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),rA=()=>z(nA),iA=()=>z(Dw);function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oA(e){for(var t=1;t{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s=oA(oA(oA({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),_(i)),_n(i)),c=(0,f.isValidElement)(i)?(0,f.cloneElement)(i,s):typeof i==`function`?i(s):f.createElement(CO,s);return f.createElement(k,{className:`recharts-active-dot`,clipPath:o},c)};function dA(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,s=o===void 0?Sm.activeDot:o,c=z(bw),l=iA();if(t==null||l==null)return null;var u=t.find(e=>l.includes(e.payload));return I(u)?null:f.createElement(wT,{zIndex:s},f.createElement(uA,{point:u,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var fA=e=>{var t=e.chartData,n=R(),r=Ac();return(0,f.useEffect)(()=>r?()=>{}:(n(qT(t)),()=>{n(qT(void 0))}),[t,n,r]),null},pA={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},mA=Go({name:`brush`,initialState:pA,reducers:{setBrushSettings(e,t){return t.payload==null?pA:t.payload}}});mA.actions.setBrushSettings;var hA=mA.reducer;function gA(e){return(e%180+180)%180}var _A=function(e){var t=e.width,n=e.height,r=gA(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=_o(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=_o(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(V(t.payload))},removeLine:(e,t)=>{var n=_o(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),yA=vA.actions;yA.addDot,yA.removeDot,yA.addArea,yA.removeArea,yA.addLine,yA.removeLine;var bA=vA.reducer;function xA(e,t){return EA(e)||TA(e,t)||CA(e,t)||SA()}function SA(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CA(e,t){if(e){if(typeof e==`string`)return wA(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wA(e,t):void 0}}function wA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.children,n=xA((0,f.useState)(`${pe(`recharts`)}-clip`),1)[0],r=rA();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return f.createElement(DA.Provider,{value:n},f.createElement(`defs`,null,f.createElement(`clipPath`,{id:n},f.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function kA(){}function AA(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:Object.prototype.toString.call(e)===`[object Object]`}function jA(e,t,n){return MA(e,t,void 0,void 0,void 0,void 0,n)}function MA(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return NA(e,t,a,o)}return NA(e,t,a,o)}function NA(e,t,n,r){if(Object.is(e,t))return!0;let i=qn(e),a=qn(t);if(i===`[object Arguments]`&&(i=or),a===`[object Arguments]`&&(a=or),i!==a)return!1;switch(i){case Yn:return e.toString()===t.toString();case Xn:return Dr(e.valueOf(),t.valueOf());case Zn:case er:case $n:return Object.is(e.valueOf(),t.valueOf());case Jn:return e.source===t.source&&e.flags===t.flags;case ir:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case tr:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!MA(a,t.get(i),i,e,t,n,r))return!1;return!0;case nr:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;oMA(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case rr:case lr:case ur:case dr:case fr:case pr:case mr:case hr:case gr:case _r:case vr:case yr:if(xr(e)!==xr(t)||e.length!==t.length)return!1;for(let i=0;ie*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function zA(e,t){return FA(e,t+1)}function BA(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:FA(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||RA(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function VA(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var o=t.start,s=t.end,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||RA(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=UA(UA({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=UA(UA({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&RA(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=UA(UA({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function JA(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=UA(UA({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&RA(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=UA(UA({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=UA(UA({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=UA(UA({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&RA(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=UA(UA({},a),{},{isShow:!0}))},h=0;h{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?IA(zE(i,{fontSize:t,letterSpacing:n}),m,d):zE(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?ce(_.coordinate-g.coordinate):1,y=LA(a,v,p);return c===`equidistantPreserveStart`?BA(v,y,h,i,o):c===`equidistantPreserveEnd`?VA(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?JA(v,y,h,i,o,c===`preserveStartEnd`):qA(v,y,h,i,o),f.filter(e=>e.isShow))}var XA=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r===void 0?5:r,a=e.tickSize,o=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,l=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>l&&(l=t.width)}});var u=n?n.getBoundingClientRect().width:0,d=o+c,f=l+d+u+(n?i:0);return Math.round(f)}return 0},ZA=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r===void 0?5:r,a=e.tickSize,o=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,l=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.height>l&&(l=t.height)}});var u=n?n.getBoundingClientRect().height:0,d=o+c,f=l+d+u+(n?i:0);return Math.round(f)}return 0},QA=Go({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=V(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),$A=QA.actions,ej=$A.setRenderedTicks,tj=$A.removeRenderedTicks,nj=QA.reducer,rj=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function ij(e,t){return lj(e)||cj(e,t)||oj(e,t)||aj()}function aj(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oj(e,t){if(e){if(typeof e==`string`)return sj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sj(e,t):void 0}}function sj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if(r!=null&&n!=null){var e=t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),o=a.current;o!=null&&o.axisId===r&&o.axisType===n&&PA(o.ticks,e)||(a.current={ticks:e,axisId:r,axisType:n},i(ej({ticks:e,axisId:r,axisType:n})))}},[i,t,r,n]),(0,f.useEffect)(()=>r==null||n==null?be:()=>{i(tj({axisId:r,axisType:n}))},[i,r,n]),null}var wj=(0,f.forwardRef)((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,o=e.stroke,s=e.tickFormatter,c=e.unit,u=e.padding,d=e.tickTextProps,p=e.orientation,m=e.mirror,h=e.x,v=e.y,y=e.width,b=e.height,x=e.tickSize,S=e.tickMargin,C=e.fontSize,w=e.letterSpacing,T=e.getTicksConfig,E=e.events,D=e.axisType,O=e.axisId,A=YA(Q(Q({},T),{},{ticks:r}),C,w),j=g(T),M=_(i),N=TD(j.textAnchor)?j.textAnchor:bj(p,m),ee=xj(p,m),te={};typeof a==`object`&&(te=a);var ne=Q(Q({},j),{},{fill:`none`},te),re=A.map(e=>Q({entry:e},yj(e,h,v,y,b,p,x,m,S))),ae=re.map(e=>{var t=e.entry,n=e.line;return f.createElement(k,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},a&&f.createElement(`line`,fj({},ne,n,{className:l(`recharts-cartesian-axis-tick-line`,ie(a,`className`))})))}),oe=re.map((e,t)=>{var n=e.entry,r=e.tick,a=Q(Q({},Q(Q(Q(Q({verticalAnchor:ee},j),{},{textAnchor:N,stroke:`none`,fill:o},r),{},{index:t,payload:n,visibleTicksCount:A.length,tickFormatter:s,padding:u},d),{},{angle:d?.angle??j.angle??0})),M);return f.createElement(k,fj({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},yn(E,n,t)),i&&f.createElement(Sj,{option:i,tickProps:a,value:`${typeof s==`function`?s(n.value,t):n.value}${c||``}`}))});return f.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${D}-ticks`},f.createElement(Cj,{ticks:A,axisId:O,axisType:D}),oe.length>0&&f.createElement(wT,{zIndex:Sm.label},f.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${D}-tick-labels`,ref:t},oe)),ae.length>0&&f.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${D}-tick-lines`},ae))}),Tj=(0,f.forwardRef)((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,o=e.hide,s=e.ticks,c=e.axisType,u=e.axisId,d=uj(e,rj),p=ij((0,f.useState)(``),2),m=p[0],h=p[1],_=ij((0,f.useState)(``),2),v=_[0],y=_[1],b=(0,f.useRef)(null);(0,f.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>XA({ticks:b.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin}),getCalculatedHeight:()=>ZA({ticks:b.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var x=(0,f.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);b.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==m||a!==v)&&(h(i),y(a))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:f.createElement(wT,{zIndex:e.zIndex},f.createElement(k,{className:l(`recharts-cartesian-axis`,a)},f.createElement(vj,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:g(e)}),f.createElement(wj,{ref:x,axisType:c,events:d,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),f.createElement(JD,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},f.createElement(cO,{label:e.label,labelRef:e.labelRef}),e.children)))}),Ej=f.forwardRef((e,t)=>{var n=Tn(e,_j);return f.createElement(Tj,fj({},n,{ref:t}))});Ej.displayName=`CartesianAxis`;var Dj=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function Oj(){return Oj=Object.assign?Object.assign.bind():function(e){for(var t=1;te+t,0);if(!i)return Mj(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;co){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...Pj(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function Ij(e,t,n){return e?Fj(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Mj(t,n)}function Lj(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=kj(e,Dj),a=r??!1,o;if(t!=null){var s=i.pathRef;o=Ij(n,jj(s?.current??null),t)}else n!=null&&(o=String(n));return f.createElement(jd,Oj({},i,{connectNulls:a,strokeDasharray:o}))}function Rj(e){var t=(0,f.useRef)(0),n=(0,f.useRef)(0),r=(0,f.useRef)(!1),i=(0,f.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,f.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(se(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var zj=Go({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(e=>e.dataKey===i.dataKey&&e.direction===i.direction?a:e))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==i.dataKey||e.direction!==i.direction))}}}),Bj=zj.actions;Bj.addErrorBar,Bj.replaceErrorBar,Bj.removeErrorBar;var Vj=zj.reducer,Hj=[`children`];function Uj(e,t){if(e==null)return{};var n,r,i=Wj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0});function Kj(e){var t=e.children,n=Uj(e,Hj);return f.createElement(Gj.Provider,{value:n},t)}function qj(e,t){var n=z(t=>tx(t,e)),r=z(e=>rx(e,t)),i=n?.allowDataOverflow??Y.allowDataOverflow,a=r?.allowDataOverflow??X.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function Jj(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=rA(),a=qj(t,n),o=a.needClipX,s=a.needClipY,c=a.needClip,l=z(e=>ES(e,t,!1)),u=z(e=>DS(e,n,!1));if(!c||!i)return null;var d=i.x,p=i.y,m=i.width,h=i.height,g=o&&l?Math.min(l[0],l[1]):d-m/2,_=s&&u?Math.min(u[0],u[1]):p-h/2,v=o&&l?Math.abs(l[1]-l[0]):m*2,y=s&&u?Math.abs(u[1]-u[0]):h*2;return f.createElement(`clipPath`,{id:`clipPath-${r}`},f.createElement(`rect`,{x:g,y:_,width:v,height:y}))}var Yj=(e,t,n,r)=>$S(e,`xAxis`,t,r),Xj=(e,t,n,r)=>QS(e,`xAxis`,t,r),Zj=(e,t,n,r)=>$S(e,`yAxis`,n,r),Qj=(e,t,n,r)=>QS(e,`yAxis`,n,r),$j=B([G,Yj,Zj,Xj,Qj],(e,t,n,r,i)=>Js(e,`xAxis`)?ic(t,r,!1):ic(n,i,!1)),eM=(e,t,n,r,i)=>i;function tM(e){return e.type===`line`}var nM=B([G,Yj,Zj,Xj,Qj,B([dx,eM],(e,t)=>e.filter(tM).find(e=>e.id===t)),$j,zp],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return OM({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function rM(e){var t=_(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var iM=[`id`],aM=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],oM=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function sM(){return sM=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t/n:0}var _M={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=gM(e),r=[];for(var i of e)if(i.status===`matched`)r.push(dM(dM({},i.next),{},{x:ge(i.prev.x,i.next.x,t),y:ge(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(dM(dM({},i.next),{},{x:ge(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(dM(dM({},i.prev),{},{x:ge(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:JO,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:Lj,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Sm.line,type:`linear`},vM=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:oc(n,t),payload:e}]},yM=f.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,p={dataDefinedOnItem:n,getPosition:be,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:oc(o,t),hide:s,type:u,color:r,unit:c,formatter:l,graphicalItemId:d}};return f.createElement(BO,{tooltipEntrySettings:p})});function bM(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,o=r.needClip;r.id;var s=g(cM(r,iM));return f.createElement(zk,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:s,needClip:o,clipPathId:t})}function xM(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,f.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return dM(dM({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return f.createElement(gO,{value:t?i:void 0},n)}function SM(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,p=i.needClip,m=i.shape,h=i.strokeDasharray,g=dM(dM({},v(cM(i,aM))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:p?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:h??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return f.createElement(f.Fragment,null,r?.length>1&&f.createElement(zO,{option:m,DefaultShape:_M.shape,shapeProps:g}),f.createElement(bM,{points:r,clipPathId:t,props:i}))}function CM(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,p=n.layout,m=hM(r.current),h=lk(n.onAnimationStart,n.onAnimationEnd),g=h.isAnimating,_=h.handleAnimationStart,v=h.handleAnimationEnd,y=!g,b=Rj(a),x=(0,f.useCallback)(e=>e>0&&m>0,[m]);return f.createElement(xM,{points:a,showLabels:y},n.children,f.createElement(uk,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:_,onAnimationEnd:v,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:x,layout:p},(e,i,a)=>{var o=g||i<1,s=o?b(i,m):null;return f.createElement(SM,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),f.createElement(xO,{label:n.label}))}function wM(e){var t=e.clipPathId,n=e.props,r=(0,f.useRef)(null),i=(0,f.useRef)(null);return f.createElement(CM,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var TM=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:W(e.payload,t)}),EM=class extends f.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,c=e.left,u=e.width,d=e.height,p=e.id,m=e.needClip,h=e.zIndex;if(t)return null;var g=l(`recharts-line`,i),_=p,v=rM(n),y=v.r,b=v.strokeWidth,x=OO(n),S=y*2+b,C=m?`url(#clipPath-${x?``:`dots-`}${_})`:void 0;return f.createElement(wT,{zIndex:h},f.createElement(k,{className:g},m&&f.createElement(`defs`,null,f.createElement(Jj,{clipPathId:_,xAxisId:a,yAxisId:o}),!x&&f.createElement(`clipPath`,{id:`clipPath-dots-${_}`},f.createElement(`rect`,{x:c-S/2,y:s-S/2,width:u+S,height:d+S}))),f.createElement(Kj,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:TM,errorBarOffset:0},f.createElement(wM,{props:this.props,clipPathId:_}))),f.createElement(dA,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:C}))}};function DM(e){var t=Tn(e,_M),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,p=t.legendType,m=t.xAxisId,h=t.yAxisId,g=t.id,_=cM(t,oM),v=qj(m,h).needClip,y=rA(),b=vl(),x=Ac(),S=z(e=>nM(e,m,h,x,g));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,w=y.width,T=y.x,E=y.y;return f.createElement(EM,sM({},_,{id:g,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:p,xAxisId:m,yAxisId:h,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:v}))}function OM(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize;return e.displayedData.map((e,c)=>{var l=W(e,o);if(t===`horizontal`)return{x:Qs({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(I(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=I(l)?null:n.scale.map(l),d=Qs({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function kM(e){var t=Tn(e,_M),n=Ac();return f.createElement(bk,{id:t.id,type:`line`},e=>f.createElement(f.Fragment,null,f.createElement(VO,{legendPayload:vM(t)}),f.createElement(yM,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),f.createElement(Dk,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),f.createElement(DM,sM({},t,{id:e}))))}var AM=f.memo(kM,Yl);AM.displayName=`Line`;function jM(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function MM(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var NM=(e,t,n)=>$S(e,`xAxis`,jM(e,t),n),PM=(e,t,n)=>QS(e,`xAxis`,jM(e,t),n),FM=(e,t,n)=>$S(e,`yAxis`,MM(e,t),n),IM=(e,t,n)=>QS(e,`yAxis`,MM(e,t),n),LM=B([G,NM,FM,PM,IM],(e,t,n,r,i)=>Js(e,`xAxis`)?ic(t,r,!1):ic(n,i,!1)),RM=B([dx,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),zM=e=>Js(G(e),`xAxis`)?`yAxis`:`xAxis`,BM=(e,t)=>zM(e)===`yAxis`?MM(e,t):jM(e,t),VM=(e,t,n)=>Ix(e,zM(e),BM(e,t),n),HM=B([G,NM,FM,PM,IM,B([RM,VM],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=Gm(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Bp,LM,RM,xm,B([RM,VM],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(ye)}})],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return xN({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),UM=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],WM=[`id`,`baseLine`];function GM(){return GM=Object.assign?Object.assign.bind():function(e){for(var t=1;te.y||0));return F(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),F(c)?f.createElement(`rect`,{x:ae.x||0));return F(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),F(c)?f.createElement(`rect`,{x:0,y:ae==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[iN(iN({},e.next),{},{x:ge(e.prev.x,e.next.x,t),y:ge(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:ZM,xAxisId:0,yAxisId:0,zIndex:Sm.area};function lN(e,t){return e&&e!==`none`?e:t}var uN=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:lN(r,i),value:oc(n,t),payload:e}]},dN=f.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,p={dataDefinedOnItem:n,getPosition:be,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:oc(o,t),hide:s,type:u,color:lN(r,a),unit:c,formatter:l,graphicalItemId:d}};return f.createElement(BO,{tooltipEntrySettings:p})});function fN(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=g(r);return f.createElement(zk,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function pN(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return iN(iN({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return f.createElement(gO,{value:t?r:void 0},n)}function mN(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,p=a.connectNulls,m=a.isRange,h=a.shape,g=a.id,_=tN(a,QM),y=iN(iN({},v(_)),{},{id:g,points:t,connectNulls:p,type:u,baseLine:n,layout:l,stroke:d,isRange:m,animationElapsedTime:o,isAnimating:s,isEntrance:c});return f.createElement(f.Fragment,null,t?.length>1&&f.createElement(k,{clipPath:r?`url(#clipPath-${i})`:void 0},f.createElement(zO,{option:h,DefaultShape:cN.shape,shapeProps:y})),f.createElement(fN,{points:t,props:_,clipPathId:i}))}function hN(e,t,n){return F(e)?ge(F(t)?t:void 0,e,n):I(e)||le(e)?ge(F(t)?t:void 0,0,n):e}function gN(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,p=r.animationMatchBy,m=r.animationInterpolateFn,h=(0,f.useMemo)(()=>({points:o,baseLine:s}),[o,s]),g=nk(h,a),_=yl(),v=lk(r.onAnimationStart,r.onAnimationEnd),y=v.isAnimating,b=v.handleAnimationStart,x=v.handleAnimationEnd,S=g.startValue;if(_==null)return null;var C=Array.isArray(s)&&Array.isArray(S)?tk(S,s,p):Array.isArray(s)?tk(null,s,p):null;return f.createElement(uk,{animationInput:h,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:b,onAnimationEnd:x,animationInterpolateFn:m,animationMatchBy:p,layout:_},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?m(C,i,_):a?s:hN(s,S,i);return g.syncStepValue(c,i),f.createElement(pN,{showLabels:!y,points:o},r.children,f.createElement(mN,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:y||i<1,isEntrance:a}),f.createElement(xO,{label:r.label}))})}function _N(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,f.useRef)(null),a=(0,f.useRef)();return f.createElement(gN,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var vN=class extends f.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,u=e.yAxisId,d=e.width,p=e.height,m=e.id,h=e.baseLine,g=e.zIndex;if(t)return null;var _=l(`recharts-area`,i),v=m,y=rM(n),b=y.r,x=y.strokeWidth,S=OO(n),C=b*2+x,w=s?`url(#clipPath-${S?``:`dots-`}${v})`:void 0;return f.createElement(wT,{zIndex:g},f.createElement(k,{className:_},s&&f.createElement(`defs`,null,f.createElement(Jj,{clipPathId:v,xAxisId:c,yAxisId:u}),!S&&f.createElement(`clipPath`,{id:`clipPath-dots-${v}`},f.createElement(`rect`,{x:o-C/2,y:a-C/2,width:d+C,height:p+C}))),f.createElement(_N,{needClip:s,clipPathId:v,props:this.props})),f.createElement(dA,{points:r,mainColor:lN(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}),this.props.isRange&&Array.isArray(h)&&f.createElement(dA,{points:h,mainColor:lN(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}))}};function yN(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,p=e.stroke,m=e.xAxisId,h=e.yAxisId,g=tN(e,$M),_=vl(),v=Ww(),y=qj(m,h).needClip,b=Ac(),x=z(t=>HM(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=rA();if(_!==`horizontal`&&_!==`vertical`||T==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var E=T.height,D=T.width,O=T.x,k=T.y;return!S||!S.length?null:f.createElement(vN,eN({},g,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:_,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:p,width:D,left:O,top:k,xAxisId:m,yAxisId:h}))}var bN=(e,t,n,r,i)=>{var a=n??t;if(F(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function xN(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=bN(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=W(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=W(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>W(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:Qs({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:Qs({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function SN(e){var t=Tn(e,cN),n=Ac();return f.createElement(bk,{id:t.id,type:`area`},e=>f.createElement(f.Fragment,null,f.createElement(VO,{legendPayload:uN(t)}),f.createElement(dN,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),f.createElement(Dk,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Zs(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),f.createElement(yN,eN({},t,{id:e}))))}var CN=f.memo(SN,Yl);CN.displayName=`Area`;var wN=[`domain`,`range`],TN=[`domain`,`range`];function EN(e,t){if(e==null)return{};var n,r,i=DN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{if(o!=null)return FN(FN({},a),{},{type:o})},[a,o]);return(0,f.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(qk(s)):n.current!==s&&t(Jk({prev:n.current,next:s})),n.current=s)},[s,t]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(Yk(n.current)),null)},[t]),null}var HN=e=>{var t=e.xAxisId,n=e.className,r=e.height,i=e.label,a=(0,f.useRef)(null),o=(0,f.useRef)(null),s=z(Oc),c=Ac(),u=R(),d=`xAxis`,p=z(e=>ZS(e,d,t,c)),m=z(e=>VS(e,t)),h=z(e=>KS(e,t)),g=z(e=>ex(e,t));if((0,f.useLayoutEffect)(()=>{if(!(r!==`auto`||!m||$D(i)||(0,f.isValidElement)(i)||g==null)){var e=a.current;if(e){var n=e.getCalculatedHeight();Math.round(m.height)!==Math.round(n)&&u(eA({id:t,height:n}))}}},[p,m,u,i,t,r,g]),m==null||h==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var _=zN(e,jN);g.id,g.scale;var v=zN(g,MN);return f.createElement(Ej,NN({},_,v,{ref:a,labelRef:o,x:h.x,y:h.y,width:m.width,height:m.height,className:l(`recharts-${d} ${d}`,n),viewBox:s,ticks:p,axisType:d,axisId:t}))},UN={allowDataOverflow:Y.allowDataOverflow,allowDecimals:Y.allowDecimals,allowDuplicatedCategory:Y.allowDuplicatedCategory,angle:Y.angle,axisLine:_j.axisLine,height:Y.height,hide:!1,includeHidden:Y.includeHidden,interval:Y.interval,label:!1,minTickGap:Y.minTickGap,mirror:Y.mirror,orientation:Y.orientation,padding:Y.padding,reversed:Y.reversed,scale:Y.scale,tick:Y.tick,tickCount:Y.tickCount,tickLine:_j.tickLine,tickSize:_j.tickSize,type:Y.type,niceTicks:Y.niceTicks,xAxisId:0},WN=f.memo(e=>{var t=Tn(e,UN);return f.createElement(f.Fragment,null,f.createElement(VN,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),f.createElement(HN,t))},kN);WN.displayName=`XAxis`;var GN=[`type`],KN=[`dangerouslySetInnerHTML`,`ticks`,`scale`],qN=[`id`,`scale`];function JN(){return JN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(o!=null)return XN(XN({},a),{},{type:o})},[o,a]);return(0,f.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(Xk(s)):n.current!==s&&t(Zk({prev:n.current,next:s})),n.current=s)},[s,t]),(0,f.useLayoutEffect)(()=>()=>{n.current&&=(t(Qk(n.current)),null)},[t]),null}function rP(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=(0,f.useRef)(null),o=(0,f.useRef)(null),s=z(Oc),c=Ac(),u=R(),d=`yAxis`,p=z(e=>JS(e,t)),m=z(e=>qS(e,t)),h=z(e=>ZS(e,d,t,c)),g=z(e=>nx(e,t));if((0,f.useLayoutEffect)(()=>{if(!(r!==`auto`||!p||$D(i)||(0,f.isValidElement)(i)||g==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(p.width)!==Math.round(n)&&u($k({id:t,width:n}))}}},[h,p,u,i,t,r,g]),p==null||m==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var _=eP(e,KN);g.id,g.scale;var v=eP(g,qN);return f.createElement(Ej,JN({},_,v,{ref:a,labelRef:o,x:m.x,y:m.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:p.width,height:p.height,className:l(`recharts-${d} ${d}`,n),viewBox:s,ticks:h,axisType:d,axisId:t}))}var iP={allowDataOverflow:X.allowDataOverflow,allowDecimals:X.allowDecimals,allowDuplicatedCategory:X.allowDuplicatedCategory,angle:X.angle,axisLine:_j.axisLine,hide:!1,includeHidden:X.includeHidden,interval:X.interval,label:!1,minTickGap:X.minTickGap,mirror:X.mirror,orientation:X.orientation,padding:X.padding,reversed:X.reversed,scale:X.scale,tick:X.tick,tickCount:X.tickCount,tickLine:_j.tickLine,tickSize:_j.tickSize,type:X.type,niceTicks:X.niceTicks,width:X.width,yAxisId:0},aP=f.memo(e=>{var t=Tn(e,iP);return f.createElement(f.Fragment,null,f.createElement(nP,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),f.createElement(rP,t))},kN);aP.displayName=`YAxis`;var oP=B([(e,t)=>t,G,Hm,Zm,pw,hw,Jw,Ec],oT);function sP(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function cP(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(sP(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var lP=wo(`mouseClick`),uP=js();uP.startListening({actionCreator:lP,effect:(e,t)=>{var n=e.payload,r=oP(t.getState(),cP(n));r?.activeIndex!=null&&t.dispatch(vC({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var dP=wo(`mouseMove`),fP=js(),pP=null,mP=null,hP=null;fP.startListening({actionCreator:dP,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);pP!==null&&(cancelAnimationFrame(pP),pP=null),mP!==null&&(typeof i!=`number`||!o)&&(clearTimeout(mP),mP=null),hP=cP(n);var s=()=>{var e=t.getState(),n=iC(e,e.tooltip.settings.shared);if(!hP)pP=null,mP=null;else{if(n===`axis`){var r=oP(e,hP);r?.activeIndex==null?t.dispatch(gC()):t.dispatch(_C({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}pP=null,mP=null}};o?i===`raf`?pP=requestAnimationFrame(s):typeof i==`number`&&mP===null&&(mP=setTimeout(s,i)):s()}});function gP(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<>`:t}var _P={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},vP=Go({name:`rootProps`,initialState:_P,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??_P.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),yP=vP.reducer,bP=vP.actions.updateOptions,xP=Go({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}});xP.actions.updatePolarOptions;var SP=xP.reducer,CP=wo(`keyDown`),wP=wo(`focus`),TP=wo(`blur`),EP=js(),DP=null,OP=null,kP=null;EP.startListening({actionCreator:CP,effect:(e,t)=>{kP=e.payload,DP!==null&&(cancelAnimationFrame(DP),DP=null);var n=t.getState().eventSettings,r=n.throttleDelay,i=n.throttledEvents,a=i===`all`||i.includes(`keydown`);OP!==null&&(typeof r!=`number`||!a)&&(clearTimeout(OP),OP=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=kP;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=NC(n,tw(e),Nx(e),uw(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=hw(e),c=tw(e),l=iC(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=$w(e,l,`hover`,String(n.index));t.dispatch(bC({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=eC(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=Nx(e),h=uw(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v=0;y--)if(NC(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=$w(e,l,`hover`,String(p));t.dispatch(bC({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{DP=null,OP=null}};a?r===`raf`?DP=requestAnimationFrame(o):typeof r==`number`&&OP===null&&(o(),kP=null,OP=setTimeout(()=>{kP?o():(OP=null,DP=null)},r)):o()}}),EP.startListening({actionCreator:wP,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;if(!r.active&&r.index==null){var i=`0`,a=$w(n,iC(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(bC({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),EP.startListening({actionCreator:TP,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(bC({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function AP(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var jP=wo(`externalEvent`),MP=js(),NP=new Map,PP=new Map,FP=new Map;MP.startListening({actionCreator:jP,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=AP(i);FP.set(a,{handler:r,reactEvent:o});var s=NP.get(a);s!==void 0&&(cancelAnimationFrame(s),NP.delete(a));var c=t.getState().eventSettings,l=c.throttleDelay,u=c.throttledEvents,d=u===`all`||u?.includes(a),f=PP.get(a);f!==void 0&&(typeof l!=`number`||!d)&&(clearTimeout(f),PP.delete(a));var p=()=>{var e=FP.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:Tw(i),activeDataKey:Sw(i),activeIndex:bw(i),activeLabel:xw(i),activeTooltipIndex:bw(i),isTooltipActive:Ew(i)};n&&n(o,r)}finally{NP.delete(a),PP.delete(a),FP.delete(a)}};if(!d)p();else if(l===`raf`){var m=requestAnimationFrame(p);NP.set(a,m)}else if(typeof l==`number`){if(!PP.has(a)){p();var h=setTimeout(p,l);PP.set(a,h)}}else p()}}});var IP=B([B([LC],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),LP=wo(`touchMove`),RP=js(),zP=null,BP=null,VP=null,HP=null;RP.startListening({actionCreator:LP,effect:(e,t)=>{var n=e.payload;if(n.touches!=null&&n.touches.length!==0){HP=AP(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);zP!==null&&(cancelAnimationFrame(zP),zP=null),BP!==null&&(typeof i!=`number`||!o)&&(clearTimeout(BP),BP=null),VP=Array.from(n.touches).map(e=>cP({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(HP!=null){var e=t.getState(),n=iC(e,e.tooltip.settings.shared);if(n===`axis`){var r=VP?.[0];if(r==null){zP=null,BP=null;return}var i=oP(e,r);i?.activeIndex!=null&&t.dispatch(_C({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=HP.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(hc),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=ZC(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=IP(e,s,c);t.dispatch(hC({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}zP=null,BP=null}};o?i===`raf`?zP=requestAnimationFrame(s):typeof i==`number`&&BP===null&&(s(),HP=null,BP=setTimeout(()=>{HP?s():(BP=null,zP=null)},i)):s()}}});var UP={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},WP=Go({name:`eventSettings`,initialState:UP,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=V(t.payload.throttledEvents))}}}),GP=WP.actions.setEventSettings,KP=WP.reducer,qP=qi({brush:hA,cartesianAxis:tA,chartData:YT,errorBars:Vj,eventSettings:KP,graphicalItems:Ek,layout:zs,legend:Al,options:HT,polarAxis:EO,polarOptions:SP,referenceElements:bA,renderedTicks:nj,rootProps:yP,tooltip:xC,zIndex:CT}),JP=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Fo({reducer:qP,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([uP.middleware,fP.middleware,EP.middleware,MP.middleware,RP.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(No({type:`raf`}))},devTools:Ju.devToolsEnabled&&{serialize:{replacer:gP},name:`recharts-${t}`}})};function YP(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Ac(),a=(0,f.useRef)(null);if(i)return n;a.current??=JP(t,r);var o=Qr;return f.createElement(Kl,{context:o,store:a.current},n)}function XP(e){var t=e.layout,n=e.margin,r=R(),i=Ac();return(0,f.useEffect)(()=>{i||(r(Is(t)),r(Fs(n)))},[r,i,t,n]),null}var ZP=(0,f.memo)(XP,Yl);function QP(e){var t=R();return(0,f.useEffect)(()=>{t(bP(e))},[t,e]),null}var $P=(0,f.memo)(e=>{var t=R();return(0,f.useEffect)(()=>{t(GP(e))},[t,e]),null},Yl);function eF(e){var t=e.zIndex,n=e.isPanorama,r=(0,f.useRef)(null),i=R();return(0,f.useLayoutEffect)(()=>(r.current&&i(xT({zIndex:t,element:r.current,isPanorama:n})),()=>{i(ST({zIndex:t,isPanorama:n}))}),[i,t,n]),f.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function tF(e){var t=e.children,n=e.isPanorama,r=z(cT);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return f.createElement(f.Fragment,null,i.map(e=>f.createElement(eF,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>f.createElement(eF,{key:e,zIndex:e,isPanorama:n})))}var nF=[`children`];function rF(e,t){if(e==null)return{};var n,r,i=iF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=hl(),r=gl(),i=gd();if(!Vs(n)||!Vs(r))return null;var a=e.children,o=e.otherAttributes,s=e.title,c=e.desc,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),f.createElement(w,aF({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:oF,ref:t}),a)}),cF=e=>{var t=e.children,n=z(Mc);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return f.createElement(w,{width:r,height:i,x:o,y:a},t)},lF=(0,f.forwardRef)((e,t)=>{var n=e.children,r=rF(e,nF);return Ac()?f.createElement(cF,null,f.createElement(tF,{isPanorama:!0},n)):f.createElement(sF,aF({ref:t},r),f.createElement(tF,{isPanorama:!1},n))});function uF(e,t){return hF(e)||mF(e,t)||fF(e,t)||dF()}function dF(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fF(e,t){if(e){if(typeof e==`string`)return pF(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pF(e,t):void 0}}function pF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{if(n!=null){var t=n.getBoundingClientRect().width/n.offsetWidth;U(t)&&t!==i&&e(Rs(t))}},[n,e,i]),r}function _F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vF(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n(oE(),null);function AF(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var jF=(0,f.forwardRef)((e,t)=>{var n=(0,f.useRef)(null),r=CF((0,f.useState)({containerWidth:AF(e.style?.width),containerHeight:AF(e.style?.height)}),2),i=r[0],a=r[1],o=(0,f.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,f.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var r=e.getBoundingClientRect(),i=r.width,a=r.height;o(i,a);var s=new ResizeObserver(e=>{var t=e[0];if(t!=null){var n=t.contentRect,r=n.width,i=n.height;o(r,i)}});s.observe(e),n.current=s}},[t,o]);return(0,f.useEffect)(()=>()=>{n.current?.disconnect()},[o]),f.createElement(f.Fragment,null,f.createElement(Sl,{width:i.containerWidth,height:i.containerHeight}),f.createElement(`div`,SF({ref:s},e)))}),MF=(0,f.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=CF((0,f.useState)({containerWidth:AF(n),containerHeight:AF(r)}),2),a=i[0],o=i[1],s=(0,f.useCallback)((e,t)=>{o(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),c=(0,f.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var n=e.getBoundingClientRect(),r=n.width,i=n.height;s(r,i)}},[t,s]);return f.createElement(f.Fragment,null,f.createElement(Sl,{width:a.containerWidth,height:a.containerHeight}),f.createElement(`div`,SF({ref:c},e)))}),NF=(0,f.forwardRef)((e,t)=>{var n=e.width,r=e.height;return f.createElement(f.Fragment,null,f.createElement(Sl,{width:n,height:r}),f.createElement(`div`,SF({ref:t},e)))}),PF=(0,f.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?f.createElement(MF,SF({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?f.createElement(NF,SF({},e,{width:n,height:r,ref:t})):f.createElement(f.Fragment,null,f.createElement(Sl,{width:n,height:r}),f.createElement(`div`,SF({ref:t},e)))});function FF(e){return e?jF:PF}var IF=(0,f.forwardRef)((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,u=e.onMouseEnter,d=e.onMouseLeave,p=e.onMouseMove,m=e.onMouseUp,h=e.onTouchEnd,g=e.onTouchMove,_=e.onTouchStart,v=e.style,y=e.width,b=e.responsive,x=e.dispatchTouchEvents,S=x===void 0||x,C=(0,f.useRef)(null),w=R(),T=CF((0,f.useState)(null),2),E=T[0],D=T[1],O=CF((0,f.useState)(null),2),k=O[0],A=O[1],j=gF(),M=ll(),N=M?.width>0?M.width:y,ee=M?.height>0?M.height:i,te=(0,f.useCallback)(e=>{j(e),typeof t==`function`&&t(e),D(e),A(e),e!=null&&(C.current=e)},[j,t,D,A]),ne=(0,f.useCallback)(e=>{w(lP(e)),w(jP({handler:a,reactEvent:e}))},[w,a]),re=(0,f.useCallback)(e=>{w(dP(e)),w(jP({handler:u,reactEvent:e}))},[w,u]),ie=(0,f.useCallback)(e=>{w(gC()),w(jP({handler:d,reactEvent:e}))},[w,d]),ae=(0,f.useCallback)(e=>{w(dP(e)),w(jP({handler:p,reactEvent:e}))},[w,p]),oe=(0,f.useCallback)(()=>{w(wP())},[w]),se=(0,f.useCallback)(()=>{w(TP())},[w]),P=(0,f.useCallback)(e=>{w(CP(e.key))},[w]),ce=(0,f.useCallback)(e=>{w(jP({handler:o,reactEvent:e}))},[w,o]),le=(0,f.useCallback)(e=>{w(jP({handler:s,reactEvent:e}))},[w,s]),ue=(0,f.useCallback)(e=>{w(jP({handler:c,reactEvent:e}))},[w,c]),F=(0,f.useCallback)(e=>{w(jP({handler:m,reactEvent:e}))},[w,m]),de=(0,f.useCallback)(e=>{w(jP({handler:_,reactEvent:e}))},[w,_]),fe=(0,f.useCallback)(e=>{S&&w(LP(e)),w(jP({handler:g,reactEvent:e}))},[w,S,g]),pe=(0,f.useCallback)(e=>{w(jP({handler:h,reactEvent:e}))},[w,h]),me=FF(b);return f.createElement(PT.Provider,{value:E},f.createElement(Ae.Provider,{value:k},f.createElement(me,{width:N??v?.width,height:ee??v?.height,className:l(`recharts-wrapper`,r),style:vF({position:`relative`,cursor:`default`,width:N,height:ee},v),onClick:ne,onContextMenu:ce,onDoubleClick:le,onFocus:oe,onBlur:se,onKeyDown:P,onMouseDown:ue,onMouseEnter:re,onMouseLeave:ie,onMouseMove:ae,onMouseUp:F,onTouchEnd:pe,onTouchMove:fe,onTouchStart:de,ref:te},f.createElement(kF,null),n)))}),LF=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function RF(e,t){if(e==null)return{};var n,r,i=zF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=g(RF(e,LF));return c?f.createElement(f.Fragment,null,f.createElement(Sl,{width:n,height:r}),f.createElement(lF,{otherAttributes:d,title:l,desc:u},a)):f.createElement(IF,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},f.createElement(lF,{otherAttributes:d,title:l,desc:u,ref:t},f.createElement(OA,null,a)))});function VF(){return VF=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(JF,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:YF,tooltipPayloadSearcher:BT,categoricalChartProps:e,ref:t})),ZF=[`supply`,`bus`,`current`,`power`,`ledTemp`,`btTemp`];function QF(e){return typeof e==`number`&&Number.isFinite(e)}function $F(e){if(!QF(e.at))return null;let t={at:e.at};for(let n of ZF){let r=e[n];QF(r)&&(t[n]=r)}return ZF.some(e=>t[e]!==void 0)?t:null}function eI(e){let t=e.filter(QF).sort((e,t)=>e-t);if(!t.length)return;let n=Math.floor(t.length/2);return t.length%2==1?t[n]:(t[n-1]+t[n])/2}function tI(e){let t=new Map;for(let n of e){let e=$F(n);e&&t.set(e.at,e)}return[...t.values()].sort((e,t)=>e.at-t.at)}function nI(e){return e.map((t,n)=>{let r=e.slice(Math.max(0,n-1),Math.min(e.length,n+2)),i={...t};for(let e of ZF){if(!QF(t[e]))continue;let n=eI(r.map(t=>t[e]).filter(QF));n!==void 0&&(i[e]=n)}return i})}function rI(e,t=.2,n=1){let r;return e.map(e=>{let i=e.current;if(!QF(i))return r=void 0,e;let a=r===void 0?i:r+t*(i-r),o=r!==void 0&&Math.abs(a-r)t.map(t=>e[t]).filter(QF))}function sI(e){let t=oI(e,[`supply`,`bus`]);if(!t.length)return[0,1];let n=Math.min(...t),r=Math.max(...t);return[Math.max(0,iI(n-Math.max(.8,r*.075),.25)),aI(r+Math.max(.2,r*.025),.25)]}function cI(e){let t=oI(e,[`ledTemp`,`btTemp`]);if(!t.length)return[20,55];let n=Math.min(...t),r=Math.max(...t);return[Math.max(0,Math.min(20,iI(n-8,1))),Math.max(55,aI(r+3,1))]}function lI(e){let t=oI(e,[`current`]);return t.length?[0,Math.max(100,aI(Math.max(0,...t)*1.2,50))]:[0,100]}var $=a(),uI={electrical:{en:`Electrical`,fa:`الکتریکی`},power:{en:`Power`,fa:`توان`},thermal:{en:`Thermal`,fa:`دما`}};function dI(e){return typeof e==`number`&&Number.isFinite(e)?e.toFixed(2):String(e??`—`)}var fI=YO(`at`);function pI(e=!1){return{isAnimationActive:!e&&`auto`,animationBegin:0,animationDuration:250,animationEasing:`linear`,animationMatchBy:fI}}function mI({connected:t,locale:n,samples:r,reduceMotion:a=!1}){let o=pI(a),[s,c]=(0,f.useState)(`electrical`),[l,u]=(0,f.useState)(`60`),[d,p]=(0,f.useState)(`smoothed`),m=n===`fa`,h=(0,f.useMemo)(()=>tI(r),[r]),g=(0,f.useMemo)(()=>{let e=l===`all`?h.length:Number(l),t=new Intl.DateTimeFormat(m?`fa-IR`:`en-US`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),n=h.slice(-e);return(d===`smoothed`?rI(nI(n)):n).map(e=>({...e,timeLabel:t.format(e.at)}))},[h,m,d,l]),_=(0,f.useMemo)(()=>{let e=[];return h.some(e=>[e.supply,e.bus,e.current].some(e=>typeof e==`number`&&Number.isFinite(e)))&&e.push(`electrical`),h.some(e=>typeof e.power==`number`&&Number.isFinite(e.power))&&e.push(`power`),h.some(e=>[e.ledTemp,e.btTemp].some(e=>typeof e==`number`&&Number.isFinite(e)))&&e.push(`thermal`),e},[h]),v=_.includes(s)?s:_[0]??`electrical`,y=g.at(-1),b=(0,f.useMemo)(()=>sI(g),[g]),x=(0,f.useMemo)(()=>cI(g),[g]),S=(0,f.useMemo)(()=>lI(g),[g]),C=m?`نمودار ${uI[v].fa} با ${g.length} نمونه`:`${uI[v].en} chart with ${g.length} samples`;return g.length?(0,$.jsxs)(`div`,{className:`telemetry-chart`,children:[(0,$.jsxs)(`div`,{className:`telemetry-chart__toolbar`,children:[(0,$.jsx)(i,{value:v,label:m?`گروه نمودار`:`Chart group`,options:_.map(e=>({value:e,label:uI[e][m?`fa`:`en`]})),onChange:c}),(0,$.jsx)(i,{value:l,label:m?`بازه نمونه‌ها`:`Sample window`,options:[{value:`30`,label:m?`۳۰ نمونه`:`30 samples`},{value:`60`,label:m?`۶۰ نمونه`:`60 samples`},{value:`all`,label:m?`همه`:`All`}],onChange:u}),(0,$.jsx)(i,{value:d,label:m?`پردازش نمودار`:`Chart processing`,options:[{value:`smoothed`,label:m?`هموار`:`Smoothed`},{value:`raw`,label:m?`خام`:`Raw`}],onChange:p})]}),(0,$.jsx)(`div`,{className:`telemetry-chart__canvas`,role:`img`,"aria-label":C,children:(0,$.jsx)(dl,{width:`100%`,height:`100%`,children:(0,$.jsxs)(XF,{data:g,margin:{top:14,right:18,bottom:2,left:4},children:[(0,$.jsxs)(`defs`,{children:[(0,$.jsxs)(`linearGradient`,{id:`telemetry-accent-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,$.jsx)(`stop`,{offset:`0`,stopColor:`var(--accent)`,stopOpacity:.34}),(0,$.jsx)(`stop`,{offset:`1`,stopColor:`var(--accent)`,stopOpacity:.01})]}),(0,$.jsxs)(`linearGradient`,{id:`telemetry-amber-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,$.jsx)(`stop`,{offset:`0`,stopColor:`var(--amber)`,stopOpacity:.28}),(0,$.jsx)(`stop`,{offset:`1`,stopColor:`var(--amber)`,stopOpacity:.01})]})]}),(0,$.jsx)(WN,{dataKey:`timeLabel`,minTickGap:38,tick:{fill:`var(--text-muted)`,fontSize:9},axisLine:{stroke:`var(--line-strong)`},tickLine:!1}),(0,$.jsx)(aP,{yAxisId:`left`,width:44,tick:{fill:`var(--text-muted)`,fontSize:9},axisLine:!1,tickLine:!1,domain:v===`electrical`?b:v===`thermal`?x:[`auto`,`auto`]}),v===`electrical`&&(0,$.jsx)(aP,{yAxisId:`right`,orientation:`right`,width:46,tick:{fill:`var(--text-muted)`,fontSize:9},axisLine:!1,tickLine:!1,domain:S}),(0,$.jsx)(CE,{cursor:{stroke:`var(--line-strong)`,strokeWidth:1},contentStyle:{background:`var(--glass-strong)`,border:`1px solid var(--line-strong)`,borderRadius:12,boxShadow:`var(--shadow-tight)`,color:`var(--text)`},labelStyle:{color:`var(--text-muted)`,marginBottom:6},formatter:(e,t)=>[dI(e),String(t)]}),(0,$.jsx)(Tu,{iconType:`plainline`,wrapperStyle:{color:`var(--text-soft)`,fontSize:10,paddingTop:7}}),v===`electrical`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(CN,{yAxisId:`left`,type:`linear`,dataKey:`supply`,name:m?`تغذیه V`:`Supply V`,stroke:`var(--accent)`,strokeWidth:2.2,fill:`url(#telemetry-accent-fill)`,...o}),(0,$.jsx)(AM,{yAxisId:`left`,type:`linear`,dataKey:`bus`,name:m?`باس V`:`Bus V`,stroke:`var(--violet)`,strokeWidth:1.8,dot:!1,...o}),(0,$.jsx)(AM,{yAxisId:`right`,type:`linear`,dataKey:`current`,name:m?`جریان mA`:`Current mA`,stroke:`var(--amber)`,strokeWidth:1.8,dot:!1,...o})]}),v===`power`&&(0,$.jsx)(CN,{yAxisId:`left`,type:`linear`,dataKey:`power`,name:m?`توان W`:`Power W`,stroke:`var(--amber)`,strokeWidth:2.2,fill:`url(#telemetry-amber-fill)`,...o}),v===`thermal`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(CN,{yAxisId:`left`,type:`linear`,dataKey:`ledTemp`,name:m?`دمای LED °C`:`LED °C`,stroke:`var(--red)`,strokeWidth:2.1,fill:`url(#telemetry-amber-fill)`,...o}),(0,$.jsx)(AM,{yAxisId:`left`,type:`linear`,dataKey:`btTemp`,name:m?`دمای صدا °C`:`Audio °C`,stroke:`var(--violet)`,strokeWidth:1.9,dot:!1,...o})]})]})})}),(0,$.jsxs)(`div`,{className:`telemetry-chart__summary`,"aria-live":`polite`,children:[(0,$.jsx)(e,{tone:t?`good`:`warn`,children:t?m?`زنده`:`Live`:m?`آخرین داده`:`Last known`}),(0,$.jsx)(`span`,{children:m?`${g.length} نمونه`:`${g.length} samples`}),y&&(0,$.jsx)(`span`,{dir:`ltr`,children:y.timeLabel})]}),(0,$.jsxs)(`table`,{className:`sr-only`,children:[(0,$.jsx)(`caption`,{children:C}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{children:[(0,$.jsx)(`th`,{children:m?`زمان`:`Time`}),(0,$.jsx)(`th`,{children:m?`تغذیه`:`Supply`}),(0,$.jsx)(`th`,{children:m?`جریان`:`Current`}),(0,$.jsx)(`th`,{children:m?`توان`:`Power`}),(0,$.jsx)(`th`,{children:m?`دما`:`Temperature`})]})}),(0,$.jsx)(`tbody`,{children:g.slice(-10).map(e=>(0,$.jsxs)(`tr`,{children:[(0,$.jsx)(`td`,{children:e.timeLabel}),(0,$.jsx)(`td`,{children:e.supply}),(0,$.jsx)(`td`,{children:e.current}),(0,$.jsx)(`td`,{children:e.power}),(0,$.jsx)(`td`,{children:e.ledTemp})]},e.at))})]})]}):(0,$.jsxs)(`div`,{className:`telemetry-chart__empty`,role:`status`,children:[(0,$.jsx)(`strong`,{children:m?`هنوز نمونه‌ای دریافت نشده است`:`No telemetry samples yet`}),(0,$.jsx)(`span`,{children:t?m?`در انتظار اولین وضعیت برد`:`Waiting for the first board status`:m?`برد آفلاین است`:`Board offline`})]})}export{mI as TelemetryChart}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DwrIxLY1.js b/Tools/Controller/internal/webui/dist/assets/chunk-D1EF5rbN.js similarity index 81% rename from Tools/Controller/internal/webui/dist/assets/chunk-DwrIxLY1.js rename to Tools/Controller/internal/webui/dist/assets/chunk-D1EF5rbN.js index b867ad2f..4ea3efb4 100644 --- a/Tools/Controller/internal/webui/dist/assets/chunk-DwrIxLY1.js +++ b/Tools/Controller/internal/webui/dist/assets/chunk-D1EF5rbN.js @@ -1 +1 @@ -import{Dt as e}from"./app-BpGu_3eg.js";var t={name:`hard-drive-download`,size:24,node:[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]};t.node;var n=e(t);export{n as t}; \ No newline at end of file +import{Pt as e}from"./app-BxYXetji.js";var t={name:`hard-drive-download`,size:24,node:[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]};t.node;var n=e(t);export{n as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DBQKI-WA.js b/Tools/Controller/internal/webui/dist/assets/chunk-DBQKI-WA.js new file mode 100644 index 00000000..04f22f8c --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-DBQKI-WA.js @@ -0,0 +1,3 @@ +import{n as e,r as t}from"./chunk-DIrhZHWK.js";import{n,r,t as i}from"./chunk-D02q3HLn.js";import{t as a}from"./chunk-GmnEjCp4.js";import{n as o,t as s}from"./chunk-BgHNRN_V.js";import{n as c,t as l}from"./chunk-B5OrbcTy.js";import{$ as u,A as d,It as f,J as p,O as m,Pt as h,S as g,X as _,Y as v,Z as y,at as b,dt as x,it as S,lt as C,ot as w,st as T,ut as E,zt as D}from"./app-BxYXetji.js";var O={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};O.node;var k=h(O),A={name:`table-properties`,size:24,node:[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]};A.node;var j=h(A),M=D(f(),1),N=x(),P=[`id`,`code`,`name`,`title`,`category`,`state`,`value`,`updated_at`];function F(e){if(Array.isArray(e))return e.map(e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{value:e});if(e&&typeof e==`object`){let t=e;return Array.isArray(t.records)?F(t.records):Array.isArray(t.data)?F(t.data):[t]}return[]}function I({locale:f,t:h}){let x=(e,t)=>f===`fa`?t:e,[D,O]=(0,M.useState)(`explore`),[A,I]=(0,M.useState)(`v1/status`),[L,R]=(0,M.useState)(`GET`),[z,B]=(0,M.useState)(`{ + "query": "" +}`),[V,H]=(0,M.useState)([]),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(null),[q,J]=(0,M.useState)([]),[Y,X]=(0,M.useState)(``),Z=async()=>{W(!0);try{let e;L===`POST`&&(JSON.parse(z),e=z);let t=await d(`datahub`,A,{method:L,body:e});K(t),H(F(t));let n=A.replace(/^\/+/,``),r=`${L} /${n}`;J(e=>[r,...e.filter(e=>e!==r)].slice(0,6)),X(``)}catch(e){X(e instanceof Error?e.message:t(e))}finally{W(!1)}},Q=async()=>{W(!0);try{await m(`datahub`,A),X(``)}catch(e){X(e instanceof Error?e.message:t(e))}finally{W(!1)}},$=e=>{let t=e.indexOf(` `);R(e.slice(0,t)),I(e.slice(t+2))};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(S,{eyebrow:x(`Local data and streaming`,`داده و جریان محلی`),title:h(`data`),detail:x(`A loopback-only workbench for deliberate data exchange; no service-specific routes or credentials are embedded.`,`میزکاری محدود به شبکهٔ محلی برای تبادل آگاهانهٔ داده؛ هیچ مسیر اختصاصی سرویس یا اطلاعات دسترسی در رابط تعبیه نشده است.`),action:(0,N.jsx)(w,{tone:Y?`warn`:G?`good`:`info`,children:G?x(`RESPONSE READY`,`پاسخ آماده`):x(`IDLE`,`آماده`)})}),(0,N.jsx)(`nav`,{className:`subnav`,"aria-label":x(`Data workspace sections`,`بخش‌های فضای داده`),children:[[`explore`,l,x(`Request`,`درخواست`)],[`table`,j,`${h(`records`)} · ${g(f,V.length)}`],[`transfer`,r,x(`Transfer`,`انتقال`)]].map(([e,t,n])=>(0,N.jsxs)(`button`,{className:D===e?`is-active`:``,onClick:()=>O(e),children:[(0,N.jsx)(u,{icon:t,size:17}),n]},e))}),(0,N.jsx)(E,{initial:!1,children:Y&&(0,N.jsxs)(C.div,{className:`integration-banner`,role:`alert`,initial:{height:0,marginBottom:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(5px)`},animate:{height:`auto`,marginBottom:14,opacity:1,clipPath:`inset(0 0 0% 0)`,filter:`blur(0px)`},exit:{height:0,marginBottom:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(4px)`},transition:{duration:.28,ease:[.22,1,.36,1]},children:[(0,N.jsx)(o,{size:19}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:h(`unavailable`)}),(0,N.jsx)(`p`,{children:Y})]})]},`data-workspace-error`)}),D===`explore`&&(0,N.jsxs)(`section`,{className:`operations-grid`,children:[(0,N.jsxs)(v,{icon:s,iconTone:`violet`,title:x(`Request composer`,`ساخت درخواست`),eyebrow:x(`Authenticated host route`,`مسیر معتبر میزبان`),children:[(0,N.jsxs)(`div`,{className:`setting-group`,children:[(0,N.jsx)(`label`,{children:x(`Method`,`روش`)}),(0,N.jsx)(b,{value:L,label:x(`HTTP method`,`روش HTTP`),options:[{value:`GET`,label:`GET`},{value:`POST`,label:`POST`}],onChange:R})]}),(0,N.jsx)(T,{label:x(`Relative data path`,`مسیر نسبی داده`),dir:`ltr`,spellCheck:!1,value:A,placeholder:`v1/status`,onChange:e=>I(e.target.value),hint:x(`The upstream origin comes only from persistent host configuration.`,`مبدأ بالادستی فقط از پیکربندی ماندگار میزبان خوانده می‌شود.`)}),L===`POST`&&(0,N.jsxs)(`label`,{className:`payload-field`,children:[(0,N.jsx)(`span`,{children:x(`JSON body`,`بدنهٔ JSON`)}),(0,N.jsx)(`textarea`,{dir:`ltr`,spellCheck:!1,value:z,onChange:e=>B(e.target.value)})]}),(0,N.jsx)(p,{tone:`primary`,icon:s,busy:U,disabled:!A.trim(),onClick:()=>void Z(),children:x(`Send request`,`ارسال درخواست`)})]}),(0,N.jsx)(v,{icon:k,iconTone:`accent`,title:x(`Response`,`پاسخ`),eyebrow:G===null?x(`No response`,`بدون پاسخ`):x(`${V.length} projected records`,`${g(f,V.length)} رکورد استخراج‌شده`),className:`operation-result`,children:(0,N.jsx)(`pre`,{className:`operation-output`,dir:`ltr`,children:G===null?x(`Run a request to inspect the response.`,`برای بررسی پاسخ، یک درخواست اجرا کنید.`):typeof G==`string`?G:t(G,!0)})}),(0,N.jsx)(v,{icon:i,iconTone:`green`,title:x(`Recent local requests`,`درخواست‌های محلی اخیر`),eyebrow:x(`${q.length} in this tab`,`${g(f,q.length)} مورد در این زبانه`),children:(0,N.jsx)(`div`,{className:`command-chips`,children:q.length?q.map(e=>(0,N.jsx)(`button`,{dir:`ltr`,onClick:()=>$(e),children:e},e)):(0,N.jsx)(`p`,{className:`card-copy`,children:x(`No requests in this browser session.`,`در این نشست مرورگر هنوز درخواستی اجرا نشده است.`)})})})]}),D===`table`&&(0,N.jsxs)(v,{icon:j,iconTone:`violet`,className:`records-card`,title:`${h(`records`)} · ${g(f,V.length)}`,eyebrow:x(`Typed local collection`,`مجموعهٔ محلی نوع‌دار`),children:[(0,N.jsx)(e,{records:V,preferredFields:P,locale:f,direction:f===`fa`?`rtl`:`ltr`,ariaLabel:x(`Data workspace records`,`رکوردهای فضای داده`),filename:`data-workspace`,preserveViewportAnchor:!0,empty:(0,N.jsx)(y,{icon:n,title:x(`No tabular records`,`رکورد جدولی موجود نیست`),detail:x(`Run a request to inspect a structured response as a typed collection.`,`یک درخواست اجرا کنید تا پاسخ ساخت‌یافته را به‌صورت مجموعهٔ نوع‌دار بررسی کنید.`)})}),(0,N.jsxs)(`footer`,{className:`table-footer`,children:[(0,N.jsxs)(`span`,{children:[V.length,` `,x(`records`,`رکورد`)]}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(c,{size:15}),` `,x(`Credentials stripped`,`اطلاعات دسترسی حذف شده`)]}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(r,{size:15}),` `,h(`rangeReady`)]})]})]}),D===`transfer`&&(0,N.jsxs)(`section`,{className:`system-grid`,children:[(0,N.jsx)(v,{icon:a,iconTone:`accent`,title:x(`Streaming download`,`دانلود جریانی`),eyebrow:A.trim()?`/${A.replace(/^\/+/,``)}`:x(`No path selected`,`مسیری انتخاب نشده`),children:A.trim()&&(0,N.jsx)(p,{icon:a,busy:U,onClick:()=>void Q(),children:x(`Download current path`,`دانلود مسیر فعلی`)})}),(0,N.jsx)(v,{icon:c,iconTone:`green`,title:x(`Boundary status`,`وضعیت مرز امنیتی`),eyebrow:Y?x(`Request rejected`,`درخواست رد شد`):x(`Host mediated`,`با میانجی‌گری میزبان`),children:(0,N.jsxs)(`div`,{className:`data-list`,children:[(0,N.jsx)(_,{label:x(`Upstream`,`بالادست`),value:x(`Configured loopback root`,`ریشهٔ محلی پیکربندی‌شده`)}),(0,N.jsx)(_,{label:x(`Credentials`,`اطلاعات دسترسی`),value:x(`Removed before forwarding`,`پیش از ارسال حذف می‌شود`),tone:`good`}),(0,N.jsx)(_,{label:x(`Redirect selection`,`انتخاب تغییرمسیر`),value:x(`Host-owned`,`در اختیار میزبان`)}),(0,N.jsx)(_,{label:x(`Range requests`,`درخواست‌های بازه‌ای`),value:x(`Preserved`,`حفظ می‌شوند`),tone:`good`})]})}),(0,N.jsx)(v,{icon:l,iconTone:`violet`,title:x(`Current response`,`پاسخ فعلی`),eyebrow:G===null?x(`No response`,`بدون پاسخ`):typeof G==`string`?x(`Text`,`متن`):x(`Structured data`,`دادهٔ ساخت‌یافته`),children:G!==null&&(0,N.jsx)(`pre`,{className:`operation-output`,dir:`ltr`,children:typeof G==`string`?G:t(G,!0)})})]})]})}export{I as DataWorkspaceView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DDsZ2KKt.js b/Tools/Controller/internal/webui/dist/assets/chunk-DDsZ2KKt.js new file mode 100644 index 00000000..b02f1b03 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-DDsZ2KKt.js @@ -0,0 +1 @@ +import{Pt as e}from"./app-BxYXetji.js";var t={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};t.node;var n=e(t);export{n as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DFSYywIo.js b/Tools/Controller/internal/webui/dist/assets/chunk-DFSYywIo.js deleted file mode 100644 index e6ecb020..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-DFSYywIo.js +++ /dev/null @@ -1,5 +0,0 @@ -import{a as e,i as t,r as n,t as r}from"./chunk-DvGrMMmP.js";import{_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as ee,s as v,t as y,u as te,v as b,x as ne,y as re}from"./chunk-D76V6mr9.js";import{i as x,n as ie,t as ae}from"./chunk-ME8Q1Sy7.js";import{t as S}from"./chunk-DwrIxLY1.js";import{n as oe,t as C}from"./chunk-BWN4QWM7.js";import{$ as se,Ct as ce,Dt as w,Et as T,H as E,K as D,Mt as O,Q as le,T as k,Tt as A,U as ue,V as j,Y as M,Z as de,a as fe,at as pe,c as N,d as me,et as P,gt as F,ht as I,it as L,kt as he,l as ge,m as _e,nt as R,o as ve,ot as ye,p as z,q as be,rt as xe,st as Se,tt as Ce,u as we,ut as Te,vt as Ee,xt as De,yt as Oe}from"./app-BpGu_3eg.js";var ke={name:`antenna`,size:24,node:[[`path`,{d:`M2 12 7 2`,key:`117k30`}],[`path`,{d:`m7 12 5-10`,key:`1tvx22`}],[`path`,{d:`m12 12 5-10`,key:`ev1o1a`}],[`path`,{d:`m17 12 5-10`,key:`1e4ti3`}],[`path`,{d:`M4.5 7h15`,key:`vlsxkz`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]};ke.node;var Ae=w(ke),je={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};je.node;var Me=w(je),Ne={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Ne.node;var Pe=w(Ne),Fe={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Fe.node;var Ie=w(Fe),Le={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};Le.node;var Re=w(Le),ze={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};ze.node;var Be=w(ze),Ve={name:`door-open`,size:24,node:[[`path`,{d:`M10 21H2`,key:`1sthdo`}],[`path`,{d:`M10 3H7a2 2 0 00-2 2v16`,key:`15gt7x`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z`,key:`tyvg9a`}],[`path`,{d:`M22 21h-3`,key:`1ec3tr`}]]};Ve.node;var He=w(Ve),Ue={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};Ue.node;var We=w(Ue),Ge={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Ge.node;var Ke=w(Ge),B={name:`keyboard-off`,size:24,node:[[`path`,{d:`M 20 4 A2 2 0 0 1 22 6`,key:`1g1fkt`}],[`path`,{d:`M 22 6 L 22 16.41`,key:`1qjg3w`}],[`path`,{d:`M 7 16 L 16 16`,key:`n0yqwb`}],[`path`,{d:`M 9.69 4 L 20 4`,key:`kbpcgx`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M20 20H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2`,key:`s23sx2`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]};B.node;var qe=w(B),Je={name:`layout-panel-top`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]};Je.node;var Ye=w(Je),Xe={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Xe.node;var Ze=w(Xe),Qe={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};Qe.node;var $e=w(Qe),et={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};et.node;var tt=w(et),nt={name:`monitor-cog`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]};nt.node;var rt=w(nt),it={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};it.node;var at=w(it),ot={name:`panel-top-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m15 14-3 3-3-3`,key:`g215vf`}]]};ot.node;var st=w(ot),ct={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};ct.node;var lt=w(ct),ut={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ut.node;var dt=w(ut),ft={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};ft.node;var pt=w(ft),mt={name:`radio-tower`,size:24,node:[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]};mt.node;var ht=w(mt),gt={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};gt.node;var _t=w(gt),vt={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};vt.node;var yt=w(vt),bt={name:`sun-medium`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 3v1`,key:`1asbbs`}],[`path`,{d:`M12 20v1`,key:`1wcdkc`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M20 12h1`,key:`1vloll`}],[`path`,{d:`m18.364 5.636-.707.707`,key:`1hakh0`}],[`path`,{d:`m6.343 17.657-.707.707`,key:`18m9nf`}],[`path`,{d:`m5.636 5.636.707.707`,key:`1xv1c5`}],[`path`,{d:`m17.657 17.657.707.707`,key:`vl76zb`}]]};bt.node;var xt=w(bt),St={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};St.node;var Ct=w(St),V=O(he(),1),wt=new Set([`log`,`info`,`warn`,`error`,`debug`,`dir`,`dirxml`,`trace`,`table`,`group`,`groupCollapsed`,`groupEnd`,`clear`,`assert`,`count`,`countReset`,`time`,`timeLog`,`timeEnd`]),Tt=new Set(`aliceblue.aqua.black.blue.brown.coral.crimson.cyan.darkblue.darkgray.darkgreen.darkgrey.fuchsia.gold.gray.green.grey.indigo.lime.magenta.maroon.navy.olive.orange.orchid.pink.plum.purple.red.salmon.silver.teal.tomato.transparent.violet.white.yellow.currentcolor`.split(`.`)),H={maxDepth:4,maxObjectKeys:50,maxStringLength:16384,maxEntries:1e3,maxTableRows:100,maxTableColumns:20,now:()=>Date.now(),captureStack:()=>{try{let e=Error(`Trace`).stack;return typeof e==`string`?e:void 0}catch{return}}};function U(e,t,n,r){return Number.isFinite(e)?Math.min(r,Math.max(n,Math.trunc(e))):t}function W(e={}){return{maxDepth:U(e.maxDepth,H.maxDepth,1,12),maxObjectKeys:U(e.maxObjectKeys,H.maxObjectKeys,1,1e3),maxStringLength:U(e.maxStringLength,H.maxStringLength,32,1e6),maxEntries:U(e.maxEntries,H.maxEntries,1,1e5),maxTableRows:U(e.maxTableRows,H.maxTableRows,1,1e4),maxTableColumns:U(e.maxTableColumns,H.maxTableColumns,1,500),now:typeof e.now==`function`?e.now:H.now,captureStack:typeof e.captureStack==`function`?e.captureStack:H.captureStack}}function Et(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.toLowerCase(),r={groupcollapsed:`groupCollapsed`,groupend:`groupEnd`,countreset:`countReset`,timelog:`timeLog`,timeend:`timeEnd`}[n]??n;return wt.has(r)?r:null}function Dt(e){if(!Array.isArray(e))return null;try{let t=Object.getOwnPropertyDescriptors(e),n=t.length;if(!n||!(`value`in n))return null;let r=n.value;if(typeof r!=`number`||!Number.isSafeInteger(r)||r<0||r>256)return null;let i=Array(r);for(let e=0;e65536||(this.space(),!this.consumeWord(`console`))||(this.space(),!this.consume(`.`)))return null;this.space();let e=Et(this.identifier());if(!e||(this.space(),!this.consume(`(`)))return null;this.space();let t=[];if(this.peek(`)`))this.index++;else for(;;){if(t.length>=256)return null;let e=this.value(0);if(!e.ok)return null;if(t.push(e.value),this.space(),this.consume(`)`))break;if(!this.consume(`,`))return null;if(this.space(),this.peek(`)`)){this.index++;break}}return this.space(),this.consume(`;`),this.space(),this.index===this.source.length?{method:e,args:t}:null}value(e){if(e>32)return{ok:!1};this.space();let t=this.source[this.index];if(t===`"`||t===`'`)return this.string(t);if(t===`[`)return this.array(e+1);if(t===`{`)return this.object(e+1);for(let[e,t]of[[`undefined`,void 0],[`-Infinity`,-1/0],[`Infinity`,1/0],[`false`,!1],[`true`,!0],[`null`,null],[`NaN`,NaN]])if(this.consumeWord(e))return{ok:!0,value:t};let n=this.source.slice(this.index).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/);return n?(this.index+=n[0].length,{ok:!0,value:Number(n[0])}):{ok:!1}}string(e){this.index++;let t=``;for(;this.index=this.source.length)return{ok:!1};let r=this.source[this.index++],i={'"':`"`,"'":`'`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:` -`,r:`\r`,t:` `};if(r in i){t+=i[r];continue}if(r!==`u`)return{ok:!1};let a=this.source.slice(this.index,this.index+4);if(!/^[0-9a-f]{4}$/i.test(a))return{ok:!1};t+=String.fromCharCode(Number.parseInt(a,16)),this.index+=4}return{ok:!1}}array(e){this.index++,this.space();let t=[];if(this.consume(`]`))return{ok:!0,value:t};for(;;){if(t.length>=1e3)return{ok:!1};let n=this.value(e);if(!n.ok)return n;if(t.push(n.value),this.space(),this.consume(`]`))return{ok:!0,value:t};if(!this.consume(`,`))return{ok:!1};if(this.space(),this.consume(`]`))return{ok:!0,value:t}}}object(e){this.index++,this.space();let t=Object.create(null);if(this.consume(`}`))return{ok:!0,value:t};let n=0;for(;;){if(n++>=1e3)return{ok:!1};let r,i=this.source[this.index];if(i===`"`||i===`'`){let e=this.string(i);if(!e.ok)return e;r=e.value}else if(r=this.identifier(),!r)return{ok:!1};if(this.space(),!this.consume(`:`))return{ok:!1};let a=this.value(e);if(!a.ok)return a;if(Object.defineProperty(t,r,{value:a.value,enumerable:!0,configurable:!0,writable:!0}),this.space(),this.consume(`}`))return{ok:!0,value:t};if(!this.consume(`,`))return{ok:!1};if(this.space(),this.consume(`}`))return{ok:!0,value:t}}}identifier(){let e=this.source.slice(this.index).match(/^[A-Za-z_$][\w$-]*/);return e?(this.index+=e[0].length,e[0]):``}space(){for(;/\s/.test(this.source[this.index]??``);)this.index++}peek(e){return this.source.startsWith(e,this.index)}consume(e){return this.peek(e)?(this.index+=e.length,!0):!1}consumeWord(e){if(!this.peek(e))return!1;let t=this.source[this.index+e.length];return t&&/[\w$-]/.test(t)?!1:(this.index+=e.length,!0)}};function kt(e){return typeof e==`string`?new Ot(e).parse():G(e)}function K(e){let t=e.trim().toLowerCase();return Tt.has(t)||/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)||/^(?:rgb|rgba|hsl|hsla)\([\d\s.,%+\-/]+\)$/i.test(t)?t:null}function At(e){let t=e.trim().toLowerCase();return/^(?:normal|bold|bolder|lighter|[1-9]00)$/.test(t)?t:null}function jt(e){let t=e.trim().toLowerCase();return/^(?:normal|italic|oblique)$/.test(t)?t:null}function q(e){let t=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!t.length)return null;let n=new Set([`none`,`underline`,`overline`,`line-through`]);return t.some(e=>!n.has(e))||t.includes(`none`)&&t.length!==1?null:[...new Set(t)].join(` `)}function Mt(e){if(typeof e!=`string`||e.length>4096)return{};let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e<1)continue;let r=n.slice(0,e).trim().toLowerCase(),i=n.slice(e+1).trim();if(!(!i||/(?:url|expression|var)\s*\(/i.test(i)||/[{}<>]/.test(i)))switch(r){case`color`:{let e=K(i);e&&(t.color=e);break}case`background-color`:{let e=K(i);e&&(t.backgroundColor=e);break}case`font-weight`:{let e=At(i);e&&(t.fontWeight=e);break}case`font-style`:{let e=jt(i);e&&(t.fontStyle=e);break}case`text-decoration`:case`text-decoration-line`:{let e=q(i);e&&(t.textDecorationLine=e);break}}}return t}function Nt(e){return e&&Object.keys(e).length?{...e}:void 0}function Pt(e,t){return e?.color===t?.color&&e?.backgroundColor===t?.backgroundColor&&e?.fontWeight===t?.fontWeight&&e?.fontStyle===t?.fontStyle&&e?.textDecorationLine===t?.textDecorationLine}function Ft(e,t,n){let r=e[e.length-1];r?.kind===`text`&&Pt(r.style,n)?e[e.length-1]={...r,text:r.text+t}:e.push({kind:`text`,text:t,style:Nt(n)})}function It(e,t){return e.length<=t.maxStringLength?e:`${e.slice(0,t.maxStringLength)}…[${e.length-t.maxStringLength} more]`}function Lt(e,t){let n=It(e,t);return JSON.stringify(n)??`""`}function J(e){return Number.isNaN(e)?`NaN`:e===1/0?`Infinity`:e===-1/0?`-Infinity`:Object.is(e,-0)?`-0`:String(e)}function Rt(e){if(e===null)return`null`;try{if(Array.isArray(e))return`array`;if(e instanceof Error)return`error`}catch{return`object`}let t=typeof e;return t===`string`||t===`number`||t===`bigint`||t===`boolean`||t===`undefined`||t===`symbol`||t===`function`?t:`object`}function zt(e,t){try{let n=e;for(let e=0;n&&e<16;e++){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return`value`in e&&typeof e.value==`string`?e.value:void 0;n=Object.getPrototypeOf(n)}}catch{}}function Bt(e,t){try{let n=Object.getOwnPropertyDescriptor(t,`size`)?.get;if(!n)return null;let r=Reflect.apply(n,e,[]);return typeof r==`number`&&Number.isSafeInteger(r)&&r>=0?r:null}catch{return null}}function Y(e){try{let t=Object.getOwnPropertyDescriptor(e,`name`);return typeof t?.value==`string`&&t.value?t.value:`anonymous`}catch{return`anonymous`}}function Vt(e){try{if(Array.isArray(e)){let t=Object.getOwnPropertyDescriptor(e,`length`)?.value;return`Array(${typeof t==`number`?t:`?`})`}if(e instanceof Map)return`Map(${Bt(e,Map.prototype)??`?`})`;if(e instanceof Set)return`Set(${Bt(e,Set.prototype)??`?`})`;if(e instanceof Date)return`Date`;if(e instanceof Error)return zt(e,`name`)||`Error`}catch{return`Object`}return`Object`}function Ht(e,t,n,r,i){if(e===null)return`null`;switch(typeof e){case`string`:return i?Lt(e,t):It(e,t);case`number`:return J(e);case`bigint`:return`${e}n`;case`boolean`:return String(e);case`undefined`:return`undefined`;case`symbol`:return String(e);case`function`:return`[Function ${Y(e)}]`}let a=e;if(r.has(a))return`[Circular]`;if(n>=t.maxDepth)return`[${Vt(a)}]`;r.add(a);try{if(a instanceof Date){let e=Date.prototype.getTime.call(a);return Number.isNaN(e)?`Invalid Date`:Date.prototype.toISOString.call(a)}if(a instanceof RegExp)return RegExp.prototype.toString.call(a);if(a instanceof Error){let e=zt(a,`name`),n=zt(a,`message`);return`${e||`Error`}${n?`: ${It(n,t)}`:``}`}if(a instanceof Map){let e=Bt(a,Map.prototype),i=[],o=0;for(let[e,s]of Map.prototype.entries.call(a)){if(o++>=t.maxObjectKeys)break;i.push(`${Ht(e,t,n+1,r,!0)} => ${Ht(s,t,n+1,r,!0)}`)}return e!==null&&e>i.length&&i.push(`… ${e-i.length} more`),`Map(${e??`?`}) { ${i.join(`, `)} }`}if(a instanceof Set){let e=Bt(a,Set.prototype),i=[],o=0;for(let e of Set.prototype.values.call(a)){if(o++>=t.maxObjectKeys)break;i.push(Ht(e,t,n+1,r,!0))}return e!==null&&e>i.length&&i.push(`… ${e-i.length} more`),`Set(${e??`?`}) { ${i.join(`, `)} }`}let e=Object.getOwnPropertyDescriptors(a),i=Reflect.ownKeys(e).filter(t=>e[t]?.enumerable),o=i.slice(0,t.maxObjectKeys),s=o.map(i=>{let a=e[i],o=typeof i==`symbol`?`[${String(i)}]`:/^[A-Za-z_$][\w$]*$/.test(i)?i:Lt(i,t);return!a||!(`value`in a)?`${o}: ${a?.get&&a?.set?`[Getter/Setter]`:a?.get?`[Getter]`:`[Setter]`}`:`${o}: ${Ht(a.value,t,n+1,r,!0)}`});return i.length>o.length&&s.push(`… ${i.length-o.length} more`),Array.isArray(a)?`[${s.map(e=>e.replace(/^\d+: /,``)).join(`, `)}]`:`{ ${s.join(`, `)} }`}catch(e){return`[Uninspectable: ${It(e instanceof Error?e.message:`inspection failed`,t)}]`}finally{r.delete(a)}}function Ut(e,t={}){return Ht(e,W(t),0,new Set,!1)}function Wt(e,t,n=`inline`,r){return{kind:`value`,text:Ht(e,n===`compact`?{...t,maxDepth:Math.min(2,t.maxDepth),maxObjectKeys:Math.min(12,t.maxObjectKeys)}:t,0,new Set,!1),valueType:Rt(e),presentation:n,style:Nt(r)}}function Gt(e,t){return typeof e==`string`?It(e,t):Ht(e,{...t,maxDepth:Math.min(t.maxDepth,2)},0,new Set,!1)}function Kt(e,t){if(typeof e==`bigint`)return String(e);let n;try{n=Number(e)}catch{n=NaN}return t&&Number.isFinite(n)&&(n=Math.trunc(n)),J(n)}function qt(e,t={}){let n=W(t);if(!e.length)return[{kind:`text`,text:``}];let r=[],i=0;if(typeof e[0]==`string`){let t=It(e[0],n);i=1;let a={},o=``,s=()=>{o&&=(Ft(r,o,a),``)};for(let c=0;c=t.length){o+=l;continue}let u=t[c+1];if(u===`%`){o+=`%`,c++;continue}if(!`sdifoOc`.includes(u)||i>=e.length){o+=`%${u}`,c++;continue}s();let d=e[i++];switch(c++,u){case`s`:Ft(r,Gt(d,n),a);break;case`d`:case`i`:r.push({kind:`value`,text:Kt(d,!0),valueType:`number`,presentation:`inline`,style:Nt(a)});break;case`f`:r.push({kind:`value`,text:Kt(d,!1),valueType:`number`,presentation:`inline`,style:Nt(a)});break;case`o`:r.push(Wt(d,n,`compact`,a));break;case`O`:r.push(Wt(d,n,`expanded`,a));break;case`c`:a=Mt(d)}}s()}for(;ie.text).join(``)}function Yt(e){if(!e)return``;let t=[];return e.color&&t.push(`color:${e.color}`),e.backgroundColor&&t.push(`background-color:${e.backgroundColor}`),e.fontWeight&&t.push(`font-weight:${e.fontWeight}`),e.fontStyle&&t.push(`font-style:${e.fontStyle}`),e.textDecorationLine&&t.push(`text-decoration-line:${e.textDecorationLine}`),t.join(`;`)}function Xt(e){let t=``,n=``,r=[],i=e.length?e:[{kind:`text`,text:``}];for(let e of i){let i=Yt(e.style);i!==n&&(t+=`%c`,r.push(i),n=i),t+=`%s`,r.push(e.text)}return n&&(t+=`%c`,r.push(``)),[t,...r]}function Zt(e){try{let t=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(t).filter(e=>t[e]?.enumerable).map(e=>{let n=t[e],r=typeof e==`symbol`?String(e):e;return!n||!(`value`in n)?{key:r,value:n?.get?`[Getter]`:`[Setter]`}:{key:r,value:n.value}})}catch{return[]}}function Qt(e){try{if(e instanceof Map)return Array.from(Map.prototype.entries.call(e),([e,t])=>({key:Ut(e,{maxDepth:1,maxObjectKeys:4}),value:t}));if(e instanceof Set)return Array.from(Set.prototype.values.call(e),(e,t)=>({key:String(t),value:e}));if(e!==null&&(typeof e==`object`||typeof e==`function`))return Zt(e)}catch{}return[{key:`0`,value:e}]}function $t(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){if(typeof r!=`string`&&typeof r!=`number`)continue;let e=It(String(r),t);if(e&&!n.includes(e)&&n.push(e),n.length>=t.maxTableColumns)break}return n}function en(e,t,n){let r=Qt(e),i=r.slice(0,n.maxTableRows),a=$t(t,n),o=[],s=!1;for(let e of i){let t=e.value;if(t!==null&&(typeof t==`object`||typeof t==`function`))for(let e of Zt(t))o.includes(e.key)||o.push(e.key);else s=!0}let c=a??[...o,...s||!o.length?[`Value`]:[]],l=c.slice(0,n.maxTableColumns);return{columns:[`(index)`,...l],rows:i.map(e=>{let t={"(index)":[Wt(e.key,n)]},r=e.value!==null&&(typeof e.value==`object`||typeof e.value==`function`)?new Map(Zt(e.value).map(e=>[e.key,e.value])):null;for(let i of l)t[i]=i===`Value`?[Wt(e.value,n,`compact`)]:r?.has(i)?[Wt(r.get(i),n,`compact`)]:[{kind:`text`,text:``}];return{key:e.key,cells:t}}),omittedRows:Math.max(0,r.length-i.length),omittedColumns:Math.max(0,c.length-l.length)}}function tn(e){switch(e){case`info`:return`info`;case`warn`:return`warn`;case`error`:case`assert`:return`error`;case`debug`:return`debug`;default:return`log`}}function nn(e){let t=Math.max(0,e),n=t<1e3?t:t/1e3,r=t<1e3?`ms`:`s`;return`${Number(n.toFixed(3))} ${r}`}function rn(e,t){if(typeof e!=`string`)return;let n=e.replace(/\r\n?/g,` -`).replace(/\u001b\[[0-?]*[ -/]*[@-~]/g,``).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,``).trim();return n?It(n,t):void 0}var an=class{options;transcriptValue=[];groups=[];counters=new Map;timers=new Map;nextEntryID=0;nextGroupID=0;revisionValue=0;constructor(e={}){this.options=W(e)}dispatch(e){let t=kt(e);return t?this.invoke(t.method,t.args,t.timestamp,t.stack):this.emitMessage(`warn`,[`Unsupported console invocation payload.`],this.options.now())}invoke(e,t=[],n,r){let i=Et(e),a=Number.isFinite(n)?Number(n):this.options.now();if(!i)return this.emitMessage(`warn`,[`Unsupported console method: ${String(e)}`],a);switch(i){case`log`:case`info`:case`warn`:case`error`:case`debug`:return this.emitMessage(i,t,a);case`dir`:case`dirxml`:return this.append({...this.base(a),kind:`message`,method:i,level:`log`,tokens:[Wt(t[0],this.options,`expanded`)]});case`trace`:{let e=t.length?[...qt(t,this.options)]:[{kind:`text`,text:`Trace`}],n=r;if(n===void 0)try{n=this.options.captureStack()}catch{n=void 0}let o=rn(n,this.options);return o&&e.push({kind:`text`,text:`\n${o}`}),this.append({...this.base(a),kind:`message`,method:i,level:`debug`,tokens:e})}case`assert`:{if(t[0])return this.noop();let e=t.slice(1),n=e.length?[...qt(e,this.options)]:[],r=[{kind:`text`,text:`Assertion failed`}];return n.length&&r.push({kind:`text`,text:`: `},...n),this.append({...this.base(a),kind:`message`,method:`assert`,level:`error`,tokens:r})}case`group`:case`groupCollapsed`:{let e=i===`groupCollapsed`,n=t.length?qt(t,this.options):[{kind:`text`,text:`console.group`}],r={...this.base(a),kind:`group`,method:i,level:`log`,collapsed:e,tokens:n},o=this.append(r);return this.groups.push({id:++this.nextGroupID,label:Jt(n),collapsed:e}),this.revisionValue++,{...o,transcript:this.entries()}}case`groupEnd`:return this.groups.length&&(this.groups.pop(),this.revisionValue++),this.noop();case`clear`:return this.transcriptValue=[],this.groups=[],this.revisionValue++,{emitted:[],transcript:[],cleared:!0,ignored:!1};case`count`:{let e=this.label(t[0]),n=(this.counters.get(e)??0)+1;return this.counters.set(e,n),this.emitMessage(`log`,[`${e}: ${n}`],a)}case`countReset`:{let e=this.label(t[0]);return this.counters.has(e)?(this.counters.set(e,0),this.revisionValue++,this.noop()):this.emitMessage(`warn`,[`Count for '${e}' does not exist.`],a)}case`time`:{let e=this.label(t[0]);return this.timers.has(e)?this.emitMessage(`warn`,[`Timer '${e}' already exists.`],a):(this.timers.set(e,a),this.revisionValue++,this.noop())}case`timeLog`:case`timeEnd`:{let e=this.label(t[0]),n=this.timers.get(e);if(n===void 0)return this.emitMessage(`warn`,[`Timer '${e}' does not exist.`],a);let r=`${e}: ${nn(a-n)}`,o=i===`timeLog`?t.slice(1):[];i===`timeEnd`&&this.timers.delete(e);let s=[{kind:`text`,text:r}];return o.length&&s.push({kind:`text`,text:` `},...qt(o,this.options)),this.append({...this.base(a),kind:`message`,method:i,level:`log`,tokens:s})}case`table`:{let e=en(t[0],t[1],this.options);return this.append({...this.base(a),kind:`table`,method:`table`,level:`log`,...e})}}}snapshot(){let e=Object.create(null);for(let[t,n]of this.counters)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1});return{entries:this.entries(),depth:this.groups.length,groups:this.groupPath(),counters:e,timers:[...this.timers.keys()],revision:this.revisionValue}}entries(){return this.transcriptValue.slice()}reset(){this.transcriptValue=[],this.groups=[],this.counters.clear(),this.timers.clear(),this.nextEntryID=0,this.nextGroupID=0,this.revisionValue++}label(e){return e===void 0?`default`:Gt(e,this.options)}groupPath(){return this.groups.map(e=>({...e}))}base(e){let t=this.groupPath();return{id:++this.nextEntryID,timestamp:e,depth:t.length,groupPath:t,hidden:t.some(e=>e.collapsed)}}emitMessage(e,t,n){return this.append({...this.base(n),kind:`message`,method:e,level:tn(e),tokens:qt(t,this.options)})}append(e){return this.transcriptValue.push(e),this.transcriptValue.length>this.options.maxEntries&&this.transcriptValue.splice(0,this.transcriptValue.length-this.options.maxEntries),this.revisionValue++,{emitted:[e],transcript:this.entries(),cleared:!1,ignored:!1}}noop(){return{emitted:[],transcript:this.entries(),cleared:!1,ignored:!0}}},X=L(),on=[[`a`,8,5,28,5],[`b`,31,8,31,27],[`c`,31,32,31,51],[`d`,8,54,28,54],[`e`,5,32,5,51],[`f`,5,8,5,27],[`g`,8,29.5,28,29.5]];function sn(e){return!!(e&&Array.isArray(e.raw_segments)&&e.raw_segments.length===4&&e.raw_segments.every(e=>Number.isInteger(e)&&e>=0&&e<=255))}function cn({panel:e,label:t=`Live four-digit display preview`}){return sn(e)?(0,X.jsx)(`div`,{className:`live-segment-preview${e.segments_active?` is-active`:``}`,dir:`ltr`,"aria-label":t,children:e.raw_segments.map((e,t)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 40 62`,role:`img`,"aria-label":`digit ${t+1} raw 0x${e.toString(16).padStart(2,`0`)}`,children:[on.map(([t,n,r,i,a],o)=>(0,X.jsx)(`line`,{x1:n,y1:r,x2:i,y2:a,className:e&1<u(e.currentTarget.open),children:[(0,X.jsxs)(`summary`,{className:`advanced-panel__summary`,children:[(0,X.jsx)(`span`,{className:`advanced-panel__icon`,children:(0,X.jsx)(D,{icon:e,size:18})}),(0,X.jsxs)(`span`,{className:`advanced-panel__copy`,children:[(0,X.jsx)(`small`,{children:t}),(0,X.jsx)(`strong`,{children:n}),(0,X.jsx)(`span`,{children:r})]}),c&&(0,X.jsx)(se,{tone:s,children:c}),(0,X.jsx)(o,{className:`advanced-panel__chevron`,"aria-hidden":`true`,size:17})]}),(0,X.jsx)(`div`,{className:`advanced-panel__body`,children:i})]})}function un(e,t,n,r){let i=Number.parseInt(e,10);return Number.isFinite(i)?Math.min(r,Math.max(n,i)):t}function dn(e){return e.trim().split(/\s+/).filter(Boolean).join(` `)}function fn(e,t){let n=e.trim(),r=t.trim();if(n&&/^[\x20-\x7e]{1,4}$/.test(r))return`host-menu set ${z(n)} label ${z(r)}`}function pn(e,t,n,r=``){return e===`lcd`?{targets:[e],type:t,text:`${n}\n${r}`,line1:n,line2:r}:{targets:[e],type:t,text:n}}function mn({snapshot:e,locale:t,run:i,busy:a,transport:o}){let s=N(e),f=t===`fa`,h=(e,t)=>f?t:e,g=o.boardState===`ready`&&e.connected&&e.have_status,ee=a.length>0,[v,y]=(0,V.useState)(``),[re,oe]=(0,V.useState)(!0),[ce,w]=(0,V.useState)(500),[E,D]=(0,V.useState)(`running`),[O,de]=(0,V.useState)(!1),[fe,I]=(0,V.useState)(`web workbench`),[L,he]=(0,V.useState)(!1),[_e,R]=(0,V.useState)(!0),[ve,be]=(0,V.useState)(!0),[xe,we]=(0,V.useState)(`status`),[Te,ke]=(0,V.useState)(`0xFFFF`),[je,Ne]=(0,V.useState)(`status voltage current temperature`),[Pe,Fe]=(0,V.useState)(``),[Ie,Le]=(0,V.useState)(``),[ze,Ve]=(0,V.useState)(s.segments&&(e.have_front_panel||e.have_front_panel_segments)?e.front_panel:void 0),[Ue,Ge]=(0,V.useState)(0),[B,Je]=(0,V.useState)(100),[Xe,Ze]=(0,V.useState)(20),[Qe,et]=(0,V.useState)(``),[tt,nt]=(0,V.useState)(32),[it,ot]=(0,V.useState)(214),[ct,lt]=(0,V.useState)(220),[ut,ft]=(0,V.useState)(180),[mt,ht]=(0,V.useState)(`attention`),[gt,vt]=(0,V.useState)(`1`),[bt,St]=(0,V.useState)(`key`),[wt,Tt]=(0,V.useState)(`1`),[H,U]=(0,V.useState)(`press`),[W,Et]=(0,V.useState)(`0x27`),[Dt,G]=(0,V.useState)(2),[Ot,kt]=(0,V.useState)(4),[K,At]=(0,V.useState)(`0x00`),[jt,q]=(0,V.useState)(`F13`),[Mt,Nt]=(0,V.useState)(80),[Pt,Ft]=(0,V.useState)(`lock`),[It,Lt]=(0,V.useState)(``),[J,Rt]=(0,V.useState)(`host`),[zt,Bt]=(0,V.useState)(`ui.note`),[Y,Vt]=(0,V.useState)(``),[Ht,Ut]=(0,V.useState)(``),[Wt,Gt]=(0,V.useState)(``),[Kt,qt]=(0,V.useState)(!0),[Jt,Yt]=(0,V.useState)(!0),[Xt,Zt]=(0,V.useState)(!0),[Qt,$t]=(0,V.useState)(!0),[en,tn]=(0,V.useState)(!0),[nn,rn]=(0,V.useState)(1500),[an,on]=(0,V.useState)(``),[sn,mn]=(0,V.useState)(37889),[hn,Z]=(0,V.useState)([]),[gn,_n]=(0,V.useState)(60),[vn,yn]=(0,V.useState)(100),[bn,xn]=(0,V.useState)(h(`No service query yet.`,`هنوز پرس‌وجوی سرویسی انجام نشده است.`)),[Sn,Cn]=(0,V.useState)(``),[wn,Tn]=(0,V.useState)(`backup`),[Q,En]=(0,V.useState)({command:``,reason:``,risk:`normal`,needsDevice:!1}),[Dn,On]=(0,V.useState)(``),[kn,An]=(0,V.useState)(!1);(0,V.useEffect)(()=>{e.have_settings&&(he(!!(e.settings.flags&1)),R(!(e.settings.flags&32)),be(!(e.settings.flags&64)),oe(e.settings.stream_period_ms>0),e.settings.stream_period_ms>0&&w(e.settings.stream_period_ms))},[e.have_settings,e.settings.flags,e.settings.stream_period_ms]),(0,V.useEffect)(()=>{!v&&e.port.name&&y(e.port.name)},[v,e.port.name]),(0,V.useEffect)(()=>{!O&&e.program_state?.mode&&D(e.program_state.mode.toLowerCase()===`running`?`running`:`idle`)},[O,e.program_state?.mode]),(0,V.useEffect)(()=>{!g&&J===`lcd`&&Rt(`host`)},[J,g]),(0,V.useEffect)(()=>{!g||!s.segments?Ve(void 0):(e.have_front_panel||e.have_front_panel_segments)&&e.front_panel&&Ve(e.front_panel)},[s.segments,g,e.front_panel_updated,e.have_front_panel,e.have_front_panel_segments,e.front_panel]),(0,V.useEffect)(()=>{g&&s.segments&&!e.have_front_panel&&k(`controller.front_panel`).then(Ve).catch(()=>void 0)},[s.segments,g,e.have_front_panel]),(0,V.useEffect)(()=>{xn(h(`No service query yet.`,`هنوز پرس‌وجوی سرویسی انجام نشده است.`))},[t]),(0,V.useEffect)(()=>{let e=!0;return k(`controller.discovery.config.get`).then(t=>{e&&(qt(t.mdns_enabled||t.dns_sd_enabled),Yt(t.ssdp_enabled||t.upnp_enabled),Zt(t.ws_discovery_enabled),$t(t.broadcast_enabled),tn(t.netbios_enabled),mn(t.broadcast_port||37889),on(t.instance_name||``))}).catch(()=>{}),()=>{e=!1}},[]);let jn=(0,V.useMemo)(()=>{let e=gt.trim()||`1`;switch(bt){case`none`:return`rf map ${e} none`;case`menu`:return`rf map ${e} menu ${wt.trim()||`next`}`;case`side`:return`rf map ${e} side ${wt.trim()||`left`} ${H.trim()||`stop`}`;case`relay`:return`rf map ${e} relay ${wt.trim()||`5`} ${H.trim()||`press`}`;case`pwm`:return`rf map ${e} pwm ${wt.trim()||`0`} ${H.trim()||`press`}`;default:return`rf map ${e} key ${wt.trim()||`1`} ${H.trim()||`press`}`}},[H,gt,bt,wt]),Mn=(e,t,n=`caution`,r=!1,i)=>{kn||(En({command:e.trim(),reason:t,risk:n,needsDevice:r,execute:i}),On(``),window.requestAnimationFrame(()=>{document.getElementById(`advanced-command-review`)?.scrollIntoView({behavior:`smooth`,block:`center`})}))},Nn=async()=>{if(!Q.command)return;let e=Q;On(``),An(!0);try{if(e.execute){let t=await e.execute();xn(JSON.stringify(t,null,2))}else await i(e.command)}catch(e){let t=e instanceof Error?e.message:String(e);xn(`! ${t}`)}finally{On(``),En({command:``,reason:``,risk:`normal`,needsDevice:!1}),An(!1)}},Pn=async(e,t)=>{Cn(e);try{let e=await t();xn(JSON.stringify(e,null,2))}catch(e){let t=e instanceof Error?e.message:String(e);xn(`! ${t}`)}finally{Cn(``)}},Fn=e=>{e.preventDefault();let t=zt.trim();if(!t)return;if(J===`lcd`){if(!Jn)return;Pn(`message`,()=>k(`controller.message.send`,pn(`lcd`,t,Ht,Wt)));return}let n=Y.trim();!n||qn>4096||Pn(`message`,()=>k(`controller.message.send`,pn(`host`,t,n)))},In=e=>{let t=new Date(Date.now()-gn*6e4).toISOString(),n=e===`status`?`controller.history.status`:`controller.history.timeline`,r=e===`status`?{since:t}:{since:t,limit:vn};Pn(`history-${e}`,()=>k(n,r))},Ln=async()=>{Cn(`discovery`);try{let e=await k(`controller.discovery.scan`,{timeout_ms:nn,mdns:Kt,dns_sd:Kt,ssdp:Jt,upnp:Jt,ws_discovery:Xt,broadcast:Qt,netbios:en});Z(e),xn(JSON.stringify(e,null,2))}catch(e){let t=e instanceof Error?e.message:String(e);xn(`! ${t}`)}finally{Cn(``)}},Rn=()=>{Pn(`discovery-config`,async()=>{let e=await k(`controller.discovery.config.set`,{mdns_enabled:Kt,dns_sd_enabled:Kt,ssdp_enabled:Jt,upnp_enabled:Jt,ws_discovery_enabled:Xt,broadcast_enabled:Qt,netbios_enabled:en,broadcast_port:sn,instance_name:an.trim()});return on(e.instance_name||``),mn(e.broadcast_port||37889),e})},zn=e=>{let t=e.public?.endpoints.web||`http://${e.host}:${e.port}/`;try{let e=new URL(t);if(e.protocol!==`http:`&&e.protocol!==`https:`)throw Error(`unsupported endpoint protocol`);window.location.assign(e.href)}catch(t){let n=t instanceof Error?t.message:String(t);xn(`! Cannot connect to ${e.name}: ${n}`)}},Bn=e=>{switch(St(e),e){case`none`:Tt(``),U(``);break;case`menu`:Tt(`next`),U(``);break;case`relay`:Tt(`5`),U(`toggle`);break;case`side`:Tt(`left`),U(`stop`);break;case`pwm`:Tt(`0`),U(`press`);break;default:Tt(`1`),U(`press`)}},Vn=v.trim()?`open ${z(v.trim())}`:`open`,Hn=`stream ${re?ce:0}`,Un=E===`idle`?`program-state set web idle`:`program-state set web running ${z(fe.trim()||`web workbench`)}`,Wn=dn(K),Gn=`i2c transfer ${W.trim()||`0x27`} ${Dt} ${Ot}${Wn?` ${Wn}`:``}`,Kn=fn(Pe,Ie),qn=new TextEncoder().encode(Y.trim()).byteLength,Jn=!!(Ht||Wt)&&Ht.length<=16&&Wt.length<=16&&/^[\x20-\x7e]*$/.test(Ht)&&/^[\x20-\x7e]*$/.test(Wt),Yn=J===`lcd`,$=ge(e,t),Xn=!Q.command||ee||kn||Q.needsDevice&&!g||Q.risk===`danger`&&Dn.trim().toUpperCase()!==`RUN`;return(0,X.jsxs)(`section`,{className:`advanced-surface`,"aria-labelledby":`advanced-workbench-title`,children:[(0,X.jsxs)(`header`,{className:`advanced-heading`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:h(`DEEP CONTROL / PROGRESSIVE DISCLOSURE`,`کنترل عمیق / نمایش مرحله‌ای`)}),(0,X.jsx)(`h2`,{id:`advanced-workbench-title`,children:h(`Advanced capability deck`,`میز قابلیت‌های پیشرفته`)}),(0,X.jsx)(`p`,{children:h(`The common controls stay calm; every specialist path remains reachable here through the same primary dispatcher.`,`کنترل‌های روزمره ساده می‌مانند و تمام مسیرهای تخصصی از همین بخش و هسته فرمان اصلی در دسترس هستند.`)})]}),(0,X.jsx)(se,{tone:g?`good`:`warn`,pulse:g,children:g?h(`DEVICE ACTIONS READY`,`فرمان‌های برد آماده`):h(`HOST CONTROLS ONLY`,`فقط کنترل میزبان`)})]}),(0,X.jsxs)(`div`,{className:`advanced-grid`,children:[(0,X.jsxs)(ln,{icon:r,eyebrow:h(`SERIAL LIFECYCLE`,`چرخه اتصال سریال`),title:h(`Connection, stream & program state`,`اتصال، جریان وضعیت و حالت برنامه`),detail:h(`Port discovery, authenticated open/reconnect, telemetry cadence and shared run state.`,`کشف درگاه، اتصال امن، آهنگ تله‌متری و حالت اجرای مشترک.`),defaultOpen:!0,status:g?e.port.name||h(`connected`,`متصل`):$.title,tone:g?`good`:$.tone===`bad`?`bad`:`warn`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:$e,busy:a===`ports`,onClick:()=>void i(`ports`),children:h(`List ports`,`فهرست درگاه‌ها`)}),g&&(0,X.jsx)(j,{icon:T,busy:a===`status`,onClick:()=>void i(`status`),children:h(`Live status`,`وضعیت زنده`)}),(0,X.jsx)(j,{icon:Ct,busy:a===`program-state`,onClick:()=>void i(`program-state`),children:h(`Program state`,`حالت برنامه`)})]}),(0,X.jsx)(`div`,{className:`advanced-fields`,children:(0,X.jsx)(P,{label:h(`Serial port · blank = authenticated auto-detect`,`درگاه سریال · خالی = کشف امن خودکار`),value:v,dir:`ltr`,spellCheck:!1,onChange:e=>y(e.target.value),action:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{tone:`primary`,icon:pt,busy:a===Vn,onClick:()=>void i(Vn),children:h(`Open`,`اتصال`)}),(0,X.jsx)(j,{icon:n,busy:a===`reconnect`||$.animated,disabled:$.retryDisabled,onClick:()=>void i(`reconnect`),children:g?h(`Reconnect`,`اتصال مجدد`):$.action}),g&&(0,X.jsx)(j,{icon:te,busy:a===`close`,onClick:()=>void i(`close`),children:h(`Close & pause`,`بستن و توقف`)})]})})}),!g&&(0,X.jsxs)(`div`,{className:`data-list connection-details`,children:[(0,X.jsx)(ue,{label:h(`Phase`,`مرحله`),value:$.title,tone:$.tone===`bad`?`bad`:$.tone===`warn`?`warn`:void 0}),$.candidate&&(0,X.jsx)(ue,{label:h(`Candidate`,`گزینه`),value:$.candidate,mono:!0}),$.attempt&&(0,X.jsx)(ue,{label:h(`Attempt`,`تلاش`),value:$.attempt}),$.timing&&(0,X.jsx)(ue,{label:h(`Timing`,`زمان‌بندی`),value:$.timing}),$.detail&&(0,X.jsx)(ue,{label:h(`Detail`,`جزئیات`),value:$.detail})]}),g&&(0,X.jsxs)(`div`,{className:`advanced-control-row`,children:[(0,X.jsx)(Ce,{checked:re,onChange:oe,label:h(`Status stream`,`جریان وضعیت`),detail:h(`Desired value; Apply sends the EEPROM-safe stream command.`,`مقدار درخواستی؛ اعمال، فرمان امن جریان را می‌فرستد.`)}),re&&(0,X.jsx)(M,{label:h(`Period`,`دوره`),value:ce,min:100,max:5e3,step:100,unit:`ms`,onChange:w}),(0,X.jsx)(j,{icon:p,busy:a===Hn,onClick:()=>void i(Hn),children:h(`Apply stream`,`اعمال جریان`)})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--program`,children:[(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Desired host program state`,`حالت برنامه در میزبان`)}),(0,X.jsx)(le,{value:E,label:h(`Program mode`,`حالت برنامه`),options:[{value:`idle`,label:h(`Idle`,`آماده`)},{value:`running`,label:h(`Running`,`در حال اجرا`)}],onChange:e=>{D(e),de(!0)}})]}),(0,X.jsx)(P,{label:h(`Reason`,`دلیل`),value:fe,disabled:E===`idle`,onChange:e=>I(e.target.value)}),(0,X.jsx)(j,{icon:C,onClick:()=>Mn(Un,h(`Review the shared host/board program-state transition.`,`تغییر حالت برنامه میزبان و برد را بازبینی کنید.`),`caution`),children:h(`Prepare state change`,`آماده‌سازی تغییر حالت`)})]})]}),g&&(0,X.jsxs)(X.Fragment,{children:[(s.temperatureLED||s.temperatureBTAudio)&&(0,X.jsxs)(ln,{icon:l,eyebrow:`DS18B20`,title:h(`Temperature identities`,`شناسه‌های دما`),detail:h(`Read assigned channels, inspect ROM identities, or explicitly rescan the OneWire bus.`,`خواندن کانال‌ها، بررسی شناسه ROM یا پویش دوباره گذرگاه OneWire.`),status:g?h(`available`,`آماده`):h(`device required`,`نیازمند برد`),tone:g?`info`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:l,disabled:!g,busy:a===`temp`,onClick:()=>void i(`temp`),children:h(`Read values`,`خواندن دما`)}),(0,X.jsx)(j,{icon:$e,disabled:!g,busy:a===`temp list`,onClick:()=>void i(`temp list`),children:h(`List identities`,`فهرست شناسه‌ها`)}),(0,X.jsx)(j,{icon:_t,disabled:!g,busy:a===`temp scan`,onClick:()=>void i(`temp scan`),children:h(`Rescan bus`,`پویش دوباره`)})]}),(0,X.jsx)(`p`,{className:`advanced-note`,children:h(`A rescan refreshes physical sensor assignment; it does not claim that attached probes have been validated here.`,`پویش دوباره، تخصیص حسگر فیزیکی را به‌روز می‌کند؛ این صفحه به‌تنهایی تأییدکننده سلامت سخت‌افزار متصل نیست.`)})]}),(0,X.jsxs)(ln,{icon:A,eyebrow:h(`EEPROM-BACKED`,`ذخیره‌شده در EEPROM`),title:h(`Silent mode & firmware buzzer cues`,`حالت بی‌صدا و اعلان‌های بیزر`),detail:h(`Inspect the authoritative board settings, choose desired audio policy, then apply explicitly.`,`تنظیمات معتبر برد را ببینید، سیاست صوتی دلخواه را انتخاب و صریحاً اعمال کنید.`),status:e.have_settings?h(`settings synced`,`تنظیمات همگام`):h(`not read`,`خوانده نشده`),tone:e.have_settings?`good`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:b,disabled:!g,busy:a===`settings`,onClick:()=>void i(`settings`),children:h(`EEPROM status`,`وضعیت EEPROM`)}),(0,X.jsx)(j,{icon:Se,disabled:!g,busy:a===`silent status`,onClick:()=>void i(`silent status`),children:h(`Silent status`,`وضعیت بی‌صدا`)})]}),(0,X.jsxs)(`div`,{className:`advanced-toggle-stack`,children:[(0,X.jsx)(Ce,{checked:L,disabled:!g,onChange:he,label:h(`Silent mode`,`حالت بی‌صدا`),detail:h(`Desired persisted value.`,`مقدار ذخیره‌شونده درخواستی.`)}),(0,X.jsx)(Ce,{checked:_e,disabled:!g,onChange:R,label:h(`Door cues`,`صدای باز و بسته شدن در`),detail:h(`Desired firmware cue state.`,`وضعیت درخواستی صدای میان‌افزار.`)}),(0,X.jsx)(Ce,{checked:ve,disabled:!g,onChange:be,label:h(`Relay cues`,`صدای روشن و خاموش شدن رله`),detail:h(`Desired firmware cue state.`,`وضعیت درخواستی صدای میان‌افزار.`)})]}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:L?Se:ye,disabled:!g,busy:a===`silent ${L?`on`:`off`}`,onClick:()=>void i(`silent ${L?`on`:`off`}`),children:h(`Apply silent`,`اعمال بی‌صدا`)}),(0,X.jsx)(j,{icon:He,disabled:!g,busy:a===`settings audio door ${_e?`on`:`off`}`,onClick:()=>void i(`settings audio door ${_e?`on`:`off`}`),children:h(`Apply door cues`,`اعمال صدای در`)}),(0,X.jsx)(j,{icon:A,disabled:!g,busy:a===`settings audio relay ${ve?`on`:`off`}`,onClick:()=>void i(`settings audio relay ${ve?`on`:`off`}`),children:h(`Apply relay cues`,`اعمال صدای رله`)})]})]}),(0,X.jsxs)(ln,{icon:Ye,eyebrow:h(`FRONT PANEL`,`پنل جلویی`),title:h(`Catalog, layout & navigation`,`کاتالوگ، چیدمان و پیمایش`),detail:h(`Firmware page IDs and HOST-supplied menu overlays remain separately inspectable.`,`شناسه صفحات میان‌افزار و منوهای میزبان به‌صورت مستقل قابل بررسی هستند.`),status:ze?.tm1637_detection_known?ze.tm1637_detected?h(`TM1637 detected`,`TM1637 شناسایی شد`):h(`TM1637 not detected`,`TM1637 شناسایی نشد`):void 0,tone:ze?.tm1637_detection_known?ze.tm1637_detected?`good`:`bad`:`neutral`,defaultOpen:!0,children:[s.segments&&(0,X.jsxs)(`div`,{className:`front-panel-live`,children:[(0,X.jsx)(cn,{panel:ze,label:h(`Live physical seven-segment display`,`نمایش زندهٔ نمایشگر فیزیکی هفت‌بخشی`)}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:h(`Live physical display`,`نمایش زنده پنل`)}),(0,X.jsx)(`span`,{children:ze?e.have_front_panel?`${h(`page`,`صفحه`)} ${ze.menu_page} · ${h(`brightness`,`روشنایی`)} ${ze.brightness}/7`:`${h(`live segment frame`,`فریم زنده نمایشگر`)} · ${h(`brightness`,`روشنایی`)} ${ze.brightness}/7`:h(`Waiting for the next physical display event`,`در انتظار رویداد بعدی نمایشگر فیزیکی`)}),(0,X.jsx)(`small`,{children:h(`Physical changes update every connected client immediately through the state stream.`,`تغییرات فیزیکی از راه جریان وضعیت، همهٔ کارخواه‌های متصل را فوری به‌روز می‌کند.`)})]})]}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[s.segments&&!e.have_front_panel_segments&&(0,X.jsx)(j,{icon:n,disabled:!g,onClick:()=>void k(`controller.front_panel`).then(Ve).catch(()=>void 0),children:h(`Recover physical state`,`بازیابی وضعیت فیزیکی`)}),(0,X.jsx)(j,{icon:Me,disabled:!g,busy:a===`menu list`,onClick:()=>void i(`menu list`),children:h(`Firmware catalog`,`کاتالوگ میان‌افزار`)}),(0,X.jsx)(j,{icon:F,disabled:!g,busy:a===`menu current`,onClick:()=>void i(`menu current`),children:h(`Current page`,`صفحه فعلی`)}),(0,X.jsx)(j,{icon:Ye,disabled:!g,busy:a===`menu layout`,onClick:()=>void i(`menu layout`),children:h(`Stored layout`,`چیدمان ذخیره‌شده`)}),(0,X.jsx)(j,{icon:$e,busy:a===`host-menu list`,onClick:()=>void i(`host-menu list`),children:h(`Host catalog`,`کاتالوگ میزبان`)}),(0,X.jsx)(j,{icon:Ke,busy:a===`host-menu directory`,onClick:()=>void i(`host-menu directory`),children:h(`Host directory`,`دایرکتوری میزبان`)}),(0,X.jsx)(j,{icon:x,busy:a===`host-menu status`,onClick:()=>void i(`host-menu status`),children:h(`Overlay status`,`وضعیت لایه میزبان`)}),(0,X.jsx)(j,{icon:Ct,disabled:!g,busy:a===`host-menu open macro-library`,onClick:()=>void i(`host-menu open macro-library`),children:h(`Macro front panel`,`پنل ماکرو`)})]}),(0,X.jsx)(`div`,{className:`advanced-nav-pad`,"aria-label":h(`Firmware menu navigation`,`پیمایش منوی میان‌افزار`),children:[`prev`,`next`,`dec`,`inc`].map(e=>(0,X.jsx)(j,{compact:!0,disabled:!g,busy:a===`menu ${e}`,onClick:()=>void i(`menu ${e}`),children:e},e))}),(0,X.jsx)(`div`,{className:`advanced-nav-pad`,"aria-label":h(`HOST menu navigation`,`پیمایش منوی میزبان`),children:[[`K1`,`Previous`],[`K2`,`Next`],[`K3`,`Decrease`],[`K4`,`Select`]].map(([e,t])=>(0,X.jsx)(j,{compact:!0,disabled:!g,busy:a===`host-menu key ${e} press`,onClick:()=>void i(`host-menu key ${e} press`),children:h(`${e} · ${t}`,`${e} · ${t}`)},e))}),(0,X.jsx)(`p`,{className:`advanced-note advanced-note--safe`,children:h(`The Macro front-panel page uses the shared host library, records host command timing by default, shows playback progress, and offers safe cancel or guarded keep-output cancel.`,`صفحه ماکروی پنل از کتابخانه مشترک میزبان استفاده می‌کند، زمان فرمان‌های میزبان را ضبط می‌کند و پیشرفت اجرا و لغو امن را نشان می‌دهد.`)}),(0,X.jsxs)(`div`,{className:`advanced-fields`,children:[(0,X.jsx)(P,{label:h(`Firmware page ID or key`,`شناسه یا کلید صفحه میان‌افزار`),value:xe,dir:`ltr`,spellCheck:!1,onChange:e=>we(e.target.value),action:(0,X.jsx)(j,{icon:F,disabled:!g||!xe.trim(),busy:a===`menu page ${xe.trim()}`,onClick:()=>void i(`menu page ${z(xe.trim())}`),children:h(`Go to page`,`رفتن به صفحه`)})}),(0,X.jsx)(P,{label:h(`Host menu ID · optional`,`شناسه منوی میزبان · اختیاری`),value:Pe,dir:`ltr`,spellCheck:!1,onChange:e=>Fe(e.target.value),action:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{icon:st,disabled:!g,busy:a===`host-menu open${Pe.trim()?` ${z(Pe.trim())}`:``}`,onClick:()=>void i(`host-menu open${Pe.trim()?` ${z(Pe.trim())}`:``}`),children:h(`Open overlay`,`باز کردن لایه`)}),(0,X.jsx)(j,{icon:n,disabled:!g,busy:a===`host-menu refresh`,onClick:()=>void i(`host-menu refresh`),children:h(`Refresh`,`تازه‌سازی`)}),(0,X.jsx)(j,{icon:pe,busy:a===`host-menu close`,onClick:()=>void i(`host-menu close`),children:h(`Close`,`بستن`)})]})}),(0,X.jsx)(P,{label:h(`Short 7-segment label`,`برچسب کوتاه نمایشگر`),hint:h(`Select a HOST menu ID above, then enter 1–4 printable ASCII characters.`,`شناسه منوی میزبان را در بالا انتخاب کنید و ۱ تا ۴ نویسه ASCII وارد کنید.`),value:Ie,dir:`ltr`,maxLength:4,spellCheck:!1,onChange:e=>Le(e.target.value),action:(0,X.jsx)(j,{icon:d,disabled:!Kn,busy:a===Kn,onClick:()=>Kn&&void i(Kn),children:h(`Save label`,`ذخیره برچسب`)})})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--layout`,children:[(0,X.jsx)(P,{label:h(`Visibility mask`,`ماسک نمایش`),value:Te,dir:`ltr`,spellCheck:!1,onChange:e=>ke(e.target.value)}),(0,X.jsx)(P,{label:h(`Ordered page references`,`ترتیب شناسه یا کلید صفحات`),value:je,dir:`ltr`,spellCheck:!1,onChange:e=>Ne(e.target.value)}),(0,X.jsx)(j,{icon:yt,disabled:!Te.trim()||!dn(je),onClick:()=>Mn(`menu layout set ${Te.trim()} ${dn(je)}`,h(`Layout writes are schema-sensitive and persistent on supported firmware.`,`نوشتن چیدمان وابسته به ساختار و در میان‌افزارهای پشتیبانی‌شده ماندگار است.`),`caution`,!0),children:h(`Prepare layout write`,`آماده‌سازی نوشتن چیدمان`)})]})]}),(0,X.jsxs)(ln,{icon:m,eyebrow:`WS281X + STATUS RGB`,title:h(`Per-pixel light & effect engine`,`نور هر پیکسل و موتور افکت`),detail:``,children:[(0,X.jsxs)(`div`,{className:`advanced-fields`,children:[(0,X.jsx)(P,{label:h(`LED count`,`تعداد LED`),type:`number`,min:1,max:100,value:B,onChange:e=>{let t=un(e.target.value,100,1,100);Je(t),Ge(e=>Math.min(e,t-1))}}),(0,X.jsx)(P,{label:h(`Frames per second`,`فریم در ثانیه`),type:`number`,min:1,max:30,value:Xe,onChange:e=>Ze(un(e.target.value,20,1,30))})]}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{disabled:!g,busy:a===`strip config ${B}`,onClick:()=>void i(`strip config ${B}`),children:h(`Set LED count`,`تنظیم تعداد LED`)}),(0,X.jsx)(j,{icon:dt,disabled:!g,busy:a===`strip rainbow ${B} ${Xe}`,onClick:()=>void i(`strip rainbow ${B} ${Xe}`),children:h(`Rolling rainbow`,`رنگین‌کمان متحرک`)}),(e.strip_effects??[]).map(e=>{let t=`effect play ${e.id} ${B} ${Xe}`;return(0,X.jsx)(j,{icon:_,disabled:!g,busy:a===t,onClick:()=>void i(t),children:e.name},e.id)}),(0,X.jsx)(j,{icon:Re,onClick:()=>void i(`effect stop`),children:h(`Stop`,`توقف`)}),(0,X.jsx)(j,{icon:We,disabled:!g,onClick:()=>void i(`strip clear`),children:h(`Clear strip`,`خاموش کردن نوار`)}),(0,X.jsx)(j,{icon:T,onClick:()=>void i(`strip status`),children:h(`Stream status`,`وضعیت جریان`)})]}),(0,X.jsx)(P,{label:h(`RGB frame · six hex digits per LED`,`فریم RGB · شش رقم هگز برای هر LED`),value:Qe,dir:`ltr`,spellCheck:!1,maxLength:600,onChange:e=>et(e.target.value.replace(/\s/g,``)),action:(0,X.jsx)(j,{disabled:!g||!/^(?:[0-9a-fA-F]{6})+$/.test(Qe)||Qe.length!==B*6,onClick:()=>void i(`strip frame ${Qe}`),children:h(`Send frame`,`ارسال فریم`)})}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--pixel`,children:[(0,X.jsx)(P,{label:h(`Pixel 0..${B-1}`,`پیکسل ۰ تا ${B-1}`),type:`number`,min:0,max:B-1,value:Ue,onChange:e=>Ge(un(e.target.value,0,0,B-1))}),(0,X.jsx)(P,{label:`R`,type:`number`,min:0,max:255,value:tt,onChange:e=>nt(un(e.target.value,0,0,255))}),(0,X.jsx)(P,{label:`G`,type:`number`,min:0,max:255,value:it,onChange:e=>ot(un(e.target.value,0,0,255))}),(0,X.jsx)(P,{label:`B`,type:`number`,min:0,max:255,value:ct,onChange:e=>lt(un(e.target.value,0,0,255))})]}),(0,X.jsx)(M,{label:h(`Pixel brightness`,`روشنایی پیکسل`),value:ut,min:0,max:255,disabled:!g,onChange:ft}),(0,X.jsx)(j,{tone:`primary`,icon:at,disabled:!g,busy:a===`strip pixel ${Ue} ${tt} ${it} ${ct} ${ut}`,onClick:()=>void i(`strip pixel ${Ue} ${tt} ${it} ${ct} ${ut}`),children:h(`Apply pixel`,`اعمال پیکسل`)}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsx)(P,{label:h(`Configured effect name`,`نام افکت تعریف‌شده`),value:mt,dir:`ltr`,spellCheck:!1,onChange:e=>ht(e.target.value)}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:_,busy:a===`rgb effect list`,onClick:()=>void i(`rgb effect list`),children:h(`List effects`,`فهرست افکت‌ها`)}),(0,X.jsx)(j,{icon:T,busy:a===`rgb effect status`,onClick:()=>void i(`rgb effect status`),children:h(`Effect status`,`وضعیت افکت`)}),(0,X.jsx)(j,{icon:dt,disabled:!g||!mt.trim(),busy:a===`rgb effect play ${z(mt.trim())}`,onClick:()=>void i(`rgb effect play ${z(mt.trim())}`),children:h(`Play effect`,`اجرای افکت`)}),(0,X.jsx)(j,{icon:Re,busy:a===`rgb effect stop`,onClick:()=>void i(`rgb effect stop`),children:h(`Stop effect`,`توقف افکت`)})]})]}),(0,X.jsxs)(ln,{icon:u,eyebrow:`433 MHz`,title:h(`RF inspection, removal & mapping`,`بررسی، حذف و نگاشت RF`),detail:h(`Reads execute directly; persistent removal and mapping always enter the review dock first.`,`خواندن مستقیم انجام می‌شود؛ حذف و نگاشت ماندگار ابتدا وارد بخش بازبینی می‌شوند.`),status:g?h(`receiver ready`,`گیرنده آماده`):h(`device required`,`نیازمند برد`),tone:g?`info`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:Ae,busy:a===`rf status`,onClick:()=>void i(`rf status`),children:h(`Learn status`,`وضعیت یادگیری`)}),(0,X.jsx)(j,{icon:$e,disabled:!g,busy:a===`rf list`,onClick:()=>void i(`rf list`),children:h(`Inspect learned entries`,`بررسی ورودی‌های آموخته‌شده`)})]}),(0,X.jsx)(P,{label:h(`Learned entry ID`,`شناسه ورودی آموخته‌شده`),value:gt,dir:`ltr`,inputMode:`numeric`,onChange:e=>vt(e.target.value)}),(0,X.jsx)(`div`,{className:`advanced-actions`,children:(0,X.jsx)(j,{tone:`danger`,icon:c,disabled:!gt.trim(),onClick:()=>Mn(`rf remove ${gt.trim()}`,h(`This permanently removes one learned RF entry from the board.`,`این فرمان یک ورودی RF آموخته‌شده را برای همیشه از برد حذف می‌کند.`),`danger`,!0),children:h(`Prepare removal`,`آماده‌سازی حذف`)})}),(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Mapping kind`,`نوع نگاشت`)}),(0,X.jsx)(le,{value:bt,label:h(`RF mapping kind`,`نوع نگاشت RF`),options:[{value:`key`,label:h(`Key`,`کلید`)},{value:`menu`,label:h(`Menu`,`منو`)},{value:`relay`,label:h(`Relay`,`رله`)},{value:`side`,label:h(`Motion`,`حرکت`)},...s.pwm?[{value:`pwm`,label:`PWM`}]:[],{value:`none`,label:h(`None`,`بدون نگاشت`)}],onChange:Bn})]}),bt!==`none`&&(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(P,{label:h(`Target / action`,`مقصد / عمل`),hint:h(`Key 1..4 · menu prev/next/dec/inc · relay 5..8 · side left/right · PWM 0..10`,`کلید ۱..۴ · منو prev/next/dec/inc · رله ۵..۸ · سمت left/right · PWM ۰..۱۰`),value:wt,dir:`ltr`,spellCheck:!1,onChange:e=>Tt(e.target.value)}),bt!==`menu`&&(0,X.jsx)(P,{label:h(`Behavior`,`رفتار`),hint:bt===`side`?`up | down | stop`:`press | toggle | momentary`,value:H,dir:`ltr`,spellCheck:!1,onChange:e=>U(e.target.value)})]}),(0,X.jsx)(`div`,{className:`advanced-command-inline`,dir:`ltr`,children:(0,X.jsx)(`code`,{children:jn})}),(0,X.jsx)(j,{icon:yt,disabled:!gt.trim(),onClick:()=>Mn(jn,h(`RF mappings affect physical outputs and must match the registered action schema.`,`نگاشت RF بر خروجی فیزیکی اثر می‌گذارد و باید دقیقاً با ساختار فرمان سازگار باشد.`),`caution`,!0),children:h(`Review mapping`,`بازبینی نگاشت`)})]}),(0,X.jsxs)(ln,{icon:ne,eyebrow:`I²C + LCD`,title:h(`Cooperative bus & raw transfer`,`گذرگاه اشتراکی و انتقال خام`),detail:h(`Inspect LCD ownership and scan safely; raw schemas are reviewed before the host lease is acquired.`,`مالکیت LCD را ببینید و امن پویش کنید؛ انتقال خام پیش از گرفتن دسترسی میزبان بازبینی می‌شود.`),status:s.lcd?`LCD 0x${(e.front_panel?.lcd_address||e.status.lcd_address).toString(16).padStart(2,`0`).toUpperCase()}`:h(`LCD not detected`,`LCD شناسایی نشد`),tone:g?`info`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:_t,disabled:!g,busy:a===`i2c scan`,onClick:()=>void i(`i2c scan`),children:h(`Scan bus`,`پویش گذرگاه`)}),s.lcd&&(0,X.jsx)(j,{icon:rt,busy:a===`i2c lcd status`,onClick:()=>void i(`i2c lcd status`),children:h(`LCD status`,`وضعیت LCD`)}),(0,X.jsx)(j,{icon:n,disabled:!g,busy:a===`i2c lcd rescan`,onClick:()=>void i(`i2c lcd rescan`),children:h(`Rescan LCD`,`پویش دوباره LCD`)}),(0,X.jsx)(j,{icon:te,disabled:!g,busy:a===`i2c release`,onClick:()=>void i(`i2c release`),children:h(`Release lease`,`آزادسازی دسترسی`)})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--i2c`,children:[(0,X.jsx)(P,{label:h(`7-bit address`,`نشانی ۷ بیتی`),value:W,dir:`ltr`,spellCheck:!1,onChange:e=>Et(e.target.value)}),(0,X.jsx)(P,{label:h(`Lease seconds 0..10`,`مدت دسترسی ۰..۱۰ ثانیه`),type:`number`,min:0,max:10,value:Dt,onChange:e=>G(un(e.target.value,2,0,10))}),(0,X.jsx)(P,{label:h(`Read count`,`تعداد بایت خواندن`),type:`number`,min:0,max:16,value:Ot,onChange:e=>kt(un(e.target.value,0,0,16))}),(0,X.jsx)(P,{label:h(`Write bytes · numeric tokens`,`بایت‌های نوشتن · توکن عددی`),hint:`0x00 0x01 255`,value:K,dir:`ltr`,spellCheck:!1,onChange:e=>At(e.target.value)})]}),(0,X.jsx)(`div`,{className:`advanced-command-inline`,dir:`ltr`,children:(0,X.jsx)(`code`,{children:Gn})}),(0,X.jsx)(j,{icon:yt,onClick:()=>Mn(Gn,h(`Raw I²C transfer parameters are sent exactly as reviewed and acquire a bounded cooperative lease.`,`پارامترهای انتقال خام I²C دقیقاً پس از بازبینی ارسال و دسترسی اشتراکی محدود دریافت می‌شود.`),`caution`,!0),children:h(`Review raw transfer`,`بازبینی انتقال خام`)})]}),(0,X.jsxs)(ln,{icon:Ee,eyebrow:h(`GLOBAL INPUT`,`ورودی سراسری`),title:h(`Keyboard lifecycle & emergency release`,`چرخه صفحه‌کلید و آزادسازی اضطراری`),detail:h(`Inspect bindings, control the primary Windows hook, or release every held and latched output.`,`نگاشت‌ها را ببینید، هوک اصلی ویندوز را کنترل یا همه خروجی‌های نگه‌داشته‌شده را آزاد کنید.`),children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:T,busy:a===`keyboard status`,onClick:()=>void i(`keyboard status`),children:h(`Hook status`,`وضعیت هوک`)}),(0,X.jsx)(j,{icon:$e,busy:a===`keyboard list`,onClick:()=>void i(`keyboard list`),children:h(`Binding catalog`,`فهرست نگاشت‌ها`)}),(0,X.jsx)(j,{icon:Ee,onClick:()=>Mn(`keyboard enable`,h(`Enabling the global hook activates the configured bindings; review them first with Keyboard list.`,`فعال‌سازی هوک سراسری، نگاشت‌های پیکربندی‌شده را فعال می‌کند؛ ابتدا فهرست صفحه‌کلید را بازبینی کنید.`),`caution`),children:h(`Review enable`,`بازبینی فعال‌سازی`)}),(0,X.jsx)(j,{icon:qe,busy:a===`keyboard disable`,onClick:()=>void i(`keyboard disable`),children:h(`Disable & release`,`غیرفعال و آزادسازی`)}),(0,X.jsx)(j,{tone:`danger`,icon:Re,busy:a===`estop ${e.emergency_stop?.active?`off`:`on`}`,onClick:()=>void i(`estop ${e.emergency_stop?.active?`off`:`on`}`),children:e.emergency_stop?.active?h(`Release E-STOP`,`آزادسازی توقف اضطراری`):h(`Engage E-STOP`,`فعال‌سازی توقف اضطراری`)})]}),(0,X.jsx)(`p`,{className:`advanced-note advanced-note--safe`,children:e.emergency_stop?.active?h(`Locked: effects, seat motion, relay tests, relay-on, and PWM output commands are rejected by PCController.`,`قفل است: افکت‌ها، حرکت صندلی، آزمایش رله، روشن‌کردن رله و فرمان‌های PWM توسط PCController رد می‌شوند.`):h(`Ready. Engaging E-STOP cancels effect playback and locks every motion/output command at PCController.`,`آماده است. توقف اضطراری پخش افکت را لغو و همه فرمان‌های حرکت و خروجی را در PCController قفل می‌کند.`)})]})]}),(0,X.jsxs)(ln,{icon:rt,eyebrow:h(`POLICY-GATED OS`,`سیستم‌عامل تحت سیاست امنیتی`),title:h(`Brightness, virtual key & power preparation`,`روشنایی، کلید مجازی و آماده‌سازی توان`),detail:h(`Read host state directly. Virtual-key and power requests are composed visibly before submission.`,`وضعیت میزبان را مستقیم بخوانید؛ کلید مجازی و فرمان توان پیش از ارسال به‌وضوح ساخته می‌شوند.`),children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:Oe,busy:a===`os status`,onClick:()=>void i(`os status`),children:h(`Host status`,`وضعیت میزبان`)}),(0,X.jsx)(j,{icon:yt,busy:a===`os policy`,onClick:()=>void i(`os policy`),children:h(`Action policy`,`سیاست فرمان‌ها`)}),(0,X.jsx)(j,{icon:xt,busy:a===`os brightness get`,onClick:()=>void i(`os brightness get`),children:h(`Read brightness`,`خواندن روشنایی`)})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(P,{label:h(`Virtual key`,`کلید مجازی`),hint:`F13 · MEDIA_PLAY_PAUSE · VOLUME_UP`,value:jt,dir:`ltr`,spellCheck:!1,onChange:e=>q(e.target.value)}),(0,X.jsx)(P,{label:h(`Hold ms`,`مدت نگه‌داری ms`),type:`number`,min:0,max:5e3,value:Mt,onChange:e=>Nt(un(e.target.value,80,0,5e3))})]}),(0,X.jsx)(j,{icon:yt,disabled:!jt.trim(),onClick:()=>Mn(`os key ${z(jt.trim())} ${Mt}`,h(`The configured OS policy still authorizes or rejects this reviewed key request.`,`سیاست سیستم‌عامل همچنان این درخواست کلید بازبینی‌شده را می‌پذیرد یا رد می‌کند.`),`caution`),children:h(`Prepare virtual key`,`آماده‌سازی کلید مجازی`)}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Power action`,`فرمان توان`)}),(0,X.jsx)(le,{value:Pt,label:h(`Power action`,`فرمان توان`),options:[{value:`lock`,label:h(`Lock`,`قفل`)},{value:`sleep`,label:h(`Sleep`,`خواب`)},{value:`hibernate`,label:h(`Hibernate`,`هایبرنیت`)},{value:`shutdown`,label:h(`Shutdown`,`خاموشی`)},{value:`restart`,label:h(`Restart`,`راه‌اندازی`)},{value:`logoff`,label:h(`Log off`,`خروج`)}],onChange:Ft})]}),(0,X.jsx)(P,{label:h(`Configured confirmation token`,`توکن تأیید تنظیم‌شده`),type:`password`,autoComplete:`off`,value:It,dir:`ltr`,onChange:e=>Lt(e.target.value)}),(0,X.jsx)(j,{tone:`danger`,icon:yt,disabled:!It.trim(),onClick:()=>Mn(`os power ${Pt} [REDACTED]`,h(`This can change the host power session. The secret is sent only through typed RPC, and the review dock requires a second typed RUN confirmation.`,`این فرمان می‌تواند وضعیت توان میزبان را تغییر دهد. توکن محرمانه فقط از RPC تایپ‌شده ارسال می‌شود و بخش بازبینی به تأیید تایپی RUN نیاز دارد.`),`danger`,!1,()=>k(`controller.os.power`,{action:Pt,confirmation:It})),children:h(`Prepare only — do not execute`,`فقط آماده‌سازی — بدون اجرا`)})]}),(0,X.jsxs)(ln,{icon:ie,eyebrow:h(`TYPED HOST SERVICES`,`سرویس‌های تایپ‌شده میزبان`),title:h(`Messages, discovery & history`,`پیام‌ها، کشف شبکه و تاریخچه`),detail:h(`Typed RPC is used where the shell intentionally has no alias; results remain visible as protocol data.`,`در عملیات بدون فرمان پوسته، RPC تایپ‌شده استفاده می‌شود و نتیجه به‌صورت داده پروتکل دیده می‌شود.`),children:[(0,X.jsxs)(`form`,{className:`advanced-form`,onSubmit:Fn,children:[(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Message target`,`مقصد پیام`)}),(0,X.jsx)(le,{value:J,label:h(`Message target`,`مقصد پیام`),options:g?[{value:`host`,label:h(`Event stream`,`جریان رویداد`)},{value:`lcd`,label:h(`Physical LCD`,`LCD فیزیکی`)}]:[{value:`host`,label:h(`Event stream`,`جریان رویداد`)}],onChange:Rt})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--message`,children:[(0,X.jsx)(P,{label:h(`Message type`,`نوع پیام`),hint:`a-z · 0-9 · dot · dash · underscore`,value:zt,dir:`ltr`,spellCheck:!1,maxLength:32,onChange:e=>Bt(e.target.value)}),J===`host`?(0,X.jsx)(P,{label:h(`Event text`,`متن رویداد`),value:Y,maxLength:4096,onChange:e=>Vt(e.target.value),hint:`${qn} / 4096 UTF-8 bytes`,"aria-invalid":qn>4096}):(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(P,{label:h(`LCD line 1`,`خط اول LCD`),value:Ht,maxLength:16,dir:`ltr`,spellCheck:!1,onChange:e=>Ut(e.target.value)}),(0,X.jsx)(P,{label:h(`LCD line 2`,`خط دوم LCD`),value:Wt,maxLength:16,dir:`ltr`,spellCheck:!1,onChange:e=>Gt(e.target.value)})]}),(0,X.jsx)(j,{type:`submit`,tone:`primary`,icon:ae,busy:Sn===`message`,disabled:!zt.trim()||(J===`host`?!Y.trim()||qn>4096:!Jn)||Yn&&!g,children:h(`Send typed message`,`ارسال پیام تایپ‌شده`)})]}),J===`lcd`&&(0,X.jsx)(`p`,{className:`advanced-note${Jn?` advanced-note--safe`:``}`,children:h(`Up to two 16-character lines; printable ASCII only. Hardware LCD text is intentionally LTR.`,`حداکثر دو خط ۱۶ نویسه‌ای و فقط ASCII قابل چاپ؛ متن LCD سخت‌افزاری عمداً چپ‌به‌راست است.`)})]}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsxs)(`div`,{className:`advanced-toggle-stack advanced-toggle-stack--compact`,children:[(0,X.jsx)(Ce,{checked:Kt,onChange:qt,label:`mDNS / DNS-SD`}),(0,X.jsx)(Ce,{checked:Jt,onChange:Yt,label:`SSDP / UPnP + SOAP`}),(0,X.jsx)(Ce,{checked:Xt,onChange:Zt,label:`WS-Discovery`}),(0,X.jsx)(Ce,{checked:Qt,onChange:$t,label:`UDP broadcast`}),(0,X.jsx)(Ce,{checked:en,onChange:tn,label:`NetBIOS`})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(P,{label:h(`Advertised instance name`,`نام تبلیغ‌شده نمونه`),hint:h(`Blank uses the configured app title`,`خالی یعنی عنوان برنامه`),value:an,maxLength:63,onChange:e=>on(e.target.value)}),(0,X.jsx)(P,{label:h(`UDP broadcast port`,`درگاه پخش UDP`),type:`number`,min:1024,max:65535,value:sn,onChange:e=>mn(un(e.target.value,37889,1024,65535))})]}),(0,X.jsx)(j,{icon:d,busy:Sn===`discovery-config`,onClick:Rn,children:h(`Save advertisement settings`,`ذخیره تنظیمات معرفی`)}),(0,X.jsx)(`p`,{className:`advanced-note advanced-note--safe`,children:h(`Advertisement is enabled by default and publishes only bounded public identity, health and telemetry. Remote commands still require an authenticated, remotely enabled IPC policy.`,`معرفی شبکه به‌طور پیش‌فرض فعال است و فقط هویت، سلامت و تله‌متری عمومی محدود را منتشر می‌کند. فرمان‌های راه‌دور همچنان به IPC فعال و احراز هویت‌شده نیاز دارند.`)}),(0,X.jsx)(M,{label:h(`Discovery timeout`,`مهلت کشف`),value:nn,min:100,max:5e3,step:100,unit:`ms`,onChange:rn}),(0,X.jsx)(j,{icon:_t,busy:Sn===`discovery`,disabled:!Kt&&!Jt&&!Xt&&!Qt&&!en,onClick:()=>void Ln(),children:h(`Discover network hosts`,`کشف میزبان‌های شبکه`)}),hn.length>0&&(0,X.jsx)(`div`,{className:`network-device-directory`,"aria-live":`polite`,children:hn.map(e=>{let t=e.public,n=t?.board.telemetry,r=[];return n?.ina219_available&&(r.push(`${((n.supply_mv??0)/1e3).toFixed(2)} V`),r.push(`${(n.current_ma??0).toFixed(0)} mA`)),n?.temperature_led_available&&r.push(`${((n.temperature_led_centi_c??0)/100).toFixed(1)} °C LED`),n?.temperature_bt_audio_available&&r.push(`${((n.temperature_bt_audio_centi_c??0)/100).toFixed(1)} °C BT`),n?.available&&r.push(n.door_open?h(`door open`,`درب باز`):h(`door closed`,`درب بسته`)),(0,X.jsxs)(`article`,{className:`network-device`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:t?.instance_name||e.name}),(0,X.jsxs)(`small`,{children:[t?.hostname||e.host,`:`,e.port,` · `,(e.protocols||[e.protocol]).join(` + `)]})]}),(0,X.jsx)(se,{tone:t?.health.ok?t.health.connectable?`good`:`warn`:`bad`,children:t?.health.connectable?h(`CONNECTABLE`,`قابل اتصال`):h(`DISCOVERABLE`,`قابل کشف`)}),(0,X.jsx)(`p`,{children:t?.board.connected?`${t.board.identity.name||`PCController`} · ${t.board.identity.build_hash||`firmware`} · ${t.board.port.name||t.board.port.product||`serial`}`:h(`Host online · board disconnected`,`میزبان آنلاین · برد قطع است`)}),r.length>0&&(0,X.jsx)(`p`,{children:r.join(` · `)}),(0,X.jsx)(j,{tone:`primary`,icon:pt,disabled:!t?.health.connectable,onClick:()=>zn(e),children:h(`Connect to host`,`اتصال به میزبان`)})]},t?.instance_id||`${e.host}:${e.port}`)})}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--history`,children:[(0,X.jsx)(P,{label:h(`Look back · minutes`,`بازه گذشته · دقیقه`),type:`number`,min:1,max:43200,value:gn,onChange:e=>_n(un(e.target.value,60,1,43200))}),(0,X.jsx)(P,{label:h(`Timeline limit`,`حد رویدادها`),type:`number`,min:1,max:5e3,value:vn,onChange:e=>yn(un(e.target.value,100,1,5e3))}),(0,X.jsx)(j,{icon:Be,busy:Sn===`history-status`,onClick:()=>In(`status`),children:h(`Status history`,`تاریخچه وضعیت`)}),(0,X.jsx)(j,{icon:T,busy:Sn===`history-timeline`,onClick:()=>In(`timeline`),children:h(`Event timeline`,`خط زمانی رویداد`)})]}),(0,X.jsx)(`pre`,{className:`advanced-service-output`,dir:`ltr`,"aria-live":`polite`,children:bn})]}),(0,X.jsxs)(ln,{icon:De,eyebrow:h(`READ-FIRST RECOVERY`,`بازیابی با اولویت خواندن`),title:h(`Firmware, toolchain & boot preparation`,`میان‌افزار، زنجیره‌ابزار و آماده‌سازی بوت`),detail:h(`Identity and toolchain reads are immediate; bootloader probe/read/backup commands are prepared only.`,`خواندن شناسه و زنجیره‌ابزار مستقیم است؛ فرمان‌های پروب، خواندن و پشتیبان بوت فقط آماده می‌شوند.`),children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[g&&(0,X.jsx)(j,{icon:De,busy:a===`hello`,onClick:()=>void i(`hello`),children:h(`Firmware identity`,`شناسه میان‌افزار`)}),(0,X.jsx)(j,{icon:b,busy:a===`toolchain profile`,onClick:()=>void i(`toolchain profile`),children:h(`Resolved profile`,`پروفایل حل‌شده`)}),(0,X.jsx)(j,{icon:De,busy:a===`toolchain core-info`,onClick:()=>void i(`toolchain core-info`),children:h(`Core info`,`اطلاعات هسته`)})]}),g&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(P,{label:h(`Backup directory or read output file`,`پوشه پشتیبان یا فایل خروجی خواندن`),value:wn,dir:`ltr`,spellCheck:!1,onChange:e=>Tn(e.target.value)}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(j,{icon:_t,onClick:()=>Mn(`boot probe`,h(`Prepare a non-write bootloader probe; execution temporarily hands over the serial port.`,`پروب غیرنوشتنی بوت آماده می‌شود؛ اجرا موقتاً درگاه سریال را تحویل می‌دهد.`),`caution`,!0),children:h(`Prepare probe`,`آماده‌سازی پروب`)}),(0,X.jsx)(j,{icon:C,onClick:()=>Mn(`boot info`,h(`Prepare a metadata read through the guarded programming lifecycle.`,`خواندن فراداده از مسیر امن پروگرام آماده می‌شود.`),`caution`,!0),children:h(`Prepare metadata`,`آماده‌سازی فراداده`)}),(0,X.jsx)(j,{icon:S,disabled:!wn.trim(),onClick:()=>Mn(`boot backup ${z(wn.trim())}`,h(`Prepare a backup-only operation to the reviewed destination.`,`عملیات فقط پشتیبان‌گیری در مقصد بازبینی‌شده آماده می‌شود.`),`caution`,!0),children:h(`Prepare backup`,`آماده‌سازی پشتیبان`)}),(0,X.jsx)(j,{icon:S,disabled:!wn.trim(),onClick:()=>Mn(`boot read ${z(wn.trim())}`,h(`Prepare a flash read to the reviewed output file; no flash write command is exposed here.`,`خواندن فلش در فایل بازبینی‌شده آماده می‌شود؛ هیچ فرمان نوشتن فلش در این بخش وجود ندارد.`),`caution`,!0),children:h(`Prepare flash read`,`آماده‌سازی خواندن فلش`)})]})]})]})]}),(0,X.jsxs)(`section`,{id:`advanced-command-review`,className:`advanced-review advanced-review--${Q.risk}`,"aria-live":`polite`,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsx)(`span`,{className:`advanced-review__icon`,children:(0,X.jsx)(yt,{size:19,"aria-hidden":`true`})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`small`,{children:h(`EXPLICIT COMMAND REVIEW`,`بازبینی صریح فرمان`)}),(0,X.jsx)(`h3`,{children:Q.command?h(`Prepared, never implicit`,`آماده، هرگز ضمنی`):h(`No command prepared`,`فرمانی آماده نشده`)})]}),Q.command&&(0,X.jsx)(se,{tone:Q.risk===`danger`?`bad`:`warn`,children:Q.risk.toUpperCase()})]}),(0,X.jsxs)(`div`,{className:`advanced-review__command`,dir:`ltr`,children:[(0,X.jsx)(`span`,{children:`pc›`}),(0,X.jsx)(`code`,{children:Q.command?me(Q.command):h(`Choose a prepare action above.`,`یک فرمان آماده‌سازی را از بالا انتخاب کنید.`)})]}),Q.reason&&(0,X.jsx)(`p`,{children:Q.reason}),Q.risk===`danger`&&(0,X.jsx)(P,{label:h(`Type RUN to arm this reviewed high-impact command`,`برای فعال‌سازی فرمان پراثر، RUN را تایپ کنید`),value:Dn,dir:`ltr`,autoComplete:`off`,spellCheck:!1,onChange:e=>On(e.target.value)}),(0,X.jsxs)(`div`,{className:`advanced-review__actions`,children:[(0,X.jsx)(j,{tone:Q.risk===`danger`?`danger`:`primary`,icon:C,disabled:Xn,busy:kn||a===Q.command,onClick:()=>void Nn(),children:h(`Run reviewed command`,`اجرای فرمان بازبینی‌شده`)}),(0,X.jsx)(j,{icon:We,disabled:!Q.command||kn,onClick:()=>{En({command:``,reason:``,risk:`normal`,needsDevice:!1}),On(``)},children:h(`Clear`,`پاک‌کردن`)}),Q.needsDevice&&!g&&(0,X.jsx)(`span`,{className:`advanced-review__blocked`,children:h(`Connect an authenticated board before execution.`,`پیش از اجرا یک برد معتبر متصل کنید.`)})]})]}),(0,X.jsxs)(`footer`,{className:`advanced-footnote`,children:[(0,X.jsx)(yt,{size:15,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:h(`Controls reflect implemented protocol paths. Physical peripherals and external services still require live-device acceptance testing.`,`کنترل‌ها بر اساس مسیرهای پیاده‌سازی‌شده پروتکل هستند؛ تجهیزات فیزیکی و سرویس‌های بیرونی همچنان به آزمون پذیرش زنده نیاز دارند.`)})]})]})}function hn(e){let t=[`display`,e.target,`--speed`,`${e.speedMS}ms`,`--duration`,`${e.durationMS}ms`,`--repeat`,e.repeat];return e.repeat===`interval`&&t.push(`--interval`,`${e.intervalMS}ms`),e.scroll&&e.target!==`lcd`&&t.push(`--scroll`),t.push(`--`,z(e.text)),t.join(` `)}var Z=[`A`,`B`,`C`,`D`],gn=new Set([`rf.learn.mapping-required`,`rf.learn.capture`]),_n=new Set([`rf.learn.ended`,`rf.learn.cancelled`,`rf.learn.full`]);function vn(e,t=0){return e.id>t&&gn.has(e.kind.trim().toLowerCase())&&Number.isInteger(e.rf_id)}function yn(e){return`${e.code}:${e.bits}:${e.protocol}`}function bn(e,t){if(e.action_kind===0)return!0;let n=yn(e);return t.find(e=>yn(e)===n)?.id!==e.id}function xn(e){return e?.action_kind?Cn(e):{action:`none`,target:``,behavior:``}}function Sn(e,t){return t.action===`none`?{id:e,action:`none`}:t.action===`menu`?{id:e,action:`menu`,target:t.target}:{id:e,action:t.action,target:t.target,behavior:t.behavior}}function Cn(e){let t=[`press`,`toggle`,`momentary`,`up`,`down`,`stop`][e.behavior]??`press`;switch(e.action_kind){case 1:return{action:`key`,target:String(e.action_value+1),behavior:t};case 2:return{action:`menu`,target:[`prev`,`next`,`dec`,`inc`][e.action_value]??`next`,behavior:``};case 3:return{action:`relay`,target:String(e.action_value+1),behavior:t};case 4:return{action:`side`,target:e.action_value===1?`right`:`left`,behavior:t};case 5:return{action:`pwm`,target:String(e.action_value),behavior:t};default:return{action:`none`,target:``,behavior:``}}}function wn(e){return e.action===`none`?!0:e.target?e.action===`menu`||!!e.behavior:!1}function Tn(e,t){let n=[`press`,`toggle`,`momentary`,`up`,`down`,`stop`][e.behavior]??`#${e.behavior}`;switch(e.action_kind){case 1:return`${t(`Key`,`کلید`)} ${e.action_value+1} · ${n}`;case 2:return`${t(`Menu`,`منو`)} · ${[`prev`,`next`,`dec`,`inc`][e.action_value]??`#${e.action_value}`}`;case 3:return`${t(`Relay`,`رله`)} ${e.action_value+1} · ${n}`;case 4:return`${t(`Motion`,`حرکت`)} ${e.action_value===1?`B`:`A`} · ${n}`;case 5:return`PWM ${e.action_value} · ${n}`;default:return t(`Unmapped`,`بدون نگاشت`)}}function Q(e){return e.code_display||`0x${e.code.toString(16).toUpperCase().padStart(8,`0`)}`}function En(e,t){switch(e){case`key`:return[1,2,3,4].map(e=>({value:String(e),label:`${t(`Key`,`کلید`)} ${e}`}));case`menu`:return[`prev`,`next`,`dec`,`inc`].map(e=>({value:e,label:e.toUpperCase()}));case`relay`:return[5,6,7,8].map(e=>({value:String(e),label:`${t(`Relay`,`رله`)} ${e}`}));case`side`:return[{value:`left`,label:t(`Motion side A`,`سمت حرکتی A`)},{value:`right`,label:t(`Motion side B`,`سمت حرکتی B`)}];case`pwm`:return Array.from({length:11},(e,t)=>({value:String(t),label:`PWM ${t}`}));default:return[]}}function Dn(e,t){return e===`side`?[{value:`up`,label:t(`Up`,`بالا`)},{value:`down`,label:t(`Down`,`پایین`)},{value:`stop`,label:t(`Stop`,`توقف`)}]:e===`menu`||e===`none`?[]:[{value:`press`,label:t(`Press`,`فشار`)},{value:`toggle`,label:t(`Toggle`,`تغییر وضعیت`)},{value:`momentary`,label:t(`Momentary`,`لحظه‌ای`)}]}function On({snapshot:e,events:r,locale:i,openDialog:a}){let o=i===`fa`,s=(0,V.useCallback)((e,t)=>o?t:e,[o]),[l,d]=(0,V.useState)(`idle`),[f,p]=(0,V.useState)(0),[m,h]=(0,V.useState)([null,null,null,null]),[g,_]=(0,V.useState)(null),[ee,v]=(0,V.useState)(!1),[y,te]=(0,V.useState)([]),[b,ne]=(0,V.useState)(()=>xn()),[x,ie]=(0,V.useState)(``),[S,C]=(0,V.useState)(()=>s(`Choose button A to begin.`,`برای شروع دکمه A را انتخاب کنید.`)),w=(0,V.useRef)(0),T=(0,V.useRef)(new Set),D=(0,V.useRef)(!1),O=(0,V.useRef)(!1),A=(0,V.useRef)(!0),ue=(0,V.useRef)(e.connected),M=(0,V.useCallback)(async()=>{let e=await k(`controller.rf.list`);return A.current&&te(e),e},[]);(0,V.useEffect)(()=>{ue.current=e.connected},[e.connected]),(0,V.useEffect)(()=>(A.current=!0,()=>{A.current=!1,D.current&&ue.current&&k(`controller.rf.learn.cancel`).catch(()=>void 0)}),[]),(0,V.useEffect)(()=>{e.connected&&M().catch(e=>{A.current&&C(s(`Inventory unavailable: ${e instanceof Error?e.message:String(e)}`,`فهرست در دسترس نیست: ${e instanceof Error?e.message:String(e)}`))})},[s,M,e.connected]),(0,V.useEffect)(()=>{e.connected||l===`idle`||l===`complete`||l===`interrupted`||(D.current=!1,ie(``),d(`interrupted`),C(s(`Capture paused because the controller disconnected. Reconnect before retrying.`,`به‌دلیل قطع ارتباط کنترلر، دریافت متوقف شد. پس از اتصال دوباره تلاش کنید.`)))},[s,l,e.connected]);let de=(0,V.useCallback)(async e=>{if(d(`resolving`),C(s(`Entry ${e} received. Verifying its exact identity…`,`ورودی ${e} دریافت شد؛ هویت دقیق آن در حال بررسی است…`)),D.current){try{await k(`controller.rf.learn.cancel`)}catch{}D.current=!1,O.current=!0}try{let t=await M(),n=t.find(t=>t.id===e);if(n||=(await new Promise(e=>window.setTimeout(e,160)),t=await M(),t.find(t=>t.id===e)),!n)throw Error(s(`captured entry was not present in board readback`,`ورودی دریافت‌شده در بازخوانی برد وجود نداشت`));if(!A.current)return;_(n),v(!0),d(`identity`),C(s(`Confirm that ${Q(n)} is handset button ${Z[f]}.`,`تأیید کنید ${Q(n)} همان دکمه ${Z[f]} فرستنده است.`))}catch(e){if(!A.current)return;d(`interrupted`),C(s(`Identity verification failed: ${e instanceof Error?e.message:String(e)}`,`بررسی هویت ناموفق بود: ${e instanceof Error?e.message:String(e)}`))}},[f,s,M]);(0,V.useEffect)(()=>{if(l!==`capturing`)return;let e=r.find(e=>vn(e,w.current)&&!T.current.has(e.id));e&&e.rf_id!==void 0&&(T.current.add(e.id),de(e.rf_id))},[r,l,de]),(0,V.useEffect)(()=>{if(l!==`capturing`)return;let e=r.find(e=>e.id>w.current&&_n.has(e.kind.trim().toLowerCase()));e&&(D.current=!1,O.current=!0,d(`interrupted`),C(e.kind.toLowerCase().includes(`full`)?s(`RF storage is full. Review stale records before capturing again.`,`حافظه RF پر است؛ پیش از دریافت دوباره، ورودی‌های قدیمی را بازبینی کنید.`):s(`No button was confirmed in this capture window. Retry when the handset is ready.`,`در این بازه دکمه‌ای تأیید نشد؛ وقتی فرستنده آماده است دوباره تلاش کنید.`)))},[s,r,l]);let fe=e=>{l!==`capturing`&&l!==`resolving`&&l!==`saving`&&(p(e),_(null),v(!1),ne(xn()),d(m[e]?`complete`:`idle`),C(m[e]?m[e]?.action_kind===0?s(`Button ${Z[e]} is captured and remains Unmapped.`,`دکمه ${Z[e]} دریافت شده و بدون نگاشت باقی مانده است.`):s(`Button ${Z[e]} has an explicit mapping. You can review or remap it.`,`دکمه ${Z[e]} نگاشت صریح دارد و قابل بازبینی یا نگاشت دوباره است.`):s(`Button ${Z[e]} is ready to capture.`,`دکمه ${Z[e]} آماده دریافت است.`)))},N=async()=>{if(e.connected&&!x){if(e.rf_learning?.active&&!D.current&&!O.current)d(`interrupted`),C(s(`Another RF learning session is active. Cancel it explicitly before starting the guided capture.`,`یک نشست یادگیری RF دیگر فعال است؛ پیش از شروع دریافت هدایت‌شده آن را صریحاً لغو کنید.`));else{ie(`capture`),_(null),v(!1),w.current=r.reduce((e,t)=>Math.max(e,t.id),0);try{await k(`controller.rf.learn.start`,{mode:`timer`,timeout_ms:3e4}),O.current=!1,D.current=!0,d(`capturing`),C(s(`Press handset button ${Z[f]} once. Other buttons are ignored until you confirm the identity.`,`دکمه ${Z[f]} فرستنده را یک‌بار فشار دهید؛ تا پیش از تأیید هویت، دکمه دیگری را فشار ندهید.`))}catch(e){d(`interrupted`),C(s(`Capture could not start: ${e instanceof Error?e.message:String(e)}`,`دریافت آغاز نشد: ${e instanceof Error?e.message:String(e)}`))}finally{ie(``)}}}},me=async()=>{if(!x){ie(`cancel`);try{e.connected&&(D.current||e.rf_learning?.active)&&await k(`controller.rf.learn.cancel`),D.current=!1,O.current=!0,_(null),v(!1),d(`idle`),C(s(`Capture for button ${Z[f]} was cancelled. No mapping changed.`,`دریافت دکمه ${Z[f]} لغو شد و هیچ نگاشتی تغییر نکرد.`))}catch(e){d(`interrupted`),C(s(`Cancellation was not acknowledged: ${e instanceof Error?e.message:String(e)}`,`لغو تأیید نشد: ${e instanceof Error?e.message:String(e)}`))}finally{ie(``)}}},P=()=>{g&&(ne(xn(g)),d(`mapping`),C(g.action_kind===0?s(`Identity confirmed for button ${Z[f]}. It remains Unmapped unless you explicitly choose an action.`,`هویت دکمه ${Z[f]} تأیید شد؛ تا زمانی که صریحاً عملی انتخاب نکنید، بدون نگاشت می‌ماند.`):s(`Identity confirmed for button ${Z[f]}. Its existing board mapping is preserved for review.`,`هویت دکمه ${Z[f]} تأیید شد؛ نگاشت موجود برد برای بازبینی حفظ شده است.`)))},F=async()=>{if(g&&e.connected&&!x){ie(`mapping`),d(`saving`);try{let e=await k(`controller.rf.map`,Sn(g.id,b)),t=e.find(e=>e.id===g.id)??{...g};if(te(e),ee){let e=[...m];e[f]=t,h(e);let n=e.findIndex((e,t)=>!e&&t>f),r=n>=0?n:e.findIndex(e=>!e);r>=0?(p(r),ne(xn()),d(`idle`),C(t.action_kind===0?s(`Button ${Z[f]} was captured and kept Unmapped. Continue with button ${Z[r]}.`,`دکمه ${Z[f]} دریافت شد و بدون نگاشت ماند؛ با دکمه ${Z[r]} ادامه دهید.`):s(`Button ${Z[f]} mapping was saved. Continue with button ${Z[r]}.`,`نگاشت دکمه ${Z[f]} ذخیره شد؛ با دکمه ${Z[r]} ادامه دهید.`))):(d(`complete`),C(s(`A/B/C/D capture is complete. Review the inventory and test only the intended signal.`,`دریافت A/B/C/D کامل شد؛ فهرست را بازبینی و فقط سیگنال موردنظر را آزمایش کنید.`)))}else d(`idle`),C(s(`Entry ${g.id} was remapped and verified by board readback.`,`ورودی ${g.id} نگاشت و با بازخوانی برد تأیید شد.`));_(null),v(!1)}catch(e){d(`mapping`),C(s(`Mapping was not saved: ${e instanceof Error?e.message:String(e)}`,`نگاشت ذخیره نشد: ${e instanceof Error?e.message:String(e)}`))}finally{ie(``)}}},I=async e=>{let t=await k(`controller.rf.remove`,{id:e.id});te(t),h(t=>t.map(t=>t?.id===e.id?null:t)),g?.id===e.id&&(_(null),v(!1),d(`idle`)),C(s(`Entry ${e.id} was removed and the inventory was refreshed.`,`ورودی ${e.id} حذف و فهرست تازه‌سازی شد.`))},L=e=>a({tone:`danger`,title:s(`Remove RF entry ${e.id}?`,`ورودی RF شماره ${e.id} حذف شود؟`),body:s(`This removes ${Q(e)} from controller storage. Other records are not changed.`,`کد ${Q(e)} از حافظه کنترلر حذف می‌شود و سایر ورودی‌ها تغییر نمی‌کنند.`),confirmLabel:s(`Remove entry`,`حذف ورودی`),action:()=>I(e)}),he=()=>a({tone:`danger`,title:s(`Clear every learned RF record?`,`همه ورودی‌های RF پاک شوند؟`),body:s(`This permanently clears ${y.length} learned record${y.length===1?``:`s`}. Export or review identities first.`,`این عمل ${y.length} ورودی آموخته‌شده را برای همیشه پاک می‌کند؛ ابتدا هویت‌ها را بازبینی کنید.`),confirmLabel:s(`Clear all records`,`پاک‌کردن همه`),action:async()=>{await k(`controller.rf.clear`,{confirm:`CLEAR RF`}),te([]),h([null,null,null,null]),_(null),d(`idle`),C(s(`All learned RF records were cleared by the controller.`,`همه ورودی‌های RF توسط کنترلر پاک شدند.`))}}),ge=e=>a({title:s(`Transmit one verification burst?`,`یک پالس آزمایشی ارسال شود؟`),body:s(`The controller will transmit ${Q(e)} once. Keep actuators isolated and observe only the intended receiver.`,`کنترلر کد ${Q(e)} را فقط یک‌بار می‌فرستد؛ عملگرها را ایزوله و فقط گیرنده موردنظر را مشاهده کنید.`),confirmLabel:s(`Transmit once`,`یک‌بار ارسال`),action:async()=>{await k(`controller.rf.transmit`,{code:e.code,bits:e.bits,protocol:e.protocol,pulse_us:e.pulse_us,repeats:1}),C(s(`One verification burst for entry ${e.id} was acknowledged.`,`یک پالس آزمایشی برای ورودی ${e.id} تأیید شد.`))}}),_e=e=>{_(e),v(!1),ne(Cn(e)),d(`mapping`),C(s(`Review the action for entry ${e.id}; nothing changes until Save mapping.`,`عمل ورودی ${e.id} را بازبینی کنید؛ تا زمان ذخیره نگاشت تغییری اعمال نمی‌شود.`))},ve=()=>{g&&L(g)},ye=e=>{ne(e===`none`||e===`menu`?{action:e,target:``,behavior:``}:e===`side`?{action:e,target:``,behavior:`stop`}:{action:e,target:``,behavior:`press`})},z=e=>{if(e.target.matches(`input, select, textarea, button, [contenteditable="true"]`))return;if(e.key===`Escape`&&(l===`capturing`||l===`resolving`)){e.preventDefault(),me();return}let t=Z.indexOf(e.key.toUpperCase());if(t>=0)e.preventDefault(),fe(t);else if(e.key===`Enter`)e.preventDefault(),l===`identity`?P():(l===`idle`||l===`interrupted`)&&N();else if((e.key===`ArrowLeft`||e.key===`ArrowRight`)&&![`capturing`,`resolving`,`saving`].includes(l)){e.preventDefault();let t=e.key===`ArrowRight`?1:-1,n=o?-t:t;fe((f+n+Z.length)%Z.length)}},Se=En(b.action,s),Ce=Dn(b.action,s),we=(0,V.useMemo)(()=>y.filter(e=>bn(e,y)),[y]),Te=Z[f],Ee=!(!e.rf_learning?.active||D.current||O.current),De=!e.connected||l===`interrupted`?`warn`:l===`complete`?`good`:l===`capturing`||l===`resolving`?`info`:`neutral`,Oe=e.connected?l===`capturing`?s(`LISTENING`,`در حال دریافت`):l===`resolving`?s(`VERIFYING`,`در حال بررسی`):l===`identity`?s(`CONFIRM IDENTITY`,`تأیید هویت`):l===`mapping`||l===`saving`?s(`MAP ACTION`,`نگاشت عمل`):l===`complete`?s(`READY TO REVIEW`,`آماده بازبینی`):s(`GUIDED CAPTURE`,`دریافت هدایت‌شده`):s(`CONTROLLER OFFLINE`,`کنترلر قطع است`);return(0,X.jsx)(E,{icon:u,iconTone:`violet`,className:`rf-guide-card`,title:s(`Handset capture studio`,`استودیوی دریافت فرستنده`),eyebrow:s(`433 MHz · guided A/B/C/D`,`۴۳۳ مگاهرتز · هدایت‌شده A/B/C/D`),action:(0,X.jsx)(se,{tone:De,pulse:l===`capturing`,children:Oe}),menu:e.connected?[{label:s(`Refresh learned inventory`,`تازه‌سازی فهرست آموخته‌ها`),icon:n,disabled:!e.connected,onSelect:()=>void M()},{label:s(`Clear all learned records`,`پاک‌کردن همه آموخته‌ها`),icon:c,tone:`danger`,disabled:!e.connected||y.length===0,onSelect:he}]:[],children:(0,X.jsxs)(`div`,{className:`rf-guide`,tabIndex:0,onKeyDown:z,"aria-label":s(`Guided RF handset capture workflow`,`فرایند هدایت‌شده دریافت فرستنده RF`),children:[(0,X.jsx)(`ol`,{className:`rf-guide__steps`,"aria-label":s(`Handset buttons`,`دکمه‌های فرستنده`),children:Z.map((e,t)=>{let n=m[t],r=t===f;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:r?`is-active`:``,"aria-current":r?`step`:void 0,onClick:()=>fe(t),disabled:l===`capturing`||l===`resolving`||l===`saving`,children:[(0,X.jsx)(`span`,{children:n?(0,X.jsx)(ce,{size:17}):t+1}),(0,X.jsxs)(`strong`,{children:[s(`Button`,`دکمه`),` `,e]}),(0,X.jsx)(`small`,{children:n?Q(n):r?s(`Current step`,`گام کنونی`):s(`Not captured`,`دریافت نشده`)})]})},e)})}),(0,X.jsxs)(R.div,{layout:!0,transition:{layout:{duration:.26,ease:[.22,1,.36,1]}},className:`rf-guide__message rf-guide__message--${De}`,role:l===`interrupted`?`alert`:`status`,"aria-live":`polite`,children:[(0,X.jsx)(`span`,{children:l===`capturing`||l===`resolving`?(0,X.jsx)(`span`,{className:`spinner`}):l===`complete`?(0,X.jsx)(t,{size:19}):(0,X.jsx)(Ae,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:Oe}),(0,X.jsx)(`p`,{children:S})]})]}),(0,X.jsxs)(xe,{mode:`wait`,initial:!1,children:[(l===`idle`||l===`interrupted`||l===`complete`)&&(0,X.jsxs)(R.div,{className:`rf-guide__capture`,initial:{opacity:0,clipPath:`inset(0 8% 0 8% round 12px)`},animate:{opacity:1,clipPath:`inset(0 0% 0 0% round 12px)`},exit:{opacity:0,clipPath:`inset(0 8% 0 8% round 12px)`},transition:{duration:.24,ease:[.22,1,.36,1]},children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`rf-guide__label`,children:Te}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:s(`Capture handset button ${Te}`,`دریافت دکمه ${Te} فرستنده`)}),(0,X.jsx)(`p`,{children:e.connected?s(`A 30-second bounded session starts only after you press the button below.`,`نشست محدود ۳۰ ثانیه‌ای فقط پس از فشردن دکمه زیر آغاز می‌شود.`):s(`Controls remain hidden until an authenticated controller reconnects.`,`تا اتصال دوباره کنترلر معتبر، کنترل‌ها پنهان می‌مانند.`)})]})]}),e.connected&&(Ee?(0,X.jsx)(j,{tone:`danger`,icon:pe,busy:x===`cancel`,onClick:()=>void me(),children:s(`Cancel active session`,`لغو نشست فعال`)}):(0,X.jsx)(j,{tone:`primary`,icon:_t,busy:x===`capture`,onClick:()=>void N(),children:s(`Start capture`,`شروع دریافت`)}))]},`capture`),(l===`capturing`||l===`resolving`)&&(0,X.jsxs)(R.div,{className:`rf-guide__listening`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,X.jsxs)(`div`,{className:`rf-guide__signal`,"aria-hidden":`true`,children:[(0,X.jsx)(`i`,{}),(0,X.jsx)(`i`,{}),(0,X.jsx)(`i`,{}),(0,X.jsx)(Ae,{size:28})]}),(0,X.jsx)(j,{tone:`ghost`,icon:pe,busy:x===`cancel`,onClick:()=>void me(),children:s(`Cancel safely`,`لغو ایمن`)})]},`listening`),l===`identity`&&g&&(0,X.jsxs)(R.div,{className:`rf-guide__identity`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.22,ease:[.22,1,.36,1]},children:[(0,X.jsxs)(`header`,{children:[(0,X.jsx)(oe,{size:22}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:s(`Is this button ${Te}?`,`آیا این همان دکمه ${Te} است؟`)}),(0,X.jsx)(`p`,{children:s(`Confirm the exact waveform identity before assigning any action.`,`پیش از تعیین عمل، هویت دقیق موج را تأیید کنید.`)})]})]}),(0,X.jsxs)(`dl`,{dir:`ltr`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`ID`}),(0,X.jsx)(`dd`,{children:g.id})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`CODE`}),(0,X.jsx)(`dd`,{children:Q(g)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`BITS`}),(0,X.jsx)(`dd`,{children:g.bits})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`PROTOCOL`}),(0,X.jsx)(`dd`,{children:g.protocol})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`PULSE`}),(0,X.jsxs)(`dd`,{children:[g.pulse_us,` µs`]})]})]}),(0,X.jsxs)(`div`,{className:`rf-guide__actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:t,onClick:P,children:s(`Confirm button ${Te}`,`تأیید دکمه ${Te}`)}),(0,X.jsx)(j,{tone:`danger`,icon:c,onClick:ve,children:s(`Discard capture`,`حذف دریافت`)})]})]},`identity`),(l===`mapping`||l===`saving`)&&g&&(0,X.jsxs)(R.div,{className:`rf-guide__mapping`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.22,ease:[.22,1,.36,1]},children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:ee?s(`Map button ${Te}`,`نگاشت دکمه ${Te}`):s(`Remap entry ${g.id}`,`نگاشت دوباره ورودی ${g.id}`)}),(0,X.jsxs)(`p`,{dir:`ltr`,children:[Q(g),` · `,g.bits,` bit · P`,g.protocol,` · `,g.pulse_us,` µs`]})]}),(0,X.jsxs)(se,{tone:`info`,children:[`ID `,g.id]})]}),(0,X.jsxs)(`div`,{className:`rf-guide__mapping-kind`,children:[(0,X.jsx)(`label`,{children:s(`Action domain`,`حوزه عمل`)}),(0,X.jsx)(le,{value:b.action,label:s(`RF action domain`,`حوزه عمل RF`),options:[{value:`key`,label:s(`Key`,`کلید`)},{value:`menu`,label:s(`Menu`,`منو`)},{value:`relay`,label:s(`Relay`,`رله`)},{value:`side`,label:s(`Motion`,`حرکت`)},{value:`pwm`,label:`PWM`},{value:`none`,label:s(`None`,`بدون عمل`)}],onChange:ye})]}),b.action!==`none`&&(0,X.jsxs)(`div`,{className:`rf-guide__mapping-fields`,children:[(0,X.jsxs)(`label`,{children:[(0,X.jsx)(`span`,{children:s(`Target`,`مقصد`)}),(0,X.jsxs)(`select`,{value:b.target,onChange:e=>ne(t=>({...t,target:e.target.value})),children:[(0,X.jsx)(`option`,{value:``,disabled:!0,children:s(`Choose target…`,`مقصد را انتخاب کنید…`)}),Se.map(e=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]}),Ce.length>0&&(0,X.jsxs)(`label`,{children:[(0,X.jsx)(`span`,{children:s(`Behavior`,`رفتار`)}),(0,X.jsx)(`select`,{value:b.behavior,onChange:e=>ne(t=>({...t,behavior:e.target.value})),children:Ce.map(e=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})]}),(0,X.jsxs)(`div`,{className:`rf-guide__actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:ce,busy:x===`mapping`,disabled:!wn(b),onClick:()=>void F(),children:b.action===`none`?s(`Keep Unmapped`,`بدون نگاشت بماند`):s(`Save mapping`,`ذخیره نگاشت`)}),(0,X.jsx)(j,{tone:`ghost`,icon:pe,disabled:l===`saving`,onClick:()=>{_(null),v(!1),d(`idle`),C(s(`Mapping review closed without changing the board.`,`بازبینی نگاشت بدون تغییر برد بسته شد.`))},children:s(`Close without saving`,`بستن بدون ذخیره`)})]})]},`mapping`)]}),(0,X.jsxs)(`div`,{className:`rf-guide__keyboard`,"aria-label":s(`Keyboard shortcuts`,`میان‌برهای صفحه‌کلید`),children:[(0,X.jsx)(be,{keys:[[`A`,`B`,`C`,`D`]],separator:`/`}),(0,X.jsx)(`span`,{children:s(`select button`,`انتخاب دکمه`)}),(0,X.jsx)(be,{keys:[`Enter`]}),(0,X.jsx)(`span`,{children:s(`capture or confirm`,`دریافت یا تأیید`)}),(0,X.jsx)(be,{keys:[`Esc`]}),(0,X.jsx)(`span`,{children:s(`cancel capture`,`لغو دریافت`)}),(0,X.jsx)(be,{keys:[[`←`,`→`]],separator:`/`}),(0,X.jsx)(`span`,{children:s(`move between steps`,`جابجایی بین گام‌ها`)})]}),(0,X.jsxs)(`section`,{className:`rf-inventory`,"aria-labelledby":`rf-inventory-title`,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{className:`eyebrow`,children:s(`BOARD READBACK`,`بازخوانی برد`)}),(0,X.jsx)(`h3`,{id:`rf-inventory-title`,children:s(`Learned record review`,`بازبینی ورودی‌های آموخته‌شده`)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(se,{tone:we.length?`warn`:`good`,children:[we.length,` `,s(`need review`,`نیازمند بررسی`)]}),e.connected&&(0,X.jsx)(j,{compact:!0,tone:`ghost`,icon:n,onClick:()=>void M(),children:s(`Refresh`,`تازه‌سازی`)})]})]}),y.length===0?(0,X.jsxs)(`div`,{className:`rf-inventory__empty`,children:[(0,X.jsx)(u,{size:24}),(0,X.jsx)(`strong`,{children:s(`No learned records`,`ورودی آموخته‌شده‌ای نیست`)}),(0,X.jsx)(`p`,{children:s(`The inventory will update after the first confirmed capture.`,`فهرست پس از نخستین دریافت تأییدشده به‌روز می‌شود.`)})]}):(0,X.jsx)(`div`,{className:`rf-inventory__list`,children:y.map(t=>{let n=bn(t,y);return(0,X.jsxs)(`article`,{className:n?`needs-review`:``,children:[(0,X.jsx)(`span`,{className:`rf-inventory__id`,children:t.id}),(0,X.jsxs)(`div`,{className:`rf-inventory__identity`,children:[(0,X.jsx)(`strong`,{dir:`ltr`,children:t.name||Q(t)}),(0,X.jsxs)(`small`,{dir:`ltr`,children:[t.name?`${Q(t)} · `:``,t.bits,` bit · P`,t.protocol,` · `,t.pulse_us,` µs`]})]}),(0,X.jsxs)(`div`,{className:`rf-inventory__mapping`,children:[(0,X.jsx)(`span`,{children:Tn(t,s)}),n&&(0,X.jsx)(`small`,{children:t.action_kind===0?s(`Unmapped record`,`ورودی بدون نگاشت`):s(`Duplicate identity`,`هویت تکراری`)})]}),e.connected&&(0,X.jsxs)(`div`,{className:`rf-inventory__actions`,children:[(0,X.jsx)(j,{compact:!0,icon:lt,onClick:()=>_e(t),children:s(`Remap`,`نگاشت دوباره`)}),(0,X.jsx)(j,{compact:!0,icon:ae,onClick:()=>ge(t),children:s(`Test once`,`آزمایش یک‌بار`)}),(0,X.jsx)(j,{compact:!0,tone:`danger`,icon:c,"aria-label":s(`Remove RF entry ${t.id}`,`حذف ورودی RF شماره ${t.id}`),onClick:()=>L(t)})]})]},t.id)})}),y.length>0&&(0,X.jsxs)(`footer`,{children:[(0,X.jsx)(`span`,{children:s(`${y.length} of 20 slots used`,`${y.length} از ۲۰ جایگاه استفاده شده`)}),e.connected&&(0,X.jsx)(j,{compact:!0,tone:`danger`,icon:re,onClick:he,children:s(`Clear all…`,`پاک‌کردن همه…`)})]})]})]})})}function kn(e){switch(e?.trim().toLowerCase()){case`blue`:return`blue`;case`violet`:return`violet`;case`green`:return`green`;case`white`:return`white`;default:return`red`}}function An(e){let t=e.repeat_count??1,n=(e.steps??[]).reduce((e,t)=>Math.max(e,(t.at_us??0)+(t.duration_ms??0)*1e3),0),r=e.repeat_interval_ms??0,i=r===0?n:r*1e3,a=n+(t-1)*i;if(!(!Number.isInteger(t)||t<1||t>1e3||!Number.isInteger(r)||r<0||r>36e5||i2147483647||t>1&&i===0||!Number.isInteger(a)||a<0||a>2147483647))return a}function jn(e,t){e??=0;let n=Math.abs(e);return n>=1e6?`${(e/1e6).toLocaleString(t,{maximumFractionDigits:3})} s`:n>=1e3?`${(e/1e3).toLocaleString(t,{maximumFractionDigits:3})} ms`:`${e.toLocaleString(t)} µs`}function Mn({macros:e,selectedReference:t,locale:n,onSelect:r}){let i=n===`fa`;return e.length?(0,X.jsx)(`div`,{className:`macro-library__catalog`,role:`listbox`,"aria-label":i?`کتابخانه جلوه‌ها`:`Effect library`,children:e.map(e=>{let a=t===String(e.id),o=An(e);return(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":a,className:a?`is-selected`:``,onClick:()=>r(e),children:[(0,X.jsx)(`span`,{className:`macro-library__color is-${kn(e.color)}`,"aria-hidden":`true`}),(0,X.jsxs)(`span`,{className:`macro-library__identity`,children:[(0,X.jsx)(`strong`,{children:e.name}),(0,X.jsxs)(`small`,{children:[`#`,e.id,` · `,e.category||(i?`بدون دسته`:`Uncategorized`),` · `,e.mode||`auto`]})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:(e.steps?.length??0).toLocaleString(n)}),(0,X.jsx)(`small`,{children:i?`گام`:`steps`})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:o===void 0?i?`زمان‌بندی نامعتبر`:`Invalid timing`:jn(o,n)}),(0,X.jsx)(`small`,{children:i?`مدت`:`duration`})]})]},e.id)})}):(0,X.jsx)(`div`,{className:`macro-library__empty`,children:i?`هنوز جلوهٔ ضبط‌شده‌ای وجود ندارد.`:`No recorded effects yet.`})}function Nn({online:e,locale:t,events:n,initialSnapshot:r,stripEffects:a=[],commandSurface:o}){let s=t===`fa`,l=(e,t)=>s?t:e,u=l(`Choose recording channels with effect record start-json in Console. The recording chooser is not available yet.`,`کانال‌های ضبط را با فرمان effect record start-json در کنسول انتخاب کنید. انتخاب‌گر ضبط هنوز آماده نیست.`),[f,p]=(0,V.useState)(r??null),[m,h]=(0,V.useState)(r?`ready`:`loading`),[g,ee]=(0,V.useState)(``),[v,y]=(0,V.useState)(``),[te,b]=(0,V.useState)(``),[ne,re]=(0,V.useState)(0),[x,ie]=(0,V.useState)(``),[ae,S]=(0,V.useState)(`Web`),[oe,C]=(0,V.useState)(`green`),[ce,w]=(0,V.useState)(`auto`),[T,E]=(0,V.useState)(``),[D,O]=(0,V.useState)(null),A=(0,V.useRef)(r?.latest_event_id??0),ue=(0,V.useCallback)(async(e=!1)=>{e||ee(`controller.macro.snapshot`);try{let e=(await k(`controller.snapshot`)).macros;return p(e),h(`ready`),y(``),A.current=Math.max(A.current,e.latest_event_id||0),e}catch(e){return h(`error`),y(e instanceof Error?e.message:String(e)),null}finally{e||ee(``)}},[t]);(0,V.useEffect)(()=>{ue()},[ue]),(0,V.useEffect)(()=>{let e=n.filter(e=>e.id>A.current).sort((e,t)=>e.id-t.id);if(!e.length||(A.current=e[e.length-1].id,p(t=>e.reduce((e,t)=>e&&fe(e,t),t)),!e.some(ve)))return;let t=window.setTimeout(()=>{ue(!0)},60);return()=>window.clearTimeout(t)},[n,ue]);let M=(0,V.useMemo)(()=>f?.library.find(e=>String(e.id)===te),[te,f?.library]),de=(0,V.useMemo)(()=>a.find(e=>e.id===T),[T,a]);(0,V.useEffect)(()=>{if(!f)return;!te&&f.library.length&&b(String(f.library[0].id));let e=new Set(f.library.map(e=>e.id)),t=0;for(;t<255&&e.has(t);)t+=1;re(n=>e.has(n)?t:n)},[te,f]),(0,V.useEffect)(()=>{M&&(ie(M.name),S(M.category||``),C(kn(M.color)))},[M?.category,M?.color,M?.id,M?.name]),(0,V.useEffect)(()=>{!T&&a.length&&E(a[0].id)},[T,a]),(0,V.useEffect)(()=>{de&&O({...de})},[de]);let pe=e=>b(String(e.id)),N=async(e,t,n)=>{ee(e),y(``);try{await o(n),await ue(!0)}catch(e){y(e instanceof Error?e.message:String(e))}finally{ee(``)}},me=te||x.trim(),F=f?.recording,I=f?.playback,L=n.slice(0,7);return(0,X.jsxs)(`div`,{className:`macro-library`,children:[(0,X.jsxs)(`div`,{className:`macro-library__monitor`,"aria-live":`polite`,children:[(0,X.jsxs)(`div`,{className:F?.active?`is-active`:``,children:[(0,X.jsx)(Ie,{"aria-hidden":`true`,size:17}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`small`,{children:l(`RECORDING`,`ضبط`)}),(0,X.jsx)(`strong`,{children:F?.active?F.name||`#${F.id}`:l(`Idle`,`آماده`)}),(0,X.jsx)(`em`,{children:F?.active?`${F.device_retained?l(`Device-retained take`,`برداشت نگه‌داری‌شده در دستگاه`):l(`Live capture`,`ضبط زنده`)} · ${F.steps} ${l(`steps`,`گام`)} · Δ ${jn(F.last_delta_us,t)}`:F?.name||``})]})]}),(0,X.jsxs)(`div`,{className:I?.running?`is-active`:``,children:[(0,X.jsx)(dt,{"aria-hidden":`true`,size:17}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`small`,{children:l(`PLAYBACK`,`اجرا`)}),(0,X.jsx)(`strong`,{children:I?.name||l(`Idle`,`آماده`)}),(0,X.jsx)(`em`,{children:I?.name?`${I.lifecycle||`idle`} · ${I.policy||`auto`} → ${I.mode||`pending`} · ${I.step}/${I.step_count} · Δ ${jn(I.last_timing_delta_us,t)}`:l(`No playback in this session`,`هنوز اجرایی در این نشست انجام نشده`)})]})]}),(0,X.jsx)(se,{tone:m===`error`?`warn`:m===`ready`?`good`:`info`,children:m===`error`?l(`UNAVAILABLE`,`در دسترس نیست`):m===`ready`?l(`LIVE`,`زنده`):l(`LOADING`,`در حال بارگذاری`)})]}),v&&(0,X.jsx)(`div`,{className:`macro-library__error`,role:`alert`,children:v}),F?.last_error&&(0,X.jsx)(`div`,{className:`macro-library__error`,role:`alert`,children:F.last_error}),!!F?.overwritten&&(0,X.jsx)(`div`,{className:`macro-library__error`,role:`status`,children:l(`Ring wrapped: ${F.overwritten} earlier snapshots overwritten. Saved profile contains the retained tail.`,`حافظه حلقوی پر شد: ${F.overwritten} وضعیت پیشین جایگزین شد. پروفایل شامل بخش پایانی باقی‌مانده است.`)}),(0,X.jsxs)(`div`,{className:`macro-library__workspace`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Be,{size:15}),` `,l(`Library`,`کتابخانه`)]}),(0,X.jsx)(`small`,{children:f?.library.length??0})]}),(0,X.jsx)(Mn,{macros:f?.library??[],selectedReference:te,locale:t,onSelect:pe})]}),(0,X.jsxs)(`section`,{className:`macro-library__editor`,children:[(0,X.jsx)(`header`,{children:(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Ze,{size:15}),` `,M?l(`Selected timed effect`,`جلوهٔ زمان‌بندی‌شدهٔ انتخابی`):l(`New timed effect`,`جلوهٔ زمان‌بندی‌شدهٔ جدید`)]})}),(0,X.jsxs)(`div`,{className:`macro-library__fields`,children:[(0,X.jsx)(P,{label:l(`ID 0..255`,`شناسه ۰ تا ۲۵۵`),type:`number`,min:0,max:255,value:M?M.id:ne,disabled:!!M,onChange:e=>re(Math.max(0,Math.min(255,Number(e.target.value)||0)))}),(0,X.jsx)(P,{label:l(`Name`,`نام`),value:x,maxLength:64,onChange:e=>ie(e.target.value)}),(0,X.jsx)(P,{label:l(`Category`,`دسته‌بندی`),value:ae,maxLength:64,onChange:e=>S(e.target.value)})]}),(0,X.jsxs)(`div`,{className:`macro-library__color-picker`,children:[(0,X.jsx)(`label`,{children:l(`Color`,`رنگ`)}),(0,X.jsx)(le,{value:oe,label:l(`Effect color`,`رنگ جلوه`),options:[{value:`red`,label:l(`Red`,`قرمز`)},{value:`blue`,label:l(`Blue`,`آبی`)},{value:`violet`,label:l(`Violet`,`بنفش`)},{value:`green`,label:l(`Green`,`سبز`)},{value:`white`,label:l(`White`,`سفید`)}],onChange:C})]}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[!M&&(0,X.jsx)(j,{icon:i,disabled:!x.trim(),busy:g===`controller.macro.create`,onClick:()=>void N(`controller.macro.create`,{id:ne,name:x.trim(),category:ae.trim(),color:oe},`effect create sequence ${ne} ${z(x.trim())} ${z(ae.trim())} ${z(oe)}`),children:l(`Create draft`,`ساخت پیش‌نویس`)}),M&&(0,X.jsx)(j,{icon:d,disabled:!x.trim(),busy:g===`controller.macro.update`,onClick:()=>void N(`controller.macro.update`,{reference:me,name:x.trim(),category:ae.trim(),color:oe},`effect update ${z(me)} ${z(x.trim())} ${z(ae.trim())} ${z(oe)}`),children:l(`Save metadata`,`ذخیره مشخصات`)}),M&&(0,X.jsx)(j,{tone:`danger`,icon:c,busy:g===`controller.macro.delete`,onClick:()=>void N(`controller.effect.delete`,{reference:me},`effect delete ${z(me)}`),children:l(`Delete`,`حذف`)}),M&&(0,X.jsx)(j,{tone:`ghost`,onClick:()=>{b(``),ie(``),S(`Web`),C(`green`)},children:l(`New`,`جدید`)})]})]})]}),(0,X.jsxs)(`section`,{className:`macro-library__strip-effects`,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(_,{size:15}),` `,l(`Lighting effects`,`جلوه‌های نورپردازی`)]}),(0,X.jsx)(`small`,{children:a.length})]}),(0,X.jsxs)(`div`,{className:`macro-library__workspace`,children:[(0,X.jsxs)(`div`,{className:`macro-library__catalog`,role:`listbox`,"aria-label":l(`Lighting effects`,`جلوه‌های نورپردازی`),children:[a.map(e=>(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.id===T,className:e.id===T?`is-selected`:``,onClick:()=>E(e.id),children:[(0,X.jsx)(`span`,{className:`macro-library__color is-violet`,"aria-hidden":`true`}),(0,X.jsxs)(`span`,{className:`macro-library__identity`,children:[(0,X.jsx)(`strong`,{children:e.name}),(0,X.jsxs)(`small`,{children:[e.category||l(`Uncategorized`,`بدون دسته`),` · `,e.engine]})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:e.default_fps}),(0,X.jsx)(`small`,{children:`FPS`})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:e.default_pixels}),(0,X.jsx)(`small`,{children:l(`LEDs`,`LED`)})]})]},e.id)),!a.length&&(0,X.jsx)(`div`,{className:`macro-library__empty`,children:l(`No lighting effects.`,`جلوهٔ نورپردازی وجود ندارد.`)})]}),(0,X.jsxs)(`div`,{className:`macro-library__editor`,children:[(0,X.jsx)(`header`,{children:(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Ze,{size:15}),` `,D?.id?l(`Effect properties`,`ویژگی‌های جلوه`):l(`New lighting effect`,`جلوه نور جدید`)]})}),D&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`macro-library__fields`,children:[(0,X.jsx)(P,{label:l(`Stable ID`,`شناسه پایدار`),value:D.id,disabled:!!de,onChange:e=>O({...D,id:e.target.value})}),(0,X.jsx)(P,{label:l(`Name`,`نام`),value:D.name,maxLength:64,onChange:e=>O({...D,name:e.target.value})}),(0,X.jsx)(P,{label:l(`Category`,`دسته‌بندی`),value:D.category||``,maxLength:64,onChange:e=>O({...D,category:e.target.value})}),(0,X.jsx)(P,{label:l(`Description`,`توضیح`),value:D.description||``,maxLength:64,onChange:e=>O({...D,description:e.target.value})}),(0,X.jsx)(P,{label:l(`Frames / second`,`فریم در ثانیه`),type:`number`,min:1,max:30,value:D.default_fps,onChange:e=>O({...D,default_fps:Number(e.target.value)})}),(0,X.jsx)(P,{label:l(`Duration (ms)`,`مدت (میلی‌ثانیه)`),type:`number`,min:100,max:36e5,value:D.default_duration_ms,onChange:e=>O({...D,default_duration_ms:Number(e.target.value)})}),(0,X.jsx)(P,{label:l(`LED count`,`تعداد LED`),type:`number`,min:1,max:100,value:D.default_pixels,onChange:e=>O({...D,default_pixels:Number(e.target.value)})})]}),(0,X.jsx)(le,{value:D.program.primitive,label:l(`Program`,`برنامه`),options:[{value:`alternating-zones`,label:l(`Alternating zones`,`ناحیه‌های متناوب`)},{value:`envelope`,label:l(`Brightness envelope`,`پوش شدت نور`)},{value:`converging-points`,label:l(`Converging points`,`نقاط همگرا`)}],onChange:e=>O({...D,program:{...D.program,primitive:e}})}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:dt,disabled:!e||!de,onClick:()=>void N(`controller.effect.play`,{},`effect play ${z(D.id)}`),children:l(`Run`,`اجرا`)}),de?(0,X.jsx)(j,{icon:d,disabled:!D.name.trim(),onClick:()=>void N(`controller.effect.update`,{},`effect update ${z(D.id)} ${z(D.name.trim())} ${z((D.category||``).trim())} ${z((D.description||``).trim()||`-`)} ${z(D.program.primitive)} ${D.default_fps} ${D.default_duration_ms} ${D.default_pixels}`),children:l(`Save to PCController`,`ذخیره در PCController`)}):(0,X.jsx)(j,{icon:i,disabled:!D.id.trim()||!D.name.trim(),onClick:()=>void N(`controller.effect.create`,{},`effect create strip ${z(D.id.trim())} ${z(D.name.trim())} ${z(D.program.primitive)} ${z((D.category||``).trim())} ${D.default_fps} ${D.default_duration_ms} ${D.default_pixels}`),children:l(`Create in PCController`,`ساخت در PCController`)}),de&&(0,X.jsx)(j,{tone:`danger`,icon:c,onClick:()=>void N(`controller.effect.delete`,{},`effect delete ${z(D.id)}`),children:l(`Delete`,`حذف`)}),(0,X.jsx)(j,{tone:`ghost`,onClick:()=>{E(``),O({id:``,name:``,category:`Lighting`,description:``,program:{primitive:`alternating-zones`,primary:{red:255,green:0,blue:0},secondary:{red:0,green:0,blue:255},period_ms:800,step_ms:100,swap_after_steps:4,dim_intensity:36},engine:`host-stream`,editable:!0,default_fps:20,default_duration_ms:5e3,default_pixels:100,min_pixels:1,max_pixels:100,min_fps:1,max_fps:30})},children:l(`New`,`جدید`)})]})]})]})]})]}),M&&(M.steps?.length??0)>0&&(0,X.jsxs)(`details`,{className:`macro-library__steps`,children:[(0,X.jsxs)(`summary`,{children:[l(`Exact step timing`,`زمان‌بندی دقیق گام‌ها`),` · `,M.steps?.length??0]}),(0,X.jsx)(`div`,{role:`table`,children:(M.steps??[]).map((e,n,r)=>{let i=n?r[n-1].at_us??0:0,a=e.at_us??0;return(0,X.jsxs)(`div`,{role:`row`,children:[(0,X.jsxs)(`span`,{children:[`#`,n+1]}),(0,X.jsx)(`strong`,{children:e.kind}),(0,X.jsx)(`span`,{children:jn(a,t)}),(0,X.jsxs)(`span`,{children:[`Δ `,jn(a-i,t)]}),(0,X.jsx)(`code`,{children:e.text||`target=${e.target??0} value=${e.value??0}`})]},`${n}-${a}-${e.kind}`)})})]}),(0,X.jsxs)(`div`,{className:`macro-library__control-grid`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`header`,{children:l(`Host recording`,`ضبط میزبان`)}),(0,X.jsx)(`p`,{role:`status`,children:u}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:Ie,disabled:!0,title:u,"data-capture-selection":`unavailable`,children:l(`Start`,`شروع`)}),(0,X.jsx)(j,{icon:d,disabled:!F?.active||!!F.device_retained,busy:g===`controller.macro.record.stop`,onClick:()=>void N(`controller.macro.record.stop`,{save:!0},`effect record save`),children:l(`Stop + save`,`توقف و ذخیره`)}),(0,X.jsx)(j,{icon:c,disabled:!F?.active||!!F.device_retained,onClick:()=>void N(`controller.macro.record.stop`,{save:!1},`effect record discard`),children:l(`Discard`,`دور انداختن`)})]})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`header`,{children:l(`Device-retained recording`,`ضبط نگه‌داری‌شده در دستگاه`)}),(0,X.jsx)(`p`,{children:l(`Keeps the latest 25 relay snapshots in RAM. Save before resetting the board. Stop and release retained RAM before strip streaming.`,`۲۵ وضعیت آخر رله در حافظه نگهداری می‌شود. پیش از ریست ذخیره کنید. قبل از پخش نوار، ضبط را متوقف و حافظه را آزاد کنید.`)}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[(0,X.jsx)(j,{icon:ht,disabled:!0,title:u,"data-capture-selection":`unavailable`,children:l(`Start retained take`,`شروع برداشت نگه‌داری‌شده`)}),(0,X.jsx)(j,{icon:Be,disabled:!0,title:u,"data-capture-selection":`unavailable`,children:l(`Import retained capture`,`وارد کردن ضبط باقی‌مانده`)}),(0,X.jsx)(j,{icon:d,disabled:!F?.active||!F.device_retained,busy:g===`controller.macro.board_record.stop`,onClick:()=>void N(`controller.macro.board_record.stop`,{},`effect record save`),children:l(`Stop + import`,`توقف و واردکردن`)}),(0,X.jsx)(j,{tone:`danger`,icon:c,disabled:!F?.active||!F.device_retained,onClick:()=>void N(`controller.macro.board_record.discard`,{},`effect record discard`),children:l(`Discard`,`دور انداختن`)}),(0,X.jsx)(j,{icon:c,disabled:!e||!!F?.active||!!I?.running,onClick:()=>void N(`controller.macro.buffer.clear`,{},`effect buffer clear`),children:l(`Release board RAM for strip`,`آزاد کردن حافظه برد برای نوار`)})]})]})]}),(0,X.jsxs)(`div`,{className:`macro-library__playback-actions`,children:[(0,X.jsx)(le,{value:ce,label:l(`Execution`,`اجرا`),options:[{value:`auto`,label:l(`Automatic`,`خودکار`)},{value:`host`,label:l(`Host (forced)`,`میزبان (اجباری)`)},{value:`mcu`,label:l(`Device (forced)`,`دستگاه (اجباری)`)}],onChange:w}),(0,X.jsx)(j,{tone:`primary`,icon:dt,disabled:!e||!me,busy:g===`controller.macro.play`,onClick:()=>void N(`controller.effect.play`,{reference:me},`effect play ${z(me)} ${ce}`),children:l(`Play selected`,`اجرای انتخاب‌شده`)}),(0,X.jsx)(j,{icon:Re,disabled:!e||!I?.running,busy:g===`controller.macro.cancel`,onClick:()=>void N(`controller.macro.cancel`,{keep_outputs:!1},`effect cancel`),children:l(`Cancel + turn outputs off`,`لغو و خاموش‌کردن خروجی‌ها`)}),(0,X.jsx)(j,{tone:`danger`,icon:Re,disabled:!e||!I?.running,onClick:()=>void N(`controller.macro.cancel`,{keep_outputs:!0},`effect cancel keep`),children:l(`Cancel, keep outputs`,`لغو با حفظ خروجی‌ها`)})]}),(0,X.jsxs)(`section`,{className:`macro-library__events`,"aria-label":l(`Live effect monitor`,`پایش زنده جلوه`),children:[(0,X.jsx)(`header`,{children:l(`Live structured monitor`,`پایش زنده ساختاریافته`)}),L.length?L.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`time`,{children:new Date(e.time).toLocaleTimeString(t)}),(0,X.jsx)(`strong`,{children:e.kind}),(0,X.jsx)(`span`,{children:e.lifecycle||e.state||e.text}),e.metadata?.delta_us&&(0,X.jsxs)(`code`,{children:[`Δ `,e.metadata.delta_us,` µs`]}),e.metadata?.mcu_delta_us&&(0,X.jsxs)(`code`,{children:[`Δ `,e.metadata.mcu_delta_us,` µs`]})]},e.id)):(0,X.jsx)(`p`,{children:l(`Waiting for effect events.`,`در انتظار رویدادهای جلوه.`)})]})]})}function Pn(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.name==`string`?t.name.trim():``;if(!n||!Array.isArray(t.notes))return[];let r=t.notes.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=Number(t.frequency_hz),r=Number(t.duration_ms),i=t.gap_ms===void 0?0:Number(t.gap_ms),a=n===0||n>=20&&n<=2e4;return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!a||r<1||r>5e3||i<0||i>5e3?[]:[{frequency_hz:Math.round(n),duration_ms:Math.round(r),gap_ms:Math.round(i)}]});return r.length===t.notes.length?[{name:n,notes:r}]:[]}):[]}function Fn(e,t){let n=e.notes.reduce((e,t)=>e+t.duration_ms+(t.gap_ms??0),0);return t===`fa`?`${e.notes.length} نت · ${n} میلی‌ثانیه`:`${e.notes.length} notes · ${n} ms`}function In(e){if(!Array.isArray(e))return[];let t=new Set;return e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let n=e,r=typeof n.name==`string`?n.name.trim().toLowerCase():``,i=typeof n.usage==`string`?n.usage.trim():``,a=typeof n.summary==`string`?n.summary.trim():``,o=typeof n.group==`string`?n.group.trim():``;if(!r||!i||!a||!o||t.has(r))return[];let s=Array.isArray(n.aliases)?[...new Set(n.aliases.flatMap(e=>typeof e==`string`&&e.trim()?[e.trim().toLowerCase()]:[]))]:[];return t.add(r),[{name:r,aliases:s,usage:i,summary:a,group:o}]})}function Ln(e){let t=new Set,n=[];for(let r of e.usage.match(/[A-Za-z][A-Za-z0-9_-]*/g)??[]){let i=r.toLowerCase();r!==i||i===e.name||t.has(i)||(t.add(i),n.push(i))}return n}function Rn(e,t,n=10){let r=e.match(/^\s*/)?.[0]??``,i=e.slice(r.length);if(!i)return[];let a=i.search(/\s/);if(a<0){let e=i.toLowerCase();return t.filter(t=>[t.name,...t.aliases??[]].some(t=>t.toLowerCase().startsWith(e))).slice(0,n).map(e=>({value:`${r}${e.name} `,label:e.name,detail:`${e.usage} — ${e.summary}`}))}let o=i.slice(0,a).toLowerCase(),s=t.find(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase()===o));if(!s)return[];let c=Math.max(e.lastIndexOf(` `),e.lastIndexOf(` `))+1,l=e.slice(c).toLowerCase();return Ln(s).filter(e=>e.startsWith(l)&&e!==l).slice(0,n).map(t=>({value:`${e.slice(0,c)}${t} `,label:t,detail:s.usage}))}var zn=class{limit;entries=[];cursor=0;draft=``;constructor(e=100){this.limit=e}record(e){let t=e.trim();t&&this.entries[this.entries.length-1]!==t&&(this.entries.push(t),this.entries.length>this.limit&&this.entries.splice(0,this.entries.length-this.limit)),this.cursor=this.entries.length,this.draft=``}edited(e){this.cursor=this.entries.length,this.draft=e}move(e,t){return this.entries.length?(this.cursor===this.entries.length&&(this.draft=t),this.cursor=Math.max(0,Math.min(this.entries.length,this.cursor+e)),this.cursor===this.entries.length?this.draft:this.entries[this.cursor]):t}values(){return[...this.entries]}},Bn=0,Vn=[`terminal`,`displays`,`status-lighting`,`audio`,`radio`,`macros`,`automations`,`i2c`,`host-control`,`firmware`];function Hn(e,t=`log`,n){return{id:n??`terminal-${++Bn}`,kind:`text`,text:e,level:t}}function Un({tokens:e}){return(0,X.jsx)(X.Fragment,{children:e.map((e,t)=>(0,X.jsx)(`span`,{className:`console-token console-token--${e.kind===`value`?e.valueType:`text`}`,style:e.style,children:e.text},`${t}-${e.text}`))})}function Wn({entry:e,locale:t}){if(e.hidden)return null;let n={"--console-indent":`${e.depth*16}px`};return e.kind===`table`?(0,X.jsxs)(`div`,{className:`console-record console-record--table`,style:n,"data-level":`log`,children:[(0,X.jsxs)(`table`,{children:[(0,X.jsx)(`thead`,{children:(0,X.jsx)(`tr`,{children:e.columns.map(e=>(0,X.jsx)(`th`,{children:e},e))})}),(0,X.jsx)(`tbody`,{children:e.rows.map(t=>(0,X.jsx)(`tr`,{children:e.columns.map(e=>(0,X.jsx)(`td`,{children:(0,X.jsx)(Un,{tokens:t.cells[e]??[]})},e))},t.key))})]}),(e.omittedRows>0||e.omittedColumns>0)&&(0,X.jsx)(`small`,{children:t===`fa`?`${e.omittedRows} ردیف و ${e.omittedColumns} ستون نمایش داده نشد`:`${e.omittedRows} rows and ${e.omittedColumns} columns omitted`})]}):(0,X.jsxs)(`div`,{className:`console-record console-record--${e.kind}`,style:n,"data-level":e.level,children:[e.kind===`group`&&(0,X.jsx)(`span`,{className:`console-group-mark`,children:e.collapsed?`▸`:`▾`}),(0,X.jsx)(Un,{tokens:e.tokens})]})}function Gn(e){if(e.kind===`table`){console.table(e.rows.map(t=>Object.fromEntries(e.columns.map(e=>[e,Jt(t.cells[e]??[])]))));return}if(e.kind===`group`){console[e.collapsed?`groupCollapsed`:`group`](...Xt(e.tokens));return}let t=e.level===`error`?`error`:e.level===`warn`?`warn`:e.level===`debug`?`debug`:e.level===`info`?`info`:`log`;console[t](...Xt(e.tokens))}function Kn(e){return e.kind===`table`?`console.table: ${e.rows.length} rows × ${e.columns.length} columns`:Jt(e.tokens)}function qn(t){let{events:n,locale:r,t:i,command:o,snapshot:c,transport:l,relayedTerminal:u}=t,d=r===`fa`,p=(e,t)=>d?t:e,[m,_]=(0,V.useState)(``),[x,S]=(0,V.useState)([]),[ce,w]=(0,V.useState)(!1),[D,O]=(0,V.useState)(``),[ue,fe]=(0,V.useState)([]),[pe,L]=(0,V.useState)(!1),[he,ge]=(0,V.useState)(0),[R,ve]=(0,V.useState)(`both`),[be,xe]=(0,V.useState)(220),[Se,ke]=(0,V.useState)(5e3),[Ae,je]=(0,V.useState)(`once`),[Me,Ne]=(0,V.useState)(3e4),[Fe,Ie]=(0,V.useState)(!1),[Le,ze]=(0,V.useState)(`READY`),[Be,Ve]=(0,V.useState)(880),[He,Ue]=(0,V.useState)(120),[Ge,Ke]=(0,V.useState)(``),[B,qe]=(0,V.useState)([]),[Je,Ye]=(0,V.useState)(`loading`),[Xe,Ze]=(0,V.useState)(38),[Qe,$e]=(0,V.useState)(210),[et,nt]=(0,V.useState)(220),[it,ot]=(0,V.useState)(180),[st,ct]=(0,V.useState)(``),[lt,ut]=(0,V.useState)(60),[ft,pt]=(0,V.useState)(!1),[mt,ht]=(0,V.useState)(()=>y(`workbench`,Vn)),[gt,vt]=(0,V.useState)(null),yt=(0,V.useRef)(null),bt=(0,V.useRef)(n.reduce((e,t)=>Math.max(e,t.id),0)),St=(0,V.useRef)(new Set),wt=(0,V.useRef)(new an({maxEntries:240})),Tt=(0,V.useRef)(new zn),H=R===`segments`?40:32,U=Le.length>0&&Le.length<=H&&/^[\x20-\x7e]*$/.test(Le),W=N(c),Et=!!c.front_panel?.tm1637_detection_known,Dt=!!c.front_panel?.tm1637_detected,G=l.boardState===`ready`&&c.connected&&c.have_status,Ot=we(c),K=Rn(m,ue),At=Math.min(he,Math.max(0,K.length-1)),jt=[{value:`segments`,label:p(`Segments`,`سون‌سگمنت`)},...W.lcd?[{value:`lcd`,label:`LCD`},{value:`both`,label:p(`Both`,`هر دو`)}]:[]];(0,V.useEffect)(()=>{!W.lcd&&R!==`segments`&&ve(`segments`)},[W.lcd,R]),(0,V.useEffect)(()=>{let e=new AbortController;return fe([]),k(`controller.command.catalog`,{},e.signal).then(t=>{e.signal.aborted||fe(In(t))}).catch(()=>{e.signal.aborted||fe([])}),()=>e.abort()},[l.authenticationRequired,l.streamState]),(0,V.useEffect)(()=>{let e=new AbortController;return Ye(`loading`),k(`controller.melodies.list`,{},e.signal).then(t=>{if(e.signal.aborted)return;let n=Pn(t);qe(n),Ke(e=>n.some(t=>t.name===e)?e:``),Ye(`ready`)}).catch(()=>{e.signal.aborted||(qe([]),Ke(``),Ye(`error`))}),()=>e.abort()},[l.authenticationRequired,l.streamState]),(0,V.useEffect)(()=>{let e=n.filter(e=>e.id>bt.current).sort((e,t)=>e.id-t.id);if(!e.length)return;bt.current=Math.max(bt.current,...e.map(e=>e.id));let t=e.flatMap(e=>[Hn(`[${_e(r,e.time)}] event/${e.source||`host`} ${e.kind}`,/error|fault|hot/i.test(e.kind)?`error`:/warn|door|disconnect/i.test(e.kind)?`warn`:`info`),Hn(e.text)]);S(e=>[...e,...t].slice(-120))},[n,r]),(0,V.useEffect)(()=>{let e=u.filter(e=>!St.current.has(e.id));if(!e.length)return;for(let t of e)St.current.add(t.id);let t=e.map(e=>Hn(`[tab/${e.tabId.slice(0,7)}] ${e.kind===`error`?`!`:e.kind===`command`?`pc›`:`↳`} ${e.text.replace(/^pc›\s*/,``)}`,e.kind===`error`?`error`:e.kind===`system`?`info`:`log`,`tab-${e.id}`));S(e=>[...e,...t].slice(-120))},[u]);let q=async e=>{let n=e.trim();if(!n)return``;if(/^console\s*\./i.test(n)){let e=kt(n),r=wt.current.dispatch(e??n);if(r.cleared)console.clear(),S([]);else if(r.emitted.length){let e=r.emitted.map(e=>({id:`console-${e.id}`,kind:`console`,entry:e}));S(t=>[...t,...e].slice(-120));for(let e of r.emitted)Gn(e),t.broadcastTerminal({kind:e.level===`error`?`error`:`system`,text:Kn(e),at:e.timestamp})}return e?.method===`groupEnd`&&console.groupEnd(),r.emitted.map(Kn).join(` -`)}O(n),S(e=>[...e.slice(-119),Hn(`pc› ${me(n)}`)]);try{let e=await o(n);return S(t=>[...t.slice(-119),Hn(e||p(`✓ accepted`,`✓ پذیرفته شد`),`info`)]),e}catch(e){let t=e instanceof Error?e.message:String(e);return S(e=>[...e.slice(-119),Hn(`! ${t}`,`error`)]),``}finally{O(``)}},Mt=e=>{e.preventDefault();let t=m.trim();t&&(me(t)===t?Tt.current.record(t):Tt.current.edited(``),_(``),L(!1),q(t))},Nt=e=>{let t=K[e];t&&(Tt.current.edited(t.value),_(t.value),L(!1),window.requestAnimationFrame(()=>document.getElementById(`workbench-command`)?.focus()))},Pt=e=>{S(t=>[...t.slice(-118),Hn(`${p(`Event`,`رویداد`)} #${e.id}`,`info`),Hn(JSON.stringify(e,null,2))])},Ft={move:p(`Move`,`جابجایی`),collapse:p(`Collapse`,`جمع‌کردن`),expand:p(`Expand`,`بازکردن`),hide:p(`Hide`,`پنهان‌کردن`),show:p(`Show`,`نمایش`),customize:p(`Arrange`,`چیدمان`),done:p(`Done`,`پایان`),reset:p(`Reset layout`,`بازنشانی چیدمان`),hidden:p(`Hidden cards`,`کارت‌های پنهان`)},It=[{id:`terminal`,label:p(`Bridge terminal`,`ترمینال پل`)},{id:`displays`,label:p(`Displays`,`نمایشگرها`)},{id:`status-lighting`,label:p(`Addressable strip`,`نوار LED آدرس‌پذیر`)},{id:`audio`,label:p(`Buzzer & melody`,`بیزر و ملودی`)},{id:`radio`,label:p(`Radio controls`,`کنترل‌های رادیویی`)},{id:`macros`,label:p(`Effect library`,`کتابخانه جلوه‌ها`)},{id:`automations`,label:p(`Host automations`,`خودکارسازی میزبان`)},{id:`i2c`,label:p(`I²C & peripherals`,`I²C و تجهیزات جانبی`)},{id:`host-control`,label:p(`Host control`,`کنترل میزبان`)},{id:`firmware`,label:p(`Firmware & recovery`,`میان‌افزار و بازیابی`)}],Lt=mt.order.filter(e=>e===`displays`?G&&W.segments:e===`status-lighting`?G&&W.statusLED:e===`audio`?G&&W.buzzer:e===`radio`?G&&W.rf:e!==`i2c`||G),J=e=>{ht(t=>{let n=e(t);return f(`workbench`,Vn,n),n})},Rt=()=>{ee(`workbench`),ht(y(`workbench`,Vn))},zt=(e,t,n)=>{let r=document.elementFromPoint(t,n)?.closest(`[data-layout-card-id]`)?.dataset.layoutCardId,i=Vn.includes(r)?r:void 0;s(yt.current,e,i)&&(yt.current=i,J(t=>h(t,e,i)))},Bt=(e,t)=>J(n=>{let r=n.order.filter(e=>Lt.includes(e)&&!n.hidden.includes(e)),i=r[r.indexOf(e)+t];return i?h(n,e,i):n}),Y=(e,t,n)=>(0,X.jsx)(v,{id:e,title:t,order:mt.order.indexOf(e),collapsed:mt.collapsed.includes(e),hidden:mt.hidden.includes(e),editing:ft,dragging:gt===e,copy:Ft,onToggleCollapsed:()=>J(t=>({...t,collapsed:a(t.collapsed,e)})),onHide:()=>J(t=>({...t,hidden:a(t.hidden,e)})),onReorderStart:e=>{yt.current=null,vt(e)},onReorderMove:zt,onReorderEnd:()=>{yt.current=null,vt(null)},onKeyboardReorder:Bt,children:n});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(de,{eyebrow:G?p(`Controller and host tools`,`ابزارهای برد و میزبان`):p(`Host tools`,`ابزارهای میزبان`),title:i(`workbench`),detail:`${l.streamState.toUpperCase()} · ${n.length} ${p(`events`,`رویداد`)} · ${l.tabPeers+1} ${p(`tabs`,`تب`)}`,action:(0,X.jsxs)(`div`,{className:`header-actions`,children:[(0,X.jsx)(se,{tone:G?`good`:`warn`,children:G?p(`BOARD + HOST`,`برد + میزبان`):p(`HOST ONLY`,`فقط میزبان`)}),(0,X.jsx)(g,{copy:Ft,editing:ft,cards:It.filter(({id:e})=>Lt.includes(e)),hidden:mt.hidden,onToggleEditing:()=>pt(e=>!e),onShow:e=>J(t=>({...t,hidden:t.hidden.filter(t=>t!==e)})),onReset:Rt})]})}),(0,X.jsxs)(`section`,{className:`workbench-grid`,children:[Y(`terminal`,p(`Bridge terminal`,`ترمینال پل`),(0,X.jsxs)(E,{icon:C,iconTone:`accent`,className:`workbench-terminal`,title:p(`Bridge terminal`,`ترمینال پل`),eyebrow:p(`Full duplex`,`ارتباط دوطرفه`),action:(0,X.jsxs)(`div`,{className:`terminal-transport`,children:[(0,X.jsxs)(se,{tone:l.streamState===`open`?`good`:`warn`,children:[`WS `,l.streamState.toUpperCase()]}),(0,X.jsxs)(se,{tone:l.tabBusSupported?l.tabPeers?`good`:`info`:`warn`,children:[`TAB `,l.tabBusSupported?l.tabPeers+1:`—`]}),(0,X.jsxs)(se,{tone:`info`,children:[(0,X.jsx)(T,{size:13}),` `,n.length]})]}),menu:[{label:p(`Clear terminal`,`پاک‌کردن ترمینال`),icon:re,onSelect:()=>{console.clear(),S([])}},{label:ce?p(`Hide console syntax`,`بستن راهنما`):p(`Show console syntax`,`نمایش راهنمای کنسول`),icon:C,onSelect:()=>w(e=>!e)},{label:p(`Open event timeline`,`بازکردن خط زمانی`),icon:T,onSelect:()=>{window.location.hash=`#/events`}}],children:[(0,X.jsx)(`div`,{className:`terminal-transcript`,role:`log`,"aria-live":`polite`,dir:`ltr`,children:x.map(e=>e.kind===`console`?(0,X.jsx)(Wn,{entry:e.entry,locale:r},e.id):(0,X.jsx)(`pre`,{className:`terminal-line`,"data-level":e.level,children:e.text},e.id))}),(0,X.jsxs)(`form`,{className:`command-form`,onSubmit:Mt,children:[(0,X.jsx)(`span`,{className:`command-prompt`,children:`pc›`}),(0,X.jsxs)(`div`,{className:`terminal-command-box`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||L(!1)},children:[(0,X.jsx)(`input`,{id:`workbench-command`,"aria-label":p(`Primary bridge command`,`فرمان پل اصلی`),"aria-autocomplete":`list`,"aria-controls":`workbench-command-completions`,"aria-expanded":pe&&K.length>0,"aria-activedescendant":pe&&K.length?`workbench-command-completion-${At}`:void 0,value:m,onFocus:()=>L(K.length>0),onChange:e=>{Tt.current.edited(e.target.value),_(e.target.value),ge(0),L(!0)},onKeyDown:e=>{if(e.key===`Tab`&&K.length)e.preventDefault(),Nt(At);else if((e.key===`ArrowDown`||e.key===`ArrowUp`)&&pe&&K.length)e.preventDefault(),ge(t=>(t+(e.key===`ArrowDown`?1:-1)+K.length)%K.length);else if(e.key===`ArrowUp`||e.key===`ArrowDown`){e.preventDefault();let t=Tt.current.move(e.key===`ArrowUp`?-1:1,m);_(t),L(!1)}else e.key===`Escape`&&(e.preventDefault(),L(!1))},spellCheck:!1,autoComplete:`off`,dir:`ltr`}),pe&&K.length>0&&(0,X.jsx)(`div`,{id:`workbench-command-completions`,className:`terminal-completions`,role:`listbox`,"aria-label":p(`Command completions`,`پیشنهادهای فرمان`),children:K.map((e,t)=>(0,X.jsxs)(`button`,{id:`workbench-command-completion-${t}`,type:`button`,role:`option`,"aria-selected":t===At,onMouseDown:e=>e.preventDefault(),onClick:()=>Nt(t),children:[(0,X.jsx)(`strong`,{children:e.label}),(0,X.jsx)(`small`,{children:e.detail})]},`${e.value}-${e.label}`))})]}),(0,X.jsx)(j,{type:`submit`,tone:`primary`,icon:ae,busy:D!==``,children:i(`run`)})]}),(0,X.jsxs)(`div`,{className:`terminal-console-help`,children:[(0,X.jsx)(j,{compact:!0,tone:`ghost`,onClick:()=>w(e=>!e),"aria-expanded":ce,children:ce?p(`Hide console syntax`,`بستن راهنما`):p(`Console syntax`,`راهنمای کنسول`)}),ce&&(0,X.jsx)(`code`,{dir:`ltr`,children:`console.*() · %s %d %i %f %o %O %c %% · table · groups · counters · timers`})]}),(0,X.jsx)(`div`,{className:`terminal-event-strip`,children:n.slice(0,5).map(e=>(0,X.jsxs)(`button`,{onClick:()=>Pt(e),children:[(0,X.jsx)(`time`,{children:_e(r,e.time)}),(0,X.jsx)(`strong`,{children:e.kind}),(0,X.jsx)(`span`,{children:e.text})]},e.id))})]})),G&&W.segments&&Y(`displays`,p(`Displays`,`نمایشگرها`),(0,X.jsxs)(E,{icon:e,iconTone:`violet`,title:p(`Displays`,`نمایشگرها`),eyebrow:W.lcd?`TM1637 + LCD`:`TM1637`,action:Et?(0,X.jsx)(se,{tone:Dt?`good`:`bad`,children:Dt?p(`TM1637 detected`,`TM1637 شناسایی شد`):p(`TM1637 not detected`,`TM1637 شناسایی نشد`)}):void 0,children:[W.lcd&&(0,X.jsxs)(`div`,{className:`setting-group`,children:[(0,X.jsx)(`label`,{children:p(`Target`,`مقصد`)}),(0,X.jsx)(le,{value:R,label:p(`Display target`,`مقصد نمایش`),options:jt,onChange:ve})]}),(0,X.jsx)(P,{label:p(`Display text · ${H} characters maximum`,`متن نمایشگر، حداکثر ${H} نویسه`),hint:U?p(`Printable ASCII is sent exactly, including leading and trailing spaces.`,`ASCII قابل چاپ دقیقاً با فاصله‌های ابتدا و انتها ارسال می‌شود.`):p(`Use printable ASCII characters only.`,`فقط از نویسه‌های قابل چاپ ASCII استفاده کنید.`),value:Le,maxLength:H,pattern:`[ -~]*`,"aria-invalid":!U,onChange:e=>ze(e.target.value)}),R!==`lcd`&&(0,X.jsx)(M,{label:p(`Marquee step speed`,`سرعت گام متن روان`),value:be,min:80,max:5e3,step:20,unit:`ms`,onChange:xe}),(0,X.jsx)(M,{label:p(`Visible duration`,`مدت نمایش`),value:Se,min:80,max:65520,step:20,unit:`ms`,onChange:ke}),(0,X.jsxs)(`div`,{className:`setting-group`,children:[(0,X.jsx)(`label`,{children:p(`Repeat policy`,`سیاست تکرار`)}),(0,X.jsx)(le,{value:Ae,label:p(`Display repeat policy`,`سیاست تکرار نمایش`),options:[{value:`once`,label:p(`Once`,`یک‌بار`)},{value:`loop`,label:p(`Loop`,`پیوسته`)},{value:`interval`,label:p(`Interval`,`بازه‌ای`)}],onChange:je})]}),Ae===`interval`&&(0,X.jsx)(M,{label:p(`Wait between presentations`,`مکث بین نمایش‌ها`),value:Me,min:1e3,max:255e3,step:1e3,unit:`ms`,onChange:Ne}),R!==`lcd`&&(0,X.jsx)(Ce,{checked:Fe,onChange:Ie,label:p(`Force marquee`,`اجبار متن روان`),detail:p(`Overflow scrolls automatically; enable this only to scroll text that already fits.`,`متن بلند خودکار حرکت می‌کند؛ این گزینه متن کوتاه را نیز روان می‌کند.`)}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:I,disabled:!U,onClick:()=>void q(hn({target:R,text:Le,speedMS:be,durationMS:Se,repeat:Ae,intervalMS:Me,scroll:Fe})),children:p(`Show text`,`نمایش متن`)}),(0,X.jsx)(j,{icon:We,onClick:()=>void q(`display ${R} 0`),children:p(`Clear`,`پاک‌کردن`)})]})]})),G&&W.statusLED&&Y(`status-lighting`,p(`Addressable strip`,`نوار LED آدرس‌پذیر`),(0,X.jsxs)(E,{icon:I,iconTone:`amber`,title:p(`Addressable strip`,`نوار LED آدرس‌پذیر`),children:[(0,X.jsx)(M,{label:p(`Red`,`قرمز`),value:Xe,min:0,max:255,onChange:Ze}),(0,X.jsx)(M,{label:p(`Green`,`سبز`),value:Qe,min:0,max:255,onChange:$e}),(0,X.jsx)(M,{label:p(`Blue`,`آبی`),value:et,min:0,max:255,onChange:nt}),(0,X.jsx)(M,{label:p(`Brightness`,`روشنایی`),value:it,min:0,max:255,onChange:ot}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:at,onClick:()=>void q(`strip fill ${Xe} ${Qe} ${et} ${it}`),children:p(`Fill strip`,`اعمال رنگ`)}),(0,X.jsx)(j,{icon:We,onClick:()=>void q(`strip clear`),children:p(`Clear`,`پاک‌کردن`)})]})]})),G&&W.buzzer&&Y(`audio`,p(`Buzzer & melody`,`بیزر و ملودی`),(0,X.jsxs)(E,{icon:A,iconTone:`green`,title:p(`Buzzer & melody`,`بیزر و ملودی`),eyebrow:p(`Timed audio`,`صدای زمان‌بندی‌شده`),children:[(0,X.jsx)(M,{label:p(`Frequency`,`فرکانس`),value:Be,min:20,max:2e4,step:10,unit:`Hz`,onChange:Ve}),(0,X.jsx)(M,{label:p(`Duration`,`مدت`),value:He,min:20,max:5e3,step:20,unit:`ms`,onChange:Ue}),(0,X.jsx)(j,{icon:ye,onClick:()=>void q(`buzzer ${Be} ${He}`),children:p(`Play tone`,`پخش صدا`)}),(0,X.jsxs)(`div`,{className:`setting-group`,children:[(0,X.jsx)(`label`,{htmlFor:`workbench-configured-melody`,children:p(`Configured melody`,`ملودی ذخیره‌شده`)}),(0,X.jsxs)(`select`,{id:`workbench-configured-melody`,value:Ge,disabled:Je!==`ready`||B.length===0,onChange:e=>Ke(e.target.value),children:[(0,X.jsx)(`option`,{value:``,children:Je===`loading`?p(`Loading configured melodies…`,`در حال دریافت ملودی‌ها…`):Je===`error`?p(`Melody catalog unavailable`,`فهرست ملودی در دسترس نیست`):B.length===0?p(`No configured melodies`,`ملودی ذخیره‌شده‌ای وجود ندارد`):p(`Select a configured melody`,`یک ملودی ذخیره‌شده انتخاب کنید`)}),B.map(e=>(0,X.jsxs)(`option`,{value:e.name,children:[e.name,` · `,Fn(e,r)]},e.name))]})]}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(j,{icon:dt,disabled:!Ge,onClick:()=>void q(`melody play ${z(Ge)}`),children:p(`Play`,`پخش`)}),(0,X.jsx)(j,{icon:Re,onClick:()=>void q(`melody stop`),children:p(`Stop`,`توقف`)}),(0,X.jsx)(j,{icon:tt,onClick:()=>void q(`melody list`),children:p(`List`,`فهرست`)})]})]})),G&&W.rf&&Y(`radio`,p(`Radio controls`,`کنترل‌های رادیویی`),(0,X.jsx)(On,{snapshot:c,events:n,locale:r,openDialog:t.openDialog})),Y(`macros`,p(`Effect library`,`کتابخانه جلوه‌ها`),(0,X.jsx)(E,{className:`macro-card`,icon:Ct,iconTone:`green`,title:p(`Effect library`,`کتابخانه جلوه‌ها`),children:(0,X.jsx)(Nn,{online:c.connected,locale:r,events:t.macroEvents,initialSnapshot:c.macros,stripEffects:(c.effects??[]).filter(e=>e.kind===`strip-stream`&&!!e.program).map(e=>({id:e.id,name:e.name,category:e.category,description:e.description,program:e.program,engine:e.engine,editable:e.editable,default_fps:e.default_fps??20,default_duration_ms:e.duration_ms||5e3,default_pixels:e.default_pixels??100,min_pixels:1,max_pixels:100,min_fps:1,max_fps:30})),commandSurface:q})})),Y(`automations`,p(`Host automations`,`خودکارسازی میزبان`),(0,X.jsxs)(E,{icon:Pe,iconTone:`violet`,title:p(`Host automations`,`خودکارسازی میزبان`),eyebrow:p(`Event-driven host rules`,`قواعد رویدادمحور میزبان`),children:[(0,X.jsx)(P,{label:p(`Host automation name`,`نام خودکارسازی میزبان`),value:st,onChange:e=>ct(e.target.value)}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(j,{icon:Pe,disabled:!st.trim(),onClick:()=>void q(`automation run ${z(st.trim())}`),children:p(`Run automation`,`اجرای خودکارسازی`)}),(0,X.jsx)(j,{icon:tt,onClick:()=>void q(`automation list`),children:p(`List`,`فهرست`)})]})]})),G&&Y(`i2c`,p(`I²C & peripherals`,`I²C و تجهیزات جانبی`),(0,X.jsx)(E,{icon:ne,iconTone:`accent`,title:p(`I²C & peripherals`,`I²C و تجهیزات جانبی`),eyebrow:p(`Cooperative host lease`,`دسترسی هماهنگ میزبان`),children:(0,X.jsxs)(`div`,{className:`operation-buttons`,children:[(0,X.jsx)(j,{icon:_t,onClick:()=>void q(`i2c scan`),children:p(`Scan bus`,`پویش گذرگاه`)}),(0,X.jsx)(j,{icon:te,onClick:()=>void q(`i2c release`),children:p(`Release lease`,`آزادسازی دسترسی`)}),(0,X.jsx)(j,{icon:Te,onClick:()=>void q(`settings`),children:p(`Board settings`,`تنظیمات برد`)}),(0,X.jsx)(j,{icon:F,onClick:()=>void q(`menu current`),children:p(`Menu state`,`وضعیت منو`)})]})})),Y(`host-control`,p(`Host control`,`کنترل میزبان`),(0,X.jsxs)(E,{icon:rt,iconTone:`violet`,title:p(`Host control`,`کنترل میزبان`),eyebrow:p(`Policy-gated`,`تحت کنترل سیاست‌ها`),menu:[{label:p(`Read host status`,`خواندن وضعیت میزبان`),icon:rt,onSelect:()=>{q(`os status`)}},{label:p(`Inspect global hotkeys`,`بررسی میان‌برهای سراسری`),icon:Ct,onSelect:()=>{q(`hotkeys status`)}},{label:p(`Inspect keyboard hook`,`بررسی اتصال صفحه‌کلید`),icon:De,onSelect:()=>{q(`keyboard status`)}}],children:[(0,X.jsx)(M,{label:p(`Monitor brightness`,`روشنایی نمایشگر`),value:lt,min:0,max:100,unit:`%`,onChange:ut}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(j,{tone:`primary`,icon:xt,onClick:()=>void q(`os brightness set ${lt}`),children:p(`Apply brightness`,`اعمال روشنایی`)}),(0,X.jsx)(j,{icon:Oe,onClick:()=>void q(`os status`),children:p(`Host status`,`وضعیت میزبان`)}),(0,X.jsx)(j,{icon:oe,onClick:()=>void q(`os policy`),children:p(`Policies`,`سیاست‌ها`)})]}),(0,X.jsxs)(`div`,{className:`operation-buttons`,children:[(0,X.jsx)(j,{icon:Ee,onClick:()=>void q(`hotkeys status`),children:p(`Global hotkeys`,`میان‌برهای سراسری`)}),(0,X.jsx)(j,{icon:rt,onClick:()=>void q(`keyboard status`),children:p(`Keyboard hook`,`اتصال صفحه‌کلید`)}),(0,X.jsx)(j,{icon:ie,onClick:()=>void q(`bridge list`),children:p(`Remote bridges`,`پل‌های راه‌دور`)})]})]})),Y(`firmware`,p(`Firmware & recovery`,`میان‌افزار و بازیابی`),(0,X.jsx)(E,{icon:De,iconTone:`amber`,title:p(`Firmware & recovery`,`میان‌افزار و بازیابی`),eyebrow:p(`Read-only first`,`ابتدا فقط خواندنی`),children:(0,X.jsxs)(`div`,{className:`operation-buttons`,children:[G&&(0,X.jsx)(j,{icon:De,onClick:()=>void q(`hello`),children:p(`Identity`,`شناسه`)}),Ot&&(0,X.jsx)(j,{icon:re,onClick:()=>void q(`reset lines`),children:p(`Hardware reset (DTR)`,`بازنشانی سخت‌افزاری (DTR)`)}),(0,X.jsx)(j,{icon:b,onClick:()=>void q(`toolchain profile`),children:p(`Toolchain profile`,`مشخصات زنجیره‌ابزار`)}),(0,X.jsx)(j,{icon:C,onClick:()=>_(`boot info`),children:p(`Prepare boot info`,`آماده‌سازی اطلاعات راه‌اندازی`)})]})}))]}),(0,X.jsx)(mn,{...t,run:q,busy:D})]})}export{qn as WorkbenchView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DIrhZHWK.js b/Tools/Controller/internal/webui/dist/assets/chunk-DIrhZHWK.js new file mode 100644 index 00000000..5b85f644 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-DIrhZHWK.js @@ -0,0 +1,3 @@ +import{t as e}from"./chunk-GmnEjCp4.js";import{a as t,i as n,r}from"./chunk-BgHNRN_V.js";import{At as i,Dt as a,It as o,Pt as s,dt as c,ft as ee,kt as te,vt as l,zt as u}from"./app-BxYXetji.js";var d={name:`arrow-down-a-z`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]],aliases:[`arrow-down-az`]};d.node;var ne=s(d),f={name:`arrow-up-a-z`,size:24,node:[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]],aliases:[`arrow-up-az`]};f.node;var re=s(f),ie={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};ie.node;var ae=s(ie),p={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};p.node;var oe=s(p),se={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]};se.node;var ce=s(se),m=u(o(),1),le=88,ue=520,de=8,fe=500;function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return e===null?`null`:e===void 0?`Not set`:typeof e==`string`?e:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?Number.isNaN(e)?`NaN`:e===1/0?`+Infinity`:e===-1/0?`-Infinity`:Object.is(e,-0)?`-0`:e.toString():typeof e==`bigint`?`${e.toString()}n`:typeof e==`symbol`?e.description?`Symbol(${e.description})`:`Symbol`:typeof e==`function`?e.name?`Function(${e.name})`:`Function`:null}function _(e){try{return Object.keys(e)}catch{return null}}function pe(e,t){try{return Reflect.get(e,t)}catch{return`[unreadable]`}}function v(e){let t=g(e);if(t!==null)return t;if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?e.toISOString():`Invalid date`}if(Array.isArray(e))return`Array · ${e.length} item${e.length===1?``:`s`}`;if(h(e)){let t=_(e);return t===null?`Unreadable object`:`Object · ${t.length} field${t.length===1?``:`s`}`}return`Unsupported value`}function y(e,t,n,r){let i=g(e);if(i!==null)return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e)?e:i;if(e instanceof Date)return v(e);if(typeof e!=`object`||!e)return`Unsupported value`;if(t.has(e))return`[circular]`;if(n>=de)return`[depth limit]`;if(r.remaining<=0)return`[entry limit]`;let a=new Set(t);if(a.add(e),Array.isArray(e)){let t=[];for(let i of e){if(r.remaining<=0){t.push(`[entry limit]`);break}--r.remaining,t.push(y(i,a,n+1,r))}return t}let o=_(e);if(o===null)return`[unreadable object]`;let s=Object.create(null);for(let t of o){if(r.remaining<=0){s[`…`]=`[entry limit]`;break}--r.remaining,s[t]=y(pe(e,t),a,n+1,r)}return s}function b(e){return y(e,new Set,0,{remaining:fe})}function x(e,t=!1){let n=b(e);try{return JSON.stringify(n,null,t?2:0)??`null`}catch{return`"[unserializable]"`}}function S(e){let t=g(e);return t===null?x(e):t}function C(e,t){try{if(e.get)return e.get(t);if(h(t))return pe(t,e.id)}catch{return`[unreadable]`}}function w(e){return/metadata|details|message|description|reason|title/i.test(e)?260:/time|date|updated|created/i.test(e)?190:156}function me(e,t){return Number.isFinite(e)?Math.min(ue,Math.max(le,Math.round(e))):w(t)}function he(e,t=[]){let n=new Set;for(let t of e){if(!h(t))continue;let e=_(t);if(e!==null)for(let t of e)n.add(t)}return[...t.filter(e=>n.delete(e)),...n].map(e=>({id:e,label:e.replaceAll(`_`,` `)}))}function T(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=new Set;for(let t of e){let e=n.get(t.id);r.push({...t,...e??{},id:t.id,label:e?.label?.trim()||t.label,visible:t.visible,width:t.width,sortable:e?.sortable??t.sortable}),i.add(t.id)}for(let e of t)e.id&&!i.has(e.id)&&(r.push({...e,label:e.label?.trim()||e.id.replaceAll(`_`,` `),visible:e.visible!==!1,width:me(e.width,e.id),sortable:e.sortable!==!1}),i.add(e.id));return r}function ge(e,t,n){return e===t?0:e==null?1:t==null?-1:typeof e==`number`&&typeof t==`number`?Number.isNaN(e)?+!Number.isNaN(t):Number.isNaN(t)?-1:e-t:typeof e==`boolean`&&typeof t==`boolean`?Number(e)-Number(t):n.compare(S(e),S(t))}function _e(e,t,n,r){if(n===null)return[...e];let i=t.find(e=>e.id===n.field);if(!i||i.sortable===!1)return[...e];let a=new Intl.Collator(r,{numeric:!0,sensitivity:`base`}),o=n.direction===`asc`?1:-1;return e.map((e,t)=>({entry:e,stableIndex:t})).sort((e,t)=>{let n=ge(C(i,e.entry.row),C(i,t.entry.row),a);return n===0?e.stableIndex-t.stableIndex:n*o}).map(({entry:e})=>e)}function ve(e,t,n,r){let i=n.trim().toLocaleLowerCase(r);return i?e.filter(({row:e})=>t.some(t=>S(C(t,e)).toLocaleLowerCase(r).includes(i))):[...e]}function E(e){if(e==null)return``;let t=g(e);return t===null?x(e):t}function D(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function ye(e,t){return[t.map(e=>D(e.id)).join(`,`),...e.map(e=>t.map(t=>D(E(C(t,e)))).join(`,`))].join(`\r +`)}function be(e){return x(e,!0)}function xe(e,t,n){return Math.max(0,e+n-t)}function Se(e,t,n){return Math.max(0,Math.min(e,Math.max(0,t-n)))}function Ce(e){return e.key===`ContextMenu`||e.key===`Apps`||e.key===`F10`&&e.shiftKey}function we(e,t,n,r,i,a=!1){let o=Math.max(0,r-1),s=Math.max(0,n-1);if(a&&t===`Home`)return{area:`header`,field:0,row:0};if(a&&t===`End`&&n>0)return{area:`row`,field:o,row:s};if(t===`Home`)return{...e,field:0};if(t===`End`)return{...e,field:o};if(t===`ArrowLeft`||t===`ArrowRight`){let n=t===`ArrowRight`?1:-1,r=i===`rtl`?-n:n;return{...e,field:Math.max(0,Math.min(o,e.field+r))}}if(t===`ArrowDown`)return n===0?e:e.area===`header`?{area:`row`,field:e.field,row:0}:{...e,row:Math.min(s,e.row+1)};if(t===`ArrowUp`){if(e.area===`row`&&e.row===0)return{area:`header`,field:e.field,row:0};if(e.area===`row`)return{...e,row:Math.max(0,e.row-1)}}return e}function Te(e){return Math.min(ue,Math.max(le,Math.round(e)))}var O=c(),Ee={search:`Filter records`,columns:`Columns`,export:`Export`,exportAllJSON:`All · JSON`,exportFilteredJSON:`Filtered · JSON`,exportAllCSV:`All · CSV`,exportFilteredCSV:`Filtered · CSV`,selected:`selected`,clearSelection:`Clear selection`,clearFilter:`Clear filter`,noRecords:`No records are available.`,noMatches:`No records match this filter.`,copyCell:`Copy cell`,copyRow:`Copy row as JSON`,copyColumn:`Copy filtered column`,selectRow:`Select row`,deselectRow:`Deselect row`,sortAscending:`Sort ascending`,sortDescending:`Sort descending`,hideColumn:`Hide column`,showColumn:`Show column`,moveEarlier:`Move earlier`,moveLater:`Move later`,columnActions:`Column actions`,reorderColumn:`Reorder column`,resizeColumn:`Resize column`,previousWindow:`Previous rows`,nextWindow:`Next rows`,showing:`Showing`,of:`of`,copied:`Copied to clipboard`,copyUnavailable:`Clipboard unavailable`,filtered:`filtered`,all:`all`,structuredValue:`Structured value`},De={search:`فیلتر رکوردها`,columns:`ستون‌ها`,export:`خروجی`,exportAllJSON:`همه · JSON`,exportFilteredJSON:`فیلترشده · JSON`,exportAllCSV:`همه · CSV`,exportFilteredCSV:`فیلترشده · CSV`,selected:`انتخاب‌شده`,clearSelection:`پاک‌کردن انتخاب`,clearFilter:`پاک‌کردن فیلتر`,noRecords:`رکوردی در دسترس نیست.`,noMatches:`هیچ رکوردی با این فیلتر هم‌خوانی ندارد.`,copyCell:`کپی سلول`,copyRow:`کپی رکورد به‌صورت JSON`,copyColumn:`کپی ستون فیلترشده`,selectRow:`انتخاب ردیف`,deselectRow:`برداشتن انتخاب ردیف`,sortAscending:`مرتب‌سازی صعودی`,sortDescending:`مرتب‌سازی نزولی`,hideColumn:`پنهان‌کردن ستون`,showColumn:`نمایش ستون`,moveEarlier:`انتقال به قبل`,moveLater:`انتقال به بعد`,columnActions:`اقدام‌های ستون`,reorderColumn:`جابجایی ستون`,resizeColumn:`تغییر عرض ستون`,previousWindow:`ردیف‌های قبلی`,nextWindow:`ردیف‌های بعدی`,showing:`نمایش`,of:`از`,copied:`در کلیپ‌بورد کپی شد`,copyUnavailable:`کلیپ‌بورد در دسترس نیست`,filtered:`فیلترشده`,all:`همه`,structuredValue:`مقدار ساخت‌یافته`},Oe=[];function k(e){return typeof e==`object`&&!!e}function A(e){return Array.isArray(e)?`Array · ${e.length}`:typeof e==`object`&&e?`Object · ${Object.keys(e).length}`:e===null?`null`:typeof e==`string`?e:typeof e==`number`?e.toString():typeof e==`boolean`?e?`true`:`false`:`Not set`}function j({value:e,depth:t}){if(Array.isArray(e))return e.length?(0,O.jsx)(`ol`,{className:`structured-value__array`,children:e.map((e,n)=>(0,O.jsx)(`li`,{children:(0,O.jsx)(j,{value:e,depth:t+1})},n))}):(0,O.jsx)(`span`,{className:`structured-value__empty`,children:`[]`});if(typeof e==`object`&&e){let n=Object.entries(e);return n.length?(0,O.jsx)(`dl`,{className:`structured-value__object`,children:n.map(([e,n])=>(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{children:e}),(0,O.jsx)(`dd`,{children:(0,O.jsx)(j,{value:n,depth:t+1})})]},e))}):(0,O.jsx)(`span`,{className:`structured-value__empty`,children:`{}`})}return(0,O.jsx)(`span`,{className:`structured-value__scalar`,dir:`auto`,children:A(e)})}function ke({value:e,label:t}){return k(e)?(0,O.jsxs)(`details`,{className:`structured-value`,children:[(0,O.jsx)(`summary`,{"aria-label":t,children:v(e)}),(0,O.jsx)(`div`,{className:`structured-value__content`,dir:`auto`,children:(0,O.jsx)(j,{value:b(e),depth:0})})]}):(0,O.jsx)(`span`,{className:`structured-value__scalar`,dir:`auto`,children:v(e)})}function M(e,t,n){if(n)try{let r=n(e,t).trim();if(r)return r}catch{}if(typeof e==`object`&&e)for(let t of[`id`,`code`,`key`]){let n;try{n=Reflect.get(e,t)}catch{n=void 0}if(typeof n==`string`&&n)return`${t}:${n}`;if(typeof n==`number`&&Number.isFinite(n))return`${t}:${n.toString()}`}return`row:${t}`}function Ae(e,t){let n=new Map;return e.map((e,r)=>{let i=M(e,r,t),a=n.get(i)??0;return n.set(i,a+1),{key:a===0?i:`${i}#${a}`,row:e,sourceIndex:r}})}function je(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.id===r.id&&e.label===r.label&&e.get===r.get&&e.visible===r.visible&&e.width===r.width&&e.sortable===r.sortable})}async function Me(e){try{let t=globalThis.navigator?.clipboard;return!t||typeof t.writeText!=`function`?!1:(await t.writeText(e),!0)}catch{return!1}}function Ne(e){return e.trim().replace(/[^a-z0-9._-]+/gi,`-`).replace(/^-+|-+$/g,``)||`records`}function Pe(e,t=!1){return k(e)?x(e,t):v(e)}function Fe(e,t,n){if(typeof document>`u`||typeof URL.createObjectURL!=`function`)return;let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.hidden=!0,document.body.append(i),i.click(),i.remove(),globalThis.setTimeout(()=>URL.revokeObjectURL(r),0)}function Ie({records:o,fields:s,preferredFields:c=Oe,locale:u,direction:d=u.toLowerCase().startsWith(`fa`)?`rtl`:`ltr`,ariaLabel:f,labels:ie,rowKey:p,rowClassName:se,renderCell:le,windowSize:ue=120,toolbar:de=!0,filename:fe=`records`,initialSort:h=null,preserveViewportAnchor:g=!1,className:_=``,empty:pe}){let v={...u.toLowerCase().startsWith(`fa`)?De:Ee,...ie},y=(0,m.useId)().replaceAll(`:`,``),b=Math.max(20,Math.min(200,Math.round(ue))),S=(0,m.useMemo)(()=>s?[]:he(o,c),[o,c,s]),w=s??S,[me,ge]=(0,m.useState)(()=>T([],w)),E=(0,m.useMemo)(()=>T(me,w),[w,me]);(0,m.useEffect)(()=>{ge(e=>{let t=T(e,w);return je(e,t)?e:t})},[w]);let D=(0,m.useMemo)(()=>{let e=E.filter(e=>e.visible);return e.length?e:E.slice(0,1)},[E]),k=(0,m.useMemo)(()=>Ae(o,p),[o,p]),[A,j]=(0,m.useState)(``),[M,Ie]=(0,m.useState)(h),[N,P]=(0,m.useState)(()=>new Set),[Le,F]=(0,m.useState)(0),[I,L]=(0,m.useState)({area:`header`,field:0,row:0}),[R,z]=(0,m.useState)(null),[Re,ze]=(0,m.useState)(``),[B,V]=(0,m.useState)(null),H=(0,m.useRef)(null),U=(0,m.useRef)(null),Be=(0,m.useRef)(null),Ve=(0,m.useMemo)(()=>_e(k,E,M,u),[E,k,u,M]),W=(0,m.useMemo)(()=>ve(Ve,E,A,u),[Ve,E,u,A]),G=Math.max(0,Math.floor(Math.max(0,W.length-1)/b)*b),K=Math.min(Le,G),He=W.slice(K,K+b),Ue=K+He.length;(0,m.useEffect)(()=>F(0),[A,M?.direction,M?.field]),(0,m.useEffect)(()=>{Le>G&&F(G)},[G,Le]),(0,m.useEffect)(()=>{L(e=>{let t=Math.max(0,Math.min(Math.max(0,D.length-1),e.field));return e.area===`header`||W.length===0?{area:`header`,field:t,row:0}:{area:`row`,field:t,row:Math.min(W.length-1,e.row)}})},[W.length,D.length]),(0,m.useEffect)(()=>{let e=new Set(k.map(e=>e.key));P(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})},[k]);let q=()=>{if(!g)return;let e=H.current;if(!e)return;let t=e.getBoundingClientRect(),n=[...e.querySelectorAll(`[data-collection-row-key]`)],r=n.find(e=>e.getBoundingClientRect().bottom>t.top+1)??n[0];r&&(Be.current={key:r.dataset.collectionRowKey??``,offset:r.getBoundingClientRect().top-t.top,scrollTop:e.scrollTop,nearStart:e.scrollTop<=4})};(0,m.useLayoutEffect)(()=>{if(!g)return;let e=H.current,t=Be.current;if(!e||!t)q();else{if(t.nearStart)e.scrollTop=0;else{let n=typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(t.key):t.key.replace(/["\\]/g,`\\$&`),r=e.querySelector(`[data-collection-row-key="${n}"]`);if(r){let n=r.getBoundingClientRect().top-e.getBoundingClientRect().top;e.scrollTop=xe(e.scrollTop,t.offset,n)}else e.scrollTop=Se(t.scrollTop,e.scrollHeight,e.clientHeight)}q()}},[W,g]),(0,m.useEffect)(()=>{if(!R)return;let e=e=>{U.current?.contains(e.target)||z(null)},t=e=>{e.key===`Escape`&&z(null)},n=e=>{U.current?.contains(e.target)||z(null)},r=()=>z(null);return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),document.addEventListener(`focusin`,n),globalThis.addEventListener(`blur`,r),U.current?.querySelector(`button`)?.focus(),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t),document.removeEventListener(`focusin`,n),globalThis.removeEventListener(`blur`,r)}},[R]),(0,m.useLayoutEffect)(()=>{if(!R||!U.current)return;let e=U.current.getBoundingClientRect(),t=globalThis.visualViewport,n=t?.width??globalThis.innerWidth,r=t?.height??globalThis.innerHeight,i=Math.round(Math.max(8,Math.min(R.left,n-e.width-8))),a=Math.round(Math.max(8,Math.min(R.top,r-e.height-8)));(i!==R.left||a!==R.top)&&z(e=>e&&{...e,left:i,top:a})},[R]);let J=e=>{ge(t=>e(T(t,w)))},We=(e,t)=>J(n=>n.map(n=>n.id===e?{...n,width:Te(t)}:n)),Ge=(e,t)=>J(n=>n.map(n=>n.id===e?{...n,visible:t}:n)),Ke=(e,t)=>J(n=>{let r=n.findIndex(t=>t.id===e),i=Math.max(0,Math.min(n.length-1,r+t));if(r<0||r===i)return n;let a=[...n],[o]=a.splice(r,1);return a.splice(i,0,o),a}),Y=(e,t)=>J(n=>{let r=n.findIndex(t=>t.id===e),i=n.findIndex(e=>e.id===t);if(r<0||i<0||r===i)return n;let a=[...n],[o]=a.splice(r,1);return a.splice(i,0,o),a}),qe=e=>P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Je=async e=>{let t=await Me(e);ze(t?v.copied:v.copyUnavailable)},Ye=(e,t)=>{e.sortable&&Ie({field:e.id,direction:t}),z(null)},Xe=e=>{e.sortable&&Ie(t=>t?.field===e.id?{field:e.id,direction:t.direction===`asc`?`desc`:`asc`}:{field:e.id,direction:`asc`})},X=(e,t,n,r,i)=>{let a=r.getBoundingClientRect(),o=globalThis.innerWidth||1024,s=globalThis.innerHeight||768,c=Math.max(8,Math.min(i?.left??a.left,o-226)),ee=Math.max(8,Math.min(i?.top??a.bottom+4,s-280));z({kind:e,field:t,row:n,left:c,top:ee})},Ze=e=>`${y}-${e.area}-${e.row}-${e.field}`,Qe=e=>{L(e),e.area===`row`&&(e.row=Ue)&&F(Math.floor(e.row/b)*b),globalThis.requestAnimationFrame?.(()=>{H.current?.querySelector(`[data-focus-token="${Ze(e)}"]`)?.focus()})},$e=(e,t)=>{if(Ce(e)){e.preventDefault(),X(t.area,t.field,t.row,e.currentTarget);return}if(t.area===`row`&&e.key===` `){e.preventDefault();let n=W[t.row];n&&qe(n.key);return}if(t.area===`row`&&e.key===`Enter`){let t=e.currentTarget.querySelector(`summary`);t&&(e.preventDefault(),t.click());return}let n=we(t,e.key,W.length,D.length,d,e.ctrlKey||e.metaKey);(n.area!==t.area||n.field!==t.field||n.row!==t.row)&&(e.preventDefault(),Qe(n))},et=(e,t)=>{t.preventDefault();let n=t.clientX,r=e.width,i=d===`rtl`?-1:1,a=t=>We(e.id,r+(t.clientX-n)*i),o=()=>{globalThis.removeEventListener(`pointermove`,a),globalThis.removeEventListener(`pointerup`,o),globalThis.removeEventListener(`pointercancel`,o)};globalThis.addEventListener(`pointermove`,a),globalThis.addEventListener(`pointerup`,o),globalThis.addEventListener(`pointercancel`,o)},Z=(e,t)=>{let n=(e===`all`?Ve:W).map(e=>e.row),r=t===`json`?be(n):ye(n,E),i=e===`all`?`all`:`filtered`;Fe(`${Ne(fe)}-${i}.${t}`,r,t===`json`?`application/json;charset=utf-8`:`text/csv;charset=utf-8`)},Q=R?D[R.field]:void 0,$=R?.kind===`row`?W[R.row]:void 0,tt=E.filter(e=>e.visible).length;return(0,O.jsxs)(`section`,{className:`typed-collection ${_}`.trim(),dir:d,"aria-label":f,children:[de&&(0,O.jsxs)(`div`,{className:`typed-collection__toolbar`,children:[(0,O.jsxs)(`label`,{className:`typed-collection__search`,children:[(0,O.jsx)(l,{size:16,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`sr-only`,children:v.search}),(0,O.jsx)(`input`,{value:A,placeholder:v.search,onChange:e=>j(e.target.value)}),A&&(0,O.jsx)(`button`,{type:`button`,"aria-label":v.clearFilter,onClick:()=>j(``),children:(0,O.jsx)(ee,{size:14})})]}),(0,O.jsxs)(`div`,{className:`typed-collection__summary`,"aria-live":`polite`,children:[(0,O.jsx)(`strong`,{children:W.length}),(0,O.jsx)(`span`,{children:A?v.filtered:v.all}),N.size>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`i`,{"aria-hidden":`true`}),(0,O.jsx)(`strong`,{children:N.size}),(0,O.jsx)(`span`,{children:v.selected})]})]}),N.size>0&&(0,O.jsx)(`button`,{type:`button`,className:`typed-collection__quiet-action`,onClick:()=>P(new Set),children:v.clearSelection}),(0,O.jsxs)(`details`,{className:`typed-collection__popover typed-collection__columns`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(e.currentTarget.open=!1)},children:[(0,O.jsxs)(`summary`,{children:[(0,O.jsx)(ce,{size:16}),v.columns]}),(0,O.jsx)(`div`,{className:`typed-collection__popover-panel`,role:`group`,"aria-label":v.columns,children:E.map(e=>(0,O.jsxs)(`div`,{className:`typed-collection__column-option`,onDragOver:t=>{B&&B!==e.id&&t.preventDefault()},onDrop:t=>{t.preventDefault();let n=B??t.dataTransfer.getData(`text/plain`);n&&Y(n,e.id),V(null)},children:[(0,O.jsxs)(`label`,{children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:e.visible,disabled:e.visible&&tt<=1,onChange:t=>Ge(e.id,t.target.checked)}),e.visible?(0,O.jsx)(n,{size:14}):(0,O.jsx)(t,{size:14}),(0,O.jsx)(`span`,{children:e.label})]}),(0,O.jsx)(`button`,{type:`button`,className:`typed-collection__column-drag`,draggable:!0,"aria-label":`${v.reorderColumn}: ${e.label}`,onDragStart:t=>{V(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id)},onDragEnd:()=>V(null),onKeyDown:t=>{(t.key===`ArrowUp`||t.key===`ArrowDown`)&&(t.preventDefault(),Ke(e.id,t.key===`ArrowUp`?-1:1))},disabled:E.length<2,children:(0,O.jsx)(r,{size:15})})]},e.id))})]}),(0,O.jsxs)(`details`,{className:`typed-collection__popover typed-collection__export`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(e.currentTarget.open=!1)},children:[(0,O.jsxs)(`summary`,{children:[(0,O.jsx)(e,{size:16}),v.export]}),(0,O.jsxs)(`div`,{className:`typed-collection__popover-panel`,role:`group`,"aria-label":v.export,children:[(0,O.jsx)(`button`,{type:`button`,onClick:()=>Z(`all`,`json`),children:v.exportAllJSON}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>Z(`filtered`,`json`),children:v.exportFilteredJSON}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>Z(`all`,`csv`),children:v.exportAllCSV}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>Z(`filtered`,`csv`),children:v.exportFilteredCSV})]})]})]}),!E.length||!o.length?pe??(0,O.jsx)(`p`,{className:`typed-collection__empty`,children:v.noRecords}):W.length?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`typed-collection__viewport`,ref:H,onScroll:q,children:(0,O.jsxs)(`table`,{className:`typed-collection__grid`,role:`grid`,"aria-label":f,"aria-multiselectable":`true`,"aria-rowcount":W.length+1,"aria-colcount":D.length+1,children:[(0,O.jsxs)(`colgroup`,{children:[(0,O.jsx)(`col`,{className:`typed-collection__select-column`}),D.map(e=>(0,O.jsx)(`col`,{style:{width:e.width}},e.id))]}),(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{role:`row`,"aria-rowindex":1,children:[(0,O.jsx)(`th`,{className:`typed-collection__select`,scope:`col`,children:(0,O.jsx)(`span`,{className:`sr-only`,children:v.selected})}),D.map((e,t)=>{let n={area:`header`,field:t,row:0},i=M?.field===e.id?M.direction:null;return(0,O.jsxs)(`th`,{scope:`col`,role:`columnheader`,"aria-colindex":t+2,"aria-sort":i===`asc`?`ascending`:i===`desc`?`descending`:`none`,"aria-haspopup":`menu`,tabIndex:I.area===`header`&&I.field===t?0:-1,"data-focus-token":Ze(n),style:{"--collection-column-width":`${e.width}px`},onFocus:()=>L(n),onKeyDown:e=>$e(e,n),onContextMenu:e=>{e.preventDefault(),X(`header`,t,0,e.currentTarget,{left:e.clientX,top:e.clientY})},onDragOver:t=>{B&&B!==e.id&&t.preventDefault()},onDrop:t=>{t.preventDefault();let n=B??t.dataTransfer.getData(`text/plain`);n&&Y(n,e.id),V(null)},onDragEnd:()=>V(null),children:[(0,O.jsxs)(`button`,{type:`button`,className:`typed-collection__sort`,tabIndex:-1,disabled:!e.sortable,onClick:()=>Xe(e),children:[(0,O.jsx)(`span`,{children:e.label}),i===`asc`?(0,O.jsx)(ne,{size:14}):i===`desc`?(0,O.jsx)(re,{size:14}):(0,O.jsx)(`span`,{className:`typed-collection__sort-placeholder`,"aria-hidden":`true`})]}),(0,O.jsxs)(`span`,{className:`typed-collection__header-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`typed-collection__header-menu`,tabIndex:-1,"aria-label":`${v.columnActions}: ${e.label}`,"aria-haspopup":`menu`,onClick:e=>X(`header`,t,0,e.currentTarget),children:(0,O.jsx)(a,{size:14})}),(0,O.jsx)(`button`,{type:`button`,className:`typed-collection__reorder`,tabIndex:-1,draggable:!0,"aria-label":`${v.reorderColumn}: ${e.label}`,onDragStart:t=>{V(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id)},onDragEnd:()=>V(null),children:(0,O.jsx)(r,{size:13})})]}),(0,O.jsx)(`button`,{type:`button`,className:`typed-collection__resize`,tabIndex:-1,"aria-label":`${v.resizeColumn}: ${e.label}`,onPointerDown:t=>et(e,t),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?12:-12;We(e.id,e.width+(d===`rtl`?-n:n))},children:(0,O.jsx)(r,{size:13})})]},e.id)})]})}),(0,O.jsx)(`tbody`,{children:He.map((e,t)=>{let n=K+t,r=N.has(e.key);return(0,O.jsxs)(`tr`,{role:`row`,"aria-rowindex":n+2,"aria-selected":r,"data-collection-row-key":e.key,className:se?.(e.row),children:[(0,O.jsx)(`td`,{className:`typed-collection__select`,role:`gridcell`,"aria-colindex":1,children:(0,O.jsxs)(`label`,{children:[(0,O.jsx)(`input`,{type:`checkbox`,tabIndex:-1,checked:r,onChange:()=>qe(e.key)}),(0,O.jsx)(`span`,{className:`sr-only`,children:r?v.deselectRow:v.selectRow}),r&&(0,O.jsx)(i,{size:13,"aria-hidden":`true`})]})}),D.map((t,r)=>{let i=C(t,e.row),a=le?.(t,i,e.row),o={area:`row`,field:r,row:n};return(0,O.jsx)(`td`,{role:`gridcell`,"aria-colindex":r+2,"aria-haspopup":`menu`,tabIndex:I.area===`row`&&I.row===n&&I.field===r?0:-1,"data-focus-token":Ze(o),onFocus:()=>L(o),onKeyDown:e=>$e(e,o),onContextMenu:e=>{e.preventDefault(),X(`row`,r,n,e.currentTarget,{left:e.clientX,top:e.clientY})},children:a===void 0?(0,O.jsx)(ke,{value:i,label:`${v.structuredValue}: ${t.label}`}):a},t.id)})]},e.key)})})]})}),W.length>b&&(0,O.jsxs)(`nav`,{className:`typed-collection__window-nav`,"aria-label":`${f} · ${v.showing}`,children:[(0,O.jsxs)(`button`,{type:`button`,disabled:K===0,onClick:()=>F(Math.max(0,K-b)),children:[(0,O.jsx)(ae,{size:15}),v.previousWindow]}),(0,O.jsxs)(`span`,{children:[v.showing,` `,(0,O.jsxs)(`strong`,{children:[K+1,`–`,Ue]}),` `,v.of,` `,(0,O.jsx)(`strong`,{children:W.length})]}),(0,O.jsxs)(`button`,{type:`button`,disabled:Ue>=W.length,onClick:()=>F(Math.min(G,K+b)),children:[v.nextWindow,(0,O.jsx)(te,{size:15})]})]})]}):(0,O.jsxs)(`div`,{className:`typed-collection__empty`,children:[(0,O.jsx)(l,{size:21}),(0,O.jsx)(`p`,{children:v.noMatches}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>j(``),children:v.clearFilter})]}),(0,O.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:Re}),R&&Q&&(0,O.jsx)(`div`,{ref:U,className:`typed-collection__context-menu`,role:`menu`,"aria-label":R.kind===`header`?Q.label:`${Q.label} · ${R.row+1}`,style:{left:R.left,top:R.top},onKeyDown:e=>{let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)],n=t.indexOf(document.activeElement);(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),t[(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus())},children:R.kind===`header`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!Q.sortable,onClick:()=>Ye(Q,`asc`),children:[(0,O.jsx)(ne,{size:15}),v.sortAscending]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:!Q.sortable,onClick:()=>Ye(Q,`desc`),children:[(0,O.jsx)(re,{size:15}),v.sortDescending]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:R.field===0,onClick:()=>{Y(Q.id,D[R.field-1].id),z(null)},children:[d===`rtl`?(0,O.jsx)(te,{size:15}):(0,O.jsx)(ae,{size:15}),v.moveEarlier]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:R.field===D.length-1,onClick:()=>{Y(Q.id,D[R.field+1].id),z(null)},children:[d===`rtl`?(0,O.jsx)(ae,{size:15}):(0,O.jsx)(te,{size:15}),v.moveLater]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Je(W.map(e=>Pe(C(Q,e.row))).join(` +`)),z(null)},children:[(0,O.jsx)(oe,{size:15}),v.copyColumn]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:tt<=1,onClick:()=>{Ge(Q.id,!1),z(null)},children:[(0,O.jsx)(t,{size:15}),v.hideColumn]})]}):$?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Je(Pe(C(Q,$.row),!0)),z(null)},children:[(0,O.jsx)(oe,{size:15}),v.copyCell]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{Je(x($.row,!0)),z(null)},children:[(0,O.jsx)(oe,{size:15}),v.copyRow]}),(0,O.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":N.has($.key),onClick:()=>{qe($.key),z(null)},children:[(0,O.jsx)(i,{size:15}),N.has($.key)?v.deselectRow:v.selectRow]}),N.size>0&&(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{P(new Set),z(null)},children:[(0,O.jsx)(ee,{size:15}),v.clearSelection]}),A&&(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{j(``),z(null)},children:[(0,O.jsx)(l,{size:15}),v.clearFilter]})]}):null})]})}export{Ie as n,x as r,ke as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DXoxHaI-.js b/Tools/Controller/internal/webui/dist/assets/chunk-DXoxHaI-.js new file mode 100644 index 00000000..762e99d7 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-DXoxHaI-.js @@ -0,0 +1,5 @@ +import{i as e,r as t,t as n}from"./chunk-BT8krml-.js";import{_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as ee,u as te,v as ne,x as re,y as ie}from"./chunk-Dmz4i1nq.js";import{i as y,n as b,t as ae}from"./chunk-BgHNRN_V.js";import{t as oe}from"./chunk-D1EF5rbN.js";import{n as se,t as x}from"./chunk-B5OrbcTy.js";import{$ as S,Ct as ce,Et as le,It as C,J as w,M as T,Mt as ue,Nt as E,Ot as D,Pt as O,St as de,Tt as k,X as A,Y as j,_ as M,_t as fe,a as pe,at as me,b as N,ct as P,dt as F,ft as he,g as ge,h as _e,it as ve,mt as ye,nt as I,o as be,ot as xe,pt as Se,st as L,v as Ce,x as we,zt as Te}from"./app-BxYXetji.js";var R={name:`antenna`,size:24,node:[[`path`,{d:`M2 12 7 2`,key:`117k30`}],[`path`,{d:`m7 12 5-10`,key:`1tvx22`}],[`path`,{d:`m12 12 5-10`,key:`ev1o1a`}],[`path`,{d:`m17 12 5-10`,key:`1e4ti3`}],[`path`,{d:`M4.5 7h15`,key:`vlsxkz`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]};R.node;var Ee=O(R),De={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};De.node;var Oe=O(De),ke={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};ke.node;var Ae=O(ke),je={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};je.node;var Me=O(je),Ne={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};Ne.node;var Pe=O(Ne),Fe={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Fe.node;var Ie=O(Fe),Le={name:`door-open`,size:24,node:[[`path`,{d:`M10 21H2`,key:`1sthdo`}],[`path`,{d:`M10 3H7a2 2 0 00-2 2v16`,key:`15gt7x`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z`,key:`tyvg9a`}],[`path`,{d:`M22 21h-3`,key:`1ec3tr`}]]};Le.node;var Re=O(Le),ze={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};ze.node;var Be=O(ze),Ve={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Ve.node;var He=O(Ve),Ue={name:`keyboard-off`,size:24,node:[[`path`,{d:`M 20 4 A2 2 0 0 1 22 6`,key:`1g1fkt`}],[`path`,{d:`M 22 6 L 22 16.41`,key:`1qjg3w`}],[`path`,{d:`M 7 16 L 16 16`,key:`n0yqwb`}],[`path`,{d:`M 9.69 4 L 20 4`,key:`kbpcgx`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M20 20H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2`,key:`s23sx2`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]};Ue.node;var We=O(Ue),Ge={name:`layout-panel-top`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]};Ge.node;var Ke=O(Ge),qe={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};qe.node;var Je=O(qe),Ye={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};Ye.node;var Xe=O(Ye),z={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};z.node;var Ze=O(z),Qe={name:`monitor-cog`,size:24,node:[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]};Qe.node;var $e=O(Qe),et={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};et.node;var tt=O(et),nt={name:`panel-top-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m15 14-3 3-3-3`,key:`g215vf`}]]};nt.node;var rt=O(nt),it={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};it.node;var at=O(it),ot={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};ot.node;var st=O(ot),ct={name:`radio-tower`,size:24,node:[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]};ct.node;var lt=O(ct),ut={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};ut.node;var dt=O(ut),ft={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};ft.node;var pt=O(ft),mt={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};mt.node;var ht=O(mt),gt={name:`sun-medium`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 3v1`,key:`1asbbs`}],[`path`,{d:`M12 20v1`,key:`1wcdkc`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M20 12h1`,key:`1vloll`}],[`path`,{d:`m18.364 5.636-.707.707`,key:`1hakh0`}],[`path`,{d:`m6.343 17.657-.707.707`,key:`18m9nf`}],[`path`,{d:`m5.636 5.636.707.707`,key:`1xv1c5`}],[`path`,{d:`m17.657 17.657.707.707`,key:`vl76zb`}]]};gt.node;var _t=O(gt),vt={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};vt.node;var yt=O(vt),B=Te(C(),1),bt=new Set([`log`,`info`,`warn`,`error`,`debug`,`dir`,`dirxml`,`trace`,`table`,`group`,`groupCollapsed`,`groupEnd`,`clear`,`assert`,`count`,`countReset`,`time`,`timeLog`,`timeEnd`]),xt=new Set(`aliceblue.aqua.black.blue.brown.coral.crimson.cyan.darkblue.darkgray.darkgreen.darkgrey.fuchsia.gold.gray.green.grey.indigo.lime.magenta.maroon.navy.olive.orange.orchid.pink.plum.purple.red.salmon.silver.teal.tomato.transparent.violet.white.yellow.currentcolor`.split(`.`)),V={maxDepth:4,maxObjectKeys:50,maxStringLength:16384,maxEntries:1e3,maxTableRows:100,maxTableColumns:20,now:()=>Date.now(),captureStack:()=>{try{let e=Error(`Trace`).stack;return typeof e==`string`?e:void 0}catch{return}}};function H(e,t,n,r){return Number.isFinite(e)?Math.min(r,Math.max(n,Math.trunc(e))):t}function St(e={}){return{maxDepth:H(e.maxDepth,V.maxDepth,1,12),maxObjectKeys:H(e.maxObjectKeys,V.maxObjectKeys,1,1e3),maxStringLength:H(e.maxStringLength,V.maxStringLength,32,1e6),maxEntries:H(e.maxEntries,V.maxEntries,1,1e5),maxTableRows:H(e.maxTableRows,V.maxTableRows,1,1e4),maxTableColumns:H(e.maxTableColumns,V.maxTableColumns,1,500),now:typeof e.now==`function`?e.now:V.now,captureStack:typeof e.captureStack==`function`?e.captureStack:V.captureStack}}function Ct(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.toLowerCase(),r={groupcollapsed:`groupCollapsed`,groupend:`groupEnd`,countreset:`countReset`,timelog:`timeLog`,timeend:`timeEnd`}[n]??n;return bt.has(r)?r:null}function U(e){if(!Array.isArray(e))return null;try{let t=Object.getOwnPropertyDescriptors(e),n=t.length;if(!n||!(`value`in n))return null;let r=n.value;if(typeof r!=`number`||!Number.isSafeInteger(r)||r<0||r>256)return null;let i=Array(r);for(let e=0;e65536||(this.space(),!this.consumeWord(`console`))||(this.space(),!this.consume(`.`)))return null;this.space();let e=Ct(this.identifier());if(!e||(this.space(),!this.consume(`(`)))return null;this.space();let t=[];if(this.peek(`)`))this.index++;else for(;;){if(t.length>=256)return null;let e=this.value(0);if(!e.ok)return null;if(t.push(e.value),this.space(),this.consume(`)`))break;if(!this.consume(`,`))return null;if(this.space(),this.peek(`)`)){this.index++;break}}return this.space(),this.consume(`;`),this.space(),this.index===this.source.length?{method:e,args:t}:null}value(e){if(e>32)return{ok:!1};this.space();let t=this.source[this.index];if(t===`"`||t===`'`)return this.string(t);if(t===`[`)return this.array(e+1);if(t===`{`)return this.object(e+1);for(let[e,t]of[[`undefined`,void 0],[`-Infinity`,-1/0],[`Infinity`,1/0],[`false`,!1],[`true`,!0],[`null`,null],[`NaN`,NaN]])if(this.consumeWord(e))return{ok:!0,value:t};let n=this.source.slice(this.index).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/);return n?(this.index+=n[0].length,{ok:!0,value:Number(n[0])}):{ok:!1}}string(e){this.index++;let t=``;for(;this.index=this.source.length)return{ok:!1};let r=this.source[this.index++],i={'"':`"`,"'":`'`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:` +`,r:`\r`,t:` `};if(r in i){t+=i[r];continue}if(r!==`u`)return{ok:!1};let a=this.source.slice(this.index,this.index+4);if(!/^[0-9a-f]{4}$/i.test(a))return{ok:!1};t+=String.fromCharCode(Number.parseInt(a,16)),this.index+=4}return{ok:!1}}array(e){this.index++,this.space();let t=[];if(this.consume(`]`))return{ok:!0,value:t};for(;;){if(t.length>=1e3)return{ok:!1};let n=this.value(e);if(!n.ok)return n;if(t.push(n.value),this.space(),this.consume(`]`))return{ok:!0,value:t};if(!this.consume(`,`))return{ok:!1};if(this.space(),this.consume(`]`))return{ok:!0,value:t}}}object(e){this.index++,this.space();let t=Object.create(null);if(this.consume(`}`))return{ok:!0,value:t};let n=0;for(;;){if(n++>=1e3)return{ok:!1};let r,i=this.source[this.index];if(i===`"`||i===`'`){let e=this.string(i);if(!e.ok)return e;r=e.value}else if(r=this.identifier(),!r)return{ok:!1};if(this.space(),!this.consume(`:`))return{ok:!1};let a=this.value(e);if(!a.ok)return a;if(Object.defineProperty(t,r,{value:a.value,enumerable:!0,configurable:!0,writable:!0}),this.space(),this.consume(`}`))return{ok:!0,value:t};if(!this.consume(`,`))return{ok:!1};if(this.space(),this.consume(`}`))return{ok:!0,value:t}}}identifier(){let e=this.source.slice(this.index).match(/^[A-Za-z_$][\w$-]*/);return e?(this.index+=e[0].length,e[0]):``}space(){for(;/\s/.test(this.source[this.index]??``);)this.index++}peek(e){return this.source.startsWith(e,this.index)}consume(e){return this.peek(e)?(this.index+=e.length,!0):!1}consumeWord(e){if(!this.peek(e))return!1;let t=this.source[this.index+e.length];return t&&/[\w$-]/.test(t)?!1:(this.index+=e.length,!0)}};function Et(e){return typeof e==`string`?new Tt(e).parse():wt(e)}function W(e){let t=e.trim().toLowerCase();return xt.has(t)||/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)||/^(?:rgb|rgba|hsl|hsla)\([\d\s.,%+\-/]+\)$/i.test(t)?t:null}function Dt(e){let t=e.trim().toLowerCase();return/^(?:normal|bold|bolder|lighter|[1-9]00)$/.test(t)?t:null}function Ot(e){let t=e.trim().toLowerCase();return/^(?:normal|italic|oblique)$/.test(t)?t:null}function G(e){let t=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!t.length)return null;let n=new Set([`none`,`underline`,`overline`,`line-through`]);return t.some(e=>!n.has(e))||t.includes(`none`)&&t.length!==1?null:[...new Set(t)].join(` `)}function kt(e){if(typeof e!=`string`||e.length>4096)return{};let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e<1)continue;let r=n.slice(0,e).trim().toLowerCase(),i=n.slice(e+1).trim();if(!(!i||/(?:url|expression|var)\s*\(/i.test(i)||/[{}<>]/.test(i)))switch(r){case`color`:{let e=W(i);e&&(t.color=e);break}case`background-color`:{let e=W(i);e&&(t.backgroundColor=e);break}case`font-weight`:{let e=Dt(i);e&&(t.fontWeight=e);break}case`font-style`:{let e=Ot(i);e&&(t.fontStyle=e);break}case`text-decoration`:case`text-decoration-line`:{let e=G(i);e&&(t.textDecorationLine=e);break}}}return t}function K(e){return e&&Object.keys(e).length?{...e}:void 0}function At(e,t){return e?.color===t?.color&&e?.backgroundColor===t?.backgroundColor&&e?.fontWeight===t?.fontWeight&&e?.fontStyle===t?.fontStyle&&e?.textDecorationLine===t?.textDecorationLine}function jt(e,t,n){let r=e[e.length-1];r?.kind===`text`&&At(r.style,n)?e[e.length-1]={...r,text:r.text+t}:e.push({kind:`text`,text:t,style:K(n)})}function q(e,t){return e.length<=t.maxStringLength?e:`${e.slice(0,t.maxStringLength)}…[${e.length-t.maxStringLength} more]`}function Mt(e,t){let n=q(e,t);return JSON.stringify(n)??`""`}function Nt(e){return Number.isNaN(e)?`NaN`:e===1/0?`Infinity`:e===-1/0?`-Infinity`:Object.is(e,-0)?`-0`:String(e)}function Pt(e){if(e===null)return`null`;try{if(Array.isArray(e))return`array`;if(e instanceof Error)return`error`}catch{return`object`}let t=typeof e;return t===`string`||t===`number`||t===`bigint`||t===`boolean`||t===`undefined`||t===`symbol`||t===`function`?t:`object`}function Ft(e,t){try{let n=e;for(let e=0;n&&e<16;e++){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return`value`in e&&typeof e.value==`string`?e.value:void 0;n=Object.getPrototypeOf(n)}}catch{}}function It(e,t){try{let n=Object.getOwnPropertyDescriptor(t,`size`)?.get;if(!n)return null;let r=Reflect.apply(n,e,[]);return typeof r==`number`&&Number.isSafeInteger(r)&&r>=0?r:null}catch{return null}}function Lt(e){try{let t=Object.getOwnPropertyDescriptor(e,`name`);return typeof t?.value==`string`&&t.value?t.value:`anonymous`}catch{return`anonymous`}}function J(e){try{if(Array.isArray(e)){let t=Object.getOwnPropertyDescriptor(e,`length`)?.value;return`Array(${typeof t==`number`?t:`?`})`}if(e instanceof Map)return`Map(${It(e,Map.prototype)??`?`})`;if(e instanceof Set)return`Set(${It(e,Set.prototype)??`?`})`;if(e instanceof Date)return`Date`;if(e instanceof Error)return Ft(e,`name`)||`Error`}catch{return`Object`}return`Object`}function Rt(e,t,n,r,i){if(e===null)return`null`;switch(typeof e){case`string`:return i?Mt(e,t):q(e,t);case`number`:return Nt(e);case`bigint`:return`${e}n`;case`boolean`:return String(e);case`undefined`:return`undefined`;case`symbol`:return String(e);case`function`:return`[Function ${Lt(e)}]`}let a=e;if(r.has(a))return`[Circular]`;if(n>=t.maxDepth)return`[${J(a)}]`;r.add(a);try{if(a instanceof Date){let e=Date.prototype.getTime.call(a);return Number.isNaN(e)?`Invalid Date`:Date.prototype.toISOString.call(a)}if(a instanceof RegExp)return RegExp.prototype.toString.call(a);if(a instanceof Error){let e=Ft(a,`name`),n=Ft(a,`message`);return`${e||`Error`}${n?`: ${q(n,t)}`:``}`}if(a instanceof Map){let e=It(a,Map.prototype),i=[],o=0;for(let[e,s]of Map.prototype.entries.call(a)){if(o++>=t.maxObjectKeys)break;i.push(`${Rt(e,t,n+1,r,!0)} => ${Rt(s,t,n+1,r,!0)}`)}return e!==null&&e>i.length&&i.push(`… ${e-i.length} more`),`Map(${e??`?`}) { ${i.join(`, `)} }`}if(a instanceof Set){let e=It(a,Set.prototype),i=[],o=0;for(let e of Set.prototype.values.call(a)){if(o++>=t.maxObjectKeys)break;i.push(Rt(e,t,n+1,r,!0))}return e!==null&&e>i.length&&i.push(`… ${e-i.length} more`),`Set(${e??`?`}) { ${i.join(`, `)} }`}let e=Object.getOwnPropertyDescriptors(a),i=Reflect.ownKeys(e).filter(t=>e[t]?.enumerable),o=i.slice(0,t.maxObjectKeys),s=o.map(i=>{let a=e[i],o=typeof i==`symbol`?`[${String(i)}]`:/^[A-Za-z_$][\w$]*$/.test(i)?i:Mt(i,t);return!a||!(`value`in a)?`${o}: ${a?.get&&a?.set?`[Getter/Setter]`:a?.get?`[Getter]`:`[Setter]`}`:`${o}: ${Rt(a.value,t,n+1,r,!0)}`});return i.length>o.length&&s.push(`… ${i.length-o.length} more`),Array.isArray(a)?`[${s.map(e=>e.replace(/^\d+: /,``)).join(`, `)}]`:`{ ${s.join(`, `)} }`}catch(e){return`[Uninspectable: ${q(e instanceof Error?e.message:`inspection failed`,t)}]`}finally{r.delete(a)}}function zt(e,t={}){return Rt(e,St(t),0,new Set,!1)}function Bt(e,t,n=`inline`,r){return{kind:`value`,text:Rt(e,n===`compact`?{...t,maxDepth:Math.min(2,t.maxDepth),maxObjectKeys:Math.min(12,t.maxObjectKeys)}:t,0,new Set,!1),valueType:Pt(e),presentation:n,style:K(r)}}function Y(e,t){return typeof e==`string`?q(e,t):Rt(e,{...t,maxDepth:Math.min(t.maxDepth,2)},0,new Set,!1)}function Vt(e,t){if(typeof e==`bigint`)return String(e);let n;try{n=Number(e)}catch{n=NaN}return t&&Number.isFinite(n)&&(n=Math.trunc(n)),Nt(n)}function Ht(e,t={}){let n=St(t);if(!e.length)return[{kind:`text`,text:``}];let r=[],i=0;if(typeof e[0]==`string`){let t=q(e[0],n);i=1;let a={},o=``,s=()=>{o&&=(jt(r,o,a),``)};for(let c=0;c=t.length){o+=l;continue}let u=t[c+1];if(u===`%`){o+=`%`,c++;continue}if(!`sdifoOc`.includes(u)||i>=e.length){o+=`%${u}`,c++;continue}s();let d=e[i++];switch(c++,u){case`s`:jt(r,Y(d,n),a);break;case`d`:case`i`:r.push({kind:`value`,text:Vt(d,!0),valueType:`number`,presentation:`inline`,style:K(a)});break;case`f`:r.push({kind:`value`,text:Vt(d,!1),valueType:`number`,presentation:`inline`,style:K(a)});break;case`o`:r.push(Bt(d,n,`compact`,a));break;case`O`:r.push(Bt(d,n,`expanded`,a));break;case`c`:a=kt(d)}}s()}for(;ie.text).join(``)}function Wt(e){if(!e)return``;let t=[];return e.color&&t.push(`color:${e.color}`),e.backgroundColor&&t.push(`background-color:${e.backgroundColor}`),e.fontWeight&&t.push(`font-weight:${e.fontWeight}`),e.fontStyle&&t.push(`font-style:${e.fontStyle}`),e.textDecorationLine&&t.push(`text-decoration-line:${e.textDecorationLine}`),t.join(`;`)}function Gt(e){let t=``,n=``,r=[],i=e.length?e:[{kind:`text`,text:``}];for(let e of i){let i=Wt(e.style);i!==n&&(t+=`%c`,r.push(i),n=i),t+=`%s`,r.push(e.text)}return n&&(t+=`%c`,r.push(``)),[t,...r]}function Kt(e){try{let t=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(t).filter(e=>t[e]?.enumerable).map(e=>{let n=t[e],r=typeof e==`symbol`?String(e):e;return!n||!(`value`in n)?{key:r,value:n?.get?`[Getter]`:`[Setter]`}:{key:r,value:n.value}})}catch{return[]}}function qt(e){try{if(e instanceof Map)return Array.from(Map.prototype.entries.call(e),([e,t])=>({key:zt(e,{maxDepth:1,maxObjectKeys:4}),value:t}));if(e instanceof Set)return Array.from(Set.prototype.values.call(e),(e,t)=>({key:String(t),value:e}));if(e!==null&&(typeof e==`object`||typeof e==`function`))return Kt(e)}catch{}return[{key:`0`,value:e}]}function Jt(e,t){if(!Array.isArray(e))return null;let n=[];for(let r of e){if(typeof r!=`string`&&typeof r!=`number`)continue;let e=q(String(r),t);if(e&&!n.includes(e)&&n.push(e),n.length>=t.maxTableColumns)break}return n}function Yt(e,t,n){let r=qt(e),i=r.slice(0,n.maxTableRows),a=Jt(t,n),o=[],s=!1;for(let e of i){let t=e.value;if(t!==null&&(typeof t==`object`||typeof t==`function`))for(let e of Kt(t))o.includes(e.key)||o.push(e.key);else s=!0}let c=a??[...o,...s||!o.length?[`Value`]:[]],l=c.slice(0,n.maxTableColumns);return{columns:[`(index)`,...l],rows:i.map(e=>{let t={"(index)":[Bt(e.key,n)]},r=e.value!==null&&(typeof e.value==`object`||typeof e.value==`function`)?new Map(Kt(e.value).map(e=>[e.key,e.value])):null;for(let i of l)t[i]=i===`Value`?[Bt(e.value,n,`compact`)]:r?.has(i)?[Bt(r.get(i),n,`compact`)]:[{kind:`text`,text:``}];return{key:e.key,cells:t}}),omittedRows:Math.max(0,r.length-i.length),omittedColumns:Math.max(0,c.length-l.length)}}function Xt(e){switch(e){case`info`:return`info`;case`warn`:return`warn`;case`error`:case`assert`:return`error`;case`debug`:return`debug`;default:return`log`}}function Zt(e){let t=Math.max(0,e),n=t<1e3?t:t/1e3,r=t<1e3?`ms`:`s`;return`${Number(n.toFixed(3))} ${r}`}function Qt(e,t){if(typeof e!=`string`)return;let n=e.replace(/\r\n?/g,` +`).replace(/\u001b\[[0-?]*[ -/]*[@-~]/g,``).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,``).trim();return n?q(n,t):void 0}var $t=class{options;transcriptValue=[];groups=[];counters=new Map;timers=new Map;nextEntryID=0;nextGroupID=0;revisionValue=0;constructor(e={}){this.options=St(e)}dispatch(e){let t=Et(e);return t?this.invoke(t.method,t.args,t.timestamp,t.stack):this.emitMessage(`warn`,[`Unsupported console invocation payload.`],this.options.now())}invoke(e,t=[],n,r){let i=Ct(e),a=Number.isFinite(n)?Number(n):this.options.now();if(!i)return this.emitMessage(`warn`,[`Unsupported console method: ${String(e)}`],a);switch(i){case`log`:case`info`:case`warn`:case`error`:case`debug`:return this.emitMessage(i,t,a);case`dir`:case`dirxml`:return this.append({...this.base(a),kind:`message`,method:i,level:`log`,tokens:[Bt(t[0],this.options,`expanded`)]});case`trace`:{let e=t.length?[...Ht(t,this.options)]:[{kind:`text`,text:`Trace`}],n=r;if(n===void 0)try{n=this.options.captureStack()}catch{n=void 0}let o=Qt(n,this.options);return o&&e.push({kind:`text`,text:`\n${o}`}),this.append({...this.base(a),kind:`message`,method:i,level:`debug`,tokens:e})}case`assert`:{if(t[0])return this.noop();let e=t.slice(1),n=e.length?[...Ht(e,this.options)]:[],r=[{kind:`text`,text:`Assertion failed`}];return n.length&&r.push({kind:`text`,text:`: `},...n),this.append({...this.base(a),kind:`message`,method:`assert`,level:`error`,tokens:r})}case`group`:case`groupCollapsed`:{let e=i===`groupCollapsed`,n=t.length?Ht(t,this.options):[{kind:`text`,text:`console.group`}],r={...this.base(a),kind:`group`,method:i,level:`log`,collapsed:e,tokens:n},o=this.append(r);return this.groups.push({id:++this.nextGroupID,label:Ut(n),collapsed:e}),this.revisionValue++,{...o,transcript:this.entries()}}case`groupEnd`:return this.groups.length&&(this.groups.pop(),this.revisionValue++),this.noop();case`clear`:return this.transcriptValue=[],this.groups=[],this.revisionValue++,{emitted:[],transcript:[],cleared:!0,ignored:!1};case`count`:{let e=this.label(t[0]),n=(this.counters.get(e)??0)+1;return this.counters.set(e,n),this.emitMessage(`log`,[`${e}: ${n}`],a)}case`countReset`:{let e=this.label(t[0]);return this.counters.has(e)?(this.counters.set(e,0),this.revisionValue++,this.noop()):this.emitMessage(`warn`,[`Count for '${e}' does not exist.`],a)}case`time`:{let e=this.label(t[0]);return this.timers.has(e)?this.emitMessage(`warn`,[`Timer '${e}' already exists.`],a):(this.timers.set(e,a),this.revisionValue++,this.noop())}case`timeLog`:case`timeEnd`:{let e=this.label(t[0]),n=this.timers.get(e);if(n===void 0)return this.emitMessage(`warn`,[`Timer '${e}' does not exist.`],a);let r=`${e}: ${Zt(a-n)}`,o=i===`timeLog`?t.slice(1):[];i===`timeEnd`&&this.timers.delete(e);let s=[{kind:`text`,text:r}];return o.length&&s.push({kind:`text`,text:` `},...Ht(o,this.options)),this.append({...this.base(a),kind:`message`,method:i,level:`log`,tokens:s})}case`table`:{let e=Yt(t[0],t[1],this.options);return this.append({...this.base(a),kind:`table`,method:`table`,level:`log`,...e})}}}snapshot(){let e=Object.create(null);for(let[t,n]of this.counters)Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1});return{entries:this.entries(),depth:this.groups.length,groups:this.groupPath(),counters:e,timers:[...this.timers.keys()],revision:this.revisionValue}}entries(){return this.transcriptValue.slice()}reset(){this.transcriptValue=[],this.groups=[],this.counters.clear(),this.timers.clear(),this.nextEntryID=0,this.nextGroupID=0,this.revisionValue++}label(e){return e===void 0?`default`:Y(e,this.options)}groupPath(){return this.groups.map(e=>({...e}))}base(e){let t=this.groupPath();return{id:++this.nextEntryID,timestamp:e,depth:t.length,groupPath:t,hidden:t.some(e=>e.collapsed)}}emitMessage(e,t,n){return this.append({...this.base(n),kind:`message`,method:e,level:Xt(e),tokens:Ht(t,this.options)})}append(e){return this.transcriptValue.push(e),this.transcriptValue.length>this.options.maxEntries&&this.transcriptValue.splice(0,this.transcriptValue.length-this.options.maxEntries),this.revisionValue++,{emitted:[e],transcript:this.entries(),cleared:!1,ignored:!1}}noop(){return{emitted:[],transcript:this.entries(),cleared:!1,ignored:!0}}},X=F(),en=[[`a`,8,5,28,5],[`b`,31,8,31,27],[`c`,31,32,31,51],[`d`,8,54,28,54],[`e`,5,32,5,51],[`f`,5,8,5,27],[`g`,8,29.5,28,29.5]];function tn(e){return!!(e&&Array.isArray(e.raw_segments)&&e.raw_segments.length===4&&e.raw_segments.every(e=>Number.isInteger(e)&&e>=0&&e<=255))}function nn({panel:e,label:t=`Live four-digit display preview`}){return tn(e)?(0,X.jsx)(`div`,{className:`live-segment-preview${e.segments_active?` is-active`:``}`,dir:`ltr`,"aria-label":t,children:e.raw_segments.map((e,t)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 40 62`,role:`img`,"aria-label":`digit ${t+1} raw 0x${e.toString(16).padStart(2,`0`)}`,children:[en.map(([t,n,r,i,a],o)=>(0,X.jsx)(`line`,{x1:n,y1:r,x2:i,y2:a,className:e&1<e===`fa`?n:t,[r,i]=(0,B.useState)(),[a,o]=(0,B.useState)(),[c,l]=(0,B.useState)(``),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(``),_=async()=>{try{let[e,t]=await Promise.all([T(`controller.udp.config.get`),T(`controller.udp.status`)]);i({...e,listen:e.listen||`127.0.0.1:8787`}),o(t),l(``)}catch(e){l(String(e))}};if((0,B.useEffect)(()=>{_()},[]),!r)return c?(0,X.jsx)(`p`,{role:`alert`,children:c}):null;let v=e=>i({...r,...e}),ee=async()=>{f(!0);try{await T(`controller.udp.config.set`,r),l(``),o(void 0)}catch(e){l(String(e))}finally{f(!1)}};return(0,X.jsxs)(`section`,{className:`advanced-fields`,"aria-label":n(`Binary UDP`,`UDP باینری`),children:[(0,X.jsx)(`h3`,{children:n(`Binary UDP`,`UDP باینری`)}),(0,X.jsx)(P,{checked:r.enabled,onChange:e=>v({enabled:e}),label:n(`Enable transport`,`فعال‌سازی ارتباط`)}),(0,X.jsx)(L,{label:n(`Listening address`,`نشانی گوش دادن`),value:r.listen,dir:`ltr`,onChange:e=>v({listen:e.target.value})}),(0,X.jsx)(P,{checked:r.discovery,onChange:e=>v({discovery:e,broadcast_events:e?r.broadcast_events:!1}),label:n(`Discover and announce peers`,`کشف و معرفی همتاها`)}),r.discovery&&(0,X.jsx)(P,{checked:r.broadcast_events,onChange:e=>v({broadcast_events:e}),label:n(`Broadcast events`,`پخش رویدادها`)}),Object.entries(r.peers??{}).map(([e,t])=>(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsxs)(`span`,{children:[e,` · `,(0,X.jsx)(`bdi`,{children:t})]}),(0,X.jsx)(w,{icon:s,onClick:()=>{let t={...r.peers};delete t[e],v({peers:t})},children:n(`Remove`,`حذف`)})]},e)),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(L,{label:n(`Peer name`,`نام همتا`),value:p,onChange:e=>m(e.target.value)}),(0,X.jsx)(L,{label:n(`Peer address`,`نشانی همتا`),value:h,dir:`ltr`,onChange:e=>g(e.target.value)})]}),(0,X.jsx)(w,{disabled:!p.trim()||!h.trim(),onClick:()=>{v({peers:{...r.peers,[p.trim()]:h.trim()}}),m(``),g(``)},children:n(`Add peer`,`افزودن همتا`)}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(w,{icon:u,busy:d,onClick:()=>void ee(),children:n(`Save UDP settings`,`ذخیره تنظیمات UDP`)}),(0,X.jsx)(w,{icon:t,onClick:()=>void _(),children:n(`Refresh`,`تازه‌سازی`)})]}),(c||a?.error)&&(0,X.jsx)(`p`,{role:`alert`,children:c||a?.error}),a&&(0,X.jsx)(`span`,{children:a.running?n(`Listening`,`در حال گوش دادن`):n(`Stopped`,`متوقف`)}),a?.peers?.map(e=>(0,X.jsxs)(`div`,{children:[e.identity?.app,` · `,(0,X.jsx)(`bdi`,{children:e.address}),(0,X.jsx)(w,{disabled:Object.values(r.peers??{}).includes(e.address),onClick:()=>{m(e.identity?.app??`peer`),g(e.address)},children:n(`Configure peer`,`پیکربندی همتا`)})]},e.id))]})}function an({icon:e,eyebrow:t,title:n,detail:r,children:i,defaultOpen:o=!1,tone:s=`neutral`,status:c}){let[l,u]=(0,B.useState)(o);return(0,X.jsxs)(`details`,{className:`advanced-panel`,open:l,onToggle:e=>u(e.currentTarget.open),children:[(0,X.jsxs)(`summary`,{className:`advanced-panel__summary`,children:[(0,X.jsx)(`span`,{className:`advanced-panel__icon`,children:(0,X.jsx)(S,{icon:e,size:18})}),(0,X.jsxs)(`span`,{className:`advanced-panel__copy`,children:[(0,X.jsx)(`small`,{children:t}),(0,X.jsx)(`strong`,{children:n}),(0,X.jsx)(`span`,{children:r})]}),c&&(0,X.jsx)(xe,{tone:s,children:c}),(0,X.jsx)(a,{className:`advanced-panel__chevron`,"aria-hidden":`true`,size:17})]}),(0,X.jsx)(`div`,{className:`advanced-panel__body`,children:i})]})}function on(e,t,n,r){let i=Number.parseInt(e,10);return Number.isFinite(i)?Math.min(r,Math.max(n,i)):t}function sn(e){return e.trim().split(/\s+/).filter(Boolean).join(` `)}function cn(e,t){let n=e.trim(),r=t.trim();if(n&&/^[\x20-\x7e]{1,4}$/.test(r))return`host-menu set ${N(n)} label ${N(r)}`}function ln(e,t,n,r=``){return e===`lcd`?{targets:[e],type:t,text:`${n}\n${r}`,line1:n,line2:r}:{targets:[e],type:t,text:n}}function un({snapshot:e,locale:r,run:i,busy:a,transport:o}){let d=_e(e),m=r===`fa`,h=(e,t)=>m?t:e,_=o.boardState===`ready`&&e.connected&&e.have_status,v=a.length>0,[ee,ie]=(0,B.useState)(``),[se,S]=(0,B.useState)(!0),[C,O]=(0,B.useState)(500),[de,j]=(0,B.useState)(`running`),[M,fe]=(0,B.useState)(!1),[pe,F]=(0,B.useState)(`web workbench`),[ve,be]=(0,B.useState)(!1),[we,Te]=(0,B.useState)(!0),[R,De]=(0,B.useState)(!0),[ke,Ae]=(0,B.useState)(`status`),[je,Me]=(0,B.useState)(`0xFFFF`),[Ne,Fe]=(0,B.useState)(`status voltage current temperature`),[Le,ze]=(0,B.useState)(``),[Ve,Ue]=(0,B.useState)(``),[Ge,qe]=(0,B.useState)(d.segments&&(e.have_front_panel||e.have_front_panel_segments)?e.front_panel:void 0),[Je,Ye]=(0,B.useState)(0),[z,Ze]=(0,B.useState)(100),[Qe,et]=(0,B.useState)(20),[nt,it]=(0,B.useState)(``),[ot,ct]=(0,B.useState)(32),[lt,ut]=(0,B.useState)(214),[ft,mt]=(0,B.useState)(220),[ht,gt]=(0,B.useState)(180),[vt,bt]=(0,B.useState)(`attention`),[xt,V]=(0,B.useState)(`1`),[H,St]=(0,B.useState)(`key`),[Ct,U]=(0,B.useState)(`1`),[wt,Tt]=(0,B.useState)(`press`),[Et,W]=(0,B.useState)(`0x27`),[Dt,Ot]=(0,B.useState)(2),[G,kt]=(0,B.useState)(4),[K,At]=(0,B.useState)(`0x00`),[jt,q]=(0,B.useState)(`F13`),[Mt,Nt]=(0,B.useState)(80),[Pt,Ft]=(0,B.useState)(`lock`),[It,Lt]=(0,B.useState)(``),[J,Rt]=(0,B.useState)(`host`),[zt,Bt]=(0,B.useState)(`ui.note`),[Y,Vt]=(0,B.useState)(``),[Ht,Ut]=(0,B.useState)(``),[Wt,Gt]=(0,B.useState)(``),[Kt,qt]=(0,B.useState)(!0),[Jt,Yt]=(0,B.useState)(!0),[Xt,Zt]=(0,B.useState)(!0),[Qt,$t]=(0,B.useState)(!0),[en,tn]=(0,B.useState)(!0),[un,dn]=(0,B.useState)(!0),[Z,fn]=(0,B.useState)(1500),[pn,mn]=(0,B.useState)(``),[hn,gn]=(0,B.useState)(37889),[_n,vn]=(0,B.useState)([]),[yn,bn]=(0,B.useState)(60),[xn,Sn]=(0,B.useState)(100),[Cn,wn]=(0,B.useState)(h(`No service query yet.`,`هنوز پرس‌وجوی سرویسی انجام نشده است.`)),[Tn,En]=(0,B.useState)(``),[Dn,On]=(0,B.useState)(`backup`),[Q,kn]=(0,B.useState)({command:``,reason:``,risk:`normal`,needsDevice:!1}),[An,jn]=(0,B.useState)(``),[Mn,Nn]=(0,B.useState)(!1);(0,B.useEffect)(()=>{e.have_settings&&(be(!!(e.settings.flags&1)),Te(!(e.settings.flags&32)),De(!(e.settings.flags&64)),S(e.settings.stream_period_ms>0),e.settings.stream_period_ms>0&&O(e.settings.stream_period_ms))},[e.have_settings,e.settings.flags,e.settings.stream_period_ms]),(0,B.useEffect)(()=>{!ee&&e.port.name&&ie(e.port.name)},[ee,e.port.name]),(0,B.useEffect)(()=>{!M&&e.program_state?.mode&&j(e.program_state.mode.toLowerCase()===`running`?`running`:`idle`)},[M,e.program_state?.mode]),(0,B.useEffect)(()=>{!_&&J===`lcd`&&Rt(`host`)},[J,_]),(0,B.useEffect)(()=>{!_||!d.segments?qe(void 0):(e.have_front_panel||e.have_front_panel_segments)&&e.front_panel&&qe(e.front_panel)},[d.segments,_,e.front_panel_updated,e.have_front_panel,e.have_front_panel_segments,e.front_panel]),(0,B.useEffect)(()=>{_&&d.segments&&!e.have_front_panel&&T(`controller.front_panel`).then(qe).catch(()=>void 0)},[d.segments,_,e.have_front_panel]),(0,B.useEffect)(()=>{wn(h(`No service query yet.`,`هنوز پرس‌وجوی سرویسی انجام نشده است.`))},[r]),(0,B.useEffect)(()=>{let e=!0;return T(`controller.discovery.config.get`).then(t=>{e&&(qt(t.mdns_enabled||t.dns_sd_enabled),Yt(t.ssdp_enabled||t.upnp_enabled),Zt(t.ws_discovery_enabled),$t(t.broadcast_enabled),tn(t.netbios_enabled),dn(t.mndp_enabled??!1),gn(t.broadcast_port||37889),mn(t.instance_name||``))}).catch(()=>{}),()=>{e=!1}},[]);let Pn=(0,B.useMemo)(()=>{let e=xt.trim()||`1`;switch(H){case`none`:return`rf map ${e} none`;case`menu`:return`rf map ${e} menu ${Ct.trim()||`next`}`;case`side`:return`rf map ${e} side ${Ct.trim()||`left`} ${wt.trim()||`stop`}`;case`relay`:return`rf map ${e} relay ${Ct.trim()||`5`} ${wt.trim()||`press`}`;case`pwm`:return`rf map ${e} pwm ${Ct.trim()||`0`} ${wt.trim()||`press`}`;default:return`rf map ${e} key ${Ct.trim()||`1`} ${wt.trim()||`press`}`}},[wt,xt,H,Ct]),Fn=(e,t,n=`caution`,r=!1,i)=>{Mn||(kn({command:e.trim(),reason:t,risk:n,needsDevice:r,execute:i}),jn(``),window.requestAnimationFrame(()=>{document.getElementById(`advanced-command-review`)?.scrollIntoView({behavior:`smooth`,block:`center`})}))},In=async()=>{if(!Q.command)return;let e=Q;jn(``),Nn(!0);try{if(e.execute){let t=await e.execute();wn(JSON.stringify(t,null,2))}else await i(e.command)}catch(e){let t=e instanceof Error?e.message:String(e);wn(`! ${t}`)}finally{jn(``),kn({command:``,reason:``,risk:`normal`,needsDevice:!1}),Nn(!1)}},Ln=async(e,t)=>{En(e);try{let e=await t();wn(JSON.stringify(e,null,2))}catch(e){let t=e instanceof Error?e.message:String(e);wn(`! ${t}`)}finally{En(``)}},Rn=e=>{e.preventDefault();let t=zt.trim();if(!t)return;if(J===`lcd`){if(!Zn)return;Ln(`message`,()=>T(`controller.message.send`,ln(`lcd`,t,Ht,Wt)));return}let n=Y.trim();!n||Xn>4096||Ln(`message`,()=>T(`controller.message.send`,ln(`host`,t,n)))},zn=e=>{let t=new Date(Date.now()-yn*6e4).toISOString(),n=e===`status`?`controller.history.status`:`controller.history.timeline`,r=e===`status`?{since:t}:{since:t,limit:xn};Ln(`history-${e}`,()=>T(n,r))},Bn=async()=>{En(`discovery`);try{let e=await T(`controller.discovery.scan`,{timeout_ms:Z,mdns:Kt,dns_sd:Kt,ssdp:Jt,upnp:Jt,ws_discovery:Xt,broadcast:Qt,netbios:en,mndp:un});vn(e),wn(JSON.stringify(e,null,2))}catch(e){let t=e instanceof Error?e.message:String(e);wn(`! ${t}`)}finally{En(``)}},Vn=()=>{Ln(`discovery-config`,async()=>{let e=await T(`controller.discovery.config.set`,{mdns_enabled:Kt,dns_sd_enabled:Kt,ssdp_enabled:Jt,upnp_enabled:Jt,ws_discovery_enabled:Xt,broadcast_enabled:Qt,netbios_enabled:en,mndp_enabled:un,broadcast_port:hn,instance_name:pn.trim()});return mn(e.instance_name||``),gn(e.broadcast_port||37889),e})},Hn=e=>{let t=e.public?.endpoints.web||`http://${e.host}:${e.port}/`;try{let e=new URL(t);if(e.protocol!==`http:`&&e.protocol!==`https:`)throw Error(`unsupported endpoint protocol`);window.location.assign(e.href)}catch(t){let n=t instanceof Error?t.message:String(t);wn(`! Cannot connect to ${e.name}: ${n}`)}},Un=e=>{switch(St(e),e){case`none`:U(``),Tt(``);break;case`menu`:U(`next`),Tt(``);break;case`relay`:U(`5`),Tt(`toggle`);break;case`side`:U(`left`),Tt(`stop`);break;case`pwm`:U(`0`),Tt(`press`);break;default:U(`1`),Tt(`press`)}},Wn=ee.trim()?`open ${N(ee.trim())}`:`open`,Gn=`stream ${se?C:0}`,Kn=de===`idle`?`program-state set web idle`:`program-state set web running ${N(pe.trim()||`web workbench`)}`,qn=sn(K),Jn=`i2c transfer ${Et.trim()||`0x27`} ${Dt} ${G}${qn?` ${qn}`:``}`,Yn=cn(Le,Ve),Xn=new TextEncoder().encode(Y.trim()).byteLength,Zn=!!(Ht||Wt)&&Ht.length<=16&&Wt.length<=16&&/^[\x20-\x7e]*$/.test(Ht)&&/^[\x20-\x7e]*$/.test(Wt),Qn=J===`lcd`,$=ge(e,r),$n=!Q.command||v||Mn||Q.needsDevice&&!_||Q.risk===`danger`&&An.trim().toUpperCase()!==`RUN`;return(0,X.jsxs)(`section`,{className:`advanced-surface`,"aria-labelledby":`advanced-workbench-title`,children:[(0,X.jsxs)(`header`,{className:`advanced-heading`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:h(`DEEP CONTROL / PROGRESSIVE DISCLOSURE`,`کنترل عمیق / نمایش مرحله‌ای`)}),(0,X.jsx)(`h2`,{id:`advanced-workbench-title`,children:h(`Advanced capability deck`,`میز قابلیت‌های پیشرفته`)}),(0,X.jsx)(`p`,{children:h(`The common controls stay calm; every specialist path remains reachable here through the same primary dispatcher.`,`کنترل‌های روزمره ساده می‌مانند و تمام مسیرهای تخصصی از همین بخش و هسته فرمان اصلی در دسترس هستند.`)})]}),(0,X.jsx)(xe,{tone:_?`good`:`warn`,pulse:_,children:_?h(`DEVICE ACTIONS READY`,`فرمان‌های برد آماده`):h(`HOST CONTROLS ONLY`,`فقط کنترل میزبان`)})]}),(0,X.jsxs)(`div`,{className:`advanced-grid`,children:[(0,X.jsxs)(an,{icon:n,eyebrow:h(`SERIAL LIFECYCLE`,`چرخه اتصال سریال`),title:h(`Connection, stream & program state`,`اتصال، جریان وضعیت و حالت برنامه`),detail:h(`Port discovery, authenticated open/reconnect, telemetry cadence and shared run state.`,`کشف درگاه، اتصال امن، آهنگ تله‌متری و حالت اجرای مشترک.`),defaultOpen:!0,status:_?e.port.name||h(`connected`,`متصل`):$.title,tone:_?`good`:$.tone===`bad`?`bad`:`warn`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:Xe,busy:a===`ports`,onClick:()=>void i(`ports`),children:h(`List ports`,`فهرست درگاه‌ها`)}),_&&(0,X.jsx)(w,{icon:E,busy:a===`status`,onClick:()=>void i(`status`),children:h(`Live status`,`وضعیت زنده`)}),(0,X.jsx)(w,{icon:yt,busy:a===`program-state`,onClick:()=>void i(`program-state`),children:h(`Program state`,`حالت برنامه`)})]}),(0,X.jsx)(`div`,{className:`advanced-fields`,children:(0,X.jsx)(L,{label:h(`Serial port · blank = authenticated auto-detect`,`درگاه سریال · خالی = کشف امن خودکار`),value:ee,dir:`ltr`,spellCheck:!1,onChange:e=>ie(e.target.value),action:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(w,{tone:`primary`,icon:st,busy:a===Wn,onClick:()=>void i(Wn),children:h(`Open`,`اتصال`)}),(0,X.jsx)(w,{icon:t,busy:a===`reconnect`||$.animated,disabled:$.retryDisabled,onClick:()=>void i(`reconnect`),children:_?h(`Reconnect`,`اتصال مجدد`):$.action}),_&&(0,X.jsx)(w,{icon:te,busy:a===`close`,onClick:()=>void i(`close`),children:h(`Close & pause`,`بستن و توقف`)})]})})}),!_&&(0,X.jsxs)(`div`,{className:`data-list connection-details`,children:[(0,X.jsx)(A,{label:h(`Phase`,`مرحله`),value:$.title,tone:$.tone===`bad`?`bad`:$.tone===`warn`?`warn`:void 0}),$.candidate&&(0,X.jsx)(A,{label:h(`Candidate`,`گزینه`),value:$.candidate,mono:!0}),$.attempt&&(0,X.jsx)(A,{label:h(`Attempt`,`تلاش`),value:$.attempt}),$.timing&&(0,X.jsx)(A,{label:h(`Timing`,`زمان‌بندی`),value:$.timing}),$.detail&&(0,X.jsx)(A,{label:h(`Detail`,`جزئیات`),value:$.detail})]}),_&&(0,X.jsxs)(`div`,{className:`advanced-control-row`,children:[(0,X.jsx)(P,{checked:se,onChange:S,label:h(`Status stream`,`جریان وضعیت`),detail:h(`Desired value; Apply sends the EEPROM-safe stream command.`,`مقدار درخواستی؛ اعمال، فرمان امن جریان را می‌فرستد.`)}),se&&(0,X.jsx)(I,{label:h(`Period`,`دوره`),value:C,min:100,max:5e3,step:100,unit:`ms`,onChange:O}),(0,X.jsx)(w,{icon:f,busy:a===Gn,onClick:()=>void i(Gn),children:h(`Apply stream`,`اعمال جریان`)})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--program`,children:[(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Desired host program state`,`حالت برنامه در میزبان`)}),(0,X.jsx)(me,{value:de,label:h(`Program mode`,`حالت برنامه`),options:[{value:`idle`,label:h(`Idle`,`آماده`)},{value:`running`,label:h(`Running`,`در حال اجرا`)}],onChange:e=>{j(e),fe(!0)}})]}),(0,X.jsx)(L,{label:h(`Reason`,`دلیل`),value:pe,disabled:de===`idle`,onChange:e=>F(e.target.value)}),(0,X.jsx)(w,{icon:x,onClick:()=>Fn(Kn,h(`Review the shared host/board program-state transition.`,`تغییر حالت برنامه میزبان و برد را بازبینی کنید.`),`caution`),children:h(`Prepare state change`,`آماده‌سازی تغییر حالت`)})]})]}),_&&(0,X.jsxs)(X.Fragment,{children:[(d.temperatureLED||d.temperatureBTAudio)&&(0,X.jsxs)(an,{icon:c,eyebrow:`DS18B20`,title:h(`Temperature identities`,`شناسه‌های دما`),detail:h(`Read assigned channels, inspect ROM identities, or explicitly rescan the OneWire bus.`,`خواندن کانال‌ها، بررسی شناسه ROM یا پویش دوباره گذرگاه OneWire.`),status:_?h(`available`,`آماده`):h(`device required`,`نیازمند برد`),tone:_?`info`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:c,disabled:!_,busy:a===`temp`,onClick:()=>void i(`temp`),children:h(`Read values`,`خواندن دما`)}),(0,X.jsx)(w,{icon:Xe,disabled:!_,busy:a===`temp list`,onClick:()=>void i(`temp list`),children:h(`List identities`,`فهرست شناسه‌ها`)}),(0,X.jsx)(w,{icon:dt,disabled:!_,busy:a===`temp scan`,onClick:()=>void i(`temp scan`),children:h(`Rescan bus`,`پویش دوباره`)})]}),(0,X.jsx)(`p`,{className:`advanced-note`,children:h(`A rescan refreshes physical sensor assignment; it does not claim that attached probes have been validated here.`,`پویش دوباره، تخصیص حسگر فیزیکی را به‌روز می‌کند؛ این صفحه به‌تنهایی تأییدکننده سلامت سخت‌افزار متصل نیست.`)})]}),(0,X.jsxs)(an,{icon:ue,eyebrow:h(`EEPROM-BACKED`,`ذخیره‌شده در EEPROM`),title:h(`Silent mode & firmware buzzer cues`,`حالت بی‌صدا و اعلان‌های بیزر`),detail:h(`Inspect the authoritative board settings, choose desired audio policy, then apply explicitly.`,`تنظیمات معتبر برد را ببینید، سیاست صوتی دلخواه را انتخاب و صریحاً اعمال کنید.`),status:e.have_settings?h(`settings synced`,`تنظیمات همگام`):h(`not read`,`خوانده نشده`),tone:e.have_settings?`good`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:ne,disabled:!_,busy:a===`settings`,onClick:()=>void i(`settings`),children:h(`EEPROM status`,`وضعیت EEPROM`)}),(0,X.jsx)(w,{icon:Se,disabled:!_,busy:a===`silent status`,onClick:()=>void i(`silent status`),children:h(`Silent status`,`وضعیت بی‌صدا`)})]}),(0,X.jsxs)(`div`,{className:`advanced-toggle-stack`,children:[(0,X.jsx)(P,{checked:ve,disabled:!_,onChange:be,label:h(`Silent mode`,`حالت بی‌صدا`),detail:h(`Desired persisted value.`,`مقدار ذخیره‌شونده درخواستی.`)}),(0,X.jsx)(P,{checked:we,disabled:!_,onChange:Te,label:h(`Door cues`,`صدای باز و بسته شدن در`),detail:h(`Desired firmware cue state.`,`وضعیت درخواستی صدای میان‌افزار.`)}),(0,X.jsx)(P,{checked:R,disabled:!_,onChange:De,label:h(`Relay cues`,`صدای روشن و خاموش شدن رله`),detail:h(`Desired firmware cue state.`,`وضعیت درخواستی صدای میان‌افزار.`)})]}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:ve?Se:ye,disabled:!_,busy:a===`silent ${ve?`on`:`off`}`,onClick:()=>void i(`silent ${ve?`on`:`off`}`),children:h(`Apply silent`,`اعمال بی‌صدا`)}),(0,X.jsx)(w,{icon:Re,disabled:!_,busy:a===`settings audio door ${we?`on`:`off`}`,onClick:()=>void i(`settings audio door ${we?`on`:`off`}`),children:h(`Apply door cues`,`اعمال صدای در`)}),(0,X.jsx)(w,{icon:ue,disabled:!_,busy:a===`settings audio relay ${R?`on`:`off`}`,onClick:()=>void i(`settings audio relay ${R?`on`:`off`}`),children:h(`Apply relay cues`,`اعمال صدای رله`)})]})]}),(0,X.jsxs)(an,{icon:Ke,eyebrow:h(`FRONT PANEL`,`پنل جلویی`),title:h(`Catalog, layout & navigation`,`کاتالوگ، چیدمان و پیمایش`),detail:h(`Firmware page IDs and HOST-supplied menu overlays remain separately inspectable.`,`شناسه صفحات میان‌افزار و منوهای میزبان به‌صورت مستقل قابل بررسی هستند.`),status:Ge?.tm1637_detection_known?Ge.tm1637_detected?h(`TM1637 detected`,`TM1637 شناسایی شد`):h(`TM1637 not detected`,`TM1637 شناسایی نشد`):void 0,tone:Ge?.tm1637_detection_known?Ge.tm1637_detected?`good`:`bad`:`neutral`,defaultOpen:!0,children:[d.segments&&(0,X.jsxs)(`div`,{className:`front-panel-live`,children:[(0,X.jsx)(nn,{panel:Ge,label:h(`Live physical seven-segment display`,`نمایش زندهٔ نمایشگر فیزیکی هفت‌بخشی`)}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:h(`Live physical display`,`نمایش زنده پنل`)}),(0,X.jsx)(`span`,{children:Ge?e.have_front_panel?`${h(`page`,`صفحه`)} ${Ge.menu_page} · ${h(`brightness`,`روشنایی`)} ${Ge.brightness}/7`:`${h(`live segment frame`,`فریم زنده نمایشگر`)} · ${h(`brightness`,`روشنایی`)} ${Ge.brightness}/7`:h(`Waiting for the next physical display event`,`در انتظار رویداد بعدی نمایشگر فیزیکی`)}),(0,X.jsx)(`small`,{children:h(`Physical changes update every connected client immediately through the state stream.`,`تغییرات فیزیکی از راه جریان وضعیت، همهٔ کارخواه‌های متصل را فوری به‌روز می‌کند.`)})]})]}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[d.segments&&!e.have_front_panel_segments&&(0,X.jsx)(w,{icon:t,disabled:!_,onClick:()=>void T(`controller.front_panel`).then(qe).catch(()=>void 0),children:h(`Recover physical state`,`بازیابی وضعیت فیزیکی`)}),(0,X.jsx)(w,{icon:Oe,disabled:!_,busy:a===`menu list`,onClick:()=>void i(`menu list`),children:h(`Firmware catalog`,`کاتالوگ میان‌افزار`)}),(0,X.jsx)(w,{icon:ce,disabled:!_,busy:a===`menu current`,onClick:()=>void i(`menu current`),children:h(`Current page`,`صفحه فعلی`)}),(0,X.jsx)(w,{icon:Ke,disabled:!_,busy:a===`menu layout`,onClick:()=>void i(`menu layout`),children:h(`Stored layout`,`چیدمان ذخیره‌شده`)}),(0,X.jsx)(w,{icon:Xe,busy:a===`host-menu list`,onClick:()=>void i(`host-menu list`),children:h(`Host catalog`,`کاتالوگ میزبان`)}),(0,X.jsx)(w,{icon:He,busy:a===`host-menu directory`,onClick:()=>void i(`host-menu directory`),children:h(`Host directory`,`دایرکتوری میزبان`)}),(0,X.jsx)(w,{icon:y,busy:a===`host-menu status`,onClick:()=>void i(`host-menu status`),children:h(`Overlay status`,`وضعیت لایه میزبان`)}),(0,X.jsx)(w,{icon:yt,disabled:!_,busy:a===`host-menu open macro-library`,onClick:()=>void i(`host-menu open macro-library`),children:h(`Macro front panel`,`پنل ماکرو`)})]}),(0,X.jsx)(`div`,{className:`advanced-nav-pad`,"aria-label":h(`Firmware menu navigation`,`پیمایش منوی میان‌افزار`),children:[`prev`,`next`,`dec`,`inc`].map(e=>(0,X.jsx)(w,{compact:!0,disabled:!_,busy:a===`menu ${e}`,onClick:()=>void i(`menu ${e}`),children:e},e))}),(0,X.jsx)(`div`,{className:`advanced-nav-pad`,"aria-label":h(`HOST menu navigation`,`پیمایش منوی میزبان`),children:[[`K1`,`Previous`],[`K2`,`Next`],[`K3`,`Decrease`],[`K4`,`Select`]].map(([e,t])=>(0,X.jsx)(w,{compact:!0,disabled:!_,busy:a===`host-menu key ${e} press`,onClick:()=>void i(`host-menu key ${e} press`),children:h(`${e} · ${t}`,`${e} · ${t}`)},e))}),(0,X.jsx)(`p`,{className:`advanced-note advanced-note--safe`,children:h(`The Macro front-panel page uses the shared host library, records host command timing by default, shows playback progress, and offers safe cancel or guarded keep-output cancel.`,`صفحه ماکروی پنل از کتابخانه مشترک میزبان استفاده می‌کند، زمان فرمان‌های میزبان را ضبط می‌کند و پیشرفت اجرا و لغو امن را نشان می‌دهد.`)}),(0,X.jsxs)(`div`,{className:`advanced-fields`,children:[(0,X.jsx)(L,{label:h(`Firmware page ID or key`,`شناسه یا کلید صفحه میان‌افزار`),value:ke,dir:`ltr`,spellCheck:!1,onChange:e=>Ae(e.target.value),action:(0,X.jsx)(w,{icon:ce,disabled:!_||!ke.trim(),busy:a===`menu page ${ke.trim()}`,onClick:()=>void i(`menu page ${N(ke.trim())}`),children:h(`Go to page`,`رفتن به صفحه`)})}),(0,X.jsx)(L,{label:h(`Host menu ID · optional`,`شناسه منوی میزبان · اختیاری`),value:Le,dir:`ltr`,spellCheck:!1,onChange:e=>ze(e.target.value),action:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(w,{icon:rt,disabled:!_,busy:a===`host-menu open${Le.trim()?` ${N(Le.trim())}`:``}`,onClick:()=>void i(`host-menu open${Le.trim()?` ${N(Le.trim())}`:``}`),children:h(`Open overlay`,`باز کردن لایه`)}),(0,X.jsx)(w,{icon:t,disabled:!_,busy:a===`host-menu refresh`,onClick:()=>void i(`host-menu refresh`),children:h(`Refresh`,`تازه‌سازی`)}),(0,X.jsx)(w,{icon:he,busy:a===`host-menu close`,onClick:()=>void i(`host-menu close`),children:h(`Close`,`بستن`)})]})}),(0,X.jsx)(L,{label:h(`Short 7-segment label`,`برچسب کوتاه نمایشگر`),hint:h(`Select a HOST menu ID above, then enter 1–4 printable ASCII characters.`,`شناسه منوی میزبان را در بالا انتخاب کنید و ۱ تا ۴ نویسه ASCII وارد کنید.`),value:Ve,dir:`ltr`,maxLength:4,spellCheck:!1,onChange:e=>Ue(e.target.value),action:(0,X.jsx)(w,{icon:u,disabled:!Yn,busy:a===Yn,onClick:()=>Yn&&void i(Yn),children:h(`Save label`,`ذخیره برچسب`)})})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--layout`,children:[(0,X.jsx)(L,{label:h(`Visibility mask`,`ماسک نمایش`),value:je,dir:`ltr`,spellCheck:!1,onChange:e=>Me(e.target.value)}),(0,X.jsx)(L,{label:h(`Ordered page references`,`ترتیب شناسه یا کلید صفحات`),value:Ne,dir:`ltr`,spellCheck:!1,onChange:e=>Fe(e.target.value)}),(0,X.jsx)(w,{icon:pt,disabled:!je.trim()||!sn(Ne),onClick:()=>Fn(`menu layout set ${je.trim()} ${sn(Ne)}`,h(`Layout writes are schema-sensitive and persistent on supported firmware.`,`نوشتن چیدمان وابسته به ساختار و در میان‌افزارهای پشتیبانی‌شده ماندگار است.`),`caution`,!0),children:h(`Prepare layout write`,`آماده‌سازی نوشتن چیدمان`)})]})]}),(0,X.jsxs)(an,{icon:p,eyebrow:`WS281X + STATUS RGB`,title:h(`Per-pixel light & effect engine`,`نور هر پیکسل و موتور افکت`),detail:``,children:[(0,X.jsxs)(`div`,{className:`advanced-fields`,children:[(0,X.jsx)(L,{label:h(`LED count`,`تعداد LED`),type:`number`,min:1,max:100,value:z,onChange:e=>{let t=on(e.target.value,100,1,100);Ze(t),Ye(e=>Math.min(e,t-1))}}),(0,X.jsx)(L,{label:h(`Frames per second`,`فریم در ثانیه`),type:`number`,min:1,max:30,value:Qe,onChange:e=>et(on(e.target.value,20,1,30))})]}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{disabled:!_,busy:a===`strip config ${z}`,onClick:()=>void i(`strip config ${z}`),children:h(`Set LED count`,`تنظیم تعداد LED`)}),(0,X.jsx)(w,{icon:at,disabled:!_,busy:a===`strip rainbow ${z} ${Qe}`,onClick:()=>void i(`strip rainbow ${z} ${Qe}`),children:h(`Rolling rainbow`,`رنگین‌کمان متحرک`)}),(e.strip_effects??[]).map(e=>{let t=`effect play ${e.id} ${z} ${Qe}`;return(0,X.jsx)(w,{icon:g,disabled:!_,busy:a===t,onClick:()=>void i(t),children:e.name},e.id)}),(0,X.jsx)(w,{icon:Pe,onClick:()=>void i(`effect stop`),children:h(`Stop`,`توقف`)}),(0,X.jsx)(w,{icon:Be,disabled:!_,onClick:()=>void i(`strip clear`),children:h(`Clear strip`,`خاموش کردن نوار`)}),(0,X.jsx)(w,{icon:E,onClick:()=>void i(`strip status`),children:h(`Stream status`,`وضعیت جریان`)})]}),(0,X.jsx)(L,{label:h(`RGB frame · six hex digits per LED`,`فریم RGB · شش رقم هگز برای هر LED`),value:nt,dir:`ltr`,spellCheck:!1,maxLength:600,onChange:e=>it(e.target.value.replace(/\s/g,``)),action:(0,X.jsx)(w,{disabled:!_||!/^(?:[0-9a-fA-F]{6})+$/.test(nt)||nt.length!==z*6,onClick:()=>void i(`strip frame ${nt}`),children:h(`Send frame`,`ارسال فریم`)})}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--pixel`,children:[(0,X.jsx)(L,{label:h(`Pixel 0..${z-1}`,`پیکسل ۰ تا ${z-1}`),type:`number`,min:0,max:z-1,value:Je,onChange:e=>Ye(on(e.target.value,0,0,z-1))}),(0,X.jsx)(L,{label:`R`,type:`number`,min:0,max:255,value:ot,onChange:e=>ct(on(e.target.value,0,0,255))}),(0,X.jsx)(L,{label:`G`,type:`number`,min:0,max:255,value:lt,onChange:e=>ut(on(e.target.value,0,0,255))}),(0,X.jsx)(L,{label:`B`,type:`number`,min:0,max:255,value:ft,onChange:e=>mt(on(e.target.value,0,0,255))})]}),(0,X.jsx)(I,{label:h(`Pixel brightness`,`روشنایی پیکسل`),value:ht,min:0,max:255,disabled:!_,onChange:gt}),(0,X.jsx)(w,{tone:`primary`,icon:tt,disabled:!_,busy:a===`strip pixel ${Je} ${ot} ${lt} ${ft} ${ht}`,onClick:()=>void i(`strip pixel ${Je} ${ot} ${lt} ${ft} ${ht}`),children:h(`Apply pixel`,`اعمال پیکسل`)}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsx)(L,{label:h(`Configured effect name`,`نام افکت تعریف‌شده`),value:vt,dir:`ltr`,spellCheck:!1,onChange:e=>bt(e.target.value)}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:g,busy:a===`rgb effect list`,onClick:()=>void i(`rgb effect list`),children:h(`List effects`,`فهرست افکت‌ها`)}),(0,X.jsx)(w,{icon:E,busy:a===`rgb effect status`,onClick:()=>void i(`rgb effect status`),children:h(`Effect status`,`وضعیت افکت`)}),(0,X.jsx)(w,{icon:at,disabled:!_||!vt.trim(),busy:a===`rgb effect play ${N(vt.trim())}`,onClick:()=>void i(`rgb effect play ${N(vt.trim())}`),children:h(`Play effect`,`اجرای افکت`)}),(0,X.jsx)(w,{icon:Pe,busy:a===`rgb effect stop`,onClick:()=>void i(`rgb effect stop`),children:h(`Stop effect`,`توقف افکت`)})]})]}),(0,X.jsxs)(an,{icon:l,eyebrow:`433 MHz`,title:h(`RF inspection, removal & mapping`,`بررسی، حذف و نگاشت RF`),detail:h(`Reads execute directly; persistent removal and mapping always enter the review dock first.`,`خواندن مستقیم انجام می‌شود؛ حذف و نگاشت ماندگار ابتدا وارد بخش بازبینی می‌شوند.`),status:_?h(`receiver ready`,`گیرنده آماده`):h(`device required`,`نیازمند برد`),tone:_?`info`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:Ee,busy:a===`rf status`,onClick:()=>void i(`rf status`),children:h(`Learn status`,`وضعیت یادگیری`)}),(0,X.jsx)(w,{icon:Xe,disabled:!_,busy:a===`rf list`,onClick:()=>void i(`rf list`),children:h(`Inspect learned entries`,`بررسی ورودی‌های آموخته‌شده`)})]}),(0,X.jsx)(L,{label:h(`Learned entry ID`,`شناسه ورودی آموخته‌شده`),value:xt,dir:`ltr`,inputMode:`numeric`,onChange:e=>V(e.target.value)}),(0,X.jsx)(`div`,{className:`advanced-actions`,children:(0,X.jsx)(w,{tone:`danger`,icon:s,disabled:!xt.trim(),onClick:()=>Fn(`rf remove ${xt.trim()}`,h(`This permanently removes one learned RF entry from the board.`,`این فرمان یک ورودی RF آموخته‌شده را برای همیشه از برد حذف می‌کند.`),`danger`,!0),children:h(`Prepare removal`,`آماده‌سازی حذف`)})}),(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Mapping kind`,`نوع نگاشت`)}),(0,X.jsx)(me,{value:H,label:h(`RF mapping kind`,`نوع نگاشت RF`),options:[{value:`key`,label:h(`Key`,`کلید`)},{value:`menu`,label:h(`Menu`,`منو`)},{value:`relay`,label:h(`Relay`,`رله`)},{value:`side`,label:h(`Motion`,`حرکت`)},...d.pwm?[{value:`pwm`,label:`PWM`}]:[],{value:`none`,label:h(`None`,`بدون نگاشت`)}],onChange:Un})]}),H!==`none`&&(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(L,{label:h(`Target / action`,`مقصد / عمل`),hint:h(`Key 1..4 · menu prev/next/dec/inc · relay 5..8 · side left/right · PWM 0..10`,`کلید ۱..۴ · منو prev/next/dec/inc · رله ۵..۸ · سمت left/right · PWM ۰..۱۰`),value:Ct,dir:`ltr`,spellCheck:!1,onChange:e=>U(e.target.value)}),H!==`menu`&&(0,X.jsx)(L,{label:h(`Behavior`,`رفتار`),hint:H===`side`?`up | down | stop`:`press | toggle | momentary`,value:wt,dir:`ltr`,spellCheck:!1,onChange:e=>Tt(e.target.value)})]}),(0,X.jsx)(`div`,{className:`advanced-command-inline`,dir:`ltr`,children:(0,X.jsx)(`code`,{children:Pn})}),(0,X.jsx)(w,{icon:pt,disabled:!xt.trim(),onClick:()=>Fn(Pn,h(`RF mappings affect physical outputs and must match the registered action schema.`,`نگاشت RF بر خروجی فیزیکی اثر می‌گذارد و باید دقیقاً با ساختار فرمان سازگار باشد.`),`caution`,!0),children:h(`Review mapping`,`بازبینی نگاشت`)})]}),(0,X.jsxs)(an,{icon:re,eyebrow:`I²C + LCD`,title:h(`Cooperative bus & raw transfer`,`گذرگاه اشتراکی و انتقال خام`),detail:h(`Inspect LCD ownership and scan safely; raw schemas are reviewed before the host lease is acquired.`,`مالکیت LCD را ببینید و امن پویش کنید؛ انتقال خام پیش از گرفتن دسترسی میزبان بازبینی می‌شود.`),status:d.lcd?`LCD 0x${(e.front_panel?.lcd_address||e.status.lcd_address).toString(16).padStart(2,`0`).toUpperCase()}`:h(`LCD not detected`,`LCD شناسایی نشد`),tone:_?`info`:`neutral`,children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:dt,disabled:!_,busy:a===`i2c scan`,onClick:()=>void i(`i2c scan`),children:h(`Scan bus`,`پویش گذرگاه`)}),d.lcd&&(0,X.jsx)(w,{icon:$e,busy:a===`i2c lcd status`,onClick:()=>void i(`i2c lcd status`),children:h(`LCD status`,`وضعیت LCD`)}),(0,X.jsx)(w,{icon:t,disabled:!_,busy:a===`i2c lcd rescan`,onClick:()=>void i(`i2c lcd rescan`),children:h(`Rescan LCD`,`پویش دوباره LCD`)}),(0,X.jsx)(w,{icon:te,disabled:!_,busy:a===`i2c release`,onClick:()=>void i(`i2c release`),children:h(`Release lease`,`آزادسازی دسترسی`)})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--i2c`,children:[(0,X.jsx)(L,{label:h(`7-bit address`,`نشانی ۷ بیتی`),value:Et,dir:`ltr`,spellCheck:!1,onChange:e=>W(e.target.value)}),(0,X.jsx)(L,{label:h(`Lease seconds 0..10`,`مدت دسترسی ۰..۱۰ ثانیه`),type:`number`,min:0,max:10,value:Dt,onChange:e=>Ot(on(e.target.value,2,0,10))}),(0,X.jsx)(L,{label:h(`Read count`,`تعداد بایت خواندن`),type:`number`,min:0,max:16,value:G,onChange:e=>kt(on(e.target.value,0,0,16))}),(0,X.jsx)(L,{label:h(`Write bytes · numeric tokens`,`بایت‌های نوشتن · توکن عددی`),hint:`0x00 0x01 255`,value:K,dir:`ltr`,spellCheck:!1,onChange:e=>At(e.target.value)})]}),(0,X.jsx)(`div`,{className:`advanced-command-inline`,dir:`ltr`,children:(0,X.jsx)(`code`,{children:Jn})}),(0,X.jsx)(w,{icon:pt,onClick:()=>Fn(Jn,h(`Raw I²C transfer parameters are sent exactly as reviewed and acquire a bounded cooperative lease.`,`پارامترهای انتقال خام I²C دقیقاً پس از بازبینی ارسال و دسترسی اشتراکی محدود دریافت می‌شود.`),`caution`,!0),children:h(`Review raw transfer`,`بازبینی انتقال خام`)})]}),(0,X.jsxs)(an,{icon:k,eyebrow:h(`GLOBAL INPUT`,`ورودی سراسری`),title:h(`Keyboard lifecycle & emergency release`,`چرخه صفحه‌کلید و آزادسازی اضطراری`),detail:h(`Inspect bindings, control the primary Windows hook, or release every held and latched output.`,`نگاشت‌ها را ببینید، هوک اصلی ویندوز را کنترل یا همه خروجی‌های نگه‌داشته‌شده را آزاد کنید.`),children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:E,busy:a===`keyboard status`,onClick:()=>void i(`keyboard status`),children:h(`Hook status`,`وضعیت هوک`)}),(0,X.jsx)(w,{icon:Xe,busy:a===`keyboard list`,onClick:()=>void i(`keyboard list`),children:h(`Binding catalog`,`فهرست نگاشت‌ها`)}),(0,X.jsx)(w,{icon:k,onClick:()=>Fn(`keyboard enable`,h(`Enabling the global hook activates the configured bindings; review them first with Keyboard list.`,`فعال‌سازی هوک سراسری، نگاشت‌های پیکربندی‌شده را فعال می‌کند؛ ابتدا فهرست صفحه‌کلید را بازبینی کنید.`),`caution`),children:h(`Review enable`,`بازبینی فعال‌سازی`)}),(0,X.jsx)(w,{icon:We,busy:a===`keyboard disable`,onClick:()=>void i(`keyboard disable`),children:h(`Disable & release`,`غیرفعال و آزادسازی`)}),(0,X.jsx)(w,{tone:`danger`,icon:Pe,busy:a===`estop ${e.emergency_stop?.active?`off`:`on`}`,onClick:()=>void i(`estop ${e.emergency_stop?.active?`off`:`on`}`),children:e.emergency_stop?.active?h(`Release E-STOP`,`آزادسازی توقف اضطراری`):h(`Engage E-STOP`,`فعال‌سازی توقف اضطراری`)})]}),(0,X.jsx)(`p`,{className:`advanced-note advanced-note--safe`,children:e.emergency_stop?.active?h(`Locked: effects, seat motion, relay tests, relay-on, and PWM output commands are rejected by PCController.`,`قفل است: افکت‌ها، حرکت صندلی، آزمایش رله، روشن‌کردن رله و فرمان‌های PWM توسط PCController رد می‌شوند.`):h(`Ready. Engaging E-STOP cancels effect playback and locks every motion/output command at PCController.`,`آماده است. توقف اضطراری پخش افکت را لغو و همه فرمان‌های حرکت و خروجی را در PCController قفل می‌کند.`)})]})]}),(0,X.jsxs)(an,{icon:$e,eyebrow:h(`POLICY-GATED OS`,`سیستم‌عامل تحت سیاست امنیتی`),title:h(`Brightness, virtual key & power preparation`,`روشنایی، کلید مجازی و آماده‌سازی توان`),detail:h(`Read host state directly. Virtual-key and power requests are composed visibly before submission.`,`وضعیت میزبان را مستقیم بخوانید؛ کلید مجازی و فرمان توان پیش از ارسال به‌وضوح ساخته می‌شوند.`),children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:le,busy:a===`os status`,onClick:()=>void i(`os status`),children:h(`Host status`,`وضعیت میزبان`)}),(0,X.jsx)(w,{icon:pt,busy:a===`os policy`,onClick:()=>void i(`os policy`),children:h(`Action policy`,`سیاست فرمان‌ها`)}),(0,X.jsx)(w,{icon:_t,busy:a===`os brightness get`,onClick:()=>void i(`os brightness get`),children:h(`Read brightness`,`خواندن روشنایی`)})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(L,{label:h(`Virtual key`,`کلید مجازی`),hint:`F13 · MEDIA_PLAY_PAUSE · VOLUME_UP`,value:jt,dir:`ltr`,spellCheck:!1,onChange:e=>q(e.target.value)}),(0,X.jsx)(L,{label:h(`Hold ms`,`مدت نگه‌داری ms`),type:`number`,min:0,max:5e3,value:Mt,onChange:e=>Nt(on(e.target.value,80,0,5e3))})]}),(0,X.jsx)(w,{icon:pt,disabled:!jt.trim(),onClick:()=>Fn(`os key ${N(jt.trim())} ${Mt}`,h(`The configured OS policy still authorizes or rejects this reviewed key request.`,`سیاست سیستم‌عامل همچنان این درخواست کلید بازبینی‌شده را می‌پذیرد یا رد می‌کند.`),`caution`),children:h(`Prepare virtual key`,`آماده‌سازی کلید مجازی`)}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Power action`,`فرمان توان`)}),(0,X.jsx)(me,{value:Pt,label:h(`Power action`,`فرمان توان`),options:[{value:`lock`,label:h(`Lock`,`قفل`)},{value:`sleep`,label:h(`Sleep`,`خواب`)},{value:`hibernate`,label:h(`Hibernate`,`هایبرنیت`)},{value:`shutdown`,label:h(`Shutdown`,`خاموشی`)},{value:`restart`,label:h(`Restart`,`راه‌اندازی`)},{value:`logoff`,label:h(`Log off`,`خروج`)}],onChange:Ft})]}),(0,X.jsx)(L,{label:h(`Configured confirmation token`,`توکن تأیید تنظیم‌شده`),type:`password`,autoComplete:`off`,value:It,dir:`ltr`,onChange:e=>Lt(e.target.value)}),(0,X.jsx)(w,{tone:`danger`,icon:pt,disabled:!It.trim(),onClick:()=>Fn(`os power ${Pt} [REDACTED]`,h(`This can change the host power session. The secret is sent only through typed RPC, and the review dock requires a second typed RUN confirmation.`,`این فرمان می‌تواند وضعیت توان میزبان را تغییر دهد. توکن محرمانه فقط از RPC تایپ‌شده ارسال می‌شود و بخش بازبینی به تأیید تایپی RUN نیاز دارد.`),`danger`,!1,()=>T(`controller.os.power`,{action:Pt,confirmation:It})),children:h(`Prepare only — do not execute`,`فقط آماده‌سازی — بدون اجرا`)})]}),(0,X.jsxs)(an,{icon:b,eyebrow:h(`TYPED HOST SERVICES`,`سرویس‌های تایپ‌شده میزبان`),title:h(`Messages, discovery & history`,`پیام‌ها، کشف شبکه و تاریخچه`),detail:h(`Typed RPC is used where the shell intentionally has no alias; results remain visible as protocol data.`,`در عملیات بدون فرمان پوسته، RPC تایپ‌شده استفاده می‌شود و نتیجه به‌صورت داده پروتکل دیده می‌شود.`),children:[(0,X.jsxs)(`form`,{className:`advanced-form`,onSubmit:Rn,children:[(0,X.jsxs)(`div`,{className:`advanced-field`,children:[(0,X.jsx)(`label`,{children:h(`Message target`,`مقصد پیام`)}),(0,X.jsx)(me,{value:J,label:h(`Message target`,`مقصد پیام`),options:_?[{value:`host`,label:h(`Event stream`,`جریان رویداد`)},{value:`lcd`,label:h(`Physical LCD`,`LCD فیزیکی`)}]:[{value:`host`,label:h(`Event stream`,`جریان رویداد`)}],onChange:Rt})]}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--message`,children:[(0,X.jsx)(L,{label:h(`Message type`,`نوع پیام`),hint:`a-z · 0-9 · dot · dash · underscore`,value:zt,dir:`ltr`,spellCheck:!1,maxLength:32,onChange:e=>Bt(e.target.value)}),J===`host`?(0,X.jsx)(L,{label:h(`Event text`,`متن رویداد`),value:Y,maxLength:4096,onChange:e=>Vt(e.target.value),hint:`${Xn} / 4096 UTF-8 bytes`,"aria-invalid":Xn>4096}):(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(L,{label:h(`LCD line 1`,`خط اول LCD`),value:Ht,maxLength:16,dir:`ltr`,spellCheck:!1,onChange:e=>Ut(e.target.value)}),(0,X.jsx)(L,{label:h(`LCD line 2`,`خط دوم LCD`),value:Wt,maxLength:16,dir:`ltr`,spellCheck:!1,onChange:e=>Gt(e.target.value)})]}),(0,X.jsx)(w,{type:`submit`,tone:`primary`,icon:ae,busy:Tn===`message`,disabled:!zt.trim()||(J===`host`?!Y.trim()||Xn>4096:!Zn)||Qn&&!_,children:h(`Send typed message`,`ارسال پیام تایپ‌شده`)})]}),J===`lcd`&&(0,X.jsx)(`p`,{className:`advanced-note${Zn?` advanced-note--safe`:``}`,children:h(`Up to two 16-character lines; printable ASCII only. Hardware LCD text is intentionally LTR.`,`حداکثر دو خط ۱۶ نویسه‌ای و فقط ASCII قابل چاپ؛ متن LCD سخت‌افزاری عمداً چپ‌به‌راست است.`)})]}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsxs)(`div`,{className:`advanced-toggle-stack advanced-toggle-stack--compact`,children:[(0,X.jsx)(P,{checked:Kt,onChange:qt,label:`mDNS / DNS-SD`}),(0,X.jsx)(P,{checked:Jt,onChange:Yt,label:`SSDP / UPnP + SOAP`}),(0,X.jsx)(P,{checked:Xt,onChange:Zt,label:`WS-Discovery`}),(0,X.jsx)(P,{checked:Qt,onChange:$t,label:`UDP broadcast`}),(0,X.jsx)(P,{checked:en,onChange:tn,label:`NetBIOS`}),(0,X.jsx)(P,{checked:un,onChange:dn,label:`MNDP`})]}),(0,X.jsx)(rn,{locale:r}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,X.jsx)(L,{label:h(`Advertised instance name`,`نام تبلیغ‌شده نمونه`),hint:h(`Blank uses the configured app title`,`خالی یعنی عنوان برنامه`),value:pn,maxLength:63,onChange:e=>mn(e.target.value)}),(0,X.jsx)(L,{label:h(`UDP broadcast port`,`درگاه پخش UDP`),type:`number`,min:1024,max:65535,value:hn,onChange:e=>gn(on(e.target.value,37889,1024,65535))})]}),(0,X.jsx)(w,{icon:u,busy:Tn===`discovery-config`,onClick:Vn,children:h(`Save advertisement settings`,`ذخیره تنظیمات معرفی`)}),(0,X.jsx)(`p`,{className:`advanced-note advanced-note--safe`,children:h(`Advertisement is enabled by default and publishes only bounded public identity, health and telemetry. Remote commands still require an authenticated, remotely enabled IPC policy.`,`معرفی شبکه به‌طور پیش‌فرض فعال است و فقط هویت، سلامت و تله‌متری عمومی محدود را منتشر می‌کند. فرمان‌های راه‌دور همچنان به IPC فعال و احراز هویت‌شده نیاز دارند.`)}),(0,X.jsx)(I,{label:h(`Discovery timeout`,`مهلت کشف`),value:Z,min:100,max:5e3,step:100,unit:`ms`,onChange:fn}),(0,X.jsx)(w,{icon:dt,busy:Tn===`discovery`,disabled:!Kt&&!Jt&&!Xt&&!Qt&&!en&&!un,onClick:()=>void Bn(),children:h(`Discover network hosts`,`کشف میزبان‌های شبکه`)}),_n.length>0&&(0,X.jsx)(`div`,{className:`network-device-directory`,"aria-live":`polite`,children:_n.map(e=>{let t=e.public,n=t?.board.telemetry,r=[];return n?.ina219_available&&(r.push(`${((n.supply_mv??0)/1e3).toFixed(2)} V`),r.push(`${(n.current_ma??0).toFixed(0)} mA`)),n?.temperature_led_available&&r.push(`${((n.temperature_led_centi_c??0)/100).toFixed(1)} °C LED`),n?.temperature_bt_audio_available&&r.push(`${((n.temperature_bt_audio_centi_c??0)/100).toFixed(1)} °C BT`),n?.available&&r.push(n.door_open?h(`door open`,`درب باز`):h(`door closed`,`درب بسته`)),(0,X.jsxs)(`article`,{className:`network-device`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`strong`,{children:t?.instance_name||e.name}),(0,X.jsxs)(`small`,{children:[t?.hostname||e.host,`:`,e.port,` · `,(e.protocols||[e.protocol]).join(` + `)]})]}),(0,X.jsx)(xe,{tone:t?.health.ok?t.health.connectable?`good`:`warn`:`bad`,children:t?.health.connectable?h(`CONNECTABLE`,`قابل اتصال`):h(`DISCOVERABLE`,`قابل کشف`)}),(0,X.jsx)(`p`,{children:t?.board.connected?`${t.board.identity.name||`PCController`} · ${t.board.identity.build_hash||`firmware`} · ${t.board.port.name||t.board.port.product||`serial`}`:h(`Host online · board disconnected`,`میزبان آنلاین · برد قطع است`)}),r.length>0&&(0,X.jsx)(`p`,{children:r.join(` · `)}),(0,X.jsx)(w,{tone:`primary`,icon:st,disabled:!t?.health.connectable,onClick:()=>Hn(e),children:h(`Connect to host`,`اتصال به میزبان`)})]},t?.instance_id||`${e.host}:${e.port}`)})}),(0,X.jsx)(`div`,{className:`advanced-divider`}),(0,X.jsxs)(`div`,{className:`advanced-fields advanced-fields--history`,children:[(0,X.jsx)(L,{label:h(`Look back · minutes`,`بازه گذشته · دقیقه`),type:`number`,min:1,max:43200,value:yn,onChange:e=>bn(on(e.target.value,60,1,43200))}),(0,X.jsx)(L,{label:h(`Timeline limit`,`حد رویدادها`),type:`number`,min:1,max:5e3,value:xn,onChange:e=>Sn(on(e.target.value,100,1,5e3))}),(0,X.jsx)(w,{icon:Ie,busy:Tn===`history-status`,onClick:()=>zn(`status`),children:h(`Status history`,`تاریخچه وضعیت`)}),(0,X.jsx)(w,{icon:E,busy:Tn===`history-timeline`,onClick:()=>zn(`timeline`),children:h(`Event timeline`,`خط زمانی رویداد`)})]}),(0,X.jsx)(`pre`,{className:`advanced-service-output`,dir:`ltr`,"aria-live":`polite`,children:Cn})]}),(0,X.jsxs)(an,{icon:D,eyebrow:h(`READ-FIRST RECOVERY`,`بازیابی با اولویت خواندن`),title:h(`Firmware, toolchain & boot preparation`,`میان‌افزار، زنجیره‌ابزار و آماده‌سازی بوت`),detail:h(`Identity and toolchain reads are immediate; bootloader probe/read/backup commands are prepared only.`,`خواندن شناسه و زنجیره‌ابزار مستقیم است؛ فرمان‌های پروب، خواندن و پشتیبان بوت فقط آماده می‌شوند.`),children:[(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[_&&(0,X.jsx)(w,{icon:D,busy:a===`hello`,onClick:()=>void i(`hello`),children:h(`Firmware identity`,`شناسه میان‌افزار`)}),(0,X.jsx)(w,{icon:ne,busy:a===`toolchain profile`,onClick:()=>void i(`toolchain profile`),children:h(`Resolved profile`,`پروفایل حل‌شده`)}),(0,X.jsx)(w,{icon:D,busy:a===`toolchain core-info`,onClick:()=>void i(`toolchain core-info`),children:h(`Core info`,`اطلاعات هسته`)})]}),_&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(L,{label:h(`Backup directory or read output file`,`پوشه پشتیبان یا فایل خروجی خواندن`),value:Dn,dir:`ltr`,spellCheck:!1,onChange:e=>On(e.target.value)}),(0,X.jsxs)(`div`,{className:`advanced-actions`,children:[(0,X.jsx)(w,{icon:dt,onClick:()=>Fn(`boot probe`,h(`Prepare a non-write bootloader probe; execution temporarily hands over the serial port.`,`پروب غیرنوشتنی بوت آماده می‌شود؛ اجرا موقتاً درگاه سریال را تحویل می‌دهد.`),`caution`,!0),children:h(`Prepare probe`,`آماده‌سازی پروب`)}),(0,X.jsx)(w,{icon:x,onClick:()=>Fn(`boot info`,h(`Prepare a metadata read through the guarded programming lifecycle.`,`خواندن فراداده از مسیر امن پروگرام آماده می‌شود.`),`caution`,!0),children:h(`Prepare metadata`,`آماده‌سازی فراداده`)}),(0,X.jsx)(w,{icon:oe,disabled:!Dn.trim(),onClick:()=>Fn(`boot backup ${N(Dn.trim())}`,h(`Prepare a backup-only operation to the reviewed destination.`,`عملیات فقط پشتیبان‌گیری در مقصد بازبینی‌شده آماده می‌شود.`),`caution`,!0),children:h(`Prepare backup`,`آماده‌سازی پشتیبان`)}),(0,X.jsx)(w,{icon:oe,disabled:!Dn.trim(),onClick:()=>Fn(`boot read ${N(Dn.trim())}`,h(`Prepare a flash read to the reviewed output file; no flash write command is exposed here.`,`خواندن فلش در فایل بازبینی‌شده آماده می‌شود؛ هیچ فرمان نوشتن فلش در این بخش وجود ندارد.`),`caution`,!0),children:h(`Prepare flash read`,`آماده‌سازی خواندن فلش`)})]})]})]})]}),(0,X.jsxs)(`section`,{id:`advanced-command-review`,className:`advanced-review advanced-review--${Q.risk}`,"aria-live":`polite`,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsx)(`span`,{className:`advanced-review__icon`,children:(0,X.jsx)(pt,{size:19,"aria-hidden":`true`})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`small`,{children:h(`EXPLICIT COMMAND REVIEW`,`بازبینی صریح فرمان`)}),(0,X.jsx)(`h3`,{children:Q.command?h(`Prepared, never implicit`,`آماده، هرگز ضمنی`):h(`No command prepared`,`فرمانی آماده نشده`)})]}),Q.command&&(0,X.jsx)(xe,{tone:Q.risk===`danger`?`bad`:`warn`,children:Q.risk.toUpperCase()})]}),(0,X.jsxs)(`div`,{className:`advanced-review__command`,dir:`ltr`,children:[(0,X.jsx)(`span`,{children:`pc›`}),(0,X.jsx)(`code`,{children:Q.command?Ce(Q.command):h(`Choose a prepare action above.`,`یک فرمان آماده‌سازی را از بالا انتخاب کنید.`)})]}),Q.reason&&(0,X.jsx)(`p`,{children:Q.reason}),Q.risk===`danger`&&(0,X.jsx)(L,{label:h(`Type RUN to arm this reviewed high-impact command`,`برای فعال‌سازی فرمان پراثر، RUN را تایپ کنید`),value:An,dir:`ltr`,autoComplete:`off`,spellCheck:!1,onChange:e=>jn(e.target.value)}),(0,X.jsxs)(`div`,{className:`advanced-review__actions`,children:[(0,X.jsx)(w,{tone:Q.risk===`danger`?`danger`:`primary`,icon:x,disabled:$n,busy:Mn||a===Q.command,onClick:()=>void In(),children:h(`Run reviewed command`,`اجرای فرمان بازبینی‌شده`)}),(0,X.jsx)(w,{icon:Be,disabled:!Q.command||Mn,onClick:()=>{kn({command:``,reason:``,risk:`normal`,needsDevice:!1}),jn(``)},children:h(`Clear`,`پاک‌کردن`)}),Q.needsDevice&&!_&&(0,X.jsx)(`span`,{className:`advanced-review__blocked`,children:h(`Connect an authenticated board before execution.`,`پیش از اجرا یک برد معتبر متصل کنید.`)})]})]}),(0,X.jsxs)(`footer`,{className:`advanced-footnote`,children:[(0,X.jsx)(pt,{size:15,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:h(`Controls reflect implemented protocol paths. Physical peripherals and external services still require live-device acceptance testing.`,`کنترل‌ها بر اساس مسیرهای پیاده‌سازی‌شده پروتکل هستند؛ تجهیزات فیزیکی و سرویس‌های بیرونی همچنان به آزمون پذیرش زنده نیاز دارند.`)})]})]})}function dn(e){let t=[`display`,e.target,`--speed`,`${e.speedMS}ms`,`--duration`,`${e.durationMS}ms`,`--repeat`,e.repeat];return e.repeat===`interval`&&t.push(`--interval`,`${e.intervalMS}ms`),e.scroll&&e.target!==`lcd`&&t.push(`--scroll`),t.push(`--`,N(e.text)),t.join(` `)}var Z=e=>`${e.code}:${e.bits}:${e.protocol}`,fn=(e,t,n=Date.now())=>t&&!!e&&n-Date.parse(e.last_seen)>=0&&n-Date.parse(e.last_seen)<250,pn=class{baseline=new Map;open(e){this.baseline=new Map(e.map(e=>[Z(e),e.received_count]))}count(e){return e?Math.max(0,e.received_count-(this.baseline.get(Z(e))??0)):0}};function mn({snapshot:e,events:n,locale:i,openDialog:a}){let o=(e,t)=>i===`fa`?t:e,[c,d]=(0,B.useState)(),[f,p]=(0,B.useState)([]),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(),[v,ee]=(0,B.useState)(!1),[te,ne]=(0,B.useState)(``),[re,ie]=(0,B.useState)(Date.now()),[y,b]=(0,B.useState)(),ae=(0,B.useRef)(new pn),oe=(0,B.useRef)(!1),se=(0,B.useRef)(0),x=(0,B.useRef)(``),S=(0,B.useRef)(0),ce=async(e=!0)=>{let t=++S.current;try{let n=await T(`controller.rf.catalog`,{read_board:e});if(t!==S.current)return;let r=`${n.host_instance_id}:${n.connection_generation}`,i=!oe.current||x.current!==r;i&&(ae.current.open(n.receptions),oe.current=!0,x.current=r),d(e=>n.entries_sampled?n:{...n,entries:i?[]:e?.entries??[]}),_(e=>i||!e||JSON.stringify(e)===JSON.stringify(c?.preferences)?n.preferences:e),p(e=>n.receptions.map(t=>{let n=i?void 0:e.find(e=>Z(e)===Z(t));return n&&n.connection_generation===t.connection_generation&&n.received_count>t.received_count?n:t})),ne(``)}catch(e){ne(String(e))}};(0,B.useEffect)(()=>(oe.current=!1,se.current=0,ce(),()=>{S.current++}),[e.connection_generation]),(0,B.useEffect)(()=>{let e=n.filter(e=>e.id>se.current);if(!e.length)return;se.current=Math.max(...e.map(e=>e.id));let t=e.filter(e=>e.kind===`rf.receive`&&e.source===`board`&&e.rf_code);t.length&&(p(e=>{let n=new Map(e.map(e=>[Z(e),e]));for(let e of t){let t={code:e.rf_code,bits:e.rf_bits,protocol:e.rf_protocol,pulse_us:e.rf_pulse_us,received_count:Number(e.metadata?.received_count),last_seen:e.time,connection_generation:Number(e.metadata?.connection_generation)};if(!Number.isFinite(t.received_count))continue;let r=n.get(Z(t));(!r||t.received_count>r.received_count)&&n.set(Z(t),t)}return[...n.values()].sort((e,t)=>Date.parse(t.last_seen)-Date.parse(e.last_seen)).slice(0,256)}),ie(Date.now())),e.some(e=>e.kind.startsWith(`rf.learn.`)||e.kind===`rf.preferences.changed`)&&ce(e.some(e=>e.kind===`rf.learn.capture`||e.kind===`rf.learn.mapping-required`||e.kind===`rf.learn.ended`||e.kind===`rf.learn.cancelled`))},[n]),(0,B.useEffect)(()=>{let e=f.map(e=>Date.parse(e.last_seen)+250).filter(e=>e>re);if(!e.length)return;let t=setTimeout(()=>ie(Date.now()),Math.max(1,Math.min(...e)-Date.now()));return()=>clearTimeout(t)},[f,re]);let le=async(e,t={})=>{if(v)return!1;ee(!0);try{return await T(`controller.rf.${e}`,t),await ce(),!0}catch(e){return ne(String(e)),!1}finally{ee(!1)}},C=(0,B.useMemo)(()=>{let e=new Map;for(let t of c?.entries??[])e.set(Z(t),t);for(let t of f)e.has(Z(t))||e.set(Z(t),t);for(let t of c?.bindings??[]){let n={code:t.match.rf_code,bits:t.match.rf_bits,protocol:t.match.rf_protocol};e.has(Z(n))||e.set(Z(n),n)}return[...e.values()]},[c,f]),ue=e.rf_learning?.active??c?.learning?.active,E=c?.board_mapping_options.find(e=>e.action===y?.action),D=e=>[...new Set((c?.bindings??[]).filter(t=>t.match.rf_code===e.code&&t.match.rf_bits===e.bits&&t.match.rf_protocol===e.protocol).flatMap(e=>e.actions.map(t=>{if(t.type===`control`)for(let e of c?.peripherals.controls??[]){let n=e.actions?.find(e=>e.id===t.action_id);if(n)return`${e.name} · ${n.name??t.action_id}`}if(t.type===`board`){let e=(t.command??``).split(/\s+/);if(e.length===3&&e[0]===`pwm`&&/^(?:[0-9]|1[0-5])$/.test(e[2])){let t=c?.peripherals.controls.find(t=>t.key===`pwm.${e[2]}`);if(t)return`${t.name} · ${e[1]}`}}return e.name})))];return(0,X.jsxs)(j,{icon:l,iconTone:`violet`,title:o(`RF controls`,`کنترل RF`),action:(0,X.jsx)(w,{tone:`ghost`,icon:fe,"aria-label":o(`RF settings`,`تنظیمات RF`),onClick:()=>h(!m)}),children:[te&&(0,X.jsx)(`div`,{role:`alert`,className:`inline-error`,children:te}),(0,X.jsxs)(`div`,{className:`rf-manager__toolbar`,children:[ue?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(xe,{tone:`info`,children:o(`Learning`,`یادگیری`)}),(0,X.jsx)(w,{icon:ht,busy:v,onClick:()=>void le(`learn.cancel`),children:o(`Stop learning`,`توقف یادگیری`)})]}):(0,X.jsx)(w,{icon:r,busy:v,disabled:!e.connected,onClick:()=>void le(`learn.start`),children:o(`Learn buttons`,`یادگیری دکمه‌ها`)}),(0,X.jsx)(w,{tone:`ghost`,icon:t,"aria-label":o(`Refresh learned buttons`,`تازه‌سازی دکمه‌ها`),disabled:v||!e.connected,onClick:()=>void ce()})]}),m&&g&&(0,X.jsxs)(`div`,{className:`rf-manager__settings`,children:[(0,X.jsx)(P,{label:o(`Timed learning`,`یادگیری زمان‌دار`),checked:g.timed,disabled:v,onChange:e=>_({...g,timed:e})}),(0,X.jsx)(I,{label:o(`Timeout`,`مهلت`),min:1,max:120,step:1,unit:`s`,value:g.timeout_seconds,disabled:v,onChange:e=>_({...g,timeout_seconds:e})}),(0,X.jsx)(P,{label:o(`Continuously learn buttons`,`یادگیری پیوستهٔ دکمه‌ها`),checked:g.continuous,disabled:v,onChange:e=>_({...g,continuous:e})}),(0,X.jsx)(w,{icon:u,busy:v,disabled:JSON.stringify(g)===JSON.stringify(c?.preferences),onClick:()=>void le(`preferences.set`,g),children:o(`Save settings`,`ذخیرهٔ تنظیمات`)})]}),(0,X.jsx)(`div`,{className:`rf-manager__list`,children:C.map(t=>{let n=f.find(e=>Z(e)===Z(t)),i=fn(n,e.connected,re),c=t.id!==void 0;return(0,X.jsxs)(`div`,{className:`rf-manager__row`,children:[(0,X.jsx)(`span`,{className:`rf-receive-indicator${i?` is-on`:``}`,role:`img`,"aria-label":i?o(`Receiving`,`در حال دریافت`):o(`Not receiving`,`دریافت نمی‌شود`)}),(0,X.jsxs)(`span`,{className:`rf-receive-count`,title:o(`Receptions since this view opened`,`دریافت‌ها از باز شدن این نما`),children:[`×`,ae.current.count(n)]}),(0,X.jsxs)(`div`,{className:`rf-manager__identity${c?``:` is-unlearned`}`,children:[(0,X.jsx)(`strong`,{children:t.name||`0x${t.code.toString(16).toUpperCase()}`}),(0,X.jsxs)(`small`,{children:[t.bits,` bits · `,o(`Protocol`,`پروتکل`),` `,t.protocol,t.board_assignment&&` · ${o(`On board`,`روی برد`)}: ${t.board_assignment.label}`]}),D(t).map(e=>(0,X.jsx)(`small`,{children:e},e))]}),(0,X.jsx)(`div`,{className:`rf-manager__actions`,children:c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(w,{tone:`ghost`,icon:fe,disabled:v,"aria-label":o(`Edit board assignment`,`ویرایش نگاشت برد`),onClick:()=>b({id:t.id,action:t.board_assignment?.action??`none`,target:t.board_assignment?.target,behavior:t.board_assignment?.behavior})}),(0,X.jsx)(w,{tone:`ghost`,icon:s,disabled:v,"aria-label":o(`Remove learned button`,`حذف دکمهٔ آموخته`),onClick:()=>{a({open:!0,tone:`danger`,title:o(`Remove learned RF button?`,`دکمهٔ آموخته حذف شود؟`),body:t.code_display??`0x${t.code.toString(16)}`,confirmLabel:o(`Remove`,`حذف`),action:async()=>{await le(`remove`,{id:t.id})}})}})]}):(0,X.jsx)(w,{icon:r,disabled:v||!n||ue,onClick:()=>void le(`observed.add`,{code:t.code,bits:t.bits,protocol:t.protocol}),children:o(`Add`,`افزودن`)})})]},Z(t))})}),y&&(0,X.jsxs)(`div`,{className:`rf-manager__settings`,children:[(0,X.jsx)(`select`,{"aria-label":o(`Board action`,`عمل برد`),value:y.action,onChange:e=>b({id:y.id,action:e.target.value}),children:c?.board_mapping_options.map(e=>(0,X.jsx)(`option`,{value:e.action,children:e.action},e.action))}),!!E?.targets.length&&(0,X.jsxs)(`select`,{"aria-label":o(`Target`,`هدف`),value:y.target??``,onChange:e=>b({...y,target:e.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:`—`}),E.targets.map(e=>(0,X.jsx)(`option`,{value:e,children:c?.peripherals.controls.find(t=>t.key===`${y.action===`pwm`?`pwm`:y.action===`side`?`seat`:`relay`}.${e}`)?.name??e},e))]}),!!E?.behaviors.length&&(0,X.jsxs)(`select`,{"aria-label":o(`Behavior`,`رفتار`),value:y.behavior??``,onChange:e=>b({...y,behavior:e.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:`—`}),E.behaviors.map(e=>(0,X.jsx)(`option`,{value:e,children:E.behavior_labels?.[e]??e},e))]}),(0,X.jsx)(w,{icon:u,busy:v,disabled:!!E?.targets.length&&!y.target||!!E?.behaviors.length&&!y.behavior,onClick:()=>void le(`map`,y).then(e=>{e&&b(void 0)}),children:o(`Save on board`,`ذخیره روی برد`)}),(0,X.jsx)(w,{tone:`ghost`,onClick:()=>b(void 0),children:o(`Cancel`,`لغو`)})]})]})}function hn(e){if(/^#[0-9a-f]{6}$/i.test(e?.trim()??``))return e.trim().toUpperCase();switch(e?.trim().toLowerCase()){case`blue`:return`blue`;case`violet`:return`violet`;case`green`:return`green`;case`white`:return`white`;default:return`red`}}function gn(e){let t=e.repeat_count??1,n=0;for(let t of e.steps??[]){let e=t.repeat_count??1,r=t.repeat_interval_ms??0,i=t.duration_ms??0;if(!Number.isInteger(e)||e<1||e>1e3||!Number.isInteger(r)||r<0||r>36e5)return;let a=(t.at_us??0)+i*1e3+(e-1)*(r===0?Math.max(i,1):r)*1e3;n=Math.max(n,a)}let r=e.repeat_interval_ms??0,i=r===0?n:r*1e3,a=n+(t-1)*i;if(!(!Number.isInteger(t)||t<1||t>1e3||!Number.isInteger(r)||r<0||r>36e5||i2147483647||t>1&&i===0||!Number.isInteger(a)||a<0||a>2147483647))return a}function _n(e,t){e??=0;let n=Math.abs(e);return n>=1e6?`${(e/1e6).toLocaleString(t,{maximumFractionDigits:3})} s`:n>=1e3?`${(e/1e3).toLocaleString(t,{maximumFractionDigits:3})} ms`:`${e.toLocaleString(t)} µs`}function vn({macros:e,selectedReference:t,locale:n,onSelect:r}){let i=n===`fa`;return e.length?(0,X.jsx)(`div`,{className:`macro-library__catalog`,role:`listbox`,"aria-label":i?`کتابخانه جلوه‌ها`:`Effect library`,children:e.map(e=>{let a=t===String(e.id),o=gn(e);return(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":a,className:a?`is-selected`:``,onClick:()=>r(e),children:[(0,X.jsx)(`span`,{className:`macro-library__color is-${hn(e.color)}`,style:e.color?.startsWith(`#`)?{backgroundColor:hn(e.color)}:void 0,"aria-hidden":`true`}),(0,X.jsxs)(`span`,{className:`macro-library__identity`,children:[(0,X.jsx)(`strong`,{children:e.name}),(0,X.jsxs)(`small`,{children:[`#`,e.id,` · `,e.category||(i?`بدون دسته`:`Uncategorized`),` · `,e.mode||`auto`]})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:(e.steps?.length??0).toLocaleString(n)}),(0,X.jsx)(`small`,{children:i?`گام`:`steps`})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:o===void 0?i?`زمان‌بندی نامعتبر`:`Invalid timing`:_n(o,n)}),(0,X.jsx)(`small`,{children:i?`مدت`:`duration`})]})]},e.id)})}):(0,X.jsx)(`div`,{className:`macro-library__empty`,children:i?`هنوز جلوهٔ ضبط‌شده‌ای وجود ندارد.`:`No recorded effects yet.`})}function yn({online:e,locale:t,events:n,initialSnapshot:i,stripEffects:a=[],commandSurface:o}){let c=t===`fa`,l=(e,t)=>c?t:e,d=l(`Choose recording channels with effect record start-json in Console. The recording chooser is not available yet.`,`کانال‌های ضبط را با فرمان effect record start-json در کنسول انتخاب کنید. انتخاب‌گر ضبط هنوز آماده نیست.`),[f,p]=(0,B.useState)(i??null),[m,h]=(0,B.useState)(i?`ready`:`loading`),[_,v]=(0,B.useState)(``),[ee,te]=(0,B.useState)(``),[ne,re]=(0,B.useState)(``),[ie,y]=(0,B.useState)(0),[b,ae]=(0,B.useState)(``),[oe,se]=(0,B.useState)(`Web`),[x,S]=(0,B.useState)(`green`),[ce,le]=(0,B.useState)(`auto`),[C,ue]=(0,B.useState)(``),[E,D]=(0,B.useState)(null),O=(0,B.useRef)(i?.latest_event_id??0),de=(0,B.useCallback)(async(e=!1)=>{e||v(`controller.macro.snapshot`);try{let e=(await T(`controller.snapshot`)).macros;return p(e),h(`ready`),te(``),O.current=Math.max(O.current,e.latest_event_id||0),e}catch(e){return h(`error`),te(e instanceof Error?e.message:String(e)),null}finally{e||v(``)}},[t]);(0,B.useEffect)(()=>{de()},[de]),(0,B.useEffect)(()=>{let e=n.filter(e=>e.id>O.current).sort((e,t)=>e.id-t.id);if(!e.length||(O.current=e[e.length-1].id,p(t=>e.reduce((e,t)=>e&&pe(e,t),t)),!e.some(be)))return;let t=window.setTimeout(()=>{de(!0)},60);return()=>window.clearTimeout(t)},[n,de]);let k=(0,B.useMemo)(()=>f?.library.find(e=>String(e.id)===ne),[ne,f?.library]),A=(0,B.useMemo)(()=>a.find(e=>e.id===C),[C,a]);(0,B.useEffect)(()=>{if(!f)return;!ne&&f.library.length&&re(String(f.library[0].id));let e=new Set(f.library.map(e=>e.id)),t=0;for(;t<255&&e.has(t);)t+=1;y(n=>e.has(n)?t:n)},[ne,f]),(0,B.useEffect)(()=>{k&&(ae(k.name),se(k.category||``),S(hn(k.color)))},[k?.category,k?.color,k?.id,k?.name]),(0,B.useEffect)(()=>{!C&&a.length&&ue(a[0].id)},[C,a]),(0,B.useEffect)(()=>{A&&D({...A})},[A]);let j=e=>re(String(e.id)),M=async(e,t,n)=>{v(e),te(``);try{await o(n),await de(!0)}catch(e){te(e instanceof Error?e.message:String(e))}finally{v(``)}},fe=ne||b.trim(),P=f?.recording,F=f?.playback,he=n.slice(0,7);return(0,X.jsxs)(`div`,{className:`macro-library`,children:[(0,X.jsxs)(`div`,{className:`macro-library__monitor`,"aria-live":`polite`,children:[(0,X.jsxs)(`div`,{className:P?.active?`is-active`:``,children:[(0,X.jsx)(Me,{"aria-hidden":`true`,size:17}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`small`,{children:l(`RECORDING`,`ضبط`)}),(0,X.jsx)(`strong`,{children:P?.active?P.name||`#${P.id}`:l(`Idle`,`آماده`)}),(0,X.jsx)(`em`,{children:P?.active?`${P.device_retained?l(`Device-retained take`,`برداشت نگه‌داری‌شده در دستگاه`):l(`Live capture`,`ضبط زنده`)} · ${P.steps} ${l(`steps`,`گام`)} · Δ ${_n(P.last_delta_us,t)}`:P?.name||``})]})]}),(0,X.jsxs)(`div`,{className:F?.running?`is-active`:``,children:[(0,X.jsx)(at,{"aria-hidden":`true`,size:17}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`small`,{children:l(`PLAYBACK`,`اجرا`)}),(0,X.jsx)(`strong`,{children:F?.name||l(`Idle`,`آماده`)}),(0,X.jsx)(`em`,{children:F?.name?`${F.lifecycle||`idle`} · ${F.policy||`auto`} → ${F.mode||`pending`} · ${F.step}/${F.step_count} · Δ ${_n(F.last_timing_delta_us,t)}`:l(`No playback in this session`,`هنوز اجرایی در این نشست انجام نشده`)})]})]}),(0,X.jsx)(xe,{tone:m===`error`?`warn`:m===`ready`?`good`:`info`,children:m===`error`?l(`UNAVAILABLE`,`در دسترس نیست`):m===`ready`?l(`LIVE`,`زنده`):l(`LOADING`,`در حال بارگذاری`)})]}),ee&&(0,X.jsx)(`div`,{className:`macro-library__error`,role:`alert`,children:ee}),P?.last_error&&(0,X.jsx)(`div`,{className:`macro-library__error`,role:`alert`,children:P.last_error}),!!P?.overwritten&&(0,X.jsx)(`div`,{className:`macro-library__error`,role:`status`,children:l(`Ring wrapped: ${P.overwritten} earlier snapshots overwritten. Saved profile contains the retained tail.`,`حافظه حلقوی پر شد: ${P.overwritten} وضعیت پیشین جایگزین شد. پروفایل شامل بخش پایانی باقی‌مانده است.`)}),(0,X.jsxs)(`div`,{className:`macro-library__workspace`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Ie,{size:15}),` `,l(`Library`,`کتابخانه`)]}),(0,X.jsx)(`small`,{children:f?.library.length??0})]}),(0,X.jsx)(vn,{macros:f?.library??[],selectedReference:ne,locale:t,onSelect:j})]}),(0,X.jsxs)(`section`,{className:`macro-library__editor`,children:[(0,X.jsx)(`header`,{children:(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Je,{size:15}),` `,k?l(`Selected timed effect`,`جلوهٔ زمان‌بندی‌شدهٔ انتخابی`):l(`New timed effect`,`جلوهٔ زمان‌بندی‌شدهٔ جدید`)]})}),(0,X.jsxs)(`div`,{className:`macro-library__fields`,children:[(0,X.jsx)(L,{label:l(`ID 0..255`,`شناسه ۰ تا ۲۵۵`),type:`number`,min:0,max:255,value:k?k.id:ie,disabled:!!k,onChange:e=>y(Math.max(0,Math.min(255,Number(e.target.value)||0)))}),(0,X.jsx)(L,{label:l(`Name`,`نام`),value:b,maxLength:64,onChange:e=>ae(e.target.value)}),(0,X.jsx)(L,{label:l(`Category`,`دسته‌بندی`),value:oe,maxLength:64,onChange:e=>se(e.target.value)})]}),(0,X.jsxs)(`div`,{className:`macro-library__color-picker`,children:[(0,X.jsx)(`label`,{children:l(`Color`,`رنگ`)}),(0,X.jsx)(me,{value:x,label:l(`Effect color`,`رنگ جلوه`),options:[{value:`red`,label:l(`Red`,`قرمز`)},{value:`blue`,label:l(`Blue`,`آبی`)},{value:`violet`,label:l(`Violet`,`بنفش`)},{value:`green`,label:l(`Green`,`سبز`)},{value:`white`,label:l(`White`,`سفید`)},{value:x.startsWith(`#`)?x:`#38D27A`,label:l(`Custom`,`سفارشی`)}],onChange:S}),x.startsWith(`#`)&&(0,X.jsx)(`input`,{type:`color`,"aria-label":l(`Custom color`,`رنگ سفارشی`),value:x,onChange:e=>S(e.target.value.toUpperCase())})]}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[!k&&(0,X.jsx)(w,{icon:r,disabled:!b.trim(),busy:_===`controller.macro.create`,onClick:()=>void M(`controller.macro.create`,{id:ie,name:b.trim(),category:oe.trim(),color:x},`effect create sequence ${ie} ${N(b.trim())} ${N(oe.trim())} ${N(x)}`),children:l(`Create draft`,`ساخت پیش‌نویس`)}),k&&(0,X.jsx)(w,{icon:u,disabled:!b.trim(),busy:_===`controller.macro.update`,onClick:()=>void M(`controller.macro.update`,{reference:fe,name:b.trim(),category:oe.trim(),color:x},`effect update ${N(fe)} ${N(b.trim())} ${N(oe.trim())} ${N(x)}`),children:l(`Save metadata`,`ذخیره مشخصات`)}),k&&(0,X.jsx)(w,{tone:`danger`,icon:s,busy:_===`controller.macro.delete`,onClick:()=>void M(`controller.effect.delete`,{reference:fe},`effect delete ${N(fe)}`),children:l(`Delete`,`حذف`)}),k&&(0,X.jsx)(w,{tone:`ghost`,onClick:()=>{re(``),ae(``),se(`Web`),S(`green`)},children:l(`New`,`جدید`)})]})]})]}),(0,X.jsxs)(`section`,{className:`macro-library__strip-effects`,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(g,{size:15}),` `,l(`Lighting effects`,`جلوه‌های نورپردازی`)]}),(0,X.jsx)(`small`,{children:a.length})]}),(0,X.jsxs)(`div`,{className:`macro-library__workspace`,children:[(0,X.jsxs)(`div`,{className:`macro-library__catalog`,role:`listbox`,"aria-label":l(`Lighting effects`,`جلوه‌های نورپردازی`),children:[a.map(e=>(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.id===C,className:e.id===C?`is-selected`:``,onClick:()=>ue(e.id),children:[(0,X.jsx)(`span`,{className:`macro-library__color is-violet`,"aria-hidden":`true`}),(0,X.jsxs)(`span`,{className:`macro-library__identity`,children:[(0,X.jsx)(`strong`,{children:e.name}),(0,X.jsxs)(`small`,{children:[e.category||l(`Uncategorized`,`بدون دسته`),` · `,e.engine]})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:e.default_fps}),(0,X.jsx)(`small`,{children:`FPS`})]}),(0,X.jsxs)(`span`,{className:`macro-library__measure`,children:[(0,X.jsx)(`strong`,{children:e.default_pixels}),(0,X.jsx)(`small`,{children:l(`LEDs`,`LED`)})]})]},e.id)),!a.length&&(0,X.jsx)(`div`,{className:`macro-library__empty`,children:l(`No lighting effects.`,`جلوهٔ نورپردازی وجود ندارد.`)})]}),(0,X.jsxs)(`div`,{className:`macro-library__editor`,children:[(0,X.jsx)(`header`,{children:(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Je,{size:15}),` `,E?.id?l(`Effect properties`,`ویژگی‌های جلوه`):l(`New lighting effect`,`جلوه نور جدید`)]})}),E&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`macro-library__fields`,children:[(0,X.jsx)(L,{label:l(`Stable ID`,`شناسه پایدار`),value:E.id,disabled:!!A,onChange:e=>D({...E,id:e.target.value})}),(0,X.jsx)(L,{label:l(`Name`,`نام`),value:E.name,maxLength:64,onChange:e=>D({...E,name:e.target.value})}),(0,X.jsx)(L,{label:l(`Category`,`دسته‌بندی`),value:E.category||``,maxLength:64,onChange:e=>D({...E,category:e.target.value})}),(0,X.jsx)(L,{label:l(`Description`,`توضیح`),value:E.description||``,maxLength:64,onChange:e=>D({...E,description:e.target.value})}),(0,X.jsx)(L,{label:l(`Frames / second`,`فریم در ثانیه`),type:`number`,min:1,max:30,value:E.default_fps,onChange:e=>D({...E,default_fps:Number(e.target.value)})}),(0,X.jsx)(L,{label:l(`Duration (ms)`,`مدت (میلی‌ثانیه)`),type:`number`,min:100,max:36e5,value:E.default_duration_ms,onChange:e=>D({...E,default_duration_ms:Number(e.target.value)})}),(0,X.jsx)(L,{label:l(`LED count`,`تعداد LED`),type:`number`,min:1,max:100,value:E.default_pixels,onChange:e=>D({...E,default_pixels:Number(e.target.value)})})]}),(0,X.jsx)(me,{value:E.program.primitive,label:l(`Program`,`برنامه`),options:[{value:`alternating-zones`,label:l(`Alternating zones`,`ناحیه‌های متناوب`)},{value:`envelope`,label:l(`Brightness envelope`,`پوش شدت نور`)},{value:`converging-points`,label:l(`Converging points`,`نقاط همگرا`)}],onChange:e=>D({...E,program:{...E.program,primitive:e}})}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[(0,X.jsx)(w,{tone:`primary`,icon:at,disabled:!e||!A,onClick:()=>void M(`controller.effect.play`,{},`effect play ${N(E.id)}`),children:l(`Run`,`اجرا`)}),A?(0,X.jsx)(w,{icon:u,disabled:!E.name.trim(),onClick:()=>void M(`controller.effect.update`,{},`effect update ${N(E.id)} ${N(E.name.trim())} ${N((E.category||``).trim())} ${N((E.description||``).trim()||`-`)} ${N(E.program.primitive)} ${E.default_fps} ${E.default_duration_ms} ${E.default_pixels}`),children:l(`Save to PCController`,`ذخیره در PCController`)}):(0,X.jsx)(w,{icon:r,disabled:!E.id.trim()||!E.name.trim(),onClick:()=>void M(`controller.effect.create`,{},`effect create strip ${N(E.id.trim())} ${N(E.name.trim())} ${N(E.program.primitive)} ${N((E.category||``).trim())} ${E.default_fps} ${E.default_duration_ms} ${E.default_pixels}`),children:l(`Create in PCController`,`ساخت در PCController`)}),A&&(0,X.jsx)(w,{tone:`danger`,icon:s,onClick:()=>void M(`controller.effect.delete`,{},`effect delete ${N(E.id)}`),children:l(`Delete`,`حذف`)}),(0,X.jsx)(w,{tone:`ghost`,onClick:()=>{ue(``),D({id:``,name:``,category:`Lighting`,description:``,program:{primitive:`alternating-zones`,primary:{red:255,green:0,blue:0},secondary:{red:0,green:0,blue:255},period_ms:800,step_ms:100,swap_after_steps:4,dim_intensity:36},engine:`host-stream`,editable:!0,default_fps:20,default_duration_ms:5e3,default_pixels:100,min_pixels:1,max_pixels:100,min_fps:1,max_fps:30})},children:l(`New`,`جدید`)})]})]})]})]})]}),k&&(k.steps?.length??0)>0&&(0,X.jsxs)(`details`,{className:`macro-library__steps`,children:[(0,X.jsxs)(`summary`,{children:[l(`Exact step timing`,`زمان‌بندی دقیق گام‌ها`),` · `,k.steps?.length??0]}),(0,X.jsx)(`div`,{role:`table`,children:(k.steps??[]).map((e,n,r)=>{let i=n?r[n-1].at_us??0:0,a=e.at_us??0;return(0,X.jsxs)(`div`,{role:`row`,children:[(0,X.jsxs)(`span`,{children:[`#`,n+1]}),(0,X.jsx)(`strong`,{children:e.kind}),(0,X.jsx)(`span`,{children:_n(a,t)}),(0,X.jsxs)(`span`,{children:[`Δ `,_n(a-i,t)]}),(0,X.jsx)(`code`,{children:e.text||`target=${e.target??0} value=${e.value??0}`})]},`${n}-${a}-${e.kind}`)})})]}),(0,X.jsxs)(`div`,{className:`macro-library__control-grid`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`header`,{children:l(`Host recording`,`ضبط میزبان`)}),(0,X.jsx)(`p`,{role:`status`,children:d}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[(0,X.jsx)(w,{tone:`primary`,icon:Me,disabled:!0,title:d,"data-capture-selection":`unavailable`,children:l(`Start`,`شروع`)}),(0,X.jsx)(w,{icon:u,disabled:!P?.active||!!P.device_retained,busy:_===`controller.macro.record.stop`,onClick:()=>void M(`controller.macro.record.stop`,{save:!0},`effect record save`),children:l(`Stop + save`,`توقف و ذخیره`)}),(0,X.jsx)(w,{icon:s,disabled:!P?.active||!!P.device_retained,onClick:()=>void M(`controller.macro.record.stop`,{save:!1},`effect record discard`),children:l(`Discard`,`دور انداختن`)})]})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`header`,{children:l(`Device-retained recording`,`ضبط نگه‌داری‌شده در دستگاه`)}),(0,X.jsx)(`p`,{children:l(`Keeps the latest 25 relay snapshots in RAM. Save before resetting the board. Stop and release retained RAM before strip streaming.`,`۲۵ وضعیت آخر رله در حافظه نگهداری می‌شود. پیش از ریست ذخیره کنید. قبل از پخش نوار، ضبط را متوقف و حافظه را آزاد کنید.`)}),(0,X.jsxs)(`div`,{className:`macro-library__actions`,children:[(0,X.jsx)(w,{icon:lt,disabled:!0,title:d,"data-capture-selection":`unavailable`,children:l(`Start retained take`,`شروع برداشت نگه‌داری‌شده`)}),(0,X.jsx)(w,{icon:Ie,disabled:!0,title:d,"data-capture-selection":`unavailable`,children:l(`Import retained capture`,`وارد کردن ضبط باقی‌مانده`)}),(0,X.jsx)(w,{icon:u,disabled:!P?.active||!P.device_retained,busy:_===`controller.macro.board_record.stop`,onClick:()=>void M(`controller.macro.board_record.stop`,{},`effect record save`),children:l(`Stop + import`,`توقف و واردکردن`)}),(0,X.jsx)(w,{tone:`danger`,icon:s,disabled:!P?.active||!P.device_retained,onClick:()=>void M(`controller.macro.board_record.discard`,{},`effect record discard`),children:l(`Discard`,`دور انداختن`)}),(0,X.jsx)(w,{icon:s,disabled:!e||!!P?.active||!!F?.running,onClick:()=>void M(`controller.macro.buffer.clear`,{},`effect buffer clear`),children:l(`Release board RAM for strip`,`آزاد کردن حافظه برد برای نوار`)})]})]})]}),(0,X.jsxs)(`div`,{className:`macro-library__playback-actions`,children:[(0,X.jsx)(me,{value:ce,label:l(`Execution`,`اجرا`),options:[{value:`auto`,label:l(`Automatic`,`خودکار`)},{value:`host`,label:l(`Host (forced)`,`میزبان (اجباری)`)},{value:`mcu`,label:l(`Device (forced)`,`دستگاه (اجباری)`)}],onChange:le}),(0,X.jsx)(w,{tone:`primary`,icon:at,disabled:!e||!fe,busy:_===`controller.macro.play`,onClick:()=>void M(`controller.effect.play`,{reference:fe},`effect play ${N(fe)} ${ce}`),children:l(`Play selected`,`اجرای انتخاب‌شده`)}),(0,X.jsx)(w,{icon:Pe,disabled:!e||!F?.running,busy:_===`controller.macro.cancel`,onClick:()=>void M(`controller.macro.cancel`,{keep_outputs:!1},`effect cancel`),children:l(`Cancel + turn outputs off`,`لغو و خاموش‌کردن خروجی‌ها`)}),(0,X.jsx)(w,{tone:`danger`,icon:Pe,disabled:!e||!F?.running,onClick:()=>void M(`controller.macro.cancel`,{keep_outputs:!0},`effect cancel keep`),children:l(`Cancel, keep outputs`,`لغو با حفظ خروجی‌ها`)})]}),(0,X.jsxs)(`section`,{className:`macro-library__events`,"aria-label":l(`Live effect monitor`,`پایش زنده جلوه`),children:[(0,X.jsx)(`header`,{children:l(`Live structured monitor`,`پایش زنده ساختاریافته`)}),he.length?he.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`time`,{children:new Date(e.time).toLocaleTimeString(t)}),(0,X.jsx)(`strong`,{children:e.kind}),(0,X.jsx)(`span`,{children:e.lifecycle||e.state||e.text}),e.metadata?.delta_us&&(0,X.jsxs)(`code`,{children:[`Δ `,e.metadata.delta_us,` µs`]}),e.metadata?.mcu_delta_us&&(0,X.jsxs)(`code`,{children:[`Δ `,e.metadata.mcu_delta_us,` µs`]})]},e.id)):(0,X.jsx)(`p`,{children:l(`Waiting for effect events.`,`در انتظار رویدادهای جلوه.`)})]})]})}function bn(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.name==`string`?t.name.trim():``;if(!n||!Array.isArray(t.notes))return[];let r=t.notes.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=Number(t.frequency_hz),r=Number(t.duration_ms),i=t.gap_ms===void 0?0:Number(t.gap_ms),a=n===0||n>=20&&n<=2e4;return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!a||r<1||r>5e3||i<0||i>5e3?[]:[{frequency_hz:Math.round(n),duration_ms:Math.round(r),gap_ms:Math.round(i)}]});return r.length===t.notes.length?[{name:n,notes:r}]:[]}):[]}function xn(e,t){let n=e.notes.reduce((e,t)=>e+t.duration_ms+(t.gap_ms??0),0);return t===`fa`?`${e.notes.length} نت · ${n} میلی‌ثانیه`:`${e.notes.length} notes · ${n} ms`}function Sn(e){if(!Array.isArray(e))return[];let t=new Set;return e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let n=e,r=typeof n.name==`string`?n.name.trim().toLowerCase():``,i=typeof n.usage==`string`?n.usage.trim():``,a=typeof n.summary==`string`?n.summary.trim():``,o=typeof n.group==`string`?n.group.trim():``;if(!r||!i||!a||!o||t.has(r))return[];let s=Array.isArray(n.aliases)?[...new Set(n.aliases.flatMap(e=>typeof e==`string`&&e.trim()?[e.trim().toLowerCase()]:[]))]:[];return t.add(r),[{name:r,aliases:s,usage:i,summary:a,group:o}]})}function Cn(e){let t=new Set,n=[];for(let r of e.usage.match(/[A-Za-z][A-Za-z0-9_-]*/g)??[]){let i=r.toLowerCase();r!==i||i===e.name||t.has(i)||(t.add(i),n.push(i))}return n}function wn(e,t,n=10){let r=e.match(/^\s*/)?.[0]??``,i=e.slice(r.length);if(!i)return[];let a=i.search(/\s/);if(a<0){let e=i.toLowerCase();return t.filter(t=>[t.name,...t.aliases??[]].some(t=>t.toLowerCase().startsWith(e))).slice(0,n).map(e=>({value:`${r}${e.name} `,label:e.name,detail:`${e.usage} — ${e.summary}`}))}let o=i.slice(0,a).toLowerCase(),s=t.find(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase()===o));if(!s)return[];let c=Math.max(e.lastIndexOf(` `),e.lastIndexOf(` `))+1,l=e.slice(c).toLowerCase();return Cn(s).filter(e=>e.startsWith(l)&&e!==l).slice(0,n).map(t=>({value:`${e.slice(0,c)}${t} `,label:t,detail:s.usage}))}var Tn=class{limit;entries=[];cursor=0;draft=``;constructor(e=100){this.limit=e}record(e){let t=e.trim();t&&this.entries[this.entries.length-1]!==t&&(this.entries.push(t),this.entries.length>this.limit&&this.entries.splice(0,this.entries.length-this.limit)),this.cursor=this.entries.length,this.draft=``}edited(e){this.cursor=this.entries.length,this.draft=e}move(e,t){return this.entries.length?(this.cursor===this.entries.length&&(this.draft=t),this.cursor=Math.max(0,Math.min(this.entries.length,this.cursor+e)),this.cursor===this.entries.length?this.draft:this.entries[this.cursor]):t}values(){return[...this.entries]}},En=0,Dn=[`terminal`,`displays`,`status-lighting`,`audio`,`radio`,`macros`,`automations`,`i2c`,`host-control`,`firmware`];function On(e,t=`log`,n){return{id:n??`terminal-${++En}`,kind:`text`,text:e,level:t}}function Q({tokens:e}){return(0,X.jsx)(X.Fragment,{children:e.map((e,t)=>(0,X.jsx)(`span`,{className:`console-token console-token--${e.kind===`value`?e.valueType:`text`}`,style:e.style,children:e.text},`${t}-${e.text}`))})}function kn({entry:e,locale:t}){if(e.hidden)return null;let n={"--console-indent":`${e.depth*16}px`};return e.kind===`table`?(0,X.jsxs)(`div`,{className:`console-record console-record--table`,style:n,"data-level":`log`,children:[(0,X.jsxs)(`table`,{children:[(0,X.jsx)(`thead`,{children:(0,X.jsx)(`tr`,{children:e.columns.map(e=>(0,X.jsx)(`th`,{children:e},e))})}),(0,X.jsx)(`tbody`,{children:e.rows.map(t=>(0,X.jsx)(`tr`,{children:e.columns.map(e=>(0,X.jsx)(`td`,{children:(0,X.jsx)(Q,{tokens:t.cells[e]??[]})},e))},t.key))})]}),(e.omittedRows>0||e.omittedColumns>0)&&(0,X.jsx)(`small`,{children:t===`fa`?`${e.omittedRows} ردیف و ${e.omittedColumns} ستون نمایش داده نشد`:`${e.omittedRows} rows and ${e.omittedColumns} columns omitted`})]}):(0,X.jsxs)(`div`,{className:`console-record console-record--${e.kind}`,style:n,"data-level":e.level,children:[e.kind===`group`&&(0,X.jsx)(`span`,{className:`console-group-mark`,children:e.collapsed?`▸`:`▾`}),(0,X.jsx)(Q,{tokens:e.tokens})]})}function An(e){if(e.kind===`table`){console.table(e.rows.map(t=>Object.fromEntries(e.columns.map(e=>[e,Ut(t.cells[e]??[])]))));return}if(e.kind===`group`){console[e.collapsed?`groupCollapsed`:`group`](...Gt(e.tokens));return}let t=e.level===`error`?`error`:e.level===`warn`?`warn`:e.level===`debug`?`debug`:e.level===`info`?`info`:`log`;console[t](...Gt(e.tokens))}function jn(e){return e.kind===`table`?`console.table: ${e.rows.length} rows × ${e.columns.length} columns`:Ut(e.tokens)}function Mn(t){let{events:n,locale:r,t:a,command:s,snapshot:c,transport:l,relayedTerminal:u}=t,f=r===`fa`,p=(e,t)=>f?t:e,[g,y]=(0,B.useState)(``),[oe,S]=(0,B.useState)([]),[C,O]=(0,B.useState)(!1),[A,pe]=(0,B.useState)(``),[F,he]=(0,B.useState)([]),[ge,be]=(0,B.useState)(!1),[Se,Te]=(0,B.useState)(0),[R,Ee]=(0,B.useState)(`both`),[De,Oe]=(0,B.useState)(220),[ke,je]=(0,B.useState)(5e3),[Me,Ne]=(0,B.useState)(`once`),[Fe,Ie]=(0,B.useState)(3e4),[Le,Re]=(0,B.useState)(!1),[ze,Ve]=(0,B.useState)(`READY`),[He,Ue]=(0,B.useState)(880),[We,Ge]=(0,B.useState)(120),[Ke,qe]=(0,B.useState)(``),[Je,Ye]=(0,B.useState)([]),[Xe,z]=(0,B.useState)(`loading`),[Qe,et]=(0,B.useState)(38),[nt,rt]=(0,B.useState)(210),[it,ot]=(0,B.useState)(220),[st,ct]=(0,B.useState)(180),[lt,ut]=(0,B.useState)(``),[ft,pt]=(0,B.useState)(60),[mt,ht]=(0,B.useState)(!1),[gt,vt]=(0,B.useState)(()=>ee(`workbench`,Dn)),[bt,xt]=(0,B.useState)(null),V=(0,B.useRef)(null),H=(0,B.useRef)(n.reduce((e,t)=>Math.max(e,t.id),0)),St=(0,B.useRef)(new Set),Ct=(0,B.useRef)(new $t({maxEntries:240})),U=(0,B.useRef)(new Tn),wt=R===`segments`?40:32,Tt=ze.length>0&&ze.length<=wt&&/^[\x20-\x7e]*$/.test(ze),W=_e(c),Dt=!!c.front_panel?.tm1637_detection_known,Ot=!!c.front_panel?.tm1637_detected,G=l.boardState===`ready`&&c.connected&&c.have_status,kt=M(c),K=wn(g,F),At=Math.min(Se,Math.max(0,K.length-1)),jt=[{value:`segments`,label:p(`Segments`,`سون‌سگمنت`)},...W.lcd?[{value:`lcd`,label:`LCD`},{value:`both`,label:p(`Both`,`هر دو`)}]:[]];(0,B.useEffect)(()=>{!W.lcd&&R!==`segments`&&Ee(`segments`)},[W.lcd,R]),(0,B.useEffect)(()=>{let e=new AbortController;return he([]),T(`controller.command.catalog`,{},e.signal).then(t=>{e.signal.aborted||he(Sn(t))}).catch(()=>{e.signal.aborted||he([])}),()=>e.abort()},[l.authenticationRequired,l.streamState]),(0,B.useEffect)(()=>{let e=new AbortController;return z(`loading`),T(`controller.melodies.list`,{},e.signal).then(t=>{if(e.signal.aborted)return;let n=bn(t);Ye(n),qe(e=>n.some(t=>t.name===e)?e:``),z(`ready`)}).catch(()=>{e.signal.aborted||(Ye([]),qe(``),z(`error`))}),()=>e.abort()},[l.authenticationRequired,l.streamState]),(0,B.useEffect)(()=>{let e=n.filter(e=>e.id>H.current).sort((e,t)=>e.id-t.id);if(!e.length)return;H.current=Math.max(H.current,...e.map(e=>e.id));let t=e.flatMap(e=>[On(`[${we(r,e.time)}] event/${e.source||`host`} ${e.kind}`,/error|fault|hot/i.test(e.kind)?`error`:/warn|door|disconnect/i.test(e.kind)?`warn`:`info`),On(e.text)]);S(e=>[...e,...t].slice(-120))},[n,r]),(0,B.useEffect)(()=>{let e=u.filter(e=>!St.current.has(e.id));if(!e.length)return;for(let t of e)St.current.add(t.id);let t=e.map(e=>On(`[tab/${e.tabId.slice(0,7)}] ${e.kind===`error`?`!`:e.kind===`command`?`pc›`:`↳`} ${e.text.replace(/^pc›\s*/,``)}`,e.kind===`error`?`error`:e.kind===`system`?`info`:`log`,`tab-${e.id}`));S(e=>[...e,...t].slice(-120))},[u]);let q=async e=>{let n=e.trim();if(!n)return``;if(/^console\s*\./i.test(n)){let e=Et(n),r=Ct.current.dispatch(e??n);if(r.cleared)console.clear(),S([]);else if(r.emitted.length){let e=r.emitted.map(e=>({id:`console-${e.id}`,kind:`console`,entry:e}));S(t=>[...t,...e].slice(-120));for(let e of r.emitted)An(e),t.broadcastTerminal({kind:e.level===`error`?`error`:`system`,text:jn(e),at:e.timestamp})}return e?.method===`groupEnd`&&console.groupEnd(),r.emitted.map(jn).join(` +`)}pe(n),S(e=>[...e.slice(-119),On(`pc› ${Ce(n)}`)]);try{let e=await s(n);return S(t=>[...t.slice(-119),On(e||p(`✓ accepted`,`✓ پذیرفته شد`),`info`)]),e}catch(e){let t=e instanceof Error?e.message:String(e);return S(e=>[...e.slice(-119),On(`! ${t}`,`error`)]),``}finally{pe(``)}},Mt=e=>{e.preventDefault();let t=g.trim();t&&(Ce(t)===t?U.current.record(t):U.current.edited(``),y(``),be(!1),q(t))},Nt=e=>{let t=K[e];t&&(U.current.edited(t.value),y(t.value),be(!1),window.requestAnimationFrame(()=>document.getElementById(`workbench-command`)?.focus()))},Pt=e=>{S(t=>[...t.slice(-118),On(`${p(`Event`,`رویداد`)} #${e.id}`,`info`),On(JSON.stringify(e,null,2))])},Ft={move:p(`Move`,`جابجایی`),collapse:p(`Collapse`,`جمع‌کردن`),expand:p(`Expand`,`بازکردن`),hide:p(`Hide`,`پنهان‌کردن`),show:p(`Show`,`نمایش`),customize:p(`Arrange`,`چیدمان`),done:p(`Done`,`پایان`),reset:p(`Reset layout`,`بازنشانی چیدمان`),hidden:p(`Hidden cards`,`کارت‌های پنهان`)},It=[{id:`terminal`,label:p(`Bridge terminal`,`ترمینال پل`)},{id:`displays`,label:p(`Displays`,`نمایشگرها`)},{id:`status-lighting`,label:p(`Addressable strip`,`نوار LED آدرس‌پذیر`)},{id:`audio`,label:p(`Buzzer & melody`,`بیزر و ملودی`)},{id:`radio`,label:p(`Radio controls`,`کنترل‌های رادیویی`)},{id:`macros`,label:p(`Effect library`,`کتابخانه جلوه‌ها`)},{id:`automations`,label:p(`Host automations`,`خودکارسازی میزبان`)},{id:`i2c`,label:p(`I²C & peripherals`,`I²C و تجهیزات جانبی`)},{id:`host-control`,label:p(`Host control`,`کنترل میزبان`)},{id:`firmware`,label:p(`Firmware & recovery`,`میان‌افزار و بازیابی`)}],Lt=gt.order.filter(e=>e===`displays`?G&&W.segments:e===`status-lighting`?G&&W.statusLED:e===`audio`?G&&W.buzzer:e===`radio`?G&&W.rf:e!==`i2c`||G),J=e=>{vt(t=>{let n=e(t);return d(`workbench`,Dn,n),n})},Rt=()=>{_(`workbench`),vt(ee(`workbench`,Dn))},zt=(e,t,n)=>{let r=document.elementFromPoint(t,n)?.closest(`[data-layout-card-id]`)?.dataset.layoutCardId,i=Dn.includes(r)?r:void 0;o(V.current,e,i)&&(V.current=i,J(t=>m(t,e,i)))},Bt=(e,t)=>J(n=>{let r=n.order.filter(e=>Lt.includes(e)&&!n.hidden.includes(e)),i=r[r.indexOf(e)+t];return i?m(n,e,i):n}),Y=(e,t,n)=>(0,X.jsx)(v,{id:e,title:t,order:gt.order.indexOf(e),collapsed:gt.collapsed.includes(e),hidden:gt.hidden.includes(e),editing:mt,dragging:bt===e,copy:Ft,onToggleCollapsed:()=>J(t=>({...t,collapsed:i(t.collapsed,e)})),onHide:()=>J(t=>({...t,hidden:i(t.hidden,e)})),onReorderStart:e=>{V.current=null,xt(e)},onReorderMove:zt,onReorderEnd:()=>{V.current=null,xt(null)},onKeyboardReorder:Bt,children:n});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ve,{eyebrow:G?p(`Controller and host tools`,`ابزارهای برد و میزبان`):p(`Host tools`,`ابزارهای میزبان`),title:a(`workbench`),detail:`${l.streamState.toUpperCase()} · ${n.length} ${p(`events`,`رویداد`)} · ${l.tabPeers+1} ${p(`tabs`,`تب`)}`,action:(0,X.jsxs)(`div`,{className:`header-actions`,children:[(0,X.jsx)(xe,{tone:G?`good`:`warn`,children:G?p(`BOARD + HOST`,`برد + میزبان`):p(`HOST ONLY`,`فقط میزبان`)}),(0,X.jsx)(h,{copy:Ft,editing:mt,cards:It.filter(({id:e})=>Lt.includes(e)),hidden:gt.hidden,onToggleEditing:()=>ht(e=>!e),onShow:e=>J(t=>({...t,hidden:t.hidden.filter(t=>t!==e)})),onReset:Rt})]})}),(0,X.jsxs)(`section`,{className:`workbench-grid`,children:[Y(`terminal`,p(`Bridge terminal`,`ترمینال پل`),(0,X.jsxs)(j,{icon:x,iconTone:`accent`,className:`workbench-terminal`,title:p(`Bridge terminal`,`ترمینال پل`),eyebrow:p(`Full duplex`,`ارتباط دوطرفه`),action:(0,X.jsxs)(`div`,{className:`terminal-transport`,children:[(0,X.jsxs)(xe,{tone:l.streamState===`open`?`good`:`warn`,children:[`WS `,l.streamState.toUpperCase()]}),(0,X.jsxs)(xe,{tone:l.tabBusSupported?l.tabPeers?`good`:`info`:`warn`,children:[`TAB `,l.tabBusSupported?l.tabPeers+1:`—`]}),(0,X.jsxs)(xe,{tone:`info`,children:[(0,X.jsx)(E,{size:13}),` `,n.length]})]}),menu:[{label:p(`Clear terminal`,`پاک‌کردن ترمینال`),icon:ie,onSelect:()=>{console.clear(),S([])}},{label:C?p(`Hide console syntax`,`بستن راهنما`):p(`Show console syntax`,`نمایش راهنمای کنسول`),icon:x,onSelect:()=>O(e=>!e)},{label:p(`Open event timeline`,`بازکردن خط زمانی`),icon:E,onSelect:()=>{window.location.hash=`#/events`}}],children:[(0,X.jsx)(`div`,{className:`terminal-transcript`,role:`log`,"aria-live":`polite`,dir:`ltr`,children:oe.map(e=>e.kind===`console`?(0,X.jsx)(kn,{entry:e.entry,locale:r},e.id):(0,X.jsx)(`pre`,{className:`terminal-line`,"data-level":e.level,children:e.text},e.id))}),(0,X.jsxs)(`form`,{className:`command-form`,onSubmit:Mt,children:[(0,X.jsx)(`span`,{className:`command-prompt`,children:`pc›`}),(0,X.jsxs)(`div`,{className:`terminal-command-box`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||be(!1)},children:[(0,X.jsx)(`input`,{id:`workbench-command`,"aria-label":p(`Primary bridge command`,`فرمان پل اصلی`),"aria-autocomplete":`list`,"aria-controls":`workbench-command-completions`,"aria-expanded":ge&&K.length>0,"aria-activedescendant":ge&&K.length?`workbench-command-completion-${At}`:void 0,value:g,onFocus:()=>be(K.length>0),onChange:e=>{U.current.edited(e.target.value),y(e.target.value),Te(0),be(!0)},onKeyDown:e=>{if(e.key===`Tab`&&K.length)e.preventDefault(),Nt(At);else if((e.key===`ArrowDown`||e.key===`ArrowUp`)&&ge&&K.length)e.preventDefault(),Te(t=>(t+(e.key===`ArrowDown`?1:-1)+K.length)%K.length);else if(e.key===`ArrowUp`||e.key===`ArrowDown`){e.preventDefault();let t=U.current.move(e.key===`ArrowUp`?-1:1,g);y(t),be(!1)}else e.key===`Escape`&&(e.preventDefault(),be(!1))},spellCheck:!1,autoComplete:`off`,dir:`ltr`}),ge&&K.length>0&&(0,X.jsx)(`div`,{id:`workbench-command-completions`,className:`terminal-completions`,role:`listbox`,"aria-label":p(`Command completions`,`پیشنهادهای فرمان`),children:K.map((e,t)=>(0,X.jsxs)(`button`,{id:`workbench-command-completion-${t}`,type:`button`,role:`option`,"aria-selected":t===At,onMouseDown:e=>e.preventDefault(),onClick:()=>Nt(t),children:[(0,X.jsx)(`strong`,{children:e.label}),(0,X.jsx)(`small`,{children:e.detail})]},`${e.value}-${e.label}`))})]}),(0,X.jsx)(w,{type:`submit`,tone:`primary`,icon:ae,busy:A!==``,children:a(`run`)})]}),(0,X.jsxs)(`div`,{className:`terminal-console-help`,children:[(0,X.jsx)(w,{compact:!0,tone:`ghost`,onClick:()=>O(e=>!e),"aria-expanded":C,children:C?p(`Hide console syntax`,`بستن راهنما`):p(`Console syntax`,`راهنمای کنسول`)}),C&&(0,X.jsx)(`code`,{dir:`ltr`,children:`console.*() · %s %d %i %f %o %O %c %% · table · groups · counters · timers`})]}),(0,X.jsx)(`div`,{className:`terminal-event-strip`,children:n.slice(0,5).map(e=>(0,X.jsxs)(`button`,{onClick:()=>Pt(e),children:[(0,X.jsx)(`time`,{children:we(r,e.time)}),(0,X.jsx)(`strong`,{children:e.kind}),(0,X.jsx)(`span`,{children:e.text})]},e.id))})]})),G&&W.segments&&Y(`displays`,p(`Displays`,`نمایشگرها`),(0,X.jsxs)(j,{icon:e,iconTone:`violet`,title:p(`Displays`,`نمایشگرها`),eyebrow:W.lcd?`TM1637 + LCD`:`TM1637`,action:Dt?(0,X.jsx)(xe,{tone:Ot?`good`:`bad`,children:Ot?p(`TM1637 detected`,`TM1637 شناسایی شد`):p(`TM1637 not detected`,`TM1637 شناسایی نشد`)}):void 0,children:[W.lcd&&(0,X.jsxs)(`div`,{className:`setting-group`,children:[(0,X.jsx)(`label`,{children:p(`Target`,`مقصد`)}),(0,X.jsx)(me,{value:R,label:p(`Display target`,`مقصد نمایش`),options:jt,onChange:Ee})]}),(0,X.jsx)(L,{label:p(`Display text · ${wt} characters maximum`,`متن نمایشگر، حداکثر ${wt} نویسه`),hint:Tt?p(`Printable ASCII is sent exactly, including leading and trailing spaces.`,`ASCII قابل چاپ دقیقاً با فاصله‌های ابتدا و انتها ارسال می‌شود.`):p(`Use printable ASCII characters only.`,`فقط از نویسه‌های قابل چاپ ASCII استفاده کنید.`),value:ze,maxLength:wt,pattern:`[ -~]*`,"aria-invalid":!Tt,onChange:e=>Ve(e.target.value)}),R!==`lcd`&&(0,X.jsx)(I,{label:p(`Marquee step speed`,`سرعت گام متن روان`),value:De,min:80,max:5e3,step:20,unit:`ms`,onChange:Oe}),(0,X.jsx)(I,{label:p(`Visible duration`,`مدت نمایش`),value:ke,min:80,max:65520,step:20,unit:`ms`,onChange:je}),(0,X.jsxs)(`div`,{className:`setting-group`,children:[(0,X.jsx)(`label`,{children:p(`Repeat policy`,`سیاست تکرار`)}),(0,X.jsx)(me,{value:Me,label:p(`Display repeat policy`,`سیاست تکرار نمایش`),options:[{value:`once`,label:p(`Once`,`یک‌بار`)},{value:`loop`,label:p(`Loop`,`پیوسته`)},{value:`interval`,label:p(`Interval`,`بازه‌ای`)}],onChange:Ne})]}),Me===`interval`&&(0,X.jsx)(I,{label:p(`Wait between presentations`,`مکث بین نمایش‌ها`),value:Fe,min:1e3,max:255e3,step:1e3,unit:`ms`,onChange:Ie}),R!==`lcd`&&(0,X.jsx)(P,{checked:Le,onChange:Re,label:p(`Force marquee`,`اجبار متن روان`),detail:p(`Overflow scrolls automatically; enable this only to scroll text that already fits.`,`متن بلند خودکار حرکت می‌کند؛ این گزینه متن کوتاه را نیز روان می‌کند.`)}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(w,{tone:`primary`,icon:de,disabled:!Tt,onClick:()=>void q(dn({target:R,text:ze,speedMS:De,durationMS:ke,repeat:Me,intervalMS:Fe,scroll:Le})),children:p(`Show text`,`نمایش متن`)}),(0,X.jsx)(w,{icon:Be,onClick:()=>void q(`display ${R} 0`),children:p(`Clear`,`پاک‌کردن`)})]})]})),G&&W.statusLED&&Y(`status-lighting`,p(`Addressable strip`,`نوار LED آدرس‌پذیر`),(0,X.jsxs)(j,{icon:de,iconTone:`amber`,title:p(`Addressable strip`,`نوار LED آدرس‌پذیر`),children:[(0,X.jsx)(I,{label:p(`Red`,`قرمز`),value:Qe,min:0,max:255,onChange:et}),(0,X.jsx)(I,{label:p(`Green`,`سبز`),value:nt,min:0,max:255,onChange:rt}),(0,X.jsx)(I,{label:p(`Blue`,`آبی`),value:it,min:0,max:255,onChange:ot}),(0,X.jsx)(I,{label:p(`Brightness`,`روشنایی`),value:st,min:0,max:255,onChange:ct}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(w,{tone:`primary`,icon:tt,onClick:()=>void q(`strip fill ${Qe} ${nt} ${it} ${st}`),children:p(`Fill strip`,`اعمال رنگ`)}),(0,X.jsx)(w,{icon:Be,onClick:()=>void q(`strip clear`),children:p(`Clear`,`پاک‌کردن`)})]})]})),G&&W.buzzer&&Y(`audio`,p(`Buzzer & melody`,`بیزر و ملودی`),(0,X.jsxs)(j,{icon:ue,iconTone:`green`,title:p(`Buzzer & melody`,`بیزر و ملودی`),eyebrow:p(`Timed audio`,`صدای زمان‌بندی‌شده`),children:[(0,X.jsx)(I,{label:p(`Frequency`,`فرکانس`),value:He,min:20,max:2e4,step:10,unit:`Hz`,onChange:Ue}),(0,X.jsx)(I,{label:p(`Duration`,`مدت`),value:We,min:20,max:5e3,step:20,unit:`ms`,onChange:Ge}),(0,X.jsx)(w,{icon:ye,onClick:()=>void q(`buzzer ${He} ${We}`),children:p(`Play tone`,`پخش صدا`)}),(0,X.jsxs)(`div`,{className:`setting-group`,children:[(0,X.jsx)(`label`,{htmlFor:`workbench-configured-melody`,children:p(`Configured melody`,`ملودی ذخیره‌شده`)}),(0,X.jsxs)(`select`,{id:`workbench-configured-melody`,value:Ke,disabled:Xe!==`ready`||Je.length===0,onChange:e=>qe(e.target.value),children:[(0,X.jsx)(`option`,{value:``,children:Xe===`loading`?p(`Loading configured melodies…`,`در حال دریافت ملودی‌ها…`):Xe===`error`?p(`Melody catalog unavailable`,`فهرست ملودی در دسترس نیست`):Je.length===0?p(`No configured melodies`,`ملودی ذخیره‌شده‌ای وجود ندارد`):p(`Select a configured melody`,`یک ملودی ذخیره‌شده انتخاب کنید`)}),Je.map(e=>(0,X.jsxs)(`option`,{value:e.name,children:[e.name,` · `,xn(e,r)]},e.name))]})]}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(w,{icon:at,disabled:!Ke,onClick:()=>void q(`melody play ${N(Ke)}`),children:p(`Play`,`پخش`)}),(0,X.jsx)(w,{icon:Pe,onClick:()=>void q(`melody stop`),children:p(`Stop`,`توقف`)}),(0,X.jsx)(w,{icon:Ze,onClick:()=>void q(`melody list`),children:p(`List`,`فهرست`)})]})]})),G&&W.rf&&Y(`radio`,p(`Radio controls`,`کنترل‌های رادیویی`),(0,X.jsx)(mn,{snapshot:c,events:n,locale:r,openDialog:t.openDialog})),Y(`macros`,p(`Effect library`,`کتابخانه جلوه‌ها`),(0,X.jsx)(j,{className:`macro-card`,icon:yt,iconTone:`green`,title:p(`Effect library`,`کتابخانه جلوه‌ها`),children:(0,X.jsx)(yn,{online:c.connected,locale:r,events:t.macroEvents,initialSnapshot:c.macros,stripEffects:(c.effects??[]).filter(e=>e.kind===`strip-stream`&&!!e.program).map(e=>({id:e.id,name:e.name,category:e.category,description:e.description,program:e.program,engine:e.engine,editable:e.editable,default_fps:e.default_fps??20,default_duration_ms:e.duration_ms||5e3,default_pixels:e.default_pixels??100,min_pixels:1,max_pixels:100,min_fps:1,max_fps:30})),commandSurface:q})})),Y(`automations`,p(`Host automations`,`خودکارسازی میزبان`),(0,X.jsxs)(j,{icon:Ae,iconTone:`violet`,title:p(`Host automations`,`خودکارسازی میزبان`),eyebrow:p(`Event-driven host rules`,`قواعد رویدادمحور میزبان`),children:[(0,X.jsx)(L,{label:p(`Host automation name`,`نام خودکارسازی میزبان`),value:lt,onChange:e=>ut(e.target.value)}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(w,{icon:Ae,disabled:!lt.trim(),onClick:()=>void q(`automation run ${N(lt.trim())}`),children:p(`Run automation`,`اجرای خودکارسازی`)}),(0,X.jsx)(w,{icon:Ze,onClick:()=>void q(`automation list`),children:p(`List`,`فهرست`)})]})]})),G&&Y(`i2c`,p(`I²C & peripherals`,`I²C و تجهیزات جانبی`),(0,X.jsx)(j,{icon:re,iconTone:`accent`,title:p(`I²C & peripherals`,`I²C و تجهیزات جانبی`),eyebrow:p(`Cooperative host lease`,`دسترسی هماهنگ میزبان`),children:(0,X.jsxs)(`div`,{className:`operation-buttons`,children:[(0,X.jsx)(w,{icon:dt,onClick:()=>void q(`i2c scan`),children:p(`Scan bus`,`پویش گذرگاه`)}),(0,X.jsx)(w,{icon:te,onClick:()=>void q(`i2c release`),children:p(`Release lease`,`آزادسازی دسترسی`)}),(0,X.jsx)(w,{icon:fe,onClick:()=>void q(`settings`),children:p(`Board settings`,`تنظیمات برد`)}),(0,X.jsx)(w,{icon:ce,onClick:()=>void q(`menu current`),children:p(`Menu state`,`وضعیت منو`)})]})})),Y(`host-control`,p(`Host control`,`کنترل میزبان`),(0,X.jsxs)(j,{icon:$e,iconTone:`violet`,title:p(`Host control`,`کنترل میزبان`),eyebrow:p(`Policy-gated`,`تحت کنترل سیاست‌ها`),menu:[{label:p(`Read host status`,`خواندن وضعیت میزبان`),icon:$e,onSelect:()=>{q(`os status`)}},{label:p(`Inspect global hotkeys`,`بررسی میان‌برهای سراسری`),icon:yt,onSelect:()=>{q(`hotkeys status`)}},{label:p(`Inspect keyboard hook`,`بررسی اتصال صفحه‌کلید`),icon:D,onSelect:()=>{q(`keyboard status`)}}],children:[(0,X.jsx)(I,{label:p(`Monitor brightness`,`روشنایی نمایشگر`),value:ft,min:0,max:100,unit:`%`,onChange:pt}),(0,X.jsxs)(`div`,{className:`inline-actions`,children:[(0,X.jsx)(w,{tone:`primary`,icon:_t,onClick:()=>void q(`os brightness set ${ft}`),children:p(`Apply brightness`,`اعمال روشنایی`)}),(0,X.jsx)(w,{icon:le,onClick:()=>void q(`os status`),children:p(`Host status`,`وضعیت میزبان`)}),(0,X.jsx)(w,{icon:se,onClick:()=>void q(`os policy`),children:p(`Policies`,`سیاست‌ها`)})]}),(0,X.jsxs)(`div`,{className:`operation-buttons`,children:[(0,X.jsx)(w,{icon:k,onClick:()=>void q(`hotkeys status`),children:p(`Global hotkeys`,`میان‌برهای سراسری`)}),(0,X.jsx)(w,{icon:$e,onClick:()=>void q(`keyboard status`),children:p(`Keyboard hook`,`اتصال صفحه‌کلید`)}),(0,X.jsx)(w,{icon:b,onClick:()=>void q(`bridge list`),children:p(`Remote bridges`,`پل‌های راه‌دور`)})]})]})),Y(`firmware`,p(`Firmware & recovery`,`میان‌افزار و بازیابی`),(0,X.jsx)(j,{icon:D,iconTone:`amber`,title:p(`Firmware & recovery`,`میان‌افزار و بازیابی`),eyebrow:p(`Read-only first`,`ابتدا فقط خواندنی`),children:(0,X.jsxs)(`div`,{className:`operation-buttons`,children:[G&&(0,X.jsx)(w,{icon:D,onClick:()=>void q(`hello`),children:p(`Identity`,`شناسه`)}),kt&&(0,X.jsx)(w,{icon:ie,onClick:()=>void q(`reset lines`),children:p(`Hardware reset (DTR)`,`بازنشانی سخت‌افزاری (DTR)`)}),(0,X.jsx)(w,{icon:ne,onClick:()=>void q(`toolchain profile`),children:p(`Toolchain profile`,`مشخصات زنجیره‌ابزار`)}),(0,X.jsx)(w,{icon:x,onClick:()=>y(`boot info`),children:p(`Prepare boot info`,`آماده‌سازی اطلاعات راه‌اندازی`)})]})}))]}),(0,X.jsx)(un,{...t,run:q,busy:A})]})}export{Mn as WorkbenchView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DfNNWLG8.js b/Tools/Controller/internal/webui/dist/assets/chunk-DfNNWLG8.js deleted file mode 100644 index 33739a4d..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-DfNNWLG8.js +++ /dev/null @@ -1 +0,0 @@ -import{n as e,r as t,t as n}from"./chunk-CTc1vKfa.js";import{a as r,i,n as a,r as o,t as s}from"./chunk-DvGrMMmP.js";import{t as c}from"./chunk-B9ewCnSE.js";import{t as l}from"./chunk-DwrIxLY1.js";import{n as u,t as d}from"./chunk-BWN4QWM7.js";import{$ as f,Dt as p,E as m,H as h,Mt as g,S as _,T as v,U as y,V as b,W as ee,Z as te,b as x,ct as ne,et as S,it as re,kt as C,m as ie,mt as ae,n as w,r as T,w as E,wt as oe,xt as se,yt as ce}from"./app-BpGu_3eg.js";var D={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};D.node;var le=p(D),O={name:`clock-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]};O.node;var ue=p(O),k={name:`cloud-download`,size:24,node:[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]],aliases:[`download-cloud`]};k.node;var de=p(k),fe={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};fe.node;var pe=p(fe),A={name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]};A.node;var j=p(A),M={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};M.node;var N=p(M),P={name:`file-up`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]};P.node;var F=p(P),I={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};I.node;var me=p(I),L={name:`package-check`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]};L.node;var he=p(L),R={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};R.node;var z=p(R),B=g(C(),1);function ge(e,t){return v(`controller.discovery.github.workflow`,e,t)}function V(e,t){return v(`controller.discovery.github.release`,e,t)}function _e(e,t,n){return v(`controller.discovery.manifest`,{url:e,...t?{bearer_token:t}:{}},n)}function H(e,t,n){return v(`controller.discovery.check`,{current:e??{},kind:t.kind,platform:t.platform??``,candidates:[t]},n)}function ve(e,t,n){let r=`stage:${e.id}:${e.sha256||e.archive_sha256||`unhashed`}`;return v(`controller.discovery.stage`,{candidate:e,idempotency_key:r,...t?{bearer_token:t}:{}},n)}function ye(e,t){return v(`controller.discovery.status`,e?{id:e}:{},t)}function be(){let e=typeof navigator>`u`?void 0:navigator,t=`${e?.userAgent??``} ${e?.platform??``}`.toLowerCase();return`${t.includes(`win`)?`windows`:t.includes(`mac`)?`darwin`:`linux`}/${t.includes(`arm64`)||t.includes(`aarch64`)?`arm64`:`amd64`}`}var U=re(),xe=[`firmware`,`eeprom`,`flash-backup`,`host-executable`];function Se(e,t){if(e=e.trim(),!e)return;let n=Number.parseInt(e.replace(/^0x/i,``),e.toLowerCase().startsWith(`0x`)?16:10);if(!Number.isSafeInteger(n)||n<0||n>4294967295)throw Error(t);return n}function Ce(e,t){if(e)return t===`host-executable`?e.current.host:t===`eeprom`?e.current.eeprom:t===`flash-backup`?e.current.flash_readback:e.current.firmware}function we(e,t){return e?e.slice(0,12).toUpperCase():t}function Te({manifest:t,events:n,locale:r,openDialog:a,onArtifactsChanged:s}){let c=(e,t)=>r===`fa`?t:e,l=e=>({firmware:c(`Board firmware`,`میان‌افزار برد`),eeprom:c(`Board EEPROM`,`EEPROM برد`),"flash-backup":c(`Flash backup`,`پشتیبان فلش`),"host-executable":c(`Host executable`,`فایل اجرایی میزبان`)})[e],[d,p]=(0,B.useState)(`release`),[m,g]=(0,B.useState)(`firmware`),[_,v]=(0,B.useState)(``),[te,x]=(0,B.useState)(`main`),[ne,re]=(0,B.useState)(`Build`),[C,ie]=(0,B.useState)(``),[w,E]=(0,B.useState)(``),[se,ce]=(0,B.useState)(``),[D,le]=(0,B.useState)(()=>be()),[O,ue]=(0,B.useState)(``),[k,fe]=(0,B.useState)(``),[pe,A]=(0,B.useState)(``),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(``),[F,I]=(0,B.useState)(null),[L,he]=(0,B.useState)(null),[R,z]=(0,B.useState)(``),[Te,W]=(0,B.useState)(``),G=j?.candidates.find(e=>e.id===N),Ee=(0,B.useMemo)(()=>n.find(e=>e.kind.startsWith(`artifact.discovery.`)),[n]),K=e=>{he(e),e.state===`failed`?W(e.error||e.detail||c(`Candidate staging failed.`,`آماده‌سازی گزینهٔ انتخابی ناموفق بود.`)):e.state===`completed`&&(fe(``),s())};(0,B.useEffect)(()=>{L?.id&&Ee&&ye(L.id).then(K).catch(e=>{W(e instanceof Error?e.message:String(e))})},[Ee?.id,Ee?.time]),(0,B.useEffect)(()=>{I(null),G&&H(Ce(t,G.kind),G).then(I).catch(e=>{W(e instanceof Error?e.message:String(e))})},[N,t]);let De=async e=>{e.preventDefault(),z(`discover`),W(``);try{let e=Se(O,c(`Packed timestamp must be a 32-bit decimal or 0x-prefixed hexadecimal value.`,`مهر زمانی فشرده باید یک عدد ده‌دهی ۳۲ بیتی یا مقدار شانزده‌شانزدهی با پیشوند 0x باشد.`)),t=k?{bearer_token:k}:{},n=d===`manifest`?await _e(w.trim(),k):d===`workflow`?await ge({repository:_.trim(),branch:te.trim(),workflow:ne.trim(),kind:m,platform:m===`host-executable`?D.trim():void 0,api_base_url:se.trim()||void 0,packed_timestamp:e,...t}):await V({repository:_.trim(),tag:C.trim()||void 0,kind:m,platform:m===`host-executable`?D.trim():void 0,api_base_url:se.trim()||void 0,packed_timestamp:e,...t});M(n),P(n.candidates[0]?.id??``),W(c(`${n.candidates.length} verified metadata candidate${n.candidates.length===1?``:`s`} discovered. No file was downloaded.`,`${n.candidates.length} گزینه با فرادادهٔ تأییدشده پیدا شد. هیچ فایلی دانلود نشده است.`))}catch(e){W(e instanceof Error?e.message:String(e))}finally{z(``)}},Oe=e=>a({title:c(`Download and stage this candidate?`,`این گزینه دانلود و آماده شود؟`),body:`${e.name}\n${e.repository||e.url}\n${e.archive_sha256||e.sha256||c(`No provider digest; the content-addressed store will still calculate SHA-256.`,`ارائه‌دهنده چکیده‌ای نداده است؛ مخزن محتوامحور همچنان SHA-256 را محاسبه می‌کند.`)}\n\n${c(`This downloads through the primary host, safely selects a ZIP member when needed, verifies all available size/digest metadata, and stages it. It does not open or program the board.`,`فایل از طریق میزبان اصلی دانلود می‌شود، در صورت نیاز عضو مناسب ZIP با ایمنی انتخاب می‌گردد، همهٔ فراداده‌های موجودِ اندازه و چکیده بررسی و سپس آماده می‌شود. این کار برد را باز یا پروگرام نمی‌کند.`)}`,confirmLabel:c(`Download and stage only`,`فقط دانلود و آماده‌سازی`),action:async()=>{z(`stage`);try{let t=await ve(pe.trim()?{...e,archive_path:pe.trim()}:e,k);K(t.operation),W(c(`Verified download queued. Programming still requires a separate update authorization.`,`دانلود تأییدشده در صف قرار گرفت. پروگرام همچنان به مجوز جداگانهٔ به‌روزرسانی نیاز دارد.`))}catch(e){throw W(e instanceof Error?e.message:String(e)),e}finally{z(``)}}});return(0,U.jsxs)(h,{icon:e,iconTone:`violet`,title:c(`Release & workflow discovery`,`کشف انتشار و گردش‌کار`),eyebrow:`${d===`release`?c(`Release`,`انتشار`):d===`workflow`?c(`Workflow`,`گردش‌کار`):c(`Manifest`,`مانیفست`)} · ${c(`proxy aware`,`سازگار با پراکسی`)}`,className:`release-discovery-card`,action:(0,U.jsx)(f,{tone:L?.state===`failed`?`bad`:L?.state===`completed`?`good`:L?`info`:`neutral`,children:L?.state?.toUpperCase()||c(`READY`,`آماده`)}),children:[(0,U.jsx)(`p`,{className:`card-copy`,children:c(`Discover build artifacts without hardcoded product names. Provider metadata, release checksums, hashes, packed timestamps and platform are preserved into the content-addressed inventory.`,`خروجی‌های ساخت بدون نام محصولِ ثابت کشف می‌شوند. فرادادهٔ ارائه‌دهنده، چک‌سام انتشار، هش، مهر زمانی فشرده و پلتفرم در فهرست محتوامحور حفظ می‌شود.`)}),(0,U.jsxs)(`form`,{className:`release-discovery-form`,onSubmit:e=>void De(e),children:[(0,U.jsxs)(`div`,{className:`discovery-source-picker`,children:[(0,U.jsxs)(`button`,{type:`button`,className:d===`release`?`is-active`:``,onClick:()=>p(`release`),children:[(0,U.jsx)(me,{}),c(`GitHub release`,`انتشار GitHub`)]}),(0,U.jsxs)(`button`,{type:`button`,className:d===`workflow`?`is-active`:``,onClick:()=>p(`workflow`),children:[(0,U.jsx)(me,{}),c(`Workflow artifact`,`خروجی گردش‌کار`)]}),(0,U.jsxs)(`button`,{type:`button`,className:d===`manifest`?`is-active`:``,onClick:()=>p(`manifest`),children:[(0,U.jsx)(e,{}),c(`HTTP manifest`,`مانیفست HTTP`)]})]}),d===`manifest`?(0,U.jsx)(S,{label:c(`Manifest URL`,`نشانی مانیفست`),type:`url`,dir:`ltr`,value:w,placeholder:`https://host.example/update-manifest.json`,onChange:e=>E(e.target.value)}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`compact-fields`,children:[(0,U.jsx)(S,{label:c(`Repository`,`مخزن`),dir:`ltr`,value:_,placeholder:`owner/repository`,onChange:e=>v(e.target.value)}),d===`workflow`?(0,U.jsx)(S,{label:c(`Branch`,`شاخه`),dir:`ltr`,value:te,onChange:e=>x(e.target.value)}):(0,U.jsx)(S,{label:c(`Tag (blank = latest stable)`,`برچسب (خالی = آخرین نسخهٔ پایدار)`),dir:`ltr`,value:C,onChange:e=>ie(e.target.value)})]}),d===`workflow`&&(0,U.jsx)(S,{label:c(`Workflow name`,`نام گردش‌کار`),value:ne,onChange:e=>re(e.target.value)}),(0,U.jsx)(S,{label:c(`GitHub API base (optional)`,`نشانی پایهٔ API گیت‌هاب (اختیاری)`),type:`url`,dir:`ltr`,value:se,placeholder:`https://api.github.com`,onChange:e=>ce(e.target.value),hint:c(`Supports GitHub Enterprise; normal GitHub uses the default when blank.`,`از GitHub Enterprise پشتیبانی می‌کند؛ برای گیت‌هاب عادی، خالی بگذارید تا مقدار پیش‌فرض استفاده شود.`)})]}),(0,U.jsxs)(`div`,{className:`compact-fields`,children:[(0,U.jsxs)(`label`,{className:`field`,children:[(0,U.jsx)(`span`,{children:c(`Artifact kind`,`نوع خروجی`)}),(0,U.jsx)(`select`,{value:m,onChange:e=>g(e.target.value),children:xe.map(e=>(0,U.jsx)(`option`,{value:e,children:l(e)},e))})]}),(0,U.jsx)(S,{label:c(`Target platform`,`پلتفرم مقصد`),dir:`ltr`,value:D,disabled:m!==`host-executable`,onChange:e=>le(e.target.value)})]}),(0,U.jsxs)(`div`,{className:`compact-fields`,children:[(0,U.jsx)(S,{label:c(`Packed timestamp override`,`بازنویسی مهر زمانی فشرده`),dir:`ltr`,value:O,placeholder:c(`0x… or decimal`,`0x… یا ده‌دهی`),onChange:e=>ue(e.target.value)}),(0,U.jsx)(S,{label:c(`Provider / peer bearer token`,`توکن حامل ارائه‌دهنده / همتا`),type:`password`,autoComplete:`off`,dir:`ltr`,value:k,onChange:e=>fe(e.target.value),hint:c(`Held only in this browser session and cleared after a successful stage.`,`فقط در همین نشست مرورگر نگهداری و پس از آماده‌سازی موفق پاک می‌شود.`)})]}),(0,U.jsx)(b,{type:`submit`,tone:`primary`,icon:e,busy:R===`discover`,disabled:d===`manifest`?!w.trim():!_.trim(),children:c(`Discover metadata`,`کشف فراداده`)})]}),Te&&(0,U.jsxs)(`div`,{className:`update-notice${/failed|error|invalid|mismatch/i.test(Te)?` is-error`:``}`,children:[(0,U.jsx)(i,{size:17}),(0,U.jsx)(`span`,{children:Te})]}),j?.candidates.length?(0,U.jsx)(`div`,{className:`release-candidates`,children:j.candidates.map(e=>(0,U.jsxs)(`label`,{className:e.id===N?`is-selected`:``,children:[(0,U.jsx)(`input`,{type:`radio`,name:`release-candidate`,checked:e.id===N,onChange:()=>P(e.id)}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:e.name}),(0,U.jsxs)(`small`,{children:[e.release_tag?`${c(`release`,`انتشار`)} ${e.release_tag}`:e.workflow_run_id?`${c(`run`,`اجرا`)} ${e.workflow_run_id}`:e.source,` · `,e.platform||c(`platform-neutral`,`مستقل از پلتفرم`)]})]}),(0,U.jsx)(`code`,{children:we(e.archive_sha256||e.sha256,c(`UNPUBLISHED`,`منتشرنشده`))}),(0,U.jsx)(`em`,{children:T(e.archive_bytes||e.bytes,c(`unknown`,`نامشخص`))})]},e.id))}):!R&&j&&(0,U.jsx)(ee,{icon:oe,title:c(`No matching candidates`,`گزینهٔ منطبقی پیدا نشد`),detail:c(`Adjust artifact kind, platform, release tag, branch, or workflow name.`,`نوع خروجی، پلتفرم، برچسب انتشار، شاخه یا نام گردش‌کار را تغییر دهید.`)}),G&&(0,U.jsxs)(`div`,{className:`release-selection`,children:[(0,U.jsxs)(`div`,{className:`data-list`,children:[(0,U.jsx)(y,{label:c(`Comparison`,`مقایسه`),value:F?.status||c(`checking`,`در حال بررسی`),tone:F?.status===`newer`?`good`:F?.status===`older`?`warn`:void 0}),(0,U.jsx)(y,{label:c(`Reason`,`دلیل`),value:F?.reason||c(`Comparing hashes and packed/build timestamps…`,`در حال مقایسهٔ هش و مهرهای زمانی فشرده/ساخت…`)}),(0,U.jsx)(y,{label:c(`Build hash`,`هش ساخت`),value:G.build_hash||c(`not supplied`,`ارائه نشده`),mono:!0}),(0,U.jsx)(y,{label:c(`Build time`,`زمان ساخت`),value:G.build_timestamp||c(`not supplied`,`ارائه نشده`),mono:!0})]}),G.archive&&(0,U.jsx)(S,{label:c(`ZIP member path (optional)`,`مسیر عضو ZIP (اختیاری)`),dir:`ltr`,value:pe,placeholder:c(`Auto-select a unique platform/kind match`,`انتخاب خودکار فایل یکتای منطبق با پلتفرم و نوع`),onChange:e=>A(e.target.value),hint:c(`Specify this only when an archive contains multiple equally suitable files.`,`فقط زمانی مشخص کنید که آرشیو چند فایل به یک اندازه مناسب دارد.`)}),(0,U.jsx)(b,{tone:`primary`,icon:de,busy:R===`stage`,onClick:()=>Oe(G),children:c(`Review verified staging`,`بازبینی آماده‌سازی تأییدشده`)})]}),L&&(0,U.jsxs)(`div`,{className:`release-operation`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(ae,{className:L.state===`queued`||L.state===`downloading`?`spin`:``}),(0,U.jsx)(`strong`,{children:L.error||L.detail||L.state}),(0,U.jsxs)(`span`,{children:[T(L.bytes_done,c(`unknown`,`نامشخص`)),` / `,T(L.bytes_total,c(`unknown`,`نامشخص`))]})]}),(0,U.jsx)(`div`,{className:`update-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.max(0,Math.min(100,L.progress_percent)),children:(0,U.jsx)(`i`,{style:{width:`${Math.max(0,Math.min(100,L.progress_percent))}%`}})}),(0,U.jsx)(b,{compact:!0,icon:o,onClick:()=>void ye(L.id).then(K).catch(e=>W(e instanceof Error?e.message:String(e))),children:c(`Refresh operation`,`تازه‌سازی عملیات`)}),L.artifact&&(0,U.jsxs)(`p`,{children:[(0,U.jsx)(u,{}),` `,c(`Staged as`,`آماده‌شده با شناسه`),` `,(0,U.jsx)(`code`,{children:L.artifact.sha256}),`؛ `,c(`board programming remains a separate action.`,`پروگرام برد همچنان عملی جداگانه است.`)]})]})]})}var W=new Set([`completed`,`failed`,`cancelled`,`downloaded`,`staged`]);function G(e){return!!e?.state&&!W.has(e.state)}function Ee(e){return!G(e)||!e?.progress_known||!Number.isFinite(e.progress_percent)?null:Math.max(0,Math.min(100,e.progress_percent))}function K(e,t){let n=Date.parse(e.started_at??``),r=G(e)?t:Date.parse(e.updated_at??``);if(!Number.isFinite(n)||!Number.isFinite(r)||r=60?`${Math.floor(i/60)}m ${i%60}s`:`${i}s`}var De={queued:[`Queued`,`در صف`],preflight:[`Checking tools & target`,`بررسی ابزارها و مقصد`],uploading:[`Uploading artifact`,`ارسال فایل`],receiving:[`Receiving artifact`,`دریافت فایل`],preparing:[`Preparing board`,`آماده‌سازی برد`],"backing-up":[`Saving board settings`,`ذخیره تنظیمات برد`],reading:[`Reading memory`,`خواندن حافظه`],writing:[`Writing memory`,`نوشتن حافظه`],programming:[`Programming board`,`پروگرام برد`],erasing:[`Erasing memory`,`پاک کردن حافظه`],verifying:[`Verifying memory`,`تأیید حافظه`],reconnecting:[`Reconnecting board`,`اتصال دوباره برد`],restoring:[`Restoring settings`,`بازیابی تنظیمات`],downloading:[`Downloading artifact`,`دریافت فایل`],staging:[`Preparing host replacement`,`آماده‌سازی جایگزین میزبان`],staged:[`Host replacement ready`,`جایگزین میزبان آماده است`],prepare:[`Preparing board`,`آماده‌سازی برد`],settings:[`Reading settings`,`خواندن تنظیمات`],release:[`Releasing serial port`,`آزاد کردن درگاه سریال`],backup:[`Saving board backup`,`ذخیره پشتیبان برد`],flash:[`Programming board`,`پروگرام برد`],reconnect:[`Reconnecting board`,`اتصال دوباره برد`],restore:[`Restoring settings`,`بازیابی تنظیمات`],"flash read":[`Reading flash`,`خواندن فلش`],"EEPROM read":[`Reading EEPROM`,`خواندن EEPROM`],"flash write":[`Writing flash`,`نوشتن فلش`],"flash verification":[`Verifying flash`,`تأیید فلش`]};function Oe({status:e,locale:t}){let n=(e,n)=>t===`fa`?n:e,r=G(e),a=Ee(e),[o,s]=(0,B.useState)(Date.now);(0,B.useEffect)(()=>{if(!r)return;let e=window.setInterval(()=>s(Date.now()),1e3);return()=>window.clearInterval(e)},[r]);let c=K(e,o),l=e.state===`failed`||e.state===`cancelled`,u=e.stage||(r?e.state:``),f=u.split(`:`)[0],p=De[f]?.[+(t===`fa`)]||f.replaceAll(`-`,` `),m=l?n(`Update stopped`,`به‌روزرسانی متوقف شد`):r?p:n(`Operation complete`,`عملیات کامل شد`),h=l?ne:r?ae:i;return(0,U.jsxs)(`section`,{className:`update-operation ${l?`is-failed`:r?`is-running`:`is-complete`}`,"aria-label":n(`Update operation`,`عملیات به‌روزرسانی`),children:[(0,U.jsxs)(`header`,{className:`update-operation__header`,children:[(0,U.jsx)(`div`,{className:`update-operation__icon`,children:(0,U.jsx)(h,{className:r?`spin`:void 0})}),(0,U.jsxs)(`div`,{className:`update-operation__heading`,children:[(0,U.jsx)(`span`,{children:e.kind===`firmware`?n(`Board firmware`,`میان‌افزار برد`):e.kind.replaceAll(`-`,` `)}),(0,U.jsx)(`h2`,{children:m})]}),c&&(0,U.jsxs)(`span`,{className:`update-operation__elapsed`,children:[(0,U.jsx)(ue,{size:16}),(0,U.jsx)(`b`,{children:c})]})]}),r&&(0,U.jsxs)(`div`,{className:`update-operation__measurement`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:a===null?n(`Waiting for this stage`,`در انتظار این مرحله`):n(`Current stage`,`مرحله جاری`)}),(0,U.jsx)(`strong`,{children:a===null?`…`:`${a}%`})]}),(0,U.jsx)(`div`,{className:`update-progress${a===null?` is-indeterminate`:``}`,role:`progressbar`,"aria-label":p,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a??void 0,"aria-valuetext":a===null?n(`In progress; duration unknown`,`در حال اجرا؛ زمان نامشخص`):void 0,children:(0,U.jsx)(`i`,{style:a===null?void 0:{width:`${a}%`}})},u)]}),e.detail&&(0,U.jsx)(`div`,{className:`update-operation__detail`,dir:`auto`,role:l?`alert`:void 0,children:e.detail}),(0,U.jsxs)(`dl`,{className:`update-operation__facts`,children:[l&&p&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n(`Last stage`,`آخرین مرحله`)}),(0,U.jsx)(`dd`,{children:p})]}),e.programming_method&&e.programming_method!==`none`&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n(`Connection`,`اتصال`)}),(0,U.jsx)(`dd`,{children:e.programming_method===`urclock`?`UART / Urclock`:`USBasp / ISP`})]}),!!e.bytes_total&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n(`Transferred`,`انتقال داده`)}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`bdi`,{title:`${e.bytes_done??0} / ${e.bytes_total} bytes`,children:w(e.bytes_done??0,e.bytes_total)})})]}),e.updated_at&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n(`Last activity`,`آخرین فعالیت`)}),(0,U.jsx)(`dd`,{children:new Date(e.updated_at).toLocaleTimeString(t)})]})]}),(0,U.jsxs)(`details`,{className:`update-operation__diagnostics`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsx)(d,{size:16}),n(`Technical details`,`جزئیات فنی`)]}),(0,U.jsxs)(`dl`,{children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n(`Operation`,`عملیات`)}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`bdi`,{children:(0,U.jsx)(`code`,{children:e.id})})})]}),e.error_code&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:n(`Error`,`خطا`)}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`bdi`,{children:(0,U.jsx)(`code`,{children:e.error_code})})})]}),e.artifact_sha256&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{children:`SHA-256`}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(`bdi`,{children:(0,U.jsx)(`code`,{children:e.artifact_sha256})})})]})]})]})]})}function q(){let e=_();return e?{Authorization:`Bearer ${e}`}:{}}async function ke(e){let t=await e.text(),n=null;if(t)try{n=JSON.parse(t)}catch{n=t}if(!e.ok){let t=E(n,e.statusText,e.status);throw Error(t||`HTTP ${e.status}`)}return n}function Ae(e){return v(`controller.artifact.manifest`,{},e)}function je(e,t){return v(`controller.artifact.list`,e?{kind:e}:{},t)}function Me(e,t){return v(`controller.artifact.fetch`,e,t)}function Ne(e,t){return v(`controller.artifact.capture`,e,t)}function Pe(e,t){return v(`controller.update.firmware`,e,t)}function Fe(e,t){return v(`controller.restore.flash`,e,t)}function Ie(e,t){return v(`controller.update.eeprom`,e,t)}function Le(e,t){return v(`controller.update.host`,e,t)}function Re(e){return v(`controller.bridge.list`,{},e)}var ze=`pccontroller.peer-update.intent.`,J=new Map,Y;function X(e,t){try{sessionStorage!==Y&&(J.clear(),Y=sessionStorage)}catch{}return`${ze}${encodeURIComponent(e.trim().toLowerCase())}.${t}`}function Z(e){let t=new Uint8Array(16);globalThis.crypto.getRandomValues(t);let n=Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``);return`peer-host-${e.slice(0,12)}-${n}`}function Q(e,t){if(!e.trim())throw Error(`Peer host update requires a peer`);let n=t.trim().toLowerCase();if(!/^[0-9a-f]{64}$/.test(n))throw Error(`Peer host update requires an exact SHA-256 digest`);let r=X(e,n),i=J.get(r);if(i)return i;try{let e=sessionStorage.getItem(r)?.trim()??``;if(/^[A-Za-z0-9._:-]{1,128}$/.test(e))return J.set(r,e),e}catch{}let a=Z(n);J.set(r,a);try{sessionStorage.setItem(r,a)}catch{}return a}function $(e,t,n){let r=X(e,t.trim().toLowerCase());J.get(r)===n&&J.delete(r);try{sessionStorage.getItem(r)===n&&sessionStorage.removeItem(r)}catch{}}function Be(e,t,n){let r=t.trim().toLowerCase(),i=n.trim();if(!e.trim()||!/^[0-9a-f]{64}$/.test(r)||!/^[A-Za-z0-9._:-]{1,128}$/.test(i))return!1;J.set(X(e,r),i);try{return sessionStorage.setItem(X(e,r),i),!0}catch{return!0}}function Ve(e,t,n){$(e,t,n.trim())}async function He(e,t,n){let r=t.trim().toLowerCase(),i=Q(e,r);try{let t=await v(`controller.peer.update.host`,{peer:e,artifact_sha256:r,authorized:!0,idempotency_key:i},n);return $(e,r,i),t}catch(t){throw t instanceof x&&t.code!==-32004&&$(e,r,i),t}}async function Ue(e,t,n,r,i){let a=new URL(m(`/api/artifacts/upload`),location.href);a.searchParams.set(`kind`,t),a.searchParams.set(`name`,e.name),a.searchParams.set(`sha256`,n),a.searchParams.set(`bytes`,String(e.size));let o=new FormData;return o.set(`artifact`,e,e.name),i&&typeof XMLHttpRequest<`u`?new Promise((t,n)=>{let s=new XMLHttpRequest,c=e.size,l=()=>s.abort();s.open(`POST`,a.toString());for(let[e,t]of Object.entries(q()))s.setRequestHeader(e,t);s.upload.onprogress=e=>{c=e.lengthComputable&&e.total>0?e.total:c,i(e.loaded,c)},s.onerror=()=>n(Error(`Artifact upload transport failed`)),s.onabort=()=>n(new DOMException(`Artifact upload was cancelled`,`AbortError`)),s.onload=()=>{r?.removeEventListener(`abort`,l);let e=null;try{e=s.responseText?JSON.parse(s.responseText):null}catch{e=s.responseText}s.status<200||s.status>=300?n(Error(E(e,s.statusText,s.status))):(i(c,c),t(e))},r?.addEventListener(`abort`,l,{once:!0}),r?.aborted?l():s.send(o)}):ke(await fetch(a.toString(),{method:`POST`,headers:q(),body:o,signal:r}))}async function We(e,t,n){let r=m(`/api/artifacts/${encodeURIComponent(e.kind)}/${encodeURIComponent(e.sha256)}`);if(n&&typeof XMLHttpRequest<`u`){Ge(await new Promise((i,a)=>{let o=new XMLHttpRequest,s=()=>o.abort();o.open(`GET`,r),o.responseType=`blob`;for(let[e,t]of Object.entries(q()))o.setRequestHeader(e,t);o.onprogress=t=>n(t.loaded,t.lengthComputable?t.total:e.bytes),o.onerror=()=>a(Error(`Artifact download transport failed`)),o.onabort=()=>a(new DOMException(`Artifact download was cancelled`,`AbortError`)),o.onload=()=>{t?.removeEventListener(`abort`,s),o.status<200||o.status>=300?a(Error(o.statusText||`HTTP ${o.status}`)):(n(e.bytes,e.bytes),i(o.response))},t?.addEventListener(`abort`,s,{once:!0}),t?.aborted?s():o.send()}),e.name);return}let i=await fetch(r,{headers:q(),signal:t});i.ok||await ke(i),Ge(await i.blob(),e.name)}function Ge(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Ke(e){let t=await crypto.subtle.digest(`SHA-256`,await e.arrayBuffer());return Array.from(new Uint8Array(t),e=>e.toString(16).padStart(2,`0`)).join(``)}function qe(e,t){return!e||!t?`unknown`:e.sha256.toLowerCase()===t.sha256.toLowerCase()?`same`:!e.build_timestamp||!t.build_timestamp||t.build_timestamp===e.build_timestamp?`different`:t.build_timestamp>e.build_timestamp?`newer`:`older`}var Je=[`firmware`,`eeprom`,`flash-backup`,`host-executable`];function Ye(e){return e?e.slice(0,12).toUpperCase():`—`}function Xe(e){let t=e.metadata;return!et(e)||!t?.operation_id||!t.kind||!t.state?null:{id:t.operation_id,kind:t.kind,state:t.state,stage:t.stage,detail:t.detail??e.text,error_code:t.error_code,progress_known:t.progress_known===`true`,progress_percent:Number(t.progress_percent),started_at:t.started_at,updated_at:t.updated_at,stage_started_at:t.stage_started_at,artifact_sha256:t.sha256,programming_method:t.programming_method,bootloader_outcome:t.bootloader_outcome,isp_fallback_suggested:t.isp_fallback_suggested===`true`,toolchain:t.toolchain_ready?{ready:t.toolchain_ready===`true`,policy:t.toolchain_policy,provider:t.toolchain_provider,version:t.toolchain_version,compatible_sources:t.toolchain_compatible_sources?Number(t.toolchain_compatible_sources):void 0,providers:t.toolchain_providers?t.toolchain_providers.split(`,`).filter(Boolean):void 0}:void 0,bytes_done:t.bytes_done?Number(t.bytes_done):void 0,bytes_total:t.bytes_total?Number(t.bytes_total):void 0}}function Ze(e,t){return{firmware:[`Board firmware`,`میان‌افزار برد`],eeprom:[`Board EEPROM`,`EEPROM برد`],"flash-backup":[`Flash readback`,`بازخوانی فلش`],"host-executable":[`Host executable`,`فایل اجرایی میزبان`]}[e]?.[+(t===`fa`)]??e}function Qe(e,t){return t(e.operation),e.artifact}function $e(e,t){return t===`host-executable`||e}function et(e){return e.kind.startsWith(`update.`)&&e.source!==`bridge`&&!e.metadata?.[`bridge.ingress`]}function tt(e){let t=e.kind.trim().toLowerCase();if(!t.startsWith(`peer-update.`))return null;let n=e.metadata?.peer?.trim()??``,r=(e.metadata?.state??t.slice(12)).trim().toLowerCase();if(!n||!r)return null;let i=Number(e.metadata?.progress_percent);return{peer:n,state:r,operationID:e.metadata?.remote_operation_id?.trim()||e.metadata?.operation_id?.trim()||`—`,progressPercent:Number.isFinite(i)?Math.min(100,Math.max(0,i)):0,progressKnown:e.metadata?.progress_known===`true`&&Number.isFinite(i),bytesDone:e.metadata?.bytes_done?Number(e.metadata.bytes_done):void 0,bytesTotal:e.metadata?.bytes_total?Number(e.metadata.bytes_total):void 0,detail:e.text,artifactSHA256:e.metadata?.sha256?.trim().toLowerCase()??``,idempotencyKey:e.metadata?.idempotency_key?.trim()??``,retrySameIntent:e.metadata?.retry_same_idempotency_key===`true`,terminalVerified:e.metadata?.terminal_verified===`true`}}function nt({appTitle:e,snapshot:u,events:d,locale:p,openDialog:m}){let g=(e,t)=>p===`fa`?t:e,[_,v]=(0,B.useState)(null),[x,re]=(0,B.useState)([]),[C,E]=(0,B.useState)(``),[oe,D]=(0,B.useState)(null),[O,ue]=(0,B.useState)([]),[k,fe]=(0,B.useState)(null),[A,M]=(0,B.useState)(``),[P,I]=(0,B.useState)(``),[me,L]=(0,B.useState)(``),[R,ge]=(0,B.useState)(`firmware`),[V,_e]=(0,B.useState)(null),[H,ve]=(0,B.useState)(``),[ye,be]=(0,B.useState)(!1),[xe,Se]=(0,B.useState)(!1),[Ce,we]=(0,B.useState)(``),[W,Ee]=(0,B.useState)(``),[K,De]=(0,B.useState)(``),[q,ke]=(0,B.useState)(``),ze=(0,B.useRef)(null),J=(0,B.useCallback)(async()=>{M(e=>e||`refresh`);try{let[e,t,n]=await Promise.all([Ae(),je(),Re()]);v(e),re(t.artifacts),D(e.update??null),ue(n),L(``),E(n=>n&&t.artifacts.some(e=>e.sha256===n)?n:e.defaults.firmware?.sha256??t.artifacts[0]?.sha256??``)}catch(e){v(null),re([]),ue([]),L(e instanceof Error?e.message:String(e))}finally{M(e=>e===`refresh`?``:e)}},[]);(0,B.useEffect)(()=>{J()},[J]);let Y=(0,B.useMemo)(()=>d.find(et),[d]),X=(0,B.useMemo)(()=>d.map(tt).find(e=>e!==null)??null,[d]);(0,B.useEffect)(()=>{X?.idempotencyKey&&X.artifactSHA256&&(X.state===`outcome-uncertain`&&X.retrySameIntent?Be(X.peer,X.artifactSHA256,X.idempotencyKey):(X.state===`failed`||X.state===`completed`)&&Ve(X.peer,X.artifactSHA256,X.idempotencyKey))},[X]);let Z=X??(k?{peer:k.peer,state:k.stage,operationID:k.operation.id,progressPercent:k.operation.progress_percent,progressKnown:k.operation.progress_known===!0,bytesDone:k.operation.bytes_done,bytesTotal:k.operation.bytes_total,detail:k.operation.detail??``,artifactSHA256:k.artifact.sha256,idempotencyKey:k.operation.idempotency_key??``,retrySameIntent:!1,terminalVerified:k.terminal_verified}:null);(0,B.useEffect)(()=>{if(!Y)return;let e=Xe(Y);e&&(D(t=>t?.updated_at&&e.updated_at&&Date.parse(t.updated_at)>Date.parse(e.updated_at)?t:e),G(e)||J())},[Y?.id,Y?.time]);let Q=x.find(e=>e.sha256===C),$=qe(Q?.kind===`host-executable`?_?.current.host:Q?.kind===`eeprom`?_?.current.eeprom:Q?.kind===`flash-backup`?_?.current.flash_readback:_?.current.firmware,Q),Ge=oe?.isp_fallback_suggested===!0,nt=async e=>{if(_e(e),ve(``),I(``),e){be(!0);try{ve(await Ke(e))}catch(e){I(`${g(`Could not hash selection`,`محاسبهٔ هش فایل انتخابی ممکن نشد`)}: ${e instanceof Error?e.message:String(e)}`)}finally{be(!1)}}},rt=e=>{nt(e.currentTarget.files?.[0]??null)},it=e=>{e.preventDefault(),Se(!1),nt(e.dataTransfer.files?.[0]??null)},at=async()=>{if(!V||!H)return;M(`upload`);let e=`browser-upload-${H.slice(0,16)}`,t=new Date().toISOString(),n=0,r=V.size;try{let i=Qe(await Ue(V,R,H,void 0,(i,a)=>{n=i,r=a;let o=a>0?Math.max(0,Math.min(100,Math.round(i*100/a))):0,s={id:e,kind:`artifact-upload`,state:`uploading`,stage:`uploading`,progress_known:a>0,progress_percent:o,bytes_done:i,bytes_total:a,detail:g(`Sending selected artifact to this host`,`ارسال فایل انتخاب‌شده به این میزبان`),started_at:t,updated_at:new Date().toISOString()};D(s),window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:s}))}),D);window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:{id:e,kind:`artifact-upload`,state:`completed`,stage:`completed`,progress_known:r>0,progress_percent:100,bytes_done:r,bytes_total:r,detail:g(`Artifact upload completed and was verified`,`ارسال فایل کامل و تأیید شد`),started_at:t,updated_at:new Date().toISOString()}})),I(g(`${V.name} was verified and staged. Nothing has been programmed.`,`${V.name} تأیید و آماده شد. هیچ چیزی پروگرام نشده است.`)),await J(),i&&E(i.sha256)}catch(i){let a=i instanceof Error?i.message:String(i);window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:{id:e,kind:`artifact-upload`,state:`failed`,stage:`uploading`,progress_known:r>0,progress_percent:r>0?Math.max(0,Math.min(100,Math.round(n*100/r))):0,bytes_done:n,bytes_total:r,detail:a,started_at:t,updated_at:new Date().toISOString()}})),I(a)}finally{M(``)}},ot=async e=>{e.preventDefault();let t=K.trim().toLowerCase();if(t&&!/^[0-9a-f]{64}$/.test(t))I(g(`Expected SHA-256 must contain exactly 64 hexadecimal characters.`,`مقدار مورد انتظار SHA-256 باید دقیقاً ۶۴ نویسهٔ شانزده‌شانزدهی داشته باشد.`));else{M(`remote`);try{let e=Qe(await Me({url:Ce.trim(),kind:R,...W.trim()?{name:W.trim()}:{},...t?{sha256:t}:{},...q?{bearer_token:q}:{}}),D);I(g(`Remote content was downloaded, checked and staged. Nothing has been programmed.`,`محتوای راه‌دور دانلود، بررسی و آماده شد. هیچ چیزی پروگرام نشده است.`)),ke(``),await J(),e&&E(e.sha256)}catch(e){I(e instanceof Error?e.message:String(e))}finally{M(``)}}},st=(e,t=`urclock`)=>{let n=e.kind!==`host-executable`;if(!$e(u.connected,e.kind)){I(g(`Connect the controller before starting a board update.`,`پیش از آغاز به‌روزرسانی برد، کنترلر را متصل کنید.`));return}let r=e.kind===`host-executable`?g(`replace the host application`,`برنامهٔ میزبان را جایگزین می‌کند`):e.kind===`eeprom`?g(`restore MCU EEPROM`,`EEPROM ریزکنترل‌گر را بازیابی می‌کند`):e.kind===`flash-backup`?g(`restore the captured flash image`,`تصویر ثبت‌شدهٔ فلش را بازیابی می‌کند`):g(`program board firmware`,`میان‌افزار برد را پروگرام می‌کند`);m({tone:`danger`,title:e.kind===`flash-backup`?g(`Authorize guarded flash restore?`,`بازیابی محافظت‌شدهٔ فلش مجاز شود؟`):g(`Authorize ${Ze(e.kind,p).toLowerCase()} update?`,`به‌روزرسانی ${Ze(e.kind,p)} مجاز شود؟`),body:`${e.name}\nSHA-256 ${e.sha256}\n\n${g(`This is the authorization step. Selection and staging did not write hardware.`,`این مرحلهٔ صدور مجوز است. انتخاب و آماده‌سازی چیزی روی سخت‌افزار ننوشته‌اند.`)} ${n?g(`The primary host will make the board safe, back up flash and EEPROM, then ${r}, verify readback, and restore lifecycle settings.`,`میزبان اصلی ابتدا برد را در وضعیت امن قرار می‌دهد، از فلش و EEPROM پشتیبان می‌گیرد، سپس ${r}، بازخوانی را تأیید و تنظیمات چرخهٔ کار را بازیابی می‌کند.`):g(`The primary host will verify the package, prepare a recoverable replacement, and ${r} only after the current process exits cleanly.`,`میزبان اصلی بسته را تأیید و جایگزینی قابل‌بازیابی آماده می‌کند و فقط پس از خروج پاک فرایند فعلی، ${r}.`)}`,confirmLabel:t===`usbasp`?g(`Authorize ISP programming`,`اجازهٔ پروگرام ISP`):g(`Authorize verified update`,`اجازهٔ به‌روزرسانی تأییدشده`),action:async()=>{M(`update`);try{let n={artifact_sha256:e.sha256,authorized:!0,method:t,...u.port.name?{port:u.port.name}:{}};Qe(e.kind===`host-executable`?await Le(n):e.kind===`eeprom`?await Ie(n):e.kind===`flash-backup`?await Fe(n):await Pe(n),D),I(g(`${e.name} entered the guarded ${e.kind===`flash-backup`?`restore`:`update`} queue.`,`${e.name} وارد صف محافظت‌شدهٔ ${e.kind===`flash-backup`?`بازیابی`:`به‌روزرسانی`} شد.`))}catch(e){throw I(e instanceof Error?e.message:String(e)),e}finally{M(``)}}})},ct=(e,t)=>{!e.connected||!e.allow_commands?I(g(`Peer ${e.name} is not connected for commands.`,`همتای ${e.name} برای فرمان‌ها متصل نیست.`)):m({tone:`danger`,title:g(`Upgrade ${e.name}?`,`به‌روزرسانی ${e.name}؟`),body:`${t.name}\nSHA-256 ${t.sha256}\n\n${g(`The primary instance will transfer the verified executable over its configured bridge, ask the remote coordinator to perform its journaled replacement, wait through restart, and verify the peer acknowledges this exact active SHA.`,`نمونهٔ اصلی فایل اجرایی تأییدشده را از پل معتبر منتقل می‌کند، از هماهنگ‌کنندهٔ راه‌دور می‌خواهد جایگزینی ثبت‌شده را انجام دهد، در طول راه‌اندازی مجدد منتظر می‌ماند و تأیید می‌کند که همتا همین SHA فعال دقیق را اعلام می‌کند.`)}`,confirmLabel:g(`Authorize peer upgrade`,`اجازهٔ به‌روزرسانی همتا`),action:async()=>{M(`peer-update`);try{let n=await He(e.name,t.sha256);fe(n),I(g(`${e.name} restarted and acknowledged ${n.artifact.sha256.slice(0,12)} as its active host executable.`,`${e.name} دوباره راه‌اندازی شد و ${n.artifact.sha256.slice(0,12)} را به‌عنوان فایل اجرایی فعال میزبان تأیید کرد.`))}catch(e){I(e instanceof Error?e.message:String(e))}finally{M(``)}}})},lt=(e=`urclock`)=>{u.connected?m({title:g(`Capture current flash and EEPROM?`,`فلش و EEPROM فعلی ثبت شوند؟`),body:`${g(`The primary host will briefly take ownership of the programming path, read both memories, verify their exact byte counts, and store content-addressed backups. Existing identical images are not duplicated.`,`میزبان اصلی برای مدتی کوتاه مسیر پروگرام را در اختیار می‌گیرد، هر دو حافظه را می‌خواند، شمار دقیق بایت‌ها را تأیید و پشتیبان‌های محتوامحور ذخیره می‌کند. تصاویر یکسان موجود دوباره کپی نمی‌شوند.`)}${e===`usbasp`?`\n\n${g(`ISP access is being used because the bootloader probe failed.`,`به‌دلیل ناموفق بودن بررسی بوت‌لودر، از دسترسی ISP استفاده می‌شود.`)}`:``}`,confirmLabel:e===`usbasp`?g(`Authorize ISP capture`,`اجازهٔ ثبت با ISP`):g(`Authorize readback`,`اجازهٔ بازخوانی`),action:async()=>{M(`capture`);try{Qe(await Ne({components:[`flash`,`eeprom`],authorized:!0,method:e}),D),I(g(`Flash and EEPROM capture entered the guarded queue.`,`ثبت فلش و EEPROM وارد صف محافظت‌شده شد.`))}catch(e){throw I(e instanceof Error?e.message:String(e)),e}finally{M(``)}}}):I(g(`Connect the controller before capturing its memories.`,`پیش از ثبت حافظه‌ها، کنترلر را متصل کنید.`))},ut=async e=>{let t=`browser-download-${e.sha256.slice(0,16)}`,n=new Date().toISOString(),r=0,i=e.bytes,a=(e,a,o,s)=>{r=a,i=o;let c=o>0?Math.max(0,Math.min(100,Math.round(a*100/o))):0;window.dispatchEvent(new CustomEvent(`pccontroller:update-transfer-progress`,{detail:{id:t,kind:`artifact-fetch`,state:e,stage:e===`completed`?`completed`:`downloading`,progress_known:o>0,progress_percent:c,bytes_done:a,bytes_total:o,detail:s,started_at:n,updated_at:new Date().toISOString()}}))};try{await We(e,void 0,(e,t)=>a(`downloading`,e,t,g(`Downloading verified artifact to this browser`,`دریافت فایل تأییدشده در این مرورگر`))),a(`completed`,e.bytes,e.bytes,g(`Artifact download completed`,`دریافت فایل کامل شد`))}catch(e){let t=e instanceof Error?e.message:String(e);a(`failed`,r,i,t),I(t)}};return me?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(te,{eyebrow:g(`Verified host updates`,`به‌روزرسانی تأییدشدهٔ میزبان`),title:g(`Firmware & updates`,`میان‌افزار و به‌روزرسانی`),detail:g(`Remote update is performed by the primary host over the board programming link; it is not MCU-native OTA.`,`به‌روزرسانی راه‌دور توسط میزبان اصلی و از مسیر پروگرام برد انجام می‌شود؛ این فرایند OTA بومی ریزکنترل‌گر نیست.`)}),(0,U.jsxs)(h,{icon:z,iconTone:`red`,title:g(`Artifact service`,`سرویس خروجی‌های ساخت`),eyebrow:g(`Unavailable`,`دردسترس نیست`),className:`updates-unavailable`,children:[(0,U.jsx)(ee,{icon:z,title:g(`Artifact service unavailable`,`سرویس خروجی‌های ساخت در دسترس نیست`),detail:me}),(0,U.jsx)(b,{icon:o,onClick:()=>void J(),children:g(`Retry typed service`,`تلاش دوباره برای سرویس`)})]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(te,{eyebrow:g(`Verified host updates`,`به‌روزرسانی تأییدشدهٔ میزبان`),title:g(`Firmware & updates`,`میان‌افزار و به‌روزرسانی`)}),oe&&(0,U.jsx)(Oe,{status:oe,locale:p}),P&&(0,U.jsxs)(`div`,{className:`update-notice${/failed|error|could not|expected/i.test(P)?` is-error`:``}`,children:[(0,U.jsx)(i,{size:17}),(0,U.jsx)(`span`,{children:P})]}),(0,U.jsxs)(`section`,{className:`updates-grid`,children:[(0,U.jsxs)(h,{icon:F,iconTone:`violet`,title:g(`Stage a local artifact`,`آماده‌سازی خروجی محلی`),eyebrow:g(`Select · hash · stage`,`انتخاب · هش · آماده‌سازی`),className:`update-source-card`,action:(0,U.jsx)(f,{tone:V&&H?`good`:`neutral`,children:V?ye?g(`HASHING`,`در حال هش`):g(`SELECTED`,`انتخاب‌شده`):g(`NO FILE`,`بدون فایل`)}),children:[(0,U.jsx)(`div`,{className:`artifact-kind-picker`,role:`radiogroup`,"aria-label":g(`Artifact kind`,`نوع خروجی`),children:Je.map(e=>(0,U.jsxs)(`button`,{role:`radio`,"aria-checked":R===e,className:R===e?`is-active`:``,onClick:()=>ge(e),children:[e===`firmware`?(0,U.jsx)(N,{}):e===`eeprom`?(0,U.jsx)(r,{}):e===`host-executable`?(0,U.jsx)(se,{}):(0,U.jsx)(j,{}),(0,U.jsx)(`span`,{children:Ze(e,p)})]},e))}),(0,U.jsx)(`input`,{ref:ze,className:`visually-hidden`,type:`file`,accept:`.hex,.eep,.bin,.exe,application/octet-stream,text/plain`,onChange:rt}),(0,U.jsxs)(`button`,{className:`artifact-drop${xe?` is-dragging`:``}`,type:`button`,onClick:()=>ze.current?.click(),onDragEnter:e=>{e.preventDefault(),Se(!0)},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`},onDragLeave:()=>Se(!1),onDrop:it,children:[ye?(0,U.jsx)(ae,{className:`spin`}):(0,U.jsx)(F,{}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:V?.name||g(`Browse for firmware, EEPROM, or readback`,`انتخاب میان‌افزار، EEPROM یا بازخوانی`)}),(0,U.jsx)(`span`,{children:V?`${T(V.size)} · SHA-256 ${Ye(H)}`:g(`The browser calculates SHA-256 locally before the host receives anything.`,`مرورگر پیش از دریافت هر چیزی توسط میزبان، SHA-256 را به‌صورت محلی محاسبه می‌کند.`)})]}),(0,U.jsx)(`span`,{children:g(`Choose file`,`انتخاب فایل`)})]}),(0,U.jsx)(b,{tone:`primary`,icon:pe,busy:A===`upload`,disabled:!V||!H||ye,onClick:()=>void at(),children:g(`Verify and stage only`,`فقط تأیید و آماده‌سازی`)})]}),(0,U.jsx)(h,{icon:de,iconTone:`accent`,title:g(`Stage from a remote source`,`آماده‌سازی از منبع راه‌دور`),eyebrow:g(`HTTPS or trusted peer`,`HTTPS یا همتای مورد اعتماد`),className:`update-source-card`,children:(0,U.jsxs)(`form`,{className:`remote-artifact-form`,onSubmit:e=>void ot(e),children:[(0,U.jsx)(S,{label:g(`Source URL`,`نشانی منبع`),type:`url`,dir:`ltr`,value:Ce,placeholder:`https://host.example/artifacts/firmware/…`,onChange:e=>we(e.target.value),hint:g(`The host respects configured proxy environment variables, validates redirects, size, and digest, then stages without programming.`,`میزبان تنظیمات پراکسی محیط را رعایت می‌کند، تغییرمسیرها، اندازه و چکیده را می‌سنجد و سپس بدون پروگرام فایل را آماده می‌کند.`)}),(0,U.jsxs)(`div`,{className:`compact-fields`,children:[(0,U.jsx)(S,{label:g(`Display name (optional)`,`نام نمایشی (اختیاری)`),value:W,onChange:e=>Ee(e.target.value)}),(0,U.jsx)(S,{label:g(`Expected SHA-256 (recommended)`,`SHA-256 مورد انتظار (پیشنهادی)`),dir:`ltr`,value:K,maxLength:64,onChange:e=>De(e.target.value.replace(/[^0-9a-f]/gi,``).toLowerCase())})]}),(0,U.jsx)(S,{label:g(`Peer bearer token (optional)`,`توکن حامل همتا (اختیاری)`),type:`password`,autoComplete:`off`,dir:`ltr`,value:q,onChange:e=>ke(e.target.value),hint:g(`Used once by the primary host for this peer download; it is not persisted or printed.`,`فقط یک‌بار توسط میزبان اصلی برای دانلود معتبر از همتا استفاده می‌شود و ذخیره یا چاپ نخواهد شد.`)}),(0,U.jsx)(b,{type:`submit`,tone:`primary`,icon:de,busy:A===`remote`,disabled:!Ce.trim(),children:g(`Download, verify and stage`,`دانلود، تأیید و آماده‌سازی`)})]})}),(0,U.jsx)(Te,{manifest:_,events:d,locale:p,openDialog:m,onArtifactsChanged:()=>void J()}),(0,U.jsxs)(h,{icon:z,iconTone:`accent`,title:g(`Update a configured peer`,`به‌روزرسانی همتای معتبر`),eyebrow:g(`Bridge-native · verified · coordinated`,`پل بومی · تأییدشده · هماهنگ`),action:(0,U.jsxs)(f,{tone:O.some(e=>e.connected)?`good`:`warn`,children:[O.filter(e=>e.connected).length,` `,g(`CONNECTED`,`متصل`)]}),children:[(0,U.jsx)(`p`,{className:`card-copy`,children:g(`Transfer the selected verified host executable over the configured bridge, perform the peer’s recoverable replacement, and wait for restart health plus an exact active-SHA acknowledgement. No SSH command or shared filesystem is used.`,`فایل اجرایی تأییدشدهٔ میزبان را از پل پیکربندی‌شده منتقل می‌کند، جایگزینی قابل‌بازیابی همتا را انجام می‌دهد و تا سلامت راه‌اندازی مجدد و تأیید دقیق SHA فعال منتظر می‌ماند. هیچ فرمان SSH یا فایل مشترکی استفاده نمی‌شود.`)}),Z&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`data-list`,children:[(0,U.jsx)(y,{label:g(`Shared peer progress · ${Z.peer}`,`پیشرفت مشترک همتا · ${Z.peer}`),value:Z.state===`completed`?g(`Restarted and active SHA verified`,`راه‌اندازی مجدد و SHA فعال تأیید شد`):Z.state===`remote-staged`?g(`Remote staged`,`آماده‌شده در راه‌دور`):Z.state===`remote-queued`?g(`Remote queued`,`در صف راه‌دور`):Z.state===`outcome-uncertain`?g(`Outcome uncertain — retry this update`,`نتیجه نامشخص است — همین به‌روزرسانی را دوباره امتحان کنید`):Z.state===`failed`?g(`Peer attempt failed`,`تلاش همتا ناموفق بود`):Z.progressKnown?`${Z.state.replaceAll(`-`,` `)} · ${Math.round(Z.progressPercent)}%`:Z.state.replaceAll(`-`,` `),tone:Z.state===`completed`&&Z.terminalVerified?`good`:Z.state===`failed`?`bad`:`warn`}),(0,U.jsx)(y,{label:g(`Transferred`,`انتقال داده`),value:Z.bytesTotal?w(Z.bytesDone??0,Z.bytesTotal):g(`Not measured for this stage`,`برای این مرحله اندازه‌گیری نشده`),mono:!0}),(0,U.jsx)(y,{label:g(`Peer operation`,`عملیات همتا`),value:Z.operationID,mono:!0}),(0,U.jsx)(y,{label:g(`Terminal replacement`,`جایگزینی نهایی`),value:Z.terminalVerified?g(`Acknowledged · active SHA matches`,`تأیید شد · SHA فعال مطابقت دارد`):g(`Waiting for health, reconnect & active SHA`,`در انتظار سلامت، اتصال دوباره و SHA فعال`),tone:Z.terminalVerified?`good`:`warn`})]}),(0,U.jsx)(`div`,{className:`update-progress${Z.progressKnown?``:` is-indeterminate`}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Z.progressKnown?Z.progressPercent:void 0,"aria-valuetext":Z.bytesTotal?w(Z.bytesDone??0,Z.bytesTotal):Z.detail,children:(0,U.jsx)(`i`,{style:Z.progressKnown?{width:`${Z.progressPercent}%`}:void 0})})]}),O.length?(0,U.jsx)(`div`,{className:`data-list`,children:O.map(e=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(y,{label:e.name,value:e.connected?g(`Connected`,`متصل`):e.last_error||g(`Disconnected`,`قطع`),tone:e.connected?`good`:`bad`}),(0,U.jsx)(`div`,{className:`inline-actions`,children:(0,U.jsx)(b,{icon:a,tone:`primary`,disabled:!e.connected||!e.allow_commands||Q?.kind!==`host-executable`||A===`peer-update`,busy:A===`peer-update`,onClick:()=>Q&&void ct(e,Q),children:g(`Review peer host update`,`بازبینی به‌روزرسانی میزبان همتا`)})})]},e.name))}):(0,U.jsx)(ee,{icon:z,title:g(`No bridge peers configured`,`هیچ همتای پلی پیکربندی نشده`),detail:g(`Add a peer in integration settings; connected peers appear here immediately.`,`یک همتای معتبر را در تنظیمات یکپارچه‌سازی بیفزایید؛ همتایان متصل فوراً اینجا ظاهر می‌شوند.`)})]}),(0,U.jsxs)(h,{icon:le,iconTone:`green`,title:g(`Embedded first-board recovery`,`بازیابی تعبیه‌شدهٔ نخستین برد`),eyebrow:g(`Verified build defaults`,`پیش‌فرض‌های تأییدشدهٔ ساخت`),action:(0,U.jsx)(f,{tone:_?.defaults_enabled?`good`:`warn`,children:_?.defaults_enabled?g(`AVAILABLE`,`موجود`):g(`NOT PACKAGED`,`بسته‌بندی نشده`)}),children:[(0,U.jsx)(`p`,{className:`card-copy`,children:g(`Enabled automatically only when the release contains both a real firmware image and a generated valid default EEPROM image. It is never auto-flashed—even a non-responsive, corrupt, or older board still requires your grant.`,`فقط وقتی خودکار فعال می‌شود که انتشار هم تصویر واقعی میان‌افزار و هم تصویر معتبرِ تولیدشده برای EEPROM پیش‌فرض داشته باشد. هرگز خودکار فلش نمی‌شود؛ حتی برد پاسخ‌گو‌نبود‌ه، خراب یا قدیمی نیز به اجازهٔ شما نیاز دارد.`)}),(0,U.jsxs)(`div`,{className:`data-list`,children:[(0,U.jsx)(y,{label:g(`Firmware`,`میان‌افزار`),value:_?.defaults.firmware?`${Ye(_.defaults.firmware.sha256)} · ${T(_.defaults.firmware.bytes)}`:g(`Missing from this host`,`در این میزبان موجود نیست`),mono:!0}),(0,U.jsx)(y,{label:g(`Default EEPROM`,`EEPROM پیش‌فرض`),value:_?.defaults.eeprom?`${Ye(_.defaults.eeprom.sha256)} · ${T(_.defaults.eeprom.bytes)}`:g(`Missing; empty .eep is never accepted`,`موجود نیست؛ فایل خالی .eep پذیرفته نمی‌شود`),mono:!0})]}),u.connected&&(0,U.jsxs)(`div`,{className:`inline-actions`,children:[(0,U.jsx)(b,{icon:se,tone:`primary`,disabled:!_?.defaults.firmware||A===`update`,onClick:()=>_?.defaults.firmware&&st(_.defaults.firmware),children:g(`Review firmware programming`,`بازبینی پروگرام میان‌افزار`)}),(0,U.jsx)(b,{icon:le,disabled:!_?.defaults.eeprom||A===`update`,onClick:()=>_?.defaults.eeprom&&st(_.defaults.eeprom),children:g(`Review EEPROM restore`,`بازبینی بازیابی EEPROM`)})]})]}),u.connected&&(0,U.jsxs)(h,{icon:l,iconTone:`amber`,title:g(`Capture this connected board`,`ثبت برد متصل`),eyebrow:g(`Flash + EEPROM · deduplicated`,`فلش + EEPROM · بدون تکرار`),action:(0,U.jsx)(f,{tone:`good`,children:u.port.name||g(`CONNECTED`,`متصل`)}),children:[(0,U.jsx)(`p`,{className:`card-copy`,children:g(`A readback is stored by content hash. Identical firmware is referenced, not copied, and the resulting flash/EEPROM artifacts can be served to configured peers or downloaded below.`,`بازخوانی بر پایهٔ هش محتوا ذخیره می‌شود. به میان‌افزار یکسان ارجاع داده می‌شود و دوباره کپی نمی‌گردد؛ خروجی فلش/EEPROM را می‌توان در اختیار همتاهای معتبر گذاشت یا از پایین دانلود کرد.`)}),(0,U.jsxs)(`div`,{className:`data-list`,children:[(0,U.jsx)(y,{label:g(`Current board`,`برد فعلی`),value:u.hello.name||e}),(0,U.jsx)(y,{label:g(`Running build`,`ساخت در حال اجرا`),value:u.hello.build_hash?u.hello.build_hash.toString(16).toUpperCase().padStart(8,`0`):`—`,mono:!0}),(0,U.jsx)(y,{label:g(`Port owner`,`مالک درگاه`),value:u.port.name||g(`automatic`,`خودکار`),mono:!0})]}),(0,U.jsx)(b,{icon:l,busy:A===`capture`,onClick:()=>lt(),children:g(`Review flash + EEPROM capture`,`بازبینی ثبت فلش + EEPROM`)})]}),u.connected&&Ge&&(0,U.jsxs)(h,{icon:ne,iconTone:`red`,title:g(`Bootloader probe failed`,`بررسی بوت‌لودر ناموفق بود`),eyebrow:g(`ISP fallback recommended`,`مسیر جایگزین ISP پیشنهاد می‌شود`),className:`isp-fallback-card`,action:(0,U.jsx)(f,{tone:`bad`,children:g(`NO BOOTLOADER ROUTE`,`بدون مسیر بوت‌لودر`)}),children:[(0,U.jsxs)(`div`,{className:`isp-guidance`,children:[(0,U.jsx)(ne,{}),(0,U.jsx)(`p`,{children:g(`The host could not enter Urboot/Urclock. Connect a supported ISP programmer; the same primary host will back up what it can, program through ISP, verify the image, and restore the application lifecycle. ISP was not suggested before this failed probe.`,`میزبان نتوانست وارد Urboot/Urclock شود. یک پروگرامر ISP پشتیبانی‌شده متصل کنید؛ همان میزبان اصلی از بخش‌های ممکن پشتیبان می‌گیرد، از طریق ISP پروگرام می‌کند، تصویر را تأیید و چرخهٔ کار برنامه را بازیابی می‌کند. پیش از این بررسی ناموفق، ISP پیشنهاد نشده بود.`)})]}),(0,U.jsxs)(`div`,{className:`inline-actions`,children:[(0,U.jsx)(b,{tone:`danger`,icon:s,disabled:!Q||Q.kind===`host-executable`,onClick:()=>Q&&st(Q,`usbasp`),children:g(`Review ISP programming`,`بازبینی پروگرام ISP`)}),(0,U.jsx)(b,{icon:n,onClick:()=>lt(`usbasp`),children:g(`Review ISP capture`,`بازبینی ثبت با ISP`)})]})]}),(0,U.jsxs)(h,{icon:j,iconTone:`violet`,title:g(`Verified artifact inventory`,`فهرست خروجی‌های تأییدشده`),eyebrow:g(`${x.length} content-addressed artifacts`,`${x.length} خروجی محتوامحور`),className:`artifact-inventory`,action:(0,U.jsxs)(f,{tone:`info`,children:[x.length,` `,g(`UNIQUE`,`یکتا`)]}),children:[x.length?(0,U.jsx)(`div`,{className:`artifact-table-wrap`,children:(0,U.jsxs)(`table`,{className:`artifact-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{"aria-label":g(`Select`,`انتخاب`)}),(0,U.jsx)(`th`,{children:g(`Artifact`,`خروجی`)}),(0,U.jsx)(`th`,{children:g(`Source`,`منبع`)}),(0,U.jsx)(`th`,{children:g(`Build / digest`,`ساخت / چکیده`)}),(0,U.jsx)(`th`,{children:g(`Size`,`اندازه`)}),(0,U.jsx)(`th`,{children:g(`Created`,`ایجاد`)}),(0,U.jsx)(`th`,{children:g(`Actions`,`عملیات`)})]})}),(0,U.jsx)(`tbody`,{children:x.map(e=>{let t=C===e.sha256,n=e.metadata,r=n?.repository||(n?.workflow_run_id?`${g(`run`,`اجرا`)} ${n.workflow_run_id}`:n?.release_id?`${g(`release`,`انتشار`)} ${n.release_id}`:``);return(0,U.jsxs)(`tr`,{className:t?`is-selected`:``,children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(`input`,{type:`radio`,name:`artifact`,checked:t,"aria-label":g(`Select ${e.name}`,`انتخاب ${e.name}`),onChange:()=>E(e.sha256)})}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{children:e.name}),(0,U.jsxs)(`span`,{children:[Ze(e.kind,p),e.embedded?g(` · embedded`,` · تعبیه‌شده`):``,e.current?g(` · current`,` · فعلی`):``]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{children:n?.provider||e.source}),r&&(0,U.jsx)(`span`,{children:r})]}),(0,U.jsxs)(`td`,{className:`mono`,children:[(0,U.jsx)(`strong`,{children:e.build_hash||Ye(e.sha256)}),(0,U.jsx)(`span`,{children:e.build_timestamp||e.sha256})]}),(0,U.jsx)(`td`,{className:`mono`,children:T(e.bytes)}),(0,U.jsx)(`td`,{children:ie(p,e.created_at)}),(0,U.jsx)(`td`,{children:(0,U.jsx)(b,{compact:!0,icon:c,onClick:()=>void ut(e),children:g(`Download`,`دانلود`)})})]},`${e.kind}-${e.sha256}`)})})]})}):(0,U.jsx)(ee,{icon:j,title:g(`No verified artifacts yet`,`هنوز خروجی تأییدشده‌ای وجود ندارد`),detail:g(`Stage a local or remote image, or capture the connected board.`,`یک تصویر محلی یا راه‌دور آماده کنید یا از برد متصل نسخه بگیرید.`)}),Q&&(0,U.jsxs)(`div`,{className:`artifact-selection`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`span`,{children:[g(`SELECTED`,`انتخاب‌شده`),` / `,Ze(Q.kind,p).toUpperCase()]}),(0,U.jsx)(`strong`,{children:Q.name}),(0,U.jsx)(`code`,{children:Q.sha256})]}),(0,U.jsx)(f,{tone:$===`same`?`good`:$===`newer`?`info`:$===`older`?`warn`:`neutral`,children:$===`same`?g(`SAME`,`یکسان`):$===`newer`?g(`NEWER`,`جدیدتر`):$===`older`?g(`OLDER`,`قدیمی‌تر`):g(`UNKNOWN`,`نامشخص`)}),$e(u.connected,Q.kind)&&(0,U.jsx)(b,{icon:Q.kind===`host-executable`?a:Q.kind===`flash-backup`?le:ce,tone:`primary`,disabled:A===`update`,onClick:()=>st(Q),children:Q.kind===`host-executable`?g(`Review host self-update`,`بازبینی به‌روزرسانی میزبان`):Q.kind===`eeprom`?g(`Review EEPROM restore`,`بازبینی بازیابی EEPROM`):Q.kind===`flash-backup`?g(`Review flash restore`,`بازبینی بازیابی فلش`):g(`Review board programming`,`بازبینی پروگرام برد`)})]})]}),(0,U.jsx)(h,{icon:z,iconTone:`accent`,title:g(`Distribution paths`,`مسیرهای توزیع`),eyebrow:g(`Serve · download · bridge`,`ارائه · دانلود · پل`),className:`update-distribution-card`,children:(0,U.jsxs)(`div`,{className:`distribution-grid`,children:[(0,U.jsxs)(`article`,{children:[(0,U.jsx)(z,{}),(0,U.jsx)(`strong`,{children:g(`Authenticated serving`,`ارائهٔ معتبر`)}),(0,U.jsx)(`p`,{children:g(`Current flash, EEPROM, firmware, host packages and backups are served by exact SHA-256 through HTTP and bridge RPC.`,`فلش فعلی، EEPROM، میان‌افزار، بسته‌های میزبان و پشتیبان‌ها با SHA-256 دقیق از طریق HTTP و RPC پل ارائه می‌شوند.`)})]}),(0,U.jsxs)(`article`,{children:[(0,U.jsx)(t,{}),(0,U.jsx)(`strong`,{children:g(`Remote synchronization`,`همگام‌سازی راه‌دور`)}),(0,U.jsx)(`p`,{children:g(`Secondary instances request staging and updates through the primary owner; they never race it for the serial port.`,`نمونه‌های ثانویه آماده‌سازی و به‌روزرسانی را از مالک اصلی درخواست می‌کنند و هرگز برای درگاه سریال با آن رقابت ندارند.`)})]}),(0,U.jsxs)(`article`,{children:[(0,U.jsx)(he,{}),(0,U.jsx)(`strong`,{children:g(`Verified replacement`,`جایگزینی تأییدشده`)}),(0,U.jsx)(`p`,{children:g(`Size, digest, packed date/time and build hash comparisons are visible before any update is authorized.`,`مقایسهٔ اندازه، چکیده، تاریخ/زمان فشرده و هش ساخت پیش از صدور مجوز هر به‌روزرسانی دیده می‌شود.`)})]})]})})]})]})}export{nt as UpdatesView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-Dmio8W6_.js b/Tools/Controller/internal/webui/dist/assets/chunk-Dmio8W6_.js deleted file mode 100644 index adcfff0b..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-Dmio8W6_.js +++ /dev/null @@ -1,3 +0,0 @@ -import{n as e,r as t}from"./chunk-C2nxElbj.js";import{n,r,t as i}from"./chunk-CTc1vKfa.js";import{t as a}from"./chunk-B9ewCnSE.js";import{n as o,t as s}from"./chunk-ME8Q1Sy7.js";import{n as c,t as l}from"./chunk-BWN4QWM7.js";import{$ as u,C as d,Dt as f,H as p,K as m,Mt as h,Q as g,U as _,V as v,W as y,Z as b,et as x,h as S,it as C,kt as w,nt as T,rt as E,x as D}from"./app-BpGu_3eg.js";var O={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};O.node;var k=f(O),A={name:`table-properties`,size:24,node:[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]};A.node;var j=f(A),M=h(w(),1),N=C(),P=[`id`,`code`,`name`,`title`,`category`,`state`,`value`,`updated_at`];function F(e){if(Array.isArray(e))return e.map(e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{value:e});if(e&&typeof e==`object`){let t=e;return Array.isArray(t.records)?F(t.records):Array.isArray(t.data)?F(t.data):[t]}return[]}function I({locale:f,t:h}){let C=(e,t)=>f===`fa`?t:e,[w,O]=(0,M.useState)(`explore`),[A,I]=(0,M.useState)(`v1/status`),[L,R]=(0,M.useState)(`GET`),[z,B]=(0,M.useState)(`{ - "query": "" -}`),[V,H]=(0,M.useState)([]),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(null),[q,J]=(0,M.useState)([]),[Y,X]=(0,M.useState)(``),Z=async()=>{W(!0);try{let e;L===`POST`&&(JSON.parse(z),e=z);let t=await d(`datahub`,A,{method:L,body:e});K(t),H(F(t));let n=A.replace(/^\/+/,``),r=`${L} /${n}`;J(e=>[r,...e.filter(e=>e!==r)].slice(0,6)),X(``)}catch(e){X(e instanceof Error?e.message:t(e))}finally{W(!1)}},Q=async()=>{W(!0);try{await D(`datahub`,A),X(``)}catch(e){X(e instanceof Error?e.message:t(e))}finally{W(!1)}},$=e=>{let t=e.indexOf(` `);R(e.slice(0,t)),I(e.slice(t+2))};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(b,{eyebrow:C(`Local data and streaming`,`داده و جریان محلی`),title:h(`data`),detail:C(`A loopback-only workbench for deliberate data exchange; no service-specific routes or credentials are embedded.`,`میزکاری محدود به شبکهٔ محلی برای تبادل آگاهانهٔ داده؛ هیچ مسیر اختصاصی سرویس یا اطلاعات دسترسی در رابط تعبیه نشده است.`),action:(0,N.jsx)(u,{tone:Y?`warn`:G?`good`:`info`,children:G?C(`RESPONSE READY`,`پاسخ آماده`):C(`IDLE`,`آماده`)})}),(0,N.jsx)(`nav`,{className:`subnav`,"aria-label":C(`Data workspace sections`,`بخش‌های فضای داده`),children:[[`explore`,l,C(`Request`,`درخواست`)],[`table`,j,`${h(`records`)} · ${S(f,V.length)}`],[`transfer`,r,C(`Transfer`,`انتقال`)]].map(([e,t,n])=>(0,N.jsxs)(`button`,{className:w===e?`is-active`:``,onClick:()=>O(e),children:[(0,N.jsx)(m,{icon:t,size:17}),n]},e))}),(0,N.jsx)(E,{initial:!1,children:Y&&(0,N.jsxs)(T.div,{className:`integration-banner`,role:`alert`,initial:{height:0,marginBottom:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(5px)`},animate:{height:`auto`,marginBottom:14,opacity:1,clipPath:`inset(0 0 0% 0)`,filter:`blur(0px)`},exit:{height:0,marginBottom:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(4px)`},transition:{duration:.28,ease:[.22,1,.36,1]},children:[(0,N.jsx)(o,{size:19}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`strong`,{children:h(`unavailable`)}),(0,N.jsx)(`p`,{children:Y})]})]},`data-workspace-error`)}),w===`explore`&&(0,N.jsxs)(`section`,{className:`operations-grid`,children:[(0,N.jsxs)(p,{icon:s,iconTone:`violet`,title:C(`Request composer`,`ساخت درخواست`),eyebrow:C(`Authenticated host route`,`مسیر معتبر میزبان`),children:[(0,N.jsxs)(`div`,{className:`setting-group`,children:[(0,N.jsx)(`label`,{children:C(`Method`,`روش`)}),(0,N.jsx)(g,{value:L,label:C(`HTTP method`,`روش HTTP`),options:[{value:`GET`,label:`GET`},{value:`POST`,label:`POST`}],onChange:R})]}),(0,N.jsx)(x,{label:C(`Relative data path`,`مسیر نسبی داده`),dir:`ltr`,spellCheck:!1,value:A,placeholder:`v1/status`,onChange:e=>I(e.target.value),hint:C(`The upstream origin comes only from persistent host configuration.`,`مبدأ بالادستی فقط از پیکربندی ماندگار میزبان خوانده می‌شود.`)}),L===`POST`&&(0,N.jsxs)(`label`,{className:`payload-field`,children:[(0,N.jsx)(`span`,{children:C(`JSON body`,`بدنهٔ JSON`)}),(0,N.jsx)(`textarea`,{dir:`ltr`,spellCheck:!1,value:z,onChange:e=>B(e.target.value)})]}),(0,N.jsx)(v,{tone:`primary`,icon:s,busy:U,disabled:!A.trim(),onClick:()=>void Z(),children:C(`Send request`,`ارسال درخواست`)})]}),(0,N.jsx)(p,{icon:k,iconTone:`accent`,title:C(`Response`,`پاسخ`),eyebrow:G===null?C(`No response`,`بدون پاسخ`):C(`${V.length} projected records`,`${S(f,V.length)} رکورد استخراج‌شده`),className:`operation-result`,children:(0,N.jsx)(`pre`,{className:`operation-output`,dir:`ltr`,children:G===null?C(`Run a request to inspect the response.`,`برای بررسی پاسخ، یک درخواست اجرا کنید.`):typeof G==`string`?G:t(G,!0)})}),(0,N.jsx)(p,{icon:i,iconTone:`green`,title:C(`Recent local requests`,`درخواست‌های محلی اخیر`),eyebrow:C(`${q.length} in this tab`,`${S(f,q.length)} مورد در این زبانه`),children:(0,N.jsx)(`div`,{className:`command-chips`,children:q.length?q.map(e=>(0,N.jsx)(`button`,{dir:`ltr`,onClick:()=>$(e),children:e},e)):(0,N.jsx)(`p`,{className:`card-copy`,children:C(`No requests in this browser session.`,`در این نشست مرورگر هنوز درخواستی اجرا نشده است.`)})})})]}),w===`table`&&(0,N.jsxs)(p,{icon:j,iconTone:`violet`,className:`records-card`,title:`${h(`records`)} · ${S(f,V.length)}`,eyebrow:C(`Typed local collection`,`مجموعهٔ محلی نوع‌دار`),children:[(0,N.jsx)(e,{records:V,preferredFields:P,locale:f,direction:f===`fa`?`rtl`:`ltr`,ariaLabel:C(`Data workspace records`,`رکوردهای فضای داده`),filename:`data-workspace`,preserveViewportAnchor:!0,empty:(0,N.jsx)(y,{icon:n,title:C(`No tabular records`,`رکورد جدولی موجود نیست`),detail:C(`Run a request to inspect a structured response as a typed collection.`,`یک درخواست اجرا کنید تا پاسخ ساخت‌یافته را به‌صورت مجموعهٔ نوع‌دار بررسی کنید.`)})}),(0,N.jsxs)(`footer`,{className:`table-footer`,children:[(0,N.jsxs)(`span`,{children:[V.length,` `,C(`records`,`رکورد`)]}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(c,{size:15}),` `,C(`Credentials stripped`,`اطلاعات دسترسی حذف شده`)]}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(r,{size:15}),` `,h(`rangeReady`)]})]})]}),w===`transfer`&&(0,N.jsxs)(`section`,{className:`system-grid`,children:[(0,N.jsx)(p,{icon:a,iconTone:`accent`,title:C(`Streaming download`,`دانلود جریانی`),eyebrow:A.trim()?`/${A.replace(/^\/+/,``)}`:C(`No path selected`,`مسیری انتخاب نشده`),children:A.trim()&&(0,N.jsx)(v,{icon:a,busy:U,onClick:()=>void Q(),children:C(`Download current path`,`دانلود مسیر فعلی`)})}),(0,N.jsx)(p,{icon:c,iconTone:`green`,title:C(`Boundary status`,`وضعیت مرز امنیتی`),eyebrow:Y?C(`Request rejected`,`درخواست رد شد`):C(`Host mediated`,`با میانجی‌گری میزبان`),children:(0,N.jsxs)(`div`,{className:`data-list`,children:[(0,N.jsx)(_,{label:C(`Upstream`,`بالادست`),value:C(`Configured loopback root`,`ریشهٔ محلی پیکربندی‌شده`)}),(0,N.jsx)(_,{label:C(`Credentials`,`اطلاعات دسترسی`),value:C(`Removed before forwarding`,`پیش از ارسال حذف می‌شود`),tone:`good`}),(0,N.jsx)(_,{label:C(`Redirect selection`,`انتخاب تغییرمسیر`),value:C(`Host-owned`,`در اختیار میزبان`)}),(0,N.jsx)(_,{label:C(`Range requests`,`درخواست‌های بازه‌ای`),value:C(`Preserved`,`حفظ می‌شوند`),tone:`good`})]})}),(0,N.jsx)(p,{icon:l,iconTone:`violet`,title:C(`Current response`,`پاسخ فعلی`),eyebrow:G===null?C(`No response`,`بدون پاسخ`):typeof G==`string`?C(`Text`,`متن`):C(`Structured data`,`دادهٔ ساخت‌یافته`),children:G!==null&&(0,N.jsx)(`pre`,{className:`operation-output`,dir:`ltr`,children:typeof G==`string`?G:t(G,!0)})})]})]})}export{I as DataWorkspaceView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-D76V6mr9.js b/Tools/Controller/internal/webui/dist/assets/chunk-Dmz4i1nq.js similarity index 81% rename from Tools/Controller/internal/webui/dist/assets/chunk-D76V6mr9.js rename to Tools/Controller/internal/webui/dist/assets/chunk-Dmz4i1nq.js index a3492600..7c4d9ccc 100644 --- a/Tools/Controller/internal/webui/dist/assets/chunk-D76V6mr9.js +++ b/Tools/Controller/internal/webui/dist/assets/chunk-Dmz4i1nq.js @@ -1 +1 @@ -import{n as e}from"./chunk-DvGrMMmP.js";import{a as t,i as n,r}from"./chunk-ME8Q1Sy7.js";import{Ct as i,Dt as a,V as o,it as s}from"./app-BpGu_3eg.js";var c={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};c.node;var l=a(c),u={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};u.node;var d=a(u),f={name:`list-restart`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M7 12H3`,key:`13ou7f`}],[`path`,{d:`M7 19H3`,key:`wbqt3n`}],[`path`,{d:`M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14`,key:`qth677`}],[`path`,{d:`M11 10v4h4`,key:`172dkj`}]]};f.node;var p=a(f),m={name:`memory-stick`,size:24,node:[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]};m.node;var h=a(m),g={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};g.node;var _=a(g),v={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};v.node;var y=a(v),b={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};b.node;var x=a(b),S={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};S.node;var C=a(S),w={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};w.node;var T=a(w),E={name:`thermometer`,size:24,node:[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]};E.node;var D=a(E),O={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};O.node;var k=a(O),A={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};A.node;var j=a(A),M={name:`waves-horizontal`,size:24,node:[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]],aliases:[`waves`]};M.node;var N=a(M);function P(e,t,n){return!!(n&&n!==t&&n!==e)}function F(e,t){return e===`ArrowUp`?-1:e===`ArrowDown`?1:e===`ArrowLeft`?t===`rtl`?1:-1:e===`ArrowRight`?t===`rtl`?-1:1:null}var I=s();function L({copy:t,editing:a,cards:s,hidden:c,onToggleEditing:l,onShow:u,onReset:d}){let f=s.filter(({id:e})=>c.includes(e));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o,{compact:!0,className:`card-layout-editor__toggle`,icon:a?i:r,"aria-pressed":a,onClick:l,children:a?t.done:t.customize}),a&&(0,I.jsxs)(`div`,{className:`card-layout-editor`,role:`toolbar`,"aria-label":t.customize,children:[f.length>0&&(0,I.jsxs)(`div`,{className:`card-layout-editor__hidden`,children:[(0,I.jsx)(`span`,{children:t.hidden}),f.map(({id:e,label:r})=>(0,I.jsxs)(o,{compact:!0,icon:n,onClick:()=>u(e),children:[t.show,` `,r]},e))]}),(0,I.jsx)(o,{compact:!0,tone:`ghost`,icon:e,onClick:d,children:t.reset})]})]})}function R({id:e,title:n,order:i,collapsed:a,hidden:o,editing:s,dragging:c,copy:l,onToggleCollapsed:u,onHide:f,onReorderStart:p,onReorderMove:m,onReorderEnd:h,onKeyboardReorder:g,children:_}){return o?null:(0,I.jsxs)(`section`,{className:`card-layout-frame${s?` is-editing`:``}${a?` is-collapsed`:``}${c?` is-dragging`:``}`,"data-layout-card-id":e,style:{order:i},children:[(s||a)&&(0,I.jsxs)(`div`,{className:`card-layout-frame__toolbar`,children:[s&&(0,I.jsx)(`button`,{type:`button`,className:`card-layout-frame__reorder`,title:`${l.move} ${n}`,"aria-label":`${l.move} ${n}`,onPointerDown:t=>{t.button===0&&t.isPrimary&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),p(e,t.clientX,t.clientY))},onPointerMove:t=>{t.currentTarget.hasPointerCapture(t.pointerId)&&m(e,t.clientX,t.clientY)},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h()},onPointerCancel:h,onLostPointerCapture:h,onKeyDown:t=>{let n=document.documentElement.dir===`rtl`?`rtl`:`ltr`,r=F(t.key,n);r!==null&&(t.preventDefault(),g(e,r))},children:(0,I.jsx)(r,{size:16})}),(0,I.jsx)(`strong`,{children:n}),(0,I.jsx)(`button`,{type:`button`,title:`${a?l.expand:l.collapse} ${n}`,"aria-label":`${a?l.expand:l.collapse} ${n}`,"aria-expanded":!a,onClick:u,children:(0,I.jsx)(d,{size:16})}),s&&(0,I.jsx)(`button`,{type:`button`,title:`${l.hide} ${n}`,"aria-label":`${l.hide} ${n}`,onClick:f,children:(0,I.jsx)(t,{size:16})})]}),!a&&_]})}function z(e){return`pccontroller.${e}-layout`}function B(e){return{order:[...e],collapsed:[],hidden:[]}}function V(e,t){let n=new Set(t),r=e=>{let t=new Set;return(e??[]).filter(e=>!n.has(e)||t.has(e)?!1:(t.add(e),!0))},i=r(e?.order);return i.push(...t.filter(e=>!i.includes(e))),{order:i,collapsed:r(e?.collapsed),hidden:r(e?.hidden)}}function H(e,t,n=typeof localStorage>`u`?null:localStorage){try{return V(JSON.parse(n?.getItem(z(e))??`null`),t)}catch{return B(t)}}function U(e,t,n,r=typeof localStorage>`u`?null:localStorage){try{r?.setItem(z(e),JSON.stringify(V(n,t)))}catch{}}function W(e,t=typeof localStorage>`u`?null:localStorage){try{t?.removeItem(z(e))}catch{}}function G(e,t,n){if(t===n)return e;let r=e.order.indexOf(t),i=e.order.indexOf(n);if(r<0||i<0)return e;let a=e.order.filter(e=>e!==t),o=a.indexOf(n)+ +(re!==t):[...e,t]}export{_,K as a,d as b,P as c,k as d,D as f,y as g,x as h,U as i,N as l,C as m,G as n,L as o,T as p,W as r,R as s,H as t,j as u,h as v,l as x,p as y}; \ No newline at end of file +import{n as e}from"./chunk-BT8krml-.js";import{a as t,i as n,r}from"./chunk-BgHNRN_V.js";import{At as i,J as a,Pt as o,dt as s}from"./app-BxYXetji.js";var c={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};c.node;var l=o(c),u={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};u.node;var d=o(u),f={name:`list-restart`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M7 12H3`,key:`13ou7f`}],[`path`,{d:`M7 19H3`,key:`wbqt3n`}],[`path`,{d:`M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14`,key:`qth677`}],[`path`,{d:`M11 10v4h4`,key:`172dkj`}]]};f.node;var p=o(f),m={name:`memory-stick`,size:24,node:[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]};m.node;var h=o(m),g={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};g.node;var _=o(g),v={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};v.node;var y=o(v),b={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};b.node;var x=o(b),S={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};S.node;var C=o(S),w={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};w.node;var T=o(w),E={name:`thermometer`,size:24,node:[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]};E.node;var D=o(E),O={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};O.node;var k=o(O),A={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};A.node;var j=o(A),M={name:`waves-horizontal`,size:24,node:[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]],aliases:[`waves`]};M.node;var N=o(M);function P(e,t,n){return!!(n&&n!==t&&n!==e)}function F(e,t){return e===`ArrowUp`?-1:e===`ArrowDown`?1:e===`ArrowLeft`?t===`rtl`?1:-1:e===`ArrowRight`?t===`rtl`?-1:1:null}var I=s();function L({copy:t,editing:o,cards:s,hidden:c,onToggleEditing:l,onShow:u,onReset:d}){let f=s.filter(({id:e})=>c.includes(e));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{compact:!0,className:`card-layout-editor__toggle`,icon:o?i:r,"aria-pressed":o,onClick:l,children:o?t.done:t.customize}),o&&(0,I.jsxs)(`div`,{className:`card-layout-editor`,role:`toolbar`,"aria-label":t.customize,children:[f.length>0&&(0,I.jsxs)(`div`,{className:`card-layout-editor__hidden`,children:[(0,I.jsx)(`span`,{children:t.hidden}),f.map(({id:e,label:r})=>(0,I.jsxs)(a,{compact:!0,icon:n,onClick:()=>u(e),children:[t.show,` `,r]},e))]}),(0,I.jsx)(a,{compact:!0,tone:`ghost`,icon:e,onClick:d,children:t.reset})]})]})}function R({id:e,title:n,order:i,collapsed:a,hidden:o,editing:s,dragging:c,copy:l,onToggleCollapsed:u,onHide:f,onReorderStart:p,onReorderMove:m,onReorderEnd:h,onKeyboardReorder:g,children:_}){return o?null:(0,I.jsxs)(`section`,{className:`card-layout-frame${s?` is-editing`:``}${a?` is-collapsed`:``}${c?` is-dragging`:``}`,"data-layout-card-id":e,style:{order:i},children:[(s||a)&&(0,I.jsxs)(`div`,{className:`card-layout-frame__toolbar`,children:[s&&(0,I.jsx)(`button`,{type:`button`,className:`card-layout-frame__reorder`,title:`${l.move} ${n}`,"aria-label":`${l.move} ${n}`,onPointerDown:t=>{t.button===0&&t.isPrimary&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),p(e,t.clientX,t.clientY))},onPointerMove:t=>{t.currentTarget.hasPointerCapture(t.pointerId)&&m(e,t.clientX,t.clientY)},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h()},onPointerCancel:h,onLostPointerCapture:h,onKeyDown:t=>{let n=document.documentElement.dir===`rtl`?`rtl`:`ltr`,r=F(t.key,n);r!==null&&(t.preventDefault(),g(e,r))},children:(0,I.jsx)(r,{size:16})}),(0,I.jsx)(`strong`,{children:n}),(0,I.jsx)(`button`,{type:`button`,title:`${a?l.expand:l.collapse} ${n}`,"aria-label":`${a?l.expand:l.collapse} ${n}`,"aria-expanded":!a,onClick:u,children:(0,I.jsx)(d,{size:16})}),s&&(0,I.jsx)(`button`,{type:`button`,title:`${l.hide} ${n}`,"aria-label":`${l.hide} ${n}`,onClick:f,children:(0,I.jsx)(t,{size:16})})]}),!a&&_]})}function z(e){return`pccontroller.${e}-layout`}function B(e){return{order:[...e],collapsed:[],hidden:[]}}function V(e,t){let n=new Set(t),r=e=>{let t=new Set;return(e??[]).filter(e=>!n.has(e)||t.has(e)?!1:(t.add(e),!0))},i=r(e?.order);return i.push(...t.filter(e=>!i.includes(e))),{order:i,collapsed:r(e?.collapsed),hidden:r(e?.hidden)}}function H(e,t,n=typeof localStorage>`u`?null:localStorage){try{return V(JSON.parse(n?.getItem(z(e))??`null`),t)}catch{return B(t)}}function U(e,t,n,r=typeof localStorage>`u`?null:localStorage){try{r?.setItem(z(e),JSON.stringify(V(n,t)))}catch{}}function W(e,t=typeof localStorage>`u`?null:localStorage){try{t?.removeItem(z(e))}catch{}}function G(e,t,n){if(t===n)return e;let r=e.order.indexOf(t),i=e.order.indexOf(n);if(r<0||i<0)return e;let a=e.order.filter(e=>e!==t),o=a.indexOf(n)+ +(re!==t):[...e,t]}export{_,K as a,d as b,P as c,k as d,D as f,y as g,x as h,U as i,N as l,C as m,G as n,L as o,T as p,W as r,R as s,H as t,j as u,h as v,l as x,p as y}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-DvGrMMmP.js b/Tools/Controller/internal/webui/dist/assets/chunk-DvGrMMmP.js deleted file mode 100644 index 3a761cc1..00000000 --- a/Tools/Controller/internal/webui/dist/assets/chunk-DvGrMMmP.js +++ /dev/null @@ -1 +0,0 @@ -import{Dt as e}from"./app-BpGu_3eg.js";var t={name:`binary`,size:24,node:[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]};t.node;var n=e(t),r={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};r.node;var i=e(r),a={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};a.node;var o=e(a),s={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};s.node;var c=e(s),l={name:`usb`,size:24,node:[[`circle`,{cx:`10`,cy:`7`,r:`1`,key:`dypaad`}],[`circle`,{cx:`4`,cy:`20`,r:`1`,key:`22iqad`}],[`path`,{d:`M4.7 19.3 19 5`,key:`1enqfc`}],[`path`,{d:`m21 3-3 1 2 2Z`,key:`d3ov82`}],[`path`,{d:`M9.26 7.68 5 12l2 5`,key:`1esawj`}],[`path`,{d:`m10 14 5 2 3.5-3.5`,key:`v8oal5`}],[`path`,{d:`m18 12 1-1 1 1-1 1Z`,key:`1bh22v`}]]};l.node;var u=e(l);export{n as a,i,c as n,o as r,u as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-FwOzfXMP.js b/Tools/Controller/internal/webui/dist/assets/chunk-FwOzfXMP.js new file mode 100644 index 00000000..7a54f28a --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/chunk-FwOzfXMP.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunk-CvBDG8li.js","assets/app-BxYXetji.js","assets/index-B-6g0IjL.css"])))=>i.map(i=>d[i]); +import{n as e,t}from"./chunk-DIrhZHWK.js";import{i as n,n as r,r as i,t as a}from"./chunk-BT8krml-.js";import{_ as o,a as s,c,d as l,f as u,g as d,h as f,i as p,l as ee,m,n as h,o as g,p as _,r as v,s as te,t as y,u as ne,v as b,x,y as S}from"./chunk-Dmz4i1nq.js";import{t as C}from"./chunk-DDsZ2KKt.js";import{n as w,t as re}from"./chunk-BgHNRN_V.js";import{n as T,t as E}from"./chunk-B5OrbcTy.js";import{B as D,C as O,E as k,Et as A,F as j,G as ie,H as ae,I as oe,It as M,J as N,K as se,L as P,M as F,Nt as ce,Ot as I,P as le,Pt as L,Q as ue,R as de,St as fe,T as pe,Tt as me,U as he,V as ge,W as _e,X as R,Y as z,Z as ve,_ as ye,_t as B,at as V,bt as be,c as xe,ct as H,d as Se,dt as Ce,et as we,f as Te,g as Ee,gt as De,h as Oe,ht as ke,i as Ae,it as je,l as Me,lt as Ne,m as Pe,mt as Fe,nt as U,ot as W,p as Ie,q as Le,rt as Re,s as ze,st as Be,t as Ve,tt as He,u as Ue,ut as We,w as Ge,wt as Ke,x as qe,y as Je,yt as Ye,z as Xe,zt as G}from"./app-BxYXetji.js";var Ze={name:`chart-no-axes-combined`,size:24,node:[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14.639V21`,key:`1s85h0`}],[`path`,{d:`M20 10.656V21`,key:`q45596`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18.463V21`,key:`1otddq`}],[`path`,{d:`M8 14.656V21`,key:`1t2idw`}]]};Ze.node;var Qe=L(Ze),$e={name:`circle-power`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 7v4`,key:`xawao1`}],[`path`,{d:`M7.998 9.003a5 5 0 1 0 8-.005`,key:`1pek45`}]],aliases:[`power-circle`]};$e.node;var et=L($e),tt={name:`circuit-board`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]};tt.node;var nt=L(tt),rt={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};rt.node;var it=L(rt),at={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};at.node;var ot=L(at),st={name:`heart-pulse`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]};st.node;var ct=L(st),lt={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};lt.node;var K=L(lt),ut={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};ut.node;var dt=L(ut),ft={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};ft.node;var pt=L(ft),mt={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};mt.node;var ht=L(mt),gt={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};gt.node;var _t=L(gt),vt={name:`timer-reset`,size:24,node:[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]};vt.node;var yt=L(vt),bt={name:`toggle-right`,size:24,node:[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};bt.node;var xt=L(bt),St={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};St.node;var Ct=L(St),q=G(M(),1),J=Ce();function wt(e){let t=e.kind.toLowerCase();return t.includes(`error`)||t.includes(`fault`)||t.includes(`hot`)?`bad`:t.includes(`warning`)||t.includes(`door`)||t.includes(`disconnect`)?`warn`:t.includes(`connect`)||t.includes(`ready`)||t.includes(`complete`)?`good`:`info`}function Tt(e){return e.text||e.reason||e.state}function Et({events:n,locale:r,t:i,limit:a=6,toolbar:o=!1}){let s=(e,t)=>r===`fa`?t:e,c=(0,q.useMemo)(()=>[{id:`time`,label:s(`Time`,`زمان`),get:e=>e.time,width:142},{id:`kind`,label:s(`Type`,`نوع`),get:e=>e.kind,width:165},{id:`message`,label:s(`Message`,`پیام`),get:Tt,width:330},{id:`source`,label:s(`Source`,`مبدأ`),get:e=>e.source,width:170,visible:o},{id:`metadata`,label:s(`Metadata`,`فراداده`),get:e=>e.metadata,width:270,visible:o}],[r,o]),l=n.slice(0,a);return(0,J.jsx)(e,{records:l,fields:c,locale:r,direction:r===`fa`?`rtl`:`ltr`,ariaLabel:s(`Controller event collection`,`مجموعهٔ رویدادهای کنترلر`),filename:`controller-events`,toolbar:o,windowSize:120,preserveViewportAnchor:!0,className:`typed-collection--events${o?``:` typed-collection--compact`}`,rowKey:e=>`${e.id}:${e.time}`,rowClassName:e=>`typed-collection__row--${wt(e)}`,renderCell:(e,n,i)=>{if(e.id===`time`)return(0,J.jsx)(`time`,{dateTime:i.time,children:qe(r,i.time)});if(e.id===`kind`)return(0,J.jsx)(`strong`,{className:`typed-collection__event-kind`,children:i.kind});if(e.id===`message`)return(0,J.jsxs)(`div`,{className:`typed-collection__event-copy`,children:[(0,J.jsx)(`span`,{className:`typed-collection__event-message`,dir:`auto`,children:Tt(i)||`—`}),!o&&i.metadata&&Object.keys(i.metadata).length>0&&(0,J.jsx)(t,{value:i.metadata,label:s(`Expand event metadata`,`نمایش فرادادهٔ رویداد`)})]});if(e.id===`metadata`&&i.metadata&&Object.keys(i.metadata).length)return(0,J.jsx)(t,{value:i.metadata,label:s(`Expand event metadata`,`نمایش فرادادهٔ رویداد`)});if(n===void 0)return(0,J.jsx)(`span`,{"aria-hidden":`true`,children:`—`})},empty:(0,J.jsx)(ve,{icon:ce,title:i(`noEvents`),detail:i(`eventStream`)})})}var Dt=[{value:`app page dashboard`,group:`navigation`,label:{en:`Open dashboard`,fa:`باز کردن داشبورد`}},{value:`app page controls`,group:`navigation`,label:{en:`Open controls`,fa:`باز کردن کنترل‌ها`}},{value:`app page workbench`,group:`navigation`,label:{en:`Open workbench`,fa:`باز کردن میزکار`}},{value:`app page updates`,group:`navigation`,label:{en:`Open updates`,fa:`باز کردن به‌روزرسانی‌ها`}},{value:`app page settings`,group:`navigation`,label:{en:`Open settings`,fa:`باز کردن تنظیمات`}},{value:`app page events`,group:`navigation`,label:{en:`Open event timeline`,fa:`باز کردن رویدادها`}},{value:`status`,group:`diagnostics`,label:{en:`Read controller status`,fa:`خواندن وضعیت کنترلر`}},{value:`os facts system`,group:`diagnostics`,label:{en:`Read host system facts`,fa:`خواندن اطلاعات سیستم میزبان`}},{value:`os facts serial`,group:`diagnostics`,label:{en:`Inspect host serial ports`,fa:`بررسی درگاه‌های سریال میزبان`}},{value:`relay off`,group:`safety`,label:{en:`Turn all outputs off`,fa:`خاموش کردن همه خروجی‌ها`}}],Ot=new Set([`Alt`,`AltGraph`,`Control`,`Meta`,`OS`,`Shift`,`Super`,`Win`,`Windows`]),kt={Backspace:`BACKSPACE`,Tab:`TAB`,Enter:`ENTER`,Escape:`ESC`,Esc:`ESC`," ":`SPACE`,Space:`SPACE`,Spacebar:`SPACE`,PageUp:`PAGEUP`,PageDown:`PAGEDOWN`,End:`END`,Home:`HOME`,ArrowLeft:`LEFT`,Left:`LEFT`,ArrowUp:`UP`,Up:`UP`,ArrowRight:`RIGHT`,Right:`RIGHT`,ArrowDown:`DOWN`,Down:`DOWN`,Insert:`INSERT`,Delete:`DELETE`,Del:`DELETE`,AudioVolumeMute:`VOLUME_MUTE`,VolumeMute:`VOLUME_MUTE`,AudioVolumeDown:`VOLUME_DOWN`,VolumeDown:`VOLUME_DOWN`,AudioVolumeUp:`VOLUME_UP`,VolumeUp:`VOLUME_UP`,MediaTrackNext:`MEDIA_NEXT`,MediaNextTrack:`MEDIA_NEXT`,MediaTrackPrevious:`MEDIA_PREVIOUS`,MediaPreviousTrack:`MEDIA_PREVIOUS`,MediaStop:`MEDIA_STOP`,MediaPlayPause:`MEDIA_PLAY_PAUSE`},At={ESC:`Esc`,BACKSPACE:`Backspace`,TAB:`Tab`,ENTER:`Enter`,SPACE:`Space`,PAGEUP:`Page Up`,PAGEDOWN:`Page Down`,END:`End`,HOME:`Home`,LEFT:`←`,UP:`↑`,RIGHT:`→`,DOWN:`↓`,INSERT:`Insert`,DELETE:`Delete`,VOLUME_MUTE:`Mute`,VOLUME_DOWN:`Volume Down`,VOLUME_UP:`Volume Up`,MEDIA_NEXT:`Media Next`,MEDIA_PREVIOUS:`Media Previous`,MEDIA_STOP:`Media Stop`,MEDIA_PLAY_PAUSE:`Play/Pause`};function jt(e){let t=e.code??``;return/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^F(?:[1-9]|1[0-9]|2[0-4])$/.test(t)?t:kt[e.key]||(/^F(?:[1-9]|1[0-9]|2[0-4])$/i.test(e.key)||/^[a-z0-9]$/i.test(e.key)?e.key.toUpperCase():null)}function Mt(e){if(e.repeat||e.isComposing||e.keyCode===229||e.key===`Process`||e.key===`Dead`||e.key===`Unidentified`||Ot.has(e.key)||e.getModifierState?.(`AltGraph`))return null;let t=jt(e);if(!t)return null;let n=[];if(e.ctrlKey&&n.push(`Ctrl`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),e.metaKey&&n.push(`Win`),n.length===0&&!/^F(?:[1-9]|1[0-9]|2[0-4])$/.test(t))return null;let r=[...n,t].join(`+`);return{canonical:r,keys:Y(r)}}function Y(e){return e.split(`+`).map(e=>e.trim()).filter(Boolean).map(e=>At[e.toUpperCase()]??{CTRL:`Ctrl`,CONTROL:`Ctrl`,ALT:`Alt`,OPTION:`Alt`,SHIFT:`Shift`,WIN:`Win`,WINDOWS:`Win`,META:`Win`,SUPER:`Win`}[e.toUpperCase()]??e)}function X(e){return new TextEncoder().encode(e).length}function Nt(e,t){let n=``;for(let r of e){if(X(n+r)>t)break;n+=r}return n}function Pt(e){return Nt(e.normalize(`NFKC`).replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,``).replace(/\s+/g,` `).trimStart(),64)}function Ft(e){return Dt.some(t=>t.value===e)}function It(e){let t=e.status;if(!t)return{state:`unavailable`,detail:`The host did not expose registrar status.`};if(t.last_error)return{state:`error`,detail:t.last_error};if(!t.supported)return{state:`error`,detail:`Global hotkeys are not supported by this host.`};let n=e.bindings.filter(e=>e.enabled),r=t.bindings??[];if(n.length===0)return!t.running&&r.length===0?{state:`idle`,detail:`No global shortcuts are enabled.`}:{state:`pending`,detail:`The host is removing the previous shortcuts.`};if(!t.running)return{state:`pending`,detail:`The host registrar has not started yet.`};if(n.length!==r.length)return{state:`pending`,detail:`The host is reconciling the shortcut set.`};let i=new Map(r.map(e=>[e.name.toLocaleLowerCase(`en-US`),e]));for(let e of n){let t=i.get(e.name.toLocaleLowerCase(`en-US`));if(!t||t.accelerator!==e.chord||t.command!==e.command)return{state:`pending`,detail:`The host has not confirmed ${e.name} yet.`}}return{state:`active`,detail:`${n.length} global shortcut${n.length===1?``:`s`} active.`}}var Lt=new Set([`Alt`,`AltGraph`,`Control`,`Meta`,`OS`,`Shift`,`Super`,`Win`,`Windows`]);function Z(e,t,n){return e===`fa`?n:t}function Rt(e,t,n){if(n.state===`active`){let n=t.bindings.filter(e=>e.enabled).length;return e===`fa`?`${k(`fa`,n)} میانبر سراسری فعال است.`:`${n} global ${n===1?`shortcut is`:`shortcuts are`} active.`}return n.state===`idle`?Z(e,`No global shortcuts are enabled.`,`هیچ میانبر سراسری فعالی وجود ندارد.`):n.detail}function Q(e,t){return new Promise(n=>{if(t.aborted){n(!1);return}let r=window.setTimeout(()=>{t.removeEventListener(`abort`,i),n(!0)},e),i=()=>{window.clearTimeout(r),n(!1)};t.addEventListener(`abort`,i,{once:!0})})}function zt({chord:e}){return(0,J.jsx)(we,{keys:Y(e)})}function Bt({locale:e}){let[t,n]=(0,q.useState)(null),[r,a]=(0,q.useState)(!0),[s,c]=(0,q.useState)(``),[u,d]=(0,q.useState)(null),[p,ee]=(0,q.useState)(``),[m,h]=(0,q.useState)(``),[g,_]=(0,q.useState)(Dt[0].value),[v,te]=(0,q.useState)(!0),[y,ne]=(0,q.useState)(!1),[b,x]=(0,q.useState)(!1),[S,w]=(0,q.useState)(!1),[re,E]=(0,q.useState)(``),[D,O]=(0,q.useState)(`info`),[k,A]=(0,q.useState)(!1),j=(0,q.useRef)(null),ie=(0,q.useRef)(null),ae=(0,q.useRef)(null),oe=e=>{d(e.name),ee(e.name),h(e.chord),_(e.command),te(e.enabled),ne(!1),A(!1),E(``)},M=(t=!1)=>{d(null),ee(``),h(``),_(Dt[0].value),te(!0),ne(!1),A(!1),E(Z(e,`Name the shortcut, record its keys, then choose an action.`,`میانبر را نام‌گذاری کنید، کلیدها را ضبط و سپس یک کنش انتخاب کنید.`)),O(`info`),t&&window.requestAnimationFrame(()=>ie.current?.focus())},se=async(e,t=!1)=>{c(``);try{let r=await F(`controller.hotkeys.get`,{},e);if(n(r),t){let e=r.bindings[0];e?oe(e):M()}return r}catch(t){if(e?.aborted)return null;let n=t instanceof Error?t.message:String(t);return c(n),null}finally{e?.aborted||a(!1)}};(0,q.useEffect)(()=>{let e=new AbortController;return se(e.signal,!0),()=>{e.abort(),ae.current?.abort()}},[]);let P=(0,q.useMemo)(()=>t?.bindings.find(e=>e.name.toLocaleLowerCase(`en-US`)===u?.toLocaleLowerCase(`en-US`)),[u,t]),ce=Pt(p).trim(),I=t?.bindings.some(e=>e.name.toLocaleLowerCase(`en-US`)===ce.toLocaleLowerCase(`en-US`)&&e.name.toLocaleLowerCase(`en-US`)!==u?.toLocaleLowerCase(`en-US`))??!1,le=t?.bindings.some(e=>e.chord===m&&e.name.toLocaleLowerCase(`en-US`)!==u?.toLocaleLowerCase(`en-US`))??!1,L=ce?I?Z(e,`That name is already in use.`,`این نام قبلاً استفاده شده است.`):``:Z(e,`A binding name is required.`,`نام میانبر الزامی است.`),ue=m?le?Z(e,`That key combination is already assigned.`,`این ترکیب کلید قبلاً اختصاص یافته است.`):``:Z(e,`Record a supported key combination.`,`یک ترکیب کلید پشتیبانی‌شده ضبط کنید.`),de=Ft(g)?``:Z(e,`Choose an approved action before saving.`,`پیش از ذخیره، یک کنش تأییدشده انتخاب کنید.`),fe=p?L:``,pe=m?ue:``,he=!L&&!ue&&!de,ge=!P||P.enabled!==v||P.chord!==m||P.command!==g,_e=t?It(t):null,R=!!(t?.apply_pending||S),ve=!R&&_e?.state===`error`?_e.detail:``,ye=ve?`danger`:D,B=r?{tone:`neutral`,label:Z(e,`Synchronizing`,`همگام‌سازی`)}:s?{tone:`bad`,label:Z(e,`Unavailable`,`دردسترس نیست`)}:R?{tone:`warn`,label:Z(e,`Apply pending`,`در انتظار اعمال`)}:_e?.state===`active`?{tone:`good`,label:Z(e,`Active`,`فعال`)}:_e?.state===`error`?{tone:`bad`,label:Z(e,`Registration failed`,`ثبت ناموفق`)}:_e?.state===`idle`?{tone:`neutral`,label:Z(e,`No active bindings`,`بدون میانبر فعال`)}:{tone:`warn`,label:Z(e,`Not confirmed`,`تأیید نشده`)},V=async t=>{ae.current?.abort();let r=new AbortController;ae.current=r,w(!0),n(t),E(Z(e,`Saved. Waiting for the host registrar to confirm the change…`,`ذخیره شد؛ در انتظار تأیید تغییر توسط میزبان…`)),O(`info`);for(let t=0;t<16;t+=1){if(!await Q(t===0?100:250,r.signal))return;let i;try{i=await F(`controller.hotkeys.get`,{},r.signal)}catch(e){if(r.signal.aborted)return;w(!1),n(e=>e&&{...e,apply_pending:!1}),E(e instanceof Error?e.message:String(e)),O(`danger`);return}n(i);let a=It(i);if(a.state===`active`||a.state===`idle`){w(!1),E(Rt(e,i,a)),O(`success`);return}if(a.state===`error`||a.state===`unavailable`){w(!1),E(a.detail),O(a.state===`error`?`danger`:`warning`);return}}w(!1),E(Z(e,`Saved, but the registrar did not confirm the change in time.`,`ذخیره شد، اما ثبت‌کننده در زمان مقرر تغییر را تأیید نکرد.`)),O(`warning`)},be=async e=>{if(e.preventDefault(),he&&ge){x(!0),A(!1),E(``);try{let e=await F(`controller.hotkeys.set`,{operation:`upsert`,name:P?.name??ce,enabled:v,chord:m,command:g}),t=e.bindings.find(e=>e.name.toLocaleLowerCase(`en-US`)===(P?.name??ce).toLocaleLowerCase(`en-US`));t&&oe(t),V(e)}catch(e){E(e instanceof Error?e.message:String(e)),O(`danger`)}finally{x(!1)}}},xe=async()=>{if(P){if(!k)A(!0),E(Z(e,`Confirm removal of “${P.name}”.`,`حذف «${P.name}» را تأیید کنید.`)),O(`warning`);else{x(!0);try{let e=await F(`controller.hotkeys.set`,{operation:`remove`,name:P.name});M(!0),V(e)}catch(e){E(e instanceof Error?e.message:String(e)),O(`danger`)}finally{x(!1)}}}},Se=()=>{ne(!0),A(!1),E(Z(e,`Listening now. Press a combination, or Escape to cancel.`,`در حال شنیدن؛ ترکیب کلید را بزنید یا با Escape لغو کنید.`)),O(`info`),window.requestAnimationFrame(()=>j.current?.focus())},Ce=t=>{if(!y||t.nativeEvent.isComposing||t.keyCode===229)return;if(t.stopPropagation(),t.key===`Escape`&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.metaKey){t.preventDefault(),ne(!1),E(Z(e,`Shortcut recording cancelled.`,`ضبط میانبر لغو شد.`)),O(`info`);return}if(Lt.has(t.key)||t.repeat)return;t.preventDefault();let n=Mt(t.nativeEvent);n?(h(n.canonical),ne(!1),A(!1),E(Z(e,`Recorded ${n.canonical}.`,`${n.canonical} ضبط شد.`)),O(`success`)):(E(Z(e,`Use Ctrl, Alt, Shift or Win with a supported key; F1–F24 may be used alone.`,`از Ctrl، Alt، Shift یا Win همراه یک کلید پشتیبانی‌شده استفاده کنید؛ F1 تا F24 می‌توانند تنها باشند.`)),O(`warning`))},we=[`navigation`,`diagnostics`,`safety`].map(e=>({group:e,commands:Dt.filter(t=>t.group===e)}));return(0,J.jsx)(z,{icon:me,iconTone:B.tone===`bad`?`red`:B.tone===`good`?`green`:B.tone===`warn`?`amber`:`violet`,title:Z(e,`Global shortcuts`,`میانبرهای سراسری`),eyebrow:B.label,className:`settings-card settings-card--wide hotkey-card`,action:(0,J.jsx)(W,{tone:B.tone,pulse:R,children:B.label}),children:s&&!t?(0,J.jsxs)(`div`,{className:`hotkey-editor__load-error`,role:`alert`,children:[(0,J.jsx)(ke,{"aria-hidden":`true`,size:20}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:Z(e,`Hotkey settings could not be loaded`,`تنظیمات میانبر بارگیری نشد`)}),(0,J.jsx)(`span`,{children:s})]}),(0,J.jsx)(N,{icon:i,busy:r,onClick:()=>{a(!0),se(void 0,!0)},children:Z(e,`Retry`,`تلاش دوباره`)})]}):(0,J.jsxs)(`div`,{className:`hotkey-editor`,children:[(0,J.jsxs)(`section`,{className:`hotkey-editor__library`,"aria-label":Z(e,`Configured global shortcuts`,`میانبرهای سراسری پیکربندی‌شده`),children:[(0,J.jsxs)(`header`,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:Z(e,`Bindings`,`میانبرها`)}),(0,J.jsx)(`small`,{children:t?Z(e,`${t.bindings.length} configured`,`${t.bindings.length} مورد پیکربندی شده`):Z(e,`Loading…`,`در حال بارگیری…`)})]}),(0,J.jsx)(N,{ref:ie,compact:!0,icon:o,onClick:()=>M(),children:Z(e,`New`,`جدید`)})]}),(0,J.jsxs)(`div`,{className:`hotkey-binding-list`,children:[t?.bindings.map(t=>(0,J.jsxs)(`button`,{type:`button`,className:t.name.toLocaleLowerCase(`en-US`)===u?.toLocaleLowerCase(`en-US`)?`is-selected`:``,"aria-pressed":t.name.toLocaleLowerCase(`en-US`)===u?.toLocaleLowerCase(`en-US`),onClick:()=>oe(t),children:[(0,J.jsx)(`span`,{className:`hotkey-binding-list__icon`,children:(0,J.jsx)(me,{"aria-hidden":`true`,size:17})}),(0,J.jsxs)(`span`,{className:`hotkey-binding-list__copy`,children:[(0,J.jsx)(`strong`,{children:t.name}),(0,J.jsx)(zt,{chord:t.chord})]}),(0,J.jsx)(`span`,{className:`hotkey-binding-list__state${t.enabled?` is-enabled`:``}`,children:t.enabled?Z(e,`Enabled`,`فعال`):Z(e,`Disabled`,`غیرفعال`)})]},t.name)),t?.bindings.length===0&&(0,J.jsxs)(`div`,{className:`hotkey-binding-list__empty`,children:[(0,J.jsx)(me,{"aria-hidden":`true`,size:22}),(0,J.jsx)(`span`,{children:Z(e,`No shortcuts configured yet.`,`هنوز میانبری پیکربندی نشده است.`)})]})]})]}),(0,J.jsxs)(`form`,{className:`hotkey-editor__form`,onSubmit:e=>void be(e),children:[(0,J.jsxs)(`header`,{className:`hotkey-editor__form-heading`,children:[(0,J.jsx)(`span`,{className:`hotkey-editor__form-icon`,children:P?(0,J.jsx)(T,{"aria-hidden":`true`,size:19}):(0,J.jsx)(o,{"aria-hidden":`true`,size:19})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`small`,{children:P?Z(e,`EDIT BINDING`,`ویرایش میانبر`):Z(e,`NEW BINDING`,`میانبر جدید`)}),(0,J.jsx)(`strong`,{children:P?.name||Z(e,`Create a global shortcut`,`ایجاد میانبر سراسری`)})]})]}),(0,J.jsxs)(`div`,{className:`hotkey-editor__fields`,children:[(0,J.jsx)(Be,{label:Z(e,`Binding name`,`نام میانبر`),value:p,disabled:!!P,autoComplete:`off`,spellCheck:!1,onInput:e=>{ee(Pt(e.currentTarget.value)),E(``),A(!1)},onChange:e=>{ee(Pt(e.currentTarget.value)),E(``),A(!1)},onBlur:()=>ee(e=>e.trim()),error:fe||void 0,hint:P?Z(e,`Names stay fixed so an edit cannot create a duplicate binding.`,`نام ثابت می‌ماند تا ویرایش، میانبر تکراری نسازد.`):void 0}),(0,J.jsxs)(`label`,{className:`hotkey-command-field${de?` is-invalid`:``}`,children:[(0,J.jsx)(`span`,{children:Z(e,`Action`,`کنش`)}),(0,J.jsxs)(`select`,{value:g,"aria-invalid":de?!0:void 0,onChange:e=>{_(e.currentTarget.value),E(``),A(!1)},children:[!Ft(g)&&(0,J.jsx)(`option`,{value:g,disabled:!0,children:Z(e,`Existing custom action — choose a safe replacement`,`کنش سفارشی فعلی — یک جایگزین امن انتخاب کنید`)}),we.map(({group:t,commands:n})=>(0,J.jsx)(`optgroup`,{label:{navigation:Z(e,`Navigation`,`پیمایش`),diagnostics:Z(e,`Diagnostics`,`عیب‌یابی`),safety:Z(e,`Safety`,`ایمنی`)}[t],children:n.map(t=>(0,J.jsx)(`option`,{value:t.value,children:t.label[e]},t.value))},t))]}),(0,J.jsx)(`small`,{className:de?`text-bad`:``,dir:`ltr`,children:de||g})]}),(0,J.jsxs)(`div`,{className:`hotkey-recorder-field${pe?` is-invalid`:``}`,children:[(0,J.jsx)(`span`,{children:Z(e,`Key combination`,`ترکیب کلید`)}),(0,J.jsxs)(`button`,{ref:j,type:`button`,className:`hotkey-recorder${y?` is-recording`:``}`,"aria-pressed":y,"aria-describedby":`hotkey-recorder-message`,onClick:Se,onKeyDown:Ce,onBlur:()=>{y&&(ne(!1),E(Z(e,`Shortcut recording stopped.`,`ضبط میانبر متوقف شد.`)),O(`info`))},children:[(0,J.jsx)(`span`,{className:`hotkey-recorder__indicator`,"aria-hidden":`true`}),m?(0,J.jsx)(zt,{chord:m}):(0,J.jsx)(`span`,{children:Z(e,`Record shortcut`,`ضبط میانبر`)}),(0,J.jsx)(`small`,{children:y?Z(e,`Listening…`,`در حال شنیدن…`):Z(e,`Press to record`,`برای ضبط فشار دهید`)})]}),(0,J.jsx)(`small`,{id:`hotkey-recorder-message`,className:pe?`text-bad`:``,role:pe?`alert`:`status`,children:pe||(y?Z(e,`Waiting for a non-modifier key.`,`در انتظار یک کلید غیرترکیبی.`):m?Z(e,`The recorded combination is valid.`,`ترکیب ضبط‌شده معتبر است.`):Z(e,`No key combination recorded.`,`هنوز ترکیب کلیدی ضبط نشده است.`))})]})]}),(0,J.jsx)(H,{checked:v,onChange:e=>{te(e),E(``),A(!1)},label:Z(e,`Enable this global shortcut`,`فعال‌سازی این میانبر سراسری`),detail:v?Z(e,`The host will register it after saving.`,`میزبان پس از ذخیره آن را ثبت می‌کند.`):Z(e,`The binding is saved but not registered.`,`میانبر ذخیره می‌شود اما ثبت نخواهد شد.`)}),(0,J.jsxs)(`div`,{className:`hotkey-editor__notice is-${ye}`,role:ye===`danger`?`alert`:`status`,"aria-live":`polite`,children:[ye===`danger`?(0,J.jsx)(ke,{"aria-hidden":`true`,size:17}):ye===`success`?(0,J.jsx)(C,{"aria-hidden":`true`,size:17}):(0,J.jsx)(`span`,{className:`hotkey-editor__notice-line`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:ve||re||(t&&_e?Rt(e,t,_e):``)||Z(e,`Choose a binding to edit or create a new one.`,`یک میانبر را برای ویرایش انتخاب یا میانبر تازه‌ای ایجاد کنید.`)})]}),(0,J.jsxs)(`footer`,{className:`hotkey-editor__actions`,children:[(0,J.jsx)(N,{type:`submit`,tone:`primary`,icon:f,busy:b,disabled:!he||!ge||k||R,children:P?Z(e,`Save binding`,`ذخیره میانبر`):Z(e,`Add binding`,`افزودن میانبر`)}),P&&(0,J.jsx)(N,{type:`button`,tone:`danger`,icon:l,busy:b,disabled:R,onClick:()=>void xe(),children:k?Z(e,`Confirm remove`,`تأیید حذف`):Z(e,`Remove`,`حذف`)}),k&&(0,J.jsx)(N,{type:`button`,tone:`ghost`,onClick:()=>{A(!1),E(``)},children:Z(e,`Cancel`,`لغو`)})]})]})]})})}var Vt=[`relay`,`motion`,`pwm`,`display`,`sensor`];function Ht(e,t){let n=new Map(t.map(e=>[e.key,e.default_name]));return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,ie(t).normalized]).filter(([e,t])=>t&&t!==n.get(e)).sort(([e],[t])=>e.localeCompare(t)))}function Ut(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Wt({locale:e}){let t=(t,n)=>e===`fa`?n:t,[n,i]=(0,q.useState)([]),[a,o]=(0,q.useState)({}),[s,c]=(0,q.useState)({}),[l,u]=(0,q.useState)(!0),[d,f]=(0,q.useState)(``),[p,ee]=(0,q.useState)(!1);(0,q.useEffect)(()=>{let e=!0;return F(`controller.peripherals.get`).then(t=>{if(!e)return;let n=Ht(t.peripheral_names??{},t.peripherals??[]);i(t.peripherals??[]),o(n),c(n),f(``),ee(!1)}).catch(t=>{e&&(f(t instanceof Error?t.message:String(t)),ee(!0))}).finally(()=>{e&&u(!1)}),()=>{e=!1}},[]);let m=(0,q.useMemo)(()=>Ht(s,n),[n,s]),h=!Ut(m,a),g=Object.keys(m).length,_=(0,q.useMemo)(()=>Vt.map(e=>({kind:e,entries:n.filter(t=>t.kind===e)})).filter(e=>e.entries.length),[n]),v=e=>({relay:t(`Relays`,`رله‌ها`),motion:t(`Motion sides`,`سمت‌های حرکت`),pwm:t(`PWM and lighting`,`PWM و نورپردازی`),display:t(`Displays`,`نمایشگرها`),sensor:t(`Sensors`,`حسگرها`)})[e]??e,te=(e,t)=>{f(``),ee(!1),c(n=>({...n,[e]:oe(t)}))},y=async()=>{if(h){u(!0),f(``),ee(!1);try{let e=await F(`controller.peripherals.set`,{peripheral_names:m}),r=Ht(e.peripheral_names??{},e.peripherals??n);i(e.peripherals??n),o(r),c(r),f(t(`Names saved.`,`نام‌ها ذخیره شدند.`))}catch(e){f(e instanceof Error?e.message:String(e)),ee(!0)}finally{u(!1)}}},ne=d||(l?t(`Synchronizing the host peripheral catalog…`,`در حال همگام‌سازی فهرست تجهیزات میزبان…`):h?t(`${g} custom name${g===1?``:`s`} in the validated draft.`,`${g} نام سفارشی در پیش‌نویس معتبر است.`):t(`${n.length} peripherals synchronized · ${g} customized.`,`${n.length} تجهیز همگام است · ${g} مورد سفارشی شده.`));return(0,J.jsxs)(z,{icon:Ye,iconTone:`accent`,title:t(`Peripheral names`,`نام تجهیزات`),eyebrow:l?t(`Synchronizing`,`در حال همگام‌سازی`):h?t(`Unsaved changes`,`تغییرات ذخیره‌نشده`):t(`Host authoritative`,`مرجع میزبان`),className:`settings-card settings-card--wide peripheral-names-card`,menu:n.length?[{label:t(`Restore every default name`,`بازگردانی همهٔ نام‌های پیش‌فرض`),icon:r,onSelect:()=>{c({}),f(``),ee(!1)}}]:void 0,children:[(0,J.jsx)(`div`,{className:`peripheral-name-groups`,"aria-busy":l,children:_.map((e,n)=>(0,J.jsxs)(`details`,{className:`peripheral-name-group`,open:n===0,children:[(0,J.jsxs)(`summary`,{children:[(0,J.jsx)(`span`,{children:v(e.kind)}),(0,J.jsx)(`small`,{children:e.entries.length})]}),(0,J.jsx)(`div`,{className:`peripheral-name-grid`,children:e.entries.map(e=>{let n=s[e.key]??``,i=ie(n),a=!!(i.normalized&&i.normalized!==e.default_name);return(0,J.jsx)(Be,{label:e.default_name,value:n,placeholder:e.default_name,maxLength:64,onInput:t=>te(e.key,t.currentTarget.value),onChange:t=>te(e.key,t.currentTarget.value),error:i.valid?void 0:i.error,success:a?t(`Custom · ${e.key}`,`سفارشی · ${e.key}`):void 0,action:(0,J.jsx)(N,{compact:!0,disabled:!n,icon:r,onClick:()=>te(e.key,``),children:t(`Default`,`پیش‌فرض`)})},e.key)})})]},e.kind))}),(0,J.jsxs)(`footer`,{className:`peripheral-names-card__footer`,children:[(0,J.jsx)(`span`,{className:p?`text-warn`:d&&!h?`text-good`:``,role:`status`,"aria-live":`polite`,children:ne}),(0,J.jsx)(N,{tone:`primary`,icon:T,busy:l,disabled:!h,onClick:()=>void y(),children:t(`Save names`,`ذخیرهٔ نام‌ها`)})]})]})}function Gt(e){return e?e.transitioning?e.requested:e.applied:`unknown`}function Kt(e,t,n){return e?.find(e=>e.key===t)?.name.trim()||n}var qt=(0,q.lazy)(()=>Ve(()=>import(`./chunk-CvBDG8li.js`).then(e=>({default:e.TelemetryChart})),__vite__mapDeps([0,1,2])));function $(e,t){let[n,r]=(0,q.useState)(Date.now);return(0,q.useEffect)(()=>{let n=0,i=!1,a=e?Date.parse(e):NaN,o=()=>{if(i||!Number.isFinite(a))return;let e=Math.max(0,Date.now()-a),s=e{r(Date.now()),o()},s)};return r(Date.now()),o(),()=>{i=!0,window.clearTimeout(n)}},[t,e]),n}function Jt(e,t,n){return e.connected?e.port.friendly_name||e.port.product||e.port.name||t:e.connection_reason||(n===`fa`?`در انتظار اتصال کنترلر`:`Waiting for a controller connection`)}function Yt(e,t){return e.map(e=>e[t]).filter(e=>typeof e==`number`&&Number.isFinite(e))}function Xt(e){let t=e.kind.toLowerCase();return t.includes(`error`)||t.includes(`fault`)||t.includes(`hot`)?`bad`:t.includes(`warning`)||t.includes(`door`)||t.includes(`disconnect`)?`warn`:t.includes(`connect`)||t.includes(`ready`)||t.includes(`complete`)?`good`:`info`}function Zt({state:e,locale:t,action:n,showTitle:r=!0}){let i=(e,n)=>t===`fa`?n:e,a=e===`connecting`||e===`transport-offline`,o=e===`transport-offline`?i(`Reconnecting…`,`در حال اتصال دوباره…`):e===`connecting`?i(`Connecting…`,`در حال اتصال…`):i(`Board offline`,`برد آفلاین`);return(0,J.jsxs)(`div`,{className:`controller-unavailable is-${e}`,role:`status`,"aria-live":`polite`,children:[a?(0,J.jsxs)(`div`,{className:`connection-fuji`,"aria-hidden":`true`,children:[(0,J.jsx)(`span`,{className:`connection-fuji__sun`}),(0,J.jsx)(`span`,{className:`connection-fuji__rear`}),(0,J.jsx)(`span`,{className:`connection-fuji__face`}),(0,J.jsx)(`span`,{className:`connection-fuji__snow`}),(0,J.jsx)(`span`,{className:`connection-fuji__trace`})]}):(0,J.jsx)(`span`,{className:`controller-unavailable__icon`,"aria-hidden":`true`,children:(0,J.jsx)(x,{size:28})}),r&&(0,J.jsx)(`strong`,{children:o}),n&&(0,J.jsx)(`div`,{className:`controller-unavailable__action`,children:n})]})}function Qt({snapshot:e,locale:t,reconnect:n,hardwareReset:r}){let o=(e,n)=>t===`fa`?n:e,[s,c]=(0,q.useState)(Date.now);(0,q.useEffect)(()=>{if(e.connection_phase!==`attempting`&&e.connection_phase!==`waiting_retry`)return;let t=window.setInterval(()=>c(Date.now()),250);return()=>window.clearInterval(t)},[e.connection_phase,e.connection_attempt_started,e.connection_next_retry]);let l=Ee(e,t,s),u=l.phase===`blocked`?(0,J.jsx)(pt,{size:30}):l.phase===`paused`?(0,J.jsx)(ne,{size:30}):l.phase===`waiting_retry`?(0,J.jsx)(yt,{size:30}):(0,J.jsx)(ht,{size:30});return(0,J.jsxs)(`div`,{className:`connection-state connection-state--${l.tone} is-${l.phase}`,role:`status`,"aria-live":`polite`,children:[(0,J.jsx)(`div`,{className:`connection-state__icon`,"aria-hidden":`true`,children:u}),(0,J.jsxs)(`div`,{className:`connection-state__body`,children:[(0,J.jsxs)(`div`,{className:`connection-state__heading`,children:[(0,J.jsx)(`strong`,{children:l.title}),l.attempt&&(0,J.jsx)(`span`,{className:`connection-state__attempt`,children:l.attempt})]}),(0,J.jsx)(`p`,{children:l.detail}),(0,J.jsxs)(`div`,{className:`connection-state__facts`,children:[l.candidate&&(0,J.jsxs)(`span`,{children:[(0,J.jsx)(a,{size:15}),l.candidate]}),l.timing&&(0,J.jsxs)(`span`,{children:[(0,J.jsx)(yt,{size:15}),l.timing]})]})]}),(0,J.jsxs)(`div`,{className:`connection-state__actions`,children:[r&&(0,J.jsx)(N,{compact:!0,icon:S,onClick:r,children:o(`Hardware reset`,`بازنشانی سخت‌افزاری`)}),(0,J.jsx)(N,{compact:!0,tone:l.phase===`blocked`?`danger`:`primary`,icon:l.animated?i:ht,busy:l.animated,disabled:l.retryDisabled,onClick:n,children:l.action})]})]})}var $t=[`telemetry`,`outputs`,`overview`,`actions`,`events`];function en(e){let{appTitle:t,snapshot:n,samples:r,events:a,locale:o,t:l,command:d,refresh:f,openDialog:m}=e,_=(e,t)=>o===`fa`?t:e,b=n.status,x=e.transport.boardState===`ready`&&n.connected&&n.have_status,S=Oe(n),C=S.ina219||S.temperatureLED||S.temperatureBTAudio,w=C,re=[S.invalidINA219?_(`Power measurements unavailable`,`اندازه‌گیری‌های توان در دسترس نیست`):``,S.invalidTemperatureLED?_(`LED temperature unavailable`,`دمای LED در دسترس نیست`):``,S.invalidTemperatureBTAudio?_(`BT Amplifier temperature unavailable`,`دمای آمپلی‌فایر بلوتوث در دسترس نیست`):``].filter(Boolean),D=n.hardware_problems?.[0],k=D?Ae(D,o):void 0,j=!x&&e.transport.authenticationRequired,ie=e.transport.boardState===`loading`,ae=!j&&e.transport.streamState===`connecting`,oe=!j&&e.transport.streamState!==`open`,M=Ee(n,o),se=x?`good`:ae?`info`:M.tone,P=oe?ae?_(`Connecting…`,`در حال اتصال…`):_(`Reconnecting…`,`در حال اتصال دوباره…`):k?.title||(ie?_(`Discovering controller board…`,`در حال جستجوی برد کنترلر…`):M.title),le=oe?void 0:k?.guidance||n.connection_reason||l(`noHardware`),L=x?l(`online`):ae?_(`Connecting`,`در حال اتصال`):oe?_(`Reconnecting`,`در حال اتصال دوباره`):ie?_(`Searching for board`,`در حال جستجوی برد`):M.title,ue=n.hello.build_hash?n.hello.build_hash.toString(16).toUpperCase().padStart(8,`0`):`—`,de=Array.from({length:8},(e,t)=>!!(b.active_relays&1<e.kind===`config`)?.id??0,he=e.transport.measurementFreshnessMS??1500,ge=$(n.status_updated,he),_e=Ge(o,n.status_updated,he,ge),[ve,B]=(0,q.useState)(null),[V,be]=(0,q.useState)(!1),[xe,H]=(0,q.useState)(()=>y(`dashboard`,$t)),[Se,Ce]=(0,q.useState)(null),we=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(!x){B(null);return}let e=!0;return F(`controller.ui.config.get`).then(t=>{e&&B(t)}).catch(()=>{e&&B(null)}),()=>{e=!1}},[x,me]);let Te=(e,t)=>Kt(ve?.controls,e,ve?.peripheral_names?.[e]?.trim()||t),De=[_(`Side A direction`,`جهت سمت A`),_(`Side A output`,`خروجی سمت A`),_(`Side B direction`,`جهت سمت B`),_(`Side B output`,`خروجی سمت B`),_(`User relay 5`,`رلهٔ کاربر ۵`),_(`User relay 6`,`رلهٔ کاربر ۶`),_(`User relay 7`,`رلهٔ کاربر ۷`),_(`User relay 8`,`رلهٔ کاربر ۸`)],Me={move:_(`Move`,`جابجایی`),collapse:_(`Collapse`,`جمع‌کردن`),expand:_(`Expand`,`بازکردن`),hide:_(`Hide`,`پنهان‌کردن`),show:_(`Show`,`نمایش`),customize:_(`Arrange`,`چیدمان`),done:_(`Done`,`پایان`),reset:_(`Reset layout`,`بازنشانی چیدمان`),hidden:_(`Hidden cards`,`کارت‌های پنهان`)},Ne=[{id:`telemetry`,label:l(`liveTelemetry`)},{id:`outputs`,label:l(`outputs`)},{id:`overview`,label:l(`status`)},{id:`actions`,label:l(`quickActions`)},{id:`events`,label:l(`events`)}],Pe=xe.order.filter(e=>x?e===`telemetry`?C:e!==`outputs`||S.relays:!1),Fe=e=>{H(t=>{let n=e(t);return p(`dashboard`,$t,n),n})},U=()=>{v(`dashboard`),H(y(`dashboard`,$t))},Ie=(e,t,n)=>{let r=document.elementFromPoint(t,n)?.closest(`[data-layout-card-id]`)?.dataset.layoutCardId,i=$t.includes(r)?r:void 0;c(we.current,e,i)&&(we.current=i,Fe(t=>h(t,e,i)))},Le=(e,t)=>Fe(n=>{let r=n.order.filter(e=>Pe.includes(e)&&!n.hidden.includes(e)),i=r[r.indexOf(e)+t];return i?h(n,e,i):n}),Re=(e,t,n)=>(0,J.jsx)(te,{id:e,title:t,order:xe.order.indexOf(e),collapsed:xe.collapsed.includes(e),hidden:xe.hidden.includes(e),editing:V,dragging:Se===e,copy:Me,onToggleCollapsed:()=>Fe(t=>({...t,collapsed:s(t.collapsed,e)})),onHide:()=>Fe(t=>({...t,hidden:s(t.hidden,e)})),onReorderStart:e=>{we.current=null,Ce(e)},onReorderMove:Ie,onReorderEnd:()=>{we.current=null,Ce(null)},onKeyboardReorder:Le,children:n});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:x?_e:ae?_(`Reconnecting`,`اتصال دوباره`):oe?_(`Connection unavailable`,`اتصال در دسترس نیست`):n.paused?_(`Board connection paused`,`اتصال برد متوقف شده`):ie?_(`Discovering board`,`در حال جستجوی برد`):_(`PCController host online`,`میزبان PCController آنلاین است`),title:l(`dashboard`),detail:j?l(`authenticationDashboardDetail`):x?Jt(n,t,o):le,action:(0,J.jsxs)(`div`,{className:`header-actions`,children:[(0,J.jsx)(W,{tone:se,pulse:ae||n.connection_state===`connecting`,children:L}),!x&&!j&&!oe&&(0,J.jsx)(N,{icon:ht,compact:!0,busy:M.animated,disabled:M.retryDisabled,onClick:()=>void d(`reconnect`,M.action),children:M.action}),(0,J.jsx)(N,{icon:i,compact:!0,onClick:()=>void f(),children:l(`refresh`)}),Pe.length>0&&(0,J.jsx)(g,{copy:Me,editing:V,cards:Ne.filter(({id:e})=>Pe.includes(e)),hidden:xe.hidden,onToggleEditing:()=>be(e=>!e),onShow:e=>Fe(t=>({...t,hidden:t.hidden.filter(t=>t!==e)})),onReset:U})]})}),(0,J.jsxs)(`section`,{className:`hero-panel${x?` is-online`:``}`,children:[(0,J.jsxs)(`div`,{className:`hero-panel__identity`,children:[!oe&&(0,J.jsx)(`div`,{className:`eyebrow`,children:x?`${_(`Controller board`,`برد کنترلر`)} · ${n.connection_state}`:_(`PCController host · online`,`میزبان PCController · آنلاین`)}),oe&&!j?(0,J.jsx)(Zt,{state:ae?`connecting`:`transport-offline`,locale:o}):!x&&!j&&!D?(0,J.jsx)(Qt,{snapshot:n,locale:o,reconnect:()=>void d(`reconnect`,M.action),hardwareReset:ye(n)?()=>void d(`reset lines`,_(`Hardware reset sent`,`بازنشانی سخت‌افزاری ارسال شد`)):void 0}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`h2`,{children:x?n.hello.name||t:j?l(`authenticationDashboard`):P}),(x||j||le)&&(0,J.jsx)(`p`,{children:x?`USB ${n.port.vid||`—`}:${n.port.pid||`—`} · ${n.port.name||_(`automatic port`,`درگاه خودکار`)}`:j?l(`authenticationDashboardDetail`):le})]}),j&&(0,J.jsx)(N,{icon:T,tone:`primary`,onClick:()=>{window.location.hash=`#/settings`},children:_(`Enter access token`,`ورود توکن دسترسی`)})]}),x&&(0,J.jsxs)(`div`,{className:`hero-panel__readout`,dir:`ltr`,children:[(0,J.jsx)(`span`,{children:_(`BUILD`,`ساخت`)}),(0,J.jsx)(`strong`,{children:ue}),(0,J.jsx)(`span`,{children:_(`UPTIME`,`زمان کارکرد`)}),(0,J.jsx)(`strong`,{children:O(o,b.uptime_ms)})]})]}),D&&k&&(0,J.jsxs)(`section`,{className:`hardware-alert is-${D.severity}`,role:`alert`,"aria-live":`assertive`,children:[(0,J.jsx)(`div`,{className:`hardware-alert__icon`,children:(0,J.jsx)(ke,{size:24,"aria-hidden":`true`})}),(0,J.jsxs)(`div`,{className:`hardware-alert__copy`,children:[(0,J.jsx)(`strong`,{children:k.title}),(0,J.jsx)(`p`,{children:k.guidance}),k.impact&&(0,J.jsx)(`p`,{className:`hardware-alert__impact`,children:k.impact}),(D.os_problem_code||D.location)&&(0,J.jsx)(`span`,{dir:`ltr`,children:[D.os_problem_code?`Windows code ${D.os_problem_code}`:``,D.location||``].filter(Boolean).join(` · `)})]})]}),x&&w&&(0,J.jsxs)(`section`,{className:`metric-grid`,children:[S.ina219&&(0,J.jsx)(He,{icon:Ct,label:Te(`sensor.supply-voltage`,l(`voltage`)),value:pe(o,b.supply_mv/1e3,2),unit:`V`,values:Yt(r,`supply`),tone:`accent`,scale:`supply`,detail:`${Te(`sensor.bus-voltage`,_(`Bus voltage`,`ولتاژ باس`))} · ${pe(o,b.bus_mv/1e3,2)} V`}),S.ina219&&(0,J.jsx)(He,{icon:ee,label:Te(`sensor.current`,l(`current`)),value:pe(o,b.current_ma,0),unit:`mA`,values:Yt(r,`current`),tone:`green`,scale:`current`,detail:`${Te(`sensor.power`,_(`Load power`,`توان بار`))} · ${pe(o,b.power_mw/1e3,2)} W`}),S.temperatureLED&&(0,J.jsx)(He,{icon:u,label:Te(`sensor.temperature-led`,`${l(`temperature`)} · LED`),value:pe(o,b.temperature_led_centi_c/100,1),unit:`°C`,values:Yt(r,`ledTemp`),tone:`amber`,scale:`temperature`}),S.temperatureBTAudio&&(0,J.jsx)(He,{icon:u,label:Te(`sensor.temperature-audio`,_(`BT Amplifier temperature`,`دمای آمپلی‌فایر بلوتوث`)),value:pe(o,b.temperature_bt_audio_centi_c/100,1),unit:`°C`,values:Yt(r,`btTemp`),tone:`violet`,scale:`temperature`})]}),x&&re.length>0&&(0,J.jsx)(`div`,{className:`measurement-alerts`,role:`status`,"aria-live":`polite`,children:re.map(e=>(0,J.jsxs)(`div`,{className:`measurement-alert`,children:[(0,J.jsx)(ke,{size:16}),(0,J.jsx)(`span`,{children:e})]},e))}),(0,J.jsxs)(`section`,{className:`dashboard-layout-grid`,children:[x&&C&&Re(`telemetry`,l(`liveTelemetry`),(0,J.jsx)(z,{icon:Qe,iconTone:`violet`,title:l(`liveTelemetry`),eyebrow:_e,className:`telemetry-chart-card`,action:(0,J.jsxs)(W,{tone:`good`,children:[r.length,` `,_(`samples`,`نمونه`)]}),menu:[{label:_(`Refresh telemetry`,`تازه‌سازی تله‌متری`),icon:i,onSelect:()=>{f()}},{label:_(`Open Workbench`,`بازکردن میزکار`),icon:E,onSelect:()=>{window.location.hash=`#/workbench`}}],children:(0,J.jsx)(q.Suspense,{fallback:(0,J.jsxs)(`div`,{className:`telemetry-chart__empty`,role:`status`,children:[(0,J.jsx)(ce,{size:22}),(0,J.jsx)(`span`,{children:o===`fa`?`در حال آماده‌سازی نمودار…`:`Preparing chart…`})]}),children:(0,J.jsx)(qt,{connected:!0,locale:o,samples:r,reduceMotion:e.reduceMotion})})})),x&&S.relays&&Re(`outputs`,l(`outputs`),(0,J.jsxs)(z,{icon:xt,iconTone:de?`amber`:`green`,title:l(`outputs`),eyebrow:`R1—R8`,className:`outputs-card`,action:(0,J.jsx)(W,{tone:b.active_relays?`warn`:`neutral`,children:b.active_relays?`${de} ${_(`ACTIVE`,`فعال`)}`:_(`SAFE`,`ایمن`)}),menu:[{label:_(`Read controller status`,`خواندن وضعیت کنترلر`),icon:A,onSelect:()=>{d(`status`)}},{label:_(`Release every output`,`آزادسازی همهٔ خروجی‌ها`),icon:ne,tone:`danger`,onSelect:()=>m({tone:`danger`,title:l(`confirmEmergencyTitle`),body:l(`confirmEmergencyBody`),confirmLabel:l(`emergencyOff`),action:async()=>{await d(`relay off`),await d(`pwm off`)}})}],children:[(0,J.jsx)(`div`,{className:`output-matrix`,children:Array.from({length:8},(e,t)=>{let r=!!(b.active_relays&1<void d(`relay ${t+1} ${r?`off`:`on`}`,_(`R${t+1} ${r?`off`:`on`}`,`رلهٔ ${t+1} ${r?`خاموش`:`روشن`} شد`)),"aria-pressed":r,children:[(0,J.jsxs)(`span`,{children:[`R`,t+1,` · `,Te(`relay.${t+1}`,De[t])]}),(0,J.jsx)(`strong`,{children:l(r?`on`:`off`)}),(0,J.jsx)(`i`,{"aria-hidden":`true`})]},t)})}),(0,J.jsxs)(`div`,{className:`safety-strip`,children:[(0,J.jsx)(T,{size:17}),(0,J.jsx)(`span`,{children:de?_(`${de} outputs active · confirmation required for emergency release`,`${de} خروجی فعال است · آزادسازی اضطراری به تأیید نیاز دارد`):_(`All physical outputs are released`,`همهٔ خروجی‌های فیزیکی آزاد هستند`)})]})]})),x&&Re(`overview`,l(`status`),(0,J.jsx)(z,{icon:A,iconTone:`green`,title:l(`status`),eyebrow:l(`device`),className:`device-card`,menu:[{label:_(`Read identity`,`خواندن شناسه`),icon:I,onSelect:()=>{d(`hello`)}},{label:_(`Open controller controls`,`بازکردن کنترل‌های برد`),icon:nt,onSelect:()=>{window.location.hash=`#/controls`}}],children:(0,J.jsxs)(`div`,{className:`data-list`,children:[(0,J.jsx)(R,{label:l(`device`),value:n.port.friendly_name||n.port.name||`—`}),(0,J.jsx)(R,{label:l(`firmware`),value:n.hello.build_timestamp||ue,mono:!0}),(0,J.jsx)(R,{label:l(`door`),value:b.door_open?l(`open`):l(`closed`),tone:b.door_open?`warn`:`good`}),S.bluetoothAudio&&(0,J.jsx)(R,{label:l(`bluetooth`),value:b.bluetooth_audio_state===2?l(`online`):b.bluetooth_audio_state===1?l(`connecting`):l(`offline`)}),(0,J.jsx)(R,{label:_(`UART CRC / framing`,`CRC / قاب‌بندی UART`),value:`${b.crc_errors} / ${b.framing_errors}`,mono:!0,tone:b.crc_errors||b.framing_errors?`warn`:`good`}),(0,J.jsx)(R,{label:_(`Reset count`,`تعداد بازنشانی`),value:b.reset_count,mono:!0})]})})),x&&Re(`actions`,l(`quickActions`),(0,J.jsx)(z,{icon:Ct,iconTone:`amber`,title:l(`quickActions`),eyebrow:_(`Confirmation protected`,`محافظت‌شده با تأیید`),className:`actions-card`,children:(0,J.jsxs)(`div`,{className:`action-grid`,children:[(0,J.jsx)(N,{icon:pt,tone:`danger`,onClick:()=>void d(`estop ${n.emergency_stop?.active?`off`:`on`}`),children:n.emergency_stop?.active?_(`Release E-STOP`,`آزادسازی توقف اضطراری`):_(`Engage E-STOP`,`فعال‌سازی توقف اضطراری`)}),(0,J.jsx)(N,{icon:A,onClick:()=>void d(`status`),children:_(`Read status`,`خواندن وضعیت`)}),S.statusLED&&(0,J.jsx)(N,{icon:fe,onClick:()=>void d(`rgb effect play attention`),children:_(`Attention cue`,`اعلان توجه`)})]})})),x&&Re(`events`,l(`events`),(0,J.jsx)(z,{icon:ce,iconTone:`violet`,title:l(`events`),eyebrow:a.length?`${qe(o,a[0].time)} · ${a[0].kind}`:l(`eventStream`),className:`activity-card`,action:(0,J.jsx)(`span`,{className:`count-chip`,children:a.length}),menu:[{label:_(`Open full timeline`,`بازکردن خط زمانی کامل`),icon:ce,onSelect:()=>{window.location.hash=`#/events`}},{label:_(`Refresh snapshot`,`تازه‌سازی وضعیت`),icon:i,onSelect:()=>{f()}}],children:(0,J.jsx)(Et,{events:a,locale:o,t:l})}))]})]})}function tn(e){let{snapshot:t,locale:n,t:r,command:a,openDialog:o}=e,s=(e,t)=>n===`fa`?t:e,c=e.transport.boardState===`ready`&&t.connected&&t.have_status,l=Oe(t),u=!!t.emergency_stop?.active,f=()=>Array.from({length:16},(e,n)=>n===t.status.pwm_channel?t.status.pwm_value:0),[p,ee]=(0,q.useState)(f),[h,g]=(0,q.useState)(f),[v,te]=(0,q.useState)(!1),[y,S]=(0,q.useState)([]),[C,w]=(0,q.useState)(``),[re,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(null),O=(0,q.useRef)({}),[k,A]=(0,q.useState)(25),[j,ie]=(0,q.useState)(130),[ae,oe]=(0,q.useState)(220),[M,se]=(0,q.useState)(190),[P,ce]=(0,q.useState)(`#000000`),[I,le]=(0,q.useState)(`color`),[L,de]=(0,q.useState)(1600),[pe,me]=(0,q.useState)(8),[he,ge]=(0,q.useState)(`loop`),[_e,R]=(0,q.useState)(`ready`),ve=e.events.find(e=>e.kind===`config`)?.id??0,B=(0,q.useRef)(p),V=(0,q.useRef)(0),be=(0,q.useRef)(``),H=`${t.host_instance_id}/${t.connection_generation}`;be.current!==H&&(be.current=H,V.current=0);let Ce=(0,q.useRef)(re),we=(0,q.useRef)(null),De=(0,q.useRef)(null),ke=`#${[k,j,ae].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`.toUpperCase(),Ae=t.have_status_led?t.status_led:void 0,Ne=Ae?`#${[Ae.red,Ae.green,Ae.blue].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`.toUpperCase():`#000000`,Fe=`${I===`color`?``:` --period ${L} --minimum ${pe} --repeat ${he}`}${I===`flash`||I===`cycle`||I===`transition`?` --to "${P}"`:``}`,Le=I===`color`?`rgb color "${ke}" ${M}`:`rgb effect ${I} "${ke}" --brightness ${M}${Fe}`,ze=I===`color`?`rgb profile set ${_e} color "${ke}" ${M}`:`rgb profile set ${_e} ${I} "${ke}" --brightness ${M}${Fe}`;we.current||=new Me,O.current=E?.pwm_channels??{};let Be=e=>O.current[`pwm.${e}`],Ve=(e,t=null)=>{if(e.revision!==void 0&&e.revisione.map((e,r)=>De.current?.isEditing(r)?e:r===t?n.values[r]:De.current?.pendingChannels().includes(r)?e:n.values[r])),w(``),te(!0)):w(`PWM unavailable`)};De.current||=new xe({operations:we.current,commit:(e,t)=>F(`controller.pwm.set`,{channel:e,raw_value:t}),onDraft:(e,t)=>{w(``),g(n=>n.map((n,r)=>r===e?t:n))},onAuthoritative:Ve,onPending:e=>S([...e]),onError:(e,t,n)=>{w(t.message),n&&g(t=>t.map((t,n)=>n===e?B.current[e]:t))}}),(0,q.useEffect)(()=>()=>De.current?.dispose(),[]),(0,q.useEffect)(()=>{if(!c){D(null);return}let e=!0;return F(`controller.ui.config.get`).then(t=>{e&&D(t)}).catch(()=>{e&&D(null)}),()=>{e=!1}},[c,ve,e.events.find(e=>e.kind===`peripherals.changed`)?.id,t.port.name]),(0,q.useEffect)(()=>{if(!c||!l.pwm){te(!1);return}w(``);let t=new Ue({eventDriven:e.transport.streamState===`open`,operations:we.current,canRead:()=>!Ce.current&&(De.current?.pendingChannels().length??0)===0,read:e=>F(`controller.pwm.values`,{},e),onAuthoritative:e=>Ve(e),onError:e=>w(e.message)});return t.start(),()=>t.stop()},[l.pwm,c,e.transport.streamState]),(0,q.useEffect)(()=>{c&&t.pwm_values&&Ve(t.pwm_values)},[c,t.pwm_revision,t.pwm_values,y.length]),(0,q.useEffect)(()=>{if(!e.focusControl||!c||!E)return;let t=[...document.querySelectorAll(`[data-control-key]`)].find(t=>t.dataset.controlKey===e.focusControl?.key);t?.scrollIntoView({block:`center`,behavior:e.reduceMotion?`auto`:`smooth`}),t?.focus({preventScroll:!0})},[e.focusControl,c,E]);let He=[`MOSFET 1`,`MOSFET 2`,`MOSFET 3`,`MOSFET 4`,`MOSFET 5`,`MOSFET 6`,`MOSFET 7`,`MOSFET 8`,s(`User PWM 9`,`PWM کاربر ۹`),s(`User PWM 10`,`PWM کاربر ۱۰`),s(`User PWM 11`,`PWM کاربر ۱۱`),s(`Enclosure light`,`نور محفظه`),s(`Power indicator`,`نشانگر توان`),s(`Status red`,`وضعیت قرمز`),s(`Status green`,`وضعیت سبز`),s(`Status blue`,`وضعیت آبی`)],We=[s(`Side A direction`,`جهت سمت A`),s(`Side A output`,`خروجی سمت A`),s(`Side B direction`,`جهت سمت B`),s(`Side B output`,`خروجی سمت B`),s(`User relay 5`,`رلهٔ کاربر ۵`),s(`User relay 6`,`رلهٔ کاربر ۶`),s(`User relay 7`,`رلهٔ کاربر ۷`),s(`User relay 8`,`رلهٔ کاربر ۸`)],Ge=(e,t)=>Kt(E?.controls,e,E?.peripheral_names?.[e]?.trim()||t),Ke=e=>Ge(`pwm.${e}`,He[e]),qe=(e,t,n=!1)=>{De.current?.schedule(e,Pe(t,Be(e)),n)},Je=async(e,t)=>{if(Be(e)){w(``);try{await F(`controller.pwm.channel.configure`,{channel:e,...t});let n=await F(`controller.ui.config.get`);D(n),Ve(await we.current.run(()=>F(`controller.pwm.values`)))}catch(e){w(e instanceof Error?e.message:String(e))}}},Ye=async(e,t)=>{if(!(De.current?.pendingChannels().length||Ce.current)){Ce.current=!0,T(!0),w(``);try{let n=await we.current.run(()=>F(`controller.control.invoke`,{action_id:`pwm.${e}.${t}`}));Ve(n.pwm)}catch(e){w(e instanceof Error?e.message:String(e))}finally{Ce.current=!1,T(!1)}}},Xe=async()=>{if(!y.length){Ce.current=!0,T(!0),w(``);try{Ve(await we.current.run(()=>F(`controller.pwm.off`)))}catch(e){w(e instanceof Error?e.message:String(e))}finally{Ce.current=!1,T(!1)}}};if(!c){let i=e.transport.streamState===`connecting`,o=e.transport.streamState!==`open`,c=i?`connecting`:o?`transport-offline`:`board-offline`,l=Ee(t,n),u=i?s(`Connecting…`,`در حال اتصال…`):o?s(`Reconnecting…`,`در حال اتصال دوباره…`):l.title;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:s(`Controller board controls`,`کنترل‌های برد`),title:r(`controls`),detail:o?void 0:t.connection_reason}),(0,J.jsx)(z,{icon:o?d:x,iconTone:`amber`,title:u,eyebrow:i?s(`Reconnecting`,`اتصال دوباره`):s(`Connection`,`اتصال`),children:o?(0,J.jsx)(Zt,{state:c,locale:n,showTitle:!1}):(0,J.jsx)(Qt,{snapshot:t,locale:n,reconnect:()=>void a(`reconnect`,l.action),hardwareReset:ye(t)?()=>void a(`reset lines`,s(`Hardware reset sent`,`بازنشانی سخت‌افزاری ارسال شد`)):void 0})})]})}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:s(`Connected controller`,`کنترلر متصل`),title:r(`controls`),detail:Jt(t,e.appTitle,n)}),(0,J.jsxs)(`div`,{className:`safety-strip controller-estop${u?` is-danger`:``}`,role:`status`,"aria-live":`assertive`,children:[(0,J.jsx)(pt,{size:17}),(0,J.jsx)(`span`,{children:u?s(`E-STOP locked · effects, motion, relay-on, and PWM output are blocked`,`توقف اضطراری قفل است · افکت‌ها، حرکت، روشن‌کردن رله و خروجی PWM مسدود هستند`):s(`E-STOP ready`,`توقف اضطراری آماده است`)}),(0,J.jsx)(N,{compact:!0,tone:`danger`,onClick:()=>void a(`estop ${u?`off`:`on`}`),children:u?s(`Release`,`آزادسازی`):s(`Engage`,`فعال‌سازی`)})]}),(0,J.jsxs)(`section`,{className:`control-layout`,children:[l.relays&&(0,J.jsxs)(z,{icon:nt,iconTone:t.status.active_relays?`amber`:`green`,eyebrow:s(`Eight protected outputs`,`هشت خروجی محافظت‌شده`),title:s(`Relays & motion`,`رله‌ها و حرکت`),className:`relay-control-card`,action:(0,J.jsx)(W,{tone:t.status.active_relays?`warn`:`good`,children:t.status.active_relays?s(`ENERGIZED`,`برقدار`):s(`RELEASED`,`آزاد`)}),menu:[{label:s(`Refresh output state`,`تازه‌سازی وضعیت خروجی‌ها`),icon:i,onSelect:()=>{a(`status`)}},{label:s(`Release every relay`,`آزادسازی همهٔ رله‌ها`),icon:ne,tone:`danger`,onSelect:()=>o({tone:`danger`,title:r(`confirmEmergencyTitle`),body:r(`confirmEmergencyBody`),confirmLabel:r(`emergencyOff`),action:async()=>{await a(`relay off`)}})}],children:[(0,J.jsx)(`div`,{className:`relay-bank`,children:Array.from({length:8},(e,n)=>{let i=!!(t.status.active_relays&1<void a(`relay ${n+1} ${i?`off`:`on`}`)}),(0,J.jsx)(`small`,{children:Ge(`relay.${n+1}`,We[n])}),(0,J.jsxs)(`div`,{className:`relay-switch__actions`,children:[(0,J.jsx)(N,{compact:!0,disabled:i||u,onClick:()=>void a(`relay ${n+1} on`),children:r(`on`)}),(0,J.jsx)(N,{compact:!0,disabled:!i,onClick:()=>void a(`relay ${n+1} off`),children:r(`off`)})]})]},n)})}),(0,J.jsx)(`div`,{className:`motion-actions`,children:[`left`,`right`].map(e=>{let n=t.motion?.[e],r=Gt(n),i=r===`up`?s(`UP`,`بالا`):r===`down`?s(`DOWN`,`پایین`):r===`stop`?s(`STOPPED`,`متوقف`):s(`UNKNOWN`,`نامشخص`);return(0,J.jsxs)(`div`,{className:`motion-side`,"data-control-key":e===`left`?`seat.a`:`seat.b`,tabIndex:-1,children:[(0,J.jsxs)(`div`,{className:`motion-side__identity`,children:[(0,J.jsx)(`strong`,{children:e===`left`?Ge(`seat.a`,s(`Side A motion`,`حرکت سمت A`)):Ge(`seat.b`,s(`Side B motion`,`حرکت سمت B`))}),(0,J.jsx)(W,{tone:r===`unknown`?`neutral`:r===`stop`?`good`:n?.transitioning?`warn`:`info`,pulse:n?.transitioning,children:n?.transitioning?`${i} · ${s(`SYNCING`,`همگام‌سازی`)}`:i})]}),(0,J.jsxs)(`div`,{className:`motion-side__actions`,children:[(0,J.jsx)(ue,{compact:!0,disabled:u,onHoldStart:()=>a(`relay side ${e} up`),onHoldStop:()=>a(`relay side ${e} stop`),children:s(`Hold Up`,`بالا نگه‌دار`)}),(0,J.jsx)(N,{compact:!0,onClick:()=>void a(`relay side ${e} stop`),children:s(`Stop`,`توقف`)}),(0,J.jsx)(ue,{compact:!0,disabled:u,onHoldStart:()=>a(`relay side ${e} down`),onHoldStop:()=>a(`relay side ${e} stop`),children:s(`Hold Down`,`پایین نگه‌دار`)})]})]},e)})}),(0,J.jsx)(N,{icon:pt,tone:`danger`,onClick:()=>o({tone:`danger`,title:r(`confirmEmergencyTitle`),body:r(`confirmEmergencyBody`),confirmLabel:r(`emergencyOff`),action:async()=>{await a(`relay off`)}}),children:r(`emergencyOff`)})]}),l.pwm&&(0,J.jsxs)(z,{icon:m,iconTone:`violet`,eyebrow:s(`11 user channels · acknowledged writes`,`۱۱ کانال کاربر · نوشتن با تأیید`),title:s(`PWM mixer`,`میکسر PWM`),className:`pwm-card`,action:(0,J.jsx)(W,{tone:C?`bad`:y.length?`warn`:v?`good`:`neutral`,children:C?s(`ERROR`,`خطا`):y.length?s(`SYNCING`,`همگام‌سازی`):v?s(`CONFIRMED`,`تأییدشده`):s(`READING`,`در حال خواندن`)}),children:[(0,J.jsx)(`div`,{className:`pwm-mixer`,children:Se.map(e=>{let n=p[e],i=h[e],a=y.includes(e),o=Ke(e),c=Be(e);return(0,J.jsxs)(`div`,{"data-control-key":`pwm.${e}`,tabIndex:-1,className:`pwm-mixer__row${t.status.pwm_channel===e&&!a?` is-live`:``}${a?` is-pending`:``}`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`strong`,{children:[c?.icon===`lightbulb`?`💡 `:c?.output_type===`motor`?`⚙️ `:``,o]}),(0,J.jsx)(`small`,{children:o===He[e]?`pwm.${e}`:`${He[e]} · pwm.${e}`}),(0,J.jsx)(`small`,{children:a?s(`Board ${n} · draft ${i}`,`برد ${n} · پیش‌نویس ${i}`):s(`${Ie(n,c)}% brightness · raw ${n}`,`${Ie(n,c)}٪ روشنایی · خام ${n}`)}),(0,J.jsxs)(`div`,{className:`pwm-channel-config`,children:[(0,J.jsxs)(`select`,{"aria-label":s(`${o} output type`,`نوع خروجی ${o}`),value:c?.output_type??`general`,onChange:t=>void Je(e,{output_type:t.target.value,icon:t.target.value===`lighting`?`lightbulb`:t.target.value===`indicator`?`led`:t.target.value===`motor`?`settings`:`sliders-horizontal`}),children:[(0,J.jsx)(`option`,{value:`lighting`,children:s(`Lighting`,`روشنایی`)}),(0,J.jsx)(`option`,{value:`indicator`,children:s(`LED indicator`,`نشانگر LED`)}),(0,J.jsx)(`option`,{value:`motor`,children:s(`Motor`,`موتور`)}),(0,J.jsx)(`option`,{value:`general`,children:s(`General PWM`,`PWM عمومی`)})]}),(0,J.jsxs)(`select`,{"aria-label":s(`${o} response curve`,`منحنی پاسخ ${o}`),value:c?.curve??`linear`,onChange:t=>void Je(e,{curve:t.target.value,gamma:t.target.value===`linear`?1:c?.gamma===1?2.2:c?.gamma??2.2}),children:[(0,J.jsx)(`option`,{value:`gamma`,children:s(`Perceptual`,`ادراکی`)}),(0,J.jsx)(`option`,{value:`linear`,children:s(`Linear`,`خطی`)})]}),c?.on_behavior&&(0,J.jsxs)(`select`,{"aria-label":s(`${o} On behavior`,`رفتار روشن شدن ${o}`),value:c.on_behavior,disabled:a||re,onChange:t=>void Je(e,{on_behavior:t.target.value}),children:[(0,J.jsx)(`option`,{value:`full`,children:s(`On: full brightness`,`روشن: نور کامل`)}),(0,J.jsx)(`option`,{value:`restore`,children:s(`On: last brightness`,`روشن: آخرین روشنایی`)})]})]})]}),(0,J.jsx)(U,{label:s(`${o} brightness`,`روشنایی ${o}`),value:Ie(i,c),min:0,max:100,step:.1,unit:`%`,disabled:!v||re||u||E?.controls.find(t=>t.key===`pwm.${e}`)?.locked,onEditStart:()=>De.current?.beginEdit(e),onEditEnd:()=>De.current?.endEdit(e),onChange:t=>qe(e,t)}),(0,J.jsxs)(`div`,{className:`pwm-mixer__actions`,children:[(0,J.jsx)(N,{compact:!0,disabled:!v||re||a||n===0||E?.controls.find(t=>t.key===`pwm.${e}`)?.locked,onClick:()=>void Ye(e,`off`),children:r(`off`)}),(0,J.jsx)(N,{compact:!0,disabled:!v||re||a||u||E?.controls.find(t=>t.key===`pwm.${e}`)?.locked||(c?.on_behavior===`restore`?n>0:n===4095),onClick:()=>void Ye(e,`on`),children:r(`on`)})]}),c?.curve===`gamma`&&(0,J.jsx)(U,{label:s(`Curve strength`,`شدت منحنی`),value:c.gamma,min:.1,max:5,step:.1,disabled:re,onChange:t=>void Je(e,{gamma:t})})]},e)})}),(0,J.jsx)(`div`,{className:`system-output-summary`,"aria-label":s(`Role-specific system PWM channels`,`کانال‌های PWM سیستمی با کنترل اختصاصی`),children:[11,12,13,14,15].map(e=>(0,J.jsxs)(`span`,{"data-control-key":`pwm.${e}`,tabIndex:-1,children:[(0,J.jsx)(`strong`,{children:Ke(e)}),(0,J.jsxs)(`small`,{children:[p[e],` / 4095`]})]},e))}),(0,J.jsx)(`div`,{className:`pwm-authority-status${C?` is-error`:``}`,role:`status`,"aria-live":`polite`,children:C||(y.length?s(`${y.length} channel${y.length===1?``:`s`} waiting for controller acknowledgement.`,`${y.length} کانال در انتظار تأیید کنترلر است.`):v?s(`Every displayed board value is authoritative; sliders are separate local drafts until acknowledged.`,`همهٔ مقادیر برد معتبرند؛ لغزنده‌ها تا زمان تأیید، پیش‌نویس محلی جداگانه‌اند.`):s(`Reading the complete 16-channel state from the controller…`,`در حال خواندن وضعیت کامل ۱۶ کانال از کنترلر…`))}),(0,J.jsx)(N,{icon:_t,busy:re,disabled:!v||re||y.length>0,onClick:()=>void Xe(),children:s(`Clear all PWM channels`,`پاک‌کردن همهٔ کانال‌های PWM`)})]}),l.statusLED&&(0,J.jsxs)(z,{icon:fe,iconTone:`amber`,eyebrow:s(`Color and effects`,`رنگ و افکت‌ها`),title:s(`Status lighting`,`نور وضعیت`),className:`rgb-card`,children:[(0,J.jsxs)(`div`,{className:`status-led-previews`,children:[(0,J.jsxs)(`div`,{className:`color-preview`,style:{"--preview":ke},children:[(0,J.jsx)(`span`,{}),(0,J.jsxs)(`strong`,{children:[s(`Selected`,`انتخاب‌شده`),` · `,ke,` · RGB `,k,` `,j,` `,ae]})]}),(0,J.jsxs)(`div`,{className:`status-led-live`,style:{"--preview":Ne},children:[(0,J.jsx)(`i`,{"aria-hidden":`true`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:s(`Physical LED mirror`,`بازتاب LED فیزیکی`)}),(0,J.jsx)(`small`,{dir:`ltr`,children:Ae?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`mono`,children:Ne}),` · effect ${Ae.effect} · condition ${Ae.condition}`]}):s(`Awaiting pushed board state`,`در انتظار وضعیت ارسالی برد`)})]})]})]}),(0,J.jsxs)(`label`,{className:`native-color-field`,children:[(0,J.jsx)(`span`,{children:s(`Color picker`,`انتخاب‌گر رنگ`)}),(0,J.jsx)(`input`,{type:`color`,value:ke,"aria-label":s(`Status LED color`,`رنگ LED وضعیت`),onChange:e=>{let t=e.target.value;A(Number.parseInt(t.slice(1,3),16)),ie(Number.parseInt(t.slice(3,5),16)),oe(Number.parseInt(t.slice(5,7),16))}}),(0,J.jsx)(`code`,{children:ke})]}),v&&(0,J.jsxs)(`div`,{className:`rgb-board-state`,children:[(0,J.jsx)(`span`,{children:s(`Board-reported PWM`,`PWM گزارش‌شدهٔ برد`)}),(0,J.jsxs)(`strong`,{dir:`ltr`,children:[p[13],` · `,p[14],` · `,p[15]]})]}),(0,J.jsx)(U,{label:s(`Red`,`قرمز`),value:k,min:0,max:255,onChange:A}),(0,J.jsx)(U,{label:s(`Green`,`سبز`),value:j,min:0,max:255,onChange:ie}),(0,J.jsx)(U,{label:s(`Blue`,`آبی`),value:ae,min:0,max:255,onChange:oe}),(0,J.jsx)(U,{label:s(`Brightness`,`روشنایی`),value:M,min:0,max:255,onChange:e=>{se(e),me(t=>Math.min(t,e))}}),(0,J.jsxs)(`div`,{className:`rgb-effect-fields`,children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:s(`Presentation`,`نحوه نمایش`)}),(0,J.jsxs)(`select`,{value:I,onChange:e=>le(e.target.value),children:[(0,J.jsx)(`option`,{value:`color`,children:s(`Steady color`,`رنگ ثابت`)}),(0,J.jsx)(`option`,{value:`breathe`,children:s(`Breathe`,`تنفس`)}),(0,J.jsx)(`option`,{value:`flash`,children:s(`Flash`,`چشمک`)}),(0,J.jsx)(`option`,{value:`cycle`,children:s(`Two-color cycle`,`چرخه دو رنگ`)}),(0,J.jsx)(`option`,{value:`transition`,children:s(`Transition`,`گذار`)})]})]}),I!==`color`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:s(`Period`,`دوره`)}),(0,J.jsx)(`input`,{type:`number`,min:640,max:6e4,value:L,onChange:e=>de(Math.max(640,Math.min(6e4,Number(e.target.value))))}),(0,J.jsx)(`small`,{children:`ms`})]}),(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:s(`Repeat`,`تکرار`)}),(0,J.jsxs)(`select`,{value:he,onChange:e=>ge(e.target.value),children:[(0,J.jsx)(`option`,{value:`once`,children:s(`Once`,`یک‌بار`)}),(0,J.jsx)(`option`,{value:`loop`,children:s(`Loop`,`پیوسته`)})]})]})]}),I===`breathe`&&(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:s(`Minimum brightness`,`حداقل روشنایی`)}),(0,J.jsx)(`input`,{type:`number`,min:0,max:M,value:pe,onChange:e=>me(Math.max(0,Math.min(M,Number(e.target.value))))})]}),(I===`flash`||I===`cycle`||I===`transition`)&&(0,J.jsxs)(`label`,{className:`native-color-field native-color-field--compact`,children:[(0,J.jsx)(`span`,{children:s(`Second color`,`رنگ دوم`)}),(0,J.jsx)(`input`,{type:`color`,value:P,onChange:e=>ce(e.target.value.toUpperCase())}),(0,J.jsx)(`code`,{children:P})]})]}),(0,J.jsxs)(`div`,{className:`inline-actions`,children:[(0,J.jsx)(N,{tone:`primary`,icon:_,disabled:!t.connected,onClick:()=>void a(Le),children:s(`Apply live`,`اعمال زنده`)}),(0,J.jsx)(N,{disabled:!t.connected,onClick:()=>void a(`rgb effect stop`),children:s(`Stop effect`,`توقف افکت`)})]}),(0,J.jsxs)(`div`,{className:`rgb-profile-row`,children:[(0,J.jsxs)(`label`,{children:[(0,J.jsx)(`span`,{children:s(`EEPROM condition`,`شرط EEPROM`)}),(0,J.jsx)(`select`,{value:_e,onChange:e=>R(e.target.value),children:[`off`,`boot`,`ready`,`learning`,`hot`,`fault`,`custom`,`bluetooth-connected`,`bluetooth-off`,`bluetooth-waiting`,`running`,`door-open`,`door-closed`,`bluetooth`,`menu`,`radio`,`save`,`discard`,`reset`].map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))})]}),(0,J.jsx)(N,{icon:b,disabled:!t.connected,onClick:()=>void a(ze),children:s(`Save profile (live when active)`,`ذخیره پروفایل (هنگام فعال‌شدن زنده)`)})]})]})]})]})}var nn=[`capabilities`,`snapshot`];function rn(e){return e.http_reachable===!0}function an(e){return e.configured===!0&&!rn(e)}function on({locale:e,t}){let r=(t,n)=>e===`fa`?n:t,[a,o]=(0,q.useState)({power:`unknown`,phase:`idle`}),[s,c]=(0,q.useState)(``),[l,u]=(0,q.useState)(``),[d,f]=(0,q.useState)(null),[p,ee]=(0,q.useState)(`capabilities`),[m,h]=(0,q.useState)(``),g=async()=>{try{o(await F(`controller.device.status`)),h(``)}catch(e){h(e instanceof Error?e.message:String(e))}};(0,q.useEffect)(()=>{g();let e=window.setInterval(()=>void g(),3e3);return()=>window.clearInterval(e)},[]);let _=async(t,n=``,r=0)=>{if(t!==`passive.refresh`&&!rn(a))h(e===`fa`?`ارتباط HTTP وسیله در دسترس نیست.`:`The device HTTP command transport is unavailable.`);else{c(t);try{o(await F(`controller.device.action`,{action:t,text:n,count:r})),h(``),t===`display.message`&&u(``)}catch(e){h(e instanceof Error?e.message:String(e))}finally{c(``)}}},v=async()=>{if(!rn(a))h(e===`fa`?`برای بازرسی، ارتباط HTTP لازم است.`:`Inspection requires the device HTTP transport.`);else{c(`inspect`);try{f(await F(`controller.device.inspect`,{resource:p})),h(``)}catch(e){h(e instanceof Error?e.message:String(e))}finally{c(``)}}},te=a.power?.toUpperCase(),y=te===`ON`,b=rn(a),x=an(a),S=a.configured===!1?e===`fa`?`یکپارچه‌سازی وسیله غیرفعال است`:`Local device integration is disabled`:a.events_online?e===`fa`?`مسیر فرمان HTTP در دسترس نیست`:`HTTP command transport is unavailable`:a.configured?e===`fa`?`وسیلهٔ محلی در دسترس نیست`:`Local companion is unreachable`:m?e===`fa`?`وضعیت وسیله دریافت نشد`:`Companion status is unavailable`:e===`fa`?`در حال بررسی وسیلهٔ محلی`:`Checking local companion availability`,C=a.last_error||m||(a.configured===!1?e===`fa`?`نشانی و فعال‌سازی را در تنظیمات خدمات محلی بررسی کنید.`:`Choose a private-network endpoint and enable it in local-service settings.`:e===`fa`?`وضعیت فعلی: ${a.phase||`نامشخص`}`:`Current phase: ${a.phase||`unknown`}`),w=[{label:e===`fa`?`تازه‌سازی وضعیت`:`Refresh device status`,icon:i,onSelect:()=>{g()}},...x?[{label:e===`fa`?`تلاش دوباره برای اتصال`:`Retry companion connection`,icon:ht,onSelect:()=>{_(`passive.refresh`)}}]:[],...b?[{label:y?e===`fa`?`خاموش‌کردن وسیله`:`Turn device off`:e===`fa`?`روشن‌کردن وسیله`:`Turn device on`,icon:et,onSelect:()=>{_(y?`power.off`:`power.on`)}}]:[]];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:`${r(`Local companion`,`وسیلهٔ محلی`)} · ${a.phase||`idle`}`,title:a.name||t(`device`),detail:a.base_url||r(`Typed local-network companion through the primary host`,`وسیلهٔ شبکهٔ محلی با قرارداد مشخص، از طریق میزبان اصلی`),action:(0,J.jsx)(W,{tone:a.events_online?`good`:a.http_reachable?`warn`:`bad`,pulse:a.phase===`connecting`,children:a.events_online?r(`EVENT STREAM`,`جریان رویداد`):a.http_reachable?`HTTP`:t(`offline`)})}),(0,J.jsxs)(`section`,{className:`device-layout`,children:[(0,J.jsxs)(z,{icon:I,iconTone:y?`green`:`amber`,title:r(`Local device`,`وسیلهٔ محلی`),eyebrow:a.events_online?r(`Events connected`,`رویدادها متصل‌اند`):a.http_reachable?r(`HTTP reachable`,`HTTP در دسترس`):r(`Unavailable`,`دردسترس نیست`),className:`device-stage${y?` is-on`:``}`,menu:w,children:[(0,J.jsxs)(`div`,{className:`device-overview`,"aria-label":r(`Device power ${a.power??`unknown`}`,`توان وسیله ${a.power??`نامشخص`}`),children:[(0,J.jsxs)(`div`,{className:`device-overview__mark`,children:[(0,J.jsx)(I,{size:38}),(0,J.jsx)(`span`,{"aria-hidden":`true`})]}),(0,J.jsxs)(`div`,{className:`device-overview__copy`,children:[(0,J.jsx)(`span`,{children:a.base_url||r(`Host-mediated local connection`,`اتصال محلی با میانجی‌گری میزبان`)}),(0,J.jsx)(`strong`,{children:y?r(`Device is powered on`,`وسیله روشن است`):te===`OFF`?r(`Device is powered off`,`وسیله خاموش است`):r(`Power state is unknown`,`وضعیت توان نامشخص است`)}),(0,J.jsx)(`small`,{children:a.last_event||a.last_error||(a.phase?`${r(`Phase`,`مرحله`)}: ${a.phase}`:r(`No device event received`,`رویدادی از وسیله دریافت نشده است`))})]})]}),(0,J.jsxs)(`div`,{className:`device-facts`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:t(`status`)}),(0,J.jsx)(`strong`,{children:a.power??t(`unknown`)})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:r(`Transport`,`رسانهٔ ارتباطی`)}),(0,J.jsx)(`strong`,{children:a.events_online?r(`Events`,`رویدادها`):a.http_reachable?`HTTP`:t(`offline`)})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:r(`Updated`,`آخرین تغییر`)}),(0,J.jsx)(`strong`,{children:a.updated_at?qe(e,a.updated_at):`—`})]})]}),b?(0,J.jsxs)(`div`,{className:`device-actions`,children:[(0,J.jsx)(N,{tone:`success`,icon:De,busy:s===`power.on`,onClick:()=>void _(`power.on`),children:t(`on`)}),(0,J.jsx)(N,{tone:`secondary`,icon:be,busy:s===`power.off`,onClick:()=>void _(`power.off`),children:t(`off`)}),(0,J.jsx)(N,{tone:`primary`,icon:et,busy:s===`power.toggle`,onClick:()=>void _(`power.toggle`),children:t(`toggle`)})]}):(0,J.jsx)(ve,{icon:a.configured===!1?B:ne,title:S,detail:C,action:(0,J.jsxs)(`div`,{className:`device-unavailable__actions`,children:[x&&(0,J.jsx)(N,{compact:!0,tone:`primary`,icon:ht,busy:s===`passive.refresh`,onClick:()=>void _(`passive.refresh`),children:e===`fa`?`تلاش دوباره`:`Retry connection`}),(0,J.jsx)(N,{compact:!0,icon:i,busy:s===`status`,onClick:()=>void g(),children:e===`fa`?`تازه‌سازی وضعیت`:`Refresh status`}),a.configured!==!0&&(0,J.jsx)(N,{compact:!0,icon:B,onClick:()=>{window.location.hash=`#/settings`},children:e===`fa`?`تنظیم یکپارچه‌سازی`:`Open integration settings`})]})}),(0,J.jsx)(We,{initial:!1,children:m&&(0,J.jsx)(Ne.div,{className:`inline-error-presence`,initial:{height:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(4px)`},animate:{height:`auto`,opacity:1,clipPath:`inset(0 0 0% 0)`,filter:`blur(0px)`},exit:{height:0,opacity:0,clipPath:`inset(0 0 100% 0)`,filter:`blur(3px)`},transition:{duration:.28,ease:[.22,1,.36,1]},children:(0,J.jsxs)(`div`,{className:`inline-error`,role:`alert`,children:[(0,J.jsx)(pt,{size:17}),(0,J.jsx)(`span`,{children:m})]})},`local-device-error`)})]}),(0,J.jsxs)(`div`,{className:`device-side`,children:[b&&(0,J.jsxs)(z,{icon:K,iconTone:`violet`,title:t(`message`),eyebrow:l.length?r(`${l.length} characters`,`${l.length} نویسه`):r(`No message entered`,`پیامی وارد نشده`),action:(0,J.jsx)(W,{tone:`info`,children:r(`LOCAL DEVICE`,`وسیلهٔ محلی`)}),children:[(0,J.jsxs)(`div`,{className:`message-compose`,children:[(0,J.jsx)(`input`,{value:l,maxLength:256,placeholder:r(`A bounded display message`,`پیام کوتاه برای نمایش`),onChange:e=>u(e.target.value)}),(0,J.jsx)(N,{icon:re,tone:`primary`,busy:s===`display.message`,disabled:!l.trim(),onClick:()=>void _(`display.message`,l.trim()),children:t(`send`)})]}),(0,J.jsxs)(`div`,{className:`beep-row`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(Fe,{size:18}),(0,J.jsxs)(`span`,{children:[t(`beep`),` · `,r(`explicit alert pulse`,`پالس هشدار صریح`)]})]}),[1,2,3].map(e=>(0,J.jsxs)(N,{compact:!0,busy:s===`alert.pulse`,onClick:()=>void _(`alert.pulse`,``,e),children:[e,`×`]},e))]})]}),b&&(0,J.jsxs)(z,{icon:n,iconTone:`accent`,title:t(`diagnostics`),eyebrow:d?r(`Inspection loaded`,`بازرسی بارگیری شد`):r(`Not inspected`,`بازرسی نشده`),action:(0,J.jsx)(N,{icon:i,compact:!0,busy:s===`inspect`,onClick:()=>void v(),children:t(`fetch`)}),children:[(0,J.jsx)(`div`,{className:`diagnostic-picker`,children:nn.map(e=>(0,J.jsx)(`button`,{className:p===e?`is-active`:``,onClick:()=>ee(e),dir:`ltr`,children:e},e))}),d!==null&&(0,J.jsx)(`pre`,{className:`diagnostic-output`,dir:`ltr`,children:JSON.stringify(d,null,2)})]}),(0,J.jsx)(z,{icon:ct,iconTone:a.events_online?`green`:`amber`,title:r(`Connection health`,`سلامت اتصال`),eyebrow:a.events_online?r(`Event stream connected`,`جریان رویداد متصل است`):a.http_reachable?r(`HTTP reachable`,`HTTP در دسترس`):r(`Unavailable`,`دردسترس نیست`),action:(0,J.jsx)(N,{icon:i,compact:!0,onClick:()=>void g(),children:e===`fa`?`تازه‌سازی`:`Refresh`}),children:(0,J.jsxs)(`div`,{className:`data-list`,children:[(0,J.jsx)(R,{label:r(`Phase`,`مرحله`),value:a.phase||`idle`}),(0,J.jsx)(R,{label:`HTTP`,value:a.http_reachable?t(`online`):t(`offline`),tone:a.http_reachable?`good`:`bad`}),(0,J.jsx)(R,{label:r(`Event stream`,`جریان رویداد`),value:a.events_online?t(`online`):t(`offline`),tone:a.events_online?`good`:`warn`}),(0,J.jsx)(R,{label:r(`Last event`,`آخرین رویداد`),value:a.last_event||`—`}),(0,J.jsx)(R,{label:r(`Identity`,`هویت`),value:[a.name,a.model,a.firmware].filter(Boolean).join(` · `)||`—`}),(0,J.jsx)(R,{label:r(`Device ID`,`شناسهٔ وسیله`),value:a.device_id||`—`,mono:!0})]})})]})]})]})}function sn({events:e,locale:t,t:n}){let r=(e,n)=>t===`fa`?n:e,[i,a]=(0,q.useState)(`all`),o=e.filter(e=>i===`all`||Xt(e)===i);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:r(`Unified history`,`تاریخچهٔ یکپارچه`),title:n(`events`),detail:r(`One timeline for controller lifecycle, RF, doors, macros, automations and integrated services.`,`یک خط زمانی برای چرخهٔ کنترلر، RF، درها، ماکروها، خودکارسازی‌ها و سرویس‌های یکپارچه.`),action:(0,J.jsxs)(W,{tone:`info`,children:[e.length,` `,r(`retained`,`نگه‌داری‌شده`)]})}),(0,J.jsxs)(z,{icon:ce,iconTone:`violet`,className:`events-page-card`,title:r(`Event timeline`,`خط زمانی رویدادها`),eyebrow:r(`${o.length} visible`,`${o.length} مورد نمایان`),children:[(0,J.jsx)(`div`,{className:`event-toolbar`,children:(0,J.jsx)(V,{value:i,label:r(`Event severity`,`شدت رویداد`),options:[{value:`all`,label:r(`All`,`همه`)},{value:`good`,label:r(`Good`,`عادی`)},{value:`warn`,label:r(`Warn`,`هشدار`)},{value:`bad`,label:r(`Fault`,`خطا`)},{value:`info`,label:r(`Info`,`اطلاعات`)}],onChange:a})}),(0,J.jsx)(Et,{events:o,locale:t,t:n,limit:o.length,toolbar:!0})]})]})}function cn({appTitle:e,snapshot:t,locale:r,t:i,command:o,appearance:s,onAppearance:c,token:l,onToken:u,onAppTitle:d,boardSettingsReadState:f,uiConfig:p,onMeasurementTiming:ee,onBuzzerPath:h,transport:g,navigationSync:_,navigationSyncStatus:v={state:`idle`,detail:``},onNavigationSync:te,appInstances:y=[]}){let x=(e,t)=>r===`fa`?t:e,S=Oe(t),C=e=>r===`fa`?{"Application title is required.":`عنوان برنامه الزامی است.`,"Application title must be 64 characters or fewer.":`عنوان برنامه باید حداکثر ۶۴ نویسه باشد.`,"Application title must include a letter or number.":`عنوان برنامه باید دست‌کم یک حرف یا عدد داشته باشد.`,"A root URL is required while this integration is enabled.":`وقتی یکپارچه‌سازی فعال است، نشانی ریشه الزامی است.`,"Enter a valid HTTP or HTTPS root URL.":`یک نشانی ریشهٔ معتبر HTTP یا HTTPS وارد کنید.`,"Only HTTP and HTTPS are supported.":`فقط HTTP و HTTPS پشتیبانی می‌شوند.`,"Credentials are not allowed in the URL.":`اطلاعات دسترسی نباید داخل نشانی باشد.`,"Query strings and fragments are not allowed.":`پارامتر پرس‌وجو و قطعه در نشانی مجاز نیست.`,"Use the service root without a path.":`ریشهٔ سرویس را بدون مسیر وارد کنید.`,"Use a private, loopback, link-local, or local-DNS host.":`از میزبان خصوصی، loopback، link-local یا DNS محلی استفاده کنید.`,"The data service must use localhost or a loopback address.":`سرویس داده باید از localhost یا نشانی loopback استفاده کند.`,"Use no more than 14 page keys or IDs.":`حداکثر ۱۴ کلید یا شناسهٔ صفحه وارد کنید.`,"Page keys or IDs must use printable ASCII characters.":`کلیدها یا شناسه‌های صفحه باید فقط از نویسه‌های قابل چاپ ASCII باشند.`,"Page keys or IDs must be unique.":`کلیدها یا شناسه‌های صفحه باید یکتا باشند.`,"Text must use printable ASCII characters.":`متن باید فقط از نویسه‌های قابل چاپ ASCII باشد.`,"Text must contain at least 5 printable ASCII bytes.":`متن باید دست‌کم ۵ بایت ASCII قابل چاپ داشته باشد.`,"Text and repeat gap must fit within 40 bytes.":`متن همراه با فاصلهٔ تکرار باید در ۴۰ بایت جا شود.`}[e]??e:e,[re,E]=(0,q.useState)(l),[O,k]=(0,q.useState)(e),[ie,oe]=(0,q.useState)(!1),[M,I]=(0,q.useState)(``),[L,ue]=(0,q.useState)(!1),[me,ye]=(0,q.useState)(``),[B,xe]=(0,q.useState)(t.settings.display_brightness),[Se,Ce]=(0,q.useState)(t.settings.display_closed_brightness),[we,Te]=(0,q.useState)(t.settings.motion_exit_hold_seconds||2),[Ee,ke]=(0,q.useState)(t.settings.status_brightness),[Ae,Me]=(0,q.useState)(t.settings.stream_period_ms||200),[Ne,Pe]=(0,q.useState)(t.settings.output_persistence),[Ie,Re]=(0,q.useState)(t.settings.relay_restore_mask),[Ve,He]=(0,q.useState)(String(t.settings.light_mode)),[Ue,We]=(0,q.useState)(t.settings.on_brightness),[Ge,qe]=(0,q.useState)(t.settings.off_brightness),[G,Ze]=(0,q.useState)(t.illumination),[Qe,$e]=(0,q.useState)(t.illumination.applied_pwm),[tt,rt]=(0,q.useState)(!1),[at,st]=(0,q.useState)(``),[ct,lt]=(0,q.useState)(!1),[K,ut]=(0,q.useState)({enabled:!0,pages:[`door`],door_open_text:`door is open`,door_closed_text:`door is closed`,speed_ms:220,gap_cells:3}),[ft,pt]=(0,q.useState)(`door`),[mt,ht]=(0,q.useState)(null),[gt,vt]=(0,q.useState)(!0),[yt,bt]=(0,q.useState)(``),[xt,St]=(0,q.useState)(!1),[Ct,wt]=(0,q.useState)(p?.status_interval_ms??200),[Tt,Et]=(0,q.useState)(p?.measurement_freshness_ms??1500),[Dt,Ot]=(0,q.useState)({refresh:p?.status_interval_ms??200,freshness:p?.measurement_freshness_ms??1500}),[kt,At]=(0,q.useState)(p===null),[jt,Mt]=(0,q.useState)(``),[Y,X]=(0,q.useState)({local_device:{enabled:!1,base_url:``},data_hub:{enabled:!1,base_url:`http://127.0.0.1:8080`},lifecycle_safety:{session_lock:`stop-motion`,suspend:`stop-motion`,refresh_on_resume:!0},buzzer_mirror:{enabled:!1,native_enabled:!1,web_audio_enabled:!0,backend:`auto`,executable:``,driver_directory:``}}),[Nt,Pt]=(0,q.useState)({local_device:{enabled:!1,base_url:``},data_hub:{enabled:!1,base_url:`http://127.0.0.1:8080`},lifecycle_safety:{session_lock:`stop-motion`,suspend:`stop-motion`,refresh_on_resume:!0},buzzer_mirror:{enabled:!1,native_enabled:!1,web_audio_enabled:!0,backend:`auto`,executable:``,driver_directory:``}}),[Ft,It]=(0,q.useState)(!0),[Lt,Z]=(0,q.useState)(!1),[Rt,Q]=(0,q.useState)(``),[zt,Vt]=(0,q.useState)(p?.buzzer_runtime),Ht=(e,t)=>c({...s,[e]:t}),Ut=(0,q.useMemo)(()=>ae(O),[O]),Gt=(0,q.useMemo)(()=>D(re),[re]),Kt=t.connected&&t.have_settings,qt=Kt&&!!(t.settings.flags&1),$=zt??p?.buzzer_runtime,Jt=$?!$.host_mirror:!(p?.integrations?.buzzer_host_enabled??!1),Yt=Kt?ze(qt,Jt):null,Xt=$?.effective_path&&$.effective_path!==`unknown`?$.effective_path:Yt,Zt=async e=>{ue(!0),ye(``);try{await h(e);let t=await F(`controller.integrations.status`);Vt(t.buzzer_runtime),ye(x(`Applied and verified.`,`اعمال و تأیید شد.`))}catch(e){ye(e instanceof Error?e.message:String(e))}finally{ue(!1)}},Qt=(0,q.useMemo)(()=>_e(Y.local_device.base_url??``,Y.local_device.enabled),[Y.local_device.base_url,Y.local_device.enabled]),$t=(0,q.useMemo)(()=>he(Y.data_hub.base_url??``,Y.data_hub.enabled),[Y.data_hub.base_url,Y.data_hub.enabled]),en=Qt.valid&&$t.valid,tn=Lt&&!le(Y,Nt),nn=Ut.normalized!==e,rn=Gt!==l,an=(0,q.useMemo)(()=>se(ft),[ft]),on=(0,q.useMemo)(()=>Le(K.door_open_text,K.gap_cells),[K.door_open_text,K.gap_cells]),sn=(0,q.useMemo)(()=>Le(K.door_closed_text,K.gap_cells),[K.door_closed_text,K.gap_cells]),cn=(0,q.useMemo)(()=>({...K,pages:an.pages,door_open_text:on.normalized,door_closed_text:sn.normalized}),[sn.normalized,on.normalized,an.pages,K]),ln=an.valid&&on.valid&&sn.valid,un=mt!==null&&!ge(cn,mt),dn=Ct>=50&&Ct<=6e4&&Tt>=Ct+100&&Tt<=12e4,fn=Ct!==Dt.refresh||Tt!==Dt.freshness,pn=[{value:`leave`,label:x(`Release keys`,`رهاسازی کلیدها`)},{value:`stop-motion`,label:x(`Stop motion`,`توقف حرکت`)},{value:`all-off`,label:x(`All outputs off`,`خاموشی همه خروجی‌ها`)}],mn=yt||(gt?mt?x(`Saving the validated scrolling configuration…`,`در حال ذخیرهٔ تنظیمات معتبر پیمایش…`):x(`Loading the persisted scrolling configuration…`,`در حال بارگذاری تنظیمات ذخیره‌شدهٔ پیمایش…`):ln?un?x(`Validated draft · ready to save.`,`پیش‌نویس معتبر است و آمادهٔ ذخیره است.`):mt?x(`Saved configuration is up to date.`,`تنظیمات ذخیره‌شده به‌روز است.`):x(`Persistent scrolling configuration is unavailable.`,`تنظیمات ماندگار پیمایش در دسترس نیست.`):x(`Correct the highlighted fields before saving.`,`پیش از ذخیره، فیلدهای مشخص‌شده را اصلاح کنید.`));(0,q.useEffect)(()=>k(e),[e]),(0,q.useEffect)(()=>E(l),[l]),(0,q.useEffect)(()=>{p&&(wt(p.status_interval_ms),Et(p.measurement_freshness_ms),Ot({refresh:p.status_interval_ms,freshness:p.measurement_freshness_ms}),At(!1))},[p?.measurement_freshness_ms,p?.status_interval_ms]),(0,q.useEffect)(()=>{let e=!0;return F(`controller.ui.config.get`).then(t=>{if(!e)return;let n=se(t.segment_scroll.pages.join(` `)).pages,r={...t.segment_scroll,pages:n,door_open_text:Xe(t.segment_scroll.door_open_text),door_closed_text:Xe(t.segment_scroll.door_closed_text)};ut(r),ht(r),pt(n.join(` `)),bt(``),St(!1)}).catch(t=>{e&&(bt(t instanceof Error?t.message:String(t)),St(!0))}).finally(()=>{e&&vt(!1)}),()=>{e=!1}},[]),(0,q.useEffect)(()=>{He(String(t.settings.light_mode)),We(t.settings.on_brightness),qe(t.settings.off_brightness),xe(t.settings.display_brightness),Ce(t.settings.display_closed_brightness),Te(t.settings.motion_exit_hold_seconds||2),ke(t.settings.status_brightness),Me(t.settings.stream_period_ms||200),Pe(t.settings.output_persistence),Re(t.settings.relay_restore_mask)},[t.settings.light_mode,t.settings.on_brightness,t.settings.off_brightness,t.settings.display_brightness,t.settings.display_closed_brightness,t.settings.motion_exit_hold_seconds,t.settings.status_brightness,t.settings.stream_period_ms,t.settings.output_persistence,t.settings.relay_restore_mask]),(0,q.useEffect)(()=>{Ze(t.illumination)},[t.illumination]),(0,q.useEffect)(()=>{$e(t.illumination.applied_pwm)},[t.illumination.applied_pwm]),(0,q.useEffect)(()=>{if(!t.connected||!t.have_settings||!S.pwm)return;let e=new AbortController;return F(`controller.illumination.get`,{},e.signal).then(t=>{e.signal.aborted||Ze(t)}).catch(t=>{e.signal.aborted||(st(t instanceof Error?t.message:String(t)),lt(!0))}),()=>e.abort()},[t.connected,t.have_settings,S.pwm]);let hn=async()=>{rt(!0),st(``),lt(!1);try{let e=await F(`controller.illumination.set`,{mode:Number(Ve),on_brightness:Ue,off_brightness:Ge});Ze(e),st(x(`Applied live and verified durable in EEPROM.`,`به‌صورت زنده اعمال و ماندگاری آن در EEPROM تأیید شد.`))}catch(e){st(e instanceof Error?e.message:String(e)),lt(!0)}finally{rt(!1)}},gn=async()=>{rt(!0),st(``),lt(!1);try{let e=await F(`controller.illumination.override`,{value:Qe});Ze(e),$e(e.applied_pwm),st(x(`Manual value applied and verified. The enclosure-lighting policy remains the owner.`,`مقدار دستی اعمال و تأیید شد. سیاست روشنایی محفظه همچنان مالک است.`))}catch(e){st(e instanceof Error?e.message:String(e)),lt(!0)}finally{rt(!1)}},_n=(e,t)=>{Pe(n=>t?n|e:n&~e)},vn=e=>{bt(``),St(!1),ut(e)},yn=e=>{bt(``),St(!1),pt(de(e))},bn=async e=>{if(e.preventDefault(),!ln)bt(x(`Correct the highlighted scrolling fields before saving.`,`پیش از ذخیره، فیلدهای پیمایش مشخص‌شده را اصلاح کنید.`)),St(!0);else if(un){vt(!0),bt(``),St(!1);try{let e=await F(`controller.ui.config.set`,{segment_scroll:cn}),t=se(e.segment_scroll.pages.join(` `)).pages,n={...e.segment_scroll,pages:t,door_open_text:Xe(e.segment_scroll.door_open_text),door_closed_text:Xe(e.segment_scroll.door_closed_text)};ut(n),ht(n),pt(t.join(` `)),bt(x(`Saved and applied by the file-watched HOST service.`,`ذخیره شد و سرویس میزبان آن را اعمال کرد.`))}catch(e){bt(e instanceof Error?e.message:String(e)),St(!0)}finally{vt(!1)}}},xn=async e=>{if(e.preventDefault(),dn&&fn){At(!0),Mt(``);try{let e=await F(`controller.ui.config.set`,{status_interval_ms:Ct,measurement_freshness_ms:Tt});wt(e.status_interval_ms),Et(e.measurement_freshness_ms),Ot({refresh:e.status_interval_ms,freshness:e.measurement_freshness_ms}),ee?.(e.status_interval_ms,e.measurement_freshness_ms),Mt(x(`Applied.`,`اعمال شد.`))}catch(e){Mt(e instanceof Error?e.message:String(e))}finally{At(!1)}}},Sn=async e=>{e.preventDefault(),oe(!0),I(``);try{if(!Ut.valid){I(C(Ut.error));return}let e=await d(Ut.normalized);k(e),I(`Saved`)}catch(e){I(e instanceof Error?e.message:String(e))}finally{oe(!1)}};(0,q.useEffect)(()=>{let e=!0;return F(`controller.integrations.local.get`).then(t=>{if(!e)return;let n={local_device:{...t.local_device,base_url:P(t.local_device.base_url??``)},data_hub:{...t.data_hub,base_url:P(t.data_hub.base_url??``)},lifecycle_safety:t.lifecycle_safety??{session_lock:`stop-motion`,suspend:`stop-motion`,refresh_on_resume:!0},buzzer_mirror:t.buzzer_mirror??{enabled:!1,native_enabled:!1,web_audio_enabled:!0,backend:`auto`,executable:``,driver_directory:``},buzzer_runtime:t.buzzer_runtime};Vt(t.buzzer_runtime),X(n),Pt(n),Z(!0),Q(``)}).catch(t=>{e&&Q(t instanceof Error?t.message:String(t))}).finally(()=>{e&&It(!1)}),()=>{e=!1}},[]);let Cn=async()=>{if(!en)Q(x(`Correct the highlighted field before saving.`,`پیش از ذخیره، فیلد مشخص‌شده را اصلاح کنید.`));else{It(!0),Q(``);try{let e={local_device:{...Y.local_device,base_url:Qt.normalized},data_hub:{...Y.data_hub,base_url:$t.normalized},lifecycle_safety:Y.lifecycle_safety,buzzer_mirror:Y.buzzer_mirror},t=await F(`controller.integrations.local.set`,e),n={local_device:{...t.local_device,base_url:P(t.local_device.base_url??``)},data_hub:{...t.data_hub,base_url:P(t.data_hub.base_url??``)},lifecycle_safety:t.lifecycle_safety,buzzer_mirror:t.buzzer_mirror,buzzer_runtime:t.buzzer_runtime};Vt(t.buzzer_runtime),X(n),Pt(n),Q(`Saved`)}catch(e){Q(e instanceof Error?e.message:String(e))}finally{It(!1)}}},wn=async e=>{e.preventDefault(),await Cn()},Tn=i(s.theme),En=i(s.locale===`fa`?`persian`:`english`),Dn=i(s.direction===`auto`?`auto`:s.direction===`ltr`?`leftToRight`:`rightToLeft`),On=g.boardState===`ready`&&t.connected&&t.have_status;return g.authenticationRequired?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:x(`Host recovery`,`بازیابی میزبان`),title:i(`settings`),detail:i(`authenticationDashboardDetail`)}),(0,J.jsx)(`section`,{className:`settings-grid`,children:(0,J.jsx)(z,{icon:T,iconTone:`amber`,title:i(`security`),eyebrow:x(`Authentication required`,`احراز هویت لازم است`),className:`settings-card`,children:(0,J.jsx)(Be,{label:i(`authToken`),type:`password`,value:re,autoComplete:`off`,spellCheck:!1,onInput:e=>E(D(e.currentTarget.value)),onChange:e=>E(D(e.currentTarget.value)),hint:rn?x(`${Gt.length} normalized characters · not applied`,`${Gt.length} نویسهٔ نرمال‌شده · اعمال نشده`):x(`Enter this host’s access token.`,`توکن دسترسی این میزبان را وارد کنید.`),action:(0,J.jsx)(N,{tone:`primary`,icon:T,disabled:!rn,onClick:()=>{u(Gt),E(Gt)},children:i(`apply`)})})})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(je,{eyebrow:On?x(`Host and controller settings`,`تنظیمات میزبان و کنترلر`):x(`Host settings`,`تنظیمات میزبان`),title:i(`settings`),detail:`${x(`Theme`,`پوسته`)}: ${Tn} · ${x(`Language`,`زبان`)}: ${En} · ${x(`Direction`,`جهت`)}: ${Dn}${On?x(` · controller available`,` · کنترلر در دسترس`):``}`}),(0,J.jsxs)(`section`,{className:`settings-grid`,children:[(0,J.jsx)(z,{icon:ot,iconTone:`violet`,title:x(`PC host identity`,`هویت میزبان رایانه`),eyebrow:ie?x(`Saving`,`در حال ذخیره`):nn?x(`Unsaved change`,`تغییر ذخیره‌نشده`):x(`Saved`,`ذخیره‌شده`),className:`settings-card`,children:(0,J.jsx)(`form`,{onSubmit:e=>void Sn(e),children:(0,J.jsx)(Be,{label:x(`Application title`,`عنوان برنامه`),value:O,minLength:1,maxLength:64,onInput:e=>{I(``),k(j(e.currentTarget.value))},onChange:e=>{I(``),k(j(e.currentTarget.value))},error:nn&&!Ut.valid?C(Ut.error):void 0,success:M===`Saved`?x(`Saved as “${e}”.`,`با عنوان «${e}» ذخیره شد.`):void 0,hint:nn?x(`${Ut.normalized.length}/64 characters · ready to save`,`${Ut.normalized.length} از ۶۴ نویسه · آمادهٔ ذخیره`):x(`Current title: ${e}`,`عنوان فعلی: ${e}`),action:(0,J.jsx)(N,{type:`submit`,tone:`primary`,icon:T,busy:ie,disabled:!nn||!Ut.valid,children:x(`Save`,`ذخیره`)})})})}),(0,J.jsx)(z,{icon:dt,iconTone:`green`,title:x(`Connected applications`,`برنامه‌های متصل`),eyebrow:`${y.length} ${x(`live`,`فعال`)}`,className:`settings-card settings-card--wide`,children:y.length===0?(0,J.jsx)(ve,{icon:dt,title:x(`No connected applications`,`برنامهٔ متصلی وجود ندارد`),detail:x(`Live clients appear here after they advertise their controls.`,`کلاینت‌های زنده پس از معرفی کنترل‌های خود اینجا ظاهر می‌شوند.`)}):(0,J.jsx)(`div`,{className:`connected-apps-list`,children:y.map(e=>{let t=(e.values?.app_actions??``).split(`,`).map(e=>e.trim()).filter(Boolean),n=e.surface.toLowerCase()===`pealayer`,r=e.self?.pid??e.self?.vars?.pid,i=e.self?.vars?.web_ui??e.self?.vars?.websocket??e.self?.vars?.rpc;return(0,J.jsxs)(`article`,{className:`connected-app`,children:[(0,J.jsxs)(`div`,{className:`connected-app__identity`,children:[(0,J.jsx)(W,{tone:e.state===`active`?`good`:`neutral`,children:e.state||x(`present`,`حاضر`)}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:e.surface}),(0,J.jsx)(`span`,{children:e.id})]})]}),(0,J.jsxs)(`div`,{className:`connected-app__facts`,children:[e.page&&(0,J.jsxs)(`span`,{children:[x(`Page`,`صفحه`),`: `,e.page]}),e.self?.kind&&(0,J.jsxs)(`span`,{children:[e.self.kind,r?` · PID ${r}`:``]}),(0,J.jsxs)(`span`,{children:[t.length,` `,x(`controls`,`کنترل`)]}),i&&(0,J.jsx)(`span`,{title:i,children:i})]}),(0,J.jsxs)(`div`,{className:`connected-app__capabilities`,"aria-label":x(`Advertised controls`,`کنترل‌های معرفی‌شده`),children:[t.slice(0,5).map(e=>(0,J.jsx)(`code`,{children:e.replace(/^pealayer\./,``)},e)),t.length>5&&(0,J.jsxs)(`span`,{title:t.slice(5).join(`, `),children:[`+`,t.length-5]})]}),n&&(0,J.jsxs)(`div`,{className:`connected-app__actions`,children:[t.includes(`pealayer.play`)&&(0,J.jsx)(N,{icon:_t,onClick:()=>void F(`controller.app.action`,{kind:`pealayer.play`,target:e.id}),children:x(`Play`,`پخش`)}),t.includes(`pealayer.pause`)&&(0,J.jsx)(N,{icon:et,onClick:()=>void F(`controller.app.action`,{kind:`pealayer.pause`,target:e.id}),children:x(`Pause`,`مکث`)})]})]},e.id)})})}),(0,J.jsx)(Wt,{locale:r}),p&&(0,J.jsx)(z,{icon:A,iconTone:`green`,title:x(`Live measurements`,`اندازه‌گیری‌های زنده`),eyebrow:kt?x(`Synchronizing`,`در حال همگام‌سازی`):`${pe(r,1e3/Ct,Ct===200?0:1)} ${x(`Hz`,`هرتز`)}`,className:`settings-card settings-card--wide`,children:(0,J.jsxs)(`form`,{className:`segment-scroll-settings`,onSubmit:e=>void xn(e),children:[(0,J.jsx)(U,{label:x(`Refresh/update interval`,`فاصلهٔ تازه‌سازی/به‌روزرسانی`),value:Ct,min:50,max:6e4,step:50,unit:`ms`,onChange:e=>{Mt(``),wt(e)}}),(0,J.jsx)(U,{label:x(`Freshness window`,`پنجرهٔ تازگی`),value:Tt,min:Ct+100,max:12e4,step:100,unit:`ms`,onChange:e=>{Mt(``),Et(e)}}),(0,J.jsxs)(`div`,{className:`local-integrations-form__footer`,children:[(0,J.jsx)(`span`,{className:`segment-scroll-settings__notice${dn?``:` is-error`}`,role:`status`,"aria-live":`polite`,children:dn?jt:x(`Freshness must be ${Ct+100}..120000 ms.`,`تازگی باید بین ${Ct+100} تا ۱۲۰۰۰۰ میلی‌ثانیه باشد.`)}),(0,J.jsx)(N,{type:`submit`,tone:`primary`,icon:T,busy:kt,disabled:!fn||!dn,children:x(`Apply live timing`,`اعمال زمان‌بندی زنده`)})]})]})}),(0,J.jsx)(z,{icon:n,iconTone:`accent`,title:x(`HOST display scrolling`,`پیمایش نمایشگر میزبان`),eyebrow:K.enabled?x(`Enabled`,`فعال`):x(`Disabled`,`غیرفعال`),className:`settings-card settings-card--wide`,children:(0,J.jsxs)(`form`,{className:`segment-scroll-settings`,onSubmit:e=>void bn(e),children:[(0,J.jsx)(H,{checked:K.enabled,onChange:e=>vn(t=>({...t,enabled:e})),label:x(`Supply scrolling text to selected pages`,`ارسال متن پیمایشی به صفحات انتخابی`),detail:x(`The board keeps OPEN/CLSD as its offline fallback; warnings, edits, programming, and other critical overlays remain higher priority.`,`برد در حالت آفلاین OPEN/CLSD را نمایش می‌دهد و هشدارها و لایه‌های مهم اولویت بالاتری دارند.`)}),(0,J.jsxs)(`div`,{className:`advanced-fields advanced-fields--split`,children:[(0,J.jsx)(Be,{label:x(`Selected page keys or IDs`,`کلید یا شناسه صفحات`),value:ft,dir:`ltr`,spellCheck:!1,onInput:e=>yn(e.currentTarget.value),onChange:e=>yn(e.currentTarget.value),error:an.valid?void 0:C(an.error),success:un&&an.valid?x(`${an.pages.length} canonical target${an.pages.length===1?``:`s`}.`,`${an.pages.length} مقصد معتبر.`):void 0,hint:x(`Spaces and commas normalize automatically; maximum 14 unique ASCII IDs.`,`فاصله و ویرگول خودکار یکسان می‌شوند؛ حداکثر ۱۴ شناسهٔ یکتای ASCII.`)}),(0,J.jsx)(Be,{label:x(`Door open text`,`متن درب باز`),value:K.door_open_text,dir:`ltr`,maxLength:40,spellCheck:!1,onInput:e=>vn(t=>({...t,door_open_text:Xe(e.currentTarget.value)})),onChange:e=>vn(t=>({...t,door_open_text:Xe(e.currentTarget.value)})),error:on.valid?void 0:C(on.error),success:un&&on.valid?x(`${on.byteLength} + ${K.gap_cells} / 40 bytes.`,`${on.byteLength} + ${K.gap_cells} از ۴۰ بایت.`):void 0,hint:x(`${on.availableBytes} ASCII bytes available before the repeat gap.`,`${on.availableBytes} بایت ASCII پیش از فاصلهٔ تکرار در دسترس است.`)}),(0,J.jsx)(Be,{label:x(`Door closed text`,`متن درب بسته`),value:K.door_closed_text,dir:`ltr`,maxLength:40,spellCheck:!1,onInput:e=>vn(t=>({...t,door_closed_text:Xe(e.currentTarget.value)})),onChange:e=>vn(t=>({...t,door_closed_text:Xe(e.currentTarget.value)})),error:sn.valid?void 0:C(sn.error),success:un&&sn.valid?x(`${sn.byteLength} + ${K.gap_cells} / 40 bytes.`,`${sn.byteLength} + ${K.gap_cells} از ۴۰ بایت.`):void 0,hint:x(`${sn.availableBytes} ASCII bytes available before the repeat gap.`,`${sn.availableBytes} بایت ASCII پیش از فاصلهٔ تکرار در دسترس است.`)})]}),(0,J.jsx)(U,{label:x(`Scroll window dwell`,`مکث هر پنجره پیمایش`),value:K.speed_ms,min:60,max:5e3,step:20,unit:`ms`,onChange:e=>vn(t=>({...t,speed_ms:e}))}),(0,J.jsx)(U,{label:x(`Gap between repeats`,`فاصله بین تکرارها`),value:K.gap_cells,min:0,max:12,unit:x(` cells`,` خانه`),onChange:e=>vn(t=>({...t,gap_cells:e}))}),(0,J.jsxs)(`div`,{className:`local-integrations-form__footer`,children:[(0,J.jsx)(`span`,{className:`segment-scroll-settings__notice${xt||!ln?` is-error`:``}`,role:`status`,"aria-live":`polite`,children:mn}),(0,J.jsx)(N,{type:`submit`,tone:`primary`,icon:T,busy:gt,disabled:!un||!ln,children:x(`Save scrolling`,`ذخیره پیمایش`)})]})]})}),(0,J.jsxs)(z,{icon:Fe,iconTone:`green`,title:x(`Buzzer routing`,`مسیر بیزر`),eyebrow:(Xt??x(`Pending`,`در انتظار`)).toUpperCase(),className:`settings-card settings-card--wide`,children:[(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:x(`Playback path`,`مسیر پخش`)}),(0,J.jsx)(V,{value:Xt??$?.requested_path??Y.buzzer_mirror.path??`none`,label:x(`Buzzer playback path`,`مسیر پخش بیزر`),options:[{value:`board`,label:x(`Board`,`برد`)},{value:`host`,label:x(`PC`,`رایانه`)},{value:`both`,label:x(`Both`,`هر دو`)},{value:`none`,label:x(`None`,`هیچ‌کدام`)}],onChange:e=>void Zt(e)})]}),(0,J.jsxs)(`div`,{className:`settings-inline-status`,children:[Kt?(0,J.jsx)(W,{tone:qt?`neutral`:`good`,children:x(`Board ${qt?`silent`:`active`}`,`برد ${qt?`بی‌صدا`:`فعال`}`)}):(0,J.jsx)(W,{tone:`neutral`,children:x(`Board state unavailable`,`وضعیت برد در دسترس نیست`)}),(0,J.jsx)(W,{tone:Jt?`neutral`:`good`,children:x(`PC ${Jt?`silent`:`active`}`,`رایانه ${Jt?`بی‌صدا`:`فعال`}`)}),L&&(0,J.jsx)(W,{tone:`warn`,children:x(`Applying…`,`در حال اعمال…`)}),$?.requested_path&&$.requested_path!==`unknown`&&$.requested_path!==$.effective_path&&(0,J.jsx)(W,{tone:$.board_apply_state===`error`?`warn`:`neutral`,children:`${$.requested_path} · ${$.board_apply_state}`}),$&&(0,J.jsx)(W,{tone:$.backend_error?`warn`:`neutral`,children:`${$.backend_requested} → ${$.backend_effective}`})]}),(0,J.jsx)(H,{checked:Y.buzzer_mirror.enabled,onChange:e=>{Q(``),X(t=>{let n=t.buzzer_mirror.path,r=n===`host`||n===`none`;return{...t,buzzer_mirror:{...t.buzzer_mirror,enabled:e,path:n&&ze(r,!e)}}})},label:x(`Mirror board beeps on this host`,`بازپخش بوق‌های برد روی این میزبان`)}),Y.buzzer_mirror.enabled&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(H,{checked:Y.buzzer_mirror.native_enabled,onChange:e=>{Q(``),X(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,native_enabled:e,backend:e&&t.buzzer_mirror.backend===`off`?`auto`:t.buzzer_mirror.backend}}))},label:x(`PC speaker renderer`,`پخش‌کنندهٔ بلندگوی رایانه`)}),(0,J.jsx)(H,{checked:Y.buzzer_mirror.web_audio_enabled,onChange:e=>{Q(``),X(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,web_audio_enabled:e}}))},label:x(`Web browser renderer`,`پخش‌کنندهٔ مرورگر وب`)}),(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:x(`PC speaker backend`,`پشتیبان بلندگوی رایانه`)}),(0,J.jsx)(V,{value:Y.buzzer_mirror.backend,label:x(`PC speaker backend`,`پشتیبان بلندگوی رایانه`),options:[{value:`auto`,label:x(`Auto`,`خودکار`)},{value:`native`,label:x(`Native`,`بومی`)},{value:`external`,label:x(`Command`,`فرمان`)},{value:`off`,label:x(`Off`,`خاموش`)}],onChange:e=>{Q(``),X(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,backend:e,native_enabled:e!==`off`&&t.buzzer_mirror.native_enabled}}))}})]}),Y.buzzer_mirror.backend!==`native`&&Y.buzzer_mirror.backend!==`off`&&(0,J.jsx)(Be,{label:x(`Beep executable (optional)`,`فایل اجرایی بوق (اختیاری)`),dir:`ltr`,spellCheck:!1,value:Y.buzzer_mirror.executable??``,placeholder:x(`Blank uses beep from PATH`,`خالی: استفاده از beep در PATH`),onChange:e=>{Q(``),X(t=>({...t,buzzer_mirror:{...t.buzzer_mirror,executable:e.currentTarget.value}}))}})]}),(0,J.jsx)(`div`,{className:`inline-actions`,children:(0,J.jsx)(N,{icon:T,tone:`primary`,busy:Ft,disabled:!tn,onClick:()=>void Cn(),children:x(`Save PC buzzer settings`,`ذخیرهٔ تنظیمات بیزر رایانه`)})}),me&&(0,J.jsx)(`p`,{className:`settings-action-feedback`,role:`status`,children:me})]}),(0,J.jsxs)(z,{icon:Ye,iconTone:`accent`,title:i(`appearance`),eyebrow:`${Tn} · ${Dn}`,className:`settings-card settings-card--wide`,menu:[{label:x(`Follow system appearance`,`پیروی از ظاهر سیستم`),icon:Ye,onSelect:()=>c({...s,theme:`system`,direction:`auto`})},{label:s.reduceMotion?x(`Enable interface motion`,`فعال‌سازی حرکت رابط`):x(`Reduce interface motion`,`کاهش حرکت رابط`),icon:ce,onSelect:()=>Ht(`reduceMotion`,!s.reduceMotion)}],children:[(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:i(`theme`)}),(0,J.jsx)(V,{value:s.theme,label:i(`theme`),options:[{value:`system`,label:i(`system`),icon:Ye},{value:`dark`,label:i(`dark`),icon:be},{value:`light`,label:i(`light`),icon:De}],onChange:e=>Ht(`theme`,e)})]}),(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:i(`language`)}),(0,J.jsx)(V,{value:s.locale,label:i(`language`),options:[{value:`en`,label:i(`english`),icon:Ke},{value:`fa`,label:i(`persian`),icon:Ke}],onChange:e=>Ht(`locale`,e)})]}),(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:i(`direction`)}),(0,J.jsx)(V,{value:s.direction,label:i(`direction`),options:[{value:`auto`,label:i(`auto`)},{value:`ltr`,label:i(`leftToRight`)},{value:`rtl`,label:i(`rightToLeft`)}],onChange:e=>Ht(`direction`,e)})]}),(0,J.jsx)(H,{checked:s.reduceMotion,onChange:e=>Ht(`reduceMotion`,e),label:i(`reduceMotion`),detail:s.reduceMotion?x(`Nonessential motion is off.`,`حرکت‌های غیرضروری خاموش‌اند.`):x(`Smooth interface transitions are on.`,`گذارهای نرم رابط فعال‌اند.`)}),(0,J.jsx)(H,{checked:s.compactNumbers,onChange:e=>Ht(`compactNumbers`,e),label:i(`compactNumbers`),detail:s.compactNumbers?x(`Large values use compact notation.`,`مقادیر بزرگ به‌صورت فشرده نمایش داده می‌شوند.`):x(`Large values use full notation.`,`مقادیر بزرگ به‌صورت کامل نمایش داده می‌شوند.`)}),(0,J.jsx)(H,{checked:_,onChange:te,label:x(`Sync this tab with other instances`,`همگام‌سازی این زبانه با نمونه‌های دیگر`),detail:v.state===`pending`?(0,J.jsx)(`span`,{role:`status`,children:x(`Synchronizing…`,`در حال همگام‌سازی…`)}):v.state===`error`?(0,J.jsx)(`span`,{role:`alert`,children:v.detail}):void 0}),(0,J.jsx)(H,{checked:!s.audioMuted,onChange:e=>Ht(`audioMuted`,!e),label:(0,J.jsxs)(`span`,{className:`setting-icon-label`,children:[(0,J.jsx)(Fe,{size:16}),x(`Interaction audio`,`صدای تعامل`)]}),detail:s.audioMuted?x(`Audio cues are off.`,`نشانه‌های صوتی خاموش‌اند.`):x(`Audio cues are at ${Math.round(s.audioVolume*100)}%.`,`بلندی نشانه‌های صوتی ${Math.round(s.audioVolume*100)}٪ است.`)}),!s.audioMuted&&(0,J.jsx)(U,{label:x(`Cue volume`,`بلندی نشانه‌ها`),value:Math.round(s.audioVolume*100),min:0,max:100,unit:`%`,onChange:e=>Ht(`audioVolume`,e/100)}),!s.audioMuted&&(0,J.jsx)(N,{icon:Fe,onClick:()=>window.dispatchEvent(new Event(`pccontroller:test-feedback`)),children:x(`Test notification`,`آزمایش اعلان`)})]}),(0,J.jsx)(Bt,{locale:s.locale}),p?.auth_required===!0&&(0,J.jsx)(z,{icon:T,iconTone:`green`,title:i(`security`),eyebrow:rn?x(`Token change pending`,`تغییر توکن در انتظار اعمال`):l?x(`Session authenticated`,`نشست معتبر است`):x(`No session token`,`بدون توکن نشست`),className:`settings-card`,children:(0,J.jsx)(Be,{label:i(`authToken`),type:`password`,value:re,autoComplete:`off`,spellCheck:!1,onInput:e=>E(D(e.currentTarget.value)),onChange:e=>E(D(e.currentTarget.value)),hint:rn?x(`${Gt.length} normalized characters · not applied`,`${Gt.length} نویسهٔ نرمال‌شده · اعمال نشده`):l?x(`Applied to this browser tab.`,`در این زبانهٔ مرورگر اعمال شده است.`):x(`Enter a token if the host requires one.`,`اگر میزبان توکن می‌خواهد، آن را وارد کنید.`),action:(0,J.jsx)(N,{tone:`primary`,icon:T,disabled:!rn,onClick:()=>{u(Gt),E(Gt)},children:i(`apply`)})})}),On&&S.settings&&(0,J.jsx)(z,{icon:fe,iconTone:`amber`,title:x(`Enclosure illumination`,`روشنایی محفظه`),eyebrow:G.available?G.at_target?x(`Applied · at target`,`اعمال‌شده · در مقدار هدف`):x(`Transitioning to target`,`در حال گذار به مقدار هدف`):x(`Waiting for live PWM state`,`در انتظار وضعیت زندهٔ PWM`),className:`settings-card settings-card--wide illumination-settings-card`,children:t.have_settings?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`illumination-state-grid`,"aria-label":x(`Live enclosure illumination state`,`وضعیت زندهٔ روشنایی محفظه`),children:[(0,J.jsx)(R,{label:x(`Policy`,`سیاست`),value:[x(`Off`,`خاموش`),x(`Auto`,`خودکار`),x(`On`,`روشن`)][G.mode]??String(G.mode)}),(0,J.jsx)(R,{label:x(`Door input`,`ورودی درب`),value:G.door_open?x(`Open`,`باز`):x(`Closed`,`بسته`),tone:G.door_open?`warn`:`good`}),(0,J.jsx)(R,{label:x(`Selected target`,`مقدار هدف انتخاب‌شده`),value:`${G.target_brightness}/255 · ${G.target_pwm}/4095`,mono:!0}),(0,J.jsx)(R,{label:x(`Applied MOSFET channel 12`,`مقدار اعمال‌شدهٔ کانال ۱۲ ماسفت`),value:G.available?`${G.applied_brightness}/255 · ${G.applied_pwm}/4095`:x(`Unavailable`,`در دسترس نیست`),tone:G.available?G.at_target?`good`:`warn`:void 0,mono:!0}),(0,J.jsx)(R,{label:x(`EEPROM durability`,`ماندگاری EEPROM`),value:G.persisted?x(`Verified`,`تأییدشده`):x(`Not confirmed`,`تأییدنشده`),tone:G.persisted?`good`:`warn`})]}),(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:x(`Operating mode`,`حالت عملکرد`)}),(0,J.jsx)(V,{value:Ve,label:x(`Enclosure illumination mode`,`حالت روشنایی محفظه`),options:[{value:`0`,label:x(`Off`,`خاموش`)},{value:`1`,label:x(`Auto · door`,`خودکار · درب`)},{value:`2`,label:x(`On`,`روشن`)}],onChange:e=>{st(``),He(e)}})]}),(0,J.jsx)(U,{label:x(`Door-open / On brightness`,`روشنایی درب باز / حالت روشن`),value:Ue,min:0,max:255,onChange:e=>{st(``),We(e)}}),(0,J.jsx)(U,{label:x(`Door-closed / Off brightness`,`روشنایی درب بسته / حالت خاموش`),value:Ge,min:0,max:255,onChange:e=>{st(``),qe(e)}}),(0,J.jsx)(U,{label:x(`Manual raw override · MOSFET channel 12`,`کنترل دستی خام · کانال ۱۲ ماسفت`),value:Qe,min:0,max:4095,onChange:e=>{st(``),$e(e)}}),(0,J.jsxs)(`div`,{className:`illumination-settings-card__footer`,children:[(0,J.jsx)(`p`,{className:ct?`settings-action-feedback text-bad`:`settings-action-feedback`,role:ct?`alert`:`status`,children:at||x(`Manual adjustment is temporary: policy ownership and EEPROM settings remain unchanged and may reapply the selected target.`,`تنظیم دستی موقت است: مالکیت سیاست و تنظیمات EEPROM تغییر نمی‌کند و ممکن است مقدار هدف دوباره اعمال شود.`)}),(0,J.jsxs)(`div`,{className:`inline-actions`,children:[(0,J.jsx)(N,{icon:m,busy:tt,disabled:!S.pwm||!G.available,onClick:()=>void gn(),children:x(`Apply manual override`,`اعمال کنترل دستی`)}),(0,J.jsx)(N,{tone:`primary`,icon:fe,busy:tt,disabled:!S.pwm||!G.available,onClick:()=>void hn(),children:x(`Apply policy`,`اعمال سیاست`)})]})]})]}):(0,J.jsx)(ve,{icon:fe,title:x(`Reading illumination policy`,`در حال خواندن سیاست روشنایی`),detail:x(`The controls appear only after the board returns authoritative EEPROM settings.`,`کنترل‌ها پس از دریافت تنظیمات معتبر EEPROM از برد نمایش داده می‌شوند.`)})}),On&&S.settings&&(0,J.jsx)(z,{icon:nt,iconTone:`amber`,title:x(`Board EEPROM settings`,`تنظیمات EEPROM برد`),eyebrow:t.have_settings?x(`Live draft · explicit write`,`پیش‌نویس زنده · نوشتن صریح`):f===`loading`?x(`Reading board settings`,`در حال خواندن تنظیمات برد`):x(`Settings unavailable`,`تنظیمات در دسترس نیست`),className:`settings-card`,children:t.have_settings?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`table`,{className:`settings-value-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:x(`Setting`,`تنظیم`)}),(0,J.jsx)(`th`,{children:x(`EEPROM report`,`گزارش EEPROM`)}),(0,J.jsx)(`th`,{children:x(`Live draft`,`پیش‌نویس زنده`)})]})}),(0,J.jsxs)(`tbody`,{children:[(0,J.jsxs)(`tr`,{children:[(0,J.jsxs)(`td`,{children:[`TM1637 · `,x(`door open`,`درب باز`)]}),(0,J.jsx)(`td`,{children:t.settings.display_brightness}),(0,J.jsx)(`td`,{children:B})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsxs)(`td`,{children:[`TM1637 · `,x(`door closed`,`درب بسته`)]}),(0,J.jsx)(`td`,{children:t.settings.display_closed_brightness}),(0,J.jsx)(`td`,{children:Se})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Motion-menu exit hold`,`مکث خروج از منوی حرکت`)}),(0,J.jsxs)(`td`,{children:[t.settings.motion_exit_hold_seconds,` s`]}),(0,J.jsxs)(`td`,{children:[we,` s`]})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Status brightness`,`روشنایی وضعیت`)}),(0,J.jsx)(`td`,{children:t.settings.status_brightness}),(0,J.jsx)(`td`,{children:Ee})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Telemetry period`,`دورهٔ تله‌متری`)}),(0,J.jsxs)(`td`,{children:[t.settings.stream_period_ms,` ms`]}),(0,J.jsxs)(`td`,{children:[Ae,` ms`]})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Remember motion command`,`به‌خاطرسپاری فرمان حرکت`)}),(0,J.jsx)(`td`,{children:t.settings.output_persistence&1?x(`Yes`,`بله`):x(`No`,`خیر`)}),(0,J.jsx)(`td`,{children:Ne&1?x(`Yes`,`بله`):x(`No`,`خیر`)})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Remember user relays`,`به‌خاطرسپاری رله‌های کاربر`)}),(0,J.jsx)(`td`,{children:t.settings.output_persistence&2?x(`Yes`,`بله`):x(`No`,`خیر`)}),(0,J.jsx)(`td`,{children:Ne&2?x(`Yes`,`بله`):x(`No`,`خیر`)})]}),S.pwm&&(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Remember user PWM`,`به‌خاطرسپاری PWM کاربر`)}),(0,J.jsx)(`td`,{children:t.settings.output_persistence&4?x(`Yes`,`بله`):x(`No`,`خیر`)}),(0,J.jsx)(`td`,{children:Ne&4?x(`Yes`,`بله`):x(`No`,`خیر`)})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Stop retains direction`,`حفظ جهت هنگام توقف`)}),(0,J.jsx)(`td`,{children:t.settings.output_persistence&8?x(`Yes`,`بله`):x(`No`,`خیر`)}),(0,J.jsx)(`td`,{children:Ne&8?x(`Yes`,`بله`):x(`No`,`خیر`)})]}),(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:x(`Stored relay restore mask`,`ماسک ذخیره‌شدهٔ بازیابی رله`)}),(0,J.jsxs)(`td`,{colSpan:2,children:[`0x`,Ie.toString(16).toUpperCase().padStart(2,`0`)]})]})]})]}),(0,J.jsx)(U,{label:x(`TM1637 · door-open brightness`,`TM1637 · روشنایی درب باز`),value:B,min:0,max:7,onChange:xe}),(0,J.jsx)(U,{label:x(`TM1637 · door-closed brightness`,`TM1637 · روشنایی درب بسته`),value:Se,min:0,max:7,onChange:Ce}),(0,J.jsx)(U,{label:x(`Motion-menu exit hold`,`مکث خروج از منوی حرکت`),value:we,min:1,max:31,unit:`s`,onChange:Te}),(0,J.jsx)(U,{label:x(`Status brightness`,`روشنایی وضعیت`),value:Ee,min:0,max:255,onChange:ke}),(0,J.jsx)(U,{label:x(`Telemetry period`,`دورهٔ تله‌متری`),value:Ae,min:50,max:5e3,step:50,unit:`ms`,onChange:Me}),(0,J.jsx)(H,{checked:!!(Ne&1),onChange:e=>_n(1,e),label:x(`Remember motion command`,`به‌خاطرسپاری فرمان حرکت`),detail:x(`Disabled by default; motion starts released after a reboot.`,`به‌طور پیش‌فرض غیرفعال است؛ حرکت پس از راه‌اندازی دوباره در حالت آزاد آغاز می‌شود.`)}),(0,J.jsx)(H,{checked:!!(Ne&2),onChange:e=>_n(2,e),label:x(`Remember user relays R5–R8`,`به‌خاطرسپاری رله‌های کاربر R5 تا R8`),detail:x(`Restore the user-output relay mask kept in EEPROM.`,`ماسک رله‌های خروجی کاربر ذخیره‌شده در EEPROM بازیابی می‌شود.`)}),S.pwm&&(0,J.jsx)(H,{checked:!!(Ne&4),onChange:e=>_n(4,e),label:x(`Remember user PWM values`,`به‌خاطرسپاری مقادیر PWM کاربر`),detail:x(`Restore MOSFET/user PWM channel values after boot.`,`مقادیر کانال‌های MOSFET/PWM کاربر پس از راه‌اندازی بازیابی می‌شوند.`)}),(0,J.jsx)(H,{checked:!!(Ne&8),onChange:e=>_n(8,e),label:x(`Stop keeps direction relay`,`توقف، رلهٔ جهت را حفظ کند`),detail:Ne&8?x(`Motion stop releases only the output/enable relay.`,`توقف حرکت فقط رلهٔ خروجی/فعال‌سازی را آزاد می‌کند.`):x(`Motion stop releases both direction and output relays.`,`توقف حرکت هر دو رلهٔ جهت و خروجی را آزاد می‌کند.`)}),(0,J.jsx)(N,{tone:`primary`,icon:b,onClick:()=>void o(Je(t.settings,B,Se,Ee,Ae,we,Ne,Ie)),children:x(`Write board settings`,`نوشتن تنظیمات برد`)})]}):(0,J.jsx)(ve,{icon:b,title:f===`loading`?x(`Reading board settings`,`در حال خواندن تنظیمات برد`):x(`Board settings are unavailable`,`تنظیمات برد در دسترس نیست`),detail:f===`loading`?x(`Waiting for the controller to return its live EEPROM settings.`,`در انتظار دریافت تنظیمات زندهٔ EEPROM از برد.`):x(`No EEPROM values are shown until the controller returns an authoritative settings report.`,`تا دریافت گزارش معتبر تنظیمات از برد، هیچ مقدار EEPROM نمایش داده نمی‌شود.`)})}),On&&(0,J.jsxs)(z,{icon:a,iconTone:`green`,title:i(`connection`),eyebrow:x(`Controller board connected`,`برد کنترلر متصل است`),className:`settings-card`,children:[(0,J.jsxs)(`div`,{className:`data-list`,children:[(0,J.jsx)(R,{label:x(`State`,`وضعیت`),value:t.connection_state,tone:`good`}),(0,J.jsx)(R,{label:x(`Port`,`درگاه`),value:t.port.name||x(`automatic`,`خودکار`),mono:!0}),(0,J.jsx)(R,{label:`VID:PID`,value:`${t.port.vid||`—`}:${t.port.pid||`—`}`,mono:!0}),(0,J.jsx)(R,{label:x(`Serial`,`سریال`),value:t.port.serial_number||`—`,mono:!0}),(0,J.jsx)(R,{label:x(`Baud`,`نرخ باد`),value:`115200 8N1`,mono:!0})]}),t.port_process&&(0,J.jsxs)(`div`,{className:`data-list`,children:[(0,J.jsx)(R,{label:x(`Port process`,`پردازش درگاه`),value:t.port_process.state,tone:t.port_process.state===`free`?`good`:t.port_process.state===`owned`?`warn`:void 0}),(0,J.jsx)(R,{label:x(`Owner`,`مالک`),value:t.port_process.pid?`${t.port_process.name||`unknown`} · PID ${t.port_process.pid}`:t.port_process.error||`—`,mono:!0}),t.port_process.executable&&(0,J.jsx)(R,{label:x(`Executable`,`فایل اجرا`),value:t.port_process.executable,mono:!0}),(0,J.jsx)(R,{label:x(`Takeover`,`واگذاری`),value:t.port_process.takeover_ready?x(`armed when free`,`با آزادشدن آماده`):x(`not armed`,`مسلح نیست`)})]}),(0,J.jsx)(`div`,{className:`inline-actions`,children:(0,J.jsx)(N,{icon:ne,onClick:()=>void o(`close`),children:x(`Pause controller`,`توقف کنترلر`)})})]}),(0,J.jsx)(z,{icon:w,iconTone:`violet`,title:x(`Host services and lifecycle`,`سرویس‌ها و چرخهٔ میزبان`),eyebrow:Ft?x(`Synchronizing`,`در حال همگام‌سازی`):tn?x(`Unsaved changes`,`تغییرات ذخیره‌نشده`):Rt===`Saved`?x(`Saved`,`ذخیره‌شده`):x(`Up to date`,`به‌روز`),className:`settings-card settings-card--wide`,children:(0,J.jsxs)(`form`,{className:`local-integrations-form`,onSubmit:e=>void wn(e),children:[(0,J.jsxs)(`section`,{className:`integration-config-panel`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(w,{size:19}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:x(`Local device`,`وسیلهٔ محلی`)}),(0,J.jsx)(`small`,{children:Y.local_device.enabled?x(`Enabled`,`فعال`):x(`Disabled`,`غیرفعال`)})]})]}),(0,J.jsx)(H,{checked:Y.local_device.enabled,onChange:e=>{Q(``),X(t=>({...t,local_device:{...t.local_device,enabled:e}}))},label:x(`Enable local device`,`فعال‌سازی وسیلهٔ محلی`),detail:Y.local_device.enabled?x(`The host will mediate local commands and events.`,`میزبان میانجی فرمان‌ها و رویدادهای محلی خواهد بود.`):x(`No local-device requests will be sent.`,`هیچ درخواستی برای وسیلهٔ محلی ارسال نمی‌شود.`)}),Y.local_device.enabled&&(0,J.jsx)(Be,{label:x(`Device root URL`,`نشانی ریشهٔ وسیله`),type:`url`,dir:`ltr`,spellCheck:!1,placeholder:`http://controller-device.local`,value:Y.local_device.base_url??``,onInput:e=>{Q(``),X(t=>({...t,local_device:{...t.local_device,base_url:P(e.currentTarget.value)}}))},onChange:e=>{Q(``),X(t=>({...t,local_device:{...t.local_device,base_url:P(e.currentTarget.value)}}))},onBlur:()=>Qt.valid&&X(e=>({...e,local_device:{...e.local_device,base_url:Qt.normalized}})),error:Qt.valid?void 0:C(Qt.error),success:Qt.valid&&Qt.normalized?x(`Validated: ${Qt.normalized}`,`تأیید شد: ${Qt.normalized}`):void 0})]}),(0,J.jsxs)(`section`,{className:`integration-config-panel`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(it,{size:19}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:x(`Data hub`,`مرکز داده`)}),(0,J.jsx)(`small`,{children:Y.data_hub.enabled?x(`Enabled`,`فعال`):x(`Disabled`,`غیرفعال`)})]})]}),(0,J.jsx)(H,{checked:Y.data_hub.enabled,onChange:e=>{Q(``),X(t=>({...t,data_hub:{...t.data_hub,enabled:e}}))},label:x(`Enable data hub`,`فعال‌سازی مرکز داده`),detail:Y.data_hub.enabled?x(`Authenticated data operations are routed through the host.`,`عملیات معتبر داده از طریق میزبان مسیریابی می‌شود.`):x(`No data-hub requests will be sent.`,`هیچ درخواستی برای مرکز داده ارسال نمی‌شود.`)}),Y.data_hub.enabled&&(0,J.jsx)(Be,{label:x(`Data-hub root URL`,`نشانی ریشهٔ مرکز داده`),type:`url`,dir:`ltr`,spellCheck:!1,placeholder:`http://127.0.0.1:8080`,value:Y.data_hub.base_url??``,onInput:e=>{Q(``),X(t=>({...t,data_hub:{...t.data_hub,base_url:P(e.currentTarget.value)}}))},onChange:e=>{Q(``),X(t=>({...t,data_hub:{...t.data_hub,base_url:P(e.currentTarget.value)}}))},onBlur:()=>$t.valid&&X(e=>({...e,data_hub:{...e.data_hub,base_url:$t.normalized}})),error:$t.valid?void 0:C($t.error),success:$t.valid&&$t.normalized?x(`Validated: ${$t.normalized}`,`تأیید شد: ${$t.normalized}`):void 0})]}),(0,J.jsxs)(`section`,{className:`integration-config-panel integration-config-panel--wide`,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(T,{size:19}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{children:x(`Session and power safety`,`ایمنی نشست و توان`)}),(0,J.jsx)(`small`,{children:Y.lifecycle_safety.refresh_on_resume?x(`Automatic reconciliation`,`همگام‌سازی خودکار`):x(`Manual reconciliation`,`همگام‌سازی دستی`)})]})]}),(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:x(`When Windows locks`,`هنگام قفل‌شدن ویندوز`)}),(0,J.jsx)(V,{value:Y.lifecycle_safety.session_lock,label:x(`Session-lock safety action`,`عمل ایمنی هنگام قفل نشست`),options:pn,onChange:e=>{Q(``),X(t=>({...t,lifecycle_safety:{...t.lifecycle_safety,session_lock:e}}))}})]}),(0,J.jsxs)(`div`,{className:`setting-group`,children:[(0,J.jsx)(`label`,{children:x(`Before system suspend`,`پیش از تعلیق سیستم`)}),(0,J.jsx)(V,{value:Y.lifecycle_safety.suspend,label:x(`Suspend safety action`,`عمل ایمنی هنگام تعلیق`),options:pn,onChange:e=>{Q(``),X(t=>({...t,lifecycle_safety:{...t.lifecycle_safety,suspend:e}}))}})]}),(0,J.jsx)(H,{checked:Y.lifecycle_safety.refresh_on_resume,onChange:e=>{Q(``),X(t=>({...t,lifecycle_safety:{...t.lifecycle_safety,refresh_on_resume:e}}))},label:x(`Reconcile after unlock, resume, and network changes`,`همگام‌سازی پس از بازشدن قفل، بازگشت و تغییر شبکه`),detail:Y.lifecycle_safety.refresh_on_resume?x(t.connected?`The host will refresh live telemetry without forcing a reconnect.`:`The host will re-arm discovery while respecting a manually paused connection.`,t.connected?`میزبان بدون اتصال مجدد اجباری، تله‌متری زنده را تازه می‌کند.`:`میزبان با حفظ توقف دستی اتصال، کشف دستگاه را دوباره فعال می‌کند.`):x(`The current connection state will be preserved until you act.`,`وضعیت فعلی اتصال تا اقدام شما حفظ می‌شود.`)})]}),(0,J.jsxs)(`footer`,{className:`local-integrations-form__footer`,children:[(0,J.jsx)(`span`,{className:Rt===`Saved`?`text-good`:Rt?`text-warn`:``,children:Rt===`Saved`?x(`Host service and lifecycle settings saved.`,`تنظیمات سرویس و چرخهٔ میزبان ذخیره شد.`):Rt||(tn?x(`Review and save the current changes.`,`تغییرات فعلی را بازبینی و ذخیره کنید.`):x(`No pending changes.`,`تغییری در انتظار ذخیره نیست.`))}),(0,J.jsx)(N,{type:`submit`,tone:`primary`,icon:T,busy:Ft,disabled:!tn||!en,children:x(`Save host settings`,`ذخیرهٔ تنظیمات میزبان`)})]})]})})]})]})}export{tn as ControlsView,en as DashboardView,sn as EventsView,on as LocalDeviceView,cn as SettingsView}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/chunk-B9ewCnSE.js b/Tools/Controller/internal/webui/dist/assets/chunk-GmnEjCp4.js similarity index 75% rename from Tools/Controller/internal/webui/dist/assets/chunk-B9ewCnSE.js rename to Tools/Controller/internal/webui/dist/assets/chunk-GmnEjCp4.js index 0f67bf62..852e59e4 100644 --- a/Tools/Controller/internal/webui/dist/assets/chunk-B9ewCnSE.js +++ b/Tools/Controller/internal/webui/dist/assets/chunk-GmnEjCp4.js @@ -1 +1 @@ -import{Dt as e}from"./app-BpGu_3eg.js";var t={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};t.node;var n=e(t);export{n as t}; \ No newline at end of file +import{Pt as e}from"./app-BxYXetji.js";var t={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};t.node;var n=e(t);export{n as t}; \ No newline at end of file diff --git a/Tools/Controller/internal/webui/dist/assets/index-B-6g0IjL.css b/Tools/Controller/internal/webui/dist/assets/index-B-6g0IjL.css new file mode 100644 index 00000000..0eef9cab --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/index-B-6g0IjL.css @@ -0,0 +1 @@ +@font-face{font-family:Vazirmatn;src:url(/fonts/vazirmatn-BeciDpKm.woff2)format("woff2");font-style:normal;font-weight:100 900;font-display:swap}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;font-synthesis:none;text-rendering:optimizelegibility;--font-ui:"Segoe UI Variable", "Segoe UI", system-ui, sans-serif;--font-fa:"Vazirmatn", Tahoma, "Segoe UI", sans-serif;--font-mono:"Cascadia Code", "SFMono-Regular", Consolas, monospace;--bg:#121116;--bg-deep:#0b0a0e;--bg-elevated:#1d1b22db;--surface:#1f1d25bd;--surface-solid:#1d1b22;--surface-muted:#33303b99;--surface-hover:#413c4cb8;--glass:#1b1920ad;--glass-strong:#121116eb;--line:#e2dceb1f;--line-strong:#e2dceb3b;--text:#f5f2f7;--text-soft:#cbc5d0;--text-muted:#938c9b;--accent:#a78bfa;--accent-bright:#d8ccff;--accent-soft:#a78bfa24;--green:#73c69a;--green-soft:#73c69a1f;--amber:#e7ae63;--amber-soft:#e7ae6324;--red:#ed7889;--red-soft:#ed788924;--violet:#c29bea;--violet-soft:#c29bea24;--sidebar-width:272px;--sidebar-compact:84px;--topbar-height:68px;--radius-xs:7px;--radius-sm:10px;--radius:14px;--radius-lg:20px;--shadow:0 24px 70px #00000057;--shadow-tight:0 10px 34px #0000003d;--ease-out:cubic-bezier(.22, 1, .36, 1);font-family:Segoe UI Variable,Segoe UI,system-ui,sans-serif}:root[lang^=fa]{font-family:var(--font-fa)}:root[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#f5f3f6;--bg-deep:#ebe8ed;--bg-elevated:#ffffffe0;--surface:#ffffffc2;--surface-solid:#fff;--surface-muted:#e8e4ecd1;--surface-hover:#ded8e5d6;--glass:#ffffffb8;--glass-strong:#fbfafcf0;--line:#2d28331f;--line-strong:#2d28333b;--text:#242126;--text-soft:#5e5864;--text-muted:#7b7382;--accent:#6845bf;--accent-bright:#5334a3;--accent-soft:#6845bf1a;--green:#307752;--green-soft:#3077521a;--amber:#8a5917;--amber-soft:#8a59171c;--red:#b33f53;--red-soft:#b33f531a;--violet:#7e52b3;--violet-soft:#7e52b31a;--shadow:0 24px 70px #19161d24;--shadow-tight:0 10px 34px #19161d1a}*{box-sizing:border-box}html,body,#root{min-height:100%;margin:0}html{background:var(--bg-deep);scrollbar-color:var(--line-strong) transparent}body{background:linear-gradient(135deg, var(--bg-deep), var(--bg) 55%, var(--bg-deep));min-width:320px;color:var(--text);overflow:hidden}button,input,select,textarea{font:inherit}*,:before,:after{-webkit-tap-highlight-color:transparent}button,[role=button],[role=switch],input[type=checkbox]{touch-action:manipulation}button{color:inherit}input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not(:disabled),textarea:not(:disabled),[contenteditable=true]{cursor:text}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:3px}a{color:inherit;text-decoration:none}p{color:var(--text-soft)}::selection{background:var(--accent);color:var(--bg-deep)}.mono,[dir=ltr]{unicode-bidi:isolate}.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}.spin{animation:.8s linear infinite spin}@keyframes spin{to{rotate:360deg}}.app-shell{grid-template:var(--topbar-height) minmax(0, 1fr) / var(--sidebar-width) minmax(0, 1fr);height:100dvh;transition:grid-template-columns .42s var(--ease-out);display:grid}.app-shell.is-sidebar-compact{grid-template-columns:var(--sidebar-compact) minmax(0, 1fr)}.app-action-progress{z-index:120;pointer-events:none;background:color-mix(in srgb, var(--blue) 16%, transparent);height:3px;position:fixed;inset:0 0 auto;overflow:hidden}.app-action-progress>span{background:var(--blue);width:100%;height:100%;box-shadow:0 0 12px color-mix(in srgb, var(--blue) 72%, transparent);transition:width .2s var(--ease-out);display:block}.app-action-progress--warning>span{background:var(--amber)}.app-action-progress--error>span{background:var(--red)}.app-action-progress--indeterminate>span{width:36%;animation:app-action-progress-indeterminate 1.2s var(--ease-out) infinite}@keyframes app-action-progress-indeterminate{0%{transform:translate(-110%)}to{transform:translate(290%)}}.sidebar{z-index:30;border-inline-end:1px solid var(--line);background:linear-gradient(180deg, var(--glass-strong), var(--glass));-webkit-backdrop-filter:blur(26px)saturate(1.15);backdrop-filter:blur(26px)saturate(1.15);flex-direction:column;grid-row:1/3;min-width:0;display:flex;position:relative;overflow:hidden;box-shadow:16px 0 50px #0005081f}.sidebar:after{content:"";inset-inline-end:-1px;background:linear-gradient(var(--accent), transparent);opacity:.7;width:1px;height:19%;position:absolute;top:0}.brand{min-height:var(--topbar-height);border-bottom:1px solid var(--line);grid-template-columns:42px minmax(0,1fr) 34px;align-items:center;gap:11px;padding:0 15px 0 18px;display:grid}[dir=rtl] .brand{padding:0 18px 0 15px}.brand__mark{width:40px;height:40px;color:var(--accent-bright);background:linear-gradient(150deg, var(--accent-soft), transparent 72%);border:1px solid color-mix(in srgb, var(--accent) 32%, transparent);font:800 12px/1 var(--font-mono);letter-spacing:-.04em;border-radius:12px;place-items:center;display:grid;position:relative}.brand__mark i{display:none}.brand__mark img{object-fit:contain;width:100%;height:100%;display:block}.brand__copy{white-space:nowrap;flex-direction:column;min-width:0;display:flex;overflow:hidden}.brand__copy strong{letter-spacing:-.02em;font-size:15px}.brand__copy span{color:var(--text-muted);font:600 8px/1.2 var(--font-mono);letter-spacing:.18em;margin-top:2px}.sidebar-toggle,.mobile-menu,.topbar-icon,.modal__close{border-radius:var(--radius-sm);width:34px;height:34px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;place-items:center;transition:color .25s,border-color .25s,background .25s;display:grid}.sidebar-toggle:hover,.mobile-menu:hover,.topbar-icon:hover,.modal__close:hover{color:var(--text);border-color:var(--line);background:var(--surface-muted)}.sidebar__status{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(105deg, var(--surface-muted), transparent);color:inherit;font:inherit;text-align:start;cursor:pointer;grid-template-columns:3px minmax(0,1fr) 22px;align-items:center;gap:12px;margin:18px 15px 10px;padding:13px 12px;display:grid;position:relative;overflow:hidden}.sidebar__status:hover{border-color:var(--line-strong);background:linear-gradient(105deg, var(--surface-hover), transparent)}.sidebar__status:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.sidebar__status-menu{z-index:140;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 96%, transparent);min-width:194px;box-shadow:var(--shadow);-webkit-backdrop-filter:blur(18px)saturate(1.12);backdrop-filter:blur(18px)saturate(1.12);border-radius:11px;gap:3px;padding:6px;display:grid;position:fixed}.sidebar__status-menu>button{min-height:32px;color:var(--text-soft);font:600 11px var(--font-ui);text-align:start;cursor:pointer;background:0 0;border:0;border-radius:7px;padding-inline:9px}.sidebar__status-menu>button:hover,.sidebar__status-menu>button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.sidebar__status>div{white-space:nowrap;flex-direction:column;min-width:0;display:flex}.sidebar__status strong{font-size:12px}.sidebar__status small{color:var(--text-muted);font:500 10px var(--font-mono);text-overflow:ellipsis;overflow:hidden}.sidebar__status>svg{color:var(--text-muted)}.status-rail{border-radius:2px;width:3px;height:28px}.status-rail--good{background:var(--green);box-shadow:0 0 14px color-mix(in srgb, var(--green) 60%, transparent)}.status-rail--bad{background:var(--red);box-shadow:0 0 14px color-mix(in srgb, var(--red) 45%, transparent)}.status-rail--warn{background:var(--amber);box-shadow:0 0 14px color-mix(in srgb, var(--amber) 52%, transparent)}.status-rail--info{background:var(--accent);box-shadow:0 0 14px color-mix(in srgb, var(--accent) 52%, transparent)}.status-rail--neutral{background:var(--text-muted);box-shadow:none}.sidebar__nav{flex:1;min-height:0;padding:4px 12px 20px;overflow:auto}.nav-group{flex-direction:column;gap:3px;margin-top:18px;display:flex}.nav-group__label{color:var(--text-muted);font:650 9px var(--font-mono);letter-spacing:.15em;white-space:nowrap;padding:0 10px 7px}.nav-button{border-radius:var(--radius-sm);text-align:start;width:100%;min-height:43px;color:var(--text-soft);cursor:pointer;background:0 0;border:1px solid #0000;grid-template-columns:30px minmax(0,1fr) auto 16px;align-items:center;gap:9px;padding:6px 9px;transition:color .24s,background .24s,border-color .24s;display:grid;position:relative;overflow:hidden}.nav-button:before{content:"";background:var(--accent);width:2px;box-shadow:0 0 16px var(--accent);transition:scale .32s var(--ease-out);position:absolute;inset-block:8px;inset-inline-start:0;scale:1 0}.nav-button:hover{color:var(--text);background:var(--surface-muted)}.nav-button.is-active{color:var(--text);background:linear-gradient(90deg, var(--accent-soft), transparent);border-color:color-mix(in srgb, var(--accent) 14%, transparent)}.nav-button.is-active:before{scale:1}.nav-button__icon{width:30px;height:30px;color:var(--text-muted);place-items:center;transition:color .3s,filter .3s;display:grid}.nav-button.is-active .nav-button__icon{color:var(--accent)}.nav-button__label{white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:13px;font-weight:560;overflow:hidden}.nav-button__badge,.count-chip{background:var(--accent-soft);min-width:20px;color:var(--accent);font:600 9px var(--font-mono);text-align:center;border-radius:6px;padding:2px 6px}.nav-button__chevron{opacity:0;color:var(--text-muted);transition:opacity .2s,translate .25s}.nav-button:hover .nav-button__chevron,.nav-button.is-active .nav-button__chevron{opacity:.7}[dir=rtl] .nav-button__chevron{rotate:180deg}.sidebar__footer{border-top:1px solid var(--line);color:var(--green);white-space:nowrap;align-items:center;gap:10px;margin:auto 15px 16px;padding:12px;display:flex;overflow:hidden}.sidebar__footer div{flex-direction:column;display:flex}.sidebar__footer strong{color:var(--text-soft);font-size:11px}.sidebar__footer span{color:var(--text-muted);font:9px var(--font-mono)}.is-sidebar-compact .brand{grid-template-columns:44px;justify-content:center;justify-items:center;gap:6px;padding:10px 0}.is-sidebar-compact .brand__copy,.is-sidebar-compact .sidebar__status>div{display:none}.is-sidebar-compact .sidebar__footer div{opacity:0;pointer-events:none;width:0}.is-sidebar-compact .sidebar-toggle{width:44px;height:44px;color:var(--text);border-color:var(--line);background:var(--surface-muted)}.sidebar-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.is-sidebar-compact .sidebar__status{grid-template-columns:3px 18px;justify-content:center;gap:7px;width:44px;height:44px;margin-inline:auto;padding:0}.is-sidebar-compact .sidebar__nav{padding-inline:12px}.is-sidebar-compact .nav-button{flex:none;grid-template-columns:1fr;gap:0;block-size:44px;min-block-size:44px;inline-size:44px;margin-inline:auto;padding:6px}.is-sidebar-compact .nav-group__label,.is-sidebar-compact .nav-button__label,.is-sidebar-compact .nav-button__badge,.is-sidebar-compact .nav-button__chevron{display:none}.is-sidebar-compact .nav-button__icon{margin:auto}.is-sidebar-compact .sidebar__footer{justify-content:center;margin-inline:12px}.topbar{border-bottom:1px solid var(--line);background:color-mix(in srgb, var(--glass-strong) 78%, transparent);-webkit-backdrop-filter:blur(22px)saturate(1.18);backdrop-filter:blur(22px)saturate(1.18);z-index:20;grid-column:2;align-items:center;gap:18px;padding:0 24px;display:flex}.mobile-menu{display:none}.breadcrumbs{align-items:center;gap:10px;min-width:180px;font-size:12px;display:flex}.breadcrumbs span{color:var(--accent);font:700 11px var(--font-mono)}.breadcrumbs i{color:var(--text-muted);font-style:normal}.breadcrumbs strong{color:var(--text-soft);font-weight:580}.command-trigger{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);width:min(460px,38vw);height:36px;color:var(--text-muted);cursor:pointer;align-items:center;gap:10px;margin:auto;padding:0 10px 0 12px;transition:border-color .25s,background .25s,box-shadow .25s;display:flex}[dir=rtl] .command-trigger{padding:0 12px 0 10px}.command-trigger:hover{border-color:var(--line-strong);background:var(--surface-hover);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent)}.command-trigger>span:not(.key-combo){text-align:start;flex:1;font-size:12px}.command-trigger>.key-combo{flex:none;margin-inline-start:5px}kbd{border:1px solid var(--line-strong);border-bottom-color:color-mix(in srgb, var(--line-strong) 150%, var(--text-muted));background:var(--surface-solid);color:var(--text-muted);font:600 9px var(--font-mono);border-radius:5px;padding:3px 6px}.key-combo,.key-combo__group,.key-combo__key{align-items:center;display:inline-flex}.key-combo{flex-wrap:wrap;gap:5px}.key-combo__group,.key-combo__key{gap:5px}.key-combo__separator,.key-combo__alternative{color:var(--text-muted);font:600 9px var(--font-mono)}.topbar__actions{align-items:center;gap:6px;display:flex}.topbar-icon{position:relative}.topbar-icon i{inset-inline-end:6px;background:var(--red);width:5px;height:5px;box-shadow:0 0 8px var(--red);border-radius:1px;position:absolute;top:5px}.app-main{scroll-behavior:smooth;grid-column:2;min-height:0;overflow:auto}.app-shell.is-bootstrap-pending{visibility:hidden}.page{width:min(1540px,100%);min-height:100%;margin:0 auto;padding:28px clamp(18px,2.4vw,38px) 52px}.page[data-route-focus-target]:focus,.page [data-route-focus-target]:focus{outline:none}.section-title{justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:24px;display:flex}.section-title h1{letter-spacing:-.045em;margin:5px 0 0;font-size:clamp(25px,2.7vw,38px);font-weight:660;line-height:1.05}.section-title p{max-width:760px;color:var(--text-muted);margin:9px 0 0;font-size:13px;line-height:1.65}.section-title__action,.header-actions{align-items:center;gap:9px;display:flex}.eyebrow{color:var(--accent);font:650 9px/1.3 var(--font-ui);letter-spacing:.06em}.button{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface-muted);min-height:38px;color:var(--text);cursor:pointer;isolation:isolate;justify-content:center;align-items:center;gap:8px;padding:8px 14px;font-size:12px;font-weight:620;line-height:1;transition:border-color .28s,color .28s,box-shadow .28s,background .28s;display:inline-flex;position:relative;overflow:hidden}.button:after{content:"";z-index:2;inset-inline:11px;transform-origin:50%;opacity:.68;height:1px;transition:scale .42s var(--ease-out), opacity .25s;background:linear-gradient(90deg,#0000,currentColor,#0000);position:absolute;bottom:0;scale:0 1}.button__wash{z-index:-1;transition:translate .65s var(--ease-out);background:linear-gradient(110deg,#0000 10%,#ffffff1f 45%,#0000 70%);position:absolute;inset:0;translate:-140%}.button:hover:not(:disabled) .button__wash,.button:focus-visible .button__wash{translate:140%}.button:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 50%, var(--line));box-shadow:inset 0 0 22px color-mix(in srgb, var(--accent-soft) 60%, transparent), 0 8px 25px #00000021}.button:hover:not(:disabled):after,.button:focus-visible:after{scale:1}.button>svg:not(.spin){transition:rotate .42s var(--ease-out), filter .28s}.button:hover:not(:disabled)>svg:not(.spin),.button:focus-visible>svg:not(.spin){filter:drop-shadow(0 0 7px);rotate:-6deg}.button:active:not(:disabled){filter:brightness(.92)}.button:disabled{opacity:.38;cursor:not-allowed}.button--compact{min-height:32px;padding:6px 10px;font-size:11px}.button--primary{background:linear-gradient(120deg, color-mix(in srgb, var(--accent) 24%, var(--surface-solid)), color-mix(in srgb, var(--accent) 11%, var(--surface-solid)));border-color:color-mix(in srgb, var(--accent) 50%, transparent);color:var(--accent-bright);box-shadow:inset 0 1px #ffffff12}.button--danger{background:linear-gradient(120deg, color-mix(in srgb, var(--red) 25%, var(--surface-solid)), color-mix(in srgb, var(--red) 10%, var(--surface-solid)));border-color:color-mix(in srgb, var(--red) 50%, transparent);color:color-mix(in srgb, var(--red) 72%, var(--text))}.button--danger:hover:not(:disabled){border-color:var(--red);box-shadow:inset 0 0 24px var(--red-soft), 0 8px 25px #4b08112e}.button--success{background:linear-gradient(120deg, color-mix(in srgb, var(--green) 25%, var(--surface-solid)), color-mix(in srgb, var(--green) 10%, var(--surface-solid)));border-color:color-mix(in srgb, var(--green) 50%, transparent);color:color-mix(in srgb, var(--green) 76%, var(--text))}.button--ghost{color:var(--text-soft);background:0 0;border-color:#0000}.hold-action.is-holding{border-color:color-mix(in srgb, var(--amber) 72%, var(--line));color:color-mix(in srgb, var(--amber) 78%, var(--text));background:linear-gradient(120deg, color-mix(in srgb, var(--amber) 23%, var(--surface-solid)), color-mix(in srgb, var(--accent) 8%, var(--surface-solid)));box-shadow:inset 0 0 24px color-mix(in srgb, var(--amber-soft) 75%, transparent), 0 0 0 1px color-mix(in srgb, var(--amber) 22%, transparent);animation:1.15s ease-in-out infinite hold-action-breathe}.hold-action.is-holding:after{opacity:1;scale:1}.hold-action.is-holding .button__wash{translate:140%}@keyframes hold-action-breathe{50%{box-shadow:inset 0 0 32px color-mix(in srgb, var(--amber-soft) 88%, transparent), 0 0 16px color-mix(in srgb, var(--amber) 18%, transparent)}}.status-badge{border:1px solid var(--line);background:var(--surface-muted);min-height:26px;font:650 9px/1 var(--font-mono);letter-spacing:.07em;white-space:nowrap;border-radius:7px;align-items:center;gap:7px;padding:5px 9px;display:inline-flex;position:relative}.status-badge__line{background:currentColor;width:9px;height:2px;box-shadow:0 0 8px}.status-badge--good{color:var(--green);background:var(--green-soft);border-color:color-mix(in srgb, var(--green) 25%, transparent)}.status-badge--warn{color:var(--amber);background:var(--amber-soft);border-color:color-mix(in srgb, var(--amber) 25%, transparent)}.status-badge--bad{color:var(--red);background:var(--red-soft);border-color:color-mix(in srgb, var(--red) 25%, transparent)}.status-badge--info{color:var(--accent);background:var(--accent-soft);border-color:color-mix(in srgb, var(--accent) 25%, transparent)}.status-badge--neutral{color:var(--text-muted)}.status-badge--pulse .status-badge__line{transform-origin:50%;animation:1.2s ease-in-out infinite status-pulse}.transport-reconnect{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;border-radius:7px;padding:0}.transport-reconnect:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.transport-reconnect:hover .status-badge{border-color:currentColor}@keyframes status-pulse{50%{opacity:.35;scale:1.7 1}}.card{border:1px solid var(--line);border-radius:var(--radius-lg);background:linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-muted) 45%, transparent));-webkit-backdrop-filter:blur(18px)saturate(1.08);backdrop-filter:blur(18px)saturate(1.08);box-shadow:var(--shadow-tight);padding:20px;position:relative;overflow:hidden}.card:before{content:"";top:-1px;background:linear-gradient(90deg, var(--violet), var(--amber), var(--red));opacity:.78;border-radius:0 0 2px 2px;width:54px;height:2px;position:absolute;inset-inline-start:20px}.card__header{justify-content:space-between;align-items:center;gap:18px;margin-bottom:17px;display:flex}.card__heading{flex:1;align-items:center;gap:11px;min-width:0;display:flex}.card__heading-copy{min-width:0}.card__icon{--card-icon-color:var(--accent);border:1px solid color-mix(in srgb, var(--card-icon-color) 28%, var(--line));background:color-mix(in srgb, var(--card-icon-color) 11%, var(--surface-muted));width:36px;height:36px;color:var(--card-icon-color);border-radius:11px;flex:0 0 36px;place-items:center;display:grid;box-shadow:inset 0 1px #ffffff09}.card__icon--green{--card-icon-color:var(--green)}.card__icon--amber{--card-icon-color:var(--amber)}.card__icon--violet{--card-icon-color:var(--violet)}.card__icon--red{--card-icon-color:var(--red)}.card__header h2{letter-spacing:-.02em;margin:5px 0 0;font-size:15px;font-weight:640}.card__action{flex:none;align-items:center;gap:8px;margin-inline-start:auto;display:flex}.card__menu-trigger{border:1px solid var(--line);background:var(--surface-muted);width:34px;height:34px;color:var(--text-soft);border-radius:10px;flex:0 0 34px;justify-content:center;align-items:center;transition:border-color .16s,background-color .16s,color .16s;display:inline-flex}.card__menu-trigger:hover,.card__menu-trigger:focus-visible,.card__menu-trigger[aria-expanded=true]{border-color:color-mix(in srgb, var(--violet) 44%, var(--line));background:var(--violet-soft);color:var(--violet);outline:none}.card-menu{z-index:130;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 94%, transparent);-webkit-backdrop-filter:blur(22px)saturate(1.15);backdrop-filter:blur(22px)saturate(1.15);transform-origin:100% 0;border-radius:13px;min-width:190px;padding:6px;position:fixed;box-shadow:0 18px 50px #00000047}.card-menu button{width:100%;min-height:38px;color:var(--text-soft);text-align:start;font:inherit;background:0 0;border:0;border-radius:9px;align-items:center;gap:10px;padding:0 11px;font-size:10px;transition:background-color .14s,color .14s;display:flex}.card-menu button:hover,.card-menu button:focus-visible{background:var(--violet-soft);color:var(--text);outline:none}.card-menu button[data-tone=danger]{color:var(--red)}.card-menu button[data-tone=danger]:hover,.card-menu button[data-tone=danger]:focus-visible{background:var(--red-soft)}.card-menu button:disabled{opacity:.42;cursor:not-allowed}.card-copy{margin:14px 0 0;font-size:12px;line-height:1.7}.hero-panel{border:1px solid var(--line);border-radius:var(--radius-lg);background:linear-gradient(105deg, var(--glass-strong) 0 62%, color-mix(in srgb, var(--violet-soft) 46%, var(--glass)) 82%, color-mix(in srgb, var(--amber-soft) 34%, var(--glass)) 100%);min-height:168px;box-shadow:var(--shadow);grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;margin-bottom:17px;padding:27px 30px;transition:border-color .28s,background .32s;display:grid;position:relative;overflow:hidden}.hero-panel:before,.hero-panel:after{content:"";pointer-events:none;position:absolute}.hero-panel:before{background:var(--red);opacity:.72;width:4px;transition:background .28s,opacity .28s;inset-block:0;inset-inline-start:0}.hero-panel.is-online:before{border-color:var(--green);background:var(--green)}.hero-panel:after{display:none}.hero-panel__identity{z-index:2;max-width:820px;min-height:78px;position:relative}.hero-panel__identity h2{letter-spacing:-.035em;max-width:760px;margin:9px 0 8px;font-size:clamp(20px,2.3vw,32px);font-weight:620;line-height:1.25}.hero-panel__identity h2 a{transition:color .22s}.hero-panel__identity h2 a:hover,.hero-panel__identity h2 a:focus-visible{color:var(--accent-bright)}.hero-panel__identity p{color:var(--text-muted);margin:0;font-size:12px}.hero-panel__readout{z-index:2;border-inline-start:1px solid var(--line-strong);grid-template-columns:auto auto;gap:7px 16px;min-width:178px;padding:14px 16px;display:grid;position:relative}.hero-panel__readout.is-empty{opacity:.45}.hero-panel__readout span{color:var(--text-muted);font:9px var(--font-mono);letter-spacing:.1em}.hero-panel__readout strong{color:var(--text-soft);font:600 11px var(--font-mono);text-align:end}.metric-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:17px;display:grid}.metric{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(145deg, var(--surface), transparent);min-height:170px;padding:16px 16px 0;position:relative;overflow:hidden}.metric:after{content:"";top:0;opacity:.55;background:linear-gradient(90deg,#0000,currentColor);width:50%;height:1px;position:absolute;inset-inline-end:0}.metric--accent{color:var(--accent)}.metric--green{color:var(--green)}.metric--amber{color:var(--amber)}.metric--violet{color:var(--violet)}.metric__top{align-items:center;gap:10px;display:flex}.metric__icon{background:color-mix(in srgb, currentColor 9%, transparent);opacity:.88;border:1px solid;border-radius:8px;place-items:center;width:32px;height:32px;display:grid}.metric__label{color:var(--text-muted);font-size:11px;font-weight:550}.metric__value{align-items:baseline;gap:6px;margin-top:13px;display:flex}.metric__value strong{color:var(--text);font:630 clamp(23px, 2.2vw, 31px) var(--font-mono);letter-spacing:-.06em}.metric__value span{color:currentColor;font:550 10px var(--font-mono)}.metric__detail{top:18px;color:var(--text-muted);font:500 9px var(--font-mono);position:absolute;inset-inline-end:15px}.sparkline{inset-inline:0;width:100%;height:70px;position:absolute;bottom:-2px;overflow:visible}.sparkline__grid{fill:none;stroke:var(--line);stroke-width:.5px;vector-effect:non-scaling-stroke}.sparkline__line{stroke-width:1.7px;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 3px)}.telemetry-chart-card{margin-bottom:14px}.telemetry-chart{min-width:0}.telemetry-chart__toolbar{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;display:flex}.telemetry-chart__toolbar .segmented{max-width:100%;overflow-x:auto}.telemetry-chart__canvas{border-block:1px solid var(--line);background:linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 44%, transparent), transparent);width:100%;height:320px;margin-top:12px}.telemetry-chart__summary{min-height:34px;color:var(--text-muted);flex-wrap:wrap;align-items:center;gap:10px;padding-top:10px;font-size:10px;display:flex}.telemetry-chart__summary span:last-child{font-family:var(--font-mono);margin-inline-start:auto}.telemetry-chart__empty{text-align:center;place-content:center;gap:6px;min-height:260px;display:grid}.telemetry-chart__empty strong{color:var(--text-soft);font-size:13px}.telemetry-chart__empty span{color:var(--text-muted);font-size:10px}.recharts-default-legend{flex-wrap:wrap;justify-content:center;gap:8px 14px;display:flex}.recharts-legend-item{margin:0!important}.recharts-tooltip-wrapper{outline:0}.sr-only{clip:rect(0, 0, 0, 0)!important;white-space:nowrap!important;border:0!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;position:absolute!important;overflow:hidden!important}.dashboard-layout-grid{grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);align-items:start;gap:14px;display:grid}.dashboard-layout-grid>[data-layout-card-id=telemetry]{grid-column:1/-1}.dashboard-layout-grid>[data-layout-card-id=outputs]{grid-row:span 2}.output-matrix{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;display:grid}.output-cell{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);cursor:pointer;flex-direction:column;align-items:flex-start;gap:7px;min-height:84px;padding:13px;transition:border-color .3s,background .3s,box-shadow .3s;display:flex;position:relative;overflow:hidden}.output-cell:before{content:"";background:linear-gradient(120deg, transparent, var(--green-soft), transparent);transition:translate .58s var(--ease-out);position:absolute;inset:0;translate:-110%}.output-cell:hover:not(:disabled):before{translate:110%}.output-cell:disabled{opacity:.4;cursor:not-allowed}.output-cell span{color:var(--text-muted);font:600 10px var(--font-mono)}.output-cell strong{font-size:12px}.output-cell i{inset-inline:13px;background:var(--line-strong);height:2px;position:absolute;bottom:10px}.output-cell i:after{content:"";background:var(--text-muted);width:22%;height:100%;transition:width .35s var(--ease-out), background .35s, box-shadow .35s;display:block}.output-cell.is-active{background:var(--green-soft);border-color:color-mix(in srgb, var(--green) 40%, transparent);box-shadow:inset 0 0 28px color-mix(in srgb, var(--green-soft) 50%, transparent)}.output-cell.is-active strong{color:var(--green)}.output-cell.is-active i:after{background:var(--green);width:100%;box-shadow:0 0 8px var(--green)}.safety-strip{border-top:1px solid var(--line);color:var(--green);align-items:center;gap:8px;margin-top:13px;padding-top:12px;display:flex}.safety-strip span{color:var(--text-muted);font-size:10px}.controller-estop{border:1px solid var(--line);background:var(--surface);border-radius:12px;margin:0 0 16px;padding:10px 12px}.controller-estop span{flex:1;font-size:12px}.controller-estop.is-danger{border-color:color-mix(in srgb, var(--red) 55%, var(--line));color:var(--red);background:color-mix(in srgb, var(--red) 8%, var(--surface))}.controller-estop.is-danger span{color:var(--text)}.measurement-alerts{flex-wrap:wrap;gap:8px;display:flex}.measurement-alert{border:1px solid color-mix(in srgb, var(--amber) 35%, transparent);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--amber) 8%, transparent);color:var(--amber);align-items:center;gap:7px;padding:8px 10px;font-size:10px;display:inline-flex}.hardware-alert{border:1px solid color-mix(in srgb, var(--red) 52%, transparent);border-radius:var(--radius);background:color-mix(in srgb, var(--red) 10%, var(--surface));box-shadow:inset 3px 0 0 var(--red);align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.hardware-alert.is-warning{border-color:color-mix(in srgb, var(--amber) 48%, transparent);background:color-mix(in srgb, var(--amber) 9%, var(--surface));box-shadow:inset 3px 0 0 var(--amber)}.hardware-alert__icon{color:var(--red);flex:none;place-items:center;display:grid}.hardware-alert.is-warning .hardware-alert__icon{color:var(--amber)}.hardware-alert__copy{flex-direction:column;gap:4px;min-width:0;display:flex}.hardware-alert__copy strong{color:var(--text);font-size:13px}.hardware-alert__copy p{color:var(--text-soft);margin:0;font-size:11px;line-height:1.5}.hardware-alert__copy span{color:var(--text-muted);font:500 9px var(--font-mono)}.hardware-alert__copy .hardware-alert__impact{color:var(--red);font-weight:700}.app-hardware-alert{margin-bottom:14px}.data-list{flex-direction:column;display:flex}.data-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:18px;min-height:34px;padding:8px 0;display:flex}.data-row:last-child{border-bottom:0}.data-row>span{color:var(--text-muted);font-size:10px}.data-row strong{max-width:66%;color:var(--text-soft);text-align:end;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:580;overflow:hidden}.text-good{color:var(--green)!important}.text-warn{color:var(--amber)!important}.text-bad{color:var(--red)!important}.action-grid{grid-template-columns:1fr 1fr;gap:8px;display:grid}.action-grid .button{min-height:48px}.dashboard-layout-grid>[data-layout-card-id=events]{grid-column:2}.empty-state{text-align:start;justify-content:center;align-items:center;gap:14px;min-height:130px;padding:20px;display:flex}.empty-state__icon{border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--surface-muted);width:50px;height:50px;color:var(--text-muted);place-items:center;display:grid}.empty-state strong{font-size:12px}.empty-state p{max-width:420px;color:var(--text-muted);margin:5px 0 0;font-size:10px;line-height:1.5}.controller-unavailable{text-align:center;place-content:center;justify-items:center;gap:12px;min-height:150px;padding:20px;display:grid}.controller-unavailable>strong{color:var(--text);letter-spacing:-.015em;font-size:14px;font-weight:650}.controller-unavailable__icon{border:1px solid color-mix(in srgb, var(--red) 30%, var(--line));background:color-mix(in srgb, var(--red) 8%, var(--surface-muted));width:64px;height:64px;color:var(--red);border-radius:18px;place-items:center;display:grid;box-shadow:inset 0 1px #ffffff0a,0 14px 36px #0000001f}.controller-unavailable.is-board-offline .controller-unavailable__icon{border-color:color-mix(in srgb, var(--amber) 30%, var(--line));background:color-mix(in srgb, var(--amber) 8%, var(--surface-muted));color:var(--amber)}.controller-unavailable__action{margin-top:2px}.hero-panel .controller-unavailable{text-align:start;place-content:center start;justify-items:start;min-height:105px;padding:0}.hero-panel .controller-unavailable__icon{width:58px;height:58px}.connection-state{--connection-color:var(--amber);border:1px solid color-mix(in srgb, var(--connection-color) 35%, var(--line));background:linear-gradient(135deg, color-mix(in srgb, var(--connection-color) 13%, var(--surface)), color-mix(in srgb, var(--surface-muted) 90%, transparent));border-radius:18px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;width:100%;padding:16px;display:grid;position:relative;overflow:hidden;box-shadow:inset 0 1px #ffffff0b,0 18px 48px #0000001f}.connection-state:before{content:"";background:linear-gradient(180deg, color-mix(in srgb, var(--connection-color) 72%, white), var(--connection-color));width:4px;position:absolute;inset:0 auto 0 0}[dir=rtl] .connection-state:before{inset:0 0 0 auto}.connection-state--good{--connection-color:var(--green)}.connection-state--info{--connection-color:var(--accent)}.connection-state--warn{--connection-color:var(--amber)}.connection-state--bad{--connection-color:var(--red)}.connection-state--neutral{--connection-color:var(--text-muted)}.connection-state__icon{width:54px;height:54px;color:var(--connection-color);background:color-mix(in srgb, var(--connection-color) 13%, var(--surface));border:1px solid color-mix(in srgb, var(--connection-color) 30%, var(--line));box-shadow:0 12px 30px color-mix(in srgb, var(--connection-color) 15%, transparent);border-radius:16px;place-items:center;display:grid}.connection-state.is-attempting .connection-state__icon{animation:1.15s ease-in-out infinite connection-icon-pulse}.connection-state__body{min-width:0}.connection-state__heading{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.connection-state__heading strong{color:var(--text);letter-spacing:-.015em;font-size:15px}.connection-state__attempt{border:1px solid color-mix(in srgb, var(--connection-color) 32%, var(--line));color:var(--connection-color);background:color-mix(in srgb, var(--connection-color) 8%, transparent);text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:750}.connection-state__body>p{color:var(--text-muted);overflow-wrap:anywhere;margin:5px 0 0;line-height:1.55}.connection-state__facts{color:color-mix(in srgb, var(--text) 70%, var(--text-muted));flex-wrap:wrap;align-items:center;gap:7px 14px;margin-top:9px;font-size:12px;display:flex}.connection-state__facts span{align-items:center;gap:5px;display:inline-flex}.connection-state__facts svg{color:var(--connection-color)}.connection-state__actions{gap:8px;min-width:max-content;display:grid}.hero-panel .connection-state{min-width:min(680px,78vw)}@keyframes connection-icon-pulse{0%,to{box-shadow:0 12px 30px color-mix(in srgb, var(--connection-color) 13%, transparent);transform:scale(1)}50%{box-shadow:0 14px 36px color-mix(in srgb, var(--connection-color) 28%, transparent);transform:scale(1.045)}}@media (max-width:700px){.connection-state{grid-template-columns:auto minmax(0,1fr)}.connection-state__actions{grid-column:1/-1;width:100%}.connection-state__actions .button{width:100%}.hero-panel .connection-state{min-width:0}}.connection-fuji{filter:drop-shadow(0 16px 28px #0003);width:144px;height:76px;position:relative;overflow:hidden}.connection-fuji>span{pointer-events:none;position:absolute}.connection-fuji__sun{top:5px;background:color-mix(in srgb, var(--red) 82%, white);width:22px;height:22px;box-shadow:0 0 0 7px color-mix(in srgb, var(--red) 9%, transparent);border-radius:50%;animation:2.8s ease-in-out infinite connection-sun;inset-inline-end:20px}.connection-fuji__rear{background:color-mix(in srgb, var(--text-muted) 20%, transparent);clip-path:polygon(0 100%,22% 62%,36% 74%,54% 27%,72% 75%,83% 62%,100% 100%);inset:24px 4px 0}.connection-fuji__face{background:linear-gradient(138deg, color-mix(in srgb, var(--violet) 44%, var(--surface-muted)), color-mix(in srgb, var(--text-muted) 28%, var(--surface)) 52%, var(--surface-muted) 53%);clip-path:polygon(7% 100%,50% 6%,93% 100%);animation:connection-mountain 1.15s var(--ease-out) both;inset:7px 20px 0}.connection-fuji__snow{background:linear-gradient(135deg, var(--text), color-mix(in srgb, var(--text) 60%, var(--violet)));clip-path:polygon(35% 40%,50% 6%,65% 40%,59% 35%,55% 44%,50% 34%,45% 44%,41% 35%);animation:connection-snow .9s var(--ease-out) .18s both;inset:7px 20px 0}.connection-fuji__trace{background:linear-gradient(90deg, transparent, var(--accent) 48%, var(--text) 51%, transparent);clip-path:polygon(7% 100%,49.4% 6%,50.6% 6%,93% 100%,91.8% 100%,50% 9%,8.2% 100%);opacity:.7;animation:1.8s ease-in-out infinite connection-trace;inset:7px 20px 0}@keyframes connection-sun{50%{opacity:.55;transform:scale(.88)}}@keyframes connection-mountain{0%{opacity:0;clip-path:polygon(50% 100%,50% 100%,50% 100%);filter:blur(8px)}}@keyframes connection-snow{0%{opacity:0;transform:translateY(5px)}}@keyframes connection-trace{50%{opacity:.2;filter:brightness(1.8) drop-shadow(0 0 5px var(--accent))}}.control-layout{grid-template-columns:1.1fr .9fr;align-items:start;gap:14px;display:grid}.workbench-grid{grid-template-columns:repeat(12,minmax(0,1fr));align-items:stretch;gap:14px;display:grid}.workbench-grid>.card-layout-frame{grid-column:span 4;min-width:0;height:100%}.workbench-grid>[data-layout-card-id=terminal]{grid-column:1/-1;min-height:420px}.workbench-grid .card__header{min-height:42px}.card-layout-frame{flex-direction:column;gap:7px;min-width:0;transition:opacity .18s,transform .18s;display:flex;position:relative}.card-layout-frame>.card{flex:1;width:100%;height:100%}.card-layout-frame.is-dragging{z-index:4;opacity:.68;transform:scale(.99)}.card-layout-frame__toolbar{border:1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));background:color-mix(in srgb, var(--surface-muted) 88%, transparent);min-height:38px;color:var(--text-muted);border-radius:10px;align-items:center;gap:6px;padding:5px 7px;display:flex}.card-layout-frame__toolbar strong{min-width:0;color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:10px;overflow:hidden}.card-layout-frame__toolbar button{width:28px;height:28px;color:var(--text-muted);cursor:pointer;touch-action:none;background:0 0;border:0;border-radius:7px;flex:0 0 28px;place-items:center;display:grid}.card-layout-frame__toolbar button:hover,.card-layout-frame__toolbar button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:none}.card-layout-frame__reorder{cursor:grab!important}.card-layout-frame__reorder:active{cursor:grabbing!important}.card-layout-frame.is-collapsed .card-layout-frame__toolbar>button svg{transition:transform .18s}.card-layout-frame:not(.is-collapsed) .card-layout-frame__toolbar>button[aria-expanded=true] svg{transform:rotate(180deg)}.header-actions{position:relative}.card-layout-editor{z-index:35;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 97%, transparent);width:min(430px,100vw - 36px);box-shadow:var(--shadow);-webkit-backdrop-filter:blur(20px)saturate(1.12);backdrop-filter:blur(20px)saturate(1.12);border-radius:12px;flex-wrap:wrap;justify-content:flex-end;gap:7px;padding:9px;display:flex;position:absolute;inset-block-start:calc(100% + 8px);inset-inline-end:0}.card-layout-editor__hidden{flex-wrap:wrap;flex:100%;align-items:center;gap:6px;display:flex}.card-layout-editor__hidden>span{color:var(--text-muted);margin-inline-end:auto;font-size:9px}.terminal-transport{flex-wrap:wrap;justify-content:flex-end;gap:5px;display:flex}.terminal-transcript{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(180deg, color-mix(in srgb, var(--bg-deep) 92%, transparent), var(--bg-deep));scrollbar-gutter:stable;min-height:220px;max-height:360px;padding:15px 17px;overflow:auto;box-shadow:inset 0 1px #ffffff06,inset 0 0 36px #00000029}.terminal-transcript pre{color:var(--text-soft);font:10px/1.65 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 7px}.terminal-transcript pre:first-child{color:var(--accent)}.terminal-transcript pre:nth-child(2){color:var(--text-muted)}.terminal-line[data-level=info]{color:var(--accent)}.terminal-line[data-level=warn]{color:var(--amber)}.terminal-line[data-level=error]{color:var(--red)}.terminal-line[data-level=debug]{color:var(--text-muted)}.console-record{color:var(--text-soft);font:10px/1.65 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 7px;padding-inline-start:var(--console-indent,0)}.console-record[data-level=info]{color:var(--accent)}.console-record[data-level=warn]{color:var(--amber)}.console-record[data-level=error]{border-inline-start:2px solid var(--red);background:linear-gradient(90deg, var(--red-soft), transparent 72%);color:var(--red);padding-block:3px}.console-record[data-level=debug]{color:var(--text-muted)}.console-record--group{color:var(--violet);font-weight:650}.console-group-mark{width:16px;color:var(--accent);display:inline-block}.console-token--number,.console-token--bigint{color:var(--violet)}.console-token--boolean{color:var(--amber)}.console-token--null,.console-token--undefined{color:var(--text-muted)}.console-token--object,.console-token--array{color:var(--green)}.console-token--error{color:var(--red)}.console-record--table{white-space:normal;max-width:100%;overflow-x:auto}.console-record--table table{border-spacing:0;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--bg-deep) 88%, transparent);border-radius:7px;width:max-content;min-width:min(100%,440px);overflow:hidden}.console-record--table th,.console-record--table td{border-inline-end:1px solid var(--line);border-bottom:1px solid var(--line);text-align:start;overflow-wrap:anywhere;max-width:280px;padding:6px 9px}.console-record--table th{background:var(--accent-soft);color:var(--accent);font-weight:700}.console-record--table tr:last-child td{border-bottom:0}.console-record--table th:last-child,.console-record--table td:last-child{border-inline-end:0}.console-record--table small{color:var(--text-muted);margin-top:5px;display:block}.terminal-console-help{color:var(--text-muted);font:8px/1.5 var(--font-mono);letter-spacing:.025em;margin:7px 3px 0}.terminal-event-strip{scrollbar-width:thin;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:10px;display:grid;overflow-x:auto}.terminal-event-strip button{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:145px;color:var(--text-soft);text-align:start;cursor:pointer;grid-template-columns:auto 1fr;gap:3px 8px;padding:9px 10px;transition:border-color .22s,background .22s,filter .22s;display:grid;overflow:hidden}.terminal-event-strip button:hover,.terminal-event-strip button:focus-visible{border-color:color-mix(in srgb, var(--accent) 44%, var(--line));background:linear-gradient(105deg, var(--accent-soft), var(--surface-hover));filter:saturate(1.12)}.terminal-event-strip time{color:var(--text-muted);font:8px var(--font-mono)}.terminal-event-strip strong{min-width:0;color:var(--accent);font:650 8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.terminal-event-strip span{min-width:0;color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;grid-column:1/-1;font-size:9px;overflow:hidden}.compact-fields{grid-template-columns:1.25fr repeat(4,minmax(72px,.7fr));align-items:end;gap:8px;display:grid}.compact-fields .text-field{min-width:0;margin-block:10px 0}.relay-control-card{grid-row:span 2}.relay-bank{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;display:grid}.relay-switch{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);flex-direction:column;justify-content:center;align-items:center;gap:9px;min-height:150px;padding:10px;transition:border-color .3s,background .3s,box-shadow .3s;display:flex}.relay-switch:disabled{opacity:.4;cursor:not-allowed}.relay-switch>span{color:var(--text-soft);font:650 11px var(--font-mono)}.relay-switch__toggle{cursor:pointer;background:0 0;border:0;border-radius:8px;place-items:center;padding:4px 12px;display:grid}.relay-switch__toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.relay-switch__toggle>i{border:1px solid var(--line-strong);background:var(--bg-deep);border-radius:8px;width:34px;height:58px;display:block;position:relative;box-shadow:inset 0 5px 14px #00000042}.relay-switch__toggle>i b{inset:5px;background:linear-gradient(var(--text-muted), color-mix(in srgb, var(--text-muted) 55%, var(--surface-solid)));height:20px;transition:top .42s var(--ease-out), background .3s, box-shadow .3s;border-radius:5px;position:absolute;top:29px;box-shadow:0 3px 8px #00000047}.relay-switch>small{color:var(--text-muted);font-size:8px}.relay-switch.is-active{border-color:color-mix(in srgb, var(--green) 46%, transparent);background:var(--green-soft);box-shadow:inset 0 0 28px color-mix(in srgb, var(--green-soft) 60%, transparent)}.relay-switch.is-active .relay-switch__toggle>i b{background:linear-gradient(var(--green), color-mix(in srgb, var(--green) 55%, var(--surface-solid)));box-shadow:0 0 13px color-mix(in srgb, var(--green) 45%, transparent);top:8px}.relay-switch__actions{grid-template-columns:1fr 1fr;gap:5px;width:100%;display:grid}.motion-actions{gap:8px;margin:14px 0;display:grid}.motion-side{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);grid-template-columns:minmax(100px,1fr) minmax(0,1.4fr);align-items:center;gap:7px;padding:9px;display:grid}.motion-side__actions{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:7px;display:grid}.motion-side__actions>.button{width:100%;min-width:0;height:100%}.motion-side strong{font:600 9px var(--font-mono);color:var(--text-muted)}.motion-side__identity{justify-content:space-between;align-items:center;gap:8px;min-width:0;display:flex}.channel-selector{grid-template-columns:repeat(8,1fr);gap:5px;display:grid}.channel-selector button{aspect-ratio:1;border:1px solid var(--line);background:var(--surface-muted);color:var(--text-muted);font:550 9px var(--font-mono);cursor:pointer;border-radius:6px;transition:all .22s}.channel-selector button:hover{color:var(--text);border-color:var(--line-strong)}.channel-selector button.is-active{background:var(--violet-soft);color:var(--violet);border-color:color-mix(in srgb, var(--violet) 40%, transparent);box-shadow:inset 0 0 13px var(--violet-soft)}.pwm-readout{justify-content:flex-end;align-items:baseline;gap:7px;margin:16px 0 8px;display:flex}.pwm-readout>span{color:var(--violet);font:600 10px var(--font-mono);margin-inline-end:auto}.pwm-readout strong{font:650 28px var(--font-mono);letter-spacing:-.05em}.pwm-readout small{color:var(--text-muted);font:9px var(--font-mono)}.pwm-mixer{scrollbar-gutter:stable;gap:7px;min-width:0;max-height:620px;padding-inline-end:12px;display:grid;overflow:auto}.pwm-mixer__row{border:1px solid var(--line);background:var(--surface-muted);border-radius:10px;grid-template-columns:minmax(170px,.55fr) minmax(210px,1fr) auto;align-items:center;gap:11px;padding:8px 10px;transition:border-color .25s,background .25s;display:grid}.pwm-mixer__row.is-live{border-color:color-mix(in srgb, var(--violet) 48%, transparent);background:var(--violet-soft)}.pwm-mixer__row.is-pending{border-color:color-mix(in srgb, var(--amber) 52%, var(--line));background:color-mix(in srgb, var(--amber-soft) 52%, var(--surface-muted));box-shadow:inset 3px 0 0 color-mix(in srgb, var(--amber) 72%, transparent)}.pwm-mixer__row>div:first-child{gap:2px;display:grid}.pwm-mixer__row strong{color:var(--text);font-size:10px}.pwm-mixer__row small{font:8px var(--font-mono);color:var(--text-muted)}.pwm-mixer__row .range-field{margin:0}.pwm-mixer__actions{gap:4px;display:flex}.pwm-channel-config{gap:5px;margin-top:3px;display:flex}.pwm-channel-config select{border:1px solid var(--line);background:var(--surface);min-width:0;color:var(--text);font:8px var(--font-ui);border-radius:7px;padding:3px 5px}.system-output-summary{border:1px solid var(--line);background:var(--surface-muted);border-radius:11px;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;padding:10px;display:grid}.system-output-summary>span{gap:3px;min-width:0;display:grid}.system-output-summary strong{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.system-output-summary small{color:var(--text-muted);font:8px var(--font-mono)}.pwm-authority-status{border-inline-start:3px solid var(--violet);background:var(--violet-soft);min-height:32px;color:var(--text-soft);border-radius:7px;padding:8px 10px;font-size:9px;line-height:1.55;transition:border-color .24s,background .24s,color .24s}.pwm-authority-status.is-error{border-color:var(--red);background:var(--red-soft);color:var(--red)}.rgb-board-state{border:1px solid var(--line);background:var(--surface-muted);color:var(--text-muted);border-radius:9px;justify-content:space-between;align-items:center;gap:14px;padding:8px 10px;font-size:9px;display:flex}.rgb-board-state strong{color:var(--text-soft);font:9px var(--font-mono)}.range-field{margin:14px 0;display:block}.range-field.is-disabled{opacity:.45}.range-field__label{justify-content:space-between;align-items:center;margin-bottom:7px;display:flex}.range-field__label strong{color:var(--text-soft);font-size:10px;font-weight:560}.range-field__label output{color:var(--text-muted);font:550 9px var(--font-mono)}.range-field input[type=range]{appearance:none;background:linear-gradient(90deg, var(--accent) var(--range), var(--line-strong) var(--range));cursor:pointer;border-radius:2px;width:100%;height:5px;margin:0}[dir=rtl] .range-field input[type=range]{background:linear-gradient(90deg, var(--line-strong) calc(100% - var(--range)), var(--accent) calc(100% - var(--range)))}.range-field input[type=range]::-webkit-slider-thumb{appearance:none;border:2px solid var(--surface-solid);background:var(--accent);width:15px;height:18px;box-shadow:0 0 0 1px var(--accent), 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);border-radius:4px}.range-field__value{border:1px solid var(--line);background:var(--surface-muted);min-height:28px;color:var(--text-muted);font:600 9px var(--font-mono);border-radius:8px;grid-template-columns:minmax(38px,auto) auto;align-items:center;gap:3px;padding:2px 7px;display:inline-grid}.range-field__number{width:7ch;min-width:38px;color:var(--text);font:inherit;text-align:end;appearance:textfield;background:0 0;border:0;outline:0;padding:2px 0}.range-field__number::-webkit-inner-spin-button{opacity:.45}.range-field__value:focus-within{border-color:color-mix(in srgb, var(--accent) 48%, var(--line));box-shadow:inset 0 0 12px var(--accent-soft)}.inline-actions,.operation-buttons{flex-wrap:wrap;gap:8px;margin-top:15px;display:flex}.color-preview{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(115deg, color-mix(in srgb, var(--preview) 45%, var(--surface-solid)), var(--surface-muted));align-items:flex-end;min-height:80px;margin-bottom:13px;padding:14px;display:flex;position:relative;overflow:hidden}.color-preview:before{display:none}.color-preview span{inset-inline-end:15px;background:var(--preview);width:50px;height:7px;box-shadow:0 0 22px var(--preview);position:absolute;top:14px}.color-preview strong{font:600 10px var(--font-mono);color:#fff;text-shadow:0 2px 5px #0006;position:relative}.status-led-previews{grid-template-columns:minmax(0,1fr) minmax(0,.8fr);gap:10px;display:grid}.status-led-live{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);align-items:center;gap:13px;min-height:80px;margin-bottom:13px;padding:13px;display:flex}.status-led-live i{background:var(--preview);border:2px solid color-mix(in srgb, var(--preview) 65%, white);width:34px;height:34px;box-shadow:0 0 9px var(--preview), 0 0 28px color-mix(in srgb, var(--preview) 70%, transparent);border-radius:50%;flex:none}.status-led-live div{gap:3px;min-width:0;display:grid}.status-led-live small{color:var(--text-muted);overflow-wrap:anywhere}.native-color-field,.rgb-effect-fields label,.rgb-profile-row label{color:var(--text-muted);align-items:center;gap:9px;font-size:12px;display:flex}.native-color-field input[type=color]{border:1px solid var(--line);background:var(--surface-muted);cursor:pointer;border-radius:8px;width:46px;height:32px;padding:2px}.native-color-field code{color:var(--text);direction:ltr}.rgb-effect-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;display:grid}.rgb-effect-fields label,.rgb-profile-row label{border:1px solid var(--line);background:var(--surface-muted);border-radius:10px;justify-content:space-between;padding:9px 11px}.rgb-effect-fields select,.rgb-effect-fields input,.rgb-profile-row select{min-width:0;color:var(--text);border:1px solid var(--line);background:var(--surface-solid);border-radius:7px;padding:6px 8px}.rgb-profile-row{align-items:stretch;gap:10px;margin-top:12px;display:flex}.rgb-profile-row label{flex:1}@media (max-width:720px){.status-led-previews,.rgb-effect-fields{grid-template-columns:1fr}.rgb-profile-row{flex-direction:column}}.console-card{grid-column:1/-1}.command-form{border:1px solid var(--line);border-radius:var(--radius);background:var(--bg-deep);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;padding:8px;display:grid}.command-prompt{color:var(--accent);font:700 13px var(--font-mono);padding-inline-start:5px}.command-form input{min-width:0;color:var(--text);font:12px var(--font-mono);background:0 0;border:0;outline:0}.terminal-command-box{min-width:0;position:relative}.terminal-command-box>input{width:100%}.terminal-completions{z-index:30;border:1px solid var(--line-strong);background:var(--surface-solid);max-height:250px;box-shadow:var(--shadow-tight);border-radius:10px;padding:5px;display:grid;position:absolute;inset:calc(100% + 9px) 0 auto;overflow:auto}.terminal-completions button{color:var(--text);text-align:start;cursor:pointer;background:0 0;border:0;border-radius:7px;grid-template-columns:minmax(72px,auto) minmax(0,1fr);align-items:baseline;gap:10px;padding:8px 9px;display:grid}.terminal-completions button:hover,.terminal-completions button[aria-selected=true]{background:var(--accent-soft)}.terminal-completions strong{font:700 10px var(--font-mono)}.terminal-completions small{color:var(--text-muted);font:9px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.command-output,.diagnostic-output,.operation-output{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--bg-deep) 90%, transparent);min-height:120px;max-height:340px;color:var(--text-soft);font:10px/1.65 var(--font-mono);white-space:pre-wrap;margin:10px 0;padding:14px;overflow:auto}.command-chips{flex-wrap:wrap;gap:6px;display:flex}.command-chips button,.diagnostic-picker button{border:1px solid var(--line);background:var(--surface-muted);color:var(--text-muted);font:9px var(--font-mono);cursor:pointer;border-radius:6px;padding:5px 8px}.device-layout{grid-template-columns:minmax(330px,.86fr) minmax(420px,1.14fr);align-items:start;gap:14px;display:grid}.device-stage{background:linear-gradient(150deg, color-mix(in srgb, var(--violet-soft) 32%, var(--glass-strong)), color-mix(in srgb, var(--amber-soft) 18%, var(--surface)));flex-direction:column;min-height:390px;transition:background-color .28s,border-color .28s;display:flex}.device-stage.is-on{border-color:color-mix(in srgb, var(--green) 28%, var(--line));background:linear-gradient(150deg, color-mix(in srgb, var(--violet-soft) 40%, var(--glass-strong)), color-mix(in srgb, var(--green-soft) 42%, var(--surface)))}.device-overview{grid-template-columns:86px minmax(0,1fr);align-items:center;gap:18px;padding:24px 0 22px;display:grid}.device-overview__mark{border:1px solid color-mix(in srgb, var(--violet) 32%, var(--line));background:linear-gradient(145deg, var(--violet-soft), var(--surface-muted));width:86px;height:86px;color:var(--violet);border-radius:22px;place-items:center;display:grid;position:relative;box-shadow:inset 0 1px #ffffff0d,0 18px 34px #0000001f}.device-overview__mark span{inset-inline-end:12px;background:var(--amber);width:18px;height:5px;box-shadow:0 0 14px color-mix(in srgb, var(--amber) 48%, transparent);border-radius:3px;transition:background-color .25s,box-shadow .25s;position:absolute;bottom:12px}.device-stage.is-on .device-overview__mark span{background:var(--green);box-shadow:0 0 14px color-mix(in srgb, var(--green) 48%, transparent)}.device-overview__copy{flex-direction:column;min-width:0;display:flex}.device-overview__copy>span{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.device-overview__copy strong{color:var(--text);letter-spacing:-.025em;margin-top:7px;font-size:17px}.device-overview__copy small{color:var(--text-soft);margin-top:8px;font-size:10px;line-height:1.5}.device-facts{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.device-facts>div{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 78%, transparent);border-radius:12px;min-width:0;padding:12px}.device-facts span,.device-facts strong{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.device-facts span{color:var(--text-muted);font-size:8px}.device-facts strong{color:var(--text-soft);margin-top:6px;font-size:11px}.device-actions{grid-template-columns:repeat(3,1fr);gap:8px;margin-top:auto;padding-top:24px;display:grid}.device-stage .empty-state{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);flex-wrap:wrap;justify-content:flex-start;margin-top:18px}.device-unavailable__actions{flex-wrap:wrap;gap:8px;margin-inline-start:auto;display:flex}.device-side{gap:14px;display:grid}.message-compose{grid-template-columns:1fr auto;gap:8px;display:grid}.message-compose input,.text-field input{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:0;height:39px;color:var(--text);outline:0;padding:0 12px;font-size:11px;transition:border-color .2s,box-shadow .2s}.message-compose input:focus,.text-field input:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 16px var(--accent-soft)}.beep-row{border-top:1px solid var(--line);align-items:center;gap:7px;margin-top:12px;padding-top:12px;display:flex}.beep-row>div{color:var(--text-muted);flex:1;align-items:center;gap:8px;font-size:10px;display:flex}.diagnostic-picker{flex-wrap:wrap;gap:5px;display:flex}.diagnostic-picker button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 35%, transparent);background:var(--accent-soft)}.inline-error-presence{will-change:height, opacity, clip-path, filter;overflow:clip}.inline-error,.integration-banner{border:1px solid color-mix(in srgb, var(--red) 35%, transparent);border-radius:var(--radius-sm);background:var(--red-soft);color:var(--red);align-items:flex-start;gap:9px;margin-top:14px;padding:10px 12px;font-size:10px;display:flex}.subnav{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);gap:6px;width:-moz-fit-content;width:fit-content;margin-bottom:14px;padding:5px;display:flex}.subnav button{min-height:36px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:9px;align-items:center;gap:8px;padding:7px 12px;font-size:11px;display:flex}.subnav button:hover{color:var(--text)}.subnav button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 20%, transparent);background:var(--accent-soft)}.integration-banner{max-width:850px;margin:0 0 14px;overflow:hidden}.integration-banner div{color:var(--text-soft)}.integration-banner strong{font-size:11px}.integration-banner p{color:var(--text-muted);font:9px var(--font-mono);margin:3px 0 0}.records-card{padding-inline:0;padding-bottom:0}.records-card .card__header{padding-inline:20px}.typed-collection{min-width:0;color:var(--text-soft);position:relative}.records-card>.typed-collection{border-top:1px solid var(--line)}.typed-collection__toolbar{z-index:6;border-bottom:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);flex-wrap:wrap;align-items:center;gap:8px;min-height:54px;padding:9px 14px;display:flex;position:relative}.typed-collection__search{border:1px solid var(--line);background:var(--surface-solid);min-width:min(310px,42vw);height:36px;color:var(--text-muted);border-radius:9px;flex:220px;align-items:center;gap:8px;padding-inline:10px 5px;transition:border-color .2s,box-shadow .2s,background-color .2s;display:flex}.typed-collection__search:focus-within{border-color:color-mix(in srgb, var(--violet) 52%, var(--line));background:color-mix(in srgb, var(--violet-soft) 18%, var(--surface-solid));box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 12%, transparent)}.typed-collection__search input{min-width:0;color:var(--text);font:10px var(--font-ui);background:0 0;border:0;outline:0;flex:1}.typed-collection__search>button{width:27px;height:27px;color:var(--text-muted);cursor:pointer;background:0 0;border:0;border-radius:7px;flex:none;place-items:center;transition:color .18s,background-color .18s;display:grid}.typed-collection__search>button:hover{background:var(--surface-hover);color:var(--text)}.typed-collection__summary{min-height:30px;color:var(--text-muted);font:8px var(--font-mono);white-space:nowrap;align-items:center;gap:5px;padding-inline:7px;display:inline-flex}.typed-collection__summary strong{color:var(--text-soft);font-size:10px}.typed-collection__summary i{background:var(--line-strong);width:1px;height:14px;margin-inline:3px}.typed-collection__quiet-action{min-height:31px;color:var(--violet);font:8px var(--font-ui);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:8px;padding:5px 9px}.typed-collection__quiet-action:hover,.typed-collection__quiet-action:focus-visible{border-color:color-mix(in srgb, var(--violet) 26%, var(--line));background:var(--violet-soft);outline:none}.typed-collection__popover{position:relative}.typed-collection__popover>summary{border:1px solid var(--line);background:var(--surface-solid);min-height:34px;color:var(--text-muted);font:600 9px var(--font-ui);cursor:pointer;border-radius:9px;align-items:center;gap:7px;padding:6px 10px;list-style:none;transition:border-color .2s,background-color .2s,color .2s;display:inline-flex}.typed-collection__popover>summary::-webkit-details-marker{display:none}.typed-collection__popover>summary:hover,.typed-collection__popover[open]>summary{border-color:color-mix(in srgb, var(--violet) 38%, var(--line));background:var(--violet-soft);color:var(--violet)}.typed-collection__popover>summary:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 16%, transparent);outline:none}.typed-collection__popover-panel{z-index:18;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 96%, transparent);-webkit-backdrop-filter:blur(24px)saturate(1.12);backdrop-filter:blur(24px)saturate(1.12);border-radius:12px;gap:4px;width:min(410px,100vw - 32px);max-height:min(520px,100dvh - 130px);padding:7px;animation:.2s cubic-bezier(.22,1,.36,1) typed-collection-popover;display:grid;position:absolute;inset-block-start:calc(100% + 7px);inset-inline-end:0;overflow:auto;box-shadow:0 22px 68px #0000004f}@keyframes typed-collection-popover{0%{opacity:0;clip-path:inset(0 0 18% round 12px);transform:translateY(-6px)}to{opacity:1;clip-path:inset(0 round 12px);transform:translateY(0)}}.typed-collection__export .typed-collection__popover-panel{width:190px}.typed-collection__export .typed-collection__popover-panel>button{min-height:36px;color:var(--text-soft);text-align:start;font:9px var(--font-ui);cursor:pointer;background:0 0;border:0;border-radius:8px;padding-inline:10px;transition:background-color .16s,color .16s}.typed-collection__export .typed-collection__popover-panel>button:hover,.typed-collection__export .typed-collection__popover-panel>button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.typed-collection__export .typed-collection__popover-panel>button:disabled{opacity:.38;cursor:not-allowed}.typed-collection__column-option{border:1px solid #0000;border-radius:9px;grid-template-columns:minmax(160px,1fr) auto;align-items:center;gap:6px 10px;padding:8px;transition:border-color .16s,background-color .16s;display:grid}.typed-collection__column-option:hover{border-color:var(--line);background:var(--surface-muted)}.typed-collection__column-option>label:first-child{min-width:0;color:var(--text-soft);font:9px var(--font-ui);cursor:pointer;align-items:center;gap:7px;display:flex}.typed-collection__column-option>label:first-child span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.typed-collection__column-option>label:first-child input{accent-color:var(--violet)}.typed-collection__column-drag{border:1px solid var(--line);background:var(--surface-solid);width:28px;height:28px;color:var(--text-muted);cursor:grab;touch-action:none;border-radius:7px;place-items:center;display:grid}.typed-collection__column-drag:hover,.typed-collection__column-drag:focus-visible{border-color:color-mix(in srgb, var(--violet) 35%, var(--line));color:var(--violet);outline:0}.typed-collection__column-drag:active{cursor:grabbing}.typed-collection__column-drag:disabled{opacity:.28;cursor:not-allowed}.typed-collection__viewport{overscroll-behavior:contain;box-sizing:border-box;scrollbar-gutter:stable both-edges;background:color-mix(in srgb, var(--bg-deep) 18%, transparent);max-height:calc(100dvh - 285px);padding-inline-start:12px;position:relative;overflow:auto}.typed-collection__grid{table-layout:fixed;border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:10px}.typed-collection__select-column{width:42px}.typed-collection__grid th{z-index:4;border-block-end:1px solid var(--line-strong);border-inline-end:1px solid var(--line);background:color-mix(in srgb, var(--glass-strong) 95%, transparent);height:42px;color:var(--text-muted);text-align:start;-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);outline:0;padding:0;position:sticky;inset-block-start:0}.typed-collection__grid th:last-child{border-inline-end:0}.typed-collection__grid th:focus-visible{z-index:7;box-shadow:inset 0 0 0 2px var(--violet)}.typed-collection__sort{width:100%;height:100%;color:inherit;text-align:start;font:700 8px var(--font-mono);letter-spacing:.07em;text-transform:uppercase;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;gap:9px;padding-inline:11px 61px;display:flex;overflow:hidden}.typed-collection__sort:disabled{cursor:default}.typed-collection__sort span:first-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.typed-collection__sort svg{color:var(--violet);flex:none}.typed-collection__sort-placeholder{width:14px}.typed-collection__header-actions{z-index:6;align-items:center;gap:1px;display:inline-flex;position:absolute;inset-block-start:50%;inset-inline-end:10px;translate:0 -50%}.typed-collection__header-menu,.typed-collection__reorder{width:22px;height:24px;color:var(--text-muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;padding:0;display:grid}.typed-collection__reorder{cursor:grab;touch-action:none}.typed-collection__reorder:active{cursor:grabbing}.typed-collection__header-menu:hover,.typed-collection__header-menu:focus-visible,.typed-collection__reorder:hover,.typed-collection__reorder:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.typed-collection__resize{z-index:8;background:color-mix(in srgb, var(--line-strong) 52%, transparent);width:16px;color:var(--text-muted);cursor:col-resize;opacity:.82;touch-action:none;border:0;border-radius:6px;place-items:center;padding:0;transition:color .16s,background-color .16s,opacity .16s;display:grid;position:absolute;inset-block:7px;inset-inline-end:-8px}.typed-collection__grid th:hover .typed-collection__resize,.typed-collection__resize:focus-visible{background:color-mix(in srgb, var(--violet-soft) 88%, var(--surface-solid));color:var(--violet);opacity:1;outline:0}.typed-collection__grid td{height:48px;max-width:var(--collection-column-width,280px);border-block-end:1px solid var(--line);border-inline-end:1px solid color-mix(in srgb, var(--line) 76%, transparent);color:var(--text-soft);text-align:start;vertical-align:middle;background:0 0;outline:0;padding:9px 11px;transition:background-color .2s,box-shadow .2s;position:relative;overflow:hidden}.typed-collection__grid td:last-child{border-inline-end:0}.typed-collection__grid tbody tr:last-child td{border-block-end:0}.typed-collection__grid tbody tr:hover td{background:color-mix(in srgb, var(--violet-soft) 30%, var(--surface-muted))}.typed-collection__grid tbody tr[aria-selected=true] td{background:color-mix(in srgb, var(--violet-soft) 68%, var(--surface-muted))}.typed-collection__grid td:focus-visible{z-index:3;box-shadow:inset 0 0 0 2px var(--violet), 0 8px 24px #00000024;background:color-mix(in srgb, var(--violet-soft) 82%, var(--surface-solid));overflow:visible}.typed-collection__select{width:42px;min-width:42px;text-align:center!important;padding:0!important}.typed-collection__select label{border:1px solid var(--line);background:var(--surface-solid);color:#fff;cursor:pointer;border-radius:8px;place-items:center;width:26px;height:26px;transition:border-color .18s,background-color .18s,box-shadow .18s;display:inline-grid;position:relative}.typed-collection__select label:has(input:checked){border-color:var(--violet);background:var(--violet);box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 12%, transparent)}.typed-collection__select input{opacity:0;pointer-events:none;position:absolute}.typed-collection__row--good td:first-child{box-shadow:inset 3px 0 var(--green)}.typed-collection__row--warn td:first-child{box-shadow:inset 3px 0 var(--amber)}.typed-collection__row--bad td:first-child{box-shadow:inset 3px 0 var(--red)}.typed-collection__row--info td:first-child{box-shadow:inset 3px 0 var(--violet)}[dir=rtl] .typed-collection__row--good td:first-child{box-shadow:inset -3px 0 var(--green)}[dir=rtl] .typed-collection__row--warn td:first-child{box-shadow:inset -3px 0 var(--amber)}[dir=rtl] .typed-collection__row--bad td:first-child{box-shadow:inset -3px 0 var(--red)}[dir=rtl] .typed-collection__row--info td:first-child{box-shadow:inset -3px 0 var(--violet)}.structured-value__scalar{color:var(--text-soft);font:9px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.structured-value{min-width:0}.structured-value>summary{color:var(--violet);font:650 8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:6px;list-style-position:inside;display:flex;overflow:hidden}.structured-value[open]>summary{color:var(--text);margin-block-end:8px}.structured-value__content{border:1px solid var(--line);background:var(--surface-solid);max-height:260px;color:var(--text-soft);font:8px/1.55 var(--font-mono);border-radius:8px;padding:9px;overflow:auto;box-shadow:inset 0 1px #ffffff06}.structured-value__array{gap:5px;margin:0;padding-inline-start:22px;display:grid}.structured-value__object{gap:5px;margin:0;display:grid}.structured-value__object>div{border-block-end:1px solid var(--line);grid-template-columns:minmax(72px,.35fr) minmax(0,1fr);gap:8px;min-width:0;padding-block-end:5px;display:grid}.structured-value__object>div:last-child{border-block-end:0;padding-block-end:0}.structured-value__object dt{overflow-wrap:anywhere;color:var(--text-muted)}.structured-value__object dd{overflow-wrap:anywhere;min-width:0;color:var(--text-soft);margin:0}.structured-value__empty{color:var(--text-muted)}.typed-collection__event-kind{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:10px;display:block;overflow:hidden}.typed-collection__event-message{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:10px;display:block;overflow:hidden}.typed-collection__event-copy{gap:5px;min-width:0;display:grid}.typed-collection__event-copy .structured-value>summary{font-size:7px}.typed-collection__grid time{color:var(--text-muted);font:8px var(--font-mono)}.typed-collection__empty{min-height:160px;color:var(--text-muted);text-align:center;place-content:center;justify-items:center;gap:8px;padding:20px;font-size:10px;display:grid}.typed-collection__empty p{margin:0}.typed-collection__empty button{border:1px solid var(--line);background:var(--surface-muted);min-height:31px;color:var(--violet);font:9px var(--font-ui);cursor:pointer;border-radius:8px;padding:5px 10px}.typed-collection__window-nav{border-block-start:1px solid var(--line);background:var(--surface-muted);min-height:45px;color:var(--text-muted);font:8px var(--font-mono);grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;padding:7px 12px;display:grid}.typed-collection__window-nav button{border:1px solid var(--line);background:var(--surface-solid);min-height:31px;color:var(--text-soft);font:8px var(--font-ui);cursor:pointer;border-radius:8px;align-items:center;gap:6px;padding:5px 9px;display:inline-flex}.typed-collection__window-nav button:first-child{justify-self:start}.typed-collection__window-nav button:last-child{justify-self:end}.typed-collection__window-nav button:hover:not(:disabled),.typed-collection__window-nav button:focus-visible{border-color:color-mix(in srgb, var(--violet) 35%, var(--line));color:var(--violet);outline:0}.typed-collection__window-nav button:disabled{opacity:.35;cursor:not-allowed}.typed-collection__window-nav span{text-align:center}.typed-collection__window-nav strong{color:var(--text-soft)}.typed-collection__context-menu{z-index:180;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 97%, transparent);-webkit-backdrop-filter:blur(24px)saturate(1.12);backdrop-filter:blur(24px)saturate(1.12);border-radius:12px;gap:3px;width:218px;padding:6px;animation:.18s cubic-bezier(.22,1,.36,1) typed-collection-menu;display:grid;position:fixed;box-shadow:0 24px 76px #0000005c}@keyframes typed-collection-menu{0%{opacity:0;clip-path:inset(0 0 22% round 12px);transform:scale(.96)}to{opacity:1;clip-path:inset(0 round 12px);transform:scale(1)}}.typed-collection__context-menu button{min-height:37px;color:var(--text-soft);text-align:start;font:9px var(--font-ui);cursor:pointer;background:0 0;border:0;border-radius:8px;align-items:center;gap:9px;padding:7px 9px;transition:background-color .15s,color .15s;display:flex}.typed-collection__context-menu button:hover,.typed-collection__context-menu button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.typed-collection__context-menu button:disabled{opacity:.35;cursor:not-allowed}.typed-collection--compact .typed-collection__viewport{border:1px solid var(--line);border-radius:10px;max-height:330px}.typed-collection--compact .typed-collection__grid th{height:36px}.typed-collection--compact .typed-collection__grid td{height:45px}.events-page-card .typed-collection{margin-block-end:-20px;margin-inline:-20px}.events-page-card .typed-collection__toolbar{padding-inline:20px}.events-page-card .typed-collection__viewport{max-height:calc(100dvh - 315px)}.settings-value-table{border-collapse:collapse;width:100%;margin:2px 0 15px;font-size:10px}.settings-value-table th{border-bottom:1px solid var(--line-strong);color:var(--text-muted);text-align:start;font:600 8px var(--font-mono);letter-spacing:.08em;text-transform:uppercase;padding:8px 7px}.settings-value-table td{border-bottom:1px solid var(--line);color:var(--text-soft);padding:9px 7px}.settings-value-table td:nth-child(n+2){font-family:var(--font-mono)}.illumination-state-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:12px;display:grid}.illumination-state-grid .data-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:0;padding:11px}.illumination-settings-card__footer{justify-content:space-between;align-items:center;gap:16px;padding-top:14px;display:flex}.illumination-settings-card__footer .settings-action-feedback{margin:0}.table-footer{border-top:1px solid var(--line);color:var(--text-muted);font:9px var(--font-mono);justify-content:space-between;align-items:center;gap:15px;padding:10px 20px;display:flex}.table-footer span{align-items:center;gap:6px;display:flex}.catalog-grid,.operations-grid,.system-grid{grid-template-columns:1fr 1fr;align-items:start;gap:14px;display:grid}.category-list{max-height:620px;overflow:auto}.category-list article{border-bottom:1px solid var(--line);grid-template-columns:30px 1fr auto;align-items:center;gap:10px;padding:10px 0;display:grid}.category-list__index{color:var(--accent);font:650 9px var(--font-mono)}.category-list strong{font-size:11px;display:block}.category-list p{color:var(--text-muted);font:8px var(--font-mono);margin:2px 0 0}.category-list article>span:last-child{color:var(--text-muted);font:9px var(--font-mono)}.operation-result,.system-grid .card:last-child{grid-column:1/-1}.operation-output{min-height:230px}.operation-buttons .button{flex:1;min-width:120px}.events-page-card{padding-top:14px}.event-toolbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px;padding-bottom:13px;display:flex}.segmented{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);gap:3px;padding:3px;display:inline-flex}.segmented button{min-height:31px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:7px;justify-content:center;align-items:center;gap:6px;padding:6px 10px;font-size:10px;transition:color .2s,background .2s,border-color .2s;display:flex}.segmented button:hover{color:var(--text)}.segmented button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 20%, transparent);background:var(--accent-soft);box-shadow:inset 0 0 15px color-mix(in srgb, var(--accent-soft) 65%, transparent)}.settings-grid{grid-template-columns:1fr 1fr;align-items:start;gap:14px;display:grid}.settings-card--wide{grid-column:1/-1}.setting-group{border-bottom:1px solid var(--line);grid-template-columns:minmax(130px,.35fr) minmax(0,1fr);align-items:center;gap:16px;padding:12px 0;display:grid}.setting-group>label{color:var(--text-soft);font-size:11px;font-weight:580}.setting-group .segmented{justify-self:stretch}.setting-group .segmented button{flex:1}.settings-inline-status{flex-wrap:wrap;gap:8px;margin-top:14px;display:flex}.settings-action-feedback{color:var(--text-muted);margin:10px 0 0;font-size:10px;line-height:1.55}.peripheral-name-groups{gap:8px;display:grid}.peripheral-name-group{border:1px solid var(--line);background:var(--surface-muted);border-radius:11px;transition:border-color .24s,background .24s;overflow:clip}.peripheral-name-group[open]{border-color:color-mix(in srgb, var(--accent) 28%, var(--line));background:color-mix(in srgb, var(--accent-soft) 22%, var(--surface-muted))}.peripheral-name-group>summary{color:var(--text-soft);cursor:pointer;justify-content:space-between;align-items:center;gap:12px;padding:11px 12px;font-size:10px;font-weight:650;list-style:none;display:flex}.peripheral-name-group>summary::-webkit-details-marker{display:none}.peripheral-name-group>summary:before{content:"›";color:var(--accent);font:16px/1 var(--font-mono);transition:transform .24s}.peripheral-name-group[open]>summary:before{transform:rotate(90deg)}.peripheral-name-group>summary span{margin-inline-end:auto}.peripheral-name-group>summary small{background:var(--surface-raised);min-width:24px;height:20px;color:var(--text-muted);font:8px var(--font-mono);border-radius:999px;place-items:center;display:grid}.peripheral-name-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0 12px 12px;display:grid}.peripheral-name-grid .text-field{align-self:start}.peripheral-names-card__footer{min-height:36px;color:var(--text-muted);justify-content:space-between;align-items:center;gap:14px;font-size:9px;display:flex}.peripheral-names-card__footer>span{line-height:1.55}.rf-learn-status{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-raised) 76%, transparent);min-height:38px;color:var(--text-soft);border-radius:10px;flex-wrap:wrap;align-items:center;gap:9px;padding:9px 11px;font-size:11px;display:flex}.update-operation{--operation-color:var(--accent);border:1px solid color-mix(in srgb, var(--operation-color) 40%, var(--line));border-radius:var(--radius-lg);background:linear-gradient(135deg, color-mix(in srgb, var(--operation-color) 10%, var(--surface)), var(--surface));box-shadow:var(--shadow);margin-bottom:18px;padding:clamp(16px,3vw,28px)}.update-operation.is-failed{--operation-color:var(--red)}.update-operation.is-complete{--operation-color:var(--green)}.update-operation__header{align-items:center;gap:16px;display:flex}.update-operation__icon{width:52px;height:52px;color:var(--operation-color);background:color-mix(in srgb, var(--operation-color) 14%, var(--surface));border-radius:16px;flex:none;place-items:center;display:grid}.update-operation__icon svg{width:27px;height:27px}.update-operation__heading{flex:1;min-width:0}.update-operation__heading>span{color:var(--operation-color);font-size:12px;font-weight:650}.update-operation__heading h2{color:var(--text);margin:4px 0 0;font-size:clamp(18px,2vw,24px);line-height:1.3}.update-operation__elapsed{color:var(--text-soft);white-space:nowrap;font:12px var(--font-mono);align-items:center;gap:7px;display:flex}.update-operation__measurement{margin-top:24px}.update-operation__measurement>div:first-child{color:var(--text-soft);justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px;font-size:12px;display:flex}.update-operation__measurement strong{color:var(--operation-color);font:650 28px var(--font-mono)}.update-operation .update-progress{height:8px}.update-operation .update-progress i{min-width:0}.update-progress.is-indeterminate i{width:25%;animation:1.7s ease-in-out infinite alternate update-stage-pulse}@keyframes update-stage-pulse{0%{transform:translate(0)}to{transform:translate(300%)}}.update-operation__detail{border-inline-start:3px solid var(--operation-color);background:color-mix(in srgb, var(--surface) 65%, transparent);color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:3px 9px 9px 3px;margin:20px 0 0;padding:14px 16px;font-size:13px;line-height:1.7}.update-operation__facts{flex-wrap:wrap;gap:18px 40px;margin:20px 0 0;display:flex}.update-operation dt{color:var(--text-muted);margin:0 0 5px;font-size:11px}.update-operation dd{color:var(--text);overflow-wrap:anywhere;margin:0;font-size:13px}.update-operation__facts dd{font-weight:550}.update-operation__diagnostics{border-top:1px solid var(--line);margin-top:20px;padding-top:12px}.update-operation__diagnostics summary{cursor:pointer;width:-moz-fit-content;width:fit-content;color:var(--text-soft);align-items:center;gap:8px;padding:4px 0;font-size:12px;display:flex}.update-operation__diagnostics summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.update-operation__diagnostics dl{gap:12px;margin:16px 0 0;display:grid}.update-operation__diagnostics code{font:11px/1.6 var(--font-mono)}@media (max-width:480px){.update-operation__header{flex-wrap:wrap;gap:10px}.update-operation__elapsed{margin-inline-start:62px}.update-operation__facts{grid-template-columns:minmax(0,1fr);gap:14px;display:grid}}@media (prefers-reduced-motion:reduce){.update-progress.is-indeterminate i{opacity:.65;animation:none}.update-operation .spin{animation:none}.update-operation .update-progress i{transition:none}}.visually-hidden{clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;width:1px!important;height:1px!important;position:fixed!important;overflow:hidden!important}.updates-unavailable{text-align:center;place-items:center;gap:16px;min-height:340px;display:grid}.updates-hero{border:1px solid color-mix(in srgb, var(--accent) 28%, var(--line));border-radius:var(--radius-lg);background:linear-gradient(145deg, color-mix(in srgb, var(--violet-soft) 32%, var(--surface)), var(--surface-muted));box-shadow:var(--shadow);grid-template-columns:minmax(0,1.4fr) minmax(260px,.6fr);gap:18px 28px;margin-bottom:14px;padding:21px;display:grid;position:relative;overflow:hidden}.updates-hero:after{display:none}.updates-hero__identity,.updates-hero__state,.updates-hero__metrics,.update-progress{z-index:1;position:relative}.updates-hero__identity{align-items:flex-start;gap:14px;display:flex}.updates-hero__identity>svg{border:1px solid color-mix(in srgb, var(--accent) 30%, var(--line));width:38px;height:38px;color:var(--accent);background:color-mix(in srgb, var(--accent) 8%, transparent);border-radius:12px;flex:none;padding:9px}.updates-hero__identity span{color:var(--accent);font:650 9px/1.2 var(--font-mono);letter-spacing:.16em;display:block}.updates-hero__identity strong{letter-spacing:-.025em;margin-top:5px;font-size:20px;display:block}.updates-hero__identity p{max-width:700px;color:var(--text-soft);margin:7px 0 0;font-size:12px;line-height:1.65}.updates-hero__state{text-align:end;grid-template-columns:auto auto;place-content:start end;gap:7px 14px;display:grid}.updates-hero__state strong{font:700 29px/1 var(--font-mono);color:var(--text)}.updates-hero__state>span:last-child{max-width:340px;color:var(--text-soft);grid-column:1/-1;font-size:11px;line-height:1.5}.update-progress{background:var(--line);border-radius:99px;grid-column:1/-1;height:5px;overflow:hidden}.update-progress i{border-radius:inherit;background:linear-gradient(90deg, var(--accent), var(--green));min-width:2px;height:100%;box-shadow:0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);transition:width .38s var(--ease-out);display:block}.updates-hero__metrics{border-top:1px solid var(--line);grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));display:grid}.updates-hero__metrics .data-row{border:0;border-inline-start:1px solid var(--line);min-width:0;padding:11px 14px 0}.updates-hero__metrics .data-row:first-child{border-inline-start:0}.update-notice{border:1px solid color-mix(in srgb, var(--green) 28%, var(--line));border-radius:var(--radius-sm);color:var(--green);background:color-mix(in srgb, var(--green) 7%, var(--surface));align-items:center;gap:9px;margin:0 0 14px;padding:11px 13px;font-size:12px;display:flex}.update-notice.is-error{border-color:color-mix(in srgb, var(--red) 35%, var(--line));color:var(--red);background:color-mix(in srgb, var(--red) 7%, var(--surface))}.updates-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:14px;display:grid}.update-source-card,.artifact-inventory,.update-distribution-card,.isp-fallback-card{grid-column:1/-1}.update-source-card{min-width:0}.artifact-kind-picker{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-bottom:11px;display:grid}.artifact-kind-picker button{border:1px solid var(--line);border-radius:var(--radius-sm);min-height:40px;color:var(--text-soft);background:var(--surface-muted);font:inherit;cursor:pointer;justify-content:center;align-items:center;gap:8px;padding:7px;font-size:11px;transition:color .2s,border-color .2s,background .2s;display:flex}.artifact-kind-picker button:hover{color:var(--text);border-color:var(--line-strong);background:var(--surface-hover)}.artifact-kind-picker button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 45%, var(--line));background:color-mix(in srgb, var(--accent) 8%, var(--surface))}.artifact-kind-picker svg{width:16px}.artifact-drop{border:1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));border-radius:var(--radius);width:100%;min-height:88px;color:var(--text);background:color-mix(in srgb, var(--accent) 3%, var(--surface-muted));font:inherit;text-align:start;cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;margin-bottom:11px;padding:15px;transition:border-color .2s,background .2s,box-shadow .2s;display:grid}.artifact-drop:hover,.artifact-drop:focus-visible{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 7%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent)}.artifact-drop>svg{width:24px;color:var(--accent)}.artifact-drop strong,.artifact-drop div span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.artifact-drop strong{font-size:12px}.artifact-drop div span{max-width:75ch;color:var(--text-muted);font:9px/1.4 var(--font-mono);margin-top:5px}.artifact-drop>span{border:1px solid var(--line);color:var(--text-soft);background:var(--surface);white-space:nowrap;border-radius:7px;padding:7px 9px;font-size:10px}.artifact-drop.is-dragging{border-style:solid;border-color:var(--violet);background:color-mix(in srgb, var(--violet-soft) 72%, var(--surface));box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--violet) 20%, transparent), 0 10px 28px #00000024}.remote-artifact-form .compact-fields{grid-template-columns:1fr 1fr}.remote-artifact-form>.button,.update-source-card>.button{justify-content:center;width:100%;margin-top:10px}.release-discovery-card{grid-column:1/-1;min-width:0}.release-discovery-form{gap:4px;display:grid}.release-discovery-form>.button,.release-selection>.button{justify-content:center;width:100%}.discovery-source-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:6px;display:grid}.discovery-source-picker button{border:1px solid var(--line);border-radius:var(--radius-sm);min-height:40px;color:var(--text-soft);background:var(--surface-muted);cursor:pointer;justify-content:center;align-items:center;gap:8px;padding:8px;font-size:10px;transition:color .2s,border-color .2s,background .2s;display:flex}.discovery-source-picker button:hover,.discovery-source-picker button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 42%, var(--line));background:color-mix(in srgb, var(--accent) 8%, var(--surface))}.discovery-source-picker svg{width:15px}.release-discovery-form .compact-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.release-discovery-form .field{min-width:0;color:var(--text-soft);flex-direction:column;gap:7px;margin:10px 0 0;font-size:10px;font-weight:580;display:flex}.release-discovery-form .field select{border:1px solid var(--line);border-radius:var(--radius-sm);width:100%;height:39px;color:var(--text);background:var(--surface-muted);outline:0;padding:0 11px;font-size:11px}.release-discovery-form .field select:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 16px var(--accent-soft)}.release-candidates{gap:6px;margin-top:15px;display:grid}.release-candidates>label{border:1px solid var(--line);border-radius:var(--radius-sm);min-height:58px;color:var(--text-soft);background:var(--surface-muted);text-align:start;cursor:pointer;grid-template-columns:auto minmax(0,1fr) minmax(92px,auto) auto;align-items:center;gap:11px;padding:9px 11px;display:grid}.release-candidates>label:hover,.release-candidates>label.is-selected{border-color:color-mix(in srgb, var(--accent) 42%, var(--line));background:color-mix(in srgb, var(--accent) 6%, var(--surface))}.release-candidates input{accent-color:var(--accent)}.release-candidates strong,.release-candidates small{display:block}.release-candidates small{color:var(--text-muted);font:8px/1.4 var(--font-mono);margin-top:4px}.release-candidates code{color:var(--accent);font:9px var(--font-mono);text-overflow:ellipsis;overflow:hidden}.release-candidates em{color:var(--text-muted);font:normal 9px var(--font-mono);white-space:nowrap}.release-selection,.release-operation{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);margin-top:14px;padding:13px}.release-selection .data-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;display:grid}.release-operation>div:first-child{grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;display:grid}.release-operation>div:first-child svg{color:var(--accent)}.release-operation>div:first-child span{color:var(--text-muted);font:9px var(--font-mono)}.release-operation .update-progress{margin:11px 0}.release-operation>p{color:var(--green);align-items:center;gap:8px;margin:11px 0 0;font-size:10px;display:flex}.release-operation>p code{min-width:0;color:var(--text-muted);text-overflow:ellipsis;overflow:hidden}.isp-fallback-card{border-color:color-mix(in srgb, var(--red) 35%, var(--line))}.isp-guidance{align-items:flex-start;gap:12px;display:flex}.isp-guidance>svg{color:var(--red);flex:none}.isp-guidance p{color:var(--text-soft);margin:0;font-size:12px;line-height:1.7}.artifact-table-wrap{margin:0 -20px;overflow-x:auto}.artifact-table{border-collapse:collapse;width:100%;min-width:900px}.artifact-table th{border-block:1px solid var(--line);color:var(--text-muted);background:var(--surface-muted);font:650 9px/1.2 var(--font-mono);letter-spacing:.08em;text-align:center;text-transform:uppercase;padding:9px 12px}.artifact-table td{border-bottom:1px solid var(--line);color:var(--text-soft);vertical-align:middle;padding:11px 12px;font-size:11px}.artifact-table tbody tr{transition:background .2s}.artifact-table tbody tr:hover,.artifact-table tbody tr.is-selected{background:color-mix(in srgb, var(--accent) 5%, transparent)}.artifact-table td strong,.artifact-table td span{display:block}.artifact-table td>span,.artifact-table td strong+span{max-width:320px;color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:3px;font-size:9px;overflow:hidden}.artifact-table td:nth-child(5),.artifact-table td:nth-child(6),.artifact-table td:nth-child(7){text-align:center;white-space:nowrap}.artifact-table input[type=radio]{accent-color:var(--accent)}.artifact-selection{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:13px;margin-top:15px;padding:13px;display:grid}.artifact-selection>div span,.artifact-selection>div strong,.artifact-selection>div code{display:block}.artifact-selection>div span{color:var(--accent);font:650 8px/1.2 var(--font-mono);letter-spacing:.12em}.artifact-selection>div strong{margin:4px 0;font-size:12px}.artifact-selection>div code{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.distribution-grid{border:1px solid var(--line);border-radius:var(--radius);background:var(--line);grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;display:grid;overflow:hidden}.distribution-grid article{background:var(--surface-muted);min-height:140px;padding:17px}.distribution-grid svg{color:var(--accent)}.distribution-grid strong{margin-top:13px;font-size:12px;display:block}.distribution-grid p{color:var(--text-soft);margin:7px 0 0;font-size:11px;line-height:1.65}.toggle-row{border:0;border-bottom:1px solid var(--line);width:100%;min-height:62px;color:inherit;text-align:start;cursor:pointer;background:0 0;grid-template-columns:1fr auto;align-items:center;gap:14px;padding:10px 0;display:grid}.toggle-row.is-disabled{cursor:not-allowed;opacity:.5}.toggle-row__copy{flex-direction:column;display:flex}.toggle-row__copy strong{color:var(--text-soft);font-size:11px}.toggle-row__copy small{color:var(--text-muted);margin-top:4px;font-size:9px;line-height:1.5}.toggle{border:1px solid var(--line-strong);background:var(--surface-muted);border-radius:6px;width:42px;height:23px;transition:background .3s,border-color .3s;position:relative}.toggle span{top:4px;background:var(--text-muted);width:13px;height:13px;transition:inset-inline-start .32s var(--ease-out), background .3s, box-shadow .3s;border-radius:3px;position:absolute;inset-inline-start:4px}.toggle-row[aria-checked=true] .toggle{background:var(--accent-soft);border-color:color-mix(in srgb, var(--accent) 45%, transparent)}.toggle-row[aria-checked=true] .toggle span{background:var(--accent);box-shadow:0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);inset-inline-start:23px}[dir=rtl] .toggle-row[aria-checked=true] .toggle span{inset-inline-start:23px}.text-field{flex-direction:column;gap:7px;min-width:0;margin:13px 0;display:flex}.text-field>label{color:var(--text-soft);font-size:10px;font-weight:580}.text-field__control{grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:8px;display:grid}.text-field__action{align-items:stretch;gap:7px;display:flex}.text-field__action .button{height:39px;min-height:39px}.text-field small{min-height:12px;color:var(--text-muted);font-size:8px;line-height:1.5}.text-field__message--contextual{opacity:0;filter:blur(1.5px);transition:opacity .24s var(--ease-out), filter .24s var(--ease-out), color .24s var(--ease-out)}.text-field:focus-within .text-field__message--contextual{opacity:1;filter:blur()}.text-field input{width:100%}.text-field.is-invalid input{border-color:color-mix(in srgb, var(--red) 68%, var(--line));box-shadow:inset 3px 0 0 color-mix(in srgb, var(--red) 75%, transparent)}.text-field.is-invalid .text-field__message{color:var(--red)}.text-field.is-valid input{border-color:color-mix(in srgb, var(--green) 44%, var(--line))}.text-field.is-valid .text-field__message{color:var(--green)}.payload-field{flex-direction:column;gap:7px;margin:13px 0;display:flex}.payload-field>span{color:var(--text-soft);font-size:10px;font-weight:580}.payload-field textarea{resize:vertical;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);width:100%;min-height:144px;color:var(--text);font-family:var(--font-mono);outline:0;padding:12px;font-size:10px;line-height:1.6;transition:border-color .2s,box-shadow .2s}.payload-field textarea:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 18px var(--accent-soft)}.integration-principles{grid-template-columns:repeat(4,1fr);gap:10px;display:grid}.integration-principles article{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);min-height:142px;padding:15px}.integration-principles svg{color:var(--accent)}.integration-principles strong{margin-top:18px;font-size:11px;display:block}.integration-principles p{color:var(--text-muted);margin:6px 0 0;font-size:9px;line-height:1.55}.local-integrations-form{grid-template-columns:1fr 1fr;gap:12px;display:grid}.integration-config-panel{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(145deg, var(--surface-muted), transparent);min-width:0;padding:16px}.integration-config-panel--wide{grid-column:1/-1}.integration-config-panel>header{border-bottom:1px solid var(--line);align-items:center;gap:10px;padding-bottom:12px;display:flex}.integration-config-panel>header>svg{color:var(--accent)}.integration-config-panel>header div{flex-direction:column;display:flex}.integration-config-panel>header strong{font-size:12px}.integration-config-panel>header small{color:var(--text-muted);letter-spacing:.08em;text-transform:uppercase;margin-top:2px;font-size:8px}.integration-config-panel--wide .setting-group{grid-template-columns:minmax(180px,.4fr) minmax(0,1fr)}.integration-config-panel--wide .toggle-row{border-bottom:0}.local-integrations-form__footer{grid-column:1/-1;justify-content:space-between;align-items:center;gap:14px;padding-top:2px;display:flex}.local-integrations-form__footer>span{color:var(--text-muted);font-size:9px;line-height:1.5}.modal-layer,.palette-layer,.mobile-drawer-layer{z-index:100;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.modal-backdrop,.palette-backdrop,.mobile-drawer-backdrop{-webkit-backdrop-filter:blur(15px)saturate(.85);backdrop-filter:blur(15px)saturate(.85);cursor:default;background:#08070aa8;border:0;width:100%;height:100%;position:absolute;inset:0}.app-preferences-layer{z-index:110;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.app-preferences-backdrop{-webkit-backdrop-filter:blur(15px)saturate(.85);backdrop-filter:blur(15px)saturate(.85);cursor:default;background:#08070aa8;border:0;width:100%;height:100%;position:absolute;inset:0}.app-preferences-dialog{z-index:1;border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:var(--surface-solid);width:min(620px,100%);max-height:min(710px,100dvh - 40px);box-shadow:var(--shadow-lg);position:relative;overflow:auto}.app-preferences-dialog>header,.app-preferences-dialog>footer{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:14px;padding:16px 20px;display:flex}.app-preferences-dialog>header>span{align-items:center;gap:9px;display:flex}.app-preferences-dialog>header svg{color:var(--accent)}.app-preferences-dialog>footer{border-top:1px solid var(--line);color:var(--text-muted);border-bottom:0;font-size:10px;line-height:1.5}.app-preferences-tabs{border-bottom:1px solid var(--line);background:var(--surface-muted);gap:5px;padding:12px 20px;display:flex}.app-preferences-tabs button{border-radius:var(--radius-sm);min-height:32px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;align-items:center;gap:7px;padding:0 11px;display:inline-flex}.app-preferences-tabs button:hover,.app-preferences-tabs button:focus-visible,.app-preferences-tabs button.is-active{border-color:var(--line-strong);background:var(--surface-solid);color:var(--text);outline:0}.app-preferences-tabs button.is-active{color:var(--accent)}.app-preferences-content{gap:0;padding:8px 20px 14px;display:grid}.app-preferences-content>p{color:var(--text-muted);margin:8px 0 12px;font-size:11px;line-height:1.6}.app-preferences-select{border-bottom:1px solid var(--line);color:var(--text-soft);justify-content:space-between;align-items:center;gap:16px;padding:12px 0;font-size:11px;font-weight:580;display:flex}.app-preferences-select>span{align-items:center;gap:8px;display:inline-flex}.app-preferences-select svg{color:var(--accent)}.app-preferences-select select{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:150px;color:var(--text);font:inherit;padding:8px 10px}@media (max-width:560px){.app-preferences-layer{padding:0}.app-preferences-dialog{border-inline:0;border-radius:0;width:100vw;height:100dvh;max-height:100dvh}.app-preferences-tabs{overflow-x:auto}}.modal{border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:linear-gradient(145deg, var(--glass-strong), var(--surface-solid));width:min(460px,100vw - 32px);padding:28px;position:relative;overflow:hidden;box-shadow:0 38px 100px #00000073}.modal:after{content:"";inset-inline:0;background:linear-gradient(90deg, transparent, var(--accent), transparent);height:2px;position:absolute;top:0}.modal--danger:after{background:linear-gradient(90deg, transparent, var(--red), transparent)}.modal__close{top:13px;position:absolute;inset-inline-end:13px}.modal__signal{border:1px solid color-mix(in srgb, var(--accent) 34%, transparent);border-radius:var(--radius);background:var(--accent-soft);width:50px;height:50px;color:var(--accent);place-items:center;margin-bottom:18px;display:grid}.modal--danger .modal__signal{border-color:color-mix(in srgb, var(--red) 34%, transparent);background:var(--red-soft);color:var(--red)}.modal h2{letter-spacing:-.03em;margin:0;font-size:20px}.modal p{margin:10px 0 24px;font-size:11px;line-height:1.7}.modal__actions{justify-content:flex-end;gap:8px;display:flex}.toast-stack{z-index:120;inset-inline-end:20px;pointer-events:none;flex-direction:column;gap:8px;width:min(380px,100vw - 40px);display:flex;position:fixed;bottom:20px}.toast{border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--glass-strong);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:65px;box-shadow:var(--shadow);pointer-events:auto;grid-template-columns:3px 1fr auto;align-items:center;gap:12px;padding:10px 10px 10px 0;display:grid;position:relative;overflow:hidden}[dir=rtl] .toast{padding:10px 0 10px 10px}.toast__rail{background:var(--accent);box-shadow:0 0 12px var(--accent);align-self:stretch}.toast--success .toast__rail{background:var(--green)}.toast--warning .toast__rail{background:var(--amber)}.toast--danger .toast__rail{background:var(--red)}.toast__body{min-width:0}.toast strong{font-size:11px;display:block}.toast p{color:var(--text-muted);margin:4px 0 0;font-size:9px;line-height:1.45}.toast button{width:28px;height:28px;color:var(--text-muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;display:grid}.toast__correlation{color:var(--text-muted);overflow-wrap:anywhere;gap:6px;margin-top:7px;font-size:9px;display:flex}.toast__correlation span{color:var(--text-faint);font-family:var(--font-ui)}.toast__action-context{border:1px solid var(--line);background:var(--surface-raised);border-radius:6px;gap:3px;margin-top:8px;padding:7px 9px;display:grid}.toast__action-context span{color:var(--text-muted);font-size:9px}.toast__action-context code{color:var(--text);overflow-wrap:anywhere;font-size:9px}.toast__progress{gap:6px;margin-top:8px;display:grid}.toast__progress>div:first-child{color:var(--text-muted);justify-content:space-between;gap:10px;font-size:9px;display:flex}.toast__progress bdi{color:var(--text);font:600 9px var(--font-mono)}.toast__progress .update-progress{height:4px}.palette{border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:var(--glass-strong);-webkit-backdrop-filter:blur(28px)saturate(1.2);backdrop-filter:blur(28px)saturate(1.2);flex-direction:column;width:min(650px,100vw - 30px);max-height:min(720px,100dvh - 40px);display:flex;position:relative;overflow:hidden;box-shadow:0 40px 120px #00000080}.palette>header{border-bottom:1px solid var(--line);color:var(--accent);grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:15px 17px;display:grid}.palette>header input{color:var(--text);background:0 0;border:0;outline:0;font-size:13px}.palette__results{padding:9px;overflow:auto}.palette__label{color:var(--text-muted);font:650 8px var(--font-mono);letter-spacing:.15em;padding:10px 9px 6px;display:block}.palette__results button{border-radius:var(--radius-sm);width:100%;min-height:51px;color:var(--text-soft);text-align:start;cursor:pointer;background:0 0;border:1px solid #0000;grid-template-columns:34px 1fr 20px;align-items:center;gap:9px;padding:7px 9px;display:grid}.palette__results button:hover{border-color:var(--line);background:var(--surface-hover)}.palette__results button>svg:first-child{color:var(--text-muted)}.palette__results button div{flex-direction:column;display:flex}.palette__results strong{font-size:11px}.palette__results small{color:var(--text-muted);margin-top:3px;font-size:9px}.palette__results .is-visible{color:var(--green)}.palette__results button>svg:last-child:not(.is-visible){opacity:0}.palette>footer{border-top:1px solid var(--line);color:var(--text-muted);align-items:center;gap:16px;padding:10px 16px;font-size:8px;display:flex}.palette>footer span{align-items:center;gap:5px;display:flex}.palette>footer span:last-child{margin-inline-start:auto}.palette__results button.is-highlighted{border-color:color-mix(in srgb, var(--accent) 26%, var(--line));background:linear-gradient(90deg, var(--accent-soft), var(--surface-hover));box-shadow:inset 2px 0 var(--accent)}.palette__results button.is-highlighted>svg:first-child{color:var(--accent);filter:drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 55%, transparent))}[dir=rtl] .palette__results button.is-highlighted{box-shadow:inset -2px 0 var(--accent)}.topbar-audio[aria-pressed=true]{color:var(--text-muted);background:var(--surface-muted)}.topbar-audio[aria-pressed=false]{color:var(--accent)}.setting-icon-label{align-items:center;gap:7px;display:inline-flex}.setting-icon-label svg{color:var(--accent)}.boot-gate{z-index:200;color:#f5f2f7;isolation:isolate;background:linear-gradient(121deg,#0000 0 63%,#a78bfa0b 63.1% 63.3%,#0000 63.4%),linear-gradient(155deg,#09090c 0%,#17151c 47%,#111016 72%,#09090c 100%);grid-template-rows:1fr auto auto minmax(24px,.34fr);place-items:center;gap:clamp(18px,3vh,30px);min-width:320px;padding:clamp(24px,5vw,62px);display:grid;position:fixed;inset:0;overflow:hidden}.boot-gate:before{content:"";z-index:-1;background:linear-gradient(90deg,#0000,#b8a1ff17,#ffffff06,#0000);width:27%;animation:4.8s cubic-bezier(.65,0,.35,1) infinite boot-light-blade;position:absolute;top:-20%;bottom:-20%;left:-38%;transform:skew(-18deg)}.boot-gate:after{content:"";z-index:-1;inset-inline:7vw;opacity:.7;background:linear-gradient(90deg,#0000,#b8a1ff42,#0000);height:1px;animation:2.8s ease-in-out infinite boot-horizon;position:absolute;top:62%}.boot-fuji{filter:drop-shadow(0 30px 62px #0000006b);align-self:end;width:min(540px,78vw);height:clamp(180px,28vh,280px);position:relative}.boot-fuji>span{transform-origin:bottom;position:absolute;inset:0}.boot-fuji__rear{clip-path:polygon(0 100%,20% 72%,32% 76%,51% 9%,66% 63%,79% 57%,100% 100%);animation:boot-mountain-reveal 1.1s var(--ease-out) both;background:linear-gradient(138deg,#7a72891a,#2a273180)}.boot-fuji__face{clip-path:polygon(3% 100%,50% 8%,97% 100%);animation:boot-mountain-reveal 1.15s var(--ease-out) 80ms both;background:linear-gradient(132deg,#4a4652 0%,#292631 46%,#17151d 47% 100%);inset:7% 7% 0!important}.boot-fuji__snow{clip-path:polygon(37% 34%,50% 8%,63% 34%,58% 31%,54% 39%,50% 31%,46% 39%,42% 31%);animation:boot-snow-reveal .9s var(--ease-out) .6s both;background:linear-gradient(130deg,#f2eff5,#c8c1d2 48%,#71677f 49%);inset:7% 7% 0!important}.boot-fuji__trace{clip-path:polygon(2.5% 100%,49.4% 7%,50.6% 7%,97.5% 100%,96.7% 100%,50% 10%,3.3% 100%);opacity:.68;background:linear-gradient(90deg,#0000,#b8a1ff 48%,#e4dcff 51%,#0000);animation:2.4s ease-in-out infinite boot-trace;inset:7% 7% 0!important}.boot-identity{grid-template-columns:48px auto;align-items:center;gap:15px;margin-top:-8px;display:grid}.boot-identity .brand__mark{color:#d8ccff;background:linear-gradient(145deg,#a78bfa29,#0000 76%);border-color:#b8a1ff6b;width:46px;height:46px;box-shadow:inset 0 0 22px #a78bfa14,0 0 30px #a78bfa14}.boot-identity>div:last-child{flex-direction:column;display:flex}.boot-identity span{color:#91889d;font:650 9px var(--font-mono);letter-spacing:.18em}.boot-identity h1{letter-spacing:-.045em;margin:5px 0 0;font-size:clamp(22px,3.2vw,36px);font-weight:620}.boot-status{width:min(430px,100vw - 48px)}.boot-status>div:first-child{color:#aaa2b2;justify-content:space-between;align-items:center;gap:18px;font-size:11px;display:flex}.boot-status b{color:#e4dcff;font:600 10px var(--font-mono)}.boot-progress{clip-path:polygon(0 0,100% 0,calc(100% - 5px) 100%,5px 100%);background:#a78bfa1f;height:3px;margin-top:9px;position:relative;overflow:hidden}.boot-progress span{transition:inline-size .34s var(--ease-out);background:linear-gradient(90deg,#7358ba,#a78bfa 68%,#eadfff);position:absolute;inset-block:0;inset-inline-start:0;box-shadow:0 0 16px #a78bfa80}.boot-entry{opacity:0;pointer-events:none;clip-path:inset(0 50%);filter:blur(6px);width:min(540px,100vw - 48px);transition:opacity .55s ease, clip-path .72s var(--ease-out), filter .55s ease;grid-template-columns:1fr 1fr;align-self:start;gap:9px;display:grid}.boot-entry.is-ready{opacity:1;pointer-events:auto;clip-path:inset(0);filter:blur()}.boot-entry small{color:#8b8493;text-align:center;grid-column:1/-1;font-size:9px;line-height:1.55}.hotkey-layer{z-index:190;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.hotkey-help{border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:linear-gradient(145deg, var(--glass-strong), var(--surface-solid));-webkit-backdrop-filter:blur(28px)saturate(1.18);backdrop-filter:blur(28px)saturate(1.18);width:min(620px,100vw - 30px);max-height:calc(100dvh - 40px);padding:24px;position:relative;overflow:auto;box-shadow:0 40px 120px #00000080}.hotkey-help:before{content:"";inset-inline:0;background:linear-gradient(90deg, transparent, var(--accent), transparent);height:2px;position:absolute;top:0}.hotkey-help>header{justify-content:space-between;align-items:center;display:flex}.hotkey-help>header>span{color:var(--accent);align-items:center;gap:8px;display:inline-flex}.hotkey-help>header i{font:650 9px var(--font-mono);letter-spacing:.16em;font-style:normal}.hotkey-help h2{letter-spacing:-.035em;margin:22px 0 0;font-size:23px}.hotkey-help>p{color:var(--text-muted);margin:8px 0 19px;font-size:11px;line-height:1.7}.hotkey-list{gap:5px;display:grid}.hotkey-list>div{border:1px solid #0000;border-bottom-color:var(--line);min-height:49px;color:var(--text-soft);grid-template-columns:minmax(180px,.43fr) 1fr;align-items:center;gap:14px;padding:8px 10px;display:grid}.hotkey-list kbd{color:var(--accent);white-space:nowrap;justify-self:start}.hotkey-list span{font-size:11px;line-height:1.55}@keyframes boot-light-blade{0%,14%{opacity:0;transform:translate(0)skew(-18deg)}30%{opacity:1}66%,to{opacity:0;transform:translate(620vw)skew(-18deg)}}@keyframes boot-horizon{50%{opacity:.28;filter:brightness(1.7)}}@keyframes boot-mountain-reveal{0%{opacity:0;clip-path:polygon(50% 100%,50% 100%,50% 100%);filter:blur(12px)}}@keyframes boot-snow-reveal{0%{opacity:0;clip-path:polygon(50% 8%,50% 8%,50% 8%)}}@keyframes boot-trace{50%{opacity:.22;filter:brightness(1.7)drop-shadow(0 0 6px #c29bea)}}.mobile-bottom-nav,.mobile-drawer-layer{display:none}@media (max-width:1180px){.metric-grid{grid-template-columns:1fr 1fr}.dashboard-layout-grid{grid-template-columns:1fr}.dashboard-layout-grid>[data-layout-card-id=telemetry],.dashboard-layout-grid>[data-layout-card-id=outputs],.dashboard-layout-grid>[data-layout-card-id=events]{grid-area:auto}.control-layout{grid-template-columns:1fr}.relay-control-card{grid-row:auto}.console-card{grid-column:auto}.workbench-grid>.card-layout-frame{grid-column:span 6}.workbench-grid>[data-layout-card-id=terminal]{grid-column:1/-1}.device-layout{grid-template-columns:1fr}.device-stage{min-height:360px}.integration-principles{grid-template-columns:1fr 1fr}.local-integrations-form{grid-template-columns:1fr}.local-integrations-form__footer{grid-column:auto}.updates-hero__metrics{grid-template-columns:1fr 1fr}.updates-hero__metrics .data-row:nth-child(3){border-inline-start:0}}@media (max-width:920px){.app-shell,.app-shell.is-sidebar-compact{grid-template:var(--topbar-height) minmax(0, 1fr) / 1fr}.sidebar{display:none}.topbar,.app-main{grid-column:1}.mobile-menu{display:grid}.breadcrumbs{min-width:0}.command-trigger{width:auto;margin:0 0 0 auto;padding-inline:10px}.command-trigger span{display:none}[dir=rtl] .command-trigger{margin:0 auto 0 0}.topbar{gap:10px;padding-inline:15px}.topbar__actions>span .status-badge,.topbar__actions>.status-badge{display:none}.mobile-drawer-layer{place-items:stretch start;padding:0;display:grid}.mobile-drawer{border-inline-end:1px solid var(--line-strong);background:var(--glass-strong);-webkit-backdrop-filter:blur(26px);backdrop-filter:blur(26px);width:min(320px,88vw);height:100%;padding:14px;position:relative;box-shadow:20px 0 80px #0006}.mobile-drawer>header{grid-template-columns:42px 1fr auto;align-items:center;gap:10px;height:55px;margin-bottom:18px;display:grid}.mobile-drawer>header button{background:var(--surface-muted);width:34px;height:34px;color:var(--text-muted);border:0;border-radius:8px;place-items:center;display:grid}.mobile-drawer .nav-button{margin-bottom:3px}[dir=rtl] .mobile-drawer-layer{place-items:stretch start}[dir=rtl] .mobile-drawer{box-shadow:-20px 0 80px #0006}}@media (max-width:720px){:root{--topbar-height:58px}body{background-size:auto}.topbar{position:relative}.breadcrumbs span,.breadcrumbs i{display:none}.breadcrumbs strong{font-size:11px}.topbar__actions{gap:2px}.topbar-icon{width:31px;height:31px}.command-trigger kbd{display:none}.app-main{padding-bottom:70px}.page{padding:20px 13px 35px}.section-title{align-items:flex-start;margin-bottom:17px}.section-title h1{font-size:27px}.section-title p{font-size:11px}.section-title__action .button{display:none}.section-title__action .card-layout-editor__toggle,.section-title__action .card-layout-editor .button{display:inline-flex}.card-layout-editor{width:auto;max-height:calc(100dvh - 138px);position:fixed;inset-block-start:118px;inset-inline:13px;overflow:auto}.hero-panel{grid-template-columns:1fr;min-height:230px;padding:23px 20px}.hero-panel__readout{border-inline-start:0;border-top:1px solid var(--line);min-width:0;padding:10px 0 0}.metric-grid{grid-template-columns:1fr 1fr;gap:9px}.metric{min-height:152px;padding-inline:13px}.metric__value strong{font-size:21px}.metric__detail{display:none}.telemetry-chart__toolbar{flex-direction:column;align-items:stretch}.telemetry-chart__toolbar .segmented{width:100%}.telemetry-chart__toolbar .segmented button{flex:1}.telemetry-chart__canvas{height:270px}.output-matrix,.relay-bank{grid-template-columns:repeat(2,1fr)}.action-grid,.motion-side{grid-template-columns:1fr}.motion-side__identity{grid-column:1/-1}.channel-selector{grid-template-columns:repeat(8,1fr)}.pwm-mixer__row{grid-template-columns:1fr}.pwm-mixer__actions{justify-content:flex-end}.system-output-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.workbench-grid{grid-template-columns:1fr;gap:10px}.workbench-grid>.card-layout-frame,.workbench-grid>[data-layout-card-id=terminal]{grid-column:1}.workbench-grid>[data-layout-card-id=terminal]{min-height:390px}.terminal-transcript{min-height:190px}.terminal-event-strip{grid-template-columns:repeat(5,minmax(145px,1fr))}.compact-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-fields .text-field:first-child{grid-column:1/-1}.device-stage{min-height:0}.device-overview{grid-template-columns:68px minmax(0,1fr)}.device-overview__mark{border-radius:18px;width:68px;height:68px}.device-facts,.device-actions,.message-compose{grid-template-columns:1fr}.beep-row{flex-wrap:wrap}.beep-row>div{flex-basis:100%}.subnav{width:100%;overflow-x:auto}.subnav button{white-space:nowrap;flex:1}.records-card .card__header{flex-direction:column}.table-footer{flex-wrap:wrap}.table-footer span:last-child{display:none}.typed-collection__toolbar{align-items:stretch}.typed-collection__search{flex-basis:100%;min-width:100%}.typed-collection__summary{margin-inline-end:auto}.typed-collection__popover-panel{width:auto;max-height:calc(100dvh - 92px);position:fixed;inset-block-start:72px;inset-inline:13px}.typed-collection__window-nav{grid-template-columns:1fr 1fr}.typed-collection__window-nav>span{grid-area:1/1/auto/-1}.typed-collection__window-nav button{grid-row:2}.typed-collection__viewport,.events-page-card .typed-collection__viewport{max-height:calc(100dvh - 330px)}.catalog-grid,.operations-grid,.system-grid,.settings-grid{grid-template-columns:1fr}.settings-card--wide,.operation-result,.system-grid .card:last-child{grid-column:auto}.setting-group,.integration-config-panel--wide .setting-group{grid-template-columns:1fr}.integration-config-panel--wide .segmented{overflow-x:auto}.integration-principles{grid-template-columns:1fr}.local-integrations-form__footer,.peripheral-names-card__footer,.illumination-settings-card__footer{flex-direction:column;align-items:stretch}.local-integrations-form__footer .button,.peripheral-names-card__footer .button,.illumination-settings-card__footer .button{justify-content:center}.peripheral-name-grid{grid-template-columns:1fr}.illumination-state-grid{grid-template-columns:1fr 1fr}.event-toolbar{flex-direction:column;align-items:stretch}.event-toolbar .segmented{overflow-x:auto}.updates-hero{grid-template-columns:1fr;padding:17px}.updates-hero__state{text-align:start;justify-content:stretch}.updates-hero__state>span:last-child{max-width:none}.updates-grid{grid-template-columns:1fr}.update-source-card,.release-discovery-card,.artifact-inventory,.update-distribution-card,.isp-fallback-card{grid-column:1}.artifact-kind-picker{grid-template-columns:1fr}.artifact-drop{grid-template-columns:auto minmax(0,1fr)}.artifact-drop>span{display:none}.remote-artifact-form .compact-fields,.release-discovery-form .compact-fields,.discovery-source-picker{grid-template-columns:1fr}.release-candidates>label{grid-template-columns:auto minmax(0,1fr) auto}.release-candidates code{display:none}.release-selection .data-list{grid-template-columns:1fr}.artifact-selection{grid-template-columns:1fr auto}.artifact-selection>.button{grid-column:1/-1;justify-content:center}.distribution-grid{grid-template-columns:1fr}.mobile-bottom-nav{z-index:50;inset-inline:0;height:calc(62px + env(safe-area-inset-bottom));padding:5px 7px env(safe-area-inset-bottom);border-top:1px solid var(--line-strong);background:var(--glass-strong);-webkit-backdrop-filter:blur(24px)saturate(1.2);backdrop-filter:blur(24px)saturate(1.2);grid-template-columns:repeat(5,1fr);display:grid;position:fixed;bottom:0}.mobile-bottom-nav button{color:var(--text-muted);background:0 0;border:0;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:3px;font-size:8px;display:flex;position:relative}.mobile-bottom-nav button:before{content:"";background:var(--accent);width:24px;height:2px;box-shadow:0 0 9px var(--accent);transition:scale .3s var(--ease-out);position:absolute;top:-5px;scale:0 1}.mobile-bottom-nav button.is-active{color:var(--accent);background:var(--accent-soft)}.mobile-bottom-nav button.is-active:before{scale:1}.palette-layer,.modal-layer{padding:10px}.palette{max-height:calc(100dvh - 20px)}.palette>footer{display:none}.toast-stack{inset-inline:10px;width:auto;bottom:75px}.boot-gate{grid-template-rows:1fr auto auto minmax(18px,.28fr);gap:16px;padding:20px 18px}.boot-fuji{width:min(520px,96vw);height:clamp(160px,26vh,230px)}.boot-identity{grid-template-columns:42px minmax(0,1fr);gap:11px}.boot-identity .brand__mark{width:40px;height:40px}.boot-identity span{letter-spacing:.12em;font-size:7px}.boot-identity h1{font-size:22px}.boot-entry{grid-template-columns:1fr;width:min(420px,100vw - 32px)}.boot-entry small{grid-column:1}.hotkey-layer{padding:10px}.hotkey-help{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:19px}.hotkey-list>div{grid-template-columns:1fr;gap:7px;padding-block:10px}.hotkey-help h2{font-size:20px}}@media (max-width:460px){.metric-grid{grid-template-columns:1fr}.metric{min-height:145px}.output-matrix,.relay-bank{grid-template-columns:1fr 1fr}.channel-selector{grid-template-columns:repeat(4,1fr)}.header-actions .status-badge{display:none}.card{border-radius:var(--radius);padding:16px}.records-card{padding-inline:0}.records-card .card__header{padding-inline:16px}.topbar__actions .topbar-icon:nth-of-type(2){display:none}.typed-collection__toolbar{padding-inline:9px}.typed-collection__summary{display:none}.typed-collection__quiet-action{order:4}.typed-collection__popover{flex:1}.typed-collection__popover>summary{justify-content:center;width:100%}.typed-collection__column-option{grid-template-columns:minmax(120px,1fr) auto}.typed-collection__grid td,.typed-collection__window-nav{padding-inline:8px}.typed-collection__window-nav button{font-size:0}.typed-collection__window-nav button svg{width:17px;height:17px}.events-page-card .typed-collection{margin-block-end:-16px;margin-inline:-16px}.events-page-card .typed-collection__toolbar{padding-inline:9px}.updates-hero__metrics{grid-template-columns:1fr}.updates-hero__metrics .data-row{border-inline-start:0}.artifact-table-wrap{margin-inline:-16px}.artifact-selection{grid-template-columns:1fr}.artifact-selection .status-badge{justify-self:start}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}.inline-error-presence{will-change:auto;clip-path:none!important;filter:none!important}}.page-loading{min-height:14rem;color:var(--text-muted);letter-spacing:.04em;place-content:center;justify-items:center;gap:.85rem;display:grid}.page-loading .spinner{border:2px solid color-mix(in srgb, var(--accent) 22%, transparent);border-top-color:var(--accent);border-radius:50%;width:1.65rem;height:1.65rem;animation:.8s linear infinite spin}.reduce-motion *,.reduce-motion :before,.reduce-motion :after{scroll-behavior:auto!important;transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}.reduce-motion .inline-error-presence{will-change:auto;clip-path:none!important;filter:none!important}@media (prefers-contrast:more){:root{--line:#e2dceb52;--line-strong:#e2dceb8c;--text-soft:#e5e0e9;--text-muted:#c1b8c8}:root[data-theme=light]{--line:#2d28334d;--line-strong:#2d28338c;--text-soft:#49434f;--text-muted:#655d6c}}.advanced-surface{border-top:1px solid var(--line-strong);margin-top:22px;padding-top:24px;position:relative}.advanced-surface:before{content:"";inset-inline-start:0;background:linear-gradient(90deg, var(--accent), transparent);width:min(260px,42%);height:1px;box-shadow:0 0 16px color-mix(in srgb, var(--accent) 44%, transparent);position:absolute;top:-1px}.advanced-heading{justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:16px;display:flex}.advanced-heading>div{max-width:790px}.advanced-heading>div>span{color:var(--accent);font:650 8px var(--font-mono);letter-spacing:.18em}.advanced-heading h2{color:var(--text);letter-spacing:-.035em;margin:6px 0 0;font-size:clamp(20px,2.5vw,29px);font-weight:620}.advanced-heading p{color:var(--text-muted);margin:7px 0 0;font-size:11px;line-height:1.72}.advanced-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:10px;display:grid}.advanced-panel{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 30%, transparent), transparent 31%), color-mix(in srgb, var(--glass) 94%, transparent);-webkit-backdrop-filter:blur(17px)saturate(1.08);backdrop-filter:blur(17px)saturate(1.08);min-width:0;transition:border-color .28s,background .34s,box-shadow .34s;position:relative;overflow:hidden;box-shadow:inset 0 1px #ffffff06}.advanced-panel:before{content:"";z-index:0;inset-inline-start:0;background:linear-gradient(var(--accent), transparent);opacity:.46;width:2px;height:62px;transition:height .48s var(--ease-out), opacity .3s;position:absolute;top:0}.advanced-panel[open]{border-color:color-mix(in srgb, var(--accent) 20%, var(--line));background:linear-gradient(128deg, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent 34%), color-mix(in srgb, var(--glass-strong) 95%, transparent);box-shadow:inset 0 1px #ffffff09,0 16px 42px #00000017}.advanced-panel[open]:before{opacity:.72;height:100%}.advanced-panel__summary{z-index:1;cursor:pointer;-webkit-user-select:none;user-select:none;grid-template-columns:38px minmax(0,1fr) auto 18px;align-items:center;gap:11px;min-height:82px;padding:13px 15px;list-style:none;display:grid;position:relative}.advanced-panel__summary::-webkit-details-marker{display:none}.advanced-panel__summary:after{content:"";z-index:-1;background:linear-gradient(103deg, var(--accent-soft), transparent 62%);clip-path:inset(0 100% 0 0);opacity:.7;transition:clip-path .45s var(--ease-out);position:absolute;inset:0}.advanced-panel__summary:hover:after,.advanced-panel__summary:focus-visible:after{clip-path:inset(0)}.advanced-panel__summary:focus-visible{outline:1px solid var(--accent);outline-offset:-3px}.advanced-panel__icon{border:1px solid color-mix(in srgb, var(--accent) 22%, var(--line));background:color-mix(in srgb, var(--accent-soft) 58%, var(--surface-muted));width:36px;height:36px;color:var(--accent);box-shadow:inset 0 0 16px color-mix(in srgb, var(--accent-soft) 65%, transparent);border-radius:9px;place-items:center;display:grid}.advanced-panel__copy{flex-direction:column;min-width:0;display:flex}.advanced-panel__copy small{color:var(--accent);font:630 7px var(--font-mono);letter-spacing:.14em}.advanced-panel__copy strong{color:var(--text);letter-spacing:-.012em;margin-top:4px;font-size:12px;font-weight:620}.advanced-panel__copy>span{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:3px;font-size:9px;line-height:1.45;overflow:hidden}.advanced-panel__chevron{color:var(--text-muted);transition:rotate .42s var(--ease-out), color .25s}.advanced-panel[open] .advanced-panel__chevron{color:var(--accent);rotate:180deg}.advanced-panel__body{z-index:1;border-top:1px solid var(--line);animation:advanced-unfold .42s var(--ease-out) both;padding:15px;position:relative}.front-panel-live{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 82%, transparent);align-items:center;gap:16px;margin-bottom:13px;padding:13px;display:flex}.front-panel-live>div:last-child{gap:3px;min-width:0;display:grid}.front-panel-live strong{color:var(--text);font-size:12px}.front-panel-live span,.front-panel-live small{color:var(--text-muted);font-size:10px}.live-segment-preview{border:1px solid color-mix(in srgb, var(--amber) 24%, var(--line));background:#151218;border-radius:9px;flex:none;gap:3px;padding:7px 9px;display:flex;box-shadow:inset 0 0 18px #000000b8}.live-segment-preview svg{width:28px;height:44px;overflow:visible}.live-segment-preview line{stroke:#c2b5cd29;stroke-width:5px;stroke-linecap:round;transition:stroke 80ms,filter 80ms}.live-segment-preview circle{fill:#c2b5cd29;transition:fill 80ms,filter 80ms}.live-segment-preview .is-lit{stroke:var(--amber);fill:var(--amber);filter:drop-shadow(0 0 4px color-mix(in srgb, var(--amber) 70%, transparent))}.advanced-actions,.advanced-inline-actions,.advanced-review__actions{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.advanced-actions+.advanced-fields,.advanced-actions+.advanced-toggle-stack,.advanced-actions+.advanced-note{margin-top:13px}.advanced-inline-actions{align-self:end}.advanced-fields{align-items:start;gap:9px;display:grid}.advanced-fields>.button{align-self:start;height:39px;min-height:39px;margin-top:30px}.advanced-fields--split{grid-template-columns:minmax(150px,1fr) minmax(170px,auto)}.advanced-fields--program{grid-template-columns:minmax(210px,1fr) minmax(170px,.8fr) auto;margin-top:12px}.advanced-fields--layout{grid-template-columns:.45fr 1fr auto;margin-top:12px}.advanced-fields--pixel{grid-template-columns:1.2fr repeat(3,minmax(72px,.65fr))}.advanced-fields--record{grid-template-columns:1fr .75fr .65fr auto;margin-top:12px}.advanced-fields--i2c{grid-template-columns:.7fr .7fr .7fr 1.4fr;margin-top:12px}.advanced-fields--message{grid-template-columns:minmax(130px,.42fr) minmax(190px,1fr) auto}.advanced-fields--history{grid-template-columns:minmax(120px,.65fr) minmax(120px,.65fr) auto auto;align-items:end}.advanced-field{min-width:0;margin:10px 0 0}.advanced-field>label{color:var(--text-soft);margin-bottom:7px;font-size:10px;font-weight:560;display:block}.advanced-field .segmented{max-width:100%;overflow-x:auto}.advanced-field .segmented button{flex:1;min-width:max-content}.advanced-control-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);grid-template-columns:minmax(190px,1.1fr) minmax(180px,1fr) auto;align-items:center;gap:14px;margin-top:13px;padding:8px 10px;display:grid}.advanced-control-row .toggle-row{border:0;min-height:48px;padding:4px 0}.advanced-control-row .range-field{margin:4px 0}.advanced-toggle-stack{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.advanced-toggle-stack .toggle-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-height:68px;padding:8px 10px}.advanced-toggle-stack--compact{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-toggle-stack--compact .toggle-row{min-height:52px}.network-device-directory{gap:10px;margin-top:12px;display:grid}.network-device{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 84%, transparent);border-radius:14px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;padding:12px;display:grid}.network-device strong,.network-device small{display:block}.network-device small{color:var(--text-muted);direction:ltr;margin-top:3px}.network-device p{color:var(--text-muted);grid-column:1/-1;margin:0}.network-device .button{justify-self:end}.advanced-nav-pad{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg-deep);grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:12px;padding:7px;display:grid}.advanced-nav-pad .button{font-family:var(--font-mono);text-transform:uppercase;justify-content:center}.advanced-divider{background:linear-gradient(90deg, var(--line-strong), var(--line), transparent);height:1px;margin:15px 0 4px}.advanced-command-inline{border:1px solid var(--line);background:var(--bg-deep);min-width:0;color:var(--accent);font:9px/1.6 var(--font-mono);scrollbar-width:thin;border-radius:7px;margin:11px 0;padding:9px 11px;overflow-x:auto}.advanced-command-inline code{white-space:nowrap}.advanced-note{border-inline-start:2px solid var(--amber);background:var(--amber-soft);color:var(--text-muted);margin:12px 0 0;padding:9px 11px;font-size:9px;line-height:1.65}.advanced-note--safe{border-inline-start-color:var(--green);background:var(--green-soft)}.advanced-form{gap:9px;display:grid}.advanced-service-output{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg-deep);min-height:124px;max-height:320px;color:var(--text-soft);font:9px/1.65 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:13px 0 0;padding:12px;overflow:auto}.advanced-review{border:1px solid color-mix(in srgb, var(--amber) 28%, var(--line));border-radius:var(--radius);background:linear-gradient(115deg, color-mix(in srgb, var(--amber-soft) 62%, transparent), transparent 45%), var(--glass-strong);-webkit-backdrop-filter:blur(20px)saturate(1.12);backdrop-filter:blur(20px)saturate(1.12);margin-top:12px;padding:16px;position:relative;overflow:hidden;box-shadow:inset 0 1px #ffffff08}.advanced-review:before{content:"";inset-inline:0;background:linear-gradient(90deg, transparent, var(--amber), transparent);opacity:.75;height:2px;position:absolute;top:0}.advanced-review--danger{border-color:color-mix(in srgb, var(--red) 35%, var(--line));background:linear-gradient(115deg, var(--red-soft), transparent 48%), var(--glass-strong)}.advanced-review--danger:before{background:linear-gradient(90deg, transparent, var(--red), transparent)}.advanced-review>header{grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:11px;display:grid}.advanced-review__icon{border:1px solid color-mix(in srgb, var(--amber) 30%, var(--line));background:var(--amber-soft);width:36px;height:36px;color:var(--amber);border-radius:9px;place-items:center;display:grid}.advanced-review--danger .advanced-review__icon{border-color:color-mix(in srgb, var(--red) 35%, var(--line));background:var(--red-soft);color:var(--red)}.advanced-review>header small{color:var(--amber);font:650 7px var(--font-mono);letter-spacing:.16em}.advanced-review--danger>header small{color:var(--red)}.advanced-review h3{color:var(--text);margin:4px 0 0;font-size:13px;font-weight:620}.advanced-review__command{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--bg-deep);color:var(--text-soft);font:10px/1.65 var(--font-mono);grid-template-columns:auto minmax(0,1fr);align-items:start;gap:9px;margin-top:13px;padding:11px 12px;display:grid}.advanced-review__command>span{color:var(--accent);font-weight:700}.advanced-review__command code{overflow-wrap:anywhere;-webkit-user-select:all;user-select:all;min-width:0}.advanced-review>p{color:var(--text-muted);margin:10px 0 0;font-size:10px;line-height:1.65}.advanced-review__actions{margin-top:13px}.advanced-review__blocked{color:var(--amber);font:9px var(--font-mono)}.advanced-footnote{color:var(--text-muted);align-items:flex-start;gap:9px;margin-top:10px;padding:10px 12px;font-size:9px;line-height:1.6;display:flex}.advanced-footnote svg{color:var(--accent);flex:none;margin-top:1px}@keyframes advanced-unfold{0%{opacity:0;clip-path:inset(0 0 100%);filter:blur(4px)}to{opacity:1;clip-path:inset(0);filter:blur()}}@media (max-width:1180px){.advanced-grid{grid-template-columns:1fr}}@media (max-width:720px){.advanced-heading{flex-direction:column;gap:12px}.advanced-panel__summary{grid-template-columns:34px minmax(0,1fr) 16px;padding:12px}.advanced-panel__summary .status-badge{display:none}.advanced-panel__copy>span{white-space:normal}.advanced-panel__body{padding:12px}.advanced-fields--split,.advanced-fields--program,.advanced-fields--layout,.advanced-fields--record,.advanced-fields--message,.advanced-fields--history{grid-template-columns:1fr}.advanced-fields>.button{margin-top:0}.advanced-fields--pixel,.advanced-fields--i2c{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-control-row{grid-template-columns:1fr;gap:6px}.advanced-toggle-stack{grid-template-columns:1fr}.advanced-inline-actions{align-self:auto}.advanced-nav-pad{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-review>header{grid-template-columns:34px minmax(0,1fr)}.advanced-review>header .status-badge{grid-column:1/-1;justify-self:start}}@media (max-width:460px){.advanced-actions .button,.advanced-inline-actions .button,.advanced-review__actions .button{flex:1;justify-content:center;min-width:120px}.advanced-fields--pixel,.advanced-fields--i2c{grid-template-columns:1fr}.advanced-panel__copy strong{font-size:11px}}.hotkey-card{min-height:470px}.hotkey-editor{grid-template-columns:minmax(250px,.72fr) minmax(420px,1.28fr);align-items:stretch;gap:14px;display:grid}.hotkey-editor__library,.hotkey-editor__form{border:1px solid var(--line);border-radius:var(--radius);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);min-width:0}.hotkey-editor__library{overflow:hidden}.hotkey-editor__library>header{border-bottom:1px solid var(--line);background:linear-gradient(110deg, color-mix(in srgb, var(--violet-soft) 64%, transparent), transparent 58%);justify-content:space-between;align-items:center;gap:12px;min-height:58px;padding:11px 12px;display:flex}.hotkey-editor__library>header>div{flex-direction:column;min-width:0;display:flex}.hotkey-editor__library>header strong{color:var(--text);font-size:11px}.hotkey-editor__library>header small{color:var(--text-muted);margin-top:3px;font-size:8px}.hotkey-binding-list{scrollbar-width:thin;max-height:380px;padding:7px;overflow:auto}.hotkey-binding-list>button{width:100%;min-height:60px;color:var(--text-soft);text-align:start;cursor:pointer;transition:border-color .25s, background-color .25s, box-shadow .38s var(--ease-out);background:0 0;border:1px solid #0000;border-radius:11px;outline:0;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 9px;display:grid;position:relative;overflow:hidden}.hotkey-binding-list>button+button{margin-top:3px}.hotkey-binding-list>button:after{content:"";background:var(--violet);opacity:0;width:2px;transition:scale .42s var(--ease-out), opacity .25s;position:absolute;inset-block:9px;inset-inline-start:0;scale:1 0}.hotkey-binding-list>button:hover,.hotkey-binding-list>button:focus-visible{border-color:color-mix(in srgb, var(--violet) 24%, var(--line));background:color-mix(in srgb, var(--violet-soft) 42%, transparent);box-shadow:inset 0 0 24px color-mix(in srgb, var(--violet-soft) 30%, transparent)}.hotkey-binding-list>button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.hotkey-binding-list>button.is-selected{border-color:color-mix(in srgb, var(--violet) 38%, var(--line));background:linear-gradient(105deg, color-mix(in srgb, var(--violet-soft) 78%, transparent), color-mix(in srgb, var(--surface-muted) 76%, transparent));box-shadow:inset 0 0 30px color-mix(in srgb, var(--violet-soft) 34%, transparent)}.hotkey-binding-list>button.is-selected:after{opacity:.9;scale:1}.hotkey-binding-list__icon{border:1px solid color-mix(in srgb, var(--violet) 27%, var(--line));background:color-mix(in srgb, var(--violet-soft) 55%, var(--surface-muted));width:32px;height:32px;color:var(--violet);border-radius:9px;place-items:center;display:grid}.hotkey-binding-list__copy{flex-direction:column;gap:7px;min-width:0;display:flex}.hotkey-binding-list__copy>strong{text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.hotkey-binding-list__copy kbd{padding:2px 5px;font-size:7px}.hotkey-binding-list__copy .key-combo,.hotkey-binding-list__copy .key-combo__group,.hotkey-binding-list__copy .key-combo__key{gap:3px}.hotkey-binding-list__state{border:1px solid var(--line);color:var(--text-muted);background:var(--surface-muted);font:650 7px/1 var(--font-mono);letter-spacing:.06em;text-transform:uppercase;border-radius:6px;padding:4px 6px}.hotkey-binding-list__state.is-enabled{border-color:color-mix(in srgb, var(--green) 26%, transparent);color:var(--green);background:var(--green-soft)}.hotkey-binding-list__empty{min-height:180px;color:var(--text-muted);text-align:center;align-content:center;place-items:center;gap:10px;padding:24px;font-size:10px;display:grid}.hotkey-binding-list__empty svg{color:var(--violet);opacity:.75}.hotkey-editor__form{flex-direction:column;padding:15px;display:flex}.hotkey-editor__form-heading{border-bottom:1px solid var(--line);align-items:center;gap:10px;min-height:43px;padding-bottom:12px;display:flex}.hotkey-editor__form-icon{border:1px solid color-mix(in srgb, var(--accent) 27%, var(--line));background:var(--accent-soft);width:34px;height:34px;color:var(--accent);border-radius:10px;flex:none;place-items:center;display:grid}.hotkey-editor__form-heading>div{flex-direction:column;min-width:0;display:flex}.hotkey-editor__form-heading small{color:var(--accent);font:650 7px/1.2 var(--font-mono);letter-spacing:.14em}.hotkey-editor__form-heading strong{color:var(--text);text-overflow:ellipsis;white-space:nowrap;margin-top:5px;font-size:12px;overflow:hidden}.hotkey-editor__fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;margin-top:3px;display:grid}.hotkey-editor__fields .text-field{margin-block:10px 0}.hotkey-command-field,.hotkey-recorder-field{flex-direction:column;gap:7px;min-width:0;margin-top:10px;display:flex}.hotkey-command-field>span,.hotkey-recorder-field>span{color:var(--text-soft);font-size:10px;font-weight:580}.hotkey-command-field select{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);width:100%;height:39px;color:var(--text);outline:0;padding-inline:11px 30px;font-size:11px;transition:border-color .25s,box-shadow .3s}.hotkey-command-field select:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 18px var(--accent-soft)}.hotkey-command-field>small,.hotkey-recorder-field>small{min-height:12px;color:var(--text-muted);font:8px/1.5 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hotkey-command-field.is-invalid select{border-color:color-mix(in srgb, var(--red) 65%, var(--line))}.hotkey-recorder-field{grid-column:1/-1}.hotkey-recorder{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:linear-gradient(105deg, color-mix(in srgb, var(--surface-muted) 88%, transparent), color-mix(in srgb, var(--violet-soft) 38%, transparent));min-height:64px;color:var(--text);text-align:start;cursor:pointer;transition:border-color .28s, box-shadow .4s var(--ease-out), background-color .28s;outline:0;grid-template-columns:3px minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 12px;display:grid;position:relative;overflow:hidden}.hotkey-recorder:hover,.hotkey-recorder:focus-visible{border-color:color-mix(in srgb, var(--violet) 45%, var(--line));box-shadow:inset 0 0 28px color-mix(in srgb, var(--violet-soft) 45%, transparent), 0 8px 24px #0000001a}.hotkey-recorder:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.hotkey-recorder.is-recording{border-color:color-mix(in srgb, var(--amber) 58%, var(--line));background:linear-gradient(105deg, var(--amber-soft), color-mix(in srgb, var(--surface-muted) 80%, transparent), var(--amber-soft));box-shadow:inset 0 0 30px color-mix(in srgb, var(--amber-soft) 60%, transparent);background-size:220% 100%;animation:1.8s ease-in-out infinite hotkey-listening}.hotkey-recorder__indicator{background:var(--violet);width:3px;height:24px;box-shadow:0 0 10px color-mix(in srgb, var(--violet) 60%, transparent);border-radius:1px}.hotkey-recorder.is-recording .hotkey-recorder__indicator{background:var(--amber);box-shadow:0 0 12px color-mix(in srgb, var(--amber) 72%, transparent);animation:1s ease-in-out infinite hotkey-signal}.hotkey-recorder>small{color:var(--text-muted);white-space:nowrap;font-size:8px}.hotkey-recorder .key-combo{min-width:0}.hotkey-recorder kbd{color:var(--text-soft);padding:5px 8px;font-size:10px}.hotkey-recorder-field.is-invalid .hotkey-recorder{border-color:color-mix(in srgb, var(--red) 58%, var(--line))}.hotkey-editor__form>.toggle-row{min-height:54px;margin-top:8px;padding-block:8px}.hotkey-editor__notice{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 68%, transparent);min-height:46px;color:var(--text-muted);grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;margin-top:9px;padding:9px 11px;font-size:9px;line-height:1.55;transition:border-color .3s,color .3s,background-color .3s;display:grid}.hotkey-editor__notice svg{color:currentColor}.hotkey-editor__notice-line{background:currentColor;width:13px;height:2px;box-shadow:0 0 8px}.hotkey-editor__notice.is-success{border-color:color-mix(in srgb, var(--green) 28%, var(--line));color:var(--green);background:var(--green-soft)}.hotkey-editor__notice.is-warning{border-color:color-mix(in srgb, var(--amber) 30%, var(--line));color:var(--amber);background:var(--amber-soft)}.hotkey-editor__notice.is-danger{border-color:color-mix(in srgb, var(--red) 34%, var(--line));color:var(--red);background:var(--red-soft)}.hotkey-editor__actions{flex-wrap:wrap;align-items:center;gap:8px;min-height:42px;margin-top:12px;display:flex}.hotkey-editor__load-error{border:1px solid color-mix(in srgb, var(--red) 30%, var(--line));border-radius:var(--radius);background:var(--red-soft);min-height:170px;color:var(--red);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;padding:18px;display:grid}.hotkey-editor__load-error>div{flex-direction:column;min-width:0;display:flex}.hotkey-editor__load-error strong{font-size:12px}.hotkey-editor__load-error span{overflow-wrap:anywhere;color:var(--text-soft);margin-top:5px;font-size:9px}.rf-guide-card{grid-column:1/-1}.rf-guide{outline:0;flex-direction:column;gap:14px;display:flex}.rf-guide:focus-visible{border-radius:var(--radius-sm);box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 58%, transparent)}.rf-guide__steps{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none;display:grid}.rf-guide__steps button{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 86%, transparent);width:100%;min-height:78px;color:var(--text-soft);text-align:start;cursor:pointer;grid-template-rows:auto auto;grid-template-columns:30px 1fr;align-items:center;column-gap:9px;padding:11px;transition:border-color .24s,background .24s,box-shadow .24s,color .24s;display:grid;position:relative}.rf-guide__steps button:after{content:"";background:var(--violet);opacity:0;transform-origin:50%;border-radius:2px 2px 0 0;height:2px;transition:opacity .24s,transform .32s cubic-bezier(.22,1,.36,1);position:absolute;inset-block-end:-1px;inset-inline:10px;transform:scaleX(.35)}.rf-guide__steps button:hover{border-color:color-mix(in srgb, var(--violet) 35%, var(--line));background:color-mix(in srgb, var(--violet-soft) 42%, var(--surface-muted))}.rf-guide__steps button.is-active{border-color:color-mix(in srgb, var(--violet) 50%, var(--line));background:linear-gradient(115deg, color-mix(in srgb, var(--violet-soft) 82%, var(--surface-muted)), var(--surface-muted));box-shadow:inset 3px 0 var(--violet), 0 10px 30px color-mix(in srgb, var(--violet-soft) 40%, transparent);color:var(--text)}[dir=rtl] .rf-guide__steps button.is-active{box-shadow:inset -3px 0 var(--violet), 0 10px 30px color-mix(in srgb, var(--violet-soft) 40%, transparent)}.rf-guide__steps button.is-active:after{opacity:1;transform:scaleX(1)}.rf-guide__steps button>span{background:color-mix(in srgb, var(--violet-soft) 72%, var(--surface-solid));width:28px;height:34px;color:var(--violet);font:700 11px var(--font-mono);border-radius:8px;grid-row:1/3;place-items:center;display:grid}.rf-guide__steps strong{align-self:end;font-size:10px}.rf-guide__steps small{min-width:0;color:var(--text-muted);font:8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;align-self:start;overflow:hidden}.rf-guide__message{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 78%, transparent);border-inline-start-width:3px;grid-template-columns:35px 1fr;align-items:center;gap:10px;min-height:62px;padding:11px 13px;transition:border-color .28s,background .28s;display:grid}.rf-guide__message>span{background:var(--surface-solid);width:32px;height:32px;color:var(--text-muted);border-radius:9px;place-items:center;display:grid}.rf-guide__message strong{color:var(--text);font:750 9px var(--font-mono);letter-spacing:.08em;display:block}.rf-guide__message p{color:var(--text-soft);margin:3px 0 0;font-size:9px;line-height:1.5}.rf-guide__message--info{border-inline-start-color:var(--violet);background:linear-gradient(100deg, color-mix(in srgb, var(--violet-soft) 70%, transparent), color-mix(in srgb, var(--surface-muted) 85%, transparent))}.rf-guide__message--good{border-inline-start-color:var(--green)}.rf-guide__message--warn{border-inline-start-color:var(--amber);background:linear-gradient(100deg, var(--amber-soft), color-mix(in srgb, var(--surface-muted) 85%, transparent))}.rf-guide__capture{border:1px solid color-mix(in srgb, var(--violet) 25%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(115deg, color-mix(in srgb, var(--violet-soft) 70%, transparent), color-mix(in srgb, var(--surface-muted) 82%, transparent));justify-content:space-between;align-items:center;gap:18px;padding:14px;display:flex}.rf-guide__capture>div{align-items:center;gap:12px;display:flex}.rf-guide__label{border:1px solid color-mix(in srgb, var(--violet) 45%, var(--line));background:var(--surface-solid);width:46px;height:52px;color:var(--violet);box-shadow:inset 0 -8px 22px var(--violet-soft);font:800 18px var(--font-mono);border-radius:11px;flex:none;place-items:center;display:grid}.rf-guide__capture strong,.rf-guide__identity strong,.rf-guide__mapping strong{color:var(--text);font-size:11px}.rf-guide__capture p,.rf-guide__identity p,.rf-guide__mapping p{color:var(--text-muted);margin:4px 0 0;font-size:9px;line-height:1.5}.rf-guide__listening{border:1px solid color-mix(in srgb, var(--violet) 35%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(100deg, color-mix(in srgb, var(--violet-soft) 60%, transparent), var(--surface-muted), color-mix(in srgb, var(--violet-soft) 60%, transparent));justify-content:center;align-items:center;gap:24px;min-height:98px;padding:14px;display:flex}.rf-guide__signal{height:47px;color:var(--violet);align-items:center;gap:5px;display:flex}.rf-guide__signal i{width:4px;height:12px;box-shadow:0 0 10px color-mix(in srgb, var(--violet) 50%, transparent);background:currentColor;border-radius:2px;animation:1.15s ease-in-out infinite alternate rf-signal}.rf-guide__signal i:nth-child(2){height:28px;animation-delay:-.38s}.rf-guide__signal i:nth-child(3){height:42px;animation-delay:-.76s}@keyframes rf-signal{0%{opacity:.35;transform:scaleY(.45)}to{opacity:1;transform:scaleY(1)}}.rf-guide__identity,.rf-guide__mapping{border:1px solid color-mix(in srgb, var(--violet) 32%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(135deg, color-mix(in srgb, var(--surface-solid) 82%, transparent), color-mix(in srgb, var(--violet-soft) 38%, var(--surface-muted)));box-shadow:0 14px 38px color-mix(in srgb, var(--shadow-color,#000) 15%, transparent);padding:15px}.rf-guide__identity>header,.rf-guide__mapping>header{color:var(--violet);justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px;display:flex}.rf-guide__identity>header{justify-content:flex-start}.rf-guide__identity dl{grid-template-columns:70px 1.6fr repeat(3,1fr);gap:7px;margin:0 0 13px;display:grid}.rf-guide__identity dl>div{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 84%, transparent);border-radius:8px;min-width:0;padding:9px}.rf-guide__identity dt{color:var(--text-muted);font:700 7px var(--font-mono);letter-spacing:.1em}.rf-guide__identity dd{color:var(--text);font:700 10px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;margin:5px 0 0;overflow:hidden}.rf-guide__actions{flex-wrap:wrap;gap:8px;display:flex}.rf-guide__mapping-kind>label,.rf-guide__mapping-fields label>span{color:var(--text-muted);font:650 8px var(--font-mono);letter-spacing:.06em;margin-bottom:6px;display:block}.rf-guide__mapping-kind .segmented{overflow-x:auto}.rf-guide__mapping-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;display:grid}.rf-guide__mapping-fields select{border:1px solid var(--line-strong);background:var(--surface-solid);width:100%;height:39px;color:var(--text);font:600 10px var(--font-ui);border-radius:8px;outline:0;padding-inline:11px 32px;transition:border-color .2s,box-shadow .2s,background .2s}.rf-guide__mapping-fields select:focus-visible{border-color:var(--violet);box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 18%, transparent)}.rf-guide__keyboard{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);color:var(--text-muted);border-radius:9px;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:9px 11px;font-size:8px;display:flex}.rf-guide__keyboard .key-combo{margin-inline-start:8px}.rf-guide__keyboard .key-combo:first-child{margin-inline-start:0}.rf-inventory{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 70%, transparent);overflow:hidden}.rf-inventory>header{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:12px 13px;display:flex}.rf-inventory>header h3{color:var(--text);margin:3px 0 0;font-size:11px}.rf-inventory>header>div:last-child{align-items:center;gap:8px;display:flex}.rf-inventory__list{flex-direction:column;display:flex}.rf-inventory__list article{border-bottom:1px solid var(--line);grid-template-columns:34px minmax(150px,1.2fr) minmax(135px,1fr) auto;align-items:center;gap:10px;min-height:64px;padding:9px 12px;transition:background .2s,box-shadow .2s;display:grid}.rf-inventory__list article:last-child{border-bottom:0}.rf-inventory__list article:hover{background:color-mix(in srgb, var(--surface-hover) 76%, transparent);box-shadow:inset 3px 0 color-mix(in srgb, var(--violet) 35%, transparent)}[dir=rtl] .rf-inventory__list article:hover{box-shadow:inset -3px 0 color-mix(in srgb, var(--violet) 35%, transparent)}.rf-inventory__list article.needs-review{background:linear-gradient(100deg, color-mix(in srgb, var(--amber-soft) 74%, transparent), transparent 52%)}.rf-inventory__id{background:var(--surface-solid);width:30px;height:32px;color:var(--text-muted);font:700 9px var(--font-mono);border-radius:8px;place-items:center;display:grid}.rf-inventory__identity,.rf-inventory__mapping{min-width:0}.rf-inventory__identity strong,.rf-inventory__mapping span{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:9px;display:block;overflow:hidden}.rf-inventory__identity small,.rf-inventory__mapping small{color:var(--text-muted);font:8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;display:block;overflow:hidden}.rf-inventory__mapping small{color:var(--amber)}.rf-inventory__actions{align-items:center;gap:6px;display:flex}.rf-inventory__actions .button:last-child{width:32px;padding-inline:0}.rf-inventory__empty{color:var(--text-muted);text-align:center;justify-items:center;padding:25px;display:grid}.rf-inventory__empty strong{color:var(--text-soft);margin-top:8px;font-size:10px}.rf-inventory__empty p{margin:5px 0 0;font-size:9px}.rf-inventory>footer{border-top:1px solid var(--line);color:var(--text-muted);font:8px var(--font-mono);justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;display:flex}@media (max-width:820px){.rf-guide__steps{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-guide__capture{flex-direction:column;align-items:stretch}.rf-guide__capture .button{justify-content:center}.rf-guide__identity dl{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-guide__identity dl>div:nth-child(2){grid-column:span 2}.rf-inventory__list article{grid-template-columns:34px 1fr}.rf-inventory__mapping,.rf-inventory__actions{grid-column:2}.rf-inventory__actions{flex-wrap:wrap}}@media (max-width:520px){.rf-guide__steps{grid-template-columns:1fr}.rf-guide__steps button{min-height:64px}.rf-guide__mapping-fields{grid-template-columns:1fr}.rf-guide__actions .button{justify-content:center;width:100%}.rf-guide__keyboard{display:none}.rf-inventory>header{flex-direction:column;align-items:stretch}.rf-inventory>header>div:last-child{justify-content:space-between}.rf-inventory__actions .button{flex:1;justify-content:center}.rf-inventory__actions .button:last-child{flex:0 0 34px}}@media (prefers-reduced-motion:reduce){.rf-guide__signal i{animation:none}}@keyframes hotkey-listening{0%,to{background-position:0 0}50%{background-position:100% 0}}@keyframes hotkey-signal{50%{opacity:.36;scale:1 .55}}@media (max-width:980px){.hotkey-editor{grid-template-columns:1fr}.hotkey-binding-list{max-height:260px}}@media (max-width:560px){.hotkey-card{min-height:0}.hotkey-editor__fields{grid-template-columns:1fr}.hotkey-recorder-field{grid-column:auto}.hotkey-binding-list>button{grid-template-columns:32px minmax(0,1fr)}.hotkey-binding-list__state{grid-column:2;justify-self:start}.hotkey-recorder{grid-template-columns:3px minmax(0,1fr)}.hotkey-recorder>small{grid-column:2}.hotkey-editor__actions .button{flex:1;min-width:120px}.hotkey-editor__load-error{grid-template-columns:auto minmax(0,1fr)}.hotkey-editor__load-error .button{grid-column:1/-1}}.segment-scroll-settings__notice{color:var(--text-muted)}.segment-scroll-settings__notice.is-error{color:var(--danger)}.workbench-grid>[data-layout-card-id=macros]{grid-column:1/-1}.macro-library{gap:13px;min-width:0;display:grid}.macro-library__monitor{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:stretch;gap:8px;display:grid}.macro-library__monitor>div{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 82%, transparent);min-width:0;min-height:68px;color:var(--text-muted);grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:10px 12px;transition:border-color .2s,background-color .2s,box-shadow .2s;display:grid}.macro-library__monitor>div.is-active{border-color:color-mix(in srgb, var(--green) 42%, var(--line));background:linear-gradient(110deg, var(--green-soft), var(--surface-muted));box-shadow:inset 3px 0 var(--green);color:var(--green)}[dir=rtl] .macro-library__monitor>div.is-active{box-shadow:inset -3px 0 var(--green)}.macro-library__monitor>div>span{gap:2px;min-width:0;display:grid}.macro-library__monitor small{color:currentColor;font:700 7px var(--font-mono);letter-spacing:.12em}.macro-library__monitor strong{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.macro-library__monitor em{color:var(--text-muted);font:8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;font-style:normal;overflow:hidden}.macro-library__monitor>.status-badge{align-self:center}.macro-library__error{border:1px solid color-mix(in srgb, var(--red) 35%, var(--line));background:var(--red-soft);color:var(--red);border-radius:8px;padding:9px 11px;font-size:9px;line-height:1.5}.macro-library__command-surface{border:1px solid color-mix(in srgb, var(--amber) 30%, var(--line));background:var(--amber-soft);color:var(--text-soft);border-radius:8px;justify-content:space-between;align-items:center;gap:10px;padding:9px 11px;font-size:9px;line-height:1.5;display:flex}.macro-library__workspace{grid-template-columns:minmax(270px,.9fr) minmax(360px,1.1fr);gap:10px;display:grid}.macro-library__workspace>section,.macro-library__control-grid>section,.macro-library__events{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 70%, transparent);min-width:0;padding:12px}.macro-library__workspace>section>header,.macro-library__control-grid>section>header,.macro-library__events>header{min-height:24px;color:var(--text-soft);font:700 9px var(--font-mono);letter-spacing:.05em;justify-content:space-between;align-items:center;gap:9px;margin-bottom:9px;display:flex}.macro-library__workspace>section>header span{align-items:center;gap:7px;display:inline-flex}.macro-library__workspace>section>header small{background:var(--accent-soft);min-width:24px;color:var(--accent);text-align:center;border-radius:999px;padding:3px 6px}.macro-library__catalog{scrollbar-width:thin;flex-direction:column;gap:5px;max-height:285px;display:flex;overflow-y:auto}.macro-library__catalog>button{border:1px solid var(--line);background:var(--surface-solid);width:100%;min-width:0;color:var(--text-soft);text-align:start;border-radius:8px;grid-template-columns:7px minmax(130px,1fr) minmax(50px,auto) minmax(72px,auto);align-items:center;gap:9px;padding:9px;transition:border-color .18s,background-color .18s,box-shadow .18s;display:grid}.macro-library__catalog>button:hover{border-color:color-mix(in srgb, var(--accent) 34%, var(--line));background:var(--surface-hover)}.macro-library__catalog>button.is-selected{border-color:color-mix(in srgb, var(--accent) 55%, var(--line));background:linear-gradient(110deg, var(--accent-soft), var(--surface-solid));box-shadow:inset 3px 0 var(--accent)}[dir=rtl] .macro-library__catalog>button.is-selected{box-shadow:inset -3px 0 var(--accent)}.macro-library__color{background:var(--red);width:6px;height:32px;box-shadow:0 0 9px color-mix(in srgb, var(--red) 45%, transparent);border-radius:4px}.macro-library__color.is-blue{background:#4f8cff;box-shadow:0 0 9px #4f8cff73}.macro-library__color.is-violet{background:var(--violet);box-shadow:0 0 9px color-mix(in srgb, var(--violet) 45%, transparent)}.macro-library__color.is-green{background:var(--green);box-shadow:0 0 9px color-mix(in srgb, var(--green) 45%, transparent)}.macro-library__color.is-white{background:#f3efff;box-shadow:0 0 9px #f3efff80}.macro-library__identity,.macro-library__measure{gap:3px;min-width:0;display:grid}.macro-library__identity strong{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.macro-library__identity small,.macro-library__measure small{color:var(--text-muted);font:7px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__measure{justify-items:end}.macro-library__measure strong{color:var(--text-soft);font:700 9px var(--font-mono)}.macro-library__empty{border:1px dashed var(--line);min-height:82px;color:var(--text-muted);text-align:center;border-radius:8px;place-items:center;padding:12px;font-size:9px;display:grid}.macro-library__fields{grid-template-columns:minmax(72px,.3fr) minmax(140px,1fr) minmax(120px,.75fr);gap:8px;display:grid}.macro-library__color-picker{margin-top:9px}.macro-library__color-picker>label{color:var(--text-muted);margin-bottom:6px;font-size:9px;display:block}.macro-library__color-picker .segmented{overflow-x:auto}.macro-library__actions,.macro-library__playback-actions{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.macro-library__editor>.macro-library__actions{margin-top:10px}.macro-library__steps{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);overflow:hidden}.macro-library__steps>summary{color:var(--text-soft);font:700 9px var(--font-mono);padding:10px 12px}.macro-library__steps>div{border-top:1px solid var(--line);scrollbar-width:thin;max-height:230px;overflow:auto}.macro-library__steps [role=row]{border-bottom:1px solid var(--line);min-width:620px;color:var(--text-muted);font:8px var(--font-mono);grid-template-columns:42px minmax(110px,.8fr) 90px 100px minmax(170px,1fr);align-items:center;gap:8px;padding:7px 11px;display:grid}.macro-library__steps [role=row]:last-child{border-bottom:0}.macro-library__steps [role=row] strong{color:var(--text-soft)}.macro-library__steps code{color:var(--accent);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__control-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.macro-library__control-grid p{min-height:31px;color:var(--text-muted);margin:0 0 10px;font-size:8px;line-height:1.55}.macro-library__board-id{width:min(160px,100%);margin-bottom:8px}.macro-library__playback-actions{border:1px solid color-mix(in srgb, var(--accent) 22%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(100deg, var(--accent-soft), transparent 45%), var(--surface-muted);padding:10px}.macro-library__events{scrollbar-width:thin;max-height:210px;overflow-y:auto}.macro-library__events>div{border-bottom:1px solid var(--line);min-width:0;color:var(--text-muted);font:8px var(--font-mono);grid-template-columns:82px minmax(130px,.65fr) minmax(160px,1fr) auto;align-items:center;gap:8px;padding:6px 2px;display:grid}.macro-library__events>div:last-child{border-bottom:0}.macro-library__events strong{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__events span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__events code{color:var(--green)}.macro-library__events p{color:var(--text-muted);margin:0;font-size:9px}@media (max-width:900px){.macro-library__monitor{grid-template-columns:1fr 1fr}.macro-library__monitor>.status-badge{grid-column:1/-1;justify-self:start}.macro-library__workspace,.macro-library__control-grid{grid-template-columns:1fr}}@media (max-width:600px){.macro-library__monitor{grid-template-columns:1fr}.macro-library__monitor>.status-badge{grid-column:1}.macro-library__fields{grid-template-columns:80px minmax(0,1fr)}.macro-library__fields .text-field:last-child{grid-column:1/-1}.macro-library__catalog>button{grid-template-columns:7px minmax(105px,1fr) auto}.macro-library__catalog .macro-library__measure:last-child{display:none}.macro-library__events>div{grid-template-columns:68px minmax(110px,.7fr) minmax(130px,1fr)}.macro-library__events code{grid-column:2/-1}.macro-library__actions .button,.macro-library__playback-actions .button{flex:145px;justify-content:center}}.connected-apps-list{gap:10px;display:grid}.connected-app{border:1px solid var(--line);background:var(--surface-muted);border-radius:10px;grid-template-columns:minmax(190px,1fr) minmax(180px,auto);align-items:center;gap:10px 12px;min-width:0;padding:12px;display:grid}.connected-app__identity{align-items:center;gap:10px;min-width:0;display:flex}.connected-app__identity>div{gap:2px;min-width:0;display:grid}.connected-app__identity strong{color:var(--text);text-transform:capitalize}.connected-app__identity span{color:var(--text-muted);font:11px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.connected-app__facts{color:var(--text-muted);flex-wrap:wrap;justify-content:flex-end;gap:5px 10px;font-size:12px;display:flex}.connected-app__facts span[title]{text-overflow:ellipsis;white-space:nowrap;max-width:280px;overflow:hidden}.connected-app__capabilities{flex-wrap:wrap;grid-column:1/-1;gap:5px;min-width:0;display:flex}.connected-app__capabilities code,.connected-app__capabilities span{border:1px solid var(--line);color:var(--text-muted);background:var(--surface);font:10px var(--font-mono);border-radius:999px;padding:3px 7px}.connected-app__actions{grid-column:1/-1;justify-content:flex-end;gap:6px;display:flex}@media (max-width:760px){.connected-app{grid-template-columns:1fr}.connected-app__facts{justify-content:flex-start}} diff --git a/Tools/Controller/internal/webui/dist/assets/index-DQn3kTuT.css b/Tools/Controller/internal/webui/dist/assets/index-DQn3kTuT.css deleted file mode 100644 index bc3f8067..00000000 --- a/Tools/Controller/internal/webui/dist/assets/index-DQn3kTuT.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Vazirmatn;src:url(/fonts/vazirmatn-BeciDpKm.woff2)format("woff2");font-style:normal;font-weight:100 900;font-display:swap}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;font-synthesis:none;text-rendering:optimizelegibility;--font-ui:"Segoe UI Variable", "Segoe UI", system-ui, sans-serif;--font-fa:"Vazirmatn", Tahoma, "Segoe UI", sans-serif;--font-mono:"Cascadia Code", "SFMono-Regular", Consolas, monospace;--bg:#121116;--bg-deep:#0b0a0e;--bg-elevated:#1d1b22db;--surface:#1f1d25bd;--surface-solid:#1d1b22;--surface-muted:#33303b99;--surface-hover:#413c4cb8;--glass:#1b1920ad;--glass-strong:#121116eb;--line:#e2dceb1f;--line-strong:#e2dceb3b;--text:#f5f2f7;--text-soft:#cbc5d0;--text-muted:#938c9b;--accent:#a78bfa;--accent-bright:#d8ccff;--accent-soft:#a78bfa24;--green:#73c69a;--green-soft:#73c69a1f;--amber:#e7ae63;--amber-soft:#e7ae6324;--red:#ed7889;--red-soft:#ed788924;--violet:#c29bea;--violet-soft:#c29bea24;--sidebar-width:272px;--sidebar-compact:84px;--topbar-height:68px;--radius-xs:7px;--radius-sm:10px;--radius:14px;--radius-lg:20px;--shadow:0 24px 70px #00000057;--shadow-tight:0 10px 34px #0000003d;--ease-out:cubic-bezier(.22, 1, .36, 1);font-family:Segoe UI Variable,Segoe UI,system-ui,sans-serif}:root[lang^=fa]{font-family:var(--font-fa)}:root[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#f5f3f6;--bg-deep:#ebe8ed;--bg-elevated:#ffffffe0;--surface:#ffffffc2;--surface-solid:#fff;--surface-muted:#e8e4ecd1;--surface-hover:#ded8e5d6;--glass:#ffffffb8;--glass-strong:#fbfafcf0;--line:#2d28331f;--line-strong:#2d28333b;--text:#242126;--text-soft:#5e5864;--text-muted:#7b7382;--accent:#6845bf;--accent-bright:#5334a3;--accent-soft:#6845bf1a;--green:#307752;--green-soft:#3077521a;--amber:#8a5917;--amber-soft:#8a59171c;--red:#b33f53;--red-soft:#b33f531a;--violet:#7e52b3;--violet-soft:#7e52b31a;--shadow:0 24px 70px #19161d24;--shadow-tight:0 10px 34px #19161d1a}*{box-sizing:border-box}html,body,#root{min-height:100%;margin:0}html{background:var(--bg-deep);scrollbar-color:var(--line-strong) transparent}body{background:linear-gradient(135deg, var(--bg-deep), var(--bg) 55%, var(--bg-deep));min-width:320px;color:var(--text);overflow:hidden}button,input,select,textarea{font:inherit}*,:before,:after{-webkit-tap-highlight-color:transparent}button,[role=button],[role=switch],input[type=checkbox]{touch-action:manipulation}button{color:inherit}input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not(:disabled),textarea:not(:disabled),[contenteditable=true]{cursor:text}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:3px}a{color:inherit;text-decoration:none}p{color:var(--text-soft)}::selection{background:var(--accent);color:var(--bg-deep)}.mono,[dir=ltr]{unicode-bidi:isolate}.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}.spin{animation:.8s linear infinite spin}@keyframes spin{to{rotate:360deg}}.app-shell{grid-template:var(--topbar-height) minmax(0, 1fr) / var(--sidebar-width) minmax(0, 1fr);height:100dvh;transition:grid-template-columns .42s var(--ease-out);display:grid}.app-shell.is-sidebar-compact{grid-template-columns:var(--sidebar-compact) minmax(0, 1fr)}.app-action-progress{z-index:120;pointer-events:none;background:color-mix(in srgb, var(--blue) 16%, transparent);height:3px;position:fixed;inset:0 0 auto;overflow:hidden}.app-action-progress>span{background:var(--blue);width:100%;height:100%;box-shadow:0 0 12px color-mix(in srgb, var(--blue) 72%, transparent);transition:width .2s var(--ease-out);display:block}.app-action-progress--warning>span{background:var(--amber)}.app-action-progress--error>span{background:var(--red)}.app-action-progress--indeterminate>span{width:36%;animation:app-action-progress-indeterminate 1.2s var(--ease-out) infinite}@keyframes app-action-progress-indeterminate{0%{transform:translate(-110%)}to{transform:translate(290%)}}.sidebar{z-index:30;border-inline-end:1px solid var(--line);background:linear-gradient(180deg, var(--glass-strong), var(--glass));-webkit-backdrop-filter:blur(26px)saturate(1.15);backdrop-filter:blur(26px)saturate(1.15);flex-direction:column;grid-row:1/3;min-width:0;display:flex;position:relative;overflow:hidden;box-shadow:16px 0 50px #0005081f}.sidebar:after{content:"";inset-inline-end:-1px;background:linear-gradient(var(--accent), transparent);opacity:.7;width:1px;height:19%;position:absolute;top:0}.brand{min-height:var(--topbar-height);border-bottom:1px solid var(--line);grid-template-columns:42px minmax(0,1fr) 34px;align-items:center;gap:11px;padding:0 15px 0 18px;display:grid}[dir=rtl] .brand{padding:0 18px 0 15px}.brand__mark{width:40px;height:40px;color:var(--accent-bright);background:linear-gradient(150deg, var(--accent-soft), transparent 72%);border:1px solid color-mix(in srgb, var(--accent) 32%, transparent);font:800 12px/1 var(--font-mono);letter-spacing:-.04em;border-radius:12px;place-items:center;display:grid;position:relative}.brand__mark i{display:none}.brand__mark img{object-fit:contain;width:100%;height:100%;display:block}.brand__copy{white-space:nowrap;flex-direction:column;min-width:0;display:flex;overflow:hidden}.brand__copy strong{letter-spacing:-.02em;font-size:15px}.brand__copy span{color:var(--text-muted);font:600 8px/1.2 var(--font-mono);letter-spacing:.18em;margin-top:2px}.sidebar-toggle,.mobile-menu,.topbar-icon,.modal__close{border-radius:var(--radius-sm);width:34px;height:34px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;place-items:center;transition:color .25s,border-color .25s,background .25s;display:grid}.sidebar-toggle:hover,.mobile-menu:hover,.topbar-icon:hover,.modal__close:hover{color:var(--text);border-color:var(--line);background:var(--surface-muted)}.sidebar__status{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(105deg, var(--surface-muted), transparent);color:inherit;font:inherit;text-align:start;cursor:pointer;grid-template-columns:3px minmax(0,1fr) 22px;align-items:center;gap:12px;margin:18px 15px 10px;padding:13px 12px;display:grid;position:relative;overflow:hidden}.sidebar__status:hover{border-color:var(--line-strong);background:linear-gradient(105deg, var(--surface-hover), transparent)}.sidebar__status:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.sidebar__status-menu{z-index:140;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 96%, transparent);min-width:194px;box-shadow:var(--shadow);-webkit-backdrop-filter:blur(18px)saturate(1.12);backdrop-filter:blur(18px)saturate(1.12);border-radius:11px;gap:3px;padding:6px;display:grid;position:fixed}.sidebar__status-menu>button{min-height:32px;color:var(--text-soft);font:600 11px var(--font-ui);text-align:start;cursor:pointer;background:0 0;border:0;border-radius:7px;padding-inline:9px}.sidebar__status-menu>button:hover,.sidebar__status-menu>button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.sidebar__status>div{white-space:nowrap;flex-direction:column;min-width:0;display:flex}.sidebar__status strong{font-size:12px}.sidebar__status small{color:var(--text-muted);font:500 10px var(--font-mono);text-overflow:ellipsis;overflow:hidden}.sidebar__status>svg{color:var(--text-muted)}.status-rail{border-radius:2px;width:3px;height:28px}.status-rail--good{background:var(--green);box-shadow:0 0 14px color-mix(in srgb, var(--green) 60%, transparent)}.status-rail--bad{background:var(--red);box-shadow:0 0 14px color-mix(in srgb, var(--red) 45%, transparent)}.status-rail--warn{background:var(--amber);box-shadow:0 0 14px color-mix(in srgb, var(--amber) 52%, transparent)}.status-rail--info{background:var(--accent);box-shadow:0 0 14px color-mix(in srgb, var(--accent) 52%, transparent)}.status-rail--neutral{background:var(--text-muted);box-shadow:none}.sidebar__nav{flex:1;min-height:0;padding:4px 12px 20px;overflow:auto}.nav-group{flex-direction:column;gap:3px;margin-top:18px;display:flex}.nav-group__label{color:var(--text-muted);font:650 9px var(--font-mono);letter-spacing:.15em;white-space:nowrap;padding:0 10px 7px}.nav-button{border-radius:var(--radius-sm);text-align:start;width:100%;min-height:43px;color:var(--text-soft);cursor:pointer;background:0 0;border:1px solid #0000;grid-template-columns:30px minmax(0,1fr) auto 16px;align-items:center;gap:9px;padding:6px 9px;transition:color .24s,background .24s,border-color .24s;display:grid;position:relative;overflow:hidden}.nav-button:before{content:"";background:var(--accent);width:2px;box-shadow:0 0 16px var(--accent);transition:scale .32s var(--ease-out);position:absolute;inset-block:8px;inset-inline-start:0;scale:1 0}.nav-button:hover{color:var(--text);background:var(--surface-muted)}.nav-button.is-active{color:var(--text);background:linear-gradient(90deg, var(--accent-soft), transparent);border-color:color-mix(in srgb, var(--accent) 14%, transparent)}.nav-button.is-active:before{scale:1}.nav-button__icon{width:30px;height:30px;color:var(--text-muted);place-items:center;transition:color .3s,filter .3s;display:grid}.nav-button.is-active .nav-button__icon{color:var(--accent)}.nav-button__label{white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:13px;font-weight:560;overflow:hidden}.nav-button__badge,.count-chip{background:var(--accent-soft);min-width:20px;color:var(--accent);font:600 9px var(--font-mono);text-align:center;border-radius:6px;padding:2px 6px}.nav-button__chevron{opacity:0;color:var(--text-muted);transition:opacity .2s,translate .25s}.nav-button:hover .nav-button__chevron,.nav-button.is-active .nav-button__chevron{opacity:.7}[dir=rtl] .nav-button__chevron{rotate:180deg}.sidebar__footer{border-top:1px solid var(--line);color:var(--green);white-space:nowrap;align-items:center;gap:10px;margin:auto 15px 16px;padding:12px;display:flex;overflow:hidden}.sidebar__footer div{flex-direction:column;display:flex}.sidebar__footer strong{color:var(--text-soft);font-size:11px}.sidebar__footer span{color:var(--text-muted);font:9px var(--font-mono)}.is-sidebar-compact .brand{grid-template-columns:44px;justify-content:center;justify-items:center;gap:6px;padding:10px 0}.is-sidebar-compact .brand__copy,.is-sidebar-compact .sidebar__status>div{display:none}.is-sidebar-compact .sidebar__footer div{opacity:0;pointer-events:none;width:0}.is-sidebar-compact .sidebar-toggle{width:44px;height:44px;color:var(--text);border-color:var(--line);background:var(--surface-muted)}.sidebar-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.is-sidebar-compact .sidebar__status{grid-template-columns:3px 18px;justify-content:center;gap:7px;width:44px;height:44px;margin-inline:auto;padding:0}.is-sidebar-compact .sidebar__nav{padding-inline:12px}.is-sidebar-compact .nav-button{flex:none;grid-template-columns:1fr;gap:0;block-size:44px;min-block-size:44px;inline-size:44px;margin-inline:auto;padding:6px}.is-sidebar-compact .nav-group__label,.is-sidebar-compact .nav-button__label,.is-sidebar-compact .nav-button__badge,.is-sidebar-compact .nav-button__chevron{display:none}.is-sidebar-compact .nav-button__icon{margin:auto}.is-sidebar-compact .sidebar__footer{justify-content:center;margin-inline:12px}.topbar{border-bottom:1px solid var(--line);background:color-mix(in srgb, var(--glass-strong) 78%, transparent);-webkit-backdrop-filter:blur(22px)saturate(1.18);backdrop-filter:blur(22px)saturate(1.18);z-index:20;grid-column:2;align-items:center;gap:18px;padding:0 24px;display:flex}.mobile-menu{display:none}.breadcrumbs{align-items:center;gap:10px;min-width:180px;font-size:12px;display:flex}.breadcrumbs span{color:var(--accent);font:700 11px var(--font-mono)}.breadcrumbs i{color:var(--text-muted);font-style:normal}.breadcrumbs strong{color:var(--text-soft);font-weight:580}.command-trigger{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);width:min(460px,38vw);height:36px;color:var(--text-muted);cursor:pointer;align-items:center;gap:10px;margin:auto;padding:0 10px 0 12px;transition:border-color .25s,background .25s,box-shadow .25s;display:flex}[dir=rtl] .command-trigger{padding:0 12px 0 10px}.command-trigger:hover{border-color:var(--line-strong);background:var(--surface-hover);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent)}.command-trigger>span:not(.key-combo){text-align:start;flex:1;font-size:12px}.command-trigger>.key-combo{flex:none;margin-inline-start:5px}kbd{border:1px solid var(--line-strong);border-bottom-color:color-mix(in srgb, var(--line-strong) 150%, var(--text-muted));background:var(--surface-solid);color:var(--text-muted);font:600 9px var(--font-mono);border-radius:5px;padding:3px 6px}.key-combo,.key-combo__group,.key-combo__key{align-items:center;display:inline-flex}.key-combo{flex-wrap:wrap;gap:5px}.key-combo__group,.key-combo__key{gap:5px}.key-combo__separator,.key-combo__alternative{color:var(--text-muted);font:600 9px var(--font-mono)}.topbar__actions{align-items:center;gap:6px;display:flex}.topbar-icon{position:relative}.topbar-icon i{inset-inline-end:6px;background:var(--red);width:5px;height:5px;box-shadow:0 0 8px var(--red);border-radius:1px;position:absolute;top:5px}.app-main{scroll-behavior:smooth;grid-column:2;min-height:0;overflow:auto}.app-shell.is-bootstrap-pending{visibility:hidden}.page{width:min(1540px,100%);min-height:100%;margin:0 auto;padding:28px clamp(18px,2.4vw,38px) 52px}.page[data-route-focus-target]:focus,.page [data-route-focus-target]:focus{outline:none}.section-title{justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:24px;display:flex}.section-title h1{letter-spacing:-.045em;margin:5px 0 0;font-size:clamp(25px,2.7vw,38px);font-weight:660;line-height:1.05}.section-title p{max-width:760px;color:var(--text-muted);margin:9px 0 0;font-size:13px;line-height:1.65}.section-title__action,.header-actions{align-items:center;gap:9px;display:flex}.eyebrow{color:var(--accent);font:650 9px/1.3 var(--font-ui);letter-spacing:.06em}.button{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface-muted);min-height:38px;color:var(--text);cursor:pointer;isolation:isolate;justify-content:center;align-items:center;gap:8px;padding:8px 14px;font-size:12px;font-weight:620;line-height:1;transition:border-color .28s,color .28s,box-shadow .28s,background .28s;display:inline-flex;position:relative;overflow:hidden}.button:after{content:"";z-index:2;inset-inline:11px;transform-origin:50%;opacity:.68;height:1px;transition:scale .42s var(--ease-out), opacity .25s;background:linear-gradient(90deg,#0000,currentColor,#0000);position:absolute;bottom:0;scale:0 1}.button__wash{z-index:-1;transition:translate .65s var(--ease-out);background:linear-gradient(110deg,#0000 10%,#ffffff1f 45%,#0000 70%);position:absolute;inset:0;translate:-140%}.button:hover:not(:disabled) .button__wash,.button:focus-visible .button__wash{translate:140%}.button:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 50%, var(--line));box-shadow:inset 0 0 22px color-mix(in srgb, var(--accent-soft) 60%, transparent), 0 8px 25px #00000021}.button:hover:not(:disabled):after,.button:focus-visible:after{scale:1}.button>svg:not(.spin){transition:rotate .42s var(--ease-out), filter .28s}.button:hover:not(:disabled)>svg:not(.spin),.button:focus-visible>svg:not(.spin){filter:drop-shadow(0 0 7px);rotate:-6deg}.button:active:not(:disabled){filter:brightness(.92)}.button:disabled{opacity:.38;cursor:not-allowed}.button--compact{min-height:32px;padding:6px 10px;font-size:11px}.button--primary{background:linear-gradient(120deg, color-mix(in srgb, var(--accent) 24%, var(--surface-solid)), color-mix(in srgb, var(--accent) 11%, var(--surface-solid)));border-color:color-mix(in srgb, var(--accent) 50%, transparent);color:var(--accent-bright);box-shadow:inset 0 1px #ffffff12}.button--danger{background:linear-gradient(120deg, color-mix(in srgb, var(--red) 25%, var(--surface-solid)), color-mix(in srgb, var(--red) 10%, var(--surface-solid)));border-color:color-mix(in srgb, var(--red) 50%, transparent);color:color-mix(in srgb, var(--red) 72%, var(--text))}.button--danger:hover:not(:disabled){border-color:var(--red);box-shadow:inset 0 0 24px var(--red-soft), 0 8px 25px #4b08112e}.button--success{background:linear-gradient(120deg, color-mix(in srgb, var(--green) 25%, var(--surface-solid)), color-mix(in srgb, var(--green) 10%, var(--surface-solid)));border-color:color-mix(in srgb, var(--green) 50%, transparent);color:color-mix(in srgb, var(--green) 76%, var(--text))}.button--ghost{color:var(--text-soft);background:0 0;border-color:#0000}.hold-action.is-holding{border-color:color-mix(in srgb, var(--amber) 72%, var(--line));color:color-mix(in srgb, var(--amber) 78%, var(--text));background:linear-gradient(120deg, color-mix(in srgb, var(--amber) 23%, var(--surface-solid)), color-mix(in srgb, var(--accent) 8%, var(--surface-solid)));box-shadow:inset 0 0 24px color-mix(in srgb, var(--amber-soft) 75%, transparent), 0 0 0 1px color-mix(in srgb, var(--amber) 22%, transparent);animation:1.15s ease-in-out infinite hold-action-breathe}.hold-action.is-holding:after{opacity:1;scale:1}.hold-action.is-holding .button__wash{translate:140%}@keyframes hold-action-breathe{50%{box-shadow:inset 0 0 32px color-mix(in srgb, var(--amber-soft) 88%, transparent), 0 0 16px color-mix(in srgb, var(--amber) 18%, transparent)}}.status-badge{border:1px solid var(--line);background:var(--surface-muted);min-height:26px;font:650 9px/1 var(--font-mono);letter-spacing:.07em;white-space:nowrap;border-radius:7px;align-items:center;gap:7px;padding:5px 9px;display:inline-flex;position:relative}.status-badge__line{background:currentColor;width:9px;height:2px;box-shadow:0 0 8px}.status-badge--good{color:var(--green);background:var(--green-soft);border-color:color-mix(in srgb, var(--green) 25%, transparent)}.status-badge--warn{color:var(--amber);background:var(--amber-soft);border-color:color-mix(in srgb, var(--amber) 25%, transparent)}.status-badge--bad{color:var(--red);background:var(--red-soft);border-color:color-mix(in srgb, var(--red) 25%, transparent)}.status-badge--info{color:var(--accent);background:var(--accent-soft);border-color:color-mix(in srgb, var(--accent) 25%, transparent)}.status-badge--neutral{color:var(--text-muted)}.status-badge--pulse .status-badge__line{transform-origin:50%;animation:1.2s ease-in-out infinite status-pulse}.transport-reconnect{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;border-radius:7px;padding:0}.transport-reconnect:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.transport-reconnect:hover .status-badge{border-color:currentColor}@keyframes status-pulse{50%{opacity:.35;scale:1.7 1}}.card{border:1px solid var(--line);border-radius:var(--radius-lg);background:linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-muted) 45%, transparent));-webkit-backdrop-filter:blur(18px)saturate(1.08);backdrop-filter:blur(18px)saturate(1.08);box-shadow:var(--shadow-tight);padding:20px;position:relative;overflow:hidden}.card:before{content:"";top:-1px;background:linear-gradient(90deg, var(--violet), var(--amber), var(--red));opacity:.78;border-radius:0 0 2px 2px;width:54px;height:2px;position:absolute;inset-inline-start:20px}.card__header{justify-content:space-between;align-items:center;gap:18px;margin-bottom:17px;display:flex}.card__heading{flex:1;align-items:center;gap:11px;min-width:0;display:flex}.card__heading-copy{min-width:0}.card__icon{--card-icon-color:var(--accent);border:1px solid color-mix(in srgb, var(--card-icon-color) 28%, var(--line));background:color-mix(in srgb, var(--card-icon-color) 11%, var(--surface-muted));width:36px;height:36px;color:var(--card-icon-color);border-radius:11px;flex:0 0 36px;place-items:center;display:grid;box-shadow:inset 0 1px #ffffff09}.card__icon--green{--card-icon-color:var(--green)}.card__icon--amber{--card-icon-color:var(--amber)}.card__icon--violet{--card-icon-color:var(--violet)}.card__icon--red{--card-icon-color:var(--red)}.card__header h2{letter-spacing:-.02em;margin:5px 0 0;font-size:15px;font-weight:640}.card__action{flex:none;align-items:center;gap:8px;margin-inline-start:auto;display:flex}.card__menu-trigger{border:1px solid var(--line);background:var(--surface-muted);width:34px;height:34px;color:var(--text-soft);border-radius:10px;flex:0 0 34px;justify-content:center;align-items:center;transition:border-color .16s,background-color .16s,color .16s;display:inline-flex}.card__menu-trigger:hover,.card__menu-trigger:focus-visible,.card__menu-trigger[aria-expanded=true]{border-color:color-mix(in srgb, var(--violet) 44%, var(--line));background:var(--violet-soft);color:var(--violet);outline:none}.card-menu{z-index:130;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 94%, transparent);-webkit-backdrop-filter:blur(22px)saturate(1.15);backdrop-filter:blur(22px)saturate(1.15);transform-origin:100% 0;border-radius:13px;min-width:190px;padding:6px;position:fixed;box-shadow:0 18px 50px #00000047}.card-menu button{width:100%;min-height:38px;color:var(--text-soft);text-align:start;font:inherit;background:0 0;border:0;border-radius:9px;align-items:center;gap:10px;padding:0 11px;font-size:10px;transition:background-color .14s,color .14s;display:flex}.card-menu button:hover,.card-menu button:focus-visible{background:var(--violet-soft);color:var(--text);outline:none}.card-menu button[data-tone=danger]{color:var(--red)}.card-menu button[data-tone=danger]:hover,.card-menu button[data-tone=danger]:focus-visible{background:var(--red-soft)}.card-menu button:disabled{opacity:.42;cursor:not-allowed}.card-copy{margin:14px 0 0;font-size:12px;line-height:1.7}.hero-panel{border:1px solid var(--line);border-radius:var(--radius-lg);background:linear-gradient(105deg, var(--glass-strong) 0 62%, color-mix(in srgb, var(--violet-soft) 46%, var(--glass)) 82%, color-mix(in srgb, var(--amber-soft) 34%, var(--glass)) 100%);min-height:168px;box-shadow:var(--shadow);grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;margin-bottom:17px;padding:27px 30px;transition:border-color .28s,background .32s;display:grid;position:relative;overflow:hidden}.hero-panel:before,.hero-panel:after{content:"";pointer-events:none;position:absolute}.hero-panel:before{background:var(--red);opacity:.72;width:4px;transition:background .28s,opacity .28s;inset-block:0;inset-inline-start:0}.hero-panel.is-online:before{border-color:var(--green);background:var(--green)}.hero-panel:after{display:none}.hero-panel__identity{z-index:2;max-width:820px;min-height:78px;position:relative}.hero-panel__identity h2{letter-spacing:-.035em;max-width:760px;margin:9px 0 8px;font-size:clamp(20px,2.3vw,32px);font-weight:620;line-height:1.25}.hero-panel__identity h2 a{transition:color .22s}.hero-panel__identity h2 a:hover,.hero-panel__identity h2 a:focus-visible{color:var(--accent-bright)}.hero-panel__identity p{color:var(--text-muted);margin:0;font-size:12px}.hero-panel__readout{z-index:2;border-inline-start:1px solid var(--line-strong);grid-template-columns:auto auto;gap:7px 16px;min-width:178px;padding:14px 16px;display:grid;position:relative}.hero-panel__readout.is-empty{opacity:.45}.hero-panel__readout span{color:var(--text-muted);font:9px var(--font-mono);letter-spacing:.1em}.hero-panel__readout strong{color:var(--text-soft);font:600 11px var(--font-mono);text-align:end}.metric-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:17px;display:grid}.metric{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(145deg, var(--surface), transparent);min-height:170px;padding:16px 16px 0;position:relative;overflow:hidden}.metric:after{content:"";top:0;opacity:.55;background:linear-gradient(90deg,#0000,currentColor);width:50%;height:1px;position:absolute;inset-inline-end:0}.metric--accent{color:var(--accent)}.metric--green{color:var(--green)}.metric--amber{color:var(--amber)}.metric--violet{color:var(--violet)}.metric__top{align-items:center;gap:10px;display:flex}.metric__icon{background:color-mix(in srgb, currentColor 9%, transparent);opacity:.88;border:1px solid;border-radius:8px;place-items:center;width:32px;height:32px;display:grid}.metric__label{color:var(--text-muted);font-size:11px;font-weight:550}.metric__value{align-items:baseline;gap:6px;margin-top:13px;display:flex}.metric__value strong{color:var(--text);font:630 clamp(23px, 2.2vw, 31px) var(--font-mono);letter-spacing:-.06em}.metric__value span{color:currentColor;font:550 10px var(--font-mono)}.metric__detail{top:18px;color:var(--text-muted);font:500 9px var(--font-mono);position:absolute;inset-inline-end:15px}.sparkline{inset-inline:0;width:100%;height:70px;position:absolute;bottom:-2px;overflow:visible}.sparkline__grid{fill:none;stroke:var(--line);stroke-width:.5px;vector-effect:non-scaling-stroke}.sparkline__line{stroke-width:1.7px;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 3px)}.telemetry-chart-card{margin-bottom:14px}.telemetry-chart{min-width:0}.telemetry-chart__toolbar{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;display:flex}.telemetry-chart__toolbar .segmented{max-width:100%;overflow-x:auto}.telemetry-chart__canvas{border-block:1px solid var(--line);background:linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 44%, transparent), transparent);width:100%;height:320px;margin-top:12px}.telemetry-chart__summary{min-height:34px;color:var(--text-muted);flex-wrap:wrap;align-items:center;gap:10px;padding-top:10px;font-size:10px;display:flex}.telemetry-chart__summary span:last-child{font-family:var(--font-mono);margin-inline-start:auto}.telemetry-chart__empty{text-align:center;place-content:center;gap:6px;min-height:260px;display:grid}.telemetry-chart__empty strong{color:var(--text-soft);font-size:13px}.telemetry-chart__empty span{color:var(--text-muted);font-size:10px}.recharts-default-legend{flex-wrap:wrap;justify-content:center;gap:8px 14px;display:flex}.recharts-legend-item{margin:0!important}.recharts-tooltip-wrapper{outline:0}.sr-only{clip:rect(0, 0, 0, 0)!important;white-space:nowrap!important;border:0!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;position:absolute!important;overflow:hidden!important}.dashboard-layout-grid{grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);align-items:start;gap:14px;display:grid}.dashboard-layout-grid>[data-layout-card-id=telemetry]{grid-column:1/-1}.dashboard-layout-grid>[data-layout-card-id=outputs]{grid-row:span 2}.output-matrix{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;display:grid}.output-cell{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);cursor:pointer;flex-direction:column;align-items:flex-start;gap:7px;min-height:84px;padding:13px;transition:border-color .3s,background .3s,box-shadow .3s;display:flex;position:relative;overflow:hidden}.output-cell:before{content:"";background:linear-gradient(120deg, transparent, var(--green-soft), transparent);transition:translate .58s var(--ease-out);position:absolute;inset:0;translate:-110%}.output-cell:hover:not(:disabled):before{translate:110%}.output-cell:disabled{opacity:.4;cursor:not-allowed}.output-cell span{color:var(--text-muted);font:600 10px var(--font-mono)}.output-cell strong{font-size:12px}.output-cell i{inset-inline:13px;background:var(--line-strong);height:2px;position:absolute;bottom:10px}.output-cell i:after{content:"";background:var(--text-muted);width:22%;height:100%;transition:width .35s var(--ease-out), background .35s, box-shadow .35s;display:block}.output-cell.is-active{background:var(--green-soft);border-color:color-mix(in srgb, var(--green) 40%, transparent);box-shadow:inset 0 0 28px color-mix(in srgb, var(--green-soft) 50%, transparent)}.output-cell.is-active strong{color:var(--green)}.output-cell.is-active i:after{background:var(--green);width:100%;box-shadow:0 0 8px var(--green)}.safety-strip{border-top:1px solid var(--line);color:var(--green);align-items:center;gap:8px;margin-top:13px;padding-top:12px;display:flex}.safety-strip span{color:var(--text-muted);font-size:10px}.controller-estop{border:1px solid var(--line);background:var(--surface);border-radius:12px;margin:0 0 16px;padding:10px 12px}.controller-estop span{flex:1;font-size:12px}.controller-estop.is-danger{border-color:color-mix(in srgb, var(--red) 55%, var(--line));color:var(--red);background:color-mix(in srgb, var(--red) 8%, var(--surface))}.controller-estop.is-danger span{color:var(--text)}.measurement-alerts{flex-wrap:wrap;gap:8px;display:flex}.measurement-alert{border:1px solid color-mix(in srgb, var(--amber) 35%, transparent);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--amber) 8%, transparent);color:var(--amber);align-items:center;gap:7px;padding:8px 10px;font-size:10px;display:inline-flex}.hardware-alert{border:1px solid color-mix(in srgb, var(--red) 52%, transparent);border-radius:var(--radius);background:color-mix(in srgb, var(--red) 10%, var(--surface));box-shadow:inset 3px 0 0 var(--red);align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.hardware-alert.is-warning{border-color:color-mix(in srgb, var(--amber) 48%, transparent);background:color-mix(in srgb, var(--amber) 9%, var(--surface));box-shadow:inset 3px 0 0 var(--amber)}.hardware-alert__icon{color:var(--red);flex:none;place-items:center;display:grid}.hardware-alert.is-warning .hardware-alert__icon{color:var(--amber)}.hardware-alert__copy{flex-direction:column;gap:4px;min-width:0;display:flex}.hardware-alert__copy strong{color:var(--text);font-size:13px}.hardware-alert__copy p{color:var(--text-soft);margin:0;font-size:11px;line-height:1.5}.hardware-alert__copy span{color:var(--text-muted);font:500 9px var(--font-mono)}.hardware-alert__copy .hardware-alert__impact{color:var(--red);font-weight:700}.app-hardware-alert{margin-bottom:14px}.data-list{flex-direction:column;display:flex}.data-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:18px;min-height:34px;padding:8px 0;display:flex}.data-row:last-child{border-bottom:0}.data-row>span{color:var(--text-muted);font-size:10px}.data-row strong{max-width:66%;color:var(--text-soft);text-align:end;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:580;overflow:hidden}.text-good{color:var(--green)!important}.text-warn{color:var(--amber)!important}.text-bad{color:var(--red)!important}.action-grid{grid-template-columns:1fr 1fr;gap:8px;display:grid}.action-grid .button{min-height:48px}.dashboard-layout-grid>[data-layout-card-id=events]{grid-column:2}.empty-state{text-align:start;justify-content:center;align-items:center;gap:14px;min-height:130px;padding:20px;display:flex}.empty-state__icon{border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--surface-muted);width:50px;height:50px;color:var(--text-muted);place-items:center;display:grid}.empty-state strong{font-size:12px}.empty-state p{max-width:420px;color:var(--text-muted);margin:5px 0 0;font-size:10px;line-height:1.5}.controller-unavailable{text-align:center;place-content:center;justify-items:center;gap:12px;min-height:150px;padding:20px;display:grid}.controller-unavailable>strong{color:var(--text);letter-spacing:-.015em;font-size:14px;font-weight:650}.controller-unavailable__icon{border:1px solid color-mix(in srgb, var(--red) 30%, var(--line));background:color-mix(in srgb, var(--red) 8%, var(--surface-muted));width:64px;height:64px;color:var(--red);border-radius:18px;place-items:center;display:grid;box-shadow:inset 0 1px #ffffff0a,0 14px 36px #0000001f}.controller-unavailable.is-board-offline .controller-unavailable__icon{border-color:color-mix(in srgb, var(--amber) 30%, var(--line));background:color-mix(in srgb, var(--amber) 8%, var(--surface-muted));color:var(--amber)}.controller-unavailable__action{margin-top:2px}.hero-panel .controller-unavailable{text-align:start;place-content:center start;justify-items:start;min-height:105px;padding:0}.hero-panel .controller-unavailable__icon{width:58px;height:58px}.connection-state{--connection-color:var(--amber);border:1px solid color-mix(in srgb, var(--connection-color) 35%, var(--line));background:linear-gradient(135deg, color-mix(in srgb, var(--connection-color) 13%, var(--surface)), color-mix(in srgb, var(--surface-muted) 90%, transparent));border-radius:18px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;width:100%;padding:16px;display:grid;position:relative;overflow:hidden;box-shadow:inset 0 1px #ffffff0b,0 18px 48px #0000001f}.connection-state:before{content:"";background:linear-gradient(180deg, color-mix(in srgb, var(--connection-color) 72%, white), var(--connection-color));width:4px;position:absolute;inset:0 auto 0 0}[dir=rtl] .connection-state:before{inset:0 0 0 auto}.connection-state--good{--connection-color:var(--green)}.connection-state--info{--connection-color:var(--accent)}.connection-state--warn{--connection-color:var(--amber)}.connection-state--bad{--connection-color:var(--red)}.connection-state--neutral{--connection-color:var(--text-muted)}.connection-state__icon{width:54px;height:54px;color:var(--connection-color);background:color-mix(in srgb, var(--connection-color) 13%, var(--surface));border:1px solid color-mix(in srgb, var(--connection-color) 30%, var(--line));box-shadow:0 12px 30px color-mix(in srgb, var(--connection-color) 15%, transparent);border-radius:16px;place-items:center;display:grid}.connection-state.is-attempting .connection-state__icon{animation:1.15s ease-in-out infinite connection-icon-pulse}.connection-state__body{min-width:0}.connection-state__heading{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.connection-state__heading strong{color:var(--text);letter-spacing:-.015em;font-size:15px}.connection-state__attempt{border:1px solid color-mix(in srgb, var(--connection-color) 32%, var(--line));color:var(--connection-color);background:color-mix(in srgb, var(--connection-color) 8%, transparent);text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:750}.connection-state__body>p{color:var(--text-muted);overflow-wrap:anywhere;margin:5px 0 0;line-height:1.55}.connection-state__facts{color:color-mix(in srgb, var(--text) 70%, var(--text-muted));flex-wrap:wrap;align-items:center;gap:7px 14px;margin-top:9px;font-size:12px;display:flex}.connection-state__facts span{align-items:center;gap:5px;display:inline-flex}.connection-state__facts svg{color:var(--connection-color)}.connection-state__actions{gap:8px;min-width:max-content;display:grid}.hero-panel .connection-state{min-width:min(680px,78vw)}@keyframes connection-icon-pulse{0%,to{box-shadow:0 12px 30px color-mix(in srgb, var(--connection-color) 13%, transparent);transform:scale(1)}50%{box-shadow:0 14px 36px color-mix(in srgb, var(--connection-color) 28%, transparent);transform:scale(1.045)}}@media (max-width:700px){.connection-state{grid-template-columns:auto minmax(0,1fr)}.connection-state__actions{grid-column:1/-1;width:100%}.connection-state__actions .button{width:100%}.hero-panel .connection-state{min-width:0}}.connection-fuji{filter:drop-shadow(0 16px 28px #0003);width:144px;height:76px;position:relative;overflow:hidden}.connection-fuji>span{pointer-events:none;position:absolute}.connection-fuji__sun{top:5px;background:color-mix(in srgb, var(--red) 82%, white);width:22px;height:22px;box-shadow:0 0 0 7px color-mix(in srgb, var(--red) 9%, transparent);border-radius:50%;animation:2.8s ease-in-out infinite connection-sun;inset-inline-end:20px}.connection-fuji__rear{background:color-mix(in srgb, var(--text-muted) 20%, transparent);clip-path:polygon(0 100%,22% 62%,36% 74%,54% 27%,72% 75%,83% 62%,100% 100%);inset:24px 4px 0}.connection-fuji__face{background:linear-gradient(138deg, color-mix(in srgb, var(--violet) 44%, var(--surface-muted)), color-mix(in srgb, var(--text-muted) 28%, var(--surface)) 52%, var(--surface-muted) 53%);clip-path:polygon(7% 100%,50% 6%,93% 100%);animation:connection-mountain 1.15s var(--ease-out) both;inset:7px 20px 0}.connection-fuji__snow{background:linear-gradient(135deg, var(--text), color-mix(in srgb, var(--text) 60%, var(--violet)));clip-path:polygon(35% 40%,50% 6%,65% 40%,59% 35%,55% 44%,50% 34%,45% 44%,41% 35%);animation:connection-snow .9s var(--ease-out) .18s both;inset:7px 20px 0}.connection-fuji__trace{background:linear-gradient(90deg, transparent, var(--accent) 48%, var(--text) 51%, transparent);clip-path:polygon(7% 100%,49.4% 6%,50.6% 6%,93% 100%,91.8% 100%,50% 9%,8.2% 100%);opacity:.7;animation:1.8s ease-in-out infinite connection-trace;inset:7px 20px 0}@keyframes connection-sun{50%{opacity:.55;transform:scale(.88)}}@keyframes connection-mountain{0%{opacity:0;clip-path:polygon(50% 100%,50% 100%,50% 100%);filter:blur(8px)}}@keyframes connection-snow{0%{opacity:0;transform:translateY(5px)}}@keyframes connection-trace{50%{opacity:.2;filter:brightness(1.8) drop-shadow(0 0 5px var(--accent))}}.control-layout{grid-template-columns:1.1fr .9fr;align-items:start;gap:14px;display:grid}.workbench-grid{grid-template-columns:repeat(12,minmax(0,1fr));align-items:stretch;gap:14px;display:grid}.workbench-grid>.card-layout-frame{grid-column:span 4;min-width:0;height:100%}.workbench-grid>[data-layout-card-id=terminal]{grid-column:1/-1;min-height:420px}.workbench-grid .card__header{min-height:42px}.card-layout-frame{flex-direction:column;gap:7px;min-width:0;transition:opacity .18s,transform .18s;display:flex;position:relative}.card-layout-frame>.card{flex:1;width:100%;height:100%}.card-layout-frame.is-dragging{z-index:4;opacity:.68;transform:scale(.99)}.card-layout-frame__toolbar{border:1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));background:color-mix(in srgb, var(--surface-muted) 88%, transparent);min-height:38px;color:var(--text-muted);border-radius:10px;align-items:center;gap:6px;padding:5px 7px;display:flex}.card-layout-frame__toolbar strong{min-width:0;color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:10px;overflow:hidden}.card-layout-frame__toolbar button{width:28px;height:28px;color:var(--text-muted);cursor:pointer;touch-action:none;background:0 0;border:0;border-radius:7px;flex:0 0 28px;place-items:center;display:grid}.card-layout-frame__toolbar button:hover,.card-layout-frame__toolbar button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:none}.card-layout-frame__reorder{cursor:grab!important}.card-layout-frame__reorder:active{cursor:grabbing!important}.card-layout-frame.is-collapsed .card-layout-frame__toolbar>button svg{transition:transform .18s}.card-layout-frame:not(.is-collapsed) .card-layout-frame__toolbar>button[aria-expanded=true] svg{transform:rotate(180deg)}.header-actions{position:relative}.card-layout-editor{z-index:35;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 97%, transparent);width:min(430px,100vw - 36px);box-shadow:var(--shadow);-webkit-backdrop-filter:blur(20px)saturate(1.12);backdrop-filter:blur(20px)saturate(1.12);border-radius:12px;flex-wrap:wrap;justify-content:flex-end;gap:7px;padding:9px;display:flex;position:absolute;inset-block-start:calc(100% + 8px);inset-inline-end:0}.card-layout-editor__hidden{flex-wrap:wrap;flex:100%;align-items:center;gap:6px;display:flex}.card-layout-editor__hidden>span{color:var(--text-muted);margin-inline-end:auto;font-size:9px}.terminal-transport{flex-wrap:wrap;justify-content:flex-end;gap:5px;display:flex}.terminal-transcript{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(180deg, color-mix(in srgb, var(--bg-deep) 92%, transparent), var(--bg-deep));scrollbar-gutter:stable;min-height:220px;max-height:360px;padding:15px 17px;overflow:auto;box-shadow:inset 0 1px #ffffff06,inset 0 0 36px #00000029}.terminal-transcript pre{color:var(--text-soft);font:10px/1.65 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 7px}.terminal-transcript pre:first-child{color:var(--accent)}.terminal-transcript pre:nth-child(2){color:var(--text-muted)}.terminal-line[data-level=info]{color:var(--accent)}.terminal-line[data-level=warn]{color:var(--amber)}.terminal-line[data-level=error]{color:var(--red)}.terminal-line[data-level=debug]{color:var(--text-muted)}.console-record{color:var(--text-soft);font:10px/1.65 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 7px;padding-inline-start:var(--console-indent,0)}.console-record[data-level=info]{color:var(--accent)}.console-record[data-level=warn]{color:var(--amber)}.console-record[data-level=error]{border-inline-start:2px solid var(--red);background:linear-gradient(90deg, var(--red-soft), transparent 72%);color:var(--red);padding-block:3px}.console-record[data-level=debug]{color:var(--text-muted)}.console-record--group{color:var(--violet);font-weight:650}.console-group-mark{width:16px;color:var(--accent);display:inline-block}.console-token--number,.console-token--bigint{color:var(--violet)}.console-token--boolean{color:var(--amber)}.console-token--null,.console-token--undefined{color:var(--text-muted)}.console-token--object,.console-token--array{color:var(--green)}.console-token--error{color:var(--red)}.console-record--table{white-space:normal;max-width:100%;overflow-x:auto}.console-record--table table{border-spacing:0;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--bg-deep) 88%, transparent);border-radius:7px;width:max-content;min-width:min(100%,440px);overflow:hidden}.console-record--table th,.console-record--table td{border-inline-end:1px solid var(--line);border-bottom:1px solid var(--line);text-align:start;overflow-wrap:anywhere;max-width:280px;padding:6px 9px}.console-record--table th{background:var(--accent-soft);color:var(--accent);font-weight:700}.console-record--table tr:last-child td{border-bottom:0}.console-record--table th:last-child,.console-record--table td:last-child{border-inline-end:0}.console-record--table small{color:var(--text-muted);margin-top:5px;display:block}.terminal-console-help{color:var(--text-muted);font:8px/1.5 var(--font-mono);letter-spacing:.025em;margin:7px 3px 0}.terminal-event-strip{scrollbar-width:thin;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:10px;display:grid;overflow-x:auto}.terminal-event-strip button{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:145px;color:var(--text-soft);text-align:start;cursor:pointer;grid-template-columns:auto 1fr;gap:3px 8px;padding:9px 10px;transition:border-color .22s,background .22s,filter .22s;display:grid;overflow:hidden}.terminal-event-strip button:hover,.terminal-event-strip button:focus-visible{border-color:color-mix(in srgb, var(--accent) 44%, var(--line));background:linear-gradient(105deg, var(--accent-soft), var(--surface-hover));filter:saturate(1.12)}.terminal-event-strip time{color:var(--text-muted);font:8px var(--font-mono)}.terminal-event-strip strong{min-width:0;color:var(--accent);font:650 8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.terminal-event-strip span{min-width:0;color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;grid-column:1/-1;font-size:9px;overflow:hidden}.compact-fields{grid-template-columns:1.25fr repeat(4,minmax(72px,.7fr));align-items:end;gap:8px;display:grid}.compact-fields .text-field{min-width:0;margin-block:10px 0}.relay-control-card{grid-row:span 2}.relay-bank{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;display:grid}.relay-switch{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);flex-direction:column;justify-content:center;align-items:center;gap:9px;min-height:150px;padding:10px;transition:border-color .3s,background .3s,box-shadow .3s;display:flex}.relay-switch:disabled{opacity:.4;cursor:not-allowed}.relay-switch>span{color:var(--text-soft);font:650 11px var(--font-mono)}.relay-switch__toggle{cursor:pointer;background:0 0;border:0;border-radius:8px;place-items:center;padding:4px 12px;display:grid}.relay-switch__toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.relay-switch__toggle>i{border:1px solid var(--line-strong);background:var(--bg-deep);border-radius:8px;width:34px;height:58px;display:block;position:relative;box-shadow:inset 0 5px 14px #00000042}.relay-switch__toggle>i b{inset:5px;background:linear-gradient(var(--text-muted), color-mix(in srgb, var(--text-muted) 55%, var(--surface-solid)));height:20px;transition:top .42s var(--ease-out), background .3s, box-shadow .3s;border-radius:5px;position:absolute;top:29px;box-shadow:0 3px 8px #00000047}.relay-switch>small{color:var(--text-muted);font-size:8px}.relay-switch.is-active{border-color:color-mix(in srgb, var(--green) 46%, transparent);background:var(--green-soft);box-shadow:inset 0 0 28px color-mix(in srgb, var(--green-soft) 60%, transparent)}.relay-switch.is-active .relay-switch__toggle>i b{background:linear-gradient(var(--green), color-mix(in srgb, var(--green) 55%, var(--surface-solid)));box-shadow:0 0 13px color-mix(in srgb, var(--green) 45%, transparent);top:8px}.relay-switch__actions{grid-template-columns:1fr 1fr;gap:5px;width:100%;display:grid}.motion-actions{gap:8px;margin:14px 0;display:grid}.motion-side{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);grid-template-columns:minmax(80px,1fr) repeat(3,auto);align-items:center;gap:7px;padding:9px;display:grid}.motion-side strong{font:600 9px var(--font-mono);color:var(--text-muted)}.motion-side__identity{justify-content:space-between;align-items:center;gap:8px;min-width:0;display:flex}.channel-selector{grid-template-columns:repeat(8,1fr);gap:5px;display:grid}.channel-selector button{aspect-ratio:1;border:1px solid var(--line);background:var(--surface-muted);color:var(--text-muted);font:550 9px var(--font-mono);cursor:pointer;border-radius:6px;transition:all .22s}.channel-selector button:hover{color:var(--text);border-color:var(--line-strong)}.channel-selector button.is-active{background:var(--violet-soft);color:var(--violet);border-color:color-mix(in srgb, var(--violet) 40%, transparent);box-shadow:inset 0 0 13px var(--violet-soft)}.pwm-readout{justify-content:flex-end;align-items:baseline;gap:7px;margin:16px 0 8px;display:flex}.pwm-readout>span{color:var(--violet);font:600 10px var(--font-mono);margin-inline-end:auto}.pwm-readout strong{font:650 28px var(--font-mono);letter-spacing:-.05em}.pwm-readout small{color:var(--text-muted);font:9px var(--font-mono)}.pwm-mixer{scrollbar-gutter:stable;gap:7px;min-width:0;max-height:620px;padding-inline-end:12px;display:grid;overflow:auto}.pwm-mixer__row{border:1px solid var(--line);background:var(--surface-muted);border-radius:10px;grid-template-columns:minmax(170px,.55fr) minmax(210px,1fr) auto;align-items:center;gap:11px;padding:8px 10px;transition:border-color .25s,background .25s;display:grid}.pwm-mixer__row.is-live{border-color:color-mix(in srgb, var(--violet) 48%, transparent);background:var(--violet-soft)}.pwm-mixer__row.is-pending{border-color:color-mix(in srgb, var(--amber) 52%, var(--line));background:color-mix(in srgb, var(--amber-soft) 52%, var(--surface-muted));box-shadow:inset 3px 0 0 color-mix(in srgb, var(--amber) 72%, transparent)}.pwm-mixer__row>div:first-child{gap:2px;display:grid}.pwm-mixer__row strong{color:var(--text);font-size:10px}.pwm-mixer__row small{font:8px var(--font-mono);color:var(--text-muted)}.pwm-mixer__row .range-field{margin:0}.pwm-mixer__actions{gap:4px;display:flex}.pwm-channel-config{gap:5px;margin-top:3px;display:flex}.pwm-channel-config select{border:1px solid var(--line);background:var(--surface);min-width:0;color:var(--text);font:8px var(--font-ui);border-radius:7px;padding:3px 5px}.system-output-summary{border:1px solid var(--line);background:var(--surface-muted);border-radius:11px;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;padding:10px;display:grid}.system-output-summary>span{gap:3px;min-width:0;display:grid}.system-output-summary strong{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.system-output-summary small{color:var(--text-muted);font:8px var(--font-mono)}.pwm-authority-status{border-inline-start:3px solid var(--violet);background:var(--violet-soft);min-height:32px;color:var(--text-soft);border-radius:7px;padding:8px 10px;font-size:9px;line-height:1.55;transition:border-color .24s,background .24s,color .24s}.pwm-authority-status.is-error{border-color:var(--red);background:var(--red-soft);color:var(--red)}.rgb-board-state{border:1px solid var(--line);background:var(--surface-muted);color:var(--text-muted);border-radius:9px;justify-content:space-between;align-items:center;gap:14px;padding:8px 10px;font-size:9px;display:flex}.rgb-board-state strong{color:var(--text-soft);font:9px var(--font-mono)}.range-field{margin:14px 0;display:block}.range-field.is-disabled{opacity:.45}.range-field__label{justify-content:space-between;align-items:center;margin-bottom:7px;display:flex}.range-field__label strong{color:var(--text-soft);font-size:10px;font-weight:560}.range-field__label output{color:var(--text-muted);font:550 9px var(--font-mono)}.range-field input[type=range]{appearance:none;background:linear-gradient(90deg, var(--accent) var(--range), var(--line-strong) var(--range));cursor:pointer;border-radius:2px;width:100%;height:5px;margin:0}[dir=rtl] .range-field input[type=range]{background:linear-gradient(90deg, var(--line-strong) calc(100% - var(--range)), var(--accent) calc(100% - var(--range)))}.range-field input[type=range]::-webkit-slider-thumb{appearance:none;border:2px solid var(--surface-solid);background:var(--accent);width:15px;height:18px;box-shadow:0 0 0 1px var(--accent), 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);border-radius:4px}.range-field__value{border:1px solid var(--line);background:var(--surface-muted);min-height:28px;color:var(--text-muted);font:600 9px var(--font-mono);border-radius:8px;grid-template-columns:minmax(38px,auto) auto;align-items:center;gap:3px;padding:2px 7px;display:inline-grid}.range-field__number{width:7ch;min-width:38px;color:var(--text);font:inherit;text-align:end;appearance:textfield;background:0 0;border:0;outline:0;padding:2px 0}.range-field__number::-webkit-inner-spin-button{opacity:.45}.range-field__value:focus-within{border-color:color-mix(in srgb, var(--accent) 48%, var(--line));box-shadow:inset 0 0 12px var(--accent-soft)}.inline-actions,.operation-buttons{flex-wrap:wrap;gap:8px;margin-top:15px;display:flex}.color-preview{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(115deg, color-mix(in srgb, var(--preview) 45%, var(--surface-solid)), var(--surface-muted));align-items:flex-end;min-height:80px;margin-bottom:13px;padding:14px;display:flex;position:relative;overflow:hidden}.color-preview:before{display:none}.color-preview span{inset-inline-end:15px;background:var(--preview);width:50px;height:7px;box-shadow:0 0 22px var(--preview);position:absolute;top:14px}.color-preview strong{font:600 10px var(--font-mono);color:#fff;text-shadow:0 2px 5px #0006;position:relative}.status-led-previews{grid-template-columns:minmax(0,1fr) minmax(0,.8fr);gap:10px;display:grid}.status-led-live{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);align-items:center;gap:13px;min-height:80px;margin-bottom:13px;padding:13px;display:flex}.status-led-live i{background:var(--preview);border:2px solid color-mix(in srgb, var(--preview) 65%, white);width:34px;height:34px;box-shadow:0 0 9px var(--preview), 0 0 28px color-mix(in srgb, var(--preview) 70%, transparent);border-radius:50%;flex:none}.status-led-live div{gap:3px;min-width:0;display:grid}.status-led-live small{color:var(--text-muted);overflow-wrap:anywhere}.native-color-field,.rgb-effect-fields label,.rgb-profile-row label{color:var(--text-muted);align-items:center;gap:9px;font-size:12px;display:flex}.native-color-field input[type=color]{border:1px solid var(--line);background:var(--surface-muted);cursor:pointer;border-radius:8px;width:46px;height:32px;padding:2px}.native-color-field code{color:var(--text);direction:ltr}.rgb-effect-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;display:grid}.rgb-effect-fields label,.rgb-profile-row label{border:1px solid var(--line);background:var(--surface-muted);border-radius:10px;justify-content:space-between;padding:9px 11px}.rgb-effect-fields select,.rgb-effect-fields input,.rgb-profile-row select{min-width:0;color:var(--text);border:1px solid var(--line);background:var(--surface-solid);border-radius:7px;padding:6px 8px}.rgb-profile-row{align-items:stretch;gap:10px;margin-top:12px;display:flex}.rgb-profile-row label{flex:1}@media (max-width:720px){.status-led-previews,.rgb-effect-fields{grid-template-columns:1fr}.rgb-profile-row{flex-direction:column}}.console-card{grid-column:1/-1}.command-form{border:1px solid var(--line);border-radius:var(--radius);background:var(--bg-deep);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;padding:8px;display:grid}.command-prompt{color:var(--accent);font:700 13px var(--font-mono);padding-inline-start:5px}.command-form input{min-width:0;color:var(--text);font:12px var(--font-mono);background:0 0;border:0;outline:0}.terminal-command-box{min-width:0;position:relative}.terminal-command-box>input{width:100%}.terminal-completions{z-index:30;border:1px solid var(--line-strong);background:var(--surface-solid);max-height:250px;box-shadow:var(--shadow-tight);border-radius:10px;padding:5px;display:grid;position:absolute;inset:calc(100% + 9px) 0 auto;overflow:auto}.terminal-completions button{color:var(--text);text-align:start;cursor:pointer;background:0 0;border:0;border-radius:7px;grid-template-columns:minmax(72px,auto) minmax(0,1fr);align-items:baseline;gap:10px;padding:8px 9px;display:grid}.terminal-completions button:hover,.terminal-completions button[aria-selected=true]{background:var(--accent-soft)}.terminal-completions strong{font:700 10px var(--font-mono)}.terminal-completions small{color:var(--text-muted);font:9px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.command-output,.diagnostic-output,.operation-output{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--bg-deep) 90%, transparent);min-height:120px;max-height:340px;color:var(--text-soft);font:10px/1.65 var(--font-mono);white-space:pre-wrap;margin:10px 0;padding:14px;overflow:auto}.command-chips{flex-wrap:wrap;gap:6px;display:flex}.command-chips button,.diagnostic-picker button{border:1px solid var(--line);background:var(--surface-muted);color:var(--text-muted);font:9px var(--font-mono);cursor:pointer;border-radius:6px;padding:5px 8px}.device-layout{grid-template-columns:minmax(330px,.86fr) minmax(420px,1.14fr);align-items:start;gap:14px;display:grid}.device-stage{background:linear-gradient(150deg, color-mix(in srgb, var(--violet-soft) 32%, var(--glass-strong)), color-mix(in srgb, var(--amber-soft) 18%, var(--surface)));flex-direction:column;min-height:390px;transition:background-color .28s,border-color .28s;display:flex}.device-stage.is-on{border-color:color-mix(in srgb, var(--green) 28%, var(--line));background:linear-gradient(150deg, color-mix(in srgb, var(--violet-soft) 40%, var(--glass-strong)), color-mix(in srgb, var(--green-soft) 42%, var(--surface)))}.device-overview{grid-template-columns:86px minmax(0,1fr);align-items:center;gap:18px;padding:24px 0 22px;display:grid}.device-overview__mark{border:1px solid color-mix(in srgb, var(--violet) 32%, var(--line));background:linear-gradient(145deg, var(--violet-soft), var(--surface-muted));width:86px;height:86px;color:var(--violet);border-radius:22px;place-items:center;display:grid;position:relative;box-shadow:inset 0 1px #ffffff0d,0 18px 34px #0000001f}.device-overview__mark span{inset-inline-end:12px;background:var(--amber);width:18px;height:5px;box-shadow:0 0 14px color-mix(in srgb, var(--amber) 48%, transparent);border-radius:3px;transition:background-color .25s,box-shadow .25s;position:absolute;bottom:12px}.device-stage.is-on .device-overview__mark span{background:var(--green);box-shadow:0 0 14px color-mix(in srgb, var(--green) 48%, transparent)}.device-overview__copy{flex-direction:column;min-width:0;display:flex}.device-overview__copy>span{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.device-overview__copy strong{color:var(--text);letter-spacing:-.025em;margin-top:7px;font-size:17px}.device-overview__copy small{color:var(--text-soft);margin-top:8px;font-size:10px;line-height:1.5}.device-facts{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.device-facts>div{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 78%, transparent);border-radius:12px;min-width:0;padding:12px}.device-facts span,.device-facts strong{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.device-facts span{color:var(--text-muted);font-size:8px}.device-facts strong{color:var(--text-soft);margin-top:6px;font-size:11px}.device-actions{grid-template-columns:repeat(3,1fr);gap:8px;margin-top:auto;padding-top:24px;display:grid}.device-stage .empty-state{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);flex-wrap:wrap;justify-content:flex-start;margin-top:18px}.device-unavailable__actions{flex-wrap:wrap;gap:8px;margin-inline-start:auto;display:flex}.device-side{gap:14px;display:grid}.message-compose{grid-template-columns:1fr auto;gap:8px;display:grid}.message-compose input,.text-field input{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:0;height:39px;color:var(--text);outline:0;padding:0 12px;font-size:11px;transition:border-color .2s,box-shadow .2s}.message-compose input:focus,.text-field input:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 16px var(--accent-soft)}.beep-row{border-top:1px solid var(--line);align-items:center;gap:7px;margin-top:12px;padding-top:12px;display:flex}.beep-row>div{color:var(--text-muted);flex:1;align-items:center;gap:8px;font-size:10px;display:flex}.diagnostic-picker{flex-wrap:wrap;gap:5px;display:flex}.diagnostic-picker button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 35%, transparent);background:var(--accent-soft)}.inline-error-presence{will-change:height, opacity, clip-path, filter;overflow:clip}.inline-error,.integration-banner{border:1px solid color-mix(in srgb, var(--red) 35%, transparent);border-radius:var(--radius-sm);background:var(--red-soft);color:var(--red);align-items:flex-start;gap:9px;margin-top:14px;padding:10px 12px;font-size:10px;display:flex}.subnav{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);gap:6px;width:-moz-fit-content;width:fit-content;margin-bottom:14px;padding:5px;display:flex}.subnav button{min-height:36px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:9px;align-items:center;gap:8px;padding:7px 12px;font-size:11px;display:flex}.subnav button:hover{color:var(--text)}.subnav button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 20%, transparent);background:var(--accent-soft)}.integration-banner{max-width:850px;margin:0 0 14px;overflow:hidden}.integration-banner div{color:var(--text-soft)}.integration-banner strong{font-size:11px}.integration-banner p{color:var(--text-muted);font:9px var(--font-mono);margin:3px 0 0}.records-card{padding-inline:0;padding-bottom:0}.records-card .card__header{padding-inline:20px}.typed-collection{min-width:0;color:var(--text-soft);position:relative}.records-card>.typed-collection{border-top:1px solid var(--line)}.typed-collection__toolbar{z-index:6;border-bottom:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);flex-wrap:wrap;align-items:center;gap:8px;min-height:54px;padding:9px 14px;display:flex;position:relative}.typed-collection__search{border:1px solid var(--line);background:var(--surface-solid);min-width:min(310px,42vw);height:36px;color:var(--text-muted);border-radius:9px;flex:220px;align-items:center;gap:8px;padding-inline:10px 5px;transition:border-color .2s,box-shadow .2s,background-color .2s;display:flex}.typed-collection__search:focus-within{border-color:color-mix(in srgb, var(--violet) 52%, var(--line));background:color-mix(in srgb, var(--violet-soft) 18%, var(--surface-solid));box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 12%, transparent)}.typed-collection__search input{min-width:0;color:var(--text);font:10px var(--font-ui);background:0 0;border:0;outline:0;flex:1}.typed-collection__search>button{width:27px;height:27px;color:var(--text-muted);cursor:pointer;background:0 0;border:0;border-radius:7px;flex:none;place-items:center;transition:color .18s,background-color .18s;display:grid}.typed-collection__search>button:hover{background:var(--surface-hover);color:var(--text)}.typed-collection__summary{min-height:30px;color:var(--text-muted);font:8px var(--font-mono);white-space:nowrap;align-items:center;gap:5px;padding-inline:7px;display:inline-flex}.typed-collection__summary strong{color:var(--text-soft);font-size:10px}.typed-collection__summary i{background:var(--line-strong);width:1px;height:14px;margin-inline:3px}.typed-collection__quiet-action{min-height:31px;color:var(--violet);font:8px var(--font-ui);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:8px;padding:5px 9px}.typed-collection__quiet-action:hover,.typed-collection__quiet-action:focus-visible{border-color:color-mix(in srgb, var(--violet) 26%, var(--line));background:var(--violet-soft);outline:none}.typed-collection__popover{position:relative}.typed-collection__popover>summary{border:1px solid var(--line);background:var(--surface-solid);min-height:34px;color:var(--text-muted);font:600 9px var(--font-ui);cursor:pointer;border-radius:9px;align-items:center;gap:7px;padding:6px 10px;list-style:none;transition:border-color .2s,background-color .2s,color .2s;display:inline-flex}.typed-collection__popover>summary::-webkit-details-marker{display:none}.typed-collection__popover>summary:hover,.typed-collection__popover[open]>summary{border-color:color-mix(in srgb, var(--violet) 38%, var(--line));background:var(--violet-soft);color:var(--violet)}.typed-collection__popover>summary:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 16%, transparent);outline:none}.typed-collection__popover-panel{z-index:18;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 96%, transparent);-webkit-backdrop-filter:blur(24px)saturate(1.12);backdrop-filter:blur(24px)saturate(1.12);border-radius:12px;gap:4px;width:min(410px,100vw - 32px);max-height:min(520px,100dvh - 130px);padding:7px;animation:.2s cubic-bezier(.22,1,.36,1) typed-collection-popover;display:grid;position:absolute;inset-block-start:calc(100% + 7px);inset-inline-end:0;overflow:auto;box-shadow:0 22px 68px #0000004f}@keyframes typed-collection-popover{0%{opacity:0;clip-path:inset(0 0 18% round 12px);transform:translateY(-6px)}to{opacity:1;clip-path:inset(0 round 12px);transform:translateY(0)}}.typed-collection__export .typed-collection__popover-panel{width:190px}.typed-collection__export .typed-collection__popover-panel>button{min-height:36px;color:var(--text-soft);text-align:start;font:9px var(--font-ui);cursor:pointer;background:0 0;border:0;border-radius:8px;padding-inline:10px;transition:background-color .16s,color .16s}.typed-collection__export .typed-collection__popover-panel>button:hover,.typed-collection__export .typed-collection__popover-panel>button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.typed-collection__export .typed-collection__popover-panel>button:disabled{opacity:.38;cursor:not-allowed}.typed-collection__column-option{border:1px solid #0000;border-radius:9px;grid-template-columns:minmax(160px,1fr) auto;align-items:center;gap:6px 10px;padding:8px;transition:border-color .16s,background-color .16s;display:grid}.typed-collection__column-option:hover{border-color:var(--line);background:var(--surface-muted)}.typed-collection__column-option>label:first-child{min-width:0;color:var(--text-soft);font:9px var(--font-ui);cursor:pointer;align-items:center;gap:7px;display:flex}.typed-collection__column-option>label:first-child span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.typed-collection__column-option>label:first-child input{accent-color:var(--violet)}.typed-collection__column-drag{border:1px solid var(--line);background:var(--surface-solid);width:28px;height:28px;color:var(--text-muted);cursor:grab;touch-action:none;border-radius:7px;place-items:center;display:grid}.typed-collection__column-drag:hover,.typed-collection__column-drag:focus-visible{border-color:color-mix(in srgb, var(--violet) 35%, var(--line));color:var(--violet);outline:0}.typed-collection__column-drag:active{cursor:grabbing}.typed-collection__column-drag:disabled{opacity:.28;cursor:not-allowed}.typed-collection__viewport{overscroll-behavior:contain;box-sizing:border-box;scrollbar-gutter:stable both-edges;background:color-mix(in srgb, var(--bg-deep) 18%, transparent);max-height:calc(100dvh - 285px);padding-inline-start:12px;position:relative;overflow:auto}.typed-collection__grid{table-layout:fixed;border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:10px}.typed-collection__select-column{width:42px}.typed-collection__grid th{z-index:4;border-block-end:1px solid var(--line-strong);border-inline-end:1px solid var(--line);background:color-mix(in srgb, var(--glass-strong) 95%, transparent);height:42px;color:var(--text-muted);text-align:start;-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px);outline:0;padding:0;position:sticky;inset-block-start:0}.typed-collection__grid th:last-child{border-inline-end:0}.typed-collection__grid th:focus-visible{z-index:7;box-shadow:inset 0 0 0 2px var(--violet)}.typed-collection__sort{width:100%;height:100%;color:inherit;text-align:start;font:700 8px var(--font-mono);letter-spacing:.07em;text-transform:uppercase;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;gap:9px;padding-inline:11px 61px;display:flex;overflow:hidden}.typed-collection__sort:disabled{cursor:default}.typed-collection__sort span:first-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.typed-collection__sort svg{color:var(--violet);flex:none}.typed-collection__sort-placeholder{width:14px}.typed-collection__header-actions{z-index:6;align-items:center;gap:1px;display:inline-flex;position:absolute;inset-block-start:50%;inset-inline-end:10px;translate:0 -50%}.typed-collection__header-menu,.typed-collection__reorder{width:22px;height:24px;color:var(--text-muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;padding:0;display:grid}.typed-collection__reorder{cursor:grab;touch-action:none}.typed-collection__reorder:active{cursor:grabbing}.typed-collection__header-menu:hover,.typed-collection__header-menu:focus-visible,.typed-collection__reorder:hover,.typed-collection__reorder:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.typed-collection__resize{z-index:8;background:color-mix(in srgb, var(--line-strong) 52%, transparent);width:16px;color:var(--text-muted);cursor:col-resize;opacity:.82;touch-action:none;border:0;border-radius:6px;place-items:center;padding:0;transition:color .16s,background-color .16s,opacity .16s;display:grid;position:absolute;inset-block:7px;inset-inline-end:-8px}.typed-collection__grid th:hover .typed-collection__resize,.typed-collection__resize:focus-visible{background:color-mix(in srgb, var(--violet-soft) 88%, var(--surface-solid));color:var(--violet);opacity:1;outline:0}.typed-collection__grid td{height:48px;max-width:var(--collection-column-width,280px);border-block-end:1px solid var(--line);border-inline-end:1px solid color-mix(in srgb, var(--line) 76%, transparent);color:var(--text-soft);text-align:start;vertical-align:middle;background:0 0;outline:0;padding:9px 11px;transition:background-color .2s,box-shadow .2s;position:relative;overflow:hidden}.typed-collection__grid td:last-child{border-inline-end:0}.typed-collection__grid tbody tr:last-child td{border-block-end:0}.typed-collection__grid tbody tr:hover td{background:color-mix(in srgb, var(--violet-soft) 30%, var(--surface-muted))}.typed-collection__grid tbody tr[aria-selected=true] td{background:color-mix(in srgb, var(--violet-soft) 68%, var(--surface-muted))}.typed-collection__grid td:focus-visible{z-index:3;box-shadow:inset 0 0 0 2px var(--violet), 0 8px 24px #00000024;background:color-mix(in srgb, var(--violet-soft) 82%, var(--surface-solid));overflow:visible}.typed-collection__select{width:42px;min-width:42px;text-align:center!important;padding:0!important}.typed-collection__select label{border:1px solid var(--line);background:var(--surface-solid);color:#fff;cursor:pointer;border-radius:8px;place-items:center;width:26px;height:26px;transition:border-color .18s,background-color .18s,box-shadow .18s;display:inline-grid;position:relative}.typed-collection__select label:has(input:checked){border-color:var(--violet);background:var(--violet);box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 12%, transparent)}.typed-collection__select input{opacity:0;pointer-events:none;position:absolute}.typed-collection__row--good td:first-child{box-shadow:inset 3px 0 var(--green)}.typed-collection__row--warn td:first-child{box-shadow:inset 3px 0 var(--amber)}.typed-collection__row--bad td:first-child{box-shadow:inset 3px 0 var(--red)}.typed-collection__row--info td:first-child{box-shadow:inset 3px 0 var(--violet)}[dir=rtl] .typed-collection__row--good td:first-child{box-shadow:inset -3px 0 var(--green)}[dir=rtl] .typed-collection__row--warn td:first-child{box-shadow:inset -3px 0 var(--amber)}[dir=rtl] .typed-collection__row--bad td:first-child{box-shadow:inset -3px 0 var(--red)}[dir=rtl] .typed-collection__row--info td:first-child{box-shadow:inset -3px 0 var(--violet)}.structured-value__scalar{color:var(--text-soft);font:9px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.structured-value{min-width:0}.structured-value>summary{color:var(--violet);font:650 8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:6px;list-style-position:inside;display:flex;overflow:hidden}.structured-value[open]>summary{color:var(--text);margin-block-end:8px}.structured-value__content{border:1px solid var(--line);background:var(--surface-solid);max-height:260px;color:var(--text-soft);font:8px/1.55 var(--font-mono);border-radius:8px;padding:9px;overflow:auto;box-shadow:inset 0 1px #ffffff06}.structured-value__array{gap:5px;margin:0;padding-inline-start:22px;display:grid}.structured-value__object{gap:5px;margin:0;display:grid}.structured-value__object>div{border-block-end:1px solid var(--line);grid-template-columns:minmax(72px,.35fr) minmax(0,1fr);gap:8px;min-width:0;padding-block-end:5px;display:grid}.structured-value__object>div:last-child{border-block-end:0;padding-block-end:0}.structured-value__object dt{overflow-wrap:anywhere;color:var(--text-muted)}.structured-value__object dd{overflow-wrap:anywhere;min-width:0;color:var(--text-soft);margin:0}.structured-value__empty{color:var(--text-muted)}.typed-collection__event-kind{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:10px;display:block;overflow:hidden}.typed-collection__event-message{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:10px;display:block;overflow:hidden}.typed-collection__event-copy{gap:5px;min-width:0;display:grid}.typed-collection__event-copy .structured-value>summary{font-size:7px}.typed-collection__grid time{color:var(--text-muted);font:8px var(--font-mono)}.typed-collection__empty{min-height:160px;color:var(--text-muted);text-align:center;place-content:center;justify-items:center;gap:8px;padding:20px;font-size:10px;display:grid}.typed-collection__empty p{margin:0}.typed-collection__empty button{border:1px solid var(--line);background:var(--surface-muted);min-height:31px;color:var(--violet);font:9px var(--font-ui);cursor:pointer;border-radius:8px;padding:5px 10px}.typed-collection__window-nav{border-block-start:1px solid var(--line);background:var(--surface-muted);min-height:45px;color:var(--text-muted);font:8px var(--font-mono);grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;padding:7px 12px;display:grid}.typed-collection__window-nav button{border:1px solid var(--line);background:var(--surface-solid);min-height:31px;color:var(--text-soft);font:8px var(--font-ui);cursor:pointer;border-radius:8px;align-items:center;gap:6px;padding:5px 9px;display:inline-flex}.typed-collection__window-nav button:first-child{justify-self:start}.typed-collection__window-nav button:last-child{justify-self:end}.typed-collection__window-nav button:hover:not(:disabled),.typed-collection__window-nav button:focus-visible{border-color:color-mix(in srgb, var(--violet) 35%, var(--line));color:var(--violet);outline:0}.typed-collection__window-nav button:disabled{opacity:.35;cursor:not-allowed}.typed-collection__window-nav span{text-align:center}.typed-collection__window-nav strong{color:var(--text-soft)}.typed-collection__context-menu{z-index:180;border:1px solid var(--line-strong);background:color-mix(in srgb, var(--glass-strong) 97%, transparent);-webkit-backdrop-filter:blur(24px)saturate(1.12);backdrop-filter:blur(24px)saturate(1.12);border-radius:12px;gap:3px;width:218px;padding:6px;animation:.18s cubic-bezier(.22,1,.36,1) typed-collection-menu;display:grid;position:fixed;box-shadow:0 24px 76px #0000005c}@keyframes typed-collection-menu{0%{opacity:0;clip-path:inset(0 0 22% round 12px);transform:scale(.96)}to{opacity:1;clip-path:inset(0 round 12px);transform:scale(1)}}.typed-collection__context-menu button{min-height:37px;color:var(--text-soft);text-align:start;font:9px var(--font-ui);cursor:pointer;background:0 0;border:0;border-radius:8px;align-items:center;gap:9px;padding:7px 9px;transition:background-color .15s,color .15s;display:flex}.typed-collection__context-menu button:hover,.typed-collection__context-menu button:focus-visible{background:var(--violet-soft);color:var(--violet);outline:0}.typed-collection__context-menu button:disabled{opacity:.35;cursor:not-allowed}.typed-collection--compact .typed-collection__viewport{border:1px solid var(--line);border-radius:10px;max-height:330px}.typed-collection--compact .typed-collection__grid th{height:36px}.typed-collection--compact .typed-collection__grid td{height:45px}.events-page-card .typed-collection{margin-block-end:-20px;margin-inline:-20px}.events-page-card .typed-collection__toolbar{padding-inline:20px}.events-page-card .typed-collection__viewport{max-height:calc(100dvh - 315px)}.settings-value-table{border-collapse:collapse;width:100%;margin:2px 0 15px;font-size:10px}.settings-value-table th{border-bottom:1px solid var(--line-strong);color:var(--text-muted);text-align:start;font:600 8px var(--font-mono);letter-spacing:.08em;text-transform:uppercase;padding:8px 7px}.settings-value-table td{border-bottom:1px solid var(--line);color:var(--text-soft);padding:9px 7px}.settings-value-table td:nth-child(n+2){font-family:var(--font-mono)}.illumination-state-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:12px;display:grid}.illumination-state-grid .data-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:0;padding:11px}.illumination-settings-card__footer{justify-content:space-between;align-items:center;gap:16px;padding-top:14px;display:flex}.illumination-settings-card__footer .settings-action-feedback{margin:0}.table-footer{border-top:1px solid var(--line);color:var(--text-muted);font:9px var(--font-mono);justify-content:space-between;align-items:center;gap:15px;padding:10px 20px;display:flex}.table-footer span{align-items:center;gap:6px;display:flex}.catalog-grid,.operations-grid,.system-grid{grid-template-columns:1fr 1fr;align-items:start;gap:14px;display:grid}.category-list{max-height:620px;overflow:auto}.category-list article{border-bottom:1px solid var(--line);grid-template-columns:30px 1fr auto;align-items:center;gap:10px;padding:10px 0;display:grid}.category-list__index{color:var(--accent);font:650 9px var(--font-mono)}.category-list strong{font-size:11px;display:block}.category-list p{color:var(--text-muted);font:8px var(--font-mono);margin:2px 0 0}.category-list article>span:last-child{color:var(--text-muted);font:9px var(--font-mono)}.operation-result,.system-grid .card:last-child{grid-column:1/-1}.operation-output{min-height:230px}.operation-buttons .button{flex:1;min-width:120px}.events-page-card{padding-top:14px}.event-toolbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px;padding-bottom:13px;display:flex}.segmented{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);gap:3px;padding:3px;display:inline-flex}.segmented button{min-height:31px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:7px;justify-content:center;align-items:center;gap:6px;padding:6px 10px;font-size:10px;transition:color .2s,background .2s,border-color .2s;display:flex}.segmented button:hover{color:var(--text)}.segmented button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 20%, transparent);background:var(--accent-soft);box-shadow:inset 0 0 15px color-mix(in srgb, var(--accent-soft) 65%, transparent)}.settings-grid{grid-template-columns:1fr 1fr;align-items:start;gap:14px;display:grid}.settings-card--wide{grid-column:1/-1}.setting-group{border-bottom:1px solid var(--line);grid-template-columns:minmax(130px,.35fr) minmax(0,1fr);align-items:center;gap:16px;padding:12px 0;display:grid}.setting-group>label{color:var(--text-soft);font-size:11px;font-weight:580}.setting-group .segmented{justify-self:stretch}.setting-group .segmented button{flex:1}.settings-inline-status{flex-wrap:wrap;gap:8px;margin-top:14px;display:flex}.settings-action-feedback{color:var(--text-muted);margin:10px 0 0;font-size:10px;line-height:1.55}.peripheral-name-groups{gap:8px;display:grid}.peripheral-name-group{border:1px solid var(--line);background:var(--surface-muted);border-radius:11px;transition:border-color .24s,background .24s;overflow:clip}.peripheral-name-group[open]{border-color:color-mix(in srgb, var(--accent) 28%, var(--line));background:color-mix(in srgb, var(--accent-soft) 22%, var(--surface-muted))}.peripheral-name-group>summary{color:var(--text-soft);cursor:pointer;justify-content:space-between;align-items:center;gap:12px;padding:11px 12px;font-size:10px;font-weight:650;list-style:none;display:flex}.peripheral-name-group>summary::-webkit-details-marker{display:none}.peripheral-name-group>summary:before{content:"›";color:var(--accent);font:16px/1 var(--font-mono);transition:transform .24s}.peripheral-name-group[open]>summary:before{transform:rotate(90deg)}.peripheral-name-group>summary span{margin-inline-end:auto}.peripheral-name-group>summary small{background:var(--surface-raised);min-width:24px;height:20px;color:var(--text-muted);font:8px var(--font-mono);border-radius:999px;place-items:center;display:grid}.peripheral-name-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0 12px 12px;display:grid}.peripheral-name-grid .text-field{align-self:start}.peripheral-names-card__footer{min-height:36px;color:var(--text-muted);justify-content:space-between;align-items:center;gap:14px;font-size:9px;display:flex}.peripheral-names-card__footer>span{line-height:1.55}.rf-learn-status{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-raised) 76%, transparent);min-height:38px;color:var(--text-soft);border-radius:10px;flex-wrap:wrap;align-items:center;gap:9px;padding:9px 11px;font-size:11px;display:flex}.update-operation{--operation-color:var(--accent);border:1px solid color-mix(in srgb, var(--operation-color) 40%, var(--line));border-radius:var(--radius-lg);background:linear-gradient(135deg, color-mix(in srgb, var(--operation-color) 10%, var(--surface)), var(--surface));box-shadow:var(--shadow);margin-bottom:18px;padding:clamp(16px,3vw,28px)}.update-operation.is-failed{--operation-color:var(--red)}.update-operation.is-complete{--operation-color:var(--green)}.update-operation__header{align-items:center;gap:16px;display:flex}.update-operation__icon{width:52px;height:52px;color:var(--operation-color);background:color-mix(in srgb, var(--operation-color) 14%, var(--surface));border-radius:16px;flex:none;place-items:center;display:grid}.update-operation__icon svg{width:27px;height:27px}.update-operation__heading{flex:1;min-width:0}.update-operation__heading>span{color:var(--operation-color);font-size:12px;font-weight:650}.update-operation__heading h2{color:var(--text);margin:4px 0 0;font-size:clamp(18px,2vw,24px);line-height:1.3}.update-operation__elapsed{color:var(--text-soft);white-space:nowrap;font:12px var(--font-mono);align-items:center;gap:7px;display:flex}.update-operation__measurement{margin-top:24px}.update-operation__measurement>div:first-child{color:var(--text-soft);justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px;font-size:12px;display:flex}.update-operation__measurement strong{color:var(--operation-color);font:650 28px var(--font-mono)}.update-operation .update-progress{height:8px}.update-operation .update-progress i{min-width:0}.update-progress.is-indeterminate i{width:25%;animation:1.7s ease-in-out infinite alternate update-stage-pulse}@keyframes update-stage-pulse{0%{transform:translate(0)}to{transform:translate(300%)}}.update-operation__detail{border-inline-start:3px solid var(--operation-color);background:color-mix(in srgb, var(--surface) 65%, transparent);color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:3px 9px 9px 3px;margin:20px 0 0;padding:14px 16px;font-size:13px;line-height:1.7}.update-operation__facts{flex-wrap:wrap;gap:18px 40px;margin:20px 0 0;display:flex}.update-operation dt{color:var(--text-muted);margin:0 0 5px;font-size:11px}.update-operation dd{color:var(--text);overflow-wrap:anywhere;margin:0;font-size:13px}.update-operation__facts dd{font-weight:550}.update-operation__diagnostics{border-top:1px solid var(--line);margin-top:20px;padding-top:12px}.update-operation__diagnostics summary{cursor:pointer;width:-moz-fit-content;width:fit-content;color:var(--text-soft);align-items:center;gap:8px;padding:4px 0;font-size:12px;display:flex}.update-operation__diagnostics summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.update-operation__diagnostics dl{gap:12px;margin:16px 0 0;display:grid}.update-operation__diagnostics code{font:11px/1.6 var(--font-mono)}@media (max-width:480px){.update-operation__header{flex-wrap:wrap;gap:10px}.update-operation__elapsed{margin-inline-start:62px}.update-operation__facts{grid-template-columns:minmax(0,1fr);gap:14px;display:grid}}@media (prefers-reduced-motion:reduce){.update-progress.is-indeterminate i{opacity:.65;animation:none}.update-operation .spin{animation:none}.update-operation .update-progress i{transition:none}}.visually-hidden{clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;width:1px!important;height:1px!important;position:fixed!important;overflow:hidden!important}.updates-unavailable{text-align:center;place-items:center;gap:16px;min-height:340px;display:grid}.updates-hero{border:1px solid color-mix(in srgb, var(--accent) 28%, var(--line));border-radius:var(--radius-lg);background:linear-gradient(145deg, color-mix(in srgb, var(--violet-soft) 32%, var(--surface)), var(--surface-muted));box-shadow:var(--shadow);grid-template-columns:minmax(0,1.4fr) minmax(260px,.6fr);gap:18px 28px;margin-bottom:14px;padding:21px;display:grid;position:relative;overflow:hidden}.updates-hero:after{display:none}.updates-hero__identity,.updates-hero__state,.updates-hero__metrics,.update-progress{z-index:1;position:relative}.updates-hero__identity{align-items:flex-start;gap:14px;display:flex}.updates-hero__identity>svg{border:1px solid color-mix(in srgb, var(--accent) 30%, var(--line));width:38px;height:38px;color:var(--accent);background:color-mix(in srgb, var(--accent) 8%, transparent);border-radius:12px;flex:none;padding:9px}.updates-hero__identity span{color:var(--accent);font:650 9px/1.2 var(--font-mono);letter-spacing:.16em;display:block}.updates-hero__identity strong{letter-spacing:-.025em;margin-top:5px;font-size:20px;display:block}.updates-hero__identity p{max-width:700px;color:var(--text-soft);margin:7px 0 0;font-size:12px;line-height:1.65}.updates-hero__state{text-align:end;grid-template-columns:auto auto;place-content:start end;gap:7px 14px;display:grid}.updates-hero__state strong{font:700 29px/1 var(--font-mono);color:var(--text)}.updates-hero__state>span:last-child{max-width:340px;color:var(--text-soft);grid-column:1/-1;font-size:11px;line-height:1.5}.update-progress{background:var(--line);border-radius:99px;grid-column:1/-1;height:5px;overflow:hidden}.update-progress i{border-radius:inherit;background:linear-gradient(90deg, var(--accent), var(--green));min-width:2px;height:100%;box-shadow:0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);transition:width .38s var(--ease-out);display:block}.updates-hero__metrics{border-top:1px solid var(--line);grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr));display:grid}.updates-hero__metrics .data-row{border:0;border-inline-start:1px solid var(--line);min-width:0;padding:11px 14px 0}.updates-hero__metrics .data-row:first-child{border-inline-start:0}.update-notice{border:1px solid color-mix(in srgb, var(--green) 28%, var(--line));border-radius:var(--radius-sm);color:var(--green);background:color-mix(in srgb, var(--green) 7%, var(--surface));align-items:center;gap:9px;margin:0 0 14px;padding:11px 13px;font-size:12px;display:flex}.update-notice.is-error{border-color:color-mix(in srgb, var(--red) 35%, var(--line));color:var(--red);background:color-mix(in srgb, var(--red) 7%, var(--surface))}.updates-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:14px;display:grid}.update-source-card,.artifact-inventory,.update-distribution-card,.isp-fallback-card{grid-column:1/-1}.update-source-card{min-width:0}.artifact-kind-picker{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-bottom:11px;display:grid}.artifact-kind-picker button{border:1px solid var(--line);border-radius:var(--radius-sm);min-height:40px;color:var(--text-soft);background:var(--surface-muted);font:inherit;cursor:pointer;justify-content:center;align-items:center;gap:8px;padding:7px;font-size:11px;transition:color .2s,border-color .2s,background .2s;display:flex}.artifact-kind-picker button:hover{color:var(--text);border-color:var(--line-strong);background:var(--surface-hover)}.artifact-kind-picker button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 45%, var(--line));background:color-mix(in srgb, var(--accent) 8%, var(--surface))}.artifact-kind-picker svg{width:16px}.artifact-drop{border:1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));border-radius:var(--radius);width:100%;min-height:88px;color:var(--text);background:color-mix(in srgb, var(--accent) 3%, var(--surface-muted));font:inherit;text-align:start;cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;margin-bottom:11px;padding:15px;transition:border-color .2s,background .2s,box-shadow .2s;display:grid}.artifact-drop:hover,.artifact-drop:focus-visible{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 7%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent)}.artifact-drop>svg{width:24px;color:var(--accent)}.artifact-drop strong,.artifact-drop div span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.artifact-drop strong{font-size:12px}.artifact-drop div span{max-width:75ch;color:var(--text-muted);font:9px/1.4 var(--font-mono);margin-top:5px}.artifact-drop>span{border:1px solid var(--line);color:var(--text-soft);background:var(--surface);white-space:nowrap;border-radius:7px;padding:7px 9px;font-size:10px}.artifact-drop.is-dragging{border-style:solid;border-color:var(--violet);background:color-mix(in srgb, var(--violet-soft) 72%, var(--surface));box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--violet) 20%, transparent), 0 10px 28px #00000024}.remote-artifact-form .compact-fields{grid-template-columns:1fr 1fr}.remote-artifact-form>.button,.update-source-card>.button{justify-content:center;width:100%;margin-top:10px}.release-discovery-card{grid-column:1/-1;min-width:0}.release-discovery-form{gap:4px;display:grid}.release-discovery-form>.button,.release-selection>.button{justify-content:center;width:100%}.discovery-source-picker{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:6px;display:grid}.discovery-source-picker button{border:1px solid var(--line);border-radius:var(--radius-sm);min-height:40px;color:var(--text-soft);background:var(--surface-muted);cursor:pointer;justify-content:center;align-items:center;gap:8px;padding:8px;font-size:10px;transition:color .2s,border-color .2s,background .2s;display:flex}.discovery-source-picker button:hover,.discovery-source-picker button.is-active{color:var(--accent);border-color:color-mix(in srgb, var(--accent) 42%, var(--line));background:color-mix(in srgb, var(--accent) 8%, var(--surface))}.discovery-source-picker svg{width:15px}.release-discovery-form .compact-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.release-discovery-form .field{min-width:0;color:var(--text-soft);flex-direction:column;gap:7px;margin:10px 0 0;font-size:10px;font-weight:580;display:flex}.release-discovery-form .field select{border:1px solid var(--line);border-radius:var(--radius-sm);width:100%;height:39px;color:var(--text);background:var(--surface-muted);outline:0;padding:0 11px;font-size:11px}.release-discovery-form .field select:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 16px var(--accent-soft)}.release-candidates{gap:6px;margin-top:15px;display:grid}.release-candidates>label{border:1px solid var(--line);border-radius:var(--radius-sm);min-height:58px;color:var(--text-soft);background:var(--surface-muted);text-align:start;cursor:pointer;grid-template-columns:auto minmax(0,1fr) minmax(92px,auto) auto;align-items:center;gap:11px;padding:9px 11px;display:grid}.release-candidates>label:hover,.release-candidates>label.is-selected{border-color:color-mix(in srgb, var(--accent) 42%, var(--line));background:color-mix(in srgb, var(--accent) 6%, var(--surface))}.release-candidates input{accent-color:var(--accent)}.release-candidates strong,.release-candidates small{display:block}.release-candidates small{color:var(--text-muted);font:8px/1.4 var(--font-mono);margin-top:4px}.release-candidates code{color:var(--accent);font:9px var(--font-mono);text-overflow:ellipsis;overflow:hidden}.release-candidates em{color:var(--text-muted);font:normal 9px var(--font-mono);white-space:nowrap}.release-selection,.release-operation{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);margin-top:14px;padding:13px}.release-selection .data-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;display:grid}.release-operation>div:first-child{grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;display:grid}.release-operation>div:first-child svg{color:var(--accent)}.release-operation>div:first-child span{color:var(--text-muted);font:9px var(--font-mono)}.release-operation .update-progress{margin:11px 0}.release-operation>p{color:var(--green);align-items:center;gap:8px;margin:11px 0 0;font-size:10px;display:flex}.release-operation>p code{min-width:0;color:var(--text-muted);text-overflow:ellipsis;overflow:hidden}.isp-fallback-card{border-color:color-mix(in srgb, var(--red) 35%, var(--line))}.isp-guidance{align-items:flex-start;gap:12px;display:flex}.isp-guidance>svg{color:var(--red);flex:none}.isp-guidance p{color:var(--text-soft);margin:0;font-size:12px;line-height:1.7}.artifact-table-wrap{margin:0 -20px;overflow-x:auto}.artifact-table{border-collapse:collapse;width:100%;min-width:900px}.artifact-table th{border-block:1px solid var(--line);color:var(--text-muted);background:var(--surface-muted);font:650 9px/1.2 var(--font-mono);letter-spacing:.08em;text-align:center;text-transform:uppercase;padding:9px 12px}.artifact-table td{border-bottom:1px solid var(--line);color:var(--text-soft);vertical-align:middle;padding:11px 12px;font-size:11px}.artifact-table tbody tr{transition:background .2s}.artifact-table tbody tr:hover,.artifact-table tbody tr.is-selected{background:color-mix(in srgb, var(--accent) 5%, transparent)}.artifact-table td strong,.artifact-table td span{display:block}.artifact-table td>span,.artifact-table td strong+span{max-width:320px;color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:3px;font-size:9px;overflow:hidden}.artifact-table td:nth-child(5),.artifact-table td:nth-child(6),.artifact-table td:nth-child(7){text-align:center;white-space:nowrap}.artifact-table input[type=radio]{accent-color:var(--accent)}.artifact-selection{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:13px;margin-top:15px;padding:13px;display:grid}.artifact-selection>div span,.artifact-selection>div strong,.artifact-selection>div code{display:block}.artifact-selection>div span{color:var(--accent);font:650 8px/1.2 var(--font-mono);letter-spacing:.12em}.artifact-selection>div strong{margin:4px 0;font-size:12px}.artifact-selection>div code{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.distribution-grid{border:1px solid var(--line);border-radius:var(--radius);background:var(--line);grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;display:grid;overflow:hidden}.distribution-grid article{background:var(--surface-muted);min-height:140px;padding:17px}.distribution-grid svg{color:var(--accent)}.distribution-grid strong{margin-top:13px;font-size:12px;display:block}.distribution-grid p{color:var(--text-soft);margin:7px 0 0;font-size:11px;line-height:1.65}.toggle-row{border:0;border-bottom:1px solid var(--line);width:100%;min-height:62px;color:inherit;text-align:start;cursor:pointer;background:0 0;grid-template-columns:1fr auto;align-items:center;gap:14px;padding:10px 0;display:grid}.toggle-row.is-disabled{cursor:not-allowed;opacity:.5}.toggle-row__copy{flex-direction:column;display:flex}.toggle-row__copy strong{color:var(--text-soft);font-size:11px}.toggle-row__copy small{color:var(--text-muted);margin-top:4px;font-size:9px;line-height:1.5}.toggle{border:1px solid var(--line-strong);background:var(--surface-muted);border-radius:6px;width:42px;height:23px;transition:background .3s,border-color .3s;position:relative}.toggle span{top:4px;background:var(--text-muted);width:13px;height:13px;transition:inset-inline-start .32s var(--ease-out), background .3s, box-shadow .3s;border-radius:3px;position:absolute;inset-inline-start:4px}.toggle-row[aria-checked=true] .toggle{background:var(--accent-soft);border-color:color-mix(in srgb, var(--accent) 45%, transparent)}.toggle-row[aria-checked=true] .toggle span{background:var(--accent);box-shadow:0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);inset-inline-start:23px}[dir=rtl] .toggle-row[aria-checked=true] .toggle span{inset-inline-start:23px}.text-field{flex-direction:column;gap:7px;min-width:0;margin:13px 0;display:flex}.text-field>label{color:var(--text-soft);font-size:10px;font-weight:580}.text-field__control{grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:8px;display:grid}.text-field__action{align-items:stretch;gap:7px;display:flex}.text-field__action .button{height:39px;min-height:39px}.text-field small{min-height:12px;color:var(--text-muted);font-size:8px;line-height:1.5}.text-field__message--contextual{opacity:0;filter:blur(1.5px);transition:opacity .24s var(--ease-out), filter .24s var(--ease-out), color .24s var(--ease-out)}.text-field:focus-within .text-field__message--contextual{opacity:1;filter:blur()}.text-field input{width:100%}.text-field.is-invalid input{border-color:color-mix(in srgb, var(--red) 68%, var(--line));box-shadow:inset 3px 0 0 color-mix(in srgb, var(--red) 75%, transparent)}.text-field.is-invalid .text-field__message{color:var(--red)}.text-field.is-valid input{border-color:color-mix(in srgb, var(--green) 44%, var(--line))}.text-field.is-valid .text-field__message{color:var(--green)}.payload-field{flex-direction:column;gap:7px;margin:13px 0;display:flex}.payload-field>span{color:var(--text-soft);font-size:10px;font-weight:580}.payload-field textarea{resize:vertical;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);width:100%;min-height:144px;color:var(--text);font-family:var(--font-mono);outline:0;padding:12px;font-size:10px;line-height:1.6;transition:border-color .2s,box-shadow .2s}.payload-field textarea:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 18px var(--accent-soft)}.integration-principles{grid-template-columns:repeat(4,1fr);gap:10px;display:grid}.integration-principles article{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-muted);min-height:142px;padding:15px}.integration-principles svg{color:var(--accent)}.integration-principles strong{margin-top:18px;font-size:11px;display:block}.integration-principles p{color:var(--text-muted);margin:6px 0 0;font-size:9px;line-height:1.55}.local-integrations-form{grid-template-columns:1fr 1fr;gap:12px;display:grid}.integration-config-panel{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(145deg, var(--surface-muted), transparent);min-width:0;padding:16px}.integration-config-panel--wide{grid-column:1/-1}.integration-config-panel>header{border-bottom:1px solid var(--line);align-items:center;gap:10px;padding-bottom:12px;display:flex}.integration-config-panel>header>svg{color:var(--accent)}.integration-config-panel>header div{flex-direction:column;display:flex}.integration-config-panel>header strong{font-size:12px}.integration-config-panel>header small{color:var(--text-muted);letter-spacing:.08em;text-transform:uppercase;margin-top:2px;font-size:8px}.integration-config-panel--wide .setting-group{grid-template-columns:minmax(180px,.4fr) minmax(0,1fr)}.integration-config-panel--wide .toggle-row{border-bottom:0}.local-integrations-form__footer{grid-column:1/-1;justify-content:space-between;align-items:center;gap:14px;padding-top:2px;display:flex}.local-integrations-form__footer>span{color:var(--text-muted);font-size:9px;line-height:1.5}.modal-layer,.palette-layer,.mobile-drawer-layer{z-index:100;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.modal-backdrop,.palette-backdrop,.mobile-drawer-backdrop{-webkit-backdrop-filter:blur(15px)saturate(.85);backdrop-filter:blur(15px)saturate(.85);cursor:default;background:#08070aa8;border:0;width:100%;height:100%;position:absolute;inset:0}.app-preferences-layer{z-index:110;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.app-preferences-backdrop{-webkit-backdrop-filter:blur(15px)saturate(.85);backdrop-filter:blur(15px)saturate(.85);cursor:default;background:#08070aa8;border:0;width:100%;height:100%;position:absolute;inset:0}.app-preferences-dialog{z-index:1;border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:var(--surface-solid);width:min(620px,100%);max-height:min(710px,100dvh - 40px);box-shadow:var(--shadow-lg);position:relative;overflow:auto}.app-preferences-dialog>header,.app-preferences-dialog>footer{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:14px;padding:16px 20px;display:flex}.app-preferences-dialog>header>span{align-items:center;gap:9px;display:flex}.app-preferences-dialog>header svg{color:var(--accent)}.app-preferences-dialog>footer{border-top:1px solid var(--line);color:var(--text-muted);border-bottom:0;font-size:10px;line-height:1.5}.app-preferences-tabs{border-bottom:1px solid var(--line);background:var(--surface-muted);gap:5px;padding:12px 20px;display:flex}.app-preferences-tabs button{border-radius:var(--radius-sm);min-height:32px;color:var(--text-muted);cursor:pointer;background:0 0;border:1px solid #0000;align-items:center;gap:7px;padding:0 11px;display:inline-flex}.app-preferences-tabs button:hover,.app-preferences-tabs button:focus-visible,.app-preferences-tabs button.is-active{border-color:var(--line-strong);background:var(--surface-solid);color:var(--text);outline:0}.app-preferences-tabs button.is-active{color:var(--accent)}.app-preferences-content{gap:0;padding:8px 20px 14px;display:grid}.app-preferences-content>p{color:var(--text-muted);margin:8px 0 12px;font-size:11px;line-height:1.6}.app-preferences-select{border-bottom:1px solid var(--line);color:var(--text-soft);justify-content:space-between;align-items:center;gap:16px;padding:12px 0;font-size:11px;font-weight:580;display:flex}.app-preferences-select>span{align-items:center;gap:8px;display:inline-flex}.app-preferences-select svg{color:var(--accent)}.app-preferences-select select{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface-muted);min-width:150px;color:var(--text);font:inherit;padding:8px 10px}@media (max-width:560px){.app-preferences-layer{padding:0}.app-preferences-dialog{border-inline:0;border-radius:0;width:100vw;height:100dvh;max-height:100dvh}.app-preferences-tabs{overflow-x:auto}}.modal{border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:linear-gradient(145deg, var(--glass-strong), var(--surface-solid));width:min(460px,100vw - 32px);padding:28px;position:relative;overflow:hidden;box-shadow:0 38px 100px #00000073}.modal:after{content:"";inset-inline:0;background:linear-gradient(90deg, transparent, var(--accent), transparent);height:2px;position:absolute;top:0}.modal--danger:after{background:linear-gradient(90deg, transparent, var(--red), transparent)}.modal__close{top:13px;position:absolute;inset-inline-end:13px}.modal__signal{border:1px solid color-mix(in srgb, var(--accent) 34%, transparent);border-radius:var(--radius);background:var(--accent-soft);width:50px;height:50px;color:var(--accent);place-items:center;margin-bottom:18px;display:grid}.modal--danger .modal__signal{border-color:color-mix(in srgb, var(--red) 34%, transparent);background:var(--red-soft);color:var(--red)}.modal h2{letter-spacing:-.03em;margin:0;font-size:20px}.modal p{margin:10px 0 24px;font-size:11px;line-height:1.7}.modal__actions{justify-content:flex-end;gap:8px;display:flex}.toast-stack{z-index:120;inset-inline-end:20px;pointer-events:none;flex-direction:column;gap:8px;width:min(380px,100vw - 40px);display:flex;position:fixed;bottom:20px}.toast{border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--glass-strong);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:65px;box-shadow:var(--shadow);pointer-events:auto;grid-template-columns:3px 1fr auto;align-items:center;gap:12px;padding:10px 10px 10px 0;display:grid;position:relative;overflow:hidden}[dir=rtl] .toast{padding:10px 0 10px 10px}.toast__rail{background:var(--accent);box-shadow:0 0 12px var(--accent);align-self:stretch}.toast--success .toast__rail{background:var(--green)}.toast--warning .toast__rail{background:var(--amber)}.toast--danger .toast__rail{background:var(--red)}.toast__body{min-width:0}.toast strong{font-size:11px;display:block}.toast p{color:var(--text-muted);margin:4px 0 0;font-size:9px;line-height:1.45}.toast button{width:28px;height:28px;color:var(--text-muted);cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;display:grid}.toast__correlation{color:var(--text-muted);overflow-wrap:anywhere;gap:6px;margin-top:7px;font-size:9px;display:flex}.toast__correlation span{color:var(--text-faint);font-family:var(--font-ui)}.toast__action-context{border:1px solid var(--line);background:var(--surface-raised);border-radius:6px;gap:3px;margin-top:8px;padding:7px 9px;display:grid}.toast__action-context span{color:var(--text-muted);font-size:9px}.toast__action-context code{color:var(--text);overflow-wrap:anywhere;font-size:9px}.toast__progress{gap:6px;margin-top:8px;display:grid}.toast__progress>div:first-child{color:var(--text-muted);justify-content:space-between;gap:10px;font-size:9px;display:flex}.toast__progress bdi{color:var(--text);font:600 9px var(--font-mono)}.toast__progress .update-progress{height:4px}.palette{border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:var(--glass-strong);-webkit-backdrop-filter:blur(28px)saturate(1.2);backdrop-filter:blur(28px)saturate(1.2);flex-direction:column;width:min(650px,100vw - 30px);max-height:min(720px,100dvh - 40px);display:flex;position:relative;overflow:hidden;box-shadow:0 40px 120px #00000080}.palette>header{border-bottom:1px solid var(--line);color:var(--accent);grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:15px 17px;display:grid}.palette>header input{color:var(--text);background:0 0;border:0;outline:0;font-size:13px}.palette__results{padding:9px;overflow:auto}.palette__label{color:var(--text-muted);font:650 8px var(--font-mono);letter-spacing:.15em;padding:10px 9px 6px;display:block}.palette__results button{border-radius:var(--radius-sm);width:100%;min-height:51px;color:var(--text-soft);text-align:start;cursor:pointer;background:0 0;border:1px solid #0000;grid-template-columns:34px 1fr 20px;align-items:center;gap:9px;padding:7px 9px;display:grid}.palette__results button:hover{border-color:var(--line);background:var(--surface-hover)}.palette__results button>svg:first-child{color:var(--text-muted)}.palette__results button div{flex-direction:column;display:flex}.palette__results strong{font-size:11px}.palette__results small{color:var(--text-muted);margin-top:3px;font-size:9px}.palette__results .is-visible{color:var(--green)}.palette__results button>svg:last-child:not(.is-visible){opacity:0}.palette>footer{border-top:1px solid var(--line);color:var(--text-muted);align-items:center;gap:16px;padding:10px 16px;font-size:8px;display:flex}.palette>footer span{align-items:center;gap:5px;display:flex}.palette>footer span:last-child{margin-inline-start:auto}.palette__results button.is-highlighted{border-color:color-mix(in srgb, var(--accent) 26%, var(--line));background:linear-gradient(90deg, var(--accent-soft), var(--surface-hover));box-shadow:inset 2px 0 var(--accent)}.palette__results button.is-highlighted>svg:first-child{color:var(--accent);filter:drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 55%, transparent))}[dir=rtl] .palette__results button.is-highlighted{box-shadow:inset -2px 0 var(--accent)}.topbar-audio[aria-pressed=true]{color:var(--text-muted);background:var(--surface-muted)}.topbar-audio[aria-pressed=false]{color:var(--accent)}.setting-icon-label{align-items:center;gap:7px;display:inline-flex}.setting-icon-label svg{color:var(--accent)}.boot-gate{z-index:200;color:#f5f2f7;isolation:isolate;background:linear-gradient(121deg,#0000 0 63%,#a78bfa0b 63.1% 63.3%,#0000 63.4%),linear-gradient(155deg,#09090c 0%,#17151c 47%,#111016 72%,#09090c 100%);grid-template-rows:1fr auto auto minmax(24px,.34fr);place-items:center;gap:clamp(18px,3vh,30px);min-width:320px;padding:clamp(24px,5vw,62px);display:grid;position:fixed;inset:0;overflow:hidden}.boot-gate:before{content:"";z-index:-1;background:linear-gradient(90deg,#0000,#b8a1ff17,#ffffff06,#0000);width:27%;animation:4.8s cubic-bezier(.65,0,.35,1) infinite boot-light-blade;position:absolute;top:-20%;bottom:-20%;left:-38%;transform:skew(-18deg)}.boot-gate:after{content:"";z-index:-1;inset-inline:7vw;opacity:.7;background:linear-gradient(90deg,#0000,#b8a1ff42,#0000);height:1px;animation:2.8s ease-in-out infinite boot-horizon;position:absolute;top:62%}.boot-fuji{filter:drop-shadow(0 30px 62px #0000006b);align-self:end;width:min(540px,78vw);height:clamp(180px,28vh,280px);position:relative}.boot-fuji>span{transform-origin:bottom;position:absolute;inset:0}.boot-fuji__rear{clip-path:polygon(0 100%,20% 72%,32% 76%,51% 9%,66% 63%,79% 57%,100% 100%);animation:boot-mountain-reveal 1.1s var(--ease-out) both;background:linear-gradient(138deg,#7a72891a,#2a273180)}.boot-fuji__face{clip-path:polygon(3% 100%,50% 8%,97% 100%);animation:boot-mountain-reveal 1.15s var(--ease-out) 80ms both;background:linear-gradient(132deg,#4a4652 0%,#292631 46%,#17151d 47% 100%);inset:7% 7% 0!important}.boot-fuji__snow{clip-path:polygon(37% 34%,50% 8%,63% 34%,58% 31%,54% 39%,50% 31%,46% 39%,42% 31%);animation:boot-snow-reveal .9s var(--ease-out) .6s both;background:linear-gradient(130deg,#f2eff5,#c8c1d2 48%,#71677f 49%);inset:7% 7% 0!important}.boot-fuji__trace{clip-path:polygon(2.5% 100%,49.4% 7%,50.6% 7%,97.5% 100%,96.7% 100%,50% 10%,3.3% 100%);opacity:.68;background:linear-gradient(90deg,#0000,#b8a1ff 48%,#e4dcff 51%,#0000);animation:2.4s ease-in-out infinite boot-trace;inset:7% 7% 0!important}.boot-identity{grid-template-columns:48px auto;align-items:center;gap:15px;margin-top:-8px;display:grid}.boot-identity .brand__mark{color:#d8ccff;background:linear-gradient(145deg,#a78bfa29,#0000 76%);border-color:#b8a1ff6b;width:46px;height:46px;box-shadow:inset 0 0 22px #a78bfa14,0 0 30px #a78bfa14}.boot-identity>div:last-child{flex-direction:column;display:flex}.boot-identity span{color:#91889d;font:650 9px var(--font-mono);letter-spacing:.18em}.boot-identity h1{letter-spacing:-.045em;margin:5px 0 0;font-size:clamp(22px,3.2vw,36px);font-weight:620}.boot-status{width:min(430px,100vw - 48px)}.boot-status>div:first-child{color:#aaa2b2;justify-content:space-between;align-items:center;gap:18px;font-size:11px;display:flex}.boot-status b{color:#e4dcff;font:600 10px var(--font-mono)}.boot-progress{clip-path:polygon(0 0,100% 0,calc(100% - 5px) 100%,5px 100%);background:#a78bfa1f;height:3px;margin-top:9px;position:relative;overflow:hidden}.boot-progress span{transition:inline-size .34s var(--ease-out);background:linear-gradient(90deg,#7358ba,#a78bfa 68%,#eadfff);position:absolute;inset-block:0;inset-inline-start:0;box-shadow:0 0 16px #a78bfa80}.boot-entry{opacity:0;pointer-events:none;clip-path:inset(0 50%);filter:blur(6px);width:min(540px,100vw - 48px);transition:opacity .55s ease, clip-path .72s var(--ease-out), filter .55s ease;grid-template-columns:1fr 1fr;align-self:start;gap:9px;display:grid}.boot-entry.is-ready{opacity:1;pointer-events:auto;clip-path:inset(0);filter:blur()}.boot-entry small{color:#8b8493;text-align:center;grid-column:1/-1;font-size:9px;line-height:1.55}.hotkey-layer{z-index:190;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.hotkey-help{border:1px solid var(--line-strong);border-radius:var(--radius-lg);background:linear-gradient(145deg, var(--glass-strong), var(--surface-solid));-webkit-backdrop-filter:blur(28px)saturate(1.18);backdrop-filter:blur(28px)saturate(1.18);width:min(620px,100vw - 30px);max-height:calc(100dvh - 40px);padding:24px;position:relative;overflow:auto;box-shadow:0 40px 120px #00000080}.hotkey-help:before{content:"";inset-inline:0;background:linear-gradient(90deg, transparent, var(--accent), transparent);height:2px;position:absolute;top:0}.hotkey-help>header{justify-content:space-between;align-items:center;display:flex}.hotkey-help>header>span{color:var(--accent);align-items:center;gap:8px;display:inline-flex}.hotkey-help>header i{font:650 9px var(--font-mono);letter-spacing:.16em;font-style:normal}.hotkey-help h2{letter-spacing:-.035em;margin:22px 0 0;font-size:23px}.hotkey-help>p{color:var(--text-muted);margin:8px 0 19px;font-size:11px;line-height:1.7}.hotkey-list{gap:5px;display:grid}.hotkey-list>div{border:1px solid #0000;border-bottom-color:var(--line);min-height:49px;color:var(--text-soft);grid-template-columns:minmax(180px,.43fr) 1fr;align-items:center;gap:14px;padding:8px 10px;display:grid}.hotkey-list kbd{color:var(--accent);white-space:nowrap;justify-self:start}.hotkey-list span{font-size:11px;line-height:1.55}@keyframes boot-light-blade{0%,14%{opacity:0;transform:translate(0)skew(-18deg)}30%{opacity:1}66%,to{opacity:0;transform:translate(620vw)skew(-18deg)}}@keyframes boot-horizon{50%{opacity:.28;filter:brightness(1.7)}}@keyframes boot-mountain-reveal{0%{opacity:0;clip-path:polygon(50% 100%,50% 100%,50% 100%);filter:blur(12px)}}@keyframes boot-snow-reveal{0%{opacity:0;clip-path:polygon(50% 8%,50% 8%,50% 8%)}}@keyframes boot-trace{50%{opacity:.22;filter:brightness(1.7)drop-shadow(0 0 6px #c29bea)}}.mobile-bottom-nav,.mobile-drawer-layer{display:none}@media (max-width:1180px){.metric-grid{grid-template-columns:1fr 1fr}.dashboard-layout-grid{grid-template-columns:1fr}.dashboard-layout-grid>[data-layout-card-id=telemetry],.dashboard-layout-grid>[data-layout-card-id=outputs],.dashboard-layout-grid>[data-layout-card-id=events]{grid-area:auto}.control-layout{grid-template-columns:1fr}.relay-control-card{grid-row:auto}.console-card{grid-column:auto}.workbench-grid>.card-layout-frame{grid-column:span 6}.workbench-grid>[data-layout-card-id=terminal]{grid-column:1/-1}.device-layout{grid-template-columns:1fr}.device-stage{min-height:360px}.integration-principles{grid-template-columns:1fr 1fr}.local-integrations-form{grid-template-columns:1fr}.local-integrations-form__footer{grid-column:auto}.updates-hero__metrics{grid-template-columns:1fr 1fr}.updates-hero__metrics .data-row:nth-child(3){border-inline-start:0}}@media (max-width:920px){.app-shell,.app-shell.is-sidebar-compact{grid-template:var(--topbar-height) minmax(0, 1fr) / 1fr}.sidebar{display:none}.topbar,.app-main{grid-column:1}.mobile-menu{display:grid}.breadcrumbs{min-width:0}.command-trigger{width:auto;margin:0 0 0 auto;padding-inline:10px}.command-trigger span{display:none}[dir=rtl] .command-trigger{margin:0 auto 0 0}.topbar{gap:10px;padding-inline:15px}.topbar__actions>span .status-badge,.topbar__actions>.status-badge{display:none}.mobile-drawer-layer{place-items:stretch start;padding:0;display:grid}.mobile-drawer{border-inline-end:1px solid var(--line-strong);background:var(--glass-strong);-webkit-backdrop-filter:blur(26px);backdrop-filter:blur(26px);width:min(320px,88vw);height:100%;padding:14px;position:relative;box-shadow:20px 0 80px #0006}.mobile-drawer>header{grid-template-columns:42px 1fr auto;align-items:center;gap:10px;height:55px;margin-bottom:18px;display:grid}.mobile-drawer>header button{background:var(--surface-muted);width:34px;height:34px;color:var(--text-muted);border:0;border-radius:8px;place-items:center;display:grid}.mobile-drawer .nav-button{margin-bottom:3px}[dir=rtl] .mobile-drawer-layer{place-items:stretch start}[dir=rtl] .mobile-drawer{box-shadow:-20px 0 80px #0006}}@media (max-width:720px){:root{--topbar-height:58px}body{background-size:auto}.topbar{position:relative}.breadcrumbs span,.breadcrumbs i{display:none}.breadcrumbs strong{font-size:11px}.topbar__actions{gap:2px}.topbar-icon{width:31px;height:31px}.command-trigger kbd{display:none}.app-main{padding-bottom:70px}.page{padding:20px 13px 35px}.section-title{align-items:flex-start;margin-bottom:17px}.section-title h1{font-size:27px}.section-title p{font-size:11px}.section-title__action .button{display:none}.section-title__action .card-layout-editor__toggle,.section-title__action .card-layout-editor .button{display:inline-flex}.card-layout-editor{width:auto;max-height:calc(100dvh - 138px);position:fixed;inset-block-start:118px;inset-inline:13px;overflow:auto}.hero-panel{grid-template-columns:1fr;min-height:230px;padding:23px 20px}.hero-panel__readout{border-inline-start:0;border-top:1px solid var(--line);min-width:0;padding:10px 0 0}.metric-grid{grid-template-columns:1fr 1fr;gap:9px}.metric{min-height:152px;padding-inline:13px}.metric__value strong{font-size:21px}.metric__detail{display:none}.telemetry-chart__toolbar{flex-direction:column;align-items:stretch}.telemetry-chart__toolbar .segmented{width:100%}.telemetry-chart__toolbar .segmented button{flex:1}.telemetry-chart__canvas{height:270px}.output-matrix,.relay-bank{grid-template-columns:repeat(2,1fr)}.action-grid{grid-template-columns:1fr}.motion-side{grid-template-columns:1fr repeat(3,auto)}.motion-side__identity{grid-column:1/-1}.channel-selector{grid-template-columns:repeat(8,1fr)}.pwm-mixer__row{grid-template-columns:1fr}.pwm-mixer__actions{justify-content:flex-end}.system-output-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.workbench-grid{grid-template-columns:1fr;gap:10px}.workbench-grid>.card-layout-frame,.workbench-grid>[data-layout-card-id=terminal]{grid-column:1}.workbench-grid>[data-layout-card-id=terminal]{min-height:390px}.terminal-transcript{min-height:190px}.terminal-event-strip{grid-template-columns:repeat(5,minmax(145px,1fr))}.compact-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-fields .text-field:first-child{grid-column:1/-1}.device-stage{min-height:0}.device-overview{grid-template-columns:68px minmax(0,1fr)}.device-overview__mark{border-radius:18px;width:68px;height:68px}.device-facts,.device-actions,.message-compose{grid-template-columns:1fr}.beep-row{flex-wrap:wrap}.beep-row>div{flex-basis:100%}.subnav{width:100%;overflow-x:auto}.subnav button{white-space:nowrap;flex:1}.records-card .card__header{flex-direction:column}.table-footer{flex-wrap:wrap}.table-footer span:last-child{display:none}.typed-collection__toolbar{align-items:stretch}.typed-collection__search{flex-basis:100%;min-width:100%}.typed-collection__summary{margin-inline-end:auto}.typed-collection__popover-panel{width:auto;max-height:calc(100dvh - 92px);position:fixed;inset-block-start:72px;inset-inline:13px}.typed-collection__window-nav{grid-template-columns:1fr 1fr}.typed-collection__window-nav>span{grid-area:1/1/auto/-1}.typed-collection__window-nav button{grid-row:2}.typed-collection__viewport,.events-page-card .typed-collection__viewport{max-height:calc(100dvh - 330px)}.catalog-grid,.operations-grid,.system-grid,.settings-grid{grid-template-columns:1fr}.settings-card--wide,.operation-result,.system-grid .card:last-child{grid-column:auto}.setting-group,.integration-config-panel--wide .setting-group{grid-template-columns:1fr}.integration-config-panel--wide .segmented{overflow-x:auto}.integration-principles{grid-template-columns:1fr}.local-integrations-form__footer,.peripheral-names-card__footer,.illumination-settings-card__footer{flex-direction:column;align-items:stretch}.local-integrations-form__footer .button,.peripheral-names-card__footer .button,.illumination-settings-card__footer .button{justify-content:center}.peripheral-name-grid{grid-template-columns:1fr}.illumination-state-grid{grid-template-columns:1fr 1fr}.event-toolbar{flex-direction:column;align-items:stretch}.event-toolbar .segmented{overflow-x:auto}.updates-hero{grid-template-columns:1fr;padding:17px}.updates-hero__state{text-align:start;justify-content:stretch}.updates-hero__state>span:last-child{max-width:none}.updates-grid{grid-template-columns:1fr}.update-source-card,.release-discovery-card,.artifact-inventory,.update-distribution-card,.isp-fallback-card{grid-column:1}.artifact-kind-picker{grid-template-columns:1fr}.artifact-drop{grid-template-columns:auto minmax(0,1fr)}.artifact-drop>span{display:none}.remote-artifact-form .compact-fields,.release-discovery-form .compact-fields,.discovery-source-picker{grid-template-columns:1fr}.release-candidates>label{grid-template-columns:auto minmax(0,1fr) auto}.release-candidates code{display:none}.release-selection .data-list{grid-template-columns:1fr}.artifact-selection{grid-template-columns:1fr auto}.artifact-selection>.button{grid-column:1/-1;justify-content:center}.distribution-grid{grid-template-columns:1fr}.mobile-bottom-nav{z-index:50;inset-inline:0;height:calc(62px + env(safe-area-inset-bottom));padding:5px 7px env(safe-area-inset-bottom);border-top:1px solid var(--line-strong);background:var(--glass-strong);-webkit-backdrop-filter:blur(24px)saturate(1.2);backdrop-filter:blur(24px)saturate(1.2);grid-template-columns:repeat(5,1fr);display:grid;position:fixed;bottom:0}.mobile-bottom-nav button{color:var(--text-muted);background:0 0;border:0;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:3px;font-size:8px;display:flex;position:relative}.mobile-bottom-nav button:before{content:"";background:var(--accent);width:24px;height:2px;box-shadow:0 0 9px var(--accent);transition:scale .3s var(--ease-out);position:absolute;top:-5px;scale:0 1}.mobile-bottom-nav button.is-active{color:var(--accent);background:var(--accent-soft)}.mobile-bottom-nav button.is-active:before{scale:1}.palette-layer,.modal-layer{padding:10px}.palette{max-height:calc(100dvh - 20px)}.palette>footer{display:none}.toast-stack{inset-inline:10px;width:auto;bottom:75px}.boot-gate{grid-template-rows:1fr auto auto minmax(18px,.28fr);gap:16px;padding:20px 18px}.boot-fuji{width:min(520px,96vw);height:clamp(160px,26vh,230px)}.boot-identity{grid-template-columns:42px minmax(0,1fr);gap:11px}.boot-identity .brand__mark{width:40px;height:40px}.boot-identity span{letter-spacing:.12em;font-size:7px}.boot-identity h1{font-size:22px}.boot-entry{grid-template-columns:1fr;width:min(420px,100vw - 32px)}.boot-entry small{grid-column:1}.hotkey-layer{padding:10px}.hotkey-help{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:19px}.hotkey-list>div{grid-template-columns:1fr;gap:7px;padding-block:10px}.hotkey-help h2{font-size:20px}}@media (max-width:460px){.metric-grid{grid-template-columns:1fr}.metric{min-height:145px}.output-matrix,.relay-bank{grid-template-columns:1fr 1fr}.channel-selector{grid-template-columns:repeat(4,1fr)}.header-actions .status-badge{display:none}.card{border-radius:var(--radius);padding:16px}.records-card{padding-inline:0}.records-card .card__header{padding-inline:16px}.topbar__actions .topbar-icon:nth-of-type(2){display:none}.typed-collection__toolbar{padding-inline:9px}.typed-collection__summary{display:none}.typed-collection__quiet-action{order:4}.typed-collection__popover{flex:1}.typed-collection__popover>summary{justify-content:center;width:100%}.typed-collection__column-option{grid-template-columns:minmax(120px,1fr) auto}.typed-collection__grid td,.typed-collection__window-nav{padding-inline:8px}.typed-collection__window-nav button{font-size:0}.typed-collection__window-nav button svg{width:17px;height:17px}.events-page-card .typed-collection{margin-block-end:-16px;margin-inline:-16px}.events-page-card .typed-collection__toolbar{padding-inline:9px}.updates-hero__metrics{grid-template-columns:1fr}.updates-hero__metrics .data-row{border-inline-start:0}.artifact-table-wrap{margin-inline:-16px}.artifact-selection{grid-template-columns:1fr}.artifact-selection .status-badge{justify-self:start}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}.inline-error-presence{will-change:auto;clip-path:none!important;filter:none!important}}.page-loading{min-height:14rem;color:var(--text-muted);letter-spacing:.04em;place-content:center;justify-items:center;gap:.85rem;display:grid}.page-loading .spinner{border:2px solid color-mix(in srgb, var(--accent) 22%, transparent);border-top-color:var(--accent);border-radius:50%;width:1.65rem;height:1.65rem;animation:.8s linear infinite spin}.reduce-motion *,.reduce-motion :before,.reduce-motion :after{scroll-behavior:auto!important;transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}.reduce-motion .inline-error-presence{will-change:auto;clip-path:none!important;filter:none!important}@media (prefers-contrast:more){:root{--line:#e2dceb52;--line-strong:#e2dceb8c;--text-soft:#e5e0e9;--text-muted:#c1b8c8}:root[data-theme=light]{--line:#2d28334d;--line-strong:#2d28338c;--text-soft:#49434f;--text-muted:#655d6c}}.advanced-surface{border-top:1px solid var(--line-strong);margin-top:22px;padding-top:24px;position:relative}.advanced-surface:before{content:"";inset-inline-start:0;background:linear-gradient(90deg, var(--accent), transparent);width:min(260px,42%);height:1px;box-shadow:0 0 16px color-mix(in srgb, var(--accent) 44%, transparent);position:absolute;top:-1px}.advanced-heading{justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:16px;display:flex}.advanced-heading>div{max-width:790px}.advanced-heading>div>span{color:var(--accent);font:650 8px var(--font-mono);letter-spacing:.18em}.advanced-heading h2{color:var(--text);letter-spacing:-.035em;margin:6px 0 0;font-size:clamp(20px,2.5vw,29px);font-weight:620}.advanced-heading p{color:var(--text-muted);margin:7px 0 0;font-size:11px;line-height:1.72}.advanced-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:10px;display:grid}.advanced-panel{border:1px solid var(--line);border-radius:var(--radius);background:linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 30%, transparent), transparent 31%), color-mix(in srgb, var(--glass) 94%, transparent);-webkit-backdrop-filter:blur(17px)saturate(1.08);backdrop-filter:blur(17px)saturate(1.08);min-width:0;transition:border-color .28s,background .34s,box-shadow .34s;position:relative;overflow:hidden;box-shadow:inset 0 1px #ffffff06}.advanced-panel:before{content:"";z-index:0;inset-inline-start:0;background:linear-gradient(var(--accent), transparent);opacity:.46;width:2px;height:62px;transition:height .48s var(--ease-out), opacity .3s;position:absolute;top:0}.advanced-panel[open]{border-color:color-mix(in srgb, var(--accent) 20%, var(--line));background:linear-gradient(128deg, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent 34%), color-mix(in srgb, var(--glass-strong) 95%, transparent);box-shadow:inset 0 1px #ffffff09,0 16px 42px #00000017}.advanced-panel[open]:before{opacity:.72;height:100%}.advanced-panel__summary{z-index:1;cursor:pointer;-webkit-user-select:none;user-select:none;grid-template-columns:38px minmax(0,1fr) auto 18px;align-items:center;gap:11px;min-height:82px;padding:13px 15px;list-style:none;display:grid;position:relative}.advanced-panel__summary::-webkit-details-marker{display:none}.advanced-panel__summary:after{content:"";z-index:-1;background:linear-gradient(103deg, var(--accent-soft), transparent 62%);clip-path:inset(0 100% 0 0);opacity:.7;transition:clip-path .45s var(--ease-out);position:absolute;inset:0}.advanced-panel__summary:hover:after,.advanced-panel__summary:focus-visible:after{clip-path:inset(0)}.advanced-panel__summary:focus-visible{outline:1px solid var(--accent);outline-offset:-3px}.advanced-panel__icon{border:1px solid color-mix(in srgb, var(--accent) 22%, var(--line));background:color-mix(in srgb, var(--accent-soft) 58%, var(--surface-muted));width:36px;height:36px;color:var(--accent);box-shadow:inset 0 0 16px color-mix(in srgb, var(--accent-soft) 65%, transparent);border-radius:9px;place-items:center;display:grid}.advanced-panel__copy{flex-direction:column;min-width:0;display:flex}.advanced-panel__copy small{color:var(--accent);font:630 7px var(--font-mono);letter-spacing:.14em}.advanced-panel__copy strong{color:var(--text);letter-spacing:-.012em;margin-top:4px;font-size:12px;font-weight:620}.advanced-panel__copy>span{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:3px;font-size:9px;line-height:1.45;overflow:hidden}.advanced-panel__chevron{color:var(--text-muted);transition:rotate .42s var(--ease-out), color .25s}.advanced-panel[open] .advanced-panel__chevron{color:var(--accent);rotate:180deg}.advanced-panel__body{z-index:1;border-top:1px solid var(--line);animation:advanced-unfold .42s var(--ease-out) both;padding:15px;position:relative}.front-panel-live{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 82%, transparent);align-items:center;gap:16px;margin-bottom:13px;padding:13px;display:flex}.front-panel-live>div:last-child{gap:3px;min-width:0;display:grid}.front-panel-live strong{color:var(--text);font-size:12px}.front-panel-live span,.front-panel-live small{color:var(--text-muted);font-size:10px}.live-segment-preview{border:1px solid color-mix(in srgb, var(--amber) 24%, var(--line));background:#151218;border-radius:9px;flex:none;gap:3px;padding:7px 9px;display:flex;box-shadow:inset 0 0 18px #000000b8}.live-segment-preview svg{width:28px;height:44px;overflow:visible}.live-segment-preview line{stroke:#c2b5cd29;stroke-width:5px;stroke-linecap:round;transition:stroke 80ms,filter 80ms}.live-segment-preview circle{fill:#c2b5cd29;transition:fill 80ms,filter 80ms}.live-segment-preview .is-lit{stroke:var(--amber);fill:var(--amber);filter:drop-shadow(0 0 4px color-mix(in srgb, var(--amber) 70%, transparent))}.advanced-actions,.advanced-inline-actions,.advanced-review__actions{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.advanced-actions+.advanced-fields,.advanced-actions+.advanced-toggle-stack,.advanced-actions+.advanced-note{margin-top:13px}.advanced-inline-actions{align-self:end}.advanced-fields{align-items:start;gap:9px;display:grid}.advanced-fields>.button{align-self:start;height:39px;min-height:39px;margin-top:30px}.advanced-fields--split{grid-template-columns:minmax(150px,1fr) minmax(170px,auto)}.advanced-fields--program{grid-template-columns:minmax(210px,1fr) minmax(170px,.8fr) auto;margin-top:12px}.advanced-fields--layout{grid-template-columns:.45fr 1fr auto;margin-top:12px}.advanced-fields--pixel{grid-template-columns:1.2fr repeat(3,minmax(72px,.65fr))}.advanced-fields--record{grid-template-columns:1fr .75fr .65fr auto;margin-top:12px}.advanced-fields--i2c{grid-template-columns:.7fr .7fr .7fr 1.4fr;margin-top:12px}.advanced-fields--message{grid-template-columns:minmax(130px,.42fr) minmax(190px,1fr) auto}.advanced-fields--history{grid-template-columns:minmax(120px,.65fr) minmax(120px,.65fr) auto auto;align-items:end}.advanced-field{min-width:0;margin:10px 0 0}.advanced-field>label{color:var(--text-soft);margin-bottom:7px;font-size:10px;font-weight:560;display:block}.advanced-field .segmented{max-width:100%;overflow-x:auto}.advanced-field .segmented button{flex:1;min-width:max-content}.advanced-control-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);grid-template-columns:minmax(190px,1.1fr) minmax(180px,1fr) auto;align-items:center;gap:14px;margin-top:13px;padding:8px 10px;display:grid}.advanced-control-row .toggle-row{border:0;min-height:48px;padding:4px 0}.advanced-control-row .range-field{margin:4px 0}.advanced-toggle-stack{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.advanced-toggle-stack .toggle-row{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);min-height:68px;padding:8px 10px}.advanced-toggle-stack--compact{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-toggle-stack--compact .toggle-row{min-height:52px}.network-device-directory{gap:10px;margin-top:12px;display:grid}.network-device{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 84%, transparent);border-radius:14px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;padding:12px;display:grid}.network-device strong,.network-device small{display:block}.network-device small{color:var(--text-muted);direction:ltr;margin-top:3px}.network-device p{color:var(--text-muted);grid-column:1/-1;margin:0}.network-device .button{justify-self:end}.advanced-nav-pad{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg-deep);grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:12px;padding:7px;display:grid}.advanced-nav-pad .button{font-family:var(--font-mono);text-transform:uppercase;justify-content:center}.advanced-divider{background:linear-gradient(90deg, var(--line-strong), var(--line), transparent);height:1px;margin:15px 0 4px}.advanced-command-inline{border:1px solid var(--line);background:var(--bg-deep);min-width:0;color:var(--accent);font:9px/1.6 var(--font-mono);scrollbar-width:thin;border-radius:7px;margin:11px 0;padding:9px 11px;overflow-x:auto}.advanced-command-inline code{white-space:nowrap}.advanced-note{border-inline-start:2px solid var(--amber);background:var(--amber-soft);color:var(--text-muted);margin:12px 0 0;padding:9px 11px;font-size:9px;line-height:1.65}.advanced-note--safe{border-inline-start-color:var(--green);background:var(--green-soft)}.advanced-form{gap:9px;display:grid}.advanced-service-output{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg-deep);min-height:124px;max-height:320px;color:var(--text-soft);font:9px/1.65 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;margin:13px 0 0;padding:12px;overflow:auto}.advanced-review{border:1px solid color-mix(in srgb, var(--amber) 28%, var(--line));border-radius:var(--radius);background:linear-gradient(115deg, color-mix(in srgb, var(--amber-soft) 62%, transparent), transparent 45%), var(--glass-strong);-webkit-backdrop-filter:blur(20px)saturate(1.12);backdrop-filter:blur(20px)saturate(1.12);margin-top:12px;padding:16px;position:relative;overflow:hidden;box-shadow:inset 0 1px #ffffff08}.advanced-review:before{content:"";inset-inline:0;background:linear-gradient(90deg, transparent, var(--amber), transparent);opacity:.75;height:2px;position:absolute;top:0}.advanced-review--danger{border-color:color-mix(in srgb, var(--red) 35%, var(--line));background:linear-gradient(115deg, var(--red-soft), transparent 48%), var(--glass-strong)}.advanced-review--danger:before{background:linear-gradient(90deg, transparent, var(--red), transparent)}.advanced-review>header{grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:11px;display:grid}.advanced-review__icon{border:1px solid color-mix(in srgb, var(--amber) 30%, var(--line));background:var(--amber-soft);width:36px;height:36px;color:var(--amber);border-radius:9px;place-items:center;display:grid}.advanced-review--danger .advanced-review__icon{border-color:color-mix(in srgb, var(--red) 35%, var(--line));background:var(--red-soft);color:var(--red)}.advanced-review>header small{color:var(--amber);font:650 7px var(--font-mono);letter-spacing:.16em}.advanced-review--danger>header small{color:var(--red)}.advanced-review h3{color:var(--text);margin:4px 0 0;font-size:13px;font-weight:620}.advanced-review__command{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--bg-deep);color:var(--text-soft);font:10px/1.65 var(--font-mono);grid-template-columns:auto minmax(0,1fr);align-items:start;gap:9px;margin-top:13px;padding:11px 12px;display:grid}.advanced-review__command>span{color:var(--accent);font-weight:700}.advanced-review__command code{overflow-wrap:anywhere;-webkit-user-select:all;user-select:all;min-width:0}.advanced-review>p{color:var(--text-muted);margin:10px 0 0;font-size:10px;line-height:1.65}.advanced-review__actions{margin-top:13px}.advanced-review__blocked{color:var(--amber);font:9px var(--font-mono)}.advanced-footnote{color:var(--text-muted);align-items:flex-start;gap:9px;margin-top:10px;padding:10px 12px;font-size:9px;line-height:1.6;display:flex}.advanced-footnote svg{color:var(--accent);flex:none;margin-top:1px}@keyframes advanced-unfold{0%{opacity:0;clip-path:inset(0 0 100%);filter:blur(4px)}to{opacity:1;clip-path:inset(0);filter:blur()}}@media (max-width:1180px){.advanced-grid{grid-template-columns:1fr}}@media (max-width:720px){.advanced-heading{flex-direction:column;gap:12px}.advanced-panel__summary{grid-template-columns:34px minmax(0,1fr) 16px;padding:12px}.advanced-panel__summary .status-badge{display:none}.advanced-panel__copy>span{white-space:normal}.advanced-panel__body{padding:12px}.advanced-fields--split,.advanced-fields--program,.advanced-fields--layout,.advanced-fields--record,.advanced-fields--message,.advanced-fields--history{grid-template-columns:1fr}.advanced-fields>.button{margin-top:0}.advanced-fields--pixel,.advanced-fields--i2c{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-control-row{grid-template-columns:1fr;gap:6px}.advanced-toggle-stack{grid-template-columns:1fr}.advanced-inline-actions{align-self:auto}.advanced-nav-pad{grid-template-columns:repeat(2,minmax(0,1fr))}.advanced-review>header{grid-template-columns:34px minmax(0,1fr)}.advanced-review>header .status-badge{grid-column:1/-1;justify-self:start}}@media (max-width:460px){.advanced-actions .button,.advanced-inline-actions .button,.advanced-review__actions .button{flex:1;justify-content:center;min-width:120px}.advanced-fields--pixel,.advanced-fields--i2c{grid-template-columns:1fr}.advanced-panel__copy strong{font-size:11px}}.hotkey-card{min-height:470px}.hotkey-editor{grid-template-columns:minmax(250px,.72fr) minmax(420px,1.28fr);align-items:stretch;gap:14px;display:grid}.hotkey-editor__library,.hotkey-editor__form{border:1px solid var(--line);border-radius:var(--radius);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);min-width:0}.hotkey-editor__library{overflow:hidden}.hotkey-editor__library>header{border-bottom:1px solid var(--line);background:linear-gradient(110deg, color-mix(in srgb, var(--violet-soft) 64%, transparent), transparent 58%);justify-content:space-between;align-items:center;gap:12px;min-height:58px;padding:11px 12px;display:flex}.hotkey-editor__library>header>div{flex-direction:column;min-width:0;display:flex}.hotkey-editor__library>header strong{color:var(--text);font-size:11px}.hotkey-editor__library>header small{color:var(--text-muted);margin-top:3px;font-size:8px}.hotkey-binding-list{scrollbar-width:thin;max-height:380px;padding:7px;overflow:auto}.hotkey-binding-list>button{width:100%;min-height:60px;color:var(--text-soft);text-align:start;cursor:pointer;transition:border-color .25s, background-color .25s, box-shadow .38s var(--ease-out);background:0 0;border:1px solid #0000;border-radius:11px;outline:0;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 9px;display:grid;position:relative;overflow:hidden}.hotkey-binding-list>button+button{margin-top:3px}.hotkey-binding-list>button:after{content:"";background:var(--violet);opacity:0;width:2px;transition:scale .42s var(--ease-out), opacity .25s;position:absolute;inset-block:9px;inset-inline-start:0;scale:1 0}.hotkey-binding-list>button:hover,.hotkey-binding-list>button:focus-visible{border-color:color-mix(in srgb, var(--violet) 24%, var(--line));background:color-mix(in srgb, var(--violet-soft) 42%, transparent);box-shadow:inset 0 0 24px color-mix(in srgb, var(--violet-soft) 30%, transparent)}.hotkey-binding-list>button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.hotkey-binding-list>button.is-selected{border-color:color-mix(in srgb, var(--violet) 38%, var(--line));background:linear-gradient(105deg, color-mix(in srgb, var(--violet-soft) 78%, transparent), color-mix(in srgb, var(--surface-muted) 76%, transparent));box-shadow:inset 0 0 30px color-mix(in srgb, var(--violet-soft) 34%, transparent)}.hotkey-binding-list>button.is-selected:after{opacity:.9;scale:1}.hotkey-binding-list__icon{border:1px solid color-mix(in srgb, var(--violet) 27%, var(--line));background:color-mix(in srgb, var(--violet-soft) 55%, var(--surface-muted));width:32px;height:32px;color:var(--violet);border-radius:9px;place-items:center;display:grid}.hotkey-binding-list__copy{flex-direction:column;gap:7px;min-width:0;display:flex}.hotkey-binding-list__copy>strong{text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.hotkey-binding-list__copy kbd{padding:2px 5px;font-size:7px}.hotkey-binding-list__copy .key-combo,.hotkey-binding-list__copy .key-combo__group,.hotkey-binding-list__copy .key-combo__key{gap:3px}.hotkey-binding-list__state{border:1px solid var(--line);color:var(--text-muted);background:var(--surface-muted);font:650 7px/1 var(--font-mono);letter-spacing:.06em;text-transform:uppercase;border-radius:6px;padding:4px 6px}.hotkey-binding-list__state.is-enabled{border-color:color-mix(in srgb, var(--green) 26%, transparent);color:var(--green);background:var(--green-soft)}.hotkey-binding-list__empty{min-height:180px;color:var(--text-muted);text-align:center;align-content:center;place-items:center;gap:10px;padding:24px;font-size:10px;display:grid}.hotkey-binding-list__empty svg{color:var(--violet);opacity:.75}.hotkey-editor__form{flex-direction:column;padding:15px;display:flex}.hotkey-editor__form-heading{border-bottom:1px solid var(--line);align-items:center;gap:10px;min-height:43px;padding-bottom:12px;display:flex}.hotkey-editor__form-icon{border:1px solid color-mix(in srgb, var(--accent) 27%, var(--line));background:var(--accent-soft);width:34px;height:34px;color:var(--accent);border-radius:10px;flex:none;place-items:center;display:grid}.hotkey-editor__form-heading>div{flex-direction:column;min-width:0;display:flex}.hotkey-editor__form-heading small{color:var(--accent);font:650 7px/1.2 var(--font-mono);letter-spacing:.14em}.hotkey-editor__form-heading strong{color:var(--text);text-overflow:ellipsis;white-space:nowrap;margin-top:5px;font-size:12px;overflow:hidden}.hotkey-editor__fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;margin-top:3px;display:grid}.hotkey-editor__fields .text-field{margin-block:10px 0}.hotkey-command-field,.hotkey-recorder-field{flex-direction:column;gap:7px;min-width:0;margin-top:10px;display:flex}.hotkey-command-field>span,.hotkey-recorder-field>span{color:var(--text-soft);font-size:10px;font-weight:580}.hotkey-command-field select{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-muted);width:100%;height:39px;color:var(--text);outline:0;padding-inline:11px 30px;font-size:11px;transition:border-color .25s,box-shadow .3s}.hotkey-command-field select:focus{border-color:color-mix(in srgb, var(--accent) 48%, transparent);box-shadow:inset 0 0 18px var(--accent-soft)}.hotkey-command-field>small,.hotkey-recorder-field>small{min-height:12px;color:var(--text-muted);font:8px/1.5 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hotkey-command-field.is-invalid select{border-color:color-mix(in srgb, var(--red) 65%, var(--line))}.hotkey-recorder-field{grid-column:1/-1}.hotkey-recorder{border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:linear-gradient(105deg, color-mix(in srgb, var(--surface-muted) 88%, transparent), color-mix(in srgb, var(--violet-soft) 38%, transparent));min-height:64px;color:var(--text);text-align:start;cursor:pointer;transition:border-color .28s, box-shadow .4s var(--ease-out), background-color .28s;outline:0;grid-template-columns:3px minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 12px;display:grid;position:relative;overflow:hidden}.hotkey-recorder:hover,.hotkey-recorder:focus-visible{border-color:color-mix(in srgb, var(--violet) 45%, var(--line));box-shadow:inset 0 0 28px color-mix(in srgb, var(--violet-soft) 45%, transparent), 0 8px 24px #0000001a}.hotkey-recorder:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.hotkey-recorder.is-recording{border-color:color-mix(in srgb, var(--amber) 58%, var(--line));background:linear-gradient(105deg, var(--amber-soft), color-mix(in srgb, var(--surface-muted) 80%, transparent), var(--amber-soft));box-shadow:inset 0 0 30px color-mix(in srgb, var(--amber-soft) 60%, transparent);background-size:220% 100%;animation:1.8s ease-in-out infinite hotkey-listening}.hotkey-recorder__indicator{background:var(--violet);width:3px;height:24px;box-shadow:0 0 10px color-mix(in srgb, var(--violet) 60%, transparent);border-radius:1px}.hotkey-recorder.is-recording .hotkey-recorder__indicator{background:var(--amber);box-shadow:0 0 12px color-mix(in srgb, var(--amber) 72%, transparent);animation:1s ease-in-out infinite hotkey-signal}.hotkey-recorder>small{color:var(--text-muted);white-space:nowrap;font-size:8px}.hotkey-recorder .key-combo{min-width:0}.hotkey-recorder kbd{color:var(--text-soft);padding:5px 8px;font-size:10px}.hotkey-recorder-field.is-invalid .hotkey-recorder{border-color:color-mix(in srgb, var(--red) 58%, var(--line))}.hotkey-editor__form>.toggle-row{min-height:54px;margin-top:8px;padding-block:8px}.hotkey-editor__notice{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 68%, transparent);min-height:46px;color:var(--text-muted);grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;margin-top:9px;padding:9px 11px;font-size:9px;line-height:1.55;transition:border-color .3s,color .3s,background-color .3s;display:grid}.hotkey-editor__notice svg{color:currentColor}.hotkey-editor__notice-line{background:currentColor;width:13px;height:2px;box-shadow:0 0 8px}.hotkey-editor__notice.is-success{border-color:color-mix(in srgb, var(--green) 28%, var(--line));color:var(--green);background:var(--green-soft)}.hotkey-editor__notice.is-warning{border-color:color-mix(in srgb, var(--amber) 30%, var(--line));color:var(--amber);background:var(--amber-soft)}.hotkey-editor__notice.is-danger{border-color:color-mix(in srgb, var(--red) 34%, var(--line));color:var(--red);background:var(--red-soft)}.hotkey-editor__actions{flex-wrap:wrap;align-items:center;gap:8px;min-height:42px;margin-top:12px;display:flex}.hotkey-editor__load-error{border:1px solid color-mix(in srgb, var(--red) 30%, var(--line));border-radius:var(--radius);background:var(--red-soft);min-height:170px;color:var(--red);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;padding:18px;display:grid}.hotkey-editor__load-error>div{flex-direction:column;min-width:0;display:flex}.hotkey-editor__load-error strong{font-size:12px}.hotkey-editor__load-error span{overflow-wrap:anywhere;color:var(--text-soft);margin-top:5px;font-size:9px}.rf-guide-card{grid-column:1/-1}.rf-guide{outline:0;flex-direction:column;gap:14px;display:flex}.rf-guide:focus-visible{border-radius:var(--radius-sm);box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 58%, transparent)}.rf-guide__steps{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none;display:grid}.rf-guide__steps button{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 86%, transparent);width:100%;min-height:78px;color:var(--text-soft);text-align:start;cursor:pointer;grid-template-rows:auto auto;grid-template-columns:30px 1fr;align-items:center;column-gap:9px;padding:11px;transition:border-color .24s,background .24s,box-shadow .24s,color .24s;display:grid;position:relative}.rf-guide__steps button:after{content:"";background:var(--violet);opacity:0;transform-origin:50%;border-radius:2px 2px 0 0;height:2px;transition:opacity .24s,transform .32s cubic-bezier(.22,1,.36,1);position:absolute;inset-block-end:-1px;inset-inline:10px;transform:scaleX(.35)}.rf-guide__steps button:hover{border-color:color-mix(in srgb, var(--violet) 35%, var(--line));background:color-mix(in srgb, var(--violet-soft) 42%, var(--surface-muted))}.rf-guide__steps button.is-active{border-color:color-mix(in srgb, var(--violet) 50%, var(--line));background:linear-gradient(115deg, color-mix(in srgb, var(--violet-soft) 82%, var(--surface-muted)), var(--surface-muted));box-shadow:inset 3px 0 var(--violet), 0 10px 30px color-mix(in srgb, var(--violet-soft) 40%, transparent);color:var(--text)}[dir=rtl] .rf-guide__steps button.is-active{box-shadow:inset -3px 0 var(--violet), 0 10px 30px color-mix(in srgb, var(--violet-soft) 40%, transparent)}.rf-guide__steps button.is-active:after{opacity:1;transform:scaleX(1)}.rf-guide__steps button>span{background:color-mix(in srgb, var(--violet-soft) 72%, var(--surface-solid));width:28px;height:34px;color:var(--violet);font:700 11px var(--font-mono);border-radius:8px;grid-row:1/3;place-items:center;display:grid}.rf-guide__steps strong{align-self:end;font-size:10px}.rf-guide__steps small{min-width:0;color:var(--text-muted);font:8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;align-self:start;overflow:hidden}.rf-guide__message{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 78%, transparent);border-inline-start-width:3px;grid-template-columns:35px 1fr;align-items:center;gap:10px;min-height:62px;padding:11px 13px;transition:border-color .28s,background .28s;display:grid}.rf-guide__message>span{background:var(--surface-solid);width:32px;height:32px;color:var(--text-muted);border-radius:9px;place-items:center;display:grid}.rf-guide__message strong{color:var(--text);font:750 9px var(--font-mono);letter-spacing:.08em;display:block}.rf-guide__message p{color:var(--text-soft);margin:3px 0 0;font-size:9px;line-height:1.5}.rf-guide__message--info{border-inline-start-color:var(--violet);background:linear-gradient(100deg, color-mix(in srgb, var(--violet-soft) 70%, transparent), color-mix(in srgb, var(--surface-muted) 85%, transparent))}.rf-guide__message--good{border-inline-start-color:var(--green)}.rf-guide__message--warn{border-inline-start-color:var(--amber);background:linear-gradient(100deg, var(--amber-soft), color-mix(in srgb, var(--surface-muted) 85%, transparent))}.rf-guide__capture{border:1px solid color-mix(in srgb, var(--violet) 25%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(115deg, color-mix(in srgb, var(--violet-soft) 70%, transparent), color-mix(in srgb, var(--surface-muted) 82%, transparent));justify-content:space-between;align-items:center;gap:18px;padding:14px;display:flex}.rf-guide__capture>div{align-items:center;gap:12px;display:flex}.rf-guide__label{border:1px solid color-mix(in srgb, var(--violet) 45%, var(--line));background:var(--surface-solid);width:46px;height:52px;color:var(--violet);box-shadow:inset 0 -8px 22px var(--violet-soft);font:800 18px var(--font-mono);border-radius:11px;flex:none;place-items:center;display:grid}.rf-guide__capture strong,.rf-guide__identity strong,.rf-guide__mapping strong{color:var(--text);font-size:11px}.rf-guide__capture p,.rf-guide__identity p,.rf-guide__mapping p{color:var(--text-muted);margin:4px 0 0;font-size:9px;line-height:1.5}.rf-guide__listening{border:1px solid color-mix(in srgb, var(--violet) 35%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(100deg, color-mix(in srgb, var(--violet-soft) 60%, transparent), var(--surface-muted), color-mix(in srgb, var(--violet-soft) 60%, transparent));justify-content:center;align-items:center;gap:24px;min-height:98px;padding:14px;display:flex}.rf-guide__signal{height:47px;color:var(--violet);align-items:center;gap:5px;display:flex}.rf-guide__signal i{width:4px;height:12px;box-shadow:0 0 10px color-mix(in srgb, var(--violet) 50%, transparent);background:currentColor;border-radius:2px;animation:1.15s ease-in-out infinite alternate rf-signal}.rf-guide__signal i:nth-child(2){height:28px;animation-delay:-.38s}.rf-guide__signal i:nth-child(3){height:42px;animation-delay:-.76s}@keyframes rf-signal{0%{opacity:.35;transform:scaleY(.45)}to{opacity:1;transform:scaleY(1)}}.rf-guide__identity,.rf-guide__mapping{border:1px solid color-mix(in srgb, var(--violet) 32%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(135deg, color-mix(in srgb, var(--surface-solid) 82%, transparent), color-mix(in srgb, var(--violet-soft) 38%, var(--surface-muted)));box-shadow:0 14px 38px color-mix(in srgb, var(--shadow-color,#000) 15%, transparent);padding:15px}.rf-guide__identity>header,.rf-guide__mapping>header{color:var(--violet);justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px;display:flex}.rf-guide__identity>header{justify-content:flex-start}.rf-guide__identity dl{grid-template-columns:70px 1.6fr repeat(3,1fr);gap:7px;margin:0 0 13px;display:grid}.rf-guide__identity dl>div{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 84%, transparent);border-radius:8px;min-width:0;padding:9px}.rf-guide__identity dt{color:var(--text-muted);font:700 7px var(--font-mono);letter-spacing:.1em}.rf-guide__identity dd{color:var(--text);font:700 10px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;margin:5px 0 0;overflow:hidden}.rf-guide__actions{flex-wrap:wrap;gap:8px;display:flex}.rf-guide__mapping-kind>label,.rf-guide__mapping-fields label>span{color:var(--text-muted);font:650 8px var(--font-mono);letter-spacing:.06em;margin-bottom:6px;display:block}.rf-guide__mapping-kind .segmented{overflow-x:auto}.rf-guide__mapping-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;display:grid}.rf-guide__mapping-fields select{border:1px solid var(--line-strong);background:var(--surface-solid);width:100%;height:39px;color:var(--text);font:600 10px var(--font-ui);border-radius:8px;outline:0;padding-inline:11px 32px;transition:border-color .2s,box-shadow .2s,background .2s}.rf-guide__mapping-fields select:focus-visible{border-color:var(--violet);box-shadow:0 0 0 3px color-mix(in srgb, var(--violet) 18%, transparent)}.rf-guide__keyboard{border:1px solid var(--line);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);color:var(--text-muted);border-radius:9px;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:9px 11px;font-size:8px;display:flex}.rf-guide__keyboard .key-combo{margin-inline-start:8px}.rf-guide__keyboard .key-combo:first-child{margin-inline-start:0}.rf-inventory{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 70%, transparent);overflow:hidden}.rf-inventory>header{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:12px 13px;display:flex}.rf-inventory>header h3{color:var(--text);margin:3px 0 0;font-size:11px}.rf-inventory>header>div:last-child{align-items:center;gap:8px;display:flex}.rf-inventory__list{flex-direction:column;display:flex}.rf-inventory__list article{border-bottom:1px solid var(--line);grid-template-columns:34px minmax(150px,1.2fr) minmax(135px,1fr) auto;align-items:center;gap:10px;min-height:64px;padding:9px 12px;transition:background .2s,box-shadow .2s;display:grid}.rf-inventory__list article:last-child{border-bottom:0}.rf-inventory__list article:hover{background:color-mix(in srgb, var(--surface-hover) 76%, transparent);box-shadow:inset 3px 0 color-mix(in srgb, var(--violet) 35%, transparent)}[dir=rtl] .rf-inventory__list article:hover{box-shadow:inset -3px 0 color-mix(in srgb, var(--violet) 35%, transparent)}.rf-inventory__list article.needs-review{background:linear-gradient(100deg, color-mix(in srgb, var(--amber-soft) 74%, transparent), transparent 52%)}.rf-inventory__id{background:var(--surface-solid);width:30px;height:32px;color:var(--text-muted);font:700 9px var(--font-mono);border-radius:8px;place-items:center;display:grid}.rf-inventory__identity,.rf-inventory__mapping{min-width:0}.rf-inventory__identity strong,.rf-inventory__mapping span{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;font-size:9px;display:block;overflow:hidden}.rf-inventory__identity small,.rf-inventory__mapping small{color:var(--text-muted);font:8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;display:block;overflow:hidden}.rf-inventory__mapping small{color:var(--amber)}.rf-inventory__actions{align-items:center;gap:6px;display:flex}.rf-inventory__actions .button:last-child{width:32px;padding-inline:0}.rf-inventory__empty{color:var(--text-muted);text-align:center;justify-items:center;padding:25px;display:grid}.rf-inventory__empty strong{color:var(--text-soft);margin-top:8px;font-size:10px}.rf-inventory__empty p{margin:5px 0 0;font-size:9px}.rf-inventory>footer{border-top:1px solid var(--line);color:var(--text-muted);font:8px var(--font-mono);justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;display:flex}@media (max-width:820px){.rf-guide__steps{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-guide__capture{flex-direction:column;align-items:stretch}.rf-guide__capture .button{justify-content:center}.rf-guide__identity dl{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-guide__identity dl>div:nth-child(2){grid-column:span 2}.rf-inventory__list article{grid-template-columns:34px 1fr}.rf-inventory__mapping,.rf-inventory__actions{grid-column:2}.rf-inventory__actions{flex-wrap:wrap}}@media (max-width:520px){.rf-guide__steps{grid-template-columns:1fr}.rf-guide__steps button{min-height:64px}.rf-guide__mapping-fields{grid-template-columns:1fr}.rf-guide__actions .button{justify-content:center;width:100%}.rf-guide__keyboard{display:none}.rf-inventory>header{flex-direction:column;align-items:stretch}.rf-inventory>header>div:last-child{justify-content:space-between}.rf-inventory__actions .button{flex:1;justify-content:center}.rf-inventory__actions .button:last-child{flex:0 0 34px}}@media (prefers-reduced-motion:reduce){.rf-guide__signal i{animation:none}}@keyframes hotkey-listening{0%,to{background-position:0 0}50%{background-position:100% 0}}@keyframes hotkey-signal{50%{opacity:.36;scale:1 .55}}@media (max-width:980px){.hotkey-editor{grid-template-columns:1fr}.hotkey-binding-list{max-height:260px}}@media (max-width:560px){.hotkey-card{min-height:0}.hotkey-editor__fields{grid-template-columns:1fr}.hotkey-recorder-field{grid-column:auto}.hotkey-binding-list>button{grid-template-columns:32px minmax(0,1fr)}.hotkey-binding-list__state{grid-column:2;justify-self:start}.hotkey-recorder{grid-template-columns:3px minmax(0,1fr)}.hotkey-recorder>small{grid-column:2}.hotkey-editor__actions .button{flex:1;min-width:120px}.hotkey-editor__load-error{grid-template-columns:auto minmax(0,1fr)}.hotkey-editor__load-error .button{grid-column:1/-1}}.segment-scroll-settings__notice{color:var(--text-muted)}.segment-scroll-settings__notice.is-error{color:var(--danger)}.workbench-grid>[data-layout-card-id=macros]{grid-column:1/-1}.macro-library{gap:13px;min-width:0;display:grid}.macro-library__monitor{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:stretch;gap:8px;display:grid}.macro-library__monitor>div{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 82%, transparent);min-width:0;min-height:68px;color:var(--text-muted);grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:10px 12px;transition:border-color .2s,background-color .2s,box-shadow .2s;display:grid}.macro-library__monitor>div.is-active{border-color:color-mix(in srgb, var(--green) 42%, var(--line));background:linear-gradient(110deg, var(--green-soft), var(--surface-muted));box-shadow:inset 3px 0 var(--green);color:var(--green)}[dir=rtl] .macro-library__monitor>div.is-active{box-shadow:inset -3px 0 var(--green)}.macro-library__monitor>div>span{gap:2px;min-width:0;display:grid}.macro-library__monitor small{color:currentColor;font:700 7px var(--font-mono);letter-spacing:.12em}.macro-library__monitor strong{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.macro-library__monitor em{color:var(--text-muted);font:8px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;font-style:normal;overflow:hidden}.macro-library__monitor>.status-badge{align-self:center}.macro-library__error{border:1px solid color-mix(in srgb, var(--red) 35%, var(--line));background:var(--red-soft);color:var(--red);border-radius:8px;padding:9px 11px;font-size:9px;line-height:1.5}.macro-library__command-surface{border:1px solid color-mix(in srgb, var(--amber) 30%, var(--line));background:var(--amber-soft);color:var(--text-soft);border-radius:8px;justify-content:space-between;align-items:center;gap:10px;padding:9px 11px;font-size:9px;line-height:1.5;display:flex}.macro-library__workspace{grid-template-columns:minmax(270px,.9fr) minmax(360px,1.1fr);gap:10px;display:grid}.macro-library__workspace>section,.macro-library__control-grid>section,.macro-library__events{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 70%, transparent);min-width:0;padding:12px}.macro-library__workspace>section>header,.macro-library__control-grid>section>header,.macro-library__events>header{min-height:24px;color:var(--text-soft);font:700 9px var(--font-mono);letter-spacing:.05em;justify-content:space-between;align-items:center;gap:9px;margin-bottom:9px;display:flex}.macro-library__workspace>section>header span{align-items:center;gap:7px;display:inline-flex}.macro-library__workspace>section>header small{background:var(--accent-soft);min-width:24px;color:var(--accent);text-align:center;border-radius:999px;padding:3px 6px}.macro-library__catalog{scrollbar-width:thin;flex-direction:column;gap:5px;max-height:285px;display:flex;overflow-y:auto}.macro-library__catalog>button{border:1px solid var(--line);background:var(--surface-solid);width:100%;min-width:0;color:var(--text-soft);text-align:start;border-radius:8px;grid-template-columns:7px minmax(130px,1fr) minmax(50px,auto) minmax(72px,auto);align-items:center;gap:9px;padding:9px;transition:border-color .18s,background-color .18s,box-shadow .18s;display:grid}.macro-library__catalog>button:hover{border-color:color-mix(in srgb, var(--accent) 34%, var(--line));background:var(--surface-hover)}.macro-library__catalog>button.is-selected{border-color:color-mix(in srgb, var(--accent) 55%, var(--line));background:linear-gradient(110deg, var(--accent-soft), var(--surface-solid));box-shadow:inset 3px 0 var(--accent)}[dir=rtl] .macro-library__catalog>button.is-selected{box-shadow:inset -3px 0 var(--accent)}.macro-library__color{background:var(--red);width:6px;height:32px;box-shadow:0 0 9px color-mix(in srgb, var(--red) 45%, transparent);border-radius:4px}.macro-library__color.is-blue{background:#4f8cff;box-shadow:0 0 9px #4f8cff73}.macro-library__color.is-violet{background:var(--violet);box-shadow:0 0 9px color-mix(in srgb, var(--violet) 45%, transparent)}.macro-library__color.is-green{background:var(--green);box-shadow:0 0 9px color-mix(in srgb, var(--green) 45%, transparent)}.macro-library__color.is-white{background:#f3efff;box-shadow:0 0 9px #f3efff80}.macro-library__identity,.macro-library__measure{gap:3px;min-width:0;display:grid}.macro-library__identity strong{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.macro-library__identity small,.macro-library__measure small{color:var(--text-muted);font:7px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__measure{justify-items:end}.macro-library__measure strong{color:var(--text-soft);font:700 9px var(--font-mono)}.macro-library__empty{border:1px dashed var(--line);min-height:82px;color:var(--text-muted);text-align:center;border-radius:8px;place-items:center;padding:12px;font-size:9px;display:grid}.macro-library__fields{grid-template-columns:minmax(72px,.3fr) minmax(140px,1fr) minmax(120px,.75fr);gap:8px;display:grid}.macro-library__color-picker{margin-top:9px}.macro-library__color-picker>label{color:var(--text-muted);margin-bottom:6px;font-size:9px;display:block}.macro-library__color-picker .segmented{overflow-x:auto}.macro-library__actions,.macro-library__playback-actions{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.macro-library__editor>.macro-library__actions{margin-top:10px}.macro-library__steps{border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb, var(--surface-muted) 72%, transparent);overflow:hidden}.macro-library__steps>summary{color:var(--text-soft);font:700 9px var(--font-mono);padding:10px 12px}.macro-library__steps>div{border-top:1px solid var(--line);scrollbar-width:thin;max-height:230px;overflow:auto}.macro-library__steps [role=row]{border-bottom:1px solid var(--line);min-width:620px;color:var(--text-muted);font:8px var(--font-mono);grid-template-columns:42px minmax(110px,.8fr) 90px 100px minmax(170px,1fr);align-items:center;gap:8px;padding:7px 11px;display:grid}.macro-library__steps [role=row]:last-child{border-bottom:0}.macro-library__steps [role=row] strong{color:var(--text-soft)}.macro-library__steps code{color:var(--accent);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__control-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.macro-library__control-grid p{min-height:31px;color:var(--text-muted);margin:0 0 10px;font-size:8px;line-height:1.55}.macro-library__board-id{width:min(160px,100%);margin-bottom:8px}.macro-library__playback-actions{border:1px solid color-mix(in srgb, var(--accent) 22%, var(--line));border-radius:var(--radius-sm);background:linear-gradient(100deg, var(--accent-soft), transparent 45%), var(--surface-muted);padding:10px}.macro-library__events{scrollbar-width:thin;max-height:210px;overflow-y:auto}.macro-library__events>div{border-bottom:1px solid var(--line);min-width:0;color:var(--text-muted);font:8px var(--font-mono);grid-template-columns:82px minmax(130px,.65fr) minmax(160px,1fr) auto;align-items:center;gap:8px;padding:6px 2px;display:grid}.macro-library__events>div:last-child{border-bottom:0}.macro-library__events strong{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__events span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.macro-library__events code{color:var(--green)}.macro-library__events p{color:var(--text-muted);margin:0;font-size:9px}@media (max-width:900px){.macro-library__monitor{grid-template-columns:1fr 1fr}.macro-library__monitor>.status-badge{grid-column:1/-1;justify-self:start}.macro-library__workspace,.macro-library__control-grid{grid-template-columns:1fr}}@media (max-width:600px){.macro-library__monitor{grid-template-columns:1fr}.macro-library__monitor>.status-badge{grid-column:1}.macro-library__fields{grid-template-columns:80px minmax(0,1fr)}.macro-library__fields .text-field:last-child{grid-column:1/-1}.macro-library__catalog>button{grid-template-columns:7px minmax(105px,1fr) auto}.macro-library__catalog .macro-library__measure:last-child{display:none}.macro-library__events>div{grid-template-columns:68px minmax(110px,.7fr) minmax(130px,1fr)}.macro-library__events code{grid-column:2/-1}.macro-library__actions .button,.macro-library__playback-actions .button{flex:145px;justify-content:center}}.connected-apps-list{gap:10px;display:grid}.connected-app{border:1px solid var(--line);background:var(--surface-muted);border-radius:10px;grid-template-columns:minmax(190px,1fr) minmax(180px,auto);align-items:center;gap:10px 12px;min-width:0;padding:12px;display:grid}.connected-app__identity{align-items:center;gap:10px;min-width:0;display:flex}.connected-app__identity>div{gap:2px;min-width:0;display:grid}.connected-app__identity strong{color:var(--text);text-transform:capitalize}.connected-app__identity span{color:var(--text-muted);font:11px var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.connected-app__facts{color:var(--text-muted);flex-wrap:wrap;justify-content:flex-end;gap:5px 10px;font-size:12px;display:flex}.connected-app__facts span[title]{text-overflow:ellipsis;white-space:nowrap;max-width:280px;overflow:hidden}.connected-app__capabilities{flex-wrap:wrap;grid-column:1/-1;gap:5px;min-width:0;display:flex}.connected-app__capabilities code,.connected-app__capabilities span{border:1px solid var(--line);color:var(--text-muted);background:var(--surface);font:10px var(--font-mono);border-radius:999px;padding:3px 7px}.connected-app__actions{grid-column:1/-1;justify-content:flex-end;gap:6px;display:flex}@media (max-width:760px){.connected-app{grid-template-columns:1fr}.connected-app__facts{justify-content:flex-start}} diff --git a/Tools/Controller/internal/webui/dist/assets/workbench-D1U8nUNX.css b/Tools/Controller/internal/webui/dist/assets/workbench-D1U8nUNX.css new file mode 100644 index 00000000..9c4d1598 --- /dev/null +++ b/Tools/Controller/internal/webui/dist/assets/workbench-D1U8nUNX.css @@ -0,0 +1 @@ +.rf-receive-indicator{background:var(--text-muted,#777);vertical-align:middle;border-radius:50%;flex:0 0 10px;width:10px;height:10px;display:inline-block}.rf-receive-indicator.is-on{background:#2dbd64;box-shadow:0 0 0 3px #2dbd641c}.rf-receive-count{min-width:4ch;font:inherit;font-variant-numeric:tabular-nums;color:var(--text-muted,#888);align-items:center;display:inline-flex}.rf-observed-cards{gap:8px;margin-top:12px;display:grid}.rf-manager__toolbar,.rf-manager__actions{align-items:center;gap:8px;display:flex}.rf-manager__settings{border:1px solid var(--border,#8884);border-radius:10px;gap:10px;margin:12px 0;padding:12px;display:grid}.rf-manager__list{gap:6px;margin-top:12px;display:grid}.rf-manager__row{border:1px solid var(--border,#8884);border-radius:10px;align-items:center;gap:10px;min-width:0;padding:10px;display:flex}.rf-manager__identity{flex:1;gap:3px;min-width:0;display:grid}.rf-manager__identity strong,.rf-manager__identity small{overflow-wrap:anywhere}.rf-manager__identity.is-unlearned{color:var(--text-muted,#888)}.rf-manager__identity small{color:var(--text-muted,#888);font-size:.8em}.workbench-grid>[data-layout-card-id=radio]{grid-column:1/-1}@media (min-width:1100px){.rf-manager__list{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-manager__settings{grid-template-columns:repeat(3,minmax(0,1fr));align-items:center}}@media (max-width:480px){.rf-manager__row{flex-wrap:wrap}.rf-manager__actions{margin-inline-start:auto}} diff --git a/Tools/Controller/internal/webui/dist/index.html b/Tools/Controller/internal/webui/dist/index.html index 128532a9..28d08840 100644 --- a/Tools/Controller/internal/webui/dist/index.html +++ b/Tools/Controller/internal/webui/dist/index.html @@ -22,8 +22,8 @@ - - + +
Preparing control surface
diff --git a/Tools/Controller/toolchain-lock.json b/Tools/Controller/toolchain-lock.json index 7d875e6c..d43eeb47 100644 --- a/Tools/Controller/toolchain-lock.json +++ b/Tools/Controller/toolchain-lock.json @@ -1,6 +1,6 @@ { "policy_name": "controllerboardmini-atmega328p", - "resolved_at_utc": "2026-10-10T01:46:26.007Z", + "resolved_at_utc": "2026-10-28T01:23:22.531Z", "firmware": { "name": "controllerboardmini-atmega328p", "fqbn": "MiniCore:avr:328:bootloader=uart0,eeprom=keep,baudrate=115200,variant=modelP,BOD=2v7,LTO=Os_flto,clock=16MHz_external", @@ -138,8 +138,8 @@ "tree_hash": "45f53abdb3c6164df0ff853232ba58b62fa1409b" }, "go": { - "version": "1.27.2", - "go_mod_sha256": "e918314d72e42bd92b773612beb7b6595391222b6ae84bf60ceefcbbb6e1b023", - "go_sum_sha256": "1cce8880978b8b85e2b1f4167c59617842b8f211f2e0ecf72493291e2350cab5" + "version": "1.27.3", + "go_mod_sha256": "59a2cdac2bbb5146db8bc6f6419f0e5077d8b7a375ffb23b8839811b04dadbd8", + "go_sum_sha256": "12b3c9489dfcc0a34010eb558aef19853274ef42d84d4d448d51292416be1380" } } diff --git a/Tools/Controller/web/package-lock.json b/Tools/Controller/web/package-lock.json index 47dd773b..9f575b9e 100644 --- a/Tools/Controller/web/package-lock.json +++ b/Tools/Controller/web/package-lock.json @@ -56,9 +56,9 @@ } }, "node_modules/@oxc-project/types": { - "version": "0.153.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.153.0.tgz", - "integrity": "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==", + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", "dev": true, "license": "MIT", "funding": { @@ -92,9 +92,9 @@ } }, "node_modules/@rolldown/binding-android-arm-eabi": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.13.tgz", - "integrity": "sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz", + "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==", "cpu": [ "arm" ], @@ -109,9 +109,9 @@ } }, "node_modules/@rolldown/binding-android-arm64": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.13.tgz", - "integrity": "sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz", + "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==", "cpu": [ "arm64" ], @@ -126,9 +126,9 @@ } }, "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.13.tgz", - "integrity": "sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz", + "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==", "cpu": [ "arm64" ], @@ -143,9 +143,9 @@ } }, "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.13.tgz", - "integrity": "sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz", + "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==", "cpu": [ "x64" ], @@ -160,9 +160,9 @@ } }, "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.13.tgz", - "integrity": "sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz", + "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==", "cpu": [ "x64" ], @@ -177,9 +177,9 @@ } }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.13.tgz", - "integrity": "sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz", + "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==", "cpu": [ "arm" ], @@ -194,9 +194,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.13.tgz", - "integrity": "sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz", + "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==", "cpu": [ "arm64" ], @@ -214,9 +214,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.13.tgz", - "integrity": "sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz", + "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==", "cpu": [ "arm64" ], @@ -234,9 +234,9 @@ } }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.13.tgz", - "integrity": "sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz", + "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==", "cpu": [ "ppc64" ], @@ -254,9 +254,9 @@ } }, "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.13.tgz", - "integrity": "sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz", + "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==", "cpu": [ "s390x" ], @@ -274,9 +274,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.13.tgz", - "integrity": "sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz", + "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==", "cpu": [ "x64" ], @@ -294,9 +294,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.13.tgz", - "integrity": "sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz", + "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==", "cpu": [ "x64" ], @@ -314,9 +314,9 @@ } }, "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.13.tgz", - "integrity": "sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz", + "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==", "cpu": [ "arm64" ], @@ -331,9 +331,9 @@ } }, "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.13.tgz", - "integrity": "sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz", + "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==", "cpu": [ "arm64" ], @@ -348,9 +348,9 @@ } }, "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.13.tgz", - "integrity": "sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz", + "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==", "cpu": [ "x64" ], @@ -878,22 +878,22 @@ } }, "node_modules/@vitest/mocker": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.3.tgz", - "integrity": "sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.5.tgz", + "integrity": "sha512-xLL3lkDegJZw+MGoGaCCsFayDZthGgpAtr3Vziyfc4p7xH89K7KRPcRBBh/kEYm0Aqkt5DtTmkYpBtRV/FrHZg==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.31", - "@vitest/spy": "5.0.3", + "@vitest/spy": "5.0.5", "estree-walker": "^3.0.3", - "magic-string": "^1.2.3" + "magic-string": "^1.4.3" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "msw": "^2.4.9", + "msw": "^2.4.9 || ^3.0.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { @@ -906,9 +906,9 @@ } }, "node_modules/@vitest/spy": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.3.tgz", - "integrity": "sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.5.tgz", + "integrity": "sha512-lwJRExuH417257Q5wv9QYugN9IMJkoxcrKrYxGPQkBzl7wlNpTUxD/5yNX4ESKVUIShKPgkGchYPFMWOOk0wzw==", "dev": true, "license": "MIT", "funding": { @@ -1096,9 +1096,9 @@ "license": "MIT" }, "node_modules/es-toolkit": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.52.0.tgz", - "integrity": "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==", + "version": "1.53.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.53.0.tgz", + "integrity": "sha512-3+AYXp9fmJ/UhHBMYj2/U+RaUouMD90SzoItyDOB2Za7W6dB7fQApFGnZPl2MF6K8/Tv1koh1JyirSx/kju6Pw==", "license": "MIT", "workspaces": [ "docs", @@ -1152,13 +1152,13 @@ } }, "node_modules/framer-motion": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-14.0.0.tgz", - "integrity": "sha512-QAtHmybrDFSliyW1sexMtSQTQd+1jw2ajibEmzpuI4XdPVzQkn+dAzJMm2sW3pl9MJuSS4xN51djQ7huhlP/VA==", + "version": "14.7.1", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-14.7.1.tgz", + "integrity": "sha512-mFDYZxyfeZnpvL/zEQEqLZNYVA/ya47c9TBfZb/PEoNBBVSVvCLkMrCv9U38cuw72W161XENZwZB0+4nIBLEJg==", "license": "MIT", "dependencies": { - "motion-dom": "14.0.0", - "motion-utils": "14.0.0", + "motion-dom": "14.7.1", + "motion-utils": "14.7.0", "tslib": "^2.4.0" }, "peerDependencies": { @@ -1190,9 +1190,9 @@ } }, "node_modules/immer": { - "version": "11.1.21", - "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.21.tgz", - "integrity": "sha512-bZSadeCPGdaY5/qRLgr6mDSH1ra21rD3rqpiWk7+QTr4ayYPTE9qZYdLh/NdPhMe0wSrTvHD/Lk8q5EwhUs0aw==", + "version": "11.2.9", + "resolved": "https://registry.npmjs.org/immer/-/immer-11.2.9.tgz", + "integrity": "sha512-IQ4UEtXjZjyefyWjtLEDXUSrF6T2hwjKPi6BIJl3bY/2XXW24d6cNGdXJSBOA/+KNnuiXkZY6DR0C3efolhitA==", "license": "MIT", "funding": { "type": "opencollective", @@ -1482,9 +1482,9 @@ } }, "node_modules/lucide-react": { - "version": "1.55.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.55.0.tgz", - "integrity": "sha512-bSozQHiI3/8q7JvgoqVRGOYUi7fYT3siAZwmZsljjsOH2Husp/2ODdFf/leD+ZC/2yKfn7r8oh6yeoR3ITR5vA==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.62.0.tgz", + "integrity": "sha512-2i8QZZhkgYMA3oJvKYpCltHh54VnT/3rIPkDLHbzr3IJQBaCz8+7j7V2k2rczYd2aCqcBaMmNlWQ2KKeDfcxmw==", "license": "ISC", "peerDependencies": { "@types/react": "*", @@ -1497,9 +1497,9 @@ } }, "node_modules/magic-string": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz", - "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", "dev": true, "license": "MIT", "dependencies": { @@ -1507,12 +1507,12 @@ } }, "node_modules/motion": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/motion/-/motion-14.0.0.tgz", - "integrity": "sha512-oGc2lkge2lkRZCP+J8/JsnYu4NFjqP1MtXirNdetn3QbvK2JqwM9A200EdT4C598KfzDhjLT12zF21xDM4Oilw==", + "version": "14.7.1", + "resolved": "https://registry.npmjs.org/motion/-/motion-14.7.1.tgz", + "integrity": "sha512-o+q7MExUC0RuCUF62HxF9v+fNVX7pUMYZqlyigQJJFAgAsmnnSlAOYeG41hGYkamxFR0rdBA0KXpaBJ28/GGAw==", "license": "MIT", "dependencies": { - "framer-motion": "14.0.0", + "framer-motion": "14.7.1", "tslib": "^2.4.0" }, "peerDependencies": { @@ -1529,18 +1529,18 @@ } }, "node_modules/motion-dom": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-14.0.0.tgz", - "integrity": "sha512-aU3ApXo1yTpeUi3JU+jbDk2TELjxPE3MbBMUP7nZHlARb6RweJK+ojmLjpuB0YsY6zhbBl1YWGo8LMsI1/Llqw==", + "version": "14.7.1", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-14.7.1.tgz", + "integrity": "sha512-p9q9F7+HoijbQjUG/cSGNmWS2t1OaAKxkd2RG5gQJRoDwoTap/Khb7K1P5rLW90crnSmx0rcRXzh3Jd5UNrpEw==", "license": "MIT", "dependencies": { - "motion-utils": "14.0.0" + "motion-utils": "14.7.0" } }, "node_modules/motion-utils": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-14.0.0.tgz", - "integrity": "sha512-jBsyjVxTTRZNeuvd/v+btVXr90LQkYl4HhRu9T2ARc+PMnvkmjsjRVeAg4Qm10b6TlTw+kykWI8gu/6LuvpLSQ==", + "version": "14.7.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-14.7.0.tgz", + "integrity": "sha512-woO0/Nb7ys75f94fjvQi/6leiHGvZUYkeHUPEZ3vxsV+9OpEVhkxp01x8MlRwX0zt31EqgXsKDAoBoJLC148Tw==", "license": "MIT" }, "node_modules/nanoid": { @@ -1563,9 +1563,9 @@ } }, "node_modules/obug": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", - "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", "dev": true, "funding": [ "https://github.com/sponsors/sxzz", @@ -1597,9 +1597,9 @@ } }, "node_modules/postcss": { - "version": "8.5.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz", - "integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==", + "version": "8.5.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", "dev": true, "funding": [ { @@ -1617,7 +1617,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.19", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" }, @@ -1626,37 +1626,37 @@ } }, "node_modules/react": { - "version": "19.3.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz", - "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "19.3.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", - "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", "license": "MIT", "dependencies": { "scheduler": "^0.28.0" }, "peerDependencies": { - "react": "^19.3.0" + "react": "^19.3.1" } }, "node_modules/react-is": { - "version": "19.3.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.0.tgz", - "integrity": "sha512-UpMYezM4v5/18F28aC66AEsjXIgE02kyEMH6yLdgLXu/UTfa1Ntwck/nNLrbqJsEXW7gPb0coNO9FQse9WTovA==", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.1.tgz", + "integrity": "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==", "license": "MIT", "peer": true }, "node_modules/react-redux": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.3.0.tgz", - "integrity": "sha512-KQopgqFo/p/fgmAs5qz6p5RWaNAzq40WAu7fJIXnQpYxFPbJYtsJPWvGeF2rOBaY/kEuV77AVsX8TsQzKm+A/g==", + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.3.1.tgz", + "integrity": "sha512-vxMLT0lalUjbZPkoTepWyKAZbjIIFssNx/CEL9lTfwQBU6XpkGSmCNdcCIrkOBUgB68uftZMnbXVb6DwGnhRKQ==", "license": "MIT", "dependencies": { "@types/use-sync-external-store": "^0.0.6", @@ -1728,13 +1728,13 @@ "license": "MIT" }, "node_modules/rolldown": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.13.tgz", - "integrity": "sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz", + "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.153.0", + "@oxc-project/types": "=0.155.0", "@rolldown/pluginutils": "^1.0.0" }, "bin": { @@ -1744,21 +1744,21 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm-eabi": "1.2.13", - "@rolldown/binding-android-arm64": "1.2.13", - "@rolldown/binding-darwin-arm64": "1.2.13", - "@rolldown/binding-darwin-x64": "1.2.13", - "@rolldown/binding-freebsd-x64": "1.2.13", - "@rolldown/binding-linux-arm-gnueabihf": "1.2.13", - "@rolldown/binding-linux-arm64-gnu": "1.2.13", - "@rolldown/binding-linux-arm64-musl": "1.2.13", - "@rolldown/binding-linux-ppc64-gnu": "1.2.13", - "@rolldown/binding-linux-s390x-gnu": "1.2.13", - "@rolldown/binding-linux-x64-gnu": "1.2.13", - "@rolldown/binding-linux-x64-musl": "1.2.13", - "@rolldown/binding-openharmony-arm64": "1.2.13", - "@rolldown/binding-win32-arm64-msvc": "1.2.13", - "@rolldown/binding-win32-x64-msvc": "1.2.13" + "@rolldown/binding-android-arm-eabi": "1.2.15", + "@rolldown/binding-android-arm64": "1.2.15", + "@rolldown/binding-darwin-arm64": "1.2.15", + "@rolldown/binding-darwin-x64": "1.2.15", + "@rolldown/binding-freebsd-x64": "1.2.15", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", + "@rolldown/binding-linux-arm64-gnu": "1.2.15", + "@rolldown/binding-linux-arm64-musl": "1.2.15", + "@rolldown/binding-linux-ppc64-gnu": "1.2.15", + "@rolldown/binding-linux-s390x-gnu": "1.2.15", + "@rolldown/binding-linux-x64-gnu": "1.2.15", + "@rolldown/binding-linux-x64-musl": "1.2.15", + "@rolldown/binding-openharmony-arm64": "1.2.15", + "@rolldown/binding-win32-arm64-msvc": "1.2.15", + "@rolldown/binding-win32-x64-msvc": "1.2.15" } }, "node_modules/scheduler": { @@ -1885,10 +1885,10 @@ } }, "node_modules/victory-vendor": { - "version": "37.3.6", - "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz", - "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==", - "license": "MIT AND ISC", + "version": "37.4.1", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.4.1.tgz", + "integrity": "sha512-geV4p2GVfVM9lgm9ZRS3pvsbAPS+BUGhM9W9nPzPHTKi+/+KjNrFXdgP6KkG+XspNZuvcXmchcrtklfuQ4gniw==", + "license": "MIT AND ISC AND BSD-3-Clause", "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", @@ -1907,16 +1907,16 @@ } }, "node_modules/vite": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz", - "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz", + "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==", "dev": true, "license": "MIT", "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", - "postcss": "^8.5.29", - "rolldown": "~1.2.12", + "postcss": "^8.5.30", + "rolldown": "~1.2.14", "tinyglobby": "^0.2.17" }, "bin": { @@ -1933,7 +1933,7 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.7.1", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", @@ -1985,23 +1985,23 @@ } }, "node_modules/vitest": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.3.tgz", - "integrity": "sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.5.tgz", + "integrity": "sha512-cPODOMF8YnkiiYtDdHo6n4wWmBrOBBbOIYH2d33M4l3CdNn72h+qMmO6uXffUN6A5AZFXNND/d+krS9mgkXRfg==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/mocker": "5.0.3", - "chai": "^6.2.2", + "@vitest/mocker": "5.0.5", + "chai": "^6.3.0", "es-module-lexer": "^2.3.2", "expect-type": "^1.4.0", - "magic-string": "^1.2.3", - "obug": "^2.1.4", + "magic-string": "^1.4.3", + "obug": "^3.0.0", "picomatch": "^4.0.7", - "std-env": "^4.2.0", - "tinybench": "^6.1.4", - "tinyexec": "^1.3.0", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", "why-is-node-running": "3.2.1" }, @@ -2018,12 +2018,12 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "5.0.3", - "@vitest/browser-preview": "5.0.3", + "@vitest/browser-playwright": "5.0.5", + "@vitest/browser-preview": "5.0.5", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", - "@vitest/coverage-istanbul": "5.0.3", - "@vitest/coverage-v8": "5.0.3", - "@vitest/ui": "5.0.3", + "@vitest/coverage-istanbul": "5.0.5", + "@vitest/coverage-v8": "5.0.5", + "@vitest/ui": "5.0.5", "happy-dom": "*", "jsdom": "*", "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" diff --git a/Tools/Dependencies/resolved-tools-lock.json b/Tools/Dependencies/resolved-tools-lock.json index ca8161cc..cb36fb81 100644 --- a/Tools/Dependencies/resolved-tools-lock.json +++ b/Tools/Dependencies/resolved-tools-lock.json @@ -1,38 +1,38 @@ { "format": "pccontroller-host-tool-lock/v1", "policy_name": "pccontroller-host-build-tools", - "resolved_at_utc": "2026-10-11T01:49:10.068Z", + "resolved_at_utc": "2026-10-28T01:23:23.736Z", "node": { - "version": "24.21.0", + "version": "24.22.1", "lts": "Krypton", - "source": "https://nodejs.org/dist/v24.21.0/", - "checksums_url": "https://nodejs.org/dist/v24.21.0/SHASUMS256.txt", - "checksums_sha256": "f410428039e2c922a14058df067a4482691c9304a5c01a75847f9f3f2d3307f6", + "source": "https://nodejs.org/dist/v24.22.1/", + "checksums_url": "https://nodejs.org/dist/v24.22.1/SHASUMS256.txt", + "checksums_sha256": "fdfbffc969c0f604beff0124d409b33a43b53f5c681d6220f80023e0d6df9dc4", "assets": [ { - "name": "node-v24.21.0-win-x64.zip", - "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-win-x64.zip", - "sha256": "158f7685b44de51f6c0df1d153526cbcd3e1bc739a8dfc607721cef75de9e541" + "name": "node-v24.22.1-win-x64.zip", + "url": "https://nodejs.org/dist/v24.22.1/node-v24.22.1-win-x64.zip", + "sha256": "d2046d28c2c3dcd211ac5145c0bf30e2047ef9dfb306693c8c6e2eccd8b95fa5" }, { - "name": "node-v24.21.0-linux-x64.tar.xz", - "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-linux-x64.tar.xz", - "sha256": "fd8e59d5a511510f6a298afb548f18c7d2b1be404d8b4a27d94fbe49f56cb2d6" + "name": "node-v24.22.1-linux-x64.tar.xz", + "url": "https://nodejs.org/dist/v24.22.1/node-v24.22.1-linux-x64.tar.xz", + "sha256": "6c172a9ab6718f7b801fb5a7bd486af2ee5e32758086a04b84fcce2aa77095e6" }, { - "name": "node-v24.21.0-linux-arm64.tar.xz", - "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-linux-arm64.tar.xz", - "sha256": "6ad1325edbdb5649c379b75a237147a666c95d4f9ae8d340fef2d1575d289ad2" + "name": "node-v24.22.1-linux-arm64.tar.xz", + "url": "https://nodejs.org/dist/v24.22.1/node-v24.22.1-linux-arm64.tar.xz", + "sha256": "dbabf7a1cbf947e6059ffad2c27b80041db97dea1e553b62afdee7f13fca336e" }, { - "name": "node-v24.21.0-darwin-x64.tar.gz", - "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-darwin-x64.tar.gz", - "sha256": "1462cb3b3046b815cf8ea436d3da450ec1a9f11dac7e5a46b0ada5305d7e8097" + "name": "node-v24.22.1-darwin-x64.tar.gz", + "url": "https://nodejs.org/dist/v24.22.1/node-v24.22.1-darwin-x64.tar.gz", + "sha256": "d132557e7ee2b85af08b0c8c34338e65c6430f2238d01f727728ef42dc83b035" }, { - "name": "node-v24.21.0-darwin-arm64.tar.gz", - "url": "https://nodejs.org/dist/v24.21.0/node-v24.21.0-darwin-arm64.tar.gz", - "sha256": "bed7eea5325e1108f32ce5228ddd6a5f0f08a499ee42aa7442aea583702f6057" + "name": "node-v24.22.1-darwin-arm64.tar.gz", + "url": "https://nodejs.org/dist/v24.22.1/node-v24.22.1-darwin-arm64.tar.gz", + "sha256": "89c682593d76cd44233fa53b1563264e7de9cbb189cad169135c5b4fadfbc0a7" } ] }, @@ -120,19 +120,19 @@ }, "windows_c_compiler": { "package_id": "BrechtSanders.WinLibs.POSIX.UCRT", - "package_version": "16.2.0-14.0.0-r1", + "package_version": "16.2.0-14.0.0-r3", "compiler": "gcc", "compiler_version": "16.2.0", "architecture": "x64", "target": "x86_64-w64-mingw32", "provenance": "winget-community-manifest", - "manifest_url": "https://raw.githubusercontent.com/microsoft/winget-pkgs/master/manifests/b/BrechtSanders/WinLibs/POSIX/UCRT/16.2.0-14.0.0-r1/BrechtSanders.WinLibs.POSIX.UCRT.installer.yaml", - "manifest_git_sha": "335054676d2475976d43181393427e8c3426b4f7", - "installer_url": "https://github.com/brechtsanders/winlibs_mingw/releases/download/16.2.0posix-14.0.0-ucrt-r1/winlibs-x86_64-posix-seh-gcc-16.2.0-mingw-w64ucrt-14.0.0-r1.zip", - "installer_sha256": "c1f52294597c0b73786b2a78eb5d176d89226d2f21875eab75e783a8b1cefcc4" + "manifest_url": "https://raw.githubusercontent.com/microsoft/winget-pkgs/master/manifests/b/BrechtSanders/WinLibs/POSIX/UCRT/16.2.0-14.0.0-r3/BrechtSanders.WinLibs.POSIX.UCRT.installer.yaml", + "manifest_git_sha": "ae9dc8258a07aa5b497638c8a0fed9badf1ec2d9", + "installer_url": "https://github.com/brechtsanders/winlibs_mingw/releases/download/16.2.0posix-23.1.3-14.0.0-ucrt-r3/winlibs-x86_64-posix-seh-gcc-16.2.0-mingw-w64ucrt-14.0.0-r3.zip", + "installer_sha256": "3c69305081e4a647144339a936244fcf7d3d9e558319e1ad7be2cd2886d4b6a1" }, "web": { - "package_lock_sha256": "0d97267c5ef5797fd91a74e444ccff932747451c33081578583ff47e9cc79783" + "package_lock_sha256": "b1aa03e0acd3d3008da70950dedd88795f080c0f0842ba52d846b0c72ca0b5cf" }, "build": { "package_lock_sha256": "323ac44b9417ec4a68487f026e41d4bc29199b7f40ded040de0d5b592318ca98" @@ -166,7 +166,7 @@ }, { "name": "actions/download-artifact", - "revision": "3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c", + "revision": "9000827ccba6bdab643e8b6fd33ac0654aef8333", "version": "v8", "workflows": [ "build.yml", @@ -199,7 +199,7 @@ }, { "name": "actions/setup-node", - "revision": "820762786026740c76f36085b0efc47a31fe5020", + "revision": "949feb2413d6458794dcd2491c4babbbce0c15c1", "version": "v7", "workflows": [ "build.yml", @@ -215,7 +215,7 @@ }, { "name": "actions/upload-artifact", - "revision": "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a", + "revision": "cf430e030ddbb5b0abf93d22962f4752f3646cd9", "version": "v7", "workflows": [ "deploy-avr.yml", @@ -227,16 +227,16 @@ }, { "name": "github/codeql-action/analyze", - "revision": "2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2", - "version": "v4.38.2", + "revision": "24c54180a607b1449ed407dd24f251e4e9147c8d", + "version": "v4.38.3", "workflows": [ "codeql.yml" ] }, { "name": "github/codeql-action/init", - "revision": "2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2", - "version": "v4.38.2", + "revision": "24c54180a607b1449ed407dd24f251e4e9147c8d", + "version": "v4.38.3", "workflows": [ "codeql.yml" ]